vue-devui 1.6.15 → 1.6.17

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 (75) hide show
  1. package/auto-complete/index.es.js +41 -4
  2. package/auto-complete/index.umd.js +12 -12
  3. package/breadcrumb/index.es.js +40 -3
  4. package/breadcrumb/index.umd.js +1 -1
  5. package/category-search/index.es.js +74 -6
  6. package/category-search/index.umd.js +21 -21
  7. package/checkbox/index.es.js +41 -4
  8. package/checkbox/index.umd.js +16 -16
  9. package/code-review/index.es.js +41 -4
  10. package/code-review/index.umd.js +17 -17
  11. package/data-grid/index.es.js +41 -4
  12. package/data-grid/index.umd.js +14 -14
  13. package/date-picker-pro/index.es.js +41 -4
  14. package/date-picker-pro/index.umd.js +8 -8
  15. package/dropdown/index.es.js +40 -3
  16. package/dropdown/index.umd.js +1 -1
  17. package/editable-select/index.es.js +48 -8
  18. package/editable-select/index.umd.js +15 -15
  19. package/editor-md/index.es.js +50 -6
  20. package/editor-md/index.umd.js +26 -26
  21. package/form/index.es.js +41 -4
  22. package/form/index.umd.js +14 -14
  23. package/input/index.es.js +40 -3
  24. package/input/index.umd.js +19 -19
  25. package/input-number/index.es.js +41 -4
  26. package/input-number/index.umd.js +18 -18
  27. package/mention/index.es.js +41 -4
  28. package/mention/index.umd.js +19 -19
  29. package/message/index.es.js +13 -13
  30. package/message/index.umd.js +1 -1
  31. package/modal/index.es.js +40 -3
  32. package/modal/index.umd.js +2 -2
  33. package/overlay/index.es.js +41 -4
  34. package/overlay/index.umd.js +1 -1
  35. package/package.json +2 -1
  36. package/pagination/index.es.js +58 -21
  37. package/pagination/index.umd.js +17 -17
  38. package/pagination/style.css +1 -1
  39. package/popover/index.es.js +41 -4
  40. package/popover/index.umd.js +9 -9
  41. package/radio/index.es.js +41 -4
  42. package/radio/index.umd.js +17 -17
  43. package/search/index.es.js +41 -4
  44. package/search/index.umd.js +17 -17
  45. package/select/index.es.js +58 -21
  46. package/select/index.umd.js +19 -19
  47. package/select/style.css +1 -1
  48. package/splitter/index.es.js +41 -4
  49. package/splitter/index.umd.js +15 -15
  50. package/style.css +1 -1
  51. package/switch/index.es.js +41 -4
  52. package/switch/index.umd.js +14 -14
  53. package/table/index.es.js +40 -3
  54. package/table/index.umd.js +15 -15
  55. package/textarea/index.es.js +41 -4
  56. package/textarea/index.umd.js +16 -16
  57. package/time-picker/index.es.js +40 -3
  58. package/time-picker/index.umd.js +15 -15
  59. package/time-select/index.es.js +58 -21
  60. package/time-select/index.umd.js +17 -17
  61. package/time-select/style.css +1 -1
  62. package/tooltip/index.es.js +41 -4
  63. package/tooltip/index.umd.js +12 -12
  64. package/tree/index.es.js +40 -3
  65. package/tree/index.umd.js +10 -10
  66. package/types/category-search/src/category-search-types.d.ts +5 -0
  67. package/types/editable-select/src/editable-select-types.d.ts +3 -0
  68. package/types/overlay/src/flexible-overlay/flexible-overlay-types.d.ts +5 -6
  69. package/types/overlay/src/flexible-overlay/index.d.ts +9 -0
  70. package/types/overlay/src/flexible-overlay/use-flexible-overlay.d.ts +11 -2
  71. package/types/select/src/composables/use-select-content.d.ts +21 -2
  72. package/types/select/src/select-types.d.ts +7 -44
  73. package/types/select/src/use-select.d.ts +26 -2
  74. package/vue-devui.es.js +122 -44
  75. package/vue-devui.umd.js +74 -74
@@ -8028,6 +8028,10 @@ const flexibleOverlayProps = {
8028
8028
  clickEventBubble: {
8029
8029
  type: Boolean,
8030
8030
  default: false
8031
+ },
8032
+ fitOriginWidth: {
8033
+ type: Boolean,
8034
+ default: false
8031
8035
  }
8032
8036
  };
8033
8037
  function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
@@ -8050,9 +8054,18 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
8050
8054
  return { x, y };
8051
8055
  }
