vue-devui 1.0.0-rc.13 → 1.0.0-rc.16

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 (114) hide show
  1. package/README.md +161 -156
  2. package/alert/index.umd.js +1 -1
  3. package/auto-complete/index.es.js +241 -82
  4. package/auto-complete/index.umd.js +28 -17
  5. package/auto-complete/style.css +1 -1
  6. package/avatar/index.umd.js +1 -1
  7. package/badge/index.umd.js +1 -1
  8. package/button/index.es.js +21 -42
  9. package/button/index.umd.js +9 -9
  10. package/card/index.umd.js +1 -1
  11. package/checkbox/index.es.js +94 -77
  12. package/checkbox/index.umd.js +26 -15
  13. package/collapse/index.es.js +3 -21
  14. package/collapse/index.umd.js +1 -1
  15. package/countdown/index.umd.js +1 -1
  16. package/date-picker-pro/index.es.js +1384 -220
  17. package/date-picker-pro/index.umd.js +25 -14
  18. package/date-picker-pro/style.css +1 -1
  19. package/drawer/index.es.js +4 -17
  20. package/drawer/index.umd.js +1 -1
  21. package/dropdown/index.es.js +4 -22
  22. package/dropdown/index.umd.js +1 -1
  23. package/editable-select/index.es.js +254 -99
  24. package/editable-select/index.umd.js +1 -1
  25. package/editable-select/style.css +1 -1
  26. package/form/index.es.js +85 -71
  27. package/form/index.umd.js +22 -11
  28. package/fullscreen/index.umd.js +1 -1
  29. package/grid/index.es.js +7 -20
  30. package/grid/index.umd.js +1 -1
  31. package/icon/index.umd.js +1 -1
  32. package/image-preview/index.es.js +12 -23
  33. package/image-preview/index.umd.js +1 -1
  34. package/image-preview/style.css +1 -1
  35. package/input/index.es.js +239 -75
  36. package/input/index.umd.js +27 -16
  37. package/input-number/index.es.js +1 -16
  38. package/input-number/index.umd.js +1 -1
  39. package/layout/index.es.js +1 -1
  40. package/layout/index.umd.js +1 -1
  41. package/loading/index.es.js +15 -38
  42. package/loading/index.umd.js +1 -1
  43. package/message/index.d.ts +7 -0
  44. package/message/index.es.js +534 -0
  45. package/message/index.umd.js +1 -0
  46. package/message/package.json +7 -0
  47. package/message/style.css +1 -0
  48. package/modal/index.es.js +11 -43
  49. package/modal/index.umd.js +1 -1
  50. package/notification/index.es.js +16 -22
  51. package/notification/index.umd.js +1 -1
  52. package/nuxt/components/Message.js +3 -0
  53. package/nuxt/components/animationInjectionKey.js +3 -0
  54. package/nuxt/components/messageProps.js +3 -0
  55. package/nuxt/components/roundInjectionKey.js +3 -0
  56. package/nuxt/components/skeletonItemProps.js +3 -0
  57. package/overlay/index.es.js +1 -1
  58. package/overlay/index.umd.js +1 -1
  59. package/package.json +4 -2
  60. package/pagination/index.es.js +152 -2
  61. package/pagination/index.umd.js +1 -1
  62. package/panel/index.umd.js +1 -1
  63. package/popover/index.es.js +1 -1
  64. package/popover/index.umd.js +4 -4
  65. package/progress/index.umd.js +3 -3
  66. package/radio/index.es.js +91 -75
  67. package/radio/index.umd.js +28 -17
  68. package/radio/style.css +1 -1
  69. package/rate/index.umd.js +1 -1
  70. package/result/index.umd.js +1 -1
  71. package/ripple/index.es.js +5 -18
  72. package/ripple/index.umd.js +1 -1
  73. package/search/index.es.js +255 -78
  74. package/search/index.umd.js +27 -16
  75. package/search/style.css +1 -1
  76. package/select/index.es.js +283 -114
  77. package/select/index.umd.js +27 -16
  78. package/select/style.css +1 -1
  79. package/skeleton/index.es.js +87 -261
  80. package/skeleton/index.umd.js +1 -1
  81. package/skeleton/style.css +1 -1
  82. package/slider/index.umd.js +1 -1
  83. package/splitter/index.es.js +175 -32
  84. package/splitter/index.umd.js +13 -13
  85. package/statistic/index.es.js +0 -21
  86. package/statistic/index.umd.js +1 -1
  87. package/status/index.umd.js +1 -1
  88. package/steps/index.umd.js +1 -1
  89. package/style.css +1 -1
  90. package/switch/index.es.js +85 -71
  91. package/switch/index.umd.js +25 -14
  92. package/table/index.es.js +309 -96
  93. package/table/index.umd.js +25 -14
  94. package/table/style.css +1 -1
  95. package/tabs/index.umd.js +1 -1
  96. package/tag/index.umd.js +1 -1
  97. package/textarea/index.es.js +88 -72
  98. package/textarea/index.umd.js +26 -15
  99. package/time-picker/index.es.js +248 -89
  100. package/time-picker/index.umd.js +25 -14
  101. package/time-select/index.es.js +283 -114
  102. package/time-select/index.umd.js +26 -15
  103. package/time-select/style.css +1 -1
  104. package/timeline/index.umd.js +1 -1
  105. package/tooltip/index.es.js +1 -1
  106. package/tooltip/index.umd.js +4 -4
  107. package/tree/index.es.js +422 -110
  108. package/tree/index.umd.js +25 -14
  109. package/tree/style.css +1 -1
  110. package/upload/index.es.js +168 -49
  111. package/upload/index.umd.js +1 -1
  112. package/vue-devui.es.js +13601 -13023
  113. package/vue-devui.umd.js +32 -21
  114. package/LICENSE +0 -23
@@ -1,39 +1,4 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
- var __publicField = (obj, key, value) => {
33
- __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
34
- return value;
35
- };
36
- import { defineComponent, watch, provide, reactive, toRefs, createVNode, onUnmounted, Transition, mergeProps, ref, unref, nextTick, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, computed, onMounted, Teleport, createTextVNode, onBeforeUnmount, shallowRef, resolveDynamicComponent, getCurrentInstance, onBeforeMount, render, resolveDirective, toRef, isVNode, renderSlot, useSlots } from "vue";
1
+ import { defineComponent, watch, provide, reactive, toRefs, createVNode, onUnmounted, Transition, mergeProps, ref, nextTick, unref, Comment, Text, Fragment, h, inject, withDirectives, cloneVNode, computed, onMounted, Teleport, createTextVNode, onBeforeUnmount, shallowRef, resolveDynamicComponent, getCurrentInstance, onBeforeMount, isVNode, onUpdated, toRaw, watchEffect, render, resolveDirective, toRef, renderSlot, useSlots } from "vue";
37
2
  import { onClickOutside } from "@vueuse/core";
38
3
  import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
