linear-react-components-ui 1.0.10-beta.1 → 1.0.10-beta.10

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 (137) hide show
  1. package/demo/06c001f4d19c06397d470bb43ff3fe49.png +0 -0
  2. package/demo/270084ef02ed3bddc3f735fd91ee3cae.png +0 -0
  3. package/demo/882f8e819d18f5f2dc08d23ebd28a7d5.png +0 -0
  4. package/demo/bundle.js +2 -0
  5. package/demo/bundle.js.LICENSE.txt +65 -0
  6. package/demo/cbc3b4bd6342c551db7afafe26dc458c.jpg +0 -0
  7. package/demo/edc9476523b940deab91951066981a31.png +0 -0
  8. package/demo/fb44e7c36db6d95bb85a745d4f060fb2.png +0 -0
  9. package/demo/fonts/Roboto-Black.woff +0 -0
  10. package/demo/fonts/Roboto-Black.woff2 +0 -0
  11. package/demo/fonts/Roboto-Bold.woff +0 -0
  12. package/demo/fonts/Roboto-Bold.woff2 +0 -0
  13. package/demo/fonts/Roboto-Light.woff +0 -0
  14. package/demo/fonts/Roboto-Light.woff2 +0 -0
  15. package/demo/fonts/Roboto-Medium.woff +0 -0
  16. package/demo/fonts/Roboto-Medium.woff2 +0 -0
  17. package/demo/fonts/Roboto-Regular.woff +0 -0
  18. package/demo/fonts/Roboto-Regular.woff2 +0 -0
  19. package/demo/fonts/Roboto-Thin.woff +0 -0
  20. package/demo/fonts/Roboto-Thin.woff2 +0 -0
  21. package/demo/fonts/TitilliumWeb-Black.woff +0 -0
  22. package/demo/fonts/TitilliumWeb-Black.woff2 +0 -0
  23. package/demo/fonts/TitilliumWeb-Bold.woff +0 -0
  24. package/demo/fonts/TitilliumWeb-Bold.woff2 +0 -0
  25. package/demo/fonts/TitilliumWeb-ExtraLight.woff +0 -0
  26. package/demo/fonts/TitilliumWeb-ExtraLight.woff2 +0 -0
  27. package/demo/fonts/TitilliumWeb-Light.woff +0 -0
  28. package/demo/fonts/TitilliumWeb-Light.woff2 +0 -0
  29. package/demo/fonts/TitilliumWeb-Regular.woff +0 -0
  30. package/demo/fonts/TitilliumWeb-Regular.woff2 +0 -0
  31. package/demo/fonts/TitilliumWeb-SemiBold.woff +0 -0
  32. package/demo/fonts/TitilliumWeb-SemiBold.woff2 +0 -0
  33. package/demo/index.html +1 -0
  34. package/lib/@types/Align.d.ts +2 -1
  35. package/lib/assets/styles/drawers.scss +9 -0
  36. package/lib/assets/styles/table.scss +30 -0
  37. package/lib/buttons/DefaultButton.js +13 -4
  38. package/lib/buttons/types.d.ts +2 -1
  39. package/lib/dialog/Alert.d.ts +1 -0
  40. package/lib/dialog/Custom.d.ts +1 -0
  41. package/lib/dialog/Error.d.ts +1 -0
  42. package/lib/dialog/Information.d.ts +1 -0
  43. package/lib/dialog/Question.d.ts +1 -0
  44. package/lib/dialog/Warning.d.ts +1 -0
  45. package/lib/dialog/base/Content.d.ts +1 -0
  46. package/lib/dialog/base/Footer.d.ts +1 -0
  47. package/lib/dialog/base/Header.d.ts +1 -0
  48. package/lib/dialog/base/index.d.ts +1 -0
  49. package/lib/dialog/form/index.d.ts +1 -0
  50. package/lib/dialog/index.d.ts +1 -0
  51. package/lib/dialog/types.d.ts +2 -1
  52. package/lib/drawer/Drawer.d.ts +1 -1
  53. package/lib/drawer/Drawer.js +22 -2
  54. package/lib/drawer/types.d.ts +1 -0
  55. package/lib/form/Field.d.ts +6 -0
  56. package/lib/form/Field.js +20 -12
  57. package/lib/form/FieldArray.d.ts +6 -0
  58. package/lib/form/FieldNumber.d.ts +6 -0
  59. package/lib/form/FieldPeriod.d.ts +6 -0
  60. package/lib/form/helpers.d.ts +6 -0
  61. package/lib/form/index.d.ts +8 -1
  62. package/lib/form/index.js +9 -1
  63. package/lib/form/types.d.ts +10 -0
  64. package/lib/form/withFieldHOC.d.ts +6 -0
  65. package/lib/form/withFormSecurity.d.ts +6 -0
  66. package/lib/form/withFormSecurity.js +2 -1
  67. package/lib/index.d.ts +1 -0
  68. package/lib/inputs/base/InputTextBase.d.ts +1 -0
  69. package/lib/inputs/base/InputTextBase.js +10 -2
  70. package/lib/inputs/base/helpers.d.ts +2 -1
  71. package/lib/inputs/base/types.d.ts +2 -1
  72. package/lib/inputs/date/Dialog.d.ts +1 -0
  73. package/lib/inputs/date/Dropdown.d.ts +1 -0
  74. package/lib/inputs/date/helpers.d.ts +1 -0
  75. package/lib/inputs/date/index.d.ts +1 -0
  76. package/lib/inputs/date/types.d.ts +1 -0
  77. package/lib/inputs/file/DefaultFile.d.ts +1 -0
  78. package/lib/inputs/file/DragDropFile.d.ts +1 -0
  79. package/lib/inputs/file/File.d.ts +1 -0
  80. package/lib/inputs/file/FileButtonSettings.d.ts +1 -0
  81. package/lib/inputs/file/helpers.d.ts +1 -0
  82. package/lib/inputs/file/index.d.ts +1 -0
  83. package/lib/inputs/file/types.d.ts +1 -0
  84. package/lib/inputs/inputHOC.d.ts +1 -0
  85. package/lib/inputs/mask/BaseMask.d.ts +1 -0
  86. package/lib/inputs/mask/Cnpj.d.ts +1 -0
  87. package/lib/inputs/mask/Cpf.d.ts +1 -0
  88. package/lib/inputs/mask/Phone.d.ts +1 -0
  89. package/lib/inputs/mask/ZipCode.d.ts +1 -0
  90. package/lib/inputs/mask/helpers.d.ts +1 -0
  91. package/lib/inputs/mask/imaskHOC.d.ts +1 -0
  92. package/lib/inputs/mask/index.d.ts +1 -0
  93. package/lib/inputs/mask/types.d.ts +2 -1
  94. package/lib/inputs/multiSelect/ActionButtons.d.ts +2 -1
  95. package/lib/inputs/multiSelect/ActionButtons.js +4 -1
  96. package/lib/inputs/multiSelect/Dropdown.d.ts +1 -0
  97. package/lib/inputs/multiSelect/Dropdown.js +1 -1
  98. package/lib/inputs/multiSelect/helper.d.ts +8 -6
  99. package/lib/inputs/multiSelect/helper.js +5 -1
  100. package/lib/inputs/multiSelect/index.d.ts +1 -0
  101. package/lib/inputs/multiSelect/index.js +5 -2
  102. package/lib/inputs/multiSelect/types.d.ts +12 -3
  103. package/lib/inputs/number/BaseNumber.d.ts +1 -0
  104. package/lib/inputs/number/Currency.d.ts +1 -0
  105. package/lib/inputs/number/Decimal.d.ts +1 -0
  106. package/lib/inputs/number/index.d.ts +1 -0
  107. package/lib/inputs/number/types.d.ts +1 -1
  108. package/lib/inputs/period/Dialog.d.ts +1 -0
  109. package/lib/inputs/period/Dropdown.d.ts +1 -0
  110. package/lib/inputs/period/PeriodList.d.ts +1 -0
  111. package/lib/inputs/period/helper.d.ts +1 -0
  112. package/lib/inputs/period/index.d.ts +1 -0
  113. package/lib/inputs/period/index.js +8 -8
  114. package/lib/inputs/period/types.d.ts +3 -2
  115. package/lib/inputs/search/index.d.ts +1 -0
  116. package/lib/inputs/select/ActionButtons.d.ts +1 -0
  117. package/lib/inputs/select/Dropdown.d.ts +1 -0
  118. package/lib/inputs/select/Dropdown.js +1 -1
  119. package/lib/inputs/select/helper.d.ts +5 -9
  120. package/lib/inputs/select/helper.js +11 -2
  121. package/lib/inputs/select/index.d.ts +1 -0
  122. package/lib/inputs/select/index.js +6 -5
  123. package/lib/inputs/select/multiple/Selecteds.d.ts +1 -0
  124. package/lib/inputs/select/multiple/Selecteds.js +1 -1
  125. package/lib/inputs/select/multiple/index.d.ts +1 -0
  126. package/lib/inputs/select/multiple/index.js +13 -10
  127. package/lib/inputs/select/simple/index.d.ts +1 -0
  128. package/lib/inputs/select/simple/index.js +8 -7
  129. package/lib/inputs/select/types.d.ts +28 -12
  130. package/lib/inputs/text/index.d.ts +1 -0
  131. package/lib/inputs/text/types.d.ts +1 -1
  132. package/lib/inputs/textarea/index.d.ts +1 -0
  133. package/lib/inputs/textarea/types.d.ts +1 -0
  134. package/lib/inputs/types.d.ts +5 -3
  135. package/lib/table/Row.js +20 -3
  136. package/lib/table/types.d.ts +5 -0
  137. package/package.json +1 -1