8052
8056
  function useOverlay(props, emit) {
8053
- const { position, showArrow } = toRefs(props);
8057
+ const { fitOriginWidth, position, showArrow } = toRefs(props);
8054
8058
  const overlayRef = ref();
8055
8059
  const arrowRef = ref();
8060
+ const overlayWidth = ref(0);
8061
+ let originObserver;
8062
+ const styles = computed(() => {
8063
+ if (fitOriginWidth.value) {
8064
+ return { width: overlayWidth.value + "px" };
8065
+ } else {
8066
+ return {};
8067
+ }
8068
+ });
8056
8069
  const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
8057
8070
  const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
8058
8071
  const staticSide = {
@@ -8097,21 +8110,43 @@ function useOverlay(props, emit) {
8097
8110
  updatePosition();
8098
8111
  }
8099
8112
  };
8113
+ const updateWidth = (originEl) => {
8114
+ overlayWidth.value = originEl.getBoundingClientRect().width;
8115
+ updatePosition();
8116
+ };
8117
+ const observeOrigin = () => {
8118
+ var _a, _b;
8119
+ if (fitOriginWidth.value && typeof window !== "undefined") {
8120
+ const originEl = (_b = (_a = props.origin) == null ? void 0 : _a.$el) != null ? _b : props.origin;
8121
+ if (originEl) {
8122
+ originObserver = new window.ResizeObserver(() => updateWidth(originEl));
8123
+ originObserver.observe(originEl);
8124
+ }
8125
+ }
8126
+ };
8127
+ const unobserveOrigin = () => {
8128
+ var _a, _b;
8129
+ const originEl = (_b = (_a = props.origin) == null ? void 0 : _a.$el) != null ? _b : props.origin;
8130
+ originEl && (originObserver == null ? void 0 : originObserver.unobserve(originEl));
8131
+ };
8100
8132
  watch(() => props.modelValue, () => {
8101
8133
  if (props.modelValue && props.origin) {
8102
8134
  nextTick(updatePosition);
8103
8135
  window.addEventListener("scroll", scrollCallback, true);
8104
8136
  window.addEventListener("resize", updatePosition);
8137
+ observeOrigin();
8105
8138
  } else {
8106
8139
  window.removeEventListener("scroll", scrollCallback, true);
8107
8140
  window.removeEventListener("resize", updatePosition);
8141
+ unobserveOrigin();
8108
8142
  }
8109
8143
  });
8110
8144
  onUnmounted(() => {
8111
8145
  window.removeEventListener("scroll", scrollCallback, true);
8112
8146
  window.removeEventListener("resize", updatePosition);
8147
+ unobserveOrigin();
8113
8148
  });
8114
- return { arrowRef, overlayRef, updatePosition };
8149
+ return { arrowRef, overlayRef, styles, updatePosition };
8115
8150
  }
8116
8151
  var flexibleOverlay = "";
8117
8152
  const FlexibleOverlay = defineComponent({
@@ -8132,6 +8167,7 @@ const FlexibleOverlay = defineComponent({
8132
8167
  const {
8133
8168
  arrowRef,
8134
8169
  overlayRef,
8170
+ styles,
8135
8171
  updatePosition
8136
8172
  } = useOverlay(props, emit);
8137
8173
  expose({
@@ -8141,7 +8177,8 @@ const FlexibleOverlay = defineComponent({
8141
8177
  var _a;
8142
8178
  return props.modelValue && createVNode("div", mergeProps({
8143
8179
  "ref": overlayRef,
8144
- "class": ns2.b()
8180
+ "class": ns2.b(),
8181
+ "style": styles.value
8145
8182
  }, attrs, {
8146
8183
  "onClick": withModifiers(() => ({}), [clickEventBubble.value ? "" : "stop"]),
8147
8184
  "onPointerup": withModifiers(() => ({}), ["stop"])
@@ -9244,6 +9281,13 @@ var EditorMd = defineComponent({
9244
9281
  fullscreenZIndex
9245
9282
  } = toRefs(props);
9246
9283
  const showFullscreen = ref(false);
9284
+ const finalModelValue = computed(() => {
9285
+ if (typeof maxlength.value === "number") {
9286
+ return modelValue.value.substring(0, maxlength.value);
9287
+ } else {
9288
+ return modelValue.value;
9289
+ }
9290
+ });
9247
9291
  const {
9248
9292
  editorRef,
9249
9293
  overlayRef,
@@ -9301,7 +9345,7 @@ var EditorMd = defineComponent({
9301
9345
  }, [createVNode("textarea", {
9302
9346
  "ref": editorRef,
9303
9347
  "placeholder": placeholder.value
9304
- }, [modelValue.value]), createVNode(FlexibleOverlay, {
9348
+ }, [finalModelValue.value]), createVNode(FlexibleOverlay, {
9305
9349
  "ref": overlayRef,
9306
9350
  "modelValue": isHintShow.value,
9307
9351
  "onUpdate:modelValue": ($event) => isHintShow.value = $event,
@@ -9317,11 +9361,11 @@ var EditorMd = defineComponent({
9317
9361
  }
9318
9362
  }), Boolean(maxlength == null ? void 0 : maxlength.value) && createVNode("div", {
9319
9363
  "class": "dp-md-count"
9320
- }, [modelValue.value.length || 0, createTextVNode("/"), maxlength.value])]), createVNode(MdRender, {
9364
+ }, [finalModelValue.value.length || 0, createTextVNode("/"), maxlength.value])]), createVNode(MdRender, {
9321
9365
  "ref": renderRef,
9322
9366
  "base-url": baseUrl.value,
9323
9367
  "breaks": breaks.value,
9324
- "content": modelValue.value,
9368
+ "content": finalModelValue.value,
9325
9369
  "custom-parse": customParse.value,
9326
9370
  "render-parse": renderParse.value,
9327
9371
  "md-rules": mdRules.value,