linear-react-components-ui 1.0.3-beta.1 → 1.0.3-beta.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 (85) hide show
  1. package/lib/drawer/Content.d.ts +1 -0
  2. package/lib/drawer/Drawer.d.ts +1 -0
  3. package/lib/drawer/Drawer.js +6 -3
  4. package/lib/drawer/Header.d.ts +1 -0
  5. package/lib/drawer/helpers.d.ts +1 -0
  6. package/lib/drawer/index.d.ts +1 -0
  7. package/lib/drawer/types.d.ts +2 -1
  8. package/lib/inputs/base/InputTextBase.js +2 -3
  9. package/lib/inputs/base/helpers.d.ts +1 -1
  10. package/lib/inputs/base/helpers.js +1 -21
  11. package/lib/inputs/base/types.d.ts +0 -1
  12. package/lib/inputs/inputHOC.d.ts +2 -1
  13. package/lib/inputs/mask/helpers.d.ts +2 -1
  14. package/lib/inputs/mask/imaskHOC.d.ts +2 -1
  15. package/lib/inputs/multiSelect/Dropdown.js +1 -1
  16. package/lib/inputs/multiSelect/helper.d.ts +1 -1
  17. package/lib/inputs/multiSelect/helper.js +1 -1
  18. package/lib/inputs/multiSelect/index.js +1 -1
  19. package/lib/inputs/multiSelect/types.d.ts +2 -2
  20. package/lib/inputs/number/BaseNumber.d.ts +2 -1
  21. package/lib/inputs/number/Currency.d.ts +2 -1
  22. package/lib/inputs/number/Decimal.d.ts +2 -1
  23. package/lib/inputs/number/index.d.ts +2 -1
  24. package/lib/inputs/number/types.d.ts +2 -1
  25. package/lib/inputs/search/index.d.ts +2 -1
  26. package/lib/inputs/search/index.js +18 -14
  27. package/lib/inputs/select/ActionButtons.d.ts +2 -1
  28. package/lib/inputs/select/Dropdown.d.ts +2 -1
  29. package/lib/inputs/select/Dropdown.js +1 -1
  30. package/lib/inputs/select/helper.d.ts +3 -2
  31. package/lib/inputs/select/helper.js +2 -2
  32. package/lib/inputs/select/index.d.ts +1 -1
  33. package/lib/inputs/select/index.js +5 -5
  34. package/lib/inputs/select/multiple/Selecteds.d.ts +1 -1
  35. package/lib/inputs/select/multiple/Selecteds.js +1 -1
  36. package/lib/inputs/select/multiple/index.d.ts +1 -1
  37. package/lib/inputs/select/multiple/index.js +4 -2
  38. package/lib/inputs/select/simple/index.d.ts +1 -1
  39. package/lib/inputs/select/simple/index.js +5 -5
  40. package/lib/inputs/select/types.d.ts +6 -11
  41. package/lib/inputs/types.d.ts +10 -4
  42. package/lib/popover/index.js +5 -7
  43. package/lib/popover/types.d.ts +1 -2
  44. package/package.json +1 -1
  45. package/lib/alerts/alert.spec.js +0 -133
  46. package/lib/avatar/avatar.spec.js +0 -190
  47. package/lib/badge/badge.spec.js +0 -127
  48. package/lib/buttons/SpinnerLoading.js +0 -230
  49. package/lib/buttons/buttons.spec.js +0 -504
  50. package/lib/calendar/calendar.spec.js +0 -171
  51. package/lib/checkbox/checkbox.spec.js +0 -215
  52. package/lib/dialog/dialog.spec.js +0 -488
  53. package/lib/drawer/Drawer.spec.js +0 -258
  54. package/lib/dropdown/dropdown.spec.js +0 -169
  55. package/lib/fieldset/fieldset.spec.js +0 -329
  56. package/lib/form/form.spec.js +0 -293
  57. package/lib/gridlayout/gridLayout.spec.js +0 -169
  58. package/lib/icons/icons.spec.js +0 -86
  59. package/lib/inputs/base/base.spec.js +0 -690
  60. package/lib/inputs/base/index.js +0 -1
  61. package/lib/inputs/color/color_input.spec.js +0 -174
  62. package/lib/inputs/date/date.spec.js +0 -354
  63. package/lib/inputs/mask/input_mask.spec.js +0 -607
  64. package/lib/inputs/number/numberfield.spec.js +0 -215
  65. package/lib/inputs/search/search_input.spec.js +0 -209
  66. package/lib/inputs/select/select.spec.js +0 -395
  67. package/lib/inputs/text/textfield.spec.js +0 -215
  68. package/lib/inputs/textarea/textarea.spec.js +0 -59
  69. package/lib/labelMessages/labelMessages.spec.js +0 -176
  70. package/lib/labels/label.spec.js +0 -162
  71. package/lib/list/list.spec.js +0 -769
  72. package/lib/menus/float/float-menu.spec.js +0 -221
  73. package/lib/menus/sidenav/sidenav.spec.js +0 -379
  74. package/lib/panel/panel.spec.js +0 -216
  75. package/lib/popover/popover.spec.js +0 -146
  76. package/lib/progress/progress.spec.js +0 -94
  77. package/lib/radio/radio.spec.js +0 -189
  78. package/lib/spinner/spinner.spec.js +0 -152
  79. package/lib/split/split.spec.js +0 -163
  80. package/lib/table/table.spec.js +0 -352
  81. package/lib/tabs/tabs.spec.js +0 -321
  82. package/lib/toolbar/toolbar.spec.js +0 -394
  83. package/lib/tooltip/tooltip.spec.js +0 -215
  84. package/lib/treeview/treeview.spec.js +0 -279
  85. package/lib/uitour/uitour.spec.js +0 -176