@@ -0,0 +1,65 @@
1
+ /*
2
+ object-assign
3
+ (c) Sindre Sorhus
4
+ @license MIT
5
+ */
6
+
7
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
8
+
9
+ /**
10
+ * @license
11
+ * Lodash <https://lodash.com/>
12
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
13
+ * Released under MIT license <https://lodash.com/license>
14
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
15
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
16
+ */
17
+
18
+ /**
19
+ * Prism: Lightweight, robust, elegant syntax highlighting
20
+ *
21
+ * @license MIT <https://opensource.org/licenses/MIT>
22
+ * @author Lea Verou <https://lea.verou.me>
23
+ * @namespace
24
+ * @public
25
+ */
26
+
27
+ /** @license React v0.19.1
28
+ * scheduler.production.min.js
29
+ *
30
+ * Copyright (c) Facebook, Inc. and its affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */
35
+
36
+ /** @license React v16.13.1
37
+ * react-is.production.min.js
38
+ *
39
+ * Copyright (c) Facebook, Inc. and its affiliates.
40
+ *
41
+ * This source code is licensed under the MIT license found in the
42
+ * LICENSE file in the root directory of this source tree.
43
+ */
44
+
45
+ /** @license React v16.14.0
46
+ * react-dom.production.min.js
47
+ *
48
+ * Copyright (c) Facebook, Inc. and its affiliates.
49
+ *
50
+ * This source code is licensed under the MIT license found in the
51
+ * LICENSE file in the root directory of this source tree.
52
+ */
53
+
54
+ /** @license React v16.14.0
55
+ * react.production.min.js
56
+ *
57
+ * Copyright (c) Facebook, Inc. and its affiliates.
58
+ *
59
+ * This source code is licensed under the MIT license found in the
60
+ * LICENSE file in the root directory of this source tree.
61
+ */
62
+
63
+ //! moment.js
64
+
65
+ //! moment.js locale configuration
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ <!doctype html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="X-UA-Compatible" content="ie=edge"><meta name="description" content="CHANGE THIS"><title>React component starter</title><script defer="defer" src="bundle.js"></script></head><body><div id="app"></div></body></html>
@@ -1,3 +1,4 @@
1
1
  type Align = 'left' | 'right' | 'center' | 'top' | 'bottom' | 'none';
