@king-design/vue 2.0.13-beta.0 → 2.0.13

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.
@@ -1280,7 +1280,7 @@
1280
1280
  #### `Table animation`
1281
1281
 
1282
1282
  ```
1283
- "<div><button class=\"k-btn k-primary css-12uxt25\" tabindex=\"0\" type=\"button\">增加一行</button><button class=\"k-btn k-primary css-12uxt25\" tabindex=\"0\" type=\"button\">删除一行</button><button class=\"k-btn k-primary css-12uxt25\" tabindex=\"0\" type=\"button\">增加 一列 </button><div class=\"k-table css-gxoqtj\"><div class=\"k-table-wrapper\"><table><colgroup><col width=\"40\"><col><col></colgroup><thead><tr><th rowspan=\"1\"><label class=\"k-checkbox css-rt2md4\" tabindex=\"0\"><span class=\"k-checkbox-wrapper\"><input type=\"checkbox\" tabindex=\"-1\" value=\"true\"></span></label></th><th title=\"Title 1\" colspan=\"1\" rowspan=\"1\"><div class=\"k-table-title\"><div class=\"k-table-title-text c-ellipsis\">Title 1</div></div></th><th title=\"Title 3\" colspan=\"1\" rowspan=\"1\"><div class=\"k-table-resize\"></div><div class=\"k-table-title\"><div class=\"k-table-title-text c-ellipsis\">Title 3</div></div></th></tr></thead><tbody><tr data-key=\"Cell 1-1\"><td class=\"k-table-check\"><label class=\"k-checkbox css-rt2md4\" tabindex=\"0\"><span class=\"k-checkbox-wrapper\"><input type=\"checkbox\" tabindex=\"-1\" value=\"true\"></span></label></td><td title=\"Cell 1-1\">Cell 1-1</td><td title=\"Cell 1-3\">Cell 1-3</td></tr><tr data-key=\"Cell 2-1\"><td class=\"k-table-check\"><label class=\"k-checkbox css-rt2md4\" tabindex=\"0\"><span class=\"k-checkbox-wrapper\"><input type=\"checkbox\" tabindex=\"-1\" value=\"true\"></span></label></td><td title=\"Cell 2-1\">Cell 2-1</td><td title=\"Cell 2-3\">Cell 2-3</td></tr></tbody></table></div></div></div>"
1283
+ "<div><button class=\"k-btn k-primary css-12uxt25\" tabindex=\"0\" type=\"button\">增加一行</button><button class=\"k-btn k-primary css-12uxt25\" tabindex=\"0\" type=\"button\">删除一行</button><button class=\"k-btn k-primary css-12uxt25\" tabindex=\"0\" type=\"button\">增加 一列 </button><div class=\"k-table css-gxoqtj\"><div class=\"k-table-wrapper\"><table><colgroup><col width=\"40\"><col><col></colgroup><thead><tr><th rowspan=\"1\"><label class=\"k-checkbox css-rt2md4\" tabindex=\"0\"><span class=\"k-checkbox-wrapper\"><input type=\"checkbox\" tabindex=\"-1\" value=\"true\"></span></label></th><th title=\"Title 1\" colspan=\"1\" rowspan=\"1\"><div class=\"k-table-title\"><div class=\"k-table-title-text c-ellipsis\">Title 1</div></div></th><th title=\"Title 3\" colspan=\"1\" rowspan=\"1\"><div class=\"k-table-resize\"></div><div class=\"k-table-title\"><div class=\"k-table-title-text c-ellipsis\">Title 3</div></div></th></tr></thead><tbody><tr data-key=\"Cell 1-1\"><td class=\"k-table-check\"><label class=\"k-checkbox css-rt2md4\" tabindex=\"0\"><span class=\"k-checkbox-wrapper\"><input type=\"checkbox\" tabindex=\"-1\" value=\"true\"></span></label></td><td title=\"Cell 1-1\">Cell 1-1</td><td title=\"Cell 1-3\">Cell 1-3</td></tr><tr data-key=\"Cell 2-1\"><td class=\"k-table-check\"><label class=\"k-checkbox css-rt2md4\" tabindex=\"0\"><span class=\"k-checkbox-wrapper\"><input type=\"checkbox\" tabindex=\"-1\" value=\"true\"></span></label></td><td title=\"Cell 2-1\">Cell 2-1</td><td title=\"Cell 2-3\">Cell 2-3</td></tr></tbody></table></div></div><div class=\"k-table css-gxoqtj\"><div class=\"k-table-wrapper\"><table><colgroup><col width=\"40\"><col><col></colgroup><thead><tr><th rowspan=\"1\"><label class=\"k-checkbox css-rt2md4\" tabindex=\"0\"><span class=\"k-checkbox-wrapper\"><input type=\"checkbox\" tabindex=\"-1\" value=\"true\"></span></label></th><th title=\"Title 1\" colspan=\"1\" rowspan=\"1\"><div class=\"k-table-title\"><div class=\"k-table-title-text c-ellipsis\">Title 1</div></div></th><th title=\"Title 3\" colspan=\"1\" rowspan=\"1\"><div class=\"k-table-resize\"></div><div class=\"k-table-title\"><div class=\"k-table-title-text c-ellipsis\">Title 3</div></div></th></tr></thead><tbody><tr data-key=\"Cell 1-1\"><td class=\"k-table-check\"><label class=\"k-checkbox css-rt2md4\" tabindex=\"0\"><span class=\"k-checkbox-wrapper\"><input type=\"checkbox\" tabindex=\"-1\" value=\"true\"></span></label></td><td title=\"Cell 1-1\">Cell 1-1</td><td title=\"Cell 1-3\">Cell 1-3</td></tr><tr data-key=\"Cell 2-1\"><td class=\"k-table-check\"><label class=\"k-checkbox css-rt2md4\" tabindex=\"0\"><span class=\"k-checkbox-wrapper\"><input type=\"checkbox\" tabindex=\"-1\" value=\"true\"></span></label></td><td title=\"Cell 2-1\">Cell 2-1</td><td title=\"Cell 2-3\">Cell 2-3</td></tr></tbody></table></div></div></div>"
1284
1284
  ```
