linear-react-components-ui 1.0.3 → 1.0.5

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 (37) hide show
  1. package/lib/assets/styles/hint.scss +9 -0
  2. package/lib/checkbox/index.js +6 -3
  3. package/lib/drawer/Content.d.ts +1 -0
  4. package/lib/drawer/Drawer.d.ts +1 -0
  5. package/lib/drawer/Drawer.js +6 -3
  6. package/lib/drawer/Header.d.ts +1 -0
  7. package/lib/drawer/helpers.d.ts +1 -0
  8. package/lib/drawer/index.d.ts +1 -0
  9. package/lib/drawer/types.d.ts +2 -1
  10. package/lib/dropdown/withDropdown.js +3 -3
  11. package/lib/hint/index.d.ts +6 -0
  12. package/lib/hint/index.js +25 -0
  13. package/lib/hint/types.d.ts +11 -0
  14. package/lib/hint/types.js +5 -0
  15. package/lib/icons/helper.d.ts +8 -0
  16. package/lib/icons/helper.js +8 -0
  17. package/lib/inputs/base/InputTextBase.js +6 -3
  18. package/lib/inputs/inputHOC.d.ts +2 -1
  19. package/lib/inputs/mask/helpers.d.ts +2 -1
  20. package/lib/inputs/mask/imaskHOC.d.ts +2 -1
  21. package/lib/inputs/number/BaseNumber.d.ts +2 -1
  22. package/lib/inputs/number/Currency.d.ts +2 -1
  23. package/lib/inputs/number/Decimal.d.ts +2 -1
  24. package/lib/inputs/number/index.d.ts +2 -1
  25. package/lib/inputs/number/types.d.ts +2 -1
  26. package/lib/inputs/search/index.d.ts +2 -1
  27. package/lib/inputs/search/index.js +14 -12
  28. package/lib/inputs/select/ActionButtons.d.ts +2 -1
  29. package/lib/inputs/select/Dropdown.d.ts +2 -1
  30. package/lib/inputs/select/helper.d.ts +2 -1
  31. package/lib/inputs/select/index.d.ts +1 -1
  32. package/lib/inputs/select/multiple/Selecteds.d.ts +1 -1
  33. package/lib/inputs/select/multiple/index.d.ts +1 -1
  34. package/lib/inputs/select/simple/index.d.ts +1 -1
  35. package/lib/inputs/select/types.d.ts +2 -7
  36. package/lib/inputs/types.d.ts +9 -3
  37. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ @import "commons.scss";
2
+
3
+ .hint-component {
4
+ @extend %hint-text;
5
+
6
+ &.-skeletonized > span {
7
+ @extend %skeleton-component;
8
+ }
9
+ }
@@ -10,6 +10,7 @@ var _gridlayout = _interopRequireDefault(require("../gridlayout"));
10
10
  var _Label = _interopRequireDefault(require("./Label"));
11
11
  require("../assets/styles/checkbox.scss");
12
12
  var _permissionValidations = require("../permissionValidations");
13
+ var _hint = _interopRequireDefault(require("../hint"));
13
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
15
  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); }
15
16
  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; }
@@ -115,9 +116,11 @@ var CheckBox = function CheckBox(_ref) {
115
116
  tooltip: tooltip,
116
117
  tooltipWidth: tooltipWidth,
117
118
  tooltipPosition: tooltipPosition
118
- })), hint && /*#__PURE__*/_react.default.createElement("div", {
119
- className: "hint"
120
- }, /*#__PURE__*/_react.default.createElement("span", null, hint)));
119
+ })), /*#__PURE__*/_react.default.createElement(_hint.default, {
120
+ visible: !!hint,
121
+ description: hint,
122
+ customClass: "hint"
123
+ }));
121
124
  };
122
125
  if (onDenied.unvisible) return null;