39
4
  const datePickerProCommonProps = {
@@ -53,7 +18,8 @@ const datePickerProCommonProps = {
53
18
  default: false
54
19
  },
55
20
  calendarRange: {
56
- type: Array
21
+ type: Array,
22
+ default: [1970, 2099]
57
23
  },
58
24
  limitDateRange: {
59
25
  type: Array
@@ -63,7 +29,7 @@ const datePickerProCommonProps = {
63
29
  default: "date"
64
30
  }
65
31
  };
66
- const datePickerProProps = __spreadValues({
32
+ const datePickerProProps = {
67
33
  modelValue: {
68
34
  type: [Date, String],
69
35
  default: ""
@@ -71,9 +37,10 @@ const datePickerProProps = __spreadValues({
71
37
  placeholder: {
72
38
  type: String,
73
39
  default: ""
74
- }
75
- }, datePickerProCommonProps);
76
- const datePickerProPanelProps = __spreadValues({
40
+ },
41
+ ...datePickerProCommonProps
42
+ };
43
+ const datePickerProPanelProps = {
77
44
  visible: {
78
45
  type: Boolean,
79
46
  default: false
@@ -88,8 +55,9 @@ const datePickerProPanelProps = __spreadValues({
88
55
  focusType: {
89
56
  type: String,
90
57
  default: "start"
91
- }
92
- }, datePickerProCommonProps);
58
+ },
59
+ ...datePickerProCommonProps
60
+ };
93
61
  const timerPickerPanelProps = {
94
62
  visible: {
95
63
  type: Boolean,
@@ -122,7 +90,7 @@ var dayjs_min = { exports: {} };
122
90
  }, p: function(t2) {
123
91
  return { M: f, y: c, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: h2 }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
124
92
  }, u: function(t2) {
125
- return t2 === void 0;
93
+ return void 0 === t2;
126
94
  } }, v = "en", D = {};
127
95
  D[v] = M;
128
96
  var p = function(t2) {
@@ -131,7 +99,7 @@ var dayjs_min = { exports: {} };
131
99
  var i2;
132
100
  if (!e2)
133
101
  return v;
134
- if (typeof e2 == "string") {
102
+ if ("string" == typeof e2) {
135
103
  var s2 = e2.toLowerCase();
136
104
  D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
137
105
  var u2 = e2.split("-");
@@ -145,7 +113,7 @@ var dayjs_min = { exports: {} };
145
113
  }, w = function(t2, e2) {
146
114
  if (p(t2))
147
115
  return t2.clone();
148
- var n2 = typeof e2 == "object" ? e2 : {};
116
+ var n2 = "object" == typeof e2 ? e2 : {};
149
117
  return n2.date = t2, n2.args = arguments, new _(n2);
150
118
  }, O = g;
151
119
  O.l = S, O.i = p, O.w = function(t2, e2) {
@@ -159,13 +127,13 @@ var dayjs_min = { exports: {} };
159
127
  return m2.parse = function(t2) {
160
128
  this.$d = function(t3) {
161
129
  var e2 = t3.date, n2 = t3.utc;
162
- if (e2 === null)
130
+ if (null === e2)
163
131
  return new Date(NaN);
164
132
  if (O.u(e2))
165
133
  return new Date();
166
134
  if (e2 instanceof Date)
167
135
  return new Date(e2);
168
- if (typeof e2 == "string" && !/Z$/i.test(e2)) {
136
+ if ("string" == typeof e2 && !/Z$/i.test(e2)) {
169
137
  var r2 = e2.match(l);
170
138
  if (r2) {
171
139
  var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
@@ -1122,7 +1090,7 @@ var lodash = { exports: {} };
1122
1090
  var objectCtorString = funcToString.call(Object2);
1123
1091
  var oldDash = root._;
1124
1092
  var reIsNative = RegExp2("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
1125
- 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;
1093
+ var Buffer = moduleExports ? context.Buffer : undefined$1, Symbol2 = context.Symbol, Uint8Array = context.Uint8Array, allocUnsafe = Buffer ? Buffer.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;
1126
1094
  var defineProperty = function() {
1127
1095
  try {
1128
1096
  var func = getNative(Object2, "defineProperty");
@@ -1132,11 +1100,11 @@ var lodash = { exports: {} };
1132
1100
  }
1133
1101
  }();
1134
1102
  var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
1135
- var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
1136
- var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
1137
- var metaMap = WeakMap2 && new WeakMap2();
1103
+ var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined$1, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse;
1104
+ var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create");
1105
+ var metaMap = WeakMap && new WeakMap();
1138
1106
  var realNames = {};
1139
- var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2);
1107
+ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap);
1140
1108
  var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1;
1141
1109
  function lodash2(value) {
1142
1110
  if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
@@ -2371,7 +2339,7 @@ var lodash = { exports: {} };
2371
2339
  end = end === undefined$1 ? length : end;
2372
2340
  return !start && end >= length ? array4 : baseSlice(array4, start, end);
2373
2341
  }
2374
- var clearTimeout = ctxClearTimeout || function(id) {
2342
+ var clearTimeout2 = ctxClearTimeout || function(id) {
2375
2343
  return root.clearTimeout(id);
2376
2344
  };
2377
2345
  function cloneBuffer(buffer, isDeep) {
@@ -2384,7 +2352,7 @@ var lodash = { exports: {} };
2384
2352
  }
2385
2353
  function cloneArrayBuffer(arrayBuffer) {
2386
2354
  var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
2387
- new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer));
2355
+ new Uint8Array(result2).set(new Uint8Array(arrayBuffer));
2388
2356
  return result2;
2389
2357
  }
2390
2358
  function cloneDataView(dataView, isDeep) {
@@ -2966,7 +2934,7 @@ var lodash = { exports: {} };
2966
2934
  object4 = object4.buffer;
2967
2935
  other = other.buffer;
2968
2936
  case arrayBufferTag:
2969
- if (object4.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object4), new Uint8Array2(other))) {
2937
+ if (object4.byteLength != other.byteLength || !equalFunc(new Uint8Array(object4), new Uint8Array(other))) {
2970
2938
  return false;
2971
2939
  }
2972
2940
  return true;
@@ -3128,7 +3096,7 @@ var lodash = { exports: {} };
3128
3096
  return result2;
3129
3097
  };
3130
3098
  var getTag = baseGetTag;
3131
- if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) {
3099
+ if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
3132
3100
  getTag = function(value) {
3133
3101
  var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : "";
3134
3102
  if (ctorString) {
@@ -4220,7 +4188,7 @@ var lodash = { exports: {} };
4220
4188
  }
4221
4189
  function cancel() {
4222
4190
  if (timerId !== undefined$1) {
4223
- clearTimeout(timerId);
4191
+ clearTimeout2(timerId);
4224
4192
  }
4225
4193
  lastInvokeTime = 0;
4226
4194
  lastArgs = lastCallTime = lastThis = timerId = undefined$1;
@@ -4238,7 +4206,7 @@ var lodash = { exports: {} };
4238
4206
  return leadingEdge(lastCallTime);
4239
4207
  }
4240
4208
  if (maxing) {
4241
- clearTimeout(timerId);
4209
+ clearTimeout2(timerId);
4242
4210
  timerId = setTimeout2(timerExpired, wait);
4243
4211
  return invokeFunc(lastCallTime);
4244
4212
  }
@@ -5845,7 +5813,10 @@ function useFormValidation(itemContexts) {
5845
5813
  try {
5846
5814
  await field.validate("");
5847
5815
  } catch (err) {
5848
- errors = __spreadValues(__spreadValues({}, errors), err);
5816
+ errors = {
5817
+ ...errors,
5818
+ ...err
5819
+ };
5849
5820
  }
5850
5821
  }
5851
5822
  if (!Object.keys(errors).length) {
@@ -5902,11 +5873,12 @@ defineComponent({
5902
5873
  }, {
5903
5874
  deep: true
5904
5875
  });
5905
- provide(FORM_TOKEN, reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
5876
+ provide(FORM_TOKEN, reactive({
5877
+ ...toRefs(props),
5906
5878
  emit: ctx.emit,
5907
5879
  addItemContext,
5908
5880
  removeItemContext
5909
- })));
5881
+ }));
5910
5882
  ctx.expose({
5911
5883
  validate,
5912
5884
  validateFields,
@@ -6783,7 +6755,7 @@ var FormControl = defineComponent({
6783
6755
  }
6784
6756
  });
6785
6757
  function _extends() {
6786
- _extends = Object.assign || function(target) {
6758
+ _extends = Object.assign ? Object.assign.bind() : function(target) {
6787
6759
  for (var i = 1; i < arguments.length; i++) {
6788
6760
  var source = arguments[i];
6789
6761
  for (var key in source) {
@@ -6802,13 +6774,13 @@ function _inheritsLoose(subClass, superClass) {
6802
6774
  _setPrototypeOf(subClass, superClass);
6803
6775
  }
6804
6776
  function _getPrototypeOf(o) {
6805
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
6777
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf2(o2) {
6806
6778
  return o2.__proto__ || Object.getPrototypeOf(o2);
6807
6779
  };
6808
6780
  return _getPrototypeOf(o);
6809
6781
  }
6810
6782
  function _setPrototypeOf(o, p) {
6811
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
6783
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf2(o2, p2) {
6812
6784
  o2.__proto__ = p2;
6813
6785
  return o2;
6814
6786
  };
@@ -6831,7 +6803,7 @@ function _isNativeReflectConstruct() {
6831
6803
  }
6832
6804
  function _construct(Parent, args, Class) {
6833
6805
  if (_isNativeReflectConstruct()) {
6834
- _construct = Reflect.construct;
6806
+ _construct = Reflect.construct.bind();
6835
6807
  } else {
6836
6808
  _construct = function _construct2(Parent2, args2, Class2) {
6837
6809
  var a = [null];
@@ -7109,9 +7081,45 @@ var whitespace = function whitespace2(rule, value, source, errors, options) {
7109
7081
  errors.push(format(options.messages.whitespace, rule.fullField));
7110
7082
  }
7111
7083
  };
7084
+ var urlReg;
7085
+ var getUrlRegex = function() {
7086
+ if (urlReg) {
7087
+ return urlReg;
7088
+ }
7089
+ var word = "[a-fA-F\\d:]";
7090
+ var b = function b2(options) {
7091
+ return options && options.includeBoundaries ? "(?:(?<=\\s|^)(?=" + word + ")|(?<=" + word + ")(?=\\s|$))" : "";
7092
+ };
7093
+ var v4 = "(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}";
7094
+ var v6seg = "[a-fA-F\\d]{1,4}";
7095
+ var v6 = ("\n(?:\n(?:" + v6seg + ":){7}(?:" + v6seg + "|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:" + v6seg + ":){6}(?:" + v4 + "|:" + v6seg + "|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:" + v6seg + ":){5}(?::" + v4 + "|(?::" + v6seg + "){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:" + v6seg + ":){4}(?:(?::" + v6seg + "){0,1}:" + v4 + "|(?::" + v6seg + "){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:" + v6seg + ":){3}(?:(?::" + v6seg + "){0,2}:" + v4 + "|(?::" + v6seg + "){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:" + v6seg + ":){2}(?:(?::" + v6seg + "){0,3}:" + v4 + "|(?::" + v6seg + "){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:" + v6seg + ":){1}(?:(?::" + v6seg + "){0,4}:" + v4 + "|(?::" + v6seg + "){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::" + v6seg + "){0,5}:" + v4 + "|(?::" + v6seg + "){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm, "").replace(/\n/g, "").trim();
7096
+ var v46Exact = new RegExp("(?:^" + v4 + "$)|(?:^" + v6 + "$)");
7097
+ var v4exact = new RegExp("^" + v4 + "$");
7098
+ var v6exact = new RegExp("^" + v6 + "$");
7099
+ var ip = function ip2(options) {
7100
+ return options && options.exact ? v46Exact : new RegExp("(?:" + b(options) + v4 + b(options) + ")|(?:" + b(options) + v6 + b(options) + ")", "g");
7101
+ };
7102
+ ip.v4 = function(options) {
7103
+ return options && options.exact ? v4exact : new RegExp("" + b(options) + v4 + b(options), "g");
7104
+ };
7105
+ ip.v6 = function(options) {
7106
+ return options && options.exact ? v6exact : new RegExp("" + b(options) + v6 + b(options), "g");
7107
+ };
7108
+ var protocol = "(?:(?:[a-z]+:)?//)";
7109
+ var auth = "(?:\\S+(?::\\S*)?@)?";
7110
+ var ipv4 = ip.v4().source;
7111
+ var ipv6 = ip.v6().source;
7112
+ var host = "(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)";
7113
+ var domain = "(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*";
7114
+ var tld = "(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";
7115
+ var port = "(?::\\d{2,5})?";
7116
+ var path = '(?:[/?#][^\\s"]*)?';
7117
+ var regex = "(?:" + protocol + "|www\\.)" + auth + "(?:localhost|" + ipv4 + "|" + ipv6 + "|" + host + domain + tld + ")" + port + path;
7118
+ urlReg = new RegExp("(?:^" + regex + "$)", "i");
7119
+ return urlReg;
7120
+ };
7112
7121
  var pattern$2 = {
7113
7122
  email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
7114
- url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", "i"),
7115
7123
  hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
7116
7124
  };
7117
7125
  var types = {
@@ -7153,7 +7161,7 @@ var types = {
7153
7161
  return typeof value === "string" && value.length <= 320 && !!value.match(pattern$2.email);
7154
7162
  },
7155
7163
  url: function url(value) {
7156
- return typeof value === "string" && value.length <= 2048 && !!value.match(pattern$2.url);
7164
+ return typeof value === "string" && value.length <= 2048 && !!value.match(getUrlRegex());
7157
7165
  },
7158
7166
  hex: function hex(value) {
7159
7167
  return typeof value === "string" && !!value.match(pattern$2.hex);
@@ -7728,7 +7736,17 @@ var Schema = /* @__PURE__ */ function() {
7728
7736
  if (rule.asyncValidator) {
7729
7737
  res = rule.asyncValidator(rule, data.value, cb, data.source, options);
7730
7738
  } else if (rule.validator) {
7731
- res = rule.validator(rule, data.value, cb, data.source, options);
7739
+ try {
7740
+ res = rule.validator(rule, data.value, cb, data.source, options);
7741
+ } catch (error) {
7742
+ console.error == null ? void 0 : console.error(error);
7743
+ if (!options.suppressValidatorError) {
7744
+ setTimeout(function() {
7745
+ throw error;
7746
+ }, 0);
7747
+ }
7748
+ cb(error.message);
7749
+ }
7732
7750
  if (res === true) {
7733
7751
  cb();
7734
7752
  } else if (res === false) {
@@ -7849,10 +7867,7 @@ function useFormItemValidate(props, _rules) {
7849
7867
  } else {
7850
7868
  return rule.trigger === triggerVal;
7851
7869
  }
7852
- }).map((_a) => {
7853
- var rule = __objRest(_a, []);
7854
- return rule;
7855
- });
7870
+ }).map(({ ...rule }) => rule);
7856
7871
  };
7857
7872
  const onValidateSuccess = () => {
7858
7873
  validateState.value = "success";
@@ -7925,15 +7940,12 @@ defineComponent({
7925
7940
  props: formItemProps,
7926
7941
  setup(props, ctx) {
7927
7942
  const formContext = inject(FORM_TOKEN);
7928
- const _a = toRefs(props), {
7943
+ const {
7929
7944
  messageType: itemMessageType,
7930
7945
  popPosition: itemPopPosition,
7931
- showFeedback: itemShowFeedback
7932
- } = _a, otherProps = __objRest(_a, [
7933
- "messageType",
7934
- "popPosition",
7935
- "showFeedback"
7936
- ]);
7946
+ showFeedback: itemShowFeedback,
7947
+ ...otherProps
7948
+ } = toRefs(props);
7937
7949
  const {
7938
7950
  label,
7939
7951
  helpTips,
@@ -7963,7 +7975,8 @@ defineComponent({
7963
7975
  labelAlign: formContext.labelAlign
7964
7976
  }));
7965
7977
  provide(LABEL_DATA, labelData);
7966
- const context = reactive(__spreadProps(__spreadValues({}, otherProps), {
7978
+ const context = reactive({
7979
+ ...otherProps,
7967
7980
  showFeedback,
7968
7981
  messageType,
7969
7982
  popPosition,
@@ -7973,7 +7986,7 @@ defineComponent({
7973
7986
  validate,
7974
7987
  resetField,
7975
7988
  clearValidate
7976
- }));
7989
+ });
7977
7990
  provide(FORM_ITEM_TOKEN, context);
7978
7991
  ctx.expose({
7979
7992
  resetField,
@@ -7998,8 +8011,8 @@ defineComponent({
7998
8011
  "extra-info": extraInfo.value
7999
8012
  }, {
8000
8013
  default: () => {
8001
- var _a2, _b;
8002
- return [(_b = (_a2 = ctx.slots).default) == null ? void 0 : _b.call(_a2)];
8014
+ var _a, _b;
8015
+ return [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)];
8003
8016
  }
8004
8017
  })]);
8005
8018
  }
@@ -8343,7 +8356,7 @@ function useInputRender(props, ctx) {
8343
8356
  const slots = ctx.slots;
8344
8357
  const inputDisabled = computed(() => disabled.value || (formContext == null ? void 0 : formContext.disabled));
8345
8358
  const inputSize = computed(() => (size == null ? void 0 : size.value) || (formContext == null ? void 0 : formContext.size) || "");
8346
- const _a = ctx.attrs, { style, class: customClass } = _a, otherAttrs = __objRest(_a, ["style", "class"]);
8359
+ const { style, class: customClass, ...otherAttrs } = ctx.attrs;
8347
8360
  const customStyle = { style };
8348
8361
  const wrapClasses = computed(() => ({
8349
8362
  [ns2.e("wrapper")]: true,
@@ -8411,6 +8424,155 @@ function useInputFunction(input2) {
8411
8424
  return { select, focus, blur };
8412
8425
  }
8413
8426
  var input = "";
8427
+ function deepAssign(...objects) {
8428
+ const isObject2 = (obj) => obj && typeof obj === "object";
8429
+ return objects.reduce((prev, from) => {
8430
+ Object.keys(from).forEach((key) => {
8431
+ const pVal = prev[key];
8432
+ const oVal = from[key];
8433
+ if (Array.isArray(pVal) && Array.isArray(oVal)) {
8434
+ prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
8435
+ } else if (isObject2(pVal) && isObject2(oVal)) {
8436
+ prev[key] = deepAssign(pVal, oVal);
8437
+ } else {
8438
+ prev[key] = oVal;
8439
+ }
8440
+ });
8441
+ return prev;
8442
+ }, {});
8443
+ }
8444
+ var zhCN = {
8445
+ pagination: {
8446
+ totalItemText: "\u6240\u6709\u6761\u76EE",
8447
+ goToText: "\u8DF3\u81F3"
8448
+ },
8449
+ accordion: {
8450
+ loading: "\u52A0\u8F7D\u4E2D",
8451
+ noData: "\u6CA1\u6709\u6570\u636E"
8452
+ },
8453
+ autoCompleteDropdown: {
8454
+ latestInput: "\u6700\u8FD1\u8F93\u5165"
8455
+ },
8456
+ cascaderList: {
8457
+ noData: "\u6CA1\u6709\u6570\u636E"
8458
+ },
8459
+ colorPicker: {
8460
+ foundationPanel: "\u57FA\u7840\u9762\u677F",
8461
+ advancedPanel: "\u9AD8\u7EA7\u9762\u677F"
8462
+ },
8463
+ datePickerPro: {
8464
+ ok: "\u786E\u5B9A",
8465
+ placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
8466
+ month1: "1\u6708",
8467
+ month2: "2\u6708",
8468
+ month3: "3\u6708",
8469
+ month4: "4\u6708",
8470
+ month5: "5\u6708",
8471
+ month6: "6\u6708",
8472
+ month7: "7\u6708",
8473
+ month8: "8\u6708",
8474
+ month9: "9\u6708",
8475
+ month10: "10\u6708",
8476
+ month11: "11\u6708",
8477
+ month12: "12\u6708",
8478
+ year: "\u5E74",
8479
+ startPlaceholder: "\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",
8480
+ endPlaceholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",
8481
+ getWeekDays() {
8482
+ return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
8483
+ },
8484
+ getTimeArr() {
8485
+ return ["\u65F6", "\u5206", "\u79D2"];
8486
+ },
8487
+ getYearMonthStr(year, month) {
8488
+ return `${year}\u5E74${month}\u6708`;
8489
+ }
8490
+ },
8491
+ editableSelect: {
8492
+ noRelatedRecords: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
8493
+ noData: "\u6CA1\u6709\u6570\u636E"
8494
+ },
8495
+ input: {
8496
+ placeholder: "\u8BF7\u8F93\u5165"
8497
+ },
8498
+ splitterBar: {
8499
+ collapse: "\u6536\u8D77",
8500
+ expand: "\u5C55\u5F00"
8501
+ },
8502
+ stepsGuide: {
8503
+ previous: "\u4E0A\u4E00\u6B65",
8504
+ continue: "\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",
8505
+ ok: "\u6211\u77E5\u9053\u5566"
8506
+ },
8507
+ table: {
8508
+ selectAll: "\u5168\u9009",
8509
+ ok: "\u786E\u5B9A"
8510
+ },
8511
+ timePopup: {
8512
+ ok: "\u786E\u5B9A"
8513
+ },
8514
+ transfer: {
8515
+ unit: "\u9879",
8516
+ panelUnit: "\u9879",
8517
+ headerUnit: "\u9879",
8518
+ noData: "\u6682\u65E0\u6570\u636E",
8519
+ placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"
8520
+ },
8521
+ tree: {
8522
+ loading: "\u52A0\u8F7D\u4E2D",
8523
+ newNode: "\u65B0\u8282\u70B9",
8524
+ selectPlaceholder: "\u8BF7\u9009\u62E9"
8525
+ },
8526
+ upload: {
8527
+ placeholder: "\u9009\u62E9\u6587\u4EF6",
8528
+ getExistSameNameFilesMsg(sameNames) {
8529
+ return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
8530
+ },
8531
+ getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
8532
+ return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u672C\u6B21\u4E0A\u4F20\u7684\u6240\u6709\u6587\u4EF6\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
8533
+ },
8534
+ getBeyondMaximalFileSizeMsg(filename, maximalSize) {
8535
+ return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
8536
+ },
8537
+ getNotAllowedFileTypeMsg(filename, scope) {
8538
+ return `\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B: "${scope}", \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u4E0D\u5728\u5141\u8BB8\u8303\u56F4\u5185\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
8539
+ }
8540
+ },
8541
+ search: {
8542
+ placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
8543
+ },
8544
+ select: {
8545
+ placeholder: "\u8BF7\u9009\u62E9",
8546
+ noDataText: "\u65E0\u6570\u636E",
8547
+ noMatchText: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
8548
+ loadingText: "\u52A0\u8F7D\u4E2D..."
8549
+ },
8550
+ tagInput: {
8551
+ maxTagsText: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
8552
+ },
8553
+ timeSelect: {
8554
+ placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
8555
+ }
8556
+ };
8557
+ const lang = ref("zh-CN");
8558
+ let langMessages = reactive({
8559
+ [lang.value]: zhCN
8560
+ });
8561
+ const Locale = {
8562
+ messages() {
8563
+ return langMessages[lang.value];
8564
+ },
8565
+ lang() {
8566
+ return lang.value;
8567
+ },
8568
+ use(newLang, newMessages2) {
8569
+ lang.value = newLang;
8570
+ this.add({ [newLang]: newMessages2 });
8571
+ },
8572
+ add(newMessages2 = {}) {
8573
+ langMessages = deepAssign(langMessages, newMessages2);
8574
+ }
8575
+ };
8414
8576
  const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
8415
8577
  function get(object4, path) {
8416
8578
  const keys = path.split(".");
@@ -8424,7 +8586,8 @@ function get(object4, path) {
8424
8586
  function createI18nTranslate(name, app, newPrefix) {
8425
8587
  const prefix = newPrefix || camelize(name) + ".";
8426
8588
  return (path) => {
8427
- const messages2 = app == null ? void 0 : app.appContext.config.globalProperties.langMessages.value;
8589
+ var _a;
8590
+ const messages2 = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
8428
8591
  const message = get(messages2, prefix + path) || get(messages2, path);
8429
8592
  return message;
8430
8593
  };
@@ -8535,8 +8698,12 @@ var Input = defineComponent({
8535
8698
  const DAY_DURATION = 24 * 60 * 60 * 1e3;
8536
8699
  const yearItemHeight = 30;
8537
8700
  const calendarItemHeight = 186;
8538
- const yearCalendarItemHeight = 48;
8701
+ const yearListHeight = 305;
8702
+ const calendarListHeight = 270;
8703
+ const monthPickerHeight = 300;
8539
8704
  const monthCalendarItemHeight = 186;
8705
+ const yearPickerHeight = 186;
8706
+ const yearCalendarItemHeight = 48;
8540
8707
  function useCalendarSelected(props, ctx) {
8541
8708
  const today = ref(new Date());
8542
8709
  const calendarRange = ref([]);
@@ -8742,25 +8909,25 @@ function useCalendarPanel(props, ctx) {
8742
8909
  };
8743
8910
  const goToYearDate = (index2) => {
8744
8911
  updateYearActive(index2);
8745
- let scrollHeight = (index2 - 4) * yearItemHeight;
8746
- if (scrollHeight < 0) {
8747
- scrollHeight = 0;
8912
+ let scrollIndex = index2 - 4;
8913
+ if (scrollIndex < 0) {
8914
+ scrollIndex = 0;
8748
8915
  }
8749
8916
  nextTick(() => {
8750
8917
  var _a;
8751
8918
  const scrollEl = yearScrollRef.value;
8752
- (_a = scrollEl == null ? void 0 : scrollEl.scroll) == null ? void 0 : _a.call(scrollEl, 0, scrollHeight);
8919
+ (_a = scrollEl == null ? void 0 : scrollEl.scrollTo) == null ? void 0 : _a.call(scrollEl, scrollIndex);
8753
8920
  });
8754
8921
  };
8755
8922
  const goToMonthDate = () => {
8756
- let scrollHeight = currentMonthIndex.value * calendarItemHeight;
8757
- if (scrollHeight < 0) {
8758
- scrollHeight = 0;
8923
+ let scrollIndex = currentMonthIndex.value;
8924
+ if (scrollIndex < 0) {
8925
+ scrollIndex = 0;
8759
8926
  }
8760
8927
  nextTick(() => {
8761
8928
  var _a;
8762
8929
  const scrollEl = monthScrollRef.value;
8763
- (_a = scrollEl == null ? void 0 : scrollEl.scroll) == null ? void 0 : _a.call(scrollEl, 0, scrollHeight);
8930
+ (_a = scrollEl == null ? void 0 : scrollEl.scrollTo) == null ? void 0 : _a.call(scrollEl, scrollIndex);
8764
8931
  });
8765
8932
  };
8766
8933
  const goToShowDate = (date4) => {
@@ -8780,12 +8947,10 @@ function useCalendarPanel(props, ctx) {
8780
8947
  };
8781
8948
  onBeforeMount(() => {
8782
8949
  today.value = new Date();
8783
- if (props.calendarRange) {
8784
- calendarRange.value = props.calendarRange;
8785
- } else {
8786
- calendarRange.value = [today.value.getFullYear() - 3, today.value.getFullYear() + 3];
8787
- }
8950
+ calendarRange.value = props.calendarRange;
8788
8951
  initCalendarData();
8952
+ });
8953
+ onMounted(() => {
8789
8954
  initCalendarShow();
8790
8955
  });
8791
8956
  const handlerSetRangeDate = (day) => {
@@ -8835,9 +9000,6 @@ function useCalendarPanel(props, ctx) {
8835
9000
  goToShowDate(date4);
8836
9001
  }
8837
9002
  };
8838
- const handleScrollYearList = (e) => {
8839
- e.currentTarget;
8840
- };
8841
9003
  const debounceScrollMonth = lodash.exports.throttle((newScrollTop) => {
8842
9004
  currentMonthIndex.value = Math.floor(newScrollTop / calendarItemHeight) + (newScrollTop % calendarItemHeight > 100 ? 1 : 0);
8843
9005
  const yearIndex = isListCollapse.value ? Math.floor(currentMonthIndex.value / 12) : currentMonthIndex.value + Math.floor(currentMonthIndex.value / 12) + 1;
@@ -8884,7 +9046,6 @@ function useCalendarPanel(props, ctx) {
8884
9046
  handlerSelectDate,
8885
9047
  handlerYearCollapse,
8886
9048
  handlerClickMonth,
8887
- handleScrollYearList,
8888
9049
  handleScrollMonthList,
8889
9050
  isDateSelected,
8890
9051
  isStartDate,
@@ -8893,6 +9054,979 @@ function useCalendarPanel(props, ctx) {
8893
9054
  isDisabled
8894
9055
  };
8895
9056
  }
9057
+ const virtualListProps = {
9058
+ data: {
9059
+ type: Array,
9060
+ default: () => []
9061
+ },
9062
+ component: {
9063
+ type: String,
9064
+ default: "div"
9065
+ },
9066
+ height: {
9067
+ type: Number,
9068
+ default: 100
9069
+ },
9070
+ itemHeight: {
9071
+ type: Number,
9072
+ default: 0
9073
+ },
9074
+ virtual: {
9075
+ type: Boolean,
9076
+ default: true
9077
+ },
9078
+ fullHeight: {
9079
+ type: Boolean
9080
+ },
9081
+ itemKey: {
9082
+ type: [String, Number, Function]
9083
+ }
9084
+ };
9085
+ const resizeObserverContainerProps = {
9086
+ height: {
9087
+ type: Number
9088
+ },
9089
+ offset: {
9090
+ type: Number || void 0
9091
+ },
9092
+ disabled: {
9093
+ type: Function
9094
+ },
9095
+ onInnerResize: {
9096
+ type: Function
9097
+ }
9098
+ };
9099
+ const scrollBarProps = {
9100
+ scrollTop: {
9101
+ type: Number
9102
+ },
9103
+ scrollHeight: {
9104
+ type: Number
9105
+ },
9106
+ height: {
9107
+ type: Number
9108
+ },
9109
+ count: {
9110
+ type: Number
9111
+ },
9112
+ onScroll: {
9113
+ type: Function
9114
+ },
9115
+ onStartMove: {
9116
+ type: Function
9117
+ },
9118
+ onStopMove: {
9119
+ type: Function
9120
+ }
9121
+ };
9122
+ const resizeObserverProps = {
9123
+ disabled: {
9124
+ type: Boolean
9125
+ },
9126
+ onResize: {
9127
+ type: Function
9128
+ }
9129
+ };
9130
+ function useVirtual(props) {
9131
+ const isVirtual = computed(() => {
9132
+ const {
9133
+ height,
9134
+ virtual
9135
+ } = props;
9136
+ return !!(virtual !== false && height);
9137
+ });
9138
+ const inVirtual = computed(() => {
9139
+ const {
9140
+ height,
9141
+ data
9142
+ } = props;
9143
+ return isVirtual.value && data && 20 * data.length > height;
9144
+ });
9145
+ return {
9146
+ isVirtual,
9147
+ inVirtual
9148
+ };
9149
+ }
9150
+ function useHeights(mergedData, getKey) {
9151
+ const instance = /* @__PURE__ */ new Map();
9152
+ let heights = /* @__PURE__ */ new Map();
9153
+ const updatedMark = ref(Symbol("update"));
9154
+ watch(mergedData, () => {
9155
+ heights = /* @__PURE__ */ new Map();
9156
+ updatedMark.value = Symbol("update");
9157
+ });
9158
+ let heightUpdateId = 0;
9159
+ function collectHeight() {
9160
+ heightUpdateId += 1;
9161
+ const currentId = heightUpdateId;
9162
+ Promise.resolve().then(() => {
9163
+ if (currentId !== heightUpdateId) {
9164
+ return;
9165
+ }
9166
+ instance.forEach((element, key) => {
9167
+ if (element && element.offsetParent) {
9168
+ const {
9169
+ offsetHeight
9170
+ } = element;
9171
+ if (heights.get(key) !== offsetHeight) {
9172
+ updatedMark.value = Symbol("update");
9173
+ heights.set(key, element.offsetHeight);
9174
+ }
9175
+ }
9176
+ });
9177
+ });
9178
+ }
9179
+ function setInstance(item, ins) {
9180
+ const key = getKey(item);
9181
+ if (ins) {
9182
+ instance.set(key, ins.$el || ins);
9183
+ collectHeight();
9184
+ } else {
9185
+ instance.delete(key);
9186
+ }
9187
+ }
9188
+ return [setInstance, collectHeight, heights, updatedMark];
9189
+ }
9190
+ var useOriginScroll = (isScrollAtTop, isScrollAtBottom) => {
9191
+ let lock = false;
9192
+ let lockTimeout = null;
9193
+ function lockScroll2() {
9194
+ if (lockTimeout) {
9195
+ clearTimeout(lockTimeout);
9196
+ }
9197
+ lock = true;
9198
+ lockTimeout = setTimeout(() => {
9199
+ lock = false;
9200
+ }, 50);
9201
+ }
9202
+ return (deltaY, smoothOffset = false) => {
9203
+ const originScroll = deltaY < 0 && isScrollAtTop.value || deltaY > 0 && isScrollAtBottom.value;
9204
+ if (smoothOffset && originScroll) {
9205
+ if (lockTimeout) {
9206
+ clearTimeout(lockTimeout);
9207
+ }
9208
+ lock = false;
9209
+ } else if (!originScroll || lock) {
9210
+ lockScroll2();
9211
+ }
9212
+ return !lock && originScroll;
9213
+ };
9214
+ };
9215
+ const isValid = (value) => {
9216
+ return value !== void 0 && value !== null && value !== "";
9217
+ };
9218
+ const isEmptyElement = (c) => {
9219
+ var _a, _b;
9220
+ return !!c && (c.type === Comment || c.type === Fragment && ((_a = c == null ? void 0 : c.children) == null ? void 0 : _a.length) === 0 || c.type === Text && ((_b = c == null ? void 0 : c.children) == null ? void 0 : _b.trim()) === "");
9221
+ };
9222
+ const flattenChildren = (children, filterEmpty = true) => {
9223
+ const temp = Array.isArray(children) ? children : [children];
9224
+ const res = [];
9225
+ temp.forEach((child) => {
9226
+ if (Array.isArray(child)) {
9227
+ res.push(...flattenChildren(child, filterEmpty));
9228
+ } else if (child && child.type === Fragment) {
9229
+ res.push(...flattenChildren(child.children, filterEmpty));
9230
+ } else if (child && isVNode(child)) {
9231
+ if (filterEmpty && !isEmptyElement(child)) {
9232
+ res.push(child);
9233
+ } else if (!filterEmpty) {
9234
+ res.push(child);
9235
+ }
9236
+ } else if (isValid(child)) {
9237
+ res.push(child);
9238
+ }
9239
+ });
9240
+ return res;
9241
+ };
9242
+ const findDOMNode = (instance) => {
9243
+ var _a;
9244
+ let node = ((_a = instance == null ? void 0 : instance.vnode) == null ? void 0 : _a.el) || instance && ((instance == null ? void 0 : instance.$el) || instance);
9245
+ while (node && !node.tagName) {
9246
+ node = node.nextSibling;
9247
+ }
9248
+ return node;
9249
+ };
9250
+ const isFF = typeof navigator === "object" && /Firefox/i.test(navigator.userAgent);
9251
+ function useFrameWheel(inVirtual, isScrollAtTop, isScrollAtBottom, onWheelDelta) {
9252
+ let offsetRef = 0;
9253
+ let nextFrame = null;
9254
+ let wheelValue = null;
9255
+ let isMouseScroll = false;
9256
+ const originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom);
9257
+ const onRawWheel = (event) => {
9258
+ var _a;
9259
+ if (!inVirtual.value) {
9260
+ return;
9261
+ }
9262
+ if (nextFrame) {
9263
+ window.cancelAnimationFrame(nextFrame);
9264
+ }
9265
+ const {
9266
+ deltaY
9267
+ } = event;
9268
+ offsetRef += deltaY;
9269
+ wheelValue = deltaY;
9270
+ if (originScroll(deltaY, false)) {
9271
+ return;
9272
+ }
9273
+ if (!isFF) {
9274
+ (_a = event == null ? void 0 : event.preventDefault) == null ? void 0 : _a.call(event);
9275
+ }
9276
+ nextFrame = window.requestAnimationFrame(() => {
9277
+ const patchMultiple = isMouseScroll ? 10 : 1;
9278
+ onWheelDelta(offsetRef * patchMultiple);
9279
+ offsetRef = 0;
9280
+ });
9281
+ };
9282
+ const onFireFoxScroll = (event) => {
9283
+ if (!inVirtual.value) {
9284
+ return;
9285
+ }
9286
+ isMouseScroll = event.detail === wheelValue;
9287
+ };
9288
+ return [onRawWheel, onFireFoxScroll];
9289
+ }
9290
+ const SMOOTH_PTG = 14 / 15;
9291
+ function useMobileTouchMove(inVirtual, listRef, callback) {
9292
+ let touched = false;
9293
+ let touchY = 0;
9294
+ let element = null;
9295
+ let interval = null;
9296
+ const onTouchMove = (e) => {
9297
+ if (touched) {
9298
+ const currentY = Math.ceil(e.touches[0].pageY);
9299
+ let offsetY = touchY - currentY;
9300
+ touchY = currentY;
9301
+ if (callback(offsetY)) {
9302
+ e.preventDefault();
9303
+ }
9304
+ if (interval) {
9305
+ clearInterval(interval);
9306
+ }
9307
+ interval = setInterval(() => {
9308
+ offsetY *= SMOOTH_PTG;
9309
+ if (!callback(offsetY, true) || Math.abs(offsetY) <= 0.1) {
9310
+ if (interval) {
9311
+ clearInterval(interval);
9312
+ }
9313
+ }
9314
+ }, 16);
9315
+ }
9316
+ };
9317
+ const cleanUpEvents = () => {
9318
+ if (element) {
9319
+ element.removeEventListener("touchmove", onTouchMove);
9320
+ element.removeEventListener("touchend", () => {
9321
+ touched = false;
9322
+ cleanUpEvents();
9323
+ });
9324
+ }
9325
+ };
9326
+ const onTouchEnd = () => {
9327
+ touched = false;
9328
+ cleanUpEvents();
9329
+ };
9330
+ const onTouchStart = (e) => {
9331
+ cleanUpEvents();
9332
+ if (e.touches.length === 1 && !touched) {
9333
+ touched = true;
9334
+ touchY = Math.ceil(e.touches[0].pageY);
9335
+ element = e.target;
9336
+ element.addEventListener("touchmove", onTouchMove, {
9337
+ passive: false
9338
+ });
9339
+ element.addEventListener("touchend", onTouchEnd);
9340
+ }
9341
+ };
9342
+ onMounted(() => {
9343
+ watch(inVirtual, (val) => {
9344
+ var _a, _b;
9345
+ (_a = listRef.value) == null ? void 0 : _a.removeEventListener("touchstart", onTouchStart);
9346
+ cleanUpEvents();
9347
+ if (interval) {
9348
+ clearInterval(interval);
9349
+ }
9350
+ if (val) {
9351
+ (_b = listRef.value) == null ? void 0 : _b.addEventListener("touchstart", onTouchStart, {
9352
+ passive: false
9353
+ });
9354
+ }
9355
+ }, {
9356
+ immediate: true
9357
+ });
9358
+ });
9359
+ }
9360
+ var ResizeObserver$1 = defineComponent({
9361
+ name: "ResizeObserver",
9362
+ props: resizeObserverProps,
9363
+ emits: ["resize"],
9364
+ setup(props, {
9365
+ slots
9366
+ }) {
9367
+ const state = reactive({
9368
+ width: 0,
9369
+ height: 0,
9370
+ offsetHeight: 0,
9371
+ offsetWidth: 0
9372
+ });
9373
+ const currentElement = ref(null);
9374
+ const resizeObserver = ref(null);
9375
+ const destroyObserver = () => {
9376
+ if (resizeObserver.value) {
9377
+ resizeObserver.value.disconnect();
9378
+ resizeObserver.value = null;
9379
+ }
9380
+ };
9381
+ const onTriggerResize = (entries) => {
9382
+ const {
9383
+ onResize
9384
+ } = props;
9385
+ const target = entries[0].target;
9386
+ const {
9387
+ width,
9388
+ height
9389
+ } = target.getBoundingClientRect();
9390
+ const {
9391
+ offsetWidth,
9392
+ offsetHeight
9393
+ } = target;
9394
+ const fixedWidth = Math.floor(width);
9395
+ const fixedHeight = Math.floor(height);
9396
+ if (state.width !== fixedWidth || state.height !== fixedHeight || state.offsetWidth !== offsetWidth || state.offsetHeight !== offsetHeight) {
9397
+ const size = {
9398
+ width: fixedWidth,
9399
+ height: fixedHeight,
9400
+ offsetWidth,
9401
+ offsetHeight
9402
+ };
9403
+ Object.assign(state, size);
9404
+ if (onResize) {
9405
+ Promise.resolve().then(() => {
9406
+ onResize({
9407
+ ...size,
9408
+ offsetWidth,
9409
+ offsetHeight
9410
+ }, target);
9411
+ });
9412
+ }
9413
+ }
9414
+ };
9415
+ const instance = getCurrentInstance();
9416
+ const registerObserver = () => {
9417
+ const {
9418
+ disabled
9419
+ } = props;
9420
+ if (disabled) {
9421
+ destroyObserver();
9422
+ return;
9423
+ }
9424
+ if (instance) {
9425
+ const element = findDOMNode(instance);
9426
+ const elementChanged = element !== currentElement.value;
9427
+ if (elementChanged) {
9428
+ destroyObserver();
9429
+ currentElement.value = element;
9430
+ }
9431
+ if (!resizeObserver.value && element) {
9432
+ resizeObserver.value = new ResizeObserver(onTriggerResize);
9433
+ resizeObserver.value.observe(element);
9434
+ }
9435
+ }
9436
+ };
9437
+ onMounted(() => {
9438
+ registerObserver();
9439
+ });
9440
+ onUpdated(() => {
9441
+ registerObserver();
9442
+ });
9443
+ onUnmounted(() => {
9444
+ destroyObserver();
9445
+ });
9446
+ return () => {
9447
+ var _a;
9448
+ return (_a = slots.default) == null ? void 0 : _a.call(slots)[0];
9449
+ };
9450
+ }
9451
+ });
9452
+ const INIT_INNER_STYLE = {
9453
+ display: "flex",
9454
+ flexDirection: "column"
9455
+ };
9456
+ var ResizeObserverContainer = defineComponent({
9457
+ name: "ResizeObserverContainer",
9458
+ props: resizeObserverContainerProps,
9459
+ setup(props, ctx) {
9460
+ const {
9461
+ height,
9462
+ offset: offset2
9463
+ } = toRefs(props);
9464
+ const outerStyle = ref({});
9465
+ const innerStyle = ref(INIT_INNER_STYLE);
9466
+ watch([() => height.value, () => offset2.value], () => {
9467
+ if (props.offset !== void 0) {
9468
+ outerStyle.value = {
9469
+ height: `${height.value}px`,
9470
+ position: "relative",
9471
+ overflow: "hidden"
9472
+ };
9473
+ innerStyle.value = {
9474
+ ...innerStyle.value,
9475
+ transform: `translateY(${offset2.value}px)`,
9476
+ position: "absolute",
9477
+ left: 0,
9478
+ right: 0,
9479
+ top: 0
9480
+ };
9481
+ }
9482
+ }, {
9483
+ immediate: true
9484
+ });
9485
+ return () => createVNode("div", {
9486
+ "style": outerStyle.value
9487
+ }, [createVNode(ResizeObserver$1, {
9488
+ "onResize": ({
9489
+ offsetHeight
9490
+ }) => {
9491
+ if (offsetHeight && props.onInnerResize) {
9492
+ props.onInnerResize();
9493
+ }
9494
+ }
9495
+ }, {
9496
+ default: () => {
9497
+ var _a, _b;
9498
+ return [createVNode("div", {
9499
+ "style": innerStyle.value
9500
+ }, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)])];
9501
+ }
9502
+ })]);
9503
+ }
9504
+ });
9505
+ function getPageY(e) {
9506
+ return "touches" in e ? e.touches[0].pageY : e.pageY;
9507
+ }
9508
+ var ScrollBar = defineComponent({
9509
+ name: "ScrollBar",
9510
+ props: scrollBarProps,
9511
+ setup(props, ctx) {
9512
+ const scrollbarRef = ref(null);
9513
+ const thumbRef = ref(null);
9514
+ const moveRaf = ref(0);
9515
+ const state = reactive({
9516
+ dragging: false,
9517
+ pageY: null,
9518
+ startTop: null,
9519
+ visible: false
9520
+ });
9521
+ const visibleTimeout = ref(null);
9522
+ const canScroll = computed(() => {
9523
+ return (props.scrollHeight || 0) > (props.height || 0);
9524
+ });
9525
+ const getSpinHeight = () => {
9526
+ const {
9527
+ height = 0,
9528
+ count = 0
9529
+ } = props;
9530
+ let baseHeight = height / count * 10;
9531
+ baseHeight = Math.max(baseHeight, 20);
9532
+ baseHeight = Math.min(baseHeight, height / 2);
9533
+ return Math.floor(baseHeight);
9534
+ };
9535
+ const getEnableScrollRange = () => {
9536
+ const {
9537
+ scrollHeight = 0,
9538
+ height = 0
9539
+ } = props;
9540
+ return scrollHeight - height || 0;
9541
+ };
9542
+ const getEnableHeightRange = () => {
9543
+ const {
9544
+ height = 0
9545
+ } = props;
9546
+ const spinHeight = getSpinHeight();
9547
+ return height - spinHeight || 0;
9548
+ };
9549
+ const getTop = () => {
9550
+ const {
9551
+ scrollTop = 0
9552
+ } = props;
9553
+ const enableScrollRange = getEnableScrollRange();
9554
+ const enableHeightRange = getEnableHeightRange();
9555
+ if (scrollTop === 0 || enableScrollRange === 0) {
9556
+ return 0;
9557
+ }
9558
+ const ptg = scrollTop / enableScrollRange;
9559
+ return ptg * enableHeightRange;
9560
+ };
9561
+ const onMouseMove = (e) => {
9562
+ const {
9563
+ dragging,
9564
+ pageY,
9565
+ startTop
9566
+ } = state;
9567
+ const {
9568
+ onScroll
9569
+ } = props;
9570
+ window.cancelAnimationFrame(moveRaf.value);
9571
+ if (dragging) {
9572
+ const offsetY = getPageY(e) - (pageY || 0);
9573
+ const newTop = (startTop || 0) + offsetY;
9574
+ const enableScrollRange = getEnableScrollRange();
9575
+ const enableHeightRange = getEnableHeightRange();
9576
+ const ptg = enableHeightRange ? newTop / enableHeightRange : 0;
9577
+ const newScrollTop = Math.ceil(ptg * enableScrollRange);
9578
+ moveRaf.value = window.requestAnimationFrame(() => {
9579
+ if (onScroll) {
9580
+ onScroll(newScrollTop);
9581
+ }
9582
+ });
9583
+ }
9584
+ };
9585
+ const onMouseUp = (callback) => {
9586
+ const {
9587
+ onStopMove
9588
+ } = props;
9589
+ state.dragging = false;
9590
+ if (onStopMove) {
9591
+ onStopMove();
9592
+ }
9593
+ if (callback) {
9594
+ callback();
9595
+ }
9596
+ };
9597
+ const onMouseDown = (e, callback) => {
9598
+ var _a, _b;
9599
+ const {
9600
+ onStartMove
9601
+ } = props;
9602
+ Object.assign(state, {
9603
+ dragging: true,
9604
+ pageY: getPageY(e),
9605
+ startTop: getTop()
9606
+ });
9607
+ if (onStartMove) {
9608
+ onStartMove();
9609
+ }
9610
+ window.addEventListener("mousemove", onMouseMove);
9611
+ window.addEventListener("mouseup", () => onMouseUp(callback));
9612
+ (_a = thumbRef == null ? void 0 : thumbRef.value) == null ? void 0 : _a.addEventListener("touchmove", onMouseMove, {
9613
+ passive: false
9614
+ });
9615
+ (_b = thumbRef == null ? void 0 : thumbRef.value) == null ? void 0 : _b.addEventListener("touchend", () => onMouseUp(callback));
9616
+ e.stopPropagation();
9617
+ e.preventDefault();
9618
+ };
9619
+ const removeEvents = () => {
9620
+ var _a, _b, _c, _d;
9621
+ window.removeEventListener("mousemove", onMouseMove);
9622
+ window.removeEventListener("mouseup", () => onMouseUp(removeEvents));
9623
+ (_a = scrollbarRef == null ? void 0 : scrollbarRef.value) == null ? void 0 : _a.removeEventListener("touchstart", (e) => {
9624
+ e.preventDefault();
9625
+ }, {
9626
+ passive: false
9627
+ });
9628
+ (_b = thumbRef == null ? void 0 : thumbRef.value) == null ? void 0 : _b.removeEventListener("touchstart", (e) => onMouseDown(e, removeEvents), {
9629
+ passive: false
9630
+ });
9631
+ (_c = thumbRef == null ? void 0 : thumbRef.value) == null ? void 0 : _c.removeEventListener("touchmove", onMouseMove, {
9632
+ passive: false
9633
+ });
9634
+ (_d = thumbRef == null ? void 0 : thumbRef.value) == null ? void 0 : _d.removeEventListener("touchend", () => onMouseUp(removeEvents));
9635
+ window.cancelAnimationFrame(moveRaf.value);
9636
+ };
9637
+ const onContainerMouseDown = (e) => {
9638
+ e.stopPropagation();
9639
+ e.preventDefault();
9640
+ };
9641
+ onBeforeUnmount(() => {
9642
+ removeEvents();
9643
+ if (visibleTimeout.value) {
9644
+ clearTimeout(visibleTimeout.value);
9645
+ }
9646
+ });
9647
+ onMounted(() => {
9648
+ var _a, _b;
9649
+ (_a = scrollbarRef == null ? void 0 : scrollbarRef.value) == null ? void 0 : _a.addEventListener("touchstart", (e) => {
9650
+ e.preventDefault();
9651
+ }, {
9652
+ passive: false
9653
+ });
9654
+ (_b = thumbRef.value) == null ? void 0 : _b.addEventListener("touchstart", (e) => onMouseDown(e, removeEvents), {
9655
+ passive: false
9656
+ });
9657
+ });
9658
+ const onShowBar = () => {
9659
+ if (visibleTimeout.value) {
9660
+ clearTimeout(visibleTimeout.value);
9661
+ }
9662
+ state.visible = true;
9663
+ visibleTimeout.value = setTimeout(() => {
9664
+ state.visible = false;
9665
+ }, 1e3);
9666
+ };
9667
+ ctx.expose({
9668
+ onShowBar
9669
+ });
9670
+ return () => {
9671
+ const display = canScroll.value && state.visible ? void 0 : "none";
9672
+ return createVNode("div", {
9673
+ "ref": scrollbarRef,
9674
+ "style": {
9675
+ width: "8px",
9676
+ top: 0,
9677
+ bottom: 0,
9678
+ right: 0,
9679
+ position: "absolute",
9680
+ display
9681
+ },
9682
+ "onMousedown": onContainerMouseDown,
9683
+ "onMousemove": onShowBar
9684
+ }, [createVNode("div", {
9685
+ "ref": thumbRef,
9686
+ "style": {
9687
+ width: "100%",
9688
+ height: getSpinHeight() + "px",
9689
+ top: getTop() + "px",
9690
+ left: 0,
9691
+ position: "absolute",
9692
+ background: "rgba(0, 0, 0, 0.5)",
9693
+ borderRadius: "99px",
9694
+ cursor: "pointer",
9695
+ userSelect: "none"
9696
+ },
9697
+ "onMousedown": (e) => onMouseDown(e, removeEvents)
9698
+ }, null)]);
9699
+ };
9700
+ }
9701
+ });
9702
+ function _isSlot$1(s) {
9703
+ return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
9704
+ }
9705
+ const Item = ({
9706
+ setRef
9707
+ }, {
9708
+ slots
9709
+ }) => {
9710
+ var _a;
9711
+ const children = flattenChildren((_a = slots.default) == null ? void 0 : _a.call(slots));
9712
+ return children && children.length ? cloneVNode(children[0], {
9713
+ ref: setRef
9714
+ }) : children;
9715
+ };
9716
+ Item.props = {
9717
+ setRef: {
9718
+ type: Function
9719
+ }
9720
+ };
9721
+ function renderChildren(list, startIndex, endIndex, setNodeRef, {
9722
+ getKey
9723
+ }, renderFunc) {
9724
+ if (renderFunc === void 0) {
9725
+ return "";
9726
+ }
9727
+ return list.slice(startIndex, endIndex + 1).map((item, index2) => {
9728
+ const eleIndex = startIndex + index2;
9729
+ const node = renderFunc(item, eleIndex, {});
9730
+ const key = getKey(item);
9731
+ return createVNode(Item, {
9732
+ "key": key,
9733
+ "setRef": (ele) => setNodeRef(item, ele)
9734
+ }, _isSlot$1(node) ? node : {
9735
+ default: () => [node]
9736
+ });
9737
+ });
9738
+ }
9739
+ const ScrollStyle = {
9740
+ overflowY: "auto",
9741
+ overflowAnchor: "none"
9742
+ };
9743
+ const DEFAULT_HEIGHT = 20;
9744
+ var VirtualList = defineComponent({
9745
+ name: "DVirtualList",
9746
+ props: virtualListProps,
9747
+ setup(props, ctx) {
9748
+ const {
9749
+ isVirtual,
9750
+ inVirtual
9751
+ } = useVirtual(props);
9752
+ const state = reactive({
9753
+ scrollTop: 0,
9754
+ scrollMoving: false
9755
+ });
9756
+ const data = computed(() => {
9757
+ return props.data || [];
9758
+ });
9759
+ const mergedData = shallowRef([]);
9760
+ watch(data, () => {
9761
+ mergedData.value = toRaw(data.value).slice();
9762
+ }, {
9763
+ immediate: true
9764
+ });
9765
+ const itemKey = shallowRef(null);
9766
+ watch(() => props.itemKey, (val) => {
9767
+ if (typeof val === "function") {
9768
+ itemKey.value = val;
9769
+ } else {
9770
+ if (val) {
9771
+ itemKey.value = (item) => item == null ? void 0 : item[val];
9772
+ }
9773
+ }
9774
+ }, {
9775
+ immediate: true
9776
+ });
9777
+ const componentRef = ref();
9778
+ const fillerInnerRef = ref();
9779
+ const barRef = ref();
9780
+ const getKey = (item) => {
9781
+ if (!itemKey.value || !props.itemKey) {
9782
+ return;
9783
+ }
9784
+ return itemKey.value(item);
9785
+ };
9786
+ const [setInstance, collectHeight, heights, updatedMark] = useHeights(mergedData, getKey);
9787
+ const calRes = reactive({
9788
+ scrollHeight: void 0,
9789
+ start: 0,
9790
+ end: 0,
9791
+ offset: void 0
9792
+ });
9793
+ const offsetHeight = ref(0);
9794
+ onMounted(() => {
9795
+ nextTick(() => {
9796
+ var _a;
9797
+ offsetHeight.value = ((_a = fillerInnerRef.value) == null ? void 0 : _a.offsetHeight) || 0;
9798
+ });
9799
+ });
9800
+ onUpdated(() => {
9801
+ nextTick(() => {
9802
+ var _a;
9803
+ offsetHeight.value = ((_a = fillerInnerRef.value) == null ? void 0 : _a.offsetHeight) || 0;
9804
+ });
9805
+ });
9806
+ watch([isVirtual, mergedData], () => {
9807
+ if (!isVirtual.value) {
9808
+ Object.assign(calRes, {
9809
+ scrollHeight: void 0,
9810
+ start: 0,
9811
+ end: mergedData.value.length - 1,
9812
+ offset: void 0
9813
+ });
9814
+ }
9815
+ }, {
9816
+ immediate: true
9817
+ });
9818
+ watch([isVirtual, mergedData, offsetHeight, inVirtual], () => {
9819
+ if (isVirtual.value && !inVirtual.value) {
9820
+ Object.assign(calRes, {
9821
+ scrollHeight: offsetHeight.value,
9822
+ start: 0,
9823
+ end: mergedData.value.length - 1,
9824
+ offset: void 0
9825
+ });
9826
+ }
9827
+ }, {
9828
+ immediate: true
9829
+ });
9830
+ watch([inVirtual, isVirtual, () => state.scrollTop, mergedData, updatedMark, () => props.height, offsetHeight], () => {
9831
+ if (!isVirtual.value || !inVirtual.value) {
9832
+ return;
9833
+ }
9834
+ let itemTop = 0;
9835
+ let startIndex;
9836
+ let startOffset;
9837
+ let endIndex;
9838
+ const mergedDataValue = unref(mergedData);
9839
+ const scrollTop = state.scrollTop;
9840
+ const {
9841
+ height
9842
+ } = props;
9843
+ const scrollTopHeight = scrollTop + height;
9844
+ for (let i = 0; i < mergedDataValue.length; i += 1) {
9845
+ const mergedDataItem = mergedDataValue[i];
9846
+ let cacheHeight;
9847
+ if (props.itemKey) {
9848
+ const key = getKey(mergedDataItem);
9849
+ cacheHeight = heights.get(key);
9850
+ }
9851
+ if (cacheHeight === void 0) {
9852
+ cacheHeight = props.itemHeight || DEFAULT_HEIGHT;
9853
+ }
9854
+ const currentItemBottom = itemTop + cacheHeight;
9855
+ if (startIndex === void 0 && currentItemBottom >= scrollTop) {
9856
+ startIndex = i;
9857
+ startOffset = itemTop;
9858
+ }
9859
+ if (endIndex === void 0 && currentItemBottom > scrollTopHeight) {
9860
+ endIndex = i;
9861
+ }
9862
+ itemTop = currentItemBottom;
9863
+ }
9864
+ if (startIndex === void 0) {
9865
+ startIndex = 0;
9866
+ startOffset = 0;
9867
+ }
9868
+ if (endIndex === void 0) {
9869
+ endIndex = mergedDataValue.length - 1;
9870
+ }
9871
+ endIndex = Math.min(endIndex + 1, mergedDataValue.length);
9872
+ Object.assign(calRes, {
9873
+ scrollHeight: itemTop,
9874
+ start: startIndex,
9875
+ end: endIndex,
9876
+ offset: startOffset
9877
+ });
9878
+ }, {
9879
+ immediate: true
9880
+ });
9881
+ const maxScrollHeight = computed(() => (calRes.scrollHeight || 0) - props.height);
9882
+ const keepInRange = (newScrollTop) => {
9883
+ let newTop = newScrollTop;
9884
+ if (!Number.isNaN(maxScrollHeight.value)) {
9885
+ newTop = Math.min(newTop, maxScrollHeight.value);
9886
+ }
9887
+ newTop = Math.max(newTop, 0);
9888
+ return newTop;
9889
+ };
9890
+ const isScrollAtTop = computed(() => state.scrollTop <= 0);
9891
+ const isScrollAtBottom = computed(() => state.scrollTop >= maxScrollHeight.value);
9892
+ const originScroll = useOriginScroll(isScrollAtTop, isScrollAtBottom);
9893
+ const syncScrollTop = (newTop) => {
9894
+ let value;
9895
+ if (typeof newTop === "function") {
9896
+ value = newTop(state.scrollTop);
9897
+ } else {
9898
+ value = newTop;
9899
+ }
9900
+ const alignedTop = keepInRange(value);
9901
+ if (componentRef.value) {
9902
+ componentRef.value.scrollTop = alignedTop;
9903
+ }
9904
+ state.scrollTop = alignedTop;
9905
+ };
9906
+ const onScrollBar = (newScrollTop) => {
9907
+ const newTop = newScrollTop;
9908
+ syncScrollTop(newTop);
9909
+ };
9910
+ const onComponentScroll = (e) => {
9911
+ var _a, _b;
9912
+ const {
9913
+ scrollTop: newScrollTop
9914
+ } = e.currentTarget;
9915
+ if (Math.abs(newScrollTop - state.scrollTop) >= 1) {
9916
+ syncScrollTop(newScrollTop);
9917
+ }
9918
+ (_b = (_a = barRef == null ? void 0 : barRef.value) == null ? void 0 : _a.onShowBar) == null ? void 0 : _b.call(_a);
9919
+ ctx.emit("scroll", e);
9920
+ };
9921
+ const [onRawWheel, onFireFoxScroll] = useFrameWheel(isVirtual, isScrollAtTop, isScrollAtBottom, (offsetY) => {
9922
+ syncScrollTop((top) => {
9923
+ const newTop = top + offsetY;
9924
+ return newTop;
9925
+ });
9926
+ });
9927
+ useMobileTouchMove(isVirtual, componentRef, (deltaY, smoothOffset) => {
9928
+ if (originScroll(deltaY, !!smoothOffset)) {
9929
+ return false;
9930
+ }
9931
+ onRawWheel({
9932
+ deltaY
9933
+ });
9934
+ return true;
9935
+ });
9936
+ const onMozMousePixelScroll = (e) => {
9937
+ if (isVirtual.value) {
9938
+ e.preventDefault();
9939
+ }
9940
+ };
9941
+ const removeEventListener = () => {
9942
+ if (componentRef.value) {
9943
+ componentRef.value.removeEventListener("wheel", onRawWheel, {
9944
+ passive: false
9945
+ });
9946
+ componentRef.value.removeEventListener("DOMMouseScroll", onFireFoxScroll);
9947
+ componentRef.value.removeEventListener("MozMousePixelScroll", onMozMousePixelScroll);
9948
+ }
9949
+ };
9950
+ watchEffect(() => {
9951
+ nextTick(() => {
9952
+ if (componentRef.value) {
9953
+ removeEventListener();
9954
+ componentRef.value.addEventListener("wheel", onRawWheel, {
9955
+ passive: false
9956
+ });
9957
+ componentRef.value.addEventListener("DOMMouseScroll", onFireFoxScroll);
9958
+ componentRef.value.addEventListener("MozMousePixelScroll", onMozMousePixelScroll);
9959
+ }
9960
+ });
9961
+ });
9962
+ onBeforeUnmount(() => {
9963
+ removeEventListener();
9964
+ });
9965
+ const componentStyle = computed(() => {
9966
+ let cs = null;
9967
+ if (props.height) {
9968
+ cs = {
9969
+ maxHeight: isVirtual.value ? props.height + "px" : void 0,
9970
+ ...ScrollStyle
9971
+ };
9972
+ if (isVirtual.value) {
9973
+ cs.overflowY = "hidden";
9974
+ if (state.scrollMoving) {
9975
+ cs.pointerEvents = "none";
9976
+ }
9977
+ }
9978
+ }
9979
+ return cs;
9980
+ });
9981
+ watch([() => calRes.start, () => calRes.end, mergedData], () => {
9982
+ const renderList = mergedData.value.slice(calRes.start, calRes.end + 1);
9983
+ ctx.emit("show-change", renderList, mergedData.value);
9984
+ }, {
9985
+ flush: "post"
9986
+ });
9987
+ ctx.expose({
9988
+ scrollTo(index2) {
9989
+ syncScrollTop(index2 * (props.itemHeight || DEFAULT_HEIGHT));
9990
+ }
9991
+ });
9992
+ return () => {
9993
+ const Component = props.component;
9994
+ return createVNode("div", {
9995
+ "style": {
9996
+ position: "relative"
9997
+ }
9998
+ }, [createVNode(Component, {
9999
+ "style": componentStyle.value,
10000
+ "ref": componentRef,
10001
+ "onScroll": onComponentScroll
10002
+ }, {
10003
+ default: () => [createVNode(ResizeObserverContainer, {
10004
+ "height": calRes.scrollHeight,
10005
+ "offset": calRes.offset,
10006
+ "onInnerResize": collectHeight,
10007
+ "ref": fillerInnerRef
10008
+ }, {
10009
+ default: () => renderChildren(mergedData.value, calRes.start, calRes.end, setInstance, {
10010
+ getKey
10011
+ }, ctx.slots.item)
10012
+ })]
10013
+ }), isVirtual.value && createVNode(ScrollBar, {
10014
+ "ref": barRef,
10015
+ "scrollTop": state.scrollTop,
10016
+ "height": props.height,
10017
+ "scrollHeight": calRes.scrollHeight,
10018
+ "count": mergedData.value.length,
10019
+ "onScroll": onScrollBar,
10020
+ "onStartMove": () => {
10021
+ state.scrollMoving = true;
10022
+ },
10023
+ "onStopMove": () => {
10024
+ state.scrollMoving = false;
10025
+ }
10026
+ }, null)]);
10027
+ };
10028
+ }
10029
+ });
8896
10030
  var CalendarPanel = defineComponent({
8897
10031
  name: "CalendarPanel",
8898
10032
  props: datePickerProPanelProps,
@@ -8910,7 +10044,6 @@ var CalendarPanel = defineComponent({
8910
10044
  handlerSelectDate,
8911
10045
  handlerYearCollapse,
8912
10046
  handlerClickMonth,
8913
- handleScrollYearList,
8914
10047
  handleScrollMonthList,
8915
10048
  isDateSelected,
8916
10049
  isStartDate,
@@ -8919,29 +10052,57 @@ var CalendarPanel = defineComponent({
8919
10052
  isDisabled
8920
10053
  } = useCalendarPanel(props, ctx);
8921
10054
  return () => {
10055
+ const yearItemSlots = {
10056
+ item: (item) => {
10057
+ return createVNode("div", {
10058
+ "class": [ns2.em("calendar-panel", "year-list-item"), item.active && ns2.e("year-title-active")]
10059
+ }, [!item.isMonth && !isListCollapse.value && createVNode("div", {
10060
+ "class": ns2.e("year-title"),
10061
+ "onClick": () => handlerYearCollapse()
10062
+ }, [item.year]), !item.isMonth && isListCollapse.value && createVNode("div", {
10063
+ "class": ns2.e("year-title"),
10064
+ "onClick": () => {
10065
+ handlerClickMonth(item.year, 0);
10066
+ }
10067
+ }, [item.year]), item.isMonth && createVNode("div", {
10068
+ "class": ns2.e("month-title"),
10069
+ "onClick": () => {
10070
+ handlerClickMonth(item.year, item.month);
10071
+ }
10072
+ }, [t(`month${item.month ? item.month + 1 : 1}`)])]);
10073
+ }
10074
+ };
10075
+ const monthItemSlots = {
10076
+ item: (month) => {
10077
+ return createVNode("div", {
10078
+ "class": ns2.e("table-month")
10079
+ }, [createVNode("div", {
10080
+ "class": ns2.e("table-month-title")
10081
+ }, [t("getYearMonthStr")(month.year, (month.month || 0) + 1)]), createVNode("table", {
10082
+ "class": ns2.e("table-month-content")
10083
+ }, [createVNode("tbody", null, [month.displayWeeks && month.displayWeeks.map((week, weekIndex) => createVNode("tr", {
10084
+ "class": ns2.e("table-week-header"),
10085
+ "key": weekIndex
10086
+ }, [week.map((day, dayIndex) => createVNode("td", {
10087
+ "key": dayIndex,
10088
+ "class": [day.inMonth && ns2.e("table-date"), isDateSelected(day.date) && ns2.e("table-date-selected"), day.isToday && ns2.e("table-date-today"), isStartDate(day.date) && ns2.e("table-date-start"), isInRangeDate(day.date) && ns2.e("table-date-in-range"), isEndDate(day.date) && ns2.e("table-date-end"), isDisabled(day.date) && ns2.e("table-date-disabled")],
10089
+ "onClick": (e) => {
10090
+ e.preventDefault();
10091
+ e.stopPropagation();
10092
+ handlerSelectDate(day);
10093
+ }
10094
+ }, [createVNode("span", null, [day.inMonth ? day.day : ""])]))]))])])]);
10095
+ }
10096
+ };
8922
10097
  return createVNode("div", {
8923
10098
  "class": ns2.e("calendar-panel")
8924
- }, [createVNode("div", {
10099
+ }, [createVNode(VirtualList, {
8925
10100
  "ref": yearScrollRef,
8926
10101
  "class": ns2.em("calendar-panel", "year-list"),
8927
- "onScroll": handleScrollYearList
8928
- }, [yearAndMonthList.value.map((item, index2) => createVNode("div", {
8929
- "class": [ns2.em("calendar-panel", "year-list-item"), item.active && ns2.e("year-title-active")],
8930
- "key": index2
8931
- }, [!item.isMonth && !isListCollapse.value && createVNode("div", {
8932
- "class": ns2.e("year-title"),
8933
- "onClick": () => handlerYearCollapse()
8934
- }, [item.year]), !item.isMonth && isListCollapse.value && createVNode("div", {
8935
- "class": ns2.e("year-title"),
8936
- "onClick": () => {
8937
- handlerClickMonth(item.year, 0);
8938
- }
8939
- }, [item.year]), item.isMonth && createVNode("div", {
8940
- "class": ns2.e("month-title"),
8941
- "onClick": () => {
8942
- handlerClickMonth(item.year, item.month);
8943
- }
8944
- }, [t(`month${item.month ? item.month + 1 : 1}`)])]))]), createVNode("div", {
10102
+ "data": yearAndMonthList.value,
10103
+ "height": yearListHeight,
10104
+ "itemHeight": yearItemHeight
10105
+ }, yearItemSlots), createVNode("div", {
8945
10106
  "class": ns2.em("calendar-panel", "main")
8946
10107
  }, [createVNode("table", {
8947
10108
  "class": ns2.e("calendar-table")
@@ -8949,29 +10110,14 @@ var CalendarPanel = defineComponent({
8949
10110
  "class": ns2.e("table-week-header")
8950
10111
  }, [t("getWeekDays")().map((child) => createVNode("td", null, [child]))])]), createVNode("tbody", null, [createVNode("tr", null, [createVNode("td", {
8951
10112
  "colspan": "7"
8952
- }, [createVNode("div", {
10113
+ }, [createVNode(VirtualList, {
8953
10114
  "ref": monthScrollRef,
8954
10115
  "class": ns2.e("tbody-wrapper"),
10116
+ "data": allMonthList.value,
10117
+ "height": calendarListHeight,
10118
+ "itemHeight": calendarItemHeight,
8955
10119
  "onScroll": handleScrollMonthList
8956
- }, [allMonthList.value.map((month, monthIndex) => createVNode("div", {
8957
- "class": ns2.e("table-month"),
8958
- "key": monthIndex
8959
- }, [createVNode("div", {
8960
- "class": ns2.e("table-month-title")
8961
- }, [t("getYearMonthStr")(month.year, (month.month || 0) + 1)]), createVNode("table", {
8962
- "class": ns2.e("table-month-content")
8963
- }, [createVNode("tbody", null, [month.displayWeeks && month.displayWeeks.map((week, weekIndex) => createVNode("tr", {
8964
- "class": ns2.e("table-week-header"),
8965
- "key": weekIndex
8966
- }, [week.map((day, dayIndex) => createVNode("td", {
8967
- "key": dayIndex,
8968
- "class": [day.inMonth && ns2.e("table-date"), isDateSelected(day.date) && ns2.e("table-date-selected"), day.isToday && ns2.e("table-date-today"), isStartDate(day.date) && ns2.e("table-date-start"), isInRangeDate(day.date) && ns2.e("table-date-in-range"), isEndDate(day.date) && ns2.e("table-date-end"), isDisabled(day.date) && ns2.e("table-date-disabled")],
8969
- "onClick": (e) => {
8970
- e.preventDefault();
8971
- e.stopPropagation();
8972
- handlerSelectDate(day);
8973
- }
8974
- }, [createVNode("span", null, [day.inMonth ? day.day : ""])]))]))])])]))])])])])])])]);
10120
+ }, monthItemSlots)])])])])])]);
8975
10121
  };
8976
10122
  }
8977
10123
  });
@@ -9564,8 +10710,8 @@ defineComponent({
9564
10710
  });
9565
10711
  class View {
9566
10712
  constructor() {
9567
- __publicField(this, "top", "50%");
9568
- __publicField(this, "left", "50%");
10713
+ this.top = "50%";
10714
+ this.left = "50%";
9569
10715
  }
9570
10716
  }
9571
10717
  const loadingProps = {
@@ -9583,13 +10729,9 @@ const loadingProps = {
9583
10729
  };
9584
10730
  class LoadingOptions {
9585
10731
  constructor() {
9586
- __publicField(this, "target");
9587
- __publicField(this, "message");
9588
- __publicField(this, "loadingTemplateRef");
9589
- __publicField(this, "backdrop", true);
9590
- __publicField(this, "positionType", "relative");
9591
- __publicField(this, "view", new View());
9592
- __publicField(this, "zIndex");
10732
+ this.backdrop = true;
10733
+ this.positionType = "relative";
10734
+ this.view = new View();
9593
10735
  }
9594
10736
  }
9595
10737
  var loading = "";
@@ -9657,7 +10799,7 @@ var Loading = defineComponent({
9657
10799
  });
9658
10800
  const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
9659
10801
  function createComponent(component, props, children = null) {
9660
- const vnode = h(component, __spreadValues({}, props), children);
10802
+ const vnode = h(component, { ...props }, children);
9661
10803
  const container = document.createElement("div");
9662
10804
  vnode[COMPONENT_CONTAINER_SYMBOL] = container;
9663
10805
  render(vnode, container);
@@ -9744,9 +10886,12 @@ const removeAttribute = (el) => {
9744
10886
  };
9745
10887
  const handleProps = (el, vprops) => {
9746
10888
  var _a;
9747
- const props = __spreadValues(__spreadValues({}, new LoadingOptions()), vprops);
10889
+ const props = {
10890
+ ...new LoadingOptions(),
10891
+ ...vprops
10892
+ };
9748
10893
  const loadingTemplateRef = props.loadingTemplateRef;
9749
- const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
10894
+ const loadingInstance = createComponent(loadingConstructor, { ...props }, loadingTemplateRef ? () => loadingTemplateRef : null);
9750
10895
  el.style.position = props.positionType;
9751
10896
  el.options = props;
9752
10897
  el.instance = loadingInstance;
@@ -9912,14 +11057,14 @@ function useYearCalendarPanel(props, ctx) {
9912
11057
  const goToShowYear = (date4) => {
9913
11058
  if (date4) {
9914
11059
  const index2 = Math.floor((date4.year() - calendarRange.value[0]) / 3);
9915
- let scrollHeight = (index2 - 1) * yearCalendarItemHeight;
9916
- if (scrollHeight < 0) {
9917
- scrollHeight = 0;
11060
+ let scrollIndex = index2 - 1;
11061
+ if (scrollIndex < 0) {
11062
+ scrollIndex = 0;
9918
11063
  }
9919
11064
  nextTick(() => {
9920
11065
  var _a;
9921
11066
  const scrollEl = yarListScrollRef.value;
9922
- (_a = scrollEl == null ? void 0 : scrollEl.scroll) == null ? void 0 : _a.call(scrollEl, 0, scrollHeight);
11067
+ (_a = scrollEl == null ? void 0 : scrollEl.scrollTo) == null ? void 0 : _a.call(scrollEl, scrollIndex);
9923
11068
  });
9924
11069
  }
9925
11070
  };
@@ -10033,23 +11178,30 @@ var YearCalendarPanel = defineComponent({
10033
11178
  handlerSelectYear
10034
11179
  } = useYearCalendarPanel(props, ctx);
10035
11180
  return () => {
11181
+ const yearItemSlots = {
11182
+ item: (years) => {
11183
+ return createVNode("div", {
11184
+ "class": ns2.e("year-list-item")
11185
+ }, [years.map((year) => createVNode("div", {
11186
+ "key": year,
11187
+ "class": getYearItemCls(year),
11188
+ "onClick": (e) => {
11189
+ e.preventDefault();
11190
+ e.stopPropagation();
11191
+ handlerSelectYear(year);
11192
+ }
11193
+ }, [year]))]);
11194
+ }
11195
+ };
10036
11196
  return createVNode("div", {
10037
11197
  "class": ns2.e("year-calendar-panel")
10038
- }, [createVNode("div", {
11198
+ }, [createVNode(VirtualList, {
10039
11199
  "ref": yarListScrollRef,
10040
- "class": ns2.e("year-list")
10041
- }, [yearList.value.map((years, index2) => createVNode("div", {
10042
- "class": ns2.e("year-list-item"),
10043
- "key": index2
10044
- }, [years.map((year) => createVNode("div", {
10045
- "key": year,
10046
- "class": getYearItemCls(year),
10047
- "onClick": (e) => {
10048
- e.preventDefault();
10049
- e.stopPropagation();
10050
- handlerSelectYear(year);
10051
- }
10052
- }, [year]))]))])]);
11200
+ "class": ns2.e("year-list"),
11201
+ "data": yearList.value,
11202
+ "height": yearPickerHeight,
11203
+ "itemHeight": yearCalendarItemHeight
11204
+ }, yearItemSlots)]);
10053
11205
  };
10054
11206
  }
10055
11207
  });
@@ -10098,25 +11250,25 @@ function useMonthCalendarPanel(props, ctx) {
10098
11250
  };
10099
11251
  const goToYearDate = () => {
10100
11252
  updateYearActive();
10101
- let scrollHeight = (currentYearIndex.value - 4) * yearItemHeight;
10102
- if (scrollHeight < 0) {
10103
- scrollHeight = 0;
11253
+ let scrollIndex = currentYearIndex.value - 4;
11254
+ if (scrollIndex < 0) {
11255
+ scrollIndex = 0;
10104
11256
  }
10105
11257
  nextTick(() => {
10106
11258
  var _a;
10107
11259
  const scrollEl = yearScrollRef.value;
10108
- (_a = scrollEl == null ? void 0 : scrollEl.scroll) == null ? void 0 : _a.call(scrollEl, 0, scrollHeight);
11260
+ (_a = scrollEl == null ? void 0 : scrollEl.scrollTo) == null ? void 0 : _a.call(scrollEl, scrollIndex);
10109
11261
  });
10110
11262
  };
10111
11263
  const goToMonthDate = () => {
10112
- let scrollHeight = currentYearIndex.value * monthCalendarItemHeight;
10113
- if (scrollHeight < 0) {
10114
- scrollHeight = 0;
11264
+ let scrollIndex = currentYearIndex.value;
11265
+ if (scrollIndex < 0) {
11266
+ scrollIndex = 0;
10115
11267
  }
10116
11268
  nextTick(() => {
10117
11269
  var _a;
10118
11270
  const scrollEl = monthScrollRef.value;
10119
- (_a = scrollEl == null ? void 0 : scrollEl.scroll) == null ? void 0 : _a.call(scrollEl, 0, scrollHeight);
11271
+ (_a = scrollEl == null ? void 0 : scrollEl.scrollTo) == null ? void 0 : _a.call(scrollEl, scrollIndex);
10120
11272
  });
10121
11273
  };
10122
11274
  const goToShowDate = (date4) => {
@@ -10127,11 +11279,7 @@ function useMonthCalendarPanel(props, ctx) {
10127
11279
  };
10128
11280
  onBeforeMount(() => {
10129
11281
  today.value = new Date();
10130
- if (props.calendarRange) {
10131
- calendarRange.value = props.calendarRange;
10132
- } else {
10133
- calendarRange.value = [today.value.getFullYear() - 25, today.value.getFullYear() + 25];
10134
- }
11282
+ calendarRange.value = props.calendarRange;
10135
11283
  initYearList();
10136
11284
  const toDate = getToDate(props.dateValue);
10137
11285
  if (props.visible && toDate) {
@@ -10139,7 +11287,8 @@ function useMonthCalendarPanel(props, ctx) {
10139
11287
  }
10140
11288
  });
10141
11289
  const handlerSelectYear = (year) => {
10142
- console.log(year);
11290
+ const toDate = dayjs(new Date(year, 0, 1)).locale("zh-cn");
11291
+ goToShowDate(toDate);
10143
11292
  };
10144
11293
  const debounceScrollMonth = lodash.exports.throttle((newScrollTop) => {
10145
11294
  currentYearIndex.value = Math.floor(newScrollTop / monthCalendarItemHeight) + (newScrollTop % monthCalendarItemHeight > 100 ? 1 : 0);
@@ -10258,40 +11407,54 @@ var MonthCalendarPanel = defineComponent({
10258
11407
  handlerSelectMonth
10259
11408
  } = useMonthCalendarPanel(props, ctx);
10260
11409
  return () => {
11410
+ const yearItemSlots = {
11411
+ item: (year) => {
11412
+ return createVNode("div", {
11413
+ "class": [ns2.e("year-list-item"), year.active && ns2.e("year-item-active")],
11414
+ "key": year.year,
11415
+ "onClick": () => handlerSelectYear(year.year)
11416
+ }, [year.year]);
11417
+ }
11418
+ };
11419
+ const monthItemSlots = {
11420
+ item: (year) => {
11421
+ return createVNode("div", {
11422
+ "class": ns2.e("table-month")
11423
+ }, [createVNode("div", {
11424
+ "class": ns2.e("table-month-title")
11425
+ }, [year.year + t("year")]), createVNode("table", {
11426
+ "class": ns2.e("table-month-content")
11427
+ }, [createVNode("tbody", null, [monthList.map((season, seasonIndex) => createVNode("tr", {
11428
+ "key": seasonIndex
11429
+ }, [season.map((month) => createVNode("td", {
11430
+ "key": month,
11431
+ "class": getMonthItemCls(year.year, month),
11432
+ "onClick": (e) => {
11433
+ e.preventDefault();
11434
+ e.stopPropagation();
11435
+ handlerSelectMonth(year.year, month);
11436
+ }
11437
+ }, [createVNode("span", null, [t(`month${month}`) || "m"])]))]))])])]);
11438
+ }
11439
+ };
10261
11440
  return createVNode("div", {
10262
11441
  "class": ns2.e("month-calendar-panel")
10263
- }, [createVNode("div", {
11442
+ }, [createVNode(VirtualList, {
10264
11443
  "ref": yearScrollRef,
10265
- "class": ns2.e("year-list")
10266
- }, [yearList.value.map((year) => createVNode("div", {
10267
- "class": [ns2.e("year-list-item"), year.active && ns2.e("year-item-active")],
10268
- "key": year.year,
10269
- "onClick": () => handlerSelectYear(year.year)
10270
- }, [year.year]))]), createVNode("div", {
11444
+ "class": ns2.e("year-list"),
11445
+ "data": yearList.value,
11446
+ "height": monthPickerHeight,
11447
+ "itemHeight": yearItemHeight
11448
+ }, yearItemSlots), createVNode("div", {
10271
11449
  "class": ns2.e("month-wrapper")
10272
- }, [createVNode("div", {
10273
- "class": ns2.e("month-list"),
11450
+ }, [createVNode(VirtualList, {
10274
11451
  "ref": monthScrollRef,
10275
- "onScroll": (e) => {
10276
- handlerMonthScroll(e);
10277
- }
10278
- }, [yearList.value.map((year) => createVNode("div", {
10279
- "class": ns2.e("table-month")
10280
- }, [createVNode("div", {
10281
- "class": ns2.e("table-month-title")
10282
- }, [year.year + t("year")]), createVNode("table", {
10283
- "class": ns2.e("table-month-content")
10284
- }, [createVNode("tbody", null, [monthList.map((season, seasonIndex) => createVNode("tr", {
10285
- "key": seasonIndex
10286
- }, [season.map((month) => createVNode("td", {
10287
- "key": month,
10288
- "class": getMonthItemCls(year.year, month),
10289
- "onClick": (e) => {
10290
- e.preventDefault();
10291
- e.stopPropagation();
10292
- handlerSelectMonth(year.year, month);
10293
- }
10294
- }, [createVNode("span", null, [t(`month${month}`) || ""])]))]))])])]))])])]);
11452
+ "class": ns2.e("month-list"),
11453
+ "data": yearList.value,
11454
+ "height": monthPickerHeight,
11455
+ "itemHeight": monthCalendarItemHeight,
11456
+ "onScroll": handlerMonthScroll
11457
+ }, monthItemSlots)])]);
10295
11458
  };
10296
11459
  }
10297
11460
  });
@@ -10604,7 +11767,7 @@ var DatePickerPro = defineComponent({
10604
11767
  };
10605
11768
  }
10606
11769
  });
10607
- const rangeDatePickerProProps = __spreadValues({
11770
+ const rangeDatePickerProProps = {
10608
11771
  modelValue: {
10609
11772
  type: Array,
10610
11773
  default: ["", ""]
@@ -10616,8 +11779,9 @@ const rangeDatePickerProProps = __spreadValues({
10616
11779
  separator: {
10617
11780
  type: String,
10618
11781
  default: "-"
10619
- }
10620
- }, datePickerProCommonProps);
11782
+ },
11783
+ ...datePickerProCommonProps
11784
+ };
10621
11785
  function useRangePickerPro(props, ctx) {
10622
11786
  const formContext = inject(FORM_TOKEN, void 0);
10623
11787
  const formItemContext = inject(FORM_ITEM_TOKEN, void 0);