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
@@ -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
@@ -7853,6 +7853,10 @@ 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
7862
  function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
@@ -7875,9 +7879,18 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
7875
7879
  return { x, y };
7876
7880
  }
7877
7881
  function useOverlay(props, emit) {
7878
- const { position, showArrow } = toRefs(props);
7882
+ const { fitOriginWidth, position, showArrow } = toRefs(props);
7879
7883
  const overlayRef = ref();
7880
7884
  const arrowRef = ref();
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
+ });
7881
7894
  const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
7882
7895
  const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
7883
7896
  const staticSide = {
@@ -7922,21 +7935,43 @@ function useOverlay(props, emit) {
7922
7935
  updatePosition();
7923
7936
  }
7924
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
+ };
7925
7957
  watch(() => props.modelValue, () => {
7926
7958
  if (props.modelValue && props.origin) {
7927
7959
  nextTick(updatePosition);
7928
7960
  window.addEventListener("scroll", scrollCallback, true);
7929
7961
  window.addEventListener("resize", updatePosition);
7962
+ observeOrigin();
7930
7963
  } else {
7931
7964
  window.removeEventListener("scroll", scrollCallback, true);
7932
7965
  window.removeEventListener("resize", updatePosition);
7966
+ unobserveOrigin();
7933
7967
  }
7934
7968
  });
7935
7969
  onUnmounted(() => {
7936
7970
  window.removeEventListener("scroll", scrollCallback, true);
7937
7971
  window.removeEventListener("resize", updatePosition);
7972
+ unobserveOrigin();
7938
7973
  });
7939
- return { arrowRef, overlayRef, updatePosition };
7974
+ return { arrowRef, overlayRef, styles, updatePosition };
7940
7975
  }
7941
7976
  var flexibleOverlay = "";
