@nocobase/plugin-field-m2m-array 1.5.0-beta.8 → 1.5.0
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/externalVersion.js
CHANGED
|
@@ -11,10 +11,10 @@ module.exports = {
|
|
|
11
11
|
"@formily/react": "2.3.0",
|
|
12
12
|
"antd": "5.12.8",
|
|
13
13
|
"react": "18.2.0",
|
|
14
|
-
"@nocobase/client": "1.5.0
|
|
14
|
+
"@nocobase/client": "1.5.0",
|
|
15
15
|
"react-router-dom": "6.21.0",
|
|
16
|
-
"@nocobase/utils": "1.5.0
|
|
17
|
-
"@nocobase/database": "1.5.0
|
|
18
|
-
"@nocobase/server": "1.5.0
|
|
19
|
-
"@nocobase/data-source-manager": "1.5.0
|
|
16
|
+
"@nocobase/utils": "1.5.0",
|
|
17
|
+
"@nocobase/database": "1.5.0",
|
|
18
|
+
"@nocobase/server": "1.5.0",
|
|
19
|
+
"@nocobase/data-source-manager": "1.5.0"
|
|
20
20
|
};
|
|
@@ -15,7 +15,6 @@ export declare const elementTypeMap: {
|
|
|
15
15
|
export declare class BelongsToArrayField extends RelationField {
|
|
16
16
|
get dataType(): string;
|
|
17
17
|
private setForeignKeyArray;
|
|
18
|
-
init(): void;
|
|
19
18
|
checkTargetCollection(): boolean;
|
|
20
19
|
checkAssociationKeys(): void;
|
|
21
20
|
bind(): boolean;
|
|
@@ -73,16 +73,6 @@ class BelongsToArrayField extends import_database.RelationField {
|
|
|
73
73
|
tks.push(...newInstances.map((instance) => instance[targetKey]));
|
|
74
74
|
model.set(foreignKey, tks);
|
|
75
75
|
};
|
|
76
|
-
init() {
|
|
77
|
-
super.init();
|
|
78
|
-
const { name, ...opts } = this.options;
|
|
79
|
-
this.collection.model.associations[name] = new import_database.BelongsToArrayAssociation({
|
|
80
|
-
db: this.database,
|
|
81
|
-
source: this.collection.model,
|
|
82
|
-
as: name,
|
|
83
|
-
...opts
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
76
|
checkTargetCollection() {
|
|
87
77
|
const { target } = this.options;
|
|
88
78
|
if (!target) {
|
|
@@ -127,6 +117,13 @@ class BelongsToArrayField extends import_database.RelationField {
|
|
|
127
117
|
return false;
|
|
128
118
|
}
|
|
129
119
|
this.checkAssociationKeys();
|
|
120
|
+
const { name, ...opts } = this.options;
|
|
121
|
+
this.collection.model.associations[name] = new import_database.BelongsToArrayAssociation({
|
|
122
|
+
db: this.database,
|
|
123
|
+
source: this.collection.model,
|
|
124
|
+
as: name,
|
|
125
|
+
...opts
|
|
126
|
+
});
|
|
130
127
|
this.on("beforeSave", this.setForeignKeyArray);
|
|
131
128
|
}
|
|
132
129
|
unbind() {
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "数据表字段:多对多 (数组)",
|
|
5
5
|
"description": "Allows to create many to many relationships between two models by storing an array of unique keys of the target model.",
|
|
6
6
|
"description.zh-CN": "支持通过在数组中存储目标表唯一键的方式建立多对多关系。",
|
|
7
|
-
"version": "1.5.0
|
|
7
|
+
"version": "1.5.0",
|
|
8
8
|
"main": "dist/server/index.js",
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"@nocobase/client": "1.x",
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
"keywords": [
|
|
15
15
|
"Collection fields"
|
|
16
16
|
],
|
|
17
|
-
"gitHead": "
|
|
17
|
+
"gitHead": "1eae52e1fc837e9b1c6b63fc31bda7945b6101e9"
|
|
18
18
|
}
|