123
126
  return gridLayout ? /*#__PURE__*/_react.default.createElement(_gridlayout.default, {
@@ -1,6 +1,7 @@
1
1
  import { IDrawerProps } from './types.js';
2
2
  import 'react';
3
3
  import '../@types/PermissionAttr.js';
4
+ import '../@types/Position.js';
4
5
 
5
6
  declare const Content: ({ children, style }: IDrawerProps) => JSX.Element;
6
7
 
@@ -1,6 +1,7 @@
1
1
  import React__default from 'react';
2
2
  import { IDrawerProps } from './types.js';
3
3
  import '../@types/PermissionAttr.js';
4
+ import '../@types/Position.js';
4
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
7
 
@@ -26,17 +26,20 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
26
26
  var BaseDrawer = function BaseDrawer(_ref) {
27
27
  var _ref$position = _ref.position,
28
28
  position = _ref$position === void 0 ? 'left' : _ref$position,
29
- customClass = _ref.customClass,
29
+ _ref$customClass = _ref.customClass,
30
+ customClass = _ref$customClass === void 0 ? '' : _ref$customClass,
30
31
  children = _ref.children,
31
32
  style = _ref.style,
32
- customClassForContent = _ref.customClassForContent,
33
+ _ref$customClassForCo = _ref.customClassForContent,
34
+ customClassForContent = _ref$customClassForCo === void 0 ? '' : _ref$customClassForCo,
33
35
  targetId = _ref.targetId,
34
36
  closeOnEsc = _ref.closeOnEsc,
35
37
  overlay = _ref.overlay,
36
38
  permissionAttr = _ref.permissionAttr,
37
39
  skeletonize = _ref.skeletonize,
38
40
  handlerClose = _ref.handlerClose,
39
- customClassForDrawer = _ref.customClassForDrawer,
41
+ _ref$customClassForDr = _ref.customClassForDrawer,
42
+ customClassForDrawer = _ref$customClassForDr === void 0 ? '' : _ref$customClassForDr,
40
43
  content = _ref.content,
41
44
  title = _ref.title,
42
45
  rest = _objectWithoutProperties(_ref, _excluded);
@@ -1,6 +1,7 @@
1
1
  import { IDrawerHeaderProps } from './types.js';
2
2
  import 'react';
3
3
  import '../@types/PermissionAttr.js';
4
+ import '../@types/Position.js';
4
5
 
5
6
  declare const Header: ({ showCloseButton, title, subTitle, icon, titleIcon, customClass, titleContent, subTitleContent, titleRightContent, }: IDrawerHeaderProps) => JSX.Element;
6
7
 
@@ -1,6 +1,7 @@
1
1
  import React__default from 'react';
2
2
  import { IDrawerContext } from './types.js';
3
3
  import '../@types/PermissionAttr.js';
4
+ import '../@types/Position.js';
4
5
 
5
6
  declare const DrawerContext: React__default.Context<IDrawerContext>;
6
7
 
@@ -3,6 +3,7 @@ export { default as DrawerHeader } from './Header.js';
3
3
  export { default as DrawerContent } from './Content.js';
4
4
  import 'react';
5
5
  import '../@types/PermissionAttr.js';
6
+ import '../@types/Position.js';
6
7
 
7
8
  declare const _default: (props: IDrawerProps) => JSX.Element;
8
9
 
@@ -1,5 +1,6 @@
1
1
  import React__default, { ReactNode, ReactElement } from 'react';
2
2
  import { PermissionAttr } from '../@types/PermissionAttr.js';
3
+ import { Position } from '../@types/Position.js';
3
4
 
4
5
  interface IDrawerProps extends React__default.HTMLAttributes<HTMLDivElement> {
5
6
  overlay?: boolean;
@@ -7,7 +8,7 @@ interface IDrawerProps extends React__default.HTMLAttributes<HTMLDivElement> {
7
8
  customClass?: string;
8
9
  customClassForContent?: string;
9
10
  customClassForDrawer?: string;
10
- position?: string;
11
+ position?: Exclude<Position, 'center'>;
11
12
  handlerClose?: () => void;
12
13
  closeOnEsc?: boolean;
13
14
  targetId?: string;
@@ -50,9 +50,9 @@ var withDropdown = function withDropdown(WrappedComponent) {
50
50
  setOpened(dropdownOpened);
51
51
  setPrevOpened(dropdownOpened);
52
52
  }
53
- var onClickOutside = function onClickOutside(_ref) {
54
- var target = _ref.target;
55
- if (popupRef !== null && popupRef !== void 0 && popupRef.current && target !== (popupRef === null || popupRef === void 0 ? void 0 : popupRef.current) && !(popupRef !== null && popupRef !== void 0 && popupRef.current.contains(target)) && wrappedComponentRef.current !== target) {
53
+ var onClickOutside = function onClickOutside(event) {
54
+ var target = event.target;
55
+ if (popupRef !== null && popupRef !== void 0 && popupRef.current && target !== (popupRef === null || popupRef === void 0 ? void 0 : popupRef.current) && !event.composedPath().includes(popupRef.current) && wrappedComponentRef.current !== target) {
56
56
  setOpened(false);
57
57
  }
58
58
  };
@@ -0,0 +1,6 @@
1
+ import { HintProps } from './types.js';
2
+ import 'react';
3
+
4
+ declare const Hint: ({ visible, description, customClass, skeletonize, style, }: HintProps) => JSX.Element | null;
5
+
6
+ export { Hint as default };
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ require("../assets/styles/hint.scss");
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
+ var Hint = function Hint(_ref) {
11
+ var _ref$visible = _ref.visible,
12
+ visible = _ref$visible === void 0 ? true : _ref$visible,
13
+ description = _ref.description,
14
+ customClass = _ref.customClass,
15
+ _ref$skeletonize = _ref.skeletonize,
16
+ skeletonize = _ref$skeletonize === void 0 ? false : _ref$skeletonize,
17
+ style = _ref.style;
18
+ if (!visible || !description) return null;
19
+ return /*#__PURE__*/_react.default.createElement("div", {
20
+ style: style,
21
+ className: "\n hint-component\n ".concat(customClass, "\n ").concat(skeletonize ? '-skeletonized' : '', "\n ")
22
+ }, /*#__PURE__*/_react.default.createElement("span", null, description));
23
+ };
24
+ var _default = Hint;
25
+ exports.default = _default;
@@ -0,0 +1,11 @@
1
+ import { CSSProperties } from 'react';
2
+
3
+ interface HintProps {
4
+ description?: string;
5
+ visible?: boolean;
6
+ customClass?: string;
7
+ skeletonize?: boolean;
8
+ style?: CSSProperties;
9
+ }
10
+
11
+ export { HintProps };
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -555,6 +555,14 @@ declare const _default: {
555
555
  viewbox: string;
556
556
  paths: string[];
557
557
  };
558
+ products: {
559
+ viewbox: string;
560
+ paths: string[];
561
+ };
562
+ records: {
563
+ viewbox: string;
564
+ paths: string[];
565
+ };
558
566
  };
559
567
 
560
568
  export { _default as default };
@@ -560,6 +560,14 @@ var _default = {
560
560
  checkmarkCircle: {
561
561
  viewbox: '0 0 16 16',
562
562
  paths: ['M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM6.5 12.031l-2.813-3.344 1.031-1.031 1.781 1.75 5.156-4.5 0.719 0.719-5.875 6.406z']
563
+ },
564
+ products: {
565
+ viewbox: '0 0 20 16',
566
+ paths: ['M19 1v5.75c0 0.147-0.133 0.469-0.237 0.573l-7.263 7.263-6.086-6.086 7.263-7.263c0.104-0.104 0.426-0.237 0.573-0.237h5.75zM19.25 0h-6c-0.412 0-0.989 0.239-1.28 0.53l-7.439 7.439c-0.292 0.292-0.292 0.769 0 1.061l6.439 6.439c0.146 0.146 0.338 0.219 0.53 0.219s0.384-0.073 0.53-0.219l7.439-7.439c0.292-0.292 0.53-0.868 0.53-1.28v-6c0-0.412-0.337-0.75-0.75-0.75v0z', 'M17 4.5c0 0.828-0.672 1.5-1.5 1.5s-1.5-0.672-1.5-1.5c0-0.828 0.672-1.5 1.5-1.5s1.5 0.672 1.5 1.5z', 'M9.914 0h-0.664c-0.412 0-0.989 0.239-1.28 0.53l-7.439 7.439c-0.292 0.292-0.292 0.769 0 1.061l6.439 6.439c0.146 0.146 0.338 0.219 0.53 0.219s0.385-0.073 0.53-0.219l0.177-0.177-6.793-6.793 8.5-8.5z']
567
+ },
568
+ records: {
569
+ viewbox: '0 0 16 16',
570
+ paths: ['M13.75 4h-0.75v-0.75c0-0.689-0.561-1.25-1.25-1.25h-0.75v-0.75c0-0.689-0.561-1.25-1.25-1.25h-7.5c-0.689 0-1.25 0.561-1.25 1.25v9.5c0 0.689 0.561 1.25 1.25 1.25h0.75v0.75c0 0.689 0.561 1.25 1.25 1.25h0.75v0.75c0 0.689 0.561 1.25 1.25 1.25h7.5c0.689 0 1.25-0.561 1.25-1.25v-9.5c0-0.689-0.561-1.25-1.25-1.25zM2.25 11c-0.138 0-0.25-0.113-0.25-0.25v-9.5c0-0.137 0.112-0.25 0.25-0.25h7.5c0.137 0 0.25 0.113 0.25 0.25v0.75h-5.75c-0.689 0-1.25 0.561-1.25 1.25v7.75h-0.75zM4.25 13c-0.138 0-0.25-0.113-0.25-0.25v-9.5c0-0.138 0.112-0.25 0.25-0.25h7.5c0.137 0 0.25 0.112 0.25 0.25v0.75h-5.75c-0.689 0-1.25 0.561-1.25 1.25v7.75h-0.75zM14 14.75c0 0.137-0.113 0.25-0.25 0.25h-7.5c-0.138 0-0.25-0.113-0.25-0.25v-9.5c0-0.138 0.112-0.25 0.25-0.25h7.5c0.137 0 0.25 0.112 0.25 0.25v9.5z']
563
571
  }
564
572
  };
565
573
  exports.default = _default;
@@ -12,6 +12,7 @@ require("../../assets/styles/input.scss");
12
12
  var helpers = _interopRequireWildcard(require("./helpers"));
13
13
  var _withTooltip = _interopRequireDefault(require("../../internals/withTooltip"));
14
14
  var _permissionValidations = require("../../permissionValidations");
15
+ var _hint = _interopRequireDefault(require("../../hint"));
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; }
@@ -172,9 +173,11 @@ var InputTextBase = function InputTextBase(props) {
172
173
  }, type === 'textarea' ? /*#__PURE__*/_react.default.createElement("textarea", _extends({
173
174
  rows: props.rows,
174
175
  cols: props.cols
175
- }, inputProps())) : /*#__PURE__*/_react.default.createElement("input", inputProps()), children), helpers.getRightElements(errorMessages || [], skeletonize, rightElements)), hint && /*#__PURE__*/_react.default.createElement("p", {
176
- className: "hint"
177
- }, hint), errorMessages && helpers.getErrorMessages(errorMessages));
176
+ }, inputProps())) : /*#__PURE__*/_react.default.createElement("input", inputProps()), children), helpers.getRightElements(errorMessages || [], skeletonize, rightElements)), /*#__PURE__*/_react.default.createElement(_hint.default, {
177
+ visible: !!hint,
178
+ customClass: "hint",
179
+ description: hint
180
+ }), errorMessages && helpers.getErrorMessages(errorMessages));
178
181
  };
