linear-react-components-ui 1.0.10-beta.0 → 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 (139) 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/icons/helper.d.ts +12 -0
  68. package/lib/icons/helper.js +12 -0
  69. package/lib/index.d.ts +1 -0
  70. package/lib/inputs/base/InputTextBase.d.ts +1 -0
  71. package/lib/inputs/base/InputTextBase.js +10 -2
  72. package/lib/inputs/base/helpers.d.ts +2 -1
  73. package/lib/inputs/base/types.d.ts +2 -1
  74. package/lib/inputs/date/Dialog.d.ts +1 -0
  75. package/lib/inputs/date/Dropdown.d.ts +1 -0
  76. package/lib/inputs/date/helpers.d.ts +1 -0
  77. package/lib/inputs/date/index.d.ts +1 -0
  78. package/lib/inputs/date/types.d.ts +1 -0
  79. package/lib/inputs/file/DefaultFile.d.ts +1 -0
  80. package/lib/inputs/file/DragDropFile.d.ts +1 -0
  81. package/lib/inputs/file/File.d.ts +1 -0
  82. package/lib/inputs/file/FileButtonSettings.d.ts +1 -0
  83. package/lib/inputs/file/helpers.d.ts +1 -0
  84. package/lib/inputs/file/index.d.ts +1 -0
  85. package/lib/inputs/file/types.d.ts +1 -0
  86. package/lib/inputs/inputHOC.d.ts +1 -0
  87. package/lib/inputs/mask/BaseMask.d.ts +1 -0
  88. package/lib/inputs/mask/Cnpj.d.ts +1 -0
  89. package/lib/inputs/mask/Cpf.d.ts +1 -0
  90. package/lib/inputs/mask/Phone.d.ts +1 -0
  91. package/lib/inputs/mask/ZipCode.d.ts +1 -0
  92. package/lib/inputs/mask/helpers.d.ts +1 -0
  93. package/lib/inputs/mask/imaskHOC.d.ts +1 -0
  94. package/lib/inputs/mask/index.d.ts +1 -0
  95. package/lib/inputs/mask/types.d.ts +2 -1
  96. package/lib/inputs/multiSelect/ActionButtons.d.ts +2 -1
  97. package/lib/inputs/multiSelect/ActionButtons.js +4 -1
  98. package/lib/inputs/multiSelect/Dropdown.d.ts +1 -0
  99. package/lib/inputs/multiSelect/Dropdown.js +1 -1
  100. package/lib/inputs/multiSelect/helper.d.ts +8 -6
  101. package/lib/inputs/multiSelect/helper.js +5 -1
  102. package/lib/inputs/multiSelect/index.d.ts +1 -0
  103. package/lib/inputs/multiSelect/index.js +5 -2
  104. package/lib/inputs/multiSelect/types.d.ts +12 -3
  105. package/lib/inputs/number/BaseNumber.d.ts +1 -0
  106. package/lib/inputs/number/Currency.d.ts +1 -0
  107. package/lib/inputs/number/Decimal.d.ts +1 -0
  108. package/lib/inputs/number/index.d.ts +1 -0
  109. package/lib/inputs/number/types.d.ts +1 -1
  110. package/lib/inputs/period/Dialog.d.ts +1 -0
  111. package/lib/inputs/period/Dropdown.d.ts +1 -0
  112. package/lib/inputs/period/PeriodList.d.ts +1 -0
  113. package/lib/inputs/period/helper.d.ts +1 -0
  114. package/lib/inputs/period/index.d.ts +1 -0
  115. package/lib/inputs/period/index.js +8 -8
  116. package/lib/inputs/period/types.d.ts +3 -2
  117. package/lib/inputs/search/index.d.ts +1 -0
  118. package/lib/inputs/select/ActionButtons.d.ts +1 -0
  119. package/lib/inputs/select/Dropdown.d.ts +1 -0
  120. package/lib/inputs/select/Dropdown.js +1 -1
  121. package/lib/inputs/select/helper.d.ts +5 -9
  122. package/lib/inputs/select/helper.js +11 -2
  123. package/lib/inputs/select/index.d.ts +1 -0
  124. package/lib/inputs/select/index.js +6 -5
  125. package/lib/inputs/select/multiple/Selecteds.d.ts +1 -0
  126. package/lib/inputs/select/multiple/Selecteds.js +1 -1
  127. package/lib/inputs/select/multiple/index.d.ts +1 -0
  128. package/lib/inputs/select/multiple/index.js +13 -10
  129. package/lib/inputs/select/simple/index.d.ts +1 -0
  130. package/lib/inputs/select/simple/index.js +8 -7
  131. package/lib/inputs/select/types.d.ts +28 -12
  132. package/lib/inputs/text/index.d.ts +1 -0
  133. package/lib/inputs/text/types.d.ts +1 -1
  134. package/lib/inputs/textarea/index.d.ts +1 -0
  135. package/lib/inputs/textarea/types.d.ts +1 -0
  136. package/lib/inputs/types.d.ts +5 -3
  137. package/lib/table/Row.js +20 -3
  138. package/lib/table/types.d.ts +5 -0
  139. package/package.json +1 -1
