ywana-core8 0.0.807 → 0.0.808

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
@@ -6760,6 +6760,7 @@
6760
6760
  editor = props.editor,
6761
6761
  editorTitle = props.editorTitle,
6762
6762
  editorActions = props.editorActions,
6763
+ editValidator = props.editValidator,
6763
6764
  listItemRenderer = props.listItemRenderer,
6764
6765
  filters = props.filters,
6765
6766
  footer = props.footer,
@@ -6863,7 +6864,8 @@
6863
6864
  patch: patch,
6864
6865
  onChange: onChange,
6865
6866
  actions: editorActions,
6866
- title: editorTitle
6867
+ title: editorTitle,
6868
+ validator: editValidator
6867
6869
  }), children ? /*#__PURE__*/React__default["default"].createElement("article", null, children) : null, /*#__PURE__*/React__default["default"].createElement("footer", null, footer)));
6868
6870
  };
6869
6871
  var CollectionFilters$1 = function CollectionFilters(props) {
@@ -7268,7 +7270,8 @@
7268
7270
  onChange = props.onChange,
7269
7271
  _props$patch2 = props.patch,
7270
7272
  patch = _props$patch2 === void 0 ? false : _props$patch2,
7271
- actions = props.actions;
7273
+ actions = props.actions,
7274
+ validator = props.validator;
7272
7275
  var timer = React.useRef(null);
7273
7276
 
7274
7277
  var _useState5 = React.useState(selected),
@@ -7297,8 +7300,9 @@
7297
7300
  }
7298
7301
 
7299
7302
  function canSave() {
7300
- var can = !equal__default["default"](form, selected);
7301
- return can;
7303
+ var hasChanged = !equal__default["default"](form, selected);
7304
+ var isValid = validator ? validator(form) : true;
7305
+ return hasChanged && isValid;
7302
7306
  }
7303
7307
 
7304
7308
  function renderTitle() {