vue-devui 1.5.13 → 1.5.15-feat.1

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 (86) hide show
  1. package/auto-complete/index.es.js +3 -0
  2. package/auto-complete/index.umd.js +1 -1
  3. package/breadcrumb/index.es.js +3 -0
  4. package/breadcrumb/index.umd.js +1 -1
  5. package/checkbox/index.es.js +3 -0
  6. package/checkbox/index.umd.js +1 -1
  7. package/code-review/index.es.js +39 -14
  8. package/code-review/index.umd.js +14 -14
  9. package/date-picker-pro/index.es.js +3 -0
  10. package/date-picker-pro/index.umd.js +8 -8
  11. package/dropdown/index.es.js +3 -0
  12. package/dropdown/index.umd.js +1 -1
  13. package/editable-select/index.es.js +5 -1
  14. package/editable-select/index.umd.js +7 -7
  15. package/editor-md/index.es.js +1428 -1213
  16. package/editor-md/index.umd.js +45 -45
  17. package/editor-md/style.css +1 -1
  18. package/form/index.es.js +3 -0
  19. package/form/index.umd.js +1 -1
  20. package/git-graph/index.es.js +3 -0
  21. package/git-graph/index.umd.js +12 -12
  22. package/input/index.es.js +3 -0
  23. package/input/index.umd.js +6 -6
  24. package/input-number/index.es.js +3 -0
  25. package/input-number/index.umd.js +1 -1
  26. package/mention/index.es.js +3 -0
  27. package/mention/index.umd.js +1 -1
  28. package/menu/index.es.js +6 -2
  29. package/menu/index.umd.js +1 -1
  30. package/modal/index.es.js +3 -0
  31. package/modal/index.umd.js +1 -1
  32. package/nuxt/components/checkbox.js +3 -0
  33. package/overlay/index.es.js +3 -0
  34. package/overlay/index.umd.js +1 -1
  35. package/package.json +1 -1
  36. package/pagination/index.es.js +156 -292
  37. package/pagination/index.umd.js +18 -18
  38. package/pagination/style.css +1 -1
  39. package/popover/index.es.js +3 -0
  40. package/popover/index.umd.js +6 -6
  41. package/radio/index.es.js +3 -0
  42. package/radio/index.umd.js +1 -1
  43. package/search/index.es.js +3 -0
  44. package/search/index.umd.js +1 -1
  45. package/select/index.es.js +120 -265
  46. package/select/index.umd.js +17 -17
  47. package/select/style.css +1 -1
  48. package/splitter/index.es.js +14 -6
  49. package/splitter/index.umd.js +4 -4
  50. package/splitter/style.css +1 -1
  51. package/style.css +1 -1
  52. package/switch/index.es.js +3 -0
  53. package/switch/index.umd.js +1 -1
  54. package/table/index.es.js +14 -6
  55. package/table/index.umd.js +2 -2
  56. package/table/style.css +1 -1
  57. package/textarea/index.es.js +3 -0
  58. package/textarea/index.umd.js +1 -1
  59. package/time-picker/index.es.js +3 -0
  60. package/time-picker/index.umd.js +1 -1
  61. package/time-select/index.es.js +120 -265
  62. package/time-select/index.umd.js +18 -18
  63. package/time-select/style.css +1 -1
  64. package/tooltip/index.es.js +14 -6
  65. package/tooltip/index.umd.js +9 -9
  66. package/tooltip/style.css +1 -1
  67. package/tree/index.es.js +3 -0
  68. package/tree/index.umd.js +1 -1
  69. package/types/code-review/src/utils.d.ts +3 -3
  70. package/types/editable-select/src/editable-select.d.ts +1 -1
  71. package/types/editor-md/index.d.ts +1 -0
  72. package/types/editor-md/src/components/md-render.d.ts +1 -1
  73. package/types/editor-md/src/composables/use-editor-md.d.ts +3 -0
  74. package/types/editor-md/src/editor-md-types.d.ts +9 -1
  75. package/types/editor-md/src/editor-md.d.ts +6 -3
  76. package/types/editor-md/src/plugins/checkbox.d.ts +1 -0
  77. package/types/menu/src/menu-types.d.ts +4 -0
  78. package/types/menu/src/menu.d.ts +9 -0
  79. package/types/pagination/src/pagination-types.d.ts +4 -13
  80. package/types/pagination/src/pagination.d.ts +218 -0
  81. package/types/select/src/select-types.d.ts +4 -23
  82. package/types/select/src/select.d.ts +1 -19
  83. package/types/select/src/use-select.d.ts +1 -1
  84. package/types/tag/src/tag.d.ts +2 -2
  85. package/vue-devui.es.js +283 -263
  86. package/vue-devui.umd.js +50 -50
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 as render$1, resolveDirective, resolveDynamicComponent, toRef, shallowRef, onBeforeMount, onUpdated, readonly, toRaw, watchEffect, renderSlot, useSlots, createApp, shallowReactive, vModelText, effect, TransitionGroup } from "vue";
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 as render$1, 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 Clipboard from "clipboard";
39
39
  import { offset, autoPlacement, arrow, shift, computePosition, flip } from "@floating-ui/dom";
@@ -7904,6 +7904,9 @@ function useOverlay(props, emit) {
7904
7904
  ];
7905
7905
  props.showArrow && middleware.push(arrow({ element: arrowEl }));
7906
7906
  props.shiftOffset !== void 0 && middleware.push(shift());
7907
+ if (!overlayEl) {
7908
+ return;
7909
+ }
7907
7910
  const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
7908
7911
  strategy: "fixed",
7909
7912
  middleware
@@ -14635,7 +14638,7 @@ function updateExpandLineCount(expandDom, newExpandDom) {
14635
14638
  const newChangedNumRight = parseInt((curMatches == null ? void 0 : curMatches[4]) || "") + parseInt((newMatches == null ? void 0 : newMatches[4]) || "");
14636
14639
  expandDom.children[1].children[0].innerText = `@@ -${(newMatches == null ? void 0 : newMatches[1]) || 0},${newChangedNumLeft} +${(newMatches == null ? void 0 : newMatches[3]) || 0},${newChangedNumRight} @@`;
14637
14640
  }
