vue-devui 1.0.0-rc.8 → 1.0.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 (228) hide show
  1. package/README.md +188 -149
  2. package/alert/index.es.js +14 -9
  3. package/alert/index.umd.js +1 -1
  4. package/alert/style.css +1 -1
  5. package/auto-complete/index.es.js +8392 -418
  6. package/auto-complete/index.umd.js +29 -5
  7. package/auto-complete/style.css +1 -1
  8. package/avatar/index.es.js +59 -74
  9. package/avatar/index.umd.js +1 -1
  10. package/badge/index.es.js +10 -4
  11. package/badge/index.umd.js +1 -1
  12. package/badge/style.css +1 -1
  13. package/button/index.es.js +191 -53
  14. package/button/index.umd.js +17 -17
  15. package/button/style.css +1 -1
  16. package/card/index.es.js +7 -3
  17. package/card/index.umd.js +1 -1
  18. package/card/style.css +1 -1
  19. package/checkbox/index.es.js +8050 -241
  20. package/checkbox/index.umd.js +27 -1
  21. package/checkbox/style.css +1 -1
  22. package/{date-picker → collapse}/index.d.ts +0 -0
  23. package/collapse/index.es.js +213 -0
  24. package/collapse/index.umd.js +1 -0
  25. package/{date-picker → collapse}/package.json +1 -1
  26. package/collapse/style.css +1 -0
  27. package/countdown/index.es.js +56 -13
  28. package/countdown/index.umd.js +1 -1
  29. package/date-picker-pro/index.d.ts +7 -0
  30. package/date-picker-pro/index.es.js +12022 -0
  31. package/date-picker-pro/index.umd.js +27 -0
  32. package/date-picker-pro/package.json +7 -0
  33. package/date-picker-pro/style.css +1 -0
  34. package/drawer/index.es.js +24 -7
  35. package/drawer/index.umd.js +1 -1
  36. package/drawer/style.css +1 -1
  37. package/dropdown/index.es.js +190 -165
  38. package/dropdown/index.umd.js +1 -1
  39. package/dropdown/style.css +1 -1
  40. package/editable-select/index.es.js +785 -145
  41. package/editable-select/index.umd.js +1 -1
  42. package/editable-select/style.css +1 -1
  43. package/form/index.es.js +399 -300
  44. package/form/index.umd.js +16 -16
  45. package/form/style.css +1 -1
  46. package/fullscreen/index.es.js +2 -2
  47. package/fullscreen/index.umd.js +1 -1
  48. package/grid/index.es.js +8 -6
  49. package/grid/index.umd.js +1 -1
  50. package/icon/index.es.js +185 -23
  51. package/icon/index.umd.js +1 -1
  52. package/icon/style.css +1 -0
  53. package/image-preview/index.es.js +2 -2
  54. package/image-preview/index.umd.js +1 -1
  55. package/image-preview/style.css +1 -1
  56. package/input/index.es.js +8220 -45
  57. package/input/index.umd.js +27 -1
  58. package/input/style.css +1 -1
  59. package/input-number/index.es.js +279 -204
  60. package/input-number/index.umd.js +1 -1
  61. package/input-number/style.css +1 -1
  62. package/layout/index.es.js +3 -3
  63. package/layout/index.umd.js +1 -1
  64. package/loading/index.es.js +53 -53
  65. package/loading/index.umd.js +1 -1
  66. package/loading/style.css +1 -1
  67. package/mention/index.d.ts +7 -0
  68. package/mention/index.es.js +8319 -0
  69. package/mention/index.umd.js +36 -0
  70. package/mention/package.json +7 -0
  71. package/mention/style.css +1 -0
  72. package/menu/index.d.ts +7 -0
  73. package/menu/index.es.js +921 -0
  74. package/menu/index.umd.js +1 -0
  75. package/menu/package.json +7 -0
  76. package/menu/style.css +1 -0
  77. package/message/index.d.ts +7 -0
  78. package/message/index.es.js +539 -0
  79. package/message/index.umd.js +1 -0
  80. package/message/package.json +7 -0
  81. package/message/style.css +1 -0
  82. package/modal/index.es.js +451 -173
  83. package/modal/index.umd.js +1 -1
  84. package/modal/style.css +1 -1
  85. package/notification/index.es.js +212 -70
  86. package/notification/index.umd.js +1 -1
  87. package/notification/style.css +1 -1
  88. package/nuxt/components/CheckboxButton.js +3 -0
  89. package/nuxt/components/Collapse.js +3 -0
  90. package/nuxt/components/CollapseItem.js +3 -0
  91. package/nuxt/components/DRangeDatePickerPro.js +3 -0
  92. package/nuxt/components/DatePickerPro.js +3 -0
  93. package/nuxt/components/Icon.js +1 -0
  94. package/nuxt/components/IconGroup.js +3 -0
  95. package/nuxt/components/LABEL_DATA.js +3 -0
  96. package/nuxt/components/Mention.js +3 -0
  97. package/nuxt/components/Menu.js +3 -0
  98. package/nuxt/components/MenuItem.js +3 -0
  99. package/nuxt/components/Message.js +3 -0
  100. package/nuxt/components/Option.js +3 -0
  101. package/nuxt/components/OptionGroup.js +3 -0
  102. package/nuxt/components/RadioButton.js +3 -0
  103. package/nuxt/components/Step.js +3 -0
  104. package/nuxt/components/Steps.js +3 -0
  105. package/nuxt/components/SubMenu.js +3 -0
  106. package/nuxt/components/TABLE_TOKEN.js +3 -0
  107. package/nuxt/components/TimePicker.js +3 -0
  108. package/nuxt/components/TimeSelect.js +3 -0
  109. package/nuxt/components/animationInjectionKey.js +3 -0
  110. package/nuxt/components/collapseItemProps.js +3 -0
  111. package/nuxt/components/collapseProps.js +3 -0
  112. package/nuxt/components/datePickerProCommonProps.js +3 -0
  113. package/nuxt/components/datePickerProPanelProps.js +3 -0
  114. package/nuxt/components/datePickerProProps.js +3 -0
  115. package/nuxt/components/iconProps.js +1 -0
  116. package/nuxt/components/mentionProps.js +3 -0
  117. package/nuxt/components/messageProps.js +3 -0
  118. package/nuxt/components/paginationInjectionKey.js +3 -0
  119. package/nuxt/components/roundInjectionKey.js +3 -0
  120. package/nuxt/components/skeletonItemProps.js +3 -0
  121. package/nuxt/components/stepProps.js +3 -0
  122. package/nuxt/components/stepsProps.js +3 -0
  123. package/nuxt/components/svgIconProps.js +3 -0
  124. package/nuxt/components/tableProps.js +3 -0
  125. package/nuxt/components/timerPickerPanelProps.js +3 -0
  126. package/nuxt/components/treeNodeProps.js +3 -0
  127. package/overlay/index.es.js +89 -142
  128. package/overlay/index.umd.js +1 -1
  129. package/overlay/style.css +1 -1
  130. package/package.json +8 -4
  131. package/pagination/index.es.js +10180 -129
  132. package/pagination/index.umd.js +27 -1
  133. package/pagination/style.css +1 -1
  134. package/panel/index.es.js +4 -0
  135. package/panel/index.umd.js +1 -1
  136. package/panel/style.css +1 -1
  137. package/popover/index.es.js +262 -229
  138. package/popover/index.umd.js +15 -15
  139. package/popover/style.css +1 -1
  140. package/progress/index.es.js +2 -2
  141. package/progress/index.umd.js +2 -2
  142. package/progress/style.css +1 -1
  143. package/radio/index.es.js +7954 -156
  144. package/radio/index.umd.js +27 -1
  145. package/radio/style.css +1 -1
  146. package/rate/index.es.js +16 -8
  147. package/rate/index.umd.js +1 -1
  148. package/rate/style.css +1 -1
  149. package/result/index.es.js +170 -22
  150. package/result/index.umd.js +1 -1
  151. package/result/style.css +1 -1
  152. package/search/index.es.js +3829 -1042
  153. package/search/index.umd.js +18 -18
  154. package/search/style.css +1 -1
  155. package/select/index.es.js +9202 -495
  156. package/select/index.umd.js +27 -1
  157. package/select/style.css +1 -1
  158. package/skeleton/index.es.js +89 -263
  159. package/skeleton/index.umd.js +1 -1
  160. package/skeleton/style.css +1 -1
  161. package/slider/index.es.js +118 -145
  162. package/slider/index.umd.js +1 -1
  163. package/slider/style.css +1 -1
  164. package/splitter/index.es.js +454 -233
  165. package/splitter/index.umd.js +13 -13
  166. package/splitter/style.css +1 -1
  167. package/statistic/index.es.js +34 -16
  168. package/statistic/index.umd.js +1 -1
  169. package/statistic/style.css +1 -1
  170. package/status/index.es.js +6 -2
  171. package/status/index.umd.js +1 -1
  172. package/status/style.css +1 -1
  173. package/steps/index.d.ts +7 -0
  174. package/steps/index.es.js +387 -0
  175. package/steps/index.umd.js +1 -0
  176. package/steps/package.json +7 -0
  177. package/steps/style.css +1 -0
  178. package/style.css +1 -1
  179. package/switch/index.es.js +7787 -62
  180. package/switch/index.umd.js +27 -1
  181. package/switch/style.css +1 -1
  182. package/table/index.es.js +5225 -1726
  183. package/table/index.umd.js +18 -18
  184. package/table/style.css +1 -1
  185. package/tabs/index.es.js +303 -102
  186. package/tabs/index.umd.js +1 -1
  187. package/tabs/style.css +1 -1
  188. package/tag/index.es.js +11 -8
  189. package/tag/index.umd.js +1 -1
  190. package/tag/style.css +1 -1
  191. package/textarea/index.es.js +7876 -41
  192. package/textarea/index.umd.js +35 -1
  193. package/textarea/style.css +1 -1
  194. package/time-picker/index.d.ts +7 -0
  195. package/time-picker/index.es.js +9549 -0
  196. package/time-picker/index.umd.js +27 -0
  197. package/time-picker/package.json +7 -0
  198. package/time-picker/style.css +1 -0
  199. package/time-select/index.d.ts +7 -0
  200. package/time-select/index.es.js +9607 -0
  201. package/time-select/index.umd.js +27 -0
  202. package/time-select/package.json +7 -0
  203. package/time-select/style.css +1 -0
  204. package/timeline/index.es.js +170 -22
  205. package/timeline/index.umd.js +1 -1
  206. package/timeline/style.css +1 -1
  207. package/tooltip/index.es.js +286 -238
  208. package/tooltip/index.umd.js +14 -14
  209. package/tooltip/style.css +1 -1
  210. package/tree/index.es.js +11342 -793
  211. package/tree/index.umd.js +27 -1
  212. package/tree/style.css +1 -1
  213. package/upload/index.es.js +458 -102
  214. package/upload/index.umd.js +1 -1
  215. package/upload/style.css +1 -1
  216. package/vue-devui.es.js +20475 -11072
  217. package/vue-devui.umd.js +31 -24
  218. package/date-picker/index.es.js +0 -1097
  219. package/date-picker/index.umd.js +0 -1
  220. package/date-picker/style.css +0 -1
  221. package/nuxt/components/DatePicker.js +0 -3
  222. package/nuxt/components/FormControl.js +0 -3
  223. package/nuxt/components/FormLabel.js +0 -3
  224. package/nuxt/components/Loading.js +0 -3
  225. package/nuxt/components/StickSlider.js +0 -3
  226. package/nuxt/components/formControlProps.js +0 -3
  227. package/nuxt/components/overlayEmits.js +0 -3
  228. package/nuxt/components/overlayProps.js +0 -3
