@solar-taro/ui-vant 3.5.2 → 4.0.0
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 +4 -0
- package/cascader/index.scss +36 -6
- package/cascader/index.vue.d.ts +13 -13
- package/cascader/typings.d.ts +5 -0
- package/cascader-picker/index.vue.d.ts +1 -1
- package/date-range-picker/index.scss +37 -6
- package/date-range-picker/index.vue.d.ts +25 -30
- package/index.js +14 -14
- package/index10.js +61 -16
- package/index11.js +18 -3
- package/index12.js +3 -28
- package/index13.js +28 -4
- package/index14.js +5 -64
- package/index16.js +1 -1
- 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 +7 -36
- package/index23.js +38 -23
- package/index24.js +27 -0
- package/index3.js +202 -119
- package/index4.js +76 -79
- package/index5.js +129 -113
- package/index6.js +36 -32
- package/index7.js +141 -134
- package/index8.js +34 -34
- package/index9.js +325 -292
- package/package.json +1 -1
- package/select-picker/index.vue.d.ts +1 -1
- package/selector/index.scss +33 -5
- package/selector/index.vue.d.ts +20 -26
- package/selector/typings.d.ts +9 -0
package/index4.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { defineComponent as x, ref as B, computed as d, watch as E, openBlock as N, createElementBlock as I, createElementVNode as L, mergeProps as P, createBlock as $, unref as q, createCommentVNode as D } from "vue";
|
|
2
|
+
import { SunSearchbar as S } from "@solar-taro/ui-sun";
|
|
3
|
+
import { cloneDeep as v } from "lodash-es";
|
|
4
|
+
const A = P, T = L, U = q, K = N, j = $, z = D, F = I, G = ["show"], H = ["title", "value-key", "columns", "loading"], Q = /* @__PURE__ */ x({
|
|
4
5
|
inheritAttrs: !1,
|
|
5
6
|
__name: "index",
|
|
6
7
|
props: {
|
|
@@ -16,116 +17,112 @@ const D = I, A = L, v = P, h = $, T = q, j = ["show"], z = ["title", "value-key"
|
|
|
16
17
|
required: { type: Boolean }
|
|
17
18
|
},
|
|
18
19
|
emits: ["close", "cancel", "confirm", "update:show", "update:modelValue"],
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
for (let t = 0; t <
|
|
23
|
-
const
|
|
24
|
-
for (let
|
|
25
|
-
const
|
|
26
|
-
|
|
20
|
+
setup(i, { emit: h }) {
|
|
21
|
+
const s = h, e = i, a = B(""), c = d(() => {
|
|
22
|
+
const n = v(e.options);
|
|
23
|
+
for (let t = 0; t < n.length - 1; t++) {
|
|
24
|
+
const l = n[t];
|
|
25
|
+
for (let o = 0; o < l.length; o++) {
|
|
26
|
+
const u = l[o];
|
|
27
|
+
u.children = n[t + 1].filter((r) => r[e.pidKey] === u[e.valueKey]);
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
|
-
return
|
|
30
|
-
}),
|
|
31
|
-
const
|
|
32
|
-
return
|
|
30
|
+
return n[0];
|
|
31
|
+
}), f = d(() => v(c.value).map((n) => m(n)).flat()), g = d(() => {
|
|
32
|
+
const n = e.options[e.options.length - 1].find((t) => t[e.valueKey] === e.modelValue);
|
|
33
|
+
return n ? b(n) : y();
|
|
33
34
|
});
|
|
34
|
-
function
|
|
35
|
-
|
|
35
|
+
function V() {
|
|
36
|
+
e.required || s("update:modelValue", null), s("cancel", e.modelValue), p();
|
|
36
37
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
38
|
+
function p() {
|
|
39
|
+
s("update:show", !1), s("close");
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
const t =
|
|
42
|
-
|
|
41
|
+
function C({ detail: n }) {
|
|
42
|
+
const t = n.value[n.value.length - 1];
|
|
43
|
+
s("update:modelValue", t[e.valueKey]), s("confirm", w(t)), s("update:show", !1);
|
|
43
44
|
}
|
|
44
|
-
function k({ detail:
|
|
45
|
-
const { picker: t, value:
|
|
46
|
-
!a.value &&
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
function k({ detail: n }) {
|
|
46
|
+
const { picker: t, value: l, index: o } = n;
|
|
47
|
+
!a.value && o < e.options.length - 1 && t.setColumnValues(
|
|
48
|
+
o + 1,
|
|
49
|
+
e.options[o + 1].filter((u) => u[e.pidKey] === l[o][e.valueKey])
|
|
49
50
|
);
|
|
50
51
|
}
|
|
51
|
-
function
|
|
52
|
-
|
|
53
|
-
|
|
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--)
|
|
52
|
+
function w(n) {
|
|
53
|
+
const t = [e.options[e.options.length - 1].find((l) => l[e.valueKey] === n[e.valueKey] && l[e.pidKey] === n[e.pidKey])];
|
|
54
|
+
for (let l = e.options.length - 2; l >= 0; l--)
|
|
57
55
|
t.unshift(
|
|
58
|
-
|
|
59
|
-
var
|
|
60
|
-
return
|
|
56
|
+
e.options[l].find((o) => {
|
|
57
|
+
var u;
|
|
58
|
+
return o[e.valueKey] === ((u = t[0]) == null ? void 0 : u[e.pidKey]);
|
|
61
59
|
})
|
|
62
60
|
);
|
|
63
61
|
return t;
|
|
64
62
|
}
|
|
65
|
-
function
|
|
66
|
-
var
|
|
67
|
-
let
|
|
68
|
-
return (
|
|
69
|
-
|
|
70
|
-
}) : (e
|
|
63
|
+
function m(n, t = "") {
|
|
64
|
+
var u;
|
|
65
|
+
let l = [], o = t + n[e.labelKey];
|
|
66
|
+
return (u = n.children) != null && u.length ? n.children.forEach((r) => {
|
|
67
|
+
l = l.concat(m(r, o + " / "));
|
|
68
|
+
}) : (n[e.labelKey] = o, l.push(n)), l;
|
|
71
69
|
}
|
|
72
|
-
function
|
|
73
|
-
var
|
|
70
|
+
function y() {
|
|
71
|
+
var l;
|
|
74
72
|
if (a.value)
|
|
75
73
|
return [{
|
|
76
|
-
values:
|
|
74
|
+
values: f.value.filter((o) => o[e.labelKey].toLowerCase().includes(a.value))
|
|
77
75
|
}];
|
|
78
|
-
const
|
|
79
|
-
let t =
|
|
76
|
+
const n = [];
|
|
77
|
+
let t = c.value;
|
|
80
78
|
for (; t; )
|
|
81
|
-
|
|
82
|
-
return
|
|
79
|
+
n.push({ values: t }), t = (l = t[0]) == null ? void 0 : l.children;
|
|
80
|
+
return n;
|
|
83
81
|
}
|
|
84
|
-
function
|
|
82
|
+
function b(n) {
|
|
85
83
|
if (a.value) {
|
|
86
|
-
const
|
|
84
|
+
const l = f.value.filter((o) => o[e.labelKey].toLowerCase().includes(a.value));
|
|
87
85
|
return [{
|
|
88
|
-
values:
|
|
89
|
-
defaultIndex:
|
|
86
|
+
values: l,
|
|
87
|
+
defaultIndex: l.findIndex((o) => o[e.valueKey] === n[e.valueKey])
|
|
90
88
|
}];
|
|
91
89
|
}
|
|
92
90
|
const t = [];
|
|
93
|
-
for (let
|
|
94
|
-
const
|
|
95
|
-
t[
|
|
96
|
-
values:
|
|
97
|
-
defaultIndex:
|
|
98
|
-
},
|
|
91
|
+
for (let l = e.options.length - 1; l >= 0; l--) {
|
|
92
|
+
const o = e.options[l].filter((u) => u[e.pidKey] === n[e.pidKey]);
|
|
93
|
+
t[l] = {
|
|
94
|
+
values: o,
|
|
95
|
+
defaultIndex: o.findIndex((u) => u[e.valueKey] === n[e.valueKey])
|
|
96
|
+
}, l > 0 && (n = e.options[l - 1].find((u) => u[e.valueKey] === n[e.pidKey]));
|
|
99
97
|
}
|
|
100
98
|
return t;
|
|
101
99
|
}
|
|
102
|
-
return (
|
|
103
|
-
show:
|
|
100
|
+
return E(a, y), (n, t) => (K(), F("van-popup", {
|
|
101
|
+
show: i.show,
|
|
104
102
|
position: "bottom",
|
|
105
103
|
round: !0,
|
|
106
104
|
"close-on-click-overlay": !0,
|
|
107
|
-
onClose: t[4] || (t[4] = (
|
|
105
|
+
onClose: t[4] || (t[4] = (l) => p())
|
|
108
106
|
}, [
|
|
109
|
-
|
|
110
|
-
title:
|
|
107
|
+
T("van-picker", A(n.$attrs, {
|
|
108
|
+
title: i.title,
|
|
111
109
|
"show-toolbar": !0,
|
|
112
|
-
"value-key":
|
|
113
|
-
columns:
|
|
114
|
-
loading:
|
|
115
|
-
onCancel: t[0] || (t[0] = (
|
|
116
|
-
onConfirm: t[1] || (t[1] = (
|
|
117
|
-
onChange: t[2] || (t[2] = (
|
|
118
|
-
}), null, 16,
|
|
119
|
-
|
|
110
|
+
"value-key": i.labelKey,
|
|
111
|
+
columns: g.value,
|
|
112
|
+
loading: i.loading,
|
|
113
|
+
onCancel: t[0] || (t[0] = (l) => V()),
|
|
114
|
+
onConfirm: t[1] || (t[1] = (l) => C(l)),
|
|
115
|
+
onChange: t[2] || (t[2] = (l) => k(l))
|
|
116
|
+
}), null, 16, H),
|
|
117
|
+
i.searchable && i.options.length ? (K(), j(U(S), {
|
|
120
118
|
key: 0,
|
|
121
|
-
|
|
122
|
-
"
|
|
123
|
-
placeholder: "
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
], 40, j));
|
|
119
|
+
modelValue: a.value,
|
|
120
|
+
"onUpdate:modelValue": t[3] || (t[3] = (l) => a.value = l),
|
|
121
|
+
placeholder: "输入关键字搜索"
|
|
122
|
+
}, null, 8, ["modelValue"])) : z("", !0)
|
|
123
|
+
], 40, G));
|
|
127
124
|
}
|
|
128
125
|
});
|
|
129
126
|
export {
|
|
130
|
-
|
|
127
|
+
Q as default
|
|
131
128
|
};
|
package/index5.js
CHANGED
|
@@ -1,30 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { date as
|
|
3
|
-
import { SunIcon as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as R, inject as N, useModel as A, useId as G, computed as c, ref as $, effect as q, Fragment as J, mergeModels as x, openBlock as K, createElementBlock as O, renderSlot as Q, createElementVNode as W, normalizeClass as X, toDisplayString as Z, createBlock as ee, unref as te, withModifiers as ae, createCommentVNode as ne, createVNode as re, createSlots as ie, withCtx as le, withDirectives as se } from "vue";
|
|
2
|
+
import { date as g } from "@solar-taro/core";
|
|
3
|
+
import { SUN_ITEM as oe, SUN_FIELD as ue, SunIcon as V } from "@solar-taro/ui-sun";
|
|
4
|
+
import { linkedRef as de } from "@solar-vue/core";
|
|
5
|
+
import ce from "./index6.js";
|
|
6
|
+
import { vDatetimePicker as pe } from "./index13.js";
|
|
7
|
+
const ve = Q, p = Z, l = K, d = O, me = ne, n = te, I = ae, fe = ee, D = re, M = X, s = W, ke = se, E = le, we = ie, ge = J, ye = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "sun-date-range-picker-inner"
|
|
10
|
+
}, he = {
|
|
11
|
+
key: 1,
|
|
12
|
+
class: "sun-date-range-picker-placeholder"
|
|
13
|
+
}, _e = { class: "sun-date-range-picker-input-group" }, be = {
|
|
6
14
|
key: 0,
|
|
7
15
|
class: "sun-date-range-picker-input-value"
|
|
8
|
-
},
|
|
16
|
+
}, Ve = {
|
|
9
17
|
key: 1,
|
|
10
18
|
class: "sun-date-range-picker-input-placeholder"
|
|
11
|
-
},
|
|
19
|
+
}, De = { class: "sun-date-range-picker-input-label" }, Me = {
|
|
12
20
|
key: 0,
|
|
13
21
|
class: "date-range-picker-input-value"
|
|
14
|
-
},
|
|
22
|
+
}, Ce = {
|
|
15
23
|
key: 1,
|
|
16
24
|
class: "sun-date-range-picker-input-placeholder"
|
|
17
|
-
},
|
|
18
|
-
let we = 1;
|
|
19
|
-
const be = /* @__PURE__ */ H({
|
|
25
|
+
}, Te = { class: "sun-date-range-picker-input-label" }, Se = ["id", "type", "value", "min-date", "max-date"], F = " ~ ", Ee = /* @__PURE__ */ R({
|
|
20
26
|
__name: "index",
|
|
21
|
-
props: /* @__PURE__ */
|
|
22
|
-
id: { default: () => `van-datetime-picker-${we++}` },
|
|
27
|
+
props: /* @__PURE__ */ x({
|
|
23
28
|
type: { default: "date" },
|
|
24
|
-
label: {},
|
|
25
|
-
title: {},
|
|
26
29
|
placeholder: {},
|
|
27
30
|
required: { type: Boolean },
|
|
31
|
+
disabled: { type: Boolean },
|
|
28
32
|
format: {},
|
|
29
33
|
min: { default: () => new Date((/* @__PURE__ */ new Date()).getFullYear() - 1, 0, 0, 0, 0, 0).getTime() },
|
|
30
34
|
max: { default: () => new Date((/* @__PURE__ */ new Date()).getFullYear() + 1, 0, 0, 0, 0, 0).getTime() }
|
|
@@ -32,145 +36,157 @@ const be = /* @__PURE__ */ H({
|
|
|
32
36
|
modelValue: { required: !0 },
|
|
33
37
|
modelModifiers: {}
|
|
34
38
|
}),
|
|
35
|
-
emits: /* @__PURE__ */
|
|
36
|
-
setup(
|
|
37
|
-
const
|
|
38
|
-
() =>
|
|
39
|
-
),
|
|
40
|
-
const [t, e] =
|
|
41
|
-
return t && e ?
|
|
42
|
-
}),
|
|
43
|
-
if (
|
|
44
|
-
return
|
|
45
|
-
switch (
|
|
39
|
+
emits: /* @__PURE__ */ x(["confirm", "clear"], ["update:modelValue"]),
|
|
40
|
+
setup(o, { emit: H }) {
|
|
41
|
+
const v = N(oe, void 0), y = N(ue, void 0), a = o, C = H, u = A(o, "modelValue"), r = de(() => [...u.value]), U = G(), j = c(
|
|
42
|
+
() => r.value[m.value] || S()
|
|
43
|
+
), f = $(!1), m = $(0), h = c(() => {
|
|
44
|
+
const [t, e] = u.value;
|
|
45
|
+
return t && e ? g(t, k.value) + F + g(e, k.value) : "";
|
|
46
|
+
}), T = c(() => u.value.length && !a.required && !a.disabled), k = c(() => {
|
|
47
|
+
if (a.format)
|
|
48
|
+
return a.format;
|
|
49
|
+
switch (a.type) {
|
|
46
50
|
case "date":
|
|
47
51
|
return "yyyy-MM-dd";
|
|
48
52
|
case "datetime":
|
|
49
53
|
return "yyyy-MM-dd HH:mm";
|
|
50
54
|
}
|
|
51
|
-
}),
|
|
52
|
-
|
|
53
|
-
return n.title;
|
|
54
|
-
switch (n.type) {
|
|
55
|
+
}), z = c(() => {
|
|
56
|
+
switch (a.type) {
|
|
55
57
|
case "date":
|
|
56
58
|
return "请选择日期";
|
|
57
59
|
case "datetime":
|
|
58
60
|
return "请选择时间";
|
|
59
61
|
}
|
|
60
|
-
}),
|
|
61
|
-
if (
|
|
62
|
-
return
|
|
63
|
-
switch (
|
|
62
|
+
}), _ = c(() => {
|
|
63
|
+
if (a.placeholder)
|
|
64
|
+
return a.placeholder;
|
|
65
|
+
switch (a.type) {
|
|
64
66
|
case "date":
|
|
65
67
|
return ["开始日期", "结束日期"];
|
|
66
68
|
case "datetime":
|
|
67
69
|
return ["开始时间", "结束时间"];
|
|
68
70
|
}
|
|
69
71
|
});
|
|
70
|
-
function
|
|
72
|
+
function S() {
|
|
71
73
|
const t = /* @__PURE__ */ new Date(), e = t.getMinutes();
|
|
72
|
-
switch (
|
|
74
|
+
switch (a.type) {
|
|
73
75
|
case "date":
|
|
74
76
|
return t.setHours(0, 0, 0, 0);
|
|
75
77
|
case "datetime":
|
|
76
|
-
return t.setMinutes(e - e % 5);
|
|
78
|
+
return t.setMinutes(e - e % 5, 0, 0);
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
+
function b() {
|
|
82
|
+
a.disabled || (f.value = !0, w(0));
|
|
81
83
|
}
|
|
82
|
-
function
|
|
83
|
-
|
|
84
|
+
function P() {
|
|
85
|
+
f.value = !1;
|
|
84
86
|
}
|
|
85
|
-
function
|
|
86
|
-
|
|
87
|
+
function B() {
|
|
88
|
+
C("clear", u.value), u.value = [], r.value = [];
|
|
87
89
|
}
|
|
88
|
-
function
|
|
89
|
-
|
|
90
|
+
function w(t) {
|
|
91
|
+
var e, i;
|
|
92
|
+
m.value = t, (i = (e = r.value)[t]) != null || (e[t] = S());
|
|
90
93
|
}
|
|
91
|
-
function
|
|
92
|
-
|
|
94
|
+
function Y(t) {
|
|
95
|
+
r.value[m.value] = t;
|
|
93
96
|
}
|
|
94
|
-
function
|
|
95
|
-
const [t, e] =
|
|
97
|
+
function L() {
|
|
98
|
+
const [t, e] = r.value;
|
|
96
99
|
if (!t || !e)
|
|
97
|
-
return
|
|
98
|
-
|
|
100
|
+
return w(t ? 1 : 0);
|
|
101
|
+
u.value = [...r.value], C("confirm", u.value), P();
|
|
99
102
|
}
|
|
100
|
-
return (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
name: "close-circle",
|
|
116
|
-
onTap: e[0] || (e[0] = (l) => I())
|
|
117
|
-
})) : ae("", !0)
|
|
118
|
-
])
|
|
119
|
-
], 16, ie)), [
|
|
120
|
-
[P]
|
|
121
|
-
])
|
|
122
|
-
]),
|
|
123
|
-
r("van-action-sheet", {
|
|
124
|
-
show: g.value,
|
|
125
|
-
title: N.value,
|
|
126
|
-
"close-on-click-overlay": !0,
|
|
127
|
-
onClose: e[6] || (e[6] = (l) => y()),
|
|
128
|
-
onCancel: e[7] || (e[7] = (l) => y())
|
|
103
|
+
return q(() => {
|
|
104
|
+
y && (y.required.value = a.required, y.disabled.value = a.disabled);
|
|
105
|
+
}), q(() => {
|
|
106
|
+
v && (v.clickable.value = !a.disabled);
|
|
107
|
+
}), v == null || v.onTap(b), (t, e) => (l(), d(ge, null, [
|
|
108
|
+
ve(t.$slots, "default", {
|
|
109
|
+
present: b,
|
|
110
|
+
displayValue: h.value
|
|
111
|
+
}, () => [
|
|
112
|
+
s("view", {
|
|
113
|
+
class: M(["sun-date-range-picker", {
|
|
114
|
+
"sun-date-range-picker-required": o.required,
|
|
115
|
+
"sun-date-range-picker-disabled": o.disabled
|
|
116
|
+
}]),
|
|
117
|
+
onTap: e[1] || (e[1] = (i) => b())
|
|
129
118
|
}, [
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
119
|
+
h.value ? (l(), d("view", ye, p(h.value), 1)) : (l(), d("view", he, p(_.value.join(F)), 1)),
|
|
120
|
+
T.value ? (l(), fe(n(V), {
|
|
121
|
+
key: 2,
|
|
122
|
+
class: "sun-date-range-picker-clear-icon",
|
|
123
|
+
name: "close-circle",
|
|
124
|
+
onTap: e[0] || (e[0] = I((i) => B(), ["stop"]))
|
|
125
|
+
})) : me("", !0),
|
|
126
|
+
D(n(V), {
|
|
127
|
+
class: "sun-date-range-picker-icon",
|
|
128
|
+
name: "calendar-outline"
|
|
129
|
+
})
|
|
130
|
+
], 34)
|
|
131
|
+
]),
|
|
132
|
+
D(n(ce), {
|
|
133
|
+
show: f.value,
|
|
134
|
+
"onUpdate:show": e[6] || (e[6] = (i) => f.value = i),
|
|
135
|
+
title: z.value,
|
|
136
|
+
"confirm-text": n(r)[0] && n(r)[1] ? "确定" : "继续",
|
|
137
|
+
onTap: e[7] || (e[7] = I(() => {
|
|
138
|
+
}, ["stop"])),
|
|
139
|
+
onConfirm: e[8] || (e[8] = (i) => L())
|
|
140
|
+
}, we({
|
|
141
|
+
default: E(() => [
|
|
142
|
+
s("view", _e, [
|
|
143
|
+
s("view", {
|
|
144
|
+
class: M(["sun-date-range-picker-input", { "sun-date-range-picker-input-active": m.value === 0 }]),
|
|
145
|
+
onTap: e[3] || (e[3] = (i) => w(0))
|
|
134
146
|
}, [
|
|
135
|
-
|
|
136
|
-
|
|
147
|
+
n(r)[0] ? (l(), d("view", be, p(n(g)(n(r)[0], k.value)), 1)) : (l(), d("view", Ve, "请选择")),
|
|
148
|
+
s("view", De, p(_.value[0]), 1)
|
|
137
149
|
], 34),
|
|
138
|
-
|
|
150
|
+
D(n(V), {
|
|
139
151
|
class: "sun-date-range-picker-input-group-icon",
|
|
140
152
|
name: "arrow-forward"
|
|
141
153
|
}),
|
|
142
|
-
|
|
143
|
-
class: M(["sun-date-range-picker-input", { "sun-date-range-picker-input-active":
|
|
144
|
-
onTap: e[
|
|
154
|
+
s("view", {
|
|
155
|
+
class: M(["sun-date-range-picker-input", { "sun-date-range-picker-input-active": m.value === 1 }]),
|
|
156
|
+
onTap: e[4] || (e[4] = (i) => w(1))
|
|
145
157
|
}, [
|
|
146
|
-
|
|
147
|
-
|
|
158
|
+
n(r)[1] ? (l(), d("view", Me, p(n(g)(n(r)[1], k.value)), 1)) : (l(), d("view", Ce, "请选择")),
|
|
159
|
+
s("view", Te, p(_.value[1]), 1)
|
|
148
160
|
], 34)
|
|
149
161
|
]),
|
|
150
|
-
|
|
151
|
-
id:
|
|
152
|
-
type:
|
|
162
|
+
ke(s("van-datetime-picker", {
|
|
163
|
+
id: n(U),
|
|
164
|
+
type: o.type,
|
|
153
165
|
"show-toolbar": !1,
|
|
154
|
-
value:
|
|
155
|
-
"min-date":
|
|
156
|
-
"max-date":
|
|
157
|
-
onInput: e[
|
|
158
|
-
}, null, 40,
|
|
159
|
-
[
|
|
160
|
-
]),
|
|
161
|
-
r("view", ye, [
|
|
162
|
-
r("van-button", {
|
|
163
|
-
type: "primary",
|
|
164
|
-
round: "true",
|
|
165
|
-
block: "true",
|
|
166
|
-
onTap: e[5] || (e[5] = (l) => E())
|
|
167
|
-
}, d(a.value[0] && a.value[1] ? "确定" : "继续"), 33)
|
|
166
|
+
value: j.value,
|
|
167
|
+
"min-date": o.min,
|
|
168
|
+
"max-date": o.max,
|
|
169
|
+
onInput: e[5] || (e[5] = (i) => Y(i.detail))
|
|
170
|
+
}, null, 40, Se), [
|
|
171
|
+
[n(pe)]
|
|
168
172
|
])
|
|
169
|
-
],
|
|
170
|
-
|
|
171
|
-
|
|
173
|
+
]),
|
|
174
|
+
_: 2
|
|
175
|
+
}, [
|
|
176
|
+
T.value ? {
|
|
177
|
+
name: "extra",
|
|
178
|
+
fn: E(() => [
|
|
179
|
+
s("view", {
|
|
180
|
+
class: "sun-date-range-picker-clear-btn",
|
|
181
|
+
onTap: e[2] || (e[2] = (i) => B())
|
|
182
|
+
}, "清除", 32)
|
|
183
|
+
]),
|
|
184
|
+
key: "0"
|
|
185
|
+
} : void 0
|
|
186
|
+
]), 1032, ["show", "title", "confirm-text"])
|
|
187
|
+
], 64));
|
|
172
188
|
}
|
|
173
189
|
});
|
|
174
190
|
export {
|
|
175
|
-
|
|
191
|
+
Ee as default
|
|
176
192
|
};
|
package/index6.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as f, ref as h, computed as
|
|
1
|
+
import { defineComponent as f, ref as h, computed as p, watch as b, onUnmounted as w, openBlock as g, createElementBlock as y, mergeProps as v, createElementVNode as x, renderSlot as k, createVNode as B, unref as C, withCtx as N, createTextVNode as V, toDisplayString as _, createCommentVNode as $ } from "vue";
|
|
2
|
+
import { SunButton as S } from "@solar-taro/ui-sun";
|
|
2
3
|
import { onKeyboardHeightChange as D, offKeyboardHeightChange as E } from "@tarojs/taro";
|
|
3
|
-
const
|
|
4
|
+
const s = k, T = x, H = _, K = V, P = C, I = N, U = B, i = g, r = y, j = $, q = v, z = ["show", "title", "close-on-click-overlay"], A = {
|
|
4
5
|
class: "sun-modal-extra",
|
|
5
6
|
style: { position: "absolute", top: "0", left: "16px", display: "flex", alignItems: "center", height: "48px" }
|
|
6
|
-
},
|
|
7
|
+
}, F = {
|
|
7
8
|
key: 0,
|
|
8
9
|
class: "van-button-container van-button-group"
|
|
9
|
-
},
|
|
10
|
+
}, M = /* @__PURE__ */ f({
|
|
10
11
|
__name: "index",
|
|
11
12
|
props: {
|
|
12
13
|
show: { type: Boolean },
|
|
@@ -16,39 +17,42 @@ const n = v, r = w, N = k, a = B, i = _, S = C, V = $, H = ["show", "title", "cl
|
|
|
16
17
|
confirmDisabled: { type: Boolean }
|
|
17
18
|
},
|
|
18
19
|
emits: ["update:show", "close", "confirm"],
|
|
19
|
-
setup(
|
|
20
|
-
const
|
|
21
|
-
function
|
|
22
|
-
|
|
20
|
+
setup(t, { emit: c }) {
|
|
21
|
+
const n = c, d = t, l = h(0), m = p(() => l.value === 0);
|
|
22
|
+
function a(e) {
|
|
23
|
+
l.value = e.height;
|
|
23
24
|
}
|
|
24
|
-
return
|
|
25
|
-
e ||
|
|
26
|
-
}), D(
|
|
27
|
-
E(
|
|
28
|
-
}), (e, o) => (
|
|
29
|
-
show:
|
|
30
|
-
title:
|
|
31
|
-
"close-on-click-overlay":
|
|
32
|
-
onClose: o[1] || (o[1] = (u) =>
|
|
25
|
+
return b(() => d.show, (e) => {
|
|
26
|
+
e || n("close");
|
|
27
|
+
}), D(a), w(() => {
|
|
28
|
+
E(a);
|
|
29
|
+
}), (e, o) => (i(), r("van-action-sheet", q(e.$attrs, {
|
|
30
|
+
show: t.show,
|
|
31
|
+
title: t.title,
|
|
32
|
+
"close-on-click-overlay": m.value,
|
|
33
|
+
onClose: o[1] || (o[1] = (u) => n("update:show", !1))
|
|
33
34
|
}), [
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
T("view", A, [
|
|
36
|
+
s(e.$slots, "extra")
|
|
36
37
|
]),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
s(e.$slots, "default"),
|
|
39
|
+
t.showButtons ? (i(), r("view", F, [
|
|
40
|
+
s(e.$slots, "buttons", {}, () => [
|
|
41
|
+
U(P(S), {
|
|
42
|
+
expand: "block",
|
|
43
|
+
disabled: t.confirmDisabled,
|
|
44
|
+
onClick: o[0] || (o[0] = (u) => n("confirm"))
|
|
45
|
+
}, {
|
|
46
|
+
default: I(() => [
|
|
47
|
+
K(H(t.confirmText), 1)
|
|
48
|
+
]),
|
|
49
|
+
_: 1
|
|
50
|
+
}, 8, ["disabled"])
|
|
47
51
|
])
|
|
48
|
-
])) :
|
|
49
|
-
], 16,
|
|
52
|
+
])) : j("", !0)
|
|
53
|
+
], 16, z));
|
|
50
54
|
}
|
|
51
55
|
});
|
|
52
56
|
export {
|
|
53
|
-
|
|
57
|
+
M as default
|
|
54
58
|
};
|