@solar-taro/ui-sun 3.1.0 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/_color.scss +2 -2
  3. package/card/card-content.vue.d.ts +17 -0
  4. package/card/card-header.vue.d.ts +17 -0
  5. package/card/card-subtitle.vue.d.ts +17 -0
  6. package/card/card-title.vue.d.ts +17 -0
  7. package/card/card.vue.d.ts +23 -0
  8. package/card/index.d.ts +5 -0
  9. package/card/index.scss +90 -0
  10. package/chip/index.scss +5 -0
  11. package/index.d.ts +1 -0
  12. package/index.js +56 -46
  13. package/index10.js +16 -30
  14. package/index11.js +29 -17
  15. package/index12.js +17 -79
  16. package/index13.js +80 -24
  17. package/index14.js +24 -33
  18. package/index15.js +33 -75
  19. package/index16.js +75 -19
  20. package/index17.js +19 -49
  21. package/index18.js +46 -141
  22. package/index19.js +142 -27
  23. package/index20.js +28 -74
  24. package/index21.js +86 -23
  25. package/index22.js +20 -42
  26. package/index23.js +42 -23
  27. package/index24.js +21 -9
  28. package/index25.js +10 -27
  29. package/index26.js +29 -18
  30. package/index27.js +18 -30
  31. package/index28.js +30 -119
  32. package/index29.js +118 -9
  33. package/index30.js +6 -7
  34. package/index31.js +7 -8
  35. package/index32.js +5 -6
  36. package/index33.js +8 -6
  37. package/index34.js +14 -10
  38. package/index35.js +8 -7
  39. package/index36.js +11 -2
  40. package/index37.js +11 -2
  41. package/index38.js +8 -2
  42. package/index39.js +10 -2
  43. package/index4.js +1 -1
  44. package/index40.js +10 -2
  45. package/index41.js +1 -1
  46. package/index43.js +1 -1
  47. package/index45.js +1 -1
  48. package/index46.js +1 -1
  49. package/index47.js +1 -1
  50. package/index48.js +1 -1
  51. package/index49.js +1 -1
  52. package/index5.js +11 -14
  53. package/index50.js +1 -1
  54. package/index51.js +1 -1
  55. package/index53.js +1 -1
  56. package/index54.js +1 -1
  57. package/index55.js +1 -1
  58. package/index56.js +1 -1
  59. package/index57.js +1 -1
  60. package/index58.js +1 -1
  61. package/index59.js +1 -1
  62. package/index6.js +16 -23
  63. package/index60.js +1 -1
  64. package/index61.js +1 -1
  65. package/index62.js +1 -1
  66. package/index63.js +1 -1
  67. package/index64.js +2 -3
  68. package/index65.js +2 -526
  69. package/index66.js +2 -66
  70. package/index67.js +2 -12
  71. package/index68.js +2 -25
  72. package/index69.js +2 -14
  73. package/index7.js +26 -17
  74. package/index70.js +3 -26
  75. package/index71.js +526 -2
  76. package/index72.js +63 -503
  77. package/index73.js +12 -79
  78. package/index74.js +23 -68
  79. package/index75.js +14 -69
  80. package/index76.js +24 -541
  81. package/index78.js +506 -2
  82. package/index79.js +79 -2
  83. package/index8.js +18 -17
  84. package/index80.js +69 -3
  85. package/index81.js +69 -2
  86. package/index82.js +543 -4
  87. package/index85.js +2 -2
  88. package/index86.js +3 -47
  89. package/index87.js +2 -82
  90. package/index88.js +4 -2
  91. package/index89.js +2 -2
  92. package/index9.js +13 -14
  93. package/index90.js +2 -2
  94. package/index91.js +2 -2
  95. package/index92.js +4 -0
  96. package/index93.js +50 -0
  97. package/index94.js +84 -0
  98. package/index95.js +4 -0
  99. package/index96.js +4 -0
  100. package/index97.js +4 -0
  101. package/item/index.scss +5 -2
  102. package/package.json +1 -1
  103. package/stepper/index.scss +34 -16
  104. package/stepper/index.vue.d.ts +4 -0
  105. package/toggle/index.scss +35 -23
