vue-devui 1.0.0-rc.0 → 1.0.0-rc.1

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 (115) hide show
  1. package/README.md +13 -0
  2. package/accordion/index.es.js +6 -3
  3. package/alert/index.es.js +28 -30
  4. package/alert/index.umd.js +1 -1
  5. package/auto-complete/index.es.js +13 -6
  6. package/auto-complete/index.umd.js +1 -1
  7. package/back-top/index.es.js +4 -2
  8. package/badge/index.es.js +1 -1
  9. package/badge/index.umd.js +1 -1
  10. package/badge/style.css +1 -1
  11. package/breadcrumb/index.es.js +2 -1
  12. package/button/index.es.js +39 -40
  13. package/button/index.umd.js +1 -1
  14. package/carousel/index.es.js +38 -53
  15. package/carousel/index.umd.js +1 -1
  16. package/cascader/index.es.js +16 -8
  17. package/cascader/style.css +1 -1
  18. package/color-picker/index.es.js +94 -85
  19. package/color-picker/index.umd.js +7 -7
  20. package/countdown/index.es.js +2 -1
  21. package/date-picker/index.es.js +40 -57
  22. package/date-picker/index.umd.js +1 -1
  23. package/dropdown/index.es.js +117 -62
  24. package/dropdown/index.umd.js +1 -1
  25. package/dropdown/style.css +1 -1
  26. package/editable-select/index.es.js +6 -3
  27. package/form/index.es.js +87 -76
  28. package/form/index.umd.js +11 -11
  29. package/form/style.css +1 -1
  30. package/fullscreen/index.es.js +13 -16
  31. package/fullscreen/index.umd.js +1 -1
  32. package/icon/index.es.js +39 -57
  33. package/icon/index.umd.js +1 -1
  34. package/image-preview/index.es.js +2 -1
  35. package/input-icon/index.es.js +38 -37
  36. package/input-icon/index.umd.js +1 -1
  37. package/input-number/index.es.js +46 -57
  38. package/input-number/index.umd.js +1 -1
  39. package/input-number/style.css +1 -1
  40. package/modal/index.es.js +81 -76
  41. package/modal/index.umd.js +1 -1
  42. package/modal/style.css +1 -1
  43. package/notification/index.es.js +38 -40
  44. package/notification/index.umd.js +1 -1
  45. package/nuxt/components/PanelBody.js +3 -0
  46. package/nuxt/components/PanelFooter.js +3 -0
  47. package/nuxt/components/PanelHeader.js +3 -0
  48. package/nuxt/components/Timeline.js +3 -0
  49. package/nuxt/components/TimelineItem.js +3 -0
  50. package/nuxt/components/alertProps.js +3 -0
  51. package/nuxt/components/fullscreenProps.js +3 -0
  52. package/nuxt/components/iconProps.js +2 -0
  53. package/nuxt/components/paginationProps.js +3 -0
  54. package/nuxt/components/panelProps.js +3 -0
  55. package/nuxt/components/searchProps.js +3 -0
  56. package/overlay/index.es.js +44 -37
  57. package/overlay/index.umd.js +1 -1
  58. package/overlay/style.css +1 -1
  59. package/package.json +8 -43
  60. package/pagination/index.es.js +10 -12
  61. package/pagination/index.umd.js +1 -1
  62. package/panel/index.es.js +45 -32
  63. package/panel/index.umd.js +1 -1
  64. package/popover/index.es.js +44 -37
  65. package/popover/index.umd.js +6 -6
  66. package/popover/style.css +1 -1
  67. package/radio/index.es.js +3 -9
  68. package/radio/index.umd.js +1 -1
  69. package/read-tip/index.es.js +6 -3
  70. package/result/index.es.js +38 -53
  71. package/result/index.umd.js +1 -1
  72. package/ripple/index.es.js +9 -5
  73. package/search/index.es.js +2 -5
  74. package/search/index.umd.js +4 -4
  75. package/select/index.es.js +42 -42
  76. package/select/index.umd.js +1 -1
  77. package/skeleton/index.es.js +17 -17
  78. package/skeleton/index.umd.js +1 -1
  79. package/slider/index.es.js +2 -1
  80. package/splitter/index.es.js +54 -42
  81. package/splitter/index.umd.js +6 -6
  82. package/splitter/style.css +1 -1
  83. package/status/index.es.js +1 -4
  84. package/status/index.umd.js +1 -1
  85. package/status/style.css +1 -1
  86. package/steps-guide/index.es.js +6 -3
  87. package/style.css +1 -1
  88. package/table/index.es.js +117 -62
  89. package/table/index.umd.js +1 -1
  90. package/table/style.css +1 -1
  91. package/tag/index.es.js +2 -1
  92. package/tag-input/index.es.js +4 -2
  93. package/time-picker/index.es.js +43 -42
  94. package/time-picker/index.umd.js +1 -1
  95. package/{time-axis → timeline}/index.d.ts +0 -0
  96. package/{time-axis → timeline}/index.es.js +65 -78
  97. package/timeline/index.umd.js +1 -0
  98. package/{time-axis → timeline}/package.json +1 -1
  99. package/timeline/style.css +1 -0
  100. package/tooltip/index.es.js +44 -37
  101. package/tooltip/index.umd.js +6 -6
  102. package/tooltip/style.css +1 -1
  103. package/transfer/index.es.js +84 -77
  104. package/transfer/index.umd.js +7 -7
  105. package/transfer/style.css +1 -1
  106. package/tree/index.es.js +10 -5
  107. package/tree-select/index.es.js +8 -4
  108. package/upload/index.es.js +38 -40
  109. package/upload/index.umd.js +1 -1
  110. package/vue-devui.es.js +771 -649
  111. package/vue-devui.umd.js +9 -9
  112. package/nuxt/components/TimeAxis.js +0 -3
  113. package/nuxt/components/TimeAxisItem.js +0 -3
  114. package/time-axis/index.umd.js +0 -1
  115. package/time-axis/style.css +0 -1