@@ -4,6 +4,7 @@ import { INumberFieldProps } from './types.js';
4
4
  import '../../@types/PermissionAttr.js';
5
5
  import '../base/types.js';
6
6
  import 'react';
7
+ import '../../@types/Align.js';
7
8
  import '../../@types/Period.js';
8
9
  import '../types.js';
9
10
  import '../../@types/DataCombo.js';
@@ -2,6 +2,7 @@ import { PermissionAttr } from '../../@types/PermissionAttr.js';
2
2
  import { CustomInputEvent } from '../base/types.js';
3
3
  import { IMaskHOCProps } from '../types.js';
4
4
  import 'react';
5
+ import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
7
  import '../../@types/DataCombo.js';
7
8
  import '../../drawer/types.js';
@@ -9,7 +10,6 @@ import '../../@types/Position.js';
9
10
 
10
11
  interface INumberFieldProps extends IMaskHOCProps {
11
12
  value?: string;
12
- textAlign?: string;
13
13
  permissionAttr?: PermissionAttr;
14
14
  disabled?: boolean;
15
15
  onChange?: (e?: CustomInputEvent, maskValue?: string, date?: string | {
@@ -5,6 +5,7 @@ import '../../@types/ColorStyles.js';
5
5
  import '../../@types/Period.js';
6
6
  import '../../@types/PermissionAttr.js';
7
7
  import '../base/types.js';
8
+ import '../../@types/Align.js';
8
9
 
9
10
  declare const Dialog: ({ handlerClose, children, dialogSize }: IDialogProps) => JSX.Element;
10
11
 
@@ -5,6 +5,7 @@ import '../../@types/ColorStyles.js';
5
5
  import '../../@types/Period.js';
6
6
  import '../../@types/PermissionAttr.js';
7
7
  import '../base/types.js';
8
+ import '../../@types/Align.js';
8
9
 
9
10
  declare const Dropdown: (props: IPeriodDropdownProps) => React.ReactPortal;
10
11
 
@@ -5,6 +5,7 @@ import '../../@types/ColorStyles.js';
5
5
  import '../../@types/Period.js';
6
6
  import '../../@types/PermissionAttr.js';
7
7
  import '../base/types.js';
8
+ import '../../@types/Align.js';
8
9
 
9
10
  declare const PeriodList: ({ selected, handleOnSelect }: IPeriodListProps) => JSX.Element;
10
11
 
@@ -5,6 +5,7 @@ import '../../@types/ColorStyles.js';
5
5
  import '../../@types/Period.js';
6
6
  import '../../@types/PermissionAttr.js';
7
7
  import '../base/types.js';
8
+ import '../../@types/Align.js';
8
9
 
9
10
  declare const getCalendarDropdownStyle: ({ topPosition, leftPosition, width }: {
10
11
  topPosition: number | string;
@@ -5,6 +5,7 @@ import '../../@types/ColorStyles.js';
5
5
  import '../../@types/Period.js';
6
6
  import '../../@types/PermissionAttr.js';
7
7
  import '../base/types.js';
8
+ import '../../@types/Align.js';
8
9
 
9
10
  declare const PeriodPicker: (props: IPeriodPickerProps) => JSX.Element | null;
10
11
 
@@ -42,11 +42,11 @@ var PeriodPicker = function PeriodPicker(props) {
42
42
  height: '350px'
43
43
  } : _props$dialogSize,
44
44
  calendarColorStyle = props.calendarColorStyle;
45
- var _useState = (0, _react.useState)(props.value && props.value.valueInitial ? (0, _moment.default)(props.value.valueInitial) : undefined),
45
+ var _useState = (0, _react.useState)(props.value && props.value.initial ? (0, _moment.default)(props.value.initial) : undefined),
46
46
  _useState2 = _slicedToArray(_useState, 2),
47
47
  valueInitial = _useState2[0],
48
48
  setValueInitial = _useState2[1];
49
- var _useState3 = (0, _react.useState)(props.value && props.value.valueFinal ? (0, _moment.default)(props.value.valueFinal) : undefined),
49
+ var _useState3 = (0, _react.useState)(props.value && props.value.final ? (0, _moment.default)(props.value.final) : undefined),
50
50
  _useState4 = _slicedToArray(_useState3, 2),
51
51
  valueFinal = _useState4[0],
52
52
  setValueFinal = _useState4[1];
@@ -119,10 +119,10 @@ var PeriodPicker = function PeriodPicker(props) {
119
119
  }
120
120
  }, [valueInitial, valueFinal]);
121
121
  (0, _react.useEffect)(function () {
122
- if (props.value) {
122
+ if (props.value && !((0, _moment.default)(props.value.initial).isSame(valueInitial) || (0, _moment.default)(props.value.final).isSame(valueFinal))) {
123
123
  var _props$value = props.value,
124
- valueInitialProp = _props$value.valueInitial,
125
- valueFinalProp = _props$value.valueFinal;
124
+ valueInitialProp = _props$value.initial,
125
+ valueFinalProp = _props$value.final;
126
126
  var newValueInitial;
127
127
  var newValueFinal;
128
128
  if ((0, _moment.default)(valueInitialProp, 'YYYY-MM-DD', true).isValid()) {
@@ -134,7 +134,7 @@ var PeriodPicker = function PeriodPicker(props) {
134
134
  setValueInitial(newValueInitial);
135
135
  setValueFinal(newValueFinal);
136
136
  }
137
- }, [(_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.valueInitial, (_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.valueFinal]);
137
+ }, [(_props$value2 = props.value) === null || _props$value2 === void 0 ? void 0 : _props$value2.initial, (_props$value3 = props.value) === null || _props$value3 === void 0 ? void 0 : _props$value3.final]);
138
138
  var openCalendar = function openCalendar() {
139
139
  setShowCalendar(true);
140
140
  setShowPeriodSelection(false);
@@ -162,7 +162,7 @@ var PeriodPicker = function PeriodPicker(props) {
162
162
  }
163
163
  };
164
164
  var setValue = function setValue(e, value) {
165
- var sholdOpenDropdown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
165
+ var shouldOpenDropdown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
166
166
  var changingAux = e ? e.target.name : '';
167
167
  var dateObj = (0, _moment.default)(value, 'DD/MM/YYYY');
168
168
  if (changingAux === 'valueInitial') {
@@ -170,7 +170,7 @@ var PeriodPicker = function PeriodPicker(props) {
170
170
  } else {
171
171
  setValueFinal(dateObj);
172
172
  }
173
- if (changingAux === 'valueInitial' && !valueFinal && sholdOpenDropdown) {
173
+ if (changingAux === 'valueInitial' && !valueFinal && shouldOpenDropdown) {
174
174
  var _inputFinalRef$curren;
175
175
  if (valueFinal) setChanging(valueFinal);
176
176
  setShowCalendar(false);
@@ -4,6 +4,7 @@ import { ColorStyles } from '../../@types/ColorStyles.js';
4
4
  import { Period } from '../../@types/Period.js';
5
5
  import { PermissionAttr } from '../../@types/PermissionAttr.js';
6
6
  import { CustomInputEvent } from '../base/types.js';
7
+ import '../../@types/Align.js';
7
8
 
8
9
  type DateTypes = 'today' | 'week' | 'lastweek' | 'last15' | 'month' | 'lastmonth';
9
10
  interface IPeriodOptions {
@@ -29,8 +30,8 @@ interface IPeriodDropdownProps {
29
30
  interface IPeriodPickerProps {
30
31
  label?: string;
31
32
  value?: {
32
- valueInitial?: Moment | string;
33
- valueFinal?: Moment | string;
33
+ initial?: Moment | string;
34
+ final?: Moment | string;
34
35
  };
35
36
  customClassForLabel?: string;
36
37
  labelUppercase?: boolean;
@@ -3,6 +3,7 @@ import 'react';
3
3
  import '../../@types/PermissionAttr.js';
4
4
  import '../../@types/DataCombo.js';
5
5
  import '../base/types.js';
6
+ import '../../@types/Align.js';
6
7
  import '../../@types/Period.js';
7
8
  import '../../drawer/types.js';
8
9
  import '../../@types/Position.js';
@@ -3,6 +3,7 @@ import 'react';
3
3
  import '../../@types/PermissionAttr.js';
4
4
  import '../../@types/DataCombo.js';
5
5
  import '../base/types.js';
6
+ import '../../@types/Align.js';
6
7
  import '../../@types/Period.js';
7
8
  import '../../drawer/types.js';
8
9
  import '../../@types/Position.js';
@@ -3,6 +3,7 @@ import 'react';
3
3
  import '../../@types/PermissionAttr.js';
4
4
  import '../../@types/DataCombo.js';
5
5
  import '../base/types.js';
6
+ import '../../@types/Align.js';
6
7
  import '../../@types/Period.js';
7
8
  import '../../drawer/types.js';
8
9
  import '../../@types/Position.js';
@@ -118,7 +118,7 @@ var Dropdown = function Dropdown(props) {
118
118
  }
119
119
  }), /*#__PURE__*/_react.default.createElement("span", {
120
120
  className: "label"
121
- }, item[descriptionKey])));
121
+ }, typeof descriptionKey === 'string' ? item[descriptionKey] : descriptionKey(item))));
122
122
  }), dataCombo && dataCombo.length === 0 && /*#__PURE__*/_react.default.createElement("div", {
123
123
  className: "notfound"
124
124
  }, searchNotFoundText)));
@@ -1,22 +1,18 @@
1
- import { DataCombo } from '../../@types/DataCombo.js';
2
1
  import { IDropdownSelectProps } from '../types.js';
2
+ import { GetSimpleFilteredParams, GetMultipleFilteredParams } from './types.js';
3
3
  import 'react';
4
4
  import '../../@types/PermissionAttr.js';
5
+ import '../../@types/DataCombo.js';
5
6
  import '../base/types.js';
7
+ import '../../@types/Align.js';
6
8
  import '../../@types/Period.js';
7
9
  import '../../drawer/types.js';
8
10
  import '../../@types/Position.js';
9
11
 
10
12
  declare const contentClass: (props: IDropdownSelectProps) => string;
11
13
  declare const getDropdownItemCssClass: (selected: boolean, disabled: boolean, striped: boolean) => string;
12
- interface GetFilteredParams {
13
- dataSource: DataCombo[];
14
- descriptionKey: string;
15
- inputText: string;
16
- currents: DataCombo[];
17
- }
18
- declare const getFilteredSimpleDataCombo: ({ dataSource, descriptionKey, inputText, }: Omit<GetFilteredParams, 'currents'>) => any[];
19
- declare const getFilteredMultipleDataCombo: ({ dataSource, inputText, descriptionKey, currents, }: GetFilteredParams) => any[];
14
+ declare const getFilteredSimpleDataCombo: ({ dataSource, descriptionKey, inputText, }: Omit<GetSimpleFilteredParams, 'currents'>) => any[];
15
+ declare const getFilteredMultipleDataCombo: ({ dataSource, inputText, descriptionKey, currents, }: GetMultipleFilteredParams) => any[];
20
16
  declare const returnDropdownDynamicStyles: ({ selectFieldRef, dropdownMaxHeight, dropdownRef }: IDropdownSelectProps) => {
21
17
  maxHeight: number;
22
18
  top: number;
@@ -21,7 +21,12 @@ var getFilteredSimpleDataCombo = function getFilteredSimpleDataCombo(_ref) {
21
21
  descriptionKey = _ref.descriptionKey,
22
22
  inputText = _ref.inputText;
23
23
  return dataSource && dataSource.filter(function (item) {
24
- return item[descriptionKey].toLowerCase().indexOf(inputText.toLowerCase()) > -1;
24
+ var _descriptionKey;
25
+ if (typeof descriptionKey === 'string') {
26
+ var _item$descriptionKey;
27
+ return ((_item$descriptionKey = item[descriptionKey]) === null || _item$descriptionKey === void 0 ? void 0 : _item$descriptionKey.toLowerCase().indexOf(inputText === null || inputText === void 0 ? void 0 : inputText.toString().toLowerCase())) > -1;
28
+ }
29
+ return ((_descriptionKey = descriptionKey(item)) === null || _descriptionKey === void 0 ? void 0 : _descriptionKey.toLowerCase().indexOf(inputText === null || inputText === void 0 ? void 0 : inputText.toString().toLowerCase())) > -1;
25
30
  });
26
31
  };
27
32
  exports.getFilteredSimpleDataCombo = getFilteredSimpleDataCombo;
@@ -31,7 +36,11 @@ var getFilteredMultipleDataCombo = function getFilteredMultipleDataCombo(_ref2)
31
36
  descriptionKey = _ref2.descriptionKey,
32
37
  currents = _ref2.currents;
33
38
  return dataSource.filter(function (item) {
34
- return item[descriptionKey].toLowerCase().indexOf(inputText.toLowerCase()) > -1 && !currents.includes(item);
39
+ var _descriptionKey2;
40
+ if (typeof descriptionKey === 'string') {
41
+ return item[descriptionKey].toLowerCase().indexOf(inputText === null || inputText === void 0 ? void 0 : inputText.toString().toLowerCase()) > -1 && !currents.includes(item);
42
+ }
43
+ return ((_descriptionKey2 = descriptionKey(item)) === null || _descriptionKey2 === void 0 ? void 0 : _descriptionKey2.toLowerCase().indexOf(inputText === null || inputText === void 0 ? void 0 : inputText.toString().toLowerCase())) > -1 && !currents.includes(item);
35
44
  });
36
45
  };
37
46
  exports.getFilteredMultipleDataCombo = getFilteredMultipleDataCombo;
@@ -1,4 +1,5 @@
1
1
  import { ISelectFieldProps } from './types.js';
2
+ import '../../@types/Align.js';
2
3
  import '../../@types/DataCombo.js';
3
4
  import '../../@types/PermissionAttr.js';
4
5
  import '../base/types.js';
@@ -5,10 +5,10 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
- var _simple = _interopRequireDefault(require("./simple"));
9
8
  var _multiple = _interopRequireDefault(require("./multiple"));
10
9
  require("../../assets/styles/select.scss");
11
10
  var _gridlayout = _interopRequireDefault(require("../../gridlayout"));
11
+ var _simple = _interopRequireDefault(require("./simple"));
12
12
  var _excluded = ["gridLayout", "multiple", "value"];
13
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
14
  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); }