2
+ type TextAlign = Extract<Align, 'left' | 'right' | 'center'>;
2
3
 
3
- export { Align };
4
+ export { Align, TextAlign };
@@ -132,6 +132,15 @@
132
132
  }
133
133
  }
134
134
  }
135
+ > .waitingspinner {
136
+ position: absolute;
137
+ top: 50%;
138
+ left: 50%;
139
+ width: 60px;
140
+ height: 60px;
141
+ margin-left: -30px;
142
+ margin-top: -30px;
143
+ }
135
144
  }
136
145
  }
137
146
 
@@ -26,12 +26,18 @@
26
26
  &.skeleton-transparency::before {
27
27
  @extend %skeleton-transparency;
28
28
  }
29
+ &.-disabled{
30
+ @extend %component-disabled;
31
+ }
29
32
  }
30
33
  > .headercontainer > .innertable > .theader > .trow,
31
34
  > .bodycontainer > .innertable > .tbody > .trow,
32
35
  > .theader > .trow,
33
36
  > .tbody > .trow {
34
37
  height: 45px;
38
+ }
39
+ > .tbody > .trow-divider {
40
+ height: 45px;
35
41
  }
36
42
  > .headercontainer > .innertable > .theader > .trow > .headercolumn,
37
43
  > .bodycontainer > .innertable > .tbody > .trow > .rowcolumn,