@@ -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
 
@@ -46,17 +46,20 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
46
46
  var BaseDrawer = function BaseDrawer(_ref) {
47
47
  var _ref$position = _ref.position,
48
48
  position = _ref$position === void 0 ? 'left' : _ref$position,
49
- customClass = _ref.customClass,
49
+ _ref$customClass = _ref.customClass,
50
+ customClass = _ref$customClass === void 0 ? '' : _ref$customClass,
50
51
  children = _ref.children,
51
52
  style = _ref.style,
52
- customClassForContent = _ref.customClassForContent,
53
+ _ref$customClassForCo = _ref.customClassForContent,
54
+ customClassForContent = _ref$customClassForCo === void 0 ? '' : _ref$customClassForCo,
53
55
  targetId = _ref.targetId,
54
56
  closeOnEsc = _ref.closeOnEsc,
55
57
  overlay = _ref.overlay,
56
58
  permissionAttr = _ref.permissionAttr,
57
59
  skeletonize = _ref.skeletonize,
58
60
  handlerClose = _ref.handlerClose,
59
- customClassForDrawer = _ref.customClassForDrawer,
61
+ _ref$customClassForDr = _ref.customClassForDrawer,
62
+ customClassForDrawer = _ref$customClassForDr === void 0 ? '' : _ref$customClassForDr,
60
63
  content = _ref.content,
61
64
  title = _ref.title,
62
65
  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;
@@ -78,8 +78,7 @@ var InputTextBase = function InputTextBase(props) {
78
78
  _onDragOver = props.onDragOver,
79
79
  _onDrop = props.onDrop,
80
80
  _onDragLeave = props.onDragLeave,
81
- readOnlyClass = props.readOnlyClass,
82
- help = props.help;
81
+ readOnlyClass = props.readOnlyClass;
83
82
  var propsInput;
84
83
  var options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
85
84
  var onDenied = onDeniedActions || (0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr);
@@ -195,7 +194,7 @@ var InputTextBase = function InputTextBase(props) {
195
194
  }, type === 'textarea' ? /*#__PURE__*/_react.default.createElement("textarea", _extends({
196
195
  rows: props.rows,
197
196
  cols: props.cols
198
- }, inputProps())) : /*#__PURE__*/_react.default.createElement("input", inputProps()), children), helpers.getRightElements(errorMessages || [], skeletonize, help, rightElements)), hint && /*#__PURE__*/_react.default.createElement("p", {
197
+ }, inputProps())) : /*#__PURE__*/_react.default.createElement("input", inputProps()), children), helpers.getRightElements(errorMessages || [], skeletonize, rightElements)), hint && /*#__PURE__*/_react.default.createElement("p", {
199
198
  className: "hint"
200
199
  }, hint), errorMessages && helpers.getErrorMessages(errorMessages));
