@solar-taro/ui-vant 1.1.0 → 1.1.1
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 +11 -1
- package/index10.js +65 -63
- package/index104.js +6 -6
- package/index105.js +6 -6
- package/index135.js +1 -1
- package/index16.js +1 -1
- package/index17.js +1 -1
- package/index18.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/index26.js +1 -1
- package/index28.js +1 -1
- package/index56.js +11 -7
- package/index57.js +7 -9
- package/index58.js +9 -11
- package/index61.js +1 -1
- package/index63.js +1 -1
- package/index64.js +1 -1
- package/index67.js +1 -1
- package/index68.js +1 -1
- package/index8.js +86 -86
- package/index83.js +1 -1
- package/index84.js +1 -1
- package/index85.js +1 -1
- package/index86.js +1 -1
- package/index87.js +1 -1
- package/list/index.vue.d.ts +1 -1
- package/package.json +1 -1
- package/plugin.d.ts +1 -1
- package/selector/index.vue.d.ts +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## 1.1.0 (2025-03-11)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **ui-vant:** opper-controller 的 autoconnect 改为 mac 与 device-id
|
|
6
|
+
|
|
7
|
+
### ❤️ Thank You
|
|
8
|
+
|
|
9
|
+
- HyperLife1119
|
|
10
|
+
|
|
1
11
|
## 1.0.3 (2025-02-17)
|
|
2
12
|
|
|
3
13
|
### 🩹 Fixes
|
|
@@ -14,4 +24,4 @@ This was a version bump only for ui-vant to align it with other projects, there
|
|
|
14
24
|
|
|
15
25
|
## 1.0.1 (2025-01-22)
|
|
16
26
|
|
|
17
|
-
This was a version bump only for ui-vant to align it with other projects, there were no code changes.
|
|
27
|
+
This was a version bump only for ui-vant to align it with other projects, there were no code changes.
|
package/index10.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useFilterList as
|
|
3
|
-
import { SunVirtualScroll as
|
|
4
|
-
import
|
|
5
|
-
const K =
|
|
1
|
+
import { defineComponent as M, ref as z, computed as h, renderSlot as A, openBlock as _, createElementBlock as G, createCommentVNode as H, mergeProps as J, resolveDirective as Q, withDirectives as U, unref as W, toDisplayString as X, createElementVNode as Y, normalizeClass as Z, normalizeStyle as x, withCtx as ee, createBlock as le, Fragment as te, renderList as oe } from "vue";
|
|
2
|
+
import { useFilterList as ne } from "@solar-taro/core";
|
|
3
|
+
import { SunVirtualScroll as se } from "@solar-taro/ui-sun";
|
|
4
|
+
import re from "./index6.js";
|
|
5
|
+
const K = A, s = _, r = G, u = H, T = J, ae = Q, q = U, d = W, D = X, c = Y, N = Z, B = x, E = ee, L = le, C = te, ie = oe, ue = ["label", "value", "placeholder", "required", "disabled"], de = ["label", "value", "placeholder", "use-right-icon-slot", "disabled"], ce = ["show", "title"], ve = ["value"], pe = ["onTap"], fe = {
|
|
6
6
|
class: "sun-selector-option-label",
|
|
7
7
|
name: "title"
|
|
8
8
|
}, me = {
|
|
@@ -21,7 +21,7 @@ const K = I, s = M, r = A, u = G, z = H, re = J, T = Q, d = U, q = W, c = X, D =
|
|
|
21
21
|
}, be = {
|
|
22
22
|
key: 3,
|
|
23
23
|
class: "van-button-container"
|
|
24
|
-
}, Be = /* @__PURE__ */
|
|
24
|
+
}, Be = /* @__PURE__ */ M({
|
|
25
25
|
__name: "index",
|
|
26
26
|
props: {
|
|
27
27
|
type: { default: "field" },
|
|
@@ -43,11 +43,11 @@ const K = I, s = M, r = A, u = G, z = H, re = J, T = Q, d = U, q = W, c = X, D =
|
|
|
43
43
|
refreshing: { type: Boolean }
|
|
44
44
|
},
|
|
45
45
|
emits: ["update:modelValue", "select", "unselect", "clear", "close", "confirm", "refresh"],
|
|
46
|
-
setup(O, {
|
|
47
|
-
const o = O, a =
|
|
46
|
+
setup(O, { expose: F, emit: P }) {
|
|
47
|
+
const o = O, a = P, y = z(!1), g = z(!1), { keyword: S, filteredList: b } = ne(
|
|
48
48
|
() => o.options,
|
|
49
49
|
(e, l) => e[o.labelKey].includes(l.value)
|
|
50
|
-
),
|
|
50
|
+
), k = h(() => {
|
|
51
51
|
var e;
|
|
52
52
|
if (v.value) {
|
|
53
53
|
const l = o.options.find((n) => n[o.valueKey] === o.modelValue);
|
|
@@ -59,7 +59,7 @@ const K = I, s = M, r = A, u = G, z = H, re = J, T = Q, d = U, q = W, c = X, D =
|
|
|
59
59
|
return ((n = o.options.find((t) => t[o.valueKey] === l)) == null ? void 0 : n[o.labelKey]) || "";
|
|
60
60
|
}
|
|
61
61
|
).join(o.delimiter);
|
|
62
|
-
}),
|
|
62
|
+
}), V = h(() => o.modelValue && !o.required), v = h(() => o.mode === "single"), R = h(() => {
|
|
63
63
|
var n, t;
|
|
64
64
|
let e, l = 48;
|
|
65
65
|
return typeof o.virtual != "boolean" && (n = o.virtual) != null && n.itemSize && (l = (t = o.virtual) == null ? void 0 : t.itemSize), { id: e, itemSize: l };
|
|
@@ -69,114 +69,116 @@ const K = I, s = M, r = A, u = G, z = H, re = J, T = Q, d = U, q = W, c = X, D =
|
|
|
69
69
|
const l = e[o.valueKey];
|
|
70
70
|
return v.value ? o.modelValue === l : ((n = o.modelValue) == null ? void 0 : n.includes(l)) || !1;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
o.disabled || (
|
|
74
|
-
|
|
72
|
+
function p() {
|
|
73
|
+
o.disabled || (y.value = !0, g.value || setTimeout(() => {
|
|
74
|
+
g.value = !0;
|
|
75
75
|
}, 300));
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
|
|
77
|
+
function f() {
|
|
78
|
+
y.value = !1, a("close");
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function j() {
|
|
81
81
|
const e = o.modelValue.map(
|
|
82
82
|
(l) => o.options.find((n) => n[o.valueKey] === l)
|
|
83
83
|
);
|
|
84
|
-
a("confirm", e),
|
|
84
|
+
a("confirm", e), f();
|
|
85
85
|
}
|
|
86
|
-
function
|
|
86
|
+
function m(e) {
|
|
87
87
|
const l = e[o.valueKey];
|
|
88
88
|
let n = o.modelValue;
|
|
89
|
-
v.value ? (i(e) ? o.required || (a("unselect", e), n = null) : (a("select", e), n = l),
|
|
89
|
+
v.value ? (i(e) ? o.required || (a("unselect", e), n = null) : (a("select", e), n = l), f()) : i(e) ? (a("unselect", e), n = o.modelValue.filter((t) => t !== l)) : (a("select", e), n = (o.modelValue || []).concat(e[o.valueKey])), a("update:modelValue", n);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function w() {
|
|
92
92
|
a("clear", o.modelValue), a("update:modelValue", null);
|
|
93
93
|
}
|
|
94
|
-
return (
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
return F({
|
|
95
|
+
present: p
|
|
96
|
+
}), (e, l) => {
|
|
97
|
+
const n = ae("readonly");
|
|
98
|
+
return s(), r(C, null, [
|
|
97
99
|
K(e.$slots, "default", {
|
|
98
|
-
present:
|
|
99
|
-
label:
|
|
100
|
+
present: p,
|
|
101
|
+
label: k.value
|
|
100
102
|
}, () => [
|
|
101
|
-
e.type === "field" ?
|
|
103
|
+
e.type === "field" ? q((s(), r("van-field", T({ key: 0 }, e.$attrs, {
|
|
102
104
|
class: "sun-selector",
|
|
103
105
|
label: e.label,
|
|
104
|
-
value:
|
|
106
|
+
value: k.value,
|
|
105
107
|
placeholder: e.placeholder,
|
|
106
108
|
required: e.required,
|
|
107
109
|
disabled: e.disabled,
|
|
108
|
-
onClickInput: l[1] || (l[1] = (t) =>
|
|
110
|
+
onClickInput: l[1] || (l[1] = (t) => p())
|
|
109
111
|
}), [
|
|
110
|
-
|
|
112
|
+
V.value ? (s(), r("van-icon", {
|
|
111
113
|
key: 0,
|
|
112
114
|
slot: "right-icon",
|
|
113
115
|
name: "clear",
|
|
114
|
-
onTap: l[0] || (l[0] = (t) =>
|
|
116
|
+
onTap: l[0] || (l[0] = (t) => w())
|
|
115
117
|
}, null, 32)) : u("", !0)
|
|
116
|
-
], 16,
|
|
118
|
+
], 16, ue)), [
|
|
117
119
|
[n]
|
|
118
|
-
]) : e.type === "search" ?
|
|
120
|
+
]) : e.type === "search" ? q((s(), r("van-search", T({ key: 1 }, e.$attrs, {
|
|
119
121
|
class: "sun-selector",
|
|
120
122
|
label: e.label,
|
|
121
|
-
value:
|
|
123
|
+
value: k.value,
|
|
122
124
|
placeholder: e.placeholder,
|
|
123
|
-
"use-right-icon-slot":
|
|
125
|
+
"use-right-icon-slot": V.value,
|
|
124
126
|
shape: "round",
|
|
125
127
|
clearable: !1,
|
|
126
128
|
disabled: e.disabled,
|
|
127
|
-
onClickInput: l[3] || (l[3] = (t) =>
|
|
129
|
+
onClickInput: l[3] || (l[3] = (t) => p())
|
|
128
130
|
}), [
|
|
129
|
-
|
|
131
|
+
V.value ? (s(), r("van-icon", {
|
|
130
132
|
key: 0,
|
|
131
133
|
slot: "right-icon",
|
|
132
134
|
name: "clear",
|
|
133
|
-
onTap: l[2] || (l[2] = (t) =>
|
|
135
|
+
onTap: l[2] || (l[2] = (t) => w())
|
|
134
136
|
}, null, 32)) : u("", !0)
|
|
135
|
-
], 16,
|
|
137
|
+
], 16, de)), [
|
|
136
138
|
[n]
|
|
137
139
|
]) : u("", !0)
|
|
138
140
|
]),
|
|
139
141
|
c("van-action-sheet", {
|
|
140
|
-
show:
|
|
142
|
+
show: y.value,
|
|
141
143
|
title: e.placeholder,
|
|
142
144
|
"close-on-click-overlay": !0,
|
|
143
|
-
onClose: l[8] || (l[8] = (t) =>
|
|
144
|
-
onCancel: l[9] || (l[9] = (t) =>
|
|
145
|
+
onClose: l[8] || (l[8] = (t) => f()),
|
|
146
|
+
onCancel: l[9] || (l[9] = (t) => f())
|
|
145
147
|
}, [
|
|
146
148
|
e.searchable ? (s(), r("van-search", {
|
|
147
149
|
key: 0,
|
|
148
150
|
shape: "round",
|
|
149
151
|
"input-align": "center",
|
|
150
|
-
value: d(
|
|
152
|
+
value: d(S),
|
|
151
153
|
placeholder: "输入关键字搜索",
|
|
152
|
-
onChange: l[4] || (l[4] = (t) =>
|
|
153
|
-
}, null, 40,
|
|
154
|
-
e.virtual ? (s(), r(
|
|
155
|
-
|
|
154
|
+
onChange: l[4] || (l[4] = (t) => S.value = t.detail.trim())
|
|
155
|
+
}, null, 40, ve)) : u("", !0),
|
|
156
|
+
e.virtual ? (s(), r(C, { key: 1 }, [
|
|
157
|
+
g.value ? (s(), L(d(se), {
|
|
156
158
|
key: 0,
|
|
157
159
|
class: "sun-selector-options",
|
|
158
160
|
refresher: e.refresher,
|
|
159
161
|
refreshing: e.refreshing,
|
|
160
|
-
items: d(
|
|
161
|
-
"item-size":
|
|
162
|
+
items: d(b),
|
|
163
|
+
"item-size": R.value.itemSize,
|
|
162
164
|
"item-key": e.valueKey,
|
|
163
165
|
style: B({ height: e.height }),
|
|
164
166
|
onRefresh: l[5] || (l[5] = (t) => a("refresh"))
|
|
165
167
|
}, {
|
|
166
|
-
default:
|
|
168
|
+
default: E(({ item: t, index: $ }) => [
|
|
167
169
|
K(e.$slots, "option", {
|
|
168
170
|
option: t,
|
|
169
171
|
index: $,
|
|
170
172
|
active: i(t),
|
|
171
|
-
select: () =>
|
|
173
|
+
select: () => m(t)
|
|
172
174
|
}, () => [
|
|
173
175
|
c("van-cell", {
|
|
174
|
-
class:
|
|
176
|
+
class: N(["sun-selector-option", { "sun-selector-option-active": i(t) }]),
|
|
175
177
|
clickable: !0,
|
|
176
178
|
size: "large",
|
|
177
|
-
onTap: (
|
|
179
|
+
onTap: (I) => m(t)
|
|
178
180
|
}, [
|
|
179
|
-
c("slot-view", fe,
|
|
181
|
+
c("slot-view", fe, D(t[e.labelKey]), 1),
|
|
180
182
|
i(t) ? (s(), r("van-icon", me)) : u("", !0)
|
|
181
183
|
], 42, pe)
|
|
182
184
|
])
|
|
@@ -186,32 +188,32 @@ const K = I, s = M, r = A, u = G, z = H, re = J, T = Q, d = U, q = W, c = X, D =
|
|
|
186
188
|
key: 1,
|
|
187
189
|
style: B({ height: e.height })
|
|
188
190
|
}, null, 4))
|
|
189
|
-
])) : (s(),
|
|
191
|
+
], 64)) : (s(), L(d(re), {
|
|
190
192
|
key: 2,
|
|
191
193
|
class: "sun-selector-options",
|
|
192
194
|
refresher: e.refresher,
|
|
193
195
|
refreshing: e.refreshing,
|
|
194
|
-
data: d(
|
|
196
|
+
data: d(b),
|
|
195
197
|
loading: e.loading,
|
|
196
198
|
"empty-type": "search",
|
|
197
199
|
style: B({ height: e.height }),
|
|
198
200
|
onRefresh: l[6] || (l[6] = (t) => a("refresh"))
|
|
199
201
|
}, {
|
|
200
|
-
default:
|
|
201
|
-
(s(!0), r(
|
|
202
|
+
default: E(() => [
|
|
203
|
+
(s(!0), r(C, null, ie(d(b), (t, $) => K(e.$slots, "option", {
|
|
202
204
|
key: t[e.valueKey],
|
|
203
205
|
option: t,
|
|
204
206
|
index: $,
|
|
205
207
|
active: i(t),
|
|
206
|
-
select: () =>
|
|
208
|
+
select: () => m(t)
|
|
207
209
|
}, () => [
|
|
208
210
|
c("van-cell", {
|
|
209
|
-
class:
|
|
211
|
+
class: N(["sun-selector-option", { "sun-selector-option-active": i(t) }]),
|
|
210
212
|
clickable: !0,
|
|
211
213
|
size: "large",
|
|
212
|
-
onTap: (
|
|
214
|
+
onTap: (I) => m(t)
|
|
213
215
|
}, [
|
|
214
|
-
c("slot-view", ye,
|
|
216
|
+
c("slot-view", ye, D(t[e.labelKey]), 1),
|
|
215
217
|
i(t) ? (s(), r("van-icon", ge)) : u("", !0)
|
|
216
218
|
], 42, he)
|
|
217
219
|
])), 128))
|
|
@@ -223,10 +225,10 @@ const K = I, s = M, r = A, u = G, z = H, re = J, T = Q, d = U, q = W, c = X, D =
|
|
|
223
225
|
type: "primary",
|
|
224
226
|
round: "true",
|
|
225
227
|
block: "true",
|
|
226
|
-
onTap: l[7] || (l[7] = (t) =>
|
|
228
|
+
onTap: l[7] || (l[7] = (t) => j())
|
|
227
229
|
}, "确定", 32)
|
|
228
230
|
]))
|
|
229
|
-
], 40,
|
|
231
|
+
], 40, ce)
|
|
230
232
|
], 64);
|
|
231
233
|
};
|
|
232
234
|
}
|
package/index104.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
return e
|
|
1
|
+
import r from "./index89.js";
|
|
2
|
+
import i from "./index121.js";
|
|
3
|
+
function f(t, a) {
|
|
4
|
+
var e = i(t, a);
|
|
5
|
+
return r(e) ? e : void 0;
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
f as default
|
|
9
9
|
};
|
package/index105.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
return
|
|
1
|
+
import { takeUntil as e } from "rxjs";
|
|
2
|
+
import { useDestroyed as o } from "./index27.js";
|
|
3
|
+
function i() {
|
|
4
|
+
const t = o();
|
|
5
|
+
return e(t);
|
|
6
6
|
}
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
i as takeUntilDestroyed
|
|
9
9
|
};
|
package/index135.js
CHANGED
package/index16.js
CHANGED
package/index17.js
CHANGED
package/index18.js
CHANGED
package/index20.js
CHANGED
package/index21.js
CHANGED
package/index22.js
CHANGED
package/index23.js
CHANGED
package/index24.js
CHANGED
package/index26.js
CHANGED
package/index28.js
CHANGED
package/index56.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
(
|
|
1
|
+
import m from "./index57.js";
|
|
2
|
+
import t from "./index58.js";
|
|
3
|
+
function v(a, f, i, u) {
|
|
4
|
+
var d = !i;
|
|
5
|
+
i || (i = {});
|
|
6
|
+
for (var s = -1, e = f.length; ++s < e; ) {
|
|
7
|
+
var n = f[s], r = void 0;
|
|
8
|
+
r === void 0 && (r = a[n]), d ? t(i, n, r) : m(i, n, r);
|
|
9
|
+
}
|
|
10
|
+
return i;
|
|
7
11
|
}
|
|
8
12
|
export {
|
|
9
|
-
|
|
13
|
+
v as default
|
|
10
14
|
};
|
package/index57.js
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
writable: !0
|
|
8
|
-
}) : r[e] = t;
|
|
1
|
+
import t from "./index58.js";
|
|
2
|
+
import i from "./index29.js";
|
|
3
|
+
var s = Object.prototype, p = s.hasOwnProperty;
|
|
4
|
+
function l(r, a, o) {
|
|
5
|
+
var n = r[a];
|
|
6
|
+
(!(p.call(r, a) && i(n, o)) || o === void 0 && !(a in r)) && t(r, a, o);
|
|
9
7
|
}
|
|
10
8
|
export {
|
|
11
|
-
|
|
9
|
+
l as default
|
|
12
10
|
};
|
package/index58.js
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
return i;
|
|
1
|
+
import u from "./index61.js";
|
|
2
|
+
function i(r, e, t) {
|
|
3
|
+
e == "__proto__" && u ? u(r, e, {
|
|
4
|
+
configurable: !0,
|
|
5
|
+
enumerable: !0,
|
|
6
|
+
value: t,
|
|
7
|
+
writable: !0
|
|
8
|
+
}) : r[e] = t;
|
|
11
9
|
}
|
|
12
10
|
export {
|
|
13
|
-
|
|
11
|
+
i as default
|
|
14
12
|
};
|
package/index61.js
CHANGED
package/index63.js
CHANGED
package/index64.js
CHANGED
package/index67.js
CHANGED
package/index68.js
CHANGED
package/index8.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { isOpperDevice as
|
|
3
|
-
import { BluetoothLowEnergeDevice as
|
|
4
|
-
import { checkBluetooth as
|
|
5
|
-
import { getSystemInfo as
|
|
6
|
-
import { filter as
|
|
7
|
-
import { useObservable as
|
|
8
|
-
import
|
|
9
|
-
import { dialog as
|
|
10
|
-
import { useDestroyed as
|
|
11
|
-
const c =
|
|
1
|
+
import { defineComponent as Q, ref as I, computed as X, watch as Y, onUnmounted as Z, unref as ee, createElementVNode as oe, toDisplayString as te, vShow as ne, withDirectives as se, normalizeClass as ie, createTextVNode as re, Fragment as ce, openBlock as le, createElementBlock as ae, renderList as ue, withCtx as de, createVNode as pe } from "vue";
|
|
2
|
+
import { isOpperDevice as ve } from "@opper/core";
|
|
3
|
+
import { BluetoothLowEnergeDevice as me } from "@opper/wx";
|
|
4
|
+
import { checkBluetooth as A, bluetoothService as w, vibrator as fe, overlay as r, withLoading as we } from "@solar-taro/core";
|
|
5
|
+
import { getSystemInfo as he, openSetting as ge } from "@tarojs/taro";
|
|
6
|
+
import { filter as z, switchMap as m, combineLatest as ye, of as E, map as $, catchError as D, tap as B, timer as be, takeUntil as N, finalize as O, from as _e } from "rxjs";
|
|
7
|
+
import { useObservable as j } from "./index26.js";
|
|
8
|
+
import De from "./index6.js";
|
|
9
|
+
import { dialog as Ce } from "./index15.js";
|
|
10
|
+
import { useDestroyed as F } from "./index27.js";
|
|
11
|
+
const c = ee, t = oe, p = te, Se = ne, ke = se, U = ie, xe = re, T = ce, h = le, g = ae, Ie = ue, Ee = de, $e = pe, Be = { class: "sun-opper-controller" }, Ne = ["show"], Oe = { class: "sun-opper-controller-device" }, Te = { class: "sun-opper-controller-device-header" }, Me = { class: "sun-opper-controller-device-name" }, Pe = { class: "sun-opper-controller-device-infos" }, Re = { class: "sun-opper-controller-device-info" }, Le = { class: "color-secondary" }, Ve = { class: "sun-opper-controller-device-info" }, Ae = { class: "color-secondary" }, ze = { class: "sun-opper-controller-device-info" }, je = { class: "color-secondary" }, Fe = { class: "sun-opper-controller-device-info" }, Ue = { class: "color-secondary" }, qe = { class: "van-button-container" }, Ke = ["title", "label", "onTap"], We = { class: "van-button-container" }, Ge = ["show"], so = /* @__PURE__ */ Q({
|
|
12
12
|
__name: "index",
|
|
13
13
|
props: {
|
|
14
14
|
show: { type: Boolean, default: !1 },
|
|
@@ -17,12 +17,12 @@ const c = Z, t = ee, p = oe, ke = te, Ce = ne, F = se, Se = ie, h = re, g = ce,
|
|
|
17
17
|
opper: {}
|
|
18
18
|
},
|
|
19
19
|
emits: ["update:show", "connect", "disconnect"],
|
|
20
|
-
setup(
|
|
21
|
-
const v =
|
|
22
|
-
|
|
20
|
+
setup(q, { emit: K }) {
|
|
21
|
+
const v = q, C = K, i = v.opper, M = F(), S = F(), a = I({}), u = I(!1), P = j(() => i.connected), y = I(!1), R = X(() => Object.values(a.value)), d = j(() => i.connected.pipe(
|
|
22
|
+
z(Boolean),
|
|
23
23
|
m(() => {
|
|
24
24
|
const n = i.device;
|
|
25
|
-
return
|
|
25
|
+
return ye({
|
|
26
26
|
id: E(n.id),
|
|
27
27
|
name: n.name,
|
|
28
28
|
version: n.firmwareRevision,
|
|
@@ -36,13 +36,13 @@ const c = Z, t = ee, p = oe, ke = te, Ce = ne, F = se, Se = ie, h = re, g = ce,
|
|
|
36
36
|
serialNumber: n.serialNumber
|
|
37
37
|
});
|
|
38
38
|
})
|
|
39
|
-
), {}),
|
|
39
|
+
), {}), W = [
|
|
40
40
|
{ id: 1, name: "断开连接" },
|
|
41
41
|
{ id: 2, name: "断开连接并关机", color: "var(--color-danger)" }
|
|
42
42
|
];
|
|
43
|
-
let
|
|
43
|
+
let k = !1;
|
|
44
44
|
function x() {
|
|
45
|
-
if (!
|
|
45
|
+
if (!A()) return;
|
|
46
46
|
let n = null;
|
|
47
47
|
u.value = !0, w.openAdapter().pipe(
|
|
48
48
|
D((e) => {
|
|
@@ -59,19 +59,19 @@ const c = Z, t = ee, p = oe, ke = te, Ce = ne, F = se, Se = ie, h = re, g = ce,
|
|
|
59
59
|
),
|
|
60
60
|
B(
|
|
61
61
|
() => be(0, 1250).pipe(
|
|
62
|
-
N(
|
|
63
|
-
).subscribe(() =>
|
|
62
|
+
N(S)
|
|
63
|
+
).subscribe(() => fe.short())
|
|
64
64
|
),
|
|
65
65
|
m(() => w.devicesChange),
|
|
66
|
-
$((e) => e.filter((o) =>
|
|
66
|
+
$((e) => e.filter((o) => ve({
|
|
67
67
|
id: o.deviceId,
|
|
68
68
|
name: o.name
|
|
69
69
|
}))),
|
|
70
|
-
N(
|
|
70
|
+
N(S),
|
|
71
71
|
D((e) => {
|
|
72
72
|
var o, l, s;
|
|
73
73
|
throw e.errno === 103 ? r.modal("温馨提示", "请先授予小程序蓝牙与位置权限").then(() => {
|
|
74
|
-
|
|
74
|
+
ge();
|
|
75
75
|
}) : (l = (o = e.errMsg) == null ? void 0 : o.includes) != null && l.call(o, "permission") ? r.tips("请先授予微信蓝牙与位置权限") : (s = e.errMsg) != null && s.includes("frequently") ? r.tips("操作频繁,请稍后再试") : r.tips(e.errMsg), f(), e;
|
|
76
76
|
}),
|
|
77
77
|
O(() => {
|
|
@@ -81,15 +81,15 @@ const c = Z, t = ee, p = oe, ke = te, Ce = ne, F = se, Se = ie, h = re, g = ce,
|
|
|
81
81
|
const o = v.mac || v.deviceId;
|
|
82
82
|
if (o) {
|
|
83
83
|
const s = o.slice(-5).replace(":", ""), _ = e.find(
|
|
84
|
-
(
|
|
85
|
-
|
|
84
|
+
(V) => V.deviceId === o || // 由于 iOS 的 deviceId 不是 MAC,但是蓝牙名字上有 MAC 后四位,这里通过比对 MAC 来选择设备
|
|
85
|
+
V.name.endsWith(s)
|
|
86
86
|
);
|
|
87
87
|
if (_)
|
|
88
|
-
return
|
|
88
|
+
return b(_.deviceId);
|
|
89
89
|
}
|
|
90
90
|
if (e.length === 1) {
|
|
91
91
|
if (n != null || (n = Date.now()), Date.now() - n > 5e3)
|
|
92
|
-
return
|
|
92
|
+
return b(e[0].deviceId);
|
|
93
93
|
} else e.length > 1 && (n = null);
|
|
94
94
|
Object.keys(a.value).forEach((s) => {
|
|
95
95
|
a.value[s].recommended = !1, Date.now() - a.value[s].discoveryTime > 5e3 && delete a.value[s];
|
|
@@ -101,45 +101,45 @@ const c = Z, t = ee, p = oe, ke = te, Ce = ne, F = se, Se = ie, h = re, g = ce,
|
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
function f() {
|
|
104
|
-
|
|
104
|
+
S.next();
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
|
|
106
|
+
function b(n) {
|
|
107
|
+
k || (r.loading("正在连接"), k = !0, M.next(), i.connect(new me(n)).pipe(
|
|
108
108
|
B(() => {
|
|
109
|
-
f(),
|
|
109
|
+
f(), C("connect", n), r.success("连接成功"), setTimeout(L, 600);
|
|
110
110
|
}),
|
|
111
111
|
D((e) => {
|
|
112
112
|
throw e.errCode === 10003 ? r.tips("连接超时,请重试") : r.tips(`连接失败:${e.errCode}:${e.errMsg}`), e;
|
|
113
113
|
}),
|
|
114
|
-
O(() =>
|
|
115
|
-
m(() => i.connected.pipe(
|
|
114
|
+
O(() => k = !1),
|
|
115
|
+
m(() => i.connected.pipe(z((e) => !e))),
|
|
116
116
|
// 监听断开
|
|
117
|
-
N(
|
|
117
|
+
N(M)
|
|
118
118
|
).subscribe(() => {
|
|
119
|
-
|
|
119
|
+
C("disconnect", n), r.error("连接断开");
|
|
120
120
|
}));
|
|
121
121
|
}
|
|
122
|
-
function
|
|
123
|
-
|
|
122
|
+
function G(n) {
|
|
123
|
+
A() && (u.value = !0, w.openAdapter().pipe(
|
|
124
124
|
O(() => {
|
|
125
125
|
u.value = !1;
|
|
126
126
|
})
|
|
127
127
|
).subscribe(() => {
|
|
128
|
-
|
|
128
|
+
b(n);
|
|
129
129
|
}));
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function H() {
|
|
132
132
|
i.disconnect().pipe(
|
|
133
|
-
|
|
133
|
+
we("正在断开")
|
|
134
134
|
).subscribe();
|
|
135
135
|
}
|
|
136
|
-
function
|
|
136
|
+
function J({ detail: n }) {
|
|
137
137
|
switch (n.id) {
|
|
138
138
|
case 1:
|
|
139
|
-
|
|
139
|
+
H();
|
|
140
140
|
break;
|
|
141
141
|
case 2:
|
|
142
|
-
|
|
142
|
+
_e(Ce.confirm("温馨提示", "您确定要关闭设备电源吗?")).pipe(
|
|
143
143
|
B(() => r.loading("正在关机")),
|
|
144
144
|
m(() => i.shutdown()),
|
|
145
145
|
D(() => E(null)),
|
|
@@ -151,101 +151,101 @@ const c = Z, t = ee, p = oe, ke = te, Ce = ne, F = se, Se = ie, h = re, g = ce,
|
|
|
151
151
|
break;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
|
|
154
|
+
function L() {
|
|
155
|
+
C("update:show", !1);
|
|
156
156
|
}
|
|
157
|
-
return
|
|
157
|
+
return Y(() => v.show, async (n) => {
|
|
158
158
|
if (n) {
|
|
159
|
-
if (!
|
|
159
|
+
if (!P.value)
|
|
160
160
|
if (v.mac) {
|
|
161
|
-
const { platform: e } = await
|
|
162
|
-
e === "ios" ? x() :
|
|
161
|
+
const { platform: e } = await he();
|
|
162
|
+
e === "ios" ? x() : G(v.mac);
|
|
163
163
|
} else
|
|
164
164
|
x();
|
|
165
165
|
} else
|
|
166
166
|
u.value && f();
|
|
167
|
-
}),
|
|
167
|
+
}), Z(() => {
|
|
168
168
|
f();
|
|
169
169
|
}), (n, e) => (h(), g("view", Be, [
|
|
170
170
|
t("van-action-sheet", {
|
|
171
171
|
show: n.show,
|
|
172
172
|
title: "OPPER",
|
|
173
173
|
"close-on-click-overlay": !0,
|
|
174
|
-
onClose: e[2] || (e[2] = (o) =>
|
|
174
|
+
onClose: e[2] || (e[2] = (o) => L())
|
|
175
175
|
}, [
|
|
176
|
-
c(
|
|
177
|
-
t("view",
|
|
178
|
-
t("view",
|
|
176
|
+
c(P) ? (h(), g(T, { key: 0 }, [
|
|
177
|
+
t("view", Oe, [
|
|
178
|
+
t("view", Te, [
|
|
179
179
|
e[7] || (e[7] = t("view", { class: "sun-opper-controller-device-title" }, "设备已连接", -1)),
|
|
180
|
-
t("view",
|
|
181
|
-
|
|
180
|
+
t("view", Me, [
|
|
181
|
+
xe(p(c(d).name || "OPPER") + " ", 1),
|
|
182
182
|
t("view", {
|
|
183
|
-
class:
|
|
183
|
+
class: U(c(d).charging ? "color-success" : "color-primary")
|
|
184
184
|
}, [
|
|
185
185
|
e[6] || (e[6] = t("van-icon", {
|
|
186
186
|
"class-prefix": "iconfont",
|
|
187
187
|
name: "lightning"
|
|
188
188
|
}, null, -1)),
|
|
189
|
-
|
|
190
|
-
[
|
|
189
|
+
ke(t("text", null, p(c(d).volt) + "%", 513), [
|
|
190
|
+
[Se, c(d).volt]
|
|
191
191
|
])
|
|
192
192
|
], 2)
|
|
193
193
|
])
|
|
194
194
|
]),
|
|
195
|
-
t("view",
|
|
196
|
-
t("view",
|
|
195
|
+
t("view", Pe, [
|
|
196
|
+
t("view", Re, [
|
|
197
197
|
e[8] || (e[8] = t("view", { class: "color-gray" }, "设备号", -1)),
|
|
198
|
-
t("view",
|
|
198
|
+
t("view", Le, p(c(d).id), 1)
|
|
199
199
|
]),
|
|
200
|
-
t("view",
|
|
200
|
+
t("view", Ve, [
|
|
201
201
|
e[9] || (e[9] = t("view", { class: "color-gray" }, "秤台精度", -1)),
|
|
202
|
-
t("view",
|
|
202
|
+
t("view", Ae, p(c(d).accuracy || 1) + "克", 1)
|
|
203
203
|
]),
|
|
204
|
-
t("view",
|
|
204
|
+
t("view", ze, [
|
|
205
205
|
e[10] || (e[10] = t("view", { class: "color-gray" }, "固件版本", -1)),
|
|
206
|
-
t("view",
|
|
206
|
+
t("view", je, p(c(d).version), 1)
|
|
207
207
|
]),
|
|
208
|
-
t("view",
|
|
208
|
+
t("view", Fe, [
|
|
209
209
|
e[11] || (e[11] = t("view", { class: "color-gray" }, "序列号", -1)),
|
|
210
|
-
t("view",
|
|
210
|
+
t("view", Ue, p(c(d).serialNumber), 1)
|
|
211
211
|
])
|
|
212
212
|
])
|
|
213
213
|
]),
|
|
214
|
-
t("view",
|
|
214
|
+
t("view", qe, [
|
|
215
215
|
t("van-button", {
|
|
216
216
|
type: "danger",
|
|
217
217
|
round: "true",
|
|
218
218
|
block: "true",
|
|
219
|
-
onTap: e[0] || (e[0] = (o) =>
|
|
219
|
+
onTap: e[0] || (e[0] = (o) => y.value = !0)
|
|
220
220
|
}, " 断开连接 ", 32)
|
|
221
221
|
])
|
|
222
|
-
])) : (h(), g(
|
|
223
|
-
$e(c(
|
|
222
|
+
], 64)) : (h(), g(T, { key: 1 }, [
|
|
223
|
+
$e(c(De), {
|
|
224
224
|
class: "sun-opper-controller-device-list",
|
|
225
225
|
refresher: !1,
|
|
226
|
-
data:
|
|
226
|
+
data: R.value,
|
|
227
227
|
loading: u.value,
|
|
228
228
|
"loading-text": "正在扫描",
|
|
229
229
|
"empty-type": "search",
|
|
230
230
|
"empty-text": "暂无设备"
|
|
231
231
|
}, {
|
|
232
232
|
default: Ee(() => [
|
|
233
|
-
(h(!0), g(
|
|
233
|
+
(h(!0), g(T, null, Ie(R.value, (o) => (h(), g("van-cell", {
|
|
234
234
|
key: o.deviceId,
|
|
235
235
|
title: o.name,
|
|
236
236
|
label: o.deviceId,
|
|
237
237
|
size: "large",
|
|
238
238
|
clickable: !0,
|
|
239
|
-
onTap: (l) =>
|
|
239
|
+
onTap: (l) => b(o.deviceId)
|
|
240
240
|
}, [
|
|
241
241
|
t("text", {
|
|
242
|
-
class:
|
|
242
|
+
class: U({ "color-success": o.recommended })
|
|
243
243
|
}, p(o.RSSI) + "dBm", 3)
|
|
244
|
-
], 40,
|
|
244
|
+
], 40, Ke))), 128))
|
|
245
245
|
]),
|
|
246
246
|
_: 1
|
|
247
247
|
}, 8, ["data", "loading"]),
|
|
248
|
-
t("view",
|
|
248
|
+
t("view", We, [
|
|
249
249
|
t("van-button", {
|
|
250
250
|
type: "primary",
|
|
251
251
|
round: "true",
|
|
@@ -253,19 +253,19 @@ const c = Z, t = ee, p = oe, ke = te, Ce = ne, F = se, Se = ie, h = re, g = ce,
|
|
|
253
253
|
onTap: e[1] || (e[1] = (o) => u.value ? f() : x())
|
|
254
254
|
}, p(u.value ? "停止扫描" : "扫描 OPPER 设备"), 33)
|
|
255
255
|
])
|
|
256
|
-
]))
|
|
256
|
+
], 64))
|
|
257
257
|
], 40, Ne),
|
|
258
258
|
t("van-action-sheet", {
|
|
259
|
-
show:
|
|
260
|
-
actions:
|
|
259
|
+
show: y.value,
|
|
260
|
+
actions: W,
|
|
261
261
|
"cancel-text": "取消",
|
|
262
|
-
onSelect: e[3] || (e[3] = (o) =>
|
|
263
|
-
onCancel: e[4] || (e[4] = (o) =>
|
|
264
|
-
onClose: e[5] || (e[5] = (o) =>
|
|
265
|
-
}, null, 40,
|
|
262
|
+
onSelect: e[3] || (e[3] = (o) => J(o)),
|
|
263
|
+
onCancel: e[4] || (e[4] = (o) => y.value = !1),
|
|
264
|
+
onClose: e[5] || (e[5] = (o) => y.value = !1)
|
|
265
|
+
}, null, 40, Ge)
|
|
266
266
|
]));
|
|
267
267
|
}
|
|
268
268
|
});
|
|
269
269
|
export {
|
|
270
|
-
|
|
270
|
+
so as default
|
|
271
271
|
};
|
package/index83.js
CHANGED
package/index84.js
CHANGED
package/index85.js
CHANGED
package/index86.js
CHANGED
package/index87.js
CHANGED
package/list/index.vue.d.ts
CHANGED
|
@@ -91,8 +91,8 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
91
91
|
refreshing: boolean;
|
|
92
92
|
refresher: boolean;
|
|
93
93
|
refresherBg: string;
|
|
94
|
-
flex: boolean;
|
|
95
94
|
loadingText: string;
|
|
95
|
+
flex: boolean;
|
|
96
96
|
emptyType: "search" | "default" | "error" | "network";
|
|
97
97
|
emptyText: string;
|
|
98
98
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
package/package.json
CHANGED
package/plugin.d.ts
CHANGED
package/selector/index.vue.d.ts
CHANGED
|
@@ -44,7 +44,9 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
44
44
|
height: string;
|
|
45
45
|
delimiter: string;
|
|
46
46
|
searchable: boolean;
|
|
47
|
-
}>>, {
|
|
47
|
+
}>>, {
|
|
48
|
+
present: typeof present;
|
|
49
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
48
50
|
confirm: (args_0: SelectorOption[]) => void;
|
|
49
51
|
close: () => void;
|
|
50
52
|
"update:modelValue": (args_0: unknown) => void;
|