linear-react-components-ui 1.0.10-beta.2 → 1.0.10-beta.3

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 (84) hide show
  1. package/lib/@types/Align.d.ts +2 -1
  2. package/lib/dialog/Alert.d.ts +1 -0
  3. package/lib/dialog/Custom.d.ts +1 -0
  4. package/lib/dialog/Error.d.ts +1 -0
  5. package/lib/dialog/Information.d.ts +1 -0
  6. package/lib/dialog/Question.d.ts +1 -0
  7. package/lib/dialog/Warning.d.ts +1 -0
  8. package/lib/dialog/base/Content.d.ts +1 -0
  9. package/lib/dialog/base/Footer.d.ts +1 -0
  10. package/lib/dialog/base/Header.d.ts +1 -0
  11. package/lib/dialog/base/index.d.ts +1 -0
  12. package/lib/dialog/form/index.d.ts +1 -0
  13. package/lib/dialog/index.d.ts +1 -0
  14. package/lib/dialog/types.d.ts +2 -1
  15. package/lib/form/Field.d.ts +0 -5
  16. package/lib/form/Field.js +10 -17
  17. package/lib/form/FieldArray.d.ts +0 -5
  18. package/lib/form/FieldNumber.d.ts +0 -5
  19. package/lib/form/FieldPeriod.d.ts +0 -5
  20. package/lib/form/helpers.d.ts +0 -5
  21. package/lib/form/index.d.ts +0 -5
  22. package/lib/form/types.d.ts +0 -8
  23. package/lib/form/withFieldHOC.d.ts +0 -5
  24. package/lib/form/withFormSecurity.d.ts +0 -5
  25. package/lib/icons/helper.d.ts +0 -12
  26. package/lib/icons/helper.js +0 -12
  27. package/lib/index.d.ts +1 -0
  28. package/lib/inputs/base/InputTextBase.d.ts +1 -0
  29. package/lib/inputs/base/InputTextBase.js +4 -1
  30. package/lib/inputs/base/helpers.d.ts +2 -1
  31. package/lib/inputs/base/types.d.ts +2 -1
  32. package/lib/inputs/date/Dialog.d.ts +1 -0
  33. package/lib/inputs/date/Dropdown.d.ts +1 -0
  34. package/lib/inputs/date/helpers.d.ts +1 -0
  35. package/lib/inputs/date/index.d.ts +1 -0
  36. package/lib/inputs/date/types.d.ts +1 -0
  37. package/lib/inputs/file/DefaultFile.d.ts +1 -0
  38. package/lib/inputs/file/DragDropFile.d.ts +1 -0
  39. package/lib/inputs/file/File.d.ts +1 -0
  40. package/lib/inputs/file/FileButtonSettings.d.ts +1 -0
  41. package/lib/inputs/file/helpers.d.ts +1 -0
  42. package/lib/inputs/file/index.d.ts +1 -0
  43. package/lib/inputs/file/types.d.ts +1 -0
  44. package/lib/inputs/inputHOC.d.ts +1 -0
  45. package/lib/inputs/mask/BaseMask.d.ts +1 -0
  46. package/lib/inputs/mask/Cnpj.d.ts +1 -0
  47. package/lib/inputs/mask/Cpf.d.ts +1 -0
  48. package/lib/inputs/mask/Phone.d.ts +1 -0
  49. package/lib/inputs/mask/ZipCode.d.ts +1 -0
  50. package/lib/inputs/mask/helpers.d.ts +1 -0
  51. package/lib/inputs/mask/imaskHOC.d.ts +1 -0
  52. package/lib/inputs/mask/index.d.ts +1 -0
  53. package/lib/inputs/mask/types.d.ts +2 -1
  54. package/lib/inputs/multiSelect/ActionButtons.d.ts +1 -0
  55. package/lib/inputs/multiSelect/Dropdown.d.ts +1 -0
  56. package/lib/inputs/multiSelect/index.d.ts +1 -0
  57. package/lib/inputs/multiSelect/types.d.ts +1 -0
  58. package/lib/inputs/number/BaseNumber.d.ts +1 -0
  59. package/lib/inputs/number/Currency.d.ts +1 -0
  60. package/lib/inputs/number/Decimal.d.ts +1 -0
  61. package/lib/inputs/number/index.d.ts +1 -0
  62. package/lib/inputs/number/types.d.ts +1 -1
  63. package/lib/inputs/period/Dialog.d.ts +1 -0
  64. package/lib/inputs/period/Dropdown.d.ts +1 -0
  65. package/lib/inputs/period/PeriodList.d.ts +1 -0
  66. package/lib/inputs/period/helper.d.ts +1 -0
  67. package/lib/inputs/period/index.d.ts +1 -0
  68. package/lib/inputs/period/types.d.ts +1 -0
  69. package/lib/inputs/search/index.d.ts +1 -0
  70. package/lib/inputs/select/ActionButtons.d.ts +1 -0
  71. package/lib/inputs/select/Dropdown.d.ts +1 -0
  72. package/lib/inputs/select/helper.d.ts +1 -0
  73. package/lib/inputs/select/index.d.ts +1 -0
  74. package/lib/inputs/select/multiple/Selecteds.d.ts +1 -0
  75. package/lib/inputs/select/multiple/index.d.ts +1 -0
  76. package/lib/inputs/select/simple/index.d.ts +1 -0
  77. package/lib/inputs/select/simple/index.js +36 -34
  78. package/lib/inputs/select/types.d.ts +7 -7
  79. package/lib/inputs/text/index.d.ts +1 -0
  80. package/lib/inputs/text/types.d.ts +1 -1
  81. package/lib/inputs/textarea/index.d.ts +1 -0
  82. package/lib/inputs/textarea/types.d.ts +1 -0
  83. package/lib/inputs/types.d.ts +3 -2
  84. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
