@tmagic/editor 1.2.0-beta.15 → 1.2.0-beta.17
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('serialize-javascript'), require('lodash-es'), require('@tmagic/schema'), require('@element-plus/icons-vue'), require('@tmagic/design'), require('monaco-editor'), require('@tmagic/stage'), require('gesto'), require('@tmagic/utils'), require('events'), require('@tmagic/core'), require('keycon')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'serialize-javascript', 'lodash-es', '@tmagic/schema', '@element-plus/icons-vue', '@tmagic/design', 'monaco-editor', '@tmagic/stage', 'gesto', '@tmagic/utils', 'events', '@tmagic/core', 'keycon'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicEditor = {}, global.Vue, global.serialize, global.lodashEs, global.schema, global.iconsVue, global.design, global.monaco, global.StageCore, global.Gesto, global.utils, global.events, global.core, global.KeyController));
|
|
5
|
-
})(this, (function (exports, vue, serialize, lodashEs, schema, iconsVue, design, monaco, StageCore, Gesto, utils, events, core, KeyController) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('serialize-javascript'), require('lodash-es'), require('@tmagic/schema'), require('@element-plus/icons-vue'), require('@tmagic/design'), require('monaco-editor'), require('@tmagic/stage'), require('gesto'), require('@tmagic/utils'), require('events'), require('@tmagic/core'), require('@tmagic/form'), require('keycon')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'serialize-javascript', 'lodash-es', '@tmagic/schema', '@element-plus/icons-vue', '@tmagic/design', 'monaco-editor', '@tmagic/stage', 'gesto', '@tmagic/utils', 'events', '@tmagic/core', '@tmagic/form', 'keycon'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.TMagicEditor = {}, global.Vue, global.serialize, global.lodashEs, global.schema, global.iconsVue, global.design, global.monaco, global.StageCore, global.Gesto, global.utils, global.events, global.core, global.form, global.KeyController));
|
|
5
|
+
})(this, (function (exports, vue, serialize, lodashEs, schema, iconsVue, design, monaco, StageCore, Gesto, utils, events, core, form, KeyController) { 'use strict';
|
|
6
6
|
|
|
7
7
|
const _interopDefaultLegacy = e => e && typeof e === 'object' && 'default' in e ? e : { default: e };
|
|
8
8
|
|
|
@@ -3126,7 +3126,9 @@
|
|
|
3126
3126
|
const curFormConfig = vue.ref([]);
|
|
3127
3127
|
const services = vue.inject("services");
|
|
3128
3128
|
const node = vue.computed(() => services?.editorService.get("node"));
|
|
3129
|
-
const propsPanelSize = vue.computed(
|
|
3129
|
+
const propsPanelSize = vue.computed(
|
|
3130
|
+
() => services?.uiService.get("propsPanelSize") || "small"
|
|
3131
|
+
);
|
|
3130
3132
|
const stage = vue.computed(() => services?.editorService.get("stage"));
|
|
3131
3133
|
const init = async () => {
|
|
3132
3134
|
if (!node.value) {
|
|
@@ -3159,10 +3161,9 @@
|
|
|
3159
3161
|
};
|
|
3160
3162
|
expose({ submit });
|
|
3161
3163
|
return (_ctx, _cache) => {
|
|
3162
|
-
const _component_m_form = vue.resolveComponent("m-form");
|
|
3163
3164
|
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$a, [
|
|
3164
3165
|
vue.renderSlot(_ctx.$slots, "props-panel-header"),
|
|
3165
|
-
vue.createVNode(
|
|
3166
|
+
vue.createVNode(vue.unref(form.MForm), {
|
|
3166
3167
|
ref_key: "configForm",
|
|
3167
3168
|
ref: configForm,
|
|
3168
3169
|
class: vue.normalizeClass(`m-editor-props-panel ${vue.unref(propsPanelSize)}`),
|
|
@@ -4374,35 +4375,27 @@
|
|
|
4374
4375
|
await expandNodes();
|
|
4375
4376
|
setTreeKeyStatus();
|
|
4376
4377
|
});
|
|
4377
|
-
const layerPanel = vue.ref();
|
|
4378
4378
|
const mouseenterHandler = () => {
|
|
4379
|
-
|
|
4379
|
+
tree.value?.$el.focus();
|
|
4380
4380
|
};
|
|
4381
4381
|
const mouseleaveHandler = () => {
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
isMultiSelectStatus.value = false;
|
|
4382
|
+
tree.value?.$el.blur();
|
|
4383
|
+
isMultiSelectStatus.value = false;
|
|
4385
4384
|
};
|
|
4386
4385
|
let keycon;
|
|
4387
4386
|
vue.onMounted(() => {
|
|
4388
|
-
|
|
4389
|
-
layerPanel.value?.addEventListener("mouseleave", mouseleaveHandler);
|
|
4390
|
-
keycon = new KeyController__default.default(layerPanel.value);
|
|
4387
|
+
keycon = new KeyController__default.default(tree.value?.$el);
|
|
4391
4388
|
const isMac = /mac os x/.test(navigator.userAgent.toLowerCase());
|
|
4392
4389
|
const ctrl = isMac ? "meta" : "ctrl";
|
|
4393
4390
|
keycon.keydown(ctrl, (e) => {
|
|
4394
4391
|
e.inputEvent.preventDefault();
|
|
4395
4392
|
isMultiSelectStatus.value = true;
|
|
4396
|
-
}).on("blur", () => {
|
|
4397
|
-
isMultiSelectStatus.value = false;
|
|
4398
4393
|
}).keyup(ctrl, (e) => {
|
|
4399
4394
|
e.inputEvent.preventDefault();
|
|
4400
4395
|
isMultiSelectStatus.value = false;
|
|
4401
4396
|
});
|
|
4402
4397
|
});
|
|
4403
4398
|
vue.onUnmounted(() => {
|
|
4404
|
-
layerPanel.value?.removeEventListener("mouseenter", mouseenterHandler);
|
|
4405
|
-
layerPanel.value?.removeEventListener("mouseleave", mouseleaveHandler);
|
|
4406
4399
|
keycon.destroy();
|
|
4407
4400
|
});
|
|
4408
4401
|
const clicked = vue.ref(false);
|
|
@@ -4459,79 +4452,77 @@
|
|
|
4459
4452
|
menu.value?.show(event);
|
|
4460
4453
|
};
|
|
4461
4454
|
return (_ctx, _cache) => {
|
|
4462
|
-
return vue.openBlock(), vue.
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4469
|
-
|
|
4470
|
-
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
"
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
})
|
|
4534
|
-
], 512);
|
|
4455
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "magic-editor-layer-panel" }, {
|
|
4456
|
+
default: vue.withCtx(() => [
|
|
4457
|
+
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
4458
|
+
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
4459
|
+
modelValue: filterText.value,
|
|
4460
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filterText.value = $event),
|
|
4461
|
+
class: "search-input",
|
|
4462
|
+
size: "small",
|
|
4463
|
+
placeholder: "\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u8FC7\u6EE4",
|
|
4464
|
+
clearable: "",
|
|
4465
|
+
"prefix-icon": vue.unref(iconsVue.Search),
|
|
4466
|
+
onChange: filterTextChangeHandler
|
|
4467
|
+
}, null, 8, ["modelValue", "prefix-icon"]),
|
|
4468
|
+
vue.unref(values).length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTree), {
|
|
4469
|
+
key: 0,
|
|
4470
|
+
tabindex: "-1",
|
|
4471
|
+
class: "magic-editor-layer-tree",
|
|
4472
|
+
ref_key: "tree",
|
|
4473
|
+
ref: tree,
|
|
4474
|
+
"node-key": "id",
|
|
4475
|
+
"empty-text": "\u9875\u9762\u7A7A\u8361\u8361\u7684",
|
|
4476
|
+
draggable: "",
|
|
4477
|
+
"default-expanded-keys": vue.unref(defaultExpandedKeys),
|
|
4478
|
+
load: loadItems,
|
|
4479
|
+
data: vue.unref(values),
|
|
4480
|
+
"default-expand-all": true,
|
|
4481
|
+
"expand-on-click-node": false,
|
|
4482
|
+
"highlight-current": true,
|
|
4483
|
+
props: {
|
|
4484
|
+
children: "items"
|
|
4485
|
+
},
|
|
4486
|
+
"filter-node-method": filterNode,
|
|
4487
|
+
"allow-drop": allowDrop,
|
|
4488
|
+
"show-checkbox": isMultiSelectStatus.value || vue.unref(selectedIds).length > 1,
|
|
4489
|
+
onNodeClick: clickHandler,
|
|
4490
|
+
onNodeContextmenu: contextmenu,
|
|
4491
|
+
onNodeDragEnd: handleDragEnd,
|
|
4492
|
+
onNodeCollapse: handleCollapse,
|
|
4493
|
+
onNodeExpand: handleExpand,
|
|
4494
|
+
onCheck: multiClickHandler,
|
|
4495
|
+
onMousedown: toggleClickFlag,
|
|
4496
|
+
onMouseup: toggleClickFlag,
|
|
4497
|
+
onMouseenter: mouseenterHandler,
|
|
4498
|
+
onMouseleave: mouseleaveHandler
|
|
4499
|
+
}, {
|
|
4500
|
+
default: vue.withCtx(({ node, data }) => [
|
|
4501
|
+
vue.createElementVNode("div", {
|
|
4502
|
+
id: data.id,
|
|
4503
|
+
class: vue.normalizeClass(["cus-tree-node", { "cus-tree-node-hover": canHighlight(data) }]),
|
|
4504
|
+
onMouseenter: ($event) => vue.unref(highlightHandler)(data)
|
|
4505
|
+
}, [
|
|
4506
|
+
vue.renderSlot(_ctx.$slots, "layer-node-content", {
|
|
4507
|
+
node,
|
|
4508
|
+
data
|
|
4509
|
+
}, () => [
|
|
4510
|
+
vue.createElementVNode("span", null, vue.toDisplayString(`${data.name} (${data.id})`), 1)
|
|
4511
|
+
])
|
|
4512
|
+
], 42, _hoisted_1$4)
|
|
4513
|
+
]),
|
|
4514
|
+
_: 3
|
|
4515
|
+
}, 8, ["default-expanded-keys", "data", "show-checkbox"])) : vue.createCommentVNode("", true),
|
|
4516
|
+
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
4517
|
+
vue.createVNode(_sfc_main$b, {
|
|
4518
|
+
ref_key: "menu",
|
|
4519
|
+
ref: menu,
|
|
4520
|
+
"layer-content-menu": __props.layerContentMenu
|
|
4521
|
+
}, null, 8, ["layer-content-menu"])
|
|
4522
|
+
]))
|
|
4523
|
+
]),
|
|
4524
|
+
_: 3
|
|
4525
|
+
});
|
|
4535
4526
|
};
|
|
4536
4527
|
}
|
|
4537
4528
|
});
|