vue-devui 1.0.0-beta.16 → 1.0.0-beta.19
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/README.md +29 -21
- package/accordion/index.es.js +229 -14
- package/accordion/index.umd.js +1 -1
- package/accordion/style.css +1 -1
- package/alert/index.es.js +28 -30
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +133 -271
- package/auto-complete/index.umd.js +1 -1
- package/auto-complete/style.css +1 -1
- package/back-top/index.es.js +5 -3
- package/back-top/index.umd.js +1 -1
- package/badge/index.es.js +13 -19
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/breadcrumb/index.es.js +2 -1
- package/button/index.es.js +95 -122
- package/button/index.umd.js +1 -1
- package/button/style.css +1 -1
- package/carousel/index.es.js +38 -53
- package/carousel/index.umd.js +1 -1
- package/cascader/index.es.js +5412 -784
- package/cascader/index.umd.js +27 -1
- package/cascader/style.css +1 -1
- package/checkbox/style.css +1 -1
- package/color-picker/index.es.js +5517 -281
- package/color-picker/index.umd.js +27 -1
- package/color-picker/style.css +1 -1
- package/countdown/index.es.js +9 -8
- package/date-picker/index.es.js +44 -62
- package/date-picker/index.umd.js +1 -1
- package/date-picker/style.css +1 -1
- package/drawer/index.es.js +159 -324
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +459 -301
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +293 -5724
- package/editable-select/index.umd.js +1 -27
- package/editable-select/style.css +1 -1
- package/form/index.es.js +6125 -535
- package/form/index.umd.js +27 -1
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +112 -133
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/gantt/index.es.js +3 -15
- package/gantt/index.umd.js +1 -1
- package/gantt/style.css +1 -1
- package/grid/index.es.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +39 -57
- package/icon/index.umd.js +1 -1
- package/image-preview/index.es.js +2 -1
- package/input/index.es.js +4 -5
- package/input/index.umd.js +1 -1
- package/input/style.css +1 -1
- package/input-icon/index.es.js +42 -42
- package/input-icon/index.umd.js +1 -1
- package/input-icon/style.css +1 -1
- package/input-number/index.es.js +46 -57
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/{time-axis → list}/index.d.ts +0 -0
- package/list/index.es.js +39 -0
- package/list/index.umd.js +1 -0
- package/{toast → list}/package.json +1 -1
- package/list/style.css +1 -0
- package/loading/index.es.js +2 -2
- package/modal/index.es.js +300 -960
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/nav-sprite/index.es.js +1 -675
- package/nav-sprite/index.umd.js +1 -1
- package/{toast → notification}/index.d.ts +0 -0
- package/notification/index.es.js +284 -0
- package/notification/index.umd.js +1 -0
- package/notification/package.json +7 -0
- package/notification/style.css +1 -0
- package/nuxt/components/DropdownMenu.js +3 -0
- package/nuxt/components/IFileOptions.js +3 -0
- package/nuxt/components/IUploadOptions.js +3 -0
- package/nuxt/components/List.js +3 -0
- package/nuxt/components/ListItem.js +3 -0
- package/nuxt/components/Notification.js +3 -0
- package/nuxt/components/NotificationService.js +3 -0
- package/nuxt/components/PanelBody.js +3 -0
- package/nuxt/components/PanelFooter.js +3 -0
- package/nuxt/components/PanelHeader.js +3 -0
- package/nuxt/components/Timeline.js +3 -0
- package/nuxt/components/TimelineItem.js +3 -0
- package/nuxt/components/UploadStatus.js +3 -0
- package/nuxt/components/alertProps.js +3 -0
- package/nuxt/components/badgeProps.js +3 -0
- package/nuxt/components/dropdownMenuProps.js +3 -0
- package/nuxt/components/fixedOverlayProps.js +3 -0
- package/nuxt/components/flexibleOverlayProps.js +3 -0
- package/nuxt/components/fullscreenProps.js +3 -0
- package/nuxt/components/iconProps.js +2 -0
- package/nuxt/components/notificationProps.js +3 -0
- package/nuxt/components/overlayEmits.js +3 -0
- package/nuxt/components/overlayProps.js +3 -0
- package/nuxt/components/paginationProps.js +3 -0
- package/nuxt/components/panelProps.js +3 -0
- package/nuxt/components/popoverProps.js +3 -0
- package/nuxt/components/searchProps.js +3 -0
- package/nuxt/components/tooltipProps.js +3 -0
- package/nuxt/components/uploadProps.js +3 -0
- package/overlay/index.es.js +152 -198
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +12 -60
- package/pagination/index.es.js +11 -13
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +48 -35
- package/panel/index.umd.js +1 -1
- package/popover/index.es.js +5954 -201
- package/popover/index.umd.js +27 -1
- package/popover/style.css +1 -1
- package/quadrant-diagram/index.es.js +5405 -166
- package/quadrant-diagram/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/read-tip/index.es.js +6 -3
- package/read-tip/style.css +1 -1
- package/result/index.es.js +38 -53
- package/result/index.umd.js +1 -1
- package/ripple/index.es.js +10 -6
- package/search/index.es.js +5428 -200
- package/search/index.umd.js +27 -1
- package/search/style.css +1 -1
- package/select/index.es.js +43 -43
- package/select/index.umd.js +1 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +17 -17
- package/skeleton/index.umd.js +1 -1
- package/slider/index.es.js +2 -1
- package/splitter/index.es.js +5815 -99
- package/splitter/index.umd.js +27 -1
- package/splitter/style.css +1 -1
- package/status/index.es.js +1 -4
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps-guide/index.es.js +6 -3
- package/sticky/index.umd.js +1 -1
- package/style.css +1 -1
- package/table/index.es.js +548 -360
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +3 -4
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +2 -1
- package/tag-input/index.es.js +4 -2
- package/textarea/style.css +1 -1
- package/{theme → theme/theme.scss} +0 -0
- package/time-picker/index.es.js +98 -123
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/timeline/index.d.ts +7 -0
- package/{time-axis → timeline}/index.es.js +65 -78
- package/timeline/index.umd.js +1 -0
- package/{time-axis → timeline}/package.json +1 -1
- package/timeline/style.css +1 -0
- package/tooltip/index.es.js +5804 -94
- package/tooltip/index.umd.js +27 -1
- package/tooltip/style.css +1 -1
- package/transfer/index.es.js +5896 -404
- package/transfer/index.umd.js +27 -1
- package/transfer/style.css +1 -1
- package/tree/index.es.js +5439 -814
- package/tree/index.umd.js +27 -1
- package/tree/style.css +1 -1
- package/tree-select/index.es.js +11 -7
- package/tree-select/style.css +1 -1
- package/upload/index.es.js +335 -2213
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +9709 -12248
- package/vue-devui.umd.js +20 -20
- package/nuxt/components/TimeAxis.js +0 -3
- package/nuxt/components/TimeAxisItem.js +0 -3
- package/nuxt/components/Toast.js +0 -3
- package/nuxt/components/ToastService.js +0 -3
- package/time-axis/index.umd.js +0 -1
- package/time-axis/style.css +0 -1
- package/toast/index.es.js +0 -2063
- package/toast/index.umd.js +0 -1
- package/toast/style.css +0 -1
package/nav-sprite/index.es.js
CHANGED
|
@@ -1,678 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
}
|
|
1
|
+
import { defineComponent } from "vue";
|
|
676
2
|
const navSpriteProps = {
|
|
677
3
|
target: {
|
|
678
4
|
type: Object
|
package/nav-sprite/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(e,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],t):(e=typeof globalThis!="undefined"?globalThis:e||self,t(e.index={},e.Vue))})(this,function(e,t){"use strict";const i={target:{type:Object},scrollTarget:{type:Object},view:{type:Object,default:{top:0,bottom:0}},hashSupport:{type:Boolean,default:!1},mode:{type:String,default:"default"},maxLevel:{type:Number,default:3},title:{type:String,default:"menu"},indent:{type:Number,default:2},width:{type:Number,default:300},height:{type:Number,default:400},isOpen:{type:Boolean,default:!0},spriteOption:{type:Object}};var u=t.defineComponent({name:"DNavSprite",props:i,emits:["afterNavInit"],setup(n){return{}}});u.install=function(n){n.component(u.name,u)};var p={title:"NavSprite \u5BFC\u822A\u7CBE\u7075",category:"\u5BFC\u822A",status:"10%",install(n){n.use(u)}};e.NavSprite=u,e.default=p,Object.defineProperty(e,"__esModule",{value:!0}),e[Symbol.toStringTag]="Module"});
|
|
File without changes
|