201
200
  };
@@ -10,6 +10,6 @@ declare const getInputClass: ({ textAlign, readOnly, readOnlyClass }: {
10
10
  }) => string;
11
11
  declare const getInputWrapperClass: (props: IBaseProps) => string;
12
12
  declare const getErrorMessages: (messages: string[]) => JSX.Element;
13
- declare const getRightElements: (errorMessages: string[], skeletonize: boolean, help?: string, rightElements?: JSX.Element | JSX.Element[]) => JSX.Element | JSX.Element[] | null;
13
+ declare const getRightElements: (errorMessages: string[], skeletonize: boolean, rightElements?: JSX.Element | JSX.Element[]) => JSX.Element | JSX.Element[] | null;
14
14
 
15
15
  export { getErrorMessages, getInputClass, getInputWrapperClass, getRightElements };
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -11,15 +9,8 @@ var _react = _interopRequireDefault(require("react"));
11
9
 
12
10
  var _lodash = _interopRequireDefault(require("lodash"));
13
11
 
14
- var _popover = _interopRequireWildcard(require("../../popover"));
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); }
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; }
19
-
20
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
13
 
22
- /* eslint-disable react/jsx-closing-tag-location */
23
14
  var getInputClass = function getInputClass(_ref) {
24
15
  var textAlign = _ref.textAlign,
25
16
  readOnly = _ref.readOnly,
@@ -49,7 +40,7 @@ var getErrorMessages = function getErrorMessages(messages) {
49
40
 
50
41
  exports.getErrorMessages = getErrorMessages;
51
42
 
52
- var getRightElements = function getRightElements(errorMessages, skeletonize, help, rightElements) {
43
+ var getRightElements = function getRightElements(errorMessages, skeletonize, rightElements) {
53
44
  var elements = rightElements || [];
54
45
  if (skeletonize) return null;
55
46
 
@@ -57,17 +48,6 @@ var getRightElements = function getRightElements(errorMessages, skeletonize, hel
57
48
  elements = [elements];
58
49
  }
59
50
 
60
- if (help) {
61
- elements.push( /*#__PURE__*/_react.default.createElement(_popover.default, {
62
- style: {
63
- width: 'auto',
64
- height: 'auto'
65
- },
66
- iconSize: 16,
67
- align: "right"
68
- }, /*#__PURE__*/_react.default.createElement(_popover.PopoverText, null, help)));
69
- }
70
-
71
51
  elements = elements.map(function (element, index) {
72
52
  return element && /*#__PURE__*/_react.default.cloneElement(element, {
73
53
  key: "rightelement-".concat(index + 1)
@@ -75,7 +75,6 @@ interface IBaseProps {
75
75
  accept?: string;
76
76
  multiple?: boolean;
77
77
  readOnlyClass?: string;
78
- help?: string;
79
78
  }
80
79
 
81
80
  export { CustomInputEvent, IBaseProps };
@@ -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;
@@ -165,7 +165,7 @@ var Dropdown = function Dropdown(props) {
165
165
  }
166
166
  }), /*#__PURE__*/_react.default.createElement("span", {
167
167
  className: "label"
168
- }, item[descriptionKey])));
168
+ }, typeof descriptionKey === 'string' ? item[descriptionKey] : descriptionKey(item))));
169
169
  })));
170
170
  };
171
171
 
@@ -2,7 +2,7 @@ import { DataCombo } from '../../@types/DataCombo.js';
2
2
 
3
3
  declare const getFilteredDataCombo: ({ dataSource, descriptionKey, inputText, }: {
4
4
  dataSource: DataCombo[];
5
- descriptionKey: string;
5
+ descriptionKey: string | ((dataSelected: DataCombo) => string);
6
6
  inputText: string;
7
7
  }) => any[];
8
8
 
