snail.vue 2.0.10 → 2.0.12
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/dist/snail.vue.d.ts +252 -104
- package/dist/snail.vue.js +862 -338
- package/dist/snail.vue.umd.js +861 -337
- package/dist/styles/snail.vue.vue.css +27 -25
- package/package.json +2 -2
package/dist/snail.vue.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//@ sourceURL=/snail.vue.js
|
|
2
2
|
import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createTextVNode, shallowRef, normalizeStyle, createElementVNode, toDisplayString, Fragment, renderList, unref, mergeModels, useModel, computed, createCommentVNode, createBlock, nextTick, onMounted, onUnmounted, useTemplateRef, createVNode, watch, withDirectives, isRef, vModelText, createApp, Transition, withCtx, normalizeProps, guardReactiveProps, ref, onErrorCaptured, resolveDynamicComponent, mergeProps, createSlots, withModifiers, getCurrentInstance, resolveComponent, onBeforeUnmount, TransitionGroup, getCurrentScope, onScopeDispose } from 'vue';
|
|
3
|
-
import { throwError, isArrayNotEmpty, isStringNotEmpty, useKey, isArray, useTimer, newId, script, isFunction, getFromArray, mountScope, useScopes, throwIfFalse, isPromise, wait, isObject, isNumberNotNaN, hasAny, mustFunction, useScope, removeFromArray, mustObject, delay, defer, useAsyncScope, useHook, throwIfTrue,
|
|
3
|
+
import { throwError, isArrayNotEmpty, isStringNotEmpty, useKey, isArray, useTimer, newId, script, isFunction, getFromArray, mountScope, useScopes, throwIfFalse, isPromise, wait, isObject, isNumberNotNaN, hasAny, mustFunction, useScope, removeFromArray, mustObject, delay, defer, useAsyncScope, useHook, throwIfTrue, correctTimeValue, getDateValue, formatDateValue, parseTimeValue, getTimeValue, padStart, formatTimeValue, parseDateValue, correctDateFormat, getDateByValue, correctNumber, onMountScope } from 'snail.core';
|
|
4
4
|
import { css, link, useObserver, useAnimation } from 'snail.view';
|
|
5
5
|
|
|
6
6
|
const _hoisted_1$k = ["title"];
|
|
7
|
-
var _sfc_main$
|
|
7
|
+
var _sfc_main$z = defineComponent({
|
|
8
8
|
...{
|
|
9
9
|
name: "Button",
|
|
10
10
|
inheritAttrs: true
|
|
@@ -65,8 +65,8 @@ function getSvgDraw(iconType, draw) {
|
|
|
65
65
|
|
|
66
66
|
const _hoisted_1$j = ["width", "height"];
|
|
67
67
|
const _hoisted_2$c = ["textContent"];
|
|
68
|
-
const _hoisted_3$
|
|
69
|
-
var _sfc_main$
|
|
68
|
+
const _hoisted_3$a = ["fill", "stroke", "stroke-width", "d"];
|
|
69
|
+
var _sfc_main$y = defineComponent({
|
|
70
70
|
...{
|
|
71
71
|
name: "Icon",
|
|
72
72
|
inheritAttrs: true
|
|
@@ -102,7 +102,7 @@ var _sfc_main$x = defineComponent({
|
|
|
102
102
|
stroke: __props.stroke,
|
|
103
103
|
"stroke-width": __props.strokeWidth,
|
|
104
104
|
d
|
|
105
|
-
}, null, 8, _hoisted_3$
|
|
105
|
+
}, null, 8, _hoisted_3$a);
|
|
106
106
|
}), 256))], 46, _hoisted_1$j);
|
|
107
107
|
};
|
|
108
108
|
}
|
|
@@ -110,9 +110,9 @@ var _sfc_main$x = defineComponent({
|
|
|
110
110
|
|
|
111
111
|
const _hoisted_1$i = ["title", "onClick"];
|
|
112
112
|
const _hoisted_2$b = ["type", "checked"];
|
|
113
|
-
const _hoisted_3$
|
|
114
|
-
const _hoisted_4$
|
|
115
|
-
var _sfc_main$
|
|
113
|
+
const _hoisted_3$9 = ["textContent"];
|
|
114
|
+
const _hoisted_4$7 = ["textContent"];
|
|
115
|
+
var _sfc_main$x = defineComponent({
|
|
116
116
|
...{
|
|
117
117
|
name: "Choose",
|
|
118
118
|
inheritAttrs: true
|
|
@@ -191,7 +191,7 @@ var _sfc_main$w = defineComponent({
|
|
|
191
191
|
}, null, 8, _hoisted_2$b)) : unref(mode) == "beautiful" ? (openBlock(), createElementBlock("div", {
|
|
192
192
|
key: 1,
|
|
193
193
|
class: normalizeClass(["status", [node.selected ? "selected" : ""]])
|
|
194
|
-
}, [node.selected ? (openBlock(), createBlock(_sfc_main$
|
|
194
|
+
}, [node.selected ? (openBlock(), createBlock(_sfc_main$y, {
|
|
195
195
|
key: 0,
|
|
196
196
|
type: "success",
|
|
197
197
|
size: 12,
|
|
@@ -200,18 +200,22 @@ var _sfc_main$w = defineComponent({
|
|
|
200
200
|
key: 2,
|
|
201
201
|
class: "item-text",
|
|
202
202
|
textContent: toDisplayString(node.item.text)
|
|
203
|
-
}, null, 8, _hoisted_3$
|
|
203
|
+
}, null, 8, _hoisted_3$9)) : createCommentVNode("", true), node.item.description ? (openBlock(), createElementBlock("span", {
|
|
204
204
|
key: 3,
|
|
205
205
|
class: "item-des",
|
|
206
206
|
textContent: toDisplayString(node.item.description)
|
|
207
|
-
}, null, 8, _hoisted_4$
|
|
207
|
+
}, null, 8, _hoisted_4$7)) : createCommentVNode("", true)], 14, _hoisted_1$i);
|
|
208
208
|
}), 128))], 2);
|
|
209
209
|
};
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
212
|
|
|
213
|
+
var addLink = href => setTimeout(link.register, 0, href);
|
|
214
|
+
|
|
215
|
+
addLink("/styles/snail.vue.vue.css");
|
|
216
|
+
|
|
213
217
|
const _hoisted_1$h = ["id"];
|
|
214
|
-
var _sfc_main$
|
|
218
|
+
var _sfc_main$w = defineComponent({
|
|
215
219
|
__name: "datepicker",
|
|
216
220
|
props: {
|
|
217
221
|
type: {},
|
|
@@ -367,11 +371,7 @@ var _sfc_main$v = defineComponent({
|
|
|
367
371
|
}
|
|
368
372
|
});
|
|
369
373
|
|
|
370
|
-
var
|
|
371
|
-
|
|
372
|
-
addLink("/styles/snail.vue.vue.css");
|
|
373
|
-
|
|
374
|
-
var _sfc_main$u = defineComponent({
|
|
374
|
+
var _sfc_main$v = defineComponent({
|
|
375
375
|
...{
|
|
376
376
|
name: "Footer",
|
|
377
377
|
inheritAttrs: true
|
|
@@ -402,13 +402,13 @@ var _sfc_main$u = defineComponent({
|
|
|
402
402
|
class: normalizeClass(["snail-footer", {
|
|
403
403
|
"start-divider": __props.divider
|
|
404
404
|
}, __props.align || "right"])
|
|
405
|
-
}, [renderSlot(_ctx.$slots, "default", {}, () => [__props.cancelDisabled != true ? (openBlock(), createBlock(_sfc_main$
|
|
405
|
+
}, [renderSlot(_ctx.$slots, "default", {}, () => [__props.cancelDisabled != true ? (openBlock(), createBlock(_sfc_main$z, {
|
|
406
406
|
key: 0,
|
|
407
407
|
size: "max",
|
|
408
408
|
type: "default",
|
|
409
409
|
onClick: _cache[0] || (_cache[0] = $event => emits("cancel")),
|
|
410
410
|
textContent: toDisplayString(__props.cancelName || "取消")
|
|
411
|
-
}, null, 8, ["textContent"])) : createCommentVNode("", true), __props.confirmDisabled != true ? (openBlock(), createBlock(_sfc_main$
|
|
411
|
+
}, null, 8, ["textContent"])) : createCommentVNode("", true), __props.confirmDisabled != true ? (openBlock(), createBlock(_sfc_main$z, {
|
|
412
412
|
key: 1,
|
|
413
413
|
size: "max",
|
|
414
414
|
type: "primary",
|
|
@@ -420,7 +420,7 @@ var _sfc_main$u = defineComponent({
|
|
|
420
420
|
});
|
|
421
421
|
|
|
422
422
|
const _hoisted_1$g = ["textContent"];
|
|
423
|
-
var _sfc_main$
|
|
423
|
+
var _sfc_main$u = defineComponent({
|
|
424
424
|
...{
|
|
425
425
|
name: "Header",
|
|
426
426
|
inheritAttrs: true
|
|
@@ -459,7 +459,7 @@ var _sfc_main$t = defineComponent({
|
|
|
459
459
|
key: 0,
|
|
460
460
|
textContent: toDisplayString(__props.title),
|
|
461
461
|
class: normalizeClass(["header-title", __props.titleAlign])
|
|
462
|
-
}, null, 10, _hoisted_1$g)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), __props.closeDisabled != true ? (openBlock(), createBlock(_sfc_main$
|
|
462
|
+
}, null, 10, _hoisted_1$g)) : createCommentVNode("", true), renderSlot(_ctx.$slots, "default"), __props.closeDisabled != true ? (openBlock(), createBlock(_sfc_main$y, {
|
|
463
463
|
key: 1,
|
|
464
464
|
type: "close",
|
|
465
465
|
size: 22,
|
|
@@ -477,12 +477,12 @@ const _hoisted_2$a = {
|
|
|
477
477
|
class: "required",
|
|
478
478
|
textContent: "*"
|
|
479
479
|
};
|
|
480
|
-
const _hoisted_3$
|
|
480
|
+
const _hoisted_3$8 = {
|
|
481
481
|
class: "input-body"
|
|
482
482
|
};
|
|
483
|
-
const _hoisted_4$
|
|
484
|
-
const _hoisted_5$
|
|
485
|
-
var _sfc_main$
|
|
483
|
+
const _hoisted_4$6 = ["type", "value", "readonly", "placeholder", "title"];
|
|
484
|
+
const _hoisted_5$4 = ["title"];
|
|
485
|
+
var _sfc_main$t = defineComponent({
|
|
486
486
|
...{
|
|
487
487
|
name: "Input",
|
|
488
488
|
inheritAttrs: true
|
|
@@ -534,7 +534,7 @@ var _sfc_main$s = defineComponent({
|
|
|
534
534
|
}, [createElementVNode("span", {
|
|
535
535
|
class: "text",
|
|
536
536
|
textContent: toDisplayString(__props.title)
|
|
537
|
-
}, null, 8, _hoisted_1$f), __props.readonly != true && __props.required == true ? (openBlock(), createElementBlock("span", _hoisted_2$a)) : createCommentVNode("", true)], 4)) : createCommentVNode("", true), createElementVNode("div", _hoisted_3$
|
|
537
|
+
}, null, 8, _hoisted_1$f), __props.readonly != true && __props.required == true ? (openBlock(), createElementBlock("span", _hoisted_2$a)) : createCommentVNode("", true)], 4)) : createCommentVNode("", true), createElementVNode("div", _hoisted_3$8, [createElementVNode("input", {
|
|
538
538
|
ref: "input-el",
|
|
539
539
|
type: __props.type || "text",
|
|
540
540
|
value: inputModel.value,
|
|
@@ -543,15 +543,15 @@ var _sfc_main$s = defineComponent({
|
|
|
543
543
|
title: inputModel.value,
|
|
544
544
|
onChange: onValueChange,
|
|
545
545
|
onClick: _cache[0] || (_cache[0] = $event => emits("click"))
|
|
546
|
-
}, null, 40, _hoisted_4$
|
|
546
|
+
}, null, 40, _hoisted_4$6), !!validateRef.value ? (openBlock(), createElementBlock("span", {
|
|
547
547
|
key: 0,
|
|
548
548
|
class: "validate",
|
|
549
549
|
title: validateRef.value
|
|
550
|
-
}, [createVNode(_sfc_main$
|
|
550
|
+
}, [createVNode(_sfc_main$y, {
|
|
551
551
|
type: "error",
|
|
552
552
|
size: 16,
|
|
553
553
|
color: "red"
|
|
554
|
-
})], 8, _hoisted_5$
|
|
554
|
+
})], 8, _hoisted_5$4)) : createCommentVNode("", true)])], 2);
|
|
555
555
|
};
|
|
556
556
|
}
|
|
557
557
|
});
|
|
@@ -761,15 +761,15 @@ const _hoisted_1$e = {
|
|
|
761
761
|
class: "number-prefix"
|
|
762
762
|
};
|
|
763
763
|
const _hoisted_2$9 = ["textContent"];
|
|
764
|
-
const _hoisted_3$
|
|
765
|
-
const _hoisted_4$
|
|
764
|
+
const _hoisted_3$7 = ["inputmode", "placeholder", "title"];
|
|
765
|
+
const _hoisted_4$5 = {
|
|
766
766
|
key: 1,
|
|
767
767
|
class: "number-suffix"
|
|
768
768
|
};
|
|
769
|
-
const _hoisted_5$
|
|
770
|
-
const _hoisted_6$
|
|
769
|
+
const _hoisted_5$3 = ["textContent"];
|
|
770
|
+
const _hoisted_6$2 = ["title", "textContent"];
|
|
771
771
|
const _hoisted_7$1 = ["title", "textContent"];
|
|
772
|
-
var _sfc_main$
|
|
772
|
+
var _sfc_main$s = defineComponent({
|
|
773
773
|
__name: "number",
|
|
774
774
|
props: mergeModels({
|
|
775
775
|
placeholder: {},
|
|
@@ -931,18 +931,18 @@ var _sfc_main$r = defineComponent({
|
|
|
931
931
|
onFocus: _cache[1] || (_cache[1] = $event => isRef(needBackSection) ? needBackSection.value = true : needBackSection = true),
|
|
932
932
|
onPaste: _cache[2] || (_cache[2] = $event => isRef(needBackSection) ? needBackSection.value = false : needBackSection = false),
|
|
933
933
|
onBlur: _cache[3] || (_cache[3] = $event => formatOnEnd(true))
|
|
934
|
-
}, null, 40, _hoisted_3$
|
|
934
|
+
}, null, 40, _hoisted_3$7), [[vModelText, displayValueRef.value]]), unref(controls) == "default" ? (openBlock(), createElementBlock(Fragment, {
|
|
935
935
|
key: 0
|
|
936
936
|
}, [createElementVNode("div", {
|
|
937
937
|
class: "controls default subtract",
|
|
938
938
|
onClick: _cache[4] || (_cache[4] = $event => onStepClick(false))
|
|
939
|
-
}, [createVNode(_sfc_main$
|
|
939
|
+
}, [createVNode(_sfc_main$y, {
|
|
940
940
|
type: "subtract",
|
|
941
941
|
size: 20
|
|
942
942
|
})]), createElementVNode("div", {
|
|
943
943
|
class: "controls default plus",
|
|
944
944
|
onClick: _cache[5] || (_cache[5] = $event => onStepClick(true))
|
|
945
|
-
}, [createVNode(_sfc_main$
|
|
945
|
+
}, [createVNode(_sfc_main$y, {
|
|
946
946
|
type: "plus",
|
|
947
947
|
size: 20
|
|
948
948
|
})])], 64)) : unref(controls) == "right" ? (openBlock(), createElementBlock(Fragment, {
|
|
@@ -950,26 +950,26 @@ var _sfc_main$r = defineComponent({
|
|
|
950
950
|
}, [createElementVNode("div", {
|
|
951
951
|
class: "controls right plus",
|
|
952
952
|
onClick: _cache[6] || (_cache[6] = $event => onStepClick(true))
|
|
953
|
-
}, [createVNode(_sfc_main$
|
|
953
|
+
}, [createVNode(_sfc_main$y, {
|
|
954
954
|
type: "arrow",
|
|
955
955
|
size: 20,
|
|
956
956
|
rotate: 270
|
|
957
957
|
})]), createElementVNode("div", {
|
|
958
958
|
class: "controls right subtract",
|
|
959
959
|
onClick: _cache[7] || (_cache[7] = $event => onStepClick(false))
|
|
960
|
-
}, [createVNode(_sfc_main$
|
|
960
|
+
}, [createVNode(_sfc_main$y, {
|
|
961
961
|
type: "arrow",
|
|
962
962
|
size: 20,
|
|
963
963
|
rotate: 90
|
|
964
|
-
})])], 64)) : createCommentVNode("", true)], 2), unref(hasSuffix) ? (openBlock(), createElementBlock("div", _hoisted_4$
|
|
964
|
+
})])], 64)) : createCommentVNode("", true)], 2), unref(hasSuffix) ? (openBlock(), createElementBlock("div", _hoisted_4$5, [createElementVNode("span", {
|
|
965
965
|
class: "ellipsis",
|
|
966
966
|
textContent: toDisplayString(unref(suffix))
|
|
967
|
-
}, null, 8, _hoisted_5$
|
|
967
|
+
}, null, 8, _hoisted_5$3)])) : createCommentVNode("", true), unref(upper) ? (openBlock(), createElementBlock("div", {
|
|
968
968
|
key: 2,
|
|
969
969
|
class: "number-util ellipsis",
|
|
970
970
|
title: upperTextRef.value,
|
|
971
971
|
textContent: toDisplayString(`大写:${upperTextRef.value || ""}`)
|
|
972
|
-
}, null, 8, _hoisted_6$
|
|
972
|
+
}, null, 8, _hoisted_6$2)) : createCommentVNode("", true), unref(thousands) == "below" ? (openBlock(), createElementBlock("div", {
|
|
973
973
|
key: 3,
|
|
974
974
|
class: "number-util ellipsis",
|
|
975
975
|
title: thousandsTextRef.value,
|
|
@@ -981,7 +981,7 @@ var _sfc_main$r = defineComponent({
|
|
|
981
981
|
|
|
982
982
|
const _hoisted_1$d = ["placeholder", "readonly"];
|
|
983
983
|
const searchIon = "M 860.16 824.32 l -163.84 -163.84 c 102.4 -120.32 97.28 -302.08 -17.92 -414.72 c -120.32 -120.32 -314.88 -120.32 -435.2 0 c -120.32 120.32 -120.32 314.88 0 435.2 c 112.64 112.64 294.4 120.32 414.72 17.92 l 163.84 163.84 c 10.24 10.24 25.6 10.24 35.84 0 c 12.8 -12.8 12.8 -28.16 2.56 -38.4 Z M 281.6 642.56 C 181.76 542.72 181.76 381.44 281.6 281.6 c 99.84 -99.84 261.12 -99.84 360.96 0 c 99.84 99.84 99.84 261.12 0 360.96 c -99.84 102.4 -261.12 102.4 -360.96 0 Z";
|
|
984
|
-
var _sfc_main$
|
|
984
|
+
var _sfc_main$r = defineComponent({
|
|
985
985
|
...{
|
|
986
986
|
name: "Search",
|
|
987
987
|
inheritAttrs: true
|
|
@@ -1028,7 +1028,7 @@ var _sfc_main$q = defineComponent({
|
|
|
1028
1028
|
onKeyup: _cache[1] || (_cache[1] = $event => onSearch($event))
|
|
1029
1029
|
}, null, 40, _hoisted_1$d), [[vModelText, textModel.value, void 0, {
|
|
1030
1030
|
trim: true
|
|
1031
|
-
}]]), createElementVNode("div", null, [createVNode(_sfc_main$
|
|
1031
|
+
}]]), createElementVNode("div", null, [createVNode(_sfc_main$y, {
|
|
1032
1032
|
class: "search-button",
|
|
1033
1033
|
type: "custom",
|
|
1034
1034
|
draw: searchIon,
|
|
@@ -1253,7 +1253,7 @@ const _hoisted_1$c = {
|
|
|
1253
1253
|
class: "snail-confirm flex-column"
|
|
1254
1254
|
};
|
|
1255
1255
|
const _hoisted_2$8 = ["innerHTML"];
|
|
1256
|
-
var _sfc_main$
|
|
1256
|
+
var _sfc_main$q = defineComponent({
|
|
1257
1257
|
...{
|
|
1258
1258
|
name: "ConfirmContainer",
|
|
1259
1259
|
inheritAttrs: true
|
|
@@ -1281,14 +1281,14 @@ var _sfc_main$p = defineComponent({
|
|
|
1281
1281
|
},
|
|
1282
1282
|
setup(__props) {
|
|
1283
1283
|
return (_ctx, _cache) => {
|
|
1284
|
-
return openBlock(), createElementBlock("div", _hoisted_1$c, [createVNode(_sfc_main$
|
|
1284
|
+
return openBlock(), createElementBlock("div", _hoisted_1$c, [createVNode(_sfc_main$u, {
|
|
1285
1285
|
"use-to": "dialog",
|
|
1286
1286
|
title: __props.title || "提示",
|
|
1287
1287
|
onClose: _cache[0] || (_cache[0] = $event => __props.closePopup(false))
|
|
1288
1288
|
}, null, 8, ["title"]), createElementVNode("div", {
|
|
1289
1289
|
class: "confirm-body",
|
|
1290
1290
|
innerHTML: __props.message || "请确认?"
|
|
1291
|
-
}, null, 8, _hoisted_2$8), createVNode(_sfc_main$
|
|
1291
|
+
}, null, 8, _hoisted_2$8), createVNode(_sfc_main$v, {
|
|
1292
1292
|
align: "right",
|
|
1293
1293
|
"cancel-name": __props.cancelName,
|
|
1294
1294
|
"cancel-disabled": __props.cancelDisabled,
|
|
@@ -1301,7 +1301,7 @@ var _sfc_main$p = defineComponent({
|
|
|
1301
1301
|
}
|
|
1302
1302
|
});
|
|
1303
1303
|
|
|
1304
|
-
var _sfc_main$
|
|
1304
|
+
var _sfc_main$p = defineComponent({
|
|
1305
1305
|
...{
|
|
1306
1306
|
name: "Loading",
|
|
1307
1307
|
inheritAttrs: true
|
|
@@ -1340,7 +1340,7 @@ var _sfc_main$o = defineComponent({
|
|
|
1340
1340
|
}
|
|
1341
1341
|
});
|
|
1342
1342
|
|
|
1343
|
-
var _sfc_main$
|
|
1343
|
+
var _sfc_main$o = defineComponent({
|
|
1344
1344
|
...{
|
|
1345
1345
|
name: "Dynamic",
|
|
1346
1346
|
inheritAttrs: false
|
|
@@ -1364,7 +1364,7 @@ var _sfc_main$n = defineComponent({
|
|
|
1364
1364
|
const loadingComponent = defineComponent({
|
|
1365
1365
|
inheritAttrs: false,
|
|
1366
1366
|
components: {
|
|
1367
|
-
Loading: _sfc_main$
|
|
1367
|
+
Loading: _sfc_main$p
|
|
1368
1368
|
},
|
|
1369
1369
|
template: "<Loading :mask-disabled='true' />"
|
|
1370
1370
|
});
|
|
@@ -1431,7 +1431,7 @@ var _sfc_main$n = defineComponent({
|
|
|
1431
1431
|
}
|
|
1432
1432
|
});
|
|
1433
1433
|
|
|
1434
|
-
var _sfc_main$
|
|
1434
|
+
var _sfc_main$n = defineComponent({
|
|
1435
1435
|
...{
|
|
1436
1436
|
name: "DialogContainer",
|
|
1437
1437
|
inheritAttrs: true
|
|
@@ -1476,7 +1476,7 @@ var _sfc_main$m = defineComponent({
|
|
|
1476
1476
|
onClick: _cache[1] || (_cache[1] = withModifiers($event => {
|
|
1477
1477
|
__props.options.closeOnMask && unref(closePopup)();
|
|
1478
1478
|
}, ["self"]))
|
|
1479
|
-
}, [createVNode(_sfc_main$
|
|
1479
|
+
}, [createVNode(_sfc_main$o, mergeProps({
|
|
1480
1480
|
class: "dialog-body",
|
|
1481
1481
|
name: __props.options.name,
|
|
1482
1482
|
component: __props.options.component,
|
|
@@ -1491,7 +1491,7 @@ var _sfc_main$m = defineComponent({
|
|
|
1491
1491
|
}
|
|
1492
1492
|
});
|
|
1493
1493
|
|
|
1494
|
-
var _sfc_main$
|
|
1494
|
+
var _sfc_main$m = defineComponent({
|
|
1495
1495
|
...{
|
|
1496
1496
|
name: "FollowContainer",
|
|
1497
1497
|
inheritAttrs: true
|
|
@@ -1612,7 +1612,7 @@ var _sfc_main$l = defineComponent({
|
|
|
1612
1612
|
});
|
|
1613
1613
|
});
|
|
1614
1614
|
return (_ctx, _cache) => {
|
|
1615
|
-
return openBlock(), createBlock(_sfc_main$
|
|
1615
|
+
return openBlock(), createBlock(_sfc_main$o, mergeProps({
|
|
1616
1616
|
class: ["snail-follow initial", [__props.popupStatus.value, __props.popupTransition.value]],
|
|
1617
1617
|
style: {
|
|
1618
1618
|
"z-index": __props.zIndex
|
|
@@ -1629,7 +1629,7 @@ var _sfc_main$l = defineComponent({
|
|
|
1629
1629
|
}
|
|
1630
1630
|
});
|
|
1631
1631
|
|
|
1632
|
-
var _sfc_main$
|
|
1632
|
+
var _sfc_main$l = defineComponent({
|
|
1633
1633
|
...{
|
|
1634
1634
|
name: "PopupContainer",
|
|
1635
1635
|
inheritAttrs: true
|
|
@@ -1649,7 +1649,7 @@ var _sfc_main$k = defineComponent({
|
|
|
1649
1649
|
model = shallowRef(void 0)
|
|
1650
1650
|
} = __props.options;
|
|
1651
1651
|
return (_ctx, _cache) => {
|
|
1652
|
-
return openBlock(), createBlock(_sfc_main$
|
|
1652
|
+
return openBlock(), createBlock(_sfc_main$o, mergeProps({
|
|
1653
1653
|
class: ["snail-popup", [__props.popupStatus.value, __props.popupTransition.value]],
|
|
1654
1654
|
style: {
|
|
1655
1655
|
"z-index": __props.zIndex
|
|
@@ -1672,7 +1672,7 @@ const _hoisted_1$b = {
|
|
|
1672
1672
|
class: "icon"
|
|
1673
1673
|
};
|
|
1674
1674
|
const _hoisted_2$7 = ["innerHTML"];
|
|
1675
|
-
var _sfc_main$
|
|
1675
|
+
var _sfc_main$k = defineComponent({
|
|
1676
1676
|
...{
|
|
1677
1677
|
name: "ToastContainer",
|
|
1678
1678
|
inheritAttrs: true
|
|
@@ -1710,7 +1710,7 @@ var _sfc_main$j = defineComponent({
|
|
|
1710
1710
|
}),
|
|
1711
1711
|
onMouseenter: _cache[3] || (_cache[3] = $event => onMouseEvent(false)),
|
|
1712
1712
|
onMouseleave: _cache[4] || (_cache[4] = $event => onMouseEvent(true))
|
|
1713
|
-
}, [unref(props).closeDisabled != true ? (openBlock(), createBlock(_sfc_main$
|
|
1713
|
+
}, [unref(props).closeDisabled != true ? (openBlock(), createBlock(_sfc_main$y, {
|
|
1714
1714
|
key: 0,
|
|
1715
1715
|
class: "close-icon",
|
|
1716
1716
|
type: "close",
|
|
@@ -1721,7 +1721,7 @@ var _sfc_main$j = defineComponent({
|
|
|
1721
1721
|
onClick: _cache[2] || (_cache[2] = $event => {
|
|
1722
1722
|
unref(closePopup)();
|
|
1723
1723
|
})
|
|
1724
|
-
}, null, 8, ["fill"])) : createCommentVNode("", true), unref(props).type ? (openBlock(), createElementBlock("div", _hoisted_1$b, [createVNode(_sfc_main$
|
|
1724
|
+
}, null, 8, ["fill"])) : createCommentVNode("", true), unref(props).type ? (openBlock(), createElementBlock("div", _hoisted_1$b, [createVNode(_sfc_main$y, {
|
|
1725
1725
|
type: unref(props).type,
|
|
1726
1726
|
fill: "#707070",
|
|
1727
1727
|
size: 20
|
|
@@ -1735,7 +1735,7 @@ var _sfc_main$j = defineComponent({
|
|
|
1735
1735
|
|
|
1736
1736
|
function usePopup() {
|
|
1737
1737
|
function popup(options) {
|
|
1738
|
-
const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$
|
|
1738
|
+
const scope = checkOptions(options, checkPopup) || popupInCustomContainer(_sfc_main$l, options);
|
|
1739
1739
|
return addScope2Scopes(scope);
|
|
1740
1740
|
}
|
|
1741
1741
|
function dialog(options) {
|
|
@@ -1768,7 +1768,7 @@ function usePopup() {
|
|
|
1768
1768
|
},
|
|
1769
1769
|
onBeforeClose: fn => hook.register("onBeforeClose", fn)
|
|
1770
1770
|
});
|
|
1771
|
-
const descriptor = openPopup(_sfc_main$
|
|
1771
|
+
const descriptor = openPopup(_sfc_main$n, options, extOptions);
|
|
1772
1772
|
scope = useAsyncScope(deferred.promise);
|
|
1773
1773
|
monitorDialog(descriptor, scope, deferred);
|
|
1774
1774
|
}
|
|
@@ -1786,14 +1786,14 @@ function usePopup() {
|
|
|
1786
1786
|
inPopup: "follow",
|
|
1787
1787
|
target
|
|
1788
1788
|
};
|
|
1789
|
-
scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$
|
|
1789
|
+
scope = checkOptions(options, checkFollow) || popupInCustomContainer(_sfc_main$m, options, extOptions);
|
|
1790
1790
|
}
|
|
1791
1791
|
return addScope2Scopes(scope);
|
|
1792
1792
|
}
|
|
1793
1793
|
function confirm(title, message, options) {
|
|
1794
1794
|
options = options || Object.create(null);
|
|
1795
1795
|
return dialog({
|
|
1796
|
-
component: _sfc_main$
|
|
1796
|
+
component: _sfc_main$q,
|
|
1797
1797
|
closeOnEscape: true,
|
|
1798
1798
|
props: {
|
|
1799
1799
|
...options,
|
|
@@ -1803,7 +1803,7 @@ function usePopup() {
|
|
|
1803
1803
|
});
|
|
1804
1804
|
}
|
|
1805
1805
|
function toast(type, message, options) {
|
|
1806
|
-
return popupInCustomContainer(_sfc_main$
|
|
1806
|
+
return popupInCustomContainer(_sfc_main$k, {
|
|
1807
1807
|
url: "#ToastContainer",
|
|
1808
1808
|
props: {
|
|
1809
1809
|
...(options || Object.create(null)),
|
|
@@ -1836,7 +1836,7 @@ function usePopup() {
|
|
|
1836
1836
|
},
|
|
1837
1837
|
...extOptions
|
|
1838
1838
|
});
|
|
1839
|
-
const descriptor = openPopup(container || _sfc_main$
|
|
1839
|
+
const descriptor = openPopup(container || _sfc_main$l, options, extOptions);
|
|
1840
1840
|
const scope = useAsyncScope(deferred.promise);
|
|
1841
1841
|
scope.onDestroy(() => destroyPopup(descriptor, deferred));
|
|
1842
1842
|
return scope;
|
|
@@ -1978,8 +1978,8 @@ const _hoisted_1$a = {
|
|
|
1978
1978
|
class: "snail-empty"
|
|
1979
1979
|
};
|
|
1980
1980
|
const _hoisted_2$6 = ["src"];
|
|
1981
|
-
const _hoisted_3$
|
|
1982
|
-
var _sfc_main$
|
|
1981
|
+
const _hoisted_3$6 = ["textContent"];
|
|
1982
|
+
var _sfc_main$j = defineComponent({
|
|
1983
1983
|
...{
|
|
1984
1984
|
name: "Empty",
|
|
1985
1985
|
inheritAttrs: true
|
|
@@ -1997,18 +1997,18 @@ var _sfc_main$i = defineComponent({
|
|
|
1997
1997
|
}, null, 8, _hoisted_2$6), renderSlot(_ctx.$slots, "default", {}, () => [createElementVNode("div", {
|
|
1998
1998
|
class: "message",
|
|
1999
1999
|
textContent: toDisplayString(__props.message || "无数据")
|
|
2000
|
-
}, null, 8, _hoisted_3$
|
|
2000
|
+
}, null, 8, _hoisted_3$6)])]);
|
|
2001
2001
|
};
|
|
2002
2002
|
}
|
|
2003
2003
|
});
|
|
2004
2004
|
|
|
2005
2005
|
const _hoisted_1$9 = ["title"];
|
|
2006
2006
|
const _hoisted_2$5 = ["textContent"];
|
|
2007
|
-
const _hoisted_3$
|
|
2007
|
+
const _hoisted_3$5 = {
|
|
2008
2008
|
key: 1,
|
|
2009
2009
|
class: "select-status"
|
|
2010
2010
|
};
|
|
2011
|
-
var _sfc_main$
|
|
2011
|
+
var _sfc_main$i = defineComponent({
|
|
2012
2012
|
...{
|
|
2013
2013
|
name: "SelectNode",
|
|
2014
2014
|
inheritAttrs: true
|
|
@@ -2053,11 +2053,11 @@ var _sfc_main$h = defineComponent({
|
|
|
2053
2053
|
}, [createElementVNode("div", {
|
|
2054
2054
|
class: "item-text ellipsis",
|
|
2055
2055
|
textContent: toDisplayString(__props.item.text)
|
|
2056
|
-
}, null, 8, _hoisted_2$5), __props.item.type == "group" ? (openBlock(), createBlock(_sfc_main$
|
|
2056
|
+
}, null, 8, _hoisted_2$5), __props.item.type == "group" ? (openBlock(), createBlock(_sfc_main$y, {
|
|
2057
2057
|
key: 0,
|
|
2058
2058
|
type: "arrow",
|
|
2059
2059
|
color: "#8a9099"
|
|
2060
|
-
})) : __props.multiple == true ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
2060
|
+
})) : __props.multiple == true ? (openBlock(), createElementBlock("div", _hoisted_3$5, [createVNode(_sfc_main$y, {
|
|
2061
2061
|
type: "success",
|
|
2062
2062
|
color: "white",
|
|
2063
2063
|
size: 12
|
|
@@ -2078,7 +2078,7 @@ var _sfc_main$h = defineComponent({
|
|
|
2078
2078
|
}
|
|
2079
2079
|
});
|
|
2080
2080
|
|
|
2081
|
-
var _sfc_main$
|
|
2081
|
+
var _sfc_main$h = defineComponent({
|
|
2082
2082
|
...{
|
|
2083
2083
|
name: "Select2Popup",
|
|
2084
2084
|
inheritAttrs: true
|
|
@@ -2250,13 +2250,13 @@ var _sfc_main$g = defineComponent({
|
|
|
2250
2250
|
key: 0
|
|
2251
2251
|
}, [createTextVNode(" 暂无选项 ")], 64)) : (openBlock(), createElementBlock(Fragment, {
|
|
2252
2252
|
key: 1
|
|
2253
|
-
}, [__props.search ? (openBlock(), createBlock(_sfc_main$
|
|
2253
|
+
}, [__props.search ? (openBlock(), createBlock(_sfc_main$r, mergeProps({
|
|
2254
2254
|
key: 0
|
|
2255
2255
|
}, __props.search, {
|
|
2256
2256
|
onSearch,
|
|
2257
2257
|
key: "select-search"
|
|
2258
2258
|
}), null, 16)) : createCommentVNode("", true), (openBlock(true), createElementBlock(Fragment, null, renderList(itemsRef.value, item => {
|
|
2259
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2259
|
+
return openBlock(), createBlock(_sfc_main$i, {
|
|
2260
2260
|
key: unref(context).getKey(item),
|
|
2261
2261
|
multiple: __props.multiple,
|
|
2262
2262
|
item,
|
|
@@ -2265,7 +2265,7 @@ var _sfc_main$g = defineComponent({
|
|
|
2265
2265
|
onEnter: onEnterSelectNode,
|
|
2266
2266
|
onClick: onClickSelectNode
|
|
2267
2267
|
}, null, 8, ["multiple", "item", "context"]);
|
|
2268
|
-
}), 128)), itemsRef.value.length == 0 ? (openBlock(), createBlock(_sfc_main$
|
|
2268
|
+
}), 128)), itemsRef.value.length == 0 ? (openBlock(), createBlock(_sfc_main$j, {
|
|
2269
2269
|
key: 1,
|
|
2270
2270
|
message: "无结果"
|
|
2271
2271
|
})) : createCommentVNode("", true), showClearButtonRef.value ? (openBlock(), createElementBlock("div", {
|
|
@@ -2282,15 +2282,15 @@ const _hoisted_1$8 = {
|
|
|
2282
2282
|
class: "select-result"
|
|
2283
2283
|
};
|
|
2284
2284
|
const _hoisted_2$4 = ["title", "textContent"];
|
|
2285
|
-
const _hoisted_3$
|
|
2286
|
-
const _hoisted_4$
|
|
2285
|
+
const _hoisted_3$4 = ["textContent"];
|
|
2286
|
+
const _hoisted_4$4 = {
|
|
2287
2287
|
key: 1,
|
|
2288
2288
|
class: "placeholder"
|
|
2289
2289
|
};
|
|
2290
2290
|
onAppCreated((app, type) => {
|
|
2291
|
-
type == "popup" && app.component("SelectPopup", _sfc_main$
|
|
2291
|
+
type == "popup" && app.component("SelectPopup", _sfc_main$h);
|
|
2292
2292
|
});
|
|
2293
|
-
var _sfc_main$
|
|
2293
|
+
var _sfc_main$g = defineComponent({
|
|
2294
2294
|
...{
|
|
2295
2295
|
name: "Select",
|
|
2296
2296
|
inheritAttrs: true
|
|
@@ -2430,7 +2430,7 @@ var _sfc_main$f = defineComponent({
|
|
|
2430
2430
|
key: 1,
|
|
2431
2431
|
class: "placeholder",
|
|
2432
2432
|
textContent: toDisplayString(__props.readonly ? "" : __props.placeholder || "请选择")
|
|
2433
|
-
}, null, 8, _hoisted_3$
|
|
2433
|
+
}, null, 8, _hoisted_3$4)), __props.readonly != true ? (openBlock(), createBlock(_sfc_main$y, {
|
|
2434
2434
|
key: 2,
|
|
2435
2435
|
type: "arrow",
|
|
2436
2436
|
size: 24,
|
|
@@ -2438,12 +2438,12 @@ var _sfc_main$f = defineComponent({
|
|
|
2438
2438
|
style: {
|
|
2439
2439
|
"transform": "rotate(90deg)"
|
|
2440
2440
|
}
|
|
2441
|
-
})) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock("div", _hoisted_4$
|
|
2441
|
+
})) : createCommentVNode("", true)], 64)) : (openBlock(), createElementBlock("div", _hoisted_4$4, "暂无可选项"))], 2);
|
|
2442
2442
|
};
|
|
2443
2443
|
}
|
|
2444
2444
|
});
|
|
2445
2445
|
|
|
2446
|
-
var _sfc_main$
|
|
2446
|
+
var _sfc_main$f = defineComponent({
|
|
2447
2447
|
...{
|
|
2448
2448
|
name: "Switch",
|
|
2449
2449
|
inheritAttrs: true
|
|
@@ -2493,7 +2493,7 @@ var _sfc_main$e = defineComponent({
|
|
|
2493
2493
|
});
|
|
2494
2494
|
|
|
2495
2495
|
const _hoisted_1$7 = ["readonly", "placeholder", "rows"];
|
|
2496
|
-
var _sfc_main$
|
|
2496
|
+
var _sfc_main$e = defineComponent({
|
|
2497
2497
|
...{
|
|
2498
2498
|
name: "Textarea"
|
|
2499
2499
|
},
|
|
@@ -2562,16 +2562,16 @@ const _hoisted_1$6 = {
|
|
|
2562
2562
|
class: "fold-header"
|
|
2563
2563
|
};
|
|
2564
2564
|
const _hoisted_2$3 = ["textContent"];
|
|
2565
|
-
const _hoisted_3$
|
|
2566
|
-
const _hoisted_4$
|
|
2565
|
+
const _hoisted_3$3 = ["textContent"];
|
|
2566
|
+
const _hoisted_4$3 = {
|
|
2567
2567
|
key: 1,
|
|
2568
2568
|
class: "status"
|
|
2569
2569
|
};
|
|
2570
|
-
const _hoisted_5$
|
|
2570
|
+
const _hoisted_5$2 = {
|
|
2571
2571
|
class: "fold-body",
|
|
2572
2572
|
ref: "foldBody"
|
|
2573
2573
|
};
|
|
2574
|
-
var _sfc_main$
|
|
2574
|
+
var _sfc_main$d = defineComponent({
|
|
2575
2575
|
...{
|
|
2576
2576
|
name: "Fold",
|
|
2577
2577
|
inheritAttrs: true
|
|
@@ -2648,16 +2648,16 @@ var _sfc_main$c = defineComponent({
|
|
|
2648
2648
|
key: 0,
|
|
2649
2649
|
class: "subtitle ellipsis",
|
|
2650
2650
|
textContent: toDisplayString(__props.subtitle)
|
|
2651
|
-
}, null, 8, _hoisted_3$
|
|
2651
|
+
}, null, 8, _hoisted_3$3)) : createCommentVNode("", true), __props.disabled != true ? (openBlock(), createElementBlock("div", _hoisted_4$3, [createVNode(_sfc_main$y, {
|
|
2652
2652
|
type: "arrow",
|
|
2653
2653
|
title: statusModel.value == "expand" ? "收起" : "展开",
|
|
2654
2654
|
onClick: onStatusClick
|
|
2655
|
-
}, null, 8, ["title"])])) : createCommentVNode("", true)])]), createElementVNode("div", _hoisted_5$
|
|
2655
|
+
}, null, 8, ["title"])])) : createCommentVNode("", true)])]), createElementVNode("div", _hoisted_5$2, [renderSlot(_ctx.$slots, "default")], 512)], 2);
|
|
2656
2656
|
};
|
|
2657
2657
|
}
|
|
2658
2658
|
});
|
|
2659
2659
|
|
|
2660
|
-
var _sfc_main$
|
|
2660
|
+
var _sfc_main$c = defineComponent({
|
|
2661
2661
|
...{
|
|
2662
2662
|
name: "Scroll",
|
|
2663
2663
|
inheritAttrs: true
|
|
@@ -2670,11 +2670,7 @@ var _sfc_main$b = defineComponent({
|
|
|
2670
2670
|
scrollY: {
|
|
2671
2671
|
type: Boolean
|
|
2672
2672
|
},
|
|
2673
|
-
barSize: {}
|
|
2674
|
-
barMode: {},
|
|
2675
|
-
debounce: {
|
|
2676
|
-
type: Boolean
|
|
2677
|
-
}
|
|
2673
|
+
barSize: {}
|
|
2678
2674
|
},
|
|
2679
2675
|
emits: ["xbar", "left", "right", "ybar", "top", "bottom"],
|
|
2680
2676
|
setup(__props, _ref) {
|
|
@@ -2691,13 +2687,9 @@ var _sfc_main$b = defineComponent({
|
|
|
2691
2687
|
const {
|
|
2692
2688
|
onInterval
|
|
2693
2689
|
} = useTimer();
|
|
2694
|
-
const classRef = computed(() => ({
|
|
2695
|
-
"debounce": props.scrollY == true && props.debounce == true,
|
|
2696
|
-
"hover-show": props.barMode == "hover"
|
|
2697
|
-
}));
|
|
2698
2690
|
const styleRef = computed(() => {
|
|
2699
2691
|
const style = Object.create(null);
|
|
2700
|
-
(props.scrollX || props.scrollY) && (style["--scroll-overflow"] = `${props.scrollX ? "auto" : "hidden"} ${props.scrollY ? "auto" : "hidden"}`);
|
|
2692
|
+
(props.scrollX || props.scrollY) && (style["--scroll-overflow"] = `${props.scrollX == true ? "auto" : "hidden"} ${props.scrollY == true ? "auto" : "hidden"}`);
|
|
2701
2693
|
if (props.barSize) {
|
|
2702
2694
|
switch (props.barSize) {
|
|
2703
2695
|
case "normal":
|
|
@@ -2771,15 +2763,9 @@ var _sfc_main$b = defineComponent({
|
|
|
2771
2763
|
events.top && emits("top");
|
|
2772
2764
|
events.bottom && emits("bottom");
|
|
2773
2765
|
if (rootDom.value) {
|
|
2774
|
-
rootDom.value.classList.remove("x-bar", "y-bar"
|
|
2775
|
-
|
|
2776
|
-
status.
|
|
2777
|
-
status.ybar && classes.push("y-bar");
|
|
2778
|
-
status.left && classes.push("left");
|
|
2779
|
-
status.right && classes.push("right");
|
|
2780
|
-
status.top && classes.push("top");
|
|
2781
|
-
status.bottom && classes.push("bottom");
|
|
2782
|
-
classes.length && rootDom.value.classList.add(...classes);
|
|
2766
|
+
rootDom.value.classList.remove("x-bar", "y-bar");
|
|
2767
|
+
status.xbar && rootDom.value.classList.add("x-bar");
|
|
2768
|
+
status.ybar && rootDom.value.classList.add("y-bar");
|
|
2783
2769
|
}
|
|
2784
2770
|
}
|
|
2785
2771
|
onMounted(() => {
|
|
@@ -2792,44 +2778,101 @@ var _sfc_main$b = defineComponent({
|
|
|
2792
2778
|
});
|
|
2793
2779
|
return (_ctx, _cache) => {
|
|
2794
2780
|
return openBlock(), createElementBlock("div", {
|
|
2795
|
-
class:
|
|
2781
|
+
class: "snail-scroll",
|
|
2796
2782
|
ref: "scroll-root",
|
|
2797
2783
|
style: normalizeStyle(styleRef.value),
|
|
2798
2784
|
onScroll: refreshScrollInfo
|
|
2799
|
-
}, [renderSlot(_ctx.$slots, "default")],
|
|
2785
|
+
}, [renderSlot(_ctx.$slots, "default")], 36);
|
|
2800
2786
|
};
|
|
2801
2787
|
}
|
|
2802
2788
|
});
|
|
2803
2789
|
|
|
2804
|
-
|
|
2805
|
-
key: 0,
|
|
2806
|
-
class: "layout-start"
|
|
2807
|
-
};
|
|
2808
|
-
const _hoisted_2$2 = {
|
|
2809
|
-
key: 1,
|
|
2810
|
-
class: "layout-end"
|
|
2811
|
-
};
|
|
2812
|
-
var _sfc_main$a = defineComponent({
|
|
2790
|
+
var _sfc_main$b = defineComponent({
|
|
2813
2791
|
__name: "layout",
|
|
2814
2792
|
props: {
|
|
2815
2793
|
mode: {},
|
|
2816
|
-
|
|
2794
|
+
main: {},
|
|
2795
|
+
left: {},
|
|
2796
|
+
right: {},
|
|
2797
|
+
top: {},
|
|
2798
|
+
bottom: {}
|
|
2817
2799
|
},
|
|
2818
2800
|
setup(__props) {
|
|
2801
|
+
const props = __props;
|
|
2802
|
+
const areaMap = computed(() => {
|
|
2803
|
+
const map = Object.create(null);
|
|
2804
|
+
map.main = {
|
|
2805
|
+
scrollable: props.main && props.main.scroll != void 0,
|
|
2806
|
+
class: "main-area",
|
|
2807
|
+
style: void 0
|
|
2808
|
+
};
|
|
2809
|
+
if (props.mode == "vertical") {
|
|
2810
|
+
map.top = {
|
|
2811
|
+
scrollable: props.top && props.top.scroll != void 0,
|
|
2812
|
+
class: "top-area",
|
|
2813
|
+
style: buildHeightStyle(props.top)
|
|
2814
|
+
};
|
|
2815
|
+
map.bottom = {
|
|
2816
|
+
scrollable: props.bottom && props.bottom.scroll != void 0,
|
|
2817
|
+
class: "bottom-area",
|
|
2818
|
+
style: buildHeightStyle(props.bottom)
|
|
2819
|
+
};
|
|
2820
|
+
} else {
|
|
2821
|
+
map.left = {
|
|
2822
|
+
scrollable: props.left && props.left.scroll != void 0,
|
|
2823
|
+
class: "left-area",
|
|
2824
|
+
style: buildWidthStyle(props.left)
|
|
2825
|
+
};
|
|
2826
|
+
map.right = {
|
|
2827
|
+
scrollable: props.right && props.right.scroll != void 0,
|
|
2828
|
+
class: "right-area",
|
|
2829
|
+
style: buildWidthStyle(props.right)
|
|
2830
|
+
};
|
|
2831
|
+
}
|
|
2832
|
+
return map;
|
|
2833
|
+
});
|
|
2834
|
+
function buildWidthStyle(style) {
|
|
2835
|
+
return style ? css.buildStyle({
|
|
2836
|
+
minWidth: style.minWidth,
|
|
2837
|
+
width: style.width,
|
|
2838
|
+
maxWidth: style.maxWidth
|
|
2839
|
+
}) : void 0;
|
|
2840
|
+
}
|
|
2841
|
+
function buildHeightStyle(style) {
|
|
2842
|
+
return style ? css.buildStyle({
|
|
2843
|
+
minHeight: style.minHeight,
|
|
2844
|
+
height: style.height,
|
|
2845
|
+
maxHeight: style.maxHeight
|
|
2846
|
+
}) : void 0;
|
|
2847
|
+
}
|
|
2819
2848
|
return (_ctx, _cache) => {
|
|
2820
2849
|
return openBlock(), createElementBlock("div", {
|
|
2821
2850
|
class: normalizeClass(["snail-layout", __props.mode])
|
|
2822
|
-
}, [
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2851
|
+
}, [(openBlock(), createElementBlock(Fragment, null, renderList(["top", "left", "main", "right", "bottom"], item => {
|
|
2852
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
2853
|
+
key: item
|
|
2854
|
+
}, [areaMap.value[item] && _ctx.$slots[item] ? (openBlock(), createElementBlock(Fragment, {
|
|
2855
|
+
key: 0
|
|
2856
|
+
}, [areaMap.value[item].scrollable ? (openBlock(), createBlock(_sfc_main$c, mergeProps({
|
|
2857
|
+
key: 0,
|
|
2858
|
+
class: areaMap.value[item].class,
|
|
2859
|
+
style: areaMap.value[item].style
|
|
2860
|
+
}, {
|
|
2861
|
+
ref_for: true
|
|
2862
|
+
}, props[item].scroll), {
|
|
2863
|
+
default: withCtx(() => [renderSlot(_ctx.$slots, item)]),
|
|
2864
|
+
_: 2
|
|
2865
|
+
}, 1040, ["class", "style"])) : (openBlock(), createElementBlock("div", {
|
|
2866
|
+
key: 1,
|
|
2867
|
+
class: normalizeClass(areaMap.value[item].class),
|
|
2868
|
+
style: normalizeStyle(areaMap.value[item].style)
|
|
2869
|
+
}, [renderSlot(_ctx.$slots, item)], 6))], 64)) : createCommentVNode("", true)], 64);
|
|
2870
|
+
}), 64))], 2);
|
|
2828
2871
|
};
|
|
2829
2872
|
}
|
|
2830
2873
|
});
|
|
2831
2874
|
|
|
2832
|
-
var _sfc_main$
|
|
2875
|
+
var _sfc_main$a = defineComponent({
|
|
2833
2876
|
...{
|
|
2834
2877
|
name: "Sort",
|
|
2835
2878
|
inheritAttrs: true
|
|
@@ -2930,10 +2973,10 @@ var _sfc_main$9 = defineComponent({
|
|
|
2930
2973
|
}
|
|
2931
2974
|
});
|
|
2932
2975
|
|
|
2933
|
-
const _hoisted_1$
|
|
2976
|
+
const _hoisted_1$5 = {
|
|
2934
2977
|
class: "table-body"
|
|
2935
2978
|
};
|
|
2936
|
-
var _sfc_main$
|
|
2979
|
+
var _sfc_main$9 = defineComponent({
|
|
2937
2980
|
...{
|
|
2938
2981
|
name: "Table",
|
|
2939
2982
|
inheritAttrs: true
|
|
@@ -2947,10 +2990,6 @@ var _sfc_main$8 = defineComponent({
|
|
|
2947
2990
|
type: Boolean
|
|
2948
2991
|
},
|
|
2949
2992
|
barSize: {},
|
|
2950
|
-
barMode: {},
|
|
2951
|
-
debounce: {
|
|
2952
|
-
type: Boolean
|
|
2953
|
-
},
|
|
2954
2993
|
border: {
|
|
2955
2994
|
type: Boolean
|
|
2956
2995
|
},
|
|
@@ -2962,7 +3001,7 @@ var _sfc_main$8 = defineComponent({
|
|
|
2962
3001
|
const hStyleRef = computed(() => css.buildStyle(props.headerStyle));
|
|
2963
3002
|
const fStyleRef = computed(() => css.buildStyle(props.footerStyle));
|
|
2964
3003
|
return (_ctx, _cache) => {
|
|
2965
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3004
|
+
return openBlock(), createBlock(_sfc_main$c, {
|
|
2966
3005
|
class: normalizeClass(["snail-table", {
|
|
2967
3006
|
"start-border": __props.border == true
|
|
2968
3007
|
}]),
|
|
@@ -2972,7 +3011,7 @@ var _sfc_main$8 = defineComponent({
|
|
|
2972
3011
|
default: withCtx(() => [createElementVNode("div", {
|
|
2973
3012
|
class: "table-header",
|
|
2974
3013
|
style: normalizeStyle(hStyleRef.value)
|
|
2975
|
-
}, [renderSlot(_ctx.$slots, "header")], 4), createElementVNode("div", _hoisted_1$
|
|
3014
|
+
}, [renderSlot(_ctx.$slots, "header")], 4), createElementVNode("div", _hoisted_1$5, [renderSlot(_ctx.$slots, "default")]), createElementVNode("div", {
|
|
2976
3015
|
class: "table-footer",
|
|
2977
3016
|
style: normalizeStyle(fStyleRef.value)
|
|
2978
3017
|
}, [renderSlot(_ctx.$slots, "footer")], 4)]),
|
|
@@ -2982,7 +3021,7 @@ var _sfc_main$8 = defineComponent({
|
|
|
2982
3021
|
}
|
|
2983
3022
|
});
|
|
2984
3023
|
|
|
2985
|
-
var _sfc_main$
|
|
3024
|
+
var _sfc_main$8 = defineComponent({
|
|
2986
3025
|
...{
|
|
2987
3026
|
name: "TableRow",
|
|
2988
3027
|
inheritAttrs: true
|
|
@@ -3005,7 +3044,7 @@ var _sfc_main$7 = defineComponent({
|
|
|
3005
3044
|
}
|
|
3006
3045
|
});
|
|
3007
3046
|
|
|
3008
|
-
var _sfc_main$
|
|
3047
|
+
var _sfc_main$7 = defineComponent({
|
|
3009
3048
|
...{
|
|
3010
3049
|
name: "TableCol",
|
|
3011
3050
|
inheritAttrs: true
|
|
@@ -3051,7 +3090,7 @@ var _sfc_main$6 = defineComponent({
|
|
|
3051
3090
|
}
|
|
3052
3091
|
});
|
|
3053
3092
|
|
|
3054
|
-
var _sfc_main$
|
|
3093
|
+
var _sfc_main$6 = defineComponent({
|
|
3055
3094
|
__name: "transitions",
|
|
3056
3095
|
props: {
|
|
3057
3096
|
group: {
|
|
@@ -3091,20 +3130,20 @@ var _sfc_main$5 = defineComponent({
|
|
|
3091
3130
|
}
|
|
3092
3131
|
});
|
|
3093
3132
|
|
|
3094
|
-
const _hoisted_1$
|
|
3133
|
+
const _hoisted_1$4 = {
|
|
3095
3134
|
key: 0,
|
|
3096
3135
|
class: "node-fold"
|
|
3097
3136
|
};
|
|
3098
|
-
const _hoisted_2$
|
|
3099
|
-
const _hoisted_3$
|
|
3137
|
+
const _hoisted_2$2 = ["title", "textContent"];
|
|
3138
|
+
const _hoisted_3$2 = {
|
|
3100
3139
|
class: "node-slot ellipsis"
|
|
3101
3140
|
};
|
|
3102
|
-
const _hoisted_4$
|
|
3141
|
+
const _hoisted_4$2 = {
|
|
3103
3142
|
key: 1,
|
|
3104
3143
|
class: "snail-tree-children hidden",
|
|
3105
3144
|
ref: "children"
|
|
3106
3145
|
};
|
|
3107
|
-
var _sfc_main$
|
|
3146
|
+
var _sfc_main$5 = defineComponent({
|
|
3108
3147
|
...{
|
|
3109
3148
|
name: "TreeNode",
|
|
3110
3149
|
inheritAttrs: true
|
|
@@ -3222,7 +3261,7 @@ var _sfc_main$4 = defineComponent({
|
|
|
3222
3261
|
key: 1
|
|
3223
3262
|
}, [_cache[4] || (_cache[4] = createElementVNode("div", {
|
|
3224
3263
|
class: "indent"
|
|
3225
|
-
}, null, -1)), __props.options.foldDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_1$
|
|
3264
|
+
}, null, -1)), __props.options.foldDisabled != true ? (openBlock(), createElementBlock("div", _hoisted_1$4, [showChildrenRef.value ? (openBlock(), createBlock(_sfc_main$y, {
|
|
3226
3265
|
key: 0,
|
|
3227
3266
|
class: normalizeClass(statusRef.value),
|
|
3228
3267
|
type: "custom",
|
|
@@ -3234,7 +3273,7 @@ var _sfc_main$4 = defineComponent({
|
|
|
3234
3273
|
class: "node-text ellipsis",
|
|
3235
3274
|
title: __props.node.text,
|
|
3236
3275
|
textContent: toDisplayString(__props.node.text)
|
|
3237
|
-
}, null, 8, _hoisted_2$
|
|
3276
|
+
}, null, 8, _hoisted_2$2), createElementVNode("div", _hoisted_3$2, [renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps(unref(slotOptions))))])], 64))], 34)) : createCommentVNode("", true), showRef.value && showChildrenRef.value ? (openBlock(), createElementBlock("div", _hoisted_4$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.node.children, child => {
|
|
3238
3277
|
return openBlock(), createBlock(_component_TreeNode, {
|
|
3239
3278
|
key: __props.context.getKey(child),
|
|
3240
3279
|
node: child,
|
|
@@ -3254,10 +3293,10 @@ var _sfc_main$4 = defineComponent({
|
|
|
3254
3293
|
}
|
|
3255
3294
|
});
|
|
3256
3295
|
|
|
3257
|
-
const _hoisted_1$
|
|
3296
|
+
const _hoisted_1$3 = {
|
|
3258
3297
|
class: "snail-tree"
|
|
3259
3298
|
};
|
|
3260
|
-
var _sfc_main$
|
|
3299
|
+
var _sfc_main$4 = defineComponent({
|
|
3261
3300
|
...{
|
|
3262
3301
|
name: "Tree",
|
|
3263
3302
|
inheritAttrs: true
|
|
@@ -3291,15 +3330,15 @@ var _sfc_main$3 = defineComponent({
|
|
|
3291
3330
|
emits("click", node, parents);
|
|
3292
3331
|
}
|
|
3293
3332
|
return (_ctx, _cache) => {
|
|
3294
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
3333
|
+
return openBlock(), createElementBlock("div", _hoisted_1$3, [__props.search ? (openBlock(), createBlock(_sfc_main$r, mergeProps({
|
|
3295
3334
|
key: 0
|
|
3296
3335
|
}, __props.search, {
|
|
3297
3336
|
onSearch
|
|
3298
|
-
}), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$
|
|
3337
|
+
}), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$c, {
|
|
3299
3338
|
"scroll-y": true
|
|
3300
3339
|
}, {
|
|
3301
3340
|
default: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.nodes || [], node => {
|
|
3302
|
-
return openBlock(), createBlock(_sfc_main$
|
|
3341
|
+
return openBlock(), createBlock(_sfc_main$5, {
|
|
3303
3342
|
key: unref(context).getKey(node),
|
|
3304
3343
|
node,
|
|
3305
3344
|
parent: void 0,
|
|
@@ -3320,7 +3359,7 @@ var _sfc_main$3 = defineComponent({
|
|
|
3320
3359
|
}
|
|
3321
3360
|
});
|
|
3322
3361
|
|
|
3323
|
-
var _sfc_main$
|
|
3362
|
+
var _sfc_main$3 = defineComponent({
|
|
3324
3363
|
__name: "wrapper",
|
|
3325
3364
|
props: {
|
|
3326
3365
|
readonly: {
|
|
@@ -3342,14 +3381,14 @@ var _sfc_main$2 = defineComponent({
|
|
|
3342
3381
|
return (_ctx, _cache) => {
|
|
3343
3382
|
return openBlock(), createElementBlock("div", {
|
|
3344
3383
|
class: normalizeClass(["snail-wrapper", __props.inPopup ? "in-popup" : "in-normal"])
|
|
3345
|
-
}, [__props.header && __props.header.disabled != true ? (openBlock(), createBlock(_sfc_main$
|
|
3384
|
+
}, [__props.header && __props.header.disabled != true ? (openBlock(), createBlock(_sfc_main$u, mergeProps({
|
|
3346
3385
|
key: 0
|
|
3347
3386
|
}, __props.header || {
|
|
3348
3387
|
useTo: "dialog",
|
|
3349
3388
|
title: "对话框"
|
|
3350
3389
|
}, {
|
|
3351
3390
|
onClose: _cache[0] || (_cache[0] = $event => emits("cancel"))
|
|
3352
|
-
}), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$
|
|
3391
|
+
}), null, 16)) : createCommentVNode("", true), createVNode(_sfc_main$c, mergeProps({
|
|
3353
3392
|
class: "wrapper-body"
|
|
3354
3393
|
}, __props.content || {
|
|
3355
3394
|
scrollX: false,
|
|
@@ -3357,7 +3396,7 @@ var _sfc_main$2 = defineComponent({
|
|
|
3357
3396
|
}), {
|
|
3358
3397
|
default: withCtx(() => [renderSlot(_ctx.$slots, "default")]),
|
|
3359
3398
|
_: 3
|
|
3360
|
-
}, 16), __props.footer && __props.readonly != true && __props.footer.disabled != true ? (openBlock(), createBlock(_sfc_main$
|
|
3399
|
+
}, 16), __props.footer && __props.readonly != true && __props.footer.disabled != true ? (openBlock(), createBlock(_sfc_main$v, mergeProps({
|
|
3361
3400
|
key: 1
|
|
3362
3401
|
}, __props.footer || {}, {
|
|
3363
3402
|
onCancel: _cache[1] || (_cache[1] = $event => emits("cancel")),
|
|
@@ -3371,7 +3410,7 @@ function mount(target, options, onDestroyed) {
|
|
|
3371
3410
|
mustObject(options, "options");
|
|
3372
3411
|
target instanceof HTMLElement || throwError("target must be a HTMLElement");
|
|
3373
3412
|
target.classList.add("snail-app");
|
|
3374
|
-
const app = createApp(_sfc_main$
|
|
3413
|
+
const app = createApp(_sfc_main$o, options);
|
|
3375
3414
|
triggerAppCreated(app);
|
|
3376
3415
|
app.mount(target);
|
|
3377
3416
|
const scope = useScope().onDestroy(() => app.unmount());
|
|
@@ -3379,42 +3418,182 @@ function mount(target, options, onDestroyed) {
|
|
|
3379
3418
|
return scope;
|
|
3380
3419
|
}
|
|
3381
3420
|
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3421
|
+
function initStepByFormat(format) {
|
|
3422
|
+
switch (format) {
|
|
3423
|
+
case "yyyy":
|
|
3424
|
+
return "year";
|
|
3425
|
+
case "yyyy-MM":
|
|
3426
|
+
return "month";
|
|
3427
|
+
default:
|
|
3428
|
+
return "day";
|
|
3429
|
+
}
|
|
3430
|
+
}
|
|
3431
|
+
function electDateValue(min, max) {
|
|
3432
|
+
return getDateValue(new Date());
|
|
3433
|
+
}
|
|
3434
|
+
function buildYearItems(year, min, max) {
|
|
3435
|
+
year = year - 10;
|
|
3436
|
+
const items = new Array(18);
|
|
3437
|
+
for (var index = 0; index < items.length; index++) {
|
|
3438
|
+
year += 1;
|
|
3439
|
+
items[index] = Object.freeze({
|
|
3440
|
+
year,
|
|
3441
|
+
disabled: min && min.year != void 0 && year < min.year || max && max.year != void 0 && year > max.year
|
|
3442
|
+
});
|
|
3443
|
+
}
|
|
3444
|
+
return items;
|
|
3445
|
+
}
|
|
3446
|
+
function buildMonthItems(yearItem, min, max) {
|
|
3447
|
+
const minDate = new Date(formatDateValue(min, "yyyy-MM"));
|
|
3448
|
+
const maxDate = new Date(formatDateValue(max, "yyyy-MM"));
|
|
3449
|
+
const items = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"];
|
|
3450
|
+
return items.map((item, index) => {
|
|
3451
|
+
const mi = {
|
|
3452
|
+
text: item,
|
|
3453
|
+
month: index + 1,
|
|
3454
|
+
year: yearItem.year,
|
|
3455
|
+
disabled: yearItem.disabled
|
|
3456
|
+
};
|
|
3457
|
+
if (mi.disabled != true) {
|
|
3458
|
+
const date = new Date(formatDateValue(mi, "yyyy-MM"));
|
|
3459
|
+
mi.disabled = minDate != void 0 && date < minDate || maxDate != void 0 && date > maxDate;
|
|
3460
|
+
}
|
|
3461
|
+
return Object.freeze(mi);
|
|
3462
|
+
});
|
|
3463
|
+
}
|
|
3464
|
+
function buildDayItems(monthItem, min, max) {
|
|
3465
|
+
const minDate = new Date(formatDateValue(min, "yyyy-MM-dd"));
|
|
3466
|
+
const maxDate = new Date(formatDateValue(max, "yyyy-MM-dd"));
|
|
3467
|
+
const date = new Date(monthItem.year, monthItem.month - 1);
|
|
3468
|
+
date.setDate(date.getDate() - (date.getDay() || 7) - 1);
|
|
3469
|
+
const items = new Array(42);
|
|
3470
|
+
for (var index = 0; index < items.length; index++) {
|
|
3471
|
+
date.setDate(date.getDate() + 1);
|
|
3472
|
+
const item = {
|
|
3473
|
+
day: date.getDate(),
|
|
3474
|
+
month: date.getMonth() + 1,
|
|
3475
|
+
year: date.getFullYear(),
|
|
3476
|
+
disabled: monthItem.disabled
|
|
3477
|
+
};
|
|
3478
|
+
if (item.disabled != true) {
|
|
3479
|
+
const date2 = new Date(formatDateValue(item, "yyyy-MM-dd"));
|
|
3480
|
+
item.disabled = minDate != void 0 && date2 < minDate || maxDate != void 0 && date2 > maxDate;
|
|
3481
|
+
}
|
|
3482
|
+
items[index] = Object.freeze(item);
|
|
3483
|
+
}
|
|
3484
|
+
return items;
|
|
3485
|
+
}
|
|
3486
|
+
function buildHourItems(min, max) {
|
|
3487
|
+
const items = new Array(24);
|
|
3488
|
+
for (var index = 0; index < items.length; index++) {
|
|
3489
|
+
items[index] = Object.freeze({
|
|
3490
|
+
hour: index,
|
|
3491
|
+
disabled: min && min.hour != void 0 && index < min.hour || max && max.hour != void 0 && index > max.hour
|
|
3492
|
+
});
|
|
3493
|
+
}
|
|
3494
|
+
return items;
|
|
3495
|
+
}
|
|
3496
|
+
function buildMinuteItems(hourItem, min, max) {
|
|
3497
|
+
const items = new Array(60);
|
|
3498
|
+
const minNumber = min && min.minute != void 0 ? getTimeNumber(min.hour, min.minute, 0) : void 0;
|
|
3499
|
+
const maxNumber = max && max.minute != void 0 ? getTimeNumber(max.hour, max.minute, 0) : void 0;
|
|
3500
|
+
for (let index = 0; index < items.length; index++) {
|
|
3501
|
+
const item = {
|
|
3502
|
+
minute: index,
|
|
3503
|
+
hour: hourItem.hour,
|
|
3504
|
+
disabled: hourItem.disabled
|
|
3505
|
+
};
|
|
3506
|
+
if (item.disabled != true) {
|
|
3507
|
+
const number = getTimeNumber(item.hour, item.minute, 0);
|
|
3508
|
+
item.disabled = minNumber != void 0 && number < minNumber || maxNumber != void 0 && number > maxNumber;
|
|
3509
|
+
}
|
|
3510
|
+
items[index] = Object.freeze(item);
|
|
3511
|
+
}
|
|
3512
|
+
return items;
|
|
3513
|
+
}
|
|
3514
|
+
function buildSecondItems(minuteItem, min, max) {
|
|
3515
|
+
const items = new Array(60);
|
|
3516
|
+
const minNumber = min && min.minute != void 0 ? getTimeNumber(min.hour, min.minute, min.second) : void 0;
|
|
3517
|
+
const maxNumber = max && max.minute != void 0 ? getTimeNumber(max.hour, max.minute, max.second) : void 0;
|
|
3518
|
+
for (let index = 0; index < items.length; index++) {
|
|
3519
|
+
const item = {
|
|
3520
|
+
second: index,
|
|
3521
|
+
minute: minuteItem.minute,
|
|
3522
|
+
hour: minuteItem.hour,
|
|
3523
|
+
disabled: minuteItem.disabled
|
|
3524
|
+
};
|
|
3525
|
+
if (item.disabled != true) {
|
|
3526
|
+
const number = getTimeNumber(item.hour, item.minute, item.second);
|
|
3527
|
+
item.disabled = minNumber != void 0 && number < minNumber || maxNumber != void 0 && number > maxNumber;
|
|
3528
|
+
}
|
|
3529
|
+
items[index] = Object.freeze(item);
|
|
3530
|
+
}
|
|
3531
|
+
return items;
|
|
3532
|
+
}
|
|
3533
|
+
function getTimeNumber(hour, minute, second) {
|
|
3534
|
+
return (hour || 0) * 1e4 + (minute || 0) * 100 + (second || 0);
|
|
3535
|
+
}
|
|
3536
|
+
function isValidTime(format, time, min, max) {
|
|
3537
|
+
time = correctTimeValue(time);
|
|
3538
|
+
if (time) {
|
|
3539
|
+
min = correctTimeValue({
|
|
3540
|
+
...min
|
|
3541
|
+
});
|
|
3542
|
+
const timeNumber = getTimeNumber(time.hour, time.minute, format == "HH:mm" ? 0 : time.second);
|
|
3543
|
+
if (min != void 0) {
|
|
3544
|
+
const minNumber = getTimeNumber(min.hour, min.minute, format == "HH:mm" ? 0 : max.second);
|
|
3545
|
+
if (timeNumber < minNumber) {
|
|
3546
|
+
return false;
|
|
3547
|
+
}
|
|
3548
|
+
}
|
|
3549
|
+
max = correctTimeValue({
|
|
3550
|
+
...max
|
|
3551
|
+
});
|
|
3552
|
+
if (max != void 0) {
|
|
3553
|
+
const maxNumber = getTimeNumber(max.hour, max.minute, format == "HH:mm" ? 0 : max.second);
|
|
3554
|
+
if (timeNumber > maxNumber) {
|
|
3555
|
+
return false;
|
|
3556
|
+
}
|
|
3557
|
+
}
|
|
3558
|
+
return true;
|
|
3559
|
+
}
|
|
3560
|
+
return false;
|
|
3561
|
+
}
|
|
3562
|
+
|
|
3563
|
+
const _hoisted_1$2 = {
|
|
3386
3564
|
class: "tz-item",
|
|
3387
3565
|
ref: "hour-items"
|
|
3388
3566
|
};
|
|
3389
|
-
const
|
|
3390
|
-
const
|
|
3567
|
+
const _hoisted_2$1 = ["textContent", "onClick"];
|
|
3568
|
+
const _hoisted_3$1 = {
|
|
3391
3569
|
class: "tz-item",
|
|
3392
3570
|
ref: "minute-items"
|
|
3393
3571
|
};
|
|
3394
|
-
const
|
|
3395
|
-
const
|
|
3572
|
+
const _hoisted_4$1 = ["textContent", "onClick"];
|
|
3573
|
+
const _hoisted_5$1 = {
|
|
3396
3574
|
key: 0,
|
|
3397
3575
|
class: "tz-item",
|
|
3398
3576
|
ref: "second-items"
|
|
3399
3577
|
};
|
|
3400
|
-
const
|
|
3401
|
-
|
|
3402
|
-
class: "time-operation"
|
|
3403
|
-
};
|
|
3404
|
-
var _sfc_main$1 = defineComponent({
|
|
3578
|
+
const _hoisted_6$1 = ["textContent", "onClick"];
|
|
3579
|
+
var _sfc_main$2 = defineComponent({
|
|
3405
3580
|
__name: "time-pc",
|
|
3406
3581
|
props: {
|
|
3407
3582
|
value: {},
|
|
3408
|
-
|
|
3583
|
+
format: {},
|
|
3584
|
+
min: {},
|
|
3585
|
+
max: {},
|
|
3586
|
+
toolbarDisabled: {
|
|
3409
3587
|
type: Boolean
|
|
3410
3588
|
},
|
|
3411
3589
|
nowDisabled: {
|
|
3412
3590
|
type: Boolean
|
|
3413
3591
|
},
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3592
|
+
clearDisabled: {
|
|
3593
|
+
type: Boolean
|
|
3594
|
+
},
|
|
3595
|
+
popup: {},
|
|
3596
|
+
picker: {},
|
|
3418
3597
|
inPopup: {},
|
|
3419
3598
|
closePopup: {
|
|
3420
3599
|
type: Function
|
|
@@ -3432,198 +3611,543 @@ var _sfc_main$1 = defineComponent({
|
|
|
3432
3611
|
} = _ref;
|
|
3433
3612
|
const props = __props;
|
|
3434
3613
|
const emits = __emit;
|
|
3435
|
-
const
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
const
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
const {
|
|
3444
|
-
inPopup,
|
|
3445
|
-
closePopup
|
|
3446
|
-
} = props;
|
|
3447
|
-
const secondDisabled = tm.format == "HH:mm";
|
|
3448
|
-
const tvRef = ref();
|
|
3614
|
+
const format = props.format == "HH:mm" ? "HH:mm" : "HH:mm:ss";
|
|
3615
|
+
const min = parseTimeValue(props.min);
|
|
3616
|
+
const max = parseTimeValue(props.max);
|
|
3617
|
+
const timeRef = ref(parseTimeValue(props.value) || getTimeValue(new Date()));
|
|
3618
|
+
const isValidTimeRef = computed(() => format == "HH:mm" ? minuteItems.value && minuteItems.value[timeRef.value.minute].disabled != true : secondItems.value && secondItems.value[timeRef.value.second].disabled != true);
|
|
3619
|
+
const hourItems = shallowRef(buildHourItems(min, max));
|
|
3620
|
+
const minuteItems = shallowRef();
|
|
3621
|
+
const secondItems = shallowRef();
|
|
3449
3622
|
const hItemsDom = useTemplateRef("hour-items");
|
|
3450
3623
|
const mItemsDom = useTemplateRef("minute-items");
|
|
3451
3624
|
const sItemsDom = useTemplateRef("second-items");
|
|
3452
|
-
function
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3460
|
-
return {
|
|
3461
|
-
active: tvRef.value.minute == value,
|
|
3462
|
-
disabled: tm.validateHHmm(tvRef.value.hour, value) == false
|
|
3463
|
-
};
|
|
3464
|
-
case "second":
|
|
3465
|
-
return {
|
|
3466
|
-
active: tvRef.value.second == value,
|
|
3467
|
-
disabled: tm.validateHHmmss(tvRef.value.hour, tvRef.value.minute, value) == false
|
|
3468
|
-
};
|
|
3469
|
-
}
|
|
3625
|
+
async function rebuildItems(time) {
|
|
3626
|
+
time != void 0 && (timeRef.value = time);
|
|
3627
|
+
minuteItems.value = buildMinuteItems(hourItems.value[timeRef.value.hour], min, max);
|
|
3628
|
+
secondItems.value = buildSecondItems(minuteItems.value[timeRef.value.minute], min, max);
|
|
3629
|
+
await nextTick();
|
|
3630
|
+
scrollIntoView(hItemsDom.value);
|
|
3631
|
+
scrollIntoView(mItemsDom.value);
|
|
3632
|
+
scrollIntoView(sItemsDom.value);
|
|
3470
3633
|
}
|
|
3471
3634
|
function scrollIntoView(items) {
|
|
3472
|
-
let activeIndex = void 0
|
|
3473
|
-
firstValidIndex;
|
|
3635
|
+
let activeIndex = void 0;
|
|
3474
3636
|
for (var index = 0; index < (items ? items.children.length : 0); index++) {
|
|
3475
3637
|
const ele = items.children[index];
|
|
3476
|
-
if (ele.classList.contains("disabled") == true) {
|
|
3477
|
-
continue;
|
|
3478
|
-
}
|
|
3479
|
-
if (firstValidIndex == void 0) {
|
|
3480
|
-
firstValidIndex = index;
|
|
3481
|
-
}
|
|
3482
3638
|
if (ele.classList.contains("active") == true) {
|
|
3483
3639
|
activeIndex = index;
|
|
3484
3640
|
break;
|
|
3485
3641
|
}
|
|
3486
3642
|
}
|
|
3487
|
-
|
|
3488
|
-
if (activeIndex == void 0) {
|
|
3489
|
-
if (firstValidIndex != void 0) {
|
|
3490
|
-
showIndex = firstValidIndex;
|
|
3491
|
-
}
|
|
3492
|
-
}
|
|
3493
|
-
showIndex != void 0 && items.children[showIndex].scrollIntoView({
|
|
3643
|
+
activeIndex != void 0 && items.children[activeIndex].scrollIntoView({
|
|
3494
3644
|
behavior: "smooth",
|
|
3495
3645
|
block: "center"
|
|
3496
3646
|
});
|
|
3497
3647
|
}
|
|
3498
|
-
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
|
|
3502
|
-
|
|
3503
|
-
|
|
3504
|
-
|
|
3648
|
+
function onHourClick(item) {
|
|
3649
|
+
if (item.disabled != true && timeRef.value.hour != item.hour) {
|
|
3650
|
+
timeRef.value.hour = item.hour;
|
|
3651
|
+
minuteItems.value = buildMinuteItems(item, min, max);
|
|
3652
|
+
secondItems.value = buildSecondItems(minuteItems.value[timeRef.value.minute], min, max);
|
|
3653
|
+
}
|
|
3654
|
+
}
|
|
3655
|
+
function onMinuteClick(item) {
|
|
3656
|
+
if (item.disabled != true) {
|
|
3657
|
+
if (format == "HH:mm") {
|
|
3658
|
+
const value = formatTimeValue(item, "HH:mm");
|
|
3659
|
+
emits("confirm", value);
|
|
3660
|
+
props.inPopup && props.closePopup(value);
|
|
3661
|
+
} else if (timeRef.value.minute != item.minute) {
|
|
3662
|
+
timeRef.value.minute = item.minute;
|
|
3663
|
+
secondItems.value = buildSecondItems(item, min, max);
|
|
3664
|
+
}
|
|
3665
|
+
}
|
|
3666
|
+
}
|
|
3667
|
+
function onSecondClick(item) {
|
|
3668
|
+
if (item.disabled != true) {
|
|
3669
|
+
timeRef.value.second = item.second;
|
|
3670
|
+
onConfirm();
|
|
3671
|
+
}
|
|
3672
|
+
}
|
|
3673
|
+
function onConfirm() {
|
|
3674
|
+
if (isValidTimeRef.value == true) {
|
|
3675
|
+
const value = formatTimeValue(timeRef.value, format);
|
|
3676
|
+
emits("confirm", value);
|
|
3677
|
+
props.inPopup && props.closePopup(value);
|
|
3678
|
+
}
|
|
3679
|
+
}
|
|
3680
|
+
onMounted(rebuildItems);
|
|
3681
|
+
return (_ctx, _cache) => {
|
|
3682
|
+
return openBlock(), createBlock(_sfc_main$b, {
|
|
3683
|
+
class: normalizeClass(["time-picker pc", {
|
|
3684
|
+
"second-disabled": unref(format) != "HH:mm:ss"
|
|
3685
|
+
}]),
|
|
3686
|
+
mode: "vertical"
|
|
3687
|
+
}, createSlots({
|
|
3688
|
+
main: withCtx(() => [createVNode(_sfc_main$6, {
|
|
3689
|
+
group: true,
|
|
3690
|
+
effect: "down-up"
|
|
3691
|
+
}, {
|
|
3692
|
+
default: withCtx(() => [createElementVNode("div", _hoisted_1$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(hourItems.value, item => {
|
|
3693
|
+
return openBlock(), createElementBlock("div", {
|
|
3694
|
+
class: normalizeClass(["tzi-number", {
|
|
3695
|
+
active: item.hour == timeRef.value.hour,
|
|
3696
|
+
disabled: item.disabled
|
|
3697
|
+
}]),
|
|
3698
|
+
key: item.hour,
|
|
3699
|
+
textContent: toDisplayString(unref(padStart)(item.hour, 2, "0")),
|
|
3700
|
+
onClick: $event => onHourClick(item)
|
|
3701
|
+
}, null, 10, _hoisted_2$1);
|
|
3702
|
+
}), 128))], 512), createElementVNode("div", _hoisted_3$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(minuteItems.value, item => {
|
|
3703
|
+
return openBlock(), createElementBlock("div", {
|
|
3704
|
+
class: normalizeClass(["tzi-number", {
|
|
3705
|
+
active: item.minute == timeRef.value.minute,
|
|
3706
|
+
disabled: item.disabled
|
|
3707
|
+
}]),
|
|
3708
|
+
key: `${item.hour}:${item.minute}`,
|
|
3709
|
+
textContent: toDisplayString(unref(padStart)(item.minute, 2, "0")),
|
|
3710
|
+
onClick: $event => onMinuteClick(item)
|
|
3711
|
+
}, null, 10, _hoisted_4$1);
|
|
3712
|
+
}), 128))], 512), unref(format) == "HH:mm:ss" ? (openBlock(), createElementBlock("div", _hoisted_5$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(secondItems.value, item => {
|
|
3713
|
+
return openBlock(), createElementBlock("div", {
|
|
3714
|
+
class: normalizeClass(["tzi-number", {
|
|
3715
|
+
active: item.second == timeRef.value.second,
|
|
3716
|
+
disabled: item.disabled
|
|
3717
|
+
}]),
|
|
3718
|
+
key: `${item.hour}:${item.minute}:${item.second}`,
|
|
3719
|
+
textContent: toDisplayString(unref(padStart)(item.second, 2, "0")),
|
|
3720
|
+
onClick: $event => onSecondClick(item)
|
|
3721
|
+
}, null, 10, _hoisted_6$1);
|
|
3722
|
+
}), 128))], 512)) : createCommentVNode("", true)]),
|
|
3723
|
+
_: 1
|
|
3724
|
+
})]),
|
|
3725
|
+
_: 2
|
|
3726
|
+
}, [__props.toolbarDisabled != true ? {
|
|
3727
|
+
name: "bottom",
|
|
3728
|
+
fn: withCtx(() => [__props.clearDisabled != true ? (openBlock(), createBlock(_sfc_main$z, {
|
|
3729
|
+
key: 0,
|
|
3730
|
+
type: "link",
|
|
3731
|
+
size: "small",
|
|
3732
|
+
textContent: "清空",
|
|
3733
|
+
onClick: _cache[0] || (_cache[0] = $event => (emits("clear"), __props.inPopup && __props.closePopup("")))
|
|
3734
|
+
})) : createCommentVNode("", true), __props.nowDisabled != true ? (openBlock(), createBlock(_sfc_main$z, {
|
|
3735
|
+
key: 1,
|
|
3736
|
+
type: "link",
|
|
3737
|
+
size: "small",
|
|
3738
|
+
textContent: "现在",
|
|
3739
|
+
onClick: _cache[1] || (_cache[1] = $event => rebuildItems(unref(getTimeValue)(new Date())))
|
|
3740
|
+
})) : createCommentVNode("", true), createVNode(_sfc_main$z, {
|
|
3741
|
+
type: "link",
|
|
3742
|
+
size: "small",
|
|
3743
|
+
textContent: "确定",
|
|
3744
|
+
class: normalizeClass({
|
|
3745
|
+
disabled: isValidTimeRef.value != true
|
|
3746
|
+
}),
|
|
3747
|
+
onClick: onConfirm
|
|
3748
|
+
}, null, 8, ["class"])]),
|
|
3749
|
+
key: "0"
|
|
3750
|
+
} : void 0]), 1032, ["class"]);
|
|
3751
|
+
};
|
|
3752
|
+
}
|
|
3753
|
+
});
|
|
3754
|
+
|
|
3755
|
+
const _hoisted_1$1 = ["textContent"];
|
|
3756
|
+
const _hoisted_2 = ["textContent"];
|
|
3757
|
+
const _hoisted_3 = ["textContent"];
|
|
3758
|
+
const _hoisted_4 = ["textContent", "onClick"];
|
|
3759
|
+
const _hoisted_5 = ["textContent", "onClick"];
|
|
3760
|
+
const _hoisted_6 = ["textContent"];
|
|
3761
|
+
const _hoisted_7 = ["textContent", "onClick"];
|
|
3762
|
+
const _hoisted_8 = ["textContent"];
|
|
3763
|
+
var _sfc_main$1 = defineComponent({
|
|
3764
|
+
__name: "date-pc",
|
|
3765
|
+
props: {
|
|
3766
|
+
value: {},
|
|
3767
|
+
format: {},
|
|
3768
|
+
min: {},
|
|
3769
|
+
max: {},
|
|
3770
|
+
minPickTime: {},
|
|
3771
|
+
maxPickTime: {},
|
|
3772
|
+
toolbarDisabled: {
|
|
3773
|
+
type: Boolean
|
|
3774
|
+
},
|
|
3775
|
+
nowDisabled: {
|
|
3776
|
+
type: Boolean
|
|
3777
|
+
},
|
|
3778
|
+
clearDisabled: {
|
|
3779
|
+
type: Boolean
|
|
3780
|
+
},
|
|
3781
|
+
popup: {},
|
|
3782
|
+
picker: {},
|
|
3783
|
+
popupStatus: {},
|
|
3784
|
+
target: {},
|
|
3785
|
+
followX: {},
|
|
3786
|
+
followY: {},
|
|
3787
|
+
pinned: {},
|
|
3788
|
+
inPopup: {},
|
|
3789
|
+
closePopup: {
|
|
3790
|
+
type: Function
|
|
3791
|
+
}
|
|
3792
|
+
},
|
|
3793
|
+
emits: ["clear", "confirm"],
|
|
3794
|
+
setup(__props, _ref) {
|
|
3795
|
+
let {
|
|
3796
|
+
emit: __emit
|
|
3797
|
+
} = _ref;
|
|
3798
|
+
const props = __props;
|
|
3799
|
+
const emits = __emit;
|
|
3800
|
+
const {
|
|
3801
|
+
inPopup
|
|
3802
|
+
} = props;
|
|
3803
|
+
const dateRef = ref(parseDateValue(props.value));
|
|
3804
|
+
const format = correctDateFormat(props.format, "yyyy-MM-dd");
|
|
3805
|
+
const min = Object.freeze(parseDateValue(props.min));
|
|
3806
|
+
const max = Object.freeze(parseDateValue(props.max));
|
|
3807
|
+
const endStep = initStepByFormat(format);
|
|
3808
|
+
const stepRef = shallowRef(endStep);
|
|
3809
|
+
const yearItems = shallowRef();
|
|
3810
|
+
const monthItems = shallowRef();
|
|
3811
|
+
const dayItemsRef = shallowRef([]);
|
|
3812
|
+
const isValidDateRef = computed(validateDate);
|
|
3813
|
+
const minPickTime = Object.freeze(parseTimeValue(props.minPickTime));
|
|
3814
|
+
const maxPickTime = Object.freeze(parseTimeValue(props.maxPickTime));
|
|
3815
|
+
const timeFormat = format == "yyyy-MM-dd HH:mm" ? "HH:mm" : format == "yyyy-MM-dd HH:mm:ss" ? "HH:mm:ss" : void 0;
|
|
3816
|
+
const timeAreaDom = timeFormat ? useTemplateRef("time-area") : void 0;
|
|
3817
|
+
function validateDate() {
|
|
3818
|
+
switch (format) {
|
|
3819
|
+
case "yyyy":
|
|
3820
|
+
{
|
|
3821
|
+
const item = yearItems.value.find(item2 => item2.year == dateRef.value.year);
|
|
3822
|
+
return item && item.disabled != true;
|
|
3505
3823
|
}
|
|
3506
|
-
|
|
3507
|
-
|
|
3508
|
-
|
|
3509
|
-
|
|
3510
|
-
await nextTick();
|
|
3511
|
-
scrollIntoView(sItemsDom.value);
|
|
3824
|
+
case "yyyy-MM":
|
|
3825
|
+
{
|
|
3826
|
+
const item = monthItems.value.find(item2 => item2.year == dateRef.value.year && item2.month == dateRef.value.month);
|
|
3827
|
+
return item && item.disabled != true;
|
|
3512
3828
|
}
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3829
|
+
case "yyyy-MM-dd":
|
|
3830
|
+
{
|
|
3831
|
+
const item = dayItemsRef.value.find(item2 => item2.year == dateRef.value.year && item2.month == dateRef.value.month && item2.day == dateRef.value.day);
|
|
3832
|
+
return item ? item.disabled != true : false;
|
|
3517
3833
|
}
|
|
3518
|
-
|
|
3834
|
+
case "yyyy-MM-dd HH:mm":
|
|
3835
|
+
case "yyyy-MM-dd HH:mm:ss":
|
|
3836
|
+
{
|
|
3837
|
+
if (isValidTime(timeFormat, dateRef.value, minPickTime, maxPickTime) == true) {
|
|
3838
|
+
const date = getDateByValue(dateRef.value);
|
|
3839
|
+
const disabled = min && date < getDateByValue(min) || max && date > getDateByValue(max);
|
|
3840
|
+
return disabled != true;
|
|
3841
|
+
}
|
|
3842
|
+
return false;
|
|
3843
|
+
}
|
|
3844
|
+
default:
|
|
3845
|
+
return false;
|
|
3519
3846
|
}
|
|
3520
3847
|
}
|
|
3521
|
-
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
|
|
3527
|
-
|
|
3848
|
+
function buildPickerItems(step, basis) {
|
|
3849
|
+
switch (step) {
|
|
3850
|
+
case "year":
|
|
3851
|
+
{
|
|
3852
|
+
dateRef.value.year += basis * 18;
|
|
3853
|
+
yearItems.value = buildYearItems(dateRef.value.year, min, max);
|
|
3854
|
+
if (basis != 0) {
|
|
3855
|
+
dateRef.value.month = 1;
|
|
3856
|
+
dateRef.value.day = 1;
|
|
3857
|
+
}
|
|
3858
|
+
break;
|
|
3859
|
+
}
|
|
3860
|
+
case "month":
|
|
3861
|
+
{
|
|
3862
|
+
dateRef.value.year += basis;
|
|
3863
|
+
let yearItem = (yearItems.value || []).find(item => item.year == dateRef.value.year);
|
|
3864
|
+
if (yearItem == void 0) {
|
|
3865
|
+
buildPickerItems("year", 0);
|
|
3866
|
+
yearItem = yearItems.value[9];
|
|
3867
|
+
}
|
|
3868
|
+
monthItems.value = buildMonthItems(yearItem, min, max);
|
|
3869
|
+
basis != 0 && (dateRef.value.day = 1);
|
|
3870
|
+
break;
|
|
3871
|
+
}
|
|
3872
|
+
case "day":
|
|
3873
|
+
{
|
|
3874
|
+
const date = new Date(dateRef.value.year, dateRef.value.month - 1, 1);
|
|
3875
|
+
date.setMonth(date.getMonth() + basis);
|
|
3876
|
+
dateRef.value.year = date.getFullYear();
|
|
3877
|
+
dateRef.value.month = date.getMonth() + 1;
|
|
3878
|
+
let monthItem = (monthItems.value || []).find(item => item.year == dateRef.value.year && item.month == dateRef.value.month);
|
|
3879
|
+
if (monthItem == void 0) {
|
|
3880
|
+
buildPickerItems("month", 0);
|
|
3881
|
+
monthItem = monthItems.value[dateRef.value.month - 1];
|
|
3882
|
+
}
|
|
3883
|
+
dayItemsRef.value = buildDayItems(monthItem, min, max);
|
|
3884
|
+
basis != 0 && (dateRef.value.day = 1);
|
|
3885
|
+
break;
|
|
3886
|
+
}
|
|
3528
3887
|
}
|
|
3529
3888
|
}
|
|
3530
|
-
function
|
|
3531
|
-
|
|
3532
|
-
|
|
3533
|
-
|
|
3889
|
+
function onSwitchStepClick(newValue) {
|
|
3890
|
+
setTimeout(() => stepRef.value = newValue);
|
|
3891
|
+
}
|
|
3892
|
+
function onYearItemClick(item) {
|
|
3893
|
+
if (item.disabled != true) {
|
|
3894
|
+
dateRef.value.year = item.year;
|
|
3895
|
+
if (format == "yyyy") {
|
|
3896
|
+
const value = String(dateRef.value.year).padStart(4, "0");
|
|
3897
|
+
emits("confirm", value);
|
|
3898
|
+
props.inPopup && props.closePopup(value);
|
|
3899
|
+
} else {
|
|
3900
|
+
dateRef.value.month = 1;
|
|
3901
|
+
monthItems.value = buildMonthItems(item, min, max);
|
|
3902
|
+
onSwitchStepClick("month");
|
|
3903
|
+
}
|
|
3534
3904
|
}
|
|
3535
|
-
|
|
3536
|
-
|
|
3905
|
+
}
|
|
3906
|
+
function onMonthItemClick(item) {
|
|
3907
|
+
if (item.disabled != true) {
|
|
3908
|
+
dateRef.value.year = item.year;
|
|
3909
|
+
dateRef.value.month = item.month;
|
|
3910
|
+
if (format == "yyyy-MM") {
|
|
3911
|
+
const value = formatDateValue(dateRef.value, "yyyy-MM");
|
|
3912
|
+
emits("confirm", value);
|
|
3913
|
+
props.inPopup && props.closePopup(value);
|
|
3914
|
+
} else {
|
|
3915
|
+
dateRef.value.day = 1;
|
|
3916
|
+
dayItemsRef.value = buildDayItems(item, min, max);
|
|
3917
|
+
onSwitchStepClick("day");
|
|
3918
|
+
}
|
|
3537
3919
|
}
|
|
3538
|
-
const value = tm.toString(tvRef.value);
|
|
3539
|
-
emits("confirm", value);
|
|
3540
|
-
inPopup && closePopup(value);
|
|
3541
3920
|
}
|
|
3542
|
-
{
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
|
|
3921
|
+
function onDayItemClick(item) {
|
|
3922
|
+
if (item.disabled != true) {
|
|
3923
|
+
const isNowMonth = item.year == dateRef.value.year && item.month == dateRef.value.month;
|
|
3924
|
+
Object.assign(dateRef.value, {
|
|
3925
|
+
year: item.year,
|
|
3926
|
+
month: item.month,
|
|
3927
|
+
day: item.day
|
|
3928
|
+
});
|
|
3929
|
+
if (format == "yyyy-MM-dd") {
|
|
3930
|
+
const value = formatDateValue(dateRef.value, "yyyy-MM-dd");
|
|
3931
|
+
emits("confirm", value);
|
|
3932
|
+
props.inPopup && props.closePopup(value);
|
|
3933
|
+
} else {
|
|
3934
|
+
isNowMonth || buildPickerItems("day", 0);
|
|
3935
|
+
}
|
|
3936
|
+
}
|
|
3546
3937
|
}
|
|
3547
|
-
|
|
3548
|
-
|
|
3549
|
-
|
|
3550
|
-
|
|
3551
|
-
|
|
3552
|
-
|
|
3938
|
+
async function onSelectTime() {
|
|
3939
|
+
if (props.picker == void 0 || timeAreaDom.value == void 0 || props.pinned.value == true) {
|
|
3940
|
+
return;
|
|
3941
|
+
}
|
|
3942
|
+
props.pinned.value = true;
|
|
3943
|
+
const task = props.picker.showTime(timeAreaDom.value, {
|
|
3944
|
+
format: timeFormat,
|
|
3945
|
+
value: formatTimeValue(dateRef.value, timeFormat),
|
|
3946
|
+
min: props.minPickTime,
|
|
3947
|
+
max: props.minPickTime,
|
|
3948
|
+
followX: "start",
|
|
3949
|
+
followY: "before",
|
|
3950
|
+
spaceX: -2,
|
|
3951
|
+
spaceY: 4
|
|
3952
|
+
});
|
|
3953
|
+
task.finally(() => setTimeout(() => props.pinned.value = false)).then(text => {
|
|
3954
|
+
if (text != void 0) {
|
|
3955
|
+
const time = parseTimeValue(text) || Object.create(null);
|
|
3956
|
+
dateRef.value.hour = time.hour;
|
|
3957
|
+
dateRef.value.minute = time.minute;
|
|
3958
|
+
dateRef.value.second = time.second;
|
|
3959
|
+
}
|
|
3960
|
+
}, reason => {
|
|
3961
|
+
console.error(reason);
|
|
3962
|
+
});
|
|
3963
|
+
}
|
|
3964
|
+
function onNow() {
|
|
3965
|
+
stepRef.value = initStepByFormat(format);
|
|
3966
|
+
dateRef.value = getDateValue(new Date());
|
|
3967
|
+
buildPickerItems(stepRef.value, 0);
|
|
3968
|
+
}
|
|
3969
|
+
function onConfirm() {
|
|
3970
|
+
if (isValidDateRef.value == true) {
|
|
3971
|
+
const value = formatDateValue(dateRef.value, format);
|
|
3972
|
+
emits("confirm", value);
|
|
3973
|
+
props.inPopup && props.closePopup(value);
|
|
3974
|
+
}
|
|
3975
|
+
}
|
|
3976
|
+
dateRef.value == void 0 && (dateRef.value = electDateValue());
|
|
3977
|
+
buildPickerItems(stepRef.value, 0);
|
|
3553
3978
|
return (_ctx, _cache) => {
|
|
3554
|
-
return openBlock(),
|
|
3555
|
-
class: normalizeClass(["
|
|
3556
|
-
"
|
|
3557
|
-
}])
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
|
|
3979
|
+
return openBlock(), createBlock(_sfc_main$b, {
|
|
3980
|
+
class: normalizeClass(["date-picker pc", {
|
|
3981
|
+
"time-now": __props.pinned && __props.pinned.value == true
|
|
3982
|
+
}]),
|
|
3983
|
+
mode: "vertical",
|
|
3984
|
+
top: {
|
|
3985
|
+
height: "40px"
|
|
3986
|
+
},
|
|
3987
|
+
bottom: {
|
|
3988
|
+
height: "30px"
|
|
3989
|
+
}
|
|
3990
|
+
}, createSlots({
|
|
3991
|
+
top: withCtx(() => [createVNode(_sfc_main$y, {
|
|
3992
|
+
type: "arrow",
|
|
3993
|
+
rotate: 180,
|
|
3994
|
+
size: 26,
|
|
3995
|
+
onClick: _cache[0] || (_cache[0] = $event => buildPickerItems(stepRef.value, -1))
|
|
3996
|
+
}), createElementVNode("div", {
|
|
3997
|
+
class: normalizeClass(["header-content", stepRef.value])
|
|
3998
|
+
}, [stepRef.value == "year" ? (openBlock(), createElementBlock("div", {
|
|
3999
|
+
key: 0,
|
|
4000
|
+
textContent: toDisplayString(`${yearItems.value[0].year}年 - ${unref(getFromArray)(yearItems.value, -1).year}年`)
|
|
4001
|
+
}, null, 8, _hoisted_1$1)) : (openBlock(), createElementBlock(Fragment, {
|
|
4002
|
+
key: 1
|
|
4003
|
+
}, [createElementVNode("div", {
|
|
4004
|
+
textContent: toDisplayString(`${dateRef.value.year}年`),
|
|
4005
|
+
onClick: _cache[1] || (_cache[1] = $event => onSwitchStepClick("year"))
|
|
4006
|
+
}, null, 8, _hoisted_2), stepRef.value == "day" ? (openBlock(), createElementBlock("div", {
|
|
4007
|
+
key: 0,
|
|
4008
|
+
textContent: toDisplayString(`${dateRef.value.month}月`),
|
|
4009
|
+
onClick: _cache[2] || (_cache[2] = $event => onSwitchStepClick("month"))
|
|
4010
|
+
}, null, 8, _hoisted_3)) : createCommentVNode("", true)], 64))], 2), createVNode(_sfc_main$y, {
|
|
4011
|
+
type: "arrow",
|
|
4012
|
+
size: 26,
|
|
4013
|
+
onClick: _cache[3] || (_cache[3] = $event => buildPickerItems(stepRef.value, 1))
|
|
4014
|
+
})]),
|
|
4015
|
+
main: withCtx(() => [stepRef.value == "year" ? (openBlock(true), createElementBlock(Fragment, {
|
|
4016
|
+
key: 0
|
|
4017
|
+
}, renderList(yearItems.value, item => {
|
|
3563
4018
|
return openBlock(), createElementBlock("div", {
|
|
3564
|
-
class: normalizeClass(["
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
4019
|
+
class: normalizeClass(["year-item", {
|
|
4020
|
+
"active": dateRef.value.year == item.year,
|
|
4021
|
+
"disabled": item.disabled
|
|
4022
|
+
}]),
|
|
4023
|
+
key: item.year
|
|
4024
|
+
}, [createElementVNode("span", {
|
|
4025
|
+
textContent: toDisplayString(item.year),
|
|
4026
|
+
onClick: $event => onYearItemClick(item)
|
|
4027
|
+
}, null, 8, _hoisted_4)], 2);
|
|
4028
|
+
}), 128)) : stepRef.value == "month" ? (openBlock(true), createElementBlock(Fragment, {
|
|
4029
|
+
key: 1
|
|
4030
|
+
}, renderList(monthItems.value, item => {
|
|
3569
4031
|
return openBlock(), createElementBlock("div", {
|
|
3570
|
-
class: normalizeClass(["
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
4032
|
+
class: normalizeClass(["month-item", {
|
|
4033
|
+
"active": dateRef.value.month == item.month,
|
|
4034
|
+
"disabled": item.disabled
|
|
4035
|
+
}]),
|
|
4036
|
+
key: `${item.year}-${item.month}`
|
|
4037
|
+
}, [createElementVNode("span", {
|
|
4038
|
+
textContent: toDisplayString(item.text),
|
|
4039
|
+
onClick: $event => onMonthItemClick(item)
|
|
4040
|
+
}, null, 8, _hoisted_5)], 2);
|
|
4041
|
+
}), 128)) : (openBlock(), createElementBlock(Fragment, {
|
|
4042
|
+
key: 2
|
|
4043
|
+
}, [(openBlock(), createElementBlock(Fragment, null, renderList(["日", "一", "二", "三", "四", "五", "六"], item => {
|
|
4044
|
+
return createElementVNode("div", {
|
|
4045
|
+
class: "day-item week",
|
|
4046
|
+
key: item,
|
|
4047
|
+
textContent: toDisplayString(item)
|
|
4048
|
+
}, null, 8, _hoisted_6);
|
|
4049
|
+
}), 64)), (openBlock(true), createElementBlock(Fragment, null, renderList(dayItemsRef.value, item => {
|
|
3575
4050
|
return openBlock(), createElementBlock("div", {
|
|
3576
|
-
class: normalizeClass(["
|
|
3577
|
-
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
4051
|
+
class: normalizeClass(["day-item", {
|
|
4052
|
+
"active": dateRef.value.year == item.year && dateRef.value.month == item.month && dateRef.value.day == item.day,
|
|
4053
|
+
"now-month": dateRef.value.year == item.year && dateRef.value.month == item.month,
|
|
4054
|
+
"disabled": item.disabled
|
|
4055
|
+
}]),
|
|
4056
|
+
key: `${item.year}-${item.month}-${item.day}`
|
|
4057
|
+
}, [createElementVNode("span", {
|
|
4058
|
+
textContent: toDisplayString(item.day),
|
|
4059
|
+
onClick: $event => onDayItemClick(item)
|
|
4060
|
+
}, null, 8, _hoisted_7)], 2);
|
|
4061
|
+
}), 128))], 64))]),
|
|
4062
|
+
_: 2
|
|
4063
|
+
}, [unref(endStep) == stepRef.value && (__props.toolbarDisabled != true || unref(timeFormat) != void 0) ? {
|
|
4064
|
+
name: "bottom",
|
|
4065
|
+
fn: withCtx(() => [unref(timeFormat) != void 0 ? (openBlock(), createElementBlock("div", {
|
|
4066
|
+
key: 0,
|
|
4067
|
+
class: normalizeClass(["time-area", {
|
|
4068
|
+
placeholder: dateRef.value.hour == void 0
|
|
4069
|
+
}]),
|
|
4070
|
+
ref: "time-area",
|
|
4071
|
+
textContent: toDisplayString(unref(formatTimeValue)(dateRef.value, unref(timeFormat)) || "选择时间"),
|
|
4072
|
+
onClick: onSelectTime
|
|
4073
|
+
}, null, 10, _hoisted_8)) : createCommentVNode("", true), __props.toolbarDisabled != true ? (openBlock(), createElementBlock(Fragment, {
|
|
4074
|
+
key: 1
|
|
4075
|
+
}, [__props.clearDisabled != true ? (openBlock(), createBlock(_sfc_main$z, {
|
|
4076
|
+
key: 0,
|
|
3581
4077
|
type: "link",
|
|
3582
4078
|
size: "small",
|
|
3583
4079
|
textContent: "清空",
|
|
3584
|
-
onClick: _cache[
|
|
3585
|
-
}),
|
|
3586
|
-
key:
|
|
4080
|
+
onClick: _cache[4] || (_cache[4] = $event => (emits("clear"), unref(inPopup) && __props.closePopup("")))
|
|
4081
|
+
})) : createCommentVNode("", true), __props.nowDisabled != true ? (openBlock(), createBlock(_sfc_main$z, {
|
|
4082
|
+
key: 1,
|
|
3587
4083
|
type: "link",
|
|
3588
4084
|
size: "small",
|
|
3589
4085
|
textContent: "现在",
|
|
3590
4086
|
onClick: onNow
|
|
3591
|
-
})) : createCommentVNode("", true), createVNode(_sfc_main$
|
|
4087
|
+
})) : createCommentVNode("", true)], 64)) : createCommentVNode("", true), createVNode(_sfc_main$z, {
|
|
3592
4088
|
type: "link",
|
|
3593
4089
|
size: "small",
|
|
3594
4090
|
textContent: "确定",
|
|
4091
|
+
class: normalizeClass({
|
|
4092
|
+
"disabled": isValidDateRef.value != true
|
|
4093
|
+
}),
|
|
3595
4094
|
onClick: onConfirm
|
|
3596
|
-
}
|
|
3597
|
-
|
|
3598
|
-
})
|
|
4095
|
+
}, null, 8, ["class"])]),
|
|
4096
|
+
key: "0"
|
|
4097
|
+
} : void 0]), 1032, ["class"]);
|
|
3599
4098
|
};
|
|
3600
4099
|
}
|
|
3601
4100
|
});
|
|
3602
4101
|
|
|
3603
4102
|
function usePicker() {
|
|
3604
4103
|
const popup = usePopup();
|
|
4104
|
+
function showDate(target, options) {
|
|
4105
|
+
options = {
|
|
4106
|
+
...options
|
|
4107
|
+
};
|
|
4108
|
+
return showPicker(target, _sfc_main$1, options);
|
|
4109
|
+
}
|
|
3605
4110
|
function showTime(target, options) {
|
|
3606
4111
|
options = {
|
|
3607
4112
|
...options
|
|
3608
4113
|
};
|
|
3609
|
-
|
|
4114
|
+
return showPicker(target, _sfc_main$2, options);
|
|
4115
|
+
}
|
|
4116
|
+
function showPicker(target, component, options) {
|
|
4117
|
+
let popupOptions = Object.create(null);
|
|
4118
|
+
if (options != void 0) {
|
|
4119
|
+
popupOptions.followX = options.followX;
|
|
4120
|
+
popupOptions.followY = options.followY;
|
|
4121
|
+
popupOptions.spaceX = options.spaceX;
|
|
4122
|
+
popupOptions.spaceY = options.spaceY;
|
|
4123
|
+
popupOptions.spaceClient = options.spaceClien;
|
|
4124
|
+
delete options.followX;
|
|
4125
|
+
delete options.followY;
|
|
4126
|
+
delete options.spaceX;
|
|
4127
|
+
delete options.spaceY;
|
|
4128
|
+
delete options.spaceClient;
|
|
4129
|
+
}
|
|
3610
4130
|
return popup.follow(target, {
|
|
3611
|
-
component
|
|
3612
|
-
followX:
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
4131
|
+
component,
|
|
4132
|
+
followX: popupOptions.followX || "center",
|
|
4133
|
+
followY: popupOptions.followY,
|
|
4134
|
+
spaceX: correctNumber(popupOptions.spaceX, 2),
|
|
4135
|
+
spaceY: correctNumber(popupOptions.spaceY, 2),
|
|
4136
|
+
spaceClient: correctNumber(popupOptions.spaceClient, 10),
|
|
3616
4137
|
closeOnMask: true,
|
|
3617
|
-
props:
|
|
4138
|
+
props: {
|
|
4139
|
+
...options,
|
|
4140
|
+
picker: manager,
|
|
4141
|
+
popup
|
|
4142
|
+
}
|
|
3618
4143
|
});
|
|
3619
4144
|
}
|
|
3620
|
-
{
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
}
|
|
4145
|
+
const manager = Object.freeze(mountScope({
|
|
4146
|
+
showDate,
|
|
4147
|
+
showTime
|
|
4148
|
+
}, "IPickerManager"));
|
|
4149
|
+
manager.onDestroy(popup.destroy);
|
|
4150
|
+
return manager;
|
|
3627
4151
|
}
|
|
3628
4152
|
|
|
3629
4153
|
const _hoisted_1 = ["textContent"];
|
|
@@ -3711,12 +4235,12 @@ var _sfc_main = defineComponent({
|
|
|
3711
4235
|
onTouchstart: onStartDrag,
|
|
3712
4236
|
onTouchmove: onDragMove,
|
|
3713
4237
|
onTouchend: onDragEnd
|
|
3714
|
-
}, [dragInfoRef.value.status == "success" ? (openBlock(), createBlock(_sfc_main$
|
|
4238
|
+
}, [dragInfoRef.value.status == "success" ? (openBlock(), createBlock(_sfc_main$y, {
|
|
3715
4239
|
key: 0,
|
|
3716
4240
|
type: "success",
|
|
3717
4241
|
size: 20,
|
|
3718
4242
|
color: "white"
|
|
3719
|
-
})) : (openBlock(), createBlock(_sfc_main$
|
|
4243
|
+
})) : (openBlock(), createBlock(_sfc_main$y, {
|
|
3720
4244
|
key: 1,
|
|
3721
4245
|
type: "custom",
|
|
3722
4246
|
size: 20,
|
|
@@ -3728,32 +4252,32 @@ var _sfc_main = defineComponent({
|
|
|
3728
4252
|
});
|
|
3729
4253
|
|
|
3730
4254
|
const components = {
|
|
3731
|
-
Button: _sfc_main$
|
|
3732
|
-
Choose: _sfc_main$
|
|
3733
|
-
DatePicker: _sfc_main$
|
|
3734
|
-
Footer: _sfc_main$
|
|
3735
|
-
Header: _sfc_main$
|
|
3736
|
-
Icon: _sfc_main$
|
|
3737
|
-
Input: _sfc_main$
|
|
3738
|
-
Number: _sfc_main$
|
|
3739
|
-
Search: _sfc_main$
|
|
3740
|
-
Select: _sfc_main$
|
|
3741
|
-
Switch: _sfc_main$
|
|
3742
|
-
Textarea: _sfc_main$
|
|
3743
|
-
Dynamic: _sfc_main$
|
|
3744
|
-
Fold: _sfc_main$
|
|
3745
|
-
Layout: _sfc_main$
|
|
3746
|
-
Scroll: _sfc_main$
|
|
3747
|
-
Sort: _sfc_main$
|
|
3748
|
-
Table: _sfc_main$
|
|
3749
|
-
TableRow: _sfc_main$
|
|
3750
|
-
TableCol: _sfc_main$
|
|
3751
|
-
Transitions: _sfc_main$
|
|
3752
|
-
Tree: _sfc_main$
|
|
3753
|
-
Wrapper: _sfc_main$
|
|
4255
|
+
Button: _sfc_main$z,
|
|
4256
|
+
Choose: _sfc_main$x,
|
|
4257
|
+
DatePicker: _sfc_main$w,
|
|
4258
|
+
Footer: _sfc_main$v,
|
|
4259
|
+
Header: _sfc_main$u,
|
|
4260
|
+
Icon: _sfc_main$y,
|
|
4261
|
+
Input: _sfc_main$t,
|
|
4262
|
+
Number: _sfc_main$s,
|
|
4263
|
+
Search: _sfc_main$r,
|
|
4264
|
+
Select: _sfc_main$g,
|
|
4265
|
+
Switch: _sfc_main$f,
|
|
4266
|
+
Textarea: _sfc_main$e,
|
|
4267
|
+
Dynamic: _sfc_main$o,
|
|
4268
|
+
Fold: _sfc_main$d,
|
|
4269
|
+
Layout: _sfc_main$b,
|
|
4270
|
+
Scroll: _sfc_main$c,
|
|
4271
|
+
Sort: _sfc_main$a,
|
|
4272
|
+
Table: _sfc_main$9,
|
|
4273
|
+
TableRow: _sfc_main$8,
|
|
4274
|
+
TableCol: _sfc_main$7,
|
|
4275
|
+
Transitions: _sfc_main$6,
|
|
4276
|
+
Tree: _sfc_main$4,
|
|
4277
|
+
Wrapper: _sfc_main$3,
|
|
3754
4278
|
DragVerify: _sfc_main,
|
|
3755
|
-
Empty: _sfc_main$
|
|
3756
|
-
Loading: _sfc_main$
|
|
4279
|
+
Empty: _sfc_main$j,
|
|
4280
|
+
Loading: _sfc_main$p
|
|
3757
4281
|
};
|
|
3758
4282
|
|
|
3759
4283
|
onMountScope(scope => {
|