@@ -147,8 +147,9 @@ const useInput = (inputValue, ctx2) => {
147
147
  };
148
148
  const useLazyLoad = (dropdownRef, inputValue, filterOtion, load) => {
149
149
  const loadMore = () => {
150
- if (filterOtion !== false)
150
+ if (filterOtion !== false) {
151
151
  return;
152
+ }
152
153
  if (dropdownRef.value.clientHeight + dropdownRef.value.scrollTop >= dropdownRef.value.scrollHeight) {
153
154
  load(inputValue.value);
154
155
  }
@@ -178,8 +179,9 @@ const useKeyboardSelect = (dropdownRef, disabled, visible, hoverIndex, selectedI
178
179
  if (!newIndex) {
179
180
  newIndex = hoverIndex.value;
180
181
  }
181
- if (!["ArrowDown", "ArrowUp"].includes(direction))
182
+ if (!["ArrowDown", "ArrowUp"].includes(direction)) {
182
183
  return;
184
+ }
183
185
  if (direction === "ArrowUp") {
184
186
  if (newIndex === 0) {
185
187
  newIndex = options.value.length - 1;
@@ -206,8 +208,9 @@ const useKeyboardSelect = (dropdownRef, disabled, visible, hoverIndex, selectedI
206
208
  };
207
209
  const handleKeydown = (event) => {
208
210
  const keyCode = event.key || event.code;
209
- if (options.value.length === 0)
211
+ if (options.value.length === 0) {
210
212
  return;
213
+ }
211
214
  if (!visible.value) {
212
215
  return toggleMenu();
213
216
  }
package/form/index.es.js CHANGED
@@ -17,8 +17,8 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, provide, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, nextTick, unref, mergeProps, toRefs, Fragment, reactive, inject, onBeforeUnmount, withDirectives, resolveDirective } from "vue";
21
- import { offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
20
+ import { defineComponent, provide, createVNode, toRefs, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, unref, nextTick, mergeProps, Fragment, reactive, inject, onBeforeUnmount, withDirectives, resolveDirective } from "vue";
21
+ import { shift, offset, autoPlacement, arrow, computePosition } from "@floating-ui/dom";
22
22
  function mitt(n) {
23
23
  return { all: n = n || /* @__PURE__ */ new Map(), on: function(t, e) {
24
24
  var i = n.get(t);
@@ -120,8 +120,9 @@ function isObject(obj) {
120
120
  return Object.prototype.toString.call(obj).slice(8, -1) === "Object";
121
121
  }
122
122
  function hasKey(obj, key) {
123
- if (!isObject(obj))
123
+ if (!isObject(obj)) {
124
124
  return false;
125
+ }
125
126
  return Object.prototype.hasOwnProperty.call(obj, key);
126
127
  }
127
128
  function getElOffset(curEl) {
@@ -199,53 +200,54 @@ var Form = defineComponent({
199
200
  }, [(_b = (_a = this.$slots).default) == null ? void 0 : _b.call(_a)]);
200
201
  }
201
202
  });
203
+ const iconProps = {
204
+ name: {
205
+ type: String,
206
+ default: "",
207
+ required: true
208
+ },
209
+ size: {
210
+ type: String,
211
+ default: "inherit"
212
+ },
213
+ color: {
214
+ type: String,
215
+ default: "inherit"
216
+ },
217
+ classPrefix: {
218
+ type: String,
219
+ default: "icon"
220
+ }
221
+ };
202
222
  var Icon = defineComponent({
203
223
  name: "DIcon",
204
- props: {
205
- name: {
206
- type: String,
207
- required: true
208
- },
209
- size: {
210
- type: String,
211
- default: "inherit"
212
- },
213
- color: {
214
- type: String,
215
- default: "inherit"
216
- },
217
- classPrefix: {
218
- type: String,
219
- default: "icon"
220
- }
221
- },
224
+ props: iconProps,
222
225
  setup(props) {
223
- return __spreadValues({}, props);
224
- },
225
- render() {
226
226
  const {
227
227
  name,
228
228
  size,
229
229
  color,
230
230
  classPrefix
231
- } = this;
232
- return /^((https?):)?\/\//.test(name) ? createVNode("img", {
233
- "src": name,
234
- "alt": name.split("/")[name.split("/").length - 1],
235
- "style": {
236
- width: size,
237
- verticalAlign: "text-bottom"
238
- }
239
- }, null) : createVNode("i", {
240
- "class": `${classPrefix} ${classPrefix}-${name}`,
241
- "style": {
242
- fontSize: size,
243
- color
244
- }
245
- }, null);
231
+ } = toRefs(props);
232
+ return () => {
233
+ return /^((https?):)?\/\//.test(name.value) ? createVNode("img", {
234
+ "src": name.value,
235
+ "alt": name.value.split("/")[name.value.split("/").length - 1],
236
+ "style": {
237
+ width: size.value,
238
+ verticalAlign: "text-bottom"
239
+ }
240
+ }, null) : createVNode("i", {
241
+ "class": `${classPrefix.value} ${classPrefix.value}-${name.value}`,
242
+ "style": {
243
+ fontSize: size.value,
244
+ color: color.value
245
+ }
246
+ }, null);
247
+ };
246
248
  }
247
249
  });
248
- var overlay = "";
250
+ var baseOverlay = "";
249
251
  function _isSlot(s) {
250
252
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
251
253
  }
@@ -292,43 +294,13 @@ const overlayProps = {
292
294
  default: true
293
295
  }
294
296
  };
295
- const overlayEmits = ["update:visible", "backdropClick"];
296
297
  const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
297
298
  overlayStyle: {
298
299
  type: [String, Object],
299
300
  default: void 0
300
301
  }
301
302
  });
