@tmagic/editor 1.2.0-beta.15 → 1.2.0-beta.16
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,19 +3161,19 @@
|
|
|
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.
|
|
3166
|
+
(vue.openBlock(), vue.createBlock(vue.unref(form.MForm), {
|
|
3166
3167
|
ref_key: "configForm",
|
|
3167
3168
|
ref: configForm,
|
|
3169
|
+
key: vue.unref(node)?.type,
|
|
3168
3170
|
class: vue.normalizeClass(`m-editor-props-panel ${vue.unref(propsPanelSize)}`),
|
|
3169
3171
|
"popper-class": `m-editor-props-panel-popper ${vue.unref(propsPanelSize)}`,
|
|
3170
3172
|
size: vue.unref(propsPanelSize),
|
|
3171
3173
|
"init-values": values.value,
|
|
3172
3174
|
config: curFormConfig.value,
|
|
3173
3175
|
onChange: submit
|
|
3174
|
-
}, null, 8, ["class", "popper-class", "size", "init-values", "config"])
|
|
3176
|
+
}, null, 8, ["class", "popper-class", "size", "init-values", "config"]))
|
|
3175
3177
|
]);
|
|
3176
3178
|
};
|
|
3177
3179
|
}
|
|
@@ -4374,35 +4376,27 @@
|
|
|
4374
4376
|
await expandNodes();
|
|
4375
4377
|
setTreeKeyStatus();
|
|
4376
4378
|
});
|
|
4377
|
-
const layerPanel = vue.ref();
|
|
4378
4379
|
const mouseenterHandler = () => {
|
|
4379
|
-
|
|
4380
|
+
tree.value?.$el.focus();
|
|
4380
4381
|
};
|
|
4381
4382
|
const mouseleaveHandler = () => {
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
isMultiSelectStatus.value = false;
|
|
4383
|
+
tree.value?.$el.blur();
|
|
4384
|
+
isMultiSelectStatus.value = false;
|
|
4385
4385
|
};
|
|
4386
4386
|
let keycon;
|
|
4387
4387
|
vue.onMounted(() => {
|
|
4388
|
-
|
|
4389
|
-
layerPanel.value?.addEventListener("mouseleave", mouseleaveHandler);
|
|
4390
|
-
keycon = new KeyController__default.default(layerPanel.value);
|
|
4388
|
+
keycon = new KeyController__default.default(tree.value?.$el);
|
|
4391
4389
|
const isMac = /mac os x/.test(navigator.userAgent.toLowerCase());
|
|
4392
4390
|
const ctrl = isMac ? "meta" : "ctrl";
|
|
4393
4391
|
keycon.keydown(ctrl, (e) => {
|
|
4394
4392
|
e.inputEvent.preventDefault();
|
|
4395
4393
|
isMultiSelectStatus.value = true;
|
|
4396
|
-
}).on("blur", () => {
|
|
4397
|
-
isMultiSelectStatus.value = false;
|
|
4398
4394
|
}).keyup(ctrl, (e) => {
|
|
4399
4395
|
e.inputEvent.preventDefault();
|
|
4400
4396
|
isMultiSelectStatus.value = false;
|
|
4401
4397
|
});
|
|
4402
4398
|
});
|
|
4403
4399
|
vue.onUnmounted(() => {
|
|
4404
|
-
layerPanel.value?.removeEventListener("mouseenter", mouseenterHandler);
|
|
4405
|
-
layerPanel.value?.removeEventListener("mouseleave", mouseleaveHandler);
|
|
4406
4400
|
keycon.destroy();
|
|
4407
4401
|
});
|
|
4408
4402
|
const clicked = vue.ref(false);
|
|
@@ -4459,79 +4453,77 @@
|
|
|
4459
4453
|
menu.value?.show(event);
|
|
4460
4454
|
};
|
|
4461
4455
|
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);
|
|
4456
|
+
return vue.openBlock(), vue.createBlock(vue.unref(design.TMagicScrollbar), { class: "magic-editor-layer-panel" }, {
|
|
4457
|
+
default: vue.withCtx(() => [
|
|
4458
|
+
vue.renderSlot(_ctx.$slots, "layer-panel-header"),
|
|
4459
|
+
vue.createVNode(vue.unref(design.TMagicInput), {
|
|
4460
|
+
modelValue: filterText.value,
|
|
4461
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filterText.value = $event),
|
|
4462
|
+
class: "search-input",
|
|
4463
|
+
size: "small",
|
|
4464
|
+
placeholder: "\u8F93\u5165\u5173\u952E\u5B57\u8FDB\u884C\u8FC7\u6EE4",
|
|
4465
|
+
clearable: "",
|
|
4466
|
+
"prefix-icon": vue.unref(iconsVue.Search),
|
|
4467
|
+
onChange: filterTextChangeHandler
|
|
4468
|
+
}, null, 8, ["modelValue", "prefix-icon"]),
|
|
4469
|
+
vue.unref(values).length ? (vue.openBlock(), vue.createBlock(vue.unref(design.TMagicTree), {
|
|
4470
|
+
key: 0,
|
|
4471
|
+
tabindex: "-1",
|
|
4472
|
+
class: "magic-editor-layer-tree",
|
|
4473
|
+
ref_key: "tree",
|
|
4474
|
+
ref: tree,
|
|
4475
|
+
"node-key": "id",
|
|
4476
|
+
"empty-text": "\u9875\u9762\u7A7A\u8361\u8361\u7684",
|
|
4477
|
+
draggable: "",
|
|
4478
|
+
"default-expanded-keys": vue.unref(defaultExpandedKeys),
|
|
4479
|
+
load: loadItems,
|
|
4480
|
+
data: vue.unref(values),
|
|
4481
|
+
"default-expand-all": true,
|
|
4482
|
+
"expand-on-click-node": false,
|
|
4483
|
+
"highlight-current": true,
|
|
4484
|
+
props: {
|
|
4485
|
+
children: "items"
|
|
4486
|
+
},
|
|
4487
|
+
"filter-node-method": filterNode,
|
|
4488
|
+
"allow-drop": allowDrop,
|
|
4489
|
+
"show-checkbox": isMultiSelectStatus.value || vue.unref(selectedIds).length > 1,
|
|
4490
|
+
onNodeClick: clickHandler,
|
|
4491
|
+
onNodeContextmenu: contextmenu,
|
|
4492
|
+
onNodeDragEnd: handleDragEnd,
|
|
4493
|
+
onNodeCollapse: handleCollapse,
|
|
4494
|
+
onNodeExpand: handleExpand,
|
|
4495
|
+
onCheck: multiClickHandler,
|
|
4496
|
+
onMousedown: toggleClickFlag,
|
|
4497
|
+
onMouseup: toggleClickFlag,
|
|
4498
|
+
onMouseenter: mouseenterHandler,
|
|
4499
|
+
onMouseleave: mouseleaveHandler
|
|
4500
|
+
}, {
|
|
4501
|
+
default: vue.withCtx(({ node, data }) => [
|
|
4502
|
+
vue.createElementVNode("div", {
|
|
4503
|
+
id: data.id,
|
|
4504
|
+
class: vue.normalizeClass(["cus-tree-node", { "cus-tree-node-hover": canHighlight(data) }]),
|
|
4505
|
+
onMouseenter: ($event) => vue.unref(highlightHandler)(data)
|
|
4506
|
+
}, [
|
|
4507
|
+
vue.renderSlot(_ctx.$slots, "layer-node-content", {
|
|
4508
|
+
node,
|
|
4509
|
+
data
|
|
4510
|
+
}, () => [
|
|
4511
|
+
vue.createElementVNode("span", null, vue.toDisplayString(`${data.name} (${data.id})`), 1)
|
|
4512
|
+
])
|
|
4513
|
+
], 42, _hoisted_1$4)
|
|
4514
|
+
]),
|
|
4515
|
+
_: 3
|
|
4516
|
+
}, 8, ["default-expanded-keys", "data", "show-checkbox"])) : vue.createCommentVNode("", true),
|
|
4517
|
+
(vue.openBlock(), vue.createBlock(vue.Teleport, { to: "body" }, [
|
|
4518
|
+
vue.createVNode(_sfc_main$b, {
|
|
4519
|
+
ref_key: "menu",
|
|
4520
|
+
ref: menu,
|
|
4521
|
+
"layer-content-menu": __props.layerContentMenu
|
|
4522
|
+
}, null, 8, ["layer-content-menu"])
|
|
4523
|
+
]))
|
|
4524
|
+
]),
|
|
4525
|
+
_: 3
|
|
4526
|
+
});
|
|
4535
4527
|
};
|
|
4536
4528
|
}
|
|
4537
4529
|
});
|