ywana-core8 0.0.981 → 0.0.983

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.umd.js CHANGED
@@ -2655,7 +2655,8 @@
2655
2655
  setValue(value);
2656
2656
  }
2657
2657
  function changeDropDown(fid, value) {
2658
- var valueIsNotEmpty = value && value.length > 0;
2658
+ var isNumericValue = !isNaN(value);
2659
+ var valueIsNotEmpty = value && value.length > 0 || isNumericValue;
2659
2660
  if (valueIsNotEmpty) {
2660
2661
  var next = Array.isArray(tokens) ? tokens.concat(value) : [value];
2661
2662
  if (onChange) onChange(id, next);
@@ -2753,16 +2754,23 @@
2753
2754
  * Tree Node
2754
2755
  */
2755
2756
  var TreeNode = function TreeNode(_ref2) {
2756
- var _ref2$icon = _ref2.icon,
2757
+ var _React$createElement;
2758
+ var id = _ref2.id,
2759
+ _ref2$icon = _ref2.icon,
2757
2760
  icon = _ref2$icon === void 0 ? 'folder' : _ref2$icon,
2758
2761
  label = _ref2.label,
2759
2762
  _ref2$open = _ref2.open,
2760
2763
  open = _ref2$open === void 0 ? false : _ref2$open,
2761
2764
  children = _ref2.children,
2762
- actions = _ref2.actions;
2765
+ actions = _ref2.actions,
2766
+ onSelect = _ref2.onSelect;
2763
2767
  var labelTxt = label ? /*#__PURE__*/React__default["default"].createElement(Text, {
2764
2768
  format: TEXTFORMATS.STRING
2765
2769
  }, label) : null;
2770
+ function select() {
2771
+ if (onSelect) onSelect(id);
2772
+ }
2773
+ var clickable = onSelect ? "clickable" : "";
2766
2774
  return /*#__PURE__*/React__default["default"].createElement("details", {
2767
2775
  className: "tree-node",
2768
2776
  open: open
@@ -2772,9 +2780,10 @@
2772
2780
  icon: icon,
2773
2781
  size: "small",
2774
2782
  small: true
2775
- }) : null, /*#__PURE__*/React__default["default"].createElement("div", {
2776
- className: "label"
2777
- }, labelTxt), /*#__PURE__*/React__default["default"].createElement("div", {
2783
+ }) : null, /*#__PURE__*/React__default["default"].createElement("div", (_React$createElement = {
2784
+ className: "label",
2785
+ onClick: select
2786
+ }, _React$createElement["className"] = clickable, _React$createElement), labelTxt), /*#__PURE__*/React__default["default"].createElement("div", {
2778
2787
  className: "actions"
2779
2788
  }, actions)), children);
2780
2789
  };