179
182
  var _default = (0, _inputHOC.default)((0, _withTooltip.default)(InputTextBase));
180
183
  exports.default = _default;
@@ -2,9 +2,10 @@ import React__default from 'react';
2
2
  import { IInputHOCProps } from './types.js';
3
3
  import '../@types/PermissionAttr.js';
4
4
  import '../@types/DataCombo.js';
5
- import './select/types.js';
6
5
  import './base/types.js';
7
6
  import '../@types/Period.js';
7
+ import '../drawer/types.js';
8
+ import '../@types/Position.js';
8
9
 
9
10
  declare const InputHOC: <ComponentProps extends IInputHOCProps>(WrappedComponent: React__default.ComponentType<ComponentProps>) => (props: ComponentProps) => JSX.Element;
10
11
 
@@ -3,9 +3,10 @@ import { IMaskHOCProps } from '../types.js';
3
3
  import 'react';
4
4
  import '../../@types/PermissionAttr.js';
5
5
  import '../../@types/DataCombo.js';
6
- import '../select/types.js';
7
6
  import '../base/types.js';
8
7
  import '../../@types/Period.js';
8
+ import '../../drawer/types.js';
9
+ import '../../@types/Position.js';
9
10
 
10
11
  declare function extractNonMaskProps(props: IMaskHOCProps, maskProps: AnyMaskedOptions): any;
