@opentiny/vue-renderless 3.1.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-sheet/index.js +28 -0
- package/action-sheet/vue.js +29 -0
- package/alert/index.js +23 -0
- package/alert/vue.js +37 -0
- package/autocomplete/index.js +175 -0
- package/autocomplete/vue.js +171 -0
- package/avatar/index.js +29 -0
- package/avatar/vue.js +24 -0
- package/badge/index.js +16 -0
- package/badge/vue.js +30 -0
- package/breadcrumb/vue.js +4 -0
- package/breadcrumb-item/vue.js +24 -0
- package/bulletin-board/index.js +21 -0
- package/bulletin-board/vue.js +36 -0
- package/button/index.js +19 -0
- package/button/vue.js +43 -0
- package/button-group/index.js +25 -0
- package/button-group/vue.js +51 -0
- package/calendar/index.js +279 -0
- package/calendar/vue.js +124 -0
- package/card-template/index.js +39 -0
- package/card-template/vue.js +34 -0
- package/carousel/index.js +206 -0
- package/carousel/vue.js +222 -0
- package/carousel-item/index.js +93 -0
- package/carousel-item/vue.js +57 -0
- package/cascader/index.js +511 -0
- package/cascader/vue.js +342 -0
- package/cascader-menu/index.js +41 -0
- package/cascader-menu/vue.js +36 -0
- package/cascader-node/index.js +63 -0
- package/cascader-node/vue.js +62 -0
- package/cascader-panel/index.js +359 -0
- package/cascader-panel/node.js +199 -0
- package/cascader-panel/store.js +80 -0
- package/cascader-panel/vue.js +217 -0
- package/checkbox/index.js +145 -0
- package/checkbox/vue.js +139 -0
- package/checkbox-button/index.js +102 -0
- package/checkbox-button/vue.js +150 -0
- package/checkbox-group/index.js +12 -0
- package/checkbox-group/vue.js +33 -0
- package/col/index.js +132 -0
- package/col/vue.js +34 -0
- package/collapse/index.js +45 -0
- package/collapse/vue.js +35 -0
- package/collapse-item/index.js +38 -0
- package/collapse-item/vue.js +48 -0
- package/common/array.js +120 -0
- package/common/bigInt.js +352 -0
- package/common/browser.js +69 -0
- package/common/dataset/index.js +135 -0
- package/common/date.js +352 -0
- package/common/decimal.js +203 -0
- package/common/deps/ResizeObserver.js +474 -0
- package/common/deps/after-leave.js +25 -0
- package/common/deps/clickoutside.js +61 -0
- package/common/deps/date-util.js +262 -0
- package/common/deps/date.js +308 -0
- package/common/deps/debounce.js +4 -0
- package/common/deps/dom.js +190 -0
- package/common/deps/fullscreen/apis.js +157 -0
- package/common/deps/fullscreen/screenfull.js +106 -0
- package/common/deps/letter-only.js +15 -0
- package/common/deps/memorize.js +149 -0
- package/common/deps/number-only.js +16 -0
- package/common/deps/popper.js +713 -0
- package/common/deps/popup-manager.js +179 -0
- package/common/deps/repeat-click.js +24 -0
- package/common/deps/requestAnimationFrame.js +25 -0
- package/common/deps/resize-event.js +29 -0
- package/common/deps/scroll-into-view.js +29 -0
- package/common/deps/scrollbar-width.js +25 -0
- package/common/deps/throttle.js +34 -0
- package/common/deps/touch.js +33 -0
- package/common/deps/tree-model/node.js +586 -0
- package/common/deps/tree-model/tree-store.js +377 -0
- package/common/deps/tree-model/util.js +14 -0
- package/common/deps/upload-ajax.js +71 -0
- package/common/deps/vue-emitter.js +30 -0
- package/common/deps/vue-popper.js +291 -0
- package/common/deps/vue-popup.js +211 -0
- package/common/event.js +17 -0
- package/common/index.js +288 -0
- package/common/object.js +228 -0
- package/common/runtime.js +52 -0
- package/common/string.js +446 -0
- package/common/type.js +65 -0
- package/common/validate/index.js +6 -0
- package/common/validate/messages.js +68 -0
- package/common/validate/rules/enum.js +8 -0
- package/common/validate/rules/index.js +14 -0
- package/common/validate/rules/pattern.js +16 -0
- package/common/validate/rules/range.js +62 -0
- package/common/validate/rules/required.js +13 -0
- package/common/validate/rules/type.js +110 -0
- package/common/validate/rules/whitespace.js +6 -0
- package/common/validate/schema.js +323 -0
- package/common/validate/util.js +198 -0
- package/common/validate/validations/array.js +25 -0
- package/common/validate/validations/date.js +35 -0
- package/common/validate/validations/enum.js +24 -0
- package/common/validate/validations/float.js +24 -0
- package/common/validate/validations/index.js +42 -0
- package/common/validate/validations/integer.js +24 -0
- package/common/validate/validations/method.js +23 -0
- package/common/validate/validations/number.js +27 -0
- package/common/validate/validations/pattern.js +23 -0
- package/common/validate/validations/required.js +15 -0
- package/common/validate/validations/string.js +29 -0
- package/common/validate/validations/type.js +25 -0
- package/common/xss.js +325 -0
- package/container/index.js +110 -0
- package/container/vue.js +63 -0
- package/credit-card/index.js +107 -0
- package/credit-card/vue.js +117 -0
- package/credit-card-form/index.js +143 -0
- package/credit-card-form/vue.js +150 -0
- package/crop/index.js +297 -0
- package/crop/vue.js +191 -0
- package/date-panel/index.js +584 -0
- package/date-panel/vue.js +319 -0
- package/date-picker/index.js +301 -0
- package/date-picker/vue.js +169 -0
- package/date-range/index.js +463 -0
- package/date-range/vue.js +297 -0
- package/date-table/index.js +457 -0
- package/date-table/vue.js +151 -0
- package/detail-page/index.js +135 -0
- package/detail-page/vue.js +145 -0
- package/dialog-box/index.js +268 -0
- package/dialog-box/vue.js +226 -0
- package/drop-times/index.js +23 -0
- package/drop-times/vue.js +28 -0
- package/dropdown/index.js +259 -0
- package/dropdown/vue.js +107 -0
- package/dropdown-item/index.js +155 -0
- package/dropdown-item/vue.js +124 -0
- package/dropdown-menu/index.js +148 -0
- package/dropdown-menu/vue.js +44 -0
- package/exception/index.js +13 -0
- package/exception/vue.js +25 -0
- package/fall-menu/index.js +121 -0
- package/fall-menu/vue.js +90 -0
- package/file-upload/index.js +1940 -0
- package/file-upload/vue.js +458 -0
- package/floatbar/index.js +10 -0
- package/floatbar/vue.js +17 -0
- package/form/index.js +186 -0
- package/form/vue.js +69 -0
- package/form-item/index.js +364 -0
- package/form-item/vue.js +210 -0
- package/fullscreen/index.js +138 -0
- package/fullscreen/vue.js +77 -0
- package/grid/core/index.js +3 -0
- package/grid/core/interceptor.js +38 -0
- package/grid/core/storeMap.js +19 -0
- package/grid/plugins/export.js +169 -0
- package/grid/plugins/exportExcel.js +749 -0
- package/grid/plugins/header.js +58 -0
- package/grid/plugins/resize.js +82 -0
- package/grid/static/array/arrayEach.js +12 -0
- package/grid/static/array/arrayIndexOf.js +11 -0
- package/grid/static/array/eachTree.js +32 -0
- package/grid/static/array/every.js +2 -0
- package/grid/static/array/filterTree.js +16 -0
- package/grid/static/array/find.js +3 -0
- package/grid/static/array/findTree.js +46 -0
- package/grid/static/array/helperCreateIterateHandle.js +59 -0
- package/grid/static/array/helperCreateTreeFunc.js +18 -0
- package/grid/static/array/includes.js +5 -0
- package/grid/static/array/lastArrayEach.js +6 -0
- package/grid/static/array/map.js +23 -0
- package/grid/static/array/mapTree.js +33 -0
- package/grid/static/array/slice.js +10 -0
- package/grid/static/array/sortBy.js +69 -0
- package/grid/static/array/sum.js +28 -0
- package/grid/static/array/toArray.js +7 -0
- package/grid/static/array/toTreeArray.js +24 -0
- package/grid/static/base/clear.js +44 -0
- package/grid/static/base/clone.js +18 -0
- package/grid/static/base/destructuring.js +18 -0
- package/grid/static/base/each.js +9 -0
- package/grid/static/base/eqNull.js +6 -0
- package/grid/static/base/findIndexOf.js +10 -0
- package/grid/static/base/get.js +42 -0
- package/grid/static/base/has.js +60 -0
- package/grid/static/base/hasOwnProp.js +4 -0
- package/grid/static/base/helperCreateGetObjects.js +26 -0
- package/grid/static/base/helperCreateInInObjectString.js +7 -0
- package/grid/static/base/helperCreateInTypeof.js +6 -0
- package/grid/static/base/helperCreateIndexOf.js +21 -0
- package/grid/static/base/helperCreateiterateIndexOf.js +21 -0
- package/grid/static/base/helperDefaultCompare.js +4 -0
- package/grid/static/base/helperDeleteProperty.js +8 -0
- package/grid/static/base/helperEqualCompare.js +60 -0
- package/grid/static/base/helperGetHGSKeys.js +4 -0
- package/grid/static/base/indexOf.js +3 -0
- package/grid/static/base/isArray.js +3 -0
- package/grid/static/base/isBoolean.js +4 -0
- package/grid/static/base/isDate.js +3 -0
- package/grid/static/base/isEmpty.js +8 -0
- package/grid/static/base/isEqual.js +11 -0
- package/grid/static/base/isFunction.js +4 -0
- package/grid/static/base/isNaN.js +5 -0
- package/grid/static/base/isNull.js +4 -0
- package/grid/static/base/isNumber.js +4 -0
- package/grid/static/base/isObject.js +5 -0
- package/grid/static/base/isPlainObject.js +2 -0
- package/grid/static/base/isRegExp.js +3 -0
- package/grid/static/base/isSet.js +5 -0
- package/grid/static/base/isString.js +4 -0
- package/grid/static/base/isUndefined.js +4 -0
- package/grid/static/base/keys.js +3 -0
- package/grid/static/base/lastEach.js +9 -0
- package/grid/static/base/remove.js +44 -0
- package/grid/static/base/set.js +43 -0
- package/grid/static/base/toJSONString.js +4 -0
- package/grid/static/base/toStringJSON.js +13 -0
- package/grid/static/base/uniqueId.js +5 -0
- package/grid/static/browse/browse.js +54 -0
- package/grid/static/function/property.js +7 -0
- package/grid/static/function/throttle.js +43 -0
- package/grid/static/index.js +55 -0
- package/grid/static/number/helperCreateToNumber.js +12 -0
- package/grid/static/number/toNumber.js +3 -0
- package/grid/static/object/assign.js +41 -0
- package/grid/static/object/extend.js +3 -0
- package/grid/static/object/lastObjectEach.js +8 -0
- package/grid/static/object/objectEach.js +11 -0
- package/grid/static/object/objectMap.js +20 -0
- package/grid/static/object/values.js +9 -0
- package/grid/static/static/staticDocument.js +4 -0
- package/grid/static/static/staticHGKeyRE.js +2 -0
- package/grid/static/static/staticParseInt.js +2 -0
- package/grid/static/static/staticStrUndefined.js +2 -0
- package/grid/static/static/staticWindow.js +4 -0
- package/grid/static/string/template.js +12 -0
- package/grid/static/string/toString.js +12 -0
- package/grid/utils/column.js +72 -0
- package/grid/utils/common.js +155 -0
- package/grid/utils/dom.js +213 -0
- package/grid/utils/event.js +40 -0
- package/grid/utils/index.js +5 -0
- package/image/index.js +187 -0
- package/image/vue.js +142 -0
- package/image-viewer/index.js +469 -0
- package/image-viewer/vue.js +243 -0
- package/input/index.js +319 -0
- package/input/vue.js +319 -0
- package/ip-address/index.js +370 -0
- package/ip-address/vue.js +185 -0
- package/layout/vue.js +4 -0
- package/link/index.js +10 -0
- package/link/vue.js +26 -0
- package/link-menu/index.js +146 -0
- package/link-menu/vue.js +138 -0
- package/list/index.js +13 -0
- package/list/vue.js +17 -0
- package/loading/index.js +29 -0
- package/loading/vue.js +28 -0
- package/milestone/index.js +92 -0
- package/milestone/vue.js +31 -0
- package/mini-picker/index.js +227 -0
- package/mini-picker/vue.js +142 -0
- package/modal/index.js +866 -0
- package/modal/vue.js +130 -0
- package/month-range/index.js +169 -0
- package/month-range/vue.js +104 -0
- package/month-table/index.js +232 -0
- package/month-table/vue.js +72 -0
- package/nav-menu/index.js +457 -0
- package/nav-menu/vue.js +187 -0
- package/notify/index.js +91 -0
- package/notify/vue.js +67 -0
- package/numeric/index.js +419 -0
- package/numeric/vue.js +218 -0
- package/option/index.js +79 -0
- package/option/vue.js +219 -0
- package/option-group/index.js +18 -0
- package/option-group/vue.js +37 -0
- package/package.json +179 -0
- package/pager-item/index.js +122 -0
- package/pager-item/vue.js +52 -0
- package/panel/index.js +30 -0
- package/panel/vue.js +26 -0
- package/picker/index.js +1039 -0
- package/picker/timezone.js +974 -0
- package/picker/vue.js +415 -0
- package/picker-column/index.js +261 -0
- package/picker-column/vue.js +163 -0
- package/pop-upload/index.js +324 -0
- package/pop-upload/vue.js +292 -0
- package/popeditor/index.js +884 -0
- package/popeditor/vue.js +368 -0
- package/popover/index.js +203 -0
- package/popover/vue.js +174 -0
- package/popup/index.js +139 -0
- package/popup/vue.js +129 -0
- package/progress/index.js +174 -0
- package/progress/vue.js +118 -0
- package/pull-refresh/index.js +104 -0
- package/pull-refresh/vue.js +64 -0
- package/radio/index.js +83 -0
- package/radio/vue.js +99 -0
- package/radio-button/index.js +58 -0
- package/radio-button/vue.js +70 -0
- package/radio-group/index.js +51 -0
- package/radio-group/vue.js +34 -0
- package/rate/index.js +254 -0
- package/rate/vue.js +158 -0
- package/row/index.js +19 -0
- package/row/vue.js +24 -0
- package/scroll-text/index.js +24 -0
- package/scroll-text/vue.js +31 -0
- package/scrollbar/index.js +127 -0
- package/scrollbar/vue-bar.js +49 -0
- package/scrollbar/vue.js +43 -0
- package/search/index.js +110 -0
- package/search/vue.js +110 -0
- package/select/index.js +1766 -0
- package/select/vue.js +693 -0
- package/select-dropdown/index.js +23 -0
- package/select-dropdown/vue.js +122 -0
- package/slide-bar/index.js +94 -0
- package/slide-bar/vue.js +58 -0
- package/slider/index.js +434 -0
- package/slider/vue.js +172 -0
- package/split/index.js +122 -0
- package/split/vue.js +131 -0
- package/steps/vue.js +4 -0
- package/switch/index.js +45 -0
- package/switch/vue.js +62 -0
- package/tab-bar/index.js +51 -0
- package/tab-bar/vue.js +16 -0
- package/tab-dropdown/index.js +11 -0
- package/tab-dropdown/vue.js +17 -0
- package/tab-item/index.js +37 -0
- package/tab-item/vue.js +49 -0
- package/tab-nav/index.js +247 -0
- package/tab-nav/vue.js +106 -0
- package/tabbar/index.js +32 -0
- package/tabbar/vue.js +54 -0
- package/tabbar-item/index.js +55 -0
- package/tabbar-item/vue.js +53 -0
- package/table/index.js +111 -0
- package/table/vue.js +66 -0
- package/tabs/index.js +174 -0
- package/tabs/vue.js +141 -0
- package/tag/index.js +14 -0
- package/tag/vue.js +13 -0
- package/tall-storage/index.js +161 -0
- package/tall-storage/vue-storage-box.js +25 -0
- package/tall-storage/vue.js +38 -0
- package/text-popup/index.js +75 -0
- package/text-popup/vue.js +64 -0
- package/time/index.js +121 -0
- package/time/vue.js +124 -0
- package/time-line/index.js +60 -0
- package/time-line/vue.js +49 -0
- package/time-panel/index.js +189 -0
- package/time-panel/scrollIntoView.js +23 -0
- package/time-panel/vue.js +110 -0
- package/time-range/index.js +199 -0
- package/time-range/vue.js +129 -0
- package/time-spinner/index.js +175 -0
- package/time-spinner/vue.js +122 -0
- package/toggle-menu/index.js +104 -0
- package/toggle-menu/vue.js +74 -0
- package/tooltip/index.js +171 -0
- package/tooltip/vue.js +133 -0
- package/top-box/index.js +81 -0
- package/top-box/vue.js +77 -0
- package/transfer/index.js +296 -0
- package/transfer/vue.js +138 -0
- package/transfer-panel/index.js +364 -0
- package/transfer-panel/vue.js +258 -0
- package/tree/index.js +642 -0
- package/tree/vue.js +268 -0
- package/tree-menu/index.js +124 -0
- package/tree-menu/vue.js +60 -0
- package/tree-node/index.js +271 -0
- package/tree-node/vue.js +211 -0
- package/upload/index.js +324 -0
- package/upload/vue.js +93 -0
- package/upload-dragger/index.js +50 -0
- package/upload-dragger/vue.js +27 -0
- package/upload-list/index.js +55 -0
- package/upload-list/vue.js +48 -0
- package/user-contact/index.js +13 -0
- package/user-contact/vue.js +20 -0
- package/user-head/index.js +71 -0
- package/user-head/vue.js +47 -0
- package/wizard/index.js +123 -0
- package/wizard/vue.js +45 -0
- package/year-table/index.js +40 -0
- package/year-table/vue.js +23 -0
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
import { on, off } from '@opentiny/vue-renderless/common/deps/dom';
|
|
2
|
+
var MapShim = function () {
|
|
3
|
+
if (typeof Map !== 'undefined') {
|
|
4
|
+
return Map;
|
|
5
|
+
}
|
|
6
|
+
var getIndex = function getIndex(arr, key) {
|
|
7
|
+
var result = -1;
|
|
8
|
+
arr.some(function (entry, index) {
|
|
9
|
+
if (entry[0] === key) {
|
|
10
|
+
result = index;
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
|
+
});
|
|
15
|
+
return result;
|
|
16
|
+
};
|
|
17
|
+
return function () {
|
|
18
|
+
function obClass() {
|
|
19
|
+
this.__entries__ = [];
|
|
20
|
+
}
|
|
21
|
+
Object.defineProperty(obClass.prototype, 'size', {
|
|
22
|
+
get: function get() {
|
|
23
|
+
return this.__entries__.length;
|
|
24
|
+
},
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true
|
|
27
|
+
});
|
|
28
|
+
obClass.prototype.get = function (key) {
|
|
29
|
+
var index = getIndex(this.__entries__, key);
|
|
30
|
+
var entry = this.__entries__[index];
|
|
31
|
+
return entry && entry[1];
|
|
32
|
+
};
|
|
33
|
+
obClass.prototype.set = function (key, value) {
|
|
34
|
+
var index = getIndex(this.__entries__, key);
|
|
35
|
+
if (~index) {
|
|
36
|
+
this.__entries__[index][1] = value;
|
|
37
|
+
} else {
|
|
38
|
+
this.__entries__.push([key, value]);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
obClass.prototype["delete"] = function (key) {
|
|
42
|
+
var entries = this.__entries__;
|
|
43
|
+
var index = getIndex(entries, key);
|
|
44
|
+
if (~index) {
|
|
45
|
+
entries.splice(index, 1);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
obClass.prototype.clear = function () {
|
|
49
|
+
this.__entries__.splice(0);
|
|
50
|
+
};
|
|
51
|
+
obClass.prototype.has = function (key) {
|
|
52
|
+
return !!~getIndex(this.__entries__, key);
|
|
53
|
+
};
|
|
54
|
+
obClass.prototype.forEach = function (callback, ctx) {
|
|
55
|
+
if (ctx === void 0) {
|
|
56
|
+
ctx = null;
|
|
57
|
+
}
|
|
58
|
+
for (var _i = 0, _a = this.__entries__; _i < _a.length; _i++) {
|
|
59
|
+
var entry = _a[_i];
|
|
60
|
+
callback.call(ctx, entry[1], entry[0]);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
return obClass;
|
|
64
|
+
}();
|
|
65
|
+
}();
|
|
66
|
+
var func = window.Function;
|
|
67
|
+
var isBrowser = window !== 'undefined' && document !== 'undefined' && window.document === document;
|
|
68
|
+
var global$1 = function () {
|
|
69
|
+
var isMath = function isMath(val) {
|
|
70
|
+
return val.Math === Math;
|
|
71
|
+
};
|
|
72
|
+
if (typeof global !== 'undefined' && isMath(global)) {
|
|
73
|
+
return global;
|
|
74
|
+
}
|
|
75
|
+
if (typeof self !== 'undefined' && isMath(self)) {
|
|
76
|
+
return self;
|
|
77
|
+
}
|
|
78
|
+
if (typeof window !== 'undefined' && isMath(window)) {
|
|
79
|
+
return window;
|
|
80
|
+
}
|
|
81
|
+
return func('return this')();
|
|
82
|
+
}();
|
|
83
|
+
var requestAnimationFrame$1 = function () {
|
|
84
|
+
if (typeof requestAnimationFrame === 'function') {
|
|
85
|
+
return requestAnimationFrame.bind(global$1);
|
|
86
|
+
}
|
|
87
|
+
return function (callback) {
|
|
88
|
+
return setTimeout(function () {
|
|
89
|
+
return callback(Date.now());
|
|
90
|
+
}, 1000 / 60);
|
|
91
|
+
};
|
|
92
|
+
}();
|
|
93
|
+
var trailingTimeout = 2;
|
|
94
|
+
function throttle(callback, delayTime) {
|
|
95
|
+
var leading = false;
|
|
96
|
+
var trailing = false;
|
|
97
|
+
var lastCallTime = 0;
|
|
98
|
+
var proxy;
|
|
99
|
+
var resolvePending = function resolvePending() {
|
|
100
|
+
if (leading) {
|
|
101
|
+
leading = false;
|
|
102
|
+
callback();
|
|
103
|
+
}
|
|
104
|
+
trailing && proxy();
|
|
105
|
+
};
|
|
106
|
+
var timeoutCallback = function timeoutCallback() {
|
|
107
|
+
requestAnimationFrame$1(resolvePending);
|
|
108
|
+
};
|
|
109
|
+
proxy = function proxy() {
|
|
110
|
+
var timeStamps = Date.now();
|
|
111
|
+
if (leading) {
|
|
112
|
+
if (timeStamps - lastCallTime < trailingTimeout) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
trailing = true;
|
|
116
|
+
} else {
|
|
117
|
+
leading = true;
|
|
118
|
+
trailing = false;
|
|
119
|
+
setTimeout(timeoutCallback, delayTime);
|
|
120
|
+
}
|
|
121
|
+
lastCallTime = timeStamps;
|
|
122
|
+
};
|
|
123
|
+
return proxy;
|
|
124
|
+
}
|
|
125
|
+
var REFRESH_DELAY = 20;
|
|
126
|
+
var transitionKeys = ['top', 'right', 'bottom', 'left', 'width', 'height', 'size', 'weight'];
|
|
127
|
+
var mutationObserverSupported = typeof MutationObserver !== 'undefined';
|
|
128
|
+
var ResizeObserverController = function () {
|
|
129
|
+
function ResizeObserverController() {
|
|
130
|
+
this.observers_ = [];
|
|
131
|
+
this.connected_ = false;
|
|
132
|
+
this.mutationEventsAdded_ = false;
|
|
133
|
+
this.mutationsObserver_ = null;
|
|
134
|
+
this.onTransitionEnd_ = this.onTransitionEnd_.bind(this);
|
|
135
|
+
this.refresh = throttle(this.refresh.bind(this), REFRESH_DELAY);
|
|
136
|
+
}
|
|
137
|
+
ResizeObserverController.prototype.addObserver = function (observer) {
|
|
138
|
+
!~this.observers_.indexOf(observer) && this.observers_.push(observer);
|
|
139
|
+
!this.connected_ && this.connect_();
|
|
140
|
+
};
|
|
141
|
+
ResizeObserverController.prototype.removeObserver = function (observer) {
|
|
142
|
+
var observers = this.observers_;
|
|
143
|
+
var index = observers.indexOf(observer);
|
|
144
|
+
~index && observers.splice(index, 1);
|
|
145
|
+
if (!observers.length && this.connected_) {
|
|
146
|
+
this.disconnect_();
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
ResizeObserverController.prototype.refresh = function () {
|
|
150
|
+
var changesDetected = this.updateObservers_();
|
|
151
|
+
changesDetected && this.refresh();
|
|
152
|
+
};
|
|
153
|
+
ResizeObserverController.prototype.updateObservers_ = function () {
|
|
154
|
+
var activeObservers = this.observers_.filter(function (observer) {
|
|
155
|
+
observer.gatherActive();
|
|
156
|
+
return observer.hasActive();
|
|
157
|
+
});
|
|
158
|
+
activeObservers.forEach(function (observer) {
|
|
159
|
+
return observer.broadcastActive();
|
|
160
|
+
});
|
|
161
|
+
return activeObservers.length > 0;
|
|
162
|
+
};
|
|
163
|
+
ResizeObserverController.prototype.connect_ = function () {
|
|
164
|
+
if (!isBrowser || this.connected_) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
on(document, 'transitionend', this.onTransitionEnd_);
|
|
168
|
+
on(window, 'resize', this.refresh);
|
|
169
|
+
if (mutationObserverSupported) {
|
|
170
|
+
this.mutationsObserver_ = new MutationObserver(this.refresh);
|
|
171
|
+
var options = {
|
|
172
|
+
attributes: true,
|
|
173
|
+
childList: true,
|
|
174
|
+
characterData: true,
|
|
175
|
+
subtree: true
|
|
176
|
+
};
|
|
177
|
+
this.mutationsObserver_.observe(document, options);
|
|
178
|
+
} else {
|
|
179
|
+
on(document, 'DOMSubtreeModified', this.refresh);
|
|
180
|
+
this.mutationEventsAdded_ = true;
|
|
181
|
+
}
|
|
182
|
+
this.connected_ = true;
|
|
183
|
+
};
|
|
184
|
+
ResizeObserverController.prototype.disconnect_ = function () {
|
|
185
|
+
if (!isBrowser || !this.connected_) {
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
off(document, 'transitionend', this.onTransitionEnd_);
|
|
189
|
+
off(window, 'resize', this.refresh);
|
|
190
|
+
this.mutationsObserver_ && this.mutationsObserver_.disconnect();
|
|
191
|
+
if (this.mutationEventsAdded_) {
|
|
192
|
+
off(document, 'DOMSubtreeModified', this.refresh);
|
|
193
|
+
}
|
|
194
|
+
this.mutationsObserver_ = null;
|
|
195
|
+
this.mutationEventsAdded_ = false;
|
|
196
|
+
this.connected_ = false;
|
|
197
|
+
};
|
|
198
|
+
ResizeObserverController.prototype.onTransitionEnd_ = function (_a) {
|
|
199
|
+
var _b = _a.propertyName;
|
|
200
|
+
var propertyName = _b === void 0 ? '' : _b;
|
|
201
|
+
var isReflowProperty = transitionKeys.some(function (key) {
|
|
202
|
+
return !!~propertyName.indexOf(key);
|
|
203
|
+
});
|
|
204
|
+
isReflowProperty && this.refresh();
|
|
205
|
+
};
|
|
206
|
+
ResizeObserverController.getInstance = function () {
|
|
207
|
+
if (!this._instance) {
|
|
208
|
+
this._instance = new ResizeObserverController();
|
|
209
|
+
}
|
|
210
|
+
return this._instance;
|
|
211
|
+
};
|
|
212
|
+
ResizeObserverController._instance = null;
|
|
213
|
+
return ResizeObserverController;
|
|
214
|
+
}();
|
|
215
|
+
var defineConfigurable = function defineConfigurable(target, props) {
|
|
216
|
+
for (var i = 0, a = Object.keys(props); i < a.length; i++) {
|
|
217
|
+
var key = a[i];
|
|
218
|
+
Object.defineProperty(target, key, {
|
|
219
|
+
value: props[key],
|
|
220
|
+
configurable: true,
|
|
221
|
+
writable: false,
|
|
222
|
+
enumerable: false
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
return target;
|
|
226
|
+
};
|
|
227
|
+
var createRectInit = function createRectInit(x, y, width, height) {
|
|
228
|
+
return {
|
|
229
|
+
x: x,
|
|
230
|
+
y: y,
|
|
231
|
+
width: width,
|
|
232
|
+
height: height
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
var getWindowOf = function getWindowOf(target) {
|
|
236
|
+
var ownerGlobal = target && target.ownerDocument && target.ownerDocument.defaultView;
|
|
237
|
+
return ownerGlobal || global$1;
|
|
238
|
+
};
|
|
239
|
+
var emptyRect = createRectInit(0, 0, 0, 0);
|
|
240
|
+
var toFloat = function toFloat(value) {
|
|
241
|
+
return parseFloat(value) || 0;
|
|
242
|
+
};
|
|
243
|
+
var getBordersSize = function getBordersSize(styles) {
|
|
244
|
+
var positions = [];
|
|
245
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
246
|
+
positions[i - 1] = arguments[i];
|
|
247
|
+
}
|
|
248
|
+
return positions.reduce(function (size, position) {
|
|
249
|
+
var value = styles["border-".concat(position, "-width")];
|
|
250
|
+
return size + toFloat(value);
|
|
251
|
+
}, 0);
|
|
252
|
+
};
|
|
253
|
+
var getPaddings = function getPaddings(styles) {
|
|
254
|
+
var positions = ['top', 'right', 'bottom', 'left'];
|
|
255
|
+
var paddings = {};
|
|
256
|
+
for (var i = 0, pos = positions; i < pos.length; i++) {
|
|
257
|
+
var position = pos[i];
|
|
258
|
+
var value = styles["padding-".concat(position)];
|
|
259
|
+
paddings[position] = toFloat(value);
|
|
260
|
+
}
|
|
261
|
+
return paddings;
|
|
262
|
+
};
|
|
263
|
+
var getSVGContentRect = function getSVGContentRect(target) {
|
|
264
|
+
var bbox = target.getBBox();
|
|
265
|
+
return createRectInit(0, 0, bbox.width, bbox.height);
|
|
266
|
+
};
|
|
267
|
+
var isDocumentElement = function isDocumentElement(target) {
|
|
268
|
+
return target === getWindowOf(target).document.documentElement;
|
|
269
|
+
};
|
|
270
|
+
var getHTMLElementContentRect = function getHTMLElementContentRect(target) {
|
|
271
|
+
var clientWidth = target.clientWidth;
|
|
272
|
+
var clientHeight = target.clientHeight;
|
|
273
|
+
if (!clientHeight && !clientWidth) {
|
|
274
|
+
return emptyRect;
|
|
275
|
+
}
|
|
276
|
+
var styles = getWindowOf(target).getComputedStyle(target);
|
|
277
|
+
var paddings = getPaddings(styles);
|
|
278
|
+
var vertPad = paddings.top + paddings.bottom;
|
|
279
|
+
var horizPad = paddings.left + paddings.right;
|
|
280
|
+
var width = toFloat(styles.width);
|
|
281
|
+
var height = toFloat(styles.height);
|
|
282
|
+
if (styles.boxSizing === 'border-box') {
|
|
283
|
+
if (Math.round(height + vertPad) !== clientHeight) {
|
|
284
|
+
height -= getBordersSize(styles, 'top', 'bottom') + vertPad;
|
|
285
|
+
}
|
|
286
|
+
if (Math.round(width + horizPad) !== clientWidth) {
|
|
287
|
+
width -= getBordersSize(styles, 'left', 'right') + horizPad;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
if (!isDocumentElement(target)) {
|
|
291
|
+
var horizScrollbar = Math.round(height + vertPad) - clientHeight;
|
|
292
|
+
var vertScrollbar = Math.round(width + horizPad) - clientWidth;
|
|
293
|
+
if (Math.abs(horizScrollbar) !== 1) {
|
|
294
|
+
height -= horizScrollbar;
|
|
295
|
+
}
|
|
296
|
+
if (Math.abs(vertScrollbar) !== 1) {
|
|
297
|
+
width -= vertScrollbar;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return createRectInit(paddings.left, paddings.top, width, height);
|
|
301
|
+
};
|
|
302
|
+
var isSVGGraphicsElement = function () {
|
|
303
|
+
if (typeof SVGGraphicsElement !== 'undefined') {
|
|
304
|
+
return function (target) {
|
|
305
|
+
return target instanceof getWindowOf(target).SVGGraphicsElement;
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
return function (target) {
|
|
309
|
+
return target instanceof getWindowOf(target).SVGElement && typeof target.getBBox === 'function';
|
|
310
|
+
};
|
|
311
|
+
}();
|
|
312
|
+
var getContentRect = function getContentRect(target) {
|
|
313
|
+
if (!isBrowser) {
|
|
314
|
+
return emptyRect;
|
|
315
|
+
}
|
|
316
|
+
if (isSVGGraphicsElement(target)) {
|
|
317
|
+
return getSVGContentRect(target);
|
|
318
|
+
}
|
|
319
|
+
return getHTMLElementContentRect(target);
|
|
320
|
+
};
|
|
321
|
+
var createReadOnlyRect = function createReadOnlyRect(_a) {
|
|
322
|
+
var x = _a.x;
|
|
323
|
+
var y = _a.y;
|
|
324
|
+
var width = _a.width;
|
|
325
|
+
var height = _a.height;
|
|
326
|
+
var Constr = typeof DOMRectReadOnly !== 'undefined' ? DOMRectReadOnly : Object;
|
|
327
|
+
var rect = Object.create(Constr.prototype);
|
|
328
|
+
defineConfigurable(rect, {
|
|
329
|
+
x: x,
|
|
330
|
+
y: y,
|
|
331
|
+
width: width,
|
|
332
|
+
height: height,
|
|
333
|
+
top: y,
|
|
334
|
+
right: x + width,
|
|
335
|
+
bottom: height + y,
|
|
336
|
+
left: x
|
|
337
|
+
});
|
|
338
|
+
return rect;
|
|
339
|
+
};
|
|
340
|
+
var ResizeObservation = function () {
|
|
341
|
+
function ResizeObservation(target) {
|
|
342
|
+
this.broadcastWidth = 0;
|
|
343
|
+
this.broadcastHeight = 0;
|
|
344
|
+
this.contentRect_ = createRectInit(0, 0, 0, 0);
|
|
345
|
+
this.target = target;
|
|
346
|
+
}
|
|
347
|
+
ResizeObservation.prototype.broadcastRect = function () {
|
|
348
|
+
var rect = this.contentRect_;
|
|
349
|
+
this.broadcastWidth = rect.width;
|
|
350
|
+
this.broadcastHeight = rect.height;
|
|
351
|
+
return rect;
|
|
352
|
+
};
|
|
353
|
+
ResizeObservation.prototype.isActive = function () {
|
|
354
|
+
var rect = getContentRect(this.target);
|
|
355
|
+
this.contentRect_ = rect;
|
|
356
|
+
return rect.width !== this.broadcastWidth || rect.height !== this.broadcastHeight;
|
|
357
|
+
};
|
|
358
|
+
return ResizeObservation;
|
|
359
|
+
}();
|
|
360
|
+
var ResizeObserverEntry = function () {
|
|
361
|
+
function ResizeObserverEntry(target, rectInit) {
|
|
362
|
+
var contentRect = createReadOnlyRect(rectInit);
|
|
363
|
+
defineConfigurable(this, {
|
|
364
|
+
target: target,
|
|
365
|
+
contentRect: contentRect
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
return ResizeObserverEntry;
|
|
369
|
+
}();
|
|
370
|
+
var ResizeObserverSPI = function () {
|
|
371
|
+
function ResizeObserverSPI(callback, controller, callbackCtx) {
|
|
372
|
+
this.observations_ = new MapShim();
|
|
373
|
+
this.activeObservations_ = [];
|
|
374
|
+
if (typeof callback !== 'function') {
|
|
375
|
+
throw new TypeError('[TINY-Resize] The callback provided as parameter 1 is not a function.');
|
|
376
|
+
}
|
|
377
|
+
this.callback_ = callback;
|
|
378
|
+
this.controller_ = controller;
|
|
379
|
+
this.callbackCtx_ = callbackCtx;
|
|
380
|
+
}
|
|
381
|
+
ResizeObserverSPI.prototype.observe = function (target) {
|
|
382
|
+
if (!arguments.length) {
|
|
383
|
+
throw new TypeError('[TINY-Resize] 1 argument required, but only 0 present.');
|
|
384
|
+
}
|
|
385
|
+
if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
|
386
|
+
return;
|
|
387
|
+
}
|
|
388
|
+
if (!(target instanceof getWindowOf(target).Element)) {
|
|
389
|
+
throw new TypeError('[TINY-Resize] parameter 1 is not of type "Element".');
|
|
390
|
+
}
|
|
391
|
+
var obserVations = this.observations_;
|
|
392
|
+
if (obserVations.has(target)) {
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
obserVations.set(target, new ResizeObservation(target));
|
|
396
|
+
this.controller_.addObserver(this);
|
|
397
|
+
this.controller_.refresh();
|
|
398
|
+
};
|
|
399
|
+
ResizeObserverSPI.prototype.unobserve = function (target) {
|
|
400
|
+
if (!arguments.length) {
|
|
401
|
+
throw new TypeError('[TINY-Resize]1 argument required, but only 0 present.');
|
|
402
|
+
}
|
|
403
|
+
if (typeof Element === 'undefined' || !(Element instanceof Object)) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
if (!(target instanceof getWindowOf(target).Element)) {
|
|
407
|
+
throw new TypeError('[TINY-Resize] parameter 1 is not of type "Element".');
|
|
408
|
+
}
|
|
409
|
+
var obserVations = this.observations_;
|
|
410
|
+
if (!obserVations.has(target)) {
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
obserVations["delete"](target);
|
|
414
|
+
!obserVations.size && this.controller_.removeObserver(this);
|
|
415
|
+
};
|
|
416
|
+
ResizeObserverSPI.prototype.gatherActive = function () {
|
|
417
|
+
var me = this;
|
|
418
|
+
this.clearActive();
|
|
419
|
+
this.observations_.forEach(function (observation) {
|
|
420
|
+
observation.isActive() && me.activeObservations_.push(observation);
|
|
421
|
+
});
|
|
422
|
+
};
|
|
423
|
+
ResizeObserverSPI.prototype.disconnect = function () {
|
|
424
|
+
this.clearActive();
|
|
425
|
+
this.observations_.clear();
|
|
426
|
+
this.controller_.removeObserver(this);
|
|
427
|
+
};
|
|
428
|
+
ResizeObserverSPI.prototype.broadcastActive = function () {
|
|
429
|
+
if (!this.hasActive()) {
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
var ctx = this.callbackCtx_;
|
|
433
|
+
var entries = this.activeObservations_.map(function (observation) {
|
|
434
|
+
return new ResizeObserverEntry(observation.target, observation.broadcastRect());
|
|
435
|
+
});
|
|
436
|
+
this.callback_.call(ctx, entries, ctx);
|
|
437
|
+
this.clearActive();
|
|
438
|
+
};
|
|
439
|
+
ResizeObserverSPI.prototype.hasActive = function () {
|
|
440
|
+
return this.activeObservations_.length > 0;
|
|
441
|
+
};
|
|
442
|
+
ResizeObserverSPI.prototype.clearActive = function () {
|
|
443
|
+
this.activeObservations_.splice(0);
|
|
444
|
+
};
|
|
445
|
+
return ResizeObserverSPI;
|
|
446
|
+
}();
|
|
447
|
+
var observers = typeof WeakMap !== 'undefined' ? new WeakMap() : new MapShim();
|
|
448
|
+
var ResizeObserver = function () {
|
|
449
|
+
function ResizeObserver(callback) {
|
|
450
|
+
if (!(this instanceof ResizeObserver)) {
|
|
451
|
+
throw new TypeError('[TINY-Resize] Cannot call a class as a function.');
|
|
452
|
+
}
|
|
453
|
+
if (!arguments.length) {
|
|
454
|
+
throw new TypeError('[TINY-Resize] 1 argument required, but only 0 present.');
|
|
455
|
+
}
|
|
456
|
+
var controller = ResizeObserverController.getInstance();
|
|
457
|
+
var observer = new ResizeObserverSPI(callback, controller, this);
|
|
458
|
+
observers.set(this, observer);
|
|
459
|
+
}
|
|
460
|
+
return ResizeObserver;
|
|
461
|
+
}();
|
|
462
|
+
['observe', 'unobserve', 'disconnect'].forEach(function (method) {
|
|
463
|
+
ResizeObserver.prototype[method] = function () {
|
|
464
|
+
var _a;
|
|
465
|
+
return (_a = observers.get(this))[method].apply(_a, arguments);
|
|
466
|
+
};
|
|
467
|
+
});
|
|
468
|
+
var index = function () {
|
|
469
|
+
if (typeof global$1.ResizeObserver !== 'undefined') {
|
|
470
|
+
return global$1.ResizeObserver;
|
|
471
|
+
}
|
|
472
|
+
return ResizeObserver;
|
|
473
|
+
}();
|
|
474
|
+
export default index;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var AfterLave = 'after-leave';
|
|
2
|
+
var Speed = 300;
|
|
3
|
+
export default (function (instance, callback) {
|
|
4
|
+
var speed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Speed;
|
|
5
|
+
var once = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
6
|
+
if (!instance || !callback) {
|
|
7
|
+
throw new Error('instance & callback is required');
|
|
8
|
+
}
|
|
9
|
+
var called = false;
|
|
10
|
+
var eventCallback = function eventCallback() {
|
|
11
|
+
if (called) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
called = true;
|
|
15
|
+
if (typeof callback === 'function') {
|
|
16
|
+
callback.apply(null, arguments);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
if (once) {
|
|
20
|
+
instance.$once(AfterLave, eventCallback);
|
|
21
|
+
} else {
|
|
22
|
+
instance.$on(AfterLave, eventCallback);
|
|
23
|
+
}
|
|
24
|
+
setTimeout(eventCallback, speed + 100);
|
|
25
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { on } from '@opentiny/vue-renderless/common/deps/dom';
|
|
2
|
+
var isServer = typeof window === 'undefined';
|
|
3
|
+
var nodeList = [];
|
|
4
|
+
var nameSpace = '@@clickoutsideContext';
|
|
5
|
+
var startClick;
|
|
6
|
+
var seed = 0;
|
|
7
|
+
if (!isServer) {
|
|
8
|
+
on(document, 'mousedown', function (event) {
|
|
9
|
+
return startClick = event;
|
|
10
|
+
});
|
|
11
|
+
on(document, 'mouseup', function (event) {
|
|
12
|
+
nodeList.forEach(function (node) {
|
|
13
|
+
return node[nameSpace].documentHandler(event, startClick);
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
var createDocumentHandler = function createDocumentHandler(el, binding, vnode) {
|
|
18
|
+
return function () {
|
|
19
|
+
var mouseup = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
20
|
+
var mousedown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
21
|
+
var popperElm = vnode.context.popperElm || vnode.context.state.popperElm;
|
|
22
|
+
if (!mouseup.target || !mousedown.target || el.contains(mouseup.target) || el.contains(mousedown.target) || el === mouseup.target || popperElm && (popperElm.contains(mouseup.target) || popperElm.contains(mousedown.target))) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
if (binding.expression && el[nameSpace].methodName && vnode.context[el[nameSpace].methodName]) {
|
|
26
|
+
vnode.context[el[nameSpace].methodName]();
|
|
27
|
+
} else {
|
|
28
|
+
el[nameSpace].bindingFn && el[nameSpace].bindingFn();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export default {
|
|
33
|
+
bind: function bind(el, binding, vnode) {
|
|
34
|
+
nodeList.push(el);
|
|
35
|
+
var id = seed++;
|
|
36
|
+
el[nameSpace] = {
|
|
37
|
+
id: id,
|
|
38
|
+
documentHandler: createDocumentHandler(el, binding, vnode),
|
|
39
|
+
methodName: binding.expression,
|
|
40
|
+
bindingFn: binding.value
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
update: function update(el, binding, vnode) {
|
|
44
|
+
el[nameSpace].documentHandler = createDocumentHandler(el, binding, vnode);
|
|
45
|
+
el[nameSpace].methodName = binding.expression;
|
|
46
|
+
el[nameSpace].bindingFn = binding.value;
|
|
47
|
+
},
|
|
48
|
+
unbind: function unbind(el) {
|
|
49
|
+
if (el.nodeType !== Node.ELEMENT_NODE) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
var len = nodeList.length;
|
|
53
|
+
for (var i = 0; i < len; i++) {
|
|
54
|
+
if (nodeList[i][nameSpace].id === el[nameSpace].id) {
|
|
55
|
+
nodeList.splice(i, 1);
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
delete el[nameSpace];
|
|
60
|
+
}
|
|
61
|
+
};
|