vue-devui 1.6.19 → 1.6.21

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 (48) hide show
  1. package/action-timeline/index.es.js +12 -8
  2. package/action-timeline/index.umd.js +1 -1
  3. package/breadcrumb/index.es.js +6 -2
  4. package/breadcrumb/index.umd.js +2 -2
  5. package/category-search/index.es.js +1036 -2037
  6. package/category-search/index.umd.js +34 -34
  7. package/code-review/index.es.js +185 -9
  8. package/code-review/index.umd.js +27 -27
  9. package/code-review/style.css +1 -1
  10. package/data-grid/index.es.js +6 -2
  11. package/data-grid/index.umd.js +11 -11
  12. package/date-picker-pro/index.es.js +1 -1
  13. package/date-picker-pro/index.umd.js +1 -1
  14. package/dropdown/index.es.js +6 -2
  15. package/dropdown/index.umd.js +2 -2
  16. package/editable-select/index.es.js +1 -1
  17. package/editable-select/index.umd.js +1 -1
  18. package/editor-md/index.es.js +21 -8
  19. package/editor-md/index.umd.js +36 -36
  20. package/global.d.ts +0 -2
  21. package/input/index.es.js +1 -1
  22. package/input/index.umd.js +1 -1
  23. package/input-number/index.es.js +13 -9
  24. package/input-number/index.umd.js +10 -10
  25. package/package.json +1 -1
  26. package/pagination/index.es.js +7 -3
  27. package/pagination/index.umd.js +12 -12
  28. package/search/index.es.js +2 -8
  29. package/search/index.umd.js +1 -7
  30. package/select/index.es.js +1 -1
  31. package/select/index.umd.js +1 -1
  32. package/style.css +1 -1
  33. package/table/index.es.js +6 -2
  34. package/table/index.umd.js +11 -11
  35. package/time-picker/index.es.js +1 -1
  36. package/time-picker/index.umd.js +1 -1
  37. package/time-select/index.es.js +1 -1
  38. package/time-select/index.umd.js +1 -1
  39. package/tree/index.es.js +2 -2
  40. package/tree/index.umd.js +1 -1
  41. package/types/code-review/src/code-review-types.d.ts +4 -0
  42. package/types/code-review/src/composables/use-code-review-comment.d.ts +3 -0
  43. package/types/editor-md/src/composables/use-editor-md-toolbar.d.ts +1 -0
  44. package/types/editor-md/src/composables/use-editor-md.d.ts +2 -0
  45. package/types/editor-md/src/editor-md-types.d.ts +1 -0
  46. package/types/input-number/src/input-number-types.d.ts +10 -6
  47. package/vue-devui.es.js +455 -1273
  48. package/vue-devui.umd.js +98 -104
@@ -58,11 +58,15 @@ function debounce(func, wait, immediate) {
58
58
  return result;
59
59
  };
60
60
  }
61
+ function judgeFireIsElement(element) {
62
+ const str = Object.prototype.toString.call(element);
63
+ return str.includes("object") && str.includes("HTML") && str.includes("Element");
64
+ }
61
65
  function getElement(element) {
62
- if (element instanceof Element) {
66
+ if (element instanceof Element || judgeFireIsElement(element)) {
63
67
  return element;
64
68
  }
65
- if (element && typeof element === "object" && element.$el instanceof Element) {
69
+ if (element && typeof element === "object" && (element.$el instanceof Element || judgeFireIsElement(element.$el))) {
66
70
  return element.$el;
67
71
  }
68
72
  return null;
@@ -1796,7 +1800,7 @@ function locale(key) {
1796
1800
  loading: "\u6B63\u5728\u52A0\u8F7D\u4E2D...",
1797
1801
  pasting: "\u60A8\u7C98\u8D34\u5185\u5BB9\u8F83\u591A, \u6B63\u5728\u52AA\u529B\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u8010\u5FC3\u7B49\u5F85..."
1798
1802
  };
1799
- return localeMap[key];
1803
+ return localeMap[key] || key;
1800
1804
  }
1801
1805
  function _enforceMaxLength(cm, changes) {
1802
1806
  const maxLength = cm.getOption("maxLength");
@@ -7587,8 +7591,10 @@ function useEditorMd(props, ctx) {
7587
7591
  renderRef,
7588
7592
  containerRef,
7589
7593
  toolbars,
7594
+ toolbarConfig,
7590
7595
  previewHtmlList,
7591
7596
  isHintShow,
7597
+ customToolbars,
7592
7598
  getEditorIns,
7593
7599
  onPaste,
7594
7600
  previewContentChange,
@@ -8801,8 +8807,8 @@ var ToolbarItem = defineComponent({
8801
8807
  }
8802
8808
  });
8803
8809
  function useToolbar() {
8804
- const { toolbars, toolbarConfig } = inject(EditorMdInjectionKey);
8805
- return { toolbars, toolbarConfig };
8810
+ const { toolbars, toolbarConfig, customToolbars } = inject(EditorMdInjectionKey);
8811
+ return { toolbars, toolbarConfig, customToolbars };
8806
8812
  }
8807
8813
  var toolbar = "";
8808
8814
  var Toolbar = defineComponent({
@@ -8810,17 +8816,22 @@ var Toolbar = defineComponent({
8810
8816
  setup() {
8811
8817
  const {
8812
8818
  toolbars,
8813
- toolbarConfig
8819
+ toolbarConfig,
8820
+ customToolbars
8814
8821
  } = useToolbar();
8822
+ const tempToolbars = {
8823
+ ...toolbars,
8824
+ ...customToolbars == null ? void 0 : customToolbars.value
8825
+ };
8815
8826
  return () => createVNode("div", {
8816
8827
  "class": "md-toolbar-container"
8817
8828
  }, [toolbarConfig.value.map((item, index2) => Array.isArray(item) ? createVNode(Fragment, null, [item.map((key, idx) => createVNode(ToolbarItem, {
8818
- "config": toolbars[key],
8829
+ "config": tempToolbars[key],
8819
8830
  "key": `${index2}-${idx}`
8820
8831
  }, null)), createVNode("span", {
8821
8832
  "class": "md-toolbar-span"
8822
8833
  }, null)]) : createVNode(ToolbarItem, {
8823
- "config": toolbars[item],
8834
+ "config": tempToolbars[item],
8824
8835
  "key": index2
8825
8836
  }, null))]);
8826
8837
  }
@@ -9332,6 +9343,7 @@ var EditorMd = defineComponent({
9332
9343
  const {
9333
9344
  mode,
9334
9345
  toolbarConfig,
9346
+ customToolbars,
9335
9347
  editorContainerHeight,
9336
9348
  hidePreviewView,
9337
9349
  placeholder,
@@ -9380,6 +9392,7 @@ var EditorMd = defineComponent({
9380
9392
  showFullscreen,
9381
9393
  toolbars,
9382
9394
  toolbarConfig,
9395
+ customToolbars,
9383
9396
  getEditorIns,
9384
9397
  t: locale
9385
9398
  });