11
12
  declare function CPFValidation(cpf?: string, returnMessage?: (msg: string) => void): void | "CPF inválido";
@@ -2,9 +2,10 @@ import React__default from 'react';
2
2
  import { IMaskHOCProps } from '../types.js';
3
3
  import '../../@types/PermissionAttr.js';
4
4
  import '../../@types/DataCombo.js';
5
- import '../select/types.js';
6
5
  import '../base/types.js';
7
6
  import '../../@types/Period.js';
7
+ import '../../drawer/types.js';
8
+ import '../../@types/Position.js';
8
9
 
9
10
  declare const IMaskHOC: <ComponentProps extends IMaskHOCProps>(ComposedComponent: React__default.ComponentType<ComponentProps>) => {
10
11
  (props: ComponentProps): JSX.Element;
@@ -5,7 +5,8 @@ import 'react';
5
5
  import '../../@types/Period.js';
6
6
  import '../types.js';
7
7
  import '../../@types/DataCombo.js';
8
- import '../select/types.js';
8
+ import '../../drawer/types.js';
9
+ import '../../@types/Position.js';
9
10
 
10
11
  declare const BaseNumber: (props: IBaseNumberProps) => JSX.Element;
11
12
 
@@ -5,7 +5,8 @@ import 'react';
5
5
  import '../../@types/Period.js';
6
6
  import '../types.js';
7
7
  import '../../@types/DataCombo.js';
8
- import '../select/types.js';
8
+ import '../../drawer/types.js';
9
+ import '../../@types/Position.js';
9
10
 
10
11
  declare const CurrencyField: (props: ICurrencyProps) => JSX.Element;
11
12
 
@@ -5,7 +5,8 @@ import 'react';
5
5
  import '../../@types/Period.js';
6
6
  import '../types.js';
7
7
  import '../../@types/DataCombo.js';
8
- import '../select/types.js';
8
+ import '../../drawer/types.js';
9
+ import '../../@types/Position.js';
9
10
 
10
11
  declare const DecimalField: (props: IBaseNumberProps) => JSX.Element;
11
12
 
@@ -7,7 +7,8 @@ import 'react';
7
7
  import '../../@types/Period.js';
8
8
  import '../types.js';
9
9
  import '../../@types/DataCombo.js';
10
- import '../select/types.js';
10
+ import '../../drawer/types.js';
11
+ import '../../@types/Position.js';
11
12
 
12
13
  declare const NumberField: (props: INumberFieldProps) => JSX.Element;
13
14
 
@@ -4,7 +4,8 @@ import { IMaskHOCProps } from '../types.js';
4
4
  import 'react';
5
5
  import '../../@types/Period.js';
6
6
  import '../../@types/DataCombo.js';
7
- import '../select/types.js';
7
+ import '../../drawer/types.js';
8
+ import '../../@types/Position.js';
8
9
 
9
10
  interface INumberFieldProps extends IMaskHOCProps {
10
11
  value?: string;
@@ -2,9 +2,10 @@ import { ISearchProps } from '../types.js';
2
2
  import 'react';
3
3
  import '../../@types/PermissionAttr.js';
4
4
  import '../../@types/DataCombo.js';
5
- import '../select/types.js';
6
5
  import '../base/types.js';
7
6
  import '../../@types/Period.js';
7
+ import '../../drawer/types.js';
8
+ import '../../@types/Position.js';
8
9
 
9
10
  declare const SearchField: (props: ISearchProps) => JSX.Element | null;
10
11
 
@@ -11,6 +11,7 @@ var _buttons = _interopRequireDefault(require("../../buttons"));
11
11
  var _icons = _interopRequireDefault(require("../../icons"));
12
12
  require("../../assets/styles/search.scss");
13
13
  var _drawer = _interopRequireWildcard(require("../../drawer"));
14
+ var _excluded = ["headerTitle", "content", "onStateChange"];
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; }
@@ -19,6 +20,8 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
19
20
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
20
21
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
21
22
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
+ 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; }
24
+ 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; }
22
25
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
23
26
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
24
27
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -28,7 +31,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
28
31
  var SearchField = function SearchField(props) {
29
32
  var _props$resetButton = props.resetButton,
30
33
  resetButton = _props$resetButton === void 0 ? true : _props$resetButton,
31
- advancedFilterProps = props.advancedFilterProps,
34
+ _props$advancedFilter = props.advancedFilterProps,
35
+ advancedFilterProps = _props$advancedFilter === void 0 ? {} : _props$advancedFilter,
32
36
  value = props.value;
33
37
  var _useState = (0, _react.useState)(false),
34
38
  _useState2 = _slicedToArray(_useState, 2),
@@ -42,6 +46,10 @@ var SearchField = function SearchField(props) {
42
46
  _useState6 = _slicedToArray(_useState5, 2),
43
47
  onDenied = _useState6[0],
44
48
  setOnDenied = _useState6[1];
49
+ var headerTitle = advancedFilterProps.headerTitle,
50
+ content = advancedFilterProps.content,
51
+ onStateChange = advancedFilterProps.onStateChange,
52
+ advancedFilterPropsRest = _objectWithoutProperties(advancedFilterProps, _excluded);
45
53
  var onReset = function onReset(event) {
46
54
  if (props.onReset) props.onReset(event);
47
55
  setValorCampo('');
@@ -58,10 +66,8 @@ var SearchField = function SearchField(props) {
58
66
  var shouldBeReadOnly = function shouldBeReadOnly() {
59
67
  return props.readOnly || onDenied && onDenied.readOnly;
60
68
  };
61
- var hideContent = onDenied && onDenied.hideContent;
69
+ var hideContent = onDenied === null || onDenied === void 0 ? void 0 : onDenied.hideContent;
62
70
  var buttonProps = function buttonProps() {
63
- var _ref = advancedFilterProps || {},
64
- onStateChange = _ref.onStateChange;
65
71
  var disableCallbacks = shouldBeReadOnly() || shouldDisable() || hideContent;
66
72
  var propsButton = {
67
73
  icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
@@ -91,7 +97,7 @@ var SearchField = function SearchField(props) {
91
97
  return propsButton;
92
98
  };
93
99
  var rightElements = function rightElements() {
94
- var enableFilterButton = advancedFilterProps !== undefined;
100
+ var enableFilterButton = Object.keys(advancedFilterProps).length > 0;
95
101
  var elements = [/*#__PURE__*/_react.default.createElement(_icons.default, {
96
102
  name: "search",
97
103
  color: "#a9a8a8",
@@ -113,15 +119,11 @@ var SearchField = function SearchField(props) {
113
119
  if (resetButton && valorCampo.trim() !== '') elements = [resetButtonIcon].concat(_toConsumableArray(elements));
114
120
  return elements;
115
121
  };
116
- var _ref2 = advancedFilterProps || {},
117
- headerTitle = _ref2.headerTitle,
118
- content = _ref2.content,
119
- onStateChange = _ref2.onStateChange;
120
122
  (0, _react.useEffect)(function () {
121
123
  if (value !== undefined && value !== valorCampo) {
122
124
  setValorCampo(value);
123
125
  }
124
- }, []);
126
+ }, [value]);
125
127
  if (onDenied && onDenied.unvisible) {
126
128
  return null;
127
129
  }
@@ -132,12 +134,12 @@ var SearchField = function SearchField(props) {
132
134
  customClass: "",
133
135
  handlerSetOnDenied: setOnDenied,
134
136
  rightElements: rightElements()
135
- })), advancedFilterOpened && /*#__PURE__*/_react.default.createElement(_drawer.default, {
137
+ })), advancedFilterOpened && /*#__PURE__*/_react.default.createElement(_drawer.default, _extends({
136
138
  handlerClose: function handlerClose() {
137
139
  setAdvancedFilterOpened(false);
138
140
  if (onStateChange) onStateChange(false);
139
141
  }
140
- }, headerTitle && /*#__PURE__*/_react.default.createElement(_drawer.DrawerHeader, {
142
+ }, advancedFilterPropsRest), headerTitle && /*#__PURE__*/_react.default.createElement(_drawer.DrawerHeader, {
141
143
  title: headerTitle
142
144
  }), /*#__PURE__*/_react.default.createElement(_drawer.DrawerContent, null, content)));
143
145
  };
@@ -2,9 +2,10 @@ import { IActionButtonsSelectProps } from '../types.js';
2
2
  import 'react';
3
3
  import '../../@types/PermissionAttr.js';
4
4
  import '../../@types/DataCombo.js';
5
- import './types.js';
6
5
  import '../base/types.js';
7
6
  import '../../@types/Period.js';
7
+ import '../../drawer/types.js';
8
+ import '../../@types/Position.js';
8
9
 
9
10
  declare const ActionButtons: (props: IActionButtonsSelectProps) => JSX.Element;
10
11
 
@@ -2,9 +2,10 @@ import { IDropdownSelectProps } from '../types.js';
2
2
  import 'react';
3
3
  import '../../@types/PermissionAttr.js';
4
4
  import '../../@types/DataCombo.js';
5
- import './types.js';
6
5
  import '../base/types.js';
7
6
  import '../../@types/Period.js';
7
+ import '../../drawer/types.js';
8
+ import '../../@types/Position.js';
8
9
 
9
10
  declare const Dropdown: (props: IDropdownSelectProps) => JSX.Element;
10
11
 
@@ -2,9 +2,10 @@ import { DataCombo } from '../../@types/DataCombo.js';
2
2
  import { IDropdownSelectProps } from '../types.js';
3
3
  import 'react';
4
4
  import '../../@types/PermissionAttr.js';
5
- import './types.js';
6
5
  import '../base/types.js';
7
6
  import '../../@types/Period.js';
7
+ import '../../drawer/types.js';
8
+ import '../../@types/Position.js';
8
9
 
9
10
  declare const contentClass: (props: IDropdownSelectProps) => string;
10
11
  declare const getDropdownItemCssClass: (selected: boolean, disabled: boolean, striped: boolean) => string;
@@ -1,8 +1,8 @@
1
1
  import { ISelectFieldProps } from './types.js';
2
- import 'react';
3
2
  import '../../@types/DataCombo.js';
4
3
  import '../../@types/PermissionAttr.js';
5
4
  import '../base/types.js';
5
+ import 'react';
6
6
  import '../../@types/Period.js';
7
7
 
8
8
  declare const SelectField: (props: ISelectFieldProps) => JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { ISelectedsMultipleProps } from '../types.js';
2
- import 'react';
3
2
  import '../../../@types/DataCombo.js';
4
3
  import '../../../@types/PermissionAttr.js';
5
4
  import '../../base/types.js';
5
+ import 'react';
6
6
  import '../../../@types/Period.js';
7
7
 
8
8
  declare const Selecteds: ({ currents, descriptionKey, idKey, handleOnUnselect, }: ISelectedsMultipleProps) => JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { IMultipleSelectProps } from '../types.js';
2
- import 'react';
3
2
  import '../../../@types/DataCombo.js';
4
3
  import '../../../@types/PermissionAttr.js';
5
4
  import '../../base/types.js';
5
+ import 'react';
6
6
  import '../../../@types/Period.js';
7
7
 
8
8
  declare const MultipleSelect: (props: IMultipleSelectProps) => JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { ISimpleSelectProps } from '../types.js';
2
- import 'react';
3
2
  import '../../../@types/DataCombo.js';
4
3
  import '../../../@types/PermissionAttr.js';
5
4
  import '../../base/types.js';
5
+ import 'react';
6
6
  import '../../../@types/Period.js';
7
7
 
8
8
  declare const SimpleSelect: (props: ISimpleSelectProps) => JSX.Element;
@@ -1,7 +1,7 @@
1
- import { ReactNode } from 'react';
2
1
  import { DataCombo } from '../../@types/DataCombo.js';
3
2
  import { PermissionAttr } from '../../@types/PermissionAttr.js';
4
3
  import { CustomInputEvent } from '../base/types.js';
4
+ import 'react';
5
5
  import '../../@types/Period.js';
6
6
 
7
7
  interface ISimpleSelectProps {
@@ -89,10 +89,5 @@ interface ISelectedsMultipleProps {
89
89
  currents: DataCombo[];
90
90
  handleOnUnselect: (id: string) => void;
91
91
  }
92
- interface IAdvancedFilterProps {
93
- onStateChange?: (bol?: boolean) => void;
94
- headerTitle?: string;
95
- content?: ReactNode | ReactNode[];
96
- }
97
92
 
98
- export { IAdvancedFilterProps, IMultipleSelectProps, ISelectFieldProps, ISelectedsMultipleProps, ISimpleSelectProps };
93
+ export { IMultipleSelectProps, ISelectFieldProps, ISelectedsMultipleProps, ISimpleSelectProps };
@@ -1,10 +1,16 @@
1
- import { MouseEvent, MutableRefObject, CSSProperties, ReactNode, KeyboardEvent, ReactElement } from 'react';
1
+ import { ReactNode, MouseEvent, MutableRefObject, CSSProperties, KeyboardEvent, ReactElement } from 'react';
2
2
  import { PermissionAttr, OnDenied } from '../@types/PermissionAttr.js';
3
3
  import { DataCombo } from '../@types/DataCombo.js';
4
- import { IAdvancedFilterProps } from './select/types.js';
5
4
  import { IBaseProps, CustomInputEvent } from './base/types.js';
5
+ import { IDrawerProps } from '../drawer/types.js';
6
6
  import '../@types/Period.js';
7
+ import '../@types/Position.js';
7
8
 
9
+ interface IAdvancedFilterProps extends Omit<IDrawerProps, 'content'> {
10
+ onStateChange?: (value?: boolean) => void;
11
+ headerTitle?: string;
12
+ content?: ReactNode | ReactNode[];
13
+ }
8
14
  interface ISearchProps extends IBaseProps {
9
15
  resetButton?: boolean;
10
16
  onReset?: (event?: CustomInputEvent) => void;
@@ -139,4 +145,4 @@ interface IButtonsProps {
139
145
  disabled?: boolean;
140
146
  }
141
147
 
142
- export { IActionButtonsSelectProps, IButtonsProps, IDropdownProps, IDropdownSelectProps, IInputHOCProps, IMaskHOCProps, ISearchProps };
148
+ export { IActionButtonsSelectProps, IAdvancedFilterProps, IButtonsProps, IDropdownProps, IDropdownSelectProps, IInputHOCProps, IMaskHOCProps, ISearchProps };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.cjs",