vue-devui 1.0.0-rc.6 → 1.0.0-rc.9

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 (168) hide show
  1. package/README.md +5 -0
  2. package/alert/index.es.js +37 -11
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +311 -77
  6. package/auto-complete/index.umd.js +3 -5
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +81 -70
  9. package/avatar/index.umd.js +1 -1
  10. package/avatar/style.css +1 -1
  11. package/badge/index.es.js +29 -4
  12. package/badge/index.umd.js +1 -1
  13. package/badge/style.css +1 -1
  14. package/button/index.es.js +5632 -87
  15. package/button/index.umd.js +27 -1
  16. package/button/style.css +1 -1
  17. package/card/index.es.js +56 -29
  18. package/card/index.umd.js +1 -1
  19. package/card/style.css +1 -1
  20. package/checkbox/index.es.js +364 -234
  21. package/checkbox/index.umd.js +1 -1
  22. package/checkbox/style.css +1 -1
  23. package/date-picker/index.es.js +310 -157
  24. package/date-picker/index.umd.js +1 -1
  25. package/date-picker/style.css +1 -1
  26. package/drawer/index.es.js +28 -3
  27. package/drawer/index.umd.js +1 -1
  28. package/drawer/style.css +1 -1
  29. package/dropdown/index.es.js +125 -45
  30. package/dropdown/index.umd.js +1 -1
  31. package/dropdown/style.css +1 -1
  32. package/editable-select/index.es.js +437 -22
  33. package/editable-select/index.umd.js +1 -1
  34. package/editable-select/style.css +1 -1
  35. package/form/index.es.js +490 -605
  36. package/form/index.umd.js +15 -15
  37. package/form/style.css +1 -1
  38. package/fullscreen/index.es.js +29 -5
  39. package/fullscreen/index.umd.js +1 -1
  40. package/fullscreen/style.css +1 -1
  41. package/grid/index.es.js +71 -50
  42. package/grid/index.umd.js +1 -1
  43. package/grid/style.css +1 -1
  44. package/icon/index.es.js +109 -13
  45. package/icon/index.umd.js +1 -1
  46. package/icon/style.css +1 -0
  47. package/image-preview/index.es.js +34 -11
  48. package/image-preview/index.umd.js +1 -1
  49. package/image-preview/style.css +1 -1
  50. package/input/index.es.js +330 -130
  51. package/input/index.umd.js +1 -1
  52. package/input/style.css +1 -1
  53. package/input-number/index.es.js +272 -199
  54. package/input-number/index.umd.js +1 -1
  55. package/input-number/style.css +1 -1
  56. package/layout/index.es.js +34 -6
  57. package/layout/index.umd.js +1 -1
  58. package/layout/style.css +1 -1
  59. package/loading/index.es.js +34 -10
  60. package/loading/index.umd.js +1 -1
  61. package/loading/style.css +1 -1
  62. package/modal/index.es.js +126 -27
  63. package/modal/index.umd.js +1 -1
  64. package/modal/style.css +1 -1
  65. package/notification/index.es.js +125 -25
  66. package/notification/index.umd.js +1 -1
  67. package/notification/style.css +1 -1
  68. package/nuxt/components/ButtonGroup.js +3 -0
  69. package/nuxt/components/CheckboxButton.js +3 -0
  70. package/nuxt/components/CheckboxGroup.js +3 -0
  71. package/nuxt/components/FORM_ITEM_TOKEN.js +3 -0
  72. package/nuxt/components/FORM_TOKEN.js +3 -0
  73. package/nuxt/components/Icon.js +1 -0
  74. package/nuxt/components/LABEL_DATA.js +3 -0
  75. package/nuxt/components/Option.js +3 -0
  76. package/nuxt/components/buttonGroupInjectionKey.js +3 -0
  77. package/nuxt/components/buttonGroupProps.js +3 -0
  78. package/nuxt/components/formControlProps.js +3 -0
  79. package/nuxt/components/formItemProps.js +3 -0
  80. package/nuxt/components/formProps.js +3 -0
  81. package/nuxt/components/iconProps.js +1 -0
  82. package/nuxt/components/svgIconProps.js +3 -0
  83. package/overlay/index.es.js +31 -9
  84. package/overlay/index.umd.js +1 -1
  85. package/overlay/style.css +1 -1
  86. package/package.json +2 -1
  87. package/pagination/index.es.js +135 -124
  88. package/pagination/index.umd.js +1 -1
  89. package/pagination/style.css +1 -1
  90. package/popover/index.es.js +198 -83
  91. package/popover/index.umd.js +16 -16
  92. package/popover/style.css +1 -1
  93. package/progress/index.es.js +76 -20
  94. package/progress/index.umd.js +3 -3
  95. package/progress/style.css +1 -1
  96. package/radio/index.es.js +161 -140
  97. package/radio/index.umd.js +1 -1
  98. package/radio/style.css +1 -1
  99. package/rate/index.es.js +48 -16
  100. package/rate/index.umd.js +1 -1
  101. package/rate/style.css +1 -1
  102. package/result/index.es.js +108 -12
  103. package/result/index.umd.js +1 -1
  104. package/result/style.css +1 -1
  105. package/search/index.es.js +379 -167
  106. package/search/index.umd.js +17 -17
  107. package/search/style.css +1 -1
  108. package/select/index.es.js +7339 -556
  109. package/select/index.umd.js +27 -1
  110. package/select/style.css +1 -1
  111. package/skeleton/index.es.js +37 -12
  112. package/skeleton/index.umd.js +1 -1
  113. package/skeleton/style.css +1 -1
  114. package/slider/index.es.js +34 -10
  115. package/slider/index.umd.js +1 -1
  116. package/slider/style.css +1 -1
  117. package/splitter/index.es.js +201 -84
  118. package/splitter/index.umd.js +14 -14
  119. package/splitter/style.css +1 -1
  120. package/status/index.es.js +26 -2
  121. package/status/index.umd.js +1 -1
  122. package/status/style.css +1 -1
  123. package/style.css +1 -1
  124. package/switch/index.es.js +30 -6
  125. package/switch/index.umd.js +1 -1
  126. package/switch/style.css +1 -1
  127. package/table/index.es.js +6808 -585
  128. package/table/index.umd.js +27 -1
  129. package/table/style.css +1 -1
  130. package/tabs/index.es.js +136 -70
  131. package/tabs/index.umd.js +1 -1
  132. package/tabs/style.css +1 -1
  133. package/tag/index.es.js +31 -7
  134. package/tag/index.umd.js +1 -1
  135. package/tag/style.css +1 -1
  136. package/textarea/index.es.js +5631 -80
  137. package/textarea/index.umd.js +35 -1
  138. package/textarea/style.css +1 -1
  139. package/timeline/index.es.js +108 -12
  140. package/timeline/index.umd.js +1 -1
  141. package/timeline/style.css +1 -1
  142. package/tooltip/index.es.js +190 -74
  143. package/tooltip/index.umd.js +17 -17
  144. package/tooltip/style.css +1 -1
  145. package/tree/index.es.js +376 -256
  146. package/tree/index.umd.js +1 -1
  147. package/tree/style.css +1 -1
  148. package/upload/index.es.js +138 -34
  149. package/upload/index.umd.js +1 -1
  150. package/upload/style.css +1 -1
  151. package/vue-devui.es.js +6770 -5769
  152. package/vue-devui.umd.js +27 -21
  153. package/comment/index.d.ts +0 -7
  154. package/comment/index.es.js +0 -84
  155. package/comment/index.umd.js +0 -1
  156. package/comment/package.json +0 -7
  157. package/comment/style.css +0 -1
  158. package/nuxt/components/Comment.js +0 -3
  159. package/nuxt/components/FormControl.js +0 -3
  160. package/nuxt/components/FormLabel.js +0 -3
  161. package/nuxt/components/ReadTip.js +0 -3
  162. package/nuxt/components/commentProps.js +0 -3
  163. package/nuxt/components/readTipProps.js +0 -3
  164. package/read-tip/index.d.ts +0 -7
  165. package/read-tip/index.es.js +0 -261
  166. package/read-tip/index.umd.js +0 -1
  167. package/read-tip/package.json +0 -7
  168. package/read-tip/style.css +0 -1
