@king-design/vue 2.0.12 → 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.
- package/__tests__/__snapshots__/Vue Next Demos.md +60 -60
- package/__tests__/components/dropdown.spec.ts +32 -9
- package/components/code/index.d.ts +2 -2
- package/components/code/useEditor.js +1 -1
- package/components/drawer/index.spec.js +48 -0
- package/components/dropdown/dropdown.d.ts +2 -1
- package/components/dropdown/dropdown.js +31 -14
- package/components/dropdown/index.spec.js +58 -0
- package/components/portal.js +9 -2
- package/components/select/styles.js +2 -2
- package/components/table/row.d.ts +1 -0
- package/components/table/row.vdt.js +5 -6
- package/components/table/table.d.ts +1 -0
- package/components/table/table.js +4 -2
- package/components/table/table.vdt.js +111 -104
- package/components/timepicker/index.d.ts +1 -0
- package/components/timepicker/index.js +1 -0
- package/components/tooltip/index.d.ts +1 -1
- package/hooks/useDocumentClick.js +29 -2
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
|
@@ -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',
|
|
134
|
-
'
|
|
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
|
-
|
|
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') :
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
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
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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
|
-
|
|
235
|
-
|
|
236
|
-
|
|
238
|
+
var callBlock = function callBlock() {
|
|
239
|
+
return _$blocks['tooltip'].call($this, $super, data);
|
|
240
|
+
};
|
|
237
241
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
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
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
+
return (_$blocks['content'] = function ($super) {
|
|
254
|
+
return content;
|
|
255
|
+
}, __$blocks['content'] = function ($super, data) {
|
|
256
|
+
var block = $blocks['content'];
|
|
253
257
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
258
|
+
var callBlock = function callBlock() {
|
|
259
|
+
return _$blocks['content'].call($this, $super, data);
|
|
260
|
+
};
|
|
257
261
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
262
|
+
return block ? block.call($this, callBlock, data) : callBlock();
|
|
263
|
+
}), __$blocks;
|
|
264
|
+
}.call($this, _$em)
|
|
265
|
+
}, key);
|
|
266
|
+
}
|
|
263
267
|
|
|
264
|
-
|
|
268
|
+
rows.push(row);
|
|
265
269
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
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
|
-
|
|
275
|
-
|
|
276
|
-
|
|
278
|
+
var callBlock = function callBlock() {
|
|
279
|
+
return _$blocks['expand'].call($this, $super, data);
|
|
280
|
+
};
|
|
277
281
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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,
|
|
@@ -3,6 +3,7 @@ import { TimepickerProps, TimepickerEvents, TimepickerBlocks } from './constants
|
|
|
3
3
|
import { SelectPicker } from './selectPicker';
|
|
4
4
|
export type { TimepickerProps, TimepickerEvents, TimepickerBlocks };
|
|
5
5
|
export declare class Timepicker<Multipe extends boolean = false, Range extends boolean = false> extends Component<TimepickerProps<Multipe, Range>, TimepickerEvents, TimepickerBlocks<Range>> {
|
|
6
|
+
static $doubleVNodes: boolean;
|
|
6
7
|
static template(this: Timepicker): import("intact").VNode<typeof SelectPicker>;
|
|
7
8
|
static typeDefs: Required<import("intact").TypeDefs<TimepickerProps<boolean, boolean>>>;
|
|
8
9
|
}
|
|
@@ -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;
|
|
@@ -1,12 +1,38 @@
|
|
|
1
1
|
import { onMounted, onUnmounted } from 'intact-vue-next';
|
|
2
|
-
import { isFunction } from 'intact-shared';
|
|
2
|
+
import { isFunction } from 'intact-shared'; // @reference: Vue3.0
|
|
3
|
+
|
|
4
|
+
var getNow = Date.now; // Determine what event timestamp the browser is using. Annoyingly, the
|
|
5
|
+
// timestamp can either be hi-res (relative to page load) or low-res
|
|
6
|
+
// (relative to UNIX epoch), so in order to compare time we have to use the
|
|
7
|
+
// same timestamp type when saving the flush timestamp.
|
|
8
|
+
|
|
9
|
+
if (getNow() > document.createEvent('Event').timeStamp) {
|
|
10
|
+
// if the low-res timestamp which is bigger than the event timestamp
|
|
11
|
+
// (which is evaluated AFTER) it means the event is using a hi-res timestamp,
|
|
12
|
+
// and we need to use the hi-res version for event listeners as well.
|
|
13
|
+
getNow = function getNow() {
|
|
14
|
+
return performance.now();
|
|
15
|
+
};
|
|
16
|
+
} // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
|
|
17
|
+
// and does not fire microtasks in between event propagation, so safe to exclude.
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
var ffMatch = navigator.userAgent.match(/firefox\/(\d+)/i);
|
|
21
|
+
var skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);
|
|
3
22
|
export function useDocumentClick(ref, callback, manual) {
|
|
4
23
|
if (manual === void 0) {
|
|
5
24
|
manual = false;
|
|
6
25
|
}
|
|
7
26
|
|
|
8
27
|
var onDocumentClick = function onDocumentClick(e) {
|
|
9
|
-
if (e._ignore) return;
|
|
28
|
+
if (e._ignore) return; // https://github.com/ksc-fe/kpc/issues/788
|
|
29
|
+
|
|
30
|
+
var timeStamp = e.timeStamp || getNow();
|
|
31
|
+
|
|
32
|
+
if (!skipTimestampCheck && onDocumentClick.timeStamp > timeStamp + 1) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
10
36
|
var target = e.target;
|
|
11
37
|
var elem = isFunction(ref) ? ref() : ref.value;
|
|
12
38
|
if (containsOrEqual(elem, target)) return;
|
|
@@ -14,6 +40,7 @@ export function useDocumentClick(ref, callback, manual) {
|
|
|
14
40
|
};
|
|
15
41
|
|
|
16
42
|
var add = function add() {
|
|
43
|
+
onDocumentClick.timeStamp = getNow();
|
|
17
44
|
document.addEventListener('click', onDocumentClick);
|
|
18
45
|
document.addEventListener('contextmenu', onDocumentClick);
|
|
19
46
|
};
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* @king-design v2.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.
|
|
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.
|
|
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.
|
|
62
|
+
export var version = '2.0.13';
|
|
63
63
|
/* generate end */
|
|
64
64
|
|
|
65
65
|
export {normalize} from 'intact-vue-next';
|