1
  type Align = 'left' | 'right' | 'center' | 'top' | 'bottom' | 'none';
2
+ type TextAlign = Extract<Align, 'left' | 'right' | 'center'>;
2
3
 
3
- export { Align };
4
+ export { Align, TextAlign };
@@ -1,5 +1,6 @@
1
1
  import { ICommonDialogProps } from './types.js';
2
2
  import 'react';
3
+ import '../@types/Align.js';
3
4
 
4
5
  declare const Alert: (props: ICommonDialogProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { ICustomProps } from './types.js';
2
2
  import 'react';
3
+ import '../@types/Align.js';
3
4
 
4
5
  declare const Custom: (props: ICustomProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { ICommonDialogProps } from './types.js';
2
2
  import 'react';
3
+ import '../@types/Align.js';
3
4
 
4
5
  declare const Error: (props: ICommonDialogProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { ICommonDialogProps } from './types.js';
2
2
  import 'react';
3
+ import '../@types/Align.js';
3
4
 
4
5
  declare const Information: (props: ICommonDialogProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { IQuestionProps } from './types.js';
2
2
  import 'react';
3
+ import '../@types/Align.js';
3
4
 
4
5
  declare const Question: (props: IQuestionProps) => JSX.Element | null;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { ICommonDialogProps } from './types.js';
2
2
  import 'react';
3
+ import '../@types/Align.js';
3
4
 
4
5
  declare const Warning: (props: ICommonDialogProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { IContentProps } from '../types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
 
4
5
  declare const Content: ({ children, styleForContent }: IContentProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { IFooterProps } from '../types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
 
4
5
  declare const Footer: (props: IFooterProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { IHeaderProps } from '../types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
 
4
5
  declare const Header: ({ showCloseButton, handlerClose, title, icon, titleIcon, }: IHeaderProps) => JSX.Element;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import React__default from 'react';
2
2
  import { IBaseProps } from '../types.js';
3
+ import '../../@types/Align.js';
3
4
 
4
5
  declare const BaseDialog: (props: IBaseProps) => React__default.ReactPortal;
5
6
 
@@ -1,5 +1,6 @@
1
1
  import { IFormProps } from '../types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
 
4
5
  declare const _default: (props: IFormProps) => JSX.Element;
5
6
 
@@ -7,6 +7,7 @@ export { default as DialogWarning } from './Warning.js';
7
7
  export { default as DialogCustom } from './Custom.js';
8
8
  import 'react';
9
9
  import './types.js';
10
+ import '../@types/Align.js';
10
11
 
11
12
 
12
13
 
@@ -1,4 +1,5 @@
1
1
  import { ReactNode, CSSProperties, ReactElement } from 'react';
2
+ import { TextAlign } from '../@types/Align.js';
2
3
 
3
4
  interface IContentProps {
4
5
  children: ReactNode | ReactNode[];
@@ -23,7 +24,7 @@ interface IBaseProps {
23
24
  closeOnEsc?: boolean;
24
25
  closeOnOutsideClick?: boolean;
25
26
  overlay?: boolean;
26
- textAlign?: string;
27
+ textAlign?: TextAlign;
27
28
  zIndex?: string;
28
29
  }
29
30
  interface IFormProps {
@@ -1,10 +1,5 @@
1
1
  import React__default from 'react';
2
2
  import { IFieldProps } from './types.js';
3
- import '../inputs/select/types.js';
4
- import '../@types/DataCombo.js';
5
- import '../@types/PermissionAttr.js';
6
- import '../inputs/base/types.js';
7
- import '../@types/Period.js';
8
3
 
9
4
  declare const _default: React__default.ForwardRefExoticComponent<IFieldProps & React__default.RefAttributes<HTMLElement>>;
10
5
 
package/lib/form/Field.js CHANGED
@@ -19,14 +19,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
19
19
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
20
20
  function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
21
21
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
22
- var getEvents = function getEvents(_ref) {
22
+ var getOnBlurEvent = function getOnBlurEvent(_ref) {
23
23
  var name = _ref.name,
24
24
  validators = _ref.validators,
25
25
  _onBlur = _ref.onBlur,
26
26
  handlerFieldValidade = _ref.handlerFieldValidade,
27
- validatorFromComponent = _ref.validatorFromComponent,
28
- handlerFieldChange = _ref.handlerFieldChange,
29
- _onChange = _ref.onChange;
27
+ validatorFromComponent = _ref.validatorFromComponent;
30
28
  if (!(validators || validatorFromComponent || _onBlur)) return {};
31
29
  var validatorsArray = (0, _helpers.getValidatorsArray)(validators, validatorFromComponent);
32
30
  return {
@@ -35,13 +33,6 @@ var getEvents = function getEvents(_ref) {
35
33
  handlerFieldValidade(name, e.target.value, validatorsArray);
36
34
  }
37
35
  if (_onBlur) _onBlur(e);
38
- },
39
- onChange: function onChange(e) {
40
- if (validatorsArray && e.target && handlerFieldValidade) {
41
- handlerFieldValidade(name, e.target.value, validatorsArray);
42
- }
43
- if (handlerFieldChange) handlerFieldChange(e);
44
- if (_onChange) _onChange(e);
45
36
  }
46
37
  };
47
38
  };
@@ -74,7 +65,7 @@ var getCustomProps = function getCustomProps(props, setValidatorFromComponent) {
74
65
  };
75
66
  var Field = function Field(props) {
76
67
  var handlerFieldChange = props.handlerFieldChange,
77
- onChange = props.onChange;
68
+ _onChange = props.onChange;
78
69
  var _useState = (0, _react.useState)(undefined),
79
70
  _useState2 = _slicedToArray(_useState, 2),
80
71
  validatorFromComponent = _useState2[0],
@@ -86,16 +77,18 @@ var Field = function Field(props) {
86
77
  handlerSetValidatorFromComponent(validatorFromComponent);
87
78
  }
88
79
  }, [validatorFromComponent]);
89
- return /*#__PURE__*/_react.default.createElement(props.component, _extends({}, props, getEvents({
80
+ return /*#__PURE__*/_react.default.createElement(props.component, _extends({}, props, getOnBlurEvent({
90
81
  name: props.name,
91
82
  validators: props.validators,
92
83
  onBlur: props.onBlur,
93
84
  validatorFromComponent: validatorFromComponent,
94
- handlerFieldValidade: props.handlerFieldValidade ? props.handlerFieldValidade : function () {},
95
- handlerFieldChange: handlerFieldChange,
96
- onChange: onChange
85
+ handlerFieldValidade: props.handlerFieldValidade ? props.handlerFieldValidade : function () {}
97
86
  }), getCustomProps(props, setValidatorFromComponent), {
98
- errorMessages: (0, _helpers.getErrorMessages)(props)
87
+ errorMessages: (0, _helpers.getErrorMessages)(props),
88
+ onChange: function onChange(e) {
89
+ if (handlerFieldChange) handlerFieldChange(e);
90
+ if (_onChange) _onChange(e);
91
+ }
99
92
  }));
100
93
  };
101
94
  var _default = (0, _withFieldHOC.default)(Field);
@@ -1,10 +1,5 @@
1
1
  import React__default from 'react';
2
2
  import { IFieldArrayProps } from './types.js';
3
- import '../inputs/select/types.js';
4
- import '../@types/DataCombo.js';
5
- import '../@types/PermissionAttr.js';
6
- import '../inputs/base/types.js';
7
- import '../@types/Period.js';
8
3
 
9
4
  declare const _default: React__default.ForwardRefExoticComponent<IFieldArrayProps & React__default.RefAttributes<HTMLElement>>;
10
5
 
@@ -1,10 +1,5 @@
1
1
  import React__default from 'react';
2
2
  import { IFieldProps } from './types.js';
3
- import '../inputs/select/types.js';
4
- import '../@types/DataCombo.js';
5
- import '../@types/PermissionAttr.js';
6
- import '../inputs/base/types.js';
7
- import '../@types/Period.js';
8
3
 
9
4
  declare const _default: React__default.ForwardRefExoticComponent<IFieldProps & React__default.RefAttributes<HTMLElement>>;
10
5
 
@@ -1,10 +1,5 @@
1
1
  import React__default from 'react';
2
2
  import { IFieldPeriodProps } from './types.js';
3
- import '../inputs/select/types.js';
4
- import '../@types/DataCombo.js';
5
- import '../@types/PermissionAttr.js';
6
- import '../inputs/base/types.js';
7
- import '../@types/Period.js';
8
3
 
9
4
  declare const _default: React__default.ForwardRefExoticComponent<IFieldPeriodProps & React__default.RefAttributes<HTMLElement>>;
10
5
 
@@ -1,10 +1,5 @@
1
1
  import React__default from 'react';
2
2
  import { FormContextProps, IWithFieldContext, IGetErrorMessagesParams, Validator } from './types.js';
3
- import '../inputs/select/types.js';
4
- import '../@types/DataCombo.js';
5
- import '../@types/PermissionAttr.js';
6
- import '../inputs/base/types.js';
7
- import '../@types/Period.js';
8
3
 
9
4
  declare const securityBeforeUnload = "securityBeforeUnload";
10
5
  declare const FormContext: React__default.Context<FormContextProps>;
@@ -3,11 +3,6 @@ export { default as FieldNumber } from './FieldNumber.js';
3
3
  export { default as FieldArray } from './FieldArray.js';
4
4
  import { IFormProps } from './types.js';
5
5
  import 'react';
6
- import '../inputs/select/types.js';
7
- import '../@types/DataCombo.js';
8
- import '../@types/PermissionAttr.js';
9
- import '../inputs/base/types.js';
10
- import '../@types/Period.js';
11
6
 
12
7
  declare const Form: ({ submitOnPressEnterKey, dataSource, securityBeforeUnload, handlerReset, handlerSubmit, handlerValidates, style, customClass, securityTitle, securityText, onDataChange, onValidateForm, externalFieldErrors, onSubmit, skeletonize, disabled, children, }: IFormProps) => JSX.Element;
13
8
 
@@ -1,9 +1,4 @@
1
1
  import { ChangeEvent, ReactNode, CSSProperties, ComponentType, MouseEventHandler } from 'react';
2
- import { AllOptions } from '../inputs/select/types.js';
3
- import '../@types/DataCombo.js';
4
- import '../@types/PermissionAttr.js';
5
- import '../inputs/base/types.js';
6
- import '../@types/Period.js';
7
2
 
8
3
  type Validator = (value: string) => string | undefined;
9
4
  type PeriodValidator = (value: {
@@ -63,8 +58,6 @@ interface IFieldProps extends WithFieldProps {
63
58
  descriptionKey?: string;
64
59
  showClearButton?: boolean;
65
60
  gridLayout?: string;
66
- allOptions?: AllOptions;
67
- searchNotFoundText?: string;
68
61
  }
69
62
  interface CustomEvent {
70
63
  target: {
@@ -161,7 +154,6 @@ interface IEventParams {
161
154
  data?: object;
162
155
  validators?: Validator | Validator[];
163
156
  onBlur?: (event: ChangeEvent<HTMLInputElement>) => void;
164
- onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
165
157
  onKeyDown?: (event: CustomKeyboardEvent) => void;
166
158
  handlerFieldValidade?: (name: string, value: string, validatorsArray: Validator[] | Validator) => void;
167
159
  handlerFieldChange?: (event: ChangeEvent<HTMLInputElement> | CustomKeyboardEvent) => void;
@@ -1,10 +1,5 @@
1
1
  import React__default from 'react';
2
2
  import { WithFieldProps } from './types.js';
3
- import '../inputs/select/types.js';
4
- import '../@types/DataCombo.js';
5
- import '../@types/PermissionAttr.js';
6
- import '../inputs/base/types.js';
7
- import '../@types/Period.js';
8
3
 
9
4
  declare const withFieldHOC: <ComponentProps extends WithFieldProps>(WrappedComponent: React__default.ComponentType<ComponentProps>) => React__default.ForwardRefExoticComponent<React__default.PropsWithoutRef<ComponentProps> & React__default.RefAttributes<HTMLElement>>;
10
5
 
@@ -1,10 +1,5 @@
1
1
  import React__default from 'react';
2
2
  import { IFormSecurityContext, IWithFormSecurity } from './types.js';
3
- import '../inputs/select/types.js';
4
- import '../@types/DataCombo.js';
5
- import '../@types/PermissionAttr.js';
6
- import '../inputs/base/types.js';
7
- import '../@types/Period.js';
8
3
 
9
4
  declare const FormSecurityContext: React__default.Context<IFormSecurityContext>;
10
5
  declare const withFormSecurity: <ComponentProps extends IWithFormSecurity>(WrappedComponent: React__default.ComponentType<ComponentProps>) => (props: ComponentProps) => JSX.Element;
@@ -563,18 +563,6 @@ declare const _default: {
563
563
  viewbox: string;
564
564
  paths: string[];
565
565
  };
566
- cash3: {
567
- viewbox: string;
568
- paths: string[];
569
- };
570
- wallet: {
571
- viewbox: string;
572
- paths: string[];
573
- };
574
- stackEmpty: {
575
- viewbox: string;
576
- paths: string[];
577
- };
578
566
  };
579
567
 
580
568
  export { _default as default };
@@ -568,18 +568,6 @@ var _default = {
568
568
  records: {
569
569
  viewbox: '0 0 16 16',
570
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']
571
- },
572
- cash3: {
573
- viewbox: '0 0 17 16',
574
- paths: ['9h1v1h-1v-1z', 'M0 6v9h17v-9h-17zM3 14h-2v-2h1v1h1v1zM3 8h-1v1h-1v-2h2v1zM10.5 10c0.276 0 0.5 0.224 0.5 0.5v2c0 0.276-0.224 0.5-0.5 0.5h-1.5v0.5c0 0.276-0.224 0.5-0.5 0.5s-0.5-0.224-0.5-0.5v-0.5h-1.5c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h1.5v-1h-1.5c-0.276 0-0.5-0.224-0.5-0.5v-2c0-0.276 0.224-0.5 0.5-0.5h1.5v-0.5c0-0.276 0.224-0.5 0.5-0.5s0.5 0.224 0.5 0.5v0.5h1.5c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5h-1.5v1h1.5zM16 14h-2v-1h1v-1h1v2zM16 9h-1v-1h-1v-1h2v2z', 'M9 11h1v1h-1v-1z', 'M1 4h15v1.5h-15v-1.5z', 'M2 2h13v1.5h-13v-1.5z']
575
- },
576
- wallet: {
577
- viewbox: '0 0 17 16',
578
- paths: ['M15 2h-13c-1.105 0-2 0.895-2 2v10c0 0.55 0.45 1 1 1h12c0.55 0 1-0.45 1-1v-1h1c0.55 0 1-0.45 1-1v-9c0-0.55-0.45-1-1-1zM1 6h0.5v1h-0.5v-1zM1 8h0.5v1h-0.5v-1zM1 10h0.5v1h-0.5v-1zM1 12h0.5v1h-0.5v-1zM2 14h-1v-0.5h1v0.5zM2 5.5h-1v-0.5h1v0.5zM4 14h-1v-0.5h1v0.5zM4 5.5h-1v-0.5h1v0.5zM6 14h-1v-0.5h1v0.5zM6 5.5h-1v-0.5h1v0.5zM8 14h-1v-0.5h1v0.5zM8 5.5h-1v-0.5h1v0.5zM10 14h-1v-0.5h1v0.5zM12 14h-1v-0.5h1v0.5zM15 7h-4v3h4v1.998c-0.001 0.001-0.001 0.001-0.002 0.002h-0.998v-1h-4v-5h4v-1c0-0.55-0.45-1-1-1h-12c0-0.551 0.449-1 1-1h12.998c0.001 0.001 0.001 0.001 0.002 0.002v3.998zM13 8.5c0 0.276-0.224 0.5-0.5 0.5s-0.5-0.224-0.5-0.5 0.224-0.5 0.5-0.5 0.5 0.224 0.5 0.5z']
579
- },
580
- stackEmpty: {
581
- viewbox: '0 0 16 16',
582
- paths: ['M16 13v-12h-11v1.155l-2.619 0.368 0.17 1.211-2.551 0.732 3.308 11.535 10.189-2.921 0.558-0.079h1.945zM6 2h9v10h-9v-10zM5 3.070v9.93h2.543l-2.721 0.382-1.418-10.088 1.595-0.224zM3.929 14.879l-2.808-9.793 1.558-0.447 1.373 9.766 2.997-0.421-3.119 0.894z']
583
571
  }
584
572
  };
585
573
  exports.default = _default;
package/lib/index.d.ts CHANGED
@@ -33,3 +33,4 @@ import './radio/types.js';
33
33
  import './tabs/Panel.js';
34
34
  import './tabs/types.js';
35
35
  import './dialog/types.js';
36
+ import './@types/Align.js';
@@ -1,5 +1,6 @@
1
1
  import { IBaseProps } from './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
 
@@ -151,7 +151,10 @@ var InputTextBase = function InputTextBase(props) {
151
151
  className: "input-base-component ".concat(skeletonize ? '-skeletonized' : '', " ").concat(customClass),
152
152
  ref: inputBaseRef
153
153
  }, label && /*#__PURE__*/_react.default.createElement("div", {
154
- className: "labelcontainer"
154
+ className: "labelcontainer",
155
+ style: {
156
+ textAlign: textAlign
157
+ }
155
158
  }, /*#__PURE__*/_react.default.createElement("span", {
156
159
  style: styleForLabel,
157
160
  className: "label ".concat(customClassForLabel, " ").concat(labelUppercase && ' -uppercase')
@@ -1,10 +1,11 @@
1
1
  import { IBaseProps } from './types.js';
2
+ import { TextAlign } from '../../@types/Align.js';
2
3
  import 'react';
3
4
  import '../../@types/Period.js';
4
5
  import '../../@types/PermissionAttr.js';
5
6
 
6
7
  declare const getInputClass: ({ textAlign, readOnly, readOnlyClass }: {
7
- textAlign?: string | undefined;
8
+ textAlign?: TextAlign | undefined;
8
9
  readOnly?: boolean | undefined;
9
10
  readOnlyClass?: string | undefined;
10
11
  }) => string;
@@ -1,4 +1,5 @@
1
1
  import { KeyboardEvent, DragEvent, MutableRefObject, RefObject, CSSProperties } from 'react';
2
+ import { TextAlign } from '../../@types/Align.js';
2
3
  import { Period } from '../../@types/Period.js';
3
4
  import { PermissionAttr, OnDenied } from '../../@types/PermissionAttr.js';
4
5
 
@@ -57,7 +58,7 @@ interface IBaseProps {
57
58
  inputRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null> | ((ref: HTMLInputElement | HTMLTextAreaElement | null) => void);
58
59
  inputBaseRef?: RefObject<HTMLDivElement> | ((ref: HTMLDivElement) => void);
59
60
  hint?: string;
60
- textAlign?: string;
61
+ textAlign?: TextAlign;
61
62
  rounded?: boolean;
62
63
  errorMessages?: string[] | undefined;
63
64
  visible?: boolean;
@@ -3,6 +3,7 @@ import 'react';
3
3
  import '../../@types/ColorStyles.js';
4
4
  import '../../@types/PermissionAttr.js';
5
5
  import '../base/types.js';
6
+ import '../../@types/Align.js';
6
7
  import '../../@types/Period.js';
7
8
 
8
9
  declare const Dialog: ({ handlerClose, children, dialogSize }: IDateDialogProps) => JSX.Element;
@@ -3,6 +3,7 @@ import { IDateDropdownProps } from './types.js';
3
3
  import '../../@types/ColorStyles.js';
4
4
  import '../../@types/PermissionAttr.js';
5
5
  import '../base/types.js';
6
+ import '../../@types/Align.js';
6
7
  import '../../@types/Period.js';
7
8
 
8
9
  declare const Dropdown: (props: IDateDropdownProps) => React.ReactPortal;
@@ -4,6 +4,7 @@ import 'react';
4
4
  import '../../@types/ColorStyles.js';
5
5
  import '../../@types/PermissionAttr.js';
6
6
  import '../base/types.js';
7
+ import '../../@types/Align.js';
7
8
  import '../../@types/Period.js';
8
9
 
9
10
  declare const PT_BR_FORMAT = "DD/MM/YYYY";
@@ -3,6 +3,7 @@ import 'react';
3
3
  import '../../@types/ColorStyles.js';
4
4
  import '../../@types/PermissionAttr.js';
5
5
  import '../base/types.js';
6
+ import '../../@types/Align.js';
6
7
  import '../../@types/Period.js';
7
8
 
8
9
  declare const DatePicker: (props: IDatePickerProps) => JSX.Element | null;
@@ -2,6 +2,7 @@ import { ReactNode } from 'react';
2
2
  import { ColorStyles } from '../../@types/ColorStyles.js';
3
3
  import { PermissionAttr } from '../../@types/PermissionAttr.js';
4
4
  import { CustomInputEvent } from '../base/types.js';
5
+ import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
7
 
7
8
  interface IDatePickerProps {
@@ -2,6 +2,7 @@ import { IDefaultFileProps } from './types.js';
2
2
  import 'react';
3
3
  import '../../@types/Size.js';
4
4
  import '../base/types.js';
5
+ import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
7
  import '../../@types/PermissionAttr.js';
7
8
 
@@ -2,6 +2,7 @@ import { IDragDropFileProps } from './types.js';
2
2
  import 'react';
3
3
  import '../../@types/Size.js';
4
4
  import '../base/types.js';
5
+ import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
7
  import '../../@types/PermissionAttr.js';
7
8
 
@@ -2,6 +2,7 @@ import { IFileProps } from './types.js';
2
2
  import 'react';
3
3
  import '../../@types/Size.js';
4
4
  import '../base/types.js';
5
+ import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
7
  import '../../@types/PermissionAttr.js';
7
8
 
@@ -2,6 +2,7 @@ import { IFileButtonSettingsProps } from './types.js';
2
2
  import 'react';
3
3
  import '../../@types/Size.js';
4
4
  import '../base/types.js';
5
+ import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
7
  import '../../@types/PermissionAttr.js';
7
8
 
@@ -2,6 +2,7 @@ import { CustomFile } from './types.js';
2
2
  import 'react';
3
3
  import '../../@types/Size.js';
4
4
  import '../base/types.js';
5
+ import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
7
  import '../../@types/PermissionAttr.js';
7
8
 
@@ -5,6 +5,7 @@ import './types.js';
5
5
  import 'react';
6
6
  import '../../@types/Size.js';
7
7
  import '../base/types.js';
8
+ import '../../@types/Align.js';
8
9
  import '../../@types/Period.js';
9
10
  import '../../@types/PermissionAttr.js';
10
11
 
@@ -1,6 +1,7 @@
1
1
  import { DragEvent, RefObject } from 'react';
2
2
  import { Size } from '../../@types/Size.js';
3
3
  import { CustomInputEvent } from '../base/types.js';
4
+ import '../../@types/Align.js';
4
5
  import '../../@types/Period.js';
5
6
  import '../../@types/PermissionAttr.js';
6
7
 
@@ -3,6 +3,7 @@ import { IInputHOCProps } from './types.js';
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';
@@ -1,5 +1,6 @@
1
1
  import { IBaseMaskProps } from './types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
  import '../../@types/PermissionAttr.js';
4
5
  import '../base/types.js';
5
6
  import '../../@types/Period.js';
@@ -1,5 +1,6 @@
1
1
  import { ICnpjFieldProps } from './types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
  import '../../@types/PermissionAttr.js';
4
5
  import '../base/types.js';
5
6
  import '../../@types/Period.js';
@@ -1,5 +1,6 @@
1
1
  import { ICpfProps } from './types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
  import '../../@types/PermissionAttr.js';
4
5
  import '../base/types.js';
5
6
  import '../../@types/Period.js';
@@ -1,5 +1,6 @@
1
1
  import { IPhoneFieldProps } from './types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
  import '../../@types/PermissionAttr.js';
4
5
  import '../base/types.js';
5
6
  import '../../@types/Period.js';
@@ -1,5 +1,6 @@
1
1
  import { IZipCode } from './types.js';
2
2
  import 'react';
3
+ import '../../@types/Align.js';
3
4
  import '../../@types/PermissionAttr.js';
4
5
  import '../base/types.js';
5
6
  import '../../@types/Period.js';
@@ -4,6 +4,7 @@ import 'react';
4
4
  import '../../@types/PermissionAttr.js';
5
5
  import '../../@types/DataCombo.js';
6
6
  import '../base/types.js';
7
+ import '../../@types/Align.js';
7
8
  import '../../@types/Period.js';
8
9
  import '../../drawer/types.js';
9
10
  import '../../@types/Position.js';
@@ -3,6 +3,7 @@ import { IMaskHOCProps } from '../types.js';
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';
@@ -5,6 +5,7 @@ export { default as PhoneField } from './Phone.js';
5
5
  export { default as ZipCodeField } from './ZipCode.js';
6
6
  import './types.js';
7
7
  import 'react';
8
+ import '../../@types/Align.js';
8
9
  import '../../@types/PermissionAttr.js';
9
10
  import '../base/types.js';
10
11
  import '../../@types/Period.js';
@@ -1,4 +1,5 @@
1
1
  import { KeyboardEvent, MutableRefObject } from 'react';
2
+ import { TextAlign } from '../../@types/Align.js';
2
3
  import { OnDenied, PermissionAttr } from '../../@types/PermissionAttr.js';
3
4
  import { CustomInputEvent } from '../base/types.js';
4
5
  import '../../@types/Period.js';
@@ -26,7 +27,7 @@ interface IBaseMaskProps {
26
27
  permissionAttr?: PermissionAttr;
27
28
  errorMessages?: string[];
28
29
  rounded?: boolean;
29
- textAlign?: string;
30
+ textAlign?: TextAlign;
30
31
  customClassForInputContent?: string;
31
32
  label?: string;
32
33
  name?: string;
@@ -2,6 +2,7 @@ import { IActionButtonsProps } from './types.js';
2
2
  import 'react';
3
3
  import '../../@types/DataCombo.js';
4
4
  import '../base/types.js';
5
+ import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
7
  import '../../@types/PermissionAttr.js';
7
8
 
@@ -2,6 +2,7 @@ import { IDropdownMultiSelectProps } from './types.js';
2
2
  import 'react';
3
3
  import '../../@types/DataCombo.js';
4
4
  import '../base/types.js';
5
+ import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
7
  import '../../@types/PermissionAttr.js';
7
8
 
@@ -2,6 +2,7 @@ import { IMultiSelectProps } from './types.js';
2
2
  import 'react';
3
3
  import '../../@types/DataCombo.js';
4
4
  import '../base/types.js';
5
+ import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
7
  import '../../@types/PermissionAttr.js';
7
8
 
@@ -1,6 +1,7 @@
1
1
  import { ChangeEvent, RefObject } from 'react';
2
2
  import { DataCombo } from '../../@types/DataCombo.js';
3
3
  import { CustomInputEvent } from '../base/types.js';
4
+ import '../../@types/Align.js';
4
5
  import '../../@types/Period.js';
5
6
  import '../../@types/PermissionAttr.js';
6
7
 
@@ -2,6 +2,7 @@ import { IBaseNumberProps } from './types.js';
2
2
  import '../../@types/PermissionAttr.js';
3
3
  import '../base/types.js';
4
4
  import 'react';
5
+ import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
7
  import '../types.js';
7
8
  import '../../@types/DataCombo.js';
@@ -2,6 +2,7 @@ import { ICurrencyProps } from './types.js';
2
2
  import '../../@types/PermissionAttr.js';
3
3
  import '../base/types.js';
4
4
  import 'react';
5
+ import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
7
  import '../types.js';
7
8
  import '../../@types/DataCombo.js';
@@ -2,6 +2,7 @@ import { IBaseNumberProps } from './types.js';
2
2
  import '../../@types/PermissionAttr.js';
3
3
  import '../base/types.js';
4
4
  import 'react';
5
+ import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
7
  import '../types.js';
7
8
  import '../../@types/DataCombo.js';
@@ -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
 
@@ -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 {
@@ -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';
@@ -3,6 +3,7 @@ import { IDropdownSelectProps } from '../types.js';
3
3
  import 'react';
4
4
  import '../../@types/PermissionAttr.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';
@@ -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';
@@ -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';
@@ -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';
@@ -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';
@@ -17,21 +17,20 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
17
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); }
18
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
19
  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); }
20
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
21
- 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."); }
22
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
23
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
20
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
25
21
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
26
22
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
27
23
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
28
24
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
29
- 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); }
30
25
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
31
26
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
27
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
28
+ 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."); }
29
+ 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); }
32
30
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
31
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
32
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
33
33
  var SimpleSelect = function SimpleSelect(props) {
34
- var _ref;
35
34
  var value = props.value,
36
35
  _props$descriptionKey = props.descriptionKey,
37
36
  descriptionKey = _props$descriptionKey === void 0 ? '' : _props$descriptionKey,
@@ -55,8 +54,7 @@ var SimpleSelect = function SimpleSelect(props) {
55
54
  searchOnDropdown = _props$searchOnDropdo === void 0 ? false : _props$searchOnDropdo,
56
55
  _props$allOptions = props.allOptions,
57
56
  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;
59
- var _useState = (0, _react.useState)(dataSourceWithAllOptions),
57
+ var _useState = (0, _react.useState)(dataSource),
60
58
  _useState2 = _slicedToArray(_useState, 2),
61
59
  dataCombo = _useState2[0],
62
60
  setDataCombo = _useState2[1];
@@ -101,9 +99,8 @@ var SimpleSelect = function SimpleSelect(props) {
101
99
  if (selectWrapper.current) setDropdownWidth(selectWrapper.current.clientWidth);
102
100
  };
103
101
  var onClickOutside = function onClickOutside(event) {
104
- var _selectWrapper$curren, _dropdownRef$current;
105
102
  var target = event.target;
106
- if (target !== selectWrapper.current && !((_selectWrapper$curren = selectWrapper.current) !== null && _selectWrapper$curren !== void 0 && _selectWrapper$curren.contains(target)) && !((_dropdownRef$current = dropdownRef.current) !== null && _dropdownRef$current !== void 0 && _dropdownRef$current.contains(target))) {
103
+ if (target !== selectWrapper.current && selectWrapper.current && !selectWrapper.current.contains(target) && dropdownRef.current && !dropdownRef.current.contains(target)) {
107
104
  setOpened(false);
108
105
  }
109
106
  };
@@ -135,7 +132,7 @@ var SimpleSelect = function SimpleSelect(props) {
135
132
  var dataComboFilter = (0, _helper.getFilteredSimpleDataCombo)({
136
133
  inputText: valueFilter,
137
134
  descriptionKey: descriptionKey,
138
- dataSource: dataSourceWithAllOptions
135
+ dataSource: dataSource
139
136
  });
140
137
  if (dataComboFilter && dataComboFilter.length > 0) selectedFilter = dataComboFilter[0];
141
138
  setDataCombo(dataComboFilter);
@@ -156,16 +153,16 @@ var SimpleSelect = function SimpleSelect(props) {
156
153
  setOpened(!opened);
157
154
  if (selectWrapper.current) setDropdownWidth(selectWrapper.current.clientWidth);
158
155
  };
159
- var onFocus = function onFocus() {
156
+ var _onFocus = function onFocus() {
160
157
  setOpened(openDropdownOnFocus);
161
158
  if (selectWrapper) {
162
159
  var dropdownWidthFocus = selectWrapper.current ? selectWrapper.current.clientWidth : 0;
163
160
  setDropdownWidth(dropdownWidthFocus);
164
161
  }
165
162
  };
166
- var onBlur = function onBlur() {
163
+ var onBlur = function onBlur(dataBlur) {
167
164
  if (props.onBlur) {
168
- var event = getSelectEvent(selected);
165
+ var event = getSelectEvent(dataBlur);
169
166
  props.onBlur(event);
170
167
  }
171
168
  if (!insideComponent) {
@@ -181,15 +178,15 @@ var SimpleSelect = function SimpleSelect(props) {
181
178
  onSelect(selected);
182
179
  } else if ([constants.keyCodes.ARROW_UP, constants.keyCodes.ARROW_DOWN].includes(e.keyCode)) {
183
180
  if (!opened) setOpened(true);
184
- var index = dataSourceWithAllOptions.length > 0 ? dataSourceWithAllOptions.findIndex(function (d) {
181
+ var index = dataSource.length > 0 ? dataSource.findIndex(function (d) {
185
182
  return selected && d[idKey] === selected[idKey];
186
183
  }) : 0;
187
184
  if (e.keyCode === constants.keyCodes.ARROW_DOWN) {
188
- index = dataSourceWithAllOptions && index === dataSourceWithAllOptions.length - 1 ? 0 : index + 1;
185
+ index = dataSource && index === dataSource.length - 1 ? 0 : index + 1;
189
186
  } else {
190
- index = dataSourceWithAllOptions && index === 0 ? (dataSourceWithAllOptions === null || dataSourceWithAllOptions === void 0 ? void 0 : dataSourceWithAllOptions.length) - 1 : index - 1;
187
+ index = dataSource && index === 0 ? (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) - 1 : index - 1;
191
188
  }
192
- setSelected(dataSourceWithAllOptions[index]);
189
+ setSelected(dataSource[index]);
193
190
  }
194
191
  }
195
192
  if (!isTyping) setIsTyping(true);
@@ -224,34 +221,38 @@ var SimpleSelect = function SimpleSelect(props) {
224
221
  }
225
222
  }, [gridLayout]);
226
223
  (0, _react.useEffect)(function () {
227
- if (value !== valueFromProps && dataSourceWithAllOptions.length > 0) {
224
+ if (value !== valueFromProps && dataSource.length > 0) {
228
225
  var newCurrent = null;
229
226
  if (value) {
230
- newCurrent = dataSourceWithAllOptions.find(function (i) {
231
- var _i$idKey;
232
- return value && ((_i$idKey = i[idKey]) === null || _i$idKey === void 0 ? void 0 : _i$idKey.toString().toLowerCase()) === (value === null || value === void 0 ? void 0 : value.toString().toLowerCase());
227
+ newCurrent = dataSource.find(function (i) {
228
+ return value && i[idKey].toString().toLowerCase() === value.toString().toLowerCase();
233
229
  });
234
230
  setValueFromProps(value);
235
- } else if (dataSourceWithAllOptions.length > 0 && selectFirstOnEnter) {
236
- newCurrent = dataSourceWithAllOptions[0];
231
+ } else if (dataSource.length > 0 && selectFirstOnEnter) {
232
+ newCurrent = dataSource[0];
237
233
  }
238
234
  setSelected(newCurrent);
235
+ setInputText(newCurrent ? newCurrent[descriptionKey] : '');
239
236
  }
240
- }, [dataSourceWithAllOptions.length, value]);
237
+ }, [dataSource.length, value]);
241
238
  (0, _react.useEffect)(function () {
242
- if (!_lodash.default.isEqual(dataCombo, dataSourceWithAllOptions)) {
243
- var dataComboFilteredSimple = undigitable || remoteSearch || !isTyping ? dataSourceWithAllOptions : (0, _helper.getFilteredSimpleDataCombo)({
239
+ if (!_lodash.default.isEqual(dataCombo, dataSource)) {
240
+ var dataComboFilteredSimple = undigitable || remoteSearch || !isTyping ? dataSource : (0, _helper.getFilteredSimpleDataCombo)({
244
241
  inputText: inputText,
245
- dataSource: dataSourceWithAllOptions,
242
+ dataSource: dataSource,
246
243
  descriptionKey: descriptionKey
247
244
  });
248
245
  setDataCombo(dataComboFilteredSimple);
249
- if (dataSourceWithAllOptions.length > 0 && remoteSearch) {
250
- var data = dataSourceWithAllOptions[0];
246
+ if (dataSource.length > 0 && remoteSearch) {
247
+ var data = dataSource[0];
251
248
  setSelected(data);
252
249
  }
253
250
  }
254
- }, [JSON.stringify(dataSourceWithAllOptions)]);
251
+ if (allOptions) {
252
+ var _ref;
253
+ setDataCombo([(_ref = {}, _defineProperty(_ref, idKey, allOptions.idValue), _defineProperty(_ref, descriptionKey, allOptions.label), _ref)].concat(_toConsumableArray(dataSource)));
254
+ }
255
+ }, [dataSource]);
255
256
  return /*#__PURE__*/_react.default.createElement("span", {
256
257
  id: componentId,
257
258
  ref: componentRef,
@@ -259,8 +260,9 @@ var SimpleSelect = function SimpleSelect(props) {
259
260
  }, /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({}, props, {
260
261
  readOnly: undigitable || shouldBeReadOnly(),
261
262
  value: inputText,
262
- onFocus: onFocus,
263
- onBlur: onBlur,
263
+ onFocus: function onFocus() {
264
+ _onFocus();
265
+ },
264
266
  onChange: function onChange(e) {
265
267
  if (e) onFilter(e.target.value);
266
268
  },
@@ -301,7 +303,7 @@ var SimpleSelect = function SimpleSelect(props) {
301
303
  handleOnBlur: function handleOnBlur() {
302
304
  return onBlur;
303
305
  },
304
- handleOnFocus: onFocus,
306
+ handleOnFocus: _onFocus,
305
307
  opened: opened,
306
308
  dataCombo: dataCombo,
307
309
  dropdownWidth: dropdownWidth || 0
@@ -1,13 +1,10 @@
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
 
7
- type AllOptions = {
8
- idValue?: number | null;
9
- label: string;
10
- };
11
8
  interface ISimpleSelectProps {
12
9
  idKey: string;
13
10
  descriptionKey: string;
@@ -17,7 +14,7 @@ interface ISimpleSelectProps {
17
14
  placeHolder?: string;
18
15
  hint?: string;
19
16
  value?: string | number | boolean | number[];
20
- textAlign?: string;
17
+ textAlign?: TextAlign;
21
18
  errorMessages?: string[];
22
19
  showClearButton?: boolean;
23
20
  searchOnDropdown?: boolean;
@@ -44,7 +41,10 @@ interface ISimpleSelectProps {
44
41
  required?: boolean;
45
42
  autoFocus?: boolean;
46
43
  onFocus?: () => void;
47
- allOptions?: AllOptions;
44
+ allOptions?: {
45
+ idValue?: number | null;
46
+ label: string;
47
+ };
48
48
  }
49
49
  interface ISelectFieldProps extends Omit<ISimpleSelectProps, 'idKey' | 'descriptionKey'> {
50
50
  multiple?: boolean;
@@ -91,4 +91,4 @@ interface ISelectedsMultipleProps {
91
91
  handleOnUnselect: (id: string) => void;
92
92
  }
93
93
 
94
- export { AllOptions, IMultipleSelectProps, ISelectFieldProps, ISelectedsMultipleProps, ISimpleSelectProps };
94
+ export { 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,6 +3,7 @@ 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
 
@@ -16,7 +17,7 @@ interface ISearchProps extends IBaseProps {
16
17
  onReset?: (event?: CustomInputEvent) => void;
17
18
  onChange?: (event?: CustomInputEvent) => void;
18
19
  onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
19
- textAlign?: string;
20
+ textAlign?: TextAlign;
20
21
  disabled?: boolean;
21
22
  readOnly?: boolean;
22
23
  value?: string;
@@ -87,7 +88,7 @@ interface IMaskHOCProps {
87
88
  customClass?: string;
88
89
  customClassForInputContent?: string;
89
90
  customClassForLabel?: string;
90
- textAlign?: string;
91
+ textAlign?: TextAlign;
91
92
  onBlur?: (e: CustomInputEvent) => void;
92
93
  leftElements?: JSX.Element | JSX.Element[];
93
94
  rounded?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linear-react-components-ui",
3
- "version": "1.0.10-beta.2",
3
+ "version": "1.0.10-beta.3",
4
4
  "description": "Linear Sistemas ReactJs Components",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.cjs",