@@ -60,6 +66,30 @@
60
66
  background-color: $component-bg-selected-color !important;
61
67
  color: $font-selected-color;
62
68
  }
69
+ .-divider {
70
+ color: $font-color-second;
71
+ font-family: 'Titillium Web';
72
+ font-weight: 700;
73
+ font-size: 16px;
74
+ text-align: center;
75
+ padding: .35rem;
76
+ &.-primary {
77
+ background-color: $primary-color;
78
+ }
79
+ &.-warning {
80
+ background-color: $warning-color;
81
+ }
82
+ &.-danger {
83
+ background-color: $danger-color;
84
+ }
85
+ &.-success {
86
+ background-color: $success-color;
87
+ }
88
+ &.-info {
89
+ background-color: $info-color;
90
+ }
91
+ }
92
+
63
93
  &:hover {
64
94
  > .rowcolumn > .rowhover {
65
95
  display: table;
@@ -6,12 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
+ var _lodash = _interopRequireDefault(require("lodash"));
9
10
  var _icons = _interopRequireDefault(require("../../lib/icons"));
10
11
  var _withTooltip = _interopRequireDefault(require("../internals/withTooltip"));
11
12
  var _spinner = _interopRequireDefault(require("../spinner"));
12
13
  var _withDropdown = _interopRequireDefault(require("../dropdown/withDropdown"));
13
14
  var _permissionValidations = require("../permissionValidations");
14
- var _excluded = ["dropdown", "onClick", "disabled", "iconName", "icon", "targetRef", "tabIndex", "isLoading", "label", "showDropdown", "getDropdownPopup", "isDropdownOpened", "showIconDropdown", "content", "style", "toggleable", "activeIconColor", "iconStyle", "visible", "customClass", "className", "size", "iconAlign", "boxShadow", "transparent", "round", "permissionAttr", "skeletonize", "tooltipPosition", "tooltipWidth", "isFloatMenu", "dropdownAlign", "customClassForDropdown"];
15
+ var _excluded = ["dropdown", "onClick", "disabled", "iconName", "icon", "targetRef", "tabIndex", "isLoading", "label", "showDropdown", "getDropdownPopup", "isDropdownOpened", "showIconDropdown", "content", "style", "toggleable", "activeIconColor", "iconStyle", "visible", "customClass", "className", "size", "iconAlign", "boxShadow", "transparent", "round", "permissionAttr", "skeletonize", "tooltipPosition", "tooltipWidth", "isFloatMenu", "dropdownAlign", "customClassForDropdown", "buttonRef"];
15
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
17
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -63,6 +64,7 @@ var DefaultButton = function DefaultButton(_ref) {
63
64
  isFloatMenu = _ref.isFloatMenu,
64
65
  dropdownAlign = _ref.dropdownAlign,
65
66
  customClassForDropdown = _ref.customClassForDropdown,
67
+ buttonRef = _ref.buttonRef,
66
68
  rest = _objectWithoutProperties(_ref, _excluded);
67
69
  var options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
68
70
  var _useState = (0, _react.useState)(false),
@@ -72,7 +74,7 @@ var DefaultButton = function DefaultButton(_ref) {
72
74
  var _useState3 = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr)),
73
75
  _useState4 = _slicedToArray(_useState3, 1),
74
76
  onDenied = _useState4[0];
75
- var buttonRef = (0, _react.useRef)(null);
77
+ var refButton = (0, _react.useRef)(null);
76
78
  var disabledIconColor = 'rgb(193, 193, 193)';
77
79
  var shouldDisable = function shouldDisable() {
78
80
  return !!onDenied.disabled || disabled;
@@ -126,8 +128,15 @@ var DefaultButton = function DefaultButton(_ref) {
126
128
  disabled: shouldDisable(),
127
129
  className: "".concat(getClass(), " ").concat(activeButton ? '-toggleable' : '', " ").concat(skeletonize ? '-skeletonized' : ''),
128
130
  ref: function ref(r) {
131
+ if (buttonRef) {
132
+ if (!_lodash.default.isFunction(buttonRef)) {
133
+ refButton.current = r;
134
+ } else {
135
+ buttonRef(r);
136
+ }
137
+ }
129
138
  if (targetRef) targetRef(r);
130
- buttonRef.current = r;
139
+ refButton.current = r;
131
140
  },
132
141
  tabIndex: tabIndex
133
142
  }), content, getIcon(), label || '', isLoading && /*#__PURE__*/_react.default.createElement("div", {
@@ -135,7 +144,7 @@ var DefaultButton = function DefaultButton(_ref) {
135
144
  }, /*#__PURE__*/_react.default.createElement(_spinner.default, {
136
145
  align: "none",
137
146
  delayTime: 0
138
- }))), dropdown && buttonRef.current && getDropdownPopup && getDropdownPopup(buttonRef.current));
147
+ }))), dropdown && refButton.current && getDropdownPopup && getDropdownPopup(refButton.current));
139
148
  };
