ydb-components-material 0.1.98 → 0.1.99

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.
Files changed (51) hide show
  1. package/build/docs/404.html +3 -3
  2. package/build/docs/_demos/:uuid +3 -3
  3. package/build/docs/colorful-button.html +3 -3
  4. package/build/docs/colorful-input.html +3 -3
  5. package/build/docs/index.html +3 -3
  6. package/build/docs/{umi.6979d68b.css → umi.475dd297.css} +1 -1
  7. package/build/docs/umi.4b7bc7e0.js +1 -0
  8. package/build/docs/~demos/:uuid.html +3 -3
  9. package/build/docs/~demos/colorful-button-demo.html +3 -3
  10. package/build/docs/~demos/colorful-input-demo.html +3 -3
  11. package/build/lowcode/3.js +2 -2
  12. package/build/lowcode/4.js +1 -1
  13. package/build/lowcode/5.js +1 -1
  14. package/build/lowcode/assets-daily.json +11 -11
  15. package/build/lowcode/assets-dev.json +2 -2
  16. package/build/lowcode/assets-prod.json +11 -11
  17. package/build/lowcode/index.js +1 -1
  18. package/build/lowcode/meta.js +1 -1
  19. package/build/lowcode/preview.js +9 -9
  20. package/build/lowcode/render/default/1.js +2 -2
  21. package/build/lowcode/render/default/2.js +1 -1
  22. package/build/lowcode/render/default/3.js +1 -1
  23. package/build/lowcode/render/default/view.css +1 -1
  24. package/build/lowcode/render/default/view.js +21 -21
  25. package/build/lowcode/view.css +1 -1
  26. package/build/lowcode/view.js +21 -21
  27. package/dist/1.js +2 -2
  28. package/dist/2.js +1 -1
  29. package/dist/3.js +1 -1
  30. package/dist/BizComps.css +1 -1
  31. package/dist/BizComps.js +26 -26
  32. package/dist/BizComps.js.map +1 -1
  33. package/es/components/message/index.d.ts +4 -5
  34. package/es/components/message/index.js +13 -35
  35. package/es/components/message/index.scss +22 -19
  36. package/es/components/scene-tree/index.js +105 -16
  37. package/es/components/scene-tree/index.scss +7 -0
  38. package/es/style.js +1 -1
  39. package/lib/components/message/index.d.ts +4 -5
  40. package/lib/components/message/index.js +13 -36
  41. package/lib/components/message/index.scss +22 -19
  42. package/lib/components/scene-tree/index.js +105 -16
  43. package/lib/components/scene-tree/index.scss +7 -0
  44. package/lib/style.js +1 -1
  45. package/lowcode/message/meta.ts +30 -0
  46. package/lowcode_es/message/meta.js +28 -0
  47. package/lowcode_es/meta.js +1 -1
  48. package/lowcode_lib/message/meta.js +28 -0
  49. package/lowcode_lib/meta.js +1 -1
  50. package/package.json +3 -3
  51. package/build/docs/umi.19ae92a3.js +0 -1
@@ -4,6 +4,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  exports.__esModule = true;
5
5
  exports["default"] = void 0;
6
6
  var _checkbox = _interopRequireDefault(require("@alifd/next/lib/checkbox"));
7
+ var _balloon = _interopRequireDefault(require("@alifd/next/lib/balloon"));
8
+ var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
7
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
10
  var _radio = _interopRequireDefault(require("@alifd/next/lib/radio"));
9
11
  var _react = _interopRequireWildcard(require("react"));
