ywana-core8 0.0.169 → 0.0.170

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
@@ -860,6 +860,8 @@
860
860
  outlined = props.outlined,
861
861
  _props$readOnly = props.readOnly,
862
862
  readOnly = _props$readOnly === void 0 ? false : _props$readOnly,
863
+ _props$canClear = props.canClear,
864
+ canClear = _props$canClear === void 0 ? true : _props$canClear,
863
865
  onChange = props.onChange,
864
866
  onEnter = props.onEnter,
865
867
  onClick = props.onClick;
@@ -888,6 +890,10 @@
888
890
  }
889
891
  }
890
892
 
893
+ function clear() {
894
+ if (onChange) onChange(id, "");
895
+ }
896
+
891
897
  var borderStyle = outlined ? "textfield-outlined" : "textfield";
892
898
  var labelStyle = label ? "" : "no-label";
893
899
  var style = labelStyle + " " + borderStyle;
@@ -905,7 +911,12 @@
905
911
  onKeyDown: onKeyPress,
906
912
  onFocus: focus,
907
913
  readOnly: readOnly
908
- }), /*#__PURE__*/React__default["default"].createElement("span", {
914
+ }), canClear ? /*#__PURE__*/React__default["default"].createElement(Icon, {
915
+ icon: "close",
916
+ clickable: true,
917
+ size: "small",
918
+ action: clear
919
+ }) : null, /*#__PURE__*/React__default["default"].createElement("span", {
909
920
  className: "bar"
910
921
  }), label ? /*#__PURE__*/React__default["default"].createElement("label", null, labelTxt) : null);
911
922
  };