@tmagic/editor 1.4.12 → 1.4.13
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 +10 -4
- package/dist/tmagic-editor.umd.cjs +10 -4
- package/package.json +9 -9
- package/src/fields/DisplayConds.vue +12 -2
- package/src/type.ts +2 -2
- package/types/fields/DisplayConds.vue.d.ts +7 -2
- package/types/type.d.ts +2 -2
package/dist/tmagic-editor.js
CHANGED
|
@@ -5625,7 +5625,9 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
5625
5625
|
size: {},
|
|
5626
5626
|
lastValues: {}
|
|
5627
5627
|
},
|
|
5628
|
-
|
|
5628
|
+
emits: ["change"],
|
|
5629
|
+
setup(__props, { emit: __emit }) {
|
|
5630
|
+
const emit = __emit;
|
|
5629
5631
|
const props = __props;
|
|
5630
5632
|
const { dataSourceService } = inject("services") || {};
|
|
5631
5633
|
const mForm = inject("mForm");
|
|
@@ -5672,12 +5674,12 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
5672
5674
|
type: "cond-op-select",
|
|
5673
5675
|
parentFields: parentFields.value,
|
|
5674
5676
|
label: "条件",
|
|
5675
|
-
width:
|
|
5677
|
+
width: 160,
|
|
5676
5678
|
name: "op"
|
|
5677
5679
|
},
|
|
5678
5680
|
{
|
|
5679
5681
|
label: "值",
|
|
5680
|
-
width:
|
|
5682
|
+
width: 160,
|
|
5681
5683
|
items: [
|
|
5682
5684
|
{
|
|
5683
5685
|
name: "value",
|
|
@@ -5716,6 +5718,9 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
5716
5718
|
}
|
|
5717
5719
|
]
|
|
5718
5720
|
}));
|
|
5721
|
+
const changeHandler = (v) => {
|
|
5722
|
+
emit("change", v);
|
|
5723
|
+
};
|
|
5719
5724
|
return (_ctx, _cache) => {
|
|
5720
5725
|
return openBlock(), createBlock(unref(MGroupList), {
|
|
5721
5726
|
style: { "width": "100%" },
|
|
@@ -5725,7 +5730,8 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
5725
5730
|
model: _ctx.model,
|
|
5726
5731
|
"last-values": _ctx.lastValues,
|
|
5727
5732
|
prop: _ctx.prop,
|
|
5728
|
-
size: _ctx.size
|
|
5733
|
+
size: _ctx.size,
|
|
5734
|
+
onChange: changeHandler
|
|
5729
5735
|
}, null, 8, ["config", "name", "disabled", "model", "last-values", "prop", "size"]);
|
|
5730
5736
|
};
|
|
5731
5737
|
}
|
|
@@ -5629,7 +5629,9 @@
|
|
|
5629
5629
|
size: {},
|
|
5630
5630
|
lastValues: {}
|
|
5631
5631
|
},
|
|
5632
|
-
|
|
5632
|
+
emits: ["change"],
|
|
5633
|
+
setup(__props, { emit: __emit }) {
|
|
5634
|
+
const emit = __emit;
|
|
5633
5635
|
const props = __props;
|
|
5634
5636
|
const { dataSourceService } = vue.inject("services") || {};
|
|
5635
5637
|
const mForm = vue.inject("mForm");
|
|
@@ -5676,12 +5678,12 @@
|
|
|
5676
5678
|
type: "cond-op-select",
|
|
5677
5679
|
parentFields: parentFields.value,
|
|
5678
5680
|
label: "条件",
|
|
5679
|
-
width:
|
|
5681
|
+
width: 160,
|
|
5680
5682
|
name: "op"
|
|
5681
5683
|
},
|
|
5682
5684
|
{
|
|
5683
5685
|
label: "值",
|
|
5684
|
-
width:
|
|
5686
|
+
width: 160,
|
|
5685
5687
|
items: [
|
|
5686
5688
|
{
|
|
5687
5689
|
name: "value",
|
|
@@ -5720,6 +5722,9 @@
|
|
|
5720
5722
|
}
|
|
5721
5723
|
]
|
|
5722
5724
|
}));
|
|
5725
|
+
const changeHandler = (v) => {
|
|
5726
|
+
emit("change", v);
|
|
5727
|
+
};
|
|
5723
5728
|
return (_ctx, _cache) => {
|
|
5724
5729
|
return vue.openBlock(), vue.createBlock(vue.unref(form.MGroupList), {
|
|
5725
5730
|
style: { "width": "100%" },
|
|
@@ -5729,7 +5734,8 @@
|
|
|
5729
5734
|
model: _ctx.model,
|
|
5730
5735
|
"last-values": _ctx.lastValues,
|
|
5731
5736
|
prop: _ctx.prop,
|
|
5732
|
-
size: _ctx.size
|
|
5737
|
+
size: _ctx.size,
|
|
5738
|
+
onChange: changeHandler
|
|
5733
5739
|
}, null, 8, ["config", "name", "disabled", "model", "last-values", "prop", "size"]);
|
|
5734
5740
|
};
|
|
5735
5741
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.4.
|
|
2
|
+
"version": "1.4.13",
|
|
3
3
|
"name": "@tmagic/editor",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"moveable": "^0.53.0",
|
|
56
56
|
"serialize-javascript": "^6.0.0",
|
|
57
57
|
"sortablejs": "^1.15.2",
|
|
58
|
-
"@tmagic/dep": "1.4.
|
|
59
|
-
"@tmagic/table": "1.4.
|
|
58
|
+
"@tmagic/dep": "1.4.13",
|
|
59
|
+
"@tmagic/table": "1.4.13"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/events": "^3.0.0",
|
|
@@ -78,12 +78,12 @@
|
|
|
78
78
|
"monaco-editor": "^0.48.0",
|
|
79
79
|
"typescript": "*",
|
|
80
80
|
"vue": "^3.4.27",
|
|
81
|
-
"@tmagic/
|
|
82
|
-
"@tmagic/form": "1.4.
|
|
83
|
-
"@tmagic/
|
|
84
|
-
"@tmagic/
|
|
85
|
-
"@tmagic/stage": "1.4.
|
|
86
|
-
"@tmagic/utils": "1.4.
|
|
81
|
+
"@tmagic/design": "1.4.13",
|
|
82
|
+
"@tmagic/form": "1.4.13",
|
|
83
|
+
"@tmagic/core": "1.4.13",
|
|
84
|
+
"@tmagic/schema": "1.4.13",
|
|
85
|
+
"@tmagic/stage": "1.4.13",
|
|
86
|
+
"@tmagic/utils": "1.4.13"
|
|
87
87
|
},
|
|
88
88
|
"peerDependenciesMeta": {
|
|
89
89
|
"typescript": {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
:last-values="lastValues"
|
|
9
9
|
:prop="prop"
|
|
10
10
|
:size="size"
|
|
11
|
+
@change="changeHandler"
|
|
11
12
|
></MGroupList>
|
|
12
13
|
</template>
|
|
13
14
|
|
|
@@ -22,6 +23,7 @@ import {
|
|
|
22
23
|
type GroupListConfig,
|
|
23
24
|
MGroupList,
|
|
24
25
|
} from '@tmagic/form';
|
|
26
|
+
import type { DisplayCond } from '@tmagic/schema';
|
|
25
27
|
|
|
26
28
|
import type { Services } from '@editor/type';
|
|
27
29
|
import { getCascaderOptionsFromFields } from '@editor/utils';
|
|
@@ -30,6 +32,10 @@ defineOptions({
|
|
|
30
32
|
name: 'm-fields-display-conds',
|
|
31
33
|
});
|
|
32
34
|
|
|
35
|
+
const emit = defineEmits<{
|
|
36
|
+
change: [value: DisplayCond[]];
|
|
37
|
+
}>();
|
|
38
|
+
|
|
33
39
|
const props = withDefaults(
|
|
34
40
|
defineProps<
|
|
35
41
|
FieldProps<{
|
|
@@ -93,12 +99,12 @@ const config = computed<GroupListConfig>(() => ({
|
|
|
93
99
|
type: 'cond-op-select',
|
|
94
100
|
parentFields: parentFields.value,
|
|
95
101
|
label: '条件',
|
|
96
|
-
width:
|
|
102
|
+
width: 160,
|
|
97
103
|
name: 'op',
|
|
98
104
|
},
|
|
99
105
|
{
|
|
100
106
|
label: '值',
|
|
101
|
-
width:
|
|
107
|
+
width: 160,
|
|
102
108
|
items: [
|
|
103
109
|
{
|
|
104
110
|
name: 'value',
|
|
@@ -142,4 +148,8 @@ const config = computed<GroupListConfig>(() => ({
|
|
|
142
148
|
},
|
|
143
149
|
],
|
|
144
150
|
}));
|
|
151
|
+
|
|
152
|
+
const changeHandler = (v: DisplayCond[]) => {
|
|
153
|
+
emit('change', v);
|
|
154
|
+
};
|
|
145
155
|
</script>
|
package/src/type.ts
CHANGED
|
@@ -774,7 +774,7 @@ export type PropsFormValueFunction = (data: { editorService: EditorService }) =>
|
|
|
774
774
|
export type PartSortableOptions = Omit<Options, 'onStart' | 'onUpdate'>;
|
|
775
775
|
export interface PageBarSortOptions extends PartSortableOptions {
|
|
776
776
|
/** 在onUpdate之后调用 */
|
|
777
|
-
afterUpdate?: (event: SortableEvent, sortable: Sortable) => void
|
|
777
|
+
afterUpdate?: (event: SortableEvent, sortable: Sortable) => void | Promise<void>;
|
|
778
778
|
/** 在onStart之前调用 */
|
|
779
|
-
beforeStart?: (event: SortableEvent, sortable: Sortable) => void
|
|
779
|
+
beforeStart?: (event: SortableEvent, sortable: Sortable) => void | Promise<void>;
|
|
780
780
|
}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
import { type FieldProps, type FilterFunction } from '@tmagic/form';
|
|
2
|
+
import type { DisplayCond } from '@tmagic/schema';
|
|
2
3
|
declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<FieldProps<{
|
|
3
4
|
titlePrefix?: string | undefined;
|
|
4
5
|
parentFields?: string[] | FilterFunction<string[]> | undefined;
|
|
5
6
|
}>>, {
|
|
6
7
|
disabled: boolean;
|
|
7
|
-
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
8
|
+
}>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
9
|
+
change: (value: DisplayCond[]) => void;
|
|
10
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<FieldProps<{
|
|
8
11
|
titlePrefix?: string | undefined;
|
|
9
12
|
parentFields?: string[] | FilterFunction<string[]> | undefined;
|
|
10
13
|
}>>, {
|
|
11
14
|
disabled: boolean;
|
|
12
|
-
}
|
|
15
|
+
}>>> & {
|
|
16
|
+
onChange?: ((value: DisplayCond[]) => any) | undefined;
|
|
17
|
+
}, {
|
|
13
18
|
disabled: boolean;
|
|
14
19
|
}, {}>;
|
|
15
20
|
export default _default;
|
package/types/type.d.ts
CHANGED
|
@@ -645,7 +645,7 @@ export type PropsFormValueFunction = (data: {
|
|
|
645
645
|
export type PartSortableOptions = Omit<Options, 'onStart' | 'onUpdate'>;
|
|
646
646
|
export interface PageBarSortOptions extends PartSortableOptions {
|
|
647
647
|
/** 在onUpdate之后调用 */
|
|
648
|
-
afterUpdate?: (event: SortableEvent, sortable: Sortable) => void
|
|
648
|
+
afterUpdate?: (event: SortableEvent, sortable: Sortable) => void | Promise<void>;
|
|
649
649
|
/** 在onStart之前调用 */
|
|
650
|
-
beforeStart?: (event: SortableEvent, sortable: Sortable) => void
|
|
650
|
+
beforeStart?: (event: SortableEvent, sortable: Sortable) => void | Promise<void>;
|
|
651
651
|
}
|