vue-devui 1.6.4 → 1.6.5
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/auto-complete/index.es.js +1 -2
- package/auto-complete/index.umd.js +1 -1
- package/breadcrumb/index.es.js +2 -15
- package/breadcrumb/index.umd.js +1 -1
- package/button/index.es.js +1 -2
- package/button/index.umd.js +1 -1
- package/carousel/index.es.js +36 -213
- package/carousel/index.umd.js +1 -1
- package/carousel/style.css +1 -1
- package/category-search/index.es.js +3 -17
- package/category-search/index.umd.js +10 -10
- package/collapse/index.es.js +15 -18
- package/collapse/index.umd.js +5 -5
- package/data-grid/index.es.js +3 -17
- package/data-grid/index.umd.js +6 -6
- package/date-picker-pro/index.es.js +21 -6
- package/date-picker-pro/index.umd.js +12 -12
- package/date-picker-pro/style.css +1 -1
- package/dropdown/index.es.js +2 -15
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.es.js +2 -3
- package/editable-select/index.umd.js +2 -2
- package/editor-md/index.es.js +32 -18
- package/editor-md/index.umd.js +15 -15
- package/icon/index.es.js +1 -2
- package/icon/index.umd.js +1 -1
- package/input/index.es.js +21 -6
- package/input/index.umd.js +11 -11
- package/input/style.css +1 -1
- package/mention/index.es.js +1 -2
- package/mention/index.umd.js +1 -1
- package/message/index.es.js +1 -2
- package/message/index.umd.js +1 -1
- package/modal/index.es.js +27 -4
- package/modal/index.umd.js +7 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +1 -2
- package/notification/index.umd.js +2 -2
- package/package.json +1 -1
- package/pagination/index.es.js +55 -253
- package/pagination/index.umd.js +18 -23
- package/pagination/style.css +1 -1
- package/result/index.es.js +1 -2
- package/result/index.umd.js +1 -1
- package/search/index.es.js +48 -27
- package/search/index.umd.js +18 -14
- package/search/style.css +1 -1
- package/select/index.es.js +43 -42
- package/select/index.umd.js +11 -16
- package/select/style.css +1 -1
- package/steps/index.es.js +1 -2
- package/steps/index.umd.js +1 -1
- package/style.css +2 -2
- package/table/index.es.js +3 -17
- package/table/index.umd.js +6 -6
- package/time-picker/index.es.js +21 -6
- package/time-picker/index.umd.js +16 -16
- package/time-picker/style.css +1 -1
- package/time-select/index.es.js +43 -42
- package/time-select/index.umd.js +9 -14
- package/time-select/style.css +1 -1
- package/timeline/index.es.js +1 -2
- package/timeline/index.umd.js +1 -1
- package/types/carousel/src/components/carousel-icons.d.ts +2 -0
- package/types/dropdown/src/use-dropdown.d.ts +1 -1
- package/types/editor-md/src/composables/use-editor-md.d.ts +1 -0
- package/types/editor-md/src/editor-md-types.d.ts +3 -0
- package/types/icon/src/icon-types.d.ts +0 -1
- package/types/modal/src/components/modal-icons.d.ts +1 -0
- package/types/svg-icons/index.d.ts +3 -0
- package/upload/index.es.js +1 -2
- package/upload/index.umd.js +2 -2
- package/vue-devui.es.js +186 -96
- package/vue-devui.umd.js +97 -86
- package/types/search/src/components/search-close-icon.d.ts +0 -2
- package/types/search/src/components/search-icon.d.ts +0 -2
- package/types/select/src/components/select-arrow-icon.d.ts +0 -2
package/editor-md/index.es.js
CHANGED
|
@@ -21,7 +21,7 @@ var __publicField = (obj, key, value) => {
|
|
|
21
21
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
22
|
return value;
|
|
23
23
|
};
|
|
24
|
-
import { toRefs, onMounted, onUnmounted, watch, defineComponent, ref, renderSlot, useSlots, createVNode, reactive, computed, nextTick,
|
|
24
|
+
import { toRefs, onMounted, onUnmounted, watch, defineComponent, ref, renderSlot, useSlots, createVNode, reactive, computed, nextTick, onBeforeUnmount, onBeforeMount, Transition, mergeProps, unref, withModifiers, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, provide, Teleport, vShow, createTextVNode, isVNode } from "vue";
|
|
25
25
|
import "clipboard";
|
|
26
26
|
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
27
27
|
import { onClickOutside } from "@vueuse/core";
|
|
@@ -7268,13 +7268,15 @@ function useEditorMd(props, ctx) {
|
|
|
7268
7268
|
customHintReplaceFn,
|
|
7269
7269
|
hintConfig,
|
|
7270
7270
|
disableChangeEvent,
|
|
7271
|
-
modelValue
|
|
7271
|
+
modelValue,
|
|
7272
|
+
beforeShowHint
|
|
7272
7273
|
} = toRefs(props);
|
|
7273
7274
|
const toolbars = reactive(cloneDeep_1(DEFAULT_TOOLBARS));
|
|
7274
7275
|
const editorRef = ref();
|
|
7275
7276
|
const renderRef = ref();
|
|
7276
7277
|
const overlayRef = ref();
|
|
7277
7278
|
const cursorRef = ref();
|
|
7279
|
+
const containerRef = ref();
|
|
7278
7280
|
const isHintShow = ref();
|
|
7279
7281
|
const previewHtmlList = ref([]);
|
|
7280
7282
|
let editorIns;
|
|
@@ -7388,6 +7390,13 @@ function useEditorMd(props, ctx) {
|
|
|
7388
7390
|
const cursor = editorIns.getCursor();
|
|
7389
7391
|
let i = prefixes.value.length;
|
|
7390
7392
|
const value = editorIns.getLine(cursor.line).replace(/\t/g, " ");
|
|
7393
|
+
let result = false;
|
|
7394
|
+
if (beforeShowHint == null ? void 0 : beforeShowHint.value) {
|
|
7395
|
+
result = beforeShowHint.value(value);
|
|
7396
|
+
}
|
|
7397
|
+
if (result) {
|
|
7398
|
+
return;
|
|
7399
|
+
}
|
|
7391
7400
|
const selection = editorIns.getSelection();
|
|
7392
7401
|
const isImgRegx = /^\!\[\S+/;
|
|
7393
7402
|
if (selection) {
|
|
@@ -7502,12 +7511,22 @@ function useEditorMd(props, ctx) {
|
|
|
7502
7511
|
}
|
|
7503
7512
|
}
|
|
7504
7513
|
};
|
|
7514
|
+
const onDocumentClick = (e) => {
|
|
7515
|
+
var _a;
|
|
7516
|
+
if (isHintShow.value && e.target !== containerRef.value && !((_a = containerRef.value) == null ? void 0 : _a.contains(e.target))) {
|
|
7517
|
+
hideHint();
|
|
7518
|
+
}
|
|
7519
|
+
};
|
|
7505
7520
|
onMounted(async () => {
|
|
7506
7521
|
await import("codemirror/addon/display/placeholder.js");
|
|
7507
7522
|
await import("codemirror/mode/markdown/markdown.js");
|
|
7508
7523
|
const module = await import("codemirror");
|
|
7509
7524
|
CodeMirror = module.default;
|
|
7510
7525
|
initEditor();
|
|
7526
|
+
document.addEventListener("click", onDocumentClick);
|
|
7527
|
+
});
|
|
7528
|
+
onBeforeUnmount(() => {
|
|
7529
|
+
document.removeEventListener("click", onDocumentClick);
|
|
7511
7530
|
});
|
|
7512
7531
|
watch(modelValue, (val) => {
|
|
7513
7532
|
if (editorIns) {
|
|
@@ -7548,6 +7567,7 @@ function useEditorMd(props, ctx) {
|
|
|
7548
7567
|
overlayRef,
|
|
7549
7568
|
cursorRef,
|
|
7550
7569
|
renderRef,
|
|
7570
|
+
containerRef,
|
|
7551
7571
|
toolbars,
|
|
7552
7572
|
previewHtmlList,
|
|
7553
7573
|
isHintShow,
|
|
@@ -7675,6 +7695,9 @@ const editorMdProps = __spreadProps(__spreadValues({}, commonProps), {
|
|
|
7675
7695
|
},
|
|
7676
7696
|
customHintReplaceFn: {
|
|
7677
7697
|
type: Function
|
|
7698
|
+
},
|
|
7699
|
+
beforeShowHint: {
|
|
7700
|
+
type: Function
|
|
7678
7701
|
}
|
|
7679
7702
|
});
|
|
7680
7703
|
const EditorMdInjectionKey = Symbol("d-editor-md");
|
|
@@ -7826,17 +7849,7 @@ const useDropdownEvent = ({ id, isOpen, origin, dropdownRef, props, emit }) => {
|
|
|
7826
7849
|
onInvalidate(() => subscriptions.forEach((v) => v()));
|
|
7827
7850
|
});
|
|
7828
7851
|
};
|
|
7829
|
-
function useDropdown(id, visible, isOpen, origin, dropdownRef,
|
|
7830
|
-
const calcPopDirection = (dropdownEl) => {
|
|
7831
|
-
const elementHeight = dropdownEl.offsetHeight;
|
|
7832
|
-
const bottomDistance = window.innerHeight - origin.value.getBoundingClientRect().bottom;
|
|
7833
|
-
const isBottomEnough = bottomDistance >= elementHeight;
|
|
7834
|
-
if (!isBottomEnough) {
|
|
7835
|
-
popDirection.value = "top";
|
|
7836
|
-
} else {
|
|
7837
|
-
popDirection.value = "bottom";
|
|
7838
|
-
}
|
|
7839
|
-
};
|
|
7852
|
+
function useDropdown(id, visible, isOpen, origin, dropdownRef, emit) {
|
|
7840
7853
|
watch(visible, (newVal, oldVal) => {
|
|
7841
7854
|
if (oldVal === void 0) {
|
|
7842
7855
|
return;
|
|
@@ -7860,9 +7873,6 @@ function useDropdown(id, visible, isOpen, origin, dropdownRef, popDirection, emi
|
|
|
7860
7873
|
}
|
|
7861
7874
|
}
|
|
7862
7875
|
}
|
|
7863
|
-
if (dropdownEl) {
|
|
7864
|
-
calcPopDirection(dropdownEl);
|
|
7865
|
-
}
|
|
7866
7876
|
});
|
|
7867
7877
|
onMounted(() => {
|
|
7868
7878
|
dropdownMap.set(id, { toggleEl: origin.value });
|
|
@@ -8251,7 +8261,7 @@ var Dropdown = defineComponent({
|
|
|
8251
8261
|
props,
|
|
8252
8262
|
emit
|
|
8253
8263
|
});
|
|
8254
|
-
useDropdown(id, visible, isOpen, origin, dropdownRef,
|
|
8264
|
+
useDropdown(id, visible, isOpen, origin, dropdownRef, emit);
|
|
8255
8265
|
const {
|
|
8256
8266
|
overlayModelValue,
|
|
8257
8267
|
overlayShowValue,
|
|
@@ -9237,6 +9247,7 @@ var EditorMd = defineComponent({
|
|
|
9237
9247
|
overlayRef,
|
|
9238
9248
|
cursorRef,
|
|
9239
9249
|
renderRef,
|
|
9250
|
+
containerRef,
|
|
9240
9251
|
isHintShow,
|
|
9241
9252
|
toolbars,
|
|
9242
9253
|
previewHtmlList,
|
|
@@ -9267,6 +9278,7 @@ var EditorMd = defineComponent({
|
|
|
9267
9278
|
"z-index": fullscreenZIndex.value
|
|
9268
9279
|
}, {
|
|
9269
9280
|
default: () => [createVNode("div", {
|
|
9281
|
+
"ref": containerRef,
|
|
9270
9282
|
"class": ["dp-md-container", {
|
|
9271
9283
|
"dp-md-readonly": mode.value === "readonly",
|
|
9272
9284
|
"dp-md-editonly": mode.value === "editonly",
|
|
@@ -9293,7 +9305,9 @@ var EditorMd = defineComponent({
|
|
|
9293
9305
|
"onUpdate:modelValue": ($event) => isHintShow.value = $event,
|
|
9294
9306
|
"origin": cursorRef.value || void 0,
|
|
9295
9307
|
"align": "start",
|
|
9296
|
-
"position": ["bottom-start"]
|
|
9308
|
+
"position": ["bottom-start"],
|
|
9309
|
+
"onClick": withModifiers(() => {
|
|
9310
|
+
}, ["stop"])
|
|
9297
9311
|
}, {
|
|
9298
9312
|
default: () => {
|
|
9299
9313
|
var _a, _b;
|