@ibiz-template/vue3-components 0.1.2 → 0.1.3
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/dist/{chart-efad8ee0.js → chart-0d4e59ff.js} +2 -2
- package/dist/chart-0d4e59ff.js.map +1 -0
- package/dist/ibiz-markdown-editor-3745dfd5.js.map +1 -1
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +3 -3
- package/dist/index.system.min.js.map +1 -1
- package/dist/wang-editor-675011c6.js.map +1 -1
- package/dist/xlsx-util-fac1c045.js.map +1 -1
- package/es/common/icon/icon.d.ts +1 -3
- package/es/common/index.d.ts +0 -2
- package/es/common/index.mjs +1 -5
- package/es/common/router-view/router-view.d.ts +1 -3
- package/es/control/app-menu/app-menu.css +1 -1
- package/es/control/app-menu-icon-view/app-menu-icon-view.d.ts +3 -3
- package/es/control/app-menu-icon-view/index.d.ts +6 -2
- package/es/control/chart/generator/chart-options-generator.mjs +1 -1
- package/es/control/chart/generator/funnel-series-generator.d.ts +1 -1
- package/es/control/chart/generator/pie-series-generator.d.ts +1 -1
- package/es/control/dashboard/dashboard.css +1 -0
- package/es/control/dashboard/dashboard.d.ts +1 -0
- package/es/control/dashboard/dashboard.mjs +1 -0
- package/es/control/dashboard/portlet/portlet-layout/portlet-layout.d.ts +1 -0
- package/es/control/dashboard/portlet/portlet-layout/portlet-layout.mjs +1 -0
- package/es/control/dashboard/portlet/portlet-part/portlet-part.controller.mjs +1 -1
- package/es/control/data-view/data-view.controller.mjs +0 -1
- package/es/control/data-view/data-view.css +1 -1
- package/es/control/drbar/drbar.controller.d.ts +2 -5
- package/es/control/drbar/drbar.d.ts +2 -2
- package/es/control/drbar/index.d.ts +3 -1
- package/es/control/drtab/drtab.controller.d.ts +2 -5
- package/es/control/exp-bar/tree-exp-bar/tree-exp-bar.controller.d.ts +8 -0
- package/es/control/exp-bar/tree-exp-bar/tree-exp-bar.controller.mjs +22 -9
- package/es/control/exp-bar/tree-exp-bar/tree-exp-bar.mjs +2 -1
- package/es/control/form/form/form.d.ts +1 -5
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.mjs +4 -3
- package/es/control/form/form-detail/form-page/form-page.mjs +2 -2
- package/es/control/grid/grid/grid-control.util.d.ts +2 -1
- package/es/control/grid/grid/grid.controller.d.ts +73 -5
- package/es/control/grid/grid/grid.controller.mjs +201 -6
- package/es/control/grid/grid/grid.css +1 -1
- package/es/control/grid/grid/grid.d.ts +6 -1
- package/es/control/grid/grid/grid.mjs +62 -10
- package/es/control/grid/grid/index.d.ts +5 -1
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.controller.d.ts +11 -2
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.controller.mjs +53 -0
- package/es/control/grid/grid-column/grid-field-column/grid-field-column.css +1 -1
- package/es/control/grid/grid-column/grid-field-edit-column/grid-edit-item/grid-edit-item.css +1 -1
- package/es/control/toolbar/index.d.ts +6 -2
- package/es/control/toolbar/toolbar.d.ts +3 -3
- package/es/control/tree/index.d.ts +7 -1
- package/es/control/tree/tree.controller.d.ts +0 -10
- package/es/control/tree/tree.controller.mjs +4 -18
- package/es/control/tree/tree.d.ts +7 -1
- package/es/control/tree/tree.mjs +23 -8
- package/es/control/tree/tree.service.d.ts +9 -2
- package/es/control/tree/tree.service.mjs +20 -1
- package/es/editor/autocomplete/ibiz-autocomplete/ibiz-autocomplete.d.ts +1 -1
- package/es/editor/cascader/ibiz-cascader/ibiz-cascader.d.ts +1 -1
- package/es/editor/code/code-editor.controller.d.ts +2 -2
- package/es/editor/data-picker/ibiz-picker/ibiz-picker.d.ts +1 -1
- package/es/editor/html/wang-editor/wang-editor.d.ts +1 -1
- package/es/editor/upload/use/use-ibiz-upload.d.ts +2 -2
- package/es/editor/upload/use/use-iview-upload.d.ts +2 -2
- package/es/index.mjs +0 -1
- package/es/panel-component/nav-pos/nav-pos.mjs +6 -4
- package/es/panel-component/nav-pos-index/nav-pos-index.controller.mjs +1 -2
- package/es/panel-component/nav-pos-index/nav-pos-index.mjs +3 -2
- package/es/panel-component/nav-pos-index/nav-pos-index.state.mjs +1 -1
- package/es/panel-component/panel-app-title/panel-app-title.css +1 -1
- package/es/panel-component/panel-app-title/panel-app-title.mjs +1 -1
- package/es/panel-component/panel-field/panel-field.controller.d.ts +1 -1
- package/es/view/portal-view/portal-view.mjs +1 -18
- package/es/view-engine/grid-view.engine.mjs +1 -1
- package/es/view-engine/wf-dyna-action-view.engine.mjs +1 -1
- package/es/view-engine/wf-dyna-start-view.engine.mjs +1 -1
- package/lib/common/index.cjs +0 -13
- package/lib/control/app-menu/app-menu.css +1 -1
- package/lib/control/chart/generator/chart-options-generator.cjs +1 -1
- package/lib/control/dashboard/dashboard.cjs +1 -0
- package/lib/control/dashboard/dashboard.css +1 -0
- package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.cjs +1 -0
- package/lib/control/dashboard/portlet/portlet-part/portlet-part.controller.cjs +1 -1
- package/lib/control/data-view/data-view.controller.cjs +0 -1
- package/lib/control/data-view/data-view.css +1 -1
- package/lib/control/exp-bar/tree-exp-bar/tree-exp-bar.cjs +2 -1
- package/lib/control/exp-bar/tree-exp-bar/tree-exp-bar.controller.cjs +22 -9
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.cjs +4 -3
- package/lib/control/form/form-detail/form-page/form-page.cjs +2 -2
- package/lib/control/grid/grid/grid.cjs +62 -10
- package/lib/control/grid/grid/grid.controller.cjs +200 -5
- package/lib/control/grid/grid/grid.css +1 -1
- package/lib/control/grid/grid-column/grid-field-column/grid-field-column.controller.cjs +53 -0
- package/lib/control/grid/grid-column/grid-field-column/grid-field-column.css +1 -1
- package/lib/control/grid/grid-column/grid-field-edit-column/grid-edit-item/grid-edit-item.css +1 -1
- package/lib/control/tree/tree.cjs +23 -8
- package/lib/control/tree/tree.controller.cjs +4 -18
- package/lib/control/tree/tree.service.cjs +20 -1
- package/lib/index.cjs +0 -11
- package/lib/panel-component/nav-pos/nav-pos.cjs +6 -4
- package/lib/panel-component/nav-pos-index/nav-pos-index.cjs +3 -2
- package/lib/panel-component/nav-pos-index/nav-pos-index.controller.cjs +1 -2
- package/lib/panel-component/nav-pos-index/nav-pos-index.state.cjs +1 -1
- package/lib/panel-component/panel-app-title/panel-app-title.cjs +1 -1
- package/lib/panel-component/panel-app-title/panel-app-title.css +1 -1
- package/lib/view/portal-view/portal-view.cjs +1 -18
- package/lib/view-engine/grid-view.engine.cjs +1 -1
- package/lib/view-engine/wf-dyna-action-view.engine.cjs +1 -1
- package/lib/view-engine/wf-dyna-start-view.engine.cjs +1 -1
- package/package.json +10 -10
- package/dist/chart-efad8ee0.js.map +0 -1
- package/es/common/keep-alive/keep-alive.d.ts +0 -45
- package/es/common/keep-alive/keep-alive.mjs +0 -293
- package/es/common/keep-alive/scheduler.d.ts +0 -41
- package/es/common/keep-alive/scheduler.mjs +0 -168
- package/lib/common/keep-alive/keep-alive.cjs +0 -304
- package/lib/common/keep-alive/scheduler.cjs +0 -178
|
@@ -1,304 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var vue = require('vue');
|
|
4
|
-
var scheduler = require('./scheduler.cjs');
|
|
5
|
-
|
|
6
|
-
const __DEV__ = true;
|
|
7
|
-
var ShapeFlags = /* @__PURE__ */ ((ShapeFlags2) => {
|
|
8
|
-
ShapeFlags2[ShapeFlags2["ELEMENT"] = 1] = "ELEMENT";
|
|
9
|
-
ShapeFlags2[ShapeFlags2["FUNCTIONAL_COMPONENT"] = 2] = "FUNCTIONAL_COMPONENT";
|
|
10
|
-
ShapeFlags2[ShapeFlags2["STATEFUL_COMPONENT"] = 4] = "STATEFUL_COMPONENT";
|
|
11
|
-
ShapeFlags2[ShapeFlags2["TEXT_CHILDREN"] = 8] = "TEXT_CHILDREN";
|
|
12
|
-
ShapeFlags2[ShapeFlags2["ARRAY_CHILDREN"] = 16] = "ARRAY_CHILDREN";
|
|
13
|
-
ShapeFlags2[ShapeFlags2["SLOTS_CHILDREN"] = 32] = "SLOTS_CHILDREN";
|
|
14
|
-
ShapeFlags2[ShapeFlags2["TELEPORT"] = 64] = "TELEPORT";
|
|
15
|
-
ShapeFlags2[ShapeFlags2["SUSPENSE"] = 128] = "SUSPENSE";
|
|
16
|
-
ShapeFlags2[ShapeFlags2["COMPONENT_SHOULD_KEEP_ALIVE"] = 256] = "COMPONENT_SHOULD_KEEP_ALIVE";
|
|
17
|
-
ShapeFlags2[ShapeFlags2["COMPONENT_KEPT_ALIVE"] = 512] = "COMPONENT_KEPT_ALIVE";
|
|
18
|
-
ShapeFlags2[ShapeFlags2["COMPONENT"] = 6] = "COMPONENT";
|
|
19
|
-
return ShapeFlags2;
|
|
20
|
-
})(ShapeFlags || {});
|
|
21
|
-
var MoveType = /* @__PURE__ */ ((MoveType2) => {
|
|
22
|
-
MoveType2[MoveType2["ENTER"] = 0] = "ENTER";
|
|
23
|
-
MoveType2[MoveType2["LEAVE"] = 1] = "LEAVE";
|
|
24
|
-
MoveType2[MoveType2["REORDER"] = 2] = "REORDER";
|
|
25
|
-
return MoveType2;
|
|
26
|
-
})(MoveType || {});
|
|
27
|
-
const isKeepAlive = (vnode) => vnode.type.__isKeepAlive;
|
|
28
|
-
const KeepAliveImpl = {
|
|
29
|
-
name: `IBizKeepAlive`,
|
|
30
|
-
// Marker for special handling inside the renderer. We are not using a ===
|
|
31
|
-
// check directly on KeepAlive in the renderer, because importing it directly
|
|
32
|
-
// would prevent it from being tree-shaken.
|
|
33
|
-
__isKeepAlive: true,
|
|
34
|
-
props: {
|
|
35
|
-
include: [String, RegExp, Array],
|
|
36
|
-
exclude: [String, RegExp, Array],
|
|
37
|
-
max: [String, Number],
|
|
38
|
-
keyList: [Array]
|
|
39
|
-
},
|
|
40
|
-
setup(props, { slots }) {
|
|
41
|
-
const instance = vue.getCurrentInstance();
|
|
42
|
-
const sharedContext = instance.ctx;
|
|
43
|
-
const cache = /* @__PURE__ */ new Map();
|
|
44
|
-
const keys = /* @__PURE__ */ new Set();
|
|
45
|
-
let current = null;
|
|
46
|
-
if (__DEV__) {
|
|
47
|
-
instance.__v_cache = cache;
|
|
48
|
-
}
|
|
49
|
-
const parentSuspense = instance.suspense;
|
|
50
|
-
const {
|
|
51
|
-
renderer: {
|
|
52
|
-
p: patch,
|
|
53
|
-
m: move,
|
|
54
|
-
um: _unmount,
|
|
55
|
-
o: { createElement }
|
|
56
|
-
}
|
|
57
|
-
} = sharedContext;
|
|
58
|
-
const storageContainer = createElement("div");
|
|
59
|
-
sharedContext.activate = (vnode, container, anchor, isSVG, optimized) => {
|
|
60
|
-
const instance2 = vnode.component;
|
|
61
|
-
move(vnode, container, anchor, 0 /* ENTER */, parentSuspense);
|
|
62
|
-
patch(
|
|
63
|
-
instance2.vnode,
|
|
64
|
-
vnode,
|
|
65
|
-
container,
|
|
66
|
-
anchor,
|
|
67
|
-
instance2,
|
|
68
|
-
parentSuspense,
|
|
69
|
-
isSVG,
|
|
70
|
-
vnode.slotScopeIds,
|
|
71
|
-
optimized
|
|
72
|
-
);
|
|
73
|
-
queuePostRenderEffect(() => {
|
|
74
|
-
instance2.isDeactivated = false;
|
|
75
|
-
if (instance2.a) {
|
|
76
|
-
invokeArrayFns(instance2.a);
|
|
77
|
-
}
|
|
78
|
-
const vnodeHook = vnode.props && vnode.props.onVnodeMounted;
|
|
79
|
-
if (vnodeHook) {
|
|
80
|
-
invokeVNodeHook(vnodeHook, instance2.parent, vnode);
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
if (__DEV__) {
|
|
84
|
-
devtoolsComponentAdded(instance2);
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
sharedContext.deactivate = (vnode) => {
|
|
88
|
-
const instance2 = vnode.component;
|
|
89
|
-
move(vnode, storageContainer, null, 1 /* LEAVE */, parentSuspense);
|
|
90
|
-
queuePostRenderEffect(() => {
|
|
91
|
-
if (instance2.da) {
|
|
92
|
-
invokeArrayFns(instance2.da);
|
|
93
|
-
}
|
|
94
|
-
const vnodeHook = vnode.props && vnode.props.onVnodeUnmounted;
|
|
95
|
-
if (vnodeHook) {
|
|
96
|
-
invokeVNodeHook(vnodeHook, instance2.parent, vnode);
|
|
97
|
-
}
|
|
98
|
-
instance2.isDeactivated = true;
|
|
99
|
-
});
|
|
100
|
-
if (__DEV__) {
|
|
101
|
-
devtoolsComponentAdded(instance2);
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
function unmount(vnode) {
|
|
105
|
-
resetShapeFlag(vnode);
|
|
106
|
-
_unmount(vnode, instance, parentSuspense, true);
|
|
107
|
-
}
|
|
108
|
-
function pruneCache(filter) {
|
|
109
|
-
cache.forEach((vnode, key) => {
|
|
110
|
-
const name = scheduler.getComponentName(vnode.type);
|
|
111
|
-
if (name && (!filter || !filter(name))) {
|
|
112
|
-
pruneCacheEntry(key);
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
function pruneCache2(filter) {
|
|
117
|
-
cache.forEach((vnode, key) => {
|
|
118
|
-
const name = vnode.key;
|
|
119
|
-
if (name && (filter && filter(name))) {
|
|
120
|
-
pruneCacheEntry(key);
|
|
121
|
-
}
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
function pruneCacheEntry(key) {
|
|
125
|
-
const cached = cache.get(key);
|
|
126
|
-
if (!current || cached.type !== current.type) {
|
|
127
|
-
unmount(cached);
|
|
128
|
-
} else if (current) {
|
|
129
|
-
resetShapeFlag(current);
|
|
130
|
-
}
|
|
131
|
-
cache.delete(key);
|
|
132
|
-
keys.delete(key);
|
|
133
|
-
}
|
|
134
|
-
vue.watch(
|
|
135
|
-
() => [props.include, props.exclude, props.keyList],
|
|
136
|
-
([include, exclude, keyList]) => {
|
|
137
|
-
include && pruneCache((name) => matches(include, name));
|
|
138
|
-
exclude && pruneCache((name) => !matches(exclude, name));
|
|
139
|
-
keyList && pruneCache2((name) => !matches(keyList, name));
|
|
140
|
-
},
|
|
141
|
-
// prune post-render after `current` has been updated
|
|
142
|
-
{ flush: "post", deep: true }
|
|
143
|
-
);
|
|
144
|
-
let pendingCacheKey = null;
|
|
145
|
-
const cacheSubtree = () => {
|
|
146
|
-
if (pendingCacheKey != null) {
|
|
147
|
-
cache.set(pendingCacheKey, getInnerChild(instance.subTree));
|
|
148
|
-
}
|
|
149
|
-
};
|
|
150
|
-
vue.onMounted(cacheSubtree);
|
|
151
|
-
vue.onUpdated(cacheSubtree);
|
|
152
|
-
vue.onBeforeUnmount(() => {
|
|
153
|
-
for (const key in cache) {
|
|
154
|
-
pruneCacheEntry(key);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
return () => {
|
|
158
|
-
pendingCacheKey = null;
|
|
159
|
-
if (!slots.default) {
|
|
160
|
-
return null;
|
|
161
|
-
}
|
|
162
|
-
const children = slots.default();
|
|
163
|
-
const rawVNode = children[0];
|
|
164
|
-
if (children.length > 1) {
|
|
165
|
-
console.log(`KeepAlive should contain exactly one component child.`);
|
|
166
|
-
current = null;
|
|
167
|
-
return children;
|
|
168
|
-
}
|
|
169
|
-
if (!vue.isVNode(rawVNode) || !(rawVNode.shapeFlag & 4 /* STATEFUL_COMPONENT */) && !(rawVNode.shapeFlag & 128 /* SUSPENSE */)) {
|
|
170
|
-
current = null;
|
|
171
|
-
return rawVNode;
|
|
172
|
-
}
|
|
173
|
-
let vnode = getInnerChild(rawVNode);
|
|
174
|
-
const comp = vnode.type;
|
|
175
|
-
const name = scheduler.getComponentName(
|
|
176
|
-
isAsyncWrapper(vnode) ? vnode.type.__asyncResolved || {} : comp
|
|
177
|
-
);
|
|
178
|
-
const { include, exclude, max, keyList } = props;
|
|
179
|
-
const slotKey = vnode.key;
|
|
180
|
-
if (
|
|
181
|
-
// 包括并且不匹配的
|
|
182
|
-
include && (!name || !matches(include, name)) || // 排除并且匹配的
|
|
183
|
-
exclude && name && matches(exclude, name) || // keyList中存在并且不匹配的
|
|
184
|
-
keyList && !slotKey && !matches(keyList, slotKey)
|
|
185
|
-
) {
|
|
186
|
-
current = vnode;
|
|
187
|
-
return rawVNode;
|
|
188
|
-
}
|
|
189
|
-
const key = vnode.key == null ? comp : vnode.key;
|
|
190
|
-
const cachedVNode = cache.get(key);
|
|
191
|
-
if (vnode.el) {
|
|
192
|
-
vnode = vue.cloneVNode(vnode);
|
|
193
|
-
if (rawVNode.shapeFlag & 128 /* SUSPENSE */) {
|
|
194
|
-
rawVNode.ssContent = vnode;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
pendingCacheKey = key;
|
|
198
|
-
if (cachedVNode) {
|
|
199
|
-
vnode.el = cachedVNode.el;
|
|
200
|
-
vnode.component = cachedVNode.component;
|
|
201
|
-
if (vnode.transition) {
|
|
202
|
-
setTransitionHooks(vnode, vnode.transition);
|
|
203
|
-
}
|
|
204
|
-
vnode.shapeFlag |= 512 /* COMPONENT_KEPT_ALIVE */;
|
|
205
|
-
keys.delete(key);
|
|
206
|
-
keys.add(key);
|
|
207
|
-
} else {
|
|
208
|
-
keys.add(key);
|
|
209
|
-
if (max && keys.size > parseInt(max, 10)) {
|
|
210
|
-
pruneCacheEntry(keys.values().next().value);
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
vnode.shapeFlag |= 256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
214
|
-
current = vnode;
|
|
215
|
-
vnode.keepAlive = true;
|
|
216
|
-
vnode.curPath = slotKey;
|
|
217
|
-
return vnode;
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
const IBizKeepAlive = KeepAliveImpl;
|
|
222
|
-
function matches(pattern, name) {
|
|
223
|
-
if (Array.isArray(pattern)) {
|
|
224
|
-
return pattern.indexOf(name) > -1;
|
|
225
|
-
}
|
|
226
|
-
if (typeof pattern === "string") {
|
|
227
|
-
return pattern.split(",").includes(name);
|
|
228
|
-
}
|
|
229
|
-
if (isRegExp(pattern)) {
|
|
230
|
-
return pattern.test(name);
|
|
231
|
-
}
|
|
232
|
-
return false;
|
|
233
|
-
}
|
|
234
|
-
function resetShapeFlag(vnode) {
|
|
235
|
-
vnode.shapeFlag &= ~256 /* COMPONENT_SHOULD_KEEP_ALIVE */;
|
|
236
|
-
vnode.shapeFlag &= ~512 /* COMPONENT_KEPT_ALIVE */;
|
|
237
|
-
}
|
|
238
|
-
function getInnerChild(vnode) {
|
|
239
|
-
return vnode.shapeFlag & 128 /* SUSPENSE */ ? vnode.ssContent : vnode;
|
|
240
|
-
}
|
|
241
|
-
function isRegExp(v) {
|
|
242
|
-
return Object.prototype.toString.call(v) === "[object RegExp]";
|
|
243
|
-
}
|
|
244
|
-
const isAsyncWrapper = (i) => !!i.type.__asyncLoader;
|
|
245
|
-
function setTransitionHooks(vnode, hooks) {
|
|
246
|
-
if (vnode.shapeFlag & 6 /* COMPONENT */ && vnode.component) {
|
|
247
|
-
setTransitionHooks(vnode.component.subTree, hooks);
|
|
248
|
-
} else {
|
|
249
|
-
vnode.transition = hooks;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
const invokeArrayFns = (fns, arg) => {
|
|
253
|
-
for (let i = 0; i < fns.length; i++) {
|
|
254
|
-
fns[i](arg);
|
|
255
|
-
}
|
|
256
|
-
};
|
|
257
|
-
const queuePostRenderEffect = scheduler.queuePostFlushCb;
|
|
258
|
-
function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
|
|
259
|
-
vue.callWithAsyncErrorHandling(hook, instance, 7, [
|
|
260
|
-
vnode,
|
|
261
|
-
prevVNode
|
|
262
|
-
]);
|
|
263
|
-
}
|
|
264
|
-
var DevtoolsHooks = /* @__PURE__ */ ((DevtoolsHooks2) => {
|
|
265
|
-
DevtoolsHooks2["APP_INIT"] = "app:init";
|
|
266
|
-
DevtoolsHooks2["APP_UNMOUNT"] = "app:unmount";
|
|
267
|
-
DevtoolsHooks2["COMPONENT_UPDATED"] = "component:updated";
|
|
268
|
-
DevtoolsHooks2["COMPONENT_ADDED"] = "component:added";
|
|
269
|
-
DevtoolsHooks2["COMPONENT_REMOVED"] = "component:removed";
|
|
270
|
-
DevtoolsHooks2["COMPONENT_EMIT"] = "component:emit";
|
|
271
|
-
DevtoolsHooks2["PERFORMANCE_START"] = "perf:start";
|
|
272
|
-
DevtoolsHooks2["PERFORMANCE_END"] = "perf:end";
|
|
273
|
-
return DevtoolsHooks2;
|
|
274
|
-
})(DevtoolsHooks || {});
|
|
275
|
-
const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook(
|
|
276
|
-
"component:added" /* COMPONENT_ADDED */
|
|
277
|
-
);
|
|
278
|
-
function createDevtoolsComponentHook(hook) {
|
|
279
|
-
return (component) => {
|
|
280
|
-
emit(
|
|
281
|
-
hook,
|
|
282
|
-
component.appContext.app,
|
|
283
|
-
component.uid,
|
|
284
|
-
component.parent ? component.parent.uid : void 0,
|
|
285
|
-
component
|
|
286
|
-
);
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
function emit(event, ...args) {
|
|
290
|
-
if (window.__VUE_DEVTOOLS_GLOBAL_HOOK__) {
|
|
291
|
-
window.__VUE_DEVTOOLS_GLOBAL_HOOK__.emit(event, ...args);
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
exports.IBizKeepAlive = IBizKeepAlive;
|
|
296
|
-
exports.MoveType = MoveType;
|
|
297
|
-
exports.ShapeFlags = ShapeFlags;
|
|
298
|
-
exports.devtoolsComponentAdded = devtoolsComponentAdded;
|
|
299
|
-
exports.invokeArrayFns = invokeArrayFns;
|
|
300
|
-
exports.invokeVNodeHook = invokeVNodeHook;
|
|
301
|
-
exports.isAsyncWrapper = isAsyncWrapper;
|
|
302
|
-
exports.isKeepAlive = isKeepAlive;
|
|
303
|
-
exports.queuePostRenderEffect = queuePostRenderEffect;
|
|
304
|
-
exports.setTransitionHooks = setTransitionHooks;
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var vue = require('vue');
|
|
4
|
-
|
|
5
|
-
const __DEV__ = true;
|
|
6
|
-
const NOOP = () => {
|
|
7
|
-
};
|
|
8
|
-
let isFlushing = false;
|
|
9
|
-
let isFlushPending = false;
|
|
10
|
-
const queue = [];
|
|
11
|
-
let flushIndex = 0;
|
|
12
|
-
const pendingPostFlushCbs = [];
|
|
13
|
-
let activePostFlushCbs = null;
|
|
14
|
-
let postFlushIndex = 0;
|
|
15
|
-
const resolvedPromise = /* @__PURE__ */ Promise.resolve();
|
|
16
|
-
let currentFlushPromise = null;
|
|
17
|
-
const RECURSION_LIMIT = 100;
|
|
18
|
-
function nextTick(fn) {
|
|
19
|
-
const p = currentFlushPromise || resolvedPromise;
|
|
20
|
-
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
21
|
-
}
|
|
22
|
-
function findInsertionIndex(id) {
|
|
23
|
-
let start = flushIndex + 1;
|
|
24
|
-
let end = queue.length;
|
|
25
|
-
while (start < end) {
|
|
26
|
-
const middle = start + end >>> 1;
|
|
27
|
-
const middleJobId = getId(queue[middle]);
|
|
28
|
-
middleJobId < id ? start = middle + 1 : end = middle;
|
|
29
|
-
}
|
|
30
|
-
return start;
|
|
31
|
-
}
|
|
32
|
-
function queueJob(job) {
|
|
33
|
-
if (!queue.length || !queue.includes(
|
|
34
|
-
job,
|
|
35
|
-
isFlushing && job.allowRecurse ? flushIndex + 1 : flushIndex
|
|
36
|
-
)) {
|
|
37
|
-
if (job.id == null) {
|
|
38
|
-
queue.push(job);
|
|
39
|
-
} else {
|
|
40
|
-
queue.splice(findInsertionIndex(job.id), 0, job);
|
|
41
|
-
}
|
|
42
|
-
queueFlush();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function queueFlush() {
|
|
46
|
-
if (!isFlushing && !isFlushPending) {
|
|
47
|
-
isFlushPending = true;
|
|
48
|
-
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
function invalidateJob(job) {
|
|
52
|
-
const i = queue.indexOf(job);
|
|
53
|
-
if (i > flushIndex) {
|
|
54
|
-
queue.splice(i, 1);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
function queuePostFlushCb(cb) {
|
|
58
|
-
if (!Array.isArray(cb)) {
|
|
59
|
-
if (!activePostFlushCbs || !activePostFlushCbs.includes(
|
|
60
|
-
cb,
|
|
61
|
-
cb.allowRecurse ? postFlushIndex + 1 : postFlushIndex
|
|
62
|
-
)) {
|
|
63
|
-
pendingPostFlushCbs.push(cb);
|
|
64
|
-
}
|
|
65
|
-
} else {
|
|
66
|
-
pendingPostFlushCbs.push(...cb);
|
|
67
|
-
}
|
|
68
|
-
queueFlush();
|
|
69
|
-
}
|
|
70
|
-
function flushPreFlushCbs(seen, i = isFlushing ? flushIndex + 1 : 0) {
|
|
71
|
-
if (__DEV__) {
|
|
72
|
-
seen = seen || /* @__PURE__ */ new Map();
|
|
73
|
-
}
|
|
74
|
-
for (; i < queue.length; i++) {
|
|
75
|
-
const cb = queue[i];
|
|
76
|
-
if (cb && cb.pre) {
|
|
77
|
-
if (__DEV__ && checkRecursiveUpdates(seen, cb)) {
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
queue.splice(i, 1);
|
|
81
|
-
i--;
|
|
82
|
-
cb();
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
function flushPostFlushCbs(seen) {
|
|
87
|
-
if (pendingPostFlushCbs.length) {
|
|
88
|
-
const deduped = [...new Set(pendingPostFlushCbs)];
|
|
89
|
-
pendingPostFlushCbs.length = 0;
|
|
90
|
-
if (activePostFlushCbs) {
|
|
91
|
-
activePostFlushCbs.push(...deduped);
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
activePostFlushCbs = deduped;
|
|
95
|
-
if (__DEV__) {
|
|
96
|
-
seen = seen || /* @__PURE__ */ new Map();
|
|
97
|
-
}
|
|
98
|
-
activePostFlushCbs.sort((a, b) => getId(a) - getId(b));
|
|
99
|
-
for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) {
|
|
100
|
-
if (__DEV__ && checkRecursiveUpdates(seen, activePostFlushCbs[postFlushIndex])) {
|
|
101
|
-
continue;
|
|
102
|
-
}
|
|
103
|
-
activePostFlushCbs[postFlushIndex]();
|
|
104
|
-
}
|
|
105
|
-
activePostFlushCbs = null;
|
|
106
|
-
postFlushIndex = 0;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
const getId = (job) => job.id == null ? Infinity : job.id;
|
|
110
|
-
const comparator = (a, b) => {
|
|
111
|
-
const diff = getId(a) - getId(b);
|
|
112
|
-
if (diff === 0) {
|
|
113
|
-
if (a.pre && !b.pre)
|
|
114
|
-
return -1;
|
|
115
|
-
if (b.pre && !a.pre)
|
|
116
|
-
return 1;
|
|
117
|
-
}
|
|
118
|
-
return diff;
|
|
119
|
-
};
|
|
120
|
-
function flushJobs(seen) {
|
|
121
|
-
isFlushPending = false;
|
|
122
|
-
isFlushing = true;
|
|
123
|
-
if (__DEV__) {
|
|
124
|
-
seen = seen || /* @__PURE__ */ new Map();
|
|
125
|
-
}
|
|
126
|
-
queue.sort(comparator);
|
|
127
|
-
const check = __DEV__ ? (job) => checkRecursiveUpdates(seen, job) : NOOP;
|
|
128
|
-
try {
|
|
129
|
-
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
130
|
-
const job = queue[flushIndex];
|
|
131
|
-
if (job && job.active !== false) {
|
|
132
|
-
if (__DEV__ && check(job)) {
|
|
133
|
-
continue;
|
|
134
|
-
}
|
|
135
|
-
vue.callWithErrorHandling(job, null, 14);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
} finally {
|
|
139
|
-
flushIndex = 0;
|
|
140
|
-
queue.length = 0;
|
|
141
|
-
flushPostFlushCbs(seen);
|
|
142
|
-
isFlushing = false;
|
|
143
|
-
currentFlushPromise = null;
|
|
144
|
-
if (queue.length || pendingPostFlushCbs.length) {
|
|
145
|
-
flushJobs(seen);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
const isFunction = (val) => typeof val === "function";
|
|
150
|
-
const getComponentName = (Component, includeInferred = true) => {
|
|
151
|
-
return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
|
|
152
|
-
};
|
|
153
|
-
function checkRecursiveUpdates(seen, fn) {
|
|
154
|
-
if (!seen.has(fn)) {
|
|
155
|
-
seen.set(fn, 1);
|
|
156
|
-
} else {
|
|
157
|
-
const count = seen.get(fn);
|
|
158
|
-
if (count > RECURSION_LIMIT) {
|
|
159
|
-
const instance = fn.ownerInstance;
|
|
160
|
-
const componentName = instance && getComponentName(instance.type);
|
|
161
|
-
console.warn(
|
|
162
|
-
`Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`
|
|
163
|
-
);
|
|
164
|
-
return true;
|
|
165
|
-
}
|
|
166
|
-
seen.set(fn, count + 1);
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
exports.NOOP = NOOP;
|
|
171
|
-
exports.flushPostFlushCbs = flushPostFlushCbs;
|
|
172
|
-
exports.flushPreFlushCbs = flushPreFlushCbs;
|
|
173
|
-
exports.getComponentName = getComponentName;
|
|
174
|
-
exports.invalidateJob = invalidateJob;
|
|
175
|
-
exports.isFunction = isFunction;
|
|
176
|
-
exports.nextTick = nextTick;
|
|
177
|
-
exports.queueJob = queueJob;
|
|
178
|
-
exports.queuePostFlushCb = queuePostFlushCb;
|