@@ -19,15 +19,16 @@ var SelectField = function SelectField(props) {
19
19
  multiple = props.multiple,
20
20
  value = props.value,
21
21
  newProps = _objectWithoutProperties(props, _excluded);
22
- var component = multiple ? /*#__PURE__*/_react.default.createElement(_multiple.default, _extends({
22
+ var component = multiple ? /*#__PURE__*/_react.default.createElement(_multiple.default, _extends({}, newProps, {
23
23
  dataSource: props.dataSource ? props.dataSource : [],
24
24
  idKey: props.idKey ? props.idKey : '',
25
+ value: Array.isArray(value) ? value : undefined,
25
26
  descriptionKey: props.descriptionKey ? props.descriptionKey : ''
26
- }, newProps)) : /*#__PURE__*/_react.default.createElement(_simple.default, _extends({
27
+ })) : /*#__PURE__*/_react.default.createElement(_simple.default, _extends({}, newProps, {
27
28
  idKey: props.idKey ? props.idKey : '',
28
- value: value,
29
+ value: !Array.isArray(value) ? value : undefined,
29
30
  descriptionKey: props.descriptionKey ? props.descriptionKey : ''
30
- }, newProps));
31
+ }));
31
32
  if (gridLayout !== undefined) {
32
33
  return /*#__PURE__*/_react.default.createElement(_gridlayout.default, {
33
34
  customClass: "-withinput",
@@ -1,4 +1,5 @@
1
1
  import { ISelectedsMultipleProps } from '../types.js';
2
+ import '../../../@types/Align.js';
2
3
  import '../../../@types/DataCombo.js';
3
4
  import '../../../@types/PermissionAttr.js';
4
5
  import '../../base/types.js';
@@ -15,7 +15,7 @@ var Selecteds = function Selecteds(_ref) {
15
15
  return /*#__PURE__*/_react.default.createElement("div", {
16
16
  className: "selecteditem",
17
17
  key: "selected-".concat(selected[idKey])
18
- }, selected[descriptionKey], /*#__PURE__*/_react.default.createElement("span", {
18
+ }, typeof descriptionKey === 'string' ? selected[descriptionKey] : descriptionKey(selected), /*#__PURE__*/_react.default.createElement("span", {
19
19
  className: "close",
20
20
  role: "button",
21
21
  tabIndex: -1,
@@ -1,4 +1,5 @@
1
1
  import { IMultipleSelectProps } from '../types.js';
2
+ import '../../../@types/Align.js';
2
3
  import '../../../@types/DataCombo.js';
3
4
  import '../../../@types/PermissionAttr.js';
4
5
  import '../../base/types.js';
@@ -50,7 +50,7 @@ var MultipleSelect = function MultipleSelect(props) {
50
50
  _useState6 = _slicedToArray(_useState5, 2),
51
51
  selected = _useState6[0],
52
52
  setSelected = _useState6[1];
53
- var _useState7 = (0, _react.useState)(''),
53
+ var _useState7 = (0, _react.useState)([]),
54
54
  _useState8 = _slicedToArray(_useState7, 2),
55
55
  inputValue = _useState8[0],
56
56
  setInputValue = _useState8[1];
@@ -79,6 +79,7 @@ var MultipleSelect = function MultipleSelect(props) {
79
79
  var dropdownRef = (0, _react.useRef)(null);
80
80
  var selectWrapper = (0, _react.useRef)();
81
81
  var gridElRef = (0, _react.useRef)();
82
+ var descriptionKeyIsString = typeof descriptionKey === 'string';
82
83
  var onScreenResize = function onScreenResize() {
83
84
  if (selectWrapper.current) setDropdownWidth(selectWrapper.current.clientWidth);
84
85
  };
@@ -104,12 +105,12 @@ var MultipleSelect = function MultipleSelect(props) {
104
105
  if (remoteSearch) {
105
106
  if (props.onSearch) props.onSearch(filteredValue);
106
107
  setOpened(true);
107
- setInputValue(filteredValue);
108
+ setInputValue([filteredValue]);
108
109
  } else {
109
110
  var dataComboFilter = dataSource;
110
- if (filteredValue !== '') {
111
+ if (filteredValue.length > 0) {
111
112
  dataComboFilter = (0, _helper.getFilteredMultipleDataCombo)({
112
- inputText: filteredValue,
113
+ inputText: [filteredValue],
113
114
  dataSource: dataSource,
114
115
  descriptionKey: descriptionKey,
115
116
  currents: currents
@@ -119,7 +120,7 @@ var MultipleSelect = function MultipleSelect(props) {
119
120
  setDataCombo(dataComboFilter);
120
121
  setOpened(true);
121
122
  if (selectedFilter) setSelected(selectedFilter);
122
- setInputValue(filteredValue);
123
+ setInputValue([filteredValue]);
123
124
  }
124
125
  };
125
126
  var onSelect = function onSelect(select) {
@@ -127,7 +128,7 @@ var MultipleSelect = function MultipleSelect(props) {
127
128
  var currentsSelect = [].concat(_toConsumableArray(currents), [select]);
128
129
  setCurrents(currentsSelect);
129
130
  setDataCombo(dataSource);
130
- setInputValue('');
131
+ setInputValue([]);
131
132
  setOpened(false);
132
133
  if (props.onSelect) setSelected(props.onSelect(currentsSelect.map(function (i) {
133
134
  return i[idKey];
@@ -171,12 +172,14 @@ var MultipleSelect = function MultipleSelect(props) {
171
172
  } else {
172
173
  index = dataSource && index === 0 ? dataSource.length - 1 : index - 1;
173
174
  }
174
- if (dataSource && dataSource.length && dataSource[index][props.descriptionKey]) {
175
- setInputValue(dataSource[index][props.descriptionKey]);
175
+ if (dataSource && dataSource.length) {
176
+ if (descriptionKeyIsString && dataSource[index][descriptionKey]) {
177
+ setInputValue(dataSource[index][descriptionKey]);
178
+ } else if (!descriptionKeyIsString) setInputValue([descriptionKey(dataSource[index])]);
176
179
  }
177
180
  if (dataSource) setSelected(dataSource[index]);
178
181
  } else if (e.keyCode === constants.keyCodes.BACKSPACE) {
179
- if (inputValue === '') {
182
+ if (inputValue.length === 0) {
180
183
  var currentsKeyDown = _lodash.default.dropRight(currents);
181
184
  setCurrents(currentsKeyDown);
182
185
  if (props.onSelect) props.onSelect(currentsKeyDown.map(function (i) {
@@ -238,7 +241,7 @@ var MultipleSelect = function MultipleSelect(props) {
238
241
  ref: componentRef,
239
242
  className: "select-component"
240
243
  }, /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({}, props, {
241
- value: inputValue,
244
+ value: inputValue.toString(),
242
245
  readOnly: shouldBeReadOnly(),
243
246
  onFocus: function onFocus() {
244
247
  _onFocus();
@@ -1,4 +1,5 @@
1
1
  import { ISimpleSelectProps } from '../types.js';
2
+ import '../../../@types/Align.js';
2
3
  import '../../../@types/DataCombo.js';
3
4
  import '../../../@types/PermissionAttr.js';
4
5
  import '../../base/types.js';
@@ -55,7 +55,8 @@ var SimpleSelect = function SimpleSelect(props) {
55
55
  searchOnDropdown = _props$searchOnDropdo === void 0 ? false : _props$searchOnDropdo,
56
56
  _props$allOptions = props.allOptions,
57
57
  allOptions = _props$allOptions === void 0 ? undefined : _props$allOptions;
58
- var dataSourceWithAllOptions = allOptions ? [(_ref = {}, _defineProperty(_ref, idKey, allOptions.idValue), _defineProperty(_ref, descriptionKey, allOptions.label), _ref)].concat(_toConsumableArray(dataSource)) : dataSource;
58
+ var descriptionKeyIsString = typeof descriptionKey === 'string';
59
+ var dataSourceWithAllOptions = allOptions ? [(_ref = {}, _defineProperty(_ref, idKey, allOptions.idValue), _defineProperty(_ref, descriptionKeyIsString ? descriptionKey : descriptionKey(allOptions.label), allOptions.label), _ref)].concat(_toConsumableArray(dataSource)) : dataSource;
59
60
  var _useState = (0, _react.useState)(dataSourceWithAllOptions),
60
61
  _useState2 = _slicedToArray(_useState, 2),
61
62
  dataCombo = _useState2[0],
@@ -140,7 +141,6 @@ var SimpleSelect = function SimpleSelect(props) {
140
141
  if (dataComboFilter && dataComboFilter.length > 0) selectedFilter = dataComboFilter[0];
141
142
  setDataCombo(dataComboFilter);
142
143
  }
143
- onChange(selectedFilter);
144
144
  setOpened(true);
145
145
  setInputText(valueFilter);
146
146
  setSelected(selectedFilter);
@@ -149,7 +149,7 @@ var SimpleSelect = function SimpleSelect(props) {
149
149
  if (selectedDropdown === undefined) return;
150
150
  setOpened(false);
151
151
  setSelected(selectedDropdown);
152
- setInputText(selectedDropdown[descriptionKey]);
152
+ if (descriptionKeyIsString) setInputText(selectedDropdown[descriptionKey]);else setInputText(descriptionKey(selectedDropdown));
153
153
  onChange(selectedDropdown);
154
154
  };
155
155
  var onOpenClose = function onOpenClose() {
@@ -163,9 +163,9 @@ var SimpleSelect = function SimpleSelect(props) {
163
163
  setDropdownWidth(dropdownWidthFocus);
164
164
  }
165
165
  };
166
- var onBlur = function onBlur(dataBlur) {
166
+ var onBlur = function onBlur() {
167
167
  if (props.onBlur) {
168
- var event = getSelectEvent(dataBlur);
168
+ var event = getSelectEvent(selected);
169
169
  props.onBlur(event);
170
170
  }
171
171
  if (!insideComponent) {
@@ -228,14 +228,15 @@ var SimpleSelect = function SimpleSelect(props) {
228
228
  var newCurrent = null;
229
229
  if (value) {
230
230
  newCurrent = dataSourceWithAllOptions.find(function (i) {
231
- return value && i[idKey].toString().toLowerCase() === value.toString().toLowerCase();
231
+ var _i$idKey;
232
+ return ((_i$idKey = i[idKey]) === null || _i$idKey === void 0 ? void 0 : _i$idKey.toString().toLowerCase()) === value.toString().toLowerCase();
232
233
  });
233
234
  setValueFromProps(value);
234
235
  } else if (dataSourceWithAllOptions.length > 0 && selectFirstOnEnter) {
235
236
  newCurrent = dataSourceWithAllOptions[0];
236
237
  }
237
238
  setSelected(newCurrent);
238
- setInputText(newCurrent ? newCurrent[descriptionKey] : '');
239
+ if (descriptionKeyIsString) setInputText(newCurrent ? newCurrent[descriptionKey] : '');else setInputText(newCurrent ? descriptionKey(newCurrent) : '');
239
240
  }
240
241
  }, [dataSourceWithAllOptions.length, value]);
241
242
  (0, _react.useEffect)(function () {
@@ -1,19 +1,25 @@
1
+ import { TextAlign } from '../../@types/Align.js';
1
2
  import { DataCombo } from '../../@types/DataCombo.js';
2
3
  import { PermissionAttr } from '../../@types/PermissionAttr.js';
3
4
  import { CustomInputEvent } from '../base/types.js';
4
5
  import 'react';
5
6
  import '../../@types/Period.js';
6
7
 
8
+ type AllOptions = {
9
+ idValue?: number | null;
10
+ label: string;
11
+ };
12
+ type DescriptionKey = string | ((dataSelected: DataCombo) => string);
7
13
  interface ISimpleSelectProps {
8
14
  idKey: string;
9
- descriptionKey: string;
15
+ descriptionKey: DescriptionKey;
10
16
  dataSource?: DataCombo[];
11
17
  id?: string;
12
18
  label?: string;
13
19
  placeHolder?: string;
14
20
  hint?: string;
15
- value?: string | number | boolean | number[];
16
- textAlign?: string;
21
+ textAlign?: TextAlign;
22
+ value?: number | string;
17
23
  errorMessages?: string[];
18
24
  showClearButton?: boolean;
19
25
  searchOnDropdown?: boolean;
@@ -40,17 +46,15 @@ interface ISimpleSelectProps {
40
46
  required?: boolean;
41
47
  autoFocus?: boolean;
42
48
  onFocus?: () => void;
43
- allOptions?: {
44
- idValue?: number | null;
45
- label: string;
46
- };
49
+ allOptions?: AllOptions;
47
50
  }
48
- interface ISelectFieldProps extends Omit<ISimpleSelectProps, 'idKey' | 'descriptionKey'> {
51
+ interface ISelectFieldProps extends Omit<ISimpleSelectProps, 'idKey' | 'value' | 'descriptionKey'> {
49
52
  multiple?: boolean;
50
53
  gridLayout?: string;
51
- descriptionKey?: string;
54
+ descriptionKey?: DescriptionKey;
52
55
  idKey?: string;
53
56
  dataSource?: DataCombo[];
57
+ value?: number | number[] | string | string[];
54
58
  showClearButton?: boolean;
55
59
  searchOnDropdown?: boolean;
56
60
  searchNotFoundText?: string;
@@ -65,9 +69,10 @@ interface ISelectFieldProps extends Omit<ISimpleSelectProps, 'idKey' | 'descript
65
69
  autoFocus?: boolean;
66
70
  disabled?: boolean;
67
71
  required?: boolean;
72
+ onSelect?: (data?: string | string[]) => DataCombo;
68
73
  }
69
74
  interface IMultipleSelectProps extends Omit<ISimpleSelectProps, 'idKey' | 'value' | 'descriptionKey'> {
70
- descriptionKey: string;
75
+ descriptionKey: DescriptionKey;
71
76
  idKey: string;
72
77
  dataSource: DataCombo[];
73
78
  searchNotFoundText?: string;
@@ -85,9 +90,20 @@ interface IMultipleSelectProps extends Omit<ISimpleSelectProps, 'idKey' | 'value
85
90
  }
86
91
  interface ISelectedsMultipleProps {
87
92
  idKey: string;
88
- descriptionKey: string;
93
+ descriptionKey: DescriptionKey;
89
94
  currents: DataCombo[];
90
95
  handleOnUnselect: (id: string) => void;
91
96
  }
97
+ interface GetFilteredParams {
98
+ dataSource: DataCombo[];
99
+ descriptionKey: DescriptionKey;
100
+ currents: DataCombo[];
101
+ }
102
+ interface GetSimpleFilteredParams extends GetFilteredParams {
103
+ inputText: number | string;
104
+ }
105
+ interface GetMultipleFilteredParams extends GetFilteredParams {
106
+ inputText: number[] | string[];
107
+ }
92
108
 
93
- export { IMultipleSelectProps, ISelectFieldProps, ISelectedsMultipleProps, ISimpleSelectProps };
109
+ export { AllOptions, DescriptionKey, GetFilteredParams, GetMultipleFilteredParams, GetSimpleFilteredParams, IMultipleSelectProps, ISelectFieldProps, ISelectedsMultipleProps, ISimpleSelectProps };
@@ -3,6 +3,7 @@ import '../../@types/Period.js';
3
3
  import '../../@types/PermissionAttr.js';
4
4
  import '../base/types.js';
5
5
  import 'react';
6
+ import '../../@types/Align.js';
6
7
  import '../../internals/types.js';
7
8
  import '../../@types/Position.js';
8
9
 
@@ -3,6 +3,7 @@ import { PermissionAttr } from '../../@types/PermissionAttr.js';
3
3
  import { IBaseProps, CustomInputEvent } from '../base/types.js';
4
4
  import { WithTooltipProps } from '../../internals/types.js';
5
5
  import 'react';
6
+ import '../../@types/Align.js';
6
7
  import '../../@types/Position.js';
7
8
 
8
9
  type CommonProperties = Pick<WithTooltipProps, 'tooltip' | 'tooltipPosition' | 'tooltipWidth'>;
@@ -18,7 +19,6 @@ interface ITextField extends IBaseProps, CommonProperties {
18
19
  leftElements?: JSX.Element | JSX.Element[];
19
20
  rightElements?: JSX.Element | JSX.Element[];
20
21
  permissionAttr?: PermissionAttr;
21
- textAlign?: string;
22
22
  gridLayout?: string;
23
23
  }
24
24
 
@@ -1,6 +1,7 @@
1
1
  import { ITextAreaProps } from './types.js';
2
2
  import '../base/types.js';
3
3
  import 'react';
4
+ import '../../@types/Align.js';
4
5
  import '../../@types/Period.js';
5
6
  import '../../@types/PermissionAttr.js';
6
7
 
@@ -1,5 +1,6 @@
1
1
  import { IBaseProps } from '../base/types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
  import '../../@types/Period.js';
4
5
  import '../../@types/PermissionAttr.js';
5
6
 
@@ -3,9 +3,11 @@ import { PermissionAttr, OnDenied } from '../@types/PermissionAttr.js';
3
3
  import { DataCombo } from '../@types/DataCombo.js';
4
4
  import { IBaseProps, CustomInputEvent } from './base/types.js';
5
5
  import { IDrawerProps } from '../drawer/types.js';
6
+ import { TextAlign } from '../@types/Align.js';
6
7
  import '../@types/Period.js';
7
8
  import '../@types/Position.js';
8
9
 
10
+ type DescriptionKey = string | ((dataSelected: DataCombo) => string);
9
11
  interface IAdvancedFilterProps extends Omit<IDrawerProps, 'content'> {
10
12
  onStateChange?: (value?: boolean) => void;
11
13
  headerTitle?: string;
@@ -16,7 +18,7 @@ interface ISearchProps extends IBaseProps {
16
18
  onReset?: (event?: CustomInputEvent) => void;
17
19
  onChange?: (event?: CustomInputEvent) => void;
18
20
  onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
19
- textAlign?: string;
21
+ textAlign?: TextAlign;
20
22
  disabled?: boolean;
21
23
  readOnly?: boolean;
22
24
  value?: string;
@@ -87,7 +89,7 @@ interface IMaskHOCProps {
87
89
  customClass?: string;
88
90
  customClassForInputContent?: string;
89
91
  customClassForLabel?: string;
90
- textAlign?: string;
92
+ textAlign?: TextAlign;
91
93
  onBlur?: (e: CustomInputEvent) => void;
92
94
  leftElements?: JSX.Element | JSX.Element[];
93
95
  rounded?: boolean;
@@ -98,7 +100,7 @@ interface IMaskHOCProps {
98
100
  }
99
101
  interface IDropdownSelectProps {
100
102
  idKey: string;
101
- descriptionKey: string;
103
+ descriptionKey: DescriptionKey;
102
104
  dropdownWidth: number;
103
105
  showClearButton?: boolean;
104
106
  handleOnSelect: (item?: DataCombo) => void;