14638
- function parseDiffCode(container, code, outputFormat) {
14641
+ function parseDiffCode(container, code, outputFormat, isAddCode = false) {
14639
14642
  var _a;
14640
14643
  const diff2HtmlUi = new Diff2HtmlUI(container, code, {
14641
14644
  drawFileList: false,
@@ -14646,7 +14649,7 @@ function parseDiffCode(container, code, outputFormat) {
14646
14649
  });
14647
14650
  if (outputFormat === "side-by-side") {
14648
14651
  let diffHtmlStr = diff2HtmlUi.diffHtml;
14649
- if (diffHtmlStr.match(EmptyDataLangReg)) {
14652
+ if (diffHtmlStr.match(EmptyDataLangReg) && isAddCode) {
14650
14653
  diffHtmlStr = diffHtmlStr.replace(EmptyDataLangReg, "");
14651
14654
  }
14652
14655
  const trList = diffHtmlStr.match(TableTrReg);
@@ -14680,6 +14683,7 @@ function updateExpandUpDownButton(trNode) {
14680
14683
  trNode.children[0].children[0].innerHTML = AllExpandIcon();
14681
14684
  }
14682
14685
  function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, position, updateExpandButton = false) {
14686
+ var _a, _b;
14683
14687
  let nextL;
14684
14688
  let prevL;
14685
14689
  let nextR;
@@ -14692,9 +14696,9 @@ function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, posit
14692
14696
  prevR = Math.max(nextR - expandThreshold + 1, 1);
14693
14697
  } else if (position === "bottom") {
14694
14698
  const prevLineNode = trNode.previousElementSibling;
14695
- prevL = parseInt(prevLineNode.children[0].innerText) + 1;
14699
+ prevL = parseInt((_a = prevLineNode == null ? void 0 : prevLineNode.children[0]) == null ? void 0 : _a.innerText) + 1;
14696
14700
  nextL = prevL + expandThreshold - 1;
14697
- prevR = parseInt(prevLineNode.children[2].innerText) + 1;
14701
+ prevR = parseInt((_b = prevLineNode == null ? void 0 : prevLineNode.children[2]) == null ? void 0 : _b.innerText) + 1;
14698
14702
  nextR = prevR + expandThreshold - 1;
14699
14703
  } else {
14700
14704
  const prevLineNode = trNode.previousElementSibling;
@@ -14710,9 +14714,14 @@ function updateLineNumberInDatasetForDoubleColumn(trNode, expandThreshold, posit
14710
14714
  updateExpandUpDownButton(trNode);
14711
14715
  }
14712
14716
  }
14717
+ if (isNaN(prevL) || isNaN(prevR) || isNaN(nextL) || isNaN(nextR)) {
14718
+ return false;
14719
+ }
14713
14720
  setLineNumberInDataset(trNode, prevL, prevR, nextL, nextR);
14721
+ return true;
14714
14722
  }
14715
14723
  function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpandButton = false) {
14724
+ var _a, _b, _c, _d;
14716
14725
  let nextL;
14717
14726
  let prevL;
14718
14727
  let nextR;
@@ -14725,9 +14734,9 @@ function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpa
14725
14734
  prevR = Math.max(nextR - expandThreshold + 1, 1);
14726
14735
  } else if (position === "bottom") {
14727
14736
  const prevLineNode = trNode.previousElementSibling;
14728
- prevL = parseInt(prevLineNode.children[0].children[0].innerText) + 1;
14737
+ prevL = parseInt((_b = (_a = prevLineNode == null ? void 0 : prevLineNode.children[0].children) == null ? void 0 : _a[0]) == null ? void 0 : _b.innerText) + 1;
14729
14738
  nextL = prevL + expandThreshold - 1;
14730
- prevR = parseInt(prevLineNode.children[0].children[1].innerText) + 1;
14739
+ prevR = parseInt((_d = (_c = prevLineNode == null ? void 0 : prevLineNode.children[0].children) == null ? void 0 : _c[1]) == null ? void 0 : _d.innerText) + 1;
14731
14740
  nextR = prevR + expandThreshold - 1;
14732
14741
  } else {
14733
14742
  const prevLineNode = trNode.previousElementSibling;
@@ -14743,7 +14752,11 @@ function updateLineNumberInDataset(trNode, expandThreshold, position, updateExpa
14743
14752
  updateExpandUpDownButton(trNode);
14744
14753
  }
14745
14754
  }
14755
+ if (isNaN(prevL) || isNaN(prevR) || isNaN(nextL) || isNaN(nextR)) {
14756
+ return false;
14757
+ }
14746
14758
  setLineNumberInDataset(trNode, prevL, prevR, nextL, nextR);
14759
+ return true;
14747
14760
  }
14748
14761
  function getLineNumberFromDataset(expandDom, expandThreshold) {
14749
14762
  var _a, _b, _c;
@@ -14921,10 +14934,16 @@ function useCodeReviewExpand(reviewContentRef, props) {
14921
14934
  }
14922
14935
  }
14923
14936
  const loadMoreLine = trNodes[0].cloneNode(true);
14924
- loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
14937
+ if (loadMoreLine.children[0].children[0]) {
14938
+ loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
14939
+ }
14925
14940
  loadMoreLine.children[1].innerText = "";
14926
14941
  (_a = trNodes[0].parentElement) == null ? void 0 : _a.appendChild(loadMoreLine);
14927
- updateLineNumberInDatasetForDoubleColumn(loadMoreLine, expandThreshold.value, "bottom");
14942
+ const res = updateLineNumberInDatasetForDoubleColumn(loadMoreLine, expandThreshold.value, "bottom");
14943
+ if (!res) {
14944
+ loadMoreLine.remove();
14945
+ return;
14946
+ }
14928
14947
  attachExpandUpDownButton(loadMoreLine.children[0], "down");
14929
14948
  };
