vue-devui 1.0.0-alpha.4 → 1.0.0-beta.10
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/accordion/index.d.ts +7 -0
- package/accordion/index.es.js +237 -1
- package/accordion/index.umd.js +1 -1
- package/accordion/style.css +1 -1
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +175 -1
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/anchor/index.d.ts +7 -0
- package/anchor/index.es.js +263 -1
- package/anchor/index.umd.js +1 -1
- package/avatar/index.d.ts +7 -0
- package/avatar/index.es.js +301 -1
- package/avatar/index.umd.js +1 -1
- package/back-top/index.d.ts +7 -0
- package/back-top/index.es.js +128 -0
- package/back-top/index.umd.js +1 -0
- package/back-top/package.json +7 -0
- package/back-top/style.css +1 -0
- package/badge/index.d.ts +7 -0
- package/badge/index.es.js +95 -1
- package/badge/index.umd.js +1 -1
- package/breadcrumb/index.d.ts +7 -0
- package/breadcrumb/index.es.js +127 -1
- package/breadcrumb/index.umd.js +1 -1
- package/breadcrumb/style.css +1 -1
- package/button/index.d.ts +7 -0
- package/button/index.es.js +190 -1
- package/button/index.umd.js +1 -1
- package/card/index.d.ts +7 -0
- package/card/index.es.js +61 -1
- package/card/index.umd.js +1 -1
- package/carousel/index.d.ts +7 -0
- package/carousel/index.es.js +329 -1
- package/carousel/index.umd.js +1 -1
- package/cascader/index.d.ts +7 -0
- package/cascader/index.es.js +1343 -1
- package/cascader/index.umd.js +1 -1
- package/cascader/style.css +1 -1
- package/checkbox/index.d.ts +7 -0
- package/checkbox/index.es.js +377 -1
- package/checkbox/index.umd.js +1 -1
- package/comment/index.d.ts +7 -0
- package/comment/index.es.js +85 -0
- package/comment/index.umd.js +1 -0
- package/comment/package.json +7 -0
- package/comment/style.css +1 -0
- package/countdown/index.d.ts +7 -0
- package/countdown/index.es.js +176 -0
- package/countdown/index.umd.js +1 -0
- package/countdown/package.json +7 -0
- package/countdown/style.css +1 -0
- package/date-picker/index.d.ts +7 -0
- package/date-picker/index.es.js +1172 -1
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/dragdrop/index.d.ts +7 -0
- package/dragdrop/index.es.js +32 -0
- package/dragdrop/index.umd.js +1 -0
- package/dragdrop/package.json +7 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +288 -0
- package/drawer/index.umd.js +1 -0
- package/drawer/package.json +7 -0
- package/drawer/style.css +1 -0
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +527 -0
- package/dropdown/index.umd.js +1 -0
- package/dropdown/package.json +7 -0
- package/dropdown/style.css +1 -0
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +5793 -1
- package/editable-select/index.umd.js +27 -1
- package/editable-select/style.css +1 -1
- package/form/index.d.ts +7 -0
- package/form/index.es.js +2244 -0
- package/form/index.umd.js +1 -0
- package/form/package.json +7 -0
- package/form/style.css +1 -0
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +163 -1
- package/fullscreen/index.umd.js +1 -1
- package/gantt/index.d.ts +7 -0
- package/gantt/index.es.js +535 -0
- package/gantt/index.umd.js +1 -0
- package/gantt/package.json +7 -0
- package/gantt/style.css +1 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +269 -0
- package/grid/index.umd.js +1 -0
- package/grid/package.json +7 -0
- package/grid/style.css +1 -0
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +75 -1
- package/icon/index.umd.js +1 -1
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +480 -1
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/index.d.ts +7 -0
- package/input/index.d.ts +7 -0
- package/input/index.es.js +190 -1
- package/input/index.umd.js +1 -1
- package/input-icon/index.d.ts +7 -0
- package/input-icon/index.es.js +332 -0
- package/input-icon/index.umd.js +1 -0
- package/input-icon/package.json +7 -0
- package/input-icon/style.css +1 -0
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +240 -1
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +100 -0
- package/layout/index.umd.js +1 -0
- package/layout/package.json +7 -0
- package/layout/style.css +1 -0
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +256 -1
- package/loading/index.umd.js +1 -1
- package/modal/index.d.ts +7 -0
- package/modal/index.es.js +1027 -1
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/nav-sprite/index.d.ts +7 -0
- package/nav-sprite/index.es.js +742 -0
- package/nav-sprite/index.umd.js +1 -0
- package/nav-sprite/package.json +7 -0
- package/nuxt/components/Accordion.js +3 -0
- package/nuxt/components/Alert.js +3 -0
- package/nuxt/components/Anchor.js +3 -0
- package/nuxt/components/Aside.js +3 -0
- package/nuxt/components/Avatar.js +3 -0
- package/nuxt/components/BackTop.js +3 -0
- package/nuxt/components/Badge.js +3 -0
- package/nuxt/components/Breadcrumb.js +3 -0
- package/nuxt/components/Button.js +3 -0
- package/nuxt/components/Card.js +3 -0
- package/nuxt/components/Carousel.js +3 -0
- package/nuxt/components/Cascader.js +3 -0
- package/nuxt/components/Checkbox.js +3 -0
- package/nuxt/components/Col.js +3 -0
- package/nuxt/components/Column.js +3 -0
- package/nuxt/components/Comment.js +3 -0
- package/nuxt/components/Content.js +3 -0
- package/nuxt/components/Countdown.js +3 -0
- package/nuxt/components/DatePicker.js +3 -0
- package/nuxt/components/Drawer.js +3 -0
- package/nuxt/components/Dropdown.js +3 -0
- package/nuxt/components/EditableSelect.js +3 -0
- package/nuxt/components/FixedOverlay.js +3 -0
- package/nuxt/components/FlexibleOverlay.js +3 -0
- package/nuxt/components/Footer.js +3 -0
- package/nuxt/components/Form.js +3 -0
- package/nuxt/components/FormControl.js +3 -0
- package/nuxt/components/FormItem.js +3 -0
- package/nuxt/components/FormLabel.js +3 -0
- package/nuxt/components/FormOperation.js +3 -0
- package/nuxt/components/Fullscreen.js +3 -0
- package/nuxt/components/Gantt.js +3 -0
- package/nuxt/components/Header.js +3 -0
- package/nuxt/components/Icon.js +2 -0
- package/nuxt/components/ImagePreviewService.js +3 -0
- package/nuxt/components/Input.js +3 -0
- package/nuxt/components/InputIcon.js +3 -0
- package/nuxt/components/InputNumber.js +3 -0
- package/nuxt/components/Layout.js +3 -0
- package/nuxt/components/Loading.js +3 -0
- package/nuxt/components/LoadingService.js +3 -0
- package/nuxt/components/Modal.js +3 -0
- package/nuxt/components/MultiUpload.js +3 -0
- package/nuxt/components/NavSprite.js +2 -0
- package/nuxt/components/Pagination.js +3 -0
- package/nuxt/components/Panel.js +3 -0
- package/nuxt/components/Popover.js +3 -0
- package/nuxt/components/Progress.js +3 -0
- package/nuxt/components/QuadrantDiagram.js +3 -0
- package/nuxt/components/Radio.js +3 -0
- package/nuxt/components/RadioGroup.js +3 -0
- package/nuxt/components/Rate.js +3 -0
- package/nuxt/components/ReadTip.js +3 -0
- package/nuxt/components/Result.js +3 -0
- package/nuxt/components/Row.js +3 -0
- package/nuxt/components/Search.js +3 -0
- package/nuxt/components/Select.js +3 -0
- package/nuxt/components/Skeleton.js +3 -0
- package/nuxt/components/SkeletonItem.js +3 -0
- package/nuxt/components/Slider.js +3 -0
- package/nuxt/components/Splitter.js +3 -0
- package/nuxt/components/Statistic.js +3 -0
- package/nuxt/components/Status.js +3 -0
- package/nuxt/components/StepsGuide.js +3 -0
- package/nuxt/components/StickSlider.js +3 -0
- package/nuxt/components/Sticky.js +2 -0
- package/nuxt/components/Switch.js +3 -0
- package/nuxt/components/Table.js +3 -0
- package/nuxt/components/Tabs.js +3 -0
- package/nuxt/components/Tag.js +3 -0
- package/nuxt/components/TagInput.js +3 -0
- package/nuxt/components/Textarea.js +3 -0
- package/nuxt/components/TimeAxis.js +3 -0
- package/nuxt/components/TimeAxisItem.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/Toast.js +3 -0
- package/nuxt/components/ToastService.js +3 -0
- package/nuxt/components/Tooltip.js +3 -0
- package/nuxt/components/Transfer.js +3 -0
- package/nuxt/components/Tree.js +3 -0
- package/nuxt/components/TreeSelect.js +3 -0
- package/nuxt/components/Upload.js +3 -0
- package/nuxt/components/buttonProps.js +3 -0
- package/nuxt/index.js +13 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +368 -1
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +8 -33
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +642 -1
- package/pagination/index.umd.js +1 -1
- package/panel/index.d.ts +7 -0
- package/panel/index.es.js +205 -1
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +236 -1
- package/popover/index.umd.js +1 -1
- package/popover/style.css +1 -1
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +153 -1
- package/progress/index.umd.js +3 -1
- package/quadrant-diagram/index.d.ts +7 -0
- package/quadrant-diagram/index.es.js +489 -1
- package/quadrant-diagram/index.umd.js +1 -1
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +225 -1
- package/radio/index.umd.js +1 -1
- package/rate/index.d.ts +7 -0
- package/rate/index.es.js +220 -1
- package/rate/index.umd.js +1 -1
- package/read-tip/index.d.ts +7 -0
- package/read-tip/index.es.js +258 -0
- package/read-tip/index.umd.js +1 -0
- package/read-tip/package.json +7 -0
- package/read-tip/style.css +1 -0
- package/result/index.d.ts +7 -0
- package/result/index.es.js +119 -0
- package/result/index.umd.js +1 -0
- package/result/package.json +7 -0
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +181 -1
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +543 -1
- package/search/index.umd.js +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +706 -1
- package/select/index.umd.js +1 -1
- package/skeleton/index.d.ts +7 -0
- package/skeleton/index.es.js +297 -1
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +199 -1
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +636 -1
- package/splitter/index.umd.js +1 -1
- package/statistic/index.d.ts +7 -0
- package/statistic/index.es.js +280 -0
- package/statistic/index.umd.js +1 -0
- package/statistic/package.json +7 -0
- package/statistic/style.css +1 -0
- package/status/index.d.ts +7 -0
- package/status/index.es.js +42 -1
- package/status/index.umd.js +1 -1
- package/steps-guide/index.d.ts +7 -0
- package/steps-guide/index.es.js +239 -1
- package/steps-guide/index.umd.js +1 -1
- package/steps-guide/style.css +1 -1
- package/sticky/index.d.ts +7 -0
- package/sticky/index.es.js +197 -1
- package/sticky/index.umd.js +1 -1
- package/style.css +1 -1
- package/switch/index.d.ts +7 -0
- package/switch/index.es.js +100 -1
- package/switch/index.umd.js +1 -1
- package/switch/style.css +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +1626 -1
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +195 -1
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +131 -0
- package/tag/index.umd.js +1 -0
- package/tag/package.json +7 -0
- package/tag/style.css +1 -0
- package/tag-input/index.d.ts +7 -0
- package/tag-input/index.es.js +329 -1
- package/tag-input/index.umd.js +1 -1
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +132 -0
- package/textarea/index.umd.js +1 -0
- package/textarea/package.json +7 -0
- package/textarea/style.css +1 -0
- package/time-axis/index.d.ts +7 -0
- package/time-axis/index.es.js +299 -0
- package/time-axis/index.umd.js +1 -0
- package/time-axis/package.json +7 -0
- package/time-axis/style.css +1 -0
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +1053 -1
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/toast/index.d.ts +7 -0
- package/toast/index.es.js +2060 -1
- package/toast/index.umd.js +1 -1
- package/toast/style.css +1 -1
- package/tooltip/index.d.ts +7 -0
- package/tooltip/index.es.js +171 -1
- package/tooltip/index.umd.js +1 -1
- package/transfer/index.d.ts +7 -0
- package/transfer/index.es.js +1725 -1
- package/transfer/index.umd.js +1 -1
- package/transfer/style.css +1 -1
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +907 -1
- package/tree/index.umd.js +1 -1
- package/tree/style.css +1 -1
- package/tree-select/index.d.ts +7 -0
- package/tree-select/index.es.js +528 -0
- package/tree-select/index.umd.js +1 -0
- package/tree-select/package.json +7 -0
- package/tree-select/style.css +1 -0
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +3179 -1
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +27755 -1
- package/vue-devui.umd.js +29 -1
|
@@ -0,0 +1,742 @@
|
|
|
1
|
+
const EMPTY_OBJ = {};
|
|
2
|
+
const NOOP = () => {
|
|
3
|
+
};
|
|
4
|
+
const extend = Object.assign;
|
|
5
|
+
const remove = (arr, el) => {
|
|
6
|
+
const i = arr.indexOf(el);
|
|
7
|
+
if (i > -1) {
|
|
8
|
+
arr.splice(i, 1);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
const isArray = Array.isArray;
|
|
12
|
+
const isMap = (val) => toTypeString(val) === "[object Map]";
|
|
13
|
+
const isSet = (val) => toTypeString(val) === "[object Set]";
|
|
14
|
+
const isFunction = (val) => typeof val === "function";
|
|
15
|
+
const isString = (val) => typeof val === "string";
|
|
16
|
+
const isSymbol = (val) => typeof val === "symbol";
|
|
17
|
+
const isObject = (val) => val !== null && typeof val === "object";
|
|
18
|
+
const isPromise = (val) => {
|
|
19
|
+
return isObject(val) && isFunction(val.then) && isFunction(val.catch);
|
|
20
|
+
};
|
|
21
|
+
const objectToString = Object.prototype.toString;
|
|
22
|
+
const toTypeString = (value) => objectToString.call(value);
|
|
23
|
+
const isPlainObject = (val) => toTypeString(val) === "[object Object]";
|
|
24
|
+
const hasChanged = (value, oldValue) => !Object.is(value, oldValue);
|
|
25
|
+
const def = (obj, key, value) => {
|
|
26
|
+
Object.defineProperty(obj, key, {
|
|
27
|
+
configurable: true,
|
|
28
|
+
enumerable: false,
|
|
29
|
+
value
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
let activeEffectScope;
|
|
33
|
+
function recordEffectScope(effect, scope) {
|
|
34
|
+
scope = scope || activeEffectScope;
|
|
35
|
+
if (scope && scope.active) {
|
|
36
|
+
scope.effects.push(effect);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
|
|
40
|
+
const newTracked = (dep) => (dep.n & trackOpBit) > 0;
|
|
41
|
+
const initDepMarkers = ({ deps }) => {
|
|
42
|
+
if (deps.length) {
|
|
43
|
+
for (let i = 0; i < deps.length; i++) {
|
|
44
|
+
deps[i].w |= trackOpBit;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const finalizeDepMarkers = (effect) => {
|
|
49
|
+
const { deps } = effect;
|
|
50
|
+
if (deps.length) {
|
|
51
|
+
let ptr = 0;
|
|
52
|
+
for (let i = 0; i < deps.length; i++) {
|
|
53
|
+
const dep = deps[i];
|
|
54
|
+
if (wasTracked(dep) && !newTracked(dep)) {
|
|
55
|
+
dep.delete(effect);
|
|
56
|
+
} else {
|
|
57
|
+
deps[ptr++] = dep;
|
|
58
|
+
}
|
|
59
|
+
dep.w &= ~trackOpBit;
|
|
60
|
+
dep.n &= ~trackOpBit;
|
|
61
|
+
}
|
|
62
|
+
deps.length = ptr;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
let effectTrackDepth = 0;
|
|
66
|
+
let trackOpBit = 1;
|
|
67
|
+
const maxMarkerBits = 30;
|
|
68
|
+
const effectStack = [];
|
|
69
|
+
let activeEffect;
|
|
70
|
+
class ReactiveEffect {
|
|
71
|
+
constructor(fn, scheduler = null, scope) {
|
|
72
|
+
this.fn = fn;
|
|
73
|
+
this.scheduler = scheduler;
|
|
74
|
+
this.active = true;
|
|
75
|
+
this.deps = [];
|
|
76
|
+
recordEffectScope(this, scope);
|
|
77
|
+
}
|
|
78
|
+
run() {
|
|
79
|
+
if (!this.active) {
|
|
80
|
+
return this.fn();
|
|
81
|
+
}
|
|
82
|
+
if (!effectStack.includes(this)) {
|
|
83
|
+
try {
|
|
84
|
+
effectStack.push(activeEffect = this);
|
|
85
|
+
enableTracking();
|
|
86
|
+
trackOpBit = 1 << ++effectTrackDepth;
|
|
87
|
+
if (effectTrackDepth <= maxMarkerBits) {
|
|
88
|
+
initDepMarkers(this);
|
|
89
|
+
} else {
|
|
90
|
+
cleanupEffect(this);
|
|
91
|
+
}
|
|
92
|
+
return this.fn();
|
|
93
|
+
} finally {
|
|
94
|
+
if (effectTrackDepth <= maxMarkerBits) {
|
|
95
|
+
finalizeDepMarkers(this);
|
|
96
|
+
}
|
|
97
|
+
trackOpBit = 1 << --effectTrackDepth;
|
|
98
|
+
resetTracking();
|
|
99
|
+
effectStack.pop();
|
|
100
|
+
const n = effectStack.length;
|
|
101
|
+
activeEffect = n > 0 ? effectStack[n - 1] : void 0;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
stop() {
|
|
106
|
+
if (this.active) {
|
|
107
|
+
cleanupEffect(this);
|
|
108
|
+
if (this.onStop) {
|
|
109
|
+
this.onStop();
|
|
110
|
+
}
|
|
111
|
+
this.active = false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function cleanupEffect(effect) {
|
|
116
|
+
const { deps } = effect;
|
|
117
|
+
if (deps.length) {
|
|
118
|
+
for (let i = 0; i < deps.length; i++) {
|
|
119
|
+
deps[i].delete(effect);
|
|
120
|
+
}
|
|
121
|
+
deps.length = 0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
let shouldTrack = true;
|
|
125
|
+
const trackStack = [];
|
|
126
|
+
function enableTracking() {
|
|
127
|
+
trackStack.push(shouldTrack);
|
|
128
|
+
shouldTrack = true;
|
|
129
|
+
}
|
|
130
|
+
function resetTracking() {
|
|
131
|
+
const last = trackStack.pop();
|
|
132
|
+
shouldTrack = last === void 0 ? true : last;
|
|
133
|
+
}
|
|
134
|
+
new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol));
|
|
135
|
+
function isReactive(value) {
|
|
136
|
+
if (isReadonly(value)) {
|
|
137
|
+
return isReactive(value["__v_raw"]);
|
|
138
|
+
}
|
|
139
|
+
return !!(value && value["__v_isReactive"]);
|
|
140
|
+
}
|
|
141
|
+
function isReadonly(value) {
|
|
142
|
+
return !!(value && value["__v_isReadonly"]);
|
|
143
|
+
}
|
|
144
|
+
function markRaw(value) {
|
|
145
|
+
def(value, "__v_skip", true);
|
|
146
|
+
return value;
|
|
147
|
+
}
|
|
148
|
+
function isRef(r) {
|
|
149
|
+
return Boolean(r && r.__v_isRef === true);
|
|
150
|
+
}
|
|
151
|
+
function unref(ref) {
|
|
152
|
+
return isRef(ref) ? ref.value : ref;
|
|
153
|
+
}
|
|
154
|
+
const shallowUnwrapHandlers = {
|
|
155
|
+
get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
|
|
156
|
+
set: (target, key, value, receiver) => {
|
|
157
|
+
const oldValue = target[key];
|
|
158
|
+
if (isRef(oldValue) && !isRef(value)) {
|
|
159
|
+
oldValue.value = value;
|
|
160
|
+
return true;
|
|
161
|
+
} else {
|
|
162
|
+
return Reflect.set(target, key, value, receiver);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
function proxyRefs(objectWithRefs) {
|
|
167
|
+
return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers);
|
|
168
|
+
}
|
|
169
|
+
Promise.resolve();
|
|
170
|
+
function queueEffectWithSuspense(fn, suspense) {
|
|
171
|
+
if (suspense && suspense.pendingBranch) {
|
|
172
|
+
if (isArray(fn)) {
|
|
173
|
+
suspense.effects.push(...fn);
|
|
174
|
+
} else {
|
|
175
|
+
suspense.effects.push(fn);
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
queuePostFlushCb(fn);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
function defineComponent(options) {
|
|
182
|
+
return isFunction(options) ? { setup: options, name: options.name } : options;
|
|
183
|
+
}
|
|
184
|
+
function resolveMergedOptions(instance) {
|
|
185
|
+
const base = instance.type;
|
|
186
|
+
const { mixins, extends: extendsOptions } = base;
|
|
187
|
+
const { mixins: globalMixins, optionsCache: cache, config: { optionMergeStrategies } } = instance.appContext;
|
|
188
|
+
const cached = cache.get(base);
|
|
189
|
+
let resolved;
|
|
190
|
+
if (cached) {
|
|
191
|
+
resolved = cached;
|
|
192
|
+
} else if (!globalMixins.length && !mixins && !extendsOptions) {
|
|
193
|
+
{
|
|
194
|
+
resolved = base;
|
|
195
|
+
}
|
|
196
|
+
} else {
|
|
197
|
+
resolved = {};
|
|
198
|
+
if (globalMixins.length) {
|
|
199
|
+
globalMixins.forEach((m) => mergeOptions(resolved, m, optionMergeStrategies, true));
|
|
200
|
+
}
|
|
201
|
+
mergeOptions(resolved, base, optionMergeStrategies);
|
|
202
|
+
}
|
|
203
|
+
cache.set(base, resolved);
|
|
204
|
+
return resolved;
|
|
205
|
+
}
|
|
206
|
+
function mergeOptions(to, from, strats, asMixin = false) {
|
|
207
|
+
const { mixins, extends: extendsOptions } = from;
|
|
208
|
+
if (extendsOptions) {
|
|
209
|
+
mergeOptions(to, extendsOptions, strats, true);
|
|
210
|
+
}
|
|
211
|
+
if (mixins) {
|
|
212
|
+
mixins.forEach((m) => mergeOptions(to, m, strats, true));
|
|
213
|
+
}
|
|
214
|
+
for (const key in from) {
|
|
215
|
+
if (asMixin && key === "expose")
|
|
216
|
+
;
|
|
217
|
+
else {
|
|
218
|
+
const strat = internalOptionMergeStrats[key] || strats && strats[key];
|
|
219
|
+
to[key] = strat ? strat(to[key], from[key]) : from[key];
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return to;
|
|
223
|
+
}
|
|
224
|
+
const internalOptionMergeStrats = {
|
|
225
|
+
data: mergeDataFn,
|
|
226
|
+
props: mergeObjectOptions,
|
|
227
|
+
emits: mergeObjectOptions,
|
|
228
|
+
methods: mergeObjectOptions,
|
|
229
|
+
computed: mergeObjectOptions,
|
|
230
|
+
beforeCreate: mergeAsArray,
|
|
231
|
+
created: mergeAsArray,
|
|
232
|
+
beforeMount: mergeAsArray,
|
|
233
|
+
mounted: mergeAsArray,
|
|
234
|
+
beforeUpdate: mergeAsArray,
|
|
235
|
+
updated: mergeAsArray,
|
|
236
|
+
beforeDestroy: mergeAsArray,
|
|
237
|
+
beforeUnmount: mergeAsArray,
|
|
238
|
+
destroyed: mergeAsArray,
|
|
239
|
+
unmounted: mergeAsArray,
|
|
240
|
+
activated: mergeAsArray,
|
|
241
|
+
deactivated: mergeAsArray,
|
|
242
|
+
errorCaptured: mergeAsArray,
|
|
243
|
+
serverPrefetch: mergeAsArray,
|
|
244
|
+
components: mergeObjectOptions,
|
|
245
|
+
directives: mergeObjectOptions,
|
|
246
|
+
watch: mergeWatchOptions,
|
|
247
|
+
provide: mergeDataFn,
|
|
248
|
+
inject: mergeInject
|
|
249
|
+
};
|
|
250
|
+
function mergeDataFn(to, from) {
|
|
251
|
+
if (!from) {
|
|
252
|
+
return to;
|
|
253
|
+
}
|
|
254
|
+
if (!to) {
|
|
255
|
+
return from;
|
|
256
|
+
}
|
|
257
|
+
return function mergedDataFn() {
|
|
258
|
+
return extend(isFunction(to) ? to.call(this, this) : to, isFunction(from) ? from.call(this, this) : from);
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
function mergeInject(to, from) {
|
|
262
|
+
return mergeObjectOptions(normalizeInject(to), normalizeInject(from));
|
|
263
|
+
}
|
|
264
|
+
function normalizeInject(raw) {
|
|
265
|
+
if (isArray(raw)) {
|
|
266
|
+
const res = {};
|
|
267
|
+
for (let i = 0; i < raw.length; i++) {
|
|
268
|
+
res[raw[i]] = raw[i];
|
|
269
|
+
}
|
|
270
|
+
return res;
|
|
271
|
+
}
|
|
272
|
+
return raw;
|
|
273
|
+
}
|
|
274
|
+
function mergeAsArray(to, from) {
|
|
275
|
+
return to ? [...new Set([].concat(to, from))] : from;
|
|
276
|
+
}
|
|
277
|
+
function mergeObjectOptions(to, from) {
|
|
278
|
+
return to ? extend(extend(Object.create(null), to), from) : from;
|
|
279
|
+
}
|
|
280
|
+
function mergeWatchOptions(to, from) {
|
|
281
|
+
if (!to)
|
|
282
|
+
return from;
|
|
283
|
+
if (!from)
|
|
284
|
+
return to;
|
|
285
|
+
const merged = extend(Object.create(null), to);
|
|
286
|
+
for (const key in from) {
|
|
287
|
+
merged[key] = mergeAsArray(to[key], from[key]);
|
|
288
|
+
}
|
|
289
|
+
return merged;
|
|
290
|
+
}
|
|
291
|
+
const queuePostRenderEffect = queueEffectWithSuspense;
|
|
292
|
+
const getPublicInstance = (i) => {
|
|
293
|
+
if (!i)
|
|
294
|
+
return null;
|
|
295
|
+
if (isStatefulComponent(i))
|
|
296
|
+
return getExposeProxy(i) || i.proxy;
|
|
297
|
+
return getPublicInstance(i.parent);
|
|
298
|
+
};
|
|
299
|
+
const publicPropertiesMap = extend(Object.create(null), {
|
|
300
|
+
$: (i) => i,
|
|
301
|
+
$el: (i) => i.vnode.el,
|
|
302
|
+
$data: (i) => i.data,
|
|
303
|
+
$props: (i) => i.props,
|
|
304
|
+
$attrs: (i) => i.attrs,
|
|
305
|
+
$slots: (i) => i.slots,
|
|
306
|
+
$refs: (i) => i.refs,
|
|
307
|
+
$parent: (i) => getPublicInstance(i.parent),
|
|
308
|
+
$root: (i) => getPublicInstance(i.root),
|
|
309
|
+
$emit: (i) => i.emit,
|
|
310
|
+
$options: (i) => resolveMergedOptions(i),
|
|
311
|
+
$forceUpdate: (i) => () => queueJob(i.update),
|
|
312
|
+
$nextTick: (i) => nextTick.bind(i.proxy),
|
|
313
|
+
$watch: (i) => instanceWatch.bind(i)
|
|
314
|
+
});
|
|
315
|
+
let currentInstance = null;
|
|
316
|
+
const setCurrentInstance = (instance) => {
|
|
317
|
+
currentInstance = instance;
|
|
318
|
+
instance.scope.on();
|
|
319
|
+
};
|
|
320
|
+
const unsetCurrentInstance = () => {
|
|
321
|
+
currentInstance && currentInstance.scope.off();
|
|
322
|
+
currentInstance = null;
|
|
323
|
+
};
|
|
324
|
+
function isStatefulComponent(instance) {
|
|
325
|
+
return instance.vnode.shapeFlag & 4;
|
|
326
|
+
}
|
|
327
|
+
function getExposeProxy(instance) {
|
|
328
|
+
if (instance.exposed) {
|
|
329
|
+
return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), {
|
|
330
|
+
get(target, key) {
|
|
331
|
+
if (key in target) {
|
|
332
|
+
return target[key];
|
|
333
|
+
} else if (key in publicPropertiesMap) {
|
|
334
|
+
return publicPropertiesMap[key](instance);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}));
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
function callWithErrorHandling(fn, instance, type, args) {
|
|
341
|
+
let res;
|
|
342
|
+
try {
|
|
343
|
+
res = args ? fn(...args) : fn();
|
|
344
|
+
} catch (err) {
|
|
345
|
+
handleError(err, instance, type);
|
|
346
|
+
}
|
|
347
|
+
return res;
|
|
348
|
+
}
|
|
349
|
+
function callWithAsyncErrorHandling(fn, instance, type, args) {
|
|
350
|
+
if (isFunction(fn)) {
|
|
351
|
+
const res = callWithErrorHandling(fn, instance, type, args);
|
|
352
|
+
if (res && isPromise(res)) {
|
|
353
|
+
res.catch((err) => {
|
|
354
|
+
handleError(err, instance, type);
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
return res;
|
|
358
|
+
}
|
|
359
|
+
const values = [];
|
|
360
|
+
for (let i = 0; i < fn.length; i++) {
|
|
361
|
+
values.push(callWithAsyncErrorHandling(fn[i], instance, type, args));
|
|
362
|
+
}
|
|
363
|
+
return values;
|
|
364
|
+
}
|
|
365
|
+
function handleError(err, instance, type, throwInDev = true) {
|
|
366
|
+
const contextVNode = instance ? instance.vnode : null;
|
|
367
|
+
if (instance) {
|
|
368
|
+
let cur = instance.parent;
|
|
369
|
+
const exposedInstance = instance.proxy;
|
|
370
|
+
const errorInfo = type;
|
|
371
|
+
while (cur) {
|
|
372
|
+
const errorCapturedHooks = cur.ec;
|
|
373
|
+
if (errorCapturedHooks) {
|
|
374
|
+
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
375
|
+
if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
cur = cur.parent;
|
|
381
|
+
}
|
|
382
|
+
const appErrorHandler = instance.appContext.config.errorHandler;
|
|
383
|
+
if (appErrorHandler) {
|
|
384
|
+
callWithErrorHandling(appErrorHandler, null, 10, [err, exposedInstance, errorInfo]);
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
logError(err, type, contextVNode, throwInDev);
|
|
389
|
+
}
|
|
390
|
+
function logError(err, type, contextVNode, throwInDev = true) {
|
|
391
|
+
{
|
|
392
|
+
console.error(err);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
let isFlushing = false;
|
|
396
|
+
let isFlushPending = false;
|
|
397
|
+
const queue = [];
|
|
398
|
+
let flushIndex = 0;
|
|
399
|
+
const pendingPreFlushCbs = [];
|
|
400
|
+
let activePreFlushCbs = null;
|
|
401
|
+
let preFlushIndex = 0;
|
|
402
|
+
const pendingPostFlushCbs = [];
|
|
403
|
+
let activePostFlushCbs = null;
|
|
404
|
+
let postFlushIndex = 0;
|
|
405
|
+
const resolvedPromise = Promise.resolve();
|
|
406
|
+
let currentFlushPromise = null;
|
|
407
|
+
let currentPreFlushParentJob = null;
|
|
408
|
+
function nextTick(fn) {
|
|
409
|
+
const p = currentFlushPromise || resolvedPromise;
|
|
410
|
+
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
411
|
+
}
|
|
412
|
+
function findInsertionIndex(id) {
|
|
413
|
+
let start = flushIndex + 1;
|
|
414
|
+
let end = queue.length;
|
|
415
|
+
while (start < end) {
|
|
416
|
+
const middle = start + end >>> 1;
|
|
417
|
+
const middleJobId = getId(queue[middle]);
|
|
418
|
+
middleJobId < id ? start = middle + 1 : end = middle;
|
|
419
|
+
}
|
|
420
|
+
return start;
|
|
421
|
+
}
|
|
422
|
+
function queueJob(job) {
|
|
423
|
+
if ((!queue.length || !queue.includes(job, isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex)) && job !== currentPreFlushParentJob) {
|
|
424
|
+
if (job.id == null) {
|
|
425
|
+
queue.push(job);
|
|
426
|
+
} else {
|
|
427
|
+
queue.splice(findInsertionIndex(job.id), 0, job);
|
|
428
|
+
}
|
|
429
|
+
queueFlush();
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
function queueFlush() {
|
|
433
|
+
if (!isFlushing && !isFlushPending) {
|
|
434
|
+
isFlushPending = true;
|
|
435
|
+
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
function queueCb(cb, activeQueue, pendingQueue, index2) {
|
|
439
|
+
if (!isArray(cb)) {
|
|
440
|
+
if (!activeQueue || !activeQueue.includes(cb, cb.allowRecurse ? index2 + 1 : index2)) {
|
|
441
|
+
pendingQueue.push(cb);
|
|
442
|
+
}
|
|
443
|
+
} else {
|
|
444
|
+
pendingQueue.push(...cb);
|
|
445
|
+
}
|
|
446
|
+
queueFlush();
|
|
447
|
+
}
|
|
448
|
+
function queuePreFlushCb(cb) {
|
|
449
|
+
queueCb(cb, activePreFlushCbs, pendingPreFlushCbs, preFlushIndex);
|
|
450
|
+
}
|
|
451
|
+
function queuePostFlushCb(cb) {
|
|
452
|
+
queueCb(cb, activePostFlushCbs, pendingPostFlushCbs, postFlushIndex);
|
|
453
|
+
}
|
|
454
|
+
function flushPreFlushCbs(seen, parentJob = null) {
|
|
455
|
+
if (pendingPreFlushCbs.length) {
|
|
456
|
+
currentPreFlushParentJob = parentJob;
|
|
457
|
+
activePreFlushCbs = [...new Set(pendingPreFlushCbs)];
|
|
458
|
+
pendingPreFlushCbs.length = 0;
|
|
459
|
+
for (preFlushIndex = 0; preFlushIndex < activePreFlushCbs.length; preFlushIndex++) {
|
|
460
|
+
activePreFlushCbs[preFlushIndex]();
|
|
461
|
+
}
|
|
462
|
+
activePreFlushCbs = null;
|
|
463
|
+
preFlushIndex = 0;
|
|
464
|
+
currentPreFlushParentJob = null;
|
|
465
|
+
flushPreFlushCbs(seen, parentJob);
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
function flushPostFlushCbs(seen) {
|
|
469
|
+
if (pendingPostFlushCbs.length) {
|
|
470
|
+
const deduped = [...new Set(pendingPostFlushCbs)];
|
|
471
|
+
pendingPostFlushCbs.length = 0;
|
|
472
|
+
if (activePostFlushCbs) {
|
|
473
|
+
activePostFlushCbs.push(...deduped);
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
activePostFlushCbs = deduped;
|
|
477
|
+
activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
|
|
478
|
+
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
479
|
+
activePostFlushCbs[postFlushIndex]();
|
|
480
|
+
}
|
|
481
|
+
activePostFlushCbs = null;
|
|
482
|
+
postFlushIndex = 0;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
const getId = (job) => job.id == null ? Infinity : job.id;
|
|
486
|
+
function flushJobs(seen) {
|
|
487
|
+
isFlushPending = false;
|
|
488
|
+
isFlushing = true;
|
|
489
|
+
flushPreFlushCbs(seen);
|
|
490
|
+
queue.sort((a, b) => getId(a) - getId(b));
|
|
491
|
+
const check = NOOP;
|
|
492
|
+
try {
|
|
493
|
+
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
494
|
+
const job = queue[flushIndex];
|
|
495
|
+
if (job && job.active !== false) {
|
|
496
|
+
if (false)
|
|
497
|
+
;
|
|
498
|
+
callWithErrorHandling(job, null, 14);
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
} finally {
|
|
502
|
+
flushIndex = 0;
|
|
503
|
+
queue.length = 0;
|
|
504
|
+
flushPostFlushCbs();
|
|
505
|
+
isFlushing = false;
|
|
506
|
+
currentFlushPromise = null;
|
|
507
|
+
if (queue.length || pendingPreFlushCbs.length || pendingPostFlushCbs.length) {
|
|
508
|
+
flushJobs(seen);
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
const INITIAL_WATCHER_VALUE = {};
|
|
513
|
+
function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EMPTY_OBJ) {
|
|
514
|
+
const instance = currentInstance;
|
|
515
|
+
let getter;
|
|
516
|
+
let forceTrigger = false;
|
|
517
|
+
let isMultiSource = false;
|
|
518
|
+
if (isRef(source)) {
|
|
519
|
+
getter = () => source.value;
|
|
520
|
+
forceTrigger = !!source._shallow;
|
|
521
|
+
} else if (isReactive(source)) {
|
|
522
|
+
getter = () => source;
|
|
523
|
+
deep = true;
|
|
524
|
+
} else if (isArray(source)) {
|
|
525
|
+
isMultiSource = true;
|
|
526
|
+
forceTrigger = source.some(isReactive);
|
|
527
|
+
getter = () => source.map((s) => {
|
|
528
|
+
if (isRef(s)) {
|
|
529
|
+
return s.value;
|
|
530
|
+
} else if (isReactive(s)) {
|
|
531
|
+
return traverse(s);
|
|
532
|
+
} else if (isFunction(s)) {
|
|
533
|
+
return callWithErrorHandling(s, instance, 2);
|
|
534
|
+
} else
|
|
535
|
+
;
|
|
536
|
+
});
|
|
537
|
+
} else if (isFunction(source)) {
|
|
538
|
+
if (cb) {
|
|
539
|
+
getter = () => callWithErrorHandling(source, instance, 2);
|
|
540
|
+
} else {
|
|
541
|
+
getter = () => {
|
|
542
|
+
if (instance && instance.isUnmounted) {
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
if (cleanup) {
|
|
546
|
+
cleanup();
|
|
547
|
+
}
|
|
548
|
+
return callWithAsyncErrorHandling(source, instance, 3, [onInvalidate]);
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
} else {
|
|
552
|
+
getter = NOOP;
|
|
553
|
+
}
|
|
554
|
+
if (cb && deep) {
|
|
555
|
+
const baseGetter = getter;
|
|
556
|
+
getter = () => traverse(baseGetter());
|
|
557
|
+
}
|
|
558
|
+
let cleanup;
|
|
559
|
+
let onInvalidate = (fn) => {
|
|
560
|
+
cleanup = effect.onStop = () => {
|
|
561
|
+
callWithErrorHandling(fn, instance, 4);
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
|
|
565
|
+
const job = () => {
|
|
566
|
+
if (!effect.active) {
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
if (cb) {
|
|
570
|
+
const newValue = effect.run();
|
|
571
|
+
if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue)) || false) {
|
|
572
|
+
if (cleanup) {
|
|
573
|
+
cleanup();
|
|
574
|
+
}
|
|
575
|
+
callWithAsyncErrorHandling(cb, instance, 3, [
|
|
576
|
+
newValue,
|
|
577
|
+
oldValue === INITIAL_WATCHER_VALUE ? void 0 : oldValue,
|
|
578
|
+
onInvalidate
|
|
579
|
+
]);
|
|
580
|
+
oldValue = newValue;
|
|
581
|
+
}
|
|
582
|
+
} else {
|
|
583
|
+
effect.run();
|
|
584
|
+
}
|
|
585
|
+
};
|
|
586
|
+
job.allowRecurse = !!cb;
|
|
587
|
+
let scheduler;
|
|
588
|
+
if (flush === "sync") {
|
|
589
|
+
scheduler = job;
|
|
590
|
+
} else if (flush === "post") {
|
|
591
|
+
scheduler = () => queuePostRenderEffect(job, instance && instance.suspense);
|
|
592
|
+
} else {
|
|
593
|
+
scheduler = () => {
|
|
594
|
+
if (!instance || instance.isMounted) {
|
|
595
|
+
queuePreFlushCb(job);
|
|
596
|
+
} else {
|
|
597
|
+
job();
|
|
598
|
+
}
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
const effect = new ReactiveEffect(getter, scheduler);
|
|
602
|
+
if (cb) {
|
|
603
|
+
if (immediate) {
|
|
604
|
+
job();
|
|
605
|
+
} else {
|
|
606
|
+
oldValue = effect.run();
|
|
607
|
+
}
|
|
608
|
+
} else if (flush === "post") {
|
|
609
|
+
queuePostRenderEffect(effect.run.bind(effect), instance && instance.suspense);
|
|
610
|
+
} else {
|
|
611
|
+
effect.run();
|
|
612
|
+
}
|
|
613
|
+
return () => {
|
|
614
|
+
effect.stop();
|
|
615
|
+
if (instance && instance.scope) {
|
|
616
|
+
remove(instance.scope.effects, effect);
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
function instanceWatch(source, value, options) {
|
|
621
|
+
const publicThis = this.proxy;
|
|
622
|
+
const getter = isString(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis);
|
|
623
|
+
let cb;
|
|
624
|
+
if (isFunction(value)) {
|
|
625
|
+
cb = value;
|
|
626
|
+
} else {
|
|
627
|
+
cb = value.handler;
|
|
628
|
+
options = value;
|
|
629
|
+
}
|
|
630
|
+
const cur = currentInstance;
|
|
631
|
+
setCurrentInstance(this);
|
|
632
|
+
const res = doWatch(getter, cb.bind(publicThis), options);
|
|
633
|
+
if (cur) {
|
|
634
|
+
setCurrentInstance(cur);
|
|
635
|
+
} else {
|
|
636
|
+
unsetCurrentInstance();
|
|
637
|
+
}
|
|
638
|
+
return res;
|
|
639
|
+
}
|
|
640
|
+
function createPathGetter(ctx, path) {
|
|
641
|
+
const segments = path.split(".");
|
|
642
|
+
return () => {
|
|
643
|
+
let cur = ctx;
|
|
644
|
+
for (let i = 0; i < segments.length && cur; i++) {
|
|
645
|
+
cur = cur[segments[i]];
|
|
646
|
+
}
|
|
647
|
+
return cur;
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
function traverse(value, seen) {
|
|
651
|
+
if (!isObject(value) || value["__v_skip"]) {
|
|
652
|
+
return value;
|
|
653
|
+
}
|
|
654
|
+
seen = seen || new Set();
|
|
655
|
+
if (seen.has(value)) {
|
|
656
|
+
return value;
|
|
657
|
+
}
|
|
658
|
+
seen.add(value);
|
|
659
|
+
if (isRef(value)) {
|
|
660
|
+
traverse(value.value, seen);
|
|
661
|
+
} else if (isArray(value)) {
|
|
662
|
+
for (let i = 0; i < value.length; i++) {
|
|
663
|
+
traverse(value[i], seen);
|
|
664
|
+
}
|
|
665
|
+
} else if (isSet(value) || isMap(value)) {
|
|
666
|
+
value.forEach((v) => {
|
|
667
|
+
traverse(v, seen);
|
|
668
|
+
});
|
|
669
|
+
} else if (isPlainObject(value)) {
|
|
670
|
+
for (const key in value) {
|
|
671
|
+
traverse(value[key], seen);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
return value;
|
|
675
|
+
}
|
|
676
|
+
const navSpriteProps = {
|
|
677
|
+
target: {
|
|
678
|
+
type: Object
|
|
679
|
+
},
|
|
680
|
+
scrollTarget: {
|
|
681
|
+
type: Object
|
|
682
|
+
},
|
|
683
|
+
view: {
|
|
684
|
+
type: Object,
|
|
685
|
+
default: { top: 0, bottom: 0 }
|
|
686
|
+
},
|
|
687
|
+
hashSupport: {
|
|
688
|
+
type: Boolean,
|
|
689
|
+
default: false
|
|
690
|
+
},
|
|
691
|
+
mode: {
|
|
692
|
+
type: String,
|
|
693
|
+
default: "default"
|
|
694
|
+
},
|
|
695
|
+
maxLevel: {
|
|
696
|
+
type: Number,
|
|
697
|
+
default: 3
|
|
698
|
+
},
|
|
699
|
+
title: {
|
|
700
|
+
type: String,
|
|
701
|
+
default: "menu"
|
|
702
|
+
},
|
|
703
|
+
indent: {
|
|
704
|
+
type: Number,
|
|
705
|
+
default: 2
|
|
706
|
+
},
|
|
707
|
+
width: {
|
|
708
|
+
type: Number,
|
|
709
|
+
default: 300
|
|
710
|
+
},
|
|
711
|
+
height: {
|
|
712
|
+
type: Number,
|
|
713
|
+
default: 400
|
|
714
|
+
},
|
|
715
|
+
isOpen: {
|
|
716
|
+
type: Boolean,
|
|
717
|
+
default: true
|
|
718
|
+
},
|
|
719
|
+
spriteOption: {
|
|
720
|
+
type: Object
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
var NavSprite = defineComponent({
|
|
724
|
+
name: "DNavSprite",
|
|
725
|
+
props: navSpriteProps,
|
|
726
|
+
emits: ["afterNavInit"],
|
|
727
|
+
setup(props) {
|
|
728
|
+
return {};
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
NavSprite.install = function(app) {
|
|
732
|
+
app.component(NavSprite.name, NavSprite);
|
|
733
|
+
};
|
|
734
|
+
var index = {
|
|
735
|
+
title: "NavSprite \u5BFC\u822A\u7CBE\u7075",
|
|
736
|
+
category: "\u5BFC\u822A",
|
|
737
|
+
status: "10%",
|
|
738
|
+
install(app) {
|
|
739
|
+
app.use(NavSprite);
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
export { NavSprite, index as default };
|