vue-devui 1.6.14 → 1.6.16

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 +60 -42
  2. package/auto-complete/index.umd.js +13 -13
  3. package/breadcrumb/index.es.js +57 -39
  4. package/breadcrumb/index.umd.js +1 -1
  5. package/category-search/index.es.js +93 -44
  6. package/category-search/index.umd.js +21 -21
  7. package/checkbox/index.es.js +60 -42
  8. package/checkbox/index.umd.js +18 -18
  9. package/code-review/index.es.js +60 -42
  10. package/code-review/index.umd.js +20 -20
  11. package/data-grid/index.es.js +60 -42
  12. package/data-grid/index.umd.js +15 -15
  13. package/date-picker-pro/index.es.js +60 -42
  14. package/date-picker-pro/index.umd.js +13 -13
  15. package/dropdown/index.es.js +57 -39
  16. package/dropdown/index.umd.js +1 -1
  17. package/editable-select/index.es.js +66 -43
  18. package/editable-select/index.umd.js +10 -10
  19. package/editor-md/index.es.js +69 -44
  20. package/editor-md/index.umd.js +28 -28
  21. package/form/index.es.js +60 -42
  22. package/form/index.umd.js +17 -17
  23. package/input/index.es.js +59 -41
  24. package/input/index.umd.js +20 -20
  25. package/input-number/index.es.js +60 -42
  26. package/input-number/index.umd.js +19 -19
  27. package/mention/index.es.js +60 -42
  28. package/mention/index.umd.js +17 -17
  29. package/message/index.es.js +13 -13
  30. package/message/index.umd.js +1 -1
  31. package/modal/index.es.js +57 -39
  32. package/modal/index.umd.js +2 -2
  33. package/overlay/index.es.js +58 -40
  34. package/overlay/index.umd.js +1 -1
  35. package/package.json +3 -2
  36. package/pagination/index.es.js +77 -59
  37. package/pagination/index.umd.js +18 -18
  38. package/pagination/style.css +1 -1
  39. package/popover/index.es.js +60 -42
  40. package/popover/index.umd.js +15 -15
  41. package/radio/index.es.js +60 -42
  42. package/radio/index.umd.js +16 -16
  43. package/search/index.es.js +60 -42
  44. package/search/index.umd.js +16 -16
  45. package/select/index.es.js +77 -59
  46. package/select/index.umd.js +20 -20
  47. package/select/style.css +1 -1
  48. package/splitter/index.es.js +60 -42
  49. package/splitter/index.umd.js +14 -14
  50. package/style.css +1 -1
  51. package/switch/index.es.js +60 -42
  52. package/switch/index.umd.js +17 -17
  53. package/table/index.es.js +59 -41
  54. package/table/index.umd.js +16 -16
  55. package/textarea/index.es.js +60 -42
  56. package/textarea/index.umd.js +19 -19
  57. package/time-picker/index.es.js +59 -41
  58. package/time-picker/index.umd.js +14 -14
  59. package/time-select/index.es.js +77 -59
  60. package/time-select/index.umd.js +18 -18
  61. package/time-select/style.css +1 -1
  62. package/tooltip/index.es.js +60 -42
  63. package/tooltip/index.umd.js +15 -15
  64. package/tree/index.es.js +59 -41
  65. package/tree/index.umd.js +14 -14
  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 +138 -77
  75. package/vue-devui.umd.js +74 -74
@@ -129,6 +129,9 @@ export interface ExtendConfig {
129
129
  disabled?: boolean;
130
130
  };
131
131
  }
