not-bulma 1.2.46 → 1.2.47
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/package.json
CHANGED
|
@@ -216,12 +216,7 @@ class notCRUD extends notController {
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
createDefault() {
|
|
219
|
-
|
|
220
|
-
_id: null,
|
|
221
|
-
title: say(this.getOptions("names.single")),
|
|
222
|
-
products: [],
|
|
223
|
-
});
|
|
224
|
-
return newRecord;
|
|
219
|
+
return this.getModel({}).toDefault();
|
|
225
220
|
}
|
|
226
221
|
|
|
227
222
|
route(params = []) {
|
package/src/frame/interface.js
CHANGED
|
@@ -444,6 +444,19 @@ class notInterface extends notBase {
|
|
|
444
444
|
getRecord() {
|
|
445
445
|
this.getData();
|
|
446
446
|
}
|
|
447
|
+
|
|
448
|
+
getDefaultAsPlainObject() {
|
|
449
|
+
if (!this.manifest || !this.manifest.fields) {
|
|
450
|
+
return {};
|
|
451
|
+
}
|
|
452
|
+
const result = {};
|
|
453
|
+
for (const fieldName of Object.keys(this.manifest.fields)) {
|
|
454
|
+
if (Object.hasOwn(this.manifest.fields[fieldName], "default")) {
|
|
455
|
+
result[fieldName] = this.manifest.fields[fieldName].default;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return result;
|
|
459
|
+
}
|
|
447
460
|
}
|
|
448
461
|
|
|
449
462
|
export default notInterface;
|
package/src/frame/record.js
CHANGED