focusin-mini-ui 1.0.0 → 1.0.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.
@@ -1,265 +1,85 @@
1
- import { defineComponent as _, openBlock as m, createElementBlock as v, normalizeClass as $, toDisplayString as G, Fragment as Y, renderList as Z, unref as I, createBlock as T, ref as k, watch as O, resolveComponent as E, createElementVNode as p, renderSlot as A, withDirectives as M, createVNode as x, vShow as F, normalizeStyle as z, pushScopeId as ee, popScopeId as te, computed as oe, createCommentVNode as ne } from "vue";
2
- const D = "common-button", se = /* @__PURE__ */ _({
3
- __name: "sButton",
4
- props: {
5
- option: {}
6
- },
7
- setup(t) {
8
- const { mode: i, onClick: o } = inject(D), { option: s } = t, n = () => {
9
- console.log("onClick"), o(i, s);
10
- };
11
- return (c, l) => (m(), v("view", {
12
- class: $(["button-item w-full", { active: c.option.isActive }]),
13
- onTap: n
14
- }, G(c.option.label), 35));
15
- }
16
- });
17
- const y = (t, i) => {
18
- const o = t.__vccOpts || t;
19
- for (const [s, n] of i)
20
- o[s] = n;
21
- return o;
22
- }, ae = /* @__PURE__ */ y(se, [["__scopeId", "data-v-3e8a5cc8"]]), ie = { class: "common-button grid grid-cols-3" }, le = /* @__PURE__ */ _({
23
- __name: "index",
24
- props: {
25
- mode: { default: "single" },
26
- options: { default: () => [] },
27
- modelValue: {}
28
- },
29
- emits: ["update:modelValue"],
30
- setup(t, { emit: i }) {
31
- const o = t, s = i, n = ref(
32
- o.options.map((l) => ({ ...l, isActive: !1 }))
33
- ), c = (l, d) => {
34
- if (console.log("onClick"), l === "single") {
35
- n.value.forEach((r) => {
36
- r.value === d.value ? r.isActive = !r.isActive : r.isActive = !1;
37
- });
38
- const a = n.value.find((r) => r.isActive);
39
- a ? s("update:modelValue", a.value) : s("update:modelValue", null);
40
- } else {
41
- n.value.forEach((r) => {
42
- r.value === d.value && (r.isActive = !r.isActive);
43
- });
44
- const a = n.value.filter((r) => r.isActive);
45
- s(
46
- "update:modelValue",
47
- a.map((r) => r.value)
48
- );
49
- }
50
- };
51
- return provide(D, {
52
- mode: o.mode,
53
- onClick: c
54
- }), watch(
55
- () => o.options,
56
- () => {
57
- n.value = o.options.map((l) => ({ ...l, isActive: !1 })), console.log(o.modelValue);
58
- },
59
- {
60
- deep: !0
61
- }
62
- ), watch(
63
- () => o.modelValue,
64
- (l, d) => {
65
- console.log("props.modelValue", l, d, n.value), o.mode === "single" ? n.value.forEach((a) => {
66
- a.value === l ? a.isActive = !0 : a.isActive = !1;
67
- }) : Array.isArray(l) && n.value.forEach((a) => {
68
- l.includes(a.value) ? a.isActive = !0 : a.isActive = !1;
69
- });
70
- },
71
- {
72
- immediate: !0
73
- }
74
- ), (l, d) => (m(), v("view", ie, [
75
- (m(!0), v(Y, null, Z(I(n), (a) => (m(), T(ae, {
76
- key: a.value,
77
- option: a
78
- }, null, 8, ["option"]))), 128))
79
- ]));
80
- }
81
- });
82
- const j = /* @__PURE__ */ y(le, [["__scopeId", "data-v-ee7334b9"]]), re = (t) => (ee("data-v-60a05d39"), t = t(), te(), t), ce = /* @__PURE__ */ re(() => /* @__PURE__ */ p("div", { class: "hr" }, null, -1)), de = { class: "titleCenter" }, ue = { class: "icon" }, pe = /* @__PURE__ */ _({
83
- __name: "index",
84
- props: {
85
- title: {
86
- type: String,
87
- default: ""
88
- },
89
- fold: {
90
- type: Boolean,
91
- default: !0
92
- },
93
- isFold: {
94
- type: Boolean,
95
- default: !0
96
- },
97
- hasPadding: {
98
- type: Boolean,
99
- default: !1
100
- },
101
- contentStyle: {
102
- type: Object,
103
- default: () => ({})
104
- }
105
- },
106
- setup(t) {
107
- const i = t, o = k(!0);
108
- O(
109
- () => i.isFold,
110
- (n) => {
111
- o.value = n;
112
- },
113
- {
114
- immediate: !0,
115
- deep: !0
116
- }
117
- );
118
- const s = () => {
119
- o.value = !o.value;
120
- };
121
- return (n, c) => {
122
- const l = E("wd-icon");
123
- return m(), v("div", {
124
- class: $(["zCard", { isOpen: o.value, "has-padding": t.hasPadding }])
125
- }, [
126
- p("div", {
127
- class: $(["title", { "has-padding": !t.hasPadding }]),
128
- onClick: s
129
- }, [
130
- ce,
131
- p("p", null, G(t.title), 1),
132
- p("div", de, [
133
- A(n.$slots, "titleCenter", {}, void 0, !0)
134
- ]),
135
- A(n.$slots, "right", {}, void 0, !0),
136
- M(p("div", ue, [
137
- x(l, {
138
- name: "arrow-up",
139
- color: "rgba(145, 152, 170, 1)",
140
- size: "18px"
141
- })
142
- ], 512), [
143
- [F, t.fold]
144
- ])
145
- ], 2),
146
- M(p("div", {
147
- class: "content",
148
- style: z(t.contentStyle)
149
- }, [
150
- A(n.$slots, "default", {}, void 0, !0)
151
- ], 4), [
152
- [F, o.value]
153
- ])
154
- ], 2);
155
- };
156
- }
157
- });
158
- const L = /* @__PURE__ */ y(pe, [["__scopeId", "data-v-60a05d39"]]), me = /* @__PURE__ */ _({
159
- __name: "index",
160
- props: {
161
- tip: {
162
- type: String,
163
- default: "暂无内容"
164
- }
165
- },
166
- setup(t) {
167
- const i = {}.VITE_BASE_OSS + "login/empty.svg", o = t, s = computed(() => o.tip);
168
- return (n, c) => {
169
- const l = E("wd-status-tip");
170
- return m(), T(l, {
171
- class: "common-empty",
172
- "image-size": {
173
- height: "320rpx",
174
- width: "320rpx"
175
- },
176
- image: i,
177
- tip: I(s)
178
- }, null, 8, ["tip"]);
179
- };
180
- }
181
- });
182
- const N = /* @__PURE__ */ y(me, [["__scopeId", "data-v-cf5f4d86"]]), V = (t) => t != null;
183
- function fe(t, i, o = {}) {
184
- let s = null, n, c, l;
185
- const d = V(o.leading) ? o.leading : !1, a = V(o.trailing) ? o.trailing : !0;
186
- function r() {
187
- n !== void 0 && (l = t.apply(c, n), n = void 0);
1
+ import { defineComponent as D, ref as k, computed as L, watch as N, resolveComponent as O, openBlock as S, createElementBlock as P, normalizeStyle as _, normalizeClass as R, unref as z, createElementVNode as C, createBlock as V, createCommentVNode as j, renderSlot as q } from "vue";
2
+ const T = (n) => n != null;
3
+ function H(n, s, t = {}) {
4
+ let o = null, a, u, d;
5
+ const c = T(t.leading) ? t.leading : !1, r = T(t.trailing) ? t.trailing : !0;
6
+ function g() {
7
+ a !== void 0 && (d = n.apply(u, a), a = void 0);
188
8
  }
189
- function b() {
190
- s = setTimeout(() => {
191
- s = null, a && r();
192
- }, i);
9
+ function m() {
10
+ o = setTimeout(() => {
11
+ o = null, r && g();
12
+ }, s);
193
13
  }
194
- function w() {
195
- s !== null && (clearTimeout(s), s = null);
14
+ function h() {
15
+ o !== null && (clearTimeout(o), o = null);
196
16
  }
197
- function P(...S) {
198
- return n = S, c = this, s === null ? (d && r(), b()) : a && (w(), b()), l;
17
+ function y(...v) {
18
+ return a = v, u = this, o === null ? (c && g(), m()) : r && (h(), m()), d;
199
19
  }
200
- return P;
20
+ return y;
201
21
  }
202
- const C = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"], U = (t) => t.replace(/[+/]/g, (i) => i === "+" ? "-" : "_").replace(/=+\$/m, ""), ge = (t, i = !1) => {
203
- let o = "";
204
- for (let s = 0, n = t.length; s < n; s += 3) {
205
- const [c, l, d] = [t[s], t[s + 1], t[s + 2]], a = c << 16 | l << 8 | d;
206
- o += C[a >>> 18], o += C[a >>> 12 & 63], o += typeof l < "u" ? C[a >>> 6 & 63] : "=", o += typeof d < "u" ? C[a & 63] : "=";
22
+ const b = [..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"], A = (n) => n.replace(/[+/]/g, (s) => s === "+" ? "-" : "_").replace(/=+\$/m, ""), J = (n, s = !1) => {
23
+ let t = "";
24
+ for (let o = 0, a = n.length; o < a; o += 3) {
25
+ const [u, d, c] = [n[o], n[o + 1], n[o + 2]], r = u << 16 | d << 8 | c;
26
+ t += b[r >>> 18], t += b[r >>> 12 & 63], t += typeof d < "u" ? b[r >>> 6 & 63] : "=", t += typeof c < "u" ? b[r & 63] : "=";
207
27
  }
208
- return i ? U(o) : o;
209
- }, ve = typeof btoa == "function" ? (t) => btoa(t) : (t) => {
210
- if (t.charCodeAt(0) > 255)
28
+ return s ? A(t) : t;
29
+ }, K = typeof btoa == "function" ? (n) => btoa(n) : (n) => {
30
+ if (n.charCodeAt(0) > 255)
211
31
  throw new RangeError("The string contains invalid characters.");
212
- return ge(Uint8Array.from(t, (i) => i.charCodeAt(0)));
213
- }, he = (t) => unescape(encodeURIComponent(t));
214
- function _e(t, i = !1) {
215
- const o = ve(he(t));
216
- return i ? U(o) : o;
32
+ return J(Uint8Array.from(n, (s) => s.charCodeAt(0)));
33
+ }, Q = (n) => unescape(encodeURIComponent(n));
34
+ function W(n, s = !1) {
35
+ const t = K(Q(n));
36
+ return s ? A(t) : t;
217
37
  }
218
- const g = (t) => ({
38
+ const p = (n) => ({
219
39
  type: Boolean,
220
- default: t
221
- }), h = (t) => ({
40
+ default: n
41
+ }), f = (n) => ({
222
42
  type: String,
223
- default: t
224
- }), ye = {
43
+ default: n
44
+ }), X = {
225
45
  /**
226
46
  * 自定义根节点样式
227
47
  */
228
- customStyle: h(""),
48
+ customStyle: f(""),
229
49
  /**
230
50
  * 自定义根节点样式类
231
51
  */
232
- customClass: h("")
233
- }, be = {
234
- ...ye,
52
+ customClass: f("")
53
+ }, Y = {
54
+ ...X,
235
55
  /**
236
56
  * 幽灵按钮
237
57
  */
238
- plain: g(!1),
58
+ plain: p(!1),
239
59
  /**
240
60
  * 圆角按钮
241
61
  */
242
- round: g(!0),
62
+ round: p(!0),
243
63
  /**
244
64
  * 禁用按钮
245
65
  */
246
- disabled: g(!1),
66
+ disabled: p(!1),
247
67
  /**
248
68
  * 是否细边框
249
69
  */
250
- hairline: g(!1),
70
+ hairline: p(!1),
251
71
  /**
252
72
  * 块状按钮
253
73
  */
254
- block: g(!1),
74
+ block: p(!1),
255
75
  /**
256
76
  * 按钮类型,可选值:primary / success / info / warning / error / text / icon
257
77
  */
258
- type: h("primary"),
78
+ type: f("primary"),
259
79
  /**
260
80
  * 按钮尺寸,可选值:small / medium / large
261
81
  */
262
- size: h("medium"),
82
+ size: f("medium"),
263
83
  /**
264
84
  * 图标类名
265
85
  */
@@ -267,11 +87,11 @@ const g = (t) => ({
267
87
  /**
268
88
  * 类名前缀,用于使用自定义图标,用法参考Icon组件
269
89
  */
270
- classPrefix: h("wd-icon"),
90
+ classPrefix: f("wd-icon"),
271
91
  /**
272
92
  * 加载中按钮
273
93
  */
274
- loading: g(!1),
94
+ loading: p(!1),
275
95
  /**
276
96
  * 加载图标颜色
277
97
  */
@@ -321,12 +141,12 @@ const g = (t) => ({
321
141
  * 可选值:'phoneNumber' | 'userInfo'
322
142
  */
323
143
  scope: String
324
- }, we = ["id", "hover-class", "hover-start-time", "hover-stay-time", "open-type", "send-message-title", "send-message-path", "send-message-img", "app-parameter", "show-message-card", "session-from", "lang", "hover-stop-propagation", "scope"], Se = { class: "wd-button__content" }, Ce = {
144
+ }, Z = ["id", "hover-class", "hover-start-time", "hover-stay-time", "open-type", "send-message-title", "send-message-path", "send-message-img", "app-parameter", "show-message-card", "session-from", "lang", "hover-stop-propagation", "scope"], x = { class: "wd-button__content" }, ee = {
325
145
  key: 0,
326
146
  class: "wd-button__loading"
327
- }, ke = { class: "wd-button__text" }, Ae = /* @__PURE__ */ _({
147
+ }, ne = { class: "wd-button__text" }, oe = /* @__PURE__ */ D({
328
148
  __name: "index",
329
- props: be,
149
+ props: Y,
330
150
  emits: [
331
151
  "click",
332
152
  "getuserinfo",
@@ -338,81 +158,81 @@ const g = (t) => ({
338
158
  "chooseavatar",
339
159
  "agreeprivacyauthorization"
340
160
  ],
341
- setup(t, { emit: i }) {
342
- const o = (e = "#4D80F0", f = !0) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="a"><stop stop-color="${f ? e : "#fff"}" offset="0%" stop-opacity="0"/><stop stop-color="${f ? e : "#fff"}" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z" fill="${f ? "#fff" : e}"/><path d="M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376" stroke="url(#a)" stroke-width="3.5" stroke-linecap="round"/></g></svg>`, s = t, n = i;
343
- console.log("customClass value:", s.customClass);
344
- const c = k(20), l = k(70), d = k(""), a = oe(() => `background-image: url(${d.value});`);
345
- O(
346
- () => s.loading,
161
+ setup(n, { emit: s }) {
162
+ const t = (e = "#4D80F0", l = !0) => `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="a"><stop stop-color="${l ? e : "#fff"}" offset="0%" stop-opacity="0"/><stop stop-color="${l ? e : "#fff"}" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z" fill="${l ? "#fff" : e}"/><path d="M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376" stroke="url(#a)" stroke-width="3.5" stroke-linecap="round"/></g></svg>`, o = n, a = s;
163
+ console.log("customClass value:", o.customClass);
164
+ const u = k(20), d = k(70), c = k(""), r = L(() => `background-image: url(${c.value});`);
165
+ N(
166
+ () => o.loading,
347
167
  () => {
348
- Q();
168
+ F();
349
169
  },
350
170
  { deep: !0, immediate: !0 }
351
171
  );
352
- const r = fe((e) => {
353
- !s.disabled && !s.loading && n("click", e);
172
+ const g = H((e) => {
173
+ !o.disabled && !o.loading && a("click", e);
354
174
  }, 1e3, { leading: !0, trailing: !1 });
355
- function b(e) {
356
- s.scope === "phoneNumber" ? S(e) : s.scope === "userInfo" && w(e);
175
+ function m(e) {
176
+ o.scope === "phoneNumber" ? v(e) : o.scope === "userInfo" && h(e);
357
177
  }
358
- function w(e) {
359
- n("getuserinfo", e.detail);
178
+ function h(e) {
179
+ a("getuserinfo", e.detail);
360
180
  }
361
- function P(e) {
362
- n("contact", e.detail);
181
+ function y(e) {
182
+ a("contact", e.detail);
363
183
  }
364
- function S(e) {
365
- n("getphonenumber", e.detail);
184
+ function v(e) {
185
+ a("getphonenumber", e.detail);
366
186
  }
367
- function R(e) {
368
- n("error", e.detail);
187
+ function M(e) {
188
+ a("error", e.detail);
369
189
  }
370
- function W(e) {
371
- n("launchapp", e.detail);
190
+ function B(e) {
191
+ a("launchapp", e.detail);
372
192
  }
373
- function q(e) {
374
- n("opensetting", e.detail);
193
+ function $(e) {
194
+ a("opensetting", e.detail);
375
195
  }
376
- function H(e) {
377
- n("chooseavatar", e.detail);
196
+ function G(e) {
197
+ a("chooseavatar", e.detail);
378
198
  }
379
- function J(e) {
380
- n("agreeprivacyauthorization", e.detail);
199
+ function E(e) {
200
+ a("agreeprivacyauthorization", e.detail);
381
201
  }
382
- function Q() {
383
- const { loadingColor: e, type: f, plain: B } = s;
384
- let u = e;
385
- if (!u)
386
- switch (f) {
202
+ function F() {
203
+ const { loadingColor: e, type: l, plain: w } = o;
204
+ let i = e;
205
+ if (!i)
206
+ switch (l) {
387
207
  case "primary":
388
- u = "#4D80F0";
208
+ i = "#4D80F0";
389
209
  break;
390
210
  case "success":
391
- u = "#34d19d";
211
+ i = "#34d19d";
392
212
  break;
393
213
  case "info":
394
- u = "#333";
214
+ i = "#333";
395
215
  break;
396
216
  case "warning":
397
- u = "#f0883a";
217
+ i = "#f0883a";
398
218
  break;
399
219
  case "error":
400
- u = "#fa4350";
220
+ i = "#fa4350";
401
221
  break;
402
222
  case "default":
403
- u = "#333";
223
+ i = "#333";
404
224
  break;
405
225
  }
406
- const X = o(u, !B);
407
- d.value = `"data:image/svg+xml;base64,${_e(X)}"`;
226
+ const U = t(i, !w);
227
+ c.value = `"data:image/svg+xml;base64,${W(U)}"`;
408
228
  }
409
- return (e, f) => {
410
- const B = E("wd-icon");
411
- return m(), v("button", {
229
+ return (e, l) => {
230
+ const w = O("wd-icon");
231
+ return S(), P("button", {
412
232
  id: e.buttonId,
413
233
  "hover-class": `${e.disabled || e.loading ? "" : "wd-button--active"}`,
414
- style: z(e.customStyle),
415
- class: $([
234
+ style: _(e.customStyle),
235
+ class: R([
416
236
  "wd-button",
417
237
  `is-${e.type}`,
418
238
  `is-${e.size}`,
@@ -426,8 +246,8 @@ const g = (t) => ({
426
246
  },
427
247
  e.customClass
428
248
  ]),
429
- "hover-start-time": c.value,
430
- "hover-stay-time": l.value,
249
+ "hover-start-time": u.value,
250
+ "hover-stay-time": d.value,
431
251
  "open-type": e.disabled || e.loading ? void 0 : e.openType,
432
252
  "send-message-title": e.sendMessageTitle,
433
253
  "send-message-path": e.sendMessagePath,
@@ -438,53 +258,52 @@ const g = (t) => ({
438
258
  lang: e.lang,
439
259
  "hover-stop-propagation": e.hoverStopPropagation,
440
260
  scope: e.scope,
441
- onClick: f[0] || (f[0] = //@ts-ignore
442
- (...u) => I(r) && I(r)(...u)),
443
- "on:getAuthorize": b,
444
- onGetuserinfo: w,
445
- onContact: P,
446
- onGetphonenumber: S,
447
- onError: R,
448
- onLaunchapp: W,
449
- onOpensetting: q,
450
- onChooseavatar: H,
451
- onAgreeprivacyauthorization: J
261
+ onClick: l[0] || (l[0] = //@ts-ignore
262
+ (...i) => z(g) && z(g)(...i)),
263
+ "on:getAuthorize": m,
264
+ onGetuserinfo: h,
265
+ onContact: y,
266
+ onGetphonenumber: v,
267
+ onError: M,
268
+ onLaunchapp: B,
269
+ onOpensetting: $,
270
+ onChooseavatar: G,
271
+ onAgreeprivacyauthorization: E
452
272
  }, [
453
- p("view", Se, [
454
- e.loading ? (m(), v("view", Ce, [
455
- p("view", {
273
+ C("view", x, [
274
+ e.loading ? (S(), P("view", ee, [
275
+ C("view", {
456
276
  class: "wd-button__loading-svg",
457
- style: z(a.value)
277
+ style: _(r.value)
458
278
  }, null, 4)
459
- ])) : e.icon ? (m(), T(B, {
279
+ ])) : e.icon ? (S(), V(w, {
460
280
  key: 1,
461
281
  "custom-class": "wd-button__icon",
462
282
  name: e.icon,
463
283
  classPrefix: e.classPrefix
464
- }, null, 8, ["name", "classPrefix"])) : ne("", !0),
465
- p("view", ke, [
466
- A(e.$slots, "default", {}, void 0, !0)
284
+ }, null, 8, ["name", "classPrefix"])) : j("", !0),
285
+ C("view", ne, [
286
+ q(e.$slots, "default", {}, void 0, !0)
467
287
  ])
468
288
  ])
469
- ], 46, we);
289
+ ], 46, Z);
470
290
  };
471
291
  }
472
292
  });
473
- const K = /* @__PURE__ */ y(Ae, [["__scopeId", "data-v-bec91f45"]]), $e = [j, L, N, K], Ie = (t) => {
474
- $e.forEach((i) => {
475
- t.component(i.name, i);
293
+ const te = (n, s) => {
294
+ const t = n.__vccOpts || n;
295
+ for (const [o, a] of s)
296
+ t[o] = a;
297
+ return t;
298
+ }, I = /* @__PURE__ */ te(oe, [["__scopeId", "data-v-1e123813"]]), ae = [I], se = (n) => {
299
+ ae.forEach((s) => {
300
+ n.component(s.name, s);
476
301
  });
477
- }, Be = {
478
- install: Ie,
479
- CommonButton: j,
480
- CommonCollapse: L,
481
- CommonEmpty: N,
482
- CommonWdButton: K
302
+ }, re = {
303
+ install: se,
304
+ FsButton: I
483
305
  };
484
306
  export {
485
- j as CommonButton,
486
- L as CommonCollapse,
487
- N as CommonEmpty,
488
- K as CommonWdButton,
489
- Be as default
307
+ I as FsButton,
308
+ re as default
490
309
  };
@@ -1 +1 @@
1
- (function(u,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(u=typeof globalThis<"u"?globalThis:u||self,e(u.FocusinMiniUi={},u.Vue))})(this,function(u,e){"use strict";function ie(o){return o}const I="common-button",$=e.defineComponent({__name:"sButton",props:{option:{}},setup(o){const{mode:l,onClick:n}=inject(I),{option:a}=o,s=()=>{console.log("onClick"),n(l,a)};return(d,r)=>(e.openBlock(),e.createElementBlock("view",{class:e.normalizeClass(["button-item w-full",{active:d.option.isActive}]),onTap:s},e.toDisplayString(d.option.label),35))}}),le="",h=(o,l)=>{const n=o.__vccOpts||o;for(const[a,s]of l)n[a]=s;return n},V=h($,[["__scopeId","data-v-3e8a5cc8"]]),T={class:"common-button grid grid-cols-3"},M=e.defineComponent({__name:"index",props:{mode:{default:"single"},options:{default:()=>[]},modelValue:{}},emits:["update:modelValue"],setup(o,{emit:l}){const n=o,a=l,s=ref(n.options.map(r=>({...r,isActive:!1}))),d=(r,p)=>{if(console.log("onClick"),r==="single"){s.value.forEach(c=>{c.value===p.value?c.isActive=!c.isActive:c.isActive=!1});const i=s.value.find(c=>c.isActive);i?a("update:modelValue",i.value):a("update:modelValue",null)}else{s.value.forEach(c=>{c.value===p.value&&(c.isActive=!c.isActive)});const i=s.value.filter(c=>c.isActive);a("update:modelValue",i.map(c=>c.value))}};return provide(I,{mode:n.mode,onClick:d}),watch(()=>n.options,()=>{s.value=n.options.map(r=>({...r,isActive:!1})),console.log(n.modelValue)},{deep:!0}),watch(()=>n.modelValue,(r,p)=>{console.log("props.modelValue",r,p,s.value),n.mode==="single"?s.value.forEach(i=>{i.value===r?i.isActive=!0:i.isActive=!1}):Array.isArray(r)&&s.value.forEach(i=>{r.includes(i.value)?i.isActive=!0:i.isActive=!1})},{immediate:!0}),(r,p)=>(e.openBlock(),e.createElementBlock("view",T,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(s),i=>(e.openBlock(),e.createBlock(V,{key:i.value,option:i},null,8,["option"]))),128))]))}}),re="",k=h(M,[["__scopeId","data-v-ee7334b9"]]),N=(o=>(e.pushScopeId("data-v-60a05d39"),o=o(),e.popScopeId(),o))(()=>e.createElementVNode("div",{class:"hr"},null,-1)),F={class:"titleCenter"},O={class:"icon"},D=e.defineComponent({__name:"index",props:{title:{type:String,default:""},fold:{type:Boolean,default:!0},isFold:{type:Boolean,default:!0},hasPadding:{type:Boolean,default:!1},contentStyle:{type:Object,default:()=>({})}},setup(o){const l=o,n=e.ref(!0);e.watch(()=>l.isFold,s=>{n.value=s},{immediate:!0,deep:!0});const a=()=>{n.value=!n.value};return(s,d)=>{const r=e.resolveComponent("wd-icon");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["zCard",{isOpen:n.value,"has-padding":o.hasPadding}])},[e.createElementVNode("div",{class:e.normalizeClass(["title",{"has-padding":!o.hasPadding}]),onClick:a},[N,e.createElementVNode("p",null,e.toDisplayString(o.title),1),e.createElementVNode("div",F,[e.renderSlot(s.$slots,"titleCenter",{},void 0,!0)]),e.renderSlot(s.$slots,"right",{},void 0,!0),e.withDirectives(e.createElementVNode("div",O,[e.createVNode(r,{name:"arrow-up",color:"rgba(145, 152, 170, 1)",size:"18px"})],512),[[e.vShow,o.fold]])],2),e.withDirectives(e.createElementVNode("div",{class:"content",style:e.normalizeStyle(o.contentStyle)},[e.renderSlot(s.$slots,"default",{},void 0,!0)],4),[[e.vShow,n.value]])],2)}}}),de="",S=h(D,[["__scopeId","data-v-60a05d39"]]),G=e.defineComponent({__name:"index",props:{tip:{type:String,default:"暂无内容"}},setup(o){const l={}.VITE_BASE_OSS+"login/empty.svg",n=o,a=computed(()=>n.tip);return(s,d)=>{const r=e.resolveComponent("wd-status-tip");return e.openBlock(),e.createBlock(r,{class:"common-empty","image-size":{height:"320rpx",width:"320rpx"},image:l,tip:e.unref(a)},null,8,["tip"])}}}),pe="",w=h(G,[["__scopeId","data-v-cf5f4d86"]]),z=o=>o!=null;function j(o,l,n={}){let a=null,s,d,r;const p=z(n.leading)?n.leading:!1,i=z(n.trailing)?n.trailing:!0;function c(){s!==void 0&&(r=o.apply(d,s),s=void 0)}function b(){a=setTimeout(()=>{a=null,i&&c()},l)}function v(){a!==null&&(clearTimeout(a),a=null)}function A(...C){return s=C,d=this,a===null?(p&&c(),b()):i&&(v(),b()),r}return A}const y=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],P=o=>o.replace(/[+/]/g,l=>l==="+"?"-":"_").replace(/=+\$/m,""),U=(o,l=!1)=>{let n="";for(let a=0,s=o.length;a<s;a+=3){const[d,r,p]=[o[a],o[a+1],o[a+2]],i=d<<16|r<<8|p;n+=y[i>>>18],n+=y[i>>>12&63],n+=typeof r<"u"?y[i>>>6&63]:"=",n+=typeof p<"u"?y[i&63]:"="}return l?P(n):n},L=typeof btoa=="function"?o=>btoa(o):o=>{if(o.charCodeAt(0)>255)throw new RangeError("The string contains invalid characters.");return U(Uint8Array.from(o,l=>l.charCodeAt(0)))},K=o=>unescape(encodeURIComponent(o));function R(o,l=!1){const n=L(K(o));return l?P(n):n}const g=o=>({type:Boolean,default:o}),_=o=>({type:String,default:o}),W={...{customStyle:_(""),customClass:_("")},plain:g(!1),round:g(!0),disabled:g(!1),hairline:g(!1),block:g(!1),type:_("primary"),size:_("medium"),icon:String,classPrefix:_("wd-icon"),loading:g(!1),loadingColor:String,openType:String,hoverStopPropagation:Boolean,lang:String,sessionFrom:String,sendMessageTitle:String,sendMessagePath:String,sendMessageImg:String,appParameter:String,showMessageCard:Boolean,buttonId:String,scope:String},q=["id","hover-class","hover-start-time","hover-stay-time","open-type","send-message-title","send-message-path","send-message-img","app-parameter","show-message-card","session-from","lang","hover-stop-propagation","scope"],H={class:"wd-button__content"},J={key:0,class:"wd-button__loading"},Q={class:"wd-button__text"},X=e.defineComponent({__name:"index",props:W,emits:["click","getuserinfo","contact","getphonenumber","error","launchapp","opensetting","chooseavatar","agreeprivacyauthorization"],setup(o,{emit:l}){const n=(t="#4D80F0",f=!0)=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="a"><stop stop-color="${f?t:"#fff"}" offset="0%" stop-opacity="0"/><stop stop-color="${f?t:"#fff"}" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z" fill="${f?"#fff":t}"/><path d="M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376" stroke="url(#a)" stroke-width="3.5" stroke-linecap="round"/></g></svg>`,a=o,s=l;console.log("customClass value:",a.customClass);const d=e.ref(20),r=e.ref(70),p=e.ref(""),i=e.computed(()=>`background-image: url(${p.value});`);e.watch(()=>a.loading,()=>{se()},{deep:!0,immediate:!0});const c=j(t=>{!a.disabled&&!a.loading&&s("click",t)},1e3,{leading:!0,trailing:!1});function b(t){a.scope==="phoneNumber"?C(t):a.scope==="userInfo"&&v(t)}function v(t){s("getuserinfo",t.detail)}function A(t){s("contact",t.detail)}function C(t){s("getphonenumber",t.detail)}function x(t){s("error",t.detail)}function ee(t){s("launchapp",t.detail)}function te(t){s("opensetting",t.detail)}function oe(t){s("chooseavatar",t.detail)}function ne(t){s("agreeprivacyauthorization",t.detail)}function se(){const{loadingColor:t,type:f,plain:E}=a;let m=t;if(!m)switch(f){case"primary":m="#4D80F0";break;case"success":m="#34d19d";break;case"info":m="#333";break;case"warning":m="#f0883a";break;case"error":m="#fa4350";break;case"default":m="#333";break}const ae=n(m,!E);p.value=`"data:image/svg+xml;base64,${R(ae)}"`}return(t,f)=>{const E=e.resolveComponent("wd-icon");return e.openBlock(),e.createElementBlock("button",{id:t.buttonId,"hover-class":`${t.disabled||t.loading?"":"wd-button--active"}`,style:e.normalizeStyle(t.customStyle),class:e.normalizeClass(["wd-button",`is-${t.type}`,`is-${t.size}`,{"is-round":t.round,"is-hairline":t.hairline,"is-plain":t.plain,"is-disabled":t.disabled,"is-block":t.block,"is-loading":t.loading},t.customClass]),"hover-start-time":d.value,"hover-stay-time":r.value,"open-type":t.disabled||t.loading?void 0:t.openType,"send-message-title":t.sendMessageTitle,"send-message-path":t.sendMessagePath,"send-message-img":t.sendMessageImg,"app-parameter":t.appParameter,"show-message-card":t.showMessageCard,"session-from":t.sessionFrom,lang:t.lang,"hover-stop-propagation":t.hoverStopPropagation,scope:t.scope,onClick:f[0]||(f[0]=(...m)=>e.unref(c)&&e.unref(c)(...m)),"on:getAuthorize":b,onGetuserinfo:v,onContact:A,onGetphonenumber:C,onError:x,onLaunchapp:ee,onOpensetting:te,onChooseavatar:oe,onAgreeprivacyauthorization:ne},[e.createElementVNode("view",H,[t.loading?(e.openBlock(),e.createElementBlock("view",J,[e.createElementVNode("view",{class:"wd-button__loading-svg",style:e.normalizeStyle(i.value)},null,4)])):t.icon?(e.openBlock(),e.createBlock(E,{key:1,"custom-class":"wd-button__icon",name:t.icon,classPrefix:t.classPrefix},null,8,["name","classPrefix"])):e.createCommentVNode("",!0),e.createElementVNode("view",Q,[e.renderSlot(t.$slots,"default",{},void 0,!0)])])],46,q)}}}),me="",B=h(X,[["__scopeId","data-v-bec91f45"]]),Y=[k,S,w,B],Z={install:o=>{Y.forEach(l=>{o.component(l.name,l)})},CommonButton:k,CommonCollapse:S,CommonEmpty:w,CommonWdButton:B};u.CommonButton=k,u.CommonCollapse=S,u.CommonEmpty=w,u.CommonWdButton=B,u.default=Z,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(d,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(d=typeof globalThis<"u"?globalThis:d||self,o(d.FocusinMiniUi={},d.Vue))})(this,function(d,o){"use strict";const P=n=>n!=null;function T(n,i,a={}){let t=null,s,g,u;const p=P(a.leading)?a.leading:!1,l=P(a.trailing)?a.trailing:!0;function h(){s!==void 0&&(u=n.apply(g,s),s=void 0)}function y(){t=setTimeout(()=>{t=null,l&&h()},i)}function v(){t!==null&&(clearTimeout(t),t=null)}function w(...k){return s=k,g=this,t===null?(p&&h(),y()):l&&(v(),y()),u}return w}const b=[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],_=n=>n.replace(/[+/]/g,i=>i==="+"?"-":"_").replace(/=+\$/m,""),z=(n,i=!1)=>{let a="";for(let t=0,s=n.length;t<s;t+=3){const[g,u,p]=[n[t],n[t+1],n[t+2]],l=g<<16|u<<8|p;a+=b[l>>>18],a+=b[l>>>12&63],a+=typeof u<"u"?b[l>>>6&63]:"=",a+=typeof p<"u"?b[l&63]:"="}return i?_(a):a},B=typeof btoa=="function"?n=>btoa(n):n=>{if(n.charCodeAt(0)>255)throw new RangeError("The string contains invalid characters.");return z(Uint8Array.from(n,i=>i.charCodeAt(0)))},M=n=>unescape(encodeURIComponent(n));function A(n,i=!1){const a=B(M(n));return i?_(a):a}const f=n=>({type:Boolean,default:n}),m=n=>({type:String,default:n}),I={...{customStyle:m(""),customClass:m("")},plain:f(!1),round:f(!0),disabled:f(!1),hairline:f(!1),block:f(!1),type:m("primary"),size:m("medium"),icon:String,classPrefix:m("wd-icon"),loading:f(!1),loadingColor:String,openType:String,hoverStopPropagation:Boolean,lang:String,sessionFrom:String,sendMessageTitle:String,sendMessagePath:String,sendMessageImg:String,appParameter:String,showMessageCard:Boolean,buttonId:String,scope:String},E=["id","hover-class","hover-start-time","hover-stay-time","open-type","send-message-title","send-message-path","send-message-img","app-parameter","show-message-card","session-from","lang","hover-stop-propagation","scope"],$={class:"wd-button__content"},F={key:0,class:"wd-button__loading"},G={class:"wd-button__text"},N=o.defineComponent({__name:"index",props:I,emits:["click","getuserinfo","contact","getphonenumber","error","launchapp","opensetting","chooseavatar","agreeprivacyauthorization"],setup(n,{emit:i}){const a=(e="#4D80F0",c=!0)=>`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><defs><linearGradient x1="100%" y1="0%" x2="0%" y2="0%" id="a"><stop stop-color="${c?e:"#fff"}" offset="0%" stop-opacity="0"/><stop stop-color="${c?e:"#fff"}" offset="100%"/></linearGradient></defs><g fill="none" fill-rule="evenodd"><path d="M21 1c11.046 0 20 8.954 20 20s-8.954 20-20 20S1 32.046 1 21 9.954 1 21 1zm0 7C13.82 8 8 13.82 8 21s5.82 13 13 13 13-5.82 13-13S28.18 8 21 8z" fill="${c?"#fff":e}"/><path d="M4.599 21c0 9.044 7.332 16.376 16.376 16.376 9.045 0 16.376-7.332 16.376-16.376" stroke="url(#a)" stroke-width="3.5" stroke-linecap="round"/></g></svg>`,t=n,s=i;console.log("customClass value:",t.customClass);const g=o.ref(20),u=o.ref(70),p=o.ref(""),l=o.computed(()=>`background-image: url(${p.value});`);o.watch(()=>t.loading,()=>{q()},{deep:!0,immediate:!0});const h=T(e=>{!t.disabled&&!t.loading&&s("click",e)},1e3,{leading:!0,trailing:!1});function y(e){t.scope==="phoneNumber"?k(e):t.scope==="userInfo"&&v(e)}function v(e){s("getuserinfo",e.detail)}function w(e){s("contact",e.detail)}function k(e){s("getphonenumber",e.detail)}function O(e){s("error",e.detail)}function D(e){s("launchapp",e.detail)}function L(e){s("opensetting",e.detail)}function j(e){s("chooseavatar",e.detail)}function R(e){s("agreeprivacyauthorization",e.detail)}function q(){const{loadingColor:e,type:c,plain:C}=t;let r=e;if(!r)switch(c){case"primary":r="#4D80F0";break;case"success":r="#34d19d";break;case"info":r="#333";break;case"warning":r="#f0883a";break;case"error":r="#fa4350";break;case"default":r="#333";break}const H=a(r,!C);p.value=`"data:image/svg+xml;base64,${A(H)}"`}return(e,c)=>{const C=o.resolveComponent("wd-icon");return o.openBlock(),o.createElementBlock("button",{id:e.buttonId,"hover-class":`${e.disabled||e.loading?"":"wd-button--active"}`,style:o.normalizeStyle(e.customStyle),class:o.normalizeClass(["wd-button",`is-${e.type}`,`is-${e.size}`,{"is-round":e.round,"is-hairline":e.hairline,"is-plain":e.plain,"is-disabled":e.disabled,"is-block":e.block,"is-loading":e.loading},e.customClass]),"hover-start-time":g.value,"hover-stay-time":u.value,"open-type":e.disabled||e.loading?void 0:e.openType,"send-message-title":e.sendMessageTitle,"send-message-path":e.sendMessagePath,"send-message-img":e.sendMessageImg,"app-parameter":e.appParameter,"show-message-card":e.showMessageCard,"session-from":e.sessionFrom,lang:e.lang,"hover-stop-propagation":e.hoverStopPropagation,scope:e.scope,onClick:c[0]||(c[0]=(...r)=>o.unref(h)&&o.unref(h)(...r)),"on:getAuthorize":y,onGetuserinfo:v,onContact:w,onGetphonenumber:k,onError:O,onLaunchapp:D,onOpensetting:L,onChooseavatar:j,onAgreeprivacyauthorization:R},[o.createElementVNode("view",$,[e.loading?(o.openBlock(),o.createElementBlock("view",F,[o.createElementVNode("view",{class:"wd-button__loading-svg",style:o.normalizeStyle(l.value)},null,4)])):e.icon?(o.openBlock(),o.createBlock(C,{key:1,"custom-class":"wd-button__icon",name:e.icon,classPrefix:e.classPrefix},null,8,["name","classPrefix"])):o.createCommentVNode("",!0),o.createElementVNode("view",G,[o.renderSlot(e.$slots,"default",{},void 0,!0)])])],46,E)}}}),K="",S=((n,i)=>{const a=n.__vccOpts||n;for(const[t,s]of i)a[t]=s;return a})(N,[["__scopeId","data-v-1e123813"]]),U=[S],V={install:n=>{U.forEach(i=>{n.component(i.name,i)})},FsButton:S};d.FsButton=S,d.default=V,Object.defineProperties(d,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});