@@ -70,16 +72,40 @@ var SceneTree = function SceneTree(_ref) {
70
72
  var targetNodeOfCurTree = _findNodeById(curTree, targetId, targetPId);
71
73
  // 删除当前题目的子题目先 可能还留有上次带出来的题目
72
74
  targetNodeOfCurTree.children = [];
75
+ // 如果不是初始化的时候就禁用了 重置一下禁用状态和
76
+ targetNodeOfOriginTree.options.forEach(function (option) {
77
+ if (option.preDisabled !== true) {
78
+ option.disabled = false;
79
+ option.showMutuallyExclusivePrompt = false;
80
+ }
81
+ });
73
82
  console.log('targetNodeOfCurTree----', targetNodeOfCurTree);
74
83
  // 可能是个多选题 val会是个数组
75
84
  if (Array.isArray(val)) {
76
85
  if (val.length) {
77
86
  var optionNameList = [];
78
87
  val.forEach(function (item) {
88
+ // 找到当前选项在当前树中
89
+ var curOption = targetNodeOfCurTree.options.find(function (option) {
90
+ return option.id === item;
91
+ });
92
+ curOption.showMutuallyExclusivePrompt = true;
79
93
  // 找到对应的选项在源数据中
80
94
  var targetOption = targetNodeOfOriginTree.options.find(function (option) {
81
95
  return option.id === item;
82
96
  });
97
+ // 如果当前选项有互斥选项,找出来禁用掉
98
+ if (Array.isArray(targetOption.mutuallyExclusiveOptions) && targetOption.mutuallyExclusiveOptions.length) {
99
+ targetOption.mutuallyExclusiveOptions.forEach(function (mutuallyExclusiveOption) {
100
+ var targetMutuallyExclusiveOption = targetNodeOfCurTree.options.find(function (option) {
101
+ return option.id === mutuallyExclusiveOption;
102
+ });
103
+ console.log('targetMutuallyExclusiveOption--', targetMutuallyExclusiveOption);
104
+ if (targetMutuallyExclusiveOption) {
105
+ targetMutuallyExclusiveOption.disabled = true;
106
+ }
107
+ });
108
+ }
83
109
  optionNameList.push(targetOption.name);
84
110
  // 拿到这个选中的选项会带出来的子题目 虽然是个数组。但是只有一项 只会带出来一个题目
85
111
  var targetNodeChildList = (targetOption.children || []).filter(Boolean).map(function (n) {
@@ -148,6 +174,13 @@ var SceneTree = function SceneTree(_ref) {
148
174
  setCurTree((0, _extends2["default"])({}, curTree));
149
175
  valChange(curTree);
150
176
  };
177
+ var trigger = function trigger(style) {
178
+ return /*#__PURE__*/React.createElement(_icon["default"], {
179
+ type: "help",
180
+ size: "xs",
181
+ style: style
182
+ });
183
+ };
151
184
  var _TreeNode = function TreeNode(_ref2) {
152
185
  var node = _ref2.node,
153
186
  otherStyle = _ref2.style;
@@ -167,7 +200,19 @@ var SceneTree = function SceneTree(_ref) {
167
200
  className: !isPC ? 'title' : 'title_pc'
168
201
  }, /*#__PURE__*/React.createElement("span", {
169
202
  className: "required"
170
- }, "*"), node.title, !!+node.isMultipleChoice && '(多选)'), !+node.isMultipleChoice ? /*#__PURE__*/React.createElement(RadioGroup, {
203
+ }, "*"), node.title, !!+node.isMultipleChoice && '(多选)', node.description && /*#__PURE__*/React.createElement(_balloon["default"], {
204
+ v2: true,
205
+ trigger: trigger({
206
+ color: '#666',
207
+ marginTop: '-4px',
208
+ marginLeft: '5px'
209
+ }),
210
+ triggerType: "click",
211
+ align: "t",
212
+ arrowPointToCenter: true,
213
+ title: "",
214
+ delay: 20
215
+ }, node.description)), !+node.isMultipleChoice ? /*#__PURE__*/React.createElement(RadioGroup, {
171
216
  className: isPC && 'options_pc',
172
217
  value: node.value,
173
218
  onChange: onValChange,
@@ -175,32 +220,76 @@ var SceneTree = function SceneTree(_ref) {
175
220
  }, node.options.map(function (option, index) {
176
221
  console.log('optionsVal', option.value);
177
222
  var isOverFlow = option.name.length > 4;
178
- return /*#__PURE__*/React.createElement(_radio["default"], {
223
+ return /*#__PURE__*/React.createElement("div", {
224
+ key: index,
225
+ style: {
226
+ display: 'flex',
227
+ alignItems: 'center',
228
+ width: '100%',
229
+ marginTop: index > 0 ? '10px' : '',
230
+ flexWrap: 'wrap'
231
+ }
232
+ }, /*#__PURE__*/React.createElement(_radio["default"], {
179
233
  id: option.pid + "+" + node.pid,
180
234
  key: option.id + node.pid + option.value + index,
181
235
  value: option.id,
182
- disabled: node.disabled,
183
- style: isOverFlow && index > 0 ? {
184
- width: '100%',
185
- marginTop: '10px'
186
- } : undefined
187
- }, option.name);
236
+ disabled: option.disabled
237
+ }, option.name), option.description && /*#__PURE__*/React.createElement(_balloon["default"], {
238
+ v2: true,
239
+ trigger: trigger({
240
+ color: '#666',
241
+ left: '-10px',
242
+ position: 'relative',
243
+ top: '1px'
244
+ }),
245
+ triggerType: "click",
246
+ align: "t",
247
+ arrowPointToCenter: true,
248
+ title: "",
249
+ delay: 20
250
+ }, option.description));
188
251
  })) : /*#__PURE__*/React.createElement(_checkbox["default"].Group, {
189
252
  value: node.value,
190
253
  onChange: onValChange,
191
254
  className: isPC && 'options_pc'
192
255
  }, node.options.map(function (option, index) {
193
- var isOverFlow = option.name.length > 4;
194
- return /*#__PURE__*/React.createElement(_checkbox["default"], {
256
+ var showMutualExclusionPrompt = option.mutualExclusionPrompt;
257
+ return /*#__PURE__*/React.createElement("div", {
258
+ style: {
259
+ display: 'flex',
260
+ alignItems: 'center',
261
+ width: '100%',
262
+ marginTop: index > 0 ? '10px' : '',
263
+ flexWrap: 'wrap'
264
+ }
265
+ }, /*#__PURE__*/React.createElement(_checkbox["default"], {
195
266
  id: option.pid + "+" + node.pid,
196
267
  key: option.id + node.pid + option.value + index,
197
268
  value: option.id,
198
- disabled: node.disabled,
199
- style: isOverFlow && index > 0 ? {
200
- width: '100%',
201
- marginTop: '10px'
202
- } : undefined
203
- }, option.name);
269
+ disabled: option.disabled
270
+ }, option.name), option.description && /*#__PURE__*/React.createElement(_balloon["default"], {
271
+ v2: true,
272
+ trigger: trigger({
273
+ color: '#666',
274
+ left: '-10px',
275
+ position: 'relative',
276
+ top: '1px'
277
+ }),
278
+ triggerType: "click",
279
+ align: "t",
280
+ arrowPointToCenter: true,
281
+ title: "",
282
+ delay: 20
283
+ }, node.description), option.showMutuallyExclusivePrompt && option.mutualExclusionPrompt && /*#__PURE__*/React.createElement("div", {
284
+ className: "mutualExclusionPrompt"
285
+ }, /*#__PURE__*/React.createElement(_icon["default"], {
286
+ type: "prompt",
287
+ size: "xs",
288
+ style: {
289
+ color: '#FF6237',
290
+ marginRight: '4px'
291
+ }
292
+ }), option.mutualExclusionPrompt));
204
293
  }))), node.children && (node.children || []).map(function (item, index) {
205
294
  var _node$children, _node$children2, _node$children3, _node$children4;
206
295
  console.log('----', ((_node$children = node.children) === null || _node$children === void 0 ? void 0 : _node$children.length) > 1 && index !== ((_node$children2 = node.children) === null || _node$children2 === void 0 ? void 0 : _node$children2.length) - 1);
@@ -12,6 +12,13 @@
12
12
  margin-bottom: 16px;
13
13
  }
14
14
 
15
+ .mutualExclusionPrompt {
16
+ color: #FF6237;
17
+ font-size: 12px;
18
+ margin-top: 3px;
19
+ width: 100%;
20
+ }
21
+
15
22
  .title_pc {
16
23
  .required {
17
24
  color: #FF3D3D;
package/lib/style.js CHANGED
@@ -2,6 +2,6 @@ require('@alifd/next/lib/icon/style');
2
2
  require('@alifd/next/lib/message/style');
3
3
  require('@alifd/next/lib/radio/style');
4
4
  require('@alifd/next/lib/checkbox/style');
5
- require('antd/lib/cascader/style');
6
5
  require('@alifd/next/lib/balloon/style');
6
+ require('antd/lib/cascader/style');
7
7
  require('./index.scss');
@@ -93,6 +93,36 @@ const MessageMeta: IPublicTypeComponentMetadata = {
93
93
  "initialValue": ""
94
94
  }
95
95
  },
96
+ {
97
+ "title": {
98
+ "label": {
99
+ "type": "i18n",
100
+ "en-US": "cancelText",
101
+ "zh-CN": "cancelText"
102
+ }
103
+ },
104
+ "name": "cancelText",
105
+ "setter": {
106
+ "componentName": "StringSetter",
107
+ "isRequired": true,
108
+ "initialValue": ""
109
+ }
110
+ },
111
+ {
112
+ "title": {
113
+ "label": {
114
+ "type": "i18n",
115
+ "en-US": "okText",
116
+ "zh-CN": "okText"
117
+ }
118
+ },
119
+ "name": "okText",
120
+ "setter": {
121
+ "componentName": "StringSetter",
122
+ "isRequired": true,
123
+ "initialValue": ""
124
+ }
125
+ },
96
126
  {
97
127
  "title": {
98
128
  "label": {
@@ -79,6 +79,34 @@ var MessageMeta = {
79
79
  "isRequired": true,
80
80
  "initialValue": ""
81
81
  }
82
+ }, {
83
+ "title": {
84
+ "label": {
85
+ "type": "i18n",
86
+ "en-US": "cancelText",
87
+ "zh-CN": "cancelText"
88
+ }
89
+ },
90
+ "name": "cancelText",
91
+ "setter": {
92
+ "componentName": "StringSetter",
93
+ "isRequired": true,
94
+ "initialValue": ""
95
+ }
96
+ }, {
97
+ "title": {
98
+ "label": {
99
+ "type": "i18n",
100
+ "en-US": "okText",
101
+ "zh-CN": "okText"
102
+ }
103
+ },
104
+ "name": "okText",
105
+ "setter": {
106
+ "componentName": "StringSetter",
107
+ "isRequired": true,
108
+ "initialValue": ""
109
+ }
82
110
  }, {
83
111
  "title": {
84
112
  "label": {
@@ -94,7 +94,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
94
94
  packageName = 'ydb-components-material';
95
95
  }
96
96
  if (version === void 0) {
97
- version = '0.1.98';
97
+ version = '0.1.99';
98
98
  }
99
99
  if (basicLibraryVersion === void 0) {
100
100
  basicLibraryVersion = {
@@ -84,6 +84,34 @@ var MessageMeta = {
84
84
  "isRequired": true,
85
85
  "initialValue": ""
86
86
  }
87
+ }, {
88
+ "title": {
89
+ "label": {
90
+ "type": "i18n",
91
+ "en-US": "cancelText",
92
+ "zh-CN": "cancelText"
93
+ }
94
+ },
95
+ "name": "cancelText",
96
+ "setter": {
97
+ "componentName": "StringSetter",
98
+ "isRequired": true,
99
+ "initialValue": ""
100
+ }
101
+ }, {
102
+ "title": {
103
+ "label": {
104
+ "type": "i18n",
105
+ "en-US": "okText",
106
+ "zh-CN": "okText"
107
+ }
108
+ },
109
+ "name": "okText",
110
+ "setter": {
111
+ "componentName": "StringSetter",
112
+ "isRequired": true,
113
+ "initialValue": ""
114
+ }
87
115
  }, {
88
116
  "title": {
89
117
  "label": {
@@ -99,7 +99,7 @@ function fillRealVersion(meta, packageName, version, basicLibraryVersion) {
99
99
  packageName = 'ydb-components-material';
100
100
  }
101
101
  if (version === void 0) {
102
- version = '0.1.98';
102
+ version = '0.1.99';
103
103
  }
104
104
  if (basicLibraryVersion === void 0) {
105
105
  basicLibraryVersion = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-components-material",
3
- "version": "0.1.98",
3
+ "version": "0.1.99",
4
4
  "description": "ydb-components-material",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -100,10 +100,10 @@
100
100
  },
101
101
  "componentConfig": {
102
102
  "isComponentLibrary": true,
103
- "materialSchema": "https://unpkg.com/ydb-components-material@0.1.98/build/lowcode/assets-prod.json"
103
+ "materialSchema": "https://unpkg.com/ydb-components-material@0.1.99/build/lowcode/assets-prod.json"
104
104
  },
105
105
  "lcMeta": {
106
106
  "type": "component"
107
107
  },
108
- "homepage": "https://unpkg.com/ydb-components-material@0.1.98/build/index.html"
108
+ "homepage": "https://unpkg.com/ydb-components-material@0.1.99/build/index.html"
109
109
  }