package/index13.js CHANGED
@@ -1,30 +1,86 @@
1
- import { defineComponent as i, renderSlot as d, createElementVNode as s, openBlock as c, createElementBlock as l } from "vue";
2
- import { withPixel as t } from "@solar-kit/core";
3
- import { getNavbarRect as p } from "@solar-taro/core";
4
- const a = d, o = s, g = c, m = l, v = { class: "sun-navbar-inner" }, b = { class: "sun-navbar-center" }, k = /* @__PURE__ */ i({
1
+ import { defineComponent as c, renderSlot as m, toDisplayString as y, createTextVNode as w, unref as p, withCtx as x, openBlock as v, createBlock as B, createVNode as S, vShow as k, createElementVNode as b, withDirectives as N, mergeProps as V, createElementBlock as E } from "vue";
2
+ import { vibrator as $ } from "@solar-taro/core";
3
+ import { SunSpinner as a, SunEmpty as D } from "@solar-taro/ui-sun";
4
+ const s = m, T = y, C = w, r = p, z = x, i = v, P = B, d = S, f = k, n = b, h = N, j = V, A = E, L = ["enable-flex", "refresher-enabled", "refresher-triggered", "refresher-background"], R = {
5
+ class: "sun-list-placeholder",
6
+ style: { display: "flex", "justify-content": "center", "align-items": "center", height: "85%" }
7
+ }, q = {
8
+ class: "sun-list-loading-wrapper",
9
+ style: { "text-align": "center", padding: "6px" }
10
+ }, I = /* @__PURE__ */ c({
5
11
  __name: "index",
6
- setup(_) {
7
- const e = p(), r = {
8
- "--navbar-height": t(e.height),
9
- "--navbar-content-height": t(e.buttonHeight),
10
- "--navbar-padding-top": t(e.paddingTop),
11
- "--navbar-padding-bottom": t(e.paddingBottom),
12
- "--navbar-padding-left": t(e.paddingLeft),
13
- "--navbar-padding-right": t(e.paddingRight)
14
- };
15
- return (n, h) => (g(), m("view", {
16
- class: "sun-navbar",
17
- style: r
18
- }, [
19
- o("view", v, [
20
- a(n.$slots, "default"),
21
- o("view", b, [
22
- a(n.$slots, "center")
12
+ props: {
13
+ refreshing: {
14
+ type: Boolean,
15
+ default: !1
16
+ },
17
+ flex: {
18
+ type: Boolean,
19
+ default: !1
20
+ },
21
+ loading: {
22
+ type: Boolean,
23
+ default: !1
24
+ },
25
+ loadingText: {
26
+ type: String,
27
+ default: "Loading"
28
+ },
29
+ data: {
30
+ type: Array,
31
+ default: []
32
+ },
33
+ refresher: {
34
+ type: Boolean,
35
+ default: !0
36
+ },
37
+ refresherBg: {
38
+ type: String,
39
+ default: "transparent"
40
+ }
41
+ },
42
+ emits: ["refresh", "lower"],
43
+ setup(e, { emit: g }) {
44
+ const o = g;
45
+ return (l, t) => (i(), A("scroll-view", j(l.$attrs, {
46
+ class: "sun-list",
47
+ enhanced: !0,
48
+ "scroll-y": !0,
49
+ "lower-threshold": 300,
50
+ "enable-flex": e.flex,
51
+ "refresher-enabled": e.refresher,
52
+ "refresher-triggered": e.refreshing,
53
+ "refresher-background": e.refresherBg,
54
+ onRefresherrefresh: t[0] || (t[0] = (u) => {
55
+ r($).short("light"), o("refresh");
56
+ }),
57
+ onScrolltolower: t[1] || (t[1] = (u) => o("lower"))
58
+ }), [
59
+ s(l.$slots, "default"),
60
+ h(n("view", R, [
61
+ e.loading ? (i(), P(r(a), {
62
+ key: 0,
63
+ size: "large"
64
+ }, {
65
+ default: z(() => [
66
+ C(T(e.loadingText), 1)
67
+ ]),
68
+ _: 1
69
+ })) : s(l.$slots, "empty", { key: 1 }, () => [
70
+ d(r(D))
23
71
  ])
24
- ])
25
- ]));
72
+ ], 512), [
73
+ [f, !e.data.length]
74
+ ]),
75
+ h(n("view", q, [
76
+ d(r(a), { size: "small" })
77
+ ], 512), [
78
+ [f, e.data.length && e.loading && !e.refreshing]
79
+ ]),
80
+ t[2] || (t[2] = n("view", { style: { position: "absolute", height: "1px", width: "1px", overflow: "hidden" } }, null, -1))
81
+ ], 16, L));
26
82
  }
27
83
  });
28
84
  export {
29
- k as default
85
+ I as default
30
86
  };
package/index14.js CHANGED
@@ -1,39 +1,30 @@
1
- import { defineComponent as m, mergeModels as d, useModel as v, computed as t, renderSlot as w, createElementVNode as g, mergeProps as k, withModifiers as y, normalizeClass as $, normalizeStyle as h, openBlock as b, createElementBlock as B } from "vue";
2
- const p = w, n = g, M = k, z = y, E = $, S = h, C = b, N = B, T = /* @__PURE__ */ m({
1
+ import { defineComponent as i, renderSlot as d, createElementVNode as s, openBlock as c, createElementBlock as l } from "vue";
2
+ import { withPixel as t } from "@solar-kit/core";
3
+ import { getNavbarRect as p } from "@solar-taro/core";
4
+ const a = d, o = s, g = c, m = l, v = { class: "sun-navbar-inner" }, b = { class: "sun-navbar-center" }, k = /* @__PURE__ */ i({
3
5
  __name: "index",
4
- props: /* @__PURE__ */ d({
5
- placement: {},
6
- offset: { default: "6px" },
7
- background: { default: "rgba(0, 0, 0, 0.5)" },
8
- color: { default: "#fff" }
9
- }, {
10
- show: { type: Boolean },
11
- showModifiers: {}
12
- }),
13
- emits: ["update:show"],
14
- setup(r) {
15
- const o = r, l = v(r, "show"), a = t(() => ["left", "right"].includes(o.placement[0])), u = t(() => ["top", "bottom"].includes(o.placement[1])), f = t(() => a.value ? o.offset : "0px"), i = t(() => u.value ? o.offset : "0px");
16
- return (e, s) => (C(), N("view", {
17
- class: E(["sun-popover", [{ "sun-popover-show": l.value }, `sun-popover-x-${e.placement[0]}`, `sun-popover-y-${e.placement[1]}`]]),
18
- style: S({ "--popover-x-offset": f.value, "--popover-y-offset": i.value, "--popover-background": e.background }),
19
- onTap: z((c) => !1, ["stop"])
6
+ setup(_) {
7
+ const e = p(), r = {
8
+ "--navbar-height": t(e.height),
9
+ "--navbar-content-height": t(e.buttonHeight),
10
+ "--navbar-padding-top": t(e.paddingTop),
11
+ "--navbar-padding-bottom": t(e.paddingBottom),
12
+ "--navbar-padding-left": t(e.paddingLeft),
13
+ "--navbar-padding-right": t(e.paddingRight)
14
+ };
15
+ return (n, h) => (g(), m("view", {
16
+ class: "sun-navbar",
17
+ style: r
20
18
  }, [
21
- n("view", {
22
- class: "sun-popover-trigger",
23
- onTap: s[0] || (s[0] = (c) => l.value = !l.value)
24
- }, [
25
- p(e.$slots, "default")
26
- ], 32),
27
- n("view", M(e.$attrs, {
28
- class: "sun-popover-container",
29
- style: { color: e.color }
30
- }), [
31
- s[1] || (s[1] = n("view", { class: "sun-popover-arrow" }, null, -1)),
32
- p(e.$slots, "content")
33
- ], 16)
34
- ], 38));
19
+ o("view", v, [
20
+ a(n.$slots, "default"),
21
+ o("view", b, [
22
+ a(n.$slots, "center")
23
+ ])
24
+ ])
25
+ ]));
35
26
  }
36
27
  });
37
28
  export {
38
- T as default
29
+ k as default
39
30
  };
package/index15.js CHANGED
@@ -1,81 +1,39 @@
1
- import { defineComponent as C, watch as I, onMounted as L, onUnmounted as M, createElementVNode as k, unref as w, openBlock as z, createElementBlock as R } from "vue";
2
- import { createSelectorQuery as y, getWindowInfo as Q, previewImage as S } from "@tarojs/taro";
3
- import { QrCode as U, QrCodeEcc as a } from "./index65.js";
4
- const h = k, A = w, B = z, D = R;
5
- let T = 1;
6
- const N = /* @__PURE__ */ C({
1
+ import { defineComponent as m, mergeModels as d, useModel as v, computed as t, renderSlot as w, createElementVNode as g, mergeProps as k, withModifiers as y, normalizeClass as $, normalizeStyle as h, openBlock as b, createElementBlock as B } from "vue";
2
+ const p = w, n = g, M = k, z = y, E = $, S = h, C = b, N = B, T = /* @__PURE__ */ m({
7
3
  __name: "index",
8
- props: {
9
- value: {},
10
- color: { default: "#000000" },
11
- backgroundColor: { default: "transparent" },
12
- level: { default: "M" }
13
- },
14
- emits: ["rendered"],
15
- setup(m, { expose: v, emit: g }) {
16
- let n, i, l, s = !1;
17
- const u = `sun-qrcode-captcha-${T++}`, x = {
18
- L: a.LOW,
19
- M: a.MEDIUM,
20
- Q: a.QUARTILE,
21
- H: a.HIGH
22
- }, _ = g, c = m;
23
- v({
24
- getDataURL: p
25
- });
26
- function d() {
27
- setTimeout(() => {
28
- y().select(`#${u}`).fields({ node: !0, size: !0 }).exec(([{ node: t, width: e, height: r }]) => {
29
- if (s) return;
30
- if (!r || !e)
31
- return d();
32
- const o = Q().pixelRatio;
33
- n = t, l = n.getContext("2d"), i = e, n.width = e * o, n.height = r * o, l.scale(o, o), f();
34
- });
35
- }, 50);
36
- }
37
- function f() {
38
- const t = U.encodeText(c.value, x[c.level]), e = i / (t.size + 2);
39
- l.fillStyle = c.backgroundColor, l.fillRect(0, 0, n.width, n.height), l.fillStyle = c.color;
40
- for (let r = 0; r < t.size; r++)
41
- for (let o = 0; o < t.size; o++)
42
- t.getModule(o, r) && l.fillRect(
43
- o * e + e,
44
- // +moduleSize 留出边距
45
- r * e + e,
46
- e,
47
- e
48
- );
49
- _("rendered");
50
- }
51
- function p() {
52
- return n.toDataURL("image/png", 1);
53
- }
54
- function E() {
55
- const t = p();
56
- S({
57
- current: t,
58
- urls: [t]
59
- });
60
- }
61
- return I(() => c.value, () => {
62
- l && f();
63
- }), L(() => {
64
- d();
65
- }), M(() => {
66
- s = !0;
67
- }), (t, e) => (B(), D("view", {
68
- class: "sun-qrcode",
69
- onTap: e[0] || (e[0] = (r) => A(n) && E())
4
+ props: /* @__PURE__ */ d({
5
+ placement: {},
6
+ offset: { default: "6px" },
7
+ background: { default: "rgba(0, 0, 0, 0.5)" },
8
+ color: { default: "#fff" }
9
+ }, {
10
+ show: { type: Boolean },
11
+ showModifiers: {}
12
+ }),
13
+ emits: ["update:show"],
14
+ setup(r) {
15
+ const o = r, l = v(r, "show"), a = t(() => ["left", "right"].includes(o.placement[0])), u = t(() => ["top", "bottom"].includes(o.placement[1])), f = t(() => a.value ? o.offset : "0px"), i = t(() => u.value ? o.offset : "0px");
16
+ return (e, s) => (C(), N("view", {
17
+ class: E(["sun-popover", [{ "sun-popover-show": l.value }, `sun-popover-x-${e.placement[0]}`, `sun-popover-y-${e.placement[1]}`]]),
18
+ style: S({ "--popover-x-offset": f.value, "--popover-y-offset": i.value, "--popover-background": e.background }),
19
+ onTap: z((c) => !1, ["stop"])
70
20
  }, [
71
- h("canvas", {
72
- id: u,
73
- type: "2d",
74
- class: "sun-slider-captcha-canvas"
75
- })
76
- ], 32));
21
+ n("view", {
22
+ class: "sun-popover-trigger",
23
+ onTap: s[0] || (s[0] = (c) => l.value = !l.value)
24
+ }, [
25
+ p(e.$slots, "default")
26
+ ], 32),
27
+ n("view", M(e.$attrs, {
28
+ class: "sun-popover-container",
29
+ style: { color: e.color }
30
+ }), [
31
+ s[1] || (s[1] = n("view", { class: "sun-popover-arrow" }, null, -1)),
32
+ p(e.$slots, "content")
33
+ ], 16)
34
+ ], 38));
77
35
  }
78
36
  });
79
37
  export {
80
- N as default
38
+ T as default
81
39
  };
package/index16.js CHANGED
@@ -1,25 +1,81 @@
1
- import { defineComponent as p, inject as a, getCurrentInstance as c, onUnmounted as m, unref as u, renderSlot as i, mergeProps as _, openBlock as f, createElementBlock as v } from "vue";
2
- import { ACTIVE_CHILD as d, PARENT as g } from "./index64.js";
3
- const o = u, k = i, C = _, B = f, E = v, $ = /* @__PURE__ */ p({
4
- __name: "segment-btn",
1
+ import { defineComponent as C, watch as I, onMounted as L, onUnmounted as M, createElementVNode as k, unref as w, openBlock as z, createElementBlock as R } from "vue";
2
+ import { createSelectorQuery as y, getWindowInfo as Q, previewImage as S } from "@tarojs/taro";
3
+ import { QrCode as U, QrCodeEcc as a } from "./index71.js";
4
+ const h = k, A = w, B = z, D = R;
5
+ let T = 1;
6
+ const N = /* @__PURE__ */ C({
7
+ __name: "index",
5
8
  props: {
6
- value: {}
9
+ value: {},
10
+ color: { default: "#000000" },
11
+ backgroundColor: { default: "transparent" },
12
+ level: { default: "M" }
7
13
  },
8
- setup(b) {
9
- const l = a(d), e = a(g), n = c();
10
- return m(() => {
11
- e.unlink(n);
12
- }), e.link(n), (t, r) => {
13
- var s;
14
- return B(), E("view", C(t.$attrs, {
15
- class: ["sun-segment-btn", { "sun-segment-btn-active": ((s = o(l)) == null ? void 0 : s.props.value) === t.value }],
16
- onTap: r[0] || (r[0] = (I) => o(e).active(o(n)))
17
- }), [
18
- k(t.$slots, "default")
19
- ], 16);
20
- };
14
+ emits: ["rendered"],
15
+ setup(m, { expose: v, emit: g }) {
16
+ let n, i, l, s = !1;
17
+ const u = `sun-qrcode-captcha-${T++}`, x = {
18
+ L: a.LOW,
19
+ M: a.MEDIUM,
20
+ Q: a.QUARTILE,
21
+ H: a.HIGH
22
+ }, _ = g, c = m;
23
+ v({
24
+ getDataURL: p
25
+ });
26
+ function d() {
27
+ setTimeout(() => {
28
+ y().select(`#${u}`).fields({ node: !0, size: !0 }).exec(([{ node: t, width: e, height: r }]) => {
29
+ if (s) return;
30
+ if (!r || !e)
31
+ return d();
32
+ const o = Q().pixelRatio;
33
+ n = t, l = n.getContext("2d"), i = e, n.width = e * o, n.height = r * o, l.scale(o, o), f();
34
+ });
35
+ }, 50);
36
+ }
37
+ function f() {
38
+ const t = U.encodeText(c.value, x[c.level]), e = i / (t.size + 2);
39
+ l.fillStyle = c.backgroundColor, l.fillRect(0, 0, n.width, n.height), l.fillStyle = c.color;
40
+ for (let r = 0; r < t.size; r++)
41
+ for (let o = 0; o < t.size; o++)
42
+ t.getModule(o, r) && l.fillRect(
43
+ o * e + e,
44
+ // +moduleSize 留出边距
45
+ r * e + e,
46
+ e,
47
+ e
48
+ );
49
+ _("rendered");
50
+ }
51
+ function p() {
52
+ return n.toDataURL("image/png", 1);
53
+ }
54
+ function E() {
55
+ const t = p();
56
+ S({
57
+ current: t,
58
+ urls: [t]
59
+ });
60
+ }
61
+ return I(() => c.value, () => {
62
+ l && f();
63
+ }), L(() => {
64
+ d();
65
+ }), M(() => {
66
+ s = !0;
67
+ }), (t, e) => (B(), D("view", {
68
+ class: "sun-qrcode",
69
+ onTap: e[0] || (e[0] = (r) => A(n) && E())
70
+ }, [
71
+ h("canvas", {
72
+ id: u,
73
+ type: "2d",
74
+ class: "sun-slider-captcha-canvas"
75
+ })
76
+ ], 32));
21
77
  }
22
78
  });
23
79
  export {
24
- $ as default
80
+ N as default
25
81
  };
package/index17.js CHANGED
@@ -1,55 +1,25 @@
1
- import { defineComponent as x, getCurrentInstance as V, shallowRef as E, shallowReactive as k, computed as a, provide as i, watch as C, onMounted as w, renderSlot as y, createElementVNode as B, mergeProps as I, openBlock as O, createElementBlock as A } from "vue";
2
- import { ACTIVE_CHILD as N, PARENT as P } from "./index64.js";
3
- const R = y, T = B, b = I, L = O, S = A, $ = { class: "sun-segment-inner" }, M = /* @__PURE__ */ x({
4
- __name: "segment",
1
+ import { defineComponent as p, inject as a, getCurrentInstance as c, onUnmounted as m, unref as u, renderSlot as i, mergeProps as _, openBlock as f, createElementBlock as v } from "vue";
2
+ import { ACTIVE_CHILD as d, PARENT as g } from "./index70.js";
3
+ const o = u, k = i, C = _, B = f, E = v, $ = /* @__PURE__ */ p({
4
+ __name: "segment-btn",
5
5
  props: {
6
- modelValue: {}
6
+ value: {}
7
7
  },
8
- emits: ["update:modelValue", "change"],
9
- setup(p, { emit: v }) {
10
- const r = v, c = p, m = V(), o = E(null), t = k([]), d = a(() => t.indexOf(o.value)), f = a(() => t.length), g = a(() => ({
11
- "--segment-length": f.value,
12
- "--segment-active-index": d.value
13
- }));
14
- i(N, o), i(P, {
15
- link: (e) => {
16
- const n = u();
17
- t.push(e), t.sort((s, l) => {
18
- const h = n.indexOf(s.vnode), _ = n.indexOf(l.vnode);
19
- return h - _;
20
- });
21
- },
22
- unlink: (e) => {
23
- t.slice(t.indexOf(e), 1);
24
- },
25
- active: (e) => {
26
- r("change", {
27
- value: e.props.value,
28
- index: d.value
29
- }), r("update:modelValue", e.props.value), o.value = e;
30
- }
31
- }), C(() => c.modelValue, (e) => {
32
- o.value = t.find((n) => n.props.value === e);
33
- });
34
- function u() {
35
- return m.subTree.children[0].children[0].children.filter((e) => typeof e.type != "symbol");
36
- }
37
- return w(() => {
38
- const e = u();
39
- t.forEach((n) => {
40
- const s = e.findIndex((l) => l === n.vnode);
41
- n.props.value === void 0 && (n.props.value = s), n.props.value === c.modelValue && (o.value = n);
42
- });
43
- }), (e, n) => (L(), S("view", b(e.$attrs, {
44
- class: "sun-segment",
45
- style: g.value
46
- }), [
47
- T("view", $, [
48
- R(e.$slots, "default")
49
- ])
50
- ], 16));
8
+ setup(b) {
9
+ const l = a(d), e = a(g), n = c();
10
+ return m(() => {
11
+ e.unlink(n);
12
+ }), e.link(n), (t, r) => {
13
+ var s;
14
+ return B(), E("view", C(t.$attrs, {
15
+ class: ["sun-segment-btn", { "sun-segment-btn-active": ((s = o(l)) == null ? void 0 : s.props.value) === t.value }],
16
+ onTap: r[0] || (r[0] = (I) => o(e).active(o(n)))
17
+ }), [
18
+ k(t.$slots, "default")
19
+ ], 16);
20
+ };
51
21
  }
52
22
  });
53
23
  export {
54
- M as default
24
+ $ as default
55
25
  };