@@ -10,7 +10,7 @@ var getFilteredDataCombo = function getFilteredDataCombo(_ref) {
10
10
  descriptionKey = _ref.descriptionKey,
11
11
  inputText = _ref.inputText;
12
12
  return dataSource.filter(function (item) {
13
- return item[descriptionKey].toLowerCase().indexOf(inputText.toLowerCase()) > -1;
13
+ return typeof descriptionKey === 'string' ? item[descriptionKey].toLowerCase().indexOf(inputText.toLowerCase()) > -1 : descriptionKey((item === null || item === void 0 ? void 0 : item.toLowerCase().indexOf(inputText.toLowerCase())) > -1);
14
14
  });
15
15
  };
16
16
 
@@ -233,7 +233,7 @@ var MultiSelectField = function MultiSelectField(props) {
233
233
  } else if (selecteds && selecteds.length > 1) {
234
234
  newLabel = 'Múltiplos';
235
235
  } else if (selecteds && selecteds.length === 1) {
236
- newLabel = selecteds[0][descriptionKey];
236
+ newLabel = typeof descriptionKey === 'string' ? selecteds[0][descriptionKey] : descriptionKey(selecteds[0]);
237
237
  } else {
238
238
  newLabel = 'Nenhum selecionado';
239
239
  }
@@ -14,7 +14,7 @@ interface IActionButtonsProps {
14
14
  interface IDropdownMultiSelectProps {
15
15
  dataCombo: DataCombo[];
16
16
  idKey: string;
17
- descriptionKey: string;
17
+ descriptionKey: string | ((dataSelected: DataCombo) => string);
18
18
  inputValue: string;
19
19
  isAllChecked: boolean;
20
20
  dropdownWidth: number;
@@ -38,7 +38,7 @@ interface IDropdownMultiSelectProps {
38
38
  interface IMultiSelectProps {
39
39
  dataSource: DataCombo[];
40
40
  idKey: string;
41
- descriptionKey: string;
41
+ descriptionKey: string | ((dataSelected: DataCombo) => string);
42
42
  value?: any[];
43
43
  gridLayout?: string;
44
44
  onSelect: (data?: string[]) => void;
@@ -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
 
@@ -19,6 +19,8 @@ require("../../assets/styles/search.scss");
19
19
 
20
20
  var _drawer = _interopRequireWildcard(require("../../drawer"));
21
21
 
22
+ var _excluded = ["headerTitle", "content", "onStateChange"];
23
+
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
25
 
24
26
  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); }
@@ -35,6 +37,10 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
35
37
 
36
38
  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); }
37
39
 
40
+ 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; }
41
+
42
+ 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; }
43
+
38
44
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
39
45
 
40
46
  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."); }
