@tmagic/editor 1.5.0-beta.12 → 1.5.0-beta.14
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/tmagic-editor.js +25 -9
- package/dist/tmagic-editor.umd.cjs +25 -9
- package/package.json +7 -7
- package/src/Editor.vue +5 -1
- package/src/editorProps.ts +3 -1
- package/src/layouts/Framework.vue +7 -1
- package/src/layouts/page-bar/PageBar.vue +11 -5
- package/src/layouts/page-bar/Search.vue +3 -0
- package/src/services/dep.ts +7 -0
- package/types/index.d.ts +35 -0
package/dist/tmagic-editor.js
CHANGED
|
@@ -7423,7 +7423,9 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
7423
7423
|
},
|
|
7424
7424
|
{
|
|
7425
7425
|
name: "keyword",
|
|
7426
|
-
|
|
7426
|
+
type: "text",
|
|
7427
|
+
placeholder: "请输入关键字",
|
|
7428
|
+
clearable: true
|
|
7427
7429
|
}
|
|
7428
7430
|
]);
|
|
7429
7431
|
const visible = ref(false);
|
|
@@ -7448,6 +7450,7 @@ const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
|
7448
7450
|
inline: true,
|
|
7449
7451
|
config: unref(formConfig),
|
|
7450
7452
|
"init-values": query.value,
|
|
7453
|
+
"prevent-submit-default": true,
|
|
7451
7454
|
onChange: onFormChange
|
|
7452
7455
|
}, null, 8, ["config", "init-values"])) : createCommentVNode("", true)
|
|
7453
7456
|
])) : createCommentVNode("", true)
|
|
@@ -7467,9 +7470,11 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
7467
7470
|
__name: "PageBar",
|
|
7468
7471
|
props: {
|
|
7469
7472
|
disabledPageFragment: { type: Boolean },
|
|
7470
|
-
pageBarSortOptions: {}
|
|
7473
|
+
pageBarSortOptions: {},
|
|
7474
|
+
filterFunction: { type: Function, default: (page, keyword) => page.name?.includes(keyword) || `${page.id}`.includes(keyword) }
|
|
7471
7475
|
},
|
|
7472
7476
|
setup(__props) {
|
|
7477
|
+
const props = __props;
|
|
7473
7478
|
const services = inject("services");
|
|
7474
7479
|
const editorService = services?.editorService;
|
|
7475
7480
|
const root = computed(() => editorService?.get("root"));
|
|
@@ -7486,7 +7491,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
|
7486
7491
|
return (root.value?.items || []).filter((item) => {
|
|
7487
7492
|
if (pageType.includes(item.type)) {
|
|
7488
7493
|
if (keyword) {
|
|
7489
|
-
return
|
|
7494
|
+
return props.filterFunction(item, keyword);
|
|
7490
7495
|
}
|
|
7491
7496
|
return true;
|
|
7492
7497
|
}
|
|
@@ -7653,7 +7658,8 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
7653
7658
|
__name: "Framework",
|
|
7654
7659
|
props: {
|
|
7655
7660
|
disabledPageFragment: { type: Boolean },
|
|
7656
|
-
pageBarSortOptions: {}
|
|
7661
|
+
pageBarSortOptions: {},
|
|
7662
|
+
pageFilterFunction: { type: Function }
|
|
7657
7663
|
},
|
|
7658
7664
|
setup(__props) {
|
|
7659
7665
|
const codeOptions = inject("codeOptions", {});
|
|
@@ -7760,7 +7766,8 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
7760
7766
|
renderSlot(_ctx.$slots, "page-bar", {}, () => [
|
|
7761
7767
|
createVNode(_sfc_main$t, {
|
|
7762
7768
|
"disabled-page-fragment": _ctx.disabledPageFragment,
|
|
7763
|
-
"page-bar-sort-options": _ctx.pageBarSortOptions
|
|
7769
|
+
"page-bar-sort-options": _ctx.pageBarSortOptions,
|
|
7770
|
+
"filter-function": _ctx.pageFilterFunction
|
|
7764
7771
|
}, {
|
|
7765
7772
|
"page-bar-add-button": withCtx(() => [
|
|
7766
7773
|
renderSlot(_ctx.$slots, "page-bar-add-button")
|
|
@@ -7775,7 +7782,7 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
|
7775
7782
|
renderSlot(_ctx.$slots, "page-list-popover", { list })
|
|
7776
7783
|
]),
|
|
7777
7784
|
_: 3
|
|
7778
|
-
}, 8, ["disabled-page-fragment", "page-bar-sort-options"])
|
|
7785
|
+
}, 8, ["disabled-page-fragment", "page-bar-sort-options", "filter-function"])
|
|
7779
7786
|
])
|
|
7780
7787
|
]),
|
|
7781
7788
|
_: 2
|
|
@@ -11649,7 +11656,9 @@ class Dep extends BaseService {
|
|
|
11649
11656
|
this.emit("collected", nodes, deep);
|
|
11650
11657
|
}
|
|
11651
11658
|
collectIdle(nodes, depExtendedData = {}, deep = false, type) {
|
|
11659
|
+
let startTask = false;
|
|
11652
11660
|
this.watcher.collectByCallback(nodes, type, ({ node, target }) => {
|
|
11661
|
+
startTask = true;
|
|
11653
11662
|
idleTask.enqueueTask(
|
|
11654
11663
|
({ node: node2, deep: deep2, target: target2 }) => {
|
|
11655
11664
|
this.collectNode(node2, target2, depExtendedData, deep2);
|
|
@@ -11662,6 +11671,11 @@ class Dep extends BaseService {
|
|
|
11662
11671
|
);
|
|
11663
11672
|
});
|
|
11664
11673
|
return new Promise((resolve) => {
|
|
11674
|
+
if (!startTask) {
|
|
11675
|
+
this.emit("collected", nodes, deep);
|
|
11676
|
+
resolve();
|
|
11677
|
+
return;
|
|
11678
|
+
}
|
|
11665
11679
|
idleTask.once("finish", () => {
|
|
11666
11680
|
this.emit("collected", nodes, deep);
|
|
11667
11681
|
resolve();
|
|
@@ -12523,7 +12537,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12523
12537
|
isContainer: { type: Function },
|
|
12524
12538
|
customContentMenu: { type: Function },
|
|
12525
12539
|
extendFormState: { type: Function },
|
|
12526
|
-
pageBarSortOptions: {}
|
|
12540
|
+
pageBarSortOptions: {},
|
|
12541
|
+
pageFilterFunction: { type: Function }
|
|
12527
12542
|
}, defaultEditorProps),
|
|
12528
12543
|
emits: ["props-panel-mounted", "update:modelValue", "props-form-error", "props-submit-error"],
|
|
12529
12544
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -12572,7 +12587,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12572
12587
|
return (_ctx, _cache) => {
|
|
12573
12588
|
return openBlock(), createBlock(_sfc_main$r, {
|
|
12574
12589
|
"disabled-page-fragment": _ctx.disabledPageFragment,
|
|
12575
|
-
"page-bar-sort-options": _ctx.pageBarSortOptions
|
|
12590
|
+
"page-bar-sort-options": _ctx.pageBarSortOptions,
|
|
12591
|
+
"page-filter-function": _ctx.pageFilterFunction
|
|
12576
12592
|
}, {
|
|
12577
12593
|
header: withCtx(() => [
|
|
12578
12594
|
renderSlot(_ctx.$slots, "header")
|
|
@@ -12698,7 +12714,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
12698
12714
|
renderSlot(_ctx.$slots, "page-list-popover", { list })
|
|
12699
12715
|
]),
|
|
12700
12716
|
_: 3
|
|
12701
|
-
}, 8, ["disabled-page-fragment", "page-bar-sort-options"]);
|
|
12717
|
+
}, 8, ["disabled-page-fragment", "page-bar-sort-options", "page-filter-function"]);
|
|
12702
12718
|
};
|
|
12703
12719
|
}
|
|
12704
12720
|
});
|
|
@@ -7420,7 +7420,9 @@
|
|
|
7420
7420
|
},
|
|
7421
7421
|
{
|
|
7422
7422
|
name: "keyword",
|
|
7423
|
-
|
|
7423
|
+
type: "text",
|
|
7424
|
+
placeholder: "请输入关键字",
|
|
7425
|
+
clearable: true
|
|
7424
7426
|
}
|
|
7425
7427
|
]);
|
|
7426
7428
|
const visible = vue.ref(false);
|
|
@@ -7445,6 +7447,7 @@
|
|
|
7445
7447
|
inline: true,
|
|
7446
7448
|
config: vue.unref(formConfig),
|
|
7447
7449
|
"init-values": query.value,
|
|
7450
|
+
"prevent-submit-default": true,
|
|
7448
7451
|
onChange: onFormChange
|
|
7449
7452
|
}, null, 8, ["config", "init-values"])) : vue.createCommentVNode("", true)
|
|
7450
7453
|
])) : vue.createCommentVNode("", true)
|
|
@@ -7464,9 +7467,11 @@
|
|
|
7464
7467
|
__name: "PageBar",
|
|
7465
7468
|
props: {
|
|
7466
7469
|
disabledPageFragment: { type: Boolean },
|
|
7467
|
-
pageBarSortOptions: {}
|
|
7470
|
+
pageBarSortOptions: {},
|
|
7471
|
+
filterFunction: { type: Function, default: (page, keyword) => page.name?.includes(keyword) || `${page.id}`.includes(keyword) }
|
|
7468
7472
|
},
|
|
7469
7473
|
setup(__props) {
|
|
7474
|
+
const props = __props;
|
|
7470
7475
|
const services = vue.inject("services");
|
|
7471
7476
|
const editorService = services?.editorService;
|
|
7472
7477
|
const root = vue.computed(() => editorService?.get("root"));
|
|
@@ -7483,7 +7488,7 @@
|
|
|
7483
7488
|
return (root.value?.items || []).filter((item) => {
|
|
7484
7489
|
if (pageType.includes(item.type)) {
|
|
7485
7490
|
if (keyword) {
|
|
7486
|
-
return
|
|
7491
|
+
return props.filterFunction(item, keyword);
|
|
7487
7492
|
}
|
|
7488
7493
|
return true;
|
|
7489
7494
|
}
|
|
@@ -7650,7 +7655,8 @@
|
|
|
7650
7655
|
__name: "Framework",
|
|
7651
7656
|
props: {
|
|
7652
7657
|
disabledPageFragment: { type: Boolean },
|
|
7653
|
-
pageBarSortOptions: {}
|
|
7658
|
+
pageBarSortOptions: {},
|
|
7659
|
+
pageFilterFunction: { type: Function }
|
|
7654
7660
|
},
|
|
7655
7661
|
setup(__props) {
|
|
7656
7662
|
const codeOptions = vue.inject("codeOptions", {});
|
|
@@ -7757,7 +7763,8 @@
|
|
|
7757
7763
|
vue.renderSlot(_ctx.$slots, "page-bar", {}, () => [
|
|
7758
7764
|
vue.createVNode(_sfc_main$t, {
|
|
7759
7765
|
"disabled-page-fragment": _ctx.disabledPageFragment,
|
|
7760
|
-
"page-bar-sort-options": _ctx.pageBarSortOptions
|
|
7766
|
+
"page-bar-sort-options": _ctx.pageBarSortOptions,
|
|
7767
|
+
"filter-function": _ctx.pageFilterFunction
|
|
7761
7768
|
}, {
|
|
7762
7769
|
"page-bar-add-button": vue.withCtx(() => [
|
|
7763
7770
|
vue.renderSlot(_ctx.$slots, "page-bar-add-button")
|
|
@@ -7772,7 +7779,7 @@
|
|
|
7772
7779
|
vue.renderSlot(_ctx.$slots, "page-list-popover", { list })
|
|
7773
7780
|
]),
|
|
7774
7781
|
_: 3
|
|
7775
|
-
}, 8, ["disabled-page-fragment", "page-bar-sort-options"])
|
|
7782
|
+
}, 8, ["disabled-page-fragment", "page-bar-sort-options", "filter-function"])
|
|
7776
7783
|
])
|
|
7777
7784
|
]),
|
|
7778
7785
|
_: 2
|
|
@@ -11646,7 +11653,9 @@
|
|
|
11646
11653
|
this.emit("collected", nodes, deep);
|
|
11647
11654
|
}
|
|
11648
11655
|
collectIdle(nodes, depExtendedData = {}, deep = false, type) {
|
|
11656
|
+
let startTask = false;
|
|
11649
11657
|
this.watcher.collectByCallback(nodes, type, ({ node, target }) => {
|
|
11658
|
+
startTask = true;
|
|
11650
11659
|
idleTask.enqueueTask(
|
|
11651
11660
|
({ node: node2, deep: deep2, target: target2 }) => {
|
|
11652
11661
|
this.collectNode(node2, target2, depExtendedData, deep2);
|
|
@@ -11659,6 +11668,11 @@
|
|
|
11659
11668
|
);
|
|
11660
11669
|
});
|
|
11661
11670
|
return new Promise((resolve) => {
|
|
11671
|
+
if (!startTask) {
|
|
11672
|
+
this.emit("collected", nodes, deep);
|
|
11673
|
+
resolve();
|
|
11674
|
+
return;
|
|
11675
|
+
}
|
|
11662
11676
|
idleTask.once("finish", () => {
|
|
11663
11677
|
this.emit("collected", nodes, deep);
|
|
11664
11678
|
resolve();
|
|
@@ -12520,7 +12534,8 @@
|
|
|
12520
12534
|
isContainer: { type: Function },
|
|
12521
12535
|
customContentMenu: { type: Function },
|
|
12522
12536
|
extendFormState: { type: Function },
|
|
12523
|
-
pageBarSortOptions: {}
|
|
12537
|
+
pageBarSortOptions: {},
|
|
12538
|
+
pageFilterFunction: { type: Function }
|
|
12524
12539
|
}, defaultEditorProps),
|
|
12525
12540
|
emits: ["props-panel-mounted", "update:modelValue", "props-form-error", "props-submit-error"],
|
|
12526
12541
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
@@ -12569,7 +12584,8 @@
|
|
|
12569
12584
|
return (_ctx, _cache) => {
|
|
12570
12585
|
return vue.openBlock(), vue.createBlock(_sfc_main$r, {
|
|
12571
12586
|
"disabled-page-fragment": _ctx.disabledPageFragment,
|
|
12572
|
-
"page-bar-sort-options": _ctx.pageBarSortOptions
|
|
12587
|
+
"page-bar-sort-options": _ctx.pageBarSortOptions,
|
|
12588
|
+
"page-filter-function": _ctx.pageFilterFunction
|
|
12573
12589
|
}, {
|
|
12574
12590
|
header: vue.withCtx(() => [
|
|
12575
12591
|
vue.renderSlot(_ctx.$slots, "header")
|
|
@@ -12695,7 +12711,7 @@
|
|
|
12695
12711
|
vue.renderSlot(_ctx.$slots, "page-list-popover", { list })
|
|
12696
12712
|
]),
|
|
12697
12713
|
_: 3
|
|
12698
|
-
}, 8, ["disabled-page-fragment", "page-bar-sort-options"]);
|
|
12714
|
+
}, 8, ["disabled-page-fragment", "page-bar-sort-options", "page-filter-function"]);
|
|
12699
12715
|
};
|
|
12700
12716
|
}
|
|
12701
12717
|
});
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.5.0-beta.
|
|
2
|
+
"version": "1.5.0-beta.14",
|
|
3
3
|
"name": "@tmagic/editor",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"moveable": "^0.53.0",
|
|
57
57
|
"serialize-javascript": "^6.0.0",
|
|
58
58
|
"sortablejs": "^1.15.2",
|
|
59
|
-
"@tmagic/
|
|
60
|
-
"@tmagic/
|
|
61
|
-
"@tmagic/
|
|
62
|
-
"@tmagic/
|
|
63
|
-
"@tmagic/
|
|
59
|
+
"@tmagic/stage": "1.5.0-beta.14",
|
|
60
|
+
"@tmagic/table": "1.5.0-beta.14",
|
|
61
|
+
"@tmagic/design": "1.5.0-beta.14",
|
|
62
|
+
"@tmagic/utils": "1.5.0-beta.14",
|
|
63
|
+
"@tmagic/form": "1.5.0-beta.14"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@types/events": "^3.0.0",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"monaco-editor": "^0.48.0",
|
|
82
82
|
"typescript": "*",
|
|
83
83
|
"vue": "^3.5.0",
|
|
84
|
-
"@tmagic/core": "1.5.0-beta.
|
|
84
|
+
"@tmagic/core": "1.5.0-beta.14"
|
|
85
85
|
},
|
|
86
86
|
"peerDependenciesMeta": {
|
|
87
87
|
"typescript": {
|
package/src/Editor.vue
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Framework
|
|
2
|
+
<Framework
|
|
3
|
+
:disabled-page-fragment="disabledPageFragment"
|
|
4
|
+
:page-bar-sort-options="pageBarSortOptions"
|
|
5
|
+
:page-filter-function="pageFilterFunction"
|
|
6
|
+
>
|
|
3
7
|
<template #header>
|
|
4
8
|
<slot name="header"></slot>
|
|
5
9
|
</template>
|
package/src/editorProps.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DataSourceSchema, EventOption, Id, MApp, MNode } from '@tmagic/core';
|
|
1
|
+
import type { DataSourceSchema, EventOption, Id, MApp, MNode, MPage, MPageFragment } from '@tmagic/core';
|
|
2
2
|
import type { FormConfig, FormState } from '@tmagic/form';
|
|
3
3
|
import StageCore, {
|
|
4
4
|
CONTAINER_HIGHLIGHT_CLASS_NAME,
|
|
@@ -97,6 +97,8 @@ export interface EditorProps {
|
|
|
97
97
|
extendFormState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
98
98
|
/** 页面顺序拖拽配置参数 */
|
|
99
99
|
pageBarSortOptions?: PageBarSortOptions;
|
|
100
|
+
/** 页面搜索函数 */
|
|
101
|
+
pageFilterFunction?: (page: MPage | MPageFragment, keyword: string) => boolean;
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
export const defaultEditorProps = {
|
|
@@ -38,7 +38,11 @@
|
|
|
38
38
|
</slot>
|
|
39
39
|
|
|
40
40
|
<slot name="page-bar">
|
|
41
|
-
<PageBar
|
|
41
|
+
<PageBar
|
|
42
|
+
:disabled-page-fragment="disabledPageFragment"
|
|
43
|
+
:page-bar-sort-options="pageBarSortOptions"
|
|
44
|
+
:filter-function="pageFilterFunction"
|
|
45
|
+
>
|
|
42
46
|
<template #page-bar-add-button><slot name="page-bar-add-button"></slot></template>
|
|
43
47
|
<template #page-bar-title="{ page }"><slot name="page-bar-title" :page="page"></slot></template>
|
|
44
48
|
<template #page-bar-popover="{ page }"><slot name="page-bar-popover" :page="page"></slot></template>
|
|
@@ -62,6 +66,7 @@
|
|
|
62
66
|
<script lang="ts" setup>
|
|
63
67
|
import { computed, inject, onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
|
64
68
|
|
|
69
|
+
import type { MPage, MPageFragment } from '@tmagic/core';
|
|
65
70
|
import { TMagicScrollbar } from '@tmagic/design';
|
|
66
71
|
|
|
67
72
|
import SplitView from '@editor/components/SplitView.vue';
|
|
@@ -81,6 +86,7 @@ defineOptions({
|
|
|
81
86
|
defineProps<{
|
|
82
87
|
disabledPageFragment: boolean;
|
|
83
88
|
pageBarSortOptions?: PageBarSortOptions;
|
|
89
|
+
pageFilterFunction?: (page: MPage | MPageFragment, keyword: string) => boolean;
|
|
84
90
|
}>();
|
|
85
91
|
|
|
86
92
|
const DEFAULT_LEFT_COLUMN_WIDTH = 310;
|
|
@@ -81,10 +81,16 @@ defineOptions({
|
|
|
81
81
|
name: 'MEditorPageBar',
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
84
|
+
const props = withDefaults(
|
|
85
|
+
defineProps<{
|
|
86
|
+
disabledPageFragment: boolean;
|
|
87
|
+
pageBarSortOptions?: PageBarSortOptions;
|
|
88
|
+
filterFunction?: (page: MPage | MPageFragment, keyword: string) => boolean;
|
|
89
|
+
}>(),
|
|
90
|
+
{
|
|
91
|
+
filterFunction: (page, keyword) => page.name?.includes(keyword) || `${page.id}`.includes(keyword),
|
|
92
|
+
},
|
|
93
|
+
);
|
|
88
94
|
|
|
89
95
|
const services = inject<Services>('services');
|
|
90
96
|
const editorService = services?.editorService;
|
|
@@ -109,7 +115,7 @@ const list = computed(() => {
|
|
|
109
115
|
return (root.value?.items || []).filter((item) => {
|
|
110
116
|
if (pageType.includes(item.type)) {
|
|
111
117
|
if (keyword) {
|
|
112
|
-
return
|
|
118
|
+
return props.filterFunction(item, keyword);
|
|
113
119
|
}
|
|
114
120
|
return true;
|
|
115
121
|
}
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
:inline="true"
|
|
9
9
|
:config="formConfig"
|
|
10
10
|
:init-values="query"
|
|
11
|
+
:prevent-submit-default="true"
|
|
11
12
|
@change="onFormChange"
|
|
12
13
|
></MForm>
|
|
13
14
|
</Teleport>
|
|
@@ -51,7 +52,9 @@ const formConfig = createForm([
|
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
name: 'keyword',
|
|
55
|
+
type: 'text',
|
|
54
56
|
placeholder: '请输入关键字',
|
|
57
|
+
clearable: true,
|
|
55
58
|
},
|
|
56
59
|
]);
|
|
57
60
|
|
package/src/services/dep.ts
CHANGED
|
@@ -79,7 +79,9 @@ class Dep extends BaseService {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
public collectIdle(nodes: MNode[], depExtendedData: DepExtendedData = {}, deep = false, type?: DepTargetType) {
|
|
82
|
+
let startTask = false;
|
|
82
83
|
this.watcher.collectByCallback(nodes, type, ({ node, target }) => {
|
|
84
|
+
startTask = true;
|
|
83
85
|
idleTask.enqueueTask(
|
|
84
86
|
({ node, deep, target }) => {
|
|
85
87
|
this.collectNode(node, target, depExtendedData, deep);
|
|
@@ -93,6 +95,11 @@ class Dep extends BaseService {
|
|
|
93
95
|
});
|
|
94
96
|
|
|
95
97
|
return new Promise<void>((resolve) => {
|
|
98
|
+
if (!startTask) {
|
|
99
|
+
this.emit('collected', nodes, deep);
|
|
100
|
+
resolve();
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
96
103
|
idleTask.once('finish', () => {
|
|
97
104
|
this.emit('collected', nodes, deep);
|
|
98
105
|
resolve();
|
package/types/index.d.ts
CHANGED
|
@@ -2564,6 +2564,8 @@ interface EditorProps {
|
|
|
2564
2564
|
extendFormState?: (state: FormState$1) => Record<string, any> | Promise<Record<string, any>>;
|
|
2565
2565
|
/** 页面顺序拖拽配置参数 */
|
|
2566
2566
|
pageBarSortOptions?: PageBarSortOptions;
|
|
2567
|
+
/** 页面搜索函数 */
|
|
2568
|
+
pageFilterFunction?: (page: MPage | MPageFragment, keyword: string) => boolean;
|
|
2567
2569
|
}
|
|
2568
2570
|
|
|
2569
2571
|
declare function __VLS_template$b(): {
|
|
@@ -2654,6 +2656,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
2654
2656
|
labelPosition?: string;
|
|
2655
2657
|
keyProp?: string;
|
|
2656
2658
|
popperClass?: string;
|
|
2659
|
+
preventSubmitDefault?: boolean;
|
|
2657
2660
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
2658
2661
|
}> & Readonly<{
|
|
2659
2662
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -2688,6 +2691,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
2688
2691
|
labelPosition?: string;
|
|
2689
2692
|
keyProp?: string;
|
|
2690
2693
|
popperClass?: string;
|
|
2694
|
+
preventSubmitDefault?: boolean;
|
|
2691
2695
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
2692
2696
|
}> & Readonly<{
|
|
2693
2697
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -2729,6 +2733,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
2729
2733
|
labelPosition?: string;
|
|
2730
2734
|
keyProp?: string;
|
|
2731
2735
|
popperClass?: string;
|
|
2736
|
+
preventSubmitDefault?: boolean;
|
|
2732
2737
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
2733
2738
|
}> & Readonly<{
|
|
2734
2739
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -2771,6 +2776,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
2771
2776
|
labelPosition?: string;
|
|
2772
2777
|
keyProp?: string;
|
|
2773
2778
|
popperClass?: string;
|
|
2779
|
+
preventSubmitDefault?: boolean;
|
|
2774
2780
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
2775
2781
|
}> & Readonly<{
|
|
2776
2782
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -2805,6 +2811,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
2805
2811
|
labelPosition?: string;
|
|
2806
2812
|
keyProp?: string;
|
|
2807
2813
|
popperClass?: string;
|
|
2814
|
+
preventSubmitDefault?: boolean;
|
|
2808
2815
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
2809
2816
|
}> & Readonly<{
|
|
2810
2817
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -2846,6 +2853,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
2846
2853
|
labelPosition?: string;
|
|
2847
2854
|
keyProp?: string;
|
|
2848
2855
|
popperClass?: string;
|
|
2856
|
+
preventSubmitDefault?: boolean;
|
|
2849
2857
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
2850
2858
|
}> & Readonly<{
|
|
2851
2859
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -2922,6 +2930,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
2922
2930
|
labelPosition?: string;
|
|
2923
2931
|
keyProp?: string;
|
|
2924
2932
|
popperClass?: string;
|
|
2933
|
+
preventSubmitDefault?: boolean;
|
|
2925
2934
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
2926
2935
|
}> & Readonly<{
|
|
2927
2936
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -2956,6 +2965,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
2956
2965
|
labelPosition?: string;
|
|
2957
2966
|
keyProp?: string;
|
|
2958
2967
|
popperClass?: string;
|
|
2968
|
+
preventSubmitDefault?: boolean;
|
|
2959
2969
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
2960
2970
|
}> & Readonly<{
|
|
2961
2971
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -2997,6 +3007,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
2997
3007
|
labelPosition?: string;
|
|
2998
3008
|
keyProp?: string;
|
|
2999
3009
|
popperClass?: string;
|
|
3010
|
+
preventSubmitDefault?: boolean;
|
|
3000
3011
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3001
3012
|
}> & Readonly<{
|
|
3002
3013
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3039,6 +3050,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3039
3050
|
labelPosition?: string;
|
|
3040
3051
|
keyProp?: string;
|
|
3041
3052
|
popperClass?: string;
|
|
3053
|
+
preventSubmitDefault?: boolean;
|
|
3042
3054
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3043
3055
|
}> & Readonly<{
|
|
3044
3056
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3073,6 +3085,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3073
3085
|
labelPosition?: string;
|
|
3074
3086
|
keyProp?: string;
|
|
3075
3087
|
popperClass?: string;
|
|
3088
|
+
preventSubmitDefault?: boolean;
|
|
3076
3089
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3077
3090
|
}> & Readonly<{
|
|
3078
3091
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3114,6 +3127,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3114
3127
|
labelPosition?: string;
|
|
3115
3128
|
keyProp?: string;
|
|
3116
3129
|
popperClass?: string;
|
|
3130
|
+
preventSubmitDefault?: boolean;
|
|
3117
3131
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3118
3132
|
}> & Readonly<{
|
|
3119
3133
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3205,6 +3219,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3205
3219
|
labelPosition?: string;
|
|
3206
3220
|
keyProp?: string;
|
|
3207
3221
|
popperClass?: string;
|
|
3222
|
+
preventSubmitDefault?: boolean;
|
|
3208
3223
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3209
3224
|
}> & Readonly<{
|
|
3210
3225
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3239,6 +3254,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3239
3254
|
labelPosition?: string;
|
|
3240
3255
|
keyProp?: string;
|
|
3241
3256
|
popperClass?: string;
|
|
3257
|
+
preventSubmitDefault?: boolean;
|
|
3242
3258
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3243
3259
|
}> & Readonly<{
|
|
3244
3260
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3280,6 +3296,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3280
3296
|
labelPosition?: string;
|
|
3281
3297
|
keyProp?: string;
|
|
3282
3298
|
popperClass?: string;
|
|
3299
|
+
preventSubmitDefault?: boolean;
|
|
3283
3300
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3284
3301
|
}> & Readonly<{
|
|
3285
3302
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3322,6 +3339,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3322
3339
|
labelPosition?: string;
|
|
3323
3340
|
keyProp?: string;
|
|
3324
3341
|
popperClass?: string;
|
|
3342
|
+
preventSubmitDefault?: boolean;
|
|
3325
3343
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3326
3344
|
}> & Readonly<{
|
|
3327
3345
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3356,6 +3374,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3356
3374
|
labelPosition?: string;
|
|
3357
3375
|
keyProp?: string;
|
|
3358
3376
|
popperClass?: string;
|
|
3377
|
+
preventSubmitDefault?: boolean;
|
|
3359
3378
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3360
3379
|
}> & Readonly<{
|
|
3361
3380
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3397,6 +3416,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3397
3416
|
labelPosition?: string;
|
|
3398
3417
|
keyProp?: string;
|
|
3399
3418
|
popperClass?: string;
|
|
3419
|
+
preventSubmitDefault?: boolean;
|
|
3400
3420
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3401
3421
|
}> & Readonly<{
|
|
3402
3422
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3473,6 +3493,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3473
3493
|
labelPosition?: string;
|
|
3474
3494
|
keyProp?: string;
|
|
3475
3495
|
popperClass?: string;
|
|
3496
|
+
preventSubmitDefault?: boolean;
|
|
3476
3497
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3477
3498
|
}> & Readonly<{
|
|
3478
3499
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3507,6 +3528,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3507
3528
|
labelPosition?: string;
|
|
3508
3529
|
keyProp?: string;
|
|
3509
3530
|
popperClass?: string;
|
|
3531
|
+
preventSubmitDefault?: boolean;
|
|
3510
3532
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3511
3533
|
}> & Readonly<{
|
|
3512
3534
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3548,6 +3570,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3548
3570
|
labelPosition?: string;
|
|
3549
3571
|
keyProp?: string;
|
|
3550
3572
|
popperClass?: string;
|
|
3573
|
+
preventSubmitDefault?: boolean;
|
|
3551
3574
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3552
3575
|
}> & Readonly<{
|
|
3553
3576
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3590,6 +3613,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3590
3613
|
labelPosition?: string;
|
|
3591
3614
|
keyProp?: string;
|
|
3592
3615
|
popperClass?: string;
|
|
3616
|
+
preventSubmitDefault?: boolean;
|
|
3593
3617
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3594
3618
|
}> & Readonly<{
|
|
3595
3619
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3624,6 +3648,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3624
3648
|
labelPosition?: string;
|
|
3625
3649
|
keyProp?: string;
|
|
3626
3650
|
popperClass?: string;
|
|
3651
|
+
preventSubmitDefault?: boolean;
|
|
3627
3652
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3628
3653
|
}> & Readonly<{
|
|
3629
3654
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -3665,6 +3690,7 @@ declare const __VLS_component$b: vue.DefineComponent<EditorProps, {
|
|
|
3665
3690
|
labelPosition?: string;
|
|
3666
3691
|
keyProp?: string;
|
|
3667
3692
|
popperClass?: string;
|
|
3693
|
+
preventSubmitDefault?: boolean;
|
|
3668
3694
|
extendState?: (state: FormState) => Record<string, any> | Promise<Record<string, any>>;
|
|
3669
3695
|
}> & Readonly<{
|
|
3670
3696
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -4324,6 +4350,7 @@ declare function __VLS_template$6(): {
|
|
|
4324
4350
|
labelPosition?: string;
|
|
4325
4351
|
keyProp?: string;
|
|
4326
4352
|
popperClass?: string;
|
|
4353
|
+
preventSubmitDefault?: boolean;
|
|
4327
4354
|
extendState?: (state: FormState$1) => Record<string, any> | Promise<Record<string, any>>;
|
|
4328
4355
|
}> & Readonly<{
|
|
4329
4356
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -4358,6 +4385,7 @@ declare function __VLS_template$6(): {
|
|
|
4358
4385
|
labelPosition?: string;
|
|
4359
4386
|
keyProp?: string;
|
|
4360
4387
|
popperClass?: string;
|
|
4388
|
+
preventSubmitDefault?: boolean;
|
|
4361
4389
|
extendState?: (state: FormState$1) => Record<string, any> | Promise<Record<string, any>>;
|
|
4362
4390
|
}> & Readonly<{
|
|
4363
4391
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -4399,6 +4427,7 @@ declare function __VLS_template$6(): {
|
|
|
4399
4427
|
labelPosition?: string;
|
|
4400
4428
|
keyProp?: string;
|
|
4401
4429
|
popperClass?: string;
|
|
4430
|
+
preventSubmitDefault?: boolean;
|
|
4402
4431
|
extendState?: (state: FormState$1) => Record<string, any> | Promise<Record<string, any>>;
|
|
4403
4432
|
}> & Readonly<{
|
|
4404
4433
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -4450,6 +4479,7 @@ declare const __VLS_component$6: vue.DefineComponent<{
|
|
|
4450
4479
|
labelPosition?: string;
|
|
4451
4480
|
keyProp?: string;
|
|
4452
4481
|
popperClass?: string;
|
|
4482
|
+
preventSubmitDefault?: boolean;
|
|
4453
4483
|
extendState?: (state: FormState$1) => Record<string, any> | Promise<Record<string, any>>;
|
|
4454
4484
|
}> & Readonly<{
|
|
4455
4485
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -4484,6 +4514,7 @@ declare const __VLS_component$6: vue.DefineComponent<{
|
|
|
4484
4514
|
labelPosition?: string;
|
|
4485
4515
|
keyProp?: string;
|
|
4486
4516
|
popperClass?: string;
|
|
4517
|
+
preventSubmitDefault?: boolean;
|
|
4487
4518
|
extendState?: (state: FormState$1) => Record<string, any> | Promise<Record<string, any>>;
|
|
4488
4519
|
}> & Readonly<{
|
|
4489
4520
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -4525,6 +4556,7 @@ declare const __VLS_component$6: vue.DefineComponent<{
|
|
|
4525
4556
|
labelPosition?: string;
|
|
4526
4557
|
keyProp?: string;
|
|
4527
4558
|
popperClass?: string;
|
|
4559
|
+
preventSubmitDefault?: boolean;
|
|
4528
4560
|
extendState?: (state: FormState$1) => Record<string, any> | Promise<Record<string, any>>;
|
|
4529
4561
|
}> & Readonly<{
|
|
4530
4562
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -4567,6 +4599,7 @@ declare const __VLS_component$6: vue.DefineComponent<{
|
|
|
4567
4599
|
labelPosition?: string;
|
|
4568
4600
|
keyProp?: string;
|
|
4569
4601
|
popperClass?: string;
|
|
4602
|
+
preventSubmitDefault?: boolean;
|
|
4570
4603
|
extendState?: (state: FormState$1) => Record<string, any> | Promise<Record<string, any>>;
|
|
4571
4604
|
}> & Readonly<{
|
|
4572
4605
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -4601,6 +4634,7 @@ declare const __VLS_component$6: vue.DefineComponent<{
|
|
|
4601
4634
|
labelPosition?: string;
|
|
4602
4635
|
keyProp?: string;
|
|
4603
4636
|
popperClass?: string;
|
|
4637
|
+
preventSubmitDefault?: boolean;
|
|
4604
4638
|
extendState?: (state: FormState$1) => Record<string, any> | Promise<Record<string, any>>;
|
|
4605
4639
|
}> & Readonly<{
|
|
4606
4640
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
@@ -4642,6 +4676,7 @@ declare const __VLS_component$6: vue.DefineComponent<{
|
|
|
4642
4676
|
labelPosition?: string;
|
|
4643
4677
|
keyProp?: string;
|
|
4644
4678
|
popperClass?: string;
|
|
4679
|
+
preventSubmitDefault?: boolean;
|
|
4645
4680
|
extendState?: (state: FormState$1) => Record<string, any> | Promise<Record<string, any>>;
|
|
4646
4681
|
}> & Readonly<{
|
|
4647
4682
|
onChange?: ((...args: any[]) => any) | undefined;
|