@vitrosoftware/common-ui-ts 1.1.108 → 1.1.109

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.
@@ -9,6 +9,7 @@
9
9
  background-repeat: no-repeat;
10
10
  background-size: 100%;
11
11
  z-index: 100;
12
+ margin-right: 32px;
12
13
  background-image: url('@vitrosoftware/common-ui-ts/css/std/controls/header/img/nav-bar-button.svg');
13
14
  }
14
15
 
@@ -7,7 +7,7 @@
7
7
  .vitro-product-title img {
8
8
  max-height: 25px;
9
9
  min-height: 25px;
10
- margin: 0px 32px;
10
+ margin-right: 32px;
11
11
  }
12
12
 
13
13
  @media (max-width: 800px) {
package/dist/index.css CHANGED
@@ -6882,6 +6882,7 @@ li:first-child ._command-menu-item_vitro-item_2pVhk23:hover {
6882
6882
  background-repeat: no-repeat;
6883
6883
  background-size: 100%;
6884
6884
  z-index: 100;
6885
+ margin-right: 32px;
6885
6886
  background-image: url('@vitrosoftware/common-ui-ts/css/std/controls/header/img/nav-bar-button.svg');
6886
6887
  }
6887
6888
 
@@ -6933,7 +6934,7 @@ li:first-child ._command-menu-item_vitro-item_2pVhk23:hover {
6933
6934
  ._product-title_vitro-product-title_2gZcA5j img {
6934
6935
  max-height: 25px;
6935
6936
  min-height: 25px;
6936
- margin: 0px 32px;
6937
+ margin-right: 32px;
6937
6938
  }
6938
6939
 
6939
6940
  @media (max-width: 800px) {
package/dist/index.js CHANGED
@@ -61893,7 +61893,7 @@ var Viewer = function Viewer(props) {
61893
61893
  };
61894
61894
 
61895
61895
  var name = "@vitrosoftware/common-ui-ts";
61896
- var version$1 = "1.1.108";
61896
+ var version$1 = "1.1.109";
61897
61897
  var description = "vitro software common ui ts";
61898
61898
  var author = "";
61899
61899
  var license = "MIT";
@@ -62569,7 +62569,7 @@ var NumberInput = React.forwardRef(function (props, ref) {
62569
62569
  var secondLocaleSeparator = localeSeparator === CTRL.COMMA ? CTRL.DOT : CTRL.COMMA;
62570
62570
  var inputRef = React.useRef();
62571
62571
  React.useEffect(function () {
62572
- var value = props.value ? props.value : CTRL.EMPTY;
62572
+ var value = props.value || props.value === 0 ? props.value : CTRL.EMPTY;
62573
62573
  setInputValue(getValue(value.toString()));
62574
62574
  }, [props.value]);
62575
62575
  React.useImperativeHandle(ref, function () {
@@ -63059,7 +63059,7 @@ var SelectedValueList = function SelectedValueList(props) {
63059
63059
  var valueListStyles = {"vitro-value-list":"_lookup-picker-value-list_vitro-value-list_LSdCMjq","vitro-item":"_lookup-picker-value-list_vitro-item_7yZBz5u","vitro-item-html-value":"_lookup-picker-value-list_vitro-item-html-value_1yl9tXx","vitro-placeholder-empty":"_lookup-picker-value-list_vitro-placeholder-empty_fTVHWwc","vitro-keyword-highlight":"_lookup-picker-value-list_vitro-keyword-highlight_1uESHan","vitro-display-none":"_lookup-picker-value-list_vitro-display-none_2kDzC6K"};
63060
63060
 
63061
63061
  var ValueListItem = function ValueListItem(props) {
63062
- var _onKeyDown = function onKeyDown(e, id) {
63062
+ var onKeyDown = function onKeyDown(e) {
63063
63063
  if (e.keyCode === 13 && !e.shiftKey) {
63064
63064
  e.preventDefault();
63065
63065
  props.onSelect(props.item.id);
@@ -63068,10 +63068,8 @@ var ValueListItem = function ValueListItem(props) {
63068
63068
  return React__default.createElement("div", {
63069
63069
  key: props.item.id,
63070
63070
  className: valueListStyles['vitro-item'],
63071
- onKeyDown: function onKeyDown(e) {
63072
- return _onKeyDown(e);
63073
- },
63074
- onClick: function onClick() {
63071
+ onKeyDown: onKeyDown,
63072
+ onMouseDown: function onMouseDown() {
63075
63073
  return props.onSelect(props.item.id);
63076
63074
  },
63077
63075
  tabIndex: 0
@@ -63099,13 +63097,20 @@ var ValueList = function ValueList(props) {
63099
63097
  }
63100
63098
  });
63101
63099
  React.useEffect(function () {
63102
- if (props.isVisible && !props.isFlip && props.contentRef) {
63103
- setStyle({
63104
- width: props.contentRef.offsetWidth + UNIT.PX,
63105
- inset: props.contentRef.offsetHeight + UNIT.PX + " auto auto 0px"
63106
- });
63107
- } else {
63100
+ if (props.isFlip) {
63108
63101
  setStyle(null);
63102
+ } else {
63103
+ if (props.isVisible && props.contentRef) {
63104
+ setStyle({
63105
+ width: props.contentRef.offsetWidth + UNIT.PX,
63106
+ inset: props.contentRef.offsetHeight + UNIT.PX + " auto auto 0px"
63107
+ });
63108
+ } else {
63109
+ setStyle({
63110
+ width: 0,
63111
+ inset: 0
63112
+ });
63113
+ }
63109
63114
  }
63110
63115
  }, [props.isVisible]);
63111
63116
  var createDisplayValue = function createDisplayValue(item) {
@@ -63320,6 +63325,7 @@ var LookupPicker = React.forwardRef(function (props, ref) {
63320
63325
  inputRef && inputRef.current && inputRef.current.focus();
63321
63326
  } else {
63322
63327
  setValueListVisible(false);
63328
+ setState(CTRL.EMPTY);
63323
63329
  }
63324
63330
  };
63325
63331
  var onOptionValueDelete = function onOptionValueDelete(id) {
@@ -63335,10 +63341,10 @@ var LookupPicker = React.forwardRef(function (props, ref) {
63335
63341
  };
63336
63342
  var onFocusOut = function onFocusOut(e) {
63337
63343
  var target = e.currentTarget;
63338
- setState(props.errorMessage ? styles$M['vitro-error'] : CTRL.EMPTY);
63339
63344
  setTimeout(function () {
63340
63345
  var _document$activeEleme;
63341
- if (!target.contains(document.activeElement) && !((_document$activeEleme = document.activeElement) !== null && _document$activeEleme !== void 0 && _document$activeEleme.classList.contains(valueListStyles['vitro-item']))) {
63346
+ var isValueListItem = Boolean(props.isMultiSelect && ((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.classList.contains(valueListStyles['vitro-item'])));
63347
+ if (!target.contains(document.activeElement) && !isValueListItem) {
63342
63348
  setValueListVisible(false);
63343
63349
  setInputValue(CTRL.EMPTY);
63344
63350
  if (props.onBlur && !props.isDisabled) {
@@ -63346,6 +63352,7 @@ var LookupPicker = React.forwardRef(function (props, ref) {
63346
63352
  return x;
63347
63353
  }), props.name);
63348
63354
  }
63355
+ setState(props.errorMessage ? styles$M['vitro-error'] : CTRL.EMPTY);
63349
63356
  }
63350
63357
  });
63351
63358
  };
@@ -63409,7 +63416,7 @@ var LookupPicker = React.forwardRef(function (props, ref) {
63409
63416
  value: inputValue,
63410
63417
  onKeyDown: onKeyDown,
63411
63418
  onChange: onChange,
63412
- onClick: onFocus
63419
+ onFocus: onFocus
63413
63420
  }), !props.isDisabled && props.children, React__default.createElement("div", {
63414
63421
  className: styles$M['vitro-right']
63415
63422
  }, !props.isMultiSelect && selectedValueList && selectedValueList.length > 0 && isEditable && React__default.createElement("div", {
@@ -66330,13 +66337,6 @@ var ProductTitle = function ProductTitle(props) {
66330
66337
  defaultUrl: props.image,
66331
66338
  caption: props.imageCaption
66332
66339
  }), props.title && React__default.createElement("h1", null, props.title), props.children);
66333
- if (props.href) {
66334
- return React__default.createElement("a", {
66335
- href: props.href,
66336
- className: styles$1k['vitro-product-title'],
66337
- title: props.imageCaption
66338
- }, content);
66339
- }
66340
66340
  var onClick = function onClick(e) {
66341
66341
  var href = props.link ? props.link : CTRL.SLASH;
66342
66342
  var event = new CustomEvent(exports.EVENT.HISTORY_UPDATE, {
@@ -66346,6 +66346,16 @@ var ProductTitle = function ProductTitle(props) {
66346
66346
  });
66347
66347
  window.dispatchEvent(event);
66348
66348
  };
66349
+ if (!props.image && !props.title) {
66350
+ return React__default.createElement(React__default.Fragment, null);
66351
+ }
66352
+ if (props.href) {
66353
+ return React__default.createElement("a", {
66354
+ href: props.href,
66355
+ className: styles$1k['vitro-product-title'],
66356
+ title: props.imageCaption
66357
+ }, content);
66358
+ }
66349
66359
  return React__default.createElement("a", {
66350
66360
  onClick: onClick,
66351
66361
  className: styles$1k['vitro-product-title'],