@tmagic/editor 1.5.0-beta.0 → 1.5.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/style.css +9 -5
- package/dist/tmagic-editor.js +160 -146
- package/dist/tmagic-editor.umd.cjs +165 -145
- package/package.json +9 -9
- package/src/hooks/index.ts +7 -0
- package/src/index.ts +2 -0
- package/src/layouts/sidebar/Sidebar.vue +18 -2
- package/src/layouts/sidebar/data-source/DataSourceListPanel.vue +12 -14
- package/src/theme/data-source.scss +8 -5
- package/types/index.d.ts +406 -205
|
@@ -3234,7 +3234,7 @@
|
|
|
3234
3234
|
});
|
|
3235
3235
|
|
|
3236
3236
|
const _hoisted_1$u = { class: "m-fields-code-select-col" };
|
|
3237
|
-
const _hoisted_2$
|
|
3237
|
+
const _hoisted_2$j = { class: "code-select-container" };
|
|
3238
3238
|
const _sfc_main$S = /* @__PURE__ */ vue.defineComponent({
|
|
3239
3239
|
...{
|
|
3240
3240
|
name: "MFieldsCodeSelectCol"
|
|
@@ -3315,7 +3315,7 @@
|
|
|
3315
3315
|
};
|
|
3316
3316
|
return (_ctx, _cache) => {
|
|
3317
3317
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$u, [
|
|
3318
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
3318
|
+
vue.createElementVNode("div", _hoisted_2$j, [
|
|
3319
3319
|
vue.createVNode(vue.unref(form.MContainer), {
|
|
3320
3320
|
class: "select",
|
|
3321
3321
|
config: selectConfig,
|
|
@@ -4065,6 +4065,68 @@
|
|
|
4065
4065
|
};
|
|
4066
4066
|
};
|
|
4067
4067
|
|
|
4068
|
+
const useFilter = (nodeData, nodeStatusMap, filterNodeMethod) => {
|
|
4069
|
+
const filterIsMatch = (value, data) => {
|
|
4070
|
+
const string = !Array.isArray(value) ? [value] : value;
|
|
4071
|
+
if (!string.length) {
|
|
4072
|
+
return true;
|
|
4073
|
+
}
|
|
4074
|
+
return string.some((v) => filterNodeMethod(v, data));
|
|
4075
|
+
};
|
|
4076
|
+
const filter = (text) => {
|
|
4077
|
+
if (!nodeData.value.length) return;
|
|
4078
|
+
nodeData.value.forEach((node) => {
|
|
4079
|
+
traverseNode(node, (node2, parents) => {
|
|
4080
|
+
if (!nodeStatusMap.value) return;
|
|
4081
|
+
const visible = filterIsMatch(text, node2);
|
|
4082
|
+
if (visible && parents.length) {
|
|
4083
|
+
parents.forEach((parent) => {
|
|
4084
|
+
updateStatus(nodeStatusMap.value, parent.id, {
|
|
4085
|
+
visible,
|
|
4086
|
+
expand: true
|
|
4087
|
+
});
|
|
4088
|
+
});
|
|
4089
|
+
}
|
|
4090
|
+
updateStatus(nodeStatusMap.value, node2.id, {
|
|
4091
|
+
visible
|
|
4092
|
+
});
|
|
4093
|
+
});
|
|
4094
|
+
});
|
|
4095
|
+
};
|
|
4096
|
+
return {
|
|
4097
|
+
filterText: vue.ref(""),
|
|
4098
|
+
filterTextChangeHandler(text) {
|
|
4099
|
+
filter(text);
|
|
4100
|
+
}
|
|
4101
|
+
};
|
|
4102
|
+
};
|
|
4103
|
+
|
|
4104
|
+
const useGetSo = (target, emit) => {
|
|
4105
|
+
let getso;
|
|
4106
|
+
const isDraging = vue.ref(false);
|
|
4107
|
+
vue.onMounted(() => {
|
|
4108
|
+
if (!target.value) return;
|
|
4109
|
+
getso = new Gesto(target.value, {
|
|
4110
|
+
container: window,
|
|
4111
|
+
pinchOutside: true
|
|
4112
|
+
}).on("drag", (e) => {
|
|
4113
|
+
if (!target.value) return;
|
|
4114
|
+
emit("change", e);
|
|
4115
|
+
}).on("dragStart", () => {
|
|
4116
|
+
isDraging.value = true;
|
|
4117
|
+
}).on("dragEnd", () => {
|
|
4118
|
+
isDraging.value = false;
|
|
4119
|
+
});
|
|
4120
|
+
});
|
|
4121
|
+
vue.onBeforeUnmount(() => {
|
|
4122
|
+
getso?.unset();
|
|
4123
|
+
isDraging.value = false;
|
|
4124
|
+
});
|
|
4125
|
+
return {
|
|
4126
|
+
isDraging
|
|
4127
|
+
};
|
|
4128
|
+
};
|
|
4129
|
+
|
|
4068
4130
|
const useNextFloatBoxPosition = (uiService, parent) => {
|
|
4069
4131
|
const boxPosition = vue.ref({
|
|
4070
4132
|
left: 0,
|
|
@@ -4089,8 +4151,42 @@
|
|
|
4089
4151
|
};
|
|
4090
4152
|
};
|
|
4091
4153
|
|
|
4154
|
+
const createPageNodeStatus$1 = (nodeData, initialLayerNodeStatus) => {
|
|
4155
|
+
const map = /* @__PURE__ */ new Map();
|
|
4156
|
+
nodeData.forEach(
|
|
4157
|
+
(node) => traverseNode(node, (node2) => {
|
|
4158
|
+
map.set(
|
|
4159
|
+
node2.id,
|
|
4160
|
+
initialLayerNodeStatus?.get(node2.id) || {
|
|
4161
|
+
visible: true,
|
|
4162
|
+
expand: false,
|
|
4163
|
+
selected: false,
|
|
4164
|
+
draggable: false
|
|
4165
|
+
}
|
|
4166
|
+
);
|
|
4167
|
+
})
|
|
4168
|
+
);
|
|
4169
|
+
return map;
|
|
4170
|
+
};
|
|
4171
|
+
const useNodeStatus$1 = (nodeData) => {
|
|
4172
|
+
const nodeStatusMap = vue.ref(/* @__PURE__ */ new Map());
|
|
4173
|
+
vue.watch(
|
|
4174
|
+
nodeData,
|
|
4175
|
+
(nodeData2) => {
|
|
4176
|
+
nodeStatusMap.value = createPageNodeStatus$1(nodeData2, nodeStatusMap.value);
|
|
4177
|
+
},
|
|
4178
|
+
{
|
|
4179
|
+
immediate: true,
|
|
4180
|
+
deep: true
|
|
4181
|
+
}
|
|
4182
|
+
);
|
|
4183
|
+
return {
|
|
4184
|
+
nodeStatusMap
|
|
4185
|
+
};
|
|
4186
|
+
};
|
|
4187
|
+
|
|
4092
4188
|
const _hoisted_1$t = { class: "m-editor-data-source-fields" };
|
|
4093
|
-
const _hoisted_2$
|
|
4189
|
+
const _hoisted_2$i = { class: "m-editor-data-source-fields-footer" };
|
|
4094
4190
|
const _sfc_main$P = /* @__PURE__ */ vue.defineComponent({
|
|
4095
4191
|
...{
|
|
4096
4192
|
name: "MFieldsDataSourceFields"
|
|
@@ -4347,7 +4443,7 @@
|
|
|
4347
4443
|
data: _ctx.model[_ctx.name],
|
|
4348
4444
|
columns: fieldColumns
|
|
4349
4445
|
}, null, 8, ["data"]),
|
|
4350
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
4446
|
+
vue.createElementVNode("div", _hoisted_2$i, [
|
|
4351
4447
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
4352
4448
|
size: "small",
|
|
4353
4449
|
disabled: _ctx.disabled,
|
|
@@ -4735,7 +4831,7 @@
|
|
|
4735
4831
|
});
|
|
4736
4832
|
|
|
4737
4833
|
const _hoisted_1$q = { style: { "display": "flex", "flex-direction": "column", "line-height": "1.2em" } };
|
|
4738
|
-
const _hoisted_2$
|
|
4834
|
+
const _hoisted_2$h = { style: { "font-size": "10px", "color": "rgba(0, 0, 0, 0.6)" } };
|
|
4739
4835
|
const _hoisted_3$8 = { class: "el-input__inner t-input__inner" };
|
|
4740
4836
|
const _sfc_main$M = /* @__PURE__ */ vue.defineComponent({
|
|
4741
4837
|
...{
|
|
@@ -4942,7 +5038,7 @@
|
|
|
4942
5038
|
default: vue.withCtx(({ item }) => [
|
|
4943
5039
|
vue.createElementVNode("div", _hoisted_1$q, [
|
|
4944
5040
|
vue.createElementVNode("div", null, vue.toDisplayString(item.text), 1),
|
|
4945
|
-
vue.createElementVNode("span", _hoisted_2$
|
|
5041
|
+
vue.createElementVNode("span", _hoisted_2$h, vue.toDisplayString(item.value), 1)
|
|
4946
5042
|
])
|
|
4947
5043
|
]),
|
|
4948
5044
|
_: 1
|
|
@@ -4984,7 +5080,7 @@
|
|
|
4984
5080
|
});
|
|
4985
5081
|
|
|
4986
5082
|
const _hoisted_1$p = { style: { "display": "flex", "margin-bottom": "10px" } };
|
|
4987
|
-
const _hoisted_2$
|
|
5083
|
+
const _hoisted_2$g = { style: { "flex": "1" } };
|
|
4988
5084
|
const _hoisted_3$7 = { style: { "flex": "1" } };
|
|
4989
5085
|
const _hoisted_4$7 = { class: "dialog-footer" };
|
|
4990
5086
|
const _sfc_main$L = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -5238,7 +5334,7 @@
|
|
|
5238
5334
|
]),
|
|
5239
5335
|
default: vue.withCtx(() => [
|
|
5240
5336
|
vue.createElementVNode("div", _hoisted_1$p, [
|
|
5241
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
5337
|
+
vue.createElementVNode("div", _hoisted_2$g, [
|
|
5242
5338
|
vue.createVNode(vue.unref(design.TMagicTag), {
|
|
5243
5339
|
size: "small",
|
|
5244
5340
|
type: "info"
|
|
@@ -5281,7 +5377,7 @@
|
|
|
5281
5377
|
});
|
|
5282
5378
|
|
|
5283
5379
|
const _hoisted_1$o = { class: "m-editor-data-source-methods" };
|
|
5284
|
-
const _hoisted_2$
|
|
5380
|
+
const _hoisted_2$f = { class: "m-editor-data-source-methods-footer" };
|
|
5285
5381
|
const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
|
|
5286
5382
|
...{
|
|
5287
5383
|
name: "MFieldsDataSourceMethods"
|
|
@@ -5357,7 +5453,7 @@
|
|
|
5357
5453
|
data: _ctx.model[_ctx.name],
|
|
5358
5454
|
columns: methodColumns
|
|
5359
5455
|
}, null, 8, ["data"]),
|
|
5360
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
5456
|
+
vue.createElementVNode("div", _hoisted_2$f, [
|
|
5361
5457
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
5362
5458
|
size: "small",
|
|
5363
5459
|
type: "primary",
|
|
@@ -5387,7 +5483,7 @@
|
|
|
5387
5483
|
});
|
|
5388
5484
|
|
|
5389
5485
|
const _hoisted_1$n = { class: "m-fields-data-source-method-select" };
|
|
5390
|
-
const _hoisted_2$
|
|
5486
|
+
const _hoisted_2$e = { class: "data-source-method-select-container" };
|
|
5391
5487
|
const _sfc_main$J = /* @__PURE__ */ vue.defineComponent({
|
|
5392
5488
|
...{
|
|
5393
5489
|
name: "MFieldsDataSourceMethodSelect"
|
|
@@ -5475,7 +5571,7 @@
|
|
|
5475
5571
|
};
|
|
5476
5572
|
return (_ctx, _cache) => {
|
|
5477
5573
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$n, [
|
|
5478
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
5574
|
+
vue.createElementVNode("div", _hoisted_2$e, [
|
|
5479
5575
|
vue.createVNode(vue.unref(form.MContainer), {
|
|
5480
5576
|
class: "select",
|
|
5481
5577
|
config: cascaderConfig.value,
|
|
@@ -5519,7 +5615,7 @@
|
|
|
5519
5615
|
});
|
|
5520
5616
|
|
|
5521
5617
|
const _hoisted_1$m = { class: "m-editor-data-source-fields" };
|
|
5522
|
-
const _hoisted_2$
|
|
5618
|
+
const _hoisted_2$d = { class: "m-editor-data-source-fields-footer" };
|
|
5523
5619
|
const _sfc_main$I = /* @__PURE__ */ vue.defineComponent({
|
|
5524
5620
|
...{
|
|
5525
5621
|
name: "MFieldsDataSourceMocks"
|
|
@@ -5729,7 +5825,7 @@
|
|
|
5729
5825
|
data: _ctx.model[_ctx.name],
|
|
5730
5826
|
columns
|
|
5731
5827
|
}, null, 8, ["data"]),
|
|
5732
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
5828
|
+
vue.createElementVNode("div", _hoisted_2$d, [
|
|
5733
5829
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
5734
5830
|
size: "small",
|
|
5735
5831
|
type: "primary",
|
|
@@ -5994,7 +6090,7 @@
|
|
|
5994
6090
|
});
|
|
5995
6091
|
|
|
5996
6092
|
const _hoisted_1$k = { class: "m-fields-event-select" };
|
|
5997
|
-
const _hoisted_2$
|
|
6093
|
+
const _hoisted_2$c = {
|
|
5998
6094
|
key: 1,
|
|
5999
6095
|
class: "fullWidth"
|
|
6000
6096
|
};
|
|
@@ -6282,7 +6378,7 @@
|
|
|
6282
6378
|
model: _ctx.model,
|
|
6283
6379
|
config: tableConfig.value,
|
|
6284
6380
|
onChange: onChangeHandler
|
|
6285
|
-
}, null, 8, ["size", "disabled", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
6381
|
+
}, null, 8, ["size", "disabled", "model", "config"])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$c, [
|
|
6286
6382
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
6287
6383
|
class: "create-button",
|
|
6288
6384
|
type: "primary",
|
|
@@ -6338,9 +6434,9 @@
|
|
|
6338
6434
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6339
6435
|
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
6340
6436
|
};
|
|
6341
|
-
const _hoisted_2$
|
|
6437
|
+
const _hoisted_2$b = /* @__PURE__ */ vue.createStaticVNode('<defs><rect id="path-1" x="0" y="0" width="32" height="32"></rect></defs><g id="组件规范" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="03图标" transform="translate(-561.000000, -2356.000000)"><g id="icon/line/Universal/code" transform="translate(561.000000, 2356.000000)"><g id="路径"><mask id="mask-2" fill="white"><use xlink:href="#path-1"></use></mask><use id="蒙版" fill="#D8D8D8" opacity="0" xlink:href="#path-1"></use><path d="M21.9284587,7.9482233 L29.8079004,15.827665 C29.9055315,15.9252961 29.9055315,16.0835874 29.8079004,16.1812184 L21.9284587,24.0606602 C21.8308276,24.1582912 21.6725364,24.1582912 21.5749053,24.0606602 L20.3374684,22.8232233 C20.2419143,22.7276698 20.2398813,22.5740096 20.331369,22.4759832 L20.3374687,22.4696702 L26.8027181,16.0044417 L20.3374687,9.53921328 C20.2398372,9.44158265 20.2398369,9.2832914 20.3374679,9.18566017 L21.5749053,7.9482233 C21.6725364,7.85059223 21.8308276,7.85059223 21.9284587,7.9482233 Z M10.3999684,7.9482233 L11.6374053,9.18566017 C11.7329594,9.28121371 11.7349925,9.43487387 11.6435048,9.53290029 L11.637405,9.53921328 L5.17215562,16.0044417 L11.637405,22.4696702 C11.7329593,22.5652236 11.7349926,22.7188837 11.643505,22.8169103 L11.6374053,22.8232233 L10.3999684,24.0606602 C10.3023374,24.1582912 10.1440461,24.1582912 10.046415,24.0606602 L2.1669733,16.1812184 C2.06934223,16.0835874 2.06934223,15.9252961 2.1669733,15.827665 L10.046415,7.9482233 C10.1440461,7.85059223 10.3023374,7.85059223 10.3999684,7.9482233 Z M17.2612532,9.29310422 L18.9262468,9.83189578 C19.0576112,9.87440526 19.1296423,10.0153579 19.0871328,10.1467222 L15.0848232,22.514807 C15.0423138,22.6461714 14.9013612,22.7182025 14.7699968,22.675693 L13.1050032,22.1369014 C12.9736388,22.0943919 12.9016077,21.9534393 12.9441172,21.822075 L16.9464268,9.45399022 C16.9889362,9.32262585 17.1298888,9.25059474 17.2612532,9.29310422 Z" id="形状" fill="#1D1F24" mask="url(#mask-2)"></path></g></g><g id="icon切图" transform="translate(226.000000, 1782.000000)"></g></g></g>', 2);
|
|
6342
6438
|
const _hoisted_4$6 = [
|
|
6343
|
-
_hoisted_2$
|
|
6439
|
+
_hoisted_2$b
|
|
6344
6440
|
];
|
|
6345
6441
|
const _sfc_main$E = /* @__PURE__ */ vue.defineComponent({
|
|
6346
6442
|
...{
|
|
@@ -6355,7 +6451,7 @@
|
|
|
6355
6451
|
});
|
|
6356
6452
|
|
|
6357
6453
|
const _hoisted_1$i = { class: "m-fields-key-value" };
|
|
6358
|
-
const _hoisted_2$
|
|
6454
|
+
const _hoisted_2$a = { key: 0 };
|
|
6359
6455
|
const _hoisted_3$6 = /* @__PURE__ */ vue.createElementVNode("span", { class: "m-fileds-key-value-delimiter" }, ":", -1);
|
|
6360
6456
|
const _sfc_main$D = /* @__PURE__ */ vue.defineComponent({
|
|
6361
6457
|
...{
|
|
@@ -6416,7 +6512,7 @@
|
|
|
6416
6512
|
};
|
|
6417
6513
|
return (_ctx, _cache) => {
|
|
6418
6514
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$i, [
|
|
6419
|
-
!showCode.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
6515
|
+
!showCode.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$a, [
|
|
6420
6516
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(records.value, (item, index) => {
|
|
6421
6517
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
6422
6518
|
class: "m-fields-key-value-item",
|
|
@@ -6490,7 +6586,7 @@
|
|
|
6490
6586
|
});
|
|
6491
6587
|
|
|
6492
6588
|
const _hoisted_1$h = { class: "m-fields-page-fragment-select" };
|
|
6493
|
-
const _hoisted_2$
|
|
6589
|
+
const _hoisted_2$9 = { class: "page-fragment-select-container" };
|
|
6494
6590
|
const _sfc_main$C = /* @__PURE__ */ vue.defineComponent({
|
|
6495
6591
|
...{
|
|
6496
6592
|
name: "MFieldsPageFragmentSelect"
|
|
@@ -6538,7 +6634,7 @@
|
|
|
6538
6634
|
return (_ctx, _cache) => {
|
|
6539
6635
|
const _component_m_form_container = vue.resolveComponent("m-form-container");
|
|
6540
6636
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$h, [
|
|
6541
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
6637
|
+
vue.createElementVNode("div", _hoisted_2$9, [
|
|
6542
6638
|
vue.createVNode(_component_m_form_container, {
|
|
6543
6639
|
class: "select",
|
|
6544
6640
|
config: selectConfig,
|
|
@@ -6725,32 +6821,6 @@
|
|
|
6725
6821
|
}
|
|
6726
6822
|
});
|
|
6727
6823
|
|
|
6728
|
-
const useGetSo = (target, emit) => {
|
|
6729
|
-
let getso;
|
|
6730
|
-
const isDraging = vue.ref(false);
|
|
6731
|
-
vue.onMounted(() => {
|
|
6732
|
-
if (!target.value) return;
|
|
6733
|
-
getso = new Gesto(target.value, {
|
|
6734
|
-
container: window,
|
|
6735
|
-
pinchOutside: true
|
|
6736
|
-
}).on("drag", (e) => {
|
|
6737
|
-
if (!target.value) return;
|
|
6738
|
-
emit("change", e);
|
|
6739
|
-
}).on("dragStart", () => {
|
|
6740
|
-
isDraging.value = true;
|
|
6741
|
-
}).on("dragEnd", () => {
|
|
6742
|
-
isDraging.value = false;
|
|
6743
|
-
});
|
|
6744
|
-
});
|
|
6745
|
-
vue.onBeforeUnmount(() => {
|
|
6746
|
-
getso?.unset();
|
|
6747
|
-
isDraging.value = false;
|
|
6748
|
-
});
|
|
6749
|
-
return {
|
|
6750
|
-
isDraging
|
|
6751
|
-
};
|
|
6752
|
-
};
|
|
6753
|
-
|
|
6754
6824
|
const _sfc_main$A = /* @__PURE__ */ vue.defineComponent({
|
|
6755
6825
|
...{
|
|
6756
6826
|
name: "MEditorResizer"
|
|
@@ -6937,7 +7007,7 @@
|
|
|
6937
7007
|
key: 1,
|
|
6938
7008
|
class: "menu-item-text"
|
|
6939
7009
|
};
|
|
6940
|
-
const _hoisted_2$
|
|
7010
|
+
const _hoisted_2$8 = { class: "el-dropdown-link menubar-menu-button" };
|
|
6941
7011
|
const _sfc_main$y = /* @__PURE__ */ vue.defineComponent({
|
|
6942
7012
|
...{
|
|
6943
7013
|
name: "MEditorToolButton"
|
|
@@ -7074,7 +7144,7 @@
|
|
|
7074
7144
|
})) : vue.createCommentVNode("", true)
|
|
7075
7145
|
]),
|
|
7076
7146
|
default: vue.withCtx(() => [
|
|
7077
|
-
vue.createElementVNode("span", _hoisted_2$
|
|
7147
|
+
vue.createElementVNode("span", _hoisted_2$8, [
|
|
7078
7148
|
vue.createTextVNode(vue.toDisplayString(_ctx.data.text), 1),
|
|
7079
7149
|
vue.createVNode(vue.unref(design.TMagicIcon), { class: "el-icon--right" }, {
|
|
7080
7150
|
default: vue.withCtx(() => [
|
|
@@ -7398,7 +7468,7 @@
|
|
|
7398
7468
|
});
|
|
7399
7469
|
|
|
7400
7470
|
const _hoisted_1$c = { class: "m-editor-page-bar-tabs" };
|
|
7401
|
-
const _hoisted_2$
|
|
7471
|
+
const _hoisted_2$7 = ["page-id", "onClick"];
|
|
7402
7472
|
const _hoisted_3$5 = { class: "m-editor-page-bar-title" };
|
|
7403
7473
|
const _hoisted_4$5 = ["title"];
|
|
7404
7474
|
const _sfc_main$t = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -7552,7 +7622,7 @@
|
|
|
7552
7622
|
]),
|
|
7553
7623
|
_: 2
|
|
7554
7624
|
}, 1024)
|
|
7555
|
-
], 10, _hoisted_2$
|
|
7625
|
+
], 10, _hoisted_2$7);
|
|
7556
7626
|
}), 128))
|
|
7557
7627
|
]),
|
|
7558
7628
|
_: 3
|
|
@@ -7563,7 +7633,7 @@
|
|
|
7563
7633
|
});
|
|
7564
7634
|
|
|
7565
7635
|
const _hoisted_1$b = { class: "m-editor-empty-panel" };
|
|
7566
|
-
const _hoisted_2$
|
|
7636
|
+
const _hoisted_2$6 = { class: "m-editor-empty-content" };
|
|
7567
7637
|
const _hoisted_3$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面", -1);
|
|
7568
7638
|
const _hoisted_4$4 = /* @__PURE__ */ vue.createElementVNode("p", null, "新增页面片", -1);
|
|
7569
7639
|
const _sfc_main$s = /* @__PURE__ */ vue.defineComponent({
|
|
@@ -7589,7 +7659,7 @@
|
|
|
7589
7659
|
};
|
|
7590
7660
|
return (_ctx, _cache) => {
|
|
7591
7661
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$b, [
|
|
7592
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
7662
|
+
vue.createElementVNode("div", _hoisted_2$6, [
|
|
7593
7663
|
vue.createElementVNode("div", {
|
|
7594
7664
|
class: "m-editor-empty-button",
|
|
7595
7665
|
onClick: _cache[0] || (_cache[0] = ($event) => clickHandler(vue.unref(schema.NodeType).PAGE))
|
|
@@ -8114,7 +8184,7 @@
|
|
|
8114
8184
|
});
|
|
8115
8185
|
|
|
8116
8186
|
const _hoisted_1$9 = ["draggable", "data-node-id", "data-parent-id", "data-parents-id", "data-is-container"];
|
|
8117
|
-
const _hoisted_2$
|
|
8187
|
+
const _hoisted_2$5 = { class: "tree-node-label" };
|
|
8118
8188
|
const _hoisted_3$3 = { class: "tree-node-tool" };
|
|
8119
8189
|
const _hoisted_4$3 = {
|
|
8120
8190
|
key: 0,
|
|
@@ -8204,7 +8274,7 @@
|
|
|
8204
8274
|
onClick: nodeClickHandler
|
|
8205
8275
|
}, [
|
|
8206
8276
|
vue.renderSlot(_ctx.$slots, "tree-node-content", { data: _ctx.data }, () => [
|
|
8207
|
-
vue.createElementVNode("div", _hoisted_2$
|
|
8277
|
+
vue.createElementVNode("div", _hoisted_2$5, [
|
|
8208
8278
|
vue.renderSlot(_ctx.$slots, "tree-node-label", { data: _ctx.data }, () => [
|
|
8209
8279
|
vue.createTextVNode(vue.toDisplayString(`${_ctx.data.name} (${_ctx.data.id})`), 1)
|
|
8210
8280
|
])
|
|
@@ -8298,76 +8368,6 @@
|
|
|
8298
8368
|
}
|
|
8299
8369
|
});
|
|
8300
8370
|
|
|
8301
|
-
const useFilter = (nodeData, nodeStatusMap, filterNodeMethod) => {
|
|
8302
|
-
const filterIsMatch = (value, data) => {
|
|
8303
|
-
const string = !Array.isArray(value) ? [value] : value;
|
|
8304
|
-
if (!string.length) {
|
|
8305
|
-
return true;
|
|
8306
|
-
}
|
|
8307
|
-
return string.some((v) => filterNodeMethod(v, data));
|
|
8308
|
-
};
|
|
8309
|
-
const filter = (text) => {
|
|
8310
|
-
if (!nodeData.value.length) return;
|
|
8311
|
-
nodeData.value.forEach((node) => {
|
|
8312
|
-
traverseNode(node, (node2, parents) => {
|
|
8313
|
-
if (!nodeStatusMap.value) return;
|
|
8314
|
-
const visible = filterIsMatch(text, node2);
|
|
8315
|
-
if (visible && parents.length) {
|
|
8316
|
-
parents.forEach((parent) => {
|
|
8317
|
-
updateStatus(nodeStatusMap.value, parent.id, {
|
|
8318
|
-
visible,
|
|
8319
|
-
expand: true
|
|
8320
|
-
});
|
|
8321
|
-
});
|
|
8322
|
-
}
|
|
8323
|
-
updateStatus(nodeStatusMap.value, node2.id, {
|
|
8324
|
-
visible
|
|
8325
|
-
});
|
|
8326
|
-
});
|
|
8327
|
-
});
|
|
8328
|
-
};
|
|
8329
|
-
return {
|
|
8330
|
-
filterText: vue.ref(""),
|
|
8331
|
-
filterTextChangeHandler(text) {
|
|
8332
|
-
filter(text);
|
|
8333
|
-
}
|
|
8334
|
-
};
|
|
8335
|
-
};
|
|
8336
|
-
|
|
8337
|
-
const createPageNodeStatus$1 = (nodeData, initialLayerNodeStatus) => {
|
|
8338
|
-
const map = /* @__PURE__ */ new Map();
|
|
8339
|
-
nodeData.forEach(
|
|
8340
|
-
(node) => traverseNode(node, (node2) => {
|
|
8341
|
-
map.set(
|
|
8342
|
-
node2.id,
|
|
8343
|
-
initialLayerNodeStatus?.get(node2.id) || {
|
|
8344
|
-
visible: true,
|
|
8345
|
-
expand: false,
|
|
8346
|
-
selected: false,
|
|
8347
|
-
draggable: false
|
|
8348
|
-
}
|
|
8349
|
-
);
|
|
8350
|
-
})
|
|
8351
|
-
);
|
|
8352
|
-
return map;
|
|
8353
|
-
};
|
|
8354
|
-
const useNodeStatus$1 = (nodeData) => {
|
|
8355
|
-
const nodeStatusMap = vue.ref(/* @__PURE__ */ new Map());
|
|
8356
|
-
vue.watch(
|
|
8357
|
-
nodeData,
|
|
8358
|
-
(nodeData2) => {
|
|
8359
|
-
nodeStatusMap.value = createPageNodeStatus$1(nodeData2, nodeStatusMap.value);
|
|
8360
|
-
},
|
|
8361
|
-
{
|
|
8362
|
-
immediate: true,
|
|
8363
|
-
deep: true
|
|
8364
|
-
}
|
|
8365
|
-
);
|
|
8366
|
-
return {
|
|
8367
|
-
nodeStatusMap
|
|
8368
|
-
};
|
|
8369
|
-
};
|
|
8370
|
-
|
|
8371
8371
|
const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
|
|
8372
8372
|
...{
|
|
8373
8373
|
name: "MEditorCodeBlockList"
|
|
@@ -8851,7 +8851,6 @@
|
|
|
8851
8851
|
});
|
|
8852
8852
|
|
|
8853
8853
|
const _hoisted_1$6 = { class: "search-wrapper" };
|
|
8854
|
-
const _hoisted_2$5 = { class: "data-source-list-panel-add-menu" };
|
|
8855
8854
|
const _sfc_main$h = /* @__PURE__ */ vue.defineComponent({
|
|
8856
8855
|
...{
|
|
8857
8856
|
name: "MEditorDataSourceListPanel"
|
|
@@ -8900,7 +8899,9 @@
|
|
|
8900
8899
|
vue.createVNode(_sfc_main$o, { onSearch: filterTextChangeHandler }),
|
|
8901
8900
|
vue.unref(editable) ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicPopover), {
|
|
8902
8901
|
key: 0,
|
|
8903
|
-
placement: "right"
|
|
8902
|
+
placement: "right",
|
|
8903
|
+
trigger: "hover",
|
|
8904
|
+
"popper-class": "data-source-list-panel-add-menu"
|
|
8904
8905
|
}, {
|
|
8905
8906
|
reference: vue.withCtx(() => [
|
|
8906
8907
|
vue.createVNode(vue.unref(design.TMagicButton), {
|
|
@@ -8914,20 +8915,18 @@
|
|
|
8914
8915
|
})
|
|
8915
8916
|
]),
|
|
8916
8917
|
default: vue.withCtx(() => [
|
|
8917
|
-
vue.
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
|
|
8924
|
-
|
|
8925
|
-
|
|
8926
|
-
|
|
8927
|
-
|
|
8928
|
-
|
|
8929
|
-
}), 128))
|
|
8930
|
-
])
|
|
8918
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(datasourceTypeList.value, (item, index) => {
|
|
8919
|
+
return vue.openBlock(), vue.createBlock(_sfc_main$y, {
|
|
8920
|
+
data: {
|
|
8921
|
+
type: "button",
|
|
8922
|
+
text: item.text,
|
|
8923
|
+
handler: () => {
|
|
8924
|
+
addHandler(item.type);
|
|
8925
|
+
}
|
|
8926
|
+
},
|
|
8927
|
+
key: index
|
|
8928
|
+
}, null, 8, ["data"]);
|
|
8929
|
+
}), 128))
|
|
8931
8930
|
]),
|
|
8932
8931
|
_: 1
|
|
8933
8932
|
})) : vue.createCommentVNode("", true),
|
|
@@ -10086,7 +10085,22 @@
|
|
|
10086
10085
|
const props = __props;
|
|
10087
10086
|
const services = vue.inject("services");
|
|
10088
10087
|
const columnLeftWidth = vue.computed(() => services?.uiService.get("columnWidth")[ColumnLayout.LEFT] || 0);
|
|
10089
|
-
const { height:
|
|
10088
|
+
const { height: editorContentHeight } = useEditorContentHeight();
|
|
10089
|
+
const columnLeftHeight = vue.ref(0);
|
|
10090
|
+
const unWatchEditorContentHeight = vue.watch(
|
|
10091
|
+
editorContentHeight,
|
|
10092
|
+
(height) => {
|
|
10093
|
+
if (height) {
|
|
10094
|
+
columnLeftHeight.value = height * 0.5;
|
|
10095
|
+
vue.nextTick().then(() => {
|
|
10096
|
+
unWatchEditorContentHeight();
|
|
10097
|
+
});
|
|
10098
|
+
}
|
|
10099
|
+
},
|
|
10100
|
+
{
|
|
10101
|
+
immediate: true
|
|
10102
|
+
}
|
|
10103
|
+
);
|
|
10090
10104
|
const activeTabName = vue.ref(props.data?.status);
|
|
10091
10105
|
const getItemConfig = (data) => {
|
|
10092
10106
|
const map = {
|
|
@@ -10340,8 +10354,8 @@
|
|
|
10340
10354
|
key: config.$key ?? index,
|
|
10341
10355
|
visible: vue.unref(floatBoxStates)[config.$key].status,
|
|
10342
10356
|
"onUpdate:visible": ($event) => vue.unref(floatBoxStates)[config.$key].status = $event,
|
|
10343
|
-
height:
|
|
10344
|
-
"onUpdate:height": _cache[1] || (_cache[1] = ($event) =>
|
|
10357
|
+
height: columnLeftHeight.value,
|
|
10358
|
+
"onUpdate:height": _cache[1] || (_cache[1] = ($event) => columnLeftHeight.value = $event),
|
|
10345
10359
|
width: columnLeftWidth.value,
|
|
10346
10360
|
title: config.text,
|
|
10347
10361
|
position: {
|
|
@@ -12723,6 +12737,8 @@
|
|
|
12723
12737
|
exports.TMagicCodeEditor = _sfc_main$X;
|
|
12724
12738
|
exports.TMagicEditor = _sfc_main;
|
|
12725
12739
|
exports.ToolButton = _sfc_main$y;
|
|
12740
|
+
exports.Tree = _sfc_main$m;
|
|
12741
|
+
exports.TreeNode = _sfc_main$n;
|
|
12726
12742
|
exports.UI_SELECT_MODE_EVENT_NAME = UI_SELECT_MODE_EVENT_NAME;
|
|
12727
12743
|
exports.UndoRedo = UndoRedo;
|
|
12728
12744
|
exports.V_GUIDE_LINE_STORAGE_KEY = V_GUIDE_LINE_STORAGE_KEY;
|
|
@@ -12782,7 +12798,11 @@
|
|
|
12782
12798
|
exports.useCodeBlockEdit = useCodeBlockEdit;
|
|
12783
12799
|
exports.useDataSourceMethod = useDataSourceMethod;
|
|
12784
12800
|
exports.useEditorContentHeight = useEditorContentHeight;
|
|
12801
|
+
exports.useFilter = useFilter;
|
|
12785
12802
|
exports.useFloatBox = useFloatBox;
|
|
12803
|
+
exports.useGetSo = useGetSo;
|
|
12804
|
+
exports.useNextFloatBoxPosition = useNextFloatBoxPosition;
|
|
12805
|
+
exports.useNodeStatus = useNodeStatus$1;
|
|
12786
12806
|
exports.useStage = useStage;
|
|
12787
12807
|
exports.useWindowRect = useWindowRect;
|
|
12788
12808
|
exports.warn = warn;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.5.0-beta.
|
|
2
|
+
"version": "1.5.0-beta.1",
|
|
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/
|
|
59
|
-
"@tmagic/
|
|
58
|
+
"@tmagic/table": "1.5.0-beta.1",
|
|
59
|
+
"@tmagic/dep": "1.5.0-beta.1"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/events": "^3.0.0",
|
|
@@ -77,12 +77,12 @@
|
|
|
77
77
|
"monaco-editor": "^0.48.0",
|
|
78
78
|
"typescript": "*",
|
|
79
79
|
"vue": "^3.4.35",
|
|
80
|
-
"@tmagic/
|
|
81
|
-
"@tmagic/
|
|
82
|
-
"@tmagic/
|
|
83
|
-
"@tmagic/
|
|
84
|
-
"@tmagic/
|
|
85
|
-
"@tmagic/utils": "1.5.0-beta.
|
|
80
|
+
"@tmagic/core": "1.5.0-beta.1",
|
|
81
|
+
"@tmagic/design": "1.5.0-beta.1",
|
|
82
|
+
"@tmagic/form": "1.5.0-beta.1",
|
|
83
|
+
"@tmagic/schema": "1.5.0-beta.1",
|
|
84
|
+
"@tmagic/stage": "1.5.0-beta.1",
|
|
85
|
+
"@tmagic/utils": "1.5.0-beta.1"
|
|
86
86
|
},
|
|
87
87
|
"peerDependenciesMeta": {
|
|
88
88
|
"typescript": {
|
package/src/hooks/index.ts
CHANGED
|
@@ -22,3 +22,10 @@ export * from './use-stage';
|
|
|
22
22
|
export * from './use-float-box';
|
|
23
23
|
export * from './use-window-rect';
|
|
24
24
|
export * from './use-editor-content-height';
|
|
25
|
+
export * from './use-filter';
|
|
26
|
+
export * from './use-float-box';
|
|
27
|
+
export * from './use-getso';
|
|
28
|
+
export * from './use-next-float-box-position';
|
|
29
|
+
export * from './use-node-status';
|
|
30
|
+
export * from './use-stage';
|
|
31
|
+
export * from './use-window-rect';
|
package/src/index.ts
CHANGED
|
@@ -85,6 +85,8 @@ export { default as SplitView } from './components/SplitView.vue';
|
|
|
85
85
|
export { default as Resizer } from './components/Resizer.vue';
|
|
86
86
|
export { default as CodeBlockEditor } from './components/CodeBlockEditor.vue';
|
|
87
87
|
export { default as FloatingBox } from './components/FloatingBox.vue';
|
|
88
|
+
export { default as Tree } from './components/Tree.vue';
|
|
89
|
+
export { default as TreeNode } from './components/TreeNode.vue';
|
|
88
90
|
export { default as PageFragmentSelect } from './fields/PageFragmentSelect.vue';
|
|
89
91
|
export { default as DisplayConds } from './fields/DisplayConds.vue';
|
|
90
92
|
export { default as CondOpSelect } from './fields/CondOpSelect.vue';
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
</template>
|
|
149
149
|
|
|
150
150
|
<script setup lang="ts">
|
|
151
|
-
import { computed, inject, ref, watch } from 'vue';
|
|
151
|
+
import { computed, inject, nextTick, ref, watch } from 'vue';
|
|
152
152
|
import { Coin, EditPen, Goods, List } from '@element-plus/icons-vue';
|
|
153
153
|
|
|
154
154
|
import FloatingBox from '@editor/components/FloatingBox.vue';
|
|
@@ -196,7 +196,23 @@ const props = withDefaults(
|
|
|
196
196
|
const services = inject<Services>('services');
|
|
197
197
|
|
|
198
198
|
const columnLeftWidth = computed(() => services?.uiService.get('columnWidth')[ColumnLayout.LEFT] || 0);
|
|
199
|
-
const { height:
|
|
199
|
+
const { height: editorContentHeight } = useEditorContentHeight();
|
|
200
|
+
const columnLeftHeight = ref(0);
|
|
201
|
+
|
|
202
|
+
const unWatchEditorContentHeight = watch(
|
|
203
|
+
editorContentHeight,
|
|
204
|
+
(height) => {
|
|
205
|
+
if (height) {
|
|
206
|
+
columnLeftHeight.value = height * 0.5;
|
|
207
|
+
nextTick().then(() => {
|
|
208
|
+
unWatchEditorContentHeight();
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
immediate: true,
|
|
214
|
+
},
|
|
215
|
+
);
|
|
200
216
|
|
|
201
217
|
const activeTabName = ref(props.data?.status);
|
|
202
218
|
|