vue-devui 1.5.2 → 1.5.4-alpha.0
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/README.md +5 -0
- package/breadcrumb/index.es.js +845 -0
- package/breadcrumb/index.umd.js +1 -0
- package/breadcrumb/package.json +8 -0
- package/breadcrumb/style.css +1 -0
- package/code-editor/index.es.js +5874 -0
- package/code-editor/index.umd.js +27 -0
- package/code-editor/package.json +8 -0
- package/code-editor/style.css +1 -0
- package/global.d.ts +3 -0
- package/image-preview/index.es.js +14 -7
- package/image-preview/index.umd.js +1 -1
- package/menu/index.es.js +4 -3
- package/menu/index.umd.js +1 -1
- package/modal/index.es.js +6 -0
- package/modal/index.umd.js +1 -1
- package/nuxt/components/Breadcrumb.js +3 -0
- package/nuxt/components/BreadcrumbItem.js +3 -0
- package/nuxt/components/CodeEditor.js +3 -0
- package/nuxt/components/breadcrumbItemProps.js +3 -0
- package/nuxt/components/breadcrumbProps.js +3 -0
- package/nuxt/components/codeEditorProps.js +3 -0
- package/package.json +3 -2
- package/pagination/index.es.js +1 -0
- package/pagination/index.umd.js +6 -6
- package/select/index.es.js +1 -0
- package/select/index.umd.js +4 -4
- package/style.css +1 -1
- package/time-select/index.es.js +1 -0
- package/time-select/index.umd.js +4 -4
- package/tree/index.es.js +5 -0
- package/tree/index.umd.js +1 -1
- package/types/breadcrumb/index.d.ts +2 -1
- package/types/code-editor/index.d.ts +11 -0
- package/types/code-editor/src/code-editor-types.d.ts +82 -0
- package/types/code-editor/src/code-editor.d.ts +120 -0
- package/types/code-editor/src/composables/use-code-editor.d.ts +5 -0
- package/types/image-preview/src/image-preview-service.d.ts +1 -1
- package/types/nav-sprite/src/nav-sprite.d.ts +1 -1
- package/types/vue-devui.d.ts +3 -2
- package/vue-devui.es.js +478 -14
- package/vue-devui.umd.js +18 -18
package/vue-devui.es.js
CHANGED
|
@@ -33,7 +33,7 @@ var __publicField = (obj, key, value) => {
|
|
|
33
33
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
34
|
return value;
|
|
35
35
|
};
|
|
36
|
-
import { createVNode, getCurrentInstance, defineComponent, toRefs, inject, computed, Fragment, mergeProps, resolveComponent, isVNode, ref, reactive, createTextVNode, provide, onMounted, watch, Transition, withDirectives, vShow, nextTick, onUnmounted, unref, withModifiers, Comment as Comment$1, Text, h, cloneVNode, Teleport, onBeforeUnmount, render, resolveDirective, resolveDynamicComponent, toRef, shallowRef,
|
|
36
|
+
import { createVNode, getCurrentInstance, defineComponent, toRefs, inject, computed, Fragment, mergeProps, resolveComponent, isVNode, ref, reactive, createTextVNode, provide, onMounted, watch, Transition, withDirectives, vShow, nextTick, onUnmounted, unref, withModifiers, Comment as Comment$1, Text, h, cloneVNode, Teleport, onBeforeUnmount, render, resolveDirective, resolveDynamicComponent, toRef, shallowRef, onBeforeMount, onUpdated, readonly, toRaw, watchEffect, renderSlot, useSlots, createApp, shallowReactive, effect, TransitionGroup } from "vue";
|
|
37
37
|
import { useRoute } from "vue-router";
|
|
38
38
|
import { offset, autoPlacement, arrow, shift, computePosition, flip } from "@floating-ui/dom";
|
|
39
39
|
import { onClickOutside, useResizeObserver } from "@vueuse/core";
|
|
@@ -11302,7 +11302,7 @@ var Breadcrumb = defineComponent({
|
|
|
11302
11302
|
var BreadcrumbInstall = {
|
|
11303
11303
|
title: "Breadcrumb \u9762\u5305\u5C51",
|
|
11304
11304
|
category: "\u5BFC\u822A",
|
|
11305
|
-
status: "
|
|
11305
|
+
status: "100%",
|
|
11306
11306
|
install(app) {
|
|
11307
11307
|
app.component(Breadcrumb.name, Breadcrumb);
|
|
11308
11308
|
app.component(BreadcrumbItem.name, BreadcrumbItem);
|
|
@@ -13339,6 +13339,449 @@ var CascaderInstall = {
|
|
|
13339
13339
|
app.component(Cascader.name, Cascader);
|
|
13340
13340
|
}
|
|
13341
13341
|
};
|
|
13342
|
+
const codeEditorProps = {
|
|
13343
|
+
modelValue: {
|
|
13344
|
+
type: String,
|
|
13345
|
+
default: ""
|
|
13346
|
+
},
|
|
13347
|
+
mode: {
|
|
13348
|
+
type: String,
|
|
13349
|
+
default: "normal"
|
|
13350
|
+
},
|
|
13351
|
+
originalText: {
|
|
13352
|
+
type: String,
|
|
13353
|
+
default: ""
|
|
13354
|
+
},
|
|
13355
|
+
theme: {
|
|
13356
|
+
type: String,
|
|
13357
|
+
default: "light"
|
|
13358
|
+
},
|
|
13359
|
+
autoHeight: {
|
|
13360
|
+
type: Boolean,
|
|
13361
|
+
default: false
|
|
13362
|
+
},
|
|
13363
|
+
refreshAll: {
|
|
13364
|
+
type: Boolean,
|
|
13365
|
+
default: false
|
|
13366
|
+
},
|
|
13367
|
+
offsetLeft: {
|
|
13368
|
+
type: Number
|
|
13369
|
+
},
|
|
13370
|
+
addCommentIcon: {
|
|
13371
|
+
type: String,
|
|
13372
|
+
default: ""
|
|
13373
|
+
},
|
|
13374
|
+
expandCommentIcon: {
|
|
13375
|
+
type: String,
|
|
13376
|
+
default: ""
|
|
13377
|
+
},
|
|
13378
|
+
options: {
|
|
13379
|
+
type: Object,
|
|
13380
|
+
default: () => ({})
|
|
13381
|
+
},
|
|
13382
|
+
mouseTargetTypes: {
|
|
13383
|
+
type: Array,
|
|
13384
|
+
default: () => [2, 4]
|
|
13385
|
+
},
|
|
13386
|
+
editorDecorations: {
|
|
13387
|
+
type: Array,
|
|
13388
|
+
default: () => []
|
|
13389
|
+
},
|
|
13390
|
+
comments: {
|
|
13391
|
+
type: Array,
|
|
13392
|
+
default: () => []
|
|
13393
|
+
}
|
|
13394
|
+
};
|
|
13395
|
+
function useCodeEditor(props, ctx2) {
|
|
13396
|
+
const editorEl = ref();
|
|
13397
|
+
const {
|
|
13398
|
+
modelValue,
|
|
13399
|
+
originalText,
|
|
13400
|
+
options,
|
|
13401
|
+
mode,
|
|
13402
|
+
theme,
|
|
13403
|
+
autoHeight,
|
|
13404
|
+
offsetLeft,
|
|
13405
|
+
refreshAll,
|
|
13406
|
+
mouseTargetTypes,
|
|
13407
|
+
editorDecorations,
|
|
13408
|
+
comments,
|
|
13409
|
+
addCommentIcon,
|
|
13410
|
+
expandCommentIcon
|
|
13411
|
+
} = toRefs(props);
|
|
13412
|
+
let monaco;
|
|
13413
|
+
let editor;
|
|
13414
|
+
let diffEditor;
|
|
13415
|
+
let themeService;
|
|
13416
|
+
let currentTheme;
|
|
13417
|
+
let commentViewZones = [];
|
|
13418
|
+
let heightMap = /* @__PURE__ */ new Map();
|
|
13419
|
+
let commentWidgets = [];
|
|
13420
|
+
let currentDecorations = [];
|
|
13421
|
+
let currentLineDecoration = [];
|
|
13422
|
+
let modifyValueFromInner = false;
|
|
13423
|
+
watch(editorDecorations, refreshDecorations, { deep: true });
|
|
13424
|
+
watch(comments, () => {
|
|
13425
|
+
refreshViewZones();
|
|
13426
|
+
refreshOverlayWidgets();
|
|
13427
|
+
}, { deep: true });
|
|
13428
|
+
watch(options, () => {
|
|
13429
|
+
updateLanguage();
|
|
13430
|
+
updateOptions();
|
|
13431
|
+
}, { deep: true });
|
|
13432
|
+
watch(originalText, setDiffEditorOriginValue);
|
|
13433
|
+
watch(theme, setCurrentTheme);
|
|
13434
|
+
watch(modelValue, () => {
|
|
13435
|
+
if (!modifyValueFromInner) {
|
|
13436
|
+
setValue();
|
|
13437
|
+
} else {
|
|
13438
|
+
modifyValueFromInner = false;
|
|
13439
|
+
}
|
|
13440
|
+
});
|
|
13441
|
+
onBeforeMount(() => {
|
|
13442
|
+
if (window["devuiThemeService"]) {
|
|
13443
|
+
themeService = window["devuiThemeService"];
|
|
13444
|
+
if (themeService.eventBus) {
|
|
13445
|
+
themeService.eventBus.add("themeChanged", setCurrentTheme);
|
|
13446
|
+
}
|
|
13447
|
+
}
|
|
13448
|
+
});
|
|
13449
|
+
onMounted(async () => {
|
|
13450
|
+
if (inBrowser) {
|
|
13451
|
+
monaco = await import("monaco-editor");
|
|
13452
|
+
setCurrentTheme();
|
|
13453
|
+
init();
|
|
13454
|
+
if (mode.value === "review") {
|
|
13455
|
+
nextTick(() => {
|
|
13456
|
+
refreshDecorations();
|
|
13457
|
+
refreshOverlayWidgets();
|
|
13458
|
+
refreshViewZones();
|
|
13459
|
+
});
|
|
13460
|
+
}
|
|
13461
|
+
}
|
|
13462
|
+
});
|
|
13463
|
+
function init() {
|
|
13464
|
+
if (mode.value === "normal" || mode.value === "review") {
|
|
13465
|
+
initNormalEditor();
|
|
13466
|
+
} else if (mode.value.includes("diff")) {
|
|
13467
|
+
initDiffEditor();
|
|
13468
|
+
}
|
|
13469
|
+
if (!options.value["theme"]) {
|
|
13470
|
+
monaco.editor.setTheme(currentTheme);
|
|
13471
|
+
}
|
|
13472
|
+
handleAutoHeight();
|
|
13473
|
+
setValueEmitter();
|
|
13474
|
+
}
|
|
13475
|
+
function initNormalEditor() {
|
|
13476
|
+
if (!editor) {
|
|
13477
|
+
editor = monaco.editor.create(editorEl.value, options.value);
|
|
13478
|
+
editor.setModel(monaco.editor.createModel(modelValue.value, options.value["language"]));
|
|
13479
|
+
ctx2.emit("afterEditorInit", editor);
|
|
13480
|
+
if (mode.value === "review") {
|
|
13481
|
+
editor.onMouseMove(handleMouseMove);
|
|
13482
|
+
editor.onMouseLeave(handleMouseLeave);
|
|
13483
|
+
editor.onMouseDown(handleMouseDown);
|
|
13484
|
+
}
|
|
13485
|
+
}
|
|
13486
|
+
}
|
|
13487
|
+
function initDiffEditor() {
|
|
13488
|
+
if (!diffEditor) {
|
|
13489
|
+
diffEditor = monaco.editor.createDiffEditor(editorEl.value, options.value);
|
|
13490
|
+
diffEditor.setModel({
|
|
13491
|
+
original: monaco.editor.createModel(originalText.value, options.value["language"]),
|
|
13492
|
+
modified: monaco.editor.createModel(modelValue.value, options.value["language"])
|
|
13493
|
+
});
|
|
13494
|
+
ctx2.emit("afterEditorInit", diffEditor);
|
|
13495
|
+
}
|
|
13496
|
+
}
|
|
13497
|
+
function setValue() {
|
|
13498
|
+
if (mode.value === "normal" || mode.value === "review") {
|
|
13499
|
+
setEditorValue();
|
|
13500
|
+
} else if (mode.value === "diff") {
|
|
13501
|
+
setDiffEditorValue();
|
|
13502
|
+
}
|
|
13503
|
+
}
|
|
13504
|
+
function setEditorValue() {
|
|
13505
|
+
var _a;
|
|
13506
|
+
if (!editor || !editor.getModel()) {
|
|
13507
|
+
return;
|
|
13508
|
+
}
|
|
13509
|
+
(_a = editor.getModel().modified) == null ? void 0 : _a.setValue(modelValue.value);
|
|
13510
|
+
}
|
|
13511
|
+
function setDiffEditorValue() {
|
|
13512
|
+
var _a;
|
|
13513
|
+
if (!diffEditor || !diffEditor.getModel()) {
|
|
13514
|
+
return;
|
|
13515
|
+
}
|
|
13516
|
+
(_a = diffEditor.getModel().modified) == null ? void 0 : _a.setValue(modelValue.value);
|
|
13517
|
+
}
|
|
13518
|
+
function setCurrentTheme() {
|
|
13519
|
+
if (options.value["theme"]) {
|
|
13520
|
+
return;
|
|
13521
|
+
}
|
|
13522
|
+
if (theme.value === "light") {
|
|
13523
|
+
currentTheme = themeService && themeService.currentTheme.isDark ? "vs-dark" : "vs";
|
|
13524
|
+
} else if (theme.value === "dark") {
|
|
13525
|
+
currentTheme = themeService && themeService.currentTheme.isDark ? "vs" : "vs-dark";
|
|
13526
|
+
}
|
|
13527
|
+
if (editor) {
|
|
13528
|
+
monaco.editor.setTheme(currentTheme);
|
|
13529
|
+
}
|
|
13530
|
+
}
|
|
13531
|
+
function handleAutoHeight() {
|
|
13532
|
+
if (autoHeight.value) {
|
|
13533
|
+
editor.onDidChangeModelDecorations(() => {
|
|
13534
|
+
setTimeout(updateEditorHeightAuto);
|
|
13535
|
+
});
|
|
13536
|
+
}
|
|
13537
|
+
}
|
|
13538
|
+
function setValueEmitter() {
|
|
13539
|
+
let model;
|
|
13540
|
+
if (editor) {
|
|
13541
|
+
model = editor.getModel();
|
|
13542
|
+
} else if (diffEditor) {
|
|
13543
|
+
model = diffEditor.getModel().modified;
|
|
13544
|
+
}
|
|
13545
|
+
model.onDidChangeContent(lodash.exports.throttle(() => {
|
|
13546
|
+
modifyValueFromInner = true;
|
|
13547
|
+
ctx2.emit("update: modelValue", model.getValue());
|
|
13548
|
+
}, 100));
|
|
13549
|
+
}
|
|
13550
|
+
function setDiffEditorOriginValue() {
|
|
13551
|
+
var _a;
|
|
13552
|
+
if (!diffEditor || !diffEditor.getModel()) {
|
|
13553
|
+
return;
|
|
13554
|
+
}
|
|
13555
|
+
(_a = diffEditor.getModel().original) == null ? void 0 : _a.setValue(originalText.value);
|
|
13556
|
+
}
|
|
13557
|
+
function updateLanguage() {
|
|
13558
|
+
const language = options.value.language;
|
|
13559
|
+
if (editor) {
|
|
13560
|
+
if (mode.value === "normal" || mode.value === "review") {
|
|
13561
|
+
const model = diffEditor.getModel();
|
|
13562
|
+
monaco.editor.setModelLanguage(model.modified, language);
|
|
13563
|
+
monaco.editor.setModelLanguage(model.original, language);
|
|
13564
|
+
}
|
|
13565
|
+
}
|
|
13566
|
+
}
|
|
13567
|
+
function updateOptions() {
|
|
13568
|
+
if (editor) {
|
|
13569
|
+
editor.updateOptions(__spreadValues({}, options.value));
|
|
13570
|
+
}
|
|
13571
|
+
if (diffEditor) {
|
|
13572
|
+
diffEditor.updateOptions(__spreadValues({}, options.value));
|
|
13573
|
+
}
|
|
13574
|
+
}
|
|
13575
|
+
function updateEditorHeightAuto() {
|
|
13576
|
+
var _a;
|
|
13577
|
+
const lineHeight = editor.getOption(monaco.editor.EditorOption.lineHeight);
|
|
13578
|
+
const lineCount = ((_a = editor.getModel()) == null ? void 0 : _a.getLineCount()) || 1;
|
|
13579
|
+
const height = editor.getTopForLineNumber(lineCount + 1) + lineHeight;
|
|
13580
|
+
if (editorEl.value) {
|
|
13581
|
+
editorEl.value.style.height = `${height}px`;
|
|
13582
|
+
}
|
|
13583
|
+
editor.layout();
|
|
13584
|
+
}
|
|
13585
|
+
function handleMouseMove(event) {
|
|
13586
|
+
if (event.target && event.target.position) {
|
|
13587
|
+
const currentLineNumber = event.target.position.lineNumber;
|
|
13588
|
+
if (!isDecorationExisted(currentLineNumber)) {
|
|
13589
|
+
const lineDecoration = [
|
|
13590
|
+
{
|
|
13591
|
+
range: new monaco.Range(currentLineNumber, 0, currentLineNumber, 0),
|
|
13592
|
+
option: {
|
|
13593
|
+
isWholeLine: true,
|
|
13594
|
+
glyphMarginClassName: `icon-pointer ${addCommentIcon.value}`
|
|
13595
|
+
}
|
|
13596
|
+
}
|
|
13597
|
+
];
|
|
13598
|
+
currentLineDecoration = editor.deltaDecorations(currentLineDecoration, lineDecoration);
|
|
13599
|
+
} else {
|
|
13600
|
+
currentLineDecoration = editor.deltaDecorations(currentLineDecoration, []);
|
|
13601
|
+
}
|
|
13602
|
+
}
|
|
13603
|
+
}
|
|
13604
|
+
function handleMouseLeave() {
|
|
13605
|
+
editor.deltaDecorations(currentLineDecoration, []);
|
|
13606
|
+
}
|
|
13607
|
+
function handleMouseDown(event) {
|
|
13608
|
+
if (mouseTargetTypes.value.includes(event.target.type)) {
|
|
13609
|
+
ctx2.emit("click", event);
|
|
13610
|
+
}
|
|
13611
|
+
}
|
|
13612
|
+
function refreshDecorations() {
|
|
13613
|
+
if (editorDecorations.value.length >= 0 && editor) {
|
|
13614
|
+
const tempDecorations = editorDecorations.value.map(setDecorations);
|
|
13615
|
+
setTimeout(() => {
|
|
13616
|
+
currentDecorations = editor.deltaDecorations(currentDecorations, tempDecorations);
|
|
13617
|
+
});
|
|
13618
|
+
currentDecorations = editor.deltaDecorations(currentLineDecoration, []);
|
|
13619
|
+
}
|
|
13620
|
+
}
|
|
13621
|
+
function setDecorations(decoration) {
|
|
13622
|
+
return {
|
|
13623
|
+
range: new monaco.Range(decoration.lineNumber, 1, decoration.lineNumber, 1),
|
|
13624
|
+
options: {
|
|
13625
|
+
isWholeLine: true,
|
|
13626
|
+
className: decoration.customClasses || "",
|
|
13627
|
+
glyphMarginClassName: `icon-pointer ${decoration.icon || expandCommentIcon.value} ${decoration.glyphClassName || ""}`
|
|
13628
|
+
}
|
|
13629
|
+
};
|
|
13630
|
+
}
|
|
13631
|
+
function isDecorationExisted(lineNumber) {
|
|
13632
|
+
return editorDecorations.value.some((ed) => ed.lineNumber === lineNumber);
|
|
13633
|
+
}
|
|
13634
|
+
function refreshViewZones() {
|
|
13635
|
+
if (editor) {
|
|
13636
|
+
editor.changeViewZones((changeAccessor) => {
|
|
13637
|
+
resetViewZones(changeAccessor);
|
|
13638
|
+
renderViewZones(changeAccessor);
|
|
13639
|
+
if (autoHeight.value) {
|
|
13640
|
+
updateEditorHeightAuto();
|
|
13641
|
+
}
|
|
13642
|
+
});
|
|
13643
|
+
}
|
|
13644
|
+
}
|
|
13645
|
+
function resetViewZones(changeAccessor) {
|
|
13646
|
+
if (commentViewZones.length > 0) {
|
|
13647
|
+
commentViewZones.forEach((commentId) => {
|
|
13648
|
+
changeAccessor.removeZone(commentId.id);
|
|
13649
|
+
});
|
|
13650
|
+
commentViewZones = [];
|
|
13651
|
+
heightMap = /* @__PURE__ */ new Map();
|
|
13652
|
+
}
|
|
13653
|
+
}
|
|
13654
|
+
function renderViewZones(changeAccessor) {
|
|
13655
|
+
if (comments.value && comments.value.length) {
|
|
13656
|
+
const renderedComments = comments.value.filter((comment2) => comment2.isExpanded);
|
|
13657
|
+
renderedComments.forEach((comment2) => {
|
|
13658
|
+
const commentId = changeAccessor.addZone({
|
|
13659
|
+
afterLineNumber: comment2.lineNumber,
|
|
13660
|
+
heightInPx: comment2.heightInPx ? comment2.heightInPx : 0,
|
|
13661
|
+
afterColumn: 1,
|
|
13662
|
+
domNode: document.createElement("div"),
|
|
13663
|
+
ondomNodeTop: (top) => {
|
|
13664
|
+
layoutOverlayWidget(comment2.lineNumber, { top });
|
|
13665
|
+
},
|
|
13666
|
+
onComputedHeight: (height) => {
|
|
13667
|
+
layoutOverlayWidget(comment2.lineNumber, { height });
|
|
13668
|
+
}
|
|
13669
|
+
});
|
|
13670
|
+
commentViewZones.push({ lineNumber: comment2.lineNumber, id: commentId });
|
|
13671
|
+
});
|
|
13672
|
+
}
|
|
13673
|
+
}
|
|
13674
|
+
function layoutOverlayWidget(lineNumber, ...positionInfos) {
|
|
13675
|
+
const index2 = comments.value.findIndex((comment2) => comment2.lineNumber === lineNumber);
|
|
13676
|
+
const editorLayoutInfo = editor.getLayoutInfo();
|
|
13677
|
+
const layoutInfo = calculateLayoutInfo(positionInfos, editorLayoutInfo, index2);
|
|
13678
|
+
if (layoutInfo.height) {
|
|
13679
|
+
heightMap.set(index2, layoutInfo.height);
|
|
13680
|
+
}
|
|
13681
|
+
comments.value[index2].domNode.style.width = `${editorLayoutInfo.width - layoutInfo.minimapWidth - layoutInfo.offsetLeft}px`;
|
|
13682
|
+
handleDomNodePosition(layoutInfo.top, layoutInfo.height, index2);
|
|
13683
|
+
}
|
|
13684
|
+
function calculateLayoutInfo(positionInfos, editorLayoutInfo, index2) {
|
|
13685
|
+
let _offsetLeft = 0;
|
|
13686
|
+
const indexOffsetLeft = comments.value[index2].offserLeft;
|
|
13687
|
+
if (indexOffsetLeft) {
|
|
13688
|
+
_offsetLeft = indexOffsetLeft;
|
|
13689
|
+
} else {
|
|
13690
|
+
_offsetLeft = (offsetLeft == null ? void 0 : offsetLeft.value) ? offsetLeft == null ? void 0 : offsetLeft.value : 0;
|
|
13691
|
+
}
|
|
13692
|
+
return {
|
|
13693
|
+
top: positionInfos[0].top,
|
|
13694
|
+
height: positionInfos[0].height,
|
|
13695
|
+
minimapWidth: editorLayoutInfo.minimap.minimapWidth,
|
|
13696
|
+
offsetLeft: _offsetLeft
|
|
13697
|
+
};
|
|
13698
|
+
}
|
|
13699
|
+
function handleDomNodePosition(top, hieght, index2) {
|
|
13700
|
+
comments.value[index2].domNode.style.height = `${hieght}px`;
|
|
13701
|
+
if (heightMap.get(index2) === 0) {
|
|
13702
|
+
comments.value[index2].domNode.style.top = `-${1e4 + top}px`;
|
|
13703
|
+
} else {
|
|
13704
|
+
comments.value[index2].domNode.style.top = `${top}px`;
|
|
13705
|
+
}
|
|
13706
|
+
}
|
|
13707
|
+
function refreshOverlayWidgets() {
|
|
13708
|
+
if (editor) {
|
|
13709
|
+
renderOverlayWidget();
|
|
13710
|
+
}
|
|
13711
|
+
}
|
|
13712
|
+
function renderOverlayWidget() {
|
|
13713
|
+
if (refreshAll.value) {
|
|
13714
|
+
resetAllOverlayWidget();
|
|
13715
|
+
} else {
|
|
13716
|
+
resetOverlayWidget();
|
|
13717
|
+
}
|
|
13718
|
+
const renderedWidget = comments.value.filter((comment2) => comment2.isExpanded);
|
|
13719
|
+
renderedWidget == null ? void 0 : renderedWidget.forEach((comment2) => {
|
|
13720
|
+
const commentIndex = commentWidgets.findIndex((cw) => cw.lineNumber === comment2.lineNumber);
|
|
13721
|
+
if (commentIndex === -1) {
|
|
13722
|
+
const overlayWidget = buildOverlayWidget(comment2);
|
|
13723
|
+
commentWidgets.push({ lineNumber: comment2.lineNumber, widget: overlayWidget });
|
|
13724
|
+
editor.addOverlayWidget(overlayWidget);
|
|
13725
|
+
}
|
|
13726
|
+
});
|
|
13727
|
+
}
|
|
13728
|
+
function resetOverlayWidget() {
|
|
13729
|
+
comments.value.forEach((comment2) => {
|
|
13730
|
+
if (!comment2.isExpanded) {
|
|
13731
|
+
const commentIndex = commentWidgets.findIndex((cw) => cw.lineNumber === comment2.lineNumber);
|
|
13732
|
+
if (commentIndex !== -1) {
|
|
13733
|
+
const commentRemoved = commentWidgets.splice(commentIndex, 1)[0];
|
|
13734
|
+
editor.removeOverlayWidget(commentRemoved.widget);
|
|
13735
|
+
}
|
|
13736
|
+
}
|
|
13737
|
+
});
|
|
13738
|
+
}
|
|
13739
|
+
function resetAllOverlayWidget() {
|
|
13740
|
+
if (commentWidgets.length > 0) {
|
|
13741
|
+
commentWidgets.forEach((widget) => {
|
|
13742
|
+
editor.removeOverlayWidget(widget.widget);
|
|
13743
|
+
});
|
|
13744
|
+
commentWidgets = [];
|
|
13745
|
+
}
|
|
13746
|
+
}
|
|
13747
|
+
function buildOverlayWidget(comment2) {
|
|
13748
|
+
return {
|
|
13749
|
+
getId: () => {
|
|
13750
|
+
return `widget-lineNumber${comment2.lineNumber}`;
|
|
13751
|
+
},
|
|
13752
|
+
getDomNode: () => {
|
|
13753
|
+
return comment2.domNode;
|
|
13754
|
+
},
|
|
13755
|
+
getPosition: () => {
|
|
13756
|
+
return null;
|
|
13757
|
+
}
|
|
13758
|
+
};
|
|
13759
|
+
}
|
|
13760
|
+
return { editorEl };
|
|
13761
|
+
}
|
|
13762
|
+
var codeEditor = "";
|
|
13763
|
+
var CodeEditor = defineComponent({
|
|
13764
|
+
name: "DCodeEditor",
|
|
13765
|
+
props: codeEditorProps,
|
|
13766
|
+
emits: ["update: modelValue", "afterEditorInit", "click"],
|
|
13767
|
+
setup(props, ctx2) {
|
|
13768
|
+
const {
|
|
13769
|
+
editorEl
|
|
13770
|
+
} = useCodeEditor(props, ctx2);
|
|
13771
|
+
return () => createVNode("div", {
|
|
13772
|
+
"ref": editorEl,
|
|
13773
|
+
"class": "devui-code-editor"
|
|
13774
|
+
}, null);
|
|
13775
|
+
}
|
|
13776
|
+
});
|
|
13777
|
+
var CodeEditorInstall = {
|
|
13778
|
+
title: "Code Editor \u4EE3\u7801\u7F16\u8F91\u5668",
|
|
13779
|
+
category: "\u6570\u636E\u5F55\u5165",
|
|
13780
|
+
status: "100%",
|
|
13781
|
+
install(app) {
|
|
13782
|
+
app.component(CodeEditor.name, CodeEditor);
|
|
13783
|
+
}
|
|
13784
|
+
};
|
|
13342
13785
|
const SELECT_TOKEN$1 = Symbol("dCollapse");
|
|
13343
13786
|
const collapseProps = {
|
|
13344
13787
|
modelValue: {
|
|
@@ -22571,10 +23014,10 @@ class ImagePreviewService {
|
|
|
22571
23014
|
this.$body.style.setProperty("overflow", "hidden", "important");
|
|
22572
23015
|
}
|
|
22573
23016
|
static close() {
|
|
22574
|
-
var _a;
|
|
23017
|
+
var _a, _b;
|
|
22575
23018
|
(_a = this.$body) == null ? void 0 : _a.style.setProperty("overflow", this.$overflow);
|
|
22576
23019
|
this.$overflow = null;
|
|
22577
|
-
this.$div && this.$body.removeChild(this.$div);
|
|
23020
|
+
this.$div && ((_b = this.$body) == null ? void 0 : _b.removeChild(this.$div));
|
|
22578
23021
|
this.$body = null;
|
|
22579
23022
|
this.$div = null;
|
|
22580
23023
|
}
|
|
@@ -22594,7 +23037,11 @@ function unmountedPreviewImages() {
|
|
|
22594
23037
|
ImagePreviewService.close();
|
|
22595
23038
|
}
|
|
22596
23039
|
function getImgByEl(el) {
|
|
22597
|
-
const
|
|
23040
|
+
const imgs = [...el.querySelectorAll("img")];
|
|
23041
|
+
const urlList = imgs.map((item) => {
|
|
23042
|
+
var _a;
|
|
23043
|
+
return (_a = item.getAttribute("preview-src") || item.getAttribute("src")) != null ? _a : "";
|
|
23044
|
+
});
|
|
22598
23045
|
return urlList;
|
|
22599
23046
|
}
|
|
22600
23047
|
function handleImg(e) {
|
|
@@ -22605,6 +23052,9 @@ function handleImg(e) {
|
|
|
22605
23052
|
if (((_a = target == null ? void 0 : target.nodeName) == null ? void 0 : _a.toLowerCase()) === "img") {
|
|
22606
23053
|
const urlList = getImgByEl(el);
|
|
22607
23054
|
const url2 = target.getAttribute("src");
|
|
23055
|
+
if (!url2) {
|
|
23056
|
+
return console.error("attribute is not exist");
|
|
23057
|
+
}
|
|
22608
23058
|
mountedPreviewImages({
|
|
22609
23059
|
url: url2,
|
|
22610
23060
|
previewUrlList: urlList,
|
|
@@ -22621,7 +23071,7 @@ function removeHandle(el) {
|
|
|
22621
23071
|
}
|
|
22622
23072
|
var ImagePreviewDirective = {
|
|
22623
23073
|
mounted(el, binding) {
|
|
22624
|
-
if (!binding.value) {
|
|
23074
|
+
if (!(binding == null ? void 0 : binding.value)) {
|
|
22625
23075
|
return handleImgByEl(el);
|
|
22626
23076
|
}
|
|
22627
23077
|
const { custom, disableDefault } = binding.value;
|
|
@@ -22647,9 +23097,9 @@ var ImagePreviewDirective = {
|
|
|
22647
23097
|
},
|
|
22648
23098
|
updated(el, binding) {
|
|
22649
23099
|
var _a, _b;
|
|
22650
|
-
el.zIndex = (_a = binding.value) == null ? void 0 : _a.zIndex;
|
|
22651
|
-
el.backDropZIndex = (_b = binding.value) == null ? void 0 : _b.backDropZIndex;
|
|
22652
|
-
if (binding.value) {
|
|
23100
|
+
el.zIndex = (_a = binding == null ? void 0 : binding.value) == null ? void 0 : _a.zIndex;
|
|
23101
|
+
el.backDropZIndex = (_b = binding == null ? void 0 : binding.value) == null ? void 0 : _b.backDropZIndex;
|
|
23102
|
+
if (binding == null ? void 0 : binding.value) {
|
|
22653
23103
|
const {
|
|
22654
23104
|
value: { disableDefault },
|
|
22655
23105
|
oldValue: { disableDefault: oldDisableDefault }
|
|
@@ -23881,7 +24331,7 @@ var MenuItem = defineComponent({
|
|
|
23881
24331
|
useClick(e);
|
|
23882
24332
|
}
|
|
23883
24333
|
isSelect.value = true;
|
|
23884
|
-
changeRouteResult = changeRoute(props, router, useRouter, key);
|
|
24334
|
+
changeRouteResult = changeRoute(props, router, useRouter.value, key);
|
|
23885
24335
|
} else {
|
|
23886
24336
|
if (ele.classList.contains(menuItemSelect)) {
|
|
23887
24337
|
rootMenuEmit("deselect", {
|
|
@@ -24377,7 +24827,8 @@ var Menu = defineComponent({
|
|
|
24377
24827
|
openKeys,
|
|
24378
24828
|
mode,
|
|
24379
24829
|
collapsed,
|
|
24380
|
-
defaultSelectKeys
|
|
24830
|
+
defaultSelectKeys,
|
|
24831
|
+
router
|
|
24381
24832
|
} = toRefs(props);
|
|
24382
24833
|
const menuId = randomId(16);
|
|
24383
24834
|
const store = useStore(menuId);
|
|
@@ -24390,7 +24841,7 @@ var Menu = defineComponent({
|
|
|
24390
24841
|
provide("mode", mode);
|
|
24391
24842
|
provide("collapsedIndent", props["collapsedIndent"]);
|
|
24392
24843
|
provide("rootMenuEmit", ctx2.emit);
|
|
24393
|
-
provide("useRouter",
|
|
24844
|
+
provide("useRouter", router);
|
|
24394
24845
|
setDefaultIndent(props["indentSize"]);
|
|
24395
24846
|
const menuRoot = ref(null);
|
|
24396
24847
|
const overflowItemLength = ref(0);
|
|
@@ -25060,6 +25511,12 @@ var Modal = defineComponent({
|
|
|
25060
25511
|
watch(modelValue, (val) => {
|
|
25061
25512
|
if (val && !keepLast.value) {
|
|
25062
25513
|
clearPosition();
|
|
25514
|
+
nextTick(() => {
|
|
25515
|
+
const autofocus = document == null ? void 0 : document.querySelector("[autofocus]");
|
|
25516
|
+
if (autofocus) {
|
|
25517
|
+
autofocus.focus();
|
|
25518
|
+
}
|
|
25519
|
+
});
|
|
25063
25520
|
}
|
|
25064
25521
|
});
|
|
25065
25522
|
const renderType = () => {
|
|
@@ -25837,6 +26294,7 @@ function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
|
|
|
25837
26294
|
handleClose();
|
|
25838
26295
|
blur2();
|
|
25839
26296
|
}
|
|
26297
|
+
filterQuery.value = "";
|
|
25840
26298
|
};
|
|
25841
26299
|
const tagDelete = (data) => {
|
|
25842
26300
|
let { modelValue } = props;
|
|
@@ -37193,6 +37651,11 @@ function useOperate() {
|
|
|
37193
37651
|
}
|
|
37194
37652
|
setNodeValue(parentNode, "expanded", true);
|
|
37195
37653
|
setNodeValue(parentNode, "isLeaf", false);
|
|
37654
|
+
let childrenLen = parentNode.childNodeCount;
|
|
37655
|
+
if (!childrenLen) {
|
|
37656
|
+
childrenLen = 0;
|
|
37657
|
+
setNodeValue(parentNode, "childNodeCount", childrenLen + 1);
|
|
37658
|
+
}
|
|
37196
37659
|
if (lastChild) {
|
|
37197
37660
|
setNodeValue(lastChild, "parentChildNodeCount", children.length + 1);
|
|
37198
37661
|
}
|
|
@@ -38969,6 +39432,7 @@ const installs = [
|
|
|
38969
39432
|
CarouselInstall,
|
|
38970
39433
|
CascaderInstall,
|
|
38971
39434
|
CheckboxInstall,
|
|
39435
|
+
CodeEditorInstall,
|
|
38972
39436
|
CollapseInstall,
|
|
38973
39437
|
ColorPickerInstall,
|
|
38974
39438
|
CommentInstall,
|
|
@@ -39036,9 +39500,9 @@ const installs = [
|
|
|
39036
39500
|
VirtualListInstall
|
|
39037
39501
|
];
|
|
39038
39502
|
var vueDevui = {
|
|
39039
|
-
version: "1.5.
|
|
39503
|
+
version: "1.5.4-alpha.0",
|
|
39040
39504
|
install(app) {
|
|
39041
39505
|
installs.forEach((p) => app.use(p));
|
|
39042
39506
|
}
|
|
39043
39507
|
};
|
|
39044
|
-
export { Accordion, Alert, Anchor, Aside, AutoComplete, Avatar, BackTop, Badge, Breadcrumb, DButton as Button, ButtonGroup, Card, Carousel, CarouselItem, Cascader, Checkbox, CheckboxButton, DCheckboxGroup as CheckboxGroup, Col, Collapse, CollapseItem, ColorPicker, Column, Comment, Content, Countdown, DRangeDatePickerPro, DatePicker, DatePickerPro, DraggableDirective, Drawer, DrawerService, Dropdown$1 as Dropdown, DropdownMenu, DroppableDirective, EditableSelect, FixedOverlay, FlexibleOverlay, Footer$1 as Footer, Form, FormItem, FormOperation, Fullscreen, Gantt, Header$1 as Header, DIcon as Icon, IconGroup, ImagePreviewDirective, ImagePreviewService, DInput as Input, InputIcon, InputNumber, Layout, List, ListItem, LoadingDirective, loading as LoadingService, Mention, Menu, MenuItem, Message, Modal, MultiAutoComplete, NavSprite, Notification, NotificationService, Option, OptionGroup, Pagination, Panel, PanelBody, PanelFooter, PanelHeader, Popover, Progress, QuadrantDiagram, Radio, RadioButton, RadioGroup, Rate, ReadTip, Result, RippleDirective, Row, DSearch as Search, Select, Skeleton, SkeletonItem, Slider, SortableDirective, Splitter, Statistic, Status, Step, Steps, StepsGuide, StepsGuideDirective, StickSlider, Sticky, SubMenu, Switch, Tab, Table, Tabs, Tag, TagInput, Textarea, TimePicker, TimeSelect, Timeline, TimelineItem, Tooltip, Transfer, Tree, TreeSelect, Upload, VirtualList, vueDevui as default };
|
|
39508
|
+
export { Accordion, Alert, Anchor, Aside, AutoComplete, Avatar, BackTop, Badge, Breadcrumb, BreadcrumbItem, DButton as Button, ButtonGroup, Card, Carousel, CarouselItem, Cascader, Checkbox, CheckboxButton, DCheckboxGroup as CheckboxGroup, CodeEditor, Col, Collapse, CollapseItem, ColorPicker, Column, Comment, Content, Countdown, DRangeDatePickerPro, DatePicker, DatePickerPro, DraggableDirective, Drawer, DrawerService, Dropdown$1 as Dropdown, DropdownMenu, DroppableDirective, EditableSelect, FixedOverlay, FlexibleOverlay, Footer$1 as Footer, Form, FormItem, FormOperation, Fullscreen, Gantt, Header$1 as Header, DIcon as Icon, IconGroup, ImagePreviewDirective, ImagePreviewService, DInput as Input, InputIcon, InputNumber, Layout, List, ListItem, LoadingDirective, loading as LoadingService, Mention, Menu, MenuItem, Message, Modal, MultiAutoComplete, NavSprite, Notification, NotificationService, Option, OptionGroup, Pagination, Panel, PanelBody, PanelFooter, PanelHeader, Popover, Progress, QuadrantDiagram, Radio, RadioButton, RadioGroup, Rate, ReadTip, Result, RippleDirective, Row, DSearch as Search, Select, Skeleton, SkeletonItem, Slider, SortableDirective, Splitter, Statistic, Status, Step, Steps, StepsGuide, StepsGuideDirective, StickSlider, Sticky, SubMenu, Switch, Tab, Table, Tabs, Tag, TagInput, Textarea, TimePicker, TimeSelect, Timeline, TimelineItem, Tooltip, Transfer, Tree, TreeSelect, Upload, VirtualList, vueDevui as default };
|