140
149
  var _default = (0, _withDropdown.default)((0, _withTooltip.default)(DefaultButton));
141
150
  exports.default = _default;
@@ -1,4 +1,4 @@
1
- import { ButtonHTMLAttributes, ReactNode, CSSProperties, ReactElement, MouseEvent } from 'react';
1
+ import { ButtonHTMLAttributes, ReactNode, CSSProperties, ReactElement, MutableRefObject, MouseEvent } from 'react';
2
2
  import { PermissionAttr } from '../@types/PermissionAttr.js';
3
3
  import { Position } from '../@types/Position.js';
4
4
  import { Size } from '../@types/Size.js';
@@ -16,6 +16,7 @@ interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
16
16
  iconStyle?: CSSProperties;
17
17
  boxShadow?: boolean;
18
18
  icon?: ReactElement;
19
+ buttonRef?: MutableRefObject<HTMLButtonElement | null> | ((ref: HTMLButtonElement | null) => void);
19
20
  targetRef?: (ref: HTMLButtonElement) => void;
20
21
  dropdown?: boolean;
21
22
  dropdownOnHover?: boolean;
@@ -1,5 +1,6 @@
1
1
  import { ICommonDialogProps } from './types.js';
2
2
  import 'react';
3
+ import '../@types/Align.js';
3
4
 
