@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 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 j, ref as w, computed as m, renderSlot as I, openBlock as M, createElementBlock as A, createCommentVNode as G, mergeProps as H, resolveDirective as J, withDirectives as Q, unref as U, toDisplayString as W, createElementVNode as X, normalizeClass as Y, normalizeStyle as Z, withCtx as x, createBlock as ee, renderList as le, Fragment as te } from "vue";
2
- import { useFilterList as oe } from "@solar-taro/core";
3
- import { SunVirtualScroll as ne } from "@solar-taro/ui-sun";
4
- import se from "./index6.js";
5
- const K = I, s = M, r = A, u = G, z = H, re = J, T = Q, d = U, q = W, c = X, D = Y, B = Z, N = x, E = ee, ae = le, L = te, ie = ["label", "value", "placeholder", "required", "disabled"], ue = ["label", "value", "placeholder", "use-right-icon-slot", "disabled"], de = ["show", "title"], ce = ["value"], ve = { key: 1 }, pe = ["onTap"], fe = {
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__ */ j({
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, { emit: F }) {
47
- const o = O, a = F, h = w(!1), y = w(!1), { keyword: C, filteredList: g } = oe(
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
- ), b = m(() => {
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
- }), k = m(() => o.modelValue && !o.required), v = m(() => o.mode === "single"), P = m(() => {
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 V() {
73
- o.disabled || (h.value = !0, y.value || setTimeout(() => {
74
- y.value = !0;
72
+ function p() {
73
+ o.disabled || (y.value = !0, g.value || setTimeout(() => {
74
+ g.value = !0;
75
75
  }, 300));
76
76
  }
77
- function p() {
78
- h.value = !1, a("close");
77
+ function f() {
78
+ y.value = !1, a("close");
79
79
  }
80
- function R() {
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), p();
84
+ a("confirm", e), f();
85
85
  }
86
- function f(e) {
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), p()) : 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);
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 S() {
91
+ function w() {
92
92
  a("clear", o.modelValue), a("update:modelValue", null);
93
93
  }
94
- return (e, l) => {
95
- const n = re("readonly");
96
- return s(), r(L, null, [
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: V,
99
- label: b.value
100
+ present: p,
101
+ label: k.value
100
102
  }, () => [
101
- e.type === "field" ? T((s(), r("van-field", z({ key: 0 }, e.$attrs, {
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: b.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) => V())
110
+ onClickInput: l[1] || (l[1] = (t) => p())
109
111
  }), [
110
- k.value ? (s(), r("van-icon", {
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) => S())
116
+ onTap: l[0] || (l[0] = (t) => w())
115
117
  }, null, 32)) : u("", !0)
116
- ], 16, ie)), [
118
+ ], 16, ue)), [
117
119
  [n]
118
- ]) : e.type === "search" ? T((s(), r("van-search", z({ key: 1 }, e.$attrs, {
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: b.value,
123
+ value: k.value,
122
124
  placeholder: e.placeholder,
123
- "use-right-icon-slot": k.value,
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) => V())
129
+ onClickInput: l[3] || (l[3] = (t) => p())
128
130
  }), [
129
- k.value ? (s(), r("van-icon", {
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) => S())
135
+ onTap: l[2] || (l[2] = (t) => w())
134
136
  }, null, 32)) : u("", !0)
135
- ], 16, ue)), [
137
+ ], 16, de)), [
136
138
  [n]
137
139
  ]) : u("", !0)
138
140
  ]),
