linear-react-components-ui 1.1.20-beta.6 → 1.1.20-beta.8
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.
- package/lib/assets/styles/select.scss +1 -2
- package/lib/dialog/base/Content.d.ts +1 -1
- package/lib/dialog/base/Content.js +2 -3
- package/lib/dialog/base/index.js +2 -3
- package/lib/dialog/form/index.js +3 -8
- package/lib/dialog/types.d.ts +4 -34
- package/lib/form/Field.d.ts +1 -3
- package/lib/form/FieldArray.d.ts +1 -3
- package/lib/form/FieldNumber.d.ts +1 -3
- package/lib/form/FieldNumber.js +1 -1
- package/lib/form/FieldPeriod.d.ts +1 -3
- package/lib/form/helpers.d.ts +1 -3
- package/lib/form/index.d.ts +1 -3
- package/lib/form/types.d.ts +1 -3
- package/lib/form/withFieldHOC.d.ts +1 -3
- package/lib/form/withFormSecurity.d.ts +1 -3
- package/lib/icons/helper.d.ts +4 -12
- package/lib/icons/helper.js +4 -12
- package/lib/inputs/base/InputTextBase.js +2 -1
- package/lib/inputs/errorMessage/index.d.ts +4 -5
- package/lib/inputs/inputHOC.d.ts +4 -5
- package/lib/inputs/mask/imaskHOC.js +203 -0
- package/lib/inputs/number/BaseNumber.d.ts +1 -2
- package/lib/inputs/number/Currency.d.ts +1 -2
- package/lib/inputs/number/Decimal.d.ts +1 -2
- package/lib/inputs/number/index.d.ts +1 -2
- package/lib/inputs/number/types.d.ts +1 -2
- package/lib/inputs/search/index.d.ts +4 -5
- package/lib/inputs/select/ActionButtons.d.ts +4 -5
- package/lib/inputs/select/ActionButtons.js +2 -14
- package/lib/inputs/select/Dropdown.d.ts +4 -5
- package/lib/inputs/select/index.d.ts +1 -3
- package/lib/inputs/select/multiple/Selecteds.d.ts +1 -3
- package/lib/inputs/select/multiple/index.d.ts +1 -3
- package/lib/inputs/select/multiple/index.js +2 -4
- package/lib/inputs/select/simple/index.d.ts +1 -3
- package/lib/inputs/select/simple/index.js +2 -4
- package/lib/inputs/select/types.d.ts +3 -14
- package/lib/inputs/types.d.ts +3 -5
- package/lib/menus/sidenav/popup_menu_help/index.js +85 -0
- package/lib/tabs/DropdownItems.js +62 -0
- package/lib/tabs/MenuItems.js +70 -0
- package/lib/treeview_old/Header.js +29 -0
- package/lib/treeview_old/Node.js +68 -0
- package/lib/treeview_old/index.js +43 -0
- package/package.json +1 -1
- package/lib/assets/styles/wizard.scss +0 -125
- package/lib/dialog/wizard/index.d.ts +0 -13
- package/lib/dialog/wizard/index.js +0 -74
- package/lib/dialog/wizard/progressbar.d.ts +0 -13
- package/lib/dialog/wizard/progressbar.js +0 -36
- package/lib/dialog/wizard/step.d.ts +0 -9
- package/lib/dialog/wizard/step.js +0 -22
- package/lib/dialog/wizard/useWizard.d.ts +0 -9
- package/lib/dialog/wizard/useWizard.js +0 -48
|
@@ -4,6 +4,6 @@ import '../../@types/Align.js';
|
|
|
4
4
|
import '../../@types/Icon.js';
|
|
5
5
|
import '../../icons/helper.js';
|
|
6
6
|
|
|
7
|
-
declare const Content: ({ children, styleForContent
|
|
7
|
+
declare const Content: ({ children, styleForContent }: IContentProps) => JSX.Element;
|
|
8
8
|
|
|
9
9
|
export { Content as default };
|
|
@@ -10,12 +10,11 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
10
10
|
const Content = _ref => {
|
|
11
11
|
let {
|
|
12
12
|
children,
|
|
13
|
-
styleForContent
|
|
14
|
-
className = ''
|
|
13
|
+
styleForContent
|
|
15
14
|
} = _ref;
|
|
16
15
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
17
16
|
id: "modal-dialog-content",
|
|
18
|
-
className: "dialog-content
|
|
17
|
+
className: "dialog-content",
|
|
19
18
|
style: styleForContent
|
|
20
19
|
}, children);
|
|
21
20
|
};
|
package/lib/dialog/base/index.js
CHANGED
|
@@ -21,8 +21,7 @@ const BaseDialog = props => {
|
|
|
21
21
|
overlay = true,
|
|
22
22
|
closeOnEsc,
|
|
23
23
|
closeOnOutsideClick,
|
|
24
|
-
wrapperClassName
|
|
25
|
-
className = '',
|
|
24
|
+
wrapperClassName,
|
|
26
25
|
children,
|
|
27
26
|
open: openProp,
|
|
28
27
|
onOpenChange,
|
|
@@ -113,7 +112,7 @@ const BaseDialog = props => {
|
|
|
113
112
|
className: "modal-overlay",
|
|
114
113
|
"data-testid": "modal-overlay"
|
|
115
114
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
116
|
-
className: "dialog
|
|
115
|
+
className: "dialog",
|
|
117
116
|
"data-testid": "dialog-component"
|
|
118
117
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
119
118
|
className: wrapperClassName,
|
package/lib/dialog/form/index.js
CHANGED
|
@@ -29,10 +29,7 @@ const ModalForm = props => {
|
|
|
29
29
|
width = '50%',
|
|
30
30
|
height = '50%',
|
|
31
31
|
content,
|
|
32
|
-
children
|
|
33
|
-
className = '',
|
|
34
|
-
wrapperClassName = '',
|
|
35
|
-
contentClassName = ''
|
|
32
|
+
children
|
|
36
33
|
} = props;
|
|
37
34
|
const headerRef = (0, _react.useRef)(null);
|
|
38
35
|
const context = (0, _react.useContext)(_withFormSecurity.FormSecurityContext);
|
|
@@ -59,8 +56,7 @@ const ModalForm = props => {
|
|
|
59
56
|
width: width,
|
|
60
57
|
height: height
|
|
61
58
|
}, props, {
|
|
62
|
-
wrapperClassName: "dialog-form-wrapper
|
|
63
|
-
className: className
|
|
59
|
+
wrapperClassName: "dialog-form-wrapper"
|
|
64
60
|
}), props.title && /*#__PURE__*/_react.default.createElement("div", {
|
|
65
61
|
className: "header-form"
|
|
66
62
|
}, /*#__PURE__*/_react.default.createElement(_Header.default, {
|
|
@@ -68,8 +64,7 @@ const ModalForm = props => {
|
|
|
68
64
|
handlerClose: props.handlerClose,
|
|
69
65
|
icon: props.icon
|
|
70
66
|
})), /*#__PURE__*/_react.default.createElement(_Content.default, {
|
|
71
|
-
styleForContent: _objectSpread(_objectSpread({}, props.styleForContent), overlayStyle)
|
|
72
|
-
className: contentClassName
|
|
67
|
+
styleForContent: _objectSpread(_objectSpread({}, props.styleForContent), overlayStyle)
|
|
73
68
|
}, content || children), getSpinner(), showFooter && props.buttons && /*#__PURE__*/_react.default.createElement(_Footer.default, null, /*#__PURE__*/_react.default.createElement(_index.ButtonContainer, _extends({}, props, {
|
|
74
69
|
style: _objectSpread({}, overlayStyle)
|
|
75
70
|
}), _react.default.Children.toArray(props.buttons.map(button => {
|
package/lib/dialog/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactNode, CSSProperties, ReactElement
|
|
1
|
+
import { ReactNode, CSSProperties, ReactElement } from 'react';
|
|
2
2
|
import { TextAlign } from '../@types/Align.js';
|
|
3
3
|
import { IconNames } from '../@types/Icon.js';
|
|
4
4
|
import '../icons/helper.js';
|
|
@@ -6,7 +6,6 @@ import '../icons/helper.js';
|
|
|
6
6
|
interface IContentProps {
|
|
7
7
|
children: ReactNode | ReactNode[];
|
|
8
8
|
styleForContent?: CSSProperties;
|
|
9
|
-
className?: string;
|
|
10
9
|
}
|
|
11
10
|
interface IFooterProps {
|
|
12
11
|
children: ReactElement | ReactElement[];
|
|
@@ -19,11 +18,10 @@ interface IHeaderProps {
|
|
|
19
18
|
titleIcon?: IconNames;
|
|
20
19
|
}
|
|
21
20
|
interface IBaseProps {
|
|
22
|
-
wrapperClassName
|
|
21
|
+
wrapperClassName: string;
|
|
23
22
|
width?: string;
|
|
24
23
|
height?: string;
|
|
25
24
|
children: ReactNode | ReactNode[];
|
|
26
|
-
className?: string;
|
|
27
25
|
closeOnEsc?: boolean;
|
|
28
26
|
closeOnOutsideClick?: boolean;
|
|
29
27
|
overlay?: boolean;
|
|
@@ -33,7 +31,7 @@ interface IBaseProps {
|
|
|
33
31
|
onOpenChange?: (open: boolean) => void;
|
|
34
32
|
handlerClose?: () => void;
|
|
35
33
|
}
|
|
36
|
-
interface IFormProps extends Omit<IBaseProps, 'textAlign' | 'zIndex'> {
|
|
34
|
+
interface IFormProps extends Omit<IBaseProps, 'textAlign' | 'zIndex' | 'wrapperClassName'> {
|
|
37
35
|
buttons?: JSX.Element[];
|
|
38
36
|
styleForContent?: CSSProperties;
|
|
39
37
|
title?: string;
|
|
@@ -41,7 +39,6 @@ interface IFormProps extends Omit<IBaseProps, 'textAlign' | 'zIndex'> {
|
|
|
41
39
|
isWaiting?: boolean;
|
|
42
40
|
icon?: JSX.Element;
|
|
43
41
|
content?: ReactNode;
|
|
44
|
-
contentClassName?: string;
|
|
45
42
|
}
|
|
46
43
|
interface ICommonDialogProps {
|
|
47
44
|
onConfirmClick?: () => void;
|
|
@@ -69,32 +66,5 @@ interface ICustomProps {
|
|
|
69
66
|
interface IFormDialogContext {
|
|
70
67
|
headerRef?: React.RefObject<HTMLDivElement>;
|
|
71
68
|
}
|
|
72
|
-
interface WizardComponentProps extends Omit<IFormProps, 'content'> {
|
|
73
|
-
children: React.ReactNode;
|
|
74
|
-
buttons?: JSX.Element[];
|
|
75
|
-
showProgressbar?: boolean;
|
|
76
|
-
title?: string;
|
|
77
|
-
handlerClose?: () => void;
|
|
78
|
-
controls: WizardControls;
|
|
79
|
-
}
|
|
80
|
-
interface WizardStepComponentProps {
|
|
81
|
-
children: React.ReactNode;
|
|
82
|
-
title: string;
|
|
83
|
-
customClass?: string;
|
|
84
|
-
customStyle?: CSSProperties;
|
|
85
|
-
}
|
|
86
|
-
interface WizardControls extends Omit<UseWizardReturn, 'controls'> {
|
|
87
|
-
setTotalSteps: Dispatch<React.SetStateAction<number>>;
|
|
88
|
-
}
|
|
89
|
-
interface UseWizardReturn {
|
|
90
|
-
changeStep: (nextStep: number) => void;
|
|
91
|
-
nextStep: () => void;
|
|
92
|
-
hasNextStep: boolean;
|
|
93
|
-
previousStep: () => void;
|
|
94
|
-
hasPreviousStep: boolean;
|
|
95
|
-
currentStep: number;
|
|
96
|
-
totalSteps: number;
|
|
97
|
-
controls: WizardControls;
|
|
98
|
-
}
|
|
99
69
|
|
|
100
|
-
export { IBaseProps, ICommonDialogProps, IContentProps, ICustomProps, IFooterProps, IFormDialogContext, IFormProps, IHeaderProps, IQuestionProps
|
|
70
|
+
export { IBaseProps, ICommonDialogProps, IContentProps, ICustomProps, IFooterProps, IFormDialogContext, IFormProps, IHeaderProps, IQuestionProps };
|
package/lib/form/Field.d.ts
CHANGED
|
@@ -2,14 +2,12 @@ import React__default from 'react';
|
|
|
2
2
|
import { IFieldProps } from './types.js';
|
|
3
3
|
import '../inputs/select/types.js';
|
|
4
4
|
import '../@types/Align.js';
|
|
5
|
-
import '../@types/Icon.js';
|
|
6
|
-
import '../icons/helper.js';
|
|
7
|
-
import '../@types/Position.js';
|
|
8
5
|
import '../@types/DataCombo.js';
|
|
9
6
|
import '../@types/PermissionAttr.js';
|
|
10
7
|
import '../inputs/base/types.js';
|
|
11
8
|
import '../@types/Period.js';
|
|
12
9
|
import '../internals/types.js';
|
|
10
|
+
import '../@types/Position.js';
|
|
13
11
|
|
|
14
12
|
declare const _default: React__default.ForwardRefExoticComponent<Pick<IFieldProps & React__default.RefAttributes<unknown>, "key" | keyof IFieldProps> & React__default.RefAttributes<HTMLElement>>;
|
|
15
13
|
|
package/lib/form/FieldArray.d.ts
CHANGED
|
@@ -2,14 +2,12 @@ import React__default from 'react';
|
|
|
2
2
|
import { IFieldArrayProps } from './types.js';
|
|
3
3
|
import '../inputs/select/types.js';
|
|
4
4
|
import '../@types/Align.js';
|
|
5
|
-
import '../@types/Icon.js';
|
|
6
|
-
import '../icons/helper.js';
|
|
7
|
-
import '../@types/Position.js';
|
|
8
5
|
import '../@types/DataCombo.js';
|
|
9
6
|
import '../@types/PermissionAttr.js';
|
|
10
7
|
import '../inputs/base/types.js';
|
|
11
8
|
import '../@types/Period.js';
|
|
12
9
|
import '../internals/types.js';
|
|
10
|
+
import '../@types/Position.js';
|
|
13
11
|
|
|
14
12
|
declare const _default: React__default.ForwardRefExoticComponent<IFieldArrayProps & React__default.RefAttributes<HTMLElement>>;
|
|
15
13
|
|
|
@@ -2,14 +2,12 @@ import React__default from 'react';
|
|
|
2
2
|
import { IFieldProps } from './types.js';
|
|
3
3
|
import '../inputs/select/types.js';
|
|
4
4
|
import '../@types/Align.js';
|
|
5
|
-
import '../@types/Icon.js';
|
|
6
|
-
import '../icons/helper.js';
|
|
7
|
-
import '../@types/Position.js';
|
|
8
5
|
import '../@types/DataCombo.js';
|
|
9
6
|
import '../@types/PermissionAttr.js';
|
|
10
7
|
import '../inputs/base/types.js';
|
|
11
8
|
import '../@types/Period.js';
|
|
12
9
|
import '../internals/types.js';
|
|
10
|
+
import '../@types/Position.js';
|
|
13
11
|
|
|
14
12
|
declare const _default: React__default.ForwardRefExoticComponent<IFieldProps & React__default.RefAttributes<HTMLElement>>;
|
|
15
13
|
|
package/lib/form/FieldNumber.js
CHANGED
|
@@ -31,7 +31,7 @@ const getEventProps = _ref => {
|
|
|
31
31
|
} = _ref;
|
|
32
32
|
return {
|
|
33
33
|
onBlur: e => {
|
|
34
|
-
if (handlerFieldChange) handlerFieldChange(e);
|
|
34
|
+
if ((component === null || component === void 0 ? void 0 : component.name) !== 'NumberField' && handlerFieldChange) handlerFieldChange(e);
|
|
35
35
|
if (validators && handlerFieldValidate) handlerFieldValidate(name, e.target.value, validators);
|
|
36
36
|
if (onBlur) onBlur(e);
|
|
37
37
|
},
|
|
@@ -2,14 +2,12 @@ import React__default from 'react';
|
|
|
2
2
|
import { IFieldPeriodProps } from './types.js';
|
|
3
3
|
import '../inputs/select/types.js';
|
|
4
4
|
import '../@types/Align.js';
|
|
5
|
-
import '../@types/Icon.js';
|
|
6
|
-
import '../icons/helper.js';
|
|
7
|
-
import '../@types/Position.js';
|
|
8
5
|
import '../@types/DataCombo.js';
|
|
9
6
|
import '../@types/PermissionAttr.js';
|
|
10
7
|
import '../inputs/base/types.js';
|
|
11
8
|
import '../@types/Period.js';
|
|
12
9
|
import '../internals/types.js';
|
|
10
|
+
import '../@types/Position.js';
|
|
13
11
|
|
|
14
12
|
declare const _default: React__default.ForwardRefExoticComponent<IFieldPeriodProps & React__default.RefAttributes<HTMLElement>>;
|
|
15
13
|
|
package/lib/form/helpers.d.ts
CHANGED
|
@@ -2,14 +2,12 @@ import React__default from 'react';
|
|
|
2
2
|
import { FormContextProps, IWithFieldContext, IGetErrorMessagesParams, Validator } from './types.js';
|
|
3
3
|
import '../inputs/select/types.js';
|
|
4
4
|
import '../@types/Align.js';
|
|
5
|
-
import '../@types/Icon.js';
|
|
6
|
-
import '../icons/helper.js';
|
|
7
|
-
import '../@types/Position.js';
|
|
8
5
|
import '../@types/DataCombo.js';
|
|
9
6
|
import '../@types/PermissionAttr.js';
|
|
10
7
|
import '../inputs/base/types.js';
|
|
11
8
|
import '../@types/Period.js';
|
|
12
9
|
import '../internals/types.js';
|
|
10
|
+
import '../@types/Position.js';
|
|
13
11
|
|
|
14
12
|
declare const securityBeforeUnload = "securityBeforeUnload";
|
|
15
13
|
declare const FormContext: React__default.Context<FormContextProps>;
|
package/lib/form/index.d.ts
CHANGED
|
@@ -6,14 +6,12 @@ import { FormProps } from './types.js';
|
|
|
6
6
|
import 'react';
|
|
7
7
|
import '../inputs/select/types.js';
|
|
8
8
|
import '../@types/Align.js';
|
|
9
|
-
import '../@types/Icon.js';
|
|
10
|
-
import '../icons/helper.js';
|
|
11
|
-
import '../@types/Position.js';
|
|
12
9
|
import '../@types/DataCombo.js';
|
|
13
10
|
import '../@types/PermissionAttr.js';
|
|
14
11
|
import '../inputs/base/types.js';
|
|
15
12
|
import '../@types/Period.js';
|
|
16
13
|
import '../internals/types.js';
|
|
14
|
+
import '../@types/Position.js';
|
|
17
15
|
|
|
18
16
|
declare const Form: ({ submitOnPressEnterKey, dataSource, securityBeforeUnload, handlerReset, handlerSubmit, handlerValidates, style, customClass, securityTitle, securityText, securityData, onDataChange, onValidateForm, externalFieldErrors, onSubmit, skeletonize, disabled, children, useInternalState, }: FormProps) => JSX.Element;
|
|
19
17
|
|
package/lib/form/types.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { ChangeEvent, ComponentType, MouseEventHandler, ReactNode, CSSProperties } from 'react';
|
|
2
2
|
import { AllOptions } from '../inputs/select/types.js';
|
|
3
3
|
import '../@types/Align.js';
|
|
4
|
-
import '../@types/Icon.js';
|
|
5
|
-
import '../icons/helper.js';
|
|
6
|
-
import '../@types/Position.js';
|
|
7
4
|
import '../@types/DataCombo.js';
|
|
8
5
|
import '../@types/PermissionAttr.js';
|
|
9
6
|
import '../inputs/base/types.js';
|
|
10
7
|
import '../@types/Period.js';
|
|
11
8
|
import '../internals/types.js';
|
|
9
|
+
import '../@types/Position.js';
|
|
12
10
|
|
|
13
11
|
type Validator = (value: string) => string | undefined;
|
|
14
12
|
type PeriodValidator = (value: {
|
|
@@ -2,14 +2,12 @@ import React__default from 'react';
|
|
|
2
2
|
import { WithFieldProps } from './types.js';
|
|
3
3
|
import '../inputs/select/types.js';
|
|
4
4
|
import '../@types/Align.js';
|
|
5
|
-
import '../@types/Icon.js';
|
|
6
|
-
import '../icons/helper.js';
|
|
7
|
-
import '../@types/Position.js';
|
|
8
5
|
import '../@types/DataCombo.js';
|
|
9
6
|
import '../@types/PermissionAttr.js';
|
|
10
7
|
import '../inputs/base/types.js';
|
|
11
8
|
import '../@types/Period.js';
|
|
12
9
|
import '../internals/types.js';
|
|
10
|
+
import '../@types/Position.js';
|
|
13
11
|
|
|
14
12
|
declare const withFieldHOC: <ComponentProps extends WithFieldProps>(WrappedComponent: React__default.ComponentType<ComponentProps>) => React__default.ForwardRefExoticComponent<React__default.PropsWithoutRef<ComponentProps> & React__default.RefAttributes<HTMLElement>>;
|
|
15
13
|
|
|
@@ -2,14 +2,12 @@ import React__default from 'react';
|
|
|
2
2
|
import { IFormSecurityContext, IWithFormSecurity } from './types.js';
|
|
3
3
|
import '../inputs/select/types.js';
|
|
4
4
|
import '../@types/Align.js';
|
|
5
|
-
import '../@types/Icon.js';
|
|
6
|
-
import '../icons/helper.js';
|
|
7
|
-
import '../@types/Position.js';
|
|
8
5
|
import '../@types/DataCombo.js';
|
|
9
6
|
import '../@types/PermissionAttr.js';
|
|
10
7
|
import '../inputs/base/types.js';
|
|
11
8
|
import '../@types/Period.js';
|
|
12
9
|
import '../internals/types.js';
|
|
10
|
+
import '../@types/Position.js';
|
|
13
11
|
|
|
14
12
|
declare const FormSecurityContext: React__default.Context<IFormSecurityContext>;
|
|
15
13
|
declare const withFormSecurity: <ComponentProps extends IWithFormSecurity>(WrappedComponent: React__default.ComponentType<ComponentProps>) => (props: ComponentProps) => JSX.Element;
|
package/lib/icons/helper.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ declare const _default: {
|
|
|
19
19
|
viewbox: string;
|
|
20
20
|
paths: string[];
|
|
21
21
|
};
|
|
22
|
+
supplier: {
|
|
23
|
+
viewbox: string;
|
|
24
|
+
paths: string[];
|
|
25
|
+
};
|
|
22
26
|
mail: {
|
|
23
27
|
viewbox: string;
|
|
24
28
|
paths: string[];
|
|
@@ -607,18 +611,6 @@ declare const _default: {
|
|
|
607
611
|
viewbox: string;
|
|
608
612
|
paths: string[];
|
|
609
613
|
};
|
|
610
|
-
similarity: {
|
|
611
|
-
viewbox: string;
|
|
612
|
-
paths: string[];
|
|
613
|
-
};
|
|
614
|
-
fileStack: {
|
|
615
|
-
viewbox: string;
|
|
616
|
-
paths: string[];
|
|
617
|
-
};
|
|
618
|
-
tree: {
|
|
619
|
-
viewbox: string;
|
|
620
|
-
paths: string[];
|
|
621
|
-
};
|
|
622
614
|
};
|
|
623
615
|
|
|
624
616
|
export { _default as default };
|
package/lib/icons/helper.js
CHANGED
|
@@ -25,6 +25,10 @@ var _default = exports.default = {
|
|
|
25
25
|
viewbox: '0 0 16 16',
|
|
26
26
|
paths: ['M4 5c0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.209-1.791 4-4 4s-4-1.791-4-4zM12 10h-8c-2.209 0-4 1.791-4 4v1h16v-1c0-2.209-1.791-4-4-4z']
|
|
27
27
|
},
|
|
28
|
+
supplier: {
|
|
29
|
+
viewbox: '0 0 16 16',
|
|
30
|
+
paths: ['M12 12.041v-0.825c1.101-0.621 2-2.168 2-3.716 0-2.485 0-4.5-3-4.5s-3 2.015-3 4.5c0 1.548 0.898 3.095 2 3.716v0.825c-3.392 0.277-6 1.944-6 3.959h14c0-2.015-2.608-3.682-6-3.959z', 'M3.242 9.625c-0.212 0.077-0.416 0.161-0.611 0.25h4.782c-0.038-0.083-0.075-0.166-0.109-0.25h-4.062z', 'M0.425 11.625c-0.053 0.082-0.101 0.165-0.144 0.25h5.834c0.192-0.089 0.389-0.172 0.593-0.25h-6.284z', 'M1.367 10.625c-0.105 0.081-0.204 0.164-0.299 0.25h6.933c-0.060-0.081-0.118-0.165-0.174-0.25h-6.461z', 'M5.261 9.125c-0.424 0.062-0.833 0.146-1.222 0.25h3.17c-0.030-0.083-0.057-0.166-0.083-0.25h-1.864z', 'M6 8.625v0.25h1.054c-0.022-0.083-0.041-0.166-0.059-0.25h-0.995z', 'M5.851 8.125c0.049 0.032 0.099 0.063 0.149 0.091v0.159h0.947c-0.014-0.083-0.025-0.167-0.035-0.25h-1.062z', 'M0.030 12.625c-0.013 0.083-0.022 0.166-0.027 0.25h4.501c0.102-0.085 0.209-0.169 0.321-0.25h-4.795z', 'M1.719 10.375h5.955c-0.024-0.042-0.048-0.084-0.072-0.127-0.022-0.041-0.044-0.082-0.066-0.123h-5.402c-0.145 0.080-0.283 0.163-0.415 0.25z', 'M4.005 3.625c-0.002 0.083-0.003 0.166-0.003 0.25h3.339c0.004-0.009 0.008-0.018 0.012-0.028 0.035-0.076 0.073-0.15 0.112-0.222h-3.46z', 'M0.168 12.125c-0.032 0.082-0.060 0.166-0.083 0.25h5.109c0.136-0.087 0.277-0.17 0.423-0.25h-5.449z', 'M4.643 0.875h4.713c-0.070-0.089-0.148-0.173-0.234-0.25h-4.245c-0.086 0.077-0.164 0.161-0.234 0.25z', 'M0.602 11.375h6.845c0.256-0.076 0.519-0.145 0.787-0.204-0.013-0.015-0.025-0.030-0.038-0.046h-7.381c-0.076 0.082-0.147 0.165-0.213 0.25z', 'M5.255 7.625c0.085 0.089 0.173 0.173 0.263 0.25h1.371c-0.006-0.083-0.010-0.167-0.012-0.25h-1.622z', 'M4.848 7.125c0.060 0.086 0.123 0.17 0.188 0.25h1.84c0-0.084 0-0.167 0-0.25h-2.027z', 'M4.255 1.625c-0.027 0.081-0.050 0.164-0.072 0.25h5.632c-0.021-0.086-0.045-0.169-0.072-0.25h-5.489z', 'M4.13 2.125c-0.015 0.082-0.029 0.165-0.041 0.25h4.625c0.179-0.098 0.372-0.181 0.578-0.25h-5.162z', 'M4.022 3.125c-0.004 0.082-0.008 0.166-0.010 0.25h3.605c0.058-0.087 0.12-0.17 0.185-0.25h-3.78z', 'M4.059 2.625c-0.008 0.082-0.016 0.165-0.022 0.25h3.995c0.092-0.089 0.189-0.173 0.292-0.25h-4.265z', 'M5.866 0.125c-0.243 0.062-0.455 0.146-0.638 0.25h3.544c-0.184-0.104-0.396-0.188-0.639-0.25h-2.266z', 'M4.544 6.625c0.045 0.085 0.092 0.169 0.141 0.25h2.192c0.001-0.084 0.002-0.167 0.003-0.25h-2.336z', 'M4.475 1.125c-0.046 0.080-0.088 0.163-0.125 0.25h5.3c-0.037-0.087-0.079-0.17-0.125-0.25h-5.050z', 'M4.152 5.625c0.022 0.084 0.048 0.167 0.074 0.25h2.683c0.005-0.084 0.012-0.167 0.019-0.25h-2.777z', 'M4.316 6.125c0.033 0.085 0.068 0.168 0.105 0.25h2.464c0.003-0.084 0.006-0.167 0.009-0.25h-2.579z', 'M4 4.125c-0 0.083-0 0.166-0 0.25h3.155c0.025-0.085 0.053-0.168 0.084-0.25h-3.238z', 'M4.002 4.625c0.003 0.083 0.008 0.167 0.016 0.25h3.014c0.016-0.084 0.035-0.168 0.055-0.25h-3.085z', 'M4.048 5.125c0.013 0.084 0.027 0.167 0.045 0.25h2.862c0.010-0.084 0.021-0.167 0.034-0.25h-2.941z']
|
|
31
|
+
},
|
|
28
32
|
mail: {
|
|
29
33
|
viewbox: '0 0 16 16',
|
|
30
34
|
paths: ['M13.333 0h-10.666c-1.467 0-2.667 1.2-2.667 2.667v10.666c0 1.468 1.2 2.667 2.667 2.667h10.666c1.467 0 2.667-1.199 2.667-2.667v-10.666c0-1.467-1.2-2.667-2.667-2.667zM2.854 13.854l-1.207-1.207 4-4 0.457 0.457-3.25 4.75zM2.396 3.104l0.457-0.457 5.146 4.146 5.146-4.146 0.457 0.457-5.604 6.604-5.604-6.604zM13.146 13.854l-3.25-4.75 0.457-0.457 4 4-1.207 1.207z']
|
|
@@ -612,17 +616,5 @@ var _default = exports.default = {
|
|
|
612
616
|
user_block: {
|
|
613
617
|
viewbox: '0 0 16 16',
|
|
614
618
|
paths: ['M7.5 16h-6.977c-0.14 0-0.274-0.059-0.369-0.163s-0.141-0.242-0.129-0.382c0.11-1.22 0.585-2.363 1.373-3.305 0.697-0.832 1.59-1.452 2.602-1.809l0-0.475c-0.562-0.385-1.037-0.926-1.385-1.582-0.402-0.758-0.615-1.634-0.615-2.535 0-1.251 0.405-2.431 1.139-3.323 0.758-0.92 1.774-1.427 2.861-1.427 2.119 0 3.874 1.966 3.993 4.476 0.013 0.276-0.2 0.51-0.476 0.523s-0.51-0.2-0.523-0.476c-0.094-1.976-1.41-3.524-2.995-3.524-1.654 0-3 1.682-3 3.75 0 1.457 0.687 2.795 1.75 3.408 0.155 0.089 0.25 0.254 0.25 0.433l-0 1.116c0 0.224-0.149 0.42-0.364 0.481-0.967 0.274-1.822 0.828-2.471 1.604-0.538 0.643-0.901 1.397-1.064 2.208h6.4c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z', 'M11.5 7c-2.481 0-4.5 2.019-4.5 4.5s2.019 4.5 4.5 4.5 4.5-2.019 4.5-4.5-2.019-4.5-4.5-4.5zM8 11.5c0-1.93 1.57-3.5 3.5-3.5 0.785 0 1.511 0.26 2.095 0.698l-4.897 4.897c-0.438-0.584-0.698-1.31-0.698-2.095zM11.5 15c-0.785 0-1.511-0.26-2.095-0.698l4.897-4.897c0.438 0.584 0.698 1.31 0.698 2.095 0 1.93-1.57 3.5-3.5 3.5z']
|
|
615
|
-
},
|
|
616
|
-
similarity: {
|
|
617
|
-
viewbox: '0 0 16 16',
|
|
618
|
-
paths: ['M13 4h-3v-1l-3-3h-7v12h6v4h10v-9l-3-3zM13 5.414l1.586 1.586h-1.586v-1.586zM7 1.414l1.586 1.586h-1.586v-1.586zM1 1h5v3h3v7h-8v-10zM15 15h-8v-3h3v-7h2v3h3v7z']
|
|
619
|
-
},
|
|
620
|
-
fileStack: {
|
|
621
|
-
viewbox: '0 0 16 16',
|
|
622
|
-
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']
|
|
623
|
-
},
|
|
624
|
-
tree: {
|
|
625
|
-
viewbox: '0 0 16 16',
|
|
626
|
-
paths: ['M15.25 12h-0.25v-3.25c0-0.965-0.785-1.75-1.75-1.75h-4.25v-2h0.25c0.412 0 0.75-0.338 0.75-0.75v-2.5c0-0.413-0.338-0.75-0.75-0.75h-2.5c-0.412 0-0.75 0.337-0.75 0.75v2.5c0 0.412 0.338 0.75 0.75 0.75h0.25v2h-4.25c-0.965 0-1.75 0.785-1.75 1.75v3.25h-0.25c-0.412 0-0.75 0.338-0.75 0.75v2.5c0 0.412 0.338 0.75 0.75 0.75h2.5c0.413 0 0.75-0.338 0.75-0.75v-2.5c0-0.412-0.337-0.75-0.75-0.75h-0.25v-3h4v3h-0.25c-0.412 0-0.75 0.338-0.75 0.75v2.5c0 0.412 0.338 0.75 0.75 0.75h2.5c0.412 0 0.75-0.338 0.75-0.75v-2.5c0-0.412-0.338-0.75-0.75-0.75h-0.25v-3h4v3h-0.25c-0.412 0-0.75 0.338-0.75 0.75v2.5c0 0.412 0.338 0.75 0.75 0.75h2.5c0.412 0 0.75-0.338 0.75-0.75v-2.5c0-0.412-0.338-0.75-0.75-0.75zM3 15h-2v-2h2v2zM9 15h-2v-2h2v2zM7 4v-2h2v2h-2zM15 15h-2v-2h2v2z']
|
|
627
619
|
}
|
|
628
620
|
};
|
|
@@ -219,7 +219,8 @@ const InputTextBase = props => {
|
|
|
219
219
|
className: "inputcontent ".concat(customClassForInputContent)
|
|
220
220
|
}, type === 'textarea' ? /*#__PURE__*/_react.default.createElement("textarea", _extends({
|
|
221
221
|
rows: props.rows,
|
|
222
|
-
cols: props.cols
|
|
222
|
+
cols: props.cols,
|
|
223
|
+
tabIndex: applyTabIndex()
|
|
223
224
|
}, inputProps())) : /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
224
225
|
autoComplete: autoComplete,
|
|
225
226
|
tabIndex: applyTabIndex(),
|
|
@@ -2,15 +2,14 @@ import React__default from 'react';
|
|
|
2
2
|
import { ErrorProps } from '../types.js';
|
|
3
3
|
import '../../@types/PermissionAttr.js';
|
|
4
4
|
import '../../@types/DataCombo.js';
|
|
5
|
-
import '../select/types.js';
|
|
6
|
-
import '../../@types/Align.js';
|
|
7
|
-
import '../../@types/Icon.js';
|
|
8
|
-
import '../../icons/helper.js';
|
|
9
|
-
import '../../@types/Position.js';
|
|
10
5
|
import '../base/types.js';
|
|
6
|
+
import '../../@types/Align.js';
|
|
11
7
|
import '../../@types/Period.js';
|
|
12
8
|
import '../../internals/types.js';
|
|
9
|
+
import '../../@types/Position.js';
|
|
13
10
|
import '../../drawer/types.js';
|
|
11
|
+
import '../../@types/Icon.js';
|
|
12
|
+
import '../../icons/helper.js';
|
|
14
13
|
|
|
15
14
|
declare const ErrorMessage: React__default.ForwardRefExoticComponent<ErrorProps & React__default.RefAttributes<HTMLParagraphElement>>;
|
|
16
15
|
|
package/lib/inputs/inputHOC.d.ts
CHANGED
|
@@ -2,15 +2,14 @@ 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
|
-
import '../@types/Align.js';
|
|
7
|
-
import '../@types/Icon.js';
|
|
8
|
-
import '../icons/helper.js';
|
|
9
|
-
import '../@types/Position.js';
|
|
10
5
|
import './base/types.js';
|
|
6
|
+
import '../@types/Align.js';
|
|
11
7
|
import '../@types/Period.js';
|
|
12
8
|
import '../internals/types.js';
|
|
9
|
+
import '../@types/Position.js';
|
|
13
10
|
import '../drawer/types.js';
|
|
11
|
+
import '../@types/Icon.js';
|
|
12
|
+
import '../icons/helper.js';
|
|
14
13
|
|
|
15
14
|
declare const InputHOC: <ComponentProps extends IInputHOCProps>(WrappedComponent: React__default.ComponentType<ComponentProps>) => (props: ComponentProps) => JSX.Element;
|
|
16
15
|
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _imask = _interopRequireDefault(require("imask"));
|
|
9
|
+
var helpers = _interopRequireWildcard(require("./helpers"));
|
|
10
|
+
var _permissionValidations = require("../../permissionValidations");
|
|
11
|
+
var _format_number = require("../number/format_number");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
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); }
|
|
16
|
+
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
|
|
17
|
+
const IMaskHOC = ComposedComponent => {
|
|
18
|
+
const MaskedComponent = props => {
|
|
19
|
+
const {
|
|
20
|
+
permissionAttr,
|
|
21
|
+
skeletonize,
|
|
22
|
+
inputRef,
|
|
23
|
+
placeholderChar = '_',
|
|
24
|
+
lazy = false,
|
|
25
|
+
pattern = '',
|
|
26
|
+
radix = ' ',
|
|
27
|
+
thousandsSeparator = '',
|
|
28
|
+
mapToRadix = [],
|
|
29
|
+
scale = 2,
|
|
30
|
+
signed = false,
|
|
31
|
+
normalizeZeros = true,
|
|
32
|
+
padFractionalZeros = true,
|
|
33
|
+
mask,
|
|
34
|
+
commit = () => {},
|
|
35
|
+
parse,
|
|
36
|
+
format,
|
|
37
|
+
definitions,
|
|
38
|
+
groups,
|
|
39
|
+
min,
|
|
40
|
+
max,
|
|
41
|
+
dispatch,
|
|
42
|
+
value = '',
|
|
43
|
+
onChange,
|
|
44
|
+
isDateField = false,
|
|
45
|
+
autoCompleteMask
|
|
46
|
+
} = props;
|
|
47
|
+
const maskOptions = {
|
|
48
|
+
placeholderChar: placeholderChar === '' ? ' ' : placeholderChar,
|
|
49
|
+
lazy,
|
|
50
|
+
pattern,
|
|
51
|
+
radix,
|
|
52
|
+
thousandsSeparator,
|
|
53
|
+
mapToRadix,
|
|
54
|
+
scale,
|
|
55
|
+
signed,
|
|
56
|
+
normalizeZeros,
|
|
57
|
+
padFractionalZeros,
|
|
58
|
+
mask,
|
|
59
|
+
commit,
|
|
60
|
+
parse,
|
|
61
|
+
format,
|
|
62
|
+
definitions,
|
|
63
|
+
groups,
|
|
64
|
+
min,
|
|
65
|
+
max,
|
|
66
|
+
dispatch
|
|
67
|
+
};
|
|
68
|
+
const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr));
|
|
69
|
+
const elementRef = (0, _react.useRef)(null);
|
|
70
|
+
const maskRef = (0, _react.useRef)(null);
|
|
71
|
+
const {
|
|
72
|
+
hideContent,
|
|
73
|
+
unvisible,
|
|
74
|
+
disabled,
|
|
75
|
+
readOnly
|
|
76
|
+
} = onDenied;
|
|
77
|
+
const dontInitMask = hideContent || unvisible || skeletonize;
|
|
78
|
+
const disableCallbacks = disabled || readOnly;
|
|
79
|
+
const setValue = newValue => {
|
|
80
|
+
if (maskRef.current) {
|
|
81
|
+
if (props.unmask) maskRef.current.unmaskedValue = newValue.toString();
|
|
82
|
+
maskRef.current.value = String(newValue);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
const onAccept = (0, _react.useCallback)(() => {
|
|
86
|
+
if (onChange && !disableCallbacks && maskRef.current) {
|
|
87
|
+
const {
|
|
88
|
+
unmaskedValue,
|
|
89
|
+
el
|
|
90
|
+
} = maskRef.current;
|
|
91
|
+
const name = el.name || el.input && el.input.name;
|
|
92
|
+
onChange({
|
|
93
|
+
target: {
|
|
94
|
+
value: unmaskedValue,
|
|
95
|
+
name
|
|
96
|
+
}
|
|
97
|
+
}, props.unmask ? unmaskedValue : maskRef.current.value);
|
|
98
|
+
}
|
|
99
|
+
}, [onChange]);
|
|
100
|
+
const onComplete = (0, _react.useCallback)(() => {
|
|
101
|
+
if (props.onComplete && !disableCallbacks && maskRef.current) {
|
|
102
|
+
const {
|
|
103
|
+
unmaskedValue,
|
|
104
|
+
el
|
|
105
|
+
} = maskRef.current;
|
|
106
|
+
const name = el.name || el.input && el.input.name;
|
|
107
|
+
props.onComplete({
|
|
108
|
+
target: {
|
|
109
|
+
value: unmaskedValue,
|
|
110
|
+
name
|
|
111
|
+
}
|
|
112
|
+
}, props.unmask ? unmaskedValue : maskRef.current.value);
|
|
113
|
+
}
|
|
114
|
+
}, [props.onComplete]);
|
|
115
|
+
const autoCompleteMaskValue = (0, _react.useCallback)(eventTargetValue => {
|
|
116
|
+
if (autoCompleteMask && eventTargetValue.length && maskRef.current && elementRef.current) {
|
|
117
|
+
const sizeMask = maskRef.current.mask.toString().replace(/\D+/g, '').length;
|
|
118
|
+
if (sizeMask > eventTargetValue.length) {
|
|
119
|
+
switch (autoCompleteMask) {
|
|
120
|
+
case 'left':
|
|
121
|
+
setValue(eventTargetValue.padStart(sizeMask, '0'));
|
|
122
|
+
break;
|
|
123
|
+
case 'right':
|
|
124
|
+
setValue(eventTargetValue.padEnd(sizeMask, '0'));
|
|
125
|
+
break;
|
|
126
|
+
default:
|
|
127
|
+
setValue(eventTargetValue);
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}, [autoCompleteMask, maskRef.current, elementRef.current]);
|
|
133
|
+
const getMask = () => {
|
|
134
|
+
const element = elementRef.current;
|
|
135
|
+
if (element) {
|
|
136
|
+
const maskCurrent = maskRef.current;
|
|
137
|
+
if (!maskCurrent) {
|
|
138
|
+
maskRef.current = (0, _imask.default)(element, maskOptions);
|
|
139
|
+
if (value && typeof value !== 'number' && value.trim() !== '' || value && typeof value === 'number') onAccept();
|
|
140
|
+
setValue(value);
|
|
141
|
+
} else {
|
|
142
|
+
maskCurrent.updateOptions(maskOptions);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
const destroyMask = () => {
|
|
147
|
+
if (maskRef.current) {
|
|
148
|
+
maskRef.current.destroy();
|
|
149
|
+
maskRef.current = null;
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
(0, _react.useEffect)(() => {
|
|
153
|
+
if (props.handlerSetOnDenied) props.handlerSetOnDenied(onDenied);
|
|
154
|
+
if (!props.mask || dontInitMask) return;
|
|
155
|
+
getMask();
|
|
156
|
+
}, [maskOptions]);
|
|
157
|
+
(0, _react.useEffect)(() => {
|
|
158
|
+
if (!maskRef.current) return;
|
|
159
|
+
const maskCurrent = maskRef.current;
|
|
160
|
+
maskCurrent.on('accept', onAccept);
|
|
161
|
+
maskCurrent.on('complete', onComplete);
|
|
162
|
+
|
|
163
|
+
// eslint-disable-next-line consistent-return
|
|
164
|
+
return () => {
|
|
165
|
+
maskCurrent.off('accept', onAccept);
|
|
166
|
+
maskCurrent.off('complete', onComplete);
|
|
167
|
+
};
|
|
168
|
+
}, [onAccept, onComplete]);
|
|
169
|
+
(0, _react.useEffect)(() => {
|
|
170
|
+
if (maskOptions.mask && !dontInitMask) {
|
|
171
|
+
if (maskRef.current) {
|
|
172
|
+
const formattedValue = isDateField ? value : (0, _format_number.numberToPtBR)(value) || '';
|
|
173
|
+
setValue(formattedValue);
|
|
174
|
+
} else {
|
|
175
|
+
getMask();
|
|
176
|
+
}
|
|
177
|
+
} else if (!dontInitMask) {
|
|
178
|
+
destroyMask();
|
|
179
|
+
if (value && elementRef.current) elementRef.current.value = value;
|
|
180
|
+
}
|
|
181
|
+
}, [value, isDateField]);
|
|
182
|
+
(0, _react.useEffect)(() => destroyMask, []);
|
|
183
|
+
return /*#__PURE__*/_react.default.createElement(ComposedComponent, _extends({}, helpers.extractNonMaskProps(props, maskOptions), {
|
|
184
|
+
onDeniedActions: onDenied,
|
|
185
|
+
defaultValue: value,
|
|
186
|
+
onBlur: e => {
|
|
187
|
+
autoCompleteMaskValue(e.target.value);
|
|
188
|
+
if (props.onBlur) props.onBlur(e);
|
|
189
|
+
},
|
|
190
|
+
onChange: e => setValue(e.target.value),
|
|
191
|
+
inputRef: el => {
|
|
192
|
+
elementRef.current = el;
|
|
193
|
+
if (inputRef) {
|
|
194
|
+
if (typeof inputRef === 'object') inputRef.current = el;else inputRef(el);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
}));
|
|
198
|
+
};
|
|
199
|
+
const nestedComponentName = ComposedComponent.displayName || ComposedComponent.name || 'Component';
|
|
200
|
+
MaskedComponent.displayName = "IMask(".concat(nestedComponentName, ")");
|
|
201
|
+
return MaskedComponent;
|
|
202
|
+
};
|
|
203
|
+
var _default = exports.default = IMaskHOC;
|