@widergy/energy-ui 3.37.2 → 3.38.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/CHANGELOG.md +7 -0
- package/dist/components/UTBadge/index.js +1 -1
- package/dist/components/UTBaseInputField/components/BadgeAdornment/index.js +24 -0
- package/dist/components/UTBaseInputField/components/IconAdornment/index.js +12 -6
- package/dist/components/UTBaseInputField/constants.js +3 -0
- package/dist/components/UTBaseInputField/index.js +32 -18
- package/dist/components/UTBaseInputField/theme.js +83 -31
- package/dist/components/UTCheckList/versions/V1/constants.js +3 -2
- package/dist/components/UTCheckList/versions/V1/index.js +15 -13
- package/dist/components/UTCheckbox/versions/V1/index.js +2 -4
- package/dist/components/UTCheckbox/versions/V1/theme.js +1 -1
- package/dist/components/UTPaper/index.js +29 -0
- package/dist/components/UTPaper/theme.js +26 -0
- package/dist/components/UTPasswordField/versions/V0/index.js +1 -1
- package/dist/components/UTPhoneInput/versions/V1/index.js +3 -3
- package/dist/components/UTSelect/index.js +12 -185
- package/dist/components/UTSelect/versions/V0/index.js +199 -0
- package/dist/components/UTSelect/{stylesJS.js → versions/V0/stylesJS.js} +1 -1
- package/dist/components/UTSelect/{theme.js → versions/V0/theme.js} +1 -1
- package/dist/components/UTSelect/versions/V1/README.md +90 -0
- package/dist/components/UTSelect/versions/V1/components/InputComponent/index.js +98 -0
- package/dist/components/UTSelect/versions/V1/components/ListboxComponent/index.js +51 -0
- package/dist/components/UTSelect/versions/V1/components/ListboxComponent/styles.module.scss +7 -0
- package/dist/components/UTSelect/versions/V1/index.js +203 -0
- package/dist/components/UTSelect/versions/V1/styles.module.scss +5 -0
- package/dist/components/UTSelect/versions/V1/utils.js +116 -0
- package/dist/components/UTTouchableWithoutFeedback/index.js +9 -4
- package/package.json +1 -1
- /package/dist/components/UTSelect/{components → versions/V0/components}/Option/index.js +0 -0
- /package/dist/components/UTSelect/{constants.js → versions/V0/constants.js} +0 -0
- /package/dist/components/UTSelect/{styles.module.scss → versions/V0/styles.module.scss} +0 -0
- /package/dist/components/UTSelect/{utils.js → versions/V0/utils.js} +0 -0
|
@@ -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 _propTypes = require("prop-types");
|
|
9
|
+
var _lab = require("@material-ui/lab");
|
|
10
|
+
var _clone = _interopRequireDefault(require("lodash/clone"));
|
|
11
|
+
var _utils = require("../../../UTValidation/utils");
|
|
12
|
+
var _UTFieldLabel = _interopRequireDefault(require("../../../UTFieldLabel"));
|
|
13
|
+
var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
14
|
+
var _UTPaper = _interopRequireDefault(require("../../../UTPaper"));
|
|
15
|
+
var _UTValidation = _interopRequireDefault(require("../../../UTValidation"));
|
|
16
|
+
var _utils2 = require("./utils");
|
|
17
|
+
var _InputComponent = _interopRequireDefault(require("./components/InputComponent"));
|
|
18
|
+
var _ListboxComponent = _interopRequireDefault(require("./components/ListboxComponent"));
|
|
19
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
23
|
+
const UTSelect = _ref => {
|
|
24
|
+
let {
|
|
25
|
+
action,
|
|
26
|
+
alwaysShowPlaceholder = true,
|
|
27
|
+
className,
|
|
28
|
+
clearable = true,
|
|
29
|
+
disabled,
|
|
30
|
+
disableFilterOptions = false,
|
|
31
|
+
error,
|
|
32
|
+
helpText,
|
|
33
|
+
multiple = false,
|
|
34
|
+
noMatchesText = 'No hay coincidencias con tu búsqueda',
|
|
35
|
+
onChange = () => {},
|
|
36
|
+
onChangeSearchTerm = () => {},
|
|
37
|
+
options,
|
|
38
|
+
placeholder = 'Seleccione un elemento',
|
|
39
|
+
prefix,
|
|
40
|
+
readOnly,
|
|
41
|
+
required,
|
|
42
|
+
suffix,
|
|
43
|
+
title,
|
|
44
|
+
value = multiple ? [] : null,
|
|
45
|
+
variant = 'select',
|
|
46
|
+
withAutoReset = true
|
|
47
|
+
} = _ref;
|
|
48
|
+
const optionsSortedByCategory = (0, _react.useMemo)(() => {
|
|
49
|
+
const clonedOptions = (0, _clone.default)(options);
|
|
50
|
+
const categoryOrder = new Map();
|
|
51
|
+
clonedOptions.forEach(option => {
|
|
52
|
+
if (!categoryOrder.has(option.category)) categoryOrder.set(option.category, categoryOrder.size);
|
|
53
|
+
});
|
|
54
|
+
return clonedOptions.sort((a, b) => categoryOrder.get(a.category) - categoryOrder.get(b.category));
|
|
55
|
+
}, [options]);
|
|
56
|
+
const [isPopperOpen, setIsPopperOpen] = (0, _react.useState)(false);
|
|
57
|
+
const [searchTerm, setSearchTerm] = (0, _react.useState)((0, _utils2.getDisplayValue)(value, optionsSortedByCategory, multiple));
|
|
58
|
+
const [showClearButton, setShowClearButton] = (0, _react.useState)(!!searchTerm);
|
|
59
|
+
const [sortedOptions, setSortedOptions] = (0, _react.useState)(optionsSortedByCategory);
|
|
60
|
+
const inputRef = (0, _react.useRef)(null);
|
|
61
|
+
(0, _react.useEffect)(() => {
|
|
62
|
+
if (withAutoReset && (0, _utils2.shouldReset)(value, optionsSortedByCategory, multiple)) {
|
|
63
|
+
onChange(null);
|
|
64
|
+
setSortedOptions((0, _utils2.sortOptions)(optionsSortedByCategory, null, multiple));
|
|
65
|
+
}
|
|
66
|
+
}, [multiple, onChange, optionsSortedByCategory, value, withAutoReset]);
|
|
67
|
+
(0, _react.useEffect)(() => {
|
|
68
|
+
if (isPopperOpen) setSortedOptions((0, _utils2.sortOptions)(optionsSortedByCategory, value, multiple));
|
|
69
|
+
}, [isPopperOpen, optionsSortedByCategory, value, multiple]);
|
|
70
|
+
const validationData = (0, _react.useMemo)(() => error && (0, _utils.formatErrorToValidation)(error), [error]);
|
|
71
|
+
const filteredOptions = (0, _react.useMemo)(() => disableFilterOptions ? sortedOptions : sortedOptions.filter(option => option.label.toLowerCase().includes(searchTerm.toLowerCase())), [sortedOptions, searchTerm, disableFilterOptions]);
|
|
72
|
+
const handleSearchChange = (0, _react.useCallback)(searchValue => {
|
|
73
|
+
onChangeSearchTerm === null || onChangeSearchTerm === void 0 || onChangeSearchTerm(searchValue);
|
|
74
|
+
setSearchTerm(searchValue);
|
|
75
|
+
}, [onChangeSearchTerm]);
|
|
76
|
+
const clearSearchInputValue = (0, _react.useCallback)(inputValue => {
|
|
77
|
+
setIsPopperOpen(false);
|
|
78
|
+
const displayValue = (0, _utils2.getDisplayValue)(inputValue, optionsSortedByCategory, multiple);
|
|
79
|
+
handleSearchChange(displayValue);
|
|
80
|
+
setShowClearButton(!!displayValue);
|
|
81
|
+
}, [_utils2.getDisplayValue, optionsSortedByCategory, multiple, handleSearchChange]);
|
|
82
|
+
const handleSelectionChange = newValues => {
|
|
83
|
+
const selectedValue = multiple ? newValues : newValues[0] || '';
|
|
84
|
+
onChange(selectedValue);
|
|
85
|
+
if (!multiple) {
|
|
86
|
+
var _inputRef$current;
|
|
87
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.blur();
|
|
88
|
+
clearSearchInputValue(selectedValue);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const handleInputFocus = () => {
|
|
92
|
+
setShowClearButton(false);
|
|
93
|
+
handleSearchChange('');
|
|
94
|
+
setIsPopperOpen(true);
|
|
95
|
+
setSortedOptions((0, _utils2.sortOptions)(optionsSortedByCategory, value, multiple));
|
|
96
|
+
};
|
|
97
|
+
const handleInputBlur = () => {
|
|
98
|
+
clearSearchInputValue(value);
|
|
99
|
+
setSortedOptions((0, _utils2.sortOptions)(optionsSortedByCategory, value, multiple));
|
|
100
|
+
};
|
|
101
|
+
const handleClearSelection = () => {
|
|
102
|
+
const clearedValue = multiple ? [] : null;
|
|
103
|
+
onChange(clearedValue);
|
|
104
|
+
handleSearchChange('');
|
|
105
|
+
setShowClearButton(false);
|
|
106
|
+
setIsPopperOpen(false);
|
|
107
|
+
setSortedOptions((0, _utils2.sortOptions)(optionsSortedByCategory, clearedValue, multiple));
|
|
108
|
+
};
|
|
109
|
+
const leftAdornments = (0, _react.useMemo)(() => (0, _utils2.getLeftAdornments)({
|
|
110
|
+
error,
|
|
111
|
+
multiple,
|
|
112
|
+
value,
|
|
113
|
+
prefix
|
|
114
|
+
}), [multiple, value, prefix]);
|
|
115
|
+
const rightAdornments = (0, _react.useMemo)(() => (0, _utils2.getRightAdornments)({
|
|
116
|
+
action,
|
|
117
|
+
clearable,
|
|
118
|
+
disabled,
|
|
119
|
+
handleClearSelection,
|
|
120
|
+
readOnly,
|
|
121
|
+
showClearButton,
|
|
122
|
+
suffix,
|
|
123
|
+
variant
|
|
124
|
+
}), [suffix, showClearButton, clearable, disabled, action, handleClearSelection, variant]);
|
|
125
|
+
const InputComponentToRender = (0, _react.useMemo)(() => params => /*#__PURE__*/_react.default.createElement(_InputComponent.default, {
|
|
126
|
+
alwaysShowPlaceholder: alwaysShowPlaceholder,
|
|
127
|
+
disabled: disabled,
|
|
128
|
+
error: error,
|
|
129
|
+
inputRef: inputRef,
|
|
130
|
+
leftAdornments: leftAdornments,
|
|
131
|
+
onBlur: handleInputBlur,
|
|
132
|
+
onChange: handleSearchChange,
|
|
133
|
+
onFocus: handleInputFocus,
|
|
134
|
+
params: params,
|
|
135
|
+
placeholder: placeholder,
|
|
136
|
+
readOnly: readOnly,
|
|
137
|
+
rightAdornments: rightAdornments,
|
|
138
|
+
value: searchTerm,
|
|
139
|
+
variant: variant
|
|
140
|
+
}), [alwaysShowPlaceholder, disabled, error, handleInputBlur, handleInputFocus, leftAdornments, placeholder, rightAdornments, searchTerm]);
|
|
141
|
+
const listBoxProps = (0, _react.useMemo)(() => ({
|
|
142
|
+
filteredOptions,
|
|
143
|
+
handleSelectionChange,
|
|
144
|
+
multiple,
|
|
145
|
+
noMatchesText,
|
|
146
|
+
value
|
|
147
|
+
}), [filteredOptions, handleSelectionChange, multiple, noMatchesText, value]);
|
|
148
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
149
|
+
className: "".concat(_stylesModule.default.container, " ").concat(className)
|
|
150
|
+
}, title && /*#__PURE__*/_react.default.createElement(_UTFieldLabel.default, {
|
|
151
|
+
required: required,
|
|
152
|
+
variant: "body"
|
|
153
|
+
}, title), /*#__PURE__*/_react.default.createElement(_lab.Autocomplete, {
|
|
154
|
+
disabled: disabled || readOnly,
|
|
155
|
+
getOptionLabel: option => option.label,
|
|
156
|
+
ListboxComponent: _ListboxComponent.default,
|
|
157
|
+
ListboxProps: listBoxProps,
|
|
158
|
+
multiple: multiple,
|
|
159
|
+
onClose: () => setIsPopperOpen(false),
|
|
160
|
+
onOpen: () => setIsPopperOpen(true),
|
|
161
|
+
open: isPopperOpen,
|
|
162
|
+
options: optionsSortedByCategory,
|
|
163
|
+
PaperComponent: _UTPaper.default,
|
|
164
|
+
renderInput: InputComponentToRender
|
|
165
|
+
}), helpText && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
166
|
+
colorTheme: "gray",
|
|
167
|
+
variant: "small"
|
|
168
|
+
}, helpText), validationData && /*#__PURE__*/_react.default.createElement(_UTValidation.default, {
|
|
169
|
+
validationData: validationData
|
|
170
|
+
}));
|
|
171
|
+
};
|
|
172
|
+
UTSelect.propTypes = {
|
|
173
|
+
action: (0, _propTypes.shape)({
|
|
174
|
+
Icon: _propTypes.string,
|
|
175
|
+
onClick: _propTypes.func,
|
|
176
|
+
size: _propTypes.string
|
|
177
|
+
}),
|
|
178
|
+
alwaysShowPlaceholder: _propTypes.bool,
|
|
179
|
+
className: _propTypes.string,
|
|
180
|
+
clearable: _propTypes.bool,
|
|
181
|
+
disabled: _propTypes.bool,
|
|
182
|
+
disableFilterOptions: _propTypes.bool,
|
|
183
|
+
error: _propTypes.string,
|
|
184
|
+
helpText: _propTypes.string,
|
|
185
|
+
multiple: _propTypes.bool,
|
|
186
|
+
noMatchesText: _propTypes.string,
|
|
187
|
+
onChange: _propTypes.func,
|
|
188
|
+
onChangeSearchTerm: _propTypes.func,
|
|
189
|
+
options: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
190
|
+
label: _propTypes.string,
|
|
191
|
+
value: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.number])
|
|
192
|
+
})),
|
|
193
|
+
placeholder: _propTypes.string,
|
|
194
|
+
prefix: _propTypes.string,
|
|
195
|
+
readOnly: _propTypes.bool,
|
|
196
|
+
required: _propTypes.bool,
|
|
197
|
+
suffix: _propTypes.string,
|
|
198
|
+
title: _propTypes.string,
|
|
199
|
+
value: (0, _propTypes.oneOfType)([_propTypes.string, (0, _propTypes.arrayOf)((0, _propTypes.oneOfType)([_propTypes.string, _propTypes.number]))]),
|
|
200
|
+
variant: _propTypes.string,
|
|
201
|
+
withAutoReset: _propTypes.bool
|
|
202
|
+
};
|
|
203
|
+
var _default = exports.default = UTSelect;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sortOptions = exports.shouldReset = exports.getRightAdornments = exports.getLeftAdornments = exports.getDisplayValue = void 0;
|
|
7
|
+
var _array = require("@widergy/web-utils/lib/array");
|
|
8
|
+
var _clone = _interopRequireDefault(require("lodash/clone"));
|
|
9
|
+
var _constants = require("../../../UTBaseInputField/constants");
|
|
10
|
+
var _constants2 = require("../../../UTCheckList/versions/V1/constants");
|
|
11
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
+
const hasOption = (options, value) => options.some(opt => {
|
|
13
|
+
var _opt$subOptions;
|
|
14
|
+
return opt.value === value || ((_opt$subOptions = opt.subOptions) === null || _opt$subOptions === void 0 ? void 0 : _opt$subOptions.some(sub => sub.value === value));
|
|
15
|
+
});
|
|
16
|
+
const shouldReset = (value, options, multiple) => {
|
|
17
|
+
if ((0, _array.isEmpty)(options) || (0, _array.isEmpty)(value)) return false;
|
|
18
|
+
return multiple ? value.some(val => !hasOption(options, val)) : !hasOption(options, value);
|
|
19
|
+
};
|
|
20
|
+
exports.shouldReset = shouldReset;
|
|
21
|
+
const getDisplayValue = (inputValue, options, multiple) => {
|
|
22
|
+
if (!inputValue) return '';
|
|
23
|
+
const findLabel = optionValue => {
|
|
24
|
+
var _options$find;
|
|
25
|
+
return ((_options$find = options.find(o => o.value === optionValue)) === null || _options$find === void 0 ? void 0 : _options$find.label) || '';
|
|
26
|
+
};
|
|
27
|
+
return multiple ? inputValue.map(findLabel).join(', ') : findLabel(inputValue);
|
|
28
|
+
};
|
|
29
|
+
exports.getDisplayValue = getDisplayValue;
|
|
30
|
+
const getLeftAdornments = _ref => {
|
|
31
|
+
let {
|
|
32
|
+
error,
|
|
33
|
+
multiple,
|
|
34
|
+
prefix,
|
|
35
|
+
value
|
|
36
|
+
} = _ref;
|
|
37
|
+
const adornments = [];
|
|
38
|
+
if (error) adornments.push({
|
|
39
|
+
name: _constants.COMPONENT_KEYS.ICON,
|
|
40
|
+
props: {
|
|
41
|
+
showOnlyOnError: true
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
if (multiple && !(0, _array.isEmpty)(value)) adornments.push({
|
|
45
|
+
name: _constants.COMPONENT_KEYS.BADGE,
|
|
46
|
+
props: {
|
|
47
|
+
text: value.length,
|
|
48
|
+
colorTheme: error ? 'error' : 'accent'
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
if (prefix) adornments.push({
|
|
52
|
+
name: _constants.COMPONENT_KEYS.PREFIX,
|
|
53
|
+
props: {
|
|
54
|
+
text: prefix
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
return adornments;
|
|
58
|
+
};
|
|
59
|
+
exports.getLeftAdornments = getLeftAdornments;
|
|
60
|
+
const getRightAdornments = _ref2 => {
|
|
61
|
+
let {
|
|
62
|
+
action,
|
|
63
|
+
clearable,
|
|
64
|
+
disabled,
|
|
65
|
+
handleClearSelection,
|
|
66
|
+
readOnly,
|
|
67
|
+
showClearButton,
|
|
68
|
+
suffix,
|
|
69
|
+
variant
|
|
70
|
+
} = _ref2;
|
|
71
|
+
const adornments = [];
|
|
72
|
+
if (suffix) adornments.push({
|
|
73
|
+
name: _constants.COMPONENT_KEYS.SUFFIX,
|
|
74
|
+
props: {
|
|
75
|
+
text: suffix
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
if (showClearButton && clearable && !disabled && !readOnly) adornments.push({
|
|
79
|
+
key: 'clearAction',
|
|
80
|
+
name: _constants.COMPONENT_KEYS.ACTION,
|
|
81
|
+
props: {
|
|
82
|
+
action: {
|
|
83
|
+
Icon: 'IconX',
|
|
84
|
+
onClick: handleClearSelection,
|
|
85
|
+
size: 'small'
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
adornments.push({
|
|
90
|
+
name: _constants.COMPONENT_KEYS.ICON,
|
|
91
|
+
props: {
|
|
92
|
+
Icon: 'IconChevronDown',
|
|
93
|
+
changeIconOnError: false,
|
|
94
|
+
changeOnError: true,
|
|
95
|
+
...(variant === 'picker' && !disabled && {
|
|
96
|
+
colorTheme: 'dark'
|
|
97
|
+
})
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
if (action) adornments.push({
|
|
101
|
+
name: _constants.COMPONENT_KEYS.ACTION,
|
|
102
|
+
props: {
|
|
103
|
+
action
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
return adornments;
|
|
107
|
+
};
|
|
108
|
+
exports.getRightAdornments = getRightAdornments;
|
|
109
|
+
const sortOptions = (options, value, multiple) => {
|
|
110
|
+
const copiedOptions = (0, _clone.default)(options);
|
|
111
|
+
return copiedOptions.map(option => ({
|
|
112
|
+
...option,
|
|
113
|
+
category: multiple ? value !== null && value !== void 0 && value.includes(option.value) ? _constants2.NO_CATEGORY : option.category : option.value === value ? _constants2.NO_CATEGORY : option.category
|
|
114
|
+
})).sort((a, b) => a.category === _constants2.NO_CATEGORY ? -1 : b.category === _constants2.NO_CATEGORY ? 1 : 0);
|
|
115
|
+
};
|
|
116
|
+
exports.sortOptions = sortOptions;
|
|
@@ -21,6 +21,7 @@ const UTTouchableWithoutFeedback = _ref => {
|
|
|
21
21
|
disabled = false,
|
|
22
22
|
keyName,
|
|
23
23
|
onClick,
|
|
24
|
+
onMouseDown,
|
|
24
25
|
withRipple = false,
|
|
25
26
|
...props
|
|
26
27
|
} = _ref;
|
|
@@ -30,16 +31,19 @@ const UTTouchableWithoutFeedback = _ref => {
|
|
|
30
31
|
if (containerSetter) containerSetter(ref);
|
|
31
32
|
};
|
|
32
33
|
const handleClick = event => {
|
|
33
|
-
if (!disabled
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
if (!disabled) onClick(event);
|
|
35
|
+
};
|
|
36
|
+
const handleMouseDown = event => {
|
|
37
|
+
event.preventDefault();
|
|
38
|
+
if (!disabled) onMouseDown(event);
|
|
36
39
|
};
|
|
37
40
|
return /*#__PURE__*/_react.default.createElement("div", _extends({}, props, {
|
|
38
41
|
"aria-disabled": disabled,
|
|
39
42
|
className: "".concat(_stylesModule.default.container, " ").concat(className, " ").concat(disabled && _stylesModule.default.disabled),
|
|
40
43
|
"data-testid": dataTestId,
|
|
41
44
|
key: keyName,
|
|
42
|
-
|
|
45
|
+
onMouseDown: onMouseDown ? handleMouseDown : undefined,
|
|
46
|
+
onClick: onClick ? handleClick : undefined,
|
|
43
47
|
ref: setRef,
|
|
44
48
|
role: "button",
|
|
45
49
|
tabIndex: disabled ? -1 : 0
|
|
@@ -55,6 +59,7 @@ UTTouchableWithoutFeedback.propTypes = {
|
|
|
55
59
|
disabled: _propTypes.bool,
|
|
56
60
|
keyName: _propTypes.string,
|
|
57
61
|
onClick: _propTypes.func,
|
|
62
|
+
onMouseDown: _propTypes.func,
|
|
58
63
|
withRipple: _propTypes.bool
|
|
59
64
|
};
|
|
60
65
|
var _default = exports.default = UTTouchableWithoutFeedback;
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|