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