@tmagic/editor 1.8.0-beta.0 → 1.8.0-beta.1
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/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +11 -2
- package/dist/es/fields/StyleSetter/Index.vue_vue_type_script_setup_true_lang.js +8 -2
- package/dist/es/fields/StyleSetter/components/Border.vue_vue_type_script_setup_true_lang.js +10 -2
- package/dist/es/fields/StyleSetter/components/Box.vue_vue_type_script_setup_true_lang.js +3 -1
- package/dist/es/fields/StyleSetter/pro/Background.vue_vue_type_script_setup_true_lang.js +10 -2
- package/dist/es/fields/StyleSetter/pro/Border.vue_vue_type_script_setup_true_lang.js +16 -3
- package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +10 -2
- package/dist/es/fields/StyleSetter/pro/Layout.vue_vue_type_script_setup_true_lang.js +14 -2
- package/dist/es/fields/StyleSetter/pro/Position.vue_vue_type_script_setup_true_lang.js +10 -2
- package/dist/es/fields/StyleSetter/pro/Transform.vue_vue_type_script_setup_true_lang.js +10 -2
- package/dist/es/layouts/sidebar/layer/use-node-status.js +37 -3
- package/dist/es/utils/editor.js +1 -1
- package/dist/tmagic-editor.umd.cjs +140 -24
- package/package.json +7 -7
- package/src/fields/DataSourceFieldSelect/Index.vue +8 -1
- package/src/fields/StyleSetter/Index.vue +6 -0
- package/src/fields/StyleSetter/components/Border.vue +15 -1
- package/src/fields/StyleSetter/components/Box.vue +2 -0
- package/src/fields/StyleSetter/pro/Background.vue +15 -1
- package/src/fields/StyleSetter/pro/Border.vue +24 -2
- package/src/fields/StyleSetter/pro/Font.vue +15 -1
- package/src/fields/StyleSetter/pro/Layout.vue +17 -1
- package/src/fields/StyleSetter/pro/Position.vue +15 -1
- package/src/fields/StyleSetter/pro/Transform.vue +15 -1
- package/src/layouts/sidebar/layer/use-node-status.ts +55 -6
- package/src/utils/editor.ts +4 -1
- package/types/index.d.ts +2 -0
|
@@ -5397,7 +5397,7 @@
|
|
|
5397
5397
|
var serializeConfig = (config) => (0, serialize_javascript.default)(config, {
|
|
5398
5398
|
space: 2,
|
|
5399
5399
|
unsafe: true
|
|
5400
|
-
}).replace(/"(\w+)":\s/g, "$1: ");
|
|
5400
|
+
}).replace(/(^|\n)(\s*)"(\w+)":\s/g, "$1$2$3: ");
|
|
5401
5401
|
var moveItemsInContainer = (sourceIndices, parent, targetIndex) => {
|
|
5402
5402
|
sourceIndices.sort((a, b) => a - b);
|
|
5403
5403
|
for (let i = sourceIndices.length - 1; i >= 0; i--) {
|
|
@@ -11759,10 +11759,43 @@
|
|
|
11759
11759
|
const nodeStatusMaps = (0, vue.ref)(/* @__PURE__ */ new Map());
|
|
11760
11760
|
/** 当前页面的节点状态 */
|
|
11761
11761
|
const nodeStatusMap = (0, vue.computed)(() => page.value ? nodeStatusMaps.value.get(page.value.id) : /* @__PURE__ */ new Map());
|
|
11762
|
-
(0, vue.watch)(
|
|
11763
|
-
if (!
|
|
11764
|
-
nodeStatusMaps.value.set(
|
|
11762
|
+
(0, vue.watch)(page, (newPage) => {
|
|
11763
|
+
if (!newPage?.id) return;
|
|
11764
|
+
nodeStatusMaps.value.set(newPage.id, createPageNodeStatus(newPage, nodeStatusMaps.value.get(newPage.id)));
|
|
11765
11765
|
}, { immediate: true });
|
|
11766
|
+
/**
|
|
11767
|
+
* root 整体被替换时(外部 modelValue 变化、历史版本恢复、套件编辑模式进入/退出等):
|
|
11768
|
+
* - 仅 watch page 引用还不够,因为 root-change 同步触发时 page 还是旧引用,
|
|
11769
|
+
* 等 initService 的异步 IIFE 跑完 editorService.select(...) 后 page 才会
|
|
11770
|
+
* 被替换为新 dsl 中的 page;此时上面的 page watch 才会触发重建。
|
|
11771
|
+
* - 但若直接同步清空 nodeStatusMaps,会让 nodeStatusMap (computed) 立刻变
|
|
11772
|
+
* undefined。上层 LayerPanel 用 `v-if="page && nodeStatusMap"` 渲染组件树,
|
|
11773
|
+
* 会瞬间销毁整个面板;若紧接着的异步 select 链路(套件退出等场景)发生
|
|
11774
|
+
* 竞态、page 引用未变 / 解析失败,watch(page) 不触发重建,组件树就再也回
|
|
11775
|
+
* 不来。
|
|
11776
|
+
* - 此外「污染」问题本质来自 createPageNodeStatus 用旧 status 作为新节点
|
|
11777
|
+
* initial 值:只要新 root 的 page 是新引用,watch(page) 会触发重建,重建
|
|
11778
|
+
* 时基于新 page.items 生成的 map 只会包含新节点 id;旧节点 id 即便残留在
|
|
11779
|
+
* initialLayerNodeStatus 中也不会被写入新 map。真正的风险只有「同一 page
|
|
11780
|
+
* id 下,新旧 dsl 都存在同一节点 id 但其实是不同节点」这种极端情况——这
|
|
11781
|
+
* 在常规业务中不会发生(id 是 uuid)。
|
|
11782
|
+
*
|
|
11783
|
+
* 综合:root-change 时仅清理「在新 root 中已不存在的 page id」对应缓存,
|
|
11784
|
+
* 保留仍然有效的 page status 不动;既避免 v-if 闪断,也不会保留无关 page 的
|
|
11785
|
+
* 死缓存。同 page id 的重建交给下方 watch(page) 触发。
|
|
11786
|
+
*/
|
|
11787
|
+
const rootChangeHandler = (value) => {
|
|
11788
|
+
if (!value) {
|
|
11789
|
+
nodeStatusMaps.value = /* @__PURE__ */ new Map();
|
|
11790
|
+
return;
|
|
11791
|
+
}
|
|
11792
|
+
const validPageIds = /* @__PURE__ */ new Set();
|
|
11793
|
+
(value.items || []).forEach((p) => {
|
|
11794
|
+
if (p?.id !== void 0) validPageIds.add(p.id);
|
|
11795
|
+
});
|
|
11796
|
+
for (const cachedPageId of Array.from(nodeStatusMaps.value.keys())) if (!validPageIds.has(cachedPageId)) nodeStatusMaps.value.delete(cachedPageId);
|
|
11797
|
+
};
|
|
11798
|
+
editorService.on("root-change", rootChangeHandler);
|
|
11766
11799
|
(0, vue.watch)(nodes, (nodes) => {
|
|
11767
11800
|
if (!nodeStatusMap.value) return;
|
|
11768
11801
|
for (const [id, status] of nodeStatusMap.value.entries()) {
|
|
@@ -11795,6 +11828,7 @@
|
|
|
11795
11828
|
};
|
|
11796
11829
|
editorService.on("remove", removeHandler);
|
|
11797
11830
|
(0, vue.onBeforeUnmount)(() => {
|
|
11831
|
+
editorService.off("root-change", rootChangeHandler);
|
|
11798
11832
|
editorService.off("remove", removeHandler);
|
|
11799
11833
|
editorService.off("add", addHandler);
|
|
11800
11834
|
});
|
|
@@ -16785,6 +16819,10 @@
|
|
|
16785
16819
|
emit("change", [dsId], eventData);
|
|
16786
16820
|
}
|
|
16787
16821
|
};
|
|
16822
|
+
const onToggleDataSourceFieldSelectHandler = () => {
|
|
16823
|
+
if (props.disabled || mForm?.isCompare) return;
|
|
16824
|
+
showDataSourceFieldSelect.value = !showDataSourceFieldSelect.value;
|
|
16825
|
+
};
|
|
16788
16826
|
return (_ctx, _cache) => {
|
|
16789
16827
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$29, [!disabledDataSource.value && (showDataSourceFieldSelect.value || !__props.config.fieldConfig) ? ((0, vue.openBlock)(), (0, vue.createBlock)(FieldSelect_default, {
|
|
16790
16828
|
key: 0,
|
|
@@ -16834,11 +16872,16 @@
|
|
|
16834
16872
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)((0, vue.unref)(_tmagic_design.TMagicButton), {
|
|
16835
16873
|
type: showDataSourceFieldSelect.value ? "primary" : "default",
|
|
16836
16874
|
size: __props.size,
|
|
16837
|
-
|
|
16875
|
+
disabled: __props.disabled || (0, vue.unref)(mForm)?.isCompare,
|
|
16876
|
+
onClick: onToggleDataSourceFieldSelectHandler
|
|
16838
16877
|
}, {
|
|
16839
16878
|
default: (0, vue.withCtx)(() => [(0, vue.createVNode)(Icon_default, { icon: (0, vue.unref)(_element_plus_icons_vue.Coin) }, null, 8, ["icon"])]),
|
|
16840
16879
|
_: 1
|
|
16841
|
-
}, 8, [
|
|
16880
|
+
}, 8, [
|
|
16881
|
+
"type",
|
|
16882
|
+
"size",
|
|
16883
|
+
"disabled"
|
|
16884
|
+
])]),
|
|
16842
16885
|
_: 1
|
|
16843
16886
|
}, 8, ["disabled"])) : (0, vue.createCommentVNode)("v-if", true)]);
|
|
16844
16887
|
};
|
|
@@ -17825,10 +17868,12 @@
|
|
|
17825
17868
|
__name: "Background",
|
|
17826
17869
|
props: {
|
|
17827
17870
|
values: {},
|
|
17871
|
+
lastValues: {},
|
|
17872
|
+
isCompare: { type: Boolean },
|
|
17828
17873
|
disabled: { type: Boolean },
|
|
17829
17874
|
size: {}
|
|
17830
17875
|
},
|
|
17831
|
-
emits: ["change"],
|
|
17876
|
+
emits: ["change", "addDiffCount"],
|
|
17832
17877
|
setup(__props, { emit: __emit }) {
|
|
17833
17878
|
const emit = __emit;
|
|
17834
17879
|
const config = (0, _tmagic_form.defineFormItem)({ items: [
|
|
@@ -17910,16 +17955,22 @@
|
|
|
17910
17955
|
const change = (value, eventData) => {
|
|
17911
17956
|
emit("change", value, eventData);
|
|
17912
17957
|
};
|
|
17958
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
17913
17959
|
return (_ctx, _cache) => {
|
|
17914
17960
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_form.MContainer), {
|
|
17915
17961
|
config: (0, vue.unref)(config),
|
|
17916
17962
|
model: __props.values,
|
|
17963
|
+
"last-values": __props.lastValues,
|
|
17964
|
+
"is-compare": __props.isCompare,
|
|
17917
17965
|
size: __props.size,
|
|
17918
17966
|
disabled: __props.disabled,
|
|
17919
|
-
onChange: change
|
|
17967
|
+
onChange: change,
|
|
17968
|
+
onAddDiffCount
|
|
17920
17969
|
}, null, 8, [
|
|
17921
17970
|
"config",
|
|
17922
17971
|
"model",
|
|
17972
|
+
"last-values",
|
|
17973
|
+
"is-compare",
|
|
17923
17974
|
"size",
|
|
17924
17975
|
"disabled"
|
|
17925
17976
|
]);
|
|
@@ -17968,10 +18019,12 @@
|
|
|
17968
18019
|
__name: "Font",
|
|
17969
18020
|
props: {
|
|
17970
18021
|
values: {},
|
|
18022
|
+
lastValues: {},
|
|
18023
|
+
isCompare: { type: Boolean },
|
|
17971
18024
|
disabled: { type: Boolean },
|
|
17972
18025
|
size: {}
|
|
17973
18026
|
},
|
|
17974
|
-
emits: ["change"],
|
|
18027
|
+
emits: ["change", "addDiffCount"],
|
|
17975
18028
|
setup(__props, { emit: __emit }) {
|
|
17976
18029
|
const emit = __emit;
|
|
17977
18030
|
const config = (0, _tmagic_form.defineFormItem)({ items: [
|
|
@@ -18039,16 +18092,22 @@
|
|
|
18039
18092
|
const change = (value, eventData) => {
|
|
18040
18093
|
emit("change", value, eventData);
|
|
18041
18094
|
};
|
|
18095
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
18042
18096
|
return (_ctx, _cache) => {
|
|
18043
18097
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_form.MContainer), {
|
|
18044
18098
|
config: (0, vue.unref)(config),
|
|
18045
18099
|
model: __props.values,
|
|
18100
|
+
"last-values": __props.lastValues,
|
|
18101
|
+
"is-compare": __props.isCompare,
|
|
18046
18102
|
size: __props.size,
|
|
18047
18103
|
disabled: __props.disabled,
|
|
18048
|
-
onChange: change
|
|
18104
|
+
onChange: change,
|
|
18105
|
+
onAddDiffCount
|
|
18049
18106
|
}, null, 8, [
|
|
18050
18107
|
"config",
|
|
18051
18108
|
"model",
|
|
18109
|
+
"last-values",
|
|
18110
|
+
"is-compare",
|
|
18052
18111
|
"size",
|
|
18053
18112
|
"disabled"
|
|
18054
18113
|
]);
|
|
@@ -18077,7 +18136,9 @@
|
|
|
18077
18136
|
props: {
|
|
18078
18137
|
disabled: { type: Boolean },
|
|
18079
18138
|
size: {},
|
|
18080
|
-
model: {}
|
|
18139
|
+
model: {},
|
|
18140
|
+
lastValues: {},
|
|
18141
|
+
isCompare: { type: Boolean }
|
|
18081
18142
|
},
|
|
18082
18143
|
emits: ["change"],
|
|
18083
18144
|
setup(__props, { emit: __emit }) {
|
|
@@ -18300,10 +18361,12 @@
|
|
|
18300
18361
|
__name: "Layout",
|
|
18301
18362
|
props: {
|
|
18302
18363
|
values: {},
|
|
18364
|
+
lastValues: {},
|
|
18365
|
+
isCompare: { type: Boolean },
|
|
18303
18366
|
disabled: { type: Boolean },
|
|
18304
18367
|
size: {}
|
|
18305
18368
|
},
|
|
18306
|
-
emits: ["change"],
|
|
18369
|
+
emits: ["change", "addDiffCount"],
|
|
18307
18370
|
setup(__props, { emit: __emit }) {
|
|
18308
18371
|
const emit = __emit;
|
|
18309
18372
|
const config = (0, _tmagic_form.defineFormItem)({ items: [
|
|
@@ -18539,25 +18602,35 @@
|
|
|
18539
18602
|
const change = (value, eventData) => {
|
|
18540
18603
|
emit("change", value, eventData);
|
|
18541
18604
|
};
|
|
18605
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
18542
18606
|
return (_ctx, _cache) => {
|
|
18543
18607
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [(0, vue.createVNode)((0, vue.unref)(_tmagic_form.MContainer), {
|
|
18544
18608
|
config: (0, vue.unref)(config),
|
|
18545
18609
|
model: __props.values,
|
|
18610
|
+
"last-values": __props.lastValues,
|
|
18611
|
+
"is-compare": __props.isCompare,
|
|
18546
18612
|
size: __props.size,
|
|
18547
18613
|
disabled: __props.disabled,
|
|
18548
|
-
onChange: change
|
|
18614
|
+
onChange: change,
|
|
18615
|
+
onAddDiffCount
|
|
18549
18616
|
}, null, 8, [
|
|
18550
18617
|
"config",
|
|
18551
18618
|
"model",
|
|
18619
|
+
"last-values",
|
|
18620
|
+
"is-compare",
|
|
18552
18621
|
"size",
|
|
18553
18622
|
"disabled"
|
|
18554
18623
|
]), (0, vue.withDirectives)((0, vue.createVNode)(Box_default, {
|
|
18555
18624
|
model: __props.values,
|
|
18625
|
+
"last-values": __props.lastValues,
|
|
18626
|
+
"is-compare": __props.isCompare,
|
|
18556
18627
|
size: __props.size,
|
|
18557
18628
|
disabled: __props.disabled,
|
|
18558
18629
|
onChange: change
|
|
18559
18630
|
}, null, 8, [
|
|
18560
18631
|
"model",
|
|
18632
|
+
"last-values",
|
|
18633
|
+
"is-compare",
|
|
18561
18634
|
"size",
|
|
18562
18635
|
"disabled"
|
|
18563
18636
|
]), [[vue.vShow, !["fixed", "absolute"].includes(__props.values.position)]])], 64);
|
|
@@ -18573,10 +18646,12 @@
|
|
|
18573
18646
|
__name: "Position",
|
|
18574
18647
|
props: {
|
|
18575
18648
|
values: {},
|
|
18649
|
+
lastValues: {},
|
|
18650
|
+
isCompare: { type: Boolean },
|
|
18576
18651
|
disabled: { type: Boolean },
|
|
18577
18652
|
size: {}
|
|
18578
18653
|
},
|
|
18579
|
-
emits: ["change"],
|
|
18654
|
+
emits: ["change", "addDiffCount"],
|
|
18580
18655
|
setup(__props, { emit: __emit }) {
|
|
18581
18656
|
const props = __props;
|
|
18582
18657
|
const emit = __emit;
|
|
@@ -18644,16 +18719,22 @@
|
|
|
18644
18719
|
const change = (value, eventData) => {
|
|
18645
18720
|
emit("change", value, eventData);
|
|
18646
18721
|
};
|
|
18722
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
18647
18723
|
return (_ctx, _cache) => {
|
|
18648
18724
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_form.MContainer), {
|
|
18649
18725
|
config: (0, vue.unref)(config),
|
|
18650
18726
|
model: __props.values,
|
|
18727
|
+
"last-values": __props.lastValues,
|
|
18728
|
+
"is-compare": __props.isCompare,
|
|
18651
18729
|
size: __props.size,
|
|
18652
18730
|
disabled: __props.disabled,
|
|
18653
|
-
onChange: change
|
|
18731
|
+
onChange: change,
|
|
18732
|
+
onAddDiffCount
|
|
18654
18733
|
}, null, 8, [
|
|
18655
18734
|
"config",
|
|
18656
18735
|
"model",
|
|
18736
|
+
"last-values",
|
|
18737
|
+
"is-compare",
|
|
18657
18738
|
"size",
|
|
18658
18739
|
"disabled"
|
|
18659
18740
|
]);
|
|
@@ -18675,10 +18756,12 @@
|
|
|
18675
18756
|
__name: "Border",
|
|
18676
18757
|
props: {
|
|
18677
18758
|
model: {},
|
|
18759
|
+
lastValues: {},
|
|
18760
|
+
isCompare: { type: Boolean },
|
|
18678
18761
|
disabled: { type: Boolean },
|
|
18679
18762
|
size: {}
|
|
18680
18763
|
},
|
|
18681
|
-
emits: ["change"],
|
|
18764
|
+
emits: ["change", "addDiffCount"],
|
|
18682
18765
|
setup(__props, { emit: __emit }) {
|
|
18683
18766
|
const direction = (0, vue.ref)("");
|
|
18684
18767
|
const config = (0, vue.computed)(() => (0, _tmagic_form.defineFormItem)({ items: [
|
|
@@ -18721,6 +18804,7 @@
|
|
|
18721
18804
|
emit("change", record.value, { modifyKey: record.propPath });
|
|
18722
18805
|
});
|
|
18723
18806
|
};
|
|
18807
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
18724
18808
|
return (_ctx, _cache) => {
|
|
18725
18809
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_1$1, [(0, vue.createElementVNode)("div", _hoisted_2, [
|
|
18726
18810
|
(0, vue.createElementVNode)("div", _hoisted_3, [(0, vue.createElementVNode)("div", {
|
|
@@ -18748,12 +18832,17 @@
|
|
|
18748
18832
|
]), (0, vue.createElementVNode)("div", _hoisted_6, [(0, vue.createVNode)((0, vue.unref)(_tmagic_form.MContainer), {
|
|
18749
18833
|
config: config.value,
|
|
18750
18834
|
model: __props.model,
|
|
18835
|
+
"last-values": __props.lastValues,
|
|
18836
|
+
"is-compare": __props.isCompare,
|
|
18751
18837
|
size: __props.size,
|
|
18752
18838
|
disabled: __props.disabled,
|
|
18753
|
-
onChange: change
|
|
18839
|
+
onChange: change,
|
|
18840
|
+
onAddDiffCount
|
|
18754
18841
|
}, null, 8, [
|
|
18755
18842
|
"config",
|
|
18756
18843
|
"model",
|
|
18844
|
+
"last-values",
|
|
18845
|
+
"is-compare",
|
|
18757
18846
|
"size",
|
|
18758
18847
|
"disabled"
|
|
18759
18848
|
])])]);
|
|
@@ -18769,10 +18858,12 @@
|
|
|
18769
18858
|
__name: "Border",
|
|
18770
18859
|
props: {
|
|
18771
18860
|
values: {},
|
|
18861
|
+
lastValues: {},
|
|
18862
|
+
isCompare: { type: Boolean },
|
|
18772
18863
|
disabled: { type: Boolean },
|
|
18773
18864
|
size: {}
|
|
18774
18865
|
},
|
|
18775
|
-
emits: ["change"],
|
|
18866
|
+
emits: ["change", "addDiffCount"],
|
|
18776
18867
|
setup(__props, { emit: __emit }) {
|
|
18777
18868
|
const emit = __emit;
|
|
18778
18869
|
const config = (0, _tmagic_form.defineFormItem)({ items: [{
|
|
@@ -18785,25 +18876,36 @@
|
|
|
18785
18876
|
const change = (value, eventData) => {
|
|
18786
18877
|
emit("change", value, eventData);
|
|
18787
18878
|
};
|
|
18879
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
18788
18880
|
return (_ctx, _cache) => {
|
|
18789
18881
|
return (0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, null, [(0, vue.createVNode)((0, vue.unref)(_tmagic_form.MContainer), {
|
|
18790
18882
|
config: (0, vue.unref)(config),
|
|
18791
18883
|
model: __props.values,
|
|
18884
|
+
"last-values": __props.lastValues,
|
|
18885
|
+
"is-compare": __props.isCompare,
|
|
18792
18886
|
size: __props.size,
|
|
18793
18887
|
disabled: __props.disabled,
|
|
18794
|
-
onChange: change
|
|
18888
|
+
onChange: change,
|
|
18889
|
+
onAddDiffCount
|
|
18795
18890
|
}, null, 8, [
|
|
18796
18891
|
"config",
|
|
18797
18892
|
"model",
|
|
18893
|
+
"last-values",
|
|
18894
|
+
"is-compare",
|
|
18798
18895
|
"size",
|
|
18799
18896
|
"disabled"
|
|
18800
18897
|
]), (0, vue.createVNode)(Border_default$1, {
|
|
18801
18898
|
model: __props.values,
|
|
18899
|
+
"last-values": __props.lastValues,
|
|
18900
|
+
"is-compare": __props.isCompare,
|
|
18802
18901
|
size: __props.size,
|
|
18803
18902
|
disabled: __props.disabled,
|
|
18804
|
-
onChange: change
|
|
18903
|
+
onChange: change,
|
|
18904
|
+
onAddDiffCount
|
|
18805
18905
|
}, null, 8, [
|
|
18806
18906
|
"model",
|
|
18907
|
+
"last-values",
|
|
18908
|
+
"is-compare",
|
|
18807
18909
|
"size",
|
|
18808
18910
|
"disabled"
|
|
18809
18911
|
])], 64);
|
|
@@ -18819,10 +18921,12 @@
|
|
|
18819
18921
|
__name: "Transform",
|
|
18820
18922
|
props: {
|
|
18821
18923
|
values: {},
|
|
18924
|
+
lastValues: {},
|
|
18925
|
+
isCompare: { type: Boolean },
|
|
18822
18926
|
disabled: { type: Boolean },
|
|
18823
18927
|
size: {}
|
|
18824
18928
|
},
|
|
18825
|
-
emits: ["change"],
|
|
18929
|
+
emits: ["change", "addDiffCount"],
|
|
18826
18930
|
setup(__props, { emit: __emit }) {
|
|
18827
18931
|
const emit = __emit;
|
|
18828
18932
|
const config = (0, _tmagic_form.defineFormItem)({ items: [{
|
|
@@ -18848,16 +18952,22 @@
|
|
|
18848
18952
|
const change = (value, eventData) => {
|
|
18849
18953
|
emit("change", value, eventData);
|
|
18850
18954
|
};
|
|
18955
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
18851
18956
|
return (_ctx, _cache) => {
|
|
18852
18957
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_form.MContainer), {
|
|
18853
18958
|
config: (0, vue.unref)(config),
|
|
18854
18959
|
model: __props.values,
|
|
18960
|
+
"last-values": __props.lastValues,
|
|
18961
|
+
"is-compare": __props.isCompare,
|
|
18855
18962
|
size: __props.size,
|
|
18856
18963
|
disabled: __props.disabled,
|
|
18857
|
-
onChange: change
|
|
18964
|
+
onChange: change,
|
|
18965
|
+
onAddDiffCount
|
|
18858
18966
|
}, null, 8, [
|
|
18859
18967
|
"config",
|
|
18860
18968
|
"model",
|
|
18969
|
+
"last-values",
|
|
18970
|
+
"is-compare",
|
|
18861
18971
|
"size",
|
|
18862
18972
|
"disabled"
|
|
18863
18973
|
]);
|
|
@@ -18884,7 +18994,7 @@
|
|
|
18884
18994
|
lastValues: {},
|
|
18885
18995
|
isCompare: { type: Boolean }
|
|
18886
18996
|
},
|
|
18887
|
-
emits: ["change"],
|
|
18997
|
+
emits: ["change", "addDiffCount"],
|
|
18888
18998
|
setup(__props, { emit: __emit }) {
|
|
18889
18999
|
const props = __props;
|
|
18890
19000
|
const emit = __emit;
|
|
@@ -18923,6 +19033,7 @@
|
|
|
18923
19033
|
});
|
|
18924
19034
|
emit("change", v, eventData);
|
|
18925
19035
|
};
|
|
19036
|
+
const onAddDiffCount = () => emit("addDiffCount");
|
|
18926
19037
|
return (_ctx, _cache) => {
|
|
18927
19038
|
return (0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(_tmagic_design.TMagicCollapse), {
|
|
18928
19039
|
class: "m-fields-style-setter",
|
|
@@ -18938,11 +19049,16 @@
|
|
|
18938
19049
|
default: (0, vue.withCtx)(() => [item.component ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.resolveDynamicComponent)(item.component), {
|
|
18939
19050
|
key: 0,
|
|
18940
19051
|
values: __props.model[__props.name],
|
|
19052
|
+
"last-values": __props.lastValues?.[__props.name],
|
|
19053
|
+
"is-compare": __props.isCompare,
|
|
18941
19054
|
size: __props.size,
|
|
18942
19055
|
disabled: __props.disabled,
|
|
18943
|
-
onChange: change
|
|
19056
|
+
onChange: change,
|
|
19057
|
+
onAddDiffCount
|
|
18944
19058
|
}, null, 40, [
|
|
18945
19059
|
"values",
|
|
19060
|
+
"last-values",
|
|
19061
|
+
"is-compare",
|
|
18946
19062
|
"size",
|
|
18947
19063
|
"disabled"
|
|
18948
19064
|
])) : (0, vue.createCommentVNode)("v-if", true)]),
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.8.0-beta.
|
|
2
|
+
"version": "1.8.0-beta.1",
|
|
3
3
|
"name": "@tmagic/editor",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": [
|
|
@@ -58,11 +58,11 @@
|
|
|
58
58
|
"moveable": "^0.53.0",
|
|
59
59
|
"serialize-javascript": "^7.0.0",
|
|
60
60
|
"sortablejs": "^1.15.6",
|
|
61
|
-
"@tmagic/design": "1.8.0-beta.
|
|
62
|
-
"@tmagic/form": "1.8.0-beta.
|
|
63
|
-
"@tmagic/stage": "1.8.0-beta.
|
|
64
|
-
"@tmagic/
|
|
65
|
-
"@tmagic/
|
|
61
|
+
"@tmagic/design": "1.8.0-beta.1",
|
|
62
|
+
"@tmagic/form": "1.8.0-beta.1",
|
|
63
|
+
"@tmagic/stage": "1.8.0-beta.1",
|
|
64
|
+
"@tmagic/table": "1.8.0-beta.1",
|
|
65
|
+
"@tmagic/utils": "1.8.0-beta.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/events": "^3.0.3",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"type-fest": "^5.2.0",
|
|
77
77
|
"typescript": "^6.0.3",
|
|
78
78
|
"vue": "^3.5.34",
|
|
79
|
-
"@tmagic/core": "1.8.0-beta.
|
|
79
|
+
"@tmagic/core": "1.8.0-beta.1"
|
|
80
80
|
},
|
|
81
81
|
"peerDependenciesMeta": {
|
|
82
82
|
"typescript": {
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
<TMagicButton
|
|
36
36
|
:type="showDataSourceFieldSelect ? 'primary' : 'default'"
|
|
37
37
|
:size="size"
|
|
38
|
-
|
|
38
|
+
:disabled="disabled || mForm?.isCompare"
|
|
39
|
+
@click="onToggleDataSourceFieldSelectHandler"
|
|
39
40
|
><MIcon :icon="Coin"></MIcon
|
|
40
41
|
></TMagicButton>
|
|
41
42
|
</TMagicTooltip>
|
|
@@ -185,4 +186,10 @@ const onChangeHandler = (value: string[], eventData?: ContainerChangeEventData)
|
|
|
185
186
|
emit('change', [dsId], eventData);
|
|
186
187
|
}
|
|
187
188
|
};
|
|
189
|
+
|
|
190
|
+
const onToggleDataSourceFieldSelectHandler = () => {
|
|
191
|
+
// 禁用或对比模式下禁止切换
|
|
192
|
+
if (props.disabled || mForm?.isCompare) return;
|
|
193
|
+
showDataSourceFieldSelect.value = !showDataSourceFieldSelect.value;
|
|
194
|
+
};
|
|
188
195
|
</script>
|
|
@@ -7,9 +7,12 @@
|
|
|
7
7
|
v-if="item.component"
|
|
8
8
|
:is="item.component"
|
|
9
9
|
:values="model[name]"
|
|
10
|
+
:last-values="lastValues?.[name]"
|
|
11
|
+
:is-compare="isCompare"
|
|
10
12
|
:size="size"
|
|
11
13
|
:disabled="disabled"
|
|
12
14
|
@change="change"
|
|
15
|
+
@add-diff-count="onAddDiffCount"
|
|
13
16
|
></component>
|
|
14
17
|
</TMagicCollapseItem>
|
|
15
18
|
</template>
|
|
@@ -36,6 +39,7 @@ const props = defineProps<FieldProps<StyleSchema>>();
|
|
|
36
39
|
|
|
37
40
|
const emit = defineEmits<{
|
|
38
41
|
change: [v: any, eventData: ContainerChangeEventData];
|
|
42
|
+
addDiffCount: [];
|
|
39
43
|
}>();
|
|
40
44
|
|
|
41
45
|
const list = [
|
|
@@ -82,4 +86,6 @@ const change = (v: any, eventData: ContainerChangeEventData) => {
|
|
|
82
86
|
});
|
|
83
87
|
emit('change', v, eventData);
|
|
84
88
|
};
|
|
89
|
+
|
|
90
|
+
const onAddDiffCount = () => emit('addDiffCount');
|
|
85
91
|
</script>
|
|
@@ -30,7 +30,16 @@
|
|
|
30
30
|
</div>
|
|
31
31
|
</div>
|
|
32
32
|
<div class="border-value-container">
|
|
33
|
-
<MContainer
|
|
33
|
+
<MContainer
|
|
34
|
+
:config="config"
|
|
35
|
+
:model="model"
|
|
36
|
+
:last-values="lastValues"
|
|
37
|
+
:is-compare="isCompare"
|
|
38
|
+
:size="size"
|
|
39
|
+
:disabled="disabled"
|
|
40
|
+
@change="change"
|
|
41
|
+
@add-diff-count="onAddDiffCount"
|
|
42
|
+
></MContainer>
|
|
34
43
|
</div>
|
|
35
44
|
</div>
|
|
36
45
|
</template>
|
|
@@ -86,11 +95,14 @@ const selectDirection = (d?: string) => (direction.value = d || '');
|
|
|
86
95
|
|
|
87
96
|
const emit = defineEmits<{
|
|
88
97
|
change: [v: StyleSchema, eventData: ContainerChangeEventData];
|
|
98
|
+
addDiffCount: [];
|
|
89
99
|
}>();
|
|
90
100
|
|
|
91
101
|
withDefaults(
|
|
92
102
|
defineProps<{
|
|
93
103
|
model: FormValue;
|
|
104
|
+
lastValues?: FormValue;
|
|
105
|
+
isCompare?: boolean;
|
|
94
106
|
disabled?: boolean;
|
|
95
107
|
size?: 'large' | 'default' | 'small';
|
|
96
108
|
}>(),
|
|
@@ -104,4 +116,6 @@ const change = (value: StyleSchema, eventData: ContainerChangeEventData) => {
|
|
|
104
116
|
});
|
|
105
117
|
});
|
|
106
118
|
};
|
|
119
|
+
|
|
120
|
+
const onAddDiffCount = () => emit('addDiffCount');
|
|
107
121
|
</script>
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<MContainer
|
|
2
|
+
<MContainer
|
|
3
|
+
:config="config"
|
|
4
|
+
:model="values"
|
|
5
|
+
:last-values="lastValues"
|
|
6
|
+
:is-compare="isCompare"
|
|
7
|
+
:size="size"
|
|
8
|
+
:disabled="disabled"
|
|
9
|
+
@change="change"
|
|
10
|
+
@add-diff-count="onAddDiffCount"
|
|
11
|
+
></MContainer>
|
|
3
12
|
</template>
|
|
4
13
|
|
|
5
14
|
<script lang="ts" setup>
|
|
@@ -13,12 +22,15 @@ import { BackgroundNoRepeat, BackgroundRepeat, BackgroundRepeatX, BackgroundRepe
|
|
|
13
22
|
|
|
14
23
|
defineProps<{
|
|
15
24
|
values: Partial<StyleSchema>;
|
|
25
|
+
lastValues?: Partial<StyleSchema>;
|
|
26
|
+
isCompare?: boolean;
|
|
16
27
|
disabled?: boolean;
|
|
17
28
|
size?: 'large' | 'default' | 'small';
|
|
18
29
|
}>();
|
|
19
30
|
|
|
20
31
|
const emit = defineEmits<{
|
|
21
32
|
change: [v: StyleSchema, eventData: ContainerChangeEventData];
|
|
33
|
+
addDiffCount: [];
|
|
22
34
|
}>();
|
|
23
35
|
|
|
24
36
|
const config = defineFormItem({
|
|
@@ -79,4 +91,6 @@ const config = defineFormItem({
|
|
|
79
91
|
const change = (value: StyleSchema, eventData: ContainerChangeEventData) => {
|
|
80
92
|
emit('change', value, eventData);
|
|
81
93
|
};
|
|
94
|
+
|
|
95
|
+
const onAddDiffCount = () => emit('addDiffCount');
|
|
82
96
|
</script>
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<MContainer
|
|
3
|
-
|
|
2
|
+
<MContainer
|
|
3
|
+
:config="config"
|
|
4
|
+
:model="values"
|
|
5
|
+
:last-values="lastValues"
|
|
6
|
+
:is-compare="isCompare"
|
|
7
|
+
:size="size"
|
|
8
|
+
:disabled="disabled"
|
|
9
|
+
@change="change"
|
|
10
|
+
@add-diff-count="onAddDiffCount"
|
|
11
|
+
></MContainer>
|
|
12
|
+
<Border
|
|
13
|
+
:model="values"
|
|
14
|
+
:last-values="lastValues"
|
|
15
|
+
:is-compare="isCompare"
|
|
16
|
+
:size="size"
|
|
17
|
+
:disabled="disabled"
|
|
18
|
+
@change="change"
|
|
19
|
+
@add-diff-count="onAddDiffCount"
|
|
20
|
+
></Border>
|
|
4
21
|
</template>
|
|
5
22
|
|
|
6
23
|
<script lang="ts" setup>
|
|
@@ -11,12 +28,15 @@ import Border from '../components/Border.vue';
|
|
|
11
28
|
|
|
12
29
|
defineProps<{
|
|
13
30
|
values: Partial<StyleSchema>;
|
|
31
|
+
lastValues?: Partial<StyleSchema>;
|
|
32
|
+
isCompare?: boolean;
|
|
14
33
|
disabled?: boolean;
|
|
15
34
|
size?: 'large' | 'default' | 'small';
|
|
16
35
|
}>();
|
|
17
36
|
|
|
18
37
|
const emit = defineEmits<{
|
|
19
38
|
change: [v: StyleSchema, eventData: ContainerChangeEventData];
|
|
39
|
+
addDiffCount: [];
|
|
20
40
|
}>();
|
|
21
41
|
|
|
22
42
|
const config = defineFormItem({
|
|
@@ -36,4 +56,6 @@ const config = defineFormItem({
|
|
|
36
56
|
const change = (value: StyleSchema, eventData: ContainerChangeEventData) => {
|
|
37
57
|
emit('change', value, eventData);
|
|
38
58
|
};
|
|
59
|
+
|
|
60
|
+
const onAddDiffCount = () => emit('addDiffCount');
|
|
39
61
|
</script>
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<MContainer
|
|
2
|
+
<MContainer
|
|
3
|
+
:config="config"
|
|
4
|
+
:model="values"
|
|
5
|
+
:last-values="lastValues"
|
|
6
|
+
:is-compare="isCompare"
|
|
7
|
+
:size="size"
|
|
8
|
+
:disabled="disabled"
|
|
9
|
+
@change="change"
|
|
10
|
+
@add-diff-count="onAddDiffCount"
|
|
11
|
+
></MContainer>
|
|
3
12
|
</template>
|
|
4
13
|
|
|
5
14
|
<script lang="ts" setup>
|
|
@@ -12,12 +21,15 @@ import { AlignCenter, AlignLeft, AlignRight } from '../icons/text-align';
|
|
|
12
21
|
|
|
13
22
|
defineProps<{
|
|
14
23
|
values: Partial<StyleSchema>;
|
|
24
|
+
lastValues?: Partial<StyleSchema>;
|
|
25
|
+
isCompare?: boolean;
|
|
15
26
|
disabled?: boolean;
|
|
16
27
|
size?: 'large' | 'default' | 'small';
|
|
17
28
|
}>();
|
|
18
29
|
|
|
19
30
|
const emit = defineEmits<{
|
|
20
31
|
change: [v: StyleSchema, eventData: ContainerChangeEventData];
|
|
32
|
+
addDiffCount: [];
|
|
21
33
|
}>();
|
|
22
34
|
|
|
23
35
|
const config = defineFormItem({
|
|
@@ -91,4 +103,6 @@ const config = defineFormItem({
|
|
|
91
103
|
const change = (value: StyleSchema, eventData: ContainerChangeEventData) => {
|
|
92
104
|
emit('change', value, eventData);
|
|
93
105
|
};
|
|
106
|
+
|
|
107
|
+
const onAddDiffCount = () => emit('addDiffCount');
|
|
94
108
|
</script>
|