7942
7977
  const FlexibleOverlay = defineComponent({
@@ -7957,6 +7992,7 @@ const FlexibleOverlay = defineComponent({
7957
7992
  const {
7958
7993
  arrowRef,
7959
7994
  overlayRef,
7995
+ styles,
7960
7996
  updatePosition
7961
7997
  } = useOverlay(props, emit);
7962
7998
  expose({
@@ -7966,7 +8002,8 @@ const FlexibleOverlay = defineComponent({
7966
8002
  var _a2;
7967
8003
  return props.modelValue && createVNode("div", mergeProps({
7968
8004
  "ref": overlayRef,
7969
- "class": ns2.b()
8005
+ "class": ns2.b(),
8006
+ "style": styles.value
7970
8007
  }, attrs, {
7971
8008
  "onClick": withModifiers(() => ({}), [clickEventBubble.value ? "" : "stop"]),
7972
8009
  "onPointerup": withModifiers(() => ({}), ["stop"])
@@ -14401,7 +14438,9 @@ var CategorySearchTagDropdown = defineComponent({
14401
14438
  const {
14402
14439
  rootCtx,
14403
14440
  ComponentMap,
14404
- onSearchKeyTagClick
14441
+ onSearchKeyTagClick,
14442
+ addTagContext,
14443
+ removeTagContext
14405
14444
  } = inject(categorySearchInjectionKey);
14406
14445
  const isVisible = ref(false);
14407
14446
  const checkType = (tag2) => {
@@ -14416,6 +14455,21 @@ var CategorySearchTagDropdown = defineComponent({
14416
14455
  const onDropdownClose = () => {
14417
14456
  isVisible.value = false;
14418
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
+ });
14419
14473
  return () => item.value.type !== "keyword" ? createVNode(Dropdown$1, {
14420
14474
  "visible": isVisible.value,
14421
14475
  "trigger": "manually",
@@ -16750,12 +16804,24 @@ function useCategorySearch(props, ctx2) {
16750
16804
  watch(() => extendConfig == null ? void 0 : extendConfig.value, () => {
16751
16805
  merge$2(operationConfig, (extendConfig == null ? void 0 : extendConfig.value) || {});
16752
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
+ };
16753
16818
  ctx2.expose({
16754
16819
  chooseItem,
16755
16820
  chooseItems,
16756
16821
  getTextInputValue,
16757
16822
  getNumberRangeValue,
16758
- searchCategory
16823
+ searchCategory,
16824
+ toggleTagMenu
16759
16825
  });
16760
16826
  onMounted(() => scrollToTail(true));
16761
16827
  provide(categorySearchInjectionKey, {
@@ -16795,7 +16861,9 @@ function useCategorySearch(props, ctx2) {
16795
16861
  searchCategory,
16796
16862
  showCurrentSearchCategory,
16797
16863
  onInputBackspace,
16798
- onInputToggle
16864
+ onInputToggle,
16865
+ addTagContext,
16866
+ removeTagContext
16799
16867
  });
16800
16868
  function init() {
16801
16869
  var _a2, _b;
@@ -33657,6 +33725,9 @@ const editableSelectProps = {
33657
33725
  showGlowStyle: {
33658
33726
  type: Boolean,
33659
33727
  default: true
33728
+ },
33729
+ maxLength: {
33730
+ type: Number
33660
33731
  }
33661
33732
  };
33662
33733
  const SELECT_KEY = Symbol("EditableSelect");
@@ -33899,9 +33970,7 @@ function useSelect$3(dropdownRef, props, states, setSoftFocus, ctx2) {
33899
33970
  setSelected();
33900
33971
  });
33901
33972
  watch(() => props.options, (newOptions) => {
33902
- if (newOptions.length !== 0) {
33903
- cachedOptions.value = newOptions;
33904
- }
33973
+ cachedOptions.value = newOptions;
33905
33974
  });
33906
33975
  onMounted(() => {
33907
33976
  setSelected();
@@ -34134,7 +34203,8 @@ var EditableSelect = defineComponent({
34134
34203
  disabled,
34135
34204
  modelValue,
34136
34205
  position,
34137
- placeholder
34206
+ placeholder,
34207
+ maxLength
34138
34208
  } = toRefs(props);
34139
34209
  const align = computed(() => position.value.some((item) => item.includes("start") || item.includes("end")) ? "start" : null);
34140
34210
  const {
@@ -34247,6 +34317,7 @@ var EditableSelect = defineComponent({
34247
34317
  "disabled": disabled.value,
34248
34318
  "placeholder": placeholder.value,
34249
34319
  "value": states.inputValue,
34320
+ "maxlength": maxLength == null ? void 0 : maxLength.value,
34250
34321
  "type": "text",
34251
34322
  "onInput": onInput,
34252
34323
  "onFocus": handleFocus,
@@ -37333,6 +37404,13 @@ var EditorMd = defineComponent({
37333
37404
  fullscreenZIndex
37334
37405
  } = toRefs(props);
37335
37406
  const showFullscreen = ref(false);
37407
+ const finalModelValue = computed(() => {
37408
+ if (typeof maxlength.value === "number") {
37409
+ return modelValue.value.substring(0, maxlength.value);
37410
+ } else {
37411
+ return modelValue.value;
37412
+ }
37413
+ });
37336
37414
  const {
37337
37415
  editorRef,
37338
37416
  overlayRef,
@@ -37390,7 +37468,7 @@ var EditorMd = defineComponent({
37390
37468
  }, [createVNode("textarea", {
37391
37469
  "ref": editorRef,
37392
37470
  "placeholder": placeholder.value
37393
- }, [modelValue.value]), createVNode(FlexibleOverlay, {
37471
+ }, [finalModelValue.value]), createVNode(FlexibleOverlay, {
37394
37472
  "ref": overlayRef,
37395
37473
  "modelValue": isHintShow.value,
37396
37474
  "onUpdate:modelValue": ($event) => isHintShow.value = $event,
@@ -37406,11 +37484,11 @@ var EditorMd = defineComponent({
37406
37484
  }
37407
37485
  }), Boolean(maxlength == null ? void 0 : maxlength.value) && createVNode("div", {
37408
37486
  "class": "dp-md-count"
37409
- }, [modelValue.value.length || 0, createTextVNode("/"), maxlength.value])]), createVNode(MdRender, {
37487
+ }, [finalModelValue.value.length || 0, createTextVNode("/"), maxlength.value])]), createVNode(MdRender, {
37410
37488
  "ref": renderRef,
37411
37489
  "base-url": baseUrl.value,
37412
37490
  "breaks": breaks.value,
37413
- "content": modelValue.value,
37491
+ "content": finalModelValue.value,
37414
37492
  "custom-parse": customParse.value,
37415
37493
  "render-parse": renderParse.value,
37416
37494
  "md-rules": mdRules.value,
@@ -41046,10 +41124,12 @@ function ErrorIcon$1() {
41046
41124
  var message$1 = "";
41047
41125
  var Message$1 = defineComponent({
41048
41126
  name: "DMessage",
41127
+ inheritAttrs: false,
41049
41128
  props: messageProps,
41050
41129
  emits: ["destroy", "close"],
41051
41130
  setup(props, {
41052
41131
  emit,
41132
+ attrs,
41053
41133
  slots
41054
41134
  }) {
41055
41135
  const {
@@ -41134,19 +41214,17 @@ var Message$1 = defineComponent({
41134
41214
  "onClick": close2
41135
41215
  }, [createVNode(Close$1, null, null)]);
41136
41216
  });
41137
- return () => {
41138
- return createVNode(Transition, {
41139
- "name": "message-fade",
41140
- "onAfterLeave": handleDestroy
41141
- }, {
41142
- default: () => [visible.value && createVNode("div", {
41143
- "class": classes.value,
41144
- "style": __spreadValues({}, styles.value),
41145
- "onMouseenter": interrupt,
41146
- "onMouseleave": removeReset
41147
- }, [renderIcon.value, renderText.value, renderClose.value])]
41148
- });
41149
- };
41217
+ return () => createVNode(Transition, {
41218
+ "name": "message-fade",
41219
+ "onAfterLeave": handleDestroy
41220
+ }, {
41221
+ default: () => [visible.value && createVNode("div", mergeProps({
41222
+ "class": classes.value,
41223
+ "style": __spreadValues({}, styles.value),
41224
+ "onMouseenter": interrupt,
41225
+ "onMouseleave": removeReset
41226
+ }, attrs), [renderIcon.value, renderText.value, renderClose.value])]
41227
+ });
41150
41228
  }
41151
41229
  });
41152
41230
  function _isSlot$6(s) {
@@ -42545,6 +42623,13 @@ const selectProps = {
42545
42623
  showGlowStyle: {
42546
42624
  type: Boolean,
42547
42625
  default: true
42626
+ },
42627
+ menuClass: {
42628
+ type: String,
42629
+ default: ""
42630
+ },
42631
+ maxLength: {
42632
+ type: Number
42548
42633
  }
42549
42634
  };
42550
42635
  const optionProps = {
@@ -42730,6 +42815,7 @@ function useSelectContent() {
42730
42815
  }
42731
42816
  };
42732
42817
  return {
42818
+ select: select2,
42733
42819
  searchQuery,
42734
42820
  selectedData,
42735
42821
  isSelectDisable,
@@ -42765,6 +42851,7 @@ var SelectContent = defineComponent({
42765
42851
  const multipleCls = ns2.e("multiple");
42766
42852
  const multipleInputCls = ns2.em("multiple", "input");
42767
42853
  const {
42854
+ select: select2,
42768
42855
  searchQuery,
42769
42856
  selectedData,
42770
42857
  isSelectDisable,
@@ -42828,6 +42915,7 @@ var SelectContent = defineComponent({
42828
42915
  "placeholder": placeholder.value,
42829
42916
  "readonly": isReadOnly.value,
42830
42917
  "disabled": isSelectDisable.value,
42918
+ "maxlength": select2 == null ? void 0 : select2.maxLength,
42831
42919
  "onInput": queryFilter,
42832
42920
  "onFocus": onFocus,
42833
42921
  "onBlur": onBlur
@@ -42839,6 +42927,7 @@ var SelectContent = defineComponent({
42839
42927
  "placeholder": placeholder.value,
42840
42928
  "readonly": isReadOnly.value,
42841
42929
  "disabled": isSelectDisable.value,
42930
+ "maxlength": select2 == null ? void 0 : select2.maxLength,
42842
42931
  "onFocus": onFocus,
42843
42932
  "onBlur": onBlur,
42844
42933
  "onInput": queryFilter
@@ -42932,7 +43021,6 @@ var Select = defineComponent({
42932
43021
  const isRender = ref(false);
42933
43022
  const currentPosition = ref("bottom");
42934
43023
  const position = ref(["bottom-start", "top-start"]);
42935
- const dropdownWidth = ref("0");
42936
43024
  const handlePositionChange = (pos) => {
42937
43025
  currentPosition.value = pos.split("-")[0] === "top" ? "top" : "bottom";
42938
43026
  };
@@ -42940,14 +43028,9 @@ var Select = defineComponent({
42940
43028
  transformOrigin: currentPosition.value === "top" ? "0% 100%" : "0% 0%",
42941
43029
  "z-index": "var(--devui-z-index-dropdown, 1052)"
42942
43030
  }));
42943
- const updateDropdownWidth = () => {
42944
- var _a2;
42945
- dropdownWidth.value = ((_a2 = originRef == null ? void 0 : originRef.value) == null ? void 0 : _a2.clientWidth) ? originRef.value.clientWidth + "px" : "100%";
42946
- };
42947
43031
  watch(selectRef, (val) => {
42948
43032
  if (val) {
42949
43033
  originRef.value = val.$el;
42950
- updateDropdownWidth();
42951
43034
  }
42952
43035
  });
42953
43036
  const scrollToBottom = () => {
@@ -42959,15 +43042,11 @@ var Select = defineComponent({
42959
43042
  };
42960
43043
  onMounted(() => {
42961
43044
  isRender.value = true;
42962
- updateDropdownWidth();
42963
- window.addEventListener("resize", updateDropdownWidth);
42964
43045
  nextTick(() => {
42965
- dropdownContainer.value.addEventListener("scroll", scrollToBottom);
43046
+ var _a2;
43047
+ (_a2 = dropdownContainer.value) == null ? void 0 : _a2.addEventListener("scroll", scrollToBottom);
42966
43048
  });
42967
43049
  });
42968
- onUnmounted(() => {
42969
- window.removeEventListener("resize", updateDropdownWidth);
42970
- });
42971
43050
  provide(SELECT_TOKEN, reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
42972
43051
  selectDisabled,
42973
43052
  selectSize,
@@ -43003,17 +43082,16 @@ var Select = defineComponent({
43003
43082
  "origin": originRef.value,
43004
43083
  "align": "start",
43005
43084
  "offset": 4,
43085
+ "fit-origin-width": true,
43006
43086
  "position": position.value,
43007
43087
  "onPositionChange": handlePositionChange,
43008
- "style": styles.value
43088
+ "style": styles.value,
43089
+ "class": props.menuClass
43009
43090
  }, {
43010
43091
  default: () => {
43011
43092
  var _a2, _b, _c, _d;
43012
43093
  return [withDirectives(createVNode("div", {
43013
- "class": dropdownCls,
43014
- "style": {
43015
- width: `${dropdownWidth.value}`
43016
- }
43094
+ "class": dropdownCls
43017
43095
  }, [withDirectives(createVNode("ul", {
43018
43096
  "class": listCls,
43019
43097
  "ref": dropdownContainer
@@ -54356,7 +54434,7 @@ const installs = [
54356
54434
  VirtualListInstall
54357
54435
  ];
54358
54436
  var vueDevui = {
54359
- version: "1.6.15",
54437
+ version: "1.6.17",
54360
54438
  install(app) {
54361
54439
  installs.forEach((p) => app.use(p));
54362
54440
  }