vue-devui 1.0.0-rc.12 → 1.0.0-rc.15
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.
- package/README.md +161 -149
- package/alert/index.umd.js +1 -1
- package/auto-complete/index.es.js +243 -83
- package/auto-complete/index.umd.js +29 -18
- package/auto-complete/style.css +1 -1
- package/avatar/index.umd.js +1 -1
- package/badge/index.umd.js +1 -1
- package/button/index.es.js +23 -43
- package/button/index.umd.js +9 -9
- package/button/style.css +1 -1
- package/card/index.umd.js +1 -1
- package/checkbox/index.es.js +94 -77
- package/checkbox/index.umd.js +26 -15
- package/checkbox/style.css +1 -1
- package/collapse/index.es.js +3 -21
- package/collapse/index.umd.js +1 -1
- package/countdown/index.umd.js +1 -1
- package/date-picker-pro/index.es.js +1423 -248
- package/date-picker-pro/index.umd.js +25 -14
- package/date-picker-pro/style.css +1 -1
- package/drawer/index.es.js +4 -17
- package/drawer/index.umd.js +1 -1
- package/dropdown/index.es.js +12 -23
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.es.js +260 -105
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +85 -71
- package/form/index.umd.js +21 -10
- package/fullscreen/index.umd.js +1 -1
- package/grid/index.es.js +7 -20
- package/grid/index.umd.js +1 -1
- package/icon/index.es.js +2 -1
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -1
- package/image-preview/index.es.js +12 -23
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +241 -76
- package/input/index.umd.js +27 -16
- package/input/style.css +1 -1
- package/input-number/index.es.js +2 -20
- package/input-number/index.umd.js +1 -1
- package/layout/index.es.js +1 -1
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +15 -38
- package/loading/index.umd.js +1 -1
- package/message/index.d.ts +7 -0
- package/message/index.es.js +534 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.es.js +13 -44
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +45 -54
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/roundInjectionKey.js +3 -0
- package/nuxt/components/skeletonItemProps.js +3 -0
- package/overlay/index.es.js +1 -1
- package/overlay/index.umd.js +1 -1
- package/package.json +2 -2
- package/pagination/index.es.js +152 -2
- package/pagination/index.umd.js +1 -1
- package/panel/index.umd.js +1 -1
- package/popover/index.es.js +1 -1
- package/popover/index.umd.js +4 -4
- package/progress/index.umd.js +3 -3
- package/radio/index.es.js +91 -75
- package/radio/index.umd.js +28 -17
- package/radio/style.css +1 -1
- package/rate/index.umd.js +1 -1
- package/result/index.es.js +2 -1
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/ripple/index.es.js +5 -18
- package/ripple/index.umd.js +1 -1
- package/search/index.es.js +258 -80
- package/search/index.umd.js +27 -16
- package/search/style.css +1 -1
- package/select/index.es.js +352 -146
- package/select/index.umd.js +28 -17
- package/select/style.css +1 -1
- package/skeleton/index.es.js +87 -261
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.umd.js +1 -1
- package/splitter/index.es.js +175 -32
- package/splitter/index.umd.js +13 -13
- package/statistic/index.es.js +0 -21
- package/statistic/index.umd.js +1 -1
- package/status/index.umd.js +1 -1
- package/steps/index.es.js +2 -1
- package/steps/index.umd.js +1 -1
- package/steps/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +85 -71
- package/switch/index.umd.js +25 -14
- package/table/index.es.js +465 -130
- package/table/index.umd.js +24 -13
- package/table/style.css +1 -1
- package/tabs/index.es.js +21 -11
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.umd.js +1 -1
- package/textarea/index.es.js +88 -72
- package/textarea/index.umd.js +26 -15
- package/time-picker/index.es.js +289 -116
- package/time-picker/index.umd.js +27 -16
- package/time-picker/style.css +1 -1
- package/time-select/index.es.js +352 -146
- package/time-select/index.umd.js +26 -15
- package/time-select/style.css +1 -1
- package/timeline/index.es.js +2 -1
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +1 -1
- package/tooltip/index.umd.js +4 -4
- package/tree/index.es.js +515 -144
- package/tree/index.umd.js +26 -15
- package/tree/style.css +1 -1
- package/upload/index.es.js +197 -81
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +13710 -12898
- package/vue-devui.umd.js +30 -19
|
@@ -1,39 +1,4 @@
|
|
|
1
|
-
|
|
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 =
|
|
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
|
-
|
|
76
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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 (
|
|
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
|
|
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
|
|
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 =
|
|
1136
|
-
var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"),
|
|
1137
|
-
var metaMap =
|
|
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(
|
|
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
|
|
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
|
|
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
|
|
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 ||
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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(
|
|
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
|
|
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
|
|
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(
|
|
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
|
-
|
|
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((
|
|
7853
|
-
var _b = _a, { trigger } = _b, rule = __objRest(_b, ["trigger"]);
|
|
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
|
|
7943
|
+
const {
|
|
7929
7944
|
messageType: itemMessageType,
|
|
7930
7945
|
popPosition: itemPopPosition,
|
|
7931
|
-
showFeedback: itemShowFeedback
|
|
7932
|
-
|
|
7933
|
-
|
|
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(
|
|
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
|
|
8002
|
-
return [(_b = (
|
|
8014
|
+
var _a, _b;
|
|
8015
|
+
return [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)];
|
|
8003
8016
|
}
|
|
8004
8017
|
})]);
|
|
8005
8018
|
}
|
|
@@ -8224,7 +8237,8 @@ function useIconDom(props, ctx) {
|
|
|
8224
8237
|
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
8225
8238
|
"style": {
|
|
8226
8239
|
width: iconSize.value || "",
|
|
8227
|
-
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)
|
|
8240
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`,
|
|
8241
|
+
verticalAlign: "middle"
|
|
8228
8242
|
}
|
|
8229
8243
|
}, ctx.attrs), null);
|
|
8230
8244
|
};
|
|
@@ -8342,7 +8356,7 @@ function useInputRender(props, ctx) {
|
|
|
8342
8356
|
const slots = ctx.slots;
|
|
8343
8357
|
const inputDisabled = computed(() => disabled.value || (formContext == null ? void 0 : formContext.disabled));
|
|
8344
8358
|
const inputSize = computed(() => (size == null ? void 0 : size.value) || (formContext == null ? void 0 : formContext.size) || "");
|
|
8345
|
-
const
|
|
8359
|
+
const { style, class: customClass, ...otherAttrs } = ctx.attrs;
|
|
8346
8360
|
const customStyle = { style };
|
|
8347
8361
|
const wrapClasses = computed(() => ({
|
|
8348
8362
|
[ns2.e("wrapper")]: true,
|
|
@@ -8410,6 +8424,155 @@ function useInputFunction(input2) {
|
|
|
8410
8424
|
return { select, focus, blur };
|
|
8411
8425
|
}
|
|
8412
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
|
+
};
|
|
8413
8576
|
const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
|
|
8414
8577
|
function get(object4, path) {
|
|
8415
8578
|
const keys = path.split(".");
|
|
@@ -8423,7 +8586,8 @@ function get(object4, path) {
|
|
|
8423
8586
|
function createI18nTranslate(name, app, newPrefix) {
|
|
8424
8587
|
const prefix = newPrefix || camelize(name) + ".";
|
|
8425
8588
|
return (path) => {
|
|
8426
|
-
|
|
8589
|
+
var _a;
|
|
8590
|
+
const messages2 = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
|
|
8427
8591
|
const message = get(messages2, prefix + path) || get(messages2, path);
|
|
8428
8592
|
return message;
|
|
8429
8593
|
};
|
|
@@ -8534,8 +8698,12 @@ var Input = defineComponent({
|
|
|
8534
8698
|
const DAY_DURATION = 24 * 60 * 60 * 1e3;
|
|
8535
8699
|
const yearItemHeight = 30;
|
|
8536
8700
|
const calendarItemHeight = 186;
|
|
8537
|
-
const
|
|
8701
|
+
const yearListHeight = 305;
|
|
8702
|
+
const calendarListHeight = 270;
|
|
8703
|
+
const monthPickerHeight = 300;
|
|
8538
8704
|
const monthCalendarItemHeight = 186;
|
|
8705
|
+
const yearPickerHeight = 186;
|
|
8706
|
+
const yearCalendarItemHeight = 48;
|
|
8539
8707
|
function useCalendarSelected(props, ctx) {
|
|
8540
8708
|
const today = ref(new Date());
|
|
8541
8709
|
const calendarRange = ref([]);
|
|
@@ -8741,25 +8909,25 @@ function useCalendarPanel(props, ctx) {
|
|
|
8741
8909
|
};
|
|
8742
8910
|
const goToYearDate = (index2) => {
|
|
8743
8911
|
updateYearActive(index2);
|
|
8744
|
-
let
|
|
8745
|
-
if (
|
|
8746
|
-
|
|
8912
|
+
let scrollIndex = index2 - 4;
|
|
8913
|
+
if (scrollIndex < 0) {
|
|
8914
|
+
scrollIndex = 0;
|
|
8747
8915
|
}
|
|
8748
8916
|
nextTick(() => {
|
|
8749
8917
|
var _a;
|
|
8750
8918
|
const scrollEl = yearScrollRef.value;
|
|
8751
|
-
(_a = scrollEl == null ? void 0 : scrollEl.
|
|
8919
|
+
(_a = scrollEl == null ? void 0 : scrollEl.scrollTo) == null ? void 0 : _a.call(scrollEl, scrollIndex);
|
|
8752
8920
|
});
|
|
8753
8921
|
};
|
|
8754
8922
|
const goToMonthDate = () => {
|
|
8755
|
-
let
|
|
8756
|
-
if (
|
|
8757
|
-
|
|
8923
|
+
let scrollIndex = currentMonthIndex.value;
|
|
8924
|
+
if (scrollIndex < 0) {
|
|
8925
|
+
scrollIndex = 0;
|
|
8758
8926
|
}
|
|
8759
8927
|
nextTick(() => {
|
|
8760
8928
|
var _a;
|
|
8761
8929
|
const scrollEl = monthScrollRef.value;
|
|
8762
|
-
(_a = scrollEl == null ? void 0 : scrollEl.
|
|
8930
|
+
(_a = scrollEl == null ? void 0 : scrollEl.scrollTo) == null ? void 0 : _a.call(scrollEl, scrollIndex);
|
|
8763
8931
|
});
|
|
8764
8932
|
};
|
|
8765
8933
|
const goToShowDate = (date4) => {
|
|
@@ -8779,12 +8947,10 @@ function useCalendarPanel(props, ctx) {
|
|
|
8779
8947
|
};
|
|
8780
8948
|
onBeforeMount(() => {
|
|
8781
8949
|
today.value = new Date();
|
|
8782
|
-
|
|
8783
|
-
calendarRange.value = props.calendarRange;
|
|
8784
|
-
} else {
|
|
8785
|
-
calendarRange.value = [today.value.getFullYear() - 3, today.value.getFullYear() + 3];
|
|
8786
|
-
}
|
|
8950
|
+
calendarRange.value = props.calendarRange;
|
|
8787
8951
|
initCalendarData();
|
|
8952
|
+
});
|
|
8953
|
+
onMounted(() => {
|
|
8788
8954
|
initCalendarShow();
|
|
8789
8955
|
});
|
|
8790
8956
|
const handlerSetRangeDate = (day) => {
|
|
@@ -8834,9 +9000,6 @@ function useCalendarPanel(props, ctx) {
|
|
|
8834
9000
|
goToShowDate(date4);
|
|
8835
9001
|
}
|
|
8836
9002
|
};
|
|
8837
|
-
const handleScrollYearList = (e) => {
|
|
8838
|
-
e.currentTarget;
|
|
8839
|
-
};
|
|
8840
9003
|
const debounceScrollMonth = lodash.exports.throttle((newScrollTop) => {
|
|
8841
9004
|
currentMonthIndex.value = Math.floor(newScrollTop / calendarItemHeight) + (newScrollTop % calendarItemHeight > 100 ? 1 : 0);
|
|
8842
9005
|
const yearIndex = isListCollapse.value ? Math.floor(currentMonthIndex.value / 12) : currentMonthIndex.value + Math.floor(currentMonthIndex.value / 12) + 1;
|
|
@@ -8883,7 +9046,6 @@ function useCalendarPanel(props, ctx) {
|
|
|
8883
9046
|
handlerSelectDate,
|
|
8884
9047
|
handlerYearCollapse,
|
|
8885
9048
|
handlerClickMonth,
|
|
8886
|
-
handleScrollYearList,
|
|
8887
9049
|
handleScrollMonthList,
|
|
8888
9050
|
isDateSelected,
|
|
8889
9051
|
isStartDate,
|
|
@@ -8892,6 +9054,979 @@ function useCalendarPanel(props, ctx) {
|
|
|
8892
9054
|
isDisabled
|
|
8893
9055
|
};
|
|
8894
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
|
+
});
|
|
8895
10030
|
var CalendarPanel = defineComponent({
|
|
8896
10031
|
name: "CalendarPanel",
|
|
8897
10032
|
props: datePickerProPanelProps,
|
|
@@ -8909,7 +10044,6 @@ var CalendarPanel = defineComponent({
|
|
|
8909
10044
|
handlerSelectDate,
|
|
8910
10045
|
handlerYearCollapse,
|
|
8911
10046
|
handlerClickMonth,
|
|
8912
|
-
handleScrollYearList,
|
|
8913
10047
|
handleScrollMonthList,
|
|
8914
10048
|
isDateSelected,
|
|
8915
10049
|
isStartDate,
|
|
@@ -8918,29 +10052,57 @@ var CalendarPanel = defineComponent({
|
|
|
8918
10052
|
isDisabled
|
|
8919
10053
|
} = useCalendarPanel(props, ctx);
|
|
8920
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
|
+
};
|
|
8921
10097
|
return createVNode("div", {
|
|
8922
10098
|
"class": ns2.e("calendar-panel")
|
|
8923
|
-
}, [createVNode(
|
|
10099
|
+
}, [createVNode(VirtualList, {
|
|
8924
10100
|
"ref": yearScrollRef,
|
|
8925
10101
|
"class": ns2.em("calendar-panel", "year-list"),
|
|
8926
|
-
"
|
|
8927
|
-
|
|
8928
|
-
"
|
|
8929
|
-
|
|
8930
|
-
}, [!item.isMonth && !isListCollapse.value && createVNode("div", {
|
|
8931
|
-
"class": ns2.e("year-title"),
|
|
8932
|
-
"onClick": () => handlerYearCollapse()
|
|
8933
|
-
}, [item.year]), !item.isMonth && isListCollapse.value && createVNode("div", {
|
|
8934
|
-
"class": ns2.e("year-title"),
|
|
8935
|
-
"onClick": () => {
|
|
8936
|
-
handlerClickMonth(item.year, 0);
|
|
8937
|
-
}
|
|
8938
|
-
}, [item.year]), item.isMonth && createVNode("div", {
|
|
8939
|
-
"class": ns2.e("month-title"),
|
|
8940
|
-
"onClick": () => {
|
|
8941
|
-
handlerClickMonth(item.year, item.month);
|
|
8942
|
-
}
|
|
8943
|
-
}, [t(`month${item.month ? item.month + 1 : 1}`)])]))]), createVNode("div", {
|
|
10102
|
+
"data": yearAndMonthList.value,
|
|
10103
|
+
"height": yearListHeight,
|
|
10104
|
+
"itemHeight": yearItemHeight
|
|
10105
|
+
}, yearItemSlots), createVNode("div", {
|
|
8944
10106
|
"class": ns2.em("calendar-panel", "main")
|
|
8945
10107
|
}, [createVNode("table", {
|
|
8946
10108
|
"class": ns2.e("calendar-table")
|
|
@@ -8948,29 +10110,14 @@ var CalendarPanel = defineComponent({
|
|
|
8948
10110
|
"class": ns2.e("table-week-header")
|
|
8949
10111
|
}, [t("getWeekDays")().map((child) => createVNode("td", null, [child]))])]), createVNode("tbody", null, [createVNode("tr", null, [createVNode("td", {
|
|
8950
10112
|
"colspan": "7"
|
|
8951
|
-
}, [createVNode(
|
|
10113
|
+
}, [createVNode(VirtualList, {
|
|
8952
10114
|
"ref": monthScrollRef,
|
|
8953
10115
|
"class": ns2.e("tbody-wrapper"),
|
|
10116
|
+
"data": allMonthList.value,
|
|
10117
|
+
"height": calendarListHeight,
|
|
10118
|
+
"itemHeight": calendarItemHeight,
|
|
8954
10119
|
"onScroll": handleScrollMonthList
|
|
8955
|
-
},
|
|
8956
|
-
"class": ns2.e("table-month"),
|
|
8957
|
-
"key": monthIndex
|
|
8958
|
-
}, [createVNode("div", {
|
|
8959
|
-
"class": ns2.e("table-month-title")
|
|
8960
|
-
}, [t("getYearMonthStr")(month.year, (month.month || 0) + 1)]), createVNode("table", {
|
|
8961
|
-
"class": ns2.e("table-month-content")
|
|
8962
|
-
}, [createVNode("tbody", null, [month.displayWeeks && month.displayWeeks.map((week, weekIndex) => createVNode("tr", {
|
|
8963
|
-
"class": ns2.e("table-week-header"),
|
|
8964
|
-
"key": weekIndex
|
|
8965
|
-
}, [week.map((day, dayIndex) => createVNode("td", {
|
|
8966
|
-
"key": dayIndex,
|
|
8967
|
-
"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")],
|
|
8968
|
-
"onClick": (e) => {
|
|
8969
|
-
e.preventDefault();
|
|
8970
|
-
e.stopPropagation();
|
|
8971
|
-
handlerSelectDate(day);
|
|
8972
|
-
}
|
|
8973
|
-
}, [createVNode("span", null, [day.inMonth ? day.day : ""])]))]))])])]))])])])])])])]);
|
|
10120
|
+
}, monthItemSlots)])])])])])]);
|
|
8974
10121
|
};
|
|
8975
10122
|
}
|
|
8976
10123
|
});
|
|
@@ -9049,7 +10196,6 @@ const usePopupLine = (hourListRef, minuteListRef, secondListRef, minTime, maxTim
|
|
|
9049
10196
|
};
|
|
9050
10197
|
const resetTimeValue = (time) => {
|
|
9051
10198
|
const timeValueArr = time.split(":");
|
|
9052
|
-
minTime.split(":");
|
|
9053
10199
|
let hh = 0;
|
|
9054
10200
|
let mm = 0;
|
|
9055
10201
|
let ss = 0;
|
|
@@ -9139,11 +10285,15 @@ const usePopupLine = (hourListRef, minuteListRef, secondListRef, minTime, maxTim
|
|
|
9139
10285
|
}
|
|
9140
10286
|
};
|
|
9141
10287
|
const activeTimeFun = (e, item, index2) => {
|
|
10288
|
+
var _a, _b;
|
|
9142
10289
|
if (item.isDisabled) {
|
|
9143
10290
|
return false;
|
|
9144
10291
|
} else {
|
|
9145
10292
|
setTimeActive(item, index2);
|
|
9146
|
-
e.target
|
|
10293
|
+
if ((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.parentElement) {
|
|
10294
|
+
const pdom = (_b = e == null ? void 0 : e.target) == null ? void 0 : _b.parentElement;
|
|
10295
|
+
pdom && pdom.parentElement && (pdom.parentElement.scrollTop = index2 * itemHeight);
|
|
10296
|
+
}
|
|
9147
10297
|
}
|
|
9148
10298
|
ctx.emit("change", { activeHour, activeMinute, activeSecond });
|
|
9149
10299
|
};
|
|
@@ -9213,33 +10363,38 @@ const timePickerProps = {
|
|
|
9213
10363
|
}
|
|
9214
10364
|
};
|
|
9215
10365
|
function useTimeScroll() {
|
|
9216
|
-
const scrollBoxDom = ref();
|
|
9217
|
-
const scrollContentDom = ref();
|
|
9218
|
-
const scrollThumbDom = ref();
|
|
9219
|
-
const scrollTrackDom = ref();
|
|
10366
|
+
const scrollBoxDom = ref(null);
|
|
10367
|
+
const scrollContentDom = ref(null);
|
|
10368
|
+
const scrollThumbDom = ref(null);
|
|
10369
|
+
const scrollTrackDom = ref(null);
|
|
9220
10370
|
const isDown = ref(false);
|
|
9221
10371
|
const getScrollHeight = () => {
|
|
9222
|
-
|
|
9223
|
-
|
|
10372
|
+
var _a, _b;
|
|
10373
|
+
const thumbHeight = (((_a = scrollContentDom.value) == null ? void 0 : _a.clientHeight) || 0) / (((_b = scrollContentDom.value) == null ? void 0 : _b.scrollHeight) || 0) * 100;
|
|
10374
|
+
scrollThumbDom.value && (scrollThumbDom.value.style.height = thumbHeight + "%");
|
|
9224
10375
|
};
|
|
9225
10376
|
const setVirtualScroll = () => {
|
|
9226
|
-
|
|
9227
|
-
|
|
10377
|
+
var _a, _b;
|
|
10378
|
+
const thumbMoveY = (((_a = scrollContentDom.value) == null ? void 0 : _a.scrollTop) || 0) * 100 / (((_b = scrollContentDom.value) == null ? void 0 : _b.clientHeight) || 0);
|
|
10379
|
+
scrollThumbDom.value && (scrollThumbDom.value.style.transform = `translateY(${thumbMoveY}%)`);
|
|
9228
10380
|
};
|
|
9229
10381
|
const clickTrackFun = (e) => {
|
|
9230
|
-
|
|
10382
|
+
var _a, _b, _c, _d, _e;
|
|
10383
|
+
const offsetNum = (((_c = (_b = (_a = scrollTrackDom.value) == null ? void 0 : _a.getBoundingClientRect) == null ? void 0 : _b.call(_a)) == null ? void 0 : _c.top) || 0) - e.clientY;
|
|
9231
10384
|
const offset2 = Math.abs(offsetNum > 0 ? 0 : offsetNum);
|
|
9232
|
-
const thumbCenter = scrollThumbDom.value.offsetHeight / 2;
|
|
9233
|
-
const thumbPosition = (offset2 - thumbCenter) * 100 / scrollContentDom.value.offsetHeight;
|
|
9234
|
-
|
|
9235
|
-
|
|
10385
|
+
const thumbCenter = (((_d = scrollThumbDom.value) == null ? void 0 : _d.offsetHeight) || 0) / 2;
|
|
10386
|
+
const thumbPosition = (offset2 - thumbCenter) * 100 / (((_e = scrollContentDom.value) == null ? void 0 : _e.offsetHeight) || 0);
|
|
10387
|
+
if (scrollContentDom.value) {
|
|
10388
|
+
scrollContentDom.value.scrollTop = thumbPosition * scrollContentDom.value.scrollHeight / 100;
|
|
10389
|
+
scrollContentDom.value.style.top = scrollContentDom.value.scrollTop + "px";
|
|
10390
|
+
}
|
|
9236
10391
|
};
|
|
9237
10392
|
const thumbMouseMove = (e) => {
|
|
9238
10393
|
const path = e.composedPath && e.composedPath() || e.path;
|
|
9239
|
-
if (path.includes(scrollBoxDom.value) || isDown.value) {
|
|
9240
|
-
scrollTrackDom.value.style.opacity = 1;
|
|
10394
|
+
if (scrollBoxDom.value && path.includes(scrollBoxDom.value) || isDown.value) {
|
|
10395
|
+
scrollTrackDom.value && (scrollTrackDom.value.style.opacity = "1");
|
|
9241
10396
|
} else {
|
|
9242
|
-
scrollTrackDom.value.style.opacity = 0;
|
|
10397
|
+
scrollTrackDom.value && (scrollTrackDom.value.style.opacity = "0");
|
|
9243
10398
|
}
|
|
9244
10399
|
if (!isDown.value) {
|
|
9245
10400
|
return;
|
|
@@ -9248,7 +10403,7 @@ function useTimeScroll() {
|
|
|
9248
10403
|
};
|
|
9249
10404
|
const mouseDownThum = () => {
|
|
9250
10405
|
isDown.value = true;
|
|
9251
|
-
scrollTrackDom.value.style.opacity = 1;
|
|
10406
|
+
scrollTrackDom.value && (scrollTrackDom.value.style.opacity = "1");
|
|
9252
10407
|
};
|
|
9253
10408
|
const mouseOutThum = (e) => {
|
|
9254
10409
|
isDown.value = false;
|
|
@@ -9316,18 +10471,20 @@ var TimeScroll = defineComponent({
|
|
|
9316
10471
|
} = useTimeScroll();
|
|
9317
10472
|
const marginRight = getScrollWidth();
|
|
9318
10473
|
onMounted(() => {
|
|
10474
|
+
var _a, _b, _c;
|
|
9319
10475
|
getScrollWidth();
|
|
9320
10476
|
getScrollHeight();
|
|
9321
|
-
scrollBoxDom.value.addEventListener("click", setVirtualScroll);
|
|
9322
|
-
scrollContentDom.value.addEventListener("scroll", setVirtualScroll);
|
|
9323
|
-
scrollThumbDom.value.addEventListener("mousedown", mouseDownThum);
|
|
10477
|
+
(_a = scrollBoxDom.value) == null ? void 0 : _a.addEventListener("click", setVirtualScroll);
|
|
10478
|
+
(_b = scrollContentDom.value) == null ? void 0 : _b.addEventListener("scroll", setVirtualScroll);
|
|
10479
|
+
(_c = scrollThumbDom.value) == null ? void 0 : _c.addEventListener("mousedown", mouseDownThum);
|
|
9324
10480
|
document.addEventListener("mouseup", mouseOutThum);
|
|
9325
10481
|
document.addEventListener("mousemove", thumbMouseMove);
|
|
9326
10482
|
});
|
|
9327
10483
|
onBeforeUnmount(() => {
|
|
9328
|
-
|
|
9329
|
-
|
|
9330
|
-
|
|
10484
|
+
var _a, _b, _c;
|
|
10485
|
+
(_a = scrollBoxDom.value) == null ? void 0 : _a.removeEventListener("click", setVirtualScroll);
|
|
10486
|
+
(_b = scrollContentDom.value) == null ? void 0 : _b.removeEventListener("scroll", setVirtualScroll);
|
|
10487
|
+
(_c = scrollThumbDom.value) == null ? void 0 : _c.removeEventListener("mousedown", mouseDownThum);
|
|
9331
10488
|
});
|
|
9332
10489
|
onUnmounted(() => {
|
|
9333
10490
|
document.removeEventListener("mouseup", mouseOutThum);
|
|
@@ -9553,8 +10710,8 @@ defineComponent({
|
|
|
9553
10710
|
});
|
|
9554
10711
|
class View {
|
|
9555
10712
|
constructor() {
|
|
9556
|
-
|
|
9557
|
-
|
|
10713
|
+
this.top = "50%";
|
|
10714
|
+
this.left = "50%";
|
|
9558
10715
|
}
|
|
9559
10716
|
}
|
|
9560
10717
|
const loadingProps = {
|
|
@@ -9572,13 +10729,9 @@ const loadingProps = {
|
|
|
9572
10729
|
};
|
|
9573
10730
|
class LoadingOptions {
|
|
9574
10731
|
constructor() {
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
__publicField(this, "backdrop", true);
|
|
9579
|
-
__publicField(this, "positionType", "relative");
|
|
9580
|
-
__publicField(this, "view", new View());
|
|
9581
|
-
__publicField(this, "zIndex");
|
|
10732
|
+
this.backdrop = true;
|
|
10733
|
+
this.positionType = "relative";
|
|
10734
|
+
this.view = new View();
|
|
9582
10735
|
}
|
|
9583
10736
|
}
|
|
9584
10737
|
var loading = "";
|
|
@@ -9646,7 +10799,7 @@ var Loading = defineComponent({
|
|
|
9646
10799
|
});
|
|
9647
10800
|
const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
|
|
9648
10801
|
function createComponent(component, props, children = null) {
|
|
9649
|
-
const vnode = h(component,
|
|
10802
|
+
const vnode = h(component, { ...props }, children);
|
|
9650
10803
|
const container = document.createElement("div");
|
|
9651
10804
|
vnode[COMPONENT_CONTAINER_SYMBOL] = container;
|
|
9652
10805
|
render(vnode, container);
|
|
@@ -9733,9 +10886,12 @@ const removeAttribute = (el) => {
|
|
|
9733
10886
|
};
|
|
9734
10887
|
const handleProps = (el, vprops) => {
|
|
9735
10888
|
var _a;
|
|
9736
|
-
const props =
|
|
10889
|
+
const props = {
|
|
10890
|
+
...new LoadingOptions(),
|
|
10891
|
+
...vprops
|
|
10892
|
+
};
|
|
9737
10893
|
const loadingTemplateRef = props.loadingTemplateRef;
|
|
9738
|
-
const loadingInstance = createComponent(loadingConstructor,
|
|
10894
|
+
const loadingInstance = createComponent(loadingConstructor, { ...props }, loadingTemplateRef ? () => loadingTemplateRef : null);
|
|
9739
10895
|
el.style.position = props.positionType;
|
|
9740
10896
|
el.options = props;
|
|
9741
10897
|
el.instance = loadingInstance;
|
|
@@ -9901,14 +11057,14 @@ function useYearCalendarPanel(props, ctx) {
|
|
|
9901
11057
|
const goToShowYear = (date4) => {
|
|
9902
11058
|
if (date4) {
|
|
9903
11059
|
const index2 = Math.floor((date4.year() - calendarRange.value[0]) / 3);
|
|
9904
|
-
let
|
|
9905
|
-
if (
|
|
9906
|
-
|
|
11060
|
+
let scrollIndex = index2 - 1;
|
|
11061
|
+
if (scrollIndex < 0) {
|
|
11062
|
+
scrollIndex = 0;
|
|
9907
11063
|
}
|
|
9908
11064
|
nextTick(() => {
|
|
9909
11065
|
var _a;
|
|
9910
11066
|
const scrollEl = yarListScrollRef.value;
|
|
9911
|
-
(_a = scrollEl == null ? void 0 : scrollEl.
|
|
11067
|
+
(_a = scrollEl == null ? void 0 : scrollEl.scrollTo) == null ? void 0 : _a.call(scrollEl, scrollIndex);
|
|
9912
11068
|
});
|
|
9913
11069
|
}
|
|
9914
11070
|
};
|
|
@@ -10022,23 +11178,30 @@ var YearCalendarPanel = defineComponent({
|
|
|
10022
11178
|
handlerSelectYear
|
|
10023
11179
|
} = useYearCalendarPanel(props, ctx);
|
|
10024
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
|
+
};
|
|
10025
11196
|
return createVNode("div", {
|
|
10026
11197
|
"class": ns2.e("year-calendar-panel")
|
|
10027
|
-
}, [createVNode(
|
|
11198
|
+
}, [createVNode(VirtualList, {
|
|
10028
11199
|
"ref": yarListScrollRef,
|
|
10029
|
-
"class": ns2.e("year-list")
|
|
10030
|
-
|
|
10031
|
-
"
|
|
10032
|
-
"
|
|
10033
|
-
},
|
|
10034
|
-
"key": year,
|
|
10035
|
-
"class": getYearItemCls(year),
|
|
10036
|
-
"onClick": (e) => {
|
|
10037
|
-
e.preventDefault();
|
|
10038
|
-
e.stopPropagation();
|
|
10039
|
-
handlerSelectYear(year);
|
|
10040
|
-
}
|
|
10041
|
-
}, [year]))]))])]);
|
|
11200
|
+
"class": ns2.e("year-list"),
|
|
11201
|
+
"data": yearList.value,
|
|
11202
|
+
"height": yearPickerHeight,
|
|
11203
|
+
"itemHeight": yearCalendarItemHeight
|
|
11204
|
+
}, yearItemSlots)]);
|
|
10042
11205
|
};
|
|
10043
11206
|
}
|
|
10044
11207
|
});
|
|
@@ -10087,25 +11250,25 @@ function useMonthCalendarPanel(props, ctx) {
|
|
|
10087
11250
|
};
|
|
10088
11251
|
const goToYearDate = () => {
|
|
10089
11252
|
updateYearActive();
|
|
10090
|
-
let
|
|
10091
|
-
if (
|
|
10092
|
-
|
|
11253
|
+
let scrollIndex = currentYearIndex.value - 4;
|
|
11254
|
+
if (scrollIndex < 0) {
|
|
11255
|
+
scrollIndex = 0;
|
|
10093
11256
|
}
|
|
10094
11257
|
nextTick(() => {
|
|
10095
11258
|
var _a;
|
|
10096
11259
|
const scrollEl = yearScrollRef.value;
|
|
10097
|
-
(_a = scrollEl == null ? void 0 : scrollEl.
|
|
11260
|
+
(_a = scrollEl == null ? void 0 : scrollEl.scrollTo) == null ? void 0 : _a.call(scrollEl, scrollIndex);
|
|
10098
11261
|
});
|
|
10099
11262
|
};
|
|
10100
11263
|
const goToMonthDate = () => {
|
|
10101
|
-
let
|
|
10102
|
-
if (
|
|
10103
|
-
|
|
11264
|
+
let scrollIndex = currentYearIndex.value;
|
|
11265
|
+
if (scrollIndex < 0) {
|
|
11266
|
+
scrollIndex = 0;
|
|
10104
11267
|
}
|
|
10105
11268
|
nextTick(() => {
|
|
10106
11269
|
var _a;
|
|
10107
11270
|
const scrollEl = monthScrollRef.value;
|
|
10108
|
-
(_a = scrollEl == null ? void 0 : scrollEl.
|
|
11271
|
+
(_a = scrollEl == null ? void 0 : scrollEl.scrollTo) == null ? void 0 : _a.call(scrollEl, scrollIndex);
|
|
10109
11272
|
});
|
|
10110
11273
|
};
|
|
10111
11274
|
const goToShowDate = (date4) => {
|
|
@@ -10116,11 +11279,7 @@ function useMonthCalendarPanel(props, ctx) {
|
|
|
10116
11279
|
};
|
|
10117
11280
|
onBeforeMount(() => {
|
|
10118
11281
|
today.value = new Date();
|
|
10119
|
-
|
|
10120
|
-
calendarRange.value = props.calendarRange;
|
|
10121
|
-
} else {
|
|
10122
|
-
calendarRange.value = [today.value.getFullYear() - 25, today.value.getFullYear() + 25];
|
|
10123
|
-
}
|
|
11282
|
+
calendarRange.value = props.calendarRange;
|
|
10124
11283
|
initYearList();
|
|
10125
11284
|
const toDate = getToDate(props.dateValue);
|
|
10126
11285
|
if (props.visible && toDate) {
|
|
@@ -10128,7 +11287,8 @@ function useMonthCalendarPanel(props, ctx) {
|
|
|
10128
11287
|
}
|
|
10129
11288
|
});
|
|
10130
11289
|
const handlerSelectYear = (year) => {
|
|
10131
|
-
|
|
11290
|
+
const toDate = dayjs(new Date(year, 0, 1)).locale("zh-cn");
|
|
11291
|
+
goToShowDate(toDate);
|
|
10132
11292
|
};
|
|
10133
11293
|
const debounceScrollMonth = lodash.exports.throttle((newScrollTop) => {
|
|
10134
11294
|
currentYearIndex.value = Math.floor(newScrollTop / monthCalendarItemHeight) + (newScrollTop % monthCalendarItemHeight > 100 ? 1 : 0);
|
|
@@ -10247,40 +11407,54 @@ var MonthCalendarPanel = defineComponent({
|
|
|
10247
11407
|
handlerSelectMonth
|
|
10248
11408
|
} = useMonthCalendarPanel(props, ctx);
|
|
10249
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
|
+
};
|
|
10250
11440
|
return createVNode("div", {
|
|
10251
11441
|
"class": ns2.e("month-calendar-panel")
|
|
10252
|
-
}, [createVNode(
|
|
11442
|
+
}, [createVNode(VirtualList, {
|
|
10253
11443
|
"ref": yearScrollRef,
|
|
10254
|
-
"class": ns2.e("year-list")
|
|
10255
|
-
|
|
10256
|
-
"
|
|
10257
|
-
"
|
|
10258
|
-
|
|
10259
|
-
}, [year.year]))]), createVNode("div", {
|
|
11444
|
+
"class": ns2.e("year-list"),
|
|
11445
|
+
"data": yearList.value,
|
|
11446
|
+
"height": monthPickerHeight,
|
|
11447
|
+
"itemHeight": yearItemHeight
|
|
11448
|
+
}, yearItemSlots), createVNode("div", {
|
|
10260
11449
|
"class": ns2.e("month-wrapper")
|
|
10261
|
-
}, [createVNode(
|
|
10262
|
-
"class": ns2.e("month-list"),
|
|
11450
|
+
}, [createVNode(VirtualList, {
|
|
10263
11451
|
"ref": monthScrollRef,
|
|
10264
|
-
"
|
|
10265
|
-
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
"
|
|
10269
|
-
},
|
|
10270
|
-
"class": ns2.e("table-month-title")
|
|
10271
|
-
}, [year.year + t("year")]), createVNode("table", {
|
|
10272
|
-
"class": ns2.e("table-month-content")
|
|
10273
|
-
}, [createVNode("tbody", null, [monthList.map((season, seasonIndex) => createVNode("tr", {
|
|
10274
|
-
"key": seasonIndex
|
|
10275
|
-
}, [season.map((month) => createVNode("td", {
|
|
10276
|
-
"key": month,
|
|
10277
|
-
"class": getMonthItemCls(year.year, month),
|
|
10278
|
-
"onClick": (e) => {
|
|
10279
|
-
e.preventDefault();
|
|
10280
|
-
e.stopPropagation();
|
|
10281
|
-
handlerSelectMonth(year.year, month);
|
|
10282
|
-
}
|
|
10283
|
-
}, [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)])]);
|
|
10284
11458
|
};
|
|
10285
11459
|
}
|
|
10286
11460
|
});
|
|
@@ -10540,7 +11714,7 @@ var DatePickerPro = defineComponent({
|
|
|
10540
11714
|
onSelectedDate,
|
|
10541
11715
|
handlerClearTime
|
|
10542
11716
|
} = usePickerPro(props, ctx, t);
|
|
10543
|
-
const position = ref(["bottom-start"]);
|
|
11717
|
+
const position = ref(["bottom-start", "top-start"]);
|
|
10544
11718
|
return () => {
|
|
10545
11719
|
var _a, _b;
|
|
10546
11720
|
const vSlots = {
|
|
@@ -10593,7 +11767,7 @@ var DatePickerPro = defineComponent({
|
|
|
10593
11767
|
};
|
|
10594
11768
|
}
|
|
10595
11769
|
});
|
|
10596
|
-
const rangeDatePickerProProps =
|
|
11770
|
+
const rangeDatePickerProProps = {
|
|
10597
11771
|
modelValue: {
|
|
10598
11772
|
type: Array,
|
|
10599
11773
|
default: ["", ""]
|
|
@@ -10605,8 +11779,9 @@ const rangeDatePickerProProps = __spreadValues({
|
|
|
10605
11779
|
separator: {
|
|
10606
11780
|
type: String,
|
|
10607
11781
|
default: "-"
|
|
10608
|
-
}
|
|
10609
|
-
|
|
11782
|
+
},
|
|
11783
|
+
...datePickerProCommonProps
|
|
11784
|
+
};
|
|
10610
11785
|
function useRangePickerPro(props, ctx) {
|
|
10611
11786
|
const formContext = inject(FORM_TOKEN, void 0);
|
|
10612
11787
|
const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
|
|
@@ -10767,7 +11942,7 @@ var DRangeDatePickerPro = defineComponent({
|
|
|
10767
11942
|
handlerClearTime,
|
|
10768
11943
|
onChangeRangeFocusType
|
|
10769
11944
|
} = useRangePickerPro(props, ctx);
|
|
10770
|
-
const position = ref(["bottom-start"]);
|
|
11945
|
+
const position = ref(["bottom-start", "top-start"]);
|
|
10771
11946
|
return () => {
|
|
10772
11947
|
var _a, _b;
|
|
10773
11948
|
const vSlots = {
|