ywana-core8 0.0.628 → 0.0.629
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 +33 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +33 -18
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +33 -18
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/domain/CollectionPage.js +8 -4
package/dist/index.modern.js
CHANGED
@@ -5655,6 +5655,8 @@ var CollectionPage = function CollectionPage(props) {
|
|
5655
5655
|
autosave = _props$autosave === void 0 ? false : _props$autosave,
|
5656
5656
|
_props$delay = props.delay,
|
5657
5657
|
delay = _props$delay === void 0 ? 1000 : _props$delay,
|
5658
|
+
_props$patch = props.patch,
|
5659
|
+
patch = _props$patch === void 0 ? false : _props$patch,
|
5658
5660
|
groupBy = props.groupBy,
|
5659
5661
|
levels = props.levels,
|
5660
5662
|
sorter = props.sorter,
|
@@ -5773,7 +5775,8 @@ var CollectionPage = function CollectionPage(props) {
|
|
5773
5775
|
delay: delay,
|
5774
5776
|
canDelete: canDelete,
|
5775
5777
|
canEdit: canEdit,
|
5776
|
-
onReload: reloadSelection
|
5778
|
+
onReload: reloadSelection,
|
5779
|
+
patch: patch
|
5777
5780
|
}), children ? /*#__PURE__*/React.createElement("article", null, children) : null, /*#__PURE__*/React.createElement("footer", null, footer)));
|
5778
5781
|
};
|
5779
5782
|
var CollectionFilters = function CollectionFilters(props) {
|
@@ -6055,9 +6058,19 @@ var CollectionTree = function CollectionTree(props) {
|
|
6055
6058
|
var CollectionEditor = function CollectionEditor(props) {
|
6056
6059
|
var save = function save() {
|
6057
6060
|
try {
|
6058
|
-
|
6061
|
+
var _temp3 = function _temp3() {
|
6059
6062
|
setPageContext(Object.assign({}, pageContext));
|
6060
|
-
}
|
6063
|
+
};
|
6064
|
+
|
6065
|
+
var _temp4 = function () {
|
6066
|
+
if (patch) {
|
6067
|
+
return Promise.resolve(pageContext.patch(form.id, form)).then(function () {});
|
6068
|
+
} else {
|
6069
|
+
return Promise.resolve(pageContext.update(form)).then(function () {});
|
6070
|
+
}
|
6071
|
+
}();
|
6072
|
+
|
6073
|
+
return Promise.resolve(_temp4 && _temp4.then ? _temp4.then(_temp3) : _temp3(_temp4));
|
6061
6074
|
} catch (e) {
|
6062
6075
|
return Promise.reject(e);
|
6063
6076
|
}
|
@@ -6087,7 +6100,9 @@ var CollectionEditor = function CollectionEditor(props) {
|
|
6087
6100
|
_props$delay2 = props.delay,
|
6088
6101
|
delay = _props$delay2 === void 0 ? 1000 : _props$delay2,
|
6089
6102
|
canDelete = props.canDelete,
|
6090
|
-
onReload = props.onReload
|
6103
|
+
onReload = props.onReload,
|
6104
|
+
_props$patch2 = props.patch,
|
6105
|
+
patch = _props$patch2 === void 0 ? false : _props$patch2;
|
6091
6106
|
var timer = useRef(null);
|
6092
6107
|
|
6093
6108
|
var _useState5 = useState(selected),
|
@@ -6185,7 +6200,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6185
6200
|
try {
|
6186
6201
|
var _this2 = this;
|
6187
6202
|
|
6188
|
-
var
|
6203
|
+
var _temp6 = _catch$3(function () {
|
6189
6204
|
return Promise.resolve(API.all(null, page)).then(function (data) {
|
6190
6205
|
_this2.all = field ? data[field] : data;
|
6191
6206
|
});
|
@@ -6193,7 +6208,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6193
6208
|
console.log(error);
|
6194
6209
|
});
|
6195
6210
|
|
6196
|
-
return Promise.resolve(
|
6211
|
+
return Promise.resolve(_temp6 && _temp6.then ? _temp6.then(function () {}) : void 0);
|
6197
6212
|
} catch (e) {
|
6198
6213
|
return Promise.reject(e);
|
6199
6214
|
}
|
@@ -6202,7 +6217,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6202
6217
|
try {
|
6203
6218
|
var _this4 = this;
|
6204
6219
|
|
6205
|
-
var
|
6220
|
+
var _temp8 = function () {
|
6206
6221
|
if (fetching) {
|
6207
6222
|
return Promise.resolve(_this4.fetch(id)).then(function (result) {
|
6208
6223
|
_this4.selected = result;
|
@@ -6216,7 +6231,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6216
6231
|
}
|
6217
6232
|
}();
|
6218
6233
|
|
6219
|
-
return Promise.resolve(
|
6234
|
+
return Promise.resolve(_temp8 && _temp8.then ? _temp8.then(function () {}) : void 0);
|
6220
6235
|
} catch (e) {
|
6221
6236
|
return Promise.reject(e);
|
6222
6237
|
}
|
@@ -6250,7 +6265,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6250
6265
|
try {
|
6251
6266
|
var _this8 = this;
|
6252
6267
|
|
6253
|
-
var
|
6268
|
+
var _temp10 = _catch$3(function () {
|
6254
6269
|
return Promise.resolve(API.create(form)).then(function () {
|
6255
6270
|
return Promise.resolve(_this8.load()).then(function () {});
|
6256
6271
|
});
|
@@ -6258,7 +6273,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6258
6273
|
console.log(error);
|
6259
6274
|
});
|
6260
6275
|
|
6261
|
-
return Promise.resolve(
|
6276
|
+
return Promise.resolve(_temp10 && _temp10.then ? _temp10.then(function () {}) : void 0);
|
6262
6277
|
} catch (e) {
|
6263
6278
|
return Promise.reject(e);
|
6264
6279
|
}
|
@@ -6267,7 +6282,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6267
6282
|
try {
|
6268
6283
|
var _this10 = this;
|
6269
6284
|
|
6270
|
-
var
|
6285
|
+
var _temp12 = _catch$3(function () {
|
6271
6286
|
return Promise.resolve(API.update(form)).then(function () {
|
6272
6287
|
return Promise.resolve(_this10.load()).then(function () {});
|
6273
6288
|
});
|
@@ -6275,7 +6290,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6275
6290
|
console.log(error);
|
6276
6291
|
});
|
6277
6292
|
|
6278
|
-
return Promise.resolve(
|
6293
|
+
return Promise.resolve(_temp12 && _temp12.then ? _temp12.then(function () {}) : void 0);
|
6279
6294
|
} catch (e) {
|
6280
6295
|
return Promise.reject(e);
|
6281
6296
|
}
|
@@ -6284,7 +6299,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6284
6299
|
try {
|
6285
6300
|
var _this12 = this;
|
6286
6301
|
|
6287
|
-
var
|
6302
|
+
var _temp14 = _catch$3(function () {
|
6288
6303
|
return Promise.resolve(API.patch(id, form)).then(function () {
|
6289
6304
|
return Promise.resolve(_this12.load()).then(function () {});
|
6290
6305
|
});
|
@@ -6292,7 +6307,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6292
6307
|
console.log(error);
|
6293
6308
|
});
|
6294
6309
|
|
6295
|
-
return Promise.resolve(
|
6310
|
+
return Promise.resolve(_temp14 && _temp14.then ? _temp14.then(function () {}) : void 0);
|
6296
6311
|
} catch (e) {
|
6297
6312
|
return Promise.reject(e);
|
6298
6313
|
}
|
@@ -6301,7 +6316,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6301
6316
|
try {
|
6302
6317
|
var _this14 = this;
|
6303
6318
|
|
6304
|
-
var
|
6319
|
+
var _temp16 = _catch$3(function () {
|
6305
6320
|
return Promise.resolve(API.updateProperty(id, propertyName, form)).then(function () {
|
6306
6321
|
return Promise.resolve(_this14.load()).then(function () {});
|
6307
6322
|
});
|
@@ -6309,7 +6324,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6309
6324
|
console.log(error);
|
6310
6325
|
});
|
6311
6326
|
|
6312
|
-
return Promise.resolve(
|
6327
|
+
return Promise.resolve(_temp16 && _temp16.then ? _temp16.then(function () {}) : void 0);
|
6313
6328
|
} catch (e) {
|
6314
6329
|
return Promise.reject(e);
|
6315
6330
|
}
|
@@ -6318,7 +6333,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6318
6333
|
try {
|
6319
6334
|
var _this16 = this;
|
6320
6335
|
|
6321
|
-
var
|
6336
|
+
var _temp18 = _catch$3(function () {
|
6322
6337
|
return Promise.resolve(API.remove(id)).then(function () {
|
6323
6338
|
return Promise.resolve(_this16.load()).then(function () {});
|
6324
6339
|
});
|
@@ -6326,7 +6341,7 @@ var CollectionContext = function CollectionContext(url, field, host, page, fetch
|
|
6326
6341
|
console.log(error);
|
6327
6342
|
});
|
6328
6343
|
|
6329
|
-
return Promise.resolve(
|
6344
|
+
return Promise.resolve(_temp18 && _temp18.then ? _temp18.then(function () {}) : void 0);
|
6330
6345
|
} catch (e) {
|
6331
6346
|
return Promise.reject(e);
|
6332
6347
|
}
|