vue-devui 1.6.4 → 1.6.6

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 (127) hide show
  1. package/auto-complete/index.es.js +19 -6
  2. package/auto-complete/index.umd.js +10 -10
  3. package/auto-complete/style.css +1 -1
  4. package/breadcrumb/index.es.js +2 -15
  5. package/breadcrumb/index.umd.js +1 -1
  6. package/breadcrumb/style.css +1 -1
  7. package/button/index.es.js +31 -12
  8. package/button/index.umd.js +10 -10
  9. package/button/style.css +1 -1
  10. package/carousel/index.es.js +36 -213
  11. package/carousel/index.umd.js +1 -1
  12. package/carousel/style.css +1 -1
  13. package/category-search/index.es.js +53 -29
  14. package/category-search/index.umd.js +12 -12
  15. package/category-search/style.css +1 -1
  16. package/checkbox/index.es.js +22 -9
  17. package/checkbox/index.umd.js +8 -8
  18. package/checkbox/style.css +1 -1
  19. package/code-review/style.css +1 -1
  20. package/collapse/index.es.js +15 -18
  21. package/collapse/index.umd.js +5 -5
  22. package/data-grid/index.es.js +48 -29
  23. package/data-grid/index.umd.js +6 -6
  24. package/data-grid/style.css +1 -1
  25. package/date-picker-pro/index.es.js +91 -20
  26. package/date-picker-pro/index.umd.js +16 -16
  27. package/date-picker-pro/style.css +1 -1
  28. package/dropdown/index.es.js +2 -15
  29. package/dropdown/index.umd.js +1 -1
  30. package/dropdown/style.css +1 -1
  31. package/editable-select/index.es.js +84 -207
  32. package/editable-select/index.umd.js +20 -16
  33. package/editable-select/style.css +1 -1
  34. package/editor-md/index.es.js +32 -18
  35. package/editor-md/index.umd.js +15 -15
  36. package/editor-md/style.css +1 -1
  37. package/form/style.css +1 -1
  38. package/icon/index.es.js +1 -2
  39. package/icon/index.umd.js +1 -1
  40. package/input/index.es.js +27 -7
  41. package/input/index.umd.js +11 -11
  42. package/input/style.css +1 -1
  43. package/input-number/index.es.js +5 -0
  44. package/input-number/index.umd.js +10 -10
  45. package/input-number/style.css +1 -1
  46. package/mention/index.es.js +12 -3
  47. package/mention/index.umd.js +8 -8
  48. package/mention/style.css +1 -1
  49. package/message/index.es.js +1 -2
  50. package/message/index.umd.js +1 -1
  51. package/modal/index.es.js +27 -4
  52. package/modal/index.umd.js +7 -1
  53. package/modal/style.css +1 -1
  54. package/notification/index.es.js +1 -2
  55. package/notification/index.umd.js +2 -2
  56. package/overlay/style.css +1 -1
  57. package/package.json +1 -1
  58. package/pagination/index.es.js +83 -263
  59. package/pagination/index.umd.js +14 -19
  60. package/pagination/style.css +1 -1
  61. package/popover/style.css +1 -1
  62. package/radio/index.es.js +10 -28
  63. package/radio/index.umd.js +9 -9
  64. package/radio/style.css +1 -1
  65. package/result/index.es.js +1 -2
  66. package/result/index.umd.js +1 -1
  67. package/search/index.es.js +54 -28
  68. package/search/index.umd.js +18 -14
  69. package/search/style.css +1 -1
  70. package/select/index.es.js +71 -52
  71. package/select/index.umd.js +18 -23
  72. package/select/style.css +1 -1
  73. package/splitter/style.css +1 -1
  74. package/steps/index.es.js +1 -2
  75. package/steps/index.umd.js +1 -1
  76. package/style.css +2 -2
  77. package/switch/index.es.js +16 -2
  78. package/switch/index.umd.js +15 -15
  79. package/switch/style.css +1 -1
  80. package/table/index.es.js +49 -30
  81. package/table/index.umd.js +12 -12
  82. package/table/style.css +1 -1
  83. package/textarea/index.es.js +6 -1
  84. package/textarea/index.umd.js +1 -1
  85. package/textarea/style.css +1 -1
  86. package/time-picker/index.es.js +66 -14
  87. package/time-picker/index.umd.js +16 -16
  88. package/time-picker/style.css +1 -1
  89. package/time-select/index.es.js +71 -52
  90. package/time-select/index.umd.js +12 -17
  91. package/time-select/style.css +1 -1
  92. package/timeline/index.es.js +1 -2
  93. package/timeline/index.umd.js +1 -1
  94. package/tooltip/style.css +1 -1
  95. package/tree/index.es.js +22 -9
  96. package/tree/index.umd.js +9 -9
  97. package/tree/style.css +1 -1
  98. package/types/auto-complete/src/auto-complete-types.d.ts +4 -0
  99. package/types/carousel/src/components/carousel-icons.d.ts +2 -0
  100. package/types/cascader/src/cascader-types.d.ts +4 -0
  101. package/types/checkbox/src/checkbox-types.d.ts +8 -0
  102. package/types/date-picker-pro/src/date-picker-pro-types.d.ts +12 -0
  103. package/types/date-picker-pro/src/range-date-picker-types.d.ts +4 -0
  104. package/types/dropdown/src/use-dropdown.d.ts +1 -1
  105. package/types/editable-select/src/editable-select-types.d.ts +4 -0
  106. package/types/editor-md/src/composables/use-editor-md.d.ts +1 -0
  107. package/types/editor-md/src/editor-md-types.d.ts +3 -0
  108. package/types/icon/src/icon-types.d.ts +0 -1
  109. package/types/input/src/input-types.d.ts +4 -0
  110. package/types/input-icon/src/input-icon.d.ts +9 -0
  111. package/types/input-number/src/input-number-types.d.ts +4 -0
  112. package/types/mention/src/mention-types.d.ts +4 -0
  113. package/types/mention/src/mention.d.ts +9 -0
  114. package/types/modal/src/components/modal-icons.d.ts +1 -0
  115. package/types/radio/src/radio-types.d.ts +8 -0
  116. package/types/select/src/select-types.d.ts +4 -0
  117. package/types/svg-icons/index.d.ts +3 -0
  118. package/types/textarea/src/textarea-types.d.ts +4 -0
  119. package/types/time-picker/src/components/time-scroll/index.d.ts +9 -0
  120. package/types/time-picker/src/time-picker-types.d.ts +4 -0
  121. package/upload/index.es.js +1 -2
  122. package/upload/index.umd.js +2 -2
  123. package/vue-devui.es.js +393 -174
  124. package/vue-devui.umd.js +93 -82
  125. package/types/search/src/components/search-close-icon.d.ts +0 -2
  126. package/types/search/src/components/search-icon.d.ts +0 -2
  127. package/types/select/src/components/select-arrow-icon.d.ts +0 -2