132
+ export interface ITagContext {
133
+ toggle: (status?: boolean) => void;
134
+ }
132
135
  export declare const categorySearchProps: {
133
136
  category: {
134
137
  type: PropType<ICategorySearchTagItem[]>;
@@ -236,6 +239,8 @@ export interface CategorySearchInjection {
236
239
  showCurrentSearchCategory: (tag: ICategorySearchTagItem) => void;
237
240
  onInputBackspace: () => void;
238
241
  onInputToggle: () => void;
242
+ addTagContext: (field: string, context: ITagContext) => void;
243
+ removeTagContext: (field: string) => void;
239
244
  }
240
245
  export declare const categorySearchInjectionKey: InjectionKey<CategorySearchInjection>;
241
246
  export declare const categorySearchDropdownProps: {
@@ -71,6 +71,9 @@ export declare const editableSelectProps: {
71
71
  readonly type: BooleanConstructor;
72
72
  readonly default: true;
73
73
  };
74
+ readonly maxLength: {
75
+ readonly type: NumberConstructor;
76
+ };
74
77
  };
75
78
  export declare type EditableSelectProps = ExtractPropTypes<typeof editableSelectProps>;
76
79
  export interface EditableSelectContext {
@@ -1,4 +1,4 @@
1
- import type { ExtractPropTypes, PropType, Ref } from 'vue';
1
+ import type { ExtractPropTypes, PropType } from 'vue';
2
2
  export declare type Placement = 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
3
3
  export declare type Alignment = 'start' | 'end';
4
4
  export declare type OffsetOptions = {
@@ -9,11 +9,6 @@ export declare type Point = {
9
9
  x?: number;
10
10
  y?: number;
11
11
  };
12
- export declare type UseOverlayFn = {
13
- arrowRef: Ref<HTMLElement | undefined>;
14
- overlayRef: Ref<HTMLElement | undefined>;
15
- updatePosition: () => void;
16
- };
17
12
  export declare type EmitEventFn = (event: 'positionChange' | 'update:modelValue', result?: unknown) => void;
18
13
  export interface Rect {
19
14
  x: number;
@@ -57,5 +52,9 @@ export declare const flexibleOverlayProps: {
57
52
  type: BooleanConstructor;
58
53
  default: boolean;
59
54
  };
55
+ fitOriginWidth: {
56
+ type: BooleanConstructor;
57
+ default: boolean;
58
+ };
60
59
  };
61
60
  export declare type FlexibleOverlayProps = ExtractPropTypes<typeof flexibleOverlayProps>;
@@ -35,6 +35,10 @@ export declare const FlexibleOverlay: import("vue").DefineComponent<{
35
35
  type: BooleanConstructor;
36
36
  default: boolean;
37
37
  };
38
+ fitOriginWidth: {
39
+ type: BooleanConstructor;
40
+ default: boolean;
41
+ };
38
42
  }, () => false | JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "positionChange")[], "update:modelValue" | "positionChange", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
39
43
  modelValue: {
40
44
  type: BooleanConstructor;
@@ -71,6 +75,10 @@ export declare const FlexibleOverlay: import("vue").DefineComponent<{
71
75
  type: BooleanConstructor;
72
76
  default: boolean;
73
77
  };
78
+ fitOriginWidth: {
79
+ type: BooleanConstructor;
80
+ default: boolean;
81
+ };
74
82
  }>> & {
75
83
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
76
84
  onPositionChange?: ((...args: any[]) => any) | undefined;
@@ -82,4 +90,5 @@ export declare const FlexibleOverlay: import("vue").DefineComponent<{
82
90
  showArrow: boolean;
83
91
  isArrowCenter: boolean;
84
92
  clickEventBubble: boolean;
93
+ fitOriginWidth: boolean;
85
94
  }, {}>;
@@ -1,2 +1,11 @@
1
- import { FlexibleOverlayProps, UseOverlayFn, EmitEventFn } from './flexible-overlay-types';
2
- export declare function useOverlay(props: FlexibleOverlayProps, emit: EmitEventFn): UseOverlayFn;
1
+ import { FlexibleOverlayProps, EmitEventFn } from './flexible-overlay-types';
2
+ export declare function useOverlay(props: FlexibleOverlayProps, emit: EmitEventFn): {
3
+ arrowRef: import("vue").Ref<HTMLElement | undefined>;
4
+ overlayRef: import("vue").Ref<HTMLElement | undefined>;
5
+ styles: import("vue").ComputedRef<{
6
+ width: string;
7
+ } | {
8
+ width?: undefined;
9
+ }>;
10
+ updatePosition: () => Promise<void>;
11
+ };
@@ -1,2 +1,21 @@
1
- import { UseSelectContentReturnType } from '../select-types';
2
- export default function useSelectContent(): UseSelectContentReturnType;
1
+ import { OptionObjectItem } from '../select-types';
2
+ export default function useSelectContent(): {
3
+ select: import("../select-types").SelectContext | undefined;
4
+ searchQuery: import("vue").Ref<string>;
5
+ selectedData: import("vue").ComputedRef<OptionObjectItem[]>;
6
+ isSelectDisable: import("vue").ComputedRef<boolean>;
7
+ isSupportCollapseTags: import("vue").ComputedRef<boolean>;
8
+ isDisabledTooltip: import("vue").ComputedRef<boolean>;
9
+ isReadOnly: import("vue").ComputedRef<boolean>;
10
+ selectionCls: import("vue").ComputedRef<string>;
11
+ inputCls: import("vue").ComputedRef<string>;
12
+ tagSize: import("vue").ComputedRef<string>;
13
+ placeholder: import("vue").ComputedRef<string>;
14
+ isMultiple: import("vue").ComputedRef<boolean>;
15
+ displayInputValue: import("vue").ComputedRef<string>;
16
+ handleClear: (e: MouseEvent) => void;
17
+ tagDelete: (data: OptionObjectItem) => void;
18
+ onFocus: (e: FocusEvent) => void;
19
+ onBlur: (e: FocusEvent) => void;
20
+ queryFilter: (e: Event) => void;
21
+ };
@@ -105,34 +105,16 @@ export declare const selectProps: {
105
105
  readonly type: BooleanConstructor;
106
106
  readonly default: true;
107
107
  };
108
+ readonly menuClass: {
109
+ readonly type: StringConstructor;
110
+ readonly default: "";
111
+ };
112
+ readonly maxLength: {
113
+ readonly type: NumberConstructor;
114
+ };
108
115
  };
109
116
  export declare type SelectProps = ExtractPropTypes<typeof selectProps>;
110
117
  export declare type OptionModelValue = number | string;
111
- export interface UseSelectReturnType {
112
- selectDisabled: ComputedRef<boolean>;
113
- selectSize: ComputedRef<SelectSize>;
114
- originRef: Ref<HTMLElement | undefined>;
115
- dropdownRef: Ref<HTMLElement | undefined>;
116
- isOpen: Ref<boolean>;
117
- selectCls: ComputedRef<string>;
118
- mergeOptions: Ref<OptionObjectItem[]>;
119
- selectedOptions: ComputedRef<OptionObjectItem[]>;
120
- filterQuery: Ref<string>;
121
- emptyText: ComputedRef<string>;
122
- isLoading: Ref<boolean>;
123
- isShowEmptyText: ComputedRef<boolean>;
124
- handleClear: (e: MouseEvent) => void;
125
- valueChange: (item: OptionObjectItem) => void;
126
- handleClose: () => void;
127
- updateInjectOptions: (item: Record<string, unknown>, operation: string, isObject: boolean) => void;
128
- tagDelete: (data: OptionObjectItem) => void;
129
- onFocus: (e: FocusEvent) => void;
130
- onBlur: (e: FocusEvent) => void;
131
- isDisabled: (item: OptionObjectItem) => boolean;
132
- toggleChange: (bool: boolean) => void;
133
- debounceQueryFilter: (query: string) => void;
134
- isShowCreateOption: ComputedRef<boolean>;
135
- }
136
118
  export interface SelectContext extends SelectProps {
137
119
  selectDisabled: boolean;
138
120
  selectSize: string;
@@ -172,25 +154,6 @@ export interface UseOptionReturnType {
172
154
  isVisible: ComputedRef<boolean>;
173
155
  optionSelect: () => void;
174
156
  }
175
- export interface UseSelectContentReturnType {
176
- searchQuery: Ref<string>;
177
- selectedData: ComputedRef<OptionObjectItem[]>;
178
- isSelectDisable: ComputedRef<boolean>;
179
- isSupportCollapseTags: ComputedRef<boolean>;
180
- isDisabledTooltip: ComputedRef<boolean>;
181
- isReadOnly: ComputedRef<boolean>;
182
- selectionCls: ComputedRef<string>;
183
- inputCls: ComputedRef<string>;
184
- tagSize: ComputedRef<string>;
185
- placeholder: ComputedRef<string>;
186
- isMultiple: ComputedRef<boolean>;
187
- displayInputValue: ComputedRef<string>;
188
- handleClear: (e: MouseEvent) => void;
189
- tagDelete: (data: OptionObjectItem) => void;
190
- onFocus: (e: FocusEvent) => void;
191
- onBlur: (e: FocusEvent) => void;
192
- queryFilter: (e: Event) => void;
193
- }
194
157
  export interface UseSelectFunctionReturn {
195
158
  isSelectFocus: Ref<boolean>;
196
159
  blur: () => void;
@@ -1,4 +1,28 @@
1
1
  import { Ref } from 'vue';
2
2
  import type { SetupContext } from 'vue';
3
- import { SelectProps, UseSelectReturnType } from './select-types';
4
- export default function useSelect(props: SelectProps, selectRef: Ref<HTMLElement | undefined>, ctx: SetupContext, focus: () => void, blur: () => void, isSelectFocus: Ref<boolean>, t: (path: string) => unknown): UseSelectReturnType;
3
+ import { SelectProps, OptionObjectItem } from './select-types';
4
+ export default function useSelect(props: SelectProps, selectRef: Ref<HTMLElement | undefined>, ctx: SetupContext, focus: () => void, blur: () => void, isSelectFocus: Ref<boolean>, t: (path: string) => unknown): {
5
+ selectDisabled: import("vue").ComputedRef<any>;
6
+ selectSize: import("vue").ComputedRef<import("./select-types").SelectSize>;
7
+ originRef: Ref<HTMLElement | undefined>;
8
+ dropdownRef: Ref<any>;
9
+ isOpen: Ref<boolean>;
10
+ selectCls: import("vue").ComputedRef<string>;
11
+ mergeOptions: import("vue").ComputedRef<OptionObjectItem[]>;
12
+ selectedOptions: import("vue").ComputedRef<OptionObjectItem[]>;
13
+ filterQuery: Ref<string>;
14
+ emptyText: import("vue").ComputedRef<string>;
15
+ isLoading: import("vue").ComputedRef<boolean>;
16
+ isShowEmptyText: import("vue").ComputedRef<boolean>;
17
+ handleClear: () => void;
18
+ valueChange: (item: OptionObjectItem) => void;
19
+ handleClose: () => void;
20
+ updateInjectOptions: (item: Record<string, unknown>, operation: string, isObject: boolean) => void;
21
+ tagDelete: (data: OptionObjectItem) => void;
22
+ onFocus: (e: FocusEvent) => void;
23
+ onBlur: (e: FocusEvent) => void;
24
+ isDisabled: (item: OptionObjectItem) => boolean;
25
+ toggleChange: (bool: boolean) => void;
26
+ debounceQueryFilter: import("lodash").DebouncedFunc<(query: string) => void>;
27
+ isShowCreateOption: import("vue").ComputedRef<boolean>;
28
+ };
package/vue-devui.es.js CHANGED
@@ -37,7 +37,7 @@ var _a;
37
37
  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";
38
38
  import { useRoute } from "vue-router";
39
39
  import Clipboard from "clipboard";
40
- import { offset, autoPlacement, arrow, shift, computePosition, flip } from "@floating-ui/dom";
40
+ import { offset, flip, arrow, computePosition } from "@floating-ui/dom";
41
41
  import { onClickOutside, toRefs as toRefs$1, useResizeObserver } from "@vueuse/core";
42
42
  import * as Diff2Html from "diff2html";
43
43
  import { Diff2HtmlUI } from "diff2html/lib/ui/js/diff2html-ui";
@@ -7853,18 +7853,12 @@ const flexibleOverlayProps = {
7853
7853
  clickEventBubble: {
7854
7854
  type: Boolean,
7855
7855
  default: false
7856
+ },
7857
+ fitOriginWidth: {
7858
+ type: Boolean,
7859
+ default: false
7856
7860
  }
7857
7861
  };
7858
- function getScrollParent(element) {
7859
- const overflowRegex = /(auto|scroll|hidden)/;
7860
- for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
7861
- const style = window.getComputedStyle(parent);
7862
- if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
7863
- return parent;
7864
- }
7865
- }
7866
- return window;
7867
- }
7868
7862
  function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
7869
7863
  let { x, y } = point;
7870
7864
  if (!isArrowCenter) {
@@ -7885,9 +7879,18 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
7885
7879
  return { x, y };
7886
7880
  }
7887
7881
  function useOverlay(props, emit) {
7882
+ const { fitOriginWidth, position, showArrow } = toRefs(props);
7888
7883
  const overlayRef = ref();
7889
7884
  const arrowRef = ref();
7890
- let originParent = null;
7885
+ const overlayWidth = ref(0);
7886
+ let originObserver;
7887
+ const styles = computed(() => {
7888
+ if (fitOriginWidth.value) {
7889
+ return { width: overlayWidth.value + "px" };
7890
+ } else {
7891
+ return {};
7892
+ }
7893
+ });
7891
7894
  const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
7892
7895
  const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
7893
7896
  const staticSide = {
@@ -7908,54 +7911,67 @@ function useOverlay(props, emit) {
7908
7911
  const hostEl = props.origin;
7909
7912
  const overlayEl = unref(overlayRef.value);
7910
7913
  const arrowEl = unref(arrowRef.value);
7911
- const middleware = [
7912
- offset(props.offset),
7913
- autoPlacement({
7914
- alignment: props.align,
7915
- allowedPlacements: props.position
7916
- })
7917
- ];
7918
- props.showArrow && middleware.push(arrow({ element: arrowEl }));
7919
- props.shiftOffset !== void 0 && middleware.push(shift());
7920
- if (!overlayEl) {
7921
- return;
7914
+ const [mainPosition, ...fallbackPosition] = position.value;
7915
+ const middleware = [offset(props.offset)];
7916
+ middleware.push(fallbackPosition.length ? flip({ fallbackPlacements: fallbackPosition }) : flip());
7917
+ if (showArrow.value) {
7918
+ middleware.push(arrow({ element: arrowRef.value }));
7922
7919
  }
7923
7920
  const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
7924
7921
  strategy: "fixed",
7922
+ placement: mainPosition,
7925
7923
  middleware
7926
7924
  });
7927
7925
  let applyX = x;
7928
7926
  let applyY = y;
7929
- if (props.shiftOffset !== void 0) {
7930
- const { x: shiftX, y: shiftY } = middlewareData.shift;
7931
- shiftX < 0 && (applyX -= props.shiftOffset);
7932
- shiftX > 0 && (applyX += props.shiftOffset);
7933
- shiftY < 0 && (applyY -= props.shiftOffset);
7934
- shiftY > 0 && (applyY += props.shiftOffset);
7935
- }
7936
7927
  emit("positionChange", placement);
7937
7928
  Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
7938
7929
  props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
7939
7930
  };
7931
+ const scrollCallback = (e) => {
7932
+ var _a2, _b;
7933
+ const scrollElement = e.target;
7934
+ if (scrollElement == null ? void 0 : scrollElement.contains((_b = (_a2 = props.origin) == null ? void 0 : _a2.$el) != null ? _b : props.origin)) {
7935
+ updatePosition();
7936
+ }
7937
+ };
7938
+ const updateWidth = (originEl) => {
7939
+ overlayWidth.value = originEl.getBoundingClientRect().width;
7940
+ updatePosition();
7941
+ };
7942
+ const observeOrigin = () => {
7943
+ var _a2, _b;
7944
+ if (fitOriginWidth.value && typeof window !== "undefined") {
7945
+ const originEl = (_b = (_a2 = props.origin) == null ? void 0 : _a2.$el) != null ? _b : props.origin;
7946
+ if (originEl) {
7947
+ originObserver = new window.ResizeObserver(() => updateWidth(originEl));
7948
+ originObserver.observe(originEl);
7949
+ }
7950
+ }
7951
+ };
7952
+ const unobserveOrigin = () => {
7953
+ var _a2, _b;
7954
+ const originEl = (_b = (_a2 = props.origin) == null ? void 0 : _a2.$el) != null ? _b : props.origin;
7955
+ originEl && (originObserver == null ? void 0 : originObserver.unobserve(originEl));
7956
+ };
7940
7957
  watch(() => props.modelValue, () => {
7941
7958
  if (props.modelValue && props.origin) {
7942
- originParent = getScrollParent(props.origin);
7943
7959
  nextTick(updatePosition);
7944
- originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
7945
- originParent !== window && window.addEventListener("scroll", updatePosition);
7960
+ window.addEventListener("scroll", scrollCallback, true);
7946
7961
  window.addEventListener("resize", updatePosition);
7962
+ observeOrigin();
7947
7963
  } else {
7948
- originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
7949
- originParent !== window && window.removeEventListener("scroll", updatePosition);
7964
+ window.removeEventListener("scroll", scrollCallback, true);
7950
7965
  window.removeEventListener("resize", updatePosition);
7966
+ unobserveOrigin();
7951
7967
  }
7952
7968
  });
7953
7969
  onUnmounted(() => {
7954
- originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
7955
- originParent !== window && window.removeEventListener("scroll", updatePosition);
7970
+ window.removeEventListener("scroll", scrollCallback, true);
7956
7971
  window.removeEventListener("resize", updatePosition);
7972
+ unobserveOrigin();
7957
7973
  });
7958
- return { arrowRef, overlayRef, updatePosition };
7974
+ return { arrowRef, overlayRef, styles, updatePosition };
7959
7975
  }
7960
7976
  var flexibleOverlay = "";
7961
7977
  const FlexibleOverlay = defineComponent({
@@ -7976,6 +7992,7 @@ const FlexibleOverlay = defineComponent({
7976
7992
  const {
7977
7993
  arrowRef,
7978
7994
  overlayRef,
7995
+ styles,
7979
7996
  updatePosition
7980
7997
  } = useOverlay(props, emit);
7981
7998
  expose({
@@ -7985,7 +8002,8 @@ const FlexibleOverlay = defineComponent({
7985
8002
  var _a2;
7986
8003
  return props.modelValue && createVNode("div", mergeProps({
7987
8004
  "ref": overlayRef,
7988
- "class": ns2.b()
8005
+ "class": ns2.b(),
8006
+ "style": styles.value
7989
8007
  }, attrs, {
7990
8008
  "onClick": withModifiers(() => ({}), [clickEventBubble.value ? "" : "stop"]),
7991
8009
  "onPointerup": withModifiers(() => ({}), ["stop"])
@@ -14420,7 +14438,9 @@ var CategorySearchTagDropdown = defineComponent({
14420
14438
  const {
14421
14439
  rootCtx,
14422
14440
  ComponentMap,
14423
- onSearchKeyTagClick
14441
+ onSearchKeyTagClick,
14442
+ addTagContext,
14443
+ removeTagContext
14424
14444
  } = inject(categorySearchInjectionKey);
14425
14445
  const isVisible = ref(false);
14426
14446
  const checkType = (tag2) => {
@@ -14435,6 +14455,21 @@ var CategorySearchTagDropdown = defineComponent({
14435
14455
  const onDropdownClose = () => {
14436
14456
  isVisible.value = false;
14437
14457
  };
14458
+ const toggle = (status2) => {
14459
+ if (typeof status2 === "boolean") {
14460
+ isVisible.value = status2;
14461
+ } else {
14462
+ onTagClick();
14463
+ }
14464
+ };
14465
+ onMounted(() => {
14466
+ addTagContext(item.value.field, {
14467
+ toggle
14468
+ });
14469
+ });
14470
+ onUnmounted(() => {
14471
+ removeTagContext(item.value.field);
14472
+ });
14438
14473
  return () => item.value.type !== "keyword" ? createVNode(Dropdown$1, {
14439
14474
  "visible": isVisible.value,
14440
14475
  "trigger": "manually",
@@ -16769,12 +16804,24 @@ function useCategorySearch(props, ctx2) {
16769
16804
  watch(() => extendConfig == null ? void 0 : extendConfig.value, () => {
16770
16805
  merge$2(operationConfig, (extendConfig == null ? void 0 : extendConfig.value) || {});
16771
16806
  }, { immediate: true, deep: true });
16807
+ const tagContextMap = {};
16808
+ const addTagContext = (field, context2) => {
16809
+ Reflect.defineProperty(tagContextMap, field, { value: context2 });
16810
+ };
16811
+ const removeTagContext = (field) => {
16812
+ Reflect.deleteProperty(tagContextMap, field);
16813
+ };
16814
+ const toggleTagMenu = (field, status2) => {
16815
+ var _a2;
16816
+ (_a2 = tagContextMap[field]) == null ? void 0 : _a2.toggle(status2);
16817
+ };
16772
16818
  ctx2.expose({
16773
16819
  chooseItem,
16774
16820
  chooseItems,
16775
16821
  getTextInputValue,
16776
16822
  getNumberRangeValue,
16777
- searchCategory
16823
+ searchCategory,
16824
+ toggleTagMenu
16778
16825
  });
16779
16826
  onMounted(() => scrollToTail(true));
16780
16827
  provide(categorySearchInjectionKey, {
@@ -16814,7 +16861,9 @@ function useCategorySearch(props, ctx2) {
16814
16861
  searchCategory,
16815
16862
  showCurrentSearchCategory,
16816
16863
  onInputBackspace,
16817
- onInputToggle
16864
+ onInputToggle,
16865
+ addTagContext,
16866
+ removeTagContext
16818
16867
  });
16819
16868
  function init() {
16820
16869
  var _a2, _b;
@@ -33676,6 +33725,9 @@ const editableSelectProps = {
33676
33725
  showGlowStyle: {
33677
33726
  type: Boolean,
33678
33727
  default: true
33728
+ },
33729
+ maxLength: {
33730
+ type: Number
33679
33731
  }
33680
33732
  };
33681
33733
  const SELECT_KEY = Symbol("EditableSelect");
@@ -34153,7 +34205,8 @@ var EditableSelect = defineComponent({
34153
34205
  disabled,
34154
34206
  modelValue,
34155
34207
  position,
34156
- placeholder
34208
+ placeholder,
34209
+ maxLength
34157
34210
  } = toRefs(props);
34158
34211
  const align = computed(() => position.value.some((item) => item.includes("start") || item.includes("end")) ? "start" : null);
34159
34212
  const {
@@ -34266,6 +34319,7 @@ var EditableSelect = defineComponent({
34266
34319
  "disabled": disabled.value,
34267
34320
  "placeholder": placeholder.value,
34268
34321
  "value": states.inputValue,
34322
+ "maxlength": maxLength == null ? void 0 : maxLength.value,
34269
34323
  "type": "text",
34270
34324
  "onInput": onInput,
34271
34325
  "onFocus": handleFocus,
@@ -37352,6 +37406,13 @@ var EditorMd = defineComponent({
37352
37406
  fullscreenZIndex
37353
37407
  } = toRefs(props);
37354
37408
  const showFullscreen = ref(false);
37409
+ const finalModelValue = computed(() => {
37410
+ if (typeof maxlength.value === "number") {
37411
+ return modelValue.value.substring(0, maxlength.value);
37412
+ } else {
37413
+ return modelValue.value;
37414
+ }
37415
+ });
37355
37416
  const {
37356
37417
  editorRef,
37357
37418
  overlayRef,
@@ -37409,7 +37470,7 @@ var EditorMd = defineComponent({
37409
37470
  }, [createVNode("textarea", {
37410
37471
  "ref": editorRef,
37411
37472
  "placeholder": placeholder.value
37412
- }, [modelValue.value]), createVNode(FlexibleOverlay, {
37473
+ }, [finalModelValue.value]), createVNode(FlexibleOverlay, {
37413
37474
  "ref": overlayRef,
37414
37475
  "modelValue": isHintShow.value,
37415
37476
  "onUpdate:modelValue": ($event) => isHintShow.value = $event,
@@ -37425,11 +37486,11 @@ var EditorMd = defineComponent({
37425
37486
  }
37426
37487
  }), Boolean(maxlength == null ? void 0 : maxlength.value) && createVNode("div", {
37427
37488
  "class": "dp-md-count"
37428
- }, [modelValue.value.length || 0, createTextVNode("/"), maxlength.value])]), createVNode(MdRender, {
37489
+ }, [finalModelValue.value.length || 0, createTextVNode("/"), maxlength.value])]), createVNode(MdRender, {
37429
37490
  "ref": renderRef,
37430
37491
  "base-url": baseUrl.value,
37431
37492
  "breaks": breaks.value,
37432
- "content": modelValue.value,
37493
+ "content": finalModelValue.value,
37433
37494
  "custom-parse": customParse.value,
37434
37495
  "render-parse": renderParse.value,
37435
37496
  "md-rules": mdRules.value,
@@ -41065,10 +41126,12 @@ function ErrorIcon$1() {
41065
41126
  var message$1 = "";
41066
41127
  var Message$1 = defineComponent({
41067
41128
  name: "DMessage",
41129
+ inheritAttrs: false,
41068
41130
  props: messageProps,
41069
41131
  emits: ["destroy", "close"],
41070
41132
  setup(props, {
41071
41133
  emit,
41134
+ attrs,
41072
41135
  slots
41073
41136
  }) {
41074
41137
  const {
@@ -41153,19 +41216,17 @@ var Message$1 = defineComponent({
41153
41216
  "onClick": close2
41154
41217
  }, [createVNode(Close$1, null, null)]);
41155
41218
  });
41156
- return () => {
41157
- return createVNode(Transition, {
41158
- "name": "message-fade",
41159
- "onAfterLeave": handleDestroy
41160
- }, {
41161
- default: () => [visible.value && createVNode("div", {
41162
- "class": classes.value,
41163
- "style": __spreadValues({}, styles.value),
41164
- "onMouseenter": interrupt,
41165
- "onMouseleave": removeReset
41166
- }, [renderIcon.value, renderText.value, renderClose.value])]
41167
- });
41168
- };
41219
+ return () => createVNode(Transition, {
41220
+ "name": "message-fade",
41221
+ "onAfterLeave": handleDestroy
41222
+ }, {
41223
+ default: () => [visible.value && createVNode("div", mergeProps({
41224
+ "class": classes.value,
41225
+ "style": __spreadValues({}, styles.value),
41226
+ "onMouseenter": interrupt,
41227
+ "onMouseleave": removeReset
41228
+ }, attrs), [renderIcon.value, renderText.value, renderClose.value])]
41229
+ });
41169
41230
  }
41170
41231
  });
41171
41232
  function _isSlot$6(s) {
@@ -42564,6 +42625,13 @@ const selectProps = {
42564
42625
  showGlowStyle: {
42565
42626
  type: Boolean,
42566
42627
  default: true
42628
+ },
42629
+ menuClass: {
42630
+ type: String,
42631
+ default: ""
42632
+ },
42633
+ maxLength: {
42634
+ type: Number
42567
42635
  }
42568
42636
  };
42569
42637
  const optionProps = {
@@ -42749,6 +42817,7 @@ function useSelectContent() {
42749
42817
  }
42750
42818
  };
42751
42819
  return {
42820
+ select: select2,
42752
42821
  searchQuery,
42753
42822
  selectedData,
42754
42823
  isSelectDisable,
@@ -42784,6 +42853,7 @@ var SelectContent = defineComponent({
42784
42853
  const multipleCls = ns2.e("multiple");
42785
42854
  const multipleInputCls = ns2.em("multiple", "input");
42786
42855
  const {
42856
+ select: select2,
42787
42857
  searchQuery,
42788
42858
  selectedData,
42789
42859
  isSelectDisable,
@@ -42847,6 +42917,7 @@ var SelectContent = defineComponent({
42847
42917
  "placeholder": placeholder.value,
42848
42918
  "readonly": isReadOnly.value,
42849
42919
  "disabled": isSelectDisable.value,
42920
+ "maxlength": select2 == null ? void 0 : select2.maxLength,
42850
42921
  "onInput": queryFilter,
42851
42922
  "onFocus": onFocus,
42852
42923
  "onBlur": onBlur
@@ -42858,6 +42929,7 @@ var SelectContent = defineComponent({
42858
42929
  "placeholder": placeholder.value,
42859
42930
  "readonly": isReadOnly.value,
42860
42931
  "disabled": isSelectDisable.value,
42932
+ "maxlength": select2 == null ? void 0 : select2.maxLength,
42861
42933
  "onFocus": onFocus,
42862
42934
  "onBlur": onBlur,
42863
42935
  "onInput": queryFilter
@@ -42951,7 +43023,6 @@ var Select = defineComponent({
42951
43023
  const isRender = ref(false);
42952
43024
  const currentPosition = ref("bottom");
42953
43025
  const position = ref(["bottom-start", "top-start"]);
42954
- const dropdownWidth = ref("0");
42955
43026
  const handlePositionChange = (pos) => {
42956
43027
  currentPosition.value = pos.split("-")[0] === "top" ? "top" : "bottom";
42957
43028
  };
@@ -42959,14 +43030,9 @@ var Select = defineComponent({
42959
43030
  transformOrigin: currentPosition.value === "top" ? "0% 100%" : "0% 0%",
42960
43031
  "z-index": "var(--devui-z-index-dropdown, 1052)"
42961
43032
  }));
42962
- const updateDropdownWidth = () => {
42963
- var _a2;
42964
- dropdownWidth.value = ((_a2 = originRef == null ? void 0 : originRef.value) == null ? void 0 : _a2.clientWidth) ? originRef.value.clientWidth + "px" : "100%";
42965
- };
42966
43033
  watch(selectRef, (val) => {
42967
43034
  if (val) {
42968
43035
  originRef.value = val.$el;
42969
- updateDropdownWidth();
42970
43036
  }
42971
43037
  });
42972
43038
  const scrollToBottom = () => {
@@ -42978,15 +43044,11 @@ var Select = defineComponent({
42978
43044
  };
42979
43045
  onMounted(() => {
42980
43046
  isRender.value = true;
42981
- updateDropdownWidth();
42982
- window.addEventListener("resize", updateDropdownWidth);
42983
43047
  nextTick(() => {
42984
- dropdownContainer.value.addEventListener("scroll", scrollToBottom);
43048
+ var _a2;
43049
+ (_a2 = dropdownContainer.value) == null ? void 0 : _a2.addEventListener("scroll", scrollToBottom);
42985
43050
  });
42986
43051
  });
42987
- onUnmounted(() => {
42988
- window.removeEventListener("resize", updateDropdownWidth);
42989
- });
42990
43052
  provide(SELECT_TOKEN, reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
42991
43053
  selectDisabled,
42992
43054
  selectSize,
@@ -43022,17 +43084,16 @@ var Select = defineComponent({
43022
43084
  "origin": originRef.value,
43023
43085
  "align": "start",
43024
43086
  "offset": 4,
43087
+ "fit-origin-width": true,
43025
43088
  "position": position.value,
43026
43089
  "onPositionChange": handlePositionChange,
43027
- "style": styles.value
43090
+ "style": styles.value,
43091
+ "class": props.menuClass
43028
43092
  }, {
43029
43093
  default: () => {
43030
43094
  var _a2, _b, _c, _d;
43031
43095
  return [withDirectives(createVNode("div", {
43032
- "class": dropdownCls,
43033
- "style": {
43034
- width: `${dropdownWidth.value}`
43035
- }
43096
+ "class": dropdownCls
43036
43097
  }, [withDirectives(createVNode("ul", {
43037
43098
  "class": listCls,
43038
43099
  "ref": dropdownContainer
@@ -54375,7 +54436,7 @@ const installs = [
54375
54436
  VirtualListInstall
54376
54437
  ];
54377
54438
  var vueDevui = {
54378
- version: "1.6.14",
54439
+ version: "1.6.16",
54379
54440
  install(app) {
54380
54441
  installs.forEach((p) => app.use(p));
54381
54442
  }