@opentiny/vue-renderless 3.1.0-alpha.0 → 3.5.0-alpha.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/action-menu/index.js +10 -0
- package/action-menu/vue.js +26 -0
- package/amount/index.js +334 -0
- package/amount/vue.js +206 -0
- package/area/index.js +162 -0
- package/area/vue.js +68 -0
- package/autonavi-map/index.js +28 -0
- package/avatar/index.js +5 -1
- package/avatar/vue.js +2 -1
- package/baidu-map/index.js +28 -0
- package/breadcrumb/index.js +9 -0
- package/breadcrumb/vue.js +25 -3
- package/breadcrumb-item/index.js +26 -0
- package/breadcrumb-item/vue.js +20 -11
- package/bulletin-board/index.js +4 -1
- package/button-group/vue.js +1 -1
- package/calendar/index.js +14 -14
- package/card-template/index.js +1 -1
- package/cascader/index.js +21 -7
- package/cascader/vue.js +1 -2
- package/cascader-node/index.js +3 -1
- package/cascader-panel/index.js +12 -4
- package/cascader-panel/vue.js +1 -2
- package/chart-bar/index.js +533 -0
- package/chart-boxplot/index.js +270 -0
- package/chart-candle/index.js +428 -0
- package/chart-core/deps/constants.js +65 -0
- package/chart-core/deps/numerify.js +286 -0
- package/chart-core/deps/utils.js +205 -0
- package/chart-core/index.js +541 -0
- package/chart-core/modules/animation.js +10 -0
- package/chart-core/modules/extend.js +36 -0
- package/chart-core/modules/mark.js +7 -0
- package/chart-core/vue.js +128 -0
- package/chart-funnel/index.js +155 -0
- package/chart-gauge/index.js +153 -0
- package/chart-graph/index.js +38 -0
- package/chart-heatmap/index.js +407 -0
- package/chart-line/index.js +358 -0
- package/chart-liquidfill/index.js +119 -0
- package/chart-map/index.js +261 -0
- package/chart-pie/index.js +327 -0
- package/chart-radar/index.js +181 -0
- package/chart-sankey/index.js +166 -0
- package/chart-scatter/index.js +360 -0
- package/chart-sunburst/index.js +36 -0
- package/chart-tree/index.js +107 -0
- package/chart-waterfall/index.js +231 -0
- package/chart-wordcloud/index.js +109 -0
- package/checkbox/index.js +4 -4
- package/checkbox-button/index.js +3 -1
- package/common/bigInt.js +5 -2
- package/common/date.js +17 -17
- package/common/deps/date-util.js +15 -5
- package/common/deps/date.js +6 -6
- package/common/deps/dom.js +18 -6
- package/common/deps/eSpaceCtrl.js +286 -0
- package/common/deps/fullscreen/apis.js +22 -22
- package/common/deps/memorize.js +3 -3
- package/common/deps/modal-queue.js +2 -0
- package/common/deps/popper.js +12 -10
- package/common/deps/popup-manager.js +16 -5
- package/common/deps/resize-event.js +6 -2
- package/common/deps/scrollbar-width.js +6 -2
- package/common/deps/tree-model/node.js +30 -10
- package/common/deps/tree-model/tree-store.js +33 -21
- package/common/deps/tree-model/util.js +6 -2
- package/common/deps/upload-ajax.js +7 -1
- package/common/deps/vue-popper.js +2 -2
- package/common/string.js +1 -1
- package/company/index.js +56 -0
- package/company/vue.js +35 -0
- package/country/index.js +54 -0
- package/country/vue.js +35 -0
- package/credit-card-form/index.js +1 -0
- package/currency/index.js +78 -0
- package/currency/vue.js +39 -0
- package/date-panel/index.js +16 -6
- package/date-picker/index.js +9 -5
- package/date-range/index.js +28 -9
- package/date-table/index.js +3 -1
- package/dept/index.js +318 -0
- package/dept/vue.js +163 -0
- package/detail-page/index.js +4 -1
- package/dialog-box/index.js +14 -4
- package/dialog-box/vue.js +7 -3
- package/drop-roles/index.js +73 -0
- package/drop-roles/vue.js +38 -0
- package/dropdown/index.js +5 -4
- package/dropdown/vue.js +5 -3
- package/dropdown-item/index.js +15 -0
- package/dropdown-item/vue.js +27 -13
- package/espace/index.js +129 -0
- package/espace/vue.js +52 -0
- package/exception/index.js +1 -1
- package/file-upload/index.js +336 -291
- package/form/index.js +3 -1
- package/form/vue.js +15 -0
- package/form-item/index.js +15 -5
- package/fullscreen/index.js +4 -4
- package/fullscreen/vue.js +3 -3
- package/grid/core/interceptor.js +4 -7
- package/grid/plugins/export.js +2 -2
- package/grid/plugins/exportExcel.js +28 -10
- package/grid/static/array/findTree.js +1 -1
- package/grid/static/base/helperCreateGetObjects.js +1 -1
- package/grid/static/base/helperEqualCompare.js +2 -2
- package/grid/static/base/helperGetHGSKeys.js +1 -1
- package/grid/static/base/uniqueId.js +1 -1
- package/grid/static/object/assign.js +3 -3
- package/grid/static/string/toString.js +3 -3
- package/hrapprover/index.js +118 -0
- package/hrapprover/vue.js +102 -0
- package/locales/index.js +116 -0
- package/locales/vue.js +46 -0
- package/logon-user/index.js +23 -0
- package/logon-user/vue.js +22 -0
- package/logout/index.js +118 -0
- package/logout/vue.js +22 -0
- package/milestone/index.js +2 -1
- package/mini-picker/index.js +1 -1
- package/mini-picker/vue.js +1 -1
- package/modal/index.js +4 -2
- package/month-table/index.js +2 -2
- package/nav-menu/index.js +2 -2
- package/numeric/index.js +5 -2
- package/package.json +33 -136
- package/pager-item/vue.js +6 -2
- package/picker/index.js +43 -17
- package/picker/timezone.js +2 -2
- package/picker-column/index.js +7 -3
- package/pop-upload/index.js +5 -3
- package/popeditor/index.js +15 -7
- package/popover/index.js +87 -54
- package/popover/vue.js +13 -9
- package/rate/index.js +2 -2
- package/rich-text/clipboard.js +77 -0
- package/rich-text/index.js +176 -0
- package/rich-text/module/file-upload.js +118 -0
- package/rich-text/module/image-drop.js +54 -0
- package/rich-text/module/image-upload.js +84 -0
- package/rich-text/options.js +187 -0
- package/rich-text/table-module.js +557 -0
- package/rich-text/vue.js +149 -0
- package/roles/index.js +87 -0
- package/roles/vue.js +39 -0
- package/search/index.js +32 -27
- package/search/vue.js +7 -2
- package/select/index.js +328 -304
- package/select/vue.js +19 -9
- package/select-dropdown/index.js +1 -1
- package/slider/index.js +9 -11
- package/slider/vue.js +3 -3
- package/split/vue.js +1 -1
- package/tab-nav/index.js +0 -6
- package/tab-nav/vue.js +0 -14
- package/table/index.js +1 -1
- package/text-popup/index.js +6 -4
- package/time/index.js +3 -1
- package/time-range/index.js +6 -2
- package/time-spinner/index.js +15 -5
- package/toggle-menu/index.js +11 -0
- package/toggle-menu/vue.js +2 -1
- package/tooltip/index.js +46 -35
- package/tooltip/vue.js +5 -1
- package/tree/index.js +57 -21
- package/tree-menu/index.js +3 -1
- package/tree-node/index.js +7 -3
- package/upload/index.js +14 -5
- package/user/index.js +634 -0
- package/user/vue.js +113 -0
- package/user-account/index.js +23 -0
- package/user-account/vue.js +25 -0
- package/user-contact/index.js +1 -4
- package/user-head/index.js +33 -11
- package/user-head/vue.js +10 -7
- package/user-link/index.js +43 -0
- package/user-link/vue.js +60 -0
package/tree/index.js
CHANGED
|
@@ -79,8 +79,10 @@ export var dragStart = function dragStart(_ref4) {
|
|
|
79
79
|
event.preventDefault();
|
|
80
80
|
return false;
|
|
81
81
|
}
|
|
82
|
-
if (!event.dataTransfer)
|
|
83
|
-
|
|
82
|
+
if (!event.dataTransfer) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
event.dataTransfer.effectAllowed = 'copy';
|
|
84
86
|
try {
|
|
85
87
|
event.dataTransfer.setData('text/plain', '');
|
|
86
88
|
} catch (e) {}
|
|
@@ -136,7 +138,7 @@ var getDragDir = function getDragDir(_ref5) {
|
|
|
136
138
|
userAllowDropInner = dropInner = allowDrop(draggingNode.node, dropNode.node, 'inner');
|
|
137
139
|
dropNext = allowDrop(draggingNode.node, dropNode.node, 'next');
|
|
138
140
|
}
|
|
139
|
-
event.dataTransfer.dropEffect = dropInner ? '
|
|
141
|
+
event.dataTransfer.dropEffect = dropInner ? 'copy' : 'none';
|
|
140
142
|
if ((dropPrev || dropInner || dropNext) && oldDropNode !== dropNode) {
|
|
141
143
|
oldDropNode && emit('node-drag-leave', draggingNode.node, oldDropNode.node, event);
|
|
142
144
|
emit('node-drag-enter', draggingNode.node, dropNode.node, event);
|
|
@@ -178,7 +180,9 @@ export var dragOver = function dragOver(_ref6) {
|
|
|
178
180
|
removeClass(oldDropNode.$el, 'is-drop-inner');
|
|
179
181
|
}
|
|
180
182
|
var draggingNode = dragState.draggingNode;
|
|
181
|
-
if (!draggingNode || !dropNode)
|
|
183
|
+
if (!draggingNode || !dropNode) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
182
186
|
var _getDragDir = getDragDir({
|
|
183
187
|
draggingNode: draggingNode,
|
|
184
188
|
dropNode: dropNode,
|
|
@@ -210,7 +214,7 @@ export var dragEnd = function dragEnd(_ref7) {
|
|
|
210
214
|
if (!event.dataTransfer) {
|
|
211
215
|
return;
|
|
212
216
|
}
|
|
213
|
-
event.dataTransfer.dropEffect = '
|
|
217
|
+
event.dataTransfer.dropEffect = 'copy';
|
|
214
218
|
if (draggingNode && dropNode) {
|
|
215
219
|
var draggingNodeCopy = {
|
|
216
220
|
data: draggingNode.node.data
|
|
@@ -287,7 +291,9 @@ var doClearCurrentStore = function doClearCurrentStore(state) {
|
|
|
287
291
|
};
|
|
288
292
|
var setIsCurrent = function setIsCurrent(root, defaultExpandedKeys, defaultExpandedKeysHighlight, currentStore) {
|
|
289
293
|
var nodeKey = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'id';
|
|
290
|
-
if (currentStore.flag || !Array.isArray(root.childNodes))
|
|
294
|
+
if (currentStore.flag || !Array.isArray(root.childNodes)) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
291
297
|
for (var i = 0; i < root.childNodes.length; i++) {
|
|
292
298
|
var child = root.childNodes[i];
|
|
293
299
|
if (child.data && child.data[nodeKey] && child.data[nodeKey] === defaultExpandedKeysHighlight) {
|
|
@@ -363,7 +369,9 @@ export var filter = function filter(_ref14) {
|
|
|
363
369
|
var props = _ref14.props,
|
|
364
370
|
state = _ref14.state;
|
|
365
371
|
return function (value) {
|
|
366
|
-
if (!props.filterNodeMethod)
|
|
372
|
+
if (!props.filterNodeMethod) {
|
|
373
|
+
throw new Error('[Tree] filterNodeMethod is required when filter');
|
|
374
|
+
}
|
|
367
375
|
state.store.filter(value);
|
|
368
376
|
};
|
|
369
377
|
};
|
|
@@ -376,9 +384,13 @@ export var getNodePath = function getNodePath(_ref15) {
|
|
|
376
384
|
var props = _ref15.props,
|
|
377
385
|
state = _ref15.state;
|
|
378
386
|
return function (data) {
|
|
379
|
-
if (!props.nodeKey)
|
|
387
|
+
if (!props.nodeKey) {
|
|
388
|
+
throw new Error('[Tree] nodeKey is required in getNodePath');
|
|
389
|
+
}
|
|
380
390
|
var node = state.store.getNode(data);
|
|
381
|
-
if (!node)
|
|
391
|
+
if (!node) {
|
|
392
|
+
return [];
|
|
393
|
+
}
|
|
382
394
|
var path = [node.data];
|
|
383
395
|
var parent = node.parent;
|
|
384
396
|
while (parent && parent !== state.root) {
|
|
@@ -408,7 +420,9 @@ export var getCurrentKey = function getCurrentKey(_ref16) {
|
|
|
408
420
|
var api = _ref16.api,
|
|
409
421
|
props = _ref16.props;
|
|
410
422
|
return function () {
|
|
411
|
-
if (!props.nodeKey)
|
|
423
|
+
if (!props.nodeKey) {
|
|
424
|
+
throw new Error('[Tree] nodeKey is required in getCurrentKey');
|
|
425
|
+
}
|
|
412
426
|
var currentNode = api.getCurrentNode();
|
|
413
427
|
return currentNode ? currentNode[props.nodeKey] : null;
|
|
414
428
|
};
|
|
@@ -417,7 +431,9 @@ export var setCheckedNodes = function setCheckedNodes(_ref17) {
|
|
|
417
431
|
var props = _ref17.props,
|
|
418
432
|
state = _ref17.state;
|
|
419
433
|
return function (nodes, leafOnly) {
|
|
420
|
-
if (!props.nodeKey)
|
|
434
|
+
if (!props.nodeKey) {
|
|
435
|
+
throw new Error('[Tree] nodeKey is required in setCheckedNodes');
|
|
436
|
+
}
|
|
421
437
|
state.store.setCheckedNodes(nodes, leafOnly);
|
|
422
438
|
};
|
|
423
439
|
};
|
|
@@ -425,7 +441,9 @@ export var setCheckedKeys = function setCheckedKeys(_ref18) {
|
|
|
425
441
|
var props = _ref18.props,
|
|
426
442
|
state = _ref18.state;
|
|
427
443
|
return function (keys, leafOnly) {
|
|
428
|
-
if (!props.nodeKey)
|
|
444
|
+
if (!props.nodeKey) {
|
|
445
|
+
throw new Error('[Tree] nodeKey is required in setCheckedKeys');
|
|
446
|
+
}
|
|
429
447
|
state.store.setCheckedKeys(keys, leafOnly);
|
|
430
448
|
};
|
|
431
449
|
};
|
|
@@ -448,7 +466,9 @@ export var setCurrentNode = function setCurrentNode(_ref19) {
|
|
|
448
466
|
var props = _ref19.props,
|
|
449
467
|
state = _ref19.state;
|
|
450
468
|
return function (node) {
|
|
451
|
-
if (!props.nodeKey)
|
|
469
|
+
if (!props.nodeKey) {
|
|
470
|
+
throw new Error('[Tree] nodeKey is required in setCurrentNode');
|
|
471
|
+
}
|
|
452
472
|
state.store.setUserCurrentNode(node);
|
|
453
473
|
};
|
|
454
474
|
};
|
|
@@ -456,7 +476,9 @@ export var setCurrentKey = function setCurrentKey(_ref20) {
|
|
|
456
476
|
var props = _ref20.props,
|
|
457
477
|
state = _ref20.state;
|
|
458
478
|
return function (key) {
|
|
459
|
-
if (!props.nodeKey)
|
|
479
|
+
if (!props.nodeKey) {
|
|
480
|
+
throw new Error('[Tree] nodeKey is required in setCurrentKey');
|
|
481
|
+
}
|
|
460
482
|
state.store.setCurrentNodeKey(key);
|
|
461
483
|
};
|
|
462
484
|
};
|
|
@@ -494,7 +516,9 @@ export var updateKeyChildren = function updateKeyChildren(_ref21) {
|
|
|
494
516
|
var props = _ref21.props,
|
|
495
517
|
state = _ref21.state;
|
|
496
518
|
return function (key, data) {
|
|
497
|
-
if (!props.nodeKey)
|
|
519
|
+
if (!props.nodeKey) {
|
|
520
|
+
throw new Error('[Tree] nodeKey is required in updateKeyChild');
|
|
521
|
+
}
|
|
498
522
|
state.store.updateChildren(key, data);
|
|
499
523
|
};
|
|
500
524
|
};
|
|
@@ -517,7 +541,9 @@ export var handleKeydown = function handleKeydown(_ref23) {
|
|
|
517
541
|
state = _ref23.state;
|
|
518
542
|
return function (event) {
|
|
519
543
|
var currentItem = event.target;
|
|
520
|
-
if (currentItem.className.indexOf('tiny-tree-node') === -1)
|
|
544
|
+
if (currentItem.className.indexOf('tiny-tree-node') === -1) {
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
521
547
|
var keyCode = event.keyCode;
|
|
522
548
|
state.treeItems = vm.$el.querySelectorAll('.is-focusable[role=treeitem]');
|
|
523
549
|
if ([KEY_CODE.ArrowUp, KEY_CODE.ArrowDown].indexOf(keyCode) > -1) {
|
|
@@ -562,7 +588,9 @@ var initRadio = function initRadio(_ref24) {
|
|
|
562
588
|
checkedKey: checkedKey,
|
|
563
589
|
state: state
|
|
564
590
|
});
|
|
565
|
-
if (isFound)
|
|
591
|
+
if (isFound) {
|
|
592
|
+
break;
|
|
593
|
+
}
|
|
566
594
|
}
|
|
567
595
|
}
|
|
568
596
|
return isFound;
|
|
@@ -581,7 +609,9 @@ var init = function init(_ref25) {
|
|
|
581
609
|
checkedKey: checkedKey,
|
|
582
610
|
state: state
|
|
583
611
|
});
|
|
584
|
-
if (isFound)
|
|
612
|
+
if (isFound) {
|
|
613
|
+
break;
|
|
614
|
+
}
|
|
585
615
|
}
|
|
586
616
|
}
|
|
587
617
|
};
|
|
@@ -589,12 +619,18 @@ export var setCurrentRadio = function setCurrentRadio(_ref26) {
|
|
|
589
619
|
var props = _ref26.props,
|
|
590
620
|
state = _ref26.state;
|
|
591
621
|
return function () {
|
|
592
|
-
if (!props.showRadio)
|
|
593
|
-
|
|
622
|
+
if (!props.showRadio) {
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
if (!props.nodeKey) {
|
|
626
|
+
throw new Error('[Tree] nodeKey is required in setCurrentRadio');
|
|
627
|
+
}
|
|
594
628
|
var nodeKey = props.nodeKey;
|
|
595
629
|
var defaultCheckedKeys = props.defaultCheckedKeys || [];
|
|
596
630
|
var checkedKey = defaultCheckedKeys.length ? defaultCheckedKeys[0] : null;
|
|
597
|
-
if (!checkedKey)
|
|
631
|
+
if (!checkedKey) {
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
598
634
|
init({
|
|
599
635
|
state: state,
|
|
600
636
|
nodeKey: nodeKey,
|
package/tree-menu/index.js
CHANGED
|
@@ -53,7 +53,9 @@ export var setMenuKey = function setMenuKey(api) {
|
|
|
53
53
|
};
|
|
54
54
|
export var filterNode = function filterNode() {
|
|
55
55
|
return function (value, data) {
|
|
56
|
-
if (!value)
|
|
56
|
+
if (!value) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
57
59
|
return data.label.indexOf(value) !== -1;
|
|
58
60
|
};
|
|
59
61
|
};
|
package/tree-node/index.js
CHANGED
|
@@ -206,7 +206,9 @@ export var handleDragStart = function handleDragStart(_ref11) {
|
|
|
206
206
|
var state = _ref11.state,
|
|
207
207
|
vm = _ref11.vm;
|
|
208
208
|
return function (event) {
|
|
209
|
-
if (!state.tree.draggable)
|
|
209
|
+
if (!state.tree.draggable) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
210
212
|
state.tree.state.emitter.emit('tree-node-drag-start', event, vm);
|
|
211
213
|
};
|
|
212
214
|
};
|
|
@@ -214,7 +216,9 @@ export var handleDragOver = function handleDragOver(_ref12) {
|
|
|
214
216
|
var state = _ref12.state,
|
|
215
217
|
vm = _ref12.vm;
|
|
216
218
|
return function (event) {
|
|
217
|
-
if (!state.tree.draggable)
|
|
219
|
+
if (!state.tree.draggable) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
218
222
|
state.tree.state.emitter.emit('tree-node-drag-over', event, vm);
|
|
219
223
|
event.preventDefault();
|
|
220
224
|
};
|
|
@@ -240,7 +244,7 @@ export var created = function created(_ref14) {
|
|
|
240
244
|
return function (fn) {
|
|
241
245
|
var tree = state.tree;
|
|
242
246
|
var property = tree.props || {};
|
|
243
|
-
var childrenKey = property
|
|
247
|
+
var childrenKey = property.children || 'children';
|
|
244
248
|
fn(childrenKey);
|
|
245
249
|
if (props.node.expanded) {
|
|
246
250
|
state.expanded = true;
|
package/upload/index.js
CHANGED
|
@@ -46,16 +46,25 @@ export var getFormData = function getFormData(_ref) {
|
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
export var uploadFiles = function uploadFiles(_ref3) {
|
|
49
|
-
var
|
|
50
|
-
state = _ref3.state,
|
|
49
|
+
var state = _ref3.state,
|
|
51
50
|
constants = _ref3.constants,
|
|
52
51
|
Modal = _ref3.Modal,
|
|
53
52
|
props = _ref3.props,
|
|
54
53
|
t = _ref3.t;
|
|
55
54
|
return function (files) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
var limit = props.limit,
|
|
56
|
+
fileList = props.fileList;
|
|
57
|
+
if (limit) {
|
|
58
|
+
var fileCount = fileList.length + files.length;
|
|
59
|
+
if (fileCount > limit) {
|
|
60
|
+
props.onExceed && props.onExceed(files, fileList);
|
|
61
|
+
return;
|
|
62
|
+
} else if (fileCount === limit) {
|
|
63
|
+
Modal.message({
|
|
64
|
+
message: "".concat(t('ui.upload.limitUploadFileNumber'), "\uFF1A").concat(limit),
|
|
65
|
+
status: 'info'
|
|
66
|
+
});
|
|
67
|
+
}
|
|
59
68
|
}
|
|
60
69
|
var postFiles = Array.prototype.slice.call(files);
|
|
61
70
|
if (props.isFolder) {
|