@@ -50,7 +56,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
50
56
  var SearchField = function SearchField(props) {
51
57
  var _props$resetButton = props.resetButton,
52
58
  resetButton = _props$resetButton === void 0 ? true : _props$resetButton,
53
- advancedFilterProps = props.advancedFilterProps,
59
+ _props$advancedFilter = props.advancedFilterProps,
60
+ advancedFilterProps = _props$advancedFilter === void 0 ? {} : _props$advancedFilter,
54
61
  value = props.value;
55
62
 
56
63
  var _useState = (0, _react.useState)(false),
@@ -68,6 +75,11 @@ var SearchField = function SearchField(props) {
68
75
  onDenied = _useState6[0],
69
76
  setOnDenied = _useState6[1];
70
77
 
78
+ var headerTitle = advancedFilterProps.headerTitle,
79
+ content = advancedFilterProps.content,
80
+ onStateChange = advancedFilterProps.onStateChange,
81
+ advancedFilterPropsRest = _objectWithoutProperties(advancedFilterProps, _excluded);
82
+
71
83
  var onReset = function onReset(event) {
72
84
  if (props.onReset) props.onReset(event);
73
85
  setValorCampo('');
@@ -88,12 +100,9 @@ var SearchField = function SearchField(props) {
88
100
  return props.readOnly || onDenied && onDenied.readOnly;
89
101
  };
90
102
 
91
- var hideContent = onDenied && onDenied.hideContent;
103
+ var hideContent = onDenied === null || onDenied === void 0 ? void 0 : onDenied.hideContent;
92
104
 
93
105
  var buttonProps = function buttonProps() {
94
- var _ref = advancedFilterProps || {},
95
- onStateChange = _ref.onStateChange;
96
-
97
106
  var disableCallbacks = shouldBeReadOnly() || shouldDisable() || hideContent;
98
107
  var propsButton = {
99
108
  icon: /*#__PURE__*/_react.default.createElement(_icons.default, {
@@ -126,7 +135,7 @@ var SearchField = function SearchField(props) {
126
135
  };
127
136
 
128
137
  var rightElements = function rightElements() {
129
- var enableFilterButton = advancedFilterProps !== undefined;
138
+ var enableFilterButton = Object.keys(advancedFilterProps).length > 0;
130
139
  var elements = [/*#__PURE__*/_react.default.createElement(_icons.default, {
131
140
  name: "search",
132
141
  color: "#a9a8a8",
@@ -152,16 +161,11 @@ var SearchField = function SearchField(props) {
152
161
  return elements;
153
162
  };
154
163
 
155
- var _ref2 = advancedFilterProps || {},
156
- headerTitle = _ref2.headerTitle,
157
- content = _ref2.content,
158
- onStateChange = _ref2.onStateChange;
159
-
160
164
  (0, _react.useEffect)(function () {
161
165
  if (value !== undefined && value !== valorCampo) {
162
166
  setValorCampo(value);
163
167
  }
164
- }, []);
168
+ }, [value]);
165
169
 
166
170
  if (onDenied && onDenied.unvisible) {
167
171
  return null;
@@ -174,12 +178,12 @@ var SearchField = function SearchField(props) {
174
178
  customClass: "",
175
179
  handlerSetOnDenied: setOnDenied,
176
180
  rightElements: rightElements()
177
- })), advancedFilterOpened && /*#__PURE__*/_react.default.createElement(_drawer.default, {
181
+ })), advancedFilterOpened && /*#__PURE__*/_react.default.createElement(_drawer.default, _extends({
178
182
  handlerClose: function handlerClose() {
179
183
  setAdvancedFilterOpened(false);
180
184
  if (onStateChange) onStateChange(false);
181
185
  }
182
- }, headerTitle && /*#__PURE__*/_react.default.createElement(_drawer.DrawerHeader, {
186
+ }, advancedFilterPropsRest), headerTitle && /*#__PURE__*/_react.default.createElement(_drawer.DrawerHeader, {
183
187
  title: headerTitle
184
188
  }), /*#__PURE__*/_react.default.createElement(_drawer.DrawerContent, null, content)));
185
189
  };
@@ -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
 
@@ -137,7 +137,7 @@ var Dropdown = function Dropdown(props) {
137
137
  }
138
138
  }), /*#__PURE__*/_react.default.createElement("span", {
139
139
  className: "label"
140
- }, item[descriptionKey])));
140
+ }, typeof descriptionKey === 'string' ? item[descriptionKey] : descriptionKey(item))));
141
141
  }), dataCombo && dataCombo.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
142
142
  className: "notfound"
143
143
  }, searchNotFoundText)));
@@ -2,15 +2,16 @@ 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;
11
12
  interface GetFilteredParams {
12
13
  dataSource: DataCombo[];
13
- descriptionKey: string;
14
+ descriptionKey: string | ((dataSelected: DataCombo) => string);
14
15
  inputText: string;
15
16
  currents: DataCombo[];
16
17
  }
@@ -26,7 +26,7 @@ var getFilteredSimpleDataCombo = function getFilteredSimpleDataCombo(_ref) {
26
26
  descriptionKey = _ref.descriptionKey,
27
27
  inputText = _ref.inputText;
28
28
  return dataSource && dataSource.filter(function (item) {
29
- return item[descriptionKey].toLowerCase().indexOf(inputText.toLowerCase()) > -1;
29
+ return typeof descriptionKey === 'string' ? item[descriptionKey].toLowerCase().indexOf(inputText.toLowerCase()) > -1 : descriptionKey((item === null || item === void 0 ? void 0 : item.toLowerCase().indexOf(inputText.toLowerCase())) > -1);
30
30
  });
31
31
  };