1285
1285
 
1286
1286
  #### `Table basic`
@@ -1,5 +1,5 @@
1
1
  import { Component, TypeDefs } from 'intact-vue-next';
2
- import type { editor } from 'monaco-editor';
2
+ import type { editor, default as monaco } from 'monaco-editor';
3
3
  import type { Events } from '../types';
4
4
  export interface CodeProps {
5
5
  value?: string;
@@ -11,7 +11,7 @@ export interface CodeProps {
11
11
  options?: editor.IStandaloneEditorConstructionOptions;
12
12
  }
13
13
  export interface CodeEvents {
14
- ready: [editor.IStandaloneCodeEditor, typeof editor];
14
+ ready: [editor.IStandaloneCodeEditor, typeof editor, typeof monaco];
15
15
  }
16
16
  export declare class Code extends Component<CodeProps, CodeEvents> {
17
17
  static template: string | import("intact").Template<any>;
@@ -29,7 +29,7 @@ export function useEditor() {
29
29
  }, options));
30
30
  watch(Editor, codeEditor);
31
31
  loading.set(false);
32
- instance.trigger('ready', codeEditor, Editor);
32
+ instance.trigger('ready', codeEditor, Editor, monaco);
33
33
  });
34
34
  });
35
35
  onBeforeUnmount(function () {
@@ -23,6 +23,7 @@ export interface TableRowProps {
23
23
  onToggleSpreadRow: (key: TableRowKey) => void;
24
24
  onBeforeUnmount: (key: TableRowKey) => void;
25
25
  offsetMap: Record<Key, number>;
26
+ animation: boolean;
26
27
  draggable: boolean;
27
28
  draggingKey: TableRowKey | null;
28
29
  onRowDragStart: DragCallback;
@@ -5,7 +5,7 @@ import { getClassAndStyleForFixed } from './useFixedColumns';
5
5
  import { Checkbox } from '../checkbox';
6
6
  import { Radio } from '../radio';
7
7
  import { TableCell } from './cell';
8
- import { createElementVNode, className as cx } from 'intact';
8
+ import { createElementVNode, className as cx, createFragment } from 'intact';
9
9
  export default function ($props, $blocks, $__proto__) {
10
10
  var _classNameObj,
11
11
  _this = this;
@@ -34,7 +34,8 @@ export default function ($props, $blocks, $__proto__) {
34
34
  key = _this$get.key,
35
35
  offsetMap = _this$get.offsetMap,
36
36
  draggable = _this$get.draggable,
37
- draggingKey = _this$get.draggingKey;
37
+ draggingKey = _this$get.draggingKey,
38
+ animation = _this$get.animation;
38
39
 
39
40
  var classNameObj = (_classNameObj = {
40
41
  'k-disabled': disabled,
@@ -110,16 +111,14 @@ export default function ($props, $blocks, $__proto__) {
110
111
  'key': columnKey
111
112
  }, columnKey));
112
113
  });
113
-
114
- var rows = _$cc(TransitionGroup, {
114
+ var rows = animation ? _$cc(TransitionGroup, {
115
115
  'name': 'k-fade-expand',
116
116
  'move': false,
117
117
  'children': vNodes
118
- });
118
+ }) : createFragment(vNodes, 8);
119
119
  /* const rows = vNodes; */
120
120
  // for performance, no normalize
121
121
 
122
-
123
122
  return createElementVNode(2, 'tr', rows, 2, cx(classNameObj), {
124
123
  'data-key': key,
125
124
  'ev-mouseenter': this.onMouseEnter,
@@ -34,6 +34,7 @@ export interface TableProps<T = any, K extends TableRowKey = TableRowKey, C exte
34
34
  minColWidth?: number;
35
35
  widthStoreKey?: string;
36
36
  draggable?: boolean;
37
+ animation?: boolean | [boolean, boolean];
37
38
  }
38
39
  export interface TableEvents<T = any, K extends TableRowKey = number> {
39
40
  clickRow: [T, number, K];
@@ -56,7 +56,8 @@ var typeDefs = {
56
56
  resizable: Boolean,
57
57
  minColWidth: Number,
58
58
  widthStoreKey: String,
59
- draggable: Boolean
59
+ draggable: Boolean,
60
+ animation: [Boolean, Array]
60
61
  };
61
62
 
62
63
  var defaults = function defaults() {
@@ -69,7 +70,8 @@ var defaults = function defaults() {
69
70
  rowExpandable: true,
70
71
  childrenKey: 'children',
71
72
  indent: 32,
72
- minColWidth: 40
73
+ minColWidth: 40,
74
+ animation: true
73
75
  };
74
76
  };
75
77
 
@@ -57,7 +57,10 @@ export default function ($props, $blocks, $__proto__) {
57
57
  tooltipContainer = _this$get.tooltipContainer,
58
58
  showIndeterminate = _this$get.showIndeterminate,
59
59
  resizable = _this$get.resizable,
60
- draggable = _this$get.draggable;
60
+ draggable = _this$get.draggable,
61
+ _animation = _this$get.animation;
62
+
63
+ var animation = !Array.isArray(_animation) ? [_animation, _animation] : _animation;
61
64
 
62
65
  var _this$columns$getData = this.columns.getData(),
63
66
  columns = _this$columns$getData.columns,
@@ -130,10 +133,8 @@ export default function ($props, $blocks, $__proto__) {
130
133
  'children': _$cc(FixedColumnsContext.Provider, {
131
134
  'value': offsetMap,
132
135
  'children': _$ce(2, 'thead', _$ma(columns, function ($value, $key) {
133
- return _$ce(2, 'tr', _$cc(TransitionGroup, {
134
- 'name': 'k-fade-expand',
135
- 'move': false,
136
- 'children': [$key === 0 && checkType !== 'none' ? _$cv('th', _extends({}, getClassAndStyleForFixed({
136
+ return _$ce(2, 'tr', function () {
137
+ var ths = [$key === 0 && checkType !== 'none' ? _$cv('th', _extends({}, getClassAndStyleForFixed({
137
138
  fixed: hasFixedLeft ? 'left' : false
138
139
  }, 0), {
139
140
  'rowspan': maxRows,
@@ -143,8 +144,13 @@ export default function ($props, $blocks, $__proto__) {
143
144
  'indeterminate': showIndeterminate && allCheckedStatus == AllCheckedStatus.Indeterminate,
144
145
  'ev-$change:value': toggleCheckedAll,
145
146
  'disabled': !hasData
146
- }) : undefined) : undefined, $value]
147
- }), 2);
147
+ }) : undefined) : undefined, $value];
148
+ return animation[1] ? _$cc(TransitionGroup, {
149
+ 'name': 'k-fade-expand',
150
+ 'move': false,
151
+ 'children': ths
152
+ }) : ths;
153
+ }(), 0);
148
154
  }, $this), 4)
149
155
  })
150
156
  })
@@ -181,115 +187,116 @@ export default function ($props, $blocks, $__proto__) {
181
187
  return block ? block.call($this, callBlock, data) : callBlock();
182
188
  }, __$blocks['empty'](_$no)), 0, 'k-table-empty', {
183
189
  'colspan': colCount
184
- }), 2, null, null, 'table-empty') : _$cc(TransitionGroup, {
185
- 'name': 'k-fade-in-left',
186
- 'move': !draggingKey.value,
187
- 'children': function () {
188
- var rows = [];
189
- loopData(function (value, index, level, hidden) {
190
- // don't render if row is hidden
191
- if (hidden) return hidden;
192
- var status = allStatus[index];
193
- var key = allKeys[index];
194
- var spreaded = isSpreaded(key);
195
- var hasChildren = !!childrenKey && Array.isArray(value[childrenKey]);
196
- var indentSize = indent ? indent * level : 0;
190
+ }), 2, null, null, 'table-empty') : function () {
191
+ var rows = [];
192
+ loopData(function (value, index, level, hidden) {
193
+ // don't render if row is hidden
194
+ if (hidden) return hidden;
195
+ var status = allStatus[index];
196
+ var key = allKeys[index];
197
+ var spreaded = isSpreaded(key);
198
+ var hasChildren = !!childrenKey && Array.isArray(value[childrenKey]);
199
+ var indentSize = indent ? indent * level : 0;
197
200
 
198
- var row = _$cc(TableRow, {
199
- 'key': key,
200
- 'cols': cols,
201
- 'data': value,
202
- 'checkType': checkType,
203
- 'hasFixedLeft': hasFixedLeft,
204
- 'onClick': _this.clickRow,
205
- 'checked': status.checked,
206
- 'indeterminate': status.indeterminate,
207
- 'index': index,
208
- 'disabled': status.disabled,
209
- 'allDisabled': status.allDisabled,
210
- 'className': _$cn(rowClassName && rowClassName(value, index, key)),
211
- 'merge': merge,
212
- 'grid': getGrid(),
213
- 'onChangeChecked': onChangeChecked,
214
- 'selected': isSelected(key),
215
- 'spreaded': spreaded,
216
- 'hasChildren': hasChildren,
217
- 'indent': indentSize,
218
- 'onToggleSpreadRow': toggleSpreadRow,
219
- 'onBeforeUnmount': _this.resetRowStatus.onRowBeforeUnmount,
220
- 'offsetMap': offsetMap,
221
- 'draggable': draggable,
222
- 'draggingKey': draggingKey.value,
223
- 'onRowDragStart': onRowDragStart,
224
- 'onRowDragEnd': onRowDragEnd,
225
- 'onRowDragOver': onRowDragOver
226
- }, key);
201
+ var row = _$cc(TableRow, {
202
+ 'key': key,
203
+ 'cols': cols,
204
+ 'data': value,
205
+ 'checkType': checkType,
206
+ 'hasFixedLeft': hasFixedLeft,
207
+ 'onClick': _this.clickRow,
208
+ 'checked': status.checked,
209
+ 'indeterminate': status.indeterminate,
210
+ 'index': index,
211
+ 'disabled': status.disabled,
212
+ 'allDisabled': status.allDisabled,
213
+ 'className': _$cn(rowClassName && rowClassName(value, index, key)),
214
+ 'merge': merge,
215
+ 'grid': getGrid(),
216
+ 'onChangeChecked': onChangeChecked,
217
+ 'selected': isSelected(key),
218
+ 'spreaded': spreaded,
219
+ 'hasChildren': hasChildren,
220
+ 'indent': indentSize,
221
+ 'onToggleSpreadRow': toggleSpreadRow,
222
+ 'onBeforeUnmount': _this.resetRowStatus.onRowBeforeUnmount,
223
+ 'offsetMap': offsetMap,
224
+ 'animation': animation[1],
225
+ 'draggable': draggable,
226
+ 'draggingKey': draggingKey.value,
227
+ 'onRowDragStart': onRowDragStart,
228
+ 'onRowDragEnd': onRowDragEnd,
229
+ 'onRowDragOver': onRowDragOver
230
+ }, key);
227
231
 
228
- if ($blocks.tooltip) {
229
- var content = (_$blocks['tooltip'] = function ($super) {
230
- return null;
231
- }, __$blocks['tooltip'] = function ($super, data) {
232
- var block = $blocks['tooltip'];
232
+ if ($blocks.tooltip) {
233
+ var content = (_$blocks['tooltip'] = function ($super) {
234
+ return null;
235
+ }, __$blocks['tooltip'] = function ($super, data) {
236
+ var block = $blocks['tooltip'];
233
237
 
234
- var callBlock = function callBlock() {
235
- return _$blocks['tooltip'].call($this, $super, data);
236
- };
238
+ var callBlock = function callBlock() {
239
+ return _$blocks['tooltip'].call($this, $super, data);
240
+ };
237
241
 
238
- return block ? block.call($this, callBlock, data) : callBlock();
239
- }, __$blocks['tooltip'](_$no, [value, index]));
240
- row = _$cc(Tooltip, {
241
- 'key': key,
242
- 'position': tooltipPosition,
243
- 'container': tooltipContainer,
244
- 'children': row,
245
- '$blocks': function ($blocks) {
246
- var _$blocks = {},
247
- __$blocks = _$ex({}, $blocks);
242
+ return block ? block.call($this, callBlock, data) : callBlock();
243
+ }, __$blocks['tooltip'](_$no, [value, index]));
244
+ row = _$cc(Tooltip, {
245
+ 'key': key,
246
+ 'position': tooltipPosition,
247
+ 'container': tooltipContainer,
248
+ 'children': row,
249
+ '$blocks': function ($blocks) {
250
+ var _$blocks = {},
251
+ __$blocks = _$ex({}, $blocks);
248
252
 
249
- return (_$blocks['content'] = function ($super) {
250
- return content;
251
- }, __$blocks['content'] = function ($super, data) {
252
- var block = $blocks['content'];
253
+ return (_$blocks['content'] = function ($super) {
254
+ return content;
255
+ }, __$blocks['content'] = function ($super, data) {
256
+ var block = $blocks['content'];
253
257
 
254
- var callBlock = function callBlock() {
255
- return _$blocks['content'].call($this, $super, data);
256
- };
258
+ var callBlock = function callBlock() {
259
+ return _$blocks['content'].call($this, $super, data);
260
+ };
257
261
 
258
- return block ? block.call($this, callBlock, data) : callBlock();
259
- }), __$blocks;
260
- }.call($this, _$em)
261
- }, key);
262
- }
262
+ return block ? block.call($this, callBlock, data) : callBlock();
263
+ }), __$blocks;
264
+ }.call($this, _$em)
265
+ }, key);
266
+ }
263
267
 
264
- rows.push(row);
268
+ rows.push(row);
265
269
 
266
- if ($blocks.expand) {
267
- var expanded = isExpanded(key);
268
- rows.push(_$ce(2, 'tr', _$ce(2, 'td', _$cc(Transition, _extends({}, expandAnimationCallbacks, {
269
- 'children': expanded ? _$ce(2, 'div', (_$blocks['expand'] = function ($super) {
270
- return null;
271
- }, __$blocks['expand'] = function ($super, data) {
272
- var block = $blocks['expand'];
270
+ if ($blocks.expand) {
271
+ var expanded = isExpanded(key);
272
+ rows.push(_$ce(2, 'tr', _$ce(2, 'td', _$cc(Transition, _extends({}, expandAnimationCallbacks, {
273
+ 'children': expanded ? _$ce(2, 'div', (_$blocks['expand'] = function ($super) {
274
+ return null;
275
+ }, __$blocks['expand'] = function ($super, data) {
276
+ var block = $blocks['expand'];
273
277
 
274
- var callBlock = function callBlock() {
275
- return _$blocks['expand'].call($this, $super, data);
276
- };
278
+ var callBlock = function callBlock() {
279
+ return _$blocks['expand'].call($this, $super, data);
280
+ };
277
281
 
278
- return block ? block.call($this, callBlock, data) : callBlock();
279
- }, __$blocks['expand'](_$no, [value, index])), 0, 'k-table-expand') : undefined
280
- })), 2, null, {
281
- 'colspan': colCount
282
- }), 2, _$cn({
283
- "k-expand": true,
284
- 'k-expanded': expanded
285
- }), null, key + ".$expand"));
286
- }
282
+ return block ? block.call($this, callBlock, data) : callBlock();
283
+ }, __$blocks['expand'](_$no, [value, index])), 0, 'k-table-expand') : undefined
284
+ })), 2, null, {
285
+ 'colspan': colCount
286
+ }), 2, _$cn({
287
+ "k-expand": true,
288
+ 'k-expanded': expanded
289
+ }), null, key + ".$expand"));
290
+ }
287
291
 
288
- return hidden || !spreaded;
289
- });
290
- return rows;
291
- }()
292
- }), 0);
292
+ return hidden || !spreaded;
293
+ });
294
+ return animation[0] ? _$cc(TransitionGroup, {
295
+ 'name': 'k-fade-in-left',
296
+ 'move': !draggingKey.value,
297
+ 'children': rows
298
+ }) : rows;
299
+ }(), 0);
293
300
 
