@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/index22.js CHANGED
@@ -1,49 +1,27 @@
1
- import { defineComponent as u, computed as p, renderList as _, Fragment as f, openBlock as d, createElementBlock as g, renderSlot as v, unref as b, createBlock as k, createCommentVNode as h, toDisplayString as B, createTextVNode as y, normalizeClass as C, mergeProps as $ } from "vue";
2
- import w from "./index29.js";
3
- const N = _, S = f, r = d, n = g, T = v, V = b, L = k, z = h, D = B, E = y, F = C, P = $, j = ["scroll-left"], q = ["onTap"], I = /* @__PURE__ */ u({
4
- __name: "index",
1
+ import { defineComponent as u, computed as n, renderSlot as c, mergeProps as r, openBlock as l, createElementBlock as d } from "vue";
2
+ const a = c, m = r, p = l, k = d, _ = /* @__PURE__ */ u({
3
+ __name: "sudoku",
5
4
  props: {
6
- tabs: {},
7
- active: { default: 0 }
8
- },
9
- emits: ["update:active", "toggle"],
10
- setup(s, { emit: c }) {
11
- const a = c, l = s, i = p(() => l.active > 2 ? (l.active - 2) * 150 + "rpx" : 0);
12
- function m(e) {
13
- a("toggle", e), a("update:active", e);
5
+ size: String,
6
+ count: {
7
+ type: Number,
8
+ default: 9
14
9
  }
15
- return (e, x) => (r(), n("scroll-view", P(e.$attrs, {
16
- class: "sun-tabbar",
17
- "scroll-x": !0,
18
- "enable-flex": !0,
19
- enhanced: !0,
20
- "show-scrollbar": !1,
21
- "scroll-with-animation": !0,
22
- "scroll-left": i.value
10
+ },
11
+ setup(o) {
12
+ const e = o, t = n(() => ({
13
+ "sun-sudoku-sm": e.count === 1,
14
+ "sun-sudoku-md": e.count === 2 || e.count === 4,
15
+ "sun-sudoku-lg": e.count === 3 || e.count > 4
16
+ }));
17
+ return (s, i) => (p(), k("view", m(s.$attrs, {
18
+ class: ["sun-sudoku", t.value],
19
+ style: { "--sudoku-width": o.size }
23
20
  }), [
24
- (r(!0), n(S, null, N(e.tabs, (t, o) => (r(), n("view", {
25
- key: o,
26
- class: F(["sun-tabbar-item", {
27
- "sun-tabbar-item-active": e.active === o,
28
- "sun-tabbar-item-icon-only": !t.text
29
- }]),
30
- onTap: (A) => m(o)
31
- }, [
32
- T(e.$slots, "default", {
33
- tab: t,
34
- index: o
35
- }, () => [
36
- t.icon ? (r(), L(V(w), {
37
- key: 0,
38
- class: "sun-tabbar-item-icon",
39
- name: e.active === o ? t.icon[0] : t.icon[1] || `${t.icon[0]}-outline`
40
- }, null, 8, ["name"])) : z("", !0),
41
- E(" " + D(t.text), 1)
42
- ])
43
- ], 42, q))), 128))
44
- ], 16, j));
21
+ a(s.$slots, "default")
22
+ ], 16));
45
23
  }
46
24
  });
47
25
  export {
48
- I as default
26
+ _ as default
49
27
  };
package/index23.js CHANGED
@@ -1,30 +1,49 @@
1
- import { defineComponent as o, computed as r, renderSlot as n, mergeProps as i, openBlock as a, createElementBlock as c } from "vue";
2
- const d = n, p = i, h = a, m = c, b = /* @__PURE__ */ o({
3
- __name: "table-cell",
1
+ import { defineComponent as u, computed as p, renderList as _, Fragment as f, openBlock as d, createElementBlock as g, renderSlot as v, unref as b, createBlock as k, createCommentVNode as h, toDisplayString as B, createTextVNode as y, normalizeClass as C, mergeProps as $ } from "vue";
2
+ import w from "./index34.js";
3
+ const N = _, S = f, r = d, n = g, T = v, V = b, L = k, z = h, D = B, E = y, F = C, P = $, j = ["scroll-left"], q = ["onTap"], I = /* @__PURE__ */ u({
4
+ __name: "index",
4
5
  props: {
5
- sticky: {},
6
- head: { type: Boolean },
7
- width: {},
8
- maxWidth: {},
9
- ellipsis: { type: Boolean },
10
- breakWord: { type: Boolean }
6
+ tabs: {},
7
+ active: { default: 0 }
11
8
  },
12
- setup(l) {
13
- const e = l, s = r(() => ({
14
- "sun-tb-cell-sticky-left": e.sticky === "left",
15
- "sun-tb-cell-sticky-right": e.sticky === "right",
16
- "sun-tb-cell-ellipsis": e.ellipsis,
17
- "sun-tb-cell-head": e.head,
18
- "sun-tb-cell-break-word": e.breakWord
19
- }));
20
- return (t, u) => (h(), m("view", p(t.$attrs, {
21
- class: ["sun-tb-cell", s.value],
22
- style: { width: t.width, "min-width": t.width, "max-width": t.maxWidth }
9
+ emits: ["update:active", "toggle"],
10
+ setup(s, { emit: c }) {
11
+ const a = c, l = s, i = p(() => l.active > 2 ? (l.active - 2) * 150 + "rpx" : 0);
12
+ function m(e) {
13
+ a("toggle", e), a("update:active", e);
14
+ }
15
+ return (e, x) => (r(), n("scroll-view", P(e.$attrs, {
16
+ class: "sun-tabbar",
17
+ "scroll-x": !0,
18
+ "enable-flex": !0,
19
+ enhanced: !0,
20
+ "show-scrollbar": !1,
21
+ "scroll-with-animation": !0,
22
+ "scroll-left": i.value
23
23
  }), [
24
- d(t.$slots, "default")
25
- ], 16));
24
+ (r(!0), n(S, null, N(e.tabs, (t, o) => (r(), n("view", {
25
+ key: o,
26
+ class: F(["sun-tabbar-item", {
27
+ "sun-tabbar-item-active": e.active === o,
28
+ "sun-tabbar-item-icon-only": !t.text
29
+ }]),
30
+ onTap: (A) => m(o)
31
+ }, [
32
+ T(e.$slots, "default", {
33
+ tab: t,
34
+ index: o
35
+ }, () => [
36
+ t.icon ? (r(), L(V(w), {
37
+ key: 0,
38
+ class: "sun-tabbar-item-icon",
39
+ name: e.active === o ? t.icon[0] : t.icon[1] || `${t.icon[0]}-outline`
40
+ }, null, 8, ["name"])) : z("", !0),
41
+ E(" " + D(t.text), 1)
42
+ ])
43
+ ], 42, q))), 128))
44
+ ], 16, j));
26
45
  }
27
46
  });
28
47
  export {
29
- b as default
48
+ I as default
30
49
  };
package/index24.js CHANGED
@@ -1,18 +1,30 @@
1
- import { defineComponent as o, renderSlot as t, mergeProps as r, openBlock as n, createElementBlock as s } from "vue";
2
- const a = t, l = r, p = n, c = s, u = /* @__PURE__ */ o({
3
- __name: "table-row",
1
+ import { defineComponent as o, computed as r, renderSlot as n, mergeProps as i, openBlock as a, createElementBlock as c } from "vue";
2
+ const d = n, p = i, h = a, m = c, b = /* @__PURE__ */ o({
3
+ __name: "table-cell",
4
4
  props: {
5
+ sticky: {},
5
6
  head: { type: Boolean },
6
- foot: { type: Boolean }
7
+ width: {},
8
+ maxWidth: {},
9
+ ellipsis: { type: Boolean },
10
+ breakWord: { type: Boolean }
7
11
  },
8
- setup(m) {
9
- return (e, d) => (p(), c("view", l(e.$attrs, {
10
- class: ["sun-tb-row", { "sun-tb-head": e.head, "sun-tb-foot": e.foot }]
12
+ setup(l) {
13
+ const e = l, s = r(() => ({
14
+ "sun-tb-cell-sticky-left": e.sticky === "left",
15
+ "sun-tb-cell-sticky-right": e.sticky === "right",
16
+ "sun-tb-cell-ellipsis": e.ellipsis,
17
+ "sun-tb-cell-head": e.head,
18
+ "sun-tb-cell-break-word": e.breakWord
19
+ }));
20
+ return (t, u) => (h(), m("view", p(t.$attrs, {
21
+ class: ["sun-tb-cell", s.value],
22
+ style: { width: t.width, "min-width": t.width, "max-width": t.maxWidth }
11
23
  }), [
12
- a(e.$slots, "default")
24
+ d(t.$slots, "default")
13
25
  ], 16));
14
26
  }
15
27
  });
16
28
  export {
17
- u as default
29
+ b as default
18
30
  };
package/index25.js CHANGED
@@ -1,35 +1,18 @@
1
- import { defineComponent as s, computed as o, renderSlot as l, normalizeClass as u, createElementVNode as d, mergeProps as b, openBlock as c, createElementBlock as p } from "vue";
2
- const m = l, i = u, B = d, _ = b, f = c, z = p, k = /* @__PURE__ */ s({
3
- __name: "table",
1
+ import { defineComponent as o, renderSlot as t, mergeProps as r, openBlock as n, createElementBlock as s } from "vue";
2
+ const a = t, l = r, p = n, c = s, u = /* @__PURE__ */ o({
3
+ __name: "table-row",
4
4
  props: {
5
- rounded: { type: Boolean, default: !0 },
6
- bordered: { type: Boolean },
7
- outerBordered: { type: Boolean, default: !0 },
8
- zebra: { type: Boolean },
9
- size: { default: "default" },
10
- layout: {}
5
+ head: { type: Boolean },
6
+ foot: { type: Boolean }
11
7
  },
12
- setup(r) {
13
- const e = r, n = o(() => ({
14
- "sun-tb-rounded": e.rounded,
15
- "sun-tb-bordered": e.bordered,
16
- "sun-tb-outer-bordered": e.outerBordered,
17
- [`sun-tb-size-${e.size}`]: e.size
18
- })), a = o(() => ({
19
- "sun-tb-zebra": e.zebra,
20
- [`sun-tb-layout-${e.layout}`]: e.layout
21
- }));
22
- return (t, y) => (f(), z("view", _(t.$attrs, {
23
- class: ["sun-tb", n.value]
8
+ setup(m) {
9
+ return (e, d) => (p(), c("view", l(e.$attrs, {
10
+ class: ["sun-tb-row", { "sun-tb-head": e.head, "sun-tb-foot": e.foot }]
24
11
  }), [
25
- B("view", {
26
- class: i(["sun-tb-inner", a.value])
27
- }, [
28
- m(t.$slots, "default")
29
- ], 2)
12
+ a(e.$slots, "default")
30
13
  ], 16));
31
14
  }
32
15
  });
33
16
  export {
34
- k as default
17
+ u as default
35
18
  };
package/index26.js CHANGED
@@ -1,24 +1,35 @@
1
- import { defineComponent as n, computed as a, renderSlot as l, normalizeClass as r, openBlock as c, createElementBlock as p } from "vue";
2
- const u = l, d = r, m = c, _ = p, g = /* @__PURE__ */ n({
3
- __name: "index",
1
+ import { defineComponent as s, computed as o, renderSlot as l, normalizeClass as u, createElementVNode as d, mergeProps as b, openBlock as c, createElementBlock as p } from "vue";
2
+ const m = l, i = u, B = d, _ = b, f = c, z = p, k = /* @__PURE__ */ s({
3
+ __name: "table",
4
4
  props: {
5
- type: { default: "solid" },
6
- color: {},
7
- shape: { default: "round" }
5
+ rounded: { type: Boolean, default: !0 },
6
+ bordered: { type: Boolean },
7
+ outerBordered: { type: Boolean, default: !0 },
8
+ zebra: { type: Boolean },
9
+ size: { default: "default" },
10
+ layout: {}
8
11
  },
9
- setup(o) {
10
- const e = o, t = a(() => [
11
- `sun-tag-${e.type}`,
12
- `sun-tag-${e.color}`,
13
- `sun-tag-${e.shape}`
14
- ]);
15
- return (s, i) => (m(), _("view", {
16
- class: d(["sun-tag", t.value])
17
- }, [
18
- u(s.$slots, "default")
19
- ], 2));
12
+ setup(r) {
13
+ const e = r, n = o(() => ({
14
+ "sun-tb-rounded": e.rounded,
15
+ "sun-tb-bordered": e.bordered,
16
+ "sun-tb-outer-bordered": e.outerBordered,
17
+ [`sun-tb-size-${e.size}`]: e.size
18
+ })), a = o(() => ({
19
+ "sun-tb-zebra": e.zebra,
20
+ [`sun-tb-layout-${e.layout}`]: e.layout
21
+ }));
22
+ return (t, y) => (f(), z("view", _(t.$attrs, {
23
+ class: ["sun-tb", n.value]
24
+ }), [
25
+ B("view", {
26
+ class: i(["sun-tb-inner", a.value])
27
+ }, [
28
+ m(t.$slots, "default")
29
+ ], 2)
30
+ ], 16));
20
31
  }
21
32
  });
22
33
  export {
23
- g as default
34
+ k as default
24
35
  };
package/index27.js CHANGED
@@ -1,36 +1,24 @@
1
- import { defineComponent as r, mergeModels as d, useModel as c, computed as u, createElementVNode as i, normalizeClass as m, openBlock as g, createElementBlock as p } from "vue";
2
- const t = i, v = m, f = g, k = p, w = /* @__PURE__ */ r({
1
+ import { defineComponent as n, computed as a, renderSlot as l, normalizeClass as r, openBlock as c, createElementBlock as p } from "vue";
2
+ const u = l, d = r, m = c, _ = p, g = /* @__PURE__ */ n({
3
3
  __name: "index",
4
- props: /* @__PURE__ */ d({
5
- disabled: { type: Boolean },
6
- color: { default: "primary" }
7
- }, {
8
- modelValue: { type: Boolean },
9
- modelModifiers: {}
10
- }),
11
- emits: ["update:modelValue"],
12
- setup(s) {
13
- const o = s, l = c(s, "modelValue"), n = u(() => [
14
- `sun-toggle-${o.color}`,
15
- {
16
- "sun-toggle-disabled": o.disabled,
17
- "sun-toggle-checked": l.value
18
- }
4
+ props: {
5
+ type: { default: "solid" },
6
+ color: {},
7
+ shape: { default: "round" }
8
+ },
9
+ setup(o) {
10
+ const e = o, t = a(() => [
11
+ `sun-tag-${e.type}`,
12
+ `sun-tag-${e.color}`,
13
+ `sun-tag-${e.shape}`
19
14
  ]);
20
- function a() {
21
- o.disabled || (l.value = !l.value);
22
- }
23
- return (B, e) => (f(), k("view", {
24
- class: v(["sun-toggle", n.value]),
25
- "hover-class": "hover",
26
- onTap: e[0] || (e[0] = (V) => a())
27
- }, e[1] || (e[1] = [
28
- t("view", { class: "sun-toggle-toggle-icon-wrapper" }, [
29
- t("view", { class: "sun-toggle-toggle-icon" })
30
- ], -1)
31
- ]), 34));
15
+ return (s, i) => (m(), _("view", {
16
+ class: d(["sun-tag", t.value])
17
+ }, [
18
+ u(s.$slots, "default")
19
+ ], 2));
32
20
  }
33
21
  });
34
22
  export {
35
- w as default
23
+ g as default
36
24
  };
package/index28.js CHANGED
@@ -1,125 +1,36 @@
1
- import { defineComponent as I, ref as f, computed as a, onActivated as D, onMounted as L, onUnmounted as N, renderList as A, Fragment as M, openBlock as E, createElementBlock as K, renderSlot as R, normalizeStyle as j, createCommentVNode as q, toDisplayString as O, createTextVNode as Q, unref as U, withCtx as W, createBlock as X, mergeProps as Y } from "vue";
2
- import { withPixel as b } from "@solar-kit/core";
3
- import { rpxToPx as G, vibrator as H } from "@solar-taro/core";
4
- import { createSelectorQuery as J } from "@tarojs/taro";
5
- import Z from "./index19.js";
6
- const ee = A, te = M, s = E, c = K, z = R, g = j, re = q, le = O, oe = Q, B = U, ie = W, ne = X, ae = Y, se = ["id", "refresher-enabled", "refresher-triggered", "refresher-background", "scroll-x", "scroll-y", "scroll-top", "scroll-left"], ue = {
7
- key: 1,
8
- class: "sun-virtual-scroll-placeholder",
9
- style: { display: "flex", "justify-content": "center", "align-items": "center", height: "85%" }
10
- };
11
- let ce = 1;
12
- const he = /* @__PURE__ */ I({
1
+ import { defineComponent as r, mergeModels as d, useModel as c, computed as u, createElementVNode as i, normalizeClass as m, openBlock as p, createElementBlock as g } from "vue";
2
+ const n = i, v = m, f = p, k = g, w = /* @__PURE__ */ r({
13
3
  __name: "index",
14
- props: {
15
- refreshing: { type: Boolean },
16
- refresher: { type: Boolean },
17
- refresherBg: { default: "transparent" },
18
- direction: { default: "vertical" },
19
- items: {},
20
- itemSize: {},
21
- itemKey: {},
22
- id: { default: () => `sun-virtual-scroll-${ce++}` },
23
- bottomSpace: { default: 0 },
24
- loading: { type: Boolean },
25
- loadingText: { default: "Loading" }
26
- },
27
- emits: ["refresh", "lower"],
28
- setup($, { emit: x }) {
29
- const y = x, r = $;
30
- let m, i = 0, S = !1;
31
- const u = f(0), v = f(0), p = f(0), h = f(0), t = a(() => r.direction === "vertical"), _ = a(() => ({
32
- right: t.value ? "0" : "auto",
33
- transform: `translate${t.value ? "Y" : "X"}(${p.value}px)`,
34
- "white-space": t.value ? "normal" : "nowrap"
35
- })), n = a(() => typeof r.itemSize == "number" ? r.itemSize : r.itemSize.endsWith("rpx") ? G(parseFloat(r.itemSize)) : parseFloat(r.itemSize)), C = a(() => n.value * r.items.length), T = a(() => ({
36
- [t.value ? "height" : "width"]: b(C.value + r.bottomSpace)
37
- })), F = a(() => ({
38
- display: t.value ? "block" : "inline-block",
39
- [t.value ? "height" : "width"]: b(n.value)
40
- })), P = a(
41
- () => r.items.slice(
42
- Math.max(v.value - u.value, 0),
43
- v.value + u.value * 2
44
- )
45
- );
46
- function V({ detail: e }) {
47
- m && cancelAnimationFrame(m), m = requestAnimationFrame(() => {
48
- i = t.value ? e.scrollTop : e.scrollLeft, v.value = ~~(i / n.value), v.value > u.value - 1 ? p.value = i - n.value * u.value - i % n.value : p.value = i - i % (n.value * u.value), m = 0;
49
- });
50
- }
51
- function w() {
52
- setTimeout(() => {
53
- J().select(`#${r.id}`).boundingClientRect((e) => {
54
- if (S) return;
55
- if (e = e, !(e != null && e.height) || !(e != null && e.width))
56
- return w();
57
- const { height: l, width: o } = e, d = t.value ? l : o;
58
- u.value = Math.ceil(d / n.value);
59
- }).exec();
60
- }, 50);
4
+ props: /* @__PURE__ */ d({
5
+ disabled: { type: Boolean },
6
+ color: { default: "primary" }
7
+ }, {
8
+ modelValue: { type: Boolean },
9
+ modelModifiers: {}
10
+ }),
11
+ emits: ["update:modelValue"],
12
+ setup(s) {
13
+ const o = s, l = c(s, "modelValue"), t = u(() => [
14
+ `sun-toggle-${o.color}`,
15
+ {
16
+ "sun-toggle-disabled": o.disabled,
17
+ "sun-toggle-checked": l.value
18
+ }
19
+ ]);
20
+ function a() {
21
+ o.disabled || (l.value = !l.value);
61
22
  }
62
- return D(() => {
63
- h.value = i;
64
- }), L(() => {
65
- w();
66
- }), N(() => {
67
- S = !0;
68
- }), (e, l) => (s(), c("scroll-view", ae(e.$attrs, {
69
- id: e.id,
70
- class: "sun-virtual-scroll",
71
- "refresher-enabled": e.refresher,
72
- "refresher-triggered": e.refreshing,
73
- "refresher-background": e.refresherBg,
74
- "scroll-x": !t.value,
75
- "scroll-y": t.value,
76
- "scroll-top": t.value ? h.value : 0,
77
- "scroll-left": t.value ? 0 : h.value,
78
- enhanced: !0,
79
- "lower-threshold": 300,
80
- onScrollPassive: l[0] || (l[0] = (o) => V(o)),
81
- onRefresherrefresh: l[1] || (l[1] = (o) => {
82
- B(H).short("light"), y("refresh");
83
- }),
84
- onScrolltolower: l[2] || (l[2] = (o) => y("lower"))
85
- }), [
86
- e.items.length ? (s(), c("view", {
87
- key: 0,
88
- class: "sun-virtual-scroll-content-container",
89
- style: g(_.value)
90
- }, [
91
- (s(!0), c(te, null, ee(P.value, (o, d) => {
92
- var k;
93
- return s(), c("view", {
94
- key: (k = o[e.itemKey]) != null ? k : d,
95
- class: "sun-virtual-scroll-item",
96
- style: g(F.value)
97
- }, [
98
- z(e.$slots, "default", {
99
- item: o,
100
- index: d
101
- })
102
- ], 4);
103
- }), 128))
104
- ], 4)) : (s(), c("view", ue, [
105
- e.loading ? (s(), ne(B(Z), {
106
- key: 0,
107
- size: "large"
108
- }, {
109
- default: ie(() => [
110
- oe(le(e.loadingText), 1)
111
- ]),
112
- _: 1
113
- })) : z(e.$slots, "empty", { key: 1 })
114
- ])),
115
- e.items.length ? (s(), c("view", {
116
- key: 2,
117
- class: "sun-virtual-scroll-spacer",
118
- style: g(T.value)
119
- }, null, 4)) : re("", !0)
120
- ], 16, se));
23
+ return (B, e) => (f(), k("view", {
24
+ class: v(["sun-toggle", t.value]),
25
+ "hover-class": "hover",
26
+ onTap: e[0] || (e[0] = (V) => a())
27
+ }, e[1] || (e[1] = [
28
+ n("view", { class: "sun-toggle-icon-wrapper" }, [
29
+ n("view", { class: "sun-toggle-icon" })
30
+ ], -1)
31
+ ]), 34));
121
32
  }
122
33
  });
123
34
  export {
124
- he as default
35
+ w as default
125
36
  };
package/index29.js CHANGED
@@ -1,16 +1,125 @@
1
- import { defineComponent as c, computed as s, normalizeClass as t, openBlock as a, createElementBlock as l } from "vue";
2
- const r = t, i = a, m = l, d = /* @__PURE__ */ c({
1
+ import { defineComponent as I, ref as f, computed as a, onActivated as D, onMounted as L, onUnmounted as N, renderList as A, Fragment as M, openBlock as E, createElementBlock as K, renderSlot as R, normalizeStyle as j, createCommentVNode as q, toDisplayString as O, createTextVNode as Q, unref as U, withCtx as W, createBlock as X, mergeProps as Y } from "vue";
2
+ import { withPixel as b } from "@solar-kit/core";
3
+ import { rpxToPx as G, vibrator as H } from "@solar-taro/core";
4
+ import { createSelectorQuery as J } from "@tarojs/taro";
5
+ import Z from "./index20.js";
6
+ const ee = A, te = M, s = E, c = K, z = R, g = j, re = q, le = O, oe = Q, B = U, ie = W, ne = X, ae = Y, se = ["id", "refresher-enabled", "refresher-triggered", "refresher-background", "scroll-x", "scroll-y", "scroll-top", "scroll-left"], ue = {
7
+ key: 1,
8
+ class: "sun-virtual-scroll-placeholder",
9
+ style: { display: "flex", "justify-content": "center", "align-items": "center", height: "85%" }
10
+ };
11
+ let ce = 1;
12
+ const he = /* @__PURE__ */ I({
3
13
  __name: "index",
4
14
  props: {
5
- name: {}
15
+ refreshing: { type: Boolean },
16
+ refresher: { type: Boolean },
17
+ refresherBg: { default: "transparent" },
18
+ direction: { default: "vertical" },
19
+ items: {},
20
+ itemSize: {},
21
+ itemKey: {},
22
+ id: { default: () => `sun-virtual-scroll-${ce++}` },
23
+ bottomSpace: { default: 0 },
24
+ loading: { type: Boolean },
25
+ loadingText: { default: "Loading" }
6
26
  },
7
- setup(e) {
8
- const n = e, o = s(() => `ionicon-${n.name}`);
9
- return (p, _) => (i(), m("view", {
10
- class: r(["sun-icon ionicon", o.value])
11
- }, null, 2));
27
+ emits: ["refresh", "lower"],
28
+ setup($, { emit: x }) {
29
+ const y = x, r = $;
30
+ let m, i = 0, S = !1;
31
+ const u = f(0), v = f(0), p = f(0), h = f(0), t = a(() => r.direction === "vertical"), _ = a(() => ({
32
+ right: t.value ? "0" : "auto",
33
+ transform: `translate${t.value ? "Y" : "X"}(${p.value}px)`,
34
+ "white-space": t.value ? "normal" : "nowrap"
35
+ })), n = a(() => typeof r.itemSize == "number" ? r.itemSize : r.itemSize.endsWith("rpx") ? G(parseFloat(r.itemSize)) : parseFloat(r.itemSize)), C = a(() => n.value * r.items.length), T = a(() => ({
36
+ [t.value ? "height" : "width"]: b(C.value + r.bottomSpace)
37
+ })), F = a(() => ({
38
+ display: t.value ? "block" : "inline-block",
39
+ [t.value ? "height" : "width"]: b(n.value)
40
+ })), P = a(
41
+ () => r.items.slice(
42
+ Math.max(v.value - u.value, 0),
43
+ v.value + u.value * 2
44
+ )
45
+ );
46
+ function V({ detail: e }) {
47
+ m && cancelAnimationFrame(m), m = requestAnimationFrame(() => {
48
+ i = t.value ? e.scrollTop : e.scrollLeft, v.value = ~~(i / n.value), v.value > u.value - 1 ? p.value = i - n.value * u.value - i % n.value : p.value = i - i % (n.value * u.value), m = 0;
49
+ });
50
+ }
51
+ function w() {
52
+ setTimeout(() => {
53
+ J().select(`#${r.id}`).boundingClientRect((e) => {
54
+ if (S) return;
55
+ if (e = e, !(e != null && e.height) || !(e != null && e.width))
56
+ return w();
57
+ const { height: l, width: o } = e, d = t.value ? l : o;
58
+ u.value = Math.ceil(d / n.value);
59
+ }).exec();
60
+ }, 50);
61
+ }
62
+ return D(() => {
63
+ h.value = i;
64
+ }), L(() => {
65
+ w();
66
+ }), N(() => {
67
+ S = !0;
68
+ }), (e, l) => (s(), c("scroll-view", ae(e.$attrs, {
69
+ id: e.id,
70
+ class: "sun-virtual-scroll",
71
+ "refresher-enabled": e.refresher,
72
+ "refresher-triggered": e.refreshing,
73
+ "refresher-background": e.refresherBg,
74
+ "scroll-x": !t.value,
75
+ "scroll-y": t.value,
76
+ "scroll-top": t.value ? h.value : 0,
77
+ "scroll-left": t.value ? 0 : h.value,
78
+ enhanced: !0,
79
+ "lower-threshold": 300,
80
+ onScrollPassive: l[0] || (l[0] = (o) => V(o)),
81
+ onRefresherrefresh: l[1] || (l[1] = (o) => {
82
+ B(H).short("light"), y("refresh");
83
+ }),
84
+ onScrolltolower: l[2] || (l[2] = (o) => y("lower"))
85
+ }), [
86
+ e.items.length ? (s(), c("view", {
87
+ key: 0,
88
+ class: "sun-virtual-scroll-content-container",
89
+ style: g(_.value)
90
+ }, [
91
+ (s(!0), c(te, null, ee(P.value, (o, d) => {
92
+ var k;
93
+ return s(), c("view", {
94
+ key: (k = o[e.itemKey]) != null ? k : d,
95
+ class: "sun-virtual-scroll-item",
96
+ style: g(F.value)
97
+ }, [
98
+ z(e.$slots, "default", {
99
+ item: o,
100
+ index: d
101
+ })
102
+ ], 4);
103
+ }), 128))
104
+ ], 4)) : (s(), c("view", ue, [
105
+ e.loading ? (s(), ne(B(Z), {
106
+ key: 0,
107
+ size: "large"
108
+ }, {
109
+ default: ie(() => [
110
+ oe(le(e.loadingText), 1)
111
+ ]),
112
+ _: 1
113
+ })) : z(e.$slots, "empty", { key: 1 })
114
+ ])),
115
+ e.items.length ? (s(), c("view", {
116
+ key: 2,
117
+ class: "sun-virtual-scroll-spacer",
118
+ style: g(T.value)
119
+ }, null, 4)) : re("", !0)
120
+ ], 16, se));
12
121
  }
13
122
  });
14
123
  export {
15
- d as default
124
+ he as default
16
125
  };
package/index30.js CHANGED
@@ -1,13 +1,12 @@
1
- import { renderSlot as t, openBlock as n, createElementBlock as r } from "vue";
1
+ import { renderSlot as t, openBlock as o, createElementBlock as n } from "vue";
2
2
  import c from "./index42.js";
3
- const s = {}, o = t, l = n, d = r, _ = { class: "sun-item-divider" };
4
- function i(e, a) {
5
- return l(), d("view", _, [
6
- o(e.$slots, "default"),
7
- o(e.$slots, "end")
3
+ const r = {}, s = t, l = o, _ = n, a = { class: "sun-card-content" };
4
+ function d(e, f) {
5
+ return l(), _("view", a, [
6
+ s(e.$slots, "default")
8
7
  ]);
9
8
  }
10
- const p = /* @__PURE__ */ c(s, [["render", i]]);
9
+ const p = /* @__PURE__ */ c(r, [["render", d]]);
11
10
  export {
12
11
  p as default
13
12
  };