@solar-taro/ui-vant 4.3.1 → 4.3.2
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/index.js +18 -20
- package/index15.js +1 -1
- package/index16.js +1 -1
- package/index17.js +1 -1
- package/index18.js +1 -1
- package/index6.js +59 -60
- package/index9.js +6 -42
- package/overlay/overlay.d.ts +1 -25
- package/package.json +1 -1
- package/vant.interface.d.ts +0 -53
package/CHANGELOG.md
CHANGED
package/index.js
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
import { SolarVant as o } from "./index2.js";
|
|
2
2
|
import { default as a } from "./index3.js";
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
3
|
+
import { default as n } from "./index4.js";
|
|
4
|
+
import { default as l } from "./index5.js";
|
|
5
5
|
import { default as u } from "./index6.js";
|
|
6
|
-
import { default as
|
|
6
|
+
import { default as d } from "./index7.js";
|
|
7
7
|
import { default as s } from "./index8.js";
|
|
8
|
-
import {
|
|
9
|
-
import { vBindFn as
|
|
10
|
-
import { vBinding as
|
|
11
|
-
import { vDatetimePicker as
|
|
12
|
-
import { vReadonly as
|
|
8
|
+
import { Notify as c, notify as v, setupOverlay as k } from "./index9.js";
|
|
9
|
+
import { vBindFn as P } from "./index10.js";
|
|
10
|
+
import { vBinding as g } from "./index11.js";
|
|
11
|
+
import { vDatetimePicker as D } from "./index12.js";
|
|
12
|
+
import { vReadonly as R } from "./index13.js";
|
|
13
13
|
export {
|
|
14
|
-
c as
|
|
15
|
-
v as Notify,
|
|
14
|
+
c as Notify,
|
|
16
15
|
o as SolarVant,
|
|
17
16
|
a as SunCascader,
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
n as SunCascaderPicker,
|
|
18
|
+
l as SunDateRangePicker,
|
|
20
19
|
u as SunOpperController,
|
|
21
|
-
|
|
20
|
+
d as SunSelectPicker,
|
|
22
21
|
s as SunSelector,
|
|
23
|
-
|
|
24
|
-
k as
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
R as
|
|
29
|
-
N as vReadonly
|
|
22
|
+
v as notify,
|
|
23
|
+
k as setupOverlay,
|
|
24
|
+
P as vBindFn,
|
|
25
|
+
g as vBinding,
|
|
26
|
+
D as vDatetimePicker,
|
|
27
|
+
R as vReadonly
|
|
30
28
|
};
|
package/index15.js
CHANGED
package/index16.js
CHANGED
package/index17.js
CHANGED
package/index18.js
CHANGED
package/index6.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isOpperDevice as
|
|
3
|
-
import { BluetoothLowEnergeyDevice as
|
|
4
|
-
import { checkBluetooth as q, bluetoothService as
|
|
5
|
-
import { SunModal as
|
|
1
|
+
import { defineComponent as te, useModel as oe, ref as E, computed as ne, watch as se, onUnmounted as le, vShow as ie, Fragment as re, mergeModels as F, openBlock as ce, createElementBlock as ae, createVNode as ue, unref as de, withCtx as pe, createElementVNode as ve, createTextVNode as me, toDisplayString as fe, normalizeClass as we, withDirectives as he, createBlock as ge, renderList as be, normalizeStyle as ye } from "vue";
|
|
2
|
+
import { isOpperDevice as _e } from "@opper/core";
|
|
3
|
+
import { BluetoothLowEnergeyDevice as Se } from "@opper/wx";
|
|
4
|
+
import { checkBluetooth as q, bluetoothService as g, vibrator as De, overlay as r, withLoading as ke } from "@solar-taro/core";
|
|
5
|
+
import { useDialog as xe, SunModal as Ce, SunIcon as Ie, SunList as Be, SunItem as Ee, SunLabel as Me, SunButton as K } from "@solar-taro/ui-sun";
|
|
6
6
|
import { useDestroyed as W, useObservable as G } from "@solar-vue/core";
|
|
7
|
-
import { getSystemInfo as
|
|
8
|
-
import { filter as H, switchMap as f, combineLatest as
|
|
9
|
-
|
|
10
|
-
const s = ue, n = pe, c = me, T = ae, Te = le, Pe = we, Re = fe, P = ve, m = re, R = ce, ze = be, Ve = ie, v = de, Ae = ge, k = he, je = { class: "sun-opper-controller" }, Ue = {
|
|
7
|
+
import { getSystemInfo as Ne, openSetting as $e } from "@tarojs/taro";
|
|
8
|
+
import { filter as H, switchMap as f, combineLatest as Le, map as M, of as N, catchError as D, tap as $, timer as Oe, takeUntil as L, finalize as O, from as Te } from "rxjs";
|
|
9
|
+
const s = de, n = ve, c = fe, T = ue, Pe = ie, Re = he, ze = we, P = me, m = ce, R = ae, Ve = be, Ae = re, v = pe, je = ye, k = ge, Ue = { class: "sun-opper-controller" }, Fe = {
|
|
11
10
|
key: 0,
|
|
12
11
|
class: "sun-opper-controller-device"
|
|
13
|
-
},
|
|
12
|
+
}, qe = { class: "sun-opper-controller-device-header" }, Ke = { class: "sun-opper-controller-device-name" }, We = { class: "sun-opper-controller-device-infos" }, Ge = { class: "sun-opper-controller-device-info" }, He = { class: "sun-opper-controller-device-info" }, Je = { class: "sun-opper-controller-device-info" }, Qe = { class: "sun-opper-controller-device-info" }, Xe = { style: { marginBottom: "1px" } }, Ye = {
|
|
14
13
|
class: "small",
|
|
15
14
|
style: { color: "var(--color-secondary)" }
|
|
16
|
-
},
|
|
15
|
+
}, Ze = ["show"], ct = /* @__PURE__ */ te({
|
|
17
16
|
__name: "index",
|
|
18
17
|
props: /* @__PURE__ */ F({
|
|
19
18
|
mac: {},
|
|
@@ -25,11 +24,11 @@ const s = ue, n = pe, c = me, T = ae, Te = le, Pe = we, Re = fe, P = ve, m = re,
|
|
|
25
24
|
}),
|
|
26
25
|
emits: /* @__PURE__ */ F(["connect", "disconnect"], ["update:show"]),
|
|
27
26
|
setup(z, { emit: J }) {
|
|
28
|
-
const w = z,
|
|
27
|
+
const w = z, b = oe(z, "show"), V = J, i = w.opper, Q = xe(), A = W(), x = W(), u = E({}), d = E(!1), C = G(() => i.connected), y = E(!1), j = ne(() => Object.values(u.value)), p = G(() => i.connected.pipe(
|
|
29
28
|
H(Boolean),
|
|
30
29
|
f(() => {
|
|
31
30
|
const o = i.device;
|
|
32
|
-
return
|
|
31
|
+
return Le({
|
|
33
32
|
id: N(o.id),
|
|
34
33
|
name: o.name,
|
|
35
34
|
version: o.firmwareRevision,
|
|
@@ -43,7 +42,7 @@ const s = ue, n = pe, c = me, T = ae, Te = le, Pe = we, Re = fe, P = ve, m = re,
|
|
|
43
42
|
serialNumber: o.serialNumber
|
|
44
43
|
});
|
|
45
44
|
})
|
|
46
|
-
), {}),
|
|
45
|
+
), {}), X = [
|
|
47
46
|
{ id: 1, name: "断开连接" },
|
|
48
47
|
{ id: 2, name: "断开连接并关机", color: "var(--color-danger)" }
|
|
49
48
|
];
|
|
@@ -51,7 +50,7 @@ const s = ue, n = pe, c = me, T = ae, Te = le, Pe = we, Re = fe, P = ve, m = re,
|
|
|
51
50
|
function B() {
|
|
52
51
|
if (!q()) return;
|
|
53
52
|
let o = null;
|
|
54
|
-
d.value = !0,
|
|
53
|
+
d.value = !0, g.openAdapter().pipe(
|
|
55
54
|
D((e) => {
|
|
56
55
|
var t, a;
|
|
57
56
|
if ((a = (t = e.errMsg) == null ? void 0 : t.includes) != null && a.call(t, "already"))
|
|
@@ -59,29 +58,29 @@ const s = ue, n = pe, c = me, T = ae, Te = le, Pe = we, Re = fe, P = ve, m = re,
|
|
|
59
58
|
throw e;
|
|
60
59
|
}),
|
|
61
60
|
f(
|
|
62
|
-
() =>
|
|
61
|
+
() => g.startDevicesDiscovery({
|
|
63
62
|
allowDuplicatesKey: !0,
|
|
64
63
|
powerLevel: "high"
|
|
65
64
|
})
|
|
66
65
|
),
|
|
67
66
|
$(
|
|
68
|
-
() =>
|
|
67
|
+
() => Oe(0, 1250).pipe(
|
|
69
68
|
L(x)
|
|
70
|
-
).subscribe(() =>
|
|
69
|
+
).subscribe(() => De.short())
|
|
71
70
|
),
|
|
72
|
-
f(() =>
|
|
73
|
-
M((e) => e.filter((t) =>
|
|
71
|
+
f(() => g.devicesChange),
|
|
72
|
+
M((e) => e.filter((t) => _e({
|
|
74
73
|
name: t.name
|
|
75
74
|
}))),
|
|
76
75
|
L(x),
|
|
77
76
|
D((e) => {
|
|
78
77
|
var t, a, l;
|
|
79
78
|
throw e.errno === 103 ? r.modal("温馨提示", "请先授予小程序蓝牙与位置权限").then(() => {
|
|
80
|
-
|
|
79
|
+
$e();
|
|
81
80
|
}) : (a = (t = e.errMsg) == null ? void 0 : t.includes) != null && a.call(t, "permission") ? r.tips("请先授予微信蓝牙与位置权限") : (l = e.errMsg) != null && l.includes("frequently") ? r.tips("操作频繁,请稍后再试") : r.tips(e.errMsg), h(), e;
|
|
82
81
|
}),
|
|
83
82
|
O(() => {
|
|
84
|
-
d.value = !1, u.value = {},
|
|
83
|
+
d.value = !1, u.value = {}, g.stopDevicesDiscovery().subscribe();
|
|
85
84
|
})
|
|
86
85
|
).subscribe((e) => {
|
|
87
86
|
const t = w.mac || w.deviceId;
|
|
@@ -110,9 +109,9 @@ const s = ue, n = pe, c = me, T = ae, Te = le, Pe = we, Re = fe, P = ve, m = re,
|
|
|
110
109
|
x.next();
|
|
111
110
|
}
|
|
112
111
|
function _(o) {
|
|
113
|
-
I || (r.loading("正在连接"), I = !0, A.next(), i.connect(new
|
|
112
|
+
I || (r.loading("正在连接"), I = !0, A.next(), i.connect(new Se(o)).pipe(
|
|
114
113
|
$(() => {
|
|
115
|
-
h(), V("connect", o), r.success("连接成功"), setTimeout(() =>
|
|
114
|
+
h(), V("connect", o), r.success("连接成功"), setTimeout(() => b.value = !1, 600);
|
|
116
115
|
}),
|
|
117
116
|
D((e) => {
|
|
118
117
|
throw e.errCode === 10003 ? r.tips("连接超时,请重试") : r.tips(`连接失败:${e.errCode}:${e.errMsg}`), e;
|
|
@@ -125,8 +124,8 @@ const s = ue, n = pe, c = me, T = ae, Te = le, Pe = we, Re = fe, P = ve, m = re,
|
|
|
125
124
|
V("disconnect", o), r.error("连接断开");
|
|
126
125
|
}));
|
|
127
126
|
}
|
|
128
|
-
function
|
|
129
|
-
q() && (d.value = !0,
|
|
127
|
+
function Y(o) {
|
|
128
|
+
q() && (d.value = !0, g.openAdapter().pipe(
|
|
130
129
|
O(() => {
|
|
131
130
|
d.value = !1;
|
|
132
131
|
})
|
|
@@ -134,19 +133,19 @@ const s = ue, n = pe, c = me, T = ae, Te = le, Pe = we, Re = fe, P = ve, m = re,
|
|
|
134
133
|
_(o);
|
|
135
134
|
}));
|
|
136
135
|
}
|
|
137
|
-
function
|
|
136
|
+
function Z() {
|
|
138
137
|
var o;
|
|
139
138
|
(o = i.disconnect()) == null || o.pipe(
|
|
140
|
-
|
|
139
|
+
ke("正在断开")
|
|
141
140
|
).subscribe();
|
|
142
141
|
}
|
|
143
|
-
function
|
|
142
|
+
function ee({ detail: o }) {
|
|
144
143
|
switch (o.id) {
|
|
145
144
|
case 1:
|
|
146
|
-
|
|
145
|
+
Z();
|
|
147
146
|
break;
|
|
148
147
|
case 2:
|
|
149
|
-
|
|
148
|
+
Te(Q.confirm({ title: "温馨提示", content: "您确定要关闭设备电源吗?" })).pipe(
|
|
150
149
|
$(() => r.loading("正在关机")),
|
|
151
150
|
f(() => i.shutdown()),
|
|
152
151
|
D(() => N(null)),
|
|
@@ -158,22 +157,22 @@ const s = ue, n = pe, c = me, T = ae, Te = le, Pe = we, Re = fe, P = ve, m = re,
|
|
|
158
157
|
break;
|
|
159
158
|
}
|
|
160
159
|
}
|
|
161
|
-
return
|
|
160
|
+
return se(() => b.value, async (o) => {
|
|
162
161
|
if (o) {
|
|
163
162
|
if (!C.value)
|
|
164
163
|
if (w.mac) {
|
|
165
|
-
const { platform: e } = await
|
|
166
|
-
e === "ios" ? B() :
|
|
164
|
+
const { platform: e } = await Ne();
|
|
165
|
+
e === "ios" ? B() : Y(w.mac);
|
|
167
166
|
} else
|
|
168
167
|
B();
|
|
169
168
|
} else
|
|
170
169
|
d.value && h();
|
|
171
|
-
}),
|
|
170
|
+
}), le(() => {
|
|
172
171
|
h();
|
|
173
|
-
}), (o, e) => (m(), R("view",
|
|
174
|
-
T(s(
|
|
175
|
-
show:
|
|
176
|
-
"onUpdate:show": e[2] || (e[2] = (t) =>
|
|
172
|
+
}), (o, e) => (m(), R("view", Ue, [
|
|
173
|
+
T(s(Ce), {
|
|
174
|
+
show: b.value,
|
|
175
|
+
"onUpdate:show": e[2] || (e[2] = (t) => b.value = t),
|
|
177
176
|
title: "OPPER"
|
|
178
177
|
}, {
|
|
179
178
|
actions: v(() => [
|
|
@@ -199,40 +198,40 @@ const s = ue, n = pe, c = me, T = ae, Te = le, Pe = we, Re = fe, P = ve, m = re,
|
|
|
199
198
|
}))
|
|
200
199
|
]),
|
|
201
200
|
default: v(() => [
|
|
202
|
-
s(C) ? (m(), R("view",
|
|
203
|
-
n("view",
|
|
201
|
+
s(C) ? (m(), R("view", Fe, [
|
|
202
|
+
n("view", qe, [
|
|
204
203
|
e[6] || (e[6] = n("view", { class: "sun-opper-controller-device-title" }, "设备已连接", -1)),
|
|
205
|
-
n("view",
|
|
204
|
+
n("view", Ke, [
|
|
206
205
|
P(c(s(p).name || "OPPER") + " ", 1),
|
|
207
206
|
n("view", {
|
|
208
|
-
class:
|
|
207
|
+
class: ze(["sun-opper-controller-device-battery", { "sun-opper-controller-device-battery-active": s(p).charging }])
|
|
209
208
|
}, [
|
|
210
|
-
T(s(
|
|
211
|
-
|
|
212
|
-
[
|
|
209
|
+
T(s(Ie), { name: "flash" }),
|
|
210
|
+
Re(n("text", null, c(s(p).volt) + "%", 513), [
|
|
211
|
+
[Pe, s(p).volt]
|
|
213
212
|
])
|
|
214
213
|
], 2)
|
|
215
214
|
])
|
|
216
215
|
]),
|
|
217
|
-
n("view",
|
|
218
|
-
n("view",
|
|
216
|
+
n("view", We, [
|
|
217
|
+
n("view", Ge, [
|
|
219
218
|
e[7] || (e[7] = n("view", null, "设备号", -1)),
|
|
220
219
|
n("view", null, c(s(p).id), 1)
|
|
221
220
|
]),
|
|
222
|
-
n("view",
|
|
221
|
+
n("view", He, [
|
|
223
222
|
e[8] || (e[8] = n("view", null, "秤台精度", -1)),
|
|
224
223
|
n("view", null, c(s(p).accuracy || 1) + "克", 1)
|
|
225
224
|
]),
|
|
226
|
-
n("view",
|
|
225
|
+
n("view", Je, [
|
|
227
226
|
e[9] || (e[9] = n("view", null, "固件版本", -1)),
|
|
228
227
|
n("view", null, c(s(p).version), 1)
|
|
229
228
|
]),
|
|
230
|
-
n("view",
|
|
229
|
+
n("view", Qe, [
|
|
231
230
|
e[10] || (e[10] = n("view", null, "序列号", -1)),
|
|
232
231
|
n("view", null, c(s(p).serialNumber), 1)
|
|
233
232
|
])
|
|
234
233
|
])
|
|
235
|
-
])) : (m(), k(s(
|
|
234
|
+
])) : (m(), k(s(Be), {
|
|
236
235
|
key: 1,
|
|
237
236
|
class: "sun-opper-controller-device-list",
|
|
238
237
|
refresher: !1,
|
|
@@ -241,7 +240,7 @@ const s = ue, n = pe, c = me, T = ae, Te = le, Pe = we, Re = fe, P = ve, m = re,
|
|
|
241
240
|
"loading-text": "正在扫描"
|
|
242
241
|
}, {
|
|
243
242
|
default: v(() => [
|
|
244
|
-
(m(!0), R(
|
|
243
|
+
(m(!0), R(Ae, null, Ve(j.value, (t) => (m(), k(s(Ee), {
|
|
245
244
|
key: t.deviceId,
|
|
246
245
|
title: t.name,
|
|
247
246
|
label: t.deviceId,
|
|
@@ -251,14 +250,14 @@ const s = ue, n = pe, c = me, T = ae, Te = le, Pe = we, Re = fe, P = ve, m = re,
|
|
|
251
250
|
}, {
|
|
252
251
|
end: v(() => [
|
|
253
252
|
n("text", {
|
|
254
|
-
style:
|
|
253
|
+
style: je({ color: t.recommended ? "var(--color-success)" : "inherit" })
|
|
255
254
|
}, c(t.RSSI) + "dBm", 5)
|
|
256
255
|
]),
|
|
257
256
|
default: v(() => [
|
|
258
|
-
T(s(
|
|
257
|
+
T(s(Me), null, {
|
|
259
258
|
default: v(() => [
|
|
260
|
-
n("view",
|
|
261
|
-
n("view",
|
|
259
|
+
n("view", Xe, c(t.localName || t.name), 1),
|
|
260
|
+
n("view", Ye, c(t.deviceId), 1)
|
|
262
261
|
]),
|
|
263
262
|
_: 2
|
|
264
263
|
}, 1024)
|
|
@@ -273,12 +272,12 @@ const s = ue, n = pe, c = me, T = ae, Te = le, Pe = we, Re = fe, P = ve, m = re,
|
|
|
273
272
|
}, 8, ["show"]),
|
|
274
273
|
n("van-action-sheet", {
|
|
275
274
|
show: y.value,
|
|
276
|
-
actions:
|
|
275
|
+
actions: X,
|
|
277
276
|
"cancel-text": "取消",
|
|
278
|
-
onSelect: e[3] || (e[3] = (t) =>
|
|
277
|
+
onSelect: e[3] || (e[3] = (t) => ee(t)),
|
|
279
278
|
onCancel: e[4] || (e[4] = (t) => y.value = !1),
|
|
280
279
|
onClose: e[5] || (e[5] = (t) => y.value = !1)
|
|
281
|
-
}, null, 40,
|
|
280
|
+
}, null, 40, Ze)
|
|
282
281
|
]));
|
|
283
282
|
}
|
|
284
283
|
});
|
package/index9.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const i = {};
|
|
2
|
-
function
|
|
2
|
+
function a(r) {
|
|
3
3
|
Object.assign(i, r);
|
|
4
4
|
}
|
|
5
|
-
class
|
|
5
|
+
class o {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.duration = 2e3;
|
|
8
8
|
}
|
|
@@ -22,45 +22,9 @@ class a {
|
|
|
22
22
|
return i.notify.clear();
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* 展示确认对话框
|
|
28
|
-
* @param title
|
|
29
|
-
* @param message
|
|
30
|
-
* @param options 其他 dialog 选项
|
|
31
|
-
*/
|
|
32
|
-
confirm(n, t, o) {
|
|
33
|
-
return i.dialog.confirm({
|
|
34
|
-
title: n,
|
|
35
|
-
message: t,
|
|
36
|
-
...o
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* 展示警告对话框
|
|
41
|
-
* @param title
|
|
42
|
-
* @param message
|
|
43
|
-
* @param options 其他 dialog 选项
|
|
44
|
-
*/
|
|
45
|
-
alert(n, t, o) {
|
|
46
|
-
return i.dialog.alert({
|
|
47
|
-
title: n,
|
|
48
|
-
message: t,
|
|
49
|
-
...o
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* 关闭对话框
|
|
54
|
-
*/
|
|
55
|
-
dismiss() {
|
|
56
|
-
return i.dialog.close();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
const u = new s(), c = new a();
|
|
25
|
+
const s = new o();
|
|
60
26
|
export {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
c as notify,
|
|
65
|
-
e as setupOverlay
|
|
27
|
+
o as Notify,
|
|
28
|
+
s as notify,
|
|
29
|
+
a as setupOverlay
|
|
66
30
|
};
|
package/overlay/overlay.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VanNotify } from '../vant.interface';
|
|
2
2
|
export interface OverlayConfig {
|
|
3
|
-
dialog: VanDialog;
|
|
4
3
|
notify: VanNotify;
|
|
5
4
|
}
|
|
6
5
|
export declare function setupOverlay(cfg: OverlayConfig): void;
|
|
@@ -12,27 +11,4 @@ export declare class Notify {
|
|
|
12
11
|
danger(message: string, selector?: string): any;
|
|
13
12
|
dismiss(): void;
|
|
14
13
|
}
|
|
15
|
-
/** @deprecated */
|
|
16
|
-
export declare class Dialog {
|
|
17
|
-
/**
|
|
18
|
-
* 展示确认对话框
|
|
19
|
-
* @param title
|
|
20
|
-
* @param message
|
|
21
|
-
* @param options 其他 dialog 选项
|
|
22
|
-
*/
|
|
23
|
-
confirm(title: string, message: string, options?: VanDialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
|
|
24
|
-
/**
|
|
25
|
-
* 展示警告对话框
|
|
26
|
-
* @param title
|
|
27
|
-
* @param message
|
|
28
|
-
* @param options 其他 dialog 选项
|
|
29
|
-
*/
|
|
30
|
-
alert(title: string, message: string, options?: VanDialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
|
|
31
|
-
/**
|
|
32
|
-
* 关闭对话框
|
|
33
|
-
*/
|
|
34
|
-
dismiss(): void;
|
|
35
|
-
}
|
|
36
|
-
/** @deprecated */
|
|
37
|
-
export declare const dialog: Dialog;
|
|
38
14
|
export declare const notify: Notify;
|
package/package.json
CHANGED
package/vant.interface.d.ts
CHANGED
|
@@ -13,58 +13,6 @@ export interface VanNotifyOptions {
|
|
|
13
13
|
onOpened?: () => void;
|
|
14
14
|
onClose?: () => void;
|
|
15
15
|
}
|
|
16
|
-
type Action = 'confirm' | 'cancel' | 'overlay';
|
|
17
|
-
type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance;
|
|
18
|
-
export interface VanDialogOptions {
|
|
19
|
-
lang?: string;
|
|
20
|
-
show?: boolean;
|
|
21
|
-
title?: string;
|
|
22
|
-
width?: string | number | null;
|
|
23
|
-
zIndex?: number;
|
|
24
|
-
theme?: string;
|
|
25
|
-
context?: (() => DialogContext) | DialogContext;
|
|
26
|
-
message?: string;
|
|
27
|
-
overlay?: boolean;
|
|
28
|
-
selector?: string;
|
|
29
|
-
ariaLabel?: string;
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated use custom-class instead
|
|
32
|
-
*/
|
|
33
|
-
className?: string;
|
|
34
|
-
customStyle?: string;
|
|
35
|
-
transition?: string;
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated use beforeClose instead
|
|
38
|
-
*/
|
|
39
|
-
asyncClose?: boolean;
|
|
40
|
-
beforeClose?: null | ((action: Action) => Promise<void | boolean> | void);
|
|
41
|
-
businessId?: number;
|
|
42
|
-
sessionFrom?: string;
|
|
43
|
-
overlayStyle?: string;
|
|
44
|
-
appParameter?: string;
|
|
45
|
-
messageAlign?: string;
|
|
46
|
-
sendMessageImg?: string;
|
|
47
|
-
showMessageCard?: boolean;
|
|
48
|
-
sendMessagePath?: string;
|
|
49
|
-
sendMessageTitle?: string;
|
|
50
|
-
confirmButtonText?: string;
|
|
51
|
-
cancelButtonText?: string;
|
|
52
|
-
showConfirmButton?: boolean;
|
|
53
|
-
showCancelButton?: boolean;
|
|
54
|
-
closeOnClickOverlay?: boolean;
|
|
55
|
-
confirmButtonOpenType?: string;
|
|
56
|
-
}
|
|
57
|
-
export interface VanDialog {
|
|
58
|
-
(options: VanDialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
|
|
59
|
-
alert(options: VanDialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
|
|
60
|
-
confirm(options: VanDialogOptions): Promise<WechatMiniprogram.Component.TrivialInstance>;
|
|
61
|
-
close(): void;
|
|
62
|
-
stopLoading(): void;
|
|
63
|
-
currentOptions: VanDialogOptions;
|
|
64
|
-
defaultOptions: VanDialogOptions;
|
|
65
|
-
setDefaultOptions(options: VanDialogOptions): void;
|
|
66
|
-
resetDefaultOptions(): void;
|
|
67
|
-
}
|
|
68
16
|
export interface VanNotify {
|
|
69
17
|
(options: VanNotifyOptions | string): any;
|
|
70
18
|
clear: (options?: VanNotifyOptions | undefined) => void;
|
|
@@ -88,4 +36,3 @@ export interface VanPickerColumn<T> {
|
|
|
88
36
|
values: T[];
|
|
89
37
|
defaultIndex?: number;
|
|
90
38
|
}
|
|
91
|
-
export {};
|