@solar-taro/ui-vant 1.3.1 → 1.3.3
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/CHANGELOG.md +14 -0
- package/cascader/index.scss +7 -2
- package/cascader/index.vue.d.ts +102 -0
- package/cascader-picker/index.vue.d.ts +6 -6
- package/date-range-picker/index.vue.d.ts +3 -3
- package/index.d.ts +1 -0
- package/index.js +24 -22
- package/index10.js +50 -243
- package/index100.js +17 -5
- package/index101.js +10 -4
- package/index102.js +5 -4
- package/index103.js +4 -5
- package/index104.js +4 -6
- package/index105.js +6 -10
- package/index106.js +6 -6
- package/index107.js +10 -18
- package/index108.js +6 -4
- package/index109.js +793 -4
- package/index11.js +247 -38
- package/index110.js +6 -3
- package/index111.js +16 -2
- package/index112.js +4 -14
- package/index113.js +5 -8
- package/index114.js +3 -5
- package/index115.js +2 -4
- package/index116.js +14 -5
- package/index117.js +8 -6
- package/index118.js +5 -5
- package/index119.js +6 -3
- package/index12.js +44 -17
- package/index120.js +5 -17
- package/index121.js +5 -5
- package/index122.js +5 -3
- package/index123.js +3 -10
- package/index124.js +17 -5
- package/index125.js +5 -4
- package/index126.js +31 -5
- package/index128.js +4 -3
- package/index129.js +9 -4
- package/index13.js +15 -25
- package/index130.js +5 -4
- package/index131.js +4 -10
- package/index132.js +5 -6
- package/index133.js +3 -7
- package/index134.js +3 -3
- package/index135.js +4 -7
- package/index136.js +11 -3
- package/index137.js +9 -0
- package/index138.js +9 -0
- package/index139.js +7 -0
- package/index14.js +28 -4
- package/index140.js +10 -0
- package/index141.js +5 -0
- package/index15.js +5 -64
- package/index16.js +64 -2
- package/index17.js +1 -1
- package/index18.js +1 -1
- package/index19.js +1 -1
- package/index2.js +1 -1
- package/index20.js +1 -1
- package/index21.js +1 -1
- package/index22.js +1 -1
- package/index23.js +1 -1
- package/index24.js +1 -1
- package/index25.js +3 -9
- package/index26.js +2 -9
- package/index27.js +2 -6
- package/index28.js +5 -3
- package/index29.js +9 -6
- package/index3.js +165 -118
- package/index30.js +8 -62
- package/index31.js +13 -3
- package/index32.js +63 -8
- package/index33.js +3 -6
- package/index34.js +8 -4
- package/index35.js +7 -2
- package/index36.js +2 -4
- package/index37.js +2 -10
- package/index38.js +5 -4
- package/index39.js +10 -4
- package/index4.js +113 -157
- package/index40.js +4 -2
- package/index41.js +4 -4
- package/index42.js +3 -8
- package/index43.js +3 -4
- package/index44.js +7 -4
- package/index45.js +4 -6
- package/index46.js +5 -6
- package/index47.js +7 -9
- package/index48.js +6 -5
- package/index49.js +9 -7
- package/index5.js +166 -27
- package/index50.js +5 -5
- package/index51.js +6 -9
- package/index52.js +4 -6
- package/index53.js +9 -17
- package/index54.js +4 -9
- package/index55.js +17 -6
- package/index56.js +9 -10
- package/index57.js +6 -3
- package/index58.js +12 -7
- package/index59.js +3 -9
- package/index6.js +29 -95
- package/index60.js +2 -2
- package/index61.js +7 -5
- package/index62.js +9 -5
- package/index63.js +6 -9
- package/index64.js +5 -15
- package/index65.js +9 -6
- package/index66.js +15 -5
- package/index67.js +5 -8
- package/index68.js +5 -6
- package/index69.js +8 -5
- package/index7.js +93 -39
- package/index70.js +6 -5
- package/index71.js +4 -5
- package/index72.js +5 -6
- package/index73.js +7 -26
- package/index74.js +6 -5
- package/index75.js +26 -40
- package/index76.js +3 -4
- package/index77.js +39 -5
- package/index78.js +7 -15
- package/index79.js +5 -7
- package/index8.js +40 -263
- package/index80.js +15 -2
- package/index81.js +8 -3
- package/index82.js +2 -4
- package/index83.js +3 -4
- package/index84.js +13 -4
- package/index85.js +5 -4
- package/index86.js +3 -4
- package/index87.js +3 -14
- package/index88.js +4 -3
- package/index89.js +4 -13
- package/index9.js +262 -54
- package/index90.js +4 -5
- package/index91.js +4 -14
- package/index92.js +14 -8
- package/index93.js +14 -3
- package/index94.js +8 -5
- package/index95.js +3 -6
- package/index96.js +5 -5
- package/index97.js +5 -7
- package/index98.js +5 -17
- package/index99.js +7 -10
- package/opper-controller/index.scss +12 -0
- package/package.json +1 -1
- package/select-picker/index.vue.d.ts +4 -4
- package/selector/index.vue.d.ts +10 -10
package/index4.js
CHANGED
|
@@ -1,175 +1,131 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "sun-date-range-picker-input-value"
|
|
7
|
-
}, re = {
|
|
8
|
-
key: 1,
|
|
9
|
-
class: "sun-date-range-picker-input-placeholder"
|
|
10
|
-
}, oe = { class: "sun-date-range-picker-input-label" }, ie = {
|
|
11
|
-
key: 0,
|
|
12
|
-
name: "down",
|
|
13
|
-
color: "var(--color-gray)"
|
|
14
|
-
}, ue = {
|
|
15
|
-
key: 0,
|
|
16
|
-
class: "date-range-picker-input-value"
|
|
17
|
-
}, se = {
|
|
18
|
-
key: 1,
|
|
19
|
-
class: "sun-date-range-picker-input-placeholder"
|
|
20
|
-
}, de = { class: "sun-date-range-picker-input-label" }, ce = ["id", "type", "value", "min-date", "max-date"], ve = { class: "sun-date-range-picker-btn-wrapper" };
|
|
21
|
-
let pe = 1;
|
|
22
|
-
const ge = /* @__PURE__ */ P({
|
|
1
|
+
import { defineComponent as E, ref as N, computed as r, mergeProps as I, createElementVNode as L, openBlock as P, createElementBlock as $, createCommentVNode as q } from "vue";
|
|
2
|
+
import y from "./index28.js";
|
|
3
|
+
const D = I, A = L, v = P, h = $, T = q, j = ["show"], z = ["title", "value-key", "columns", "loading"], H = /* @__PURE__ */ E({
|
|
4
|
+
inheritAttrs: !1,
|
|
23
5
|
__name: "index",
|
|
24
6
|
props: {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
7
|
+
show: { type: Boolean },
|
|
8
|
+
labelKey: { default: "fullName" },
|
|
9
|
+
valueKey: { default: "id" },
|
|
10
|
+
pidKey: { default: "pid" },
|
|
11
|
+
searchable: { type: Boolean, default: !0 },
|
|
28
12
|
title: {},
|
|
29
|
-
|
|
13
|
+
loading: { type: Boolean },
|
|
14
|
+
options: { default: () => [] },
|
|
30
15
|
modelValue: {},
|
|
31
|
-
required: { type: Boolean }
|
|
32
|
-
format: {},
|
|
33
|
-
minDate: { default: () => new Date((/* @__PURE__ */ new Date()).getFullYear() - 5, 0, 0, 0, 0, 0).getTime() },
|
|
34
|
-
maxDate: { default: () => new Date((/* @__PURE__ */ new Date()).getFullYear() + 5, 0, 0, 0, 0, 0).getTime() }
|
|
16
|
+
required: { type: Boolean }
|
|
35
17
|
},
|
|
36
|
-
emits: ["
|
|
37
|
-
setup(
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
if (a.format)
|
|
47
|
-
return a.format;
|
|
48
|
-
switch (a.type) {
|
|
49
|
-
case "date":
|
|
50
|
-
return "yyyy-MM-dd";
|
|
51
|
-
case "datetime":
|
|
52
|
-
return "yyyy-MM-dd HH:mm";
|
|
53
|
-
}
|
|
54
|
-
}), q = u(() => {
|
|
55
|
-
if (a.title)
|
|
56
|
-
return a.title;
|
|
57
|
-
switch (a.type) {
|
|
58
|
-
case "date":
|
|
59
|
-
return "请选择日期";
|
|
60
|
-
case "datetime":
|
|
61
|
-
return "请选择时间";
|
|
62
|
-
}
|
|
63
|
-
}), y = u(() => {
|
|
64
|
-
if (a.placeholder)
|
|
65
|
-
return a.placeholder;
|
|
66
|
-
switch (a.type) {
|
|
67
|
-
case "date":
|
|
68
|
-
return ["开始日期", "结束日期"];
|
|
69
|
-
case "datetime":
|
|
70
|
-
return ["开始时间", "结束时间"];
|
|
18
|
+
emits: ["close", "cancel", "confirm", "update:show", "update:modelValue"],
|
|
19
|
+
setup(K, { emit: g }) {
|
|
20
|
+
const u = g, n = K, a = N(""), d = r(() => {
|
|
21
|
+
const e = y(n.options);
|
|
22
|
+
for (let t = 0; t < e.length - 1; t++) {
|
|
23
|
+
const o = e[t];
|
|
24
|
+
for (let l = 0; l < o.length; l++) {
|
|
25
|
+
const i = o[l];
|
|
26
|
+
i.children = e[t + 1].filter((s) => s[n.pidKey] === i[n.valueKey]);
|
|
27
|
+
}
|
|
71
28
|
}
|
|
29
|
+
return e[0];
|
|
30
|
+
}), p = r(() => y(d.value).map((e) => c(e)).flat()), C = r(() => {
|
|
31
|
+
const e = n.options[n.options.length - 1].find((t) => t[n.valueKey] === n.modelValue);
|
|
32
|
+
return e ? x(e) : m();
|
|
72
33
|
});
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
case "datetime":
|
|
79
|
-
return t.setMinutes(e - e % 5);
|
|
80
|
-
}
|
|
34
|
+
function w() {
|
|
35
|
+
n.required || u("update:modelValue", null), u("cancel", n.modelValue), f();
|
|
36
|
+
}
|
|
37
|
+
function f() {
|
|
38
|
+
u("update:show", !1), u("close");
|
|
81
39
|
}
|
|
82
|
-
function
|
|
83
|
-
|
|
40
|
+
function V({ detail: e }) {
|
|
41
|
+
const t = e.value[e.value.length - 1];
|
|
42
|
+
u("update:modelValue", t[n.valueKey]), u("confirm", B(t)), u("update:show", !1);
|
|
84
43
|
}
|
|
85
|
-
function
|
|
86
|
-
|
|
44
|
+
function k({ detail: e }) {
|
|
45
|
+
const { picker: t, value: o, index: l } = e;
|
|
46
|
+
!a.value && l < n.options.length - 1 && t.setColumnValues(
|
|
47
|
+
l + 1,
|
|
48
|
+
n.options[l + 1].filter((i) => i[n.pidKey] === o[l][n.valueKey])
|
|
49
|
+
);
|
|
87
50
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
51
|
+
function b({ detail: e }) {
|
|
52
|
+
a.value = e.trim().toLowerCase(), m();
|
|
90
53
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
54
|
+
function B(e) {
|
|
55
|
+
const t = [n.options[n.options.length - 1].find((o) => o[n.valueKey] === e[n.valueKey] && o[n.pidKey] === e[n.pidKey])];
|
|
56
|
+
for (let o = n.options.length - 2; o >= 0; o--)
|
|
57
|
+
t.unshift(
|
|
58
|
+
n.options[o].find((l) => {
|
|
59
|
+
var i;
|
|
60
|
+
return l[n.valueKey] === ((i = t[0]) == null ? void 0 : i[n.pidKey]);
|
|
61
|
+
})
|
|
62
|
+
);
|
|
63
|
+
return t;
|
|
93
64
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
65
|
+
function c(e, t = "") {
|
|
66
|
+
var i;
|
|
67
|
+
let o = [], l = t + e[n.labelKey];
|
|
68
|
+
return (i = e.children) != null && i.length ? e.children.forEach((s) => {
|
|
69
|
+
o = o.concat(c(s, l + " / "));
|
|
70
|
+
}) : (e[n.labelKey] = l, o.push(e)), o;
|
|
96
71
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
99
|
-
if (
|
|
100
|
-
return
|
|
101
|
-
|
|
72
|
+
function m() {
|
|
73
|
+
var o;
|
|
74
|
+
if (a.value)
|
|
75
|
+
return [{
|
|
76
|
+
values: p.value.filter((l) => l[n.labelKey].toLowerCase().includes(a.value))
|
|
77
|
+
}];
|
|
78
|
+
const e = [];
|
|
79
|
+
let t = d.value;
|
|
80
|
+
for (; t; )
|
|
81
|
+
e.push({ values: t }), t = (o = t[0]) == null ? void 0 : o.children;
|
|
82
|
+
return e;
|
|
83
|
+
}
|
|
84
|
+
function x(e) {
|
|
85
|
+
if (a.value) {
|
|
86
|
+
const o = p.value.filter((l) => l[n.labelKey].toLowerCase().includes(a.value));
|
|
87
|
+
return [{
|
|
88
|
+
values: o,
|
|
89
|
+
defaultIndex: o.findIndex((l) => l[n.valueKey] === e[n.valueKey])
|
|
90
|
+
}];
|
|
91
|
+
}
|
|
92
|
+
const t = [];
|
|
93
|
+
for (let o = n.options.length - 1; o >= 0; o--) {
|
|
94
|
+
const l = n.options[o].filter((i) => i[n.pidKey] === e[n.pidKey]);
|
|
95
|
+
t[o] = {
|
|
96
|
+
values: l,
|
|
97
|
+
defaultIndex: l.findIndex((i) => i[n.valueKey] === e[n.valueKey])
|
|
98
|
+
}, o > 0 && (e = n.options[o - 1].find((i) => i[n.valueKey] === e[n.pidKey]));
|
|
99
|
+
}
|
|
100
|
+
return t;
|
|
102
101
|
}
|
|
103
|
-
return (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
"close-on-click-overlay": !0,
|
|
129
|
-
onClose: e[6] || (e[6] = (r) => g()),
|
|
130
|
-
onCancel: e[7] || (e[7] = (r) => g())
|
|
131
|
-
}, [
|
|
132
|
-
l("view", ne, [
|
|
133
|
-
l("view", {
|
|
134
|
-
class: V(["sun-date-range-picker-input", { "sun-date-range-picker-input-active": d.value === 0 }]),
|
|
135
|
-
onTap: e[2] || (e[2] = (r) => p(0))
|
|
136
|
-
}, [
|
|
137
|
-
n.value.ref.value[0] ? (o(), i("view", le, c(w(m)(n.value.ref.value[0], v.value)), 1)) : (o(), i("view", re, "请选择")),
|
|
138
|
-
l("view", oe, c(y.value[0]), 1)
|
|
139
|
-
], 34),
|
|
140
|
-
(o(), i("van-icon", ie)),
|
|
141
|
-
l("view", {
|
|
142
|
-
class: V(["sun-date-range-picker-input", { "sun-date-range-picker-input-active": d.value === 1 }]),
|
|
143
|
-
onTap: e[3] || (e[3] = (r) => p(1))
|
|
144
|
-
}, [
|
|
145
|
-
n.value.ref.value[1] ? (o(), i("view", ue, c(w(m)(n.value.ref.value[1], v.value)), 1)) : (o(), i("view", se, "请选择")),
|
|
146
|
-
l("view", de, c(y.value[1]), 1)
|
|
147
|
-
], 34)
|
|
148
|
-
]),
|
|
149
|
-
D(l("van-datetime-picker", {
|
|
150
|
-
id: t.id,
|
|
151
|
-
type: t.type,
|
|
152
|
-
"show-toolbar": !1,
|
|
153
|
-
value: $.value,
|
|
154
|
-
"min-date": t.minDate,
|
|
155
|
-
"max-date": t.maxDate,
|
|
156
|
-
onInput: e[4] || (e[4] = (r) => E(r.detail))
|
|
157
|
-
}, null, 40, ce), [
|
|
158
|
-
[w(Q)]
|
|
159
|
-
]),
|
|
160
|
-
l("view", ve, [
|
|
161
|
-
l("van-button", {
|
|
162
|
-
type: "primary",
|
|
163
|
-
round: "true",
|
|
164
|
-
block: "true",
|
|
165
|
-
onTap: e[5] || (e[5] = (r) => I())
|
|
166
|
-
}, c(n.value.ref.value[0] && n.value.ref.value[1] ? "确定" : "继续"), 33)
|
|
167
|
-
])
|
|
168
|
-
], 40, ae)
|
|
169
|
-
], 64);
|
|
170
|
-
};
|
|
102
|
+
return (e, t) => (v(), h("van-popup", {
|
|
103
|
+
show: e.show,
|
|
104
|
+
position: "bottom",
|
|
105
|
+
round: !0,
|
|
106
|
+
"close-on-click-overlay": !0,
|
|
107
|
+
onClose: t[4] || (t[4] = (o) => f())
|
|
108
|
+
}, [
|
|
109
|
+
A("van-picker", D(e.$attrs, {
|
|
110
|
+
title: e.title,
|
|
111
|
+
"show-toolbar": !0,
|
|
112
|
+
"value-key": e.labelKey,
|
|
113
|
+
columns: C.value,
|
|
114
|
+
loading: e.loading,
|
|
115
|
+
onCancel: t[0] || (t[0] = (o) => w()),
|
|
116
|
+
onConfirm: t[1] || (t[1] = (o) => V(o)),
|
|
117
|
+
onChange: t[2] || (t[2] = (o) => k(o))
|
|
118
|
+
}), null, 16, z),
|
|
119
|
+
e.searchable && e.options.length ? (v(), h("van-search", {
|
|
120
|
+
key: 0,
|
|
121
|
+
shape: "round",
|
|
122
|
+
"input-align": "center",
|
|
123
|
+
placeholder: "请输入搜索关键词",
|
|
124
|
+
onChange: t[3] || (t[3] = (o) => b(o))
|
|
125
|
+
}, null, 32)) : T("", !0)
|
|
126
|
+
], 40, j));
|
|
171
127
|
}
|
|
172
128
|
});
|
|
173
129
|
export {
|
|
174
|
-
|
|
130
|
+
H as default
|
|
175
131
|
};
|
package/index40.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var n = 9007199254740991;
|
|
2
|
+
function r(t) {
|
|
3
|
+
return typeof t == "number" && t > -1 && t % 1 == 0 && t <= n;
|
|
4
|
+
}
|
|
3
5
|
export {
|
|
4
6
|
r as default
|
|
5
7
|
};
|
package/index41.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import f from "./index42.js";
|
|
2
|
+
import t from "./index43.js";
|
|
3
|
+
var r = typeof exports == "object" && exports && !exports.nodeType && exports, e = r && typeof module == "object" && module && !module.nodeType && module, u = e && e.exports === r, o = u ? f.Buffer : void 0, p = o ? o.isBuffer : void 0, a = p || t;
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
a as default
|
|
6
6
|
};
|
package/index42.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import o from "./index90.js";
|
|
4
|
-
var i = "[object Null]", f = "[object Undefined]", r = t ? t.toStringTag : void 0;
|
|
5
|
-
function m(n) {
|
|
6
|
-
return n == null ? n === void 0 ? f : i : r && r in Object(n) ? e(n) : o(n);
|
|
7
|
-
}
|
|
1
|
+
import e from "./index82.js";
|
|
2
|
+
var t = typeof self == "object" && self && self.Object === Object && self, r = e || t || Function("return this")();
|
|
8
3
|
export {
|
|
9
|
-
|
|
4
|
+
r as default
|
|
10
5
|
};
|
package/index43.js
CHANGED
package/index44.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
var
|
|
1
|
+
import t from "./index83.js";
|
|
2
|
+
import e from "./index84.js";
|
|
3
|
+
import o from "./index85.js";
|
|
4
|
+
var i = "[object Null]", f = "[object Undefined]", r = t ? t.toStringTag : void 0;
|
|
5
|
+
function m(n) {
|
|
6
|
+
return n == null ? n === void 0 ? f : i : r && r in Object(n) ? e(n) : o(n);
|
|
7
|
+
}
|
|
5
8
|
export {
|
|
6
9
|
m as default
|
|
7
10
|
};
|
package/index45.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function i(t) {
|
|
5
|
-
return r(t) && a(t) == e;
|
|
1
|
+
function n(t) {
|
|
2
|
+
var e = typeof t;
|
|
3
|
+
return t != null && (e == "object" || e == "function");
|
|
6
4
|
}
|
|
7
5
|
export {
|
|
8
|
-
|
|
6
|
+
n as default
|
|
9
7
|
};
|
package/index46.js
CHANGED
package/index47.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
}();
|
|
1
|
+
import a from "./index75.js";
|
|
2
|
+
import r from "./index36.js";
|
|
3
|
+
var e = "[object Map]";
|
|
4
|
+
function i(t) {
|
|
5
|
+
return r(t) && a(t) == e;
|
|
6
|
+
}
|
|
9
7
|
export {
|
|
10
|
-
|
|
8
|
+
i as default
|
|
11
9
|
};
|
package/index48.js
CHANGED
package/index49.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
1
|
+
import p from "./index82.js";
|
|
2
|
+
var t = typeof exports == "object" && exports && !exports.nodeType && exports, e = t && typeof module == "object" && module && !module.nodeType && module, u = e && e.exports === t, r = u && p.process, l = function() {
|
|
3
|
+
try {
|
|
4
|
+
var o = e && e.require && e.require("util").types;
|
|
5
|
+
return o || r && r.binding && r.binding("util");
|
|
6
|
+
} catch {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
7
9
|
export {
|
|
8
|
-
|
|
10
|
+
l as default
|
|
9
11
|
};
|
package/index5.js
CHANGED
|
@@ -1,36 +1,175 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
|
|
1
|
+
import { defineComponent as P, computed as u, ref as k, renderSlot as S, openBlock as H, createElementBlock as z, createCommentVNode as Y, createElementVNode as j, mergeProps as x, resolveDirective as A, withDirectives as G, unref as J, toDisplayString as K, normalizeClass as L, Fragment as O } from "vue";
|
|
2
|
+
import { date as m } from "@solar-taro/core";
|
|
3
|
+
import { vDatetimePicker as Q } from "./index14.js";
|
|
4
|
+
const R = S, o = H, i = z, U = Y, l = j, W = x, X = A, D = G, w = J, c = K, V = L, Z = O, ee = ["label", "value", "placeholder", "required"], te = { name: "right-icon" }, ae = ["show", "title"], ne = { class: "sun-date-range-picker-input-group" }, le = {
|
|
3
5
|
key: 0,
|
|
4
|
-
class: "sun-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
class: "sun-date-range-picker-input-value"
|
|
7
|
+
}, re = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "sun-date-range-picker-input-placeholder"
|
|
10
|
+
}, oe = { class: "sun-date-range-picker-input-label" }, ie = {
|
|
11
|
+
key: 0,
|
|
12
|
+
name: "down",
|
|
13
|
+
color: "var(--color-gray)"
|
|
14
|
+
}, ue = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "date-range-picker-input-value"
|
|
17
|
+
}, se = {
|
|
18
|
+
key: 1,
|
|
19
|
+
class: "sun-date-range-picker-input-placeholder"
|
|
20
|
+
}, de = { class: "sun-date-range-picker-input-label" }, ce = ["id", "type", "value", "min-date", "max-date"], ve = { class: "sun-date-range-picker-btn-wrapper" };
|
|
21
|
+
let pe = 1;
|
|
22
|
+
const ge = /* @__PURE__ */ P({
|
|
8
23
|
__name: "index",
|
|
9
24
|
props: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
25
|
+
id: { default: () => `van-datetime-picker-${pe++}` },
|
|
26
|
+
type: { default: "date" },
|
|
27
|
+
label: {},
|
|
28
|
+
title: {},
|
|
29
|
+
placeholder: {},
|
|
30
|
+
modelValue: {},
|
|
31
|
+
required: { type: Boolean },
|
|
32
|
+
format: {},
|
|
33
|
+
minDate: { default: () => new Date((/* @__PURE__ */ new Date()).getFullYear() - 5, 0, 0, 0, 0, 0).getTime() },
|
|
34
|
+
maxDate: { default: () => new Date((/* @__PURE__ */ new Date()).getFullYear() + 5, 0, 0, 0, 0, 0).getTime() }
|
|
13
35
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}))
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
36
|
+
emits: ["update:modelValue", "confirm", "clear", "close"],
|
|
37
|
+
setup(b, { emit: C }) {
|
|
38
|
+
const a = b, s = C, _ = " ~ ", n = u(() => ({
|
|
39
|
+
ref: k([...a.modelValue])
|
|
40
|
+
})), $ = u(
|
|
41
|
+
() => n.value.ref.value[d.value] || B()
|
|
42
|
+
), f = k(!1), d = k(0), M = u(() => {
|
|
43
|
+
const [t, e] = a.modelValue;
|
|
44
|
+
return t && e ? m(t, v.value) + _ + m(e, v.value) : "";
|
|
45
|
+
}), T = u(() => a.modelValue.length && !a.required), v = u(() => {
|
|
46
|
+
if (a.format)
|
|
47
|
+
return a.format;
|
|
48
|
+
switch (a.type) {
|
|
49
|
+
case "date":
|
|
50
|
+
return "yyyy-MM-dd";
|
|
51
|
+
case "datetime":
|
|
52
|
+
return "yyyy-MM-dd HH:mm";
|
|
53
|
+
}
|
|
54
|
+
}), q = u(() => {
|
|
55
|
+
if (a.title)
|
|
56
|
+
return a.title;
|
|
57
|
+
switch (a.type) {
|
|
58
|
+
case "date":
|
|
59
|
+
return "请选择日期";
|
|
60
|
+
case "datetime":
|
|
61
|
+
return "请选择时间";
|
|
62
|
+
}
|
|
63
|
+
}), y = u(() => {
|
|
64
|
+
if (a.placeholder)
|
|
65
|
+
return a.placeholder;
|
|
66
|
+
switch (a.type) {
|
|
67
|
+
case "date":
|
|
68
|
+
return ["开始日期", "结束日期"];
|
|
69
|
+
case "datetime":
|
|
70
|
+
return ["开始时间", "结束时间"];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
function B() {
|
|
74
|
+
const t = /* @__PURE__ */ new Date(), e = t.getMinutes();
|
|
75
|
+
switch (a.type) {
|
|
76
|
+
case "date":
|
|
77
|
+
return t.setHours(0, 0, 0, 0);
|
|
78
|
+
case "datetime":
|
|
79
|
+
return t.setMinutes(e - e % 5);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function h() {
|
|
83
|
+
f.value = !0, p(0);
|
|
84
|
+
}
|
|
85
|
+
function g() {
|
|
86
|
+
f.value = !1, s("close");
|
|
87
|
+
}
|
|
88
|
+
function F() {
|
|
89
|
+
n.value.ref.value = [], s("clear", a.modelValue), s("update:modelValue", []);
|
|
90
|
+
}
|
|
91
|
+
function p(t) {
|
|
92
|
+
d.value = t;
|
|
93
|
+
}
|
|
94
|
+
function E(t) {
|
|
95
|
+
n.value.ref.value[d.value] = t;
|
|
96
|
+
}
|
|
97
|
+
function I() {
|
|
98
|
+
const [t, e] = n.value.ref.value;
|
|
99
|
+
if (!t || !e)
|
|
100
|
+
return p(t ? 1 : 0);
|
|
101
|
+
s("update:modelValue", [...n.value.ref.value]), s("confirm", n.value.ref.value), g();
|
|
102
|
+
}
|
|
103
|
+
return (t, e) => {
|
|
104
|
+
const N = X("readonly");
|
|
105
|
+
return o(), i(Z, null, [
|
|
106
|
+
R(t.$slots, "default", { present: h }, () => [
|
|
107
|
+
D((o(), i("van-field", W(t.$attrs, {
|
|
108
|
+
label: t.label,
|
|
109
|
+
value: M.value,
|
|
110
|
+
placeholder: y.value.join(_),
|
|
111
|
+
required: t.required,
|
|
112
|
+
onClickInput: e[1] || (e[1] = (r) => h())
|
|
113
|
+
}), [
|
|
114
|
+
l("slot-view", te, [
|
|
115
|
+
T.value ? (o(), i("van-icon", {
|
|
116
|
+
key: 0,
|
|
117
|
+
name: "clear",
|
|
118
|
+
onTap: e[0] || (e[0] = (r) => F())
|
|
119
|
+
}, null, 32)) : U("", !0)
|
|
120
|
+
])
|
|
121
|
+
], 16, ee)), [
|
|
122
|
+
[N]
|
|
123
|
+
])
|
|
27
124
|
]),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
125
|
+
l("van-action-sheet", {
|
|
126
|
+
show: f.value,
|
|
127
|
+
title: q.value,
|
|
128
|
+
"close-on-click-overlay": !0,
|
|
129
|
+
onClose: e[6] || (e[6] = (r) => g()),
|
|
130
|
+
onCancel: e[7] || (e[7] = (r) => g())
|
|
131
|
+
}, [
|
|
132
|
+
l("view", ne, [
|
|
133
|
+
l("view", {
|
|
134
|
+
class: V(["sun-date-range-picker-input", { "sun-date-range-picker-input-active": d.value === 0 }]),
|
|
135
|
+
onTap: e[2] || (e[2] = (r) => p(0))
|
|
136
|
+
}, [
|
|
137
|
+
n.value.ref.value[0] ? (o(), i("view", le, c(w(m)(n.value.ref.value[0], v.value)), 1)) : (o(), i("view", re, "请选择")),
|
|
138
|
+
l("view", oe, c(y.value[0]), 1)
|
|
139
|
+
], 34),
|
|
140
|
+
(o(), i("van-icon", ie)),
|
|
141
|
+
l("view", {
|
|
142
|
+
class: V(["sun-date-range-picker-input", { "sun-date-range-picker-input-active": d.value === 1 }]),
|
|
143
|
+
onTap: e[3] || (e[3] = (r) => p(1))
|
|
144
|
+
}, [
|
|
145
|
+
n.value.ref.value[1] ? (o(), i("view", ue, c(w(m)(n.value.ref.value[1], v.value)), 1)) : (o(), i("view", se, "请选择")),
|
|
146
|
+
l("view", de, c(y.value[1]), 1)
|
|
147
|
+
], 34)
|
|
148
|
+
]),
|
|
149
|
+
D(l("van-datetime-picker", {
|
|
150
|
+
id: t.id,
|
|
151
|
+
type: t.type,
|
|
152
|
+
"show-toolbar": !1,
|
|
153
|
+
value: $.value,
|
|
154
|
+
"min-date": t.minDate,
|
|
155
|
+
"max-date": t.maxDate,
|
|
156
|
+
onInput: e[4] || (e[4] = (r) => E(r.detail))
|
|
157
|
+
}, null, 40, ce), [
|
|
158
|
+
[w(Q)]
|
|
159
|
+
]),
|
|
160
|
+
l("view", ve, [
|
|
161
|
+
l("van-button", {
|
|
162
|
+
type: "primary",
|
|
163
|
+
round: "true",
|
|
164
|
+
block: "true",
|
|
165
|
+
onTap: e[5] || (e[5] = (r) => I())
|
|
166
|
+
}, c(n.value.ref.value[0] && n.value.ref.value[1] ? "确定" : "继续"), 33)
|
|
167
|
+
])
|
|
168
|
+
], 40, ae)
|
|
169
|
+
], 64);
|
|
170
|
+
};
|
|
32
171
|
}
|
|
33
172
|
});
|
|
34
173
|
export {
|
|
35
|
-
|
|
174
|
+
ge as default
|
|
36
175
|
};
|