294
301
  var tableWidthPx = tableWidth.value ? tableWidth.value + "px" : null;
295
302
  var _this$stickyScrollbar = this.stickyScrollbar,
@@ -8,6 +8,6 @@ export interface TooltipProps extends BaseTooltipProps {
8
8
  export interface TooltipBlocks extends BaseTooltipBlocks, TooltipContentBlocks {
9
9
  content: null;
10
10
  }
11
- declare class _Tooltip extends BaseTooltip<TooltipProps, TooltipEvents, TooltipBlocks> {
11
+ export declare class _Tooltip extends BaseTooltip<TooltipProps, TooltipEvents, TooltipBlocks> {
12
12
  }
13
13
  export declare const Tooltip: typeof _Tooltip;
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v2.0.13-beta.0
2
+ * @king-design v2.0.13
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -57,7 +57,7 @@ export * from './components/tree';
57
57
  export * from './components/treeSelect';
58
58
  export * from './components/upload';
59
59
  export * from './components/wave';
60
- export declare const version = "2.0.13-beta.0";
60
+ export declare const version = "2.0.13";
61
61
 
62
62
 
63
63
  export {normalize} from 'intact-vue-next';
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @king-design v2.0.13-beta.0
2
+ * @king-design v2.0.13
3
3
  *
4
4
  * Copyright (c) Kingsoft Cloud
5
5
  * Released under the MIT License
@@ -59,7 +59,7 @@ export * from './components/tree';
59
59
  export * from './components/treeSelect';
60
60
  export * from './components/upload';
61
61
  export * from './components/wave';
62
- export var version = '2.0.13-beta.0';
62
+ export var version = '2.0.13';
63
63
  /* generate end */
64
64
 
65
65
  export {normalize} from 'intact-vue-next';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@king-design/vue",
3
- "version": "2.0.13-beta.0",
3
+ "version": "2.0.13",
4
4
  "description": "King-Design UI components for Vue3.0.",
5
5
  "keywords": [
6
6
  "component",