linear-react-components-ui 1.1.0-beta.6 → 1.1.0
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/babel.config.json +2 -2
- package/lib/alerts/AlertContainer.js +46 -54
- package/lib/alerts/AlertProvider.js +36 -53
- package/lib/alerts/BaseAlert.js +14 -20
- package/lib/alerts/Message.js +37 -46
- package/lib/alerts/helpers.js +3 -3
- package/lib/alerts/index.js +5 -5
- package/lib/alerts/withAlert.js +11 -11
- package/lib/assets/styles/checkbox.scss +0 -8
- package/lib/avatar/index.js +42 -41
- package/lib/badge/index.js +15 -16
- package/lib/buttons/ActivateButton.js +6 -8
- package/lib/buttons/AddButton.js +9 -11
- package/lib/buttons/Button.js +11 -11
- package/lib/buttons/ButtonGroups.js +8 -6
- package/lib/buttons/CancelButton.js +9 -7
- package/lib/buttons/DangerButton.js +9 -7
- package/lib/buttons/DefaultButton.js +66 -85
- package/lib/buttons/DestroyButton.js +10 -8
- package/lib/buttons/EditButton.js +6 -8
- package/lib/buttons/InactivateButton.js +6 -8
- package/lib/buttons/InfoButton.js +9 -7
- package/lib/buttons/PrimaryButton.js +9 -7
- package/lib/buttons/RestoreButton.js +6 -8
- package/lib/buttons/SaveButton.js +9 -7
- package/lib/buttons/SuccessButton.js +9 -7
- package/lib/buttons/WarningButton.js +9 -7
- package/lib/buttons/button_container/index.js +16 -19
- package/lib/buttons/index.js +31 -31
- package/lib/buttons/split_button/index.js +24 -26
- package/lib/calendar/DangerCalendar.js +9 -7
- package/lib/calendar/InfoCalendar.js +9 -7
- package/lib/calendar/PrimaryCalendar.js +9 -7
- package/lib/calendar/SuccessCalendar.js +9 -7
- package/lib/calendar/WarningCalendar.js +9 -7
- package/lib/calendar/base/Day.js +16 -14
- package/lib/calendar/base/Month.js +15 -19
- package/lib/calendar/base/Week.js +15 -19
- package/lib/calendar/base/helpers.js +17 -15
- package/lib/calendar/base/index.js +38 -51
- package/lib/calendar/index.js +13 -13
- package/lib/checkbox/Label.js +10 -8
- package/lib/checkbox/index.d.ts +1 -1
- package/lib/checkbox/index.js +75 -97
- package/lib/checkbox/types.d.ts +0 -1
- package/lib/dialog/Alert.js +7 -7
- package/lib/dialog/Custom.js +20 -23
- package/lib/dialog/Error.js +7 -7
- package/lib/dialog/Information.js +7 -7
- package/lib/dialog/Question.js +16 -16
- package/lib/dialog/Warning.js +7 -7
- package/lib/dialog/base/Content.js +9 -7
- package/lib/dialog/base/Footer.js +6 -8
- package/lib/dialog/base/Header.js +32 -34
- package/lib/dialog/base/index.js +64 -72
- package/lib/dialog/base/style.js +8 -10
- package/lib/dialog/form/index.js +35 -38
- package/lib/dialog/index.js +15 -15
- package/lib/drawer/Content.js +14 -12
- package/lib/drawer/Drawer.js +68 -82
- package/lib/drawer/Header.js +45 -48
- package/lib/drawer/helpers.js +4 -4
- package/lib/drawer/index.js +7 -7
- package/lib/dropdown/Popup.js +37 -40
- package/lib/dropdown/helper.js +6 -6
- package/lib/dropdown/withDropdown.js +44 -63
- package/lib/fieldset/index.js +49 -56
- package/lib/form/Field.js +73 -79
- package/lib/form/FieldArray.js +76 -85
- package/lib/form/FieldNumber.js +34 -42
- package/lib/form/FieldPeriod.js +54 -59
- package/lib/form/helpers.js +29 -28
- package/lib/form/index.js +121 -151
- package/lib/form/withFieldHOC.js +36 -42
- package/lib/form/withFormSecurity.js +27 -35
- package/lib/gridlayout/GridCol.js +16 -15
- package/lib/gridlayout/GridRow.js +11 -12
- package/lib/gridlayout/index.js +5 -5
- package/lib/hint/index.js +25 -29
- package/lib/icons/helper.js +2 -2
- package/lib/icons/index.js +37 -48
- package/lib/index.js +19 -19
- package/lib/inputs/base/InputTextBase.js +99 -109
- package/lib/inputs/base/helpers.js +29 -23
- package/lib/inputs/color/index.js +34 -44
- package/lib/inputs/date/Dialog.js +10 -8
- package/lib/inputs/date/Dropdown.js +14 -12
- package/lib/inputs/date/helpers.js +18 -14
- package/lib/inputs/date/index.js +96 -133
- package/lib/inputs/file/DefaultFile.js +50 -74
- package/lib/inputs/file/DragDropFile.js +119 -172
- package/lib/inputs/file/File.js +22 -28
- package/lib/inputs/file/FileButtonSettings.js +14 -16
- package/lib/inputs/file/helpers.js +6 -7
- package/lib/inputs/file/index.js +7 -7
- package/lib/inputs/inputHOC.js +23 -35
- package/lib/inputs/mask/BaseMask.js +33 -27
- package/lib/inputs/mask/Cnpj.js +19 -31
- package/lib/inputs/mask/Cpf.js +20 -35
- package/lib/inputs/mask/Phone.js +8 -6
- package/lib/inputs/mask/ZipCode.js +6 -8
- package/lib/inputs/mask/helpers.js +21 -26
- package/lib/inputs/mask/imaskHOC.js +102 -122
- package/lib/inputs/mask/index.js +11 -11
- package/lib/inputs/multiSelect/ActionButtons.js +18 -18
- package/lib/inputs/multiSelect/Dropdown.js +63 -75
- package/lib/inputs/multiSelect/helper.js +9 -7
- package/lib/inputs/multiSelect/index.js +85 -136
- package/lib/inputs/number/BaseNumber.js +23 -21
- package/lib/inputs/number/Currency.js +9 -8
- package/lib/inputs/number/Decimal.js +4 -6
- package/lib/inputs/number/format_number.js +9 -6
- package/lib/inputs/number/index.js +13 -13
- package/lib/inputs/period/Dialog.js +10 -8
- package/lib/inputs/period/Dropdown.js +12 -12
- package/lib/inputs/period/PeriodList.js +19 -17
- package/lib/inputs/period/helper.js +38 -37
- package/lib/inputs/period/index.js +147 -196
- package/lib/inputs/search/index.js +45 -67
- package/lib/inputs/select/ActionButtons.js +18 -18
- package/lib/inputs/select/Dropdown.js +51 -65
- package/lib/inputs/select/helper.js +55 -44
- package/lib/inputs/select/index.js +13 -11
- package/lib/inputs/select/multiple/Selecteds.js +20 -22
- package/lib/inputs/select/multiple/index.js +90 -143
- package/lib/inputs/select/simple/index.js +103 -156
- package/lib/inputs/text/index.js +4 -6
- package/lib/inputs/textarea/index.js +11 -10
- package/lib/internals/colorStyles.js +3 -3
- package/lib/internals/constants.js +2 -2
- package/lib/internals/withTooltip.js +54 -68
- package/lib/labelMessages/index.js +28 -47
- package/lib/labels/DangerLabel.js +9 -7
- package/lib/labels/DefaultLabel.js +29 -42
- package/lib/labels/InfoLabel.js +9 -7
- package/lib/labels/PrimaryLabel.js +9 -7
- package/lib/labels/SuccessLabel.js +9 -7
- package/lib/labels/WarningLabel.js +9 -7
- package/lib/labels/index.js +15 -15
- package/lib/labels/label_container/index.js +11 -10
- package/lib/list/Header.js +12 -10
- package/lib/list/Item.js +58 -72
- package/lib/list/Separator.js +6 -8
- package/lib/list/helpers.js +3 -3
- package/lib/list/index.js +81 -107
- package/lib/menus/float/MenuItem.js +27 -27
- package/lib/menus/float/SubMenuContainer.js +39 -44
- package/lib/menus/float/helpers.js +4 -4
- package/lib/menus/float/index.js +25 -25
- package/lib/menus/index.js +3 -3
- package/lib/menus/sidenav/ExpandMenu.js +12 -10
- package/lib/menus/sidenav/MenuLink.js +12 -10
- package/lib/menus/sidenav/NavMenuGroup.js +15 -13
- package/lib/menus/sidenav/NavMenuItem.js +56 -69
- package/lib/menus/sidenav/NavSubMenuItem.js +24 -28
- package/lib/menus/sidenav/helpers.js +7 -7
- package/lib/menus/sidenav/index.js +92 -119
- package/lib/menus/sidenav/popup_menu_search/EmptyList.js +12 -11
- package/lib/menus/sidenav/popup_menu_search/index.js +64 -84
- package/lib/noPermission/index.js +15 -17
- package/lib/panel/Content.js +46 -58
- package/lib/panel/DangerPanel.js +6 -8
- package/lib/panel/Default.js +45 -59
- package/lib/panel/Header.js +37 -34
- package/lib/panel/InfoPanel.js +6 -8
- package/lib/panel/PrimaryPanel.js +6 -8
- package/lib/panel/SuccessPanel.js +6 -8
- package/lib/panel/ToolBar.js +8 -6
- package/lib/panel/WarningPanel.js +6 -8
- package/lib/panel/helpers.js +13 -11
- package/lib/panel/index.js +17 -17
- package/lib/permissionValidations.js +26 -28
- package/lib/popover/PopoverText.js +8 -6
- package/lib/popover/PopoverTitle.js +8 -6
- package/lib/popover/index.js +21 -24
- package/lib/progress/Bar.js +34 -39
- package/lib/progress/index.js +19 -20
- package/lib/radio/index.js +37 -57
- package/lib/shortcuts/index.js +13 -11
- package/lib/skeleton/SkeletonContainer.js +12 -12
- package/lib/skeleton/index.js +27 -33
- package/lib/spinner/SpinnerLoading.js +46 -46
- package/lib/spinner/index.js +27 -40
- package/lib/split/Split.js +97 -113
- package/lib/split/SplitSide.js +22 -20
- package/lib/split/helpers.js +4 -4
- package/lib/split/index.js +5 -5
- package/lib/table/Body.js +47 -49
- package/lib/table/Header.js +39 -41
- package/lib/table/HeaderColumn.js +22 -22
- package/lib/table/Row.js +48 -50
- package/lib/table/RowColumn.js +37 -35
- package/lib/table/helpers.js +9 -12
- package/lib/table/index.js +89 -108
- package/lib/tabs/DropdownTabs.js +39 -43
- package/lib/tabs/Menu.js +20 -19
- package/lib/tabs/MenuTabs.js +48 -55
- package/lib/tabs/Panel.js +54 -73
- package/lib/tabs/context.js +62 -93
- package/lib/tabs/index.js +30 -35
- package/lib/tabs/tabHelpers.js +24 -21
- package/lib/toolbar/ButtonBar.js +49 -52
- package/lib/toolbar/LabelBar.js +38 -41
- package/lib/toolbar/Separator.js +6 -8
- package/lib/toolbar/ToolBarGroup.js +9 -8
- package/lib/toolbar/helpers.js +3 -3
- package/lib/toolbar/index.js +25 -26
- package/lib/tooltip/index.js +29 -33
- package/lib/treetable/Body.js +22 -33
- package/lib/treetable/Header.js +13 -15
- package/lib/treetable/Row.d.ts +1 -1
- package/lib/treetable/Row.js +107 -158
- package/lib/treetable/helpers.d.ts +1 -1
- package/lib/treetable/helpers.js +18 -24
- package/lib/treetable/index.d.ts +2 -2
- package/lib/treetable/index.js +11 -12
- package/lib/treeview/Header.js +11 -9
- package/lib/treeview/Node.js +109 -148
- package/lib/treeview/constants.js +2 -2
- package/lib/treeview/index.js +156 -221
- package/lib/uitour/helpers.js +3 -3
- package/lib/uitour/index.js +67 -106
- package/package.json +5 -14
- /package/lib/{types.d-BfM3lUbt.d.ts → types.d-DvJcBS8L.d.ts} +0 -0
|
@@ -3,134 +3,118 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _imask = _interopRequireDefault(require("imask"));
|
|
9
9
|
var helpers = _interopRequireWildcard(require("./helpers"));
|
|
10
10
|
var _permissionValidations = require("../../permissionValidations");
|
|
11
11
|
var _format_number = require("../number/format_number");
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
13
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
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
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
padFractionalZeros = _props$padFractionalZ === void 0 ? true : _props$padFractionalZ,
|
|
49
|
-
mask = props.mask,
|
|
50
|
-
_props$commit = props.commit,
|
|
51
|
-
commit = _props$commit === void 0 ? function () {} : _props$commit,
|
|
52
|
-
parse = props.parse,
|
|
53
|
-
format = props.format,
|
|
54
|
-
definitions = props.definitions,
|
|
55
|
-
groups = props.groups,
|
|
56
|
-
min = props.min,
|
|
57
|
-
max = props.max,
|
|
58
|
-
dispatch = props.dispatch,
|
|
59
|
-
_props$value = props.value,
|
|
60
|
-
value = _props$value === void 0 ? '' : _props$value,
|
|
61
|
-
onChange = props.onChange,
|
|
62
|
-
_props$isDateField = props.isDateField,
|
|
63
|
-
isDateField = _props$isDateField === void 0 ? false : _props$isDateField,
|
|
64
|
-
autoCompleteMask = props.autoCompleteMask;
|
|
65
|
-
var maskOptions = {
|
|
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 = {
|
|
66
48
|
placeholderChar: placeholderChar === '' ? ' ' : placeholderChar,
|
|
67
|
-
lazy
|
|
68
|
-
pattern
|
|
69
|
-
radix
|
|
70
|
-
thousandsSeparator
|
|
71
|
-
mapToRadix
|
|
72
|
-
scale
|
|
73
|
-
signed
|
|
74
|
-
normalizeZeros
|
|
75
|
-
padFractionalZeros
|
|
76
|
-
mask
|
|
77
|
-
commit
|
|
78
|
-
parse
|
|
79
|
-
format
|
|
80
|
-
definitions
|
|
81
|
-
groups
|
|
82
|
-
min
|
|
83
|
-
max
|
|
84
|
-
dispatch
|
|
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
|
|
85
67
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
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 => {
|
|
98
80
|
if (maskRef.current) {
|
|
99
81
|
if (props.unmask) maskRef.current.unmaskedValue = newValue.toString();
|
|
100
82
|
maskRef.current.value = String(newValue);
|
|
101
83
|
}
|
|
102
84
|
};
|
|
103
|
-
|
|
85
|
+
const onAccept = (0, _react.useCallback)(() => {
|
|
104
86
|
if (onChange && !disableCallbacks && maskRef.current) {
|
|
105
|
-
|
|
106
|
-
unmaskedValue
|
|
107
|
-
el
|
|
108
|
-
|
|
87
|
+
const {
|
|
88
|
+
unmaskedValue,
|
|
89
|
+
el
|
|
90
|
+
} = maskRef.current;
|
|
91
|
+
const name = el.name || el.input && el.input.name;
|
|
109
92
|
onChange({
|
|
110
93
|
target: {
|
|
111
94
|
value: unmaskedValue,
|
|
112
|
-
name
|
|
95
|
+
name
|
|
113
96
|
}
|
|
114
97
|
}, props.unmask ? unmaskedValue : maskRef.current.value);
|
|
115
98
|
}
|
|
116
99
|
}, [onChange]);
|
|
117
|
-
|
|
100
|
+
const onComplete = (0, _react.useCallback)(() => {
|
|
118
101
|
if (props.onComplete && !disableCallbacks && maskRef.current) {
|
|
119
|
-
|
|
120
|
-
unmaskedValue
|
|
121
|
-
el
|
|
122
|
-
|
|
102
|
+
const {
|
|
103
|
+
unmaskedValue,
|
|
104
|
+
el
|
|
105
|
+
} = maskRef.current;
|
|
106
|
+
const name = el.name || el.input && el.input.name;
|
|
123
107
|
props.onComplete({
|
|
124
108
|
target: {
|
|
125
109
|
value: unmaskedValue,
|
|
126
|
-
name
|
|
110
|
+
name
|
|
127
111
|
}
|
|
128
112
|
}, props.unmask ? unmaskedValue : maskRef.current.value);
|
|
129
113
|
}
|
|
130
114
|
}, [props.onComplete]);
|
|
131
|
-
|
|
115
|
+
const autoCompleteMaskValue = (0, _react.useCallback)(eventTargetValue => {
|
|
132
116
|
if (autoCompleteMask && eventTargetValue.length && maskRef.current && elementRef.current) {
|
|
133
|
-
|
|
117
|
+
const sizeMask = maskRef.current.mask.toString().replace(/\D+/g, '').length;
|
|
134
118
|
if (sizeMask > eventTargetValue.length) {
|
|
135
119
|
switch (autoCompleteMask) {
|
|
136
120
|
case 'left':
|
|
@@ -146,12 +130,12 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
|
|
|
146
130
|
}
|
|
147
131
|
}
|
|
148
132
|
}, [autoCompleteMask, maskRef.current, elementRef.current]);
|
|
149
|
-
|
|
150
|
-
|
|
133
|
+
const getMask = () => {
|
|
134
|
+
const element = elementRef.current;
|
|
151
135
|
if (element) {
|
|
152
|
-
|
|
136
|
+
const maskCurrent = maskRef.current;
|
|
153
137
|
if (!maskCurrent) {
|
|
154
|
-
maskRef.current = (0, _imask
|
|
138
|
+
maskRef.current = (0, _imask.default)(element, maskOptions);
|
|
155
139
|
if (value && typeof value !== 'number' && value.trim() !== '' || value && typeof value === 'number') onAccept();
|
|
156
140
|
setValue(value);
|
|
157
141
|
} else {
|
|
@@ -159,33 +143,33 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
|
|
|
159
143
|
}
|
|
160
144
|
}
|
|
161
145
|
};
|
|
162
|
-
|
|
146
|
+
const destroyMask = () => {
|
|
163
147
|
if (maskRef.current) {
|
|
164
148
|
maskRef.current.destroy();
|
|
165
149
|
maskRef.current = null;
|
|
166
150
|
}
|
|
167
151
|
};
|
|
168
|
-
(0, _react.useEffect)(
|
|
152
|
+
(0, _react.useEffect)(() => {
|
|
169
153
|
if (props.handlerSetOnDenied) props.handlerSetOnDenied(onDenied);
|
|
170
154
|
if (!props.mask || dontInitMask) return;
|
|
171
155
|
getMask();
|
|
172
156
|
}, [maskOptions]);
|
|
173
|
-
(0, _react.useEffect)(
|
|
157
|
+
(0, _react.useEffect)(() => {
|
|
174
158
|
if (!maskRef.current) return;
|
|
175
|
-
|
|
159
|
+
const maskCurrent = maskRef.current;
|
|
176
160
|
maskCurrent.on('accept', onAccept);
|
|
177
161
|
maskCurrent.on('complete', onComplete);
|
|
178
162
|
|
|
179
163
|
// eslint-disable-next-line consistent-return
|
|
180
|
-
return
|
|
164
|
+
return () => {
|
|
181
165
|
maskCurrent.off('accept', onAccept);
|
|
182
166
|
maskCurrent.off('complete', onComplete);
|
|
183
167
|
};
|
|
184
168
|
}, [onAccept, onComplete]);
|
|
185
|
-
(0, _react.useEffect)(
|
|
169
|
+
(0, _react.useEffect)(() => {
|
|
186
170
|
if (maskOptions.mask && !dontInitMask) {
|
|
187
171
|
if (maskRef.current) {
|
|
188
|
-
|
|
172
|
+
const formattedValue = isDateField ? value : (0, _format_number.numberToPtBR)(value) || '';
|
|
189
173
|
setValue(formattedValue);
|
|
190
174
|
} else {
|
|
191
175
|
getMask();
|
|
@@ -195,29 +179,25 @@ var IMaskHOC = function IMaskHOC(ComposedComponent) {
|
|
|
195
179
|
if (value && elementRef.current) elementRef.current.value = value;
|
|
196
180
|
}
|
|
197
181
|
}, [value, isDateField]);
|
|
198
|
-
(0, _react.useEffect)(
|
|
199
|
-
|
|
200
|
-
}, []);
|
|
201
|
-
return /*#__PURE__*/_react["default"].createElement(ComposedComponent, _extends({}, helpers.extractNonMaskProps(props, maskOptions), {
|
|
182
|
+
(0, _react.useEffect)(() => destroyMask, []);
|
|
183
|
+
return /*#__PURE__*/_react.default.createElement(ComposedComponent, _extends({}, helpers.extractNonMaskProps(props, maskOptions), {
|
|
202
184
|
onDeniedActions: onDenied,
|
|
203
185
|
defaultValue: value,
|
|
204
|
-
onBlur:
|
|
186
|
+
onBlur: e => {
|
|
205
187
|
autoCompleteMaskValue(e.target.value);
|
|
206
188
|
if (props.onBlur) props.onBlur(e);
|
|
207
189
|
},
|
|
208
|
-
onChange:
|
|
209
|
-
|
|
210
|
-
},
|
|
211
|
-
inputRef: function inputRef(el) {
|
|
190
|
+
onChange: e => setValue(e.target.value),
|
|
191
|
+
inputRef: el => {
|
|
212
192
|
elementRef.current = el;
|
|
213
|
-
if (
|
|
214
|
-
if (
|
|
193
|
+
if (inputRef) {
|
|
194
|
+
if (typeof inputRef === 'object') inputRef.current = el;else inputRef(el);
|
|
215
195
|
}
|
|
216
196
|
}
|
|
217
197
|
}));
|
|
218
198
|
};
|
|
219
|
-
|
|
199
|
+
const nestedComponentName = ComposedComponent.displayName || ComposedComponent.name || 'Component';
|
|
220
200
|
MaskedComponent.displayName = "IMask(".concat(nestedComponentName, ")");
|
|
221
201
|
return MaskedComponent;
|
|
222
202
|
};
|
|
223
|
-
var _default = exports
|
|
203
|
+
var _default = exports.default = IMaskHOC;
|
package/lib/inputs/mask/index.js
CHANGED
|
@@ -5,33 +5,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
Object.defineProperty(exports, "CnpjField", {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: function
|
|
9
|
-
return _Cnpj
|
|
8
|
+
get: function () {
|
|
9
|
+
return _Cnpj.default;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "CpfField", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function
|
|
15
|
-
return _Cpf
|
|
14
|
+
get: function () {
|
|
15
|
+
return _Cpf.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "PhoneField", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function
|
|
21
|
-
return _Phone
|
|
20
|
+
get: function () {
|
|
21
|
+
return _Phone.default;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
Object.defineProperty(exports, "ZipCodeField", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function
|
|
27
|
-
return _ZipCode
|
|
26
|
+
get: function () {
|
|
27
|
+
return _ZipCode.default;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
exports
|
|
30
|
+
exports.default = void 0;
|
|
31
31
|
var _BaseMask = _interopRequireDefault(require("./BaseMask"));
|
|
32
32
|
var _Cpf = _interopRequireDefault(require("./Cpf"));
|
|
33
33
|
var _Cnpj = _interopRequireDefault(require("./Cnpj"));
|
|
34
34
|
var _Phone = _interopRequireDefault(require("./Phone"));
|
|
35
35
|
var _ZipCode = _interopRequireDefault(require("./ZipCode"));
|
|
36
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
37
|
-
var _default = exports
|
|
36
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
37
|
+
var _default = exports.default = _BaseMask.default;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
|
-
exports
|
|
6
|
+
exports.default = void 0;
|
|
8
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _buttons = _interopRequireDefault(require("../../buttons"));
|
|
10
9
|
var _list = _interopRequireWildcard(require("../../list"));
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : {
|
|
12
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
13
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
dropdownAlignButton =
|
|
22
|
-
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
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); }
|
|
12
|
+
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; }
|
|
13
|
+
const ActionButtons = _ref => {
|
|
14
|
+
let {
|
|
15
|
+
disabled,
|
|
16
|
+
dropdownOpened,
|
|
17
|
+
handleOpenClose,
|
|
18
|
+
handleCheckAll,
|
|
19
|
+
handleUncheckAll,
|
|
20
|
+
dropdownAlignButton = 'left'
|
|
21
|
+
} = _ref;
|
|
22
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
23
23
|
disabled: disabled,
|
|
24
24
|
size: "small",
|
|
25
25
|
iconName: dropdownOpened ? 'up' : 'down',
|
|
@@ -27,7 +27,7 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
27
27
|
customClass: "actionbutton",
|
|
28
28
|
transparent: true,
|
|
29
29
|
boxShadow: false
|
|
30
|
-
}), /*#__PURE__*/_react
|
|
30
|
+
}), /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
31
31
|
disabled: disabled,
|
|
32
32
|
iconName: "more1",
|
|
33
33
|
transparent: true,
|
|
@@ -36,14 +36,14 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
|
36
36
|
dropdown: true,
|
|
37
37
|
dropdownAlign: dropdownAlignButton,
|
|
38
38
|
showIconDropdown: false
|
|
39
|
-
}, /*#__PURE__*/_react
|
|
39
|
+
}, /*#__PURE__*/_react.default.createElement(_list.default, null, /*#__PURE__*/_react.default.createElement(_list.ListItem, {
|
|
40
40
|
itemId: "1",
|
|
41
41
|
text: "Marcar Todos",
|
|
42
42
|
onClick: handleCheckAll
|
|
43
|
-
}), /*#__PURE__*/_react
|
|
43
|
+
}), /*#__PURE__*/_react.default.createElement(_list.ListItem, {
|
|
44
44
|
itemId: "2",
|
|
45
45
|
text: "Desmarcar Todos",
|
|
46
46
|
onClick: handleUncheckAll
|
|
47
47
|
}))));
|
|
48
48
|
};
|
|
49
|
-
var _default = exports
|
|
49
|
+
var _default = exports.default = ActionButtons;
|