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.
Files changed (77) hide show
  1. package/auto-complete/index.es.js +1 -2
  2. package/auto-complete/index.umd.js +1 -1
  3. package/breadcrumb/index.es.js +2 -15
  4. package/breadcrumb/index.umd.js +1 -1
  5. package/button/index.es.js +1 -2
  6. package/button/index.umd.js +1 -1
  7. package/carousel/index.es.js +36 -213
  8. package/carousel/index.umd.js +1 -1
  9. package/carousel/style.css +1 -1
  10. package/category-search/index.es.js +3 -17
  11. package/category-search/index.umd.js +10 -10
  12. package/collapse/index.es.js +15 -18
  13. package/collapse/index.umd.js +5 -5
  14. package/data-grid/index.es.js +3 -17
  15. package/data-grid/index.umd.js +6 -6
  16. package/date-picker-pro/index.es.js +21 -6
  17. package/date-picker-pro/index.umd.js +12 -12
  18. package/date-picker-pro/style.css +1 -1
  19. package/dropdown/index.es.js +2 -15
  20. package/dropdown/index.umd.js +1 -1
  21. package/editable-select/index.es.js +2 -3
  22. package/editable-select/index.umd.js +2 -2
  23. package/editor-md/index.es.js +32 -18
  24. package/editor-md/index.umd.js +15 -15
  25. package/icon/index.es.js +1 -2
  26. package/icon/index.umd.js +1 -1
  27. package/input/index.es.js +21 -6
  28. package/input/index.umd.js +11 -11
  29. package/input/style.css +1 -1
  30. package/mention/index.es.js +1 -2
  31. package/mention/index.umd.js +1 -1
  32. package/message/index.es.js +1 -2
  33. package/message/index.umd.js +1 -1
  34. package/modal/index.es.js +27 -4
  35. package/modal/index.umd.js +7 -1
  36. package/modal/style.css +1 -1
  37. package/notification/index.es.js +1 -2
  38. package/notification/index.umd.js +2 -2
  39. package/package.json +1 -1
  40. package/pagination/index.es.js +55 -253
  41. package/pagination/index.umd.js +18 -23
  42. package/pagination/style.css +1 -1
  43. package/result/index.es.js +1 -2
  44. package/result/index.umd.js +1 -1
  45. package/search/index.es.js +48 -27
  46. package/search/index.umd.js +18 -14
  47. package/search/style.css +1 -1
  48. package/select/index.es.js +43 -42
  49. package/select/index.umd.js +11 -16
  50. package/select/style.css +1 -1
  51. package/steps/index.es.js +1 -2
  52. package/steps/index.umd.js +1 -1
  53. package/style.css +2 -2
  54. package/table/index.es.js +3 -17
  55. package/table/index.umd.js +6 -6
  56. package/time-picker/index.es.js +21 -6
  57. package/time-picker/index.umd.js +16 -16
  58. package/time-picker/style.css +1 -1
  59. package/time-select/index.es.js +43 -42
  60. package/time-select/index.umd.js +9 -14
  61. package/time-select/style.css +1 -1
  62. package/timeline/index.es.js +1 -2
  63. package/timeline/index.umd.js +1 -1
  64. package/types/carousel/src/components/carousel-icons.d.ts +2 -0
  65. package/types/dropdown/src/use-dropdown.d.ts +1 -1
  66. package/types/editor-md/src/composables/use-editor-md.d.ts +1 -0
  67. package/types/editor-md/src/editor-md-types.d.ts +3 -0
  68. package/types/icon/src/icon-types.d.ts +0 -1
  69. package/types/modal/src/components/modal-icons.d.ts +1 -0
  70. package/types/svg-icons/index.d.ts +3 -0
  71. package/upload/index.es.js +1 -2
  72. package/upload/index.umd.js +2 -2
  73. package/vue-devui.es.js +186 -96
  74. package/vue-devui.umd.js +97 -86
  75. package/types/search/src/components/search-close-icon.d.ts +0 -2
  76. package/types/search/src/components/search-icon.d.ts +0 -2
  77. package/types/select/src/components/select-arrow-icon.d.ts +0 -2
@@ -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, onBeforeMount, onBeforeUnmount, Transition, mergeProps, unref, withModifiers, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, provide, Teleport, vShow, createTextVNode, isVNode } from "vue";
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, popDirection, emit) {
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, currentPosition, emit);
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;