@@ -17,21 +17,45 @@ var __spreadValues = (a, b) => {
17
17
  return a;
18
18
  };
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, unref, nextTick, mergeProps, toRefs, Fragment } from "vue";
20
+ import { defineComponent, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, watch, onUnmounted, ref, unref, nextTick, mergeProps, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, toRefs, provide } from "vue";
21
21
  import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
22
+ function createBem(namespace, element, modifier) {
23
+ let cls = namespace;
24
+ if (element) {
25
+ cls += `__${element}`;
26
+ }
27
+ if (modifier) {
28
+ cls += `--${modifier}`;
29
+ }
30
+ return cls;
31
+ }
32
+ function useNamespace(block, needDot = false) {
33
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
34
+ const b = () => createBem(namespace);
35
+ const e = (element) => element ? createBem(namespace, element) : "";
36
+ const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
37
+ const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
38
+ return {
39
+ b,
40
+ e,
41
+ m,
42
+ em
43
+ };
44
+ }
22
45
  var baseOverlay = "";
23
46
  function _isSlot(s) {
24
47
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
25
48
  }
26
49
  const CommonOverlay = defineComponent({
27
50
  setup(props, ctx) {
51
+ const ns2 = useNamespace("overlay");
28
52
  return () => {
29
53
  let _slot;
30
54
  return createVNode(Teleport, {
31
55
  "to": "#d-overlay-anchor"
32
56
  }, {
33
57
  default: () => [createVNode(Transition, {
34
- "name": "devui-overlay-fade"
58
+ "name": ns2.e("fade")
35
59
  }, _isSlot(_slot = renderSlot(ctx.slots, "default")) ? _slot : {
36
60
  default: () => [_slot]
37
61
  })]
@@ -74,15 +98,12 @@ const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
74
98
  });
75
99
  const overlayEmits = ["update:visible", "backdropClick"];
76
100
  function useOverlayLogic(props, ctx) {
101
+ const ns2 = useNamespace("overlay");
77
102
  const backgroundClass = computed(() => {
78
- return [
79
- "devui-overlay-background",
80
- props.backgroundClass,
81
- !props.hasBackdrop ? "devui-overlay-background__disabled" : "devui-overlay-background__color"
82
- ];
103
+ return [ns2.e("background"), props.backgroundClass, !props.hasBackdrop ? ns2.em("background", "disabled") : ns2.em("background", "color")];
83
104
  });
84
105
  const overlayClass = computed(() => {
85
- return "devui-overlay";
106
+ return ns2.b();
86
107
  });
87
108
  const handleBackdropClick = (event) => {
88
109
  var _a;
@@ -292,6 +313,7 @@ const FlexibleOverlay = defineComponent({
292
313
  emit,
293
314
  expose
294
315
  }) {
316
+ const ns2 = useNamespace("flexible-overlay");
295
317
  const {
296
318
  arrowRef,
297
319
  overlayRef,
@@ -304,14 +326,70 @@ const FlexibleOverlay = defineComponent({
304
326
  var _a;
305
327
  return props.modelValue && createVNode("div", mergeProps({
306
328
  "ref": overlayRef,
307
- "class": "devui-flexible-overlay"
329
+ "class": ns2.b()
308
330
  }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
309
331
  "ref": arrowRef,
310
- "class": "devui-flexible-overlay-arrow"
332
+ "class": ns2.e("arrow")
311
333
  }, null)]);
312
334
  };
313
335
  }
314
336
  });
337
+ const POPPER_TRIGGER_TOKEN = Symbol("popper-trigger");
338
+ const isObject = (val) => val !== null && typeof val === "object";
339
+ const ns$1 = useNamespace("popper-trigger");
340
+ function wrapContent(content) {
341
+ return h("span", { class: ns$1.b() }, content);
342
+ }
343
+ function getFirstValidChild(nodes) {
344
+ for (const child of nodes) {
345
+ if (isObject(child)) {
346
+ if (child.type === Comment) {
347
+ continue;
348
+ }
349
+ if (child.type === "svg" || child.type === Text) {
350
+ return wrapContent(child);
351
+ }
352
+ if (child.type === Fragment) {
353
+ return getFirstValidChild(child.children);
354
+ }
355
+ return child;
356
+ }
357
+ return wrapContent(child);
358
+ }
359
+ return null;
360
+ }
361
+ var PopperTrigger = defineComponent({
362
+ name: "DPopperTrigger",
363
+ setup(_, ctx) {
364
+ const {
365
+ slots,
366
+ attrs
367
+ } = ctx;
368
+ return () => {
369
+ var _a;
370
+ const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots, attrs);
371
+ const triggerRef = inject(POPPER_TRIGGER_TOKEN);
372
+ if (!defaultSlot) {
373
+ return null;
374
+ }
375
+ const firstValidChild = getFirstValidChild(defaultSlot);
376
+ if (!firstValidChild) {
377
+ return null;
378
+ }
379
+ return withDirectives(cloneVNode(firstValidChild, attrs), [[{
380
+ mounted(el) {
381
+ triggerRef.value = el;
382
+ },
383
+ updated(el) {
384
+ triggerRef.value = el;
385
+ },
386
+ unmounted() {
387
+ triggerRef.value = null;
388
+ }
389
+ }]]);
390
+ };
391
+ }
392
+ });
315
393
  const popoverProps = {
316
394
  isOpen: {
317
395
  type: Boolean,
@@ -352,6 +430,10 @@ const popoverProps = {
352
430
  mouseLeaveDelay: {
353
431
  type: Number,
354
432
  default: 100
433
+ },
434
+ disabled: {
435
+ type: Boolean,
436
+ default: false
355
437
  }
356
438
  };
357
439
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
@@ -1065,7 +1147,7 @@ var lodash = { exports: {} };
1065
1147
  var objectCtorString = funcToString.call(Object2);
1066
1148
  var oldDash = root._;
1067
1149
  var reIsNative = RegExp2("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
1068
- var Buffer2 = moduleExports ? context.Buffer : undefined$1, Symbol = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined$1, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined$1, symIterator = Symbol ? Symbol.iterator : undefined$1, symToStringTag = Symbol ? Symbol.toStringTag : undefined$1;
1150
+ var Buffer2 = moduleExports ? context.Buffer : undefined$1, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined$1, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined$1, symIterator = Symbol2 ? Symbol2.iterator : undefined$1, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined$1;
1069
1151
  var defineProperty = function() {
1070
1152
  try {
1071
1153
  var func = getNative(Object2, "defineProperty");
@@ -1080,7 +1162,7 @@ var lodash = { exports: {} };
1080
1162
  var metaMap = WeakMap2 && new WeakMap2();
1081
1163
  var realNames = {};
1082
1164
  var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap2);
1083
- var symbolProto = Symbol ? Symbol.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
1165
+ var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
1084
1166
  function lodash2(value) {
1085
1167
  if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
1086
1168
  if (value instanceof LodashWrapper) {
@@ -1096,7 +1178,7 @@ var lodash = { exports: {} };
1096
1178
  function object() {
1097
1179
  }
1098
1180
  return function(proto) {
1099
- if (!isObject(proto)) {
1181
+ if (!isObject2(proto)) {
1100
1182
  return {};
1101
1183
  }
1102
1184
  if (objectCreate) {
@@ -1458,7 +1540,7 @@ var lodash = { exports: {} };
1458
1540
  if (result2 !== undefined$1) {
1459
1541
  return result2;
1460
1542
  }
1461
- if (!isObject(value)) {
1543
+ if (!isObject2(value)) {
1462
1544
  return value;
1463
1545
  }
1464
1546
  var isArr = isArray(value);
@@ -1805,7 +1887,7 @@ var lodash = { exports: {} };
1805
1887
  return true;
1806
1888
  }
1807
1889
  function baseIsNative(value) {
1808
- if (!isObject(value) || isMasked(value)) {
1890
+ if (!isObject2(value) || isMasked(value)) {
1809
1891
  return false;
1810
1892
  }
1811
1893
  var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
@@ -1845,7 +1927,7 @@ var lodash = { exports: {} };
1845
1927
  return result2;
1846
1928
  }
1847
1929
  function baseKeysIn(object) {
1848
- if (!isObject(object)) {
1930
+ if (!isObject2(object)) {
1849
1931
  return nativeKeysIn(object);
1850
1932
  }
1851
1933
  var isProto = isPrototype(object), result2 = [];
@@ -1890,7 +1972,7 @@ var lodash = { exports: {} };
1890
1972
  }
1891
1973
  baseFor(source, function(srcValue, key) {
1892
1974
  stack || (stack = new Stack());
1893
- if (isObject(srcValue)) {
1975
+ if (isObject2(srcValue)) {
1894
1976
  baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
1895
1977
  } else {
1896
1978
  var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined$1;
@@ -1930,7 +2012,7 @@ var lodash = { exports: {} };
1930
2012
  newValue = objValue;
1931
2013
  if (isArguments(objValue)) {
1932
2014
  newValue = toPlainObject(objValue);
1933
- } else if (!isObject(objValue) || isFunction(objValue)) {
2015
+ } else if (!isObject2(objValue) || isFunction(objValue)) {
1934
2016
  newValue = initCloneObject(srcValue);
1935
2017
  }
1936
2018
  } else {
@@ -2069,7 +2151,7 @@ var lodash = { exports: {} };
2069
2151
  return shuffleSelf(array, baseClamp(n, 0, array.length));
2070
2152
  }
2071
2153
  function baseSet(object, path, value, customizer) {
2072
- if (!isObject(object)) {
2154
+ if (!isObject2(object)) {
2073
2155
  return object;
2074
2156
  }
2075
2157
  path = castPath(path, object);
@@ -2083,7 +2165,7 @@ var lodash = { exports: {} };
2083
2165
  var objValue = nested[key];
2084
2166
  newValue = customizer ? customizer(objValue, key, nested) : undefined$1;
2085
2167
  if (newValue === undefined$1) {
2086
- newValue = isObject(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {};
2168
+ newValue = isObject2(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {};
2087
2169
  }
2088
2170
  }
2089
2171
  assignValue(nested, key, newValue);
@@ -2533,7 +2615,7 @@ var lodash = { exports: {} };
2533
2615
  return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
2534
2616
  }
2535
2617
  var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
2536
- return isObject(result2) ? result2 : thisBinding;
2618
+ return isObject2(result2) ? result2 : thisBinding;
2537
2619
  };
2538
2620
  }
2539
2621
  function createCurry(func, bitmask, arity) {
@@ -2847,7 +2929,7 @@ var lodash = { exports: {} };
2847
2929
  return objValue;
2848
2930
  }
2849
2931
  function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
2850
- if (isObject(objValue) && isObject(srcValue)) {
2932
+ if (isObject2(objValue) && isObject2(srcValue)) {
2851
2933
  stack.set(srcValue, objValue);
2852
2934
  baseMerge(objValue, srcValue, undefined$1, customDefaultsMerge, stack);
2853
2935
  stack["delete"](srcValue);
@@ -3195,7 +3277,7 @@ var lodash = { exports: {} };
3195
3277
  return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
3196
3278
  }
3197
3279
  function isIterateeCall(value, index2, object) {
3198
- if (!isObject(object)) {
3280
+ if (!isObject2(object)) {
3199
3281
  return false;
3200
3282
  }
3201
3283
  var type = typeof index2;
@@ -3238,7 +3320,7 @@ var lodash = { exports: {} };
3238
3320
  return value === proto;
3239
3321
  }
3240
3322
  function isStrictComparable(value) {
3241
- return value === value && !isObject(value);
3323
+ return value === value && !isObject2(value);
3242
3324
  }
3243
3325
  function matchesStrictComparable(key, srcValue) {
3244
3326
  return function(object) {
@@ -4120,7 +4202,7 @@ var lodash = { exports: {} };
4120
4202
  throw new TypeError2(FUNC_ERROR_TEXT);
4121
4203
  }
4122
4204
  wait = toNumber(wait) || 0;
4123
- if (isObject(options)) {
4205
+ if (isObject2(options)) {
4124
4206
  leading = !!options.leading;
4125
4207
  maxing = "maxWait" in options;
4126
4208
  maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
@@ -4290,7 +4372,7 @@ var lodash = { exports: {} };
4290
4372
  if (typeof func != "function") {
4291
4373
  throw new TypeError2(FUNC_ERROR_TEXT);
4292
4374
  }
4293
- if (isObject(options)) {
4375
+ if (isObject2(options)) {
4294
4376
  leading = "leading" in options ? !!options.leading : leading;
4295
4377
  trailing = "trailing" in options ? !!options.trailing : trailing;
4296
4378
  }
@@ -4398,7 +4480,7 @@ var lodash = { exports: {} };
4398
4480
  return typeof value == "number" && nativeIsFinite(value);
4399
4481
  }
4400
4482
  function isFunction(value) {
4401
- if (!isObject(value)) {
4483
+ if (!isObject2(value)) {
4402
4484
  return false;
4403
4485
  }
4404
4486
  var tag = baseGetTag(value);
@@ -4410,7 +4492,7 @@ var lodash = { exports: {} };
4410
4492
  function isLength(value) {
4411
4493
  return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
4412
4494
  }
4413
- function isObject(value) {
4495
+ function isObject2(value) {
4414
4496
  var type = typeof value;
4415
4497
  return value != null && (type == "object" || type == "function");
4416
4498
  }
@@ -4517,9 +4599,9 @@ var lodash = { exports: {} };
4517
4599
  if (isSymbol(value)) {
4518
4600
  return NAN;
4519
4601
  }
4520
- if (isObject(value)) {
4602
+ if (isObject2(value)) {
4521
4603
  var other = typeof value.valueOf == "function" ? value.valueOf() : value;
4522
- value = isObject(other) ? other + "" : other;
4604
+ value = isObject2(other) ? other + "" : other;
4523
4605
  }
4524
4606
  if (typeof value != "string") {
4525
4607
  return value === 0 ? value : +value;
@@ -4740,7 +4822,7 @@ var lodash = { exports: {} };
4740
4822
  var Ctor = object && object.constructor;
4741
4823
  if (isArrLike) {
4742
4824
  accumulator = isArr ? new Ctor() : [];
4743
- } else if (isObject(object)) {
4825
+ } else if (isObject2(object)) {
4744
4826
  accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
4745
4827
  } else {
4746
4828
  accumulator = {};
@@ -5022,7 +5104,7 @@ var lodash = { exports: {} };
5022
5104
  }
5023
5105
  function truncate(string, options) {
5024
5106
  var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
5025
- if (isObject(options)) {
5107
+ if (isObject2(options)) {
5026
5108
  var separator = "separator" in options ? options.separator : separator;
5027
5109
  length = "length" in options ? toInteger(options.length) : length;
5028
5110
  omission = "omission" in options ? baseToString(options.omission) : omission;
@@ -5152,13 +5234,13 @@ var lodash = { exports: {} };
5152
5234
  });
5153
5235
  function mixin(object, source, options) {
5154
5236
  var props = keys(source), methodNames = baseFunctions(source, props);
5155
- if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
5237
+ if (options == null && !(isObject2(source) && (methodNames.length || !props.length))) {
5156
5238
  options = source;
5157
5239
  source = object;
5158
5240
  object = this;
5159
5241
  methodNames = baseFunctions(source, keys(source));
5160
5242
  }
5161
- var chain2 = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object);
5243
+ var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object);
5162
5244
  arrayEach(methodNames, function(methodName) {
5163
5245
  var func = source[methodName];
5164
5246
  object[methodName] = func;
@@ -5504,7 +5586,7 @@ var lodash = { exports: {} };
5504
5586
  lodash2.isNil = isNil;
5505
5587
  lodash2.isNull = isNull;
5506
5588
  lodash2.isNumber = isNumber;
5507
- lodash2.isObject = isObject;
5589
+ lodash2.isObject = isObject2;
5508
5590
  lodash2.isObjectLike = isObjectLike;
5509
5591
  lodash2.isPlainObject = isPlainObject;
5510
5592
  lodash2.isRegExp = isRegExp;
@@ -5800,11 +5882,16 @@ function usePopover(props, visible, placement, origin, popoverRef) {
5800
5882
  return { overlayStyles };
5801
5883
  }
5802
5884
  function usePopoverEvent(props, visible, origin) {
5803
- const { trigger, position, mouseEnterDelay, mouseLeaveDelay } = toRefs(props);
5885
+ const { trigger, position, mouseEnterDelay, mouseLeaveDelay, disabled } = toRefs(props);
5804
5886
  const isClick = computed(() => trigger.value === "click");
5805
5887
  const placement = ref(position.value[0].split("-")[0]);
5806
5888
  const isEnter = ref(false);
5807
- const onClick = () => isClick.value && (visible.value = !visible.value);
5889
+ const onClick = () => {
5890
+ if (disabled.value) {
5891
+ return;
5892
+ }
5893
+ isClick.value && (visible.value = !visible.value);
5894
+ };
5808
5895
  const enter = lodash.exports.debounce(() => {
5809
5896
  isEnter.value && (visible.value = true);
5810
5897
  }, mouseEnterDelay.value);
@@ -5812,6 +5899,9 @@ function usePopoverEvent(props, visible, origin) {
5812
5899
  !isEnter.value && (visible.value = false);
5813
5900
  }, mouseLeaveDelay.value);
5814
5901
  const onMouseenter = () => {
5902
+ if (disabled.value) {
5903
+ return;
5904
+ }
5815
5905
  if (!isClick.value) {
5816
5906
  isEnter.value = true;
5817
5907
  enter();
@@ -5823,6 +5913,15 @@ function usePopoverEvent(props, visible, origin) {
5823
5913
  leave();
5824
5914
  }
5825
5915
  };
5916
+ const quickLeave = () => {
5917
+ isEnter.value = false;
5918
+ visible.value = false;
5919
+ };
5920
+ watch(disabled, (newVal) => {
5921
+ if (newVal && visible.value) {
5922
+ quickLeave();
5923
+ }
5924
+ });
5826
5925
  const handlePositionChange = (pos) => {
5827
5926
  placement.value = pos.split("-")[0];
5828
5927
  };
@@ -5834,11 +5933,12 @@ function usePopoverEvent(props, visible, origin) {
5834
5933
  origin.value.addEventListener("mouseleave", onMouseleave);
5835
5934
  }
5836
5935
  });
5837
- return { placement, handlePositionChange };
5936
+ return { placement, handlePositionChange, onMouseenter, onMouseleave };
5838
5937
  }
5938
+ const ns = useNamespace("popover");
5839
5939
  function SuccessIcon() {
5840
5940
  return createVNode("svg", {
5841
- "class": "devui-icon devui-icon-success",
5941
+ "class": [ns.e("icon"), ns.em("icon", "success")],
5842
5942
  "viewBox": "0 0 16 16",
5843
5943
  "version": "1.1",
5844
5944
  "xmlns": "http://www.w3.org/2000/svg"
@@ -5862,7 +5962,7 @@ function SuccessIcon() {
5862
5962
  }
5863
5963
  function WarningIcon() {
5864
5964
  return createVNode("svg", {
5865
- "class": "devui-icon devui-icon-warning",
5965
+ "class": [ns.e("icon"), ns.em("icon", "warning")],
5866
5966
  "viewBox": "0 0 16 16",
5867
5967
  "version": "1.1",
5868
5968
  "xmlns": "http://www.w3.org/2000/svg"
@@ -5872,14 +5972,14 @@ function WarningIcon() {
5872
5972
  "fill": "none",
5873
5973
  "fill-rule": "evenodd"
5874
5974
  }, [createVNode("polygon", {
5875
- "points": "7.5 1.74501946 1.39184847 13.5954649 7.08947368 14.2207621 13.9973698 13.5954649 10.9383683 5.61273879 8.40084114 1.27624313"
5975
+ "points": "7.5 1.74501946 1.39184847 13.5954649 7.08947368 14.2207621 13.9973698 13.5954649 10.9383683 5.61273879 8.40084114 1.27624313"
5876
5976
  }, null), createVNode("path", {
5877
- "d": "M8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 Z M8.87894737,11.2105263 L7.08947368,11.2105263 L7.08947368,13 L8.87894737,13 L8.87894737,11.2105263 Z M8.96842105,4.5 L7,4.5 L7.08947368,9.86842105 L8.87894737,9.86842105 L8.96842105,4.5 Z"
5977
+ "d": "M8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 Z M8.87894737,11.2105263 L7.08947368,11.2105263 L7.08947368,13 L8.87894737,13 L8.87894737,11.2105263 Z M8.96842105,4.5 L7,4.5 L7.08947368,9.86842105 L8.87894737,9.86842105 L8.96842105,4.5 Z"
5878
5978
  }, null)])]);
5879
5979
  }
5880
5980
  function InfoIcon() {
5881
5981
  return createVNode("svg", {
5882
- "class": "devui-icon devui-icon-info",
5982
+ "class": [ns.e("icon"), ns.em("icon", "info")],
5883
5983
  "viewBox": "0 0 16 16",
5884
5984
  "version": "1.1",
5885
5985
  "xmlns": "http://www.w3.org/2000/svg"
@@ -5895,12 +5995,12 @@ function InfoIcon() {
5895
5995
  }, null), createVNode("g", {
5896
5996
  "stroke-width": "1"
5897
5997
  }, [createVNode("path", {
5898
- "d": "M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z M9,5 L7,5 L7,3 L9,3 L9,5 Z M9,12.6 L7,12.6 L7,6.6 L9,6.6 L9,12.6 Z"
5998
+ "d": "M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z M9,5 L7,5 L7,3 L9,3 L9,5 Z M9,12.6 L7,12.6 L7,6.6 L9,6.6 L9,12.6 Z"
5899
5999
  }, null)])])]);
5900
6000
  }
5901
6001
  function ErrorIcon() {
5902
6002
  return createVNode("svg", {
5903
- "class": "devui-icon devui-icon-error",
6003
+ "class": [ns.e("icon"), ns.em("icon", "error")],
5904
6004
  "width": "16px",
5905
6005
  "height": "16px",
5906
6006
  "viewBox": "0 0 16 16",
@@ -5916,7 +6016,7 @@ function ErrorIcon() {
5916
6016
  "cy": "8",
5917
6017
  "r": "7"
5918
6018
  }, null), createVNode("path", {
5919
- "d": "M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z M9,12.6 L7,12.6 L7,10.6 L9,10.6 L9,12.6 Z M9,9.1 L7,9.1 L6.9,3.1 L9.1,3.1 L9,9.1 Z",
6019
+ "d": "M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z M9,12.6 L7,12.6 L7,10.6 L9,10.6 L9,12.6 Z M9,9.1 L7,9.1 L6.9,3.1 L9.1,3.1 L9,9.1 Z",
5920
6020
  "fill-rule": "nonzero"
5921
6021
  }, null)])]);
5922
6022
  }
@@ -5929,8 +6029,9 @@ var PopoverIcon = defineComponent({
5929
6029
  }
5930
6030
  },
5931
6031
  setup(props) {
6032
+ const ns2 = useNamespace("popover");
5932
6033
  return () => props.type && props.type !== "default" && createVNode("span", {
5933
- "class": "devui-popover-icon"
6034
+ "class": ns2.e("icon-wrap")
5934
6035
  }, [props.type === "success" && createVNode(SuccessIcon, null, null), props.type === "warning" && createVNode(WarningIcon, null, null), props.type === "info" && createVNode(InfoIcon, null, null), props.type === "error" && createVNode(ErrorIcon, null, null)]);
5935
6036
  }
5936
6037
  });
@@ -5939,9 +6040,11 @@ var Popover = defineComponent({
5939
6040
  name: "DPopover",
5940
6041
  inheritAttrs: false,
5941
6042
  props: popoverProps,
6043
+ emits: ["show", "hide"],
5942
6044
  setup(props, {
5943
6045
  slots,
5944
- attrs
6046
+ attrs,
6047
+ emit
5945
6048
  }) {
5946
6049
  const {
5947
6050
  content,
@@ -5956,47 +6059,59 @@ var Popover = defineComponent({
5956
6059
  const visible = ref(false);
5957
6060
  const {
5958
6061
  placement,
5959
- handlePositionChange
6062
+ handlePositionChange,
6063
+ onMouseenter,
6064
+ onMouseleave
5960
6065
  } = usePopoverEvent(props, visible, origin);
5961
6066
  const {
5962
6067
  overlayStyles
5963
6068
  } = usePopover(props, visible, placement, origin, popoverRef);
5964
- return () => {
5965
- var _a;
5966
- return createVNode(Fragment, null, [createVNode("div", {
5967
- "ref": origin,
5968
- "class": "devui-popover-reference"
5969
- }, [(_a = slots.reference) == null ? void 0 : _a.call(slots)]), createVNode(Teleport, {
5970
- "to": "body"
6069
+ const ns2 = useNamespace("popover");
6070
+ provide(POPPER_TRIGGER_TOKEN, origin);
6071
+ watch(visible, (newVal) => {
6072
+ if (newVal) {
6073
+ emit("show");
6074
+ } else {
6075
+ emit("hide");
6076
+ }
6077
+ });
6078
+ return () => createVNode(Fragment, null, [createVNode(PopperTrigger, null, {
6079
+ default: () => {
6080
+ var _a;
6081
+ return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
6082
+ }
6083
+ }), createVNode(Teleport, {
6084
+ "to": "body"
6085
+ }, {
6086
+ default: () => [createVNode(Transition, {
6087
+ "name": showAnimation.value ? ns2.m(`fade-${placement.value}`) : ""
5971
6088
  }, {
5972
- default: () => [createVNode(Transition, {
5973
- "name": showAnimation.value ? `devui-popover-fade-${placement.value}` : ""
5974
- }, {
5975
- default: () => [createVNode(FlexibleOverlay, mergeProps({
5976
- "modelValue": visible.value,
5977
- "onUpdate:modelValue": ($event) => visible.value = $event,
5978
- "ref": popoverRef,
5979
- "origin": origin.value,
5980
- "position": position.value,
5981
- "align": align.value,
5982
- "offset": offset2.value,
5983
- "class": ["devui-popover-content", popType.value !== "default" ? "is-icon" : ""],
5984
- "show-arrow": true,
5985
- "is-arrow-center": false,
5986
- "style": overlayStyles.value
5987
- }, attrs, {
5988
- "onPositionChange": handlePositionChange
5989
- }), {
5990
- default: () => {
5991
- var _a2;
5992
- return [createVNode(PopoverIcon, {
5993
- "type": popType.value
5994
- }, null), ((_a2 = slots.content) == null ? void 0 : _a2.call(slots)) || createVNode("span", null, [content.value])];
5995
- }
5996
- })]
6089
+ default: () => [createVNode(FlexibleOverlay, mergeProps({
6090
+ "modelValue": visible.value,
6091
+ "onUpdate:modelValue": ($event) => visible.value = $event,
6092
+ "ref": popoverRef,
6093
+ "origin": origin.value,
6094
+ "position": position.value,
6095
+ "align": align.value,
6096
+ "offset": offset2.value,
6097
+ "class": [ns2.e("content"), popType.value !== "default" ? "is-icon" : ""],
6098
+ "show-arrow": true,
6099
+ "is-arrow-center": false,
6100
+ "style": overlayStyles.value
6101
+ }, attrs, {
6102
+ "onPositionChange": handlePositionChange,
6103
+ "onMouseenter": onMouseenter,
6104
+ "onMouseleave": onMouseleave
6105
+ }), {
6106
+ default: () => {
6107
+ var _a;
6108
+ return [createVNode(PopoverIcon, {
6109
+ "type": popType.value
6110
+ }, null), ((_a = slots.content) == null ? void 0 : _a.call(slots)) || createVNode("span", null, [content.value])];
6111
+ }
5997
6112
  })]
5998
- })]);
5999
- };
6113
+ })]
6114
+ })]);
6000
6115
  }
6001
6116
  });
6002
6117
  var index = {