package/form/index.es.js CHANGED
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
29
29
  }
30
30
  return target;
31
31
  };
32
- import { defineComponent, watch, provide, reactive, toRefs, createVNode, Teleport, Transition, renderSlot, isVNode, computed, onMounted, onUnmounted, ref, unref, nextTick, mergeProps, Fragment, inject, onBeforeUnmount } from "vue";
32
+ import { defineComponent, watch, provide, reactive, toRefs, createVNode, onUnmounted, Transition, mergeProps, ref, unref, nextTick, withModifiers, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, computed, onMounted, Teleport, createTextVNode, onBeforeUnmount } from "vue";
33
33
  import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
34
34
  const formProps = {
35
35
  data: {
@@ -66,6 +66,13 @@ const formProps = {
66
66
  showFeedback: {
67
67
  type: Boolean,
68
68
  default: false
69
+ },
70
+ disabled: {
71
+ type: Boolean,
72
+ default: false
73
+ },
74
+ size: {
75
+ type: String
69
76
  }
70
77
  };
71
78
  const FORM_TOKEN = Symbol("dForm");
@@ -79,8 +86,8 @@ function createBem(namespace, element, modifier) {
79
86
  }
80
87
  return cls;
81
88
  }
82
- function useNamespace(block) {
83
- const namespace = `devui-${block}`;
89
+ function useNamespace(block, needDot = false) {
90
+ const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
84
91
  const b = () => createBem(namespace);
85
92
  const e = (element) => element ? createBem(namespace, element) : "";
86
93
  const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
@@ -844,7 +851,7 @@ var lodash = { exports: {} };
844
851
  function object4() {
845
852
  }
846
853
  return function(proto) {
847
- if (!isObject(proto)) {
854
+ if (!isObject2(proto)) {
848
855
  return {};
849
856
  }
850
857
  if (objectCreate) {
@@ -1206,7 +1213,7 @@ var lodash = { exports: {} };
1206
1213
  if (result2 !== undefined$1) {
1207
1214
  return result2;
1208
1215
  }
1209
- if (!isObject(value)) {
1216
+ if (!isObject2(value)) {
1210
1217
  return value;
1211
1218
  }
1212
1219
  var isArr = isArray(value);
@@ -1553,7 +1560,7 @@ var lodash = { exports: {} };
1553
1560
  return true;
1554
1561
  }
1555
1562
  function baseIsNative(value) {
1556
- if (!isObject(value) || isMasked(value)) {
1563
+ if (!isObject2(value) || isMasked(value)) {
1557
1564
  return false;
1558
1565
  }
1559
1566
  var pattern4 = isFunction(value) ? reIsNative : reIsHostCtor;
@@ -1593,7 +1600,7 @@ var lodash = { exports: {} };
1593
1600
  return result2;
1594
1601
  }
1595
1602
  function baseKeysIn(object4) {
1596
- if (!isObject(object4)) {
1603
+ if (!isObject2(object4)) {
1597
1604
  return nativeKeysIn(object4);
1598
1605
  }
1599
1606
  var isProto = isPrototype(object4), result2 = [];
@@ -1638,7 +1645,7 @@ var lodash = { exports: {} };
1638
1645
  }
1639
1646
  baseFor(source, function(srcValue, key) {
1640
1647
  stack || (stack = new Stack());
1641
- if (isObject(srcValue)) {
1648
+ if (isObject2(srcValue)) {
1642
1649
  baseMergeDeep(object4, source, key, srcIndex, baseMerge, customizer, stack);
1643
1650
  } else {
1644
1651
  var newValue = customizer ? customizer(safeGet(object4, key), srcValue, key + "", object4, source, stack) : undefined$1;
@@ -1678,7 +1685,7 @@ var lodash = { exports: {} };
1678
1685
  newValue = objValue;
1679
1686
  if (isArguments(objValue)) {
1680
1687
  newValue = toPlainObject(objValue);
1681
- } else if (!isObject(objValue) || isFunction(objValue)) {
1688
+ } else if (!isObject2(objValue) || isFunction(objValue)) {
1682
1689
  newValue = initCloneObject(srcValue);
1683
1690
  }
1684
1691
  } else {
@@ -1817,7 +1824,7 @@ var lodash = { exports: {} };
1817
1824
  return shuffleSelf(array4, baseClamp(n, 0, array4.length));
1818
1825
  }
1819
1826
  function baseSet(object4, path, value, customizer) {
1820
- if (!isObject(object4)) {
1827
+ if (!isObject2(object4)) {
1821
1828
  return object4;
1822
1829
  }
1823
1830
  path = castPath(path, object4);
@@ -1831,7 +1838,7 @@ var lodash = { exports: {} };
1831
1838
  var objValue = nested[key];
1832
1839
  newValue = customizer ? customizer(objValue, key, nested) : undefined$1;
1833
1840
  if (newValue === undefined$1) {
1834
- newValue = isObject(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {};
1841
+ newValue = isObject2(objValue) ? objValue : isIndex(path[index2 + 1]) ? [] : {};
1835
1842
  }
1836
1843
  }
1837
1844
  assignValue(nested, key, newValue);
@@ -2281,7 +2288,7 @@ var lodash = { exports: {} };
2281
2288
  return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
2282
2289
  }
2283
2290
  var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args);
2284
- return isObject(result2) ? result2 : thisBinding;
2291
+ return isObject2(result2) ? result2 : thisBinding;
2285
2292
  };
2286
2293
  }
2287
2294
  function createCurry(func, bitmask, arity) {
@@ -2595,7 +2602,7 @@ var lodash = { exports: {} };
2595
2602
  return objValue;
2596
2603
  }
2597
2604
  function customDefaultsMerge(objValue, srcValue, key, object4, source, stack) {
2598
- if (isObject(objValue) && isObject(srcValue)) {
2605
+ if (isObject2(objValue) && isObject2(srcValue)) {
2599
2606
  stack.set(srcValue, objValue);
2600
2607
  baseMerge(objValue, srcValue, undefined$1, customDefaultsMerge, stack);
2601
2608
  stack["delete"](srcValue);
@@ -2943,7 +2950,7 @@ var lodash = { exports: {} };
2943
2950
  return !!length && (type4 == "number" || type4 != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
2944
2951
  }
2945
2952
  function isIterateeCall(value, index2, object4) {
2946
- if (!isObject(object4)) {
2953
+ if (!isObject2(object4)) {
2947
2954
  return false;
2948
2955
  }
2949
2956
  var type4 = typeof index2;
@@ -2986,7 +2993,7 @@ var lodash = { exports: {} };
2986
2993
  return value === proto;
2987
2994
  }
2988
2995
  function isStrictComparable(value) {
2989
- return value === value && !isObject(value);
2996
+ return value === value && !isObject2(value);
2990
2997
  }
2991
2998
  function matchesStrictComparable(key, srcValue) {
2992
2999
  return function(object4) {
@@ -3868,7 +3875,7 @@ var lodash = { exports: {} };
3868
3875
  throw new TypeError2(FUNC_ERROR_TEXT);
3869
3876
  }
3870
3877
  wait = toNumber(wait) || 0;
3871
- if (isObject(options)) {
3878
+ if (isObject2(options)) {
3872
3879
  leading = !!options.leading;
3873
3880
  maxing = "maxWait" in options;
3874
3881
  maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
@@ -4038,7 +4045,7 @@ var lodash = { exports: {} };
4038
4045
  if (typeof func != "function") {
4039
4046
  throw new TypeError2(FUNC_ERROR_TEXT);
4040
4047
  }
4041
- if (isObject(options)) {
4048
+ if (isObject2(options)) {
4042
4049
  leading = "leading" in options ? !!options.leading : leading;
4043
4050
  trailing = "trailing" in options ? !!options.trailing : trailing;
4044
4051
  }
@@ -4146,7 +4153,7 @@ var lodash = { exports: {} };
4146
4153
  return typeof value == "number" && nativeIsFinite(value);
4147
4154
  }
4148
4155
  function isFunction(value) {
4149
- if (!isObject(value)) {
4156
+ if (!isObject2(value)) {
4150
4157
  return false;
4151
4158
  }
4152
4159
  var tag = baseGetTag(value);
@@ -4158,7 +4165,7 @@ var lodash = { exports: {} };
4158
4165
  function isLength(value) {
4159
4166
  return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
4160
4167
  }
4161
- function isObject(value) {
4168
+ function isObject2(value) {
4162
4169
  var type4 = typeof value;
4163
4170
  return value != null && (type4 == "object" || type4 == "function");
4164
4171
  }
@@ -4265,9 +4272,9 @@ var lodash = { exports: {} };
4265
4272
  if (isSymbol(value)) {
4266
4273
  return NAN;
4267
4274
  }
4268
- if (isObject(value)) {
4275
+ if (isObject2(value)) {
4269
4276
  var other = typeof value.valueOf == "function" ? value.valueOf() : value;
4270
- value = isObject(other) ? other + "" : other;
4277
+ value = isObject2(other) ? other + "" : other;
4271
4278
  }
4272
4279
  if (typeof value != "string") {
4273
4280
  return value === 0 ? value : +value;
@@ -4488,7 +4495,7 @@ var lodash = { exports: {} };
4488
4495
  var Ctor = object4 && object4.constructor;
4489
4496
  if (isArrLike) {
4490
4497
  accumulator = isArr ? new Ctor() : [];
4491
- } else if (isObject(object4)) {
4498
+ } else if (isObject2(object4)) {
4492
4499
  accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object4)) : {};
4493
4500
  } else {
4494
4501
  accumulator = {};
@@ -4770,7 +4777,7 @@ var lodash = { exports: {} };
4770
4777
  }
4771
4778
  function truncate(string3, options) {
4772
4779
  var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
4773
- if (isObject(options)) {
4780
+ if (isObject2(options)) {
4774
4781
  var separator = "separator" in options ? options.separator : separator;
4775
4782
  length = "length" in options ? toInteger(options.length) : length;
4776
4783
  omission = "omission" in options ? baseToString(options.omission) : omission;
@@ -4900,13 +4907,13 @@ var lodash = { exports: {} };
4900
4907
  });
4901
4908
  function mixin(object4, source, options) {
4902
4909
  var props = keys(source), methodNames = baseFunctions(source, props);
4903
- if (options == null && !(isObject(source) && (methodNames.length || !props.length))) {
4910
+ if (options == null && !(isObject2(source) && (methodNames.length || !props.length))) {
4904
4911
  options = source;
4905
4912
  source = object4;
4906
4913
  object4 = this;
4907
4914
  methodNames = baseFunctions(source, keys(source));
4908
4915
  }
4909
- var chain2 = !(isObject(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object4);
4916
+ var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object4);
4910
4917
  arrayEach(methodNames, function(methodName) {
4911
4918
  var func = source[methodName];
4912
4919
  object4[methodName] = func;
@@ -5252,7 +5259,7 @@ var lodash = { exports: {} };
5252
5259
  lodash2.isNil = isNil;
5253
5260
  lodash2.isNull = isNull;
5254
5261
  lodash2.isNumber = isNumber;
5255
- lodash2.isObject = isObject;
5262
+ lodash2.isObject = isObject2;
5256
5263
  lodash2.isObjectLike = isObjectLike;
5257
5264
  lodash2.isPlainObject = isPlainObject;
5258
5265
  lodash2.isRegExp = isRegExp;
@@ -5613,136 +5620,131 @@ var Form = defineComponent({
5613
5620
  };
5614
5621
  }
5615
5622
  });
5616
- const formLabelProps = {
5617
- helpTips: {
5623
+ const formItemProps = {
5624
+ label: {
5625
+ type: String
5626
+ },
5627
+ field: {
5618
5628
  type: String,
5619
5629
  default: ""
5620
- }
5621
- };
5622
- var baseOverlay = "";
5623
- function _isSlot(s) {
5624
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
5625
- }
5626
- const CommonOverlay = defineComponent({
5627
- setup(props, ctx) {
5628
- const ns2 = useNamespace("overlay");
5629
- return () => {
5630
- let _slot;
5631
- return createVNode(Teleport, {
5632
- "to": "#d-overlay-anchor"
5633
- }, {
5634
- default: () => [createVNode(Transition, {
5635
- "name": ns2.e("fade")
5636
- }, _isSlot(_slot = renderSlot(ctx.slots, "default")) ? _slot : {
5637
- default: () => [_slot]
5638
- })]
5639
- });
5640
- };
5641
- }
5642
- });
5643
- const overlayProps = {
5644
- visible: {
5645
- type: Boolean
5646
5630
  },
5647
- backgroundBlock: {
5631
+ required: {
5648
5632
  type: Boolean,
5649
5633
  default: false
5650
5634
  },
5651
- backgroundClass: {
5635
+ messageType: {
5636
+ type: String
5637
+ },
5638
+ popPosition: {
5639
+ type: Array
5640
+ },
5641
+ rules: {
5642
+ type: [Object, Array]
5643
+ },
5644
+ showFeedback: {
5645
+ type: Boolean,
5646
+ default: void 0
5647
+ },
5648
+ helpTips: {
5652
5649
  type: String,
5653
5650
  default: ""
5654
5651
  },
5655
- backgroundStyle: {
5656
- type: [String, Object]
5652
+ feedbackStatus: {
5653
+ type: String
5657
5654
  },
5658
- onBackdropClick: {
5659
- type: Function
5655
+ extraInfo: {
5656
+ type: String,
5657
+ default: ""
5658
+ }
5659
+ };
5660
+ const FORM_ITEM_TOKEN = Symbol("dFormItem");
5661
+ const LABEL_DATA = Symbol("labelData");
5662
+ const formLabelProps = {
5663
+ helpTips: {
5664
+ type: String,
5665
+ default: ""
5666
+ }
5667
+ };
5668
+ const fixedOverlayProps = {
5669
+ modelValue: {
5670
+ type: Boolean,
5671
+ default: false
5660
5672
  },
5661
- backdropClose: {
5673
+ lockScroll: {
5662
5674
  type: Boolean,
5663
5675
  default: true
5664
5676
  },
5665
- hasBackdrop: {
5677
+ closeOnClickOverlay: {
5666
5678
  type: Boolean,
5667
5679
  default: true
5668
5680
  }
5669
5681
  };
5670
- const fixedOverlayProps = __spreadProps(__spreadValues({}, overlayProps), {
5671
- overlayStyle: {
5672
- type: [String, Object],
5673
- default: void 0
5682
+ function lockScroll() {
5683
+ if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
5684
+ const scrollTop = document.documentElement.scrollTop;
5685
+ const style = document.documentElement.getAttribute("style");
5686
+ document.documentElement.style.position = "fixed";
5687
+ document.documentElement.style.top = `-${scrollTop}px`;
5688
+ document.documentElement.style.width = document.documentElement.style.width || "100%";
5689
+ document.documentElement.style.overflowY = "scroll";
5690
+ return () => {
5691
+ if (style) {
5692
+ document.documentElement.setAttribute("style", style);
5693
+ } else {
5694
+ document.documentElement.removeAttribute("style");
5695
+ }
5696
+ document.documentElement.scrollTop = scrollTop;
5697
+ };
5674
5698
  }
5675
- });
5676
- const overlayEmits = ["update:visible", "backdropClick"];
5677
- function useOverlayLogic(props, ctx) {
5678
- const ns2 = useNamespace("overlay");
5679
- const backgroundClass = computed(() => {
5680
- return [ns2.e("background"), props.backgroundClass, !props.hasBackdrop ? ns2.em("background", "disabled") : ns2.em("background", "color")];
5681
- });
5682
- const overlayClass = computed(() => {
5683
- return ns2.b();
5684
- });
5685
- const handleBackdropClick = (event) => {
5686
- var _a;
5699
+ return;
5700
+ }
5701
+ function useFixedOverlay(props, ctx) {
5702
+ let lockScrollCb;
5703
+ const onClick = (event) => {
5687
5704
  event.preventDefault();
5688
- (_a = props.onBackdropClick) == null ? void 0 : _a.call(props);
5689
- if (props.backdropClose) {
5690
- ctx.emit("update:visible", false);
5705
+ ctx.emit("click", event);
5706
+ if (props.closeOnClickOverlay) {
5707
+ ctx.emit("update:modelValue", false);
5691
5708
  }
5692
5709
  };
5693
- const handleOverlayBubbleCancel = (event) => event.cancelBubble = true;
5694
- onMounted(() => {
5695
- const body = document.body;
5696
- const originOverflow = body.style.overflow;
5697
- const originPosition = body.style.position;
5698
- watch([() => props.visible, () => props.backgroundBlock], ([visible, backgroundBlock]) => {
5699
- if (backgroundBlock) {
5700
- const top = body.getBoundingClientRect().y;
5701
- if (visible) {
5702
- body.style.overflowY = "scroll";
5703
- body.style.position = visible ? "fixed" : "";
5704
- body.style.top = `${top}px`;
5705
- } else {
5706
- body.style.overflowY = originOverflow;
5707
- body.style.position = originPosition;
5708
- body.style.top = "";
5709
- window.scrollTo(0, -top);
5710
- }
5711
- }
5712
- });
5713
- onUnmounted(() => {
5714
- document.body.style.overflow = originOverflow;
5715
- });
5716
- });
5717
- return {
5718
- backgroundClass,
5719
- overlayClass,
5720
- handleBackdropClick,
5721
- handleOverlayBubbleCancel
5710
+ const removeBodyAdditions = () => {
5711
+ lockScrollCb == null ? void 0 : lockScrollCb();
5722
5712
  };
5713
+ watch(() => props.modelValue, (val) => {
5714
+ if (val) {
5715
+ props.lockScroll && (lockScrollCb = lockScroll());
5716
+ } else {
5717
+ removeBodyAdditions();
5718
+ }
5719
+ });
5720
+ onUnmounted(removeBodyAdditions);
5721
+ return { onClick };
5723
5722
  }
5724
5723
  var fixedOverlay = "";
5725
5724
  defineComponent({
5726
5725
  name: "DFixedOverlay",
5726
+ inheritAttrs: false,
5727
5727
  props: fixedOverlayProps,
5728
- emits: overlayEmits,
5728
+ emits: ["update:modelValue", "click"],
5729
5729
  setup(props, ctx) {
5730
5730
  const {
5731
- backgroundClass,
5732
- overlayClass,
5733
- handleBackdropClick,
5734
- handleOverlayBubbleCancel
5735
- } = useOverlayLogic(props, ctx);
5736
- return () => createVNode(CommonOverlay, null, {
5737
- default: () => [props.visible && createVNode("div", {
5738
- "class": backgroundClass.value,
5739
- "style": props.backgroundStyle,
5740
- "onClick": handleBackdropClick
5741
- }, [createVNode("div", {
5742
- "class": overlayClass.value,
5743
- "style": props.overlayStyle,
5744
- "onClick": handleOverlayBubbleCancel
5745
- }, [renderSlot(ctx.slots, "default")])])]
5731
+ modelValue
5732
+ } = toRefs(props);
5733
+ const ns2 = useNamespace("fixed-overlay");
5734
+ const {
5735
+ onClick
5736
+ } = useFixedOverlay(props, ctx);
5737
+ return () => createVNode(Transition, {
5738
+ "name": ns2.m("fade")
5739
+ }, {
5740
+ default: () => {
5741
+ var _a, _b;
5742
+ return [modelValue.value && createVNode("div", mergeProps({
5743
+ "class": ns2.b()
5744
+ }, ctx.attrs, {
5745
+ "onClick": onClick
5746
+ }), [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])];
5747
+ }
5746
5748
  });
5747
5749
  }
5748
5750
  });
@@ -5777,6 +5779,10 @@ const flexibleOverlayProps = {
5777
5779
  isArrowCenter: {
5778
5780
  type: Boolean,
5779
5781
  default: true
5782
+ },
5783
+ clickEventBubble: {
5784
+ type: Boolean,
5785
+ default: false
5780
5786
  }
5781
5787
  };
5782
5788
  function getScrollParent(element) {
@@ -5891,6 +5897,9 @@ const FlexibleOverlay = defineComponent({
5891
5897
  expose
5892
5898
  }) {
5893
5899
  const ns2 = useNamespace("flexible-overlay");
5900
+ const {
5901
+ clickEventBubble
5902
+ } = toRefs(props);
5894
5903
  const {
5895
5904
  arrowRef,
5896
5905
  overlayRef,
@@ -5904,13 +5913,72 @@ const FlexibleOverlay = defineComponent({
5904
5913
  return props.modelValue && createVNode("div", mergeProps({
5905
5914
  "ref": overlayRef,
5906
5915
  "class": ns2.b()
5907
- }, attrs), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
5916
+ }, attrs, {
5917
+ "onClick": withModifiers(() => ({}), [clickEventBubble.value ? "" : "stop"]),
5918
+ "onPointerup": withModifiers(() => ({}), ["stop"])
5919
+ }), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
5908
5920
  "ref": arrowRef,
5909
5921
  "class": ns2.e("arrow")
5910
5922
  }, null)]);
5911
5923
  };
5912
5924
  }
5913
5925
  });
5926
+ const POPPER_TRIGGER_TOKEN = Symbol("popper-trigger");
5927
+ const isObject = (val) => val !== null && typeof val === "object";
5928
+ const ns$1 = useNamespace("popper-trigger");
5929
+ function wrapContent(content) {
5930
+ return h("span", { class: ns$1.b() }, content);
5931
+ }
5932
+ function getFirstValidChild(nodes) {
5933
+ for (const child of nodes) {
5934
+ if (isObject(child)) {
5935
+ if (child.type === Comment) {
5936
+ continue;
5937
+ }
5938
+ if (child.type === "svg" || child.type === Text) {
5939
+ return wrapContent(child);
5940
+ }
5941
+ if (child.type === Fragment) {
5942
+ return getFirstValidChild(child.children);
5943
+ }
5944
+ return child;
5945
+ }
5946
+ return wrapContent(child);
5947
+ }
5948
+ return null;
5949
+ }
5950
+ var PopperTrigger = defineComponent({
5951
+ name: "DPopperTrigger",
5952
+ setup(_, ctx) {
5953
+ const {
5954
+ slots,
5955
+ attrs
5956
+ } = ctx;
5957
+ return () => {
5958
+ var _a;
5959
+ const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots, attrs);
5960
+ const triggerRef = inject(POPPER_TRIGGER_TOKEN);
5961
+ if (!defaultSlot) {
5962
+ return null;
5963
+ }
5964
+ const firstValidChild = getFirstValidChild(defaultSlot);
5965
+ if (!firstValidChild) {
5966
+ return null;
5967
+ }
5968
+ return withDirectives(cloneVNode(firstValidChild, attrs), [[{
5969
+ mounted(el) {
5970
+ triggerRef.value = el;
5971
+ },
5972
+ updated(el) {
5973
+ triggerRef.value = el;
5974
+ },
5975
+ unmounted() {
5976
+ triggerRef.value = null;
5977
+ }
5978
+ }]]);
5979
+ };
5980
+ }
5981
+ });
5914
5982
  const popoverProps = {
5915
5983
  isOpen: {
5916
5984
  type: Boolean,
@@ -5951,6 +6019,10 @@ const popoverProps = {
5951
6019
  mouseLeaveDelay: {
5952
6020
  type: Number,
5953
6021
  default: 100
6022
+ },
6023
+ disabled: {
6024
+ type: Boolean,
6025
+ default: false
5954
6026
  }
5955
6027
  };
5956
6028
  const TransformOriginMap = {
@@ -5962,7 +6034,7 @@ const TransformOriginMap = {
5962
6034
  function usePopover(props, visible, placement, origin, popoverRef) {
5963
6035
  const { trigger, isOpen } = toRefs(props);
5964
6036
  const overlayStyles = computed(() => ({
5965
- zIndex: 1060,
6037
+ zIndex: "var(--devui-z-index-pop-up, 1060)",
5966
6038
  transformOrigin: TransformOriginMap[placement.value]
5967
6039
  }));
5968
6040
  const onDocumentClick = (e) => {
@@ -5987,11 +6059,16 @@ function usePopover(props, visible, placement, origin, popoverRef) {
5987
6059
  return { overlayStyles };
5988
6060
  }
5989
6061
  function usePopoverEvent(props, visible, origin) {
5990
- const { trigger, position, mouseEnterDelay, mouseLeaveDelay } = toRefs(props);
6062
+ const { trigger, position, mouseEnterDelay, mouseLeaveDelay, disabled } = toRefs(props);
5991
6063
  const isClick = computed(() => trigger.value === "click");
5992
6064
  const placement = ref(position.value[0].split("-")[0]);
5993
6065
  const isEnter = ref(false);
5994
- const onClick = () => isClick.value && (visible.value = !visible.value);
6066
+ const onClick = () => {
6067
+ if (disabled.value) {
6068
+ return;
6069
+ }
6070
+ isClick.value && (visible.value = !visible.value);
6071
+ };
5995
6072
  const enter = lodash.exports.debounce(() => {
5996
6073
  isEnter.value && (visible.value = true);
5997
6074
  }, mouseEnterDelay.value);
@@ -5999,6 +6076,9 @@ function usePopoverEvent(props, visible, origin) {
5999
6076
  !isEnter.value && (visible.value = false);
6000
6077
  }, mouseLeaveDelay.value);
6001
6078
  const onMouseenter = () => {
6079
+ if (disabled.value) {
6080
+ return;
6081
+ }
6002
6082
  if (!isClick.value) {
6003
6083
  isEnter.value = true;
6004
6084
  enter();
@@ -6010,6 +6090,15 @@ function usePopoverEvent(props, visible, origin) {
6010
6090
  leave();
6011
6091
  }
6012
6092
  };
6093
+ const quickLeave = () => {
6094
+ isEnter.value = false;
6095
+ visible.value = false;
6096
+ };
6097
+ watch(disabled, (newVal) => {
6098
+ if (newVal && visible.value) {
6099
+ quickLeave();
6100
+ }
6101
+ });
6013
6102
  const handlePositionChange = (pos) => {
6014
6103
  placement.value = pos.split("-")[0];
6015
6104
  };
@@ -6128,9 +6217,11 @@ var Popover = defineComponent({
6128
6217
  name: "DPopover",
6129
6218
  inheritAttrs: false,
6130
6219
  props: popoverProps,
6220
+ emits: ["show", "hide"],
6131
6221
  setup(props, {
6132
6222
  slots,
6133
- attrs
6223
+ attrs,
6224
+ emit
6134
6225
  }) {
6135
6226
  const {
6136
6227
  content,
@@ -6153,44 +6244,51 @@ var Popover = defineComponent({
6153
6244
  overlayStyles
6154
6245
  } = usePopover(props, visible, placement, origin, popoverRef);
6155
6246
  const ns2 = useNamespace("popover");
6156
- return () => {
6157
- var _a;
6158
- return createVNode(Fragment, null, [createVNode("div", {
6159
- "ref": origin,
6160
- "class": ns2.e("reference")
6161
- }, [(_a = slots.reference) == null ? void 0 : _a.call(slots)]), createVNode(Teleport, {
6162
- "to": "body"
6247
+ provide(POPPER_TRIGGER_TOKEN, origin);
6248
+ watch(visible, (newVal) => {
6249
+ if (newVal) {
6250
+ emit("show");
6251
+ } else {
6252
+ emit("hide");
6253
+ }
6254
+ });
6255
+ return () => createVNode(Fragment, null, [createVNode(PopperTrigger, null, {
6256
+ default: () => {
6257
+ var _a;
6258
+ return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
6259
+ }
6260
+ }), createVNode(Teleport, {
6261
+ "to": "body"
6262
+ }, {
6263
+ default: () => [createVNode(Transition, {
6264
+ "name": showAnimation.value ? ns2.m(`fade-${placement.value}`) : ""
6163
6265
  }, {
6164
- default: () => [createVNode(Transition, {
6165
- "name": showAnimation.value ? ns2.m(`fade-${placement.value}`) : ""
6166
- }, {
6167
- default: () => [createVNode(FlexibleOverlay, mergeProps({
6168
- "modelValue": visible.value,
6169
- "onUpdate:modelValue": ($event) => visible.value = $event,
6170
- "ref": popoverRef,
6171
- "origin": origin.value,
6172
- "position": position.value,
6173
- "align": align.value,
6174
- "offset": offset2.value,
6175
- "class": [ns2.e("content"), popType.value !== "default" ? "is-icon" : ""],
6176
- "show-arrow": true,
6177
- "is-arrow-center": false,
6178
- "style": overlayStyles.value
6179
- }, attrs, {
6180
- "onPositionChange": handlePositionChange,
6181
- "onMouseenter": onMouseenter,
6182
- "onMouseleave": onMouseleave
6183
- }), {
6184
- default: () => {
6185
- var _a2;
6186
- return [createVNode(PopoverIcon, {
6187
- "type": popType.value
6188
- }, null), ((_a2 = slots.content) == null ? void 0 : _a2.call(slots)) || createVNode("span", null, [content.value])];
6189
- }
6190
- })]
6266
+ default: () => [createVNode(FlexibleOverlay, mergeProps({
6267
+ "modelValue": visible.value,
6268
+ "onUpdate:modelValue": ($event) => visible.value = $event,
6269
+ "ref": popoverRef,
6270
+ "origin": origin.value,
6271
+ "position": position.value,
6272
+ "align": align.value,
6273
+ "offset": offset2.value,
6274
+ "class": [ns2.e("content"), popType.value !== "default" ? "is-icon" : ""],
6275
+ "show-arrow": true,
6276
+ "is-arrow-center": false,
6277
+ "style": overlayStyles.value
6278
+ }, attrs, {
6279
+ "onPositionChange": handlePositionChange,
6280
+ "onMouseenter": onMouseenter,
6281
+ "onMouseleave": onMouseleave
6282
+ }), {
6283
+ default: () => {
6284
+ var _a;
6285
+ return [createVNode(PopoverIcon, {
6286
+ "type": popType.value
6287
+ }, null), ((_a = slots.content) == null ? void 0 : _a.call(slots)) || createVNode("span", null, [content.value])];
6288
+ }
6191
6289
  })]
6192
- })]);
6193
- };
6290
+ })]
6291
+ })]);
6194
6292
  }
6195
6293
  });
6196
6294
  function HelpTipsIcon() {
@@ -6264,39 +6362,15 @@ function PendingIcon() {
6264
6362
  "fill-rule": "nonzero"
6265
6363
  }, null)])]);
6266
6364
  }
6267
- const formItemProps = {
6268
- field: {
6269
- type: String,
6270
- default: ""
6271
- },
6272
- required: {
6273
- type: Boolean,
6274
- default: false
6275
- },
6276
- messageType: {
6277
- type: String
6278
- },
6279
- popPosition: {
6280
- type: Array
6281
- },
6282
- rules: {
6283
- type: [Object, Array]
6284
- },
6285
- showFeedback: {
6286
- type: Boolean,
6287
- default: void 0
6288
- }
6289
- };
6290
- const FORM_ITEM_TOKEN = Symbol("dFormItem");
6291
6365
  function useFormLabel() {
6292
- const formContext = inject(FORM_TOKEN);
6293
6366
  const formItemContext = inject(FORM_ITEM_TOKEN);
6367
+ const labelData = inject(LABEL_DATA);
6294
6368
  const ns2 = useNamespace("form");
6295
6369
  const labelClasses = computed(() => ({
6296
6370
  [`${ns2.e("label")}`]: true,
6297
- [`${ns2.em("label", "vertical")}`]: formContext.layout === "vertical",
6298
- [`${ns2.em("label", formContext.labelSize)}`]: formContext.layout === "horizontal",
6299
- [`${ns2.em("label", formContext.labelAlign)}`]: formContext.layout === "horizontal"
6371
+ [`${ns2.em("label", "vertical")}`]: labelData.value.layout === "vertical",
6372
+ [`${ns2.em("label", labelData.value.labelSize)}`]: labelData.value.layout === "horizontal",
6373
+ [`${ns2.em("label", labelData.value.labelAlign)}`]: labelData.value.layout === "horizontal"
6300
6374
  }));
6301
6375
  const labelInnerClasses = computed(() => ({
6302
6376
  [`${ns2.e("label-span")}`]: true,
@@ -6326,13 +6400,94 @@ var FormLabel = defineComponent({
6326
6400
  "trigger": "hover",
6327
6401
  "pop-type": "info"
6328
6402
  }, {
6329
- reference: () => createVNode(HelpTipsIcon, {
6403
+ default: () => [createVNode(HelpTipsIcon, {
6330
6404
  "class": ns2.e("label-help")
6331
- }, null)
6405
+ }, null), createTextVNode(",")]
6332
6406
  })]);
6333
6407
  };
6334
6408
  }
6335
6409
  });
6410
+ const formControlProps = {
6411
+ feedbackStatus: {
6412
+ type: String
6413
+ },
6414
+ extraInfo: {
6415
+ type: String,
6416
+ default: ""
6417
+ }
6418
+ };
6419
+ function useFormControl(props) {
6420
+ const labelData = inject(LABEL_DATA);
6421
+ const ns2 = useNamespace("form");
6422
+ const { feedbackStatus } = toRefs(props);
6423
+ const controlClasses = computed(() => ({
6424
+ [ns2.e("control")]: true,
6425
+ [ns2.em("control", "horizontal")]: labelData.value.layout === "horizontal"
6426
+ }));
6427
+ const controlContainerClasses = computed(() => ({
6428
+ [ns2.e("control-container")]: true,
6429
+ [ns2.em("control-container", "horizontal")]: labelData.value.layout === "horizontal",
6430
+ [ns2.em("control-container", "has-feedback")]: Boolean(feedbackStatus == null ? void 0 : feedbackStatus.value),
6431
+ [ns2.em("control-container", "feedback-error")]: Boolean((feedbackStatus == null ? void 0 : feedbackStatus.value) === "error")
6432
+ }));
6433
+ return { controlClasses, controlContainerClasses };
6434
+ }
6435
+ function useFormControlValidate() {
6436
+ const formItemContext = inject(FORM_ITEM_TOKEN);
6437
+ const feedbackStatus = computed(() => formItemContext.validateState);
6438
+ const showFeedback = computed(() => formItemContext.showFeedback && Boolean(formItemContext.validateState));
6439
+ const showPopover = computed(() => formItemContext.messageType === "popover" && formItemContext.validateState === "error");
6440
+ const showMessage = computed(() => formItemContext.messageType === "text" && formItemContext.validateState === "error");
6441
+ const errorMessage = computed(() => formItemContext.validateMessage);
6442
+ const popPosition = computed(() => formItemContext.popPosition);
6443
+ return { feedbackStatus, showFeedback, showPopover, showMessage, errorMessage, popPosition };
6444
+ }
6445
+ var formControl = "";
6446
+ var FormControl = defineComponent({
6447
+ name: "DFormControl",
6448
+ props: formControlProps,
6449
+ setup(props, ctx) {
6450
+ const formControl2 = ref();
6451
+ const ns2 = useNamespace("form");
6452
+ const {
6453
+ controlClasses,
6454
+ controlContainerClasses
6455
+ } = useFormControl(props);
6456
+ const {
6457
+ feedbackStatus,
6458
+ showFeedback,
6459
+ showPopover,
6460
+ showMessage,
6461
+ errorMessage,
6462
+ popPosition
6463
+ } = useFormControlValidate();
6464
+ return () => createVNode("div", {
6465
+ "class": controlClasses.value,
6466
+ "ref": formControl2
6467
+ }, [createVNode("div", {
6468
+ "class": controlContainerClasses.value
6469
+ }, [createVNode(Popover, {
6470
+ "is-open": showPopover.value,
6471
+ "trigger": "manually",
6472
+ "content": errorMessage.value,
6473
+ "pop-type": "error",
6474
+ "position": popPosition.value
6475
+ }, {
6476
+ default: () => {
6477
+ var _a, _b;
6478
+ return [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)];
6479
+ }
6480
+ }), showFeedback.value && createVNode("span", {
6481
+ "class": [ns2.e("feedback-icon"), ns2.em("feedback-icon", feedbackStatus.value)]
6482
+ }, [feedbackStatus.value === "error" && createVNode(ErrorIcon, null, null), feedbackStatus.value === "success" && createVNode(SuccessIcon, null, null), feedbackStatus.value === "pending" && createVNode(PendingIcon, null, null)])]), createVNode("div", {
6483
+ "class": ns2.e("control-info")
6484
+ }, [showMessage.value && createVNode("div", {
6485
+ "class": "error-message"
6486
+ }, [errorMessage.value]), props.extraInfo && createVNode("div", {
6487
+ "class": ns2.e("control-extra")
6488
+ }, [props.extraInfo])])]);
6489
+ }
6490
+ });
6336
6491
  function _extends() {
6337
6492
  _extends = Object.assign || function(target) {
6338
6493
  for (var i = 1; i < arguments.length; i++) {
@@ -7335,6 +7490,16 @@ Schema.register = function register(type4, validator) {
7335
7490
  Schema.warning = warning;
7336
7491
  Schema.messages = messages;
7337
7492
  Schema.validators = validators;
7493
+ function getFieldValue(obj, path) {
7494
+ return {
7495
+ get value() {
7496
+ return lodash.exports.get(obj, path);
7497
+ },
7498
+ set value(val) {
7499
+ lodash.exports.set(obj, path, val);
7500
+ }
7501
+ };
7502
+ }
7338
7503
  function useFormItem(messageType, _rules, validateState) {
7339
7504
  const formContext = inject(FORM_TOKEN);
7340
7505
  const ns2 = useNamespace("form");
@@ -7373,17 +7538,12 @@ function useFormItemValidate(props, _rules) {
7373
7538
  const computedField = computed(() => {
7374
7539
  return typeof props.field === "string" ? props.field : "";
7375
7540
  });
7376
- const fieldValue = computed({
7377
- get: () => {
7378
- const formData = formContext.data;
7379
- if (!formData || !props.field) {
7380
- return;
7381
- }
7382
- return formData[props.field];
7383
- },
7384
- set: (val) => {
7385
- formContext.data[props.field] = val;
7541
+ const fieldValue = computed(() => {
7542
+ const formData = formContext.data;
7543
+ if (!formData || !props.field) {
7544
+ return;
7386
7545
  }
7546
+ return getFieldValue(formData, props.field).value;
7387
7547
  });
7388
7548
  const getRuleByTrigger = (triggerVal) => {
7389
7549
  return _rules.value.filter((rule) => {
@@ -7396,7 +7556,7 @@ function useFormItemValidate(props, _rules) {
7396
7556
  return rule.trigger === triggerVal;
7397
7557
  }
7398
7558
  }).map((_a) => {
7399
- var _b = _a, { trigger } = _b, rule = __objRest(_b, ["trigger"]);
7559
+ var rule = __objRest(_a, []);
7400
7560
  return rule;
7401
7561
  });
7402
7562
  };
@@ -7452,13 +7612,16 @@ function useFormItemValidate(props, _rules) {
7452
7612
  if (!formContext.data || !props.field) {
7453
7613
  return;
7454
7614
  }
7455
- isResetting = true;
7456
- fieldValue.value = initFieldValue;
7615
+ const currentValue = getFieldValue(formContext.data, props.field);
7616
+ if (!lodash.exports.isEqual(currentValue.value, initFieldValue)) {
7617
+ isResetting = true;
7618
+ }
7619
+ currentValue.value = initFieldValue;
7457
7620
  await nextTick();
7458
7621
  clearValidate();
7459
7622
  };
7460
7623
  onMounted(() => {
7461
- initFieldValue = lodash.exports.cloneDeep(formContext.data[props.field]);
7624
+ initFieldValue = lodash.exports.clone(fieldValue.value);
7462
7625
  });
7463
7626
  return { validateState, validateMessage, validate, resetField, clearValidate };
7464
7627
  }
@@ -7477,6 +7640,12 @@ var FormItem = defineComponent({
7477
7640
  "popPosition",
7478
7641
  "showFeedback"
7479
7642
  ]);
7643
+ const {
7644
+ label,
7645
+ helpTips,
7646
+ feedbackStatus,
7647
+ extraInfo
7648
+ } = toRefs(props);
7480
7649
  const showFeedback = computed(() => (itemShowFeedback == null ? void 0 : itemShowFeedback.value) !== void 0 ? itemShowFeedback.value : formContext.showFeedback);
7481
7650
  const messageType = computed(() => (itemMessageType == null ? void 0 : itemMessageType.value) || formContext.messageType);
7482
7651
  const popPosition = computed(() => (itemPopPosition == null ? void 0 : itemPopPosition.value) || formContext.popPosition);
@@ -7494,6 +7663,12 @@ var FormItem = defineComponent({
7494
7663
  itemClasses,
7495
7664
  isRequired
7496
7665
  } = useFormItem(messageType, _rules, validateState);
7666
+ const labelData = computed(() => ({
7667
+ layout: formContext.layout,
7668
+ labelSize: formContext.labelSize,
7669
+ labelAlign: formContext.labelAlign
7670
+ }));
7671
+ provide(LABEL_DATA, labelData);
7497
7672
  const context = reactive(__spreadProps(__spreadValues({}, otherProps), {
7498
7673
  showFeedback,
7499
7674
  messageType,
@@ -7518,95 +7693,21 @@ var FormItem = defineComponent({
7518
7693
  onBeforeUnmount(() => {
7519
7694
  formContext == null ? void 0 : formContext.removeItemContext(context);
7520
7695
  });
7521
- return () => {
7522
- var _a2, _b;
7523
- return createVNode("div", {
7524
- "class": itemClasses.value
7525
- }, [(_b = (_a2 = ctx.slots).default) == null ? void 0 : _b.call(_a2)]);
7526
- };
7527
- }
7528
- });
7529
- const formControlProps = {
7530
- feedbackStatus: {
7531
- type: String
7532
- },
7533
- extraInfo: {
7534
- type: String,
7535
- default: ""
7536
- }
7537
- };
7538
- function useFormControl(props) {
7539
- const formContext = inject(FORM_TOKEN);
7540
- const ns2 = useNamespace("form");
7541
- const { feedbackStatus } = toRefs(props);
7542
- const controlClasses = computed(() => ({
7543
- [ns2.e("control")]: true,
7544
- [ns2.em("control", "horizontal")]: formContext.layout === "horizontal"
7545
- }));
7546
- const controlContainerClasses = computed(() => ({
7547
- [ns2.e("control-container")]: true,
7548
- [ns2.em("control-container", "horizontal")]: formContext.layout === "horizontal",
7549
- [ns2.em("control-container", "has-feedback")]: Boolean(feedbackStatus == null ? void 0 : feedbackStatus.value),
7550
- [ns2.em("control-container", "feedback-error")]: Boolean((feedbackStatus == null ? void 0 : feedbackStatus.value) === "error")
7551
- }));
7552
- return { controlClasses, controlContainerClasses };
7553
- }
7554
- function useFormControlValidate() {
7555
- const formItemContext = inject(FORM_ITEM_TOKEN);
7556
- const feedbackStatus = computed(() => formItemContext.validateState);
7557
- const showFeedback = computed(() => formItemContext.showFeedback && Boolean(formItemContext.validateState));
7558
- const showPopover = computed(() => formItemContext.messageType === "popover" && formItemContext.validateState === "error");
7559
- const showMessage = computed(() => formItemContext.messageType === "text" && formItemContext.validateState === "error");
7560
- const errorMessage = computed(() => formItemContext.validateMessage);
7561
- const popPosition = computed(() => formItemContext.popPosition);
7562
- return { feedbackStatus, showFeedback, showPopover, showMessage, errorMessage, popPosition };
7563
- }
7564
- var formControl = "";
7565
- var FormControl = defineComponent({
7566
- name: "DFormControl",
7567
- props: formControlProps,
7568
- setup(props, ctx) {
7569
- const formControl2 = ref();
7570
- const ns2 = useNamespace("form");
7571
- const {
7572
- controlClasses,
7573
- controlContainerClasses
7574
- } = useFormControl(props);
7575
- const {
7576
- feedbackStatus,
7577
- showFeedback,
7578
- showPopover,
7579
- showMessage,
7580
- errorMessage,
7581
- popPosition
7582
- } = useFormControlValidate();
7583
7696
  return () => createVNode("div", {
7584
- "class": controlClasses.value,
7585
- "ref": formControl2
7586
- }, [createVNode("div", {
7587
- "class": controlContainerClasses.value
7588
- }, [createVNode(Popover, {
7589
- "is-open": showPopover.value,
7590
- "trigger": "manually",
7591
- "content": errorMessage.value,
7592
- "pop-type": "error",
7593
- "position": popPosition.value
7697
+ "class": itemClasses.value
7698
+ }, [createVNode(FormLabel, {
7699
+ "help-tips": helpTips.value
7594
7700
  }, {
7595
- reference: () => {
7596
- var _a, _b;
7597
- return createVNode("div", {
7598
- "class": ns2.e("control-content")
7599
- }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
7701
+ default: () => [label == null ? void 0 : label.value]
7702
+ }), createVNode(FormControl, {
7703
+ "feedback-status": feedbackStatus == null ? void 0 : feedbackStatus.value,
7704
+ "extra-info": extraInfo.value
7705
+ }, {
7706
+ default: () => {
7707
+ var _a2, _b;
7708
+ return [(_b = (_a2 = ctx.slots).default) == null ? void 0 : _b.call(_a2)];
7600
7709
  }
7601
- }), showFeedback.value && createVNode("span", {
7602
- "class": [ns2.e("feedback-icon"), ns2.em("feedback-icon", feedbackStatus.value)]
7603
- }, [feedbackStatus.value === "error" && createVNode(ErrorIcon, null, null), feedbackStatus.value === "success" && createVNode(SuccessIcon, null, null), feedbackStatus.value === "pending" && createVNode(PendingIcon, null, null)])]), createVNode("div", {
7604
- "class": ns2.e("control-info")
7605
- }, [showMessage.value && createVNode("div", {
7606
- "class": "error-message"
7607
- }, [errorMessage.value]), props.extraInfo && createVNode("div", {
7608
- "class": ns2.e("control-extra")
7609
- }, [props.extraInfo])])]);
7710
+ })]);
7610
7711
  }
7611
7712
  });
7612
7713
  var formOperation = "";
@@ -7637,10 +7738,8 @@ var index = {
7637
7738
  status: "75%",
7638
7739
  install(app) {
7639
7740
  app.component(Form.name, Form);
7640
- app.component(FormLabel.name, FormLabel);
7641
7741
  app.component(FormItem.name, FormItem);
7642
- app.component(FormControl.name, FormControl);
7643
7742
  app.component(FormOperation.name, FormOperation);
7644
7743
  }
7645
7744
  };
7646
- export { FORM_ITEM_TOKEN, FORM_TOKEN, Form, FormControl, FormItem, FormLabel, FormOperation, index as default, formControlProps, formItemProps, formProps };
7745
+ export { FORM_ITEM_TOKEN, FORM_TOKEN, Form, FormItem, FormOperation, LABEL_DATA, index as default, formItemProps, formProps };