32
32
 
@@ -38,7 +38,7 @@ var getFilteredMultipleDataCombo = function getFilteredMultipleDataCombo(_ref2)
38
38
  descriptionKey = _ref2.descriptionKey,
39
39
  currents = _ref2.currents;
40
40
  return dataSource.filter(function (item) {
41
- return item[descriptionKey].toLowerCase().indexOf(inputText.toLowerCase()) > -1 && !currents.includes(item);
41
+ return typeof descriptionKey === 'string' ? item[descriptionKey].toLowerCase().indexOf(inputText.toLowerCase()) > -1 : descriptionKey((item === null || item === void 0 ? void 0 : item.toLowerCase().indexOf(inputText.toLowerCase())) > -1) && !currents.includes(item);
42
42
  });
43
43
  };
44
44
 
@@ -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;
@@ -7,14 +7,14 @@ exports.default = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
10
- var _simple = _interopRequireDefault(require("./simple"));
11
-
12
10
  var _multiple = _interopRequireDefault(require("./multiple"));
13
11
 
14
12
  require("../../assets/styles/select.scss");
15
13
 
16
14
  var _gridlayout = _interopRequireDefault(require("../../gridlayout"));
17
15
 
16
+ var _simple = _interopRequireDefault(require("./simple"));
17
+
18
18
  var _excluded = ["gridLayout", "multiple", "value"];
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -31,15 +31,15 @@ var SelectField = function SelectField(props) {
31
31
  value = props.value,
32
32
  newProps = _objectWithoutProperties(props, _excluded);
33
33
 
34
- var component = multiple ? /*#__PURE__*/_react.default.createElement(_multiple.default, _extends({
34
+ var component = multiple ? /*#__PURE__*/_react.default.createElement(_multiple.default, _extends({}, newProps, {
35
35
  dataSource: props.dataSource ? props.dataSource : [],
36
36
  idKey: props.idKey ? props.idKey : '',
37
37
  descriptionKey: props.descriptionKey ? props.descriptionKey : ''
38
- }, newProps)) : /*#__PURE__*/_react.default.createElement(_simple.default, _extends({
38
+ })) : /*#__PURE__*/_react.default.createElement(_simple.default, _extends({}, newProps, {
39
39
  idKey: props.idKey ? props.idKey : '',
40
40
  value: value,
41
41
  descriptionKey: props.descriptionKey ? props.descriptionKey : ''
42
- }, newProps));
42
+ }));
43
43
 
44
44
  if (gridLayout !== undefined) {
45
45
  return /*#__PURE__*/_react.default.createElement(_gridlayout.default, {
@@ -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;
@@ -18,7 +18,7 @@ var Selecteds = function Selecteds(_ref) {
18
18
  return /*#__PURE__*/_react.default.createElement("div", {
19
19
  className: "selecteditem",
20
20
  key: "selected-".concat(selected[idKey])
21
- }, selected[descriptionKey], /*#__PURE__*/_react.default.createElement("span", {
21
+ }, typeof descriptionKey === 'string' ? selected[descriptionKey] : descriptionKey(selected), /*#__PURE__*/_react.default.createElement("span", {
22
22
  className: "close",
23
23
  role: "button",
24
24
  tabIndex: -1,
@@ -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;
@@ -223,8 +223,10 @@ var MultipleSelect = function MultipleSelect(props) {
223
223
  index = dataSource && index === 0 ? dataSource.length - 1 : index - 1;
224
224
  }
225
225
 
226
- if (dataSource && dataSource.length && dataSource[index][props.descriptionKey]) {
227
- setInputValue(dataSource[index][props.descriptionKey]);
226
+ if (dataSource && dataSource.length) {
227
+ if (typeof props.descriptionKey === 'string' && dataSource[index][props.descriptionKey]) {
228
+ setInputValue(dataSource[index][props.descriptionKey]);
229
+ } else if (typeof props.descriptionKey !== 'string') setInputValue(props.descriptionKey(dataSource[index]));
228
230
  }
229
231
 
230
232
  if (dataSource) setSelected(dataSource[index]);
@@ -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;