139
141
  c("van-action-sheet", {
140
- show: h.value,
142
+ show: y.value,
141
143
  title: e.placeholder,
142
144
  "close-on-click-overlay": !0,
143
- onClose: l[8] || (l[8] = (t) => p()),
144
- onCancel: l[9] || (l[9] = (t) => p())
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(C),
152
+ value: d(S),
151
153
  placeholder: "输入关键字搜索",
152
- onChange: l[4] || (l[4] = (t) => C.value = t.detail.trim())
153
- }, null, 40, ce)) : u("", !0),
154
- e.virtual ? (s(), r("block", ve, [
155
- y.value ? (s(), E(d(ne), {
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(g),
161
- "item-size": P.value.itemSize,
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: N(({ item: t, index: $ }) => [
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: () => f(t)
173
+ select: () => m(t)
172
174
  }, () => [
173
175
  c("van-cell", {
174
- class: D(["sun-selector-option", { "sun-selector-option-active": i(t) }]),
176
+ class: N(["sun-selector-option", { "sun-selector-option-active": i(t) }]),
175
177
  clickable: !0,
176
178
  size: "large",
177
- onTap: (_) => f(t)
179
+ onTap: (I) => m(t)
178
180
  }, [
179
- c("slot-view", fe, q(t[e.labelKey]), 1),
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(), E(d(se), {
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(g),
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: N(() => [
201
- (s(!0), r(L, null, ae(d(g), (t, $) => K(e.$slots, "option", {
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: () => f(t)
208
+ select: () => m(t)
207
209
  }, () => [
208
210
  c("van-cell", {
209
- class: D(["sun-selector-option", { "sun-selector-option-active": i(t) }]),
211
+ class: N(["sun-selector-option", { "sun-selector-option-active": i(t) }]),
210
212
  clickable: !0,
211
213
  size: "large",
212
- onTap: (_) => f(t)
214
+ onTap: (I) => m(t)
213
215
  }, [
214
- c("slot-view", ye, q(t[e.labelKey]), 1),
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) => R())
228
+ onTap: l[7] || (l[7] = (t) => j())
227
229
  }, "确定", 32)
228
230
  ]))
229
- ], 40, de)
231
+ ], 40, ce)
230
232
  ], 64);
231
233
  };
232
234
  }
package/index104.js CHANGED
@@ -1,9 +1,9 @@
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);
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
- i as takeUntilDestroyed
8
+ f as default
9
9
  };
package/index105.js CHANGED
@@ -1,9 +1,9 @@
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;
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
- f as default
8
+ i as takeUntilDestroyed
9
9
  };
package/index135.js CHANGED
@@ -1,4 +1,4 @@
1
- import e from "./index105.js";
1
+ import e from "./index104.js";
2
2
  var a = e(Object, "create");
3
3
  export {
4
4
  a as default
package/index16.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index4.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 "./index5.js";
1
+ import f from "./index4.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index18.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index10.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 "./index5.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 "./index8.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index22.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index9.js";
1
+ import f from "./index7.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index23.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index3.js";
1
+ import f from "./index10.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index24.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index8.js";
1
+ import f from "./index9.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/index26.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ref as i } from "vue";
2
- import { takeUntilDestroyed as s } from "./index104.js";
2
+ import { takeUntilDestroyed as s } from "./index105.js";
3
3
  function a(e, o) {
4
4
  const t = i(o);
5
5
  return (typeof e == "function" ? e() : e).pipe(s()).subscribe((r) => {
package/index28.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import S from "./index62.js";
2
2
  import L from "./index60.js";
3
- import B from "./index56.js";
3
+ import B from "./index57.js";
4
4
  import I from "./index63.js";
5
5
  import O from "./index64.js";
6
6
  import _ from "./index65.js";
package/index56.js CHANGED
@@ -1,10 +1,14 @@
1
- import t from "./index57.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);
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
- l as default
13
+ v as default
10
14
  };
package/index57.js CHANGED
@@ -1,12 +1,10 @@
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;
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
- i as default
9
+ l as default
12
10
  };
package/index58.js CHANGED
@@ -1,14 +1,12 @@
1
- import m from "./index56.js";
2
- import t from "./index57.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;
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
- v as default
11
+ i as default
14
12
  };
package/index61.js CHANGED
@@ -1,4 +1,4 @@
1
- import r from "./index105.js";
1
+ import r from "./index104.js";
2
2
  var o = function() {
3
3
  try {
4
4
  var e = r(Object, "defineProperty");
package/index63.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index58.js";
1
+ import o from "./index56.js";
2
2
  import e from "./index50.js";
3
3
  function m(r, t) {
4
4
  return r && o(t, e(t), r);
package/index64.js CHANGED
@@ -1,4 +1,4 @@
1
- import t from "./index58.js";
1
+ import t from "./index56.js";
2
2
  import o from "./index53.js";
3
3
  function i(n, r) {
4
4
  return n && t(r, o(r), n);
package/index67.js CHANGED
@@ -1,4 +1,4 @@
1
- import m from "./index58.js";
1
+ import m from "./index56.js";
2
2
  import r from "./index112.js";
3
3
  function f(o, t) {
4
4
  return m(o, r(o), t);
package/index68.js CHANGED
@@ -1,4 +1,4 @@
1
- import m from "./index58.js";
1
+ import m from "./index56.js";
2
2
  import r from "./index103.js";
3
3
  function e(o, t) {
4
4
  return m(o, r(o), t);
package/index8.js CHANGED
@@ -1,14 +1,14 @@
1
- import { defineComponent as J, ref as I, computed as Q, watch as X, onUnmounted as Y, unref as Z, createElementVNode as ee, toDisplayString as oe, vShow as te, withDirectives as ne, normalizeClass as se, createTextVNode as ie, openBlock as re, createElementBlock as ce, renderList as le, Fragment as ae, withCtx as ue, createVNode as de } from "vue";
2
- import { isOpperDevice as pe } from "@opper/core";
3
- import { BluetoothLowEnergeDevice as ve } from "@opper/wx";
4
- import { checkBluetooth as V, bluetoothService as w, vibrator as me, overlay as r, withLoading as fe } from "@solar-taro/core";
5
- import { getSystemInfo as we, openSetting as he } from "@tarojs/taro";
6
- import { filter as A, switchMap as m, combineLatest as ge, of as E, map as $, catchError as D, tap as B, timer as be, takeUntil as N, finalize as O, from as ye } from "rxjs";
7
- import { useObservable as z } from "./index26.js";
8
- import _e from "./index6.js";
9
- import { dialog as De } from "./index15.js";
10
- import { useDestroyed as j } from "./index27.js";
11
- const c = Z, t = ee, p = oe, ke = te, Ce = ne, F = se, Se = ie, h = re, g = ce, xe = le, Ie = ae, Ee = ue, $e = de, Be = { class: "sun-opper-controller" }, Ne = ["show"], Oe = { key: 0 }, Te = { class: "sun-opper-controller-device" }, Me = { class: "sun-opper-controller-device-header" }, Pe = { class: "sun-opper-controller-device-name" }, Re = { class: "sun-opper-controller-device-infos" }, Le = { class: "sun-opper-controller-device-info" }, Ve = { class: "color-secondary" }, Ae = { class: "sun-opper-controller-device-info" }, ze = { class: "color-secondary" }, je = { class: "sun-opper-controller-device-info" }, Fe = { class: "color-secondary" }, Ue = { class: "sun-opper-controller-device-info" }, qe = { class: "color-secondary" }, Ke = { class: "van-button-container" }, We = { key: 1 }, Ge = ["title", "label", "onTap"], He = { class: "van-button-container" }, Je = ["show"], ro = /* @__PURE__ */ J({
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(U, { emit: q }) {
21
- const v = U, k = q, i = v.opper, T = j(), C = j(), a = I({}), u = I(!1), M = z(() => i.connected), b = I(!1), P = Q(() => Object.values(a.value)), d = z(() => i.connected.pipe(
22
- A(Boolean),
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 ge({
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
- ), {}), K = [
39
+ ), {}), W = [
40
40
  { id: 1, name: "断开连接" },
41
41
  { id: 2, name: "断开连接并关机", color: "var(--color-danger)" }
42
42
  ];
43
- let S = !1;
43
+ let k = !1;
44
44
  function x() {
45
- if (!V()) return;
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(C)
63
- ).subscribe(() => me.short())
62
+ N(S)
63
+ ).subscribe(() => fe.short())
64
64
  ),
65
65
  m(() => w.devicesChange),
66
- $((e) => e.filter((o) => pe({
66
+ $((e) => e.filter((o) => ve({
67
67
  id: o.deviceId,
68
68
  name: o.name
69
69
  }))),
70
- N(C),
70
+ N(S),
71
71
  D((e) => {
72
72
  var o, l, s;
73
73
  throw e.errno === 103 ? r.modal("温馨提示", "请先授予小程序蓝牙与位置权限").then(() => {
74
- he();
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
- (L) => L.deviceId === o || // 由于 iOS 的 deviceId 不是 MAC,但是蓝牙名字上有 MAC 后四位,这里通过比对 MAC 来选择设备
85
- L.name.endsWith(s)
84
+ (V) => V.deviceId === o || // 由于 iOS 的 deviceId 不是 MAC,但是蓝牙名字上有 MAC 后四位,这里通过比对 MAC 来选择设备
85
+ V.name.endsWith(s)
86
86
  );
87
87
  if (_)
88
- return y(_.deviceId);
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 y(e[0].deviceId);
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
- C.next();
104
+ S.next();
105
105
  }
106
- function y(n) {
107
- S || (r.loading("正在连接"), S = !0, T.next(), i.connect(new ve(n)).pipe(
106
+ function b(n) {
107
+ k || (r.loading("正在连接"), k = !0, M.next(), i.connect(new me(n)).pipe(
108
108
  B(() => {
109
- f(), k("connect", n), r.success("连接成功"), setTimeout(R, 600);
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(() => S = !1),
115
- m(() => i.connected.pipe(A((e) => !e))),
114
+ O(() => k = !1),
115
+ m(() => i.connected.pipe(z((e) => !e))),
116
116
  // 监听断开
117
- N(T)
117
+ N(M)
118
118
  ).subscribe(() => {
119
- k("disconnect", n), r.error("连接断开");
119
+ C("disconnect", n), r.error("连接断开");
120
120
  }));
121
121
  }
122
- function W(n) {
123
- V() && (u.value = !0, w.openAdapter().pipe(
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
- y(n);
128
+ b(n);
129
129
  }));
130
130
  }
131
- function G() {
131
+ function H() {
132
132
  i.disconnect().pipe(
133
- fe("正在断开")
133
+ we("正在断开")
134
134
  ).subscribe();
135
135
  }
136
- function H({ detail: n }) {
136
+ function J({ detail: n }) {
137
137
  switch (n.id) {
138
138
  case 1:
139
- G();
139
+ H();
140
140
  break;
141
141
  case 2:
142
- ye(De.confirm("温馨提示", "您确定要关闭设备电源吗?")).pipe(
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 R() {
155
- k("update:show", !1);
154
+ function L() {
155
+ C("update:show", !1);
156
156
  }
157
- return X(() => v.show, async (n) => {
157
+ return Y(() => v.show, async (n) => {
158
158
  if (n) {
159
- if (!M.value)
159
+ if (!P.value)
160
160
  if (v.mac) {
161
- const { platform: e } = await we();
162
- e === "ios" ? x() : W(v.mac);
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
- }), Y(() => {
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) => R())
174
+ onClose: e[2] || (e[2] = (o) => L())
175
175
  }, [
176
- c(M) ? (h(), g("block", Oe, [
177
- t("view", Te, [
178
- t("view", Me, [
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", Pe, [
181
- Se(p(c(d).name || "OPPER") + " ", 1),
180
+ t("view", Me, [
181
+ xe(p(c(d).name || "OPPER") + " ", 1),
182
182
  t("view", {
183
- class: F(c(d).charging ? "color-success" : "color-primary")
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
- Ce(t("text", null, p(c(d).volt) + "%", 513), [
190
- [ke, c(d).volt]
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", Re, [
196
- t("view", Le, [
195
+ t("view", Pe, [
196
+ t("view", Re, [
197
197
  e[8] || (e[8] = t("view", { class: "color-gray" }, "设备号", -1)),
198
- t("view", Ve, p(c(d).id), 1)
198
+ t("view", Le, p(c(d).id), 1)
199
199
  ]),
200
- t("view", Ae, [
200
+ t("view", Ve, [
201
201
  e[9] || (e[9] = t("view", { class: "color-gray" }, "秤台精度", -1)),
202
- t("view", ze, p(c(d).accuracy || 1) + "克", 1)
202
+ t("view", Ae, p(c(d).accuracy || 1) + "克", 1)
203
203
  ]),
204
- t("view", je, [
204
+ t("view", ze, [
205
205
  e[10] || (e[10] = t("view", { class: "color-gray" }, "固件版本", -1)),
206
- t("view", Fe, p(c(d).version), 1)
206
+ t("view", je, p(c(d).version), 1)
207
207
  ]),
208
- t("view", Ue, [
208
+ t("view", Fe, [
209
209
  e[11] || (e[11] = t("view", { class: "color-gray" }, "序列号", -1)),
210
- t("view", qe, p(c(d).serialNumber), 1)
210
+ t("view", Ue, p(c(d).serialNumber), 1)
211
211
  ])
212
212
  ])
213
213
  ]),
214
- t("view", Ke, [
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) => b.value = !0)
219
+ onTap: e[0] || (e[0] = (o) => y.value = !0)
220
220
  }, " 断开连接 ", 32)
221
221
  ])
222
- ])) : (h(), g("block", We, [
223
- $e(c(_e), {
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: P.value,
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(Ie, null, xe(P.value, (o) => (h(), g("van-cell", {
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) => y(o.deviceId)
239
+ onTap: (l) => b(o.deviceId)
240
240
  }, [
241
241
  t("text", {
242
- class: F({ "color-success": o.recommended })
242
+ class: U({ "color-success": o.recommended })
243
243
  }, p(o.RSSI) + "dBm", 3)
244
- ], 40, Ge))), 128))
244
+ ], 40, Ke))), 128))
245
245
  ]),
246
246
  _: 1
247
247
  }, 8, ["data", "loading"]),
248
- t("view", He, [
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: b.value,
260
- actions: K,
259
+ show: y.value,
260
+ actions: W,
261
261
  "cancel-text": "取消",
262
- onSelect: e[3] || (e[3] = (o) => H(o)),
263
- onCancel: e[4] || (e[4] = (o) => b.value = !1),
264
- onClose: e[5] || (e[5] = (o) => b.value = !1)
265
- }, null, 40, Je)
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
- ro as default
270
+ so as default
271
271
  };
package/index83.js CHANGED
@@ -1,4 +1,4 @@
1
- import t from "./index105.js";
1
+ import t from "./index104.js";
2
2
  import a from "./index38.js";
3
3
  var e = t(a, "DataView");
4
4
  export {
package/index84.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index105.js";
1
+ import o from "./index104.js";
2
2
  import r from "./index38.js";
3
3
  var p = o(r, "Map");
4
4
  export {
package/index85.js CHANGED
@@ -1,4 +1,4 @@
1
- import o from "./index105.js";
1
+ import o from "./index104.js";
2
2
  import r from "./index38.js";
3
3
  var m = o(r, "Promise");
4
4
  export {
package/index86.js CHANGED
@@ -1,4 +1,4 @@
1
- import t from "./index105.js";
1
+ import t from "./index104.js";
2
2
  import o from "./index38.js";
3
3
  var a = t(o, "Set");
4
4
  export {
package/index87.js CHANGED
@@ -1,4 +1,4 @@
1
- import a from "./index105.js";
1
+ import a from "./index104.js";
2
2
  import o from "./index38.js";
3
3
  var e = a(o, "WeakMap");
4
4
  export {
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solar-taro/ui-vant",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
package/plugin.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Plugin } from 'vue';
2
2
 
3
3
  /**
4
- * sun-core vue plugin
4
+ * solar vant ui vue plugin
5
5
  *
6
6
  * Directives:
7
7
  * - `v-readonly`: https://github.com/NervJS/taro/issues/10337#issuecomment-989641124
@@ -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
- }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
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;