@@ -18,7 +18,7 @@ var __publicField = (obj, key, value) => {
18
18
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
19
19
  return value;
20
20
  };
21
- import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps, watch, onUnmounted, Transition, ref, unref, nextTick, withModifiers, inject, h, render, withDirectives, resolveDirective, renderSlot, useSlots, reactive, getCurrentInstance, onMounted, provide, toRef, vShow, Teleport, isVNode } from "vue";
21
+ import { watch, onUnmounted, defineComponent, toRefs, createVNode, Transition, mergeProps, ref, unref, nextTick, withModifiers, inject, computed, h, render, withDirectives, resolveDirective, renderSlot, useSlots, reactive, getCurrentInstance, onMounted, provide, toRef, vShow, Teleport, isVNode } from "vue";
22
22
  import { onClickOutside } from "@vueuse/core";
23
23
  import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
24
24
  const editableSelectProps = {
@@ -79,204 +79,13 @@ const editableSelectProps = {
79
79
  enableLazyLoad: {
80
80
  type: Boolean,
81
81
  default: false
82
- }
83
- };
84
- const SELECT_KEY = Symbol("EditableSelect");
85
- const DEFAULT_PREFIX = "icon";
86
- const iconProps = {
87
- name: {
88
- type: String,
89
- default: "",
90
- required: true
91
- },
92
- size: {
93
- type: [Number, String],
94
- default: "inherit"
95
- },
96
- color: {
97
- type: String,
98
- default: "inherit"
99
- },
100
- component: {
101
- type: Object,
102
- default: null
103
- },
104
- classPrefix: {
105
- type: String,
106
- default: DEFAULT_PREFIX
107
- },
108
- operable: {
109
- type: Boolean,
110
- default: false
111
82
  },
112
- disabled: {
83
+ showGlowStyle: {
113
84
  type: Boolean,
114
- default: false
115
- },
116
- rotate: {
117
- type: [Number, String]
118
- }
119
- };
120
- const svgIconProps = {
121
- name: {
122
- type: String,
123
- default: "",
124
- required: true
125
- },
126
- color: {
127
- type: String,
128
- default: "inherit"
129
- },
130
- size: {
131
- type: [Number, String],
132
- default: "inherit"
85
+ default: true
133
86
  }
134
87
  };
135
- function createBem(namespace, element, modifier) {
136
- let cls = namespace;
137
- if (element) {
138
- cls += `__${element}`;
139
- }
140
- if (modifier) {
141
- cls += `--${modifier}`;
142
- }
143
- return cls;
144
- }
145
- function useNamespace(block, needDot = false) {
146
- const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
147
- const b = () => createBem(namespace);
148
- const e = (element) => element ? createBem(namespace, element) : "";
149
- const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
150
- const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
151
- return {
152
- b,
153
- e,
154
- m,
155
- em
156
- };
157
- }
158
- var icon = "";
159
- var svgIcon = defineComponent({
160
- name: "DSvgIcon",
161
- props: svgIconProps,
162
- setup(props) {
163
- const {
164
- name,
165
- color,
166
- size
167
- } = toRefs(props);
168
- const ns = useNamespace("svg-icon");
169
- const iconName = computed(() => `#icon-${name.value}`);
170
- const iconSize = computed(() => {
171
- return typeof size.value === "number" ? `${size.value}px` : size.value;
172
- });
173
- const styles = {
174
- width: iconSize.value,
175
- height: iconSize.value
176
- };
177
- return () => {
178
- return createVNode("svg", {
179
- "class": ns.b(),
180
- "style": styles
181
- }, [createVNode("use", {
182
- "xlink:href": iconName.value,
183
- "fill": color.value
184
- }, null)]);
185
- };
186
- }
187
- });
188
- function isUrl(value) {
189
- return /^((http|https):)?\/\//.test(value);
190
- }
191
- function useIconDom(props, ctx) {
192
- const {
193
- component,
194
- name,
195
- size,
196
- color,
197
- classPrefix,
198
- rotate
199
- } = toRefs(props);
200
- const ns = useNamespace("icon");
201
- const iconSize = computed(() => {
202
- return typeof size.value === "number" ? `${size.value}px` : size.value;
203
- });
204
- const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
205
- const imgIconDom = () => {
206
- return createVNode("img", mergeProps({
207
- "src": name.value,
208
- "alt": name.value.split("/")[name.value.split("/").length - 1],
209
- "class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
210
- "style": {
211
- width: iconSize.value || "",
212
- transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`,
213
- verticalAlign: "middle"
214
- }
215
- }, ctx.attrs), null);
216
- };
217
- const svgIconDom = () => {
218
- return createVNode(IconComponent, mergeProps({
219
- "name": name.value,
220
- "color": color.value,
221
- "size": iconSize.value,
222
- "class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
223
- "style": {
224
- transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
225
- }
226
- }, ctx.attrs), null);
227
- };
228
- const fontIconDom = () => {
229
- const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
230
- return createVNode("i", mergeProps({
231
- "class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns.m("spin")],
232
- "style": {
233
- fontSize: iconSize.value,
234
- color: color.value,
235
- transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
236
- }
237
- }, ctx.attrs), null);
238
- };
239
- const iconDom = () => {
240
- return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
241
- };
242
- return {
243
- iconDom
244
- };
245
- }
246
- var Icon = defineComponent({
247
- name: "DIcon",
248
- props: iconProps,
249
- emits: ["click"],
250
- setup(props, ctx) {
251
- const {
252
- disabled,
253
- operable
254
- } = toRefs(props);
255
- const {
256
- iconDom
257
- } = useIconDom(props, ctx);
258
- const ns = useNamespace("icon");
259
- const wrapClassed = computed(() => ({
260
- [ns.e("container")]: true,
261
- [ns.m("disabled")]: disabled.value,
262
- [ns.m("operable")]: operable.value,
263
- [ns.m("no-slots")]: !Object.keys(ctx.slots).length
264
- }));
265
- const onClick = (e) => {
266
- if (disabled.value) {
267
- return;
268
- }
269
- ctx.emit("click", e);
270
- };
271
- return () => {
272
- var _a, _b, _c, _d;
273
- return createVNode("div", {
274
- "class": wrapClassed.value,
275
- "onClick": onClick
276
- }, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
277
- };
278
- }
279
- });
88
+ const SELECT_KEY = Symbol("EditableSelect");
280
89
  const fixedOverlayProps = {
281
90
  modelValue: {
282
91
  type: Boolean,
@@ -332,6 +141,29 @@ function useFixedOverlay(props, ctx) {
332
141
  onUnmounted(removeBodyAdditions);
333
142
  return { onClick };
334
143
  }
144
+ function createBem(namespace, element, modifier) {
145
+ let cls = namespace;
146
+ if (element) {
147
+ cls += `__${element}`;
148
+ }
149
+ if (modifier) {
150
+ cls += `--${modifier}`;
151
+ }
152
+ return cls;
153
+ }
154
+ function useNamespace(block, needDot = false) {
155
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
156
+ const b = () => createBem(namespace);
157
+ const e = (element) => element ? createBem(namespace, element) : "";
158
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
159
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
160
+ return {
161
+ b,
162
+ e,
163
+ m,
164
+ em
165
+ };
166
+ }
335
167
  var fixedOverlay = "";
336
168
  defineComponent({
337
169
  name: "DFixedOverlay",
@@ -6255,7 +6087,7 @@ var Dropdown = defineComponent({
6255
6087
  debounceLoadMore();
6256
6088
  };
6257
6089
  const renderOption = () => {
6258
- if (props.options.length === 0) {
6090
+ if (props.options.length === 0 && !select.loading.value) {
6259
6091
  return createVNode("li", {
6260
6092
  "class": ns.em("item", "no-data-tip")
6261
6093
  }, [slots.noResultItem ? slots.noResultItem() : emptyText.value]);
@@ -6294,6 +6126,45 @@ var Dropdown = defineComponent({
6294
6126
  };
6295
6127
  }
6296
6128
  });
6129
+ function SelectArrowIcon() {
6130
+ return createVNode("svg", {
6131
+ "width": "16px",
6132
+ "height": "16px",
6133
+ "viewBox": "0 0 16 16",
6134
+ "version": "1.1",
6135
+ "xmlns": "http://www.w3.org/2000/svg"
6136
+ }, [createVNode("g", {
6137
+ "stroke": "none",
6138
+ "stroke-width": "1",
6139
+ "fill": "none",
6140
+ "fill-rule": "evenodd"
6141
+ }, [createVNode("path", {
6142
+ "d": `M3.64644661,5.64644661 C3.82001296,5.47288026 4.08943736,5.45359511 4.2843055,5.58859116 L4.35355339,5.64644661
6143
+ L8,9.293 L11.6464466,5.64644661 C11.820013,5.47288026 12.0894374,5.45359511 12.2843055,5.58859116 L12.3535534,5.64644661
6144
+ C12.5271197,5.82001296 12.5464049,6.08943736 12.4114088,6.2843055 L12.3535534,6.35355339 L8.35355339,10.3535534
6145
+ C8.17998704,10.5271197 7.91056264,10.5464049 7.7156945,10.4114088 L7.64644661,10.3535534 L3.64644661,6.35355339
6146
+ C3.45118446,6.15829124 3.45118446,5.84170876 3.64644661,5.64644661 Z`
6147
+ }, null)])]);
6148
+ }
6149
+ function InputClearIcon() {
6150
+ return createVNode("svg", {
6151
+ "width": "16px",
6152
+ "height": "16px",
6153
+ "viewBox": "0 0 16 16",
6154
+ "version": "1.1",
6155
+ "xmlns": "http://www.w3.org/2000/svg"
6156
+ }, [createVNode("g", {
6157
+ "stroke": "none",
6158
+ "stroke-width": "1",
6159
+ "fill": "none",
6160
+ "fill-rule": "evenodd"
6161
+ }, [createVNode("path", {
6162
+ "d": "M8,1 C11.8659932,1 15,4.13400675 15,8 C15,11.8659932 11.8659932,15 8,15 C4.13400675,15 1,11.8659932 1,8 C1,4.13400675 4.13400675,1 8,1 Z M5.87867966,5.17157288 C5.68341751,4.97631073 5.36683502,4.97631073 5.17157288,5.17157288 C4.99800652,5.34513923 4.97872137,5.61456363 5.11371742,5.80943177 L5.17157288,5.87867966 L7.29218611,7.99929289 L5.17157288,10.1213203 C4.97631073,10.3165825 4.97631073,10.633165 5.17157288,10.8284271 C5.34513923,11.0019935 5.61456363,11.0212786 5.80943177,10.8862826 L5.87867966,10.8284271 L7.99929289,8.70639967 L10.1213203,10.8284271 C10.3165825,11.0236893 10.633165,11.0236893 10.8284271,10.8284271 C11.0019935,10.6548608 11.0212786,10.3854364 10.8862826,10.1905682 L10.8284271,10.1213203 L8.70710678,8 L10.8284271,5.87867966 C11.0236893,5.68341751 11.0236893,5.36683502 10.8284271,5.17157288 C10.6548608,4.99800652 10.3854364,4.97872137 10.1905682,5.11371742 L10.1213203,5.17157288 L8,7.29289322 L5.87867966,5.17157288 Z",
6163
+ "id": "\u5F62\u72B6",
6164
+ "fill": "#D5D5DB",
6165
+ "fill-rule": "nonzero"
6166
+ }, null)])]);
6167
+ }
6297
6168
  function deepAssign(...objects) {
6298
6169
  const isObject = (obj) => obj && typeof obj === "object";
6299
6170
  return objects.reduce((prev, from) => {
@@ -6672,7 +6543,8 @@ function useInputRender(props, states) {
6672
6543
  const inputWrapperClasses = computed(() => ({
6673
6544
  [ns.e("wrapper")]: true,
6674
6545
  [ns.em("wrapper", "focus")]: states.isFocus,
6675
- [ns.em("wrapper", "disabled")]: props.disabled
6546
+ [ns.em("wrapper", "disabled")]: props.disabled,
6547
+ [ns.em("wrapper", "glow-style")]: props.showGlowStyle
6676
6548
  }));
6677
6549
  const inputInnerClasses = computed(() => ({
6678
6550
  [ns.e("inner")]: true
@@ -6803,6 +6675,7 @@ var EditableSelect = defineComponent({
6803
6675
  position,
6804
6676
  placeholder
6805
6677
  } = toRefs(props);
6678
+ const align = computed(() => position.value.some((item) => item.includes("start") || item.includes("end")) ? "start" : null);
6806
6679
  const {
6807
6680
  onInput,
6808
6681
  onMouseenter,
@@ -6851,9 +6724,17 @@ var EditableSelect = defineComponent({
6851
6724
  inputInnerClasses,
6852
6725
  inputSuffixClasses
6853
6726
  } = useInputRender(props, states);
6727
+ const currentPosition = ref("bottom");
6728
+ const handlePositionChange = (pos) => {
6729
+ currentPosition.value = pos.includes("top") || pos.includes("right-end") || pos.includes("left-end") ? "top" : "bottom";
6730
+ };
6731
+ const styles = computed(() => ({
6732
+ transformOrigin: currentPosition.value === "top" ? "0% 100%" : "0% 0%",
6733
+ "z-index": "var(--devui-z-index-dropdown, 1052)"
6734
+ }));
6854
6735
  const renderBasicDropdown = () => {
6855
6736
  return createVNode(Transition, {
6856
- "name": "fade"
6737
+ "name": ns.m(`fade-${currentPosition.value}`)
6857
6738
  }, {
6858
6739
  default: () => [createVNode(FlexibleOverlay, {
6859
6740
  "ref": overlayRef,
@@ -6861,9 +6742,9 @@ var EditableSelect = defineComponent({
6861
6742
  "onUpdate:modelValue": ($event) => states.visible = $event,
6862
6743
  "origin": originRef.value,
6863
6744
  "position": position.value,
6864
- "style": {
6865
- zIndex: "var(--devui-z-index-dropdown, 1052)"
6866
- }
6745
+ "align": align.value,
6746
+ "style": styles.value,
6747
+ "onPositionChange": handlePositionChange
6867
6748
  }, {
6868
6749
  default: () => [createVNode(Dropdown, {
6869
6750
  "options": filteredOptions.value,
@@ -6915,13 +6796,9 @@ var EditableSelect = defineComponent({
6915
6796
  }, [withDirectives(createVNode("span", {
6916
6797
  "class": ns.e("clear-icon"),
6917
6798
  "onClick": withModifiers(handleClear, ["stop"])
6918
- }, [createVNode(Icon, {
6919
- "name": "icon-remove"
6920
- }, null)]), [[vShow, showClearable.value]]), withDirectives(createVNode("span", {
6799
+ }, [createVNode(InputClearIcon, null, null)]), [[vShow, showClearable.value]]), withDirectives(createVNode("span", {
6921
6800
  "class": ns.e("arrow-icon")
6922
- }, [createVNode(Icon, {
6923
- "name": "select-arrow"
6924
- }, null)]), [[vShow, !showClearable.value]])])])]), renderDropdown()]);
6801
+ }, [createVNode(SelectArrowIcon, null, null)]), [[vShow, !showClearable.value]])])])]), renderDropdown()]);
6925
6802
  };
6926
6803
  }
6927
6804
  });