@vitrosoftware/common-ui-ts 1.1.202 → 1.1.203
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/dist/index.js
CHANGED
|
@@ -61066,9 +61066,14 @@ var Button$2 = React.forwardRef(function (props, ref) {
|
|
|
61066
61066
|
var _useState2 = React.useState(false),
|
|
61067
61067
|
isHover = _useState2[0],
|
|
61068
61068
|
setIsHover = _useState2[1];
|
|
61069
|
+
var innerRef = React.useRef(null);
|
|
61070
|
+
React.useImperativeHandle(ref, function () {
|
|
61071
|
+
return innerRef.current;
|
|
61072
|
+
});
|
|
61069
61073
|
var createRipple = function createRipple(e) {
|
|
61074
|
+
var _innerRef$current;
|
|
61070
61075
|
var button = e.currentTarget.firstElementChild;
|
|
61071
|
-
if (button && !
|
|
61076
|
+
if (button && !(innerRef !== null && innerRef !== void 0 && (_innerRef$current = innerRef.current) !== null && _innerRef$current !== void 0 && _innerRef$current.disabled)) {
|
|
61072
61077
|
var circle = window.document.createElement(HTML_ELEMENT_SPAN);
|
|
61073
61078
|
var diameter = Math.max(button.clientWidth, button.clientHeight);
|
|
61074
61079
|
var radius = diameter / 2;
|
|
@@ -61084,8 +61089,8 @@ var Button$2 = React.forwardRef(function (props, ref) {
|
|
|
61084
61089
|
}
|
|
61085
61090
|
};
|
|
61086
61091
|
var onClick = function onClick(e) {
|
|
61087
|
-
var
|
|
61088
|
-
if (!
|
|
61092
|
+
var _innerRef$current2;
|
|
61093
|
+
if (!(innerRef !== null && innerRef !== void 0 && (_innerRef$current2 = innerRef.current) !== null && _innerRef$current2 !== void 0 && _innerRef$current2.disabled)) {
|
|
61089
61094
|
if (props.onClick) {
|
|
61090
61095
|
setPending(true);
|
|
61091
61096
|
var promise = props.onClick(e);
|
|
@@ -61106,15 +61111,19 @@ var Button$2 = React.forwardRef(function (props, ref) {
|
|
|
61106
61111
|
}
|
|
61107
61112
|
}
|
|
61108
61113
|
};
|
|
61114
|
+
React.useEffect(function () {
|
|
61115
|
+
if (innerRef.current) {
|
|
61116
|
+
innerRef.current.disabled = pending || (props.isDisabled ? true : false);
|
|
61117
|
+
}
|
|
61118
|
+
}, [pending, props.isDisabled]);
|
|
61109
61119
|
return React__default.createElement("button", {
|
|
61110
|
-
ref:
|
|
61120
|
+
ref: innerRef,
|
|
61111
61121
|
onMouseEnter: function onMouseEnter() {
|
|
61112
61122
|
return setIsHover(true);
|
|
61113
61123
|
},
|
|
61114
61124
|
onMouseLeave: function onMouseLeave() {
|
|
61115
61125
|
return setIsHover(false);
|
|
61116
61126
|
},
|
|
61117
|
-
disabled: pending || props.isDisabled,
|
|
61118
61127
|
type: TYPE_BUTTON,
|
|
61119
61128
|
className: styles$h['vitro-button'] + (props.className ? CTRL.SPACE + props.className : CTRL.EMPTY),
|
|
61120
61129
|
title: CTRL.EMPTY,
|
|
@@ -63131,7 +63140,7 @@ var Viewer = function Viewer(props) {
|
|
|
63131
63140
|
};
|
|
63132
63141
|
|
|
63133
63142
|
var name = "@vitrosoftware/common-ui-ts";
|
|
63134
|
-
var version$1 = "1.1.
|
|
63143
|
+
var version$1 = "1.1.203";
|
|
63135
63144
|
var description = "vitro software common ui ts";
|
|
63136
63145
|
var author = "";
|
|
63137
63146
|
var license = "MIT";
|