ywana-core8 0.0.169 → 0.0.173

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.cjs CHANGED
@@ -863,6 +863,8 @@ var TextField = function TextField(props) {
863
863
  outlined = props.outlined,
864
864
  _props$readOnly = props.readOnly,
865
865
  readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
866
+ _props$canClear = props.canClear,
867
+ canClear = _props$canClear === void 0 ? true : _props$canClear,
866
868
  onChange = props.onChange,
867
869
  onEnter = props.onEnter,
868
870
  onClick = props.onClick;
@@ -891,6 +893,10 @@ var TextField = function TextField(props) {
891
893
  }
892
894
  }
893
895
 
896
+ function clear() {
897
+ if (onChange) onChange(id, "");
898
+ }
899
+
894
900
  var borderStyle = outlined ? "textfield-outlined" : "textfield";
895
901
  var labelStyle = label ? "" : "no-label";
896
902
  var style = labelStyle + " " + borderStyle;
@@ -908,7 +914,12 @@ var TextField = function TextField(props) {
908
914
  onKeyDown: onKeyPress,
909
915
  onFocus: focus,
910
916
  readOnly: readOnly
911
- }), /*#__PURE__*/React__default["default"].createElement("span", {
917
+ }), canClear ? /*#__PURE__*/React__default["default"].createElement(Icon, {
918
+ icon: "close",
919
+ clickable: true,
920
+ size: "small",
921
+ action: clear
922
+ }) : null, /*#__PURE__*/React__default["default"].createElement("span", {
912
923
  className: "bar"
913
924
  }), label ? /*#__PURE__*/React__default["default"].createElement("label", null, labelTxt) : null);
914
925
  };
@@ -941,7 +952,10 @@ var DropDown = function DropDown(props) {
941
952
  var option = options.find(function (option) {
942
953
  return option.value === value;
943
954
  });
944
- if (option) setLabel(option.label);
955
+
956
+ var _label = option ? option.label : "";
957
+
958
+ setLabel(_label);
945
959
  }
946
960
  }, [value]);
947
961
 
@@ -2970,6 +2984,7 @@ var StringEditor = function StringEditor(_ref6) {
2970
2984
  return opts;
2971
2985
  }
2972
2986
 
2987
+ console.log('StringEditor: ', label, value, content);
2973
2988
  return /*#__PURE__*/React__default["default"].createElement("div", {
2974
2989
  className: "field-editor string-editor"
2975
2990
  }, format === FORMATS.DATE ? /*#__PURE__*/React__default["default"].createElement(TextField, {