14930
14949
  const insertIncrementCodeForDoubleColumn = (code, direction, referenceDom) => {
@@ -14936,7 +14955,7 @@ function useCodeReviewExpand(reviewContentRef, props) {
14936
14955
  }
14937
14956
  const prefix = "--- updated_at Jan 1, 2019, 0:0:0 AM\n+++ updated_at Jan 1, 2019, 0:0:0 AM\n";
14938
14957
  const container = document.createElement("div");
14939
- parseDiffCode(container, prefix + code, outputFormat.value);
14958
+ parseDiffCode(container, prefix + code, outputFormat.value, true);
14940
14959
  const trNodes = Array.from(container.querySelectorAll("tr"));
14941
14960
  const expandLine = trNodes.find((element) => {
14942
14961
  var _a;
@@ -14998,10 +15017,16 @@ function useCodeReviewExpand(reviewContentRef, props) {
14998
15017
  }
14999
15018
  }
15000
15019
  const loadMoreLine = trNodes[0].cloneNode(true);
15001
- loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
15020
+ if (loadMoreLine.children[0].children[0]) {
15021
+ loadMoreLine.children[0].removeChild(loadMoreLine.children[0].children[0]);
15022
+ }
15002
15023
  loadMoreLine.children[1].innerText = "";
15003
15024
  (_a = trNodes[0].parentElement) == null ? void 0 : _a.appendChild(loadMoreLine);
15004
- updateLineNumberInDataset(loadMoreLine, expandThreshold.value, "bottom");
15025
+ const res = updateLineNumberInDataset(loadMoreLine, expandThreshold.value, "bottom");
15026
+ if (!res) {
15027
+ loadMoreLine.remove();
15028
+ return;
15029
+ }
15005
15030
  attachExpandUpDownButton(loadMoreLine.children[0], "down");
15006
15031
  };
15007
15032
  const insertIncrementCode = (code, direction, referenceDom) => {
@@ -15013,7 +15038,7 @@ function useCodeReviewExpand(reviewContentRef, props) {
15013
15038
  }
15014
15039
  const prefix = "--- updated_at Jan 1, 2019, 0:0:0 AM\n+++ updated_at Jan 1, 2019, 0:0:0 AM\n";
15015
15040
  const container = document.createElement("div");
15016
- parseDiffCode(container, prefix + code, outputFormat.value);
15041
+ parseDiffCode(container, prefix + code, outputFormat.value, true);
15017
15042
  const trNodes = Array.from(container.querySelectorAll("tr"));
15018
15043
  const expandLine = trNodes.find((element) => {
15019
15044
  var _a;
@@ -23426,6 +23451,7 @@ function useInputEvent(inputRef, props, states, ctx2) {
23426
23451
  };
23427
23452
  const handleInputChange = () => {
23428
23453
  states.query = states.inputValue;
23454
+ ctx2.emit("inputChange", states.query);
23429
23455
  handleQueryChange(states.query);
23430
23456
  };
23431
23457
  const debouncedOnInputChange = lodash.exports.debounce(handleInputChange, delay.value);
@@ -23484,7 +23510,7 @@ function _isSlot$8(s) {
23484
23510
  var EditableSelect = defineComponent({
23485
23511
  name: "DEditableSelect",
23486
23512
  props: editableSelectProps,
23487
- emits: ["update:modelValue", "focus", "blur", "clear", "change", "visibleChange", "loadMore"],
23513
+ emits: ["update:modelValue", "focus", "blur", "clear", "change", "visibleChange", "loadMore", "inputChange"],
23488
23514
  setup(props, ctx2) {
23489
23515
  const ns2 = useNamespace$1("editable-select");
23490
23516
  const inputRef = ref();
@@ -23764,7 +23790,7 @@ var Fullscreen = defineComponent({
23764
23790
  });
23765
23791
  var FullscreenInstall = {
23766
23792
  title: "Fullscreen \u5168\u5C4F",
23767
- category: "\u57FA\u7840\u7EC4\u4EF6",
23793
+ category: "\u901A\u7528",
23768
23794
  install(app) {
23769
23795
  app.component(Fullscreen.name, Fullscreen);
23770
23796
  }
@@ -25396,11 +25422,19 @@ function useEditorMd(props, ctx2) {
25396
25422
  const toolbars = reactive(cloneDeep_1(DEFAULT_TOOLBARS));
25397
25423
  const editorRef = ref();
25398
25424
  const renderRef = ref();
25425
+ const overlayRef = ref();
25426
+ const cursorRef = ref();
25427
+ const isHintShow = ref();
25399
25428
  const previewHtmlList = ref([]);
25400
25429
  let editorIns;
25401
25430
  let canPreviewScrollView = false;
25431
+ let cursorHint = "";
25432
+ let cursorHintEnd = -1;
25433
+ let cursorHintStart = -1;
25434
+ let prefix;
25435
+ let hintShow = false;
25402
25436
  let CodeMirror;
25403
- computed(() => {
25437
+ const prefixes = computed(() => {
25404
25438
  const result2 = [];
25405
25439
  for (const key in hintConfig == null ? void 0 : hintConfig.value) {
25406
25440
  if (typeof (hintConfig == null ? void 0 : hintConfig.value[key]) === "function" || (hintConfig == null ? void 0 : hintConfig.value[key]) && typeof (hintConfig == null ? void 0 : hintConfig.value[key].handler) === "function") {
@@ -25455,7 +25489,91 @@ function useEditorMd(props, ctx2) {
25455
25489
  canPreviewScrollView = false;
25456
25490
  };
25457
25491
  const onChecked = (e) => {
25458
- ctx2.emit("mdCheckedEvent", e);
25492
+ ctx2.emit("checkedChange", e);
25493
+ };
25494
+ let timer;
25495
+ const attachOverlay = () => {
25496
+ timer = setTimeout(() => {
25497
+ var _a;
25498
+ cursorRef.value = ((_a = editorRef.value) == null ? void 0 : _a.parentNode.querySelector(".CodeMirror-cursor")) || void 0;
25499
+ overlayRef.value.updatePosition();
25500
+ isHintShow.value = true;
25501
+ hintShow = true;
25502
+ });
25503
+ };
25504
+ const hideHint = () => {
25505
+ clearTimeout(timer);
25506
+ isHintShow.value = false;
25507
+ };
25508
+ const showHint = () => {
25509
+ if (hintShow) {
25510
+ hideHint();
25511
+ }
25512
+ attachOverlay();
25513
+ };
25514
+ const getHintList = () => {
25515
+ let handler;
25516
+ if (typeof hintConfig.value[prefix] === "function") {
25517
+ handler = hintConfig.value[prefix];
25518
+ } else if (hintConfig.value[prefix] && typeof hintConfig.value[prefix].handler === "function") {
25519
+ handler = hintConfig.value[prefix].handler;
25520
+ }
25521
+ const callback = (replaceText) => {
25522
+ const cursor = editorIns.getCursor();
25523
+ const endCh = cursorHintEnd;
25524
+ const startCh = cursorHintStart;
25525
+ if (editorIns.getLine(cursor.line).length === cursor.ch) {
25526
+ editorIns.replaceRange(replaceText + " ", { line: cursor.line, ch: startCh }, { line: cursor.line, ch: endCh });
25527
+ } else {
25528
+ editorIns.replaceRange(replaceText, { line: cursor.line, ch: startCh }, { line: cursor.line, ch: endCh });
25529
+ editorIns.setCursor(cursor.line, editorIns.getCursor().ch + 1);
25530
+ }
25531
+ editorIns.focus();
25532
+ hideHint();
25533
+ };
25534
+ handler && handler({ prefix, cursorHint, callback });
25535
+ };
25536
+ const cursorActivityHandler = () => {
25537
+ const cursor = editorIns.getCursor();
25538
+ let i = prefixes.value.length;
25539
+ const value = editorIns.getLine(cursor.line).replace(/\t/g, " ");
25540
+ const selection = editorIns.getSelection();
25541
+ const isImgRegx = /^\!\[\S+/;
25542
+ if (selection) {
25543
+ return;
25544
+ }
25545
+ let nowPrefix = "";
25546
+ let hint = "";
25547
+ while (i >= 1) {
25548
+ i--;
25549
+ nowPrefix = prefixes.value[i];
25550
+ const startPos = value.lastIndexOf(nowPrefix, cursor.ch);
25551
+ const endPos = value.indexOf(" ", cursor.ch) > -1 ? value.indexOf(" ", cursor.ch) : value.length;
25552
+ hint = value.slice(startPos, cursor.ch);
25553
+ if (startPos > 0 && value[startPos - 1] !== " " || startPos < 0 || !hint.includes(nowPrefix) || hint.endsWith(" ") || isImgRegx.test(hint)) {
25554
+ cursorHint = "";
25555
+ cursorHintStart = -1;
25556
+ cursorHintEnd = -1;
25557
+ } else {
25558
+ prefix = prefixes.value[i];
25559
+ cursorHint = hint.slice(prefix.length);
25560
+ cursorHintStart = startPos;
25561
+ cursorHintEnd = endPos;
25562
+ break;
25563
+ }
25564
+ }
25565
+ if (cursorHintStart > -1 && hint[0]) {
25566
+ const spacePosition = value.lastIndexOf(" ", cursor.ch);
25567
+ if (spacePosition > cursorHintStart) {
25568
+ return;
25569
+ }
25570
+ setTimeout(() => {
25571
+ showHint();
25572
+ getHintList();
25573
+ });
25574
+ } else {
25575
+ hideHint();
25576
+ }
25459
25577
  };
25460
25578
  const onChange = debounce(() => {
25461
25579
  const content2 = editorIns.getValue();
@@ -25492,8 +25610,13 @@ function useEditorMd(props, ctx2) {
25492
25610
  shortKeys[toolbarItem.shortKey.replace(/\+/g, "-")] = (_a = toolbarItem.handler) == null ? void 0 : _a.bind(null, editorIns, toolbarItem.params);
25493
25611
  }
25494
25612
  }
25495
- editorIns.setOption("extraKeys", shortKeys);
25613
+ editorIns.setOption("extraKeys", Object.assign({
25614
+ Esc: () => {
25615
+ hideHint();
25616
+ }
25617
+ }), shortKeys);
25496
25618
  editorIns.on("beforeChange", _enforceMaxLength);
25619
+ editorIns.on("cursorActivity", lodash.exports.throttle(cursorActivityHandler, hintConfig.value && hintConfig.value.throttleTime || 300));
25497
25620
  editorIns.setSize("auto", "100%");
25498
25621
  refreshEditorCursor();
25499
25622
  editorIns.setCursor(editorIns.lineCount(), 0);
@@ -25571,9 +25694,12 @@ function useEditorMd(props, ctx2) {
25571
25694
  });
25572
25695
  return {
25573
25696
  editorRef,
25697
+ overlayRef,
25698
+ cursorRef,
25574
25699
  renderRef,
25575
25700
  toolbars,
25576
25701
  previewHtmlList,
25702
+ isHintShow,
25577
25703
  getEditorIns,
25578
25704
  onPaste,
25579
25705
  previewContentChange,
@@ -25693,7 +25819,8 @@ const editorMdProps = __spreadProps(__spreadValues({}, commonProps$1), {
25693
25819
  default: 10
25694
25820
  },
25695
25821
  hintConfig: {
25696
- type: Object
25822
+ type: Object,
25823
+ default: {}
25697
25824
  },
25698
25825
  customHintReplaceFn: {
25699
25826
  type: Function
@@ -25841,9 +25968,11 @@ var Tooltip = defineComponent({
25841
25968
  onMouseenterOverlay
25842
25969
  } = useTooltip(origin, props);
25843
25970
  const ns2 = useNamespace$1("tooltip");
25844
- const className2 = computed(() => {
25845
- return [ns2.b(), ns2.m(placement.value)].join(" ");
25846
- });
25971
+ const className2 = computed(() => ({
25972
+ [ns2.b()]: true,
25973
+ [ns2.m(placement.value)]: true,
25974
+ [ns2.m("with-content")]: slots.content
25975
+ }));
25847
25976
  provide(POPPER_TRIGGER_TOKEN, origin);
25848
25977
  return () => createVNode(Fragment, null, [createVNode(PopperTrigger, null, {
25849
25978
  default: () => {
@@ -25870,9 +25999,12 @@ var Tooltip = defineComponent({
25870
25999
  "onMouseenter": onMouseenterOverlay,
25871
26000
  "onMouseleave": onMouseleave
25872
26001
  }, {
25873
- default: () => [createVNode("span", {
25874
- "innerHTML": content2.value
25875
- }, null)]
26002
+ default: () => {
26003
+ var _a;
26004
+ return [slots.content ? (_a = slots.content) == null ? void 0 : _a.call(slots) : createVNode("span", {
26005
+ "innerHTML": content2.value
26006
+ }, null)];
26007
+ }
25876
26008
  })]
25877
26009
  })]
25878
26010
  })]);
@@ -25987,13 +26119,17 @@ var ToolbarItem = defineComponent({
25987
26119
  const editorIns = getEditorIns();
25988
26120
  if (config.id === "fullscreen") {
25989
26121
  showFullscreen.value = !showFullscreen.value;
25990
- } else {
25991
- (_a = config.handler) == null ? void 0 : _a.call(config, editorIns, config.params);
26122
+ if (window) {
26123
+ const event = new Event("resize");
26124
+ window.dispatchEvent(event);
26125
+ }
25992
26126
  }
26127
+ (_a = config.handler) == null ? void 0 : _a.call(config, editorIns, config.params);
25993
26128
  };
25994
26129
  return () => createVNode(Fragment, null, [config.type === "button" && createVNode(Tooltip, {
25995
26130
  "position": ["top", "bottom"],
25996
- "content": getTooltipContent(config.name, config.shortKey)
26131
+ "content": getTooltipContent(config.name, config.shortKey),
26132
+ "hide-after": 1e3
25997
26133
  }, {
25998
26134
  default: () => [createVNode("span", {
25999
26135
  "class": "md-toolbar-item",
@@ -26005,8 +26141,9 @@ var ToolbarItem = defineComponent({
26005
26141
  "align": "start"
26006
26142
  }, {
26007
26143
  default: () => createVNode("span", null, [createVNode(Tooltip, {
26008
- "position": ["top"],
26009
- "content": getTooltipContent(config.name)
26144
+ "position": showFullscreen.value ? ["right"] : ["top"],
26145
+ "content": getTooltipContent(config.name),
26146
+ "hide-after": 1e3
26010
26147
  }, {
26011
26148
  default: () => [createVNode("span", {
26012
26149
  "class": "md-toolbar-item",
@@ -26432,7 +26569,7 @@ function useEditorMdRender(props, ctx2) {
26432
26569
  const result2 = previewRef.value.querySelectorAll("input");
26433
26570
  const index2 = [...result2].filter((el) => el.type === "checkbox").findIndex((item) => item === e.target);
26434
26571
  const checkContent = setChecked(e.target.checked, index2);
26435
- ctx2.emit("mdCheckedEvent", checkContent);
26572
+ ctx2.emit("checkedChange", checkContent);
26436
26573
  }
26437
26574
  };
26438
26575
  return { previewRef, renderService, onPreviewClick, setContainerContent };
@@ -26486,7 +26623,7 @@ function useMdRenderWatcher(props, renderService, setContainerContent) {
26486
26623
  var MdRender = defineComponent({
26487
26624
  name: "DMdRender",
26488
26625
  props: mdRenderProps,
26489
- emits: ["mdRenderChange", "mdCheckedEvent"],
26626
+ emits: ["mdRenderChange", "checkedChange"],
26490
26627
  setup(props, ctx2) {
26491
26628
  const {
26492
26629
  previewRef,
@@ -26512,7 +26649,7 @@ function _isSlot$7(s) {
26512
26649
  var EditorMd = defineComponent({
26513
26650
  name: "DEditorMd",
26514
26651
  props: editorMdProps,
26515
- emits: ["update:modelValue", "mdCheckedEvent", "selectHint", "afterEditorInit", "contentChange", "previewContentChange", "imageUpload"],
26652
+ emits: ["update:modelValue", "checkedChange", "selectHint", "afterEditorInit", "contentChange", "previewContentChange", "imageUpload"],
26516
26653
  setup(props, ctx2) {
26517
26654
  const {
26518
26655
  mode,
@@ -26535,7 +26672,10 @@ var EditorMd = defineComponent({
26535
26672
  const showFullscreen = ref(false);
26536
26673
  const {
26537
26674
  editorRef,
26675
+ overlayRef,
26676
+ cursorRef,
26538
26677
  renderRef,
26678
+ isHintShow,
26539
26679
  toolbars,
26540
26680
  previewHtmlList,
26541
26681
  onPaste,
@@ -26585,7 +26725,19 @@ var EditorMd = defineComponent({
26585
26725
  }, [createVNode("textarea", {
26586
26726
  "ref": editorRef,
26587
26727
  "placeholder": placeholder.value
26588
- }, [modelValue.value]), Boolean(maxlength == null ? void 0 : maxlength.value) && createVNode("div", {
26728
+ }, [modelValue.value]), createVNode(FlexibleOverlay, {
26729
+ "ref": overlayRef,
26730
+ "modelValue": isHintShow.value,
26731
+ "onUpdate:modelValue": ($event) => isHintShow.value = $event,
26732
+ "origin": cursorRef.value || void 0,
26733
+ "align": "start",
26734
+ "position": ["bottom-start"]
26735
+ }, {
26736
+ default: () => {
26737
+ var _a, _b;
26738
+ return [(_b = (_a = ctx2.slots) == null ? void 0 : _a.hintTemplate) == null ? void 0 : _b.call(_a)];
26739
+ }
26740
+ }), Boolean(maxlength == null ? void 0 : maxlength.value) && createVNode("div", {
26589
26741
  "class": "dp-md-count"
26590
26742
  }, [modelValue.value.length || 0, createTextVNode("/"), maxlength.value])]), createVNode(MdRender, {
26591
26743
  "ref": renderRef,
@@ -26600,7 +26752,7 @@ var EditorMd = defineComponent({
26600
26752
  "disable-render": true,
26601
26753
  "md-plugins": mdPlugins.value,
26602
26754
  "onMdRenderChange": previewContentChange,
26603
- "onMdCheckedEvent": onChecked,
26755
+ "onCheckedChange": onChecked,
26604
26756
  "onScroll": onPreviewScroll,
26605
26757
  "onMouseover": onPreviewMouseover,
26606
26758
  "onMouseout": onPreviewMouseout
@@ -27381,6 +27533,9 @@ class GitGraph$1 {
27381
27533
  style: "clip-path: circle(50%)"
27382
27534
  };
27383
27535
  this.setNodeAttr(img, imgAttrs);
27536
+ const authorText = document.createElementNS("http://www.w3.org/2000/svg", "title");
27537
+ authorText.appendChild(document.createTextNode(commit.author.name));
27538
+ img.appendChild(authorText);
27384
27539
  this.svg.appendChild(img);
27385
27540
  if (!this.messageBoxWidth) {
27386
27541
  this.messageBoxWidth = this.svg.getBoundingClientRect.width - (avatar_box_x + 40);
@@ -30223,6 +30378,10 @@ const menuProps = {
30223
30378
  router: {
30224
30379
  type: Boolean,
30225
30380
  default: false
30381
+ },
30382
+ disableOverflowStyle: {
30383
+ type: Boolean,
30384
+ default: false
30226
30385
  }
30227
30386
  };
30228
30387
  var menu = "";
@@ -30316,7 +30475,7 @@ var Menu = defineComponent({
30316
30475
  const container = overflowContainerElement.children[1];
30317
30476
  const ob = new IntersectionObserver((entries) => {
30318
30477
  entries.forEach((entry) => {
30319
- if (!entry.isIntersecting) {
30478
+ if (!entry.isIntersecting && !props.disableOverflowStyle) {
30320
30479
  const cloneNode = entry.target.cloneNode(true);
30321
30480
  if (entry.target.classList.contains(`${ns2.b()}-overflow-container`)) {
30322
30481
  if (flag && entry.target.previousElementSibling && container.children.length) {
@@ -30387,7 +30546,7 @@ var Menu = defineComponent({
30387
30546
  "key": "overflowContainer",
30388
30547
  "title": "...",
30389
30548
  "class": overflowContainerClassName
30390
- }, null), [[vShow, overflowItemLength.value > 0 && mode.value === "horizontal"]])]);
30549
+ }, null), [[vShow, overflowItemLength.value > 0 && mode.value === "horizontal" && !props.disableOverflowStyle]])]);
30391
30550
  };
30392
30551
  }
30393
30552
  });
@@ -31562,11 +31721,12 @@ function className$1(classStr, classOpt) {
31562
31721
  function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
31563
31722
  const formContext = inject(FORM_TOKEN, void 0);
31564
31723
  const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
31565
- const ns2 = useNamespace("select");
31724
+ const ns2 = useNamespace$1("select");
31566
31725
  const dropdownRef = ref();
31567
31726
  const selectDisabled = computed(() => (formContext == null ? void 0 : formContext.disabled) || props.disabled);
31568
31727
  const selectSize = computed(() => props.size || (formContext == null ? void 0 : formContext.size) || "md");
31569
31728
  const isObjectOption = ref(false);
31729
+ const originRef = ref();
31570
31730
  const isOpen = ref(false);
31571
31731
  const toggleChange = (bool) => {
31572
31732
  if (selectDisabled.value) {
@@ -31576,16 +31736,9 @@ function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
31576
31736
  ctx2.emit("toggle-change", bool);
31577
31737
  };
31578
31738
  onClickOutside(dropdownRef, () => {
31579
- var _a;
31580
- if (props.multiple && isOpen.value) {
31581
- (_a = selectRef.value) == null ? void 0 : _a.clearMultipleSearchKey();
31582
- onBlur();
31583
- }
31584
- if (isOpen.value) {
31585
- toggleChange(false);
31586
- }
31739
+ toggleChange(false);
31587
31740
  }, { ignore: [selectRef] });
31588
- const dropdownMenuMultipleNs = useNamespace("dropdown-menu-multiple");
31741
+ const dropdownMenuMultipleNs = useNamespace$1("dropdown-menu-multiple");
31589
31742
  const selectCls = computed(() => {
31590
31743
  return className$1(ns2.b(), {
31591
31744
  [ns2.m("open")]: isOpen.value,
@@ -31696,11 +31849,8 @@ function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
31696
31849
  }
31697
31850
  };
31698
31851
  const valueChange = (item) => {
31699
- var _a;
31700
31852
  const { multiple } = props;
31701
31853
  let { modelValue } = props;
31702
- filterQuery.value = "";
31703
- handlerQueryFunc("");
31704
31854
  if (multiple) {
31705
31855
  const checkedItems = Array.isArray(modelValue) ? modelValue.slice() : [];
31706
31856
  const index2 = checkedItems.indexOf(item.value);
@@ -31727,7 +31877,6 @@ function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
31727
31877
  }
31728
31878
  getMultipleSelected(checkedItems);
31729
31879
  } else {
31730
- (_a = selectRef.value) == null ? void 0 : _a.clearSingleSearchKey();
31731
31880
  ctx2.emit("update:modelValue", item.value);
31732
31881
  getSingleSelected(item);
31733
31882
  toggleChange(false);
@@ -31738,8 +31887,6 @@ function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
31738
31887
  ctx2.emit("toggle-change", false);
31739
31888
  };
31740
31889
  const handleClear = () => {
31741
- filterQuery.value = "";
31742
- handlerQueryFunc("");
31743
31890
  if (props.multiple) {
31744
31891
  ctx2.emit("update:modelValue", []);
31745
31892
  ctx2.emit("value-change", []);
@@ -31752,6 +31899,7 @@ function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
31752
31899
  handleClose();
31753
31900
  blur2();
31754
31901
  }
31902
+ filterQuery.value = "";
31755
31903
  };
31756
31904
  const tagDelete = (data) => {
31757
31905
  let { modelValue } = props;
@@ -31769,22 +31917,21 @@ function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
31769
31917
  ctx2.emit("remove-tag", data.value);
31770
31918
  getMultipleSelected(checkedItems);
31771
31919
  };
31772
- const onFocus = () => {
31920
+ const onFocus = (e) => {
31921
+ ctx2.emit("focus", e);
31773
31922
  if (!selectDisabled.value) {
31774
31923
  isSelectFocus.value = true;
31775
31924
  }
31776
31925
  };
31777
- const onBlur = () => {
31926
+ const onBlur = (e) => {
31927
+ ctx2.emit("blur", e);
31778
31928
  if (!selectDisabled.value) {
31779
- setTimeout(() => {
31780
- filterQuery.value = "";
31781
- handlerQueryFunc("");
31782
- }, 150);
31783
31929
  isSelectFocus.value = false;
31784
31930
  }
31785
31931
  };
31786
31932
  const queryChange = (query) => {
31787
31933
  filterQuery.value = query;
31934
+ ctx2.emit("input-change", query);
31788
31935
  };
31789
31936
  const isLoading = computed(() => typeof props.loading === "boolean" && props.loading);
31790
31937
  const debounceTime = computed(() => props.remote ? 300 : 0);
@@ -31812,7 +31959,7 @@ function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
31812
31959
  const emptyText = computed(() => {
31813
31960
  const visibleOptionsCount = injectOptionsArray.value.filter((item) => {
31814
31961
  const label = item.name || item.value;
31815
- return label.toString().toLocaleLowerCase().includes(filterQuery.value.trim().toLocaleLowerCase());
31962
+ return label.toString().toLocaleLowerCase().includes(filterQuery.value.toLocaleLowerCase().trim());
31816
31963
  }).length;
31817
31964
  if (isLoading.value) {
31818
31965
  return props.loadingText || t("loadingText");
@@ -31839,8 +31986,7 @@ function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
31839
31986
  }
31840
31987
  };
31841
31988
  watch(() => props.modelValue, () => {
31842
- formItemContext == null ? void 0 : formItemContext.validate("change").catch(() => {
31843
- });
31989
+ formItemContext == null ? void 0 : formItemContext.validate("change").catch((err) => console.warn(err));
31844
31990
  updateInjectOptionsStatus();
31845
31991
  }, { deep: true });
31846
31992
  watch(injectOptions, () => {
@@ -31855,17 +32001,10 @@ function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
31855
32001
  (_a = dropdownRef.value) == null ? void 0 : _a.updatePosition();
31856
32002
  }
31857
32003
  }, { flush: "post" });
31858
- watch(isSelectFocus, (val) => {
31859
- if (val) {
31860
- ctx2.emit("focus");
31861
- } else {
31862
- ctx2.emit("blur");
31863
- }
31864
- });
31865
- onMounted(updateInjectOptionsStatus);
31866
32004
  return {
31867
32005
  selectDisabled,
31868
32006
  selectSize,
32007
+ originRef,
31869
32008
  dropdownRef,
31870
32009
  isOpen,
31871
32010
  selectCls,
@@ -31890,7 +32029,7 @@ function useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t) {
31890
32029
  }
31891
32030
  const selectProps = {
31892
32031
  modelValue: {
31893
- type: [String, Number, Array, Boolean],
32032
+ type: [String, Number, Array],
31894
32033
  default: ""
31895
32034
  },
31896
32035
  "onUpdate:modelValue": {
@@ -31905,10 +32044,6 @@ const selectProps = {
31905
32044
  type: String,
31906
32045
  default: ""
31907
32046
  },
31908
- position: {
31909
- type: Array,
31910
- default: () => ["bottom", "top"]
31911
- },
31912
32047
  overview: {
31913
32048
  type: String,
31914
32049
  default: "border"
@@ -31980,10 +32115,6 @@ const selectProps = {
31980
32115
  multipleLimit: {
31981
32116
  type: Number,
31982
32117
  default: 0
31983
- },
31984
- showEmptyWhenUnmatched: {
31985
- type: Boolean,
31986
- default: true
31987
32118
  }
31988
32119
  };
31989
32120
  const optionProps = {
@@ -32016,7 +32147,7 @@ const optionGroupProps = {
32016
32147
  const SELECT_TOKEN = Symbol("dSelect");
32017
32148
  const OPTION_GROUP_TOKEN = Symbol("dOptionGroup");
32018
32149
  function useOption(props) {
32019
- const ns2 = useNamespace("select");
32150
+ const ns2 = useNamespace$1("select");
32020
32151
  const select2 = inject(SELECT_TOKEN, null);
32021
32152
  const optionGroup = inject(OPTION_GROUP_TOKEN, null);
32022
32153
  const currentName = computed(() => {
@@ -32032,23 +32163,20 @@ function useOption(props) {
32032
32163
  return select2.modelValue === props.value;
32033
32164
  }
32034
32165
  });
32035
- const isDisabled = computed(() => props.disabled || ((optionGroup == null ? void 0 : optionGroup.disabled) ? true : false));
32036
32166
  const optionItem = computed(() => {
32037
32167
  return {
32038
32168
  name: props.name || props.value + "" || "",
32039
32169
  value: props.value,
32040
32170
  create: props.create,
32041
- _checked: false,
32042
- disabled: isDisabled.value
32171
+ _checked: false
32043
32172
  };
32044
32173
  });
32174
+ const isDisabled = computed(() => props.disabled || ((optionGroup == null ? void 0 : optionGroup.disabled) ? true : false));
32045
32175
  const isObjectOption = ref(!!props.name);
32046
32176
  const selectOptionCls = computed(() => {
32047
32177
  return className$1(ns2.e("item"), {
32048
32178
  active: isOptionSelected.value,
32049
- disabled: isDisabled.value,
32050
- [ns2.em("item", "sm")]: (select2 == null ? void 0 : select2.selectSize) === "sm",
32051
- [ns2.em("item", "lg")]: (select2 == null ? void 0 : select2.selectSize) === "lg"
32179
+ disabled: isDisabled.value
32052
32180
  });
32053
32181
  });
32054
32182
  const optionSelect = () => {
@@ -32246,16 +32374,12 @@ var TagInstall = {
32246
32374
  }
32247
32375
  };
32248
32376
  function useSelectContent() {
32249
- const ns2 = useNamespace("select");
32377
+ const ns2 = useNamespace$1("select");
32250
32378
  const select2 = inject(SELECT_TOKEN);
32251
32379
  const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
32252
- const styleType = inject(STYLE_TOKEN, void 0);
32253
32380
  const app = getCurrentInstance();
32254
32381
  const t = createI18nTranslate("DSelect", app);
32255
32382
  const searchQuery = ref("");
32256
- const singleSearchKey = ref("");
32257
- const singleInputRef = ref();
32258
- const singlePlaceholderWidth = computed(() => (select2 == null ? void 0 : select2.dropdownWidth) ? `${(select2 == null ? void 0 : select2.dropdownWidth) - 40}px` : "auto");
32259
32383
  const selectedData = computed(() => {
32260
32384
  return (select2 == null ? void 0 : select2.selectedOptions) || [];
32261
32385
  });
@@ -32273,37 +32397,21 @@ function useSelectContent() {
32273
32397
  const displayInputValue = computed(() => {
32274
32398
  var _a;
32275
32399
  if (select2 == null ? void 0 : select2.selectedOptions) {
32276
- return select2.selectedOptions.length > 1 ? select2.selectedOptions.map((item) => (item == null ? void 0 : item.name) || (item == null ? void 0 : item.value) || "").join(",") : ((_a = select2.selectedOptions[0]) == null ? void 0 : _a.name) || (select2.showEmptyWhenUnmatched ? "" : select2.modelValue);
32400
+ return select2.selectedOptions.length > 1 ? select2.selectedOptions.map((item) => (item == null ? void 0 : item.name) || (item == null ? void 0 : item.value) || "").join(",") : ((_a = select2.selectedOptions[0]) == null ? void 0 : _a.name) || "";
32277
32401
  } else {
32278
32402
  return "";
32279
32403
  }
32280
32404
  });
32281
- const isPlaceholderDark = computed(() => {
32282
- if (!singleSearchKey.value) {
32283
- if (isSelectDisable.value) {
32284
- return false;
32285
- }
32286
- if (!displayInputValue.value) {
32287
- return true;
32288
- } else {
32289
- return select2 == null ? void 0 : select2.isSelectFocus;
32290
- }
32291
- } else {
32292
- return false;
32293
- }
32294
- });
32295
32405
  const mergeClearable = computed(() => {
32296
32406
  return !isSelectDisable.value && !!(select2 == null ? void 0 : select2.allowClear) && (displayInputValue.value ? true : false);
32297
32407
  });
32298
32408
  const isDisabledTooltip = computed(() => {
32299
32409
  return !isSupportTagsTooltip.value || !!(select2 == null ? void 0 : select2.isOpen);
32300
32410
  });
32301
- const isSupportFilter = computed(() => lodash.exports.isFunction(select2 == null ? void 0 : select2.filter) || typeof (select2 == null ? void 0 : select2.filter) === "boolean" && (select2 == null ? void 0 : select2.filter));
32302
32411
  const selectionCls = computed(() => {
32303
32412
  return className$1(ns2.e("selection"), {
32304
32413
  [ns2.e("clearable")]: mergeClearable.value,
32305
- [ns2.em("selection", "error")]: isValidateError.value,
32306
- [ns2.em("selection", "gray-style")]: styleType === "gray"
32414
+ [ns2.em("selection", "error")]: isValidateError.value
32307
32415
  });
32308
32416
  });
32309
32417
  const inputCls = computed(() => {
@@ -32314,20 +32422,12 @@ function useSelectContent() {
32314
32422
  });
32315
32423
  const tagSize = computed(() => (select2 == null ? void 0 : select2.selectSize) || "sm");
32316
32424
  const placeholder = computed(() => displayInputValue.value ? "" : (select2 == null ? void 0 : select2.placeholder) || t("placeholder"));
32317
- const singlePlaceholder = computed(() => (select2 == null ? void 0 : select2.placeholder) || t("placeholder"));
32318
32425
  const isMultiple = computed(() => !!(select2 == null ? void 0 : select2.multiple));
32319
32426
  const handleClear = (e) => {
32320
32427
  e.preventDefault();
32321
32428
  e.stopPropagation();
32322
- searchQuery.value = "";
32323
- singleSearchKey.value = "";
32324
32429
  select2 == null ? void 0 : select2.handleClear();
32325
32430
  };
32326
- const onSingleInputWrapClick = () => {
32327
- if (!(select2 == null ? void 0 : select2.selectDisabled)) {
32328
- singleInputRef.value.focus();
32329
- }
32330
- };
32331
32431
  const tagDelete = (data) => {
32332
32432
  if (data && (data.value || data.value === 0)) {
32333
32433
  select2 == null ? void 0 : select2.tagDelete(data);
@@ -32337,69 +32437,41 @@ function useSelectContent() {
32337
32437
  select2 == null ? void 0 : select2.onFocus(e);
32338
32438
  };
32339
32439
  const onBlur = (e) => {
32340
- singleSearchKey.value = "";
32341
32440
  select2 == null ? void 0 : select2.onBlur(e);
32342
32441
  };
32343
- const onMultipleClick = () => {
32344
- if (select2 == null ? void 0 : select2.selectDisabled) {
32345
- return;
32346
- }
32347
- if (select2 == null ? void 0 : select2.isOpen) {
32348
- searchQuery.value = "";
32349
- select2 == null ? void 0 : select2.onBlur();
32350
- } else {
32351
- select2 == null ? void 0 : select2.onFocus();
32352
- }
32353
- };
32354
- const onArrowClick = () => {
32355
- if (isMultiple.value) {
32356
- onMultipleClick();
32357
- }
32358
- };
32359
32442
  const queryFilter = (e) => {
32360
32443
  e.preventDefault();
32361
32444
  e.stopPropagation();
32362
32445
  const query = e.target.value;
32363
- singleSearchKey.value = query;
32364
- searchQuery.value = query;
32365
32446
  if (!isReadOnly.value && (select2 == null ? void 0 : select2.debounceQueryFilter)) {
32366
32447
  select2 == null ? void 0 : select2.debounceQueryFilter(query);
32367
32448
  }
32368
32449
  };
32369
32450
  return {
32370
- singleInputRef,
32371
32451
  searchQuery,
32372
- singleSearchKey,
32373
32452
  selectedData,
32374
32453
  isSelectDisable,
32375
32454
  isSupportCollapseTags,
32376
32455
  isDisabledTooltip,
32377
- isSupportFilter,
32378
32456
  isReadOnly,
32379
32457
  selectionCls,
32380
32458
  inputCls,
32381
32459
  tagSize,
32382
32460
  placeholder,
32383
- singlePlaceholder,
32384
- singlePlaceholderWidth,
32385
32461
  isMultiple,
32386
32462
  displayInputValue,
32387
- isPlaceholderDark,
32388
- onSingleInputWrapClick,
32389
32463
  handleClear,
32390
32464
  tagDelete,
32391
32465
  onFocus,
32392
32466
  onBlur,
32393
- onMultipleClick,
32394
- onArrowClick,
32395
32467
  queryFilter
32396
32468
  };
32397
32469
  }
32398
32470
  var SelectContent = defineComponent({
32399
32471
  name: "SelectContent",
32400
- setup(_, ctx2) {
32472
+ setup() {
32401
32473
  const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
32402
- const ns2 = useNamespace("select");
32474
+ const ns2 = useNamespace$1("select");
32403
32475
  const clearCls = computed(() => ({
32404
32476
  [ns2.e("clear")]: true,
32405
32477
  [ns2.em("clear", "feedback")]: Boolean(formItemContext == null ? void 0 : formItemContext.validateState) && (formItemContext == null ? void 0 : formItemContext.showFeedback)
@@ -32411,71 +32483,44 @@ var SelectContent = defineComponent({
32411
32483
  const multipleCls = ns2.e("multiple");
32412
32484
  const multipleInputCls = ns2.em("multiple", "input");
32413
32485
  const {
32414
- singleInputRef,
32415
32486
  searchQuery,
32416
- singleSearchKey,
32417
32487
  selectedData,
32418
32488
  isSelectDisable,
32419
32489
  isSupportCollapseTags,
32420
32490
  isDisabledTooltip,
32421
32491
  isReadOnly,
32422
- isSupportFilter,
32423
32492
  selectionCls,
32424
32493
  inputCls,
32425
32494
  tagSize,
32426
32495
  placeholder,
32427
- singlePlaceholder,
32428
- singlePlaceholderWidth,
32429
32496
  isMultiple,
32430
- isPlaceholderDark,
32431
32497
  displayInputValue,
32432
- onSingleInputWrapClick,
32433
- onMultipleClick,
32434
- onArrowClick,
32435
32498
  handleClear,
32436
32499
  tagDelete,
32437
32500
  onFocus,
32438
32501
  onBlur,
32439
32502
  queryFilter
32440
32503
  } = useSelectContent();
32441
- const clearSingleSearchKey = () => {
32442
- singleSearchKey.value = "";
32443
- };
32444
- const clearMultipleSearchKey = () => {
32445
- searchQuery.value = "";
32446
- };
32447
- ctx2.expose({
32448
- clearSingleSearchKey,
32449
- clearMultipleSearchKey
32450
- });
32451
32504
  return () => {
32452
32505
  return createVNode("div", {
32453
32506
  "class": selectionCls.value
32454
32507
  }, [isMultiple.value ? createVNode("div", {
32455
- "class": multipleCls,
32456
- "onClick": onMultipleClick
32508
+ "class": multipleCls
32457
32509
  }, [!isSupportCollapseTags.value && selectedData.value.length >= 1 && selectedData.value.map((item) => createVNode(Tag, {
32458
- "deletable": !(isSelectDisable.value || item.disabled),
32510
+ "deletable": true,
32459
32511
  "onTagDelete": withModifiers(() => tagDelete(item), ["prevent", "stop"]),
32460
32512
  "key": item.value,
32461
- "maxWidth": "78%",
32462
- "class": ["multiple-tag", {
32463
- disabled: isSelectDisable.value || item.disabled
32464
- }],
32465
32513
  "size": tagSize.value
32466
32514
  }, {
32467
32515
  default: () => [item.name]
32468
32516
  })), isSupportCollapseTags.value && selectedData.value.length >= 1 && createVNode(Tag, {
32469
32517
  "deletable": true,
32470
- "maxWidth": "75%",
32471
- "class": "multiple-tag",
32472
32518
  "onTagDelete": withModifiers(() => tagDelete(selectedData.value[0]), ["prevent", "stop"]),
32473
32519
  "size": tagSize.value
32474
32520
  }, {
32475
32521
  default: () => [selectedData.value[0].name]
32476
32522
  }), isSupportCollapseTags.value && selectedData.value.length > 1 && createVNode(Popover, {
32477
32523
  "trigger": "hover",
32478
- "auto-update-position": true,
32479
32524
  "disabled": isDisabledTooltip.value
32480
32525
  }, {
32481
32526
  default: () => createVNode(Tag, {
@@ -32487,49 +32532,39 @@ var SelectContent = defineComponent({
32487
32532
  "deletable": true,
32488
32533
  "onTagDelete": withModifiers(() => tagDelete(item), ["prevent", "stop"]),
32489
32534
  "key": item.value,
32490
- "class": "popover-tag",
32491
32535
  "size": tagSize.value
32492
32536
  }, {
32493
32537
  default: () => [item.name]
32494
32538
  }))])
32495
32539
  }), createVNode("div", {
32496
32540
  "class": multipleInputCls
32497
- }, [withDirectives(createVNode("input", {
32541
+ }, [createVNode("input", {
32498
32542
  "ref": "input",
32499
32543
  "value": searchQuery.value,
32500
32544
  "type": "text",
32501
32545
  "class": inputCls.value,
32502
32546
  "placeholder": placeholder.value,
32503
- "readonly": isReadOnly.value || !isSupportFilter.value,
32547
+ "readonly": isReadOnly.value,
32504
32548
  "disabled": isSelectDisable.value,
32505
- "onInput": queryFilter
32506
- }, null), [[vShow, !selectedData.value.length || isSupportFilter.value]])])]) : createVNode("div", {
32507
- "class": "single-inner-input",
32508
- "onClick": onSingleInputWrapClick
32509
- }, [!singleSearchKey.value && createVNode("span", {
32510
- "class": ["input-placeholder", {
32511
- "placeholder-dark": isPlaceholderDark.value
32512
- }],
32513
- "style": {
32514
- width: singlePlaceholderWidth.value
32515
- },
32516
- "title": displayInputValue.value || singlePlaceholder.value
32517
- }, [displayInputValue.value || singlePlaceholder.value]), withDirectives(createVNode("input", {
32518
- "ref": singleInputRef,
32549
+ "onInput": queryFilter,
32550
+ "onFocus": onFocus,
32551
+ "onBlur": onBlur
32552
+ }, null)])]) : createVNode("input", {
32553
+ "ref": "input",
32554
+ "value": displayInputValue.value,
32519
32555
  "type": "text",
32520
- "onUpdate:modelValue": ($event) => singleSearchKey.value = $event,
32521
32556
  "class": inputCls.value,
32557
+ "placeholder": placeholder.value,
32522
32558
  "readonly": isReadOnly.value,
32523
32559
  "disabled": isSelectDisable.value,
32524
32560
  "onFocus": onFocus,
32525
32561
  "onBlur": onBlur,
32526
32562
  "onInput": queryFilter
32527
- }, null), [[vModelText, singleSearchKey.value]])]), createVNode("span", {
32563
+ }, null), createVNode("span", {
32528
32564
  "onClick": handleClear,
32529
32565
  "class": clearCls.value
32530
32566
  }, [createVNode(AlertCloseIcon, null, null)]), createVNode("span", {
32531
- "class": arrowCls.value,
32532
- "onClick": onArrowClick
32567
+ "class": arrowCls.value
32533
32568
  }, [createVNode(SelectArrowIcon, null, null)])]);
32534
32569
  };
32535
32570
  }
@@ -32557,38 +32592,11 @@ function useSelectFunction(props, selectRef) {
32557
32592
  };
32558
32593
  return { isSelectFocus, focus, blur: blur2 };
32559
32594
  }
32560
- function useSelectMenuSize(selectRef, dropdownRef, isOpen) {
32561
- const originRef = ref();
32562
- const dropdownWidth = ref(0);
32563
- let observer;
32564
- const updateDropdownWidth = () => {
32565
- var _a;
32566
- dropdownWidth.value = ((_a = originRef.value) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
32567
- if (isOpen.value) {
32568
- dropdownRef.value.updatePosition();
32569
- }
32570
- };
32571
- const watchInputSize = () => {
32572
- if (window) {
32573
- observer = new window.ResizeObserver(updateDropdownWidth);
32574
- observer.observe(originRef.value);
32575
- }
32576
- };
32577
- onMounted(() => {
32578
- originRef.value = selectRef.value.$el;
32579
- watchInputSize();
32580
- updateDropdownWidth();
32581
- });
32582
- onBeforeUnmount(() => {
32583
- observer == null ? void 0 : observer.unobserve(originRef.value);
32584
- });
32585
- return { originRef, dropdownWidth };
32586
- }
32587
32595
  var select = "";
32588
32596
  var Select = defineComponent({
32589
32597
  name: "DSelect",
32590
32598
  props: selectProps,
32591
- emits: ["toggle-change", "value-change", "update:modelValue", "focus", "blur", "remove-tag", "clear", "load-more"],
32599
+ emits: ["toggle-change", "value-change", "update:modelValue", "focus", "blur", "remove-tag", "clear", "input-change"],
32592
32600
  setup(props, ctx2) {
32593
32601
  const app = getCurrentInstance();
32594
32602
  const t = createI18nTranslate("DSelect", app);
@@ -32601,6 +32609,7 @@ var Select = defineComponent({
32601
32609
  const {
32602
32610
  selectDisabled,
32603
32611
  selectSize,
32612
+ originRef,
32604
32613
  dropdownRef,
32605
32614
  isOpen,
32606
32615
  selectCls,
@@ -32622,16 +32631,9 @@ var Select = defineComponent({
32622
32631
  isShowCreateOption
32623
32632
  } = useSelect$2(props, selectRef, ctx2, focus, blur2, isSelectFocus, t);
32624
32633
  const dropdownContainer = ref();
32625
- const {
32626
- originRef,
32627
- dropdownWidth
32628
- } = useSelectMenuSize(selectRef, dropdownRef, isOpen);
32629
- const scrollbarNs = useNamespace("scrollbar");
32630
- const ns2 = useNamespace("select");
32631
- const dropdownCls = {
32632
- [ns2.e("dropdown")]: true,
32633
- [ns2.em("dropdown", "multiple")]: props.multiple
32634
- };
32634
+ const scrollbarNs = useNamespace$1("scrollbar");
32635
+ const ns2 = useNamespace$1("select");
32636
+ const dropdownCls = ns2.e("dropdown");
32635
32637
  const listCls = {
32636
32638
  [ns2.e("dropdown-list")]: true,
32637
32639
  [scrollbarNs.b()]: true
@@ -32643,8 +32645,17 @@ var Select = defineComponent({
32643
32645
  toggleChange
32644
32646
  });
32645
32647
  const isRender = ref(false);
32646
- onBeforeMount(() => {
32647
- isRender.value = true;
32648
+ const position = ref(["bottom-start", "top-start"]);
32649
+ const dropdownWidth = ref("0");
32650
+ const updateDropdownWidth = () => {
32651
+ var _a;
32652
+ dropdownWidth.value = ((_a = originRef == null ? void 0 : originRef.value) == null ? void 0 : _a.clientWidth) ? originRef.value.clientWidth + "px" : "100%";
32653
+ };
32654
+ watch(selectRef, (val) => {
32655
+ if (val) {
32656
+ originRef.value = val.$el;
32657
+ updateDropdownWidth();
32658
+ }
32648
32659
  });
32649
32660
  const scrollToBottom = () => {
32650
32661
  const compareHeight = dropdownContainer.value.scrollHeight - dropdownContainer.value.clientHeight;
@@ -32654,18 +32665,22 @@ var Select = defineComponent({
32654
32665
  }
32655
32666
  };
32656
32667
  onMounted(() => {
32668
+ isRender.value = true;
32669
+ updateDropdownWidth();
32670
+ window.addEventListener("resize", updateDropdownWidth);
32657
32671
  nextTick(() => {
32658
32672
  dropdownContainer.value.addEventListener("scroll", scrollToBottom);
32659
32673
  });
32660
32674
  });
32675
+ onUnmounted(() => {
32676
+ window.removeEventListener("resize", updateDropdownWidth);
32677
+ });
32661
32678
  provide(SELECT_TOKEN, reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
32662
32679
  selectDisabled,
32663
32680
  selectSize,
32664
32681
  isOpen,
32665
- isSelectFocus,
32666
32682
  selectedOptions,
32667
32683
  filterQuery,
32668
- dropdownWidth,
32669
32684
  valueChange,
32670
32685
  handleClear,
32671
32686
  updateInjectOptions,
@@ -32679,7 +32694,7 @@ var Select = defineComponent({
32679
32694
  "class": selectCls.value,
32680
32695
  "onClick": withModifiers(() => {
32681
32696
  toggleChange(!isOpen.value);
32682
- }, [])
32697
+ }, ["stop"])
32683
32698
  }, [createVNode(SelectContent, {
32684
32699
  "ref": selectRef
32685
32700
  }, null), createVNode(Teleport, {
@@ -32693,9 +32708,9 @@ var Select = defineComponent({
32693
32708
  "onUpdate:modelValue": ($event) => isRender.value = $event,
32694
32709
  "ref": dropdownRef,
32695
32710
  "origin": originRef.value,
32711
+ "align": "start",
32696
32712
  "offset": 4,
32697
- "place-strategy": "no-space",
32698
- "position": props.position,
32713
+ "position": position.value,
32699
32714
  "style": {
32700
32715
  visibility: isOpen.value ? "visible" : "hidden",
32701
32716
  "z-index": isOpen.value ? "var(--devui-z-index-dropdown, 1052)" : -1
@@ -32706,14 +32721,11 @@ var Select = defineComponent({
32706
32721
  return [createVNode("div", {
32707
32722
  "class": dropdownCls,
32708
32723
  "style": {
32709
- width: `${dropdownWidth.value}px`,
32724
+ width: `${dropdownWidth.value}`,
32710
32725
  visibility: isOpen.value ? "visible" : "hidden"
32711
32726
  }
32712
32727
  }, [withDirectives(createVNode("ul", {
32713
32728
  "class": listCls,
32714
- "style": {
32715
- padding: isShowEmptyText.value ? "0" : "12px"
32716
- },
32717
32729
  "ref": dropdownContainer
32718
32730
  }, [isShowCreateOption.value && createVNode(Option, {
32719
32731
  "value": filterQuery.value,
@@ -32733,8 +32745,7 @@ var Select = defineComponent({
32733
32745
  default: () => [props.multiple ? createVNode(Checkbox, {
32734
32746
  "modelValue": item._checked,
32735
32747
  "label": item.name,
32736
- "disabled": isDisabled(item),
32737
- "class": "select-checkbox"
32748
+ "disabled": isDisabled(item)
32738
32749
  }, null) : item.name || item.value]
32739
32750
  }))]), [[vShow, !isLoading.value]]), isShowEmptyText.value && createVNode("div", null, [((_c = ctx2.slots) == null ? void 0 : _c.empty) && ctx2.slots.empty(), !((_d = ctx2.slots) == null ? void 0 : _d.empty) && createVNode("p", {
32740
32751
  "class": dropdownEmptyCls
@@ -32750,7 +32761,7 @@ var OptionGroup = defineComponent({
32750
32761
  name: "DOptionGroup",
32751
32762
  props: optionGroupProps,
32752
32763
  setup(props, ctx2) {
32753
- const ns2 = useNamespace("select");
32764
+ const ns2 = useNamespace$1("select");
32754
32765
  provide(OPTION_GROUP_TOKEN, reactive(__spreadValues({}, toRefs(props))));
32755
32766
  return () => {
32756
32767
  var _a;
@@ -32789,7 +32800,7 @@ const paginationProps = {
32789
32800
  },
32790
32801
  pageSizeDirection: {
32791
32802
  type: Array,
32792
- default: () => ["centerDown", "centerUp"]
32803
+ default: () => ["bottom", "top"]
32793
32804
  },
32794
32805
  pageIndex: {
32795
32806
  type: Number,
@@ -32935,7 +32946,7 @@ var ConfigMenu = defineComponent({
32935
32946
  isShowConfig,
32936
32947
  $slots
32937
32948
  } = this;
32938
- const ns2 = useNamespace$1("pagination");
32949
+ const ns2 = useNamespace("pagination");
32939
32950
  return withDirectives(createVNode("div", {
32940
32951
  "class": ns2.e("config"),
32941
32952
  "ref": "paginationConfig"
@@ -33003,8 +33014,14 @@ var JumpPage = defineComponent({
33003
33014
  }
33004
33015
  };
33005
33016
  const jump = (e) => {
33017
+ if (isNaN(curPage)) {
33018
+ curPage = 1;
33019
+ }
33006
33020
  if (curPage > (totalPages == null ? void 0 : totalPages.value)) {
33007
- return;
33021
+ curPage = totalPages == null ? void 0 : totalPages.value;
33022
+ }
33023
+ if (curPage < 1) {
33024
+ curPage = 1;
33008
33025
  }
33009
33026
  if ((e === "btn" || e.key === "Enter") && (cursor == null ? void 0 : cursor.value) !== curPage) {
33010
33027
  emit("changeCursorEmit", curPage);
@@ -33025,7 +33042,7 @@ var JumpPage = defineComponent({
33025
33042
  jump,
33026
33043
  showJumpButton
33027
33044
  } = this;
33028
- const ns2 = useNamespace$1("pagination");
33045
+ const ns2 = useNamespace("pagination");
33029
33046
  const inputProps2 = {
33030
33047
  class: [ns2.e("input"), size ? ns2.em("input", size) : ""],
33031
33048
  size,
@@ -33147,7 +33164,7 @@ var PageNumBtn = defineComponent({
33147
33164
  nextChange,
33148
33165
  showTruePageIndex
33149
33166
  } = this;
33150
- const ns2 = useNamespace$1("pagination");
33167
+ const ns2 = useNamespace("pagination");
33151
33168
  return createVNode("ul", {
33152
33169
  "class": [ns2.e("list"), size ? ns2.m(size) : ""]
33153
33170
  }, [createVNode("li", {
@@ -33233,13 +33250,14 @@ var PageNumBtn = defineComponent({
33233
33250
  });
33234
33251
  var PageSize = defineComponent({
33235
33252
  setup() {
33236
- const ns2 = useNamespace$1("pagination");
33253
+ const ns2 = useNamespace("pagination");
33237
33254
  const paginationContext = inject(paginationInjectionKey);
33238
33255
  const iconRotate = ref(0);
33239
33256
  const {
33240
33257
  size,
33241
33258
  currentPageSize,
33242
33259
  pageSizeOptions,
33260
+ pageSizeDirection,
33243
33261
  pageSizeChange,
33244
33262
  t
33245
33263
  } = paginationContext;
@@ -33247,7 +33265,7 @@ var PageSize = defineComponent({
33247
33265
  iconRotate.value = e ? 180 : 0;
33248
33266
  };
33249
33267
  return () => createVNode(Fragment, null, [createVNode(Dropdown$1, {
33250
- "position": ["bottom", "top"],
33268
+ "position": pageSizeDirection.value,
33251
33269
  "class": ns2.e("size-list"),
33252
33270
  "onToggle": onDropdownToggle
33253
33271
  }, {
@@ -33265,9 +33283,9 @@ var PageSize = defineComponent({
33265
33283
  "class": {
33266
33284
  active: item === currentPageSize.value
33267
33285
  },
33268
- "onClick": withModifiers(pageSizeChange.bind(null, {
33269
- value: item
33270
- }), ["stop"]),
33286
+ "onClick": () => {
33287
+ pageSizeChange(item);
33288
+ },
33271
33289
  "key": index2
33272
33290
  }, [item]))])
33273
33291
  }), createVNode("span", {
@@ -33294,6 +33312,7 @@ var Pagination = defineComponent({
33294
33312
  const {
33295
33313
  autoHide,
33296
33314
  pageSizeOptions,
33315
+ pageSizeDirection,
33297
33316
  total,
33298
33317
  canChangePageSize,
33299
33318
  lite,
@@ -33311,7 +33330,7 @@ var Pagination = defineComponent({
33311
33330
  showJumpButton,
33312
33331
  haveConfigMenu
33313
33332
  } = toRefs(props);
33314
- const ns2 = useNamespace$1("pagination");
33333
+ const ns2 = useNamespace("pagination");
33315
33334
  const totalPages = computed(() => Math.ceil(props.total / props.pageSize));
33316
33335
  const litePageOptions = computed(() => liteSelectOptions(totalPages.value));
33317
33336
  const cursor = computed({
@@ -33339,7 +33358,7 @@ var Pagination = defineComponent({
33339
33358
  emit("pageIndexChange", val);
33340
33359
  };
33341
33360
  const pageSizeChange = (val) => {
33342
- currentPageSize.value = val.value;
33361
+ currentPageSize.value = val;
33343
33362
  if (props.autoFixPageIndex) {
33344
33363
  nextTick(() => {
33345
33364
  if (cursor.value > totalPages.value) {
@@ -33347,7 +33366,7 @@ var Pagination = defineComponent({
33347
33366
  }
33348
33367
  });
33349
33368
  }
33350
- emit("pageSizeChange", val.value);
33369
+ emit("pageSizeChange", val);
33351
33370
  };
33352
33371
  const litePageIndexChange = (page) => {
33353
33372
  changeCursorEmit(page.value);
@@ -33356,6 +33375,7 @@ var Pagination = defineComponent({
33356
33375
  size,
33357
33376
  currentPageSize,
33358
33377
  pageSizeOptions,
33378
+ pageSizeDirection,
33359
33379
  pageSizeChange,
33360
33380
  t
33361
33381
  });
@@ -44043,7 +44063,7 @@ const installs = [
44043
44063
  VirtualListInstall
44044
44064
  ];
44045
44065
  var vueDevui = {
44046
- version: "1.5.13",
44066
+ version: "1.5.15-feat.1",
44047
44067
  install(app) {
44048
44068
  installs.forEach((p) => app.use(p));
44049
44069
  }