4
5
  declare const Alert: (props: ICommonDialogProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { ICustomProps } from './types.js';
2
2
  import 'react';
3
+ import '../@types/Align.js';
3
4
 
4
5
  declare const Custom: (props: ICustomProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { ICommonDialogProps } from './types.js';
2
2
  import 'react';
3
+ import '../@types/Align.js';
3
4
 
4
5
  declare const Error: (props: ICommonDialogProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { ICommonDialogProps } from './types.js';
2
2
  import 'react';
3
+ import '../@types/Align.js';
3
4
 
4
5
  declare const Information: (props: ICommonDialogProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { IQuestionProps } from './types.js';
2
2
  import 'react';
3
+ import '../@types/Align.js';
3
4
 
4
5
  declare const Question: (props: IQuestionProps) => JSX.Element | null;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { ICommonDialogProps } from './types.js';
2
2
  import 'react';
3
+ import '../@types/Align.js';
3
4
 
4
5
  declare const Warning: (props: ICommonDialogProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { IContentProps } from '../types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
 
4
5
  declare const Content: ({ children, styleForContent }: IContentProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { IFooterProps } from '../types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
 
4
5
  declare const Footer: (props: IFooterProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { IHeaderProps } from '../types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
 
4
5
  declare const Header: ({ showCloseButton, handlerClose, title, icon, titleIcon, }: IHeaderProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import React__default from 'react';
2
2
  import { IBaseProps } from '../types.js';
3
+ import '../../@types/Align.js';
3
4
 
4
5
  declare const BaseDialog: (props: IBaseProps) => React__default.ReactPortal;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { IFormProps } from '../types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
 
4
5
  declare const _default: (props: IFormProps) => JSX.Element;
5
6
 
@@ -7,6 +7,7 @@ export { default as DialogWarning } from './Warning.js';
7
7
  export { default as DialogCustom } from './Custom.js';
8
8
  import 'react';
9
9
  import './types.js';
10
+ import '../@types/Align.js';
10
11
 
11
12
 
12
13
 
@@ -1,4 +1,5 @@
1
1
  import { ReactNode, CSSProperties, ReactElement } from 'react';
2
+ import { TextAlign } from '../@types/Align.js';
2
3
 
3
4
  interface IContentProps {
4
5
  children: ReactNode | ReactNode[];
@@ -23,7 +24,7 @@ interface IBaseProps {
23
24
  closeOnEsc?: boolean;
24
25
  closeOnOutsideClick?: boolean;
25
26
  overlay?: boolean;
26
- textAlign?: string;
27
+ textAlign?: TextAlign;
27
28
  zIndex?: string;
28
29
  }
29
30
  interface IFormProps {
@@ -3,6 +3,6 @@ import { IDrawerProps } from './types.js';
3
3
  import '../@types/PermissionAttr.js';
4
4
  import '../@types/Position.js';
5
5
 
6
- declare const BaseDrawer: ({ position, customClass, children, style, customClassForContent, targetId, closeOnEsc, overlay, permissionAttr, skeletonize, handlerClose, customClassForDrawer, content, title, ...rest }: IDrawerProps) => React__default.ReactPortal;
6
+ declare const BaseDrawer: ({ position, customClass, children, style, customClassForContent, targetId, closeOnEsc, overlay, permissionAttr, skeletonize, handlerClose, customClassForDrawer, content, title, isWaiting, ...rest }: IDrawerProps) => React__default.ReactPortal;
7
7
 
8
8
  export { BaseDrawer as default };
@@ -10,7 +10,8 @@ var _reactDom = _interopRequireDefault(require("react-dom"));
10
10
  var _helpers = _interopRequireDefault(require("./helpers"));
11
11
  var _permissionValidations = require("../permissionValidations");
12
12
  var _ = require(".");
13
- var _excluded = ["position", "customClass", "children", "style", "customClassForContent", "targetId", "closeOnEsc", "overlay", "permissionAttr", "skeletonize", "handlerClose", "customClassForDrawer", "content", "title"];
13
+ var _spinner = _interopRequireDefault(require("../spinner"));
14
+ var _excluded = ["position", "customClass", "children", "style", "customClassForContent", "targetId", "closeOnEsc", "overlay", "permissionAttr", "skeletonize", "handlerClose", "customClassForDrawer", "content", "title", "isWaiting"];
14
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
17
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -42,6 +43,8 @@ var BaseDrawer = function BaseDrawer(_ref) {
42
43
  customClassForDrawer = _ref$customClassForDr === void 0 ? '' : _ref$customClassForDr,
43
44
  content = _ref.content,
44
45
  title = _ref.title,
46
+ _ref$isWaiting = _ref.isWaiting,
47
+ isWaiting = _ref$isWaiting === void 0 ? false : _ref$isWaiting,
45
48
  rest = _objectWithoutProperties(_ref, _excluded);
46
49
  var headerProps = _extends({}, rest, {
47
50
  title: title
@@ -53,6 +56,22 @@ var BaseDrawer = function BaseDrawer(_ref) {
53
56
  var _useState = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)([hideContent], permissionAttr)),
54
57
  _useState2 = _slicedToArray(_useState, 1),
55
58
  onDenied = _useState2[0];
59
+ var overlayStyle = isWaiting ? {
60
+ opacity: 0.4,
61
+ pointerEvent: 'none',
62
+ placeContent: 'center'
63
+ } : {};
64
+ var getSpinner = function getSpinner() {
65
+ if (!isWaiting) return null;
66
+ return /*#__PURE__*/_react.default.createElement("div", {
67
+ className: "waitingspinner"
68
+ }, /*#__PURE__*/_react.default.createElement(_spinner.default, {
69
+ style: {
70
+ width: 60
71
+ },
72
+ delayTime: 0
73
+ }));
74
+ };
56
75
  var setDrawerComponent = function setDrawerComponent(body, randonId) {
57
76
  var componentEl = document.createElement('div');
58
77
  componentEl.className = 'drawer-component';
@@ -115,11 +134,12 @@ var BaseDrawer = function BaseDrawer(_ref) {
115
134
  className: "".concat(position, " ").concat(customClass),
116
135
  style: style
117
136
  }, /*#__PURE__*/_react.default.createElement("div", {
137
+ style: overlayStyle,
118
138
  "data-testid": "drawercontent",
119
139
  className: "drawercontent ".concat(skeletonize ? '-skeletonized' : '', " ").concat(customClassForContent)
120
140
  }, title && /*#__PURE__*/_react.default.createElement(_.DrawerHeader, _extends({}, headerProps, {
121
141
  customClass: customClassForDrawer
122
- })), content ? /*#__PURE__*/_react.default.createElement(_.DrawerContent, null, content) : children)));
142
+ })), content ? /*#__PURE__*/_react.default.createElement(_.DrawerContent, null, content) : children, getSpinner())));
123
143
  };
124
144
  return /*#__PURE__*/_reactDom.default.createPortal(drawerContent(), drawerContainerEl.current);
125
145
  };
@@ -17,6 +17,7 @@ interface IDrawerProps extends React__default.HTMLAttributes<HTMLDivElement> {
17
17
  closeOnOutsideClick?: boolean;
18
18
  content?: string;
19
19
  title?: string;
20
+ isWaiting?: boolean;
20
21
  }
21
22
  interface IDrawerHeaderProps extends React__default.HTMLAttributes<HTMLDivElement> {
22
23
  showCloseButton?: boolean;
@@ -1,5 +1,11 @@
1
1
  import React__default from 'react';
2
2
  import { IFieldProps } from './types.js';
3
+ import '../inputs/select/types.js';
4
+ import '../@types/Align.js';
5
+ import '../@types/DataCombo.js';
6
+ import '../@types/PermissionAttr.js';
7
+ import '../inputs/base/types.js';
8
+ import '../@types/Period.js';
3
9
 
4
10
  declare const _default: React__default.ForwardRefExoticComponent<IFieldProps & React__default.RefAttributes<HTMLElement>>;
5
11
 
package/lib/form/Field.js CHANGED
@@ -19,12 +19,15 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
19
19
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
20
20
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
21
21
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
- var getOnBlurEvent = function getOnBlurEvent(_ref) {
23
- var name = _ref.name,
24
- validators = _ref.validators,
22
+ var getEvents = function getEvents(_ref) {
23
+ var _ref$validators = _ref.validators,
24
+ validators = _ref$validators === void 0 ? [] : _ref$validators,
25
+ name = _ref.name,
25
26
  _onBlur = _ref.onBlur,
26
27
  handlerFieldValidade = _ref.handlerFieldValidade,
27
- validatorFromComponent = _ref.validatorFromComponent;
28
+ validatorFromComponent = _ref.validatorFromComponent,
29
+ handlerFieldChange = _ref.handlerFieldChange,
30
+ _onChange = _ref.onChange;
28
31
  if (!(validators || validatorFromComponent || _onBlur)) return {};
29
32
  var validatorsArray = (0, _helpers.getValidatorsArray)(validators, validatorFromComponent);
30
33
  return {
@@ -33,6 +36,13 @@ var getOnBlurEvent = function getOnBlurEvent(_ref) {
33
36
  handlerFieldValidade(name, e.target.value, validatorsArray);
34
37
  }
35
38
  if (_onBlur) _onBlur(e);
39
+ },
40
+ onChange: function onChange(e) {
41
+ if (validatorsArray && e.target && handlerFieldValidade) {
42
+ handlerFieldValidade(name, e.target.value, validatorsArray);
43
+ }
44
+ if (handlerFieldChange) handlerFieldChange(e);
45
+ if (_onChange) _onChange(e);
36
46
  }
37
47
  };
38
48
  };
@@ -65,7 +75,7 @@ var getCustomProps = function getCustomProps(props, setValidatorFromComponent) {
65
75
  };
66
76
  var Field = function Field(props) {
67
77
  var handlerFieldChange = props.handlerFieldChange,
68
- _onChange = props.onChange;
78
+ onChange = props.onChange;
69
79
  var _useState = (0, _react.useState)(undefined),
70
80
  _useState2 = _slicedToArray(_useState, 2),
71
81
  validatorFromComponent = _useState2[0],
@@ -77,18 +87,16 @@ var Field = function Field(props) {
77
87
  handlerSetValidatorFromComponent(validatorFromComponent);
78
88
  }
79
89
  }, [validatorFromComponent]);
80
- return /*#__PURE__*/_react.default.createElement(props.component, _extends({}, props, getOnBlurEvent({
90
+ return /*#__PURE__*/_react.default.createElement(props.component, _extends({}, props, getEvents({
81
91
  name: props.name,
82
92
  validators: props.validators,
83
93
  onBlur: props.onBlur,
84
94
  validatorFromComponent: validatorFromComponent,
85
- handlerFieldValidade: props.handlerFieldValidade ? props.handlerFieldValidade : function () {}
95
+ handlerFieldValidade: props.handlerFieldValidade ? props.handlerFieldValidade : function () {},
96
+ handlerFieldChange: handlerFieldChange,
97
+ onChange: onChange
86
98
  }), getCustomProps(props, setValidatorFromComponent), {
87
- errorMessages: (0, _helpers.getErrorMessages)(props),
88
- onChange: function onChange(e) {
89
- if (handlerFieldChange) handlerFieldChange(e);
90
- if (_onChange) _onChange(e);
91
- }
99
+ errorMessages: (0, _helpers.getErrorMessages)(props)
92
100
  }));
93
101
  };
94
102
  var _default = (0, _withFieldHOC.default)(Field);
@@ -1,5 +1,11 @@
1
1
  import React__default from 'react';
2
2
  import { IFieldArrayProps } from './types.js';
3
+ import '../inputs/select/types.js';
4
+ import '../@types/Align.js';
5
+ import '../@types/DataCombo.js';
6
+ import '../@types/PermissionAttr.js';
7
+ import '../inputs/base/types.js';
8
+ import '../@types/Period.js';
3
9
 
4
10
  declare const _default: React__default.ForwardRefExoticComponent<IFieldArrayProps & React__default.RefAttributes<HTMLElement>>;
5
11
 
@@ -1,5 +1,11 @@
1
1
  import React__default from 'react';
2
2
  import { IFieldProps } from './types.js';
3
+ import '../inputs/select/types.js';
4
+ import '../@types/Align.js';
5
+ import '../@types/DataCombo.js';
6
+ import '../@types/PermissionAttr.js';
7
+ import '../inputs/base/types.js';
8
+ import '../@types/Period.js';
3
9
 
4
10
  declare const _default: React__default.ForwardRefExoticComponent<IFieldProps & React__default.RefAttributes<HTMLElement>>;
5
11
 
@@ -1,5 +1,11 @@
1
1
  import React__default from 'react';
2
2
  import { IFieldPeriodProps } from './types.js';
3
+ import '../inputs/select/types.js';
4
+ import '../@types/Align.js';
5
+ import '../@types/DataCombo.js';
6
+ import '../@types/PermissionAttr.js';
7
+ import '../inputs/base/types.js';
8
+ import '../@types/Period.js';
3
9
 
4
10
  declare const _default: React__default.ForwardRefExoticComponent<IFieldPeriodProps & React__default.RefAttributes<HTMLElement>>;
5
11
 
@@ -1,5 +1,11 @@
1
1
  import React__default from 'react';
2
2
  import { FormContextProps, IWithFieldContext, IGetErrorMessagesParams, Validator } from './types.js';
3
+ import '../inputs/select/types.js';
4
+ import '../@types/Align.js';
5
+ import '../@types/DataCombo.js';
6
+ import '../@types/PermissionAttr.js';
7
+ import '../inputs/base/types.js';
8
+ import '../@types/Period.js';
3
9
 
4
10
  declare const securityBeforeUnload = "securityBeforeUnload";
5
11
  declare const FormContext: React__default.Context<FormContextProps>;
@@ -1,9 +1,16 @@
1
1
  export { default as Field } from './Field.js';
2
2
  export { default as FieldNumber } from './FieldNumber.js';
3
3
  export { default as FieldArray } from './FieldArray.js';
4
+ export { default as FieldPeriod } from './FieldPeriod.js';
4
5
  import { IFormProps } from './types.js';
5
6
  import 'react';
7
+ import '../inputs/select/types.js';
8
+ import '../@types/Align.js';
9
+ import '../@types/DataCombo.js';
10
+ import '../@types/PermissionAttr.js';
11
+ import '../inputs/base/types.js';
12
+ import '../@types/Period.js';
6
13
 
7
- declare const Form: ({ submitOnPressEnterKey, dataSource, securityBeforeUnload, handlerReset, handlerSubmit, handlerValidates, style, customClass, securityTitle, securityText, onDataChange, onValidateForm, externalFieldErrors, onSubmit, skeletonize, disabled, children, }: IFormProps) => JSX.Element;
14
+ declare const Form: ({ submitOnPressEnterKey, dataSource, securityBeforeUnload, handlerReset, handlerSubmit, handlerValidates, style, customClass, securityTitle, securityText, securityData, onDataChange, onValidateForm, externalFieldErrors, onSubmit, skeletonize, disabled, children, }: IFormProps) => JSX.Element;
8
15
 
9
16
  export { Form as default };