302
- const flexibleOverlayProps = {
303
- modelValue: {
304
- type: Boolean,
305
- default: false
306
- },
307
- origin: {
308
- type: Object,
309
- require: true
310
- },
311
- position: {
312
- type: Array,
313
- default: ["bottom"]
314
- },
315
- offset: {
316
- type: [Number, Object],
317
- default: 8
318
- },
319
- align: {
320
- type: String,
321
- default: null
322
- },
323
- showArrow: {
324
- type: Boolean,
325
- default: false
326
- },
327
- isArrowCenter: {
328
- type: Boolean,
329
- default: true
330
- }
331
- };
303
+ const overlayEmits = ["update:visible", "backdropClick"];
332
304
  function useOverlayLogic(props, ctx2) {
333
305
  const backgroundClass = computed(() => {
334
306
  return [
@@ -379,6 +351,7 @@ function useOverlayLogic(props, ctx2) {
379
351
  handleOverlayBubbleCancel
380
352
  };
381
353
  }
354
+ var fixedOverlay = "";
382
355
  defineComponent({
383
356
  name: "DFixedOverlay",
384
357
  props: fixedOverlayProps,
@@ -403,6 +376,36 @@ defineComponent({
403
376
  });
404
377
  }
405
378
  });
379
+ const flexibleOverlayProps = {
380
+ modelValue: {
381
+ type: Boolean,
382
+ default: false
383
+ },
384
+ origin: {
385
+ type: Object,
386
+ require: true
387
+ },
388
+ position: {
389
+ type: Array,
390
+ default: ["bottom"]
391
+ },
392
+ offset: {
393
+ type: [Number, Object],
394
+ default: 8
395
+ },
396
+ align: {
397
+ type: String,
398
+ default: null
399
+ },
400
+ showArrow: {
401
+ type: Boolean,
402
+ default: false
403
+ },
404
+ isArrowCenter: {
405
+ type: Boolean,
406
+ default: true
407
+ }
408
+ };
406
409
  function getScrollParent(element) {
407
410
  const overflowRegex = /(auto|scroll|hidden)/;
408
411
  for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
@@ -456,6 +459,7 @@ function useOverlay(props, emit) {
456
459
  const overlayEl = unref(overlayRef.value);
457
460
  const arrowEl = unref(arrowRef.value);
458
461
  const middleware = [
462
+ shift(),
459
463
  offset(props.offset),
460
464
  autoPlacement({
461
465
  alignment: props.align,
@@ -490,7 +494,7 @@ function useOverlay(props, emit) {
490
494
  originParent !== window && window.removeEventListener("scroll", updatePosition);
491
495
  window.removeEventListener("resize", updatePosition);
492
496
  });
493
- return { arrowRef, overlayRef };
497
+ return { arrowRef, overlayRef, updatePosition };
494
498
  }
495
499
  var flexibleOverlay = "";
496
500
  const FlexibleOverlay = defineComponent({
@@ -501,12 +505,17 @@ const FlexibleOverlay = defineComponent({
501
505
  setup(props, {
502
506
  slots,
503
507
  attrs,
504
- emit
508
+ emit,
509
+ expose
505
510
  }) {
506
511
  const {
507
512
  arrowRef,
508
- overlayRef
513
+ overlayRef,
514
+ updatePosition
509
515
  } = useOverlay(props, emit);
516
+ expose({
517
+ updatePosition
518
+ });
510
519
  return () => {
511
520
  var _a;
512
521
  return props.modelValue && createVNode("div", mergeProps({
@@ -7662,8 +7671,9 @@ function handleErrorStrategyPass(el) {
7662
7671
  el.setAttribute("class", classList.join(" "));
7663
7672
  }
7664
7673
  function getFormControlUID(el) {
7665
- if (el.tagName.toLocaleLowerCase() === "body")
7674
+ if (el.tagName.toLocaleLowerCase() === "body") {
7666
7675
  return "";
7676
+ }
7667
7677
  if (el.parentElement.id.startsWith("dfc-")) {
7668
7678
  return el.parentElement.id;
7669
7679
  } else {
@@ -7706,8 +7716,9 @@ function validateFn({ validator, modelValue, el, tipEl, isFormTag, messageShowTy
7706
7716
  handleValidatePass(el, tipEl);
7707
7717
  }).catch((err) => {
7708
7718
  const { errors } = err;
7709
- if (!errors || errors.length === 0)
7719
+ if (!errors || errors.length === 0) {
7710
7720
  return;
7721
+ }
7711
7722
  let msg = "";
7712
7723
  if (typeof errors[0].message === "object") {
7713
7724
  msg = errors[0].message.default;