ywana-core8 0.0.168 → 0.0.172

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
  };
@@ -2970,6 +2981,7 @@ var StringEditor = function StringEditor(_ref6) {
2970
2981
  return opts;
2971
2982
  }
2972
2983
 
2984
+ console.log('StringEditor: ', label, value, content);
2973
2985
  return /*#__PURE__*/React__default["default"].createElement("div", {
2974
2986
  className: "field-editor string-editor"
2975
2987
  }, format === FORMATS.DATE ? /*#__PURE__*/React__default["default"].createElement(TextField, {
@@ -4244,11 +4256,12 @@ var TablePage = function TablePage(props) {
4244
4256
  function renderActions() {
4245
4257
  return actions.map(function (element) {
4246
4258
  var action = function action() {
4247
- return element.props.action(pageContext, "a");
4259
+ return element.props.action(pageContext);
4248
4260
  };
4249
4261
 
4250
- var clone = React__default["default"].cloneElement(element, [action]);
4251
- console.log("renderActions", clone);
4262
+ var clone = React__default["default"].cloneElement(element, {
4263
+ action: action
4264
+ });
4252
4265
  return clone;
4253
4266
  });
4254
4267
  }