ydb-components-material 0.1.160 → 0.1.161

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.
@@ -113,23 +113,26 @@ var SceneTree = function SceneTree(_ref) {
113
113
  targetNodeOfCurTree.children = targetNodeChildList;
114
114
  } else {
115
115
  // 如果已经有子题目 查一下已经存在的子题目中是否有当前选中项的子题目
116
+ // 按 groupId 去重(同一组的子题目视为同一题),无 groupId 时退回按 id
116
117
  console.log('targetNodeOfCurTree---', targetNodeOfCurTree);
118
+ var targetChildGroupId = targetNodeChildList[0].groupId;
117
119
  var alreadyExit = (targetNodeOfCurTree.children || []).find(function (v) {
118
- return v.id === targetNodeChildList[0].id;
120
+ return targetChildGroupId ? v.groupId === targetChildGroupId : v.id === targetNodeChildList[0].id;
119
121
  });
120
122
  if (alreadyExit) {
121
123
  // 如果存在 说明当前带出来的这个子题目已经存在 需要合并两个题目的选项下的children
122
124
 
123
125
  var repeatQuestion = targetNodeChildList[0];
124
126
  // 遍历这两个重复题目的选项 合并每个选项的children
127
+ // 选项匹配与子题目去重同样按 groupId(无 groupId 时退回按 id)
125
128
  alreadyExit.options.forEach(function (o) {
126
129
  var curOption = repeatQuestion.options.find(function (r) {
127
- return r.id === o.id;
130
+ return o.groupId ? r.groupId === o.groupId : r.id === o.id;
128
131
  });
129
132
  if (curOption) {
130
133
  curOption.children.forEach(function (child) {
131
134
  if (!o.children.find(function (c) {
132
- return c.id === child.id;
135
+ return child.groupId ? c.groupId === child.groupId : c.id === child.id;
133
136
  })) {
134
137
  o.children.push(child);
135
138
  }
@@ -119,23 +119,26 @@ var SceneTree = function SceneTree(_ref) {
119
119
  targetNodeOfCurTree.children = targetNodeChildList;
120
120
  } else {
121
121
  // 如果已经有子题目 查一下已经存在的子题目中是否有当前选中项的子题目
122
+ // 按 groupId 去重(同一组的子题目视为同一题),无 groupId 时退回按 id
122
123
  console.log('targetNodeOfCurTree---', targetNodeOfCurTree);
124
+ var targetChildGroupId = targetNodeChildList[0].groupId;
123
125
  var alreadyExit = (targetNodeOfCurTree.children || []).find(function (v) {
124
- return v.id === targetNodeChildList[0].id;
126
+ return targetChildGroupId ? v.groupId === targetChildGroupId : v.id === targetNodeChildList[0].id;
125
127
  });
126
128
  if (alreadyExit) {
127
129
  // 如果存在 说明当前带出来的这个子题目已经存在 需要合并两个题目的选项下的children
128
130
 
129
131
  var repeatQuestion = targetNodeChildList[0];
130
132
  // 遍历这两个重复题目的选项 合并每个选项的children
133
+ // 选项匹配与子题目去重同样按 groupId(无 groupId 时退回按 id)
131
134
  alreadyExit.options.forEach(function (o) {
132
135
  var curOption = repeatQuestion.options.find(function (r) {
133
- return r.id === o.id;
136
+ return o.groupId ? r.groupId === o.groupId : r.id === o.id;
134
137
  });
135
138
  if (curOption) {
136
139
  curOption.children.forEach(function (child) {
137
140
  if (!o.children.find(function (c) {
138
- return c.id === child.id;
141
+ return child.groupId ? c.groupId === child.groupId : c.id === child.id;
139
142
  })) {
140
143
  o.children.push(child);
141
144
  }
@@ -98,7 +98,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
98
98
  packageName = 'ydb-components-material';
99
99
  }
100
100
  if (version === void 0) {
101
- version = '0.1.160';
101
+ version = '0.1.161';
102
102
  }
103
103
  if (basicLibraryVersion === void 0) {
104
104
  basicLibraryVersion = {
@@ -103,7 +103,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
103
103
  packageName = 'ydb-components-material';
104
104
  }
105
105
  if (version === void 0) {
106
- version = '0.1.160';
106
+ version = '0.1.161';
107
107
  }
108
108
  if (basicLibraryVersion === void 0) {
109
109
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-components-material",
3
- "version": "0.1.160",
3
+ "version": "0.1.161",
4
4
  "description": "ydb-components-material",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -102,10 +102,10 @@
102
102
  },
103
103
  "componentConfig": {
104
104
  "isComponentLibrary": true,
105
- "materialSchema": "https://unpkg.com/ydb-components-material@0.1.160/build/lowcode/assets-prod.json"
105
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.161/build/lowcode/assets-prod.json"
106
106
  },
107
107
  "lcMeta": {
108
108
  "type": "component"
109
109
  },
110
- "homepage": "https://unpkg.com/ydb-components-material@0.1.160/build/index.html"
110
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.161/build/index.html"
111
111
  }