@rahmatsaputra-my-id/react-js-library 0.0.25 → 0.0.27
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.
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ITouchableOpacityProps } from './TouchableOpacity.types';
|
|
3
|
-
declare const TouchableOpacity: ({ children, onPress, style, ...props }: ITouchableOpacityProps
|
|
3
|
+
declare const TouchableOpacity: ({ children, onPress, style, disabled, ...props }: ITouchableOpacityProps & {
|
|
4
|
+
disabled?: boolean | undefined;
|
|
5
|
+
}) => JSX.Element | null;
|
|
4
6
|
export default TouchableOpacity;
|
package/dist/index.es.js
CHANGED
|
@@ -198,12 +198,13 @@ var styles$e = {
|
|
|
198
198
|
};
|
|
199
199
|
|
|
200
200
|
var TouchableOpacity = function (_a) {
|
|
201
|
-
var children = _a.children, onPress = _a.onPress, style = _a.style, props = __rest(_a, ["children", "onPress", "style"]);
|
|
202
|
-
var handleOnPress = function () {
|
|
203
|
-
if (onPress)
|
|
204
|
-
onPress();
|
|
201
|
+
var children = _a.children, onPress = _a.onPress, style = _a.style, _b = _a.disabled, disabled = _b === void 0 ? false : _b, props = __rest(_a, ["children", "onPress", "style", "disabled"]);
|
|
202
|
+
var handleOnPress = function (event) {
|
|
203
|
+
if (!disabled && onPress) {
|
|
204
|
+
onPress(event);
|
|
205
|
+
}
|
|
205
206
|
};
|
|
206
|
-
return (jsx("div", __assign({ onClick: handleOnPress, style: __assign(__assign({}, styles$e.content), style) }, props, { children: children })));
|
|
207
|
+
return (jsx("div", __assign({ onClick: handleOnPress, style: __assign(__assign(__assign({}, styles$e.content), style), { opacity: disabled ? 0.5 : 1, pointerEvents: disabled ? 'none' : 'auto' }) }, props, { children: children })));
|
|
207
208
|
};
|
|
208
209
|
|
|
209
210
|
var Colors = {
|
|
@@ -451,6 +452,7 @@ var Icons = {
|
|
|
451
452
|
tax: "".concat(PATH.IMAGE, "/icon-tax.png"),
|
|
452
453
|
terms_and_conditions: "".concat(PATH.IMAGE, "/icon-terms-and-conditions.png"),
|
|
453
454
|
wallet: "".concat(PATH.IMAGE, "/icon-wallet.png"),
|
|
455
|
+
bulk_product: "".concat(PATH.IMAGE, "/icon-bulk-product.png"),
|
|
454
456
|
};
|
|
455
457
|
|
|
456
458
|
var Images = function (_a) {
|