@vitrosoftware/common-ui-ts 1.1.201 → 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 && !props.isDisabled) {
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 _ref$current;
61088
- if (!props.isDisabled && !(ref !== null && ref !== void 0 && (_ref$current = ref.current) !== null && _ref$current !== void 0 && _ref$current.disabled)) {
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: 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,
@@ -61219,15 +61228,13 @@ var DialogFooter = function DialogFooter(props) {
61219
61228
  onClick: props.onClose,
61220
61229
  className: styles$l['vitro-button']
61221
61230
  }), (_props$buttonList2 = props.buttonList) !== null && _props$buttonList2 !== void 0 && _props$buttonList2.length ? props.buttonList.map(function (button) {
61222
- return React__default.createElement(Button$2, {
61223
- text: button.text,
61231
+ return React__default.createElement(Button$2, Object.assign({}, button, {
61224
61232
  onClick: function onClick() {
61225
61233
  var _button$onClick;
61226
61234
  return (_button$onClick = button.onClick) === null || _button$onClick === void 0 ? void 0 : _button$onClick.call(button, props.dialog);
61227
61235
  },
61228
- isDisabled: button.isDisabled,
61229
61236
  className: styles$l['vitro-button'] + (button.className ? CTRL.SPACE + button.className : CTRL.EMPTY)
61230
- });
61237
+ }));
61231
61238
  }) : null));
61232
61239
  };
61233
61240
 
@@ -63133,7 +63140,7 @@ var Viewer = function Viewer(props) {
63133
63140
  };
63134
63141
 
63135
63142
  var name = "@vitrosoftware/common-ui-ts";
63136
- var version$1 = "1.1.201";
63143
+ var version$1 = "1.1.203";
63137
63144
  var description = "vitro software common ui ts";
63138
63145
  var author = "";
63139
63146
  var license = "MIT";