@solar-taro/ui-vant 4.0.1 → 4.1.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 CHANGED
@@ -1,3 +1,7 @@
1
+ ## 4.0.1 (2026-10-14)
2
+
3
+ This was a version bump only for ui-vant to align it with other projects, there were no code changes.
4
+
1
5
  # 4.0.0 (2026-10-14)
2
6
 
3
7
  ### 🚀 Features
package/index15.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index5.js";
1
+ import f from "./index3.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index17.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index9.js";
1
+ import f from "./index5.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index18.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index8.js";
1
+ import f from "./index7.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index19.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index3.js";
1
+ import f from "./index6.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index20.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index6.js";
1
+ import f from "./index8.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index21.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index7.js";
1
+ import f from "./index9.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index6.js CHANGED
@@ -1,13 +1,7 @@
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";
3
- import { onKeyboardHeightChange as D, offKeyboardHeightChange as E } from "@tarojs/taro";
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 = {
5
- class: "sun-modal-extra",
6
- style: { position: "absolute", top: "0", left: "16px", display: "flex", alignItems: "center", height: "48px" }
7
- }, F = {
8
- key: 0,
9
- class: "van-button-container van-button-group"
10
- }, M = /* @__PURE__ */ f({
1
+ import { defineComponent as h, ref as p, computed as b, watch as k, onUnmounted as w, openBlock as B, createElementBlock as y, mergeProps as g, createElementVNode as v, renderSlot as x, createBlock as C, unref as N, withCtx as V, createVNode as S, createTextVNode as _, toDisplayString as $, createCommentVNode as D } from "vue";
2
+ import { SunButtonGroup as E, SunButton as T } from "@solar-taro/ui-sun";
3
+ import { onKeyboardHeightChange as H, offKeyboardHeightChange as K } from "@tarojs/taro";
4
+ const l = x, P = v, G = $, U = _, r = N, c = V, j = S, i = B, q = C, z = D, A = g, F = y, I = ["show", "title", "close-on-click-overlay"], J = { class: "sun-modal-extra" }, Q = /* @__PURE__ */ h({
11
5
  __name: "index",
12
6
  props: {
13
7
  show: { type: Boolean },
@@ -17,42 +11,50 @@ const s = k, T = x, H = _, K = V, P = C, I = N, U = B, i = g, r = y, j = $, q =
17
11
  confirmDisabled: { type: Boolean }
18
12
  },
19
13
  emits: ["update:show", "close", "confirm"],
20
- setup(t, { emit: c }) {
21
- const n = c, d = t, l = h(0), m = p(() => l.value === 0);
14
+ setup(t, { emit: d }) {
15
+ const n = d, m = t, s = p(0), u = b(() => s.value === 0);
22
16
  function a(e) {
23
- l.value = e.height;
17
+ s.value = e.height;
24
18
  }
25
- return b(() => d.show, (e) => {
19
+ return k(() => m.show, (e) => {
26
20
  e || n("close");
27
- }), D(a), w(() => {
28
- E(a);
29
- }), (e, o) => (i(), r("van-action-sheet", q(e.$attrs, {
21
+ }), H(a), w(() => {
22
+ K(a);
23
+ }), (e, o) => (i(), F("van-action-sheet", A(e.$attrs, {
24
+ class: "sun-modal",
30
25
  show: t.show,
31
26
  title: t.title,
32
- "close-on-click-overlay": m.value,
33
- onClose: o[1] || (o[1] = (u) => n("update:show", !1))
27
+ "close-on-click-overlay": u.value,
28
+ onClose: o[1] || (o[1] = (f) => n("update:show", !1))
34
29
  }), [
35
- T("view", A, [
36
- s(e.$slots, "extra")
30
+ P("view", J, [
31
+ l(e.$slots, "extra")
37
32
  ]),
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"])
51
- ])
52
- ])) : j("", !0)
53
- ], 16, z));
33
+ l(e.$slots, "default"),
34
+ t.showButtons ? (i(), q(r(E), {
35
+ key: 0,
36
+ class: "sun-modal-buttons",
37
+ expand: "block"
38
+ }, {
39
+ default: c(() => [
40
+ l(e.$slots, "buttons", {}, () => [
41
+ j(r(T), {
42
+ expand: "block",
43
+ disabled: t.confirmDisabled,
44
+ onClick: o[0] || (o[0] = (f) => n("confirm"))
45
+ }, {
46
+ default: c(() => [
47
+ U(G(t.confirmText), 1)
48
+ ]),
49
+ _: 1
50
+ }, 8, ["disabled"])
51
+ ])
52
+ ]),
53
+ _: 3
54
+ })) : z("", !0)
55
+ ], 16, I));
54
56
  }
55
57
  });
56
58
  export {
57
- M as default
59
+ Q as default
58
60
  };
package/index7.js CHANGED
@@ -1,148 +1,156 @@
1
- import { defineComponent as Z, ref as E, computed as ee, watch as te, onUnmounted as ne, Fragment as oe, vShow as se, openBlock as ie, createElementBlock as le, createElementVNode as re, unref as ce, createTextVNode as ae, toDisplayString as ue, normalizeClass as de, createVNode as pe, withDirectives as ve, withCtx as fe, renderList as me, normalizeStyle as we } from "vue";
2
- import { isOpperDevice as he } from "@opper/core";
3
- import { BluetoothLowEnergeyDevice as be } from "@opper/wx";
4
- import { checkBluetooth as U, bluetoothService as w, vibrator as ge, overlay as r, withLoading as ye } from "@solar-taro/core";
5
- import { SunIcon as _e, SunButton as q, SunList as De } from "@solar-taro/ui-sun";
6
- import { useDestroyed as K, useObservable as W } from "@solar-vue/core";
7
- import { getSystemInfo as Se, openSetting as xe } from "@tarojs/taro";
8
- import { filter as G, switchMap as f, combineLatest as Ce, map as B, of as $, catchError as D, tap as N, timer as ke, takeUntil as O, finalize as T, from as Ie } from "rxjs";
9
- import { dialog as Ee } from "./index10.js";
10
- const i = ce, o = re, p = ue, S = pe, Be = se, $e = ve, Ne = de, L = ae, M = fe, P = oe, h = ie, b = le, Oe = me, Te = we, Le = { class: "sun-opper-controller" }, Me = ["show"], Pe = { class: "sun-opper-controller-device" }, Re = { class: "sun-opper-controller-device-header" }, ze = { class: "sun-opper-controller-device-name" }, Ve = { class: "sun-opper-controller-device-infos" }, Ae = { class: "sun-opper-controller-device-info" }, je = { class: "sun-opper-controller-device-info" }, Fe = { class: "sun-opper-controller-device-info" }, Ue = { class: "sun-opper-controller-device-info" }, qe = { class: "van-button-container" }, Ke = ["title", "label", "onTap"], We = { class: "van-button-container" }, Ge = ["show"], ot = /* @__PURE__ */ Z({
1
+ import { defineComponent as ee, useModel as te, ref as E, computed as oe, watch as ne, onUnmounted as se, vShow as ie, Fragment as le, mergeModels as F, openBlock as re, createElementBlock as ce, createVNode as ae, unref as ue, withCtx as de, createElementVNode as pe, createTextVNode as ve, toDisplayString as me, normalizeClass as fe, withDirectives as we, createBlock as he, renderList as be, normalizeStyle as ge } from "vue";
2
+ import { isOpperDevice as ye } from "@opper/core";
3
+ import { BluetoothLowEnergeyDevice as _e } from "@opper/wx";
4
+ import { checkBluetooth as q, bluetoothService as b, vibrator as Se, overlay as r, withLoading as De } from "@solar-taro/core";
5
+ import { SunIcon as ke, SunList as xe, SunItem as Ce, SunLabel as Ie, SunButton as K } from "@solar-taro/ui-sun";
6
+ import { useDestroyed as W, useObservable as G } from "@solar-vue/core";
7
+ import { getSystemInfo as Be, openSetting as Ee } from "@tarojs/taro";
8
+ import { filter as H, switchMap as f, combineLatest as Me, map as M, of as N, catchError as D, tap as $, timer as Ne, takeUntil as L, finalize as O, from as $e } from "rxjs";
9
+ import Le from "./index6.js";
10
+ import { dialog as Oe } from "./index10.js";
11
+ const s = ue, n = pe, c = me, T = ae, Te = ie, Pe = we, Re = fe, P = ve, m = re, R = ce, ze = be, Ve = le, v = de, Ae = ge, k = he, je = { class: "sun-opper-controller" }, Ue = {
12
+ key: 0,
13
+ class: "sun-opper-controller-device"
14
+ }, Fe = { class: "sun-opper-controller-device-header" }, qe = { class: "sun-opper-controller-device-name" }, Ke = { class: "sun-opper-controller-device-infos" }, We = { class: "sun-opper-controller-device-info" }, Ge = { class: "sun-opper-controller-device-info" }, He = { class: "sun-opper-controller-device-info" }, Je = { class: "sun-opper-controller-device-info" }, Qe = { style: { marginBottom: "1px" } }, Xe = {
15
+ class: "small",
16
+ style: { color: "var(--color-secondary)" }
17
+ }, Ye = ["show"], at = /* @__PURE__ */ ee({
11
18
  __name: "index",
12
- props: {
13
- show: { type: Boolean, default: !1 },
19
+ props: /* @__PURE__ */ F({
14
20
  mac: {},
15
21
  deviceId: {},
16
22
  opper: {}
17
- },
18
- emits: ["update:show", "connect", "disconnect"],
19
- setup(R, { emit: H }) {
20
- const v = R, x = H, l = v.opper, z = K(), C = K(), a = E({}), u = E(!1), V = W(() => l.connected), g = E(!1), A = ee(() => Object.values(a.value)), d = W(() => l.connected.pipe(
21
- G(Boolean),
23
+ }, {
24
+ show: { type: Boolean, default: !1 },
25
+ showModifiers: {}
26
+ }),
27
+ emits: /* @__PURE__ */ F(["connect", "disconnect"], ["update:show"]),
28
+ setup(z, { emit: J }) {
29
+ const w = z, g = te(z, "show"), V = J, l = w.opper, A = W(), x = W(), u = E({}), d = E(!1), C = G(() => l.connected), y = E(!1), j = oe(() => Object.values(u.value)), p = G(() => l.connected.pipe(
30
+ H(Boolean),
22
31
  f(() => {
23
- const n = l.device;
24
- return Ce({
25
- id: $(n.id),
26
- name: n.name,
27
- version: n.firmwareRevision,
32
+ const o = l.device;
33
+ return Me({
34
+ id: N(o.id),
35
+ name: o.name,
36
+ version: o.firmwareRevision,
28
37
  accuracy: l.accuracyChange,
29
38
  volt: l.batteryChange.pipe(
30
- B(([e]) => e)
39
+ M(([e]) => e)
31
40
  ),
32
41
  charging: l.batteryChange.pipe(
33
- B(([, e]) => !!e)
42
+ M(([, e]) => !!e)
34
43
  ),
35
- serialNumber: n.serialNumber
44
+ serialNumber: o.serialNumber
36
45
  });
37
46
  })
38
- ), {}), J = [
47
+ ), {}), Q = [
39
48
  { id: 1, name: "断开连接" },
40
49
  { id: 2, name: "断开连接并关机", color: "var(--color-danger)" }
41
50
  ];
42
- let k = !1;
43
- function I() {
44
- if (!U()) return;
45
- let n = null;
46
- u.value = !0, w.openAdapter().pipe(
51
+ let I = !1;
52
+ function B() {
53
+ if (!q()) return;
54
+ let o = null;
55
+ d.value = !0, b.openAdapter().pipe(
47
56
  D((e) => {
48
- var t, c;
49
- if ((c = (t = e.errMsg) == null ? void 0 : t.includes) != null && c.call(t, "already"))
50
- return $(null);
57
+ var t, a;
58
+ if ((a = (t = e.errMsg) == null ? void 0 : t.includes) != null && a.call(t, "already"))
59
+ return N(null);
51
60
  throw e;
52
61
  }),
53
62
  f(
54
- () => w.startDevicesDiscovery({
63
+ () => b.startDevicesDiscovery({
55
64
  allowDuplicatesKey: !0,
56
65
  powerLevel: "high"
57
66
  })
58
67
  ),
59
- N(
60
- () => ke(0, 1250).pipe(
61
- O(C)
62
- ).subscribe(() => ge.short())
68
+ $(
69
+ () => Ne(0, 1250).pipe(
70
+ L(x)
71
+ ).subscribe(() => Se.short())
63
72
  ),
64
- f(() => w.devicesChange),
65
- B((e) => e.filter((t) => he({
66
- id: t.deviceId,
73
+ f(() => b.devicesChange),
74
+ M((e) => e.filter((t) => ye({
67
75
  name: t.name
68
76
  }))),
69
- O(C),
77
+ L(x),
70
78
  D((e) => {
71
- var t, c, s;
79
+ var t, a, i;
72
80
  throw e.errno === 103 ? r.modal("温馨提示", "请先授予小程序蓝牙与位置权限").then(() => {
73
- xe();
74
- }) : (c = (t = e.errMsg) == null ? void 0 : t.includes) != null && c.call(t, "permission") ? r.tips("请先授予微信蓝牙与位置权限") : (s = e.errMsg) != null && s.includes("frequently") ? r.tips("操作频繁,请稍后再试") : r.tips(e.errMsg), m(), e;
81
+ Ee();
82
+ }) : (a = (t = e.errMsg) == null ? void 0 : t.includes) != null && a.call(t, "permission") ? r.tips("请先授予微信蓝牙与位置权限") : (i = e.errMsg) != null && i.includes("frequently") ? r.tips("操作频繁,请稍后再试") : r.tips(e.errMsg), h(), e;
75
83
  }),
76
- T(() => {
77
- u.value = !1, a.value = {}, w.stopDevicesDiscovery().subscribe();
84
+ O(() => {
85
+ d.value = !1, u.value = {}, b.stopDevicesDiscovery().subscribe();
78
86
  })
79
87
  ).subscribe((e) => {
80
- const t = v.mac || v.deviceId;
88
+ const t = w.mac || w.deviceId;
81
89
  if (t) {
82
- const s = t.slice(-5).replace(":", ""), _ = e.find(
83
- (F) => F.deviceId === t || // 由于 iOS 的 deviceId 不是 MAC,但是蓝牙名字上有 MAC 后四位,这里通过比对 MAC 来选择设备
84
- F.name.endsWith(s)
90
+ const i = t.slice(-5).replace(":", ""), S = e.find(
91
+ (U) => U.deviceId === t || // 由于 iOS 的 deviceId 不是 MAC,但是蓝牙名字上有 MAC 后四位,这里通过比对 MAC 来选择设备
92
+ U.name.endsWith(i)
85
93
  );
86
- if (_)
87
- return y(_.deviceId);
94
+ if (S)
95
+ return _(S.deviceId);
88
96
  }
89
97
  if (e.length === 1) {
90
- if (n != null || (n = Date.now()), Date.now() - n > 5e3)
91
- return y(e[0].deviceId);
92
- } else e.length > 1 && (n = null);
93
- Object.keys(a.value).forEach((s) => {
94
- a.value[s].recommended = !1, Date.now() - a.value[s].discoveryTime > 5e3 && delete a.value[s];
95
- }), e.forEach((s) => {
96
- a.value[s.deviceId] = s, s.discoveryTime = Date.now();
98
+ if (o != null || (o = Date.now()), Date.now() - o > 5e3)
99
+ return _(e[0].deviceId);
100
+ } else e.length > 1 && (o = null);
101
+ Object.keys(u.value).forEach((i) => {
102
+ u.value[i].recommended = !1, Date.now() - u.value[i].discoveryTime > 5e3 && delete u.value[i];
103
+ }), e.forEach((i) => {
104
+ u.value[i.deviceId] = i, i.discoveryTime = Date.now();
97
105
  });
98
- const c = [...Object.values(a.value)].sort((s, _) => _.RSSI - s.RSSI)[0];
99
- c && (c.recommended = !0);
106
+ const a = [...Object.values(u.value)].sort((i, S) => S.RSSI - i.RSSI)[0];
107
+ a && (a.recommended = !0);
100
108
  });
101
109
  }
102
- function m() {
103
- C.next();
110
+ function h() {
111
+ x.next();
104
112
  }
105
- function y(n) {
106
- k || (r.loading("正在连接"), k = !0, z.next(), l.connect(new be(n)).pipe(
107
- N(() => {
108
- m(), x("connect", n), r.success("连接成功"), setTimeout(j, 600);
113
+ function _(o) {
114
+ I || (r.loading("正在连接"), I = !0, A.next(), l.connect(new _e(o)).pipe(
115
+ $(() => {
116
+ h(), V("connect", o), r.success("连接成功"), setTimeout(() => g.value = !1, 600);
109
117
  }),
110
118
  D((e) => {
111
119
  throw e.errCode === 10003 ? r.tips("连接超时,请重试") : r.tips(`连接失败:${e.errCode}:${e.errMsg}`), e;
112
120
  }),
113
- T(() => k = !1),
114
- f(() => l.connected.pipe(G((e) => !e))),
121
+ O(() => I = !1),
122
+ f(() => l.connected.pipe(H((e) => !e))),
115
123
  // 监听断开
116
- O(z)
124
+ L(A)
117
125
  ).subscribe(() => {
118
- x("disconnect", n), r.error("连接断开");
126
+ V("disconnect", o), r.error("连接断开");
119
127
  }));
120
128
  }
121
- function Q(n) {
122
- U() && (u.value = !0, w.openAdapter().pipe(
123
- T(() => {
124
- u.value = !1;
129
+ function X(o) {
130
+ q() && (d.value = !0, b.openAdapter().pipe(
131
+ O(() => {
132
+ d.value = !1;
125
133
  })
126
134
  ).subscribe(() => {
127
- y(n);
135
+ _(o);
128
136
  }));
129
137
  }
130
- function X() {
131
- var n;
132
- (n = l.disconnect()) == null || n.pipe(
133
- ye("正在断开")
138
+ function Y() {
139
+ var o;
140
+ (o = l.disconnect()) == null || o.pipe(
141
+ De("正在断开")
134
142
  ).subscribe();
135
143
  }
136
- function Y({ detail: n }) {
137
- switch (n.id) {
144
+ function Z({ detail: o }) {
145
+ switch (o.id) {
138
146
  case 1:
139
- X();
147
+ Y();
140
148
  break;
141
149
  case 2:
142
- Ie(Ee.confirm("温馨提示", "您确定要关闭设备电源吗?")).pipe(
143
- N(() => r.loading("正在关机")),
150
+ $e(Oe.confirm("温馨提示", "您确定要关闭设备电源吗?")).pipe(
151
+ $(() => r.loading("正在关机")),
144
152
  f(() => l.shutdown()),
145
- D(() => $(null)),
153
+ D(() => N(null)),
146
154
  // 关机后距离信号丢失还有一段时间,这里主动断开连接,改进用户体验
147
155
  f(() => l.disconnect())
148
156
  ).subscribe(() => {
@@ -151,123 +159,130 @@ const i = ce, o = re, p = ue, S = pe, Be = se, $e = ve, Ne = de, L = ae, M = fe,
151
159
  break;
152
160
  }
153
161
  }
154
- function j() {
155
- x("update:show", !1);
156
- }
157
- return te(() => v.show, async (n) => {
158
- if (n) {
159
- if (!V.value)
160
- if (v.mac) {
161
- const { platform: e } = await Se();
162
- e === "ios" ? I() : Q(v.mac);
162
+ return ne(() => g.value, async (o) => {
163
+ if (o) {
164
+ if (!C.value)
165
+ if (w.mac) {
166
+ const { platform: e } = await Be();
167
+ e === "ios" ? B() : X(w.mac);
163
168
  } else
164
- I();
169
+ B();
165
170
  } else
166
- u.value && m();
167
- }), ne(() => {
168
- m();
169
- }), (n, e) => (h(), b("view", Le, [
170
- o("van-action-sheet", {
171
- show: R.show,
172
- title: "OPPER",
173
- "close-on-click-overlay": !0,
174
- onClose: e[2] || (e[2] = (t) => j())
175
- }, [
176
- i(V) ? (h(), b(P, { key: 0 }, [
177
- o("view", Pe, [
178
- o("view", Re, [
179
- e[6] || (e[6] = o("view", { class: "sun-opper-controller-device-title" }, "设备已连接", -1)),
180
- o("view", ze, [
181
- L(p(i(d).name || "OPPER") + " ", 1),
182
- o("view", {
183
- class: Ne(["sun-opper-controller-device-battery", { "sun-opper-controller-device-battery-active": i(d).charging }])
171
+ d.value && h();
172
+ }), se(() => {
173
+ h();
174
+ }), (o, e) => (m(), R("view", je, [
175
+ T(s(Le), {
176
+ show: g.value,
177
+ "onUpdate:show": e[2] || (e[2] = (t) => g.value = t),
178
+ title: "OPPER"
179
+ }, {
180
+ buttons: v(() => [
181
+ s(C) ? (m(), k(s(K), {
182
+ key: 0,
183
+ color: "danger",
184
+ expand: "block",
185
+ onTap: e[0] || (e[0] = (t) => y.value = !0)
186
+ }, {
187
+ default: v(() => [...e[11] || (e[11] = [
188
+ P("断开连接", -1)
189
+ ])]),
190
+ _: 1
191
+ })) : (m(), k(s(K), {
192
+ key: 1,
193
+ expand: "block",
194
+ onTap: e[1] || (e[1] = (t) => d.value ? h() : B())
195
+ }, {
196
+ default: v(() => [
197
+ P(c(d.value ? "停止扫描" : "扫描 OPPER 设备"), 1)
198
+ ]),
199
+ _: 1
200
+ }))
201
+ ]),
202
+ default: v(() => [
203
+ s(C) ? (m(), R("view", Ue, [
204
+ n("view", Fe, [
205
+ e[6] || (e[6] = n("view", { class: "sun-opper-controller-device-title" }, "设备已连接", -1)),
206
+ n("view", qe, [
207
+ P(c(s(p).name || "OPPER") + " ", 1),
208
+ n("view", {
209
+ class: Re(["sun-opper-controller-device-battery", { "sun-opper-controller-device-battery-active": s(p).charging }])
184
210
  }, [
185
- S(i(_e), { name: "flash" }),
186
- $e(o("text", null, p(i(d).volt) + "%", 513), [
187
- [Be, i(d).volt]
211
+ T(s(ke), { name: "flash" }),
212
+ Pe(n("text", null, c(s(p).volt) + "%", 513), [
213
+ [Te, s(p).volt]
188
214
  ])
189
215
  ], 2)
190
216
  ])
191
217
  ]),
192
- o("view", Ve, [
193
- o("view", Ae, [
194
- e[7] || (e[7] = o("view", null, "设备号", -1)),
195
- o("view", null, p(i(d).id), 1)
218
+ n("view", Ke, [
219
+ n("view", We, [
220
+ e[7] || (e[7] = n("view", null, "设备号", -1)),
221
+ n("view", null, c(s(p).id), 1)
196
222
  ]),
197
- o("view", je, [
198
- e[8] || (e[8] = o("view", null, "秤台精度", -1)),
199
- o("view", null, p(i(d).accuracy || 1) + "克", 1)
223
+ n("view", Ge, [
224
+ e[8] || (e[8] = n("view", null, "秤台精度", -1)),
225
+ n("view", null, c(s(p).accuracy || 1) + "克", 1)
200
226
  ]),
201
- o("view", Fe, [
202
- e[9] || (e[9] = o("view", null, "固件版本", -1)),
203
- o("view", null, p(i(d).version), 1)
227
+ n("view", He, [
228
+ e[9] || (e[9] = n("view", null, "固件版本", -1)),
229
+ n("view", null, c(s(p).version), 1)
204
230
  ]),
205
- o("view", Ue, [
206
- e[10] || (e[10] = o("view", null, "序列号", -1)),
207
- o("view", null, p(i(d).serialNumber), 1)
231
+ n("view", Je, [
232
+ e[10] || (e[10] = n("view", null, "序列号", -1)),
233
+ n("view", null, c(s(p).serialNumber), 1)
208
234
  ])
209
235
  ])
210
- ]),
211
- o("view", qe, [
212
- S(i(q), {
213
- color: "danger",
214
- expand: "block",
215
- onTap: e[0] || (e[0] = (t) => g.value = !0)
216
- }, {
217
- default: M(() => [...e[11] || (e[11] = [
218
- L("断开连接", -1)
219
- ])]),
220
- _: 1
221
- })
222
- ])
223
- ], 64)) : (h(), b(P, { key: 1 }, [
224
- S(i(De), {
236
+ ])) : (m(), k(s(xe), {
237
+ key: 1,
225
238
  class: "sun-opper-controller-device-list",
226
239
  refresher: !1,
227
- data: A.value,
228
- loading: u.value,
240
+ data: j.value,
241
+ loading: d.value,
229
242
  "loading-text": "正在扫描"
230
243
  }, {
231
- default: M(() => [
232
- (h(!0), b(P, null, Oe(A.value, (t) => (h(), b("van-cell", {
244
+ default: v(() => [
245
+ (m(!0), R(Ve, null, ze(j.value, (t) => (m(), k(s(Ce), {
233
246
  key: t.deviceId,
234
247
  title: t.name,
235
248
  label: t.deviceId,
236
249
  size: "large",
237
250
  clickable: !0,
238
- onTap: (c) => y(t.deviceId)
239
- }, [
240
- o("text", {
241
- style: Te({ color: t.recommended ? "var(--color-success)" : "inherit" })
242
- }, p(t.RSSI) + "dBm", 5)
243
- ], 40, Ke))), 128))
251
+ onTap: (a) => _(t.deviceId)
252
+ }, {
253
+ end: v(() => [
254
+ n("text", {
255
+ style: Ae({ color: t.recommended ? "var(--color-success)" : "inherit" })
256
+ }, c(t.RSSI) + "dBm", 5)
257
+ ]),
258
+ default: v(() => [
259
+ T(s(Ie), null, {
260
+ default: v(() => [
261
+ n("view", Qe, c(t.localName || t.name), 1),
262
+ n("view", Xe, c(t.deviceId), 1)
263
+ ]),
264
+ _: 2
265
+ }, 1024)
266
+ ]),
267
+ _: 2
268
+ }, 1032, ["title", "label", "onTap"]))), 128))
244
269
  ]),
245
270
  _: 1
246
- }, 8, ["data", "loading"]),
247
- o("view", We, [
248
- S(i(q), {
249
- expand: "block",
250
- onTap: e[1] || (e[1] = (t) => u.value ? m() : I())
251
- }, {
252
- default: M(() => [
253
- L(p(u.value ? "停止扫描" : "扫描 OPPER 设备"), 1)
254
- ]),
255
- _: 1
256
- })
257
- ])
258
- ], 64))
259
- ], 40, Me),
260
- o("van-action-sheet", {
261
- show: g.value,
262
- actions: J,
271
+ }, 8, ["data", "loading"]))
272
+ ]),
273
+ _: 1
274
+ }, 8, ["show"]),
275
+ n("van-action-sheet", {
276
+ show: y.value,
277
+ actions: Q,
263
278
  "cancel-text": "取消",
264
- onSelect: e[3] || (e[3] = (t) => Y(t)),
265
- onCancel: e[4] || (e[4] = (t) => g.value = !1),
266
- onClose: e[5] || (e[5] = (t) => g.value = !1)
267
- }, null, 40, Ge)
279
+ onSelect: e[3] || (e[3] = (t) => Z(t)),
280
+ onCancel: e[4] || (e[4] = (t) => y.value = !1),
281
+ onClose: e[5] || (e[5] = (t) => y.value = !1)
282
+ }, null, 40, Ye)
268
283
  ]));
269
284
  }
270
285
  });
271
286
  export {
272
- ot as default
287
+ at as default
273
288
  };
@@ -0,0 +1,14 @@
1
+ .sun-modal {
2
+ &-extra {
3
+ position: absolute;
4
+ top: 0;
5
+ left: 16px;
6
+ display: flex;
7
+ align-items: center;
8
+ height: 48px;
9
+ }
10
+
11
+ &-buttons {
12
+ padding: 12px 16px;
13
+ }
14
+ }
@@ -1,21 +1,21 @@
1
1
  import { Opper } from '@opper/core';
2
2
  type __VLS_Props = {
3
- show?: boolean;
4
3
  /** NFC 直连 */
5
4
  mac?: string;
6
5
  /** 自动连 */
7
6
  deviceId?: string;
8
7
  opper: Opper;
9
8
  };
10
- declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
- "update:show": (args_0: boolean) => any;
9
+ type __VLS_PublicProps = {
10
+ 'show'?: boolean;
11
+ } & __VLS_Props;
12
+ declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
+ "update:show": (value: boolean) => any;
12
14
  connect: (deviceId: string) => any;
13
15
  disconnect: (deviceId: string) => any;
14
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
15
- "onUpdate:show"?: ((args_0: boolean) => any) | undefined;
16
+ }, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
17
+ "onUpdate:show"?: ((value: boolean) => any) | undefined;
16
18
  onConnect?: ((deviceId: string) => any) | undefined;
17
19
  onDisconnect?: ((deviceId: string) => any) | undefined;
18
- }>, {
19
- show: boolean;
20
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, SVGViewElement>;
20
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, SVGViewElement>;
21
21
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solar-taro/ui-vant",
3
- "version": "4.0.1",
3
+ "version": "4.1.0",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",