@solar-taro/ui-sun 1.3.4 → 1.3.6
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 +20 -0
- package/index18.js +51 -48
- package/index19.js +1 -1
- package/index20.js +1 -1
- package/index22.js +1 -1
- package/index23.js +7 -2
- package/index24.js +1 -1
- package/index25.js +2 -7
- package/index26.js +1 -1
- package/index27.js +1 -1
- package/index28.js +1 -1
- package/index29.js +1 -1
- package/index30.js +1 -1
- package/index31.js +1 -1
- package/index32.js +1 -1
- package/index33.js +1 -1
- package/index34.js +1 -1
- package/index35.js +1 -1
- package/index36.js +1 -1
- package/index37.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
## 1.3.5 (2025-09-28)
|
|
2
|
+
|
|
3
|
+
### 🩹 Fixes
|
|
4
|
+
|
|
5
|
+
- **ui-sun/virtual-scroll:** fix bug
|
|
6
|
+
|
|
7
|
+
### ❤️ Thank You
|
|
8
|
+
|
|
9
|
+
- HyperLife1119
|
|
10
|
+
|
|
11
|
+
## 1.3.4 (2025-09-24)
|
|
12
|
+
|
|
13
|
+
### 🚀 Features
|
|
14
|
+
|
|
15
|
+
- **ui-sun/tailwind:** refactor color configuration to accept primary colors as options
|
|
16
|
+
|
|
17
|
+
### ❤️ Thank You
|
|
18
|
+
|
|
19
|
+
- HyperLife1119
|
|
20
|
+
|
|
1
21
|
## 1.3.3 (2025-09-24)
|
|
2
22
|
|
|
3
23
|
This was a version bump only for ui-sun to align it with other projects, there were no code changes.
|
package/index18.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { withPixel as
|
|
3
|
-
import { rpxToPx as
|
|
4
|
-
import { createSelectorQuery as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as P, ref as f, computed as i, onMounted as V, onUnmounted as I, renderList as L, Fragment as N, openBlock as D, createElementBlock as M, renderSlot as A, normalizeStyle as E, createCommentVNode as K, toDisplayString as R, createTextVNode as j, unref as q, withCtx as O, createBlock as Q, mergeProps as U } from "vue";
|
|
2
|
+
import { withPixel as w } from "@solar-kit/core";
|
|
3
|
+
import { rpxToPx as W, vibrator as X } from "@solar-taro/core";
|
|
4
|
+
import { createSelectorQuery as Y } from "@tarojs/taro";
|
|
5
|
+
import G from "./index13.js";
|
|
6
|
+
const H = L, J = N, a = D, u = M, k = A, h = E, Z = K, ee = R, te = j, b = q, re = O, le = Q, oe = U, ne = ["id", "refresher-enabled", "refresher-triggered", "refresher-background", "scroll-x", "scroll-y"], ie = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "sun-virtual-scroll-placeholder",
|
|
9
9
|
style: { display: "flex", "justify-content": "center", "align-items": "center", height: "85%" }
|
|
10
10
|
};
|
|
11
|
-
let
|
|
12
|
-
const
|
|
11
|
+
let ae = 1;
|
|
12
|
+
const ve = /* @__PURE__ */ P({
|
|
13
13
|
__name: "index",
|
|
14
14
|
props: {
|
|
15
15
|
refreshing: { type: Boolean },
|
|
@@ -19,49 +19,52 @@ const me = /* @__PURE__ */ F({
|
|
|
19
19
|
items: {},
|
|
20
20
|
itemSize: {},
|
|
21
21
|
itemKey: {},
|
|
22
|
-
id: { default: () => `sun-virtual-scroll-${
|
|
22
|
+
id: { default: () => `sun-virtual-scroll-${ae++}` },
|
|
23
23
|
bottomSpace: { default: 0 },
|
|
24
24
|
loading: { type: Boolean },
|
|
25
25
|
loadingText: { default: "Loading" }
|
|
26
26
|
},
|
|
27
27
|
emits: ["refresh", "lower"],
|
|
28
|
-
setup(
|
|
29
|
-
const p =
|
|
30
|
-
let c;
|
|
31
|
-
const s = f(0), m = f(0),
|
|
28
|
+
setup(z, { emit: B }) {
|
|
29
|
+
const p = B, r = z;
|
|
30
|
+
let c, g = !1;
|
|
31
|
+
const s = f(0), m = f(0), v = f(0), l = i(() => r.direction === "vertical"), $ = i(() => ({
|
|
32
32
|
right: l.value ? "0" : "auto",
|
|
33
|
-
transform: `translate${l.value ? "Y" : "X"}(${
|
|
33
|
+
transform: `translate${l.value ? "Y" : "X"}(${v.value}px)`,
|
|
34
34
|
"white-space": l.value ? "normal" : "nowrap"
|
|
35
|
-
})),
|
|
36
|
-
[l.value ? "height" : "width"]:
|
|
37
|
-
})),
|
|
35
|
+
})), n = i(() => typeof r.itemSize == "number" ? r.itemSize : r.itemSize.endsWith("rpx") ? W(parseFloat(r.itemSize)) : parseFloat(r.itemSize)), x = i(() => n.value * r.items.length), C = i(() => ({
|
|
36
|
+
[l.value ? "height" : "width"]: w(x.value + r.bottomSpace)
|
|
37
|
+
})), _ = i(() => ({
|
|
38
38
|
display: l.value ? "block" : "inline-block",
|
|
39
|
-
[l.value ? "height" : "width"]:
|
|
40
|
-
})),
|
|
39
|
+
[l.value ? "height" : "width"]: w(n.value)
|
|
40
|
+
})), T = i(
|
|
41
41
|
() => r.items.slice(
|
|
42
42
|
Math.max(m.value - s.value, 0),
|
|
43
43
|
m.value + s.value * 2
|
|
44
44
|
)
|
|
45
45
|
);
|
|
46
|
-
function
|
|
46
|
+
function F({ detail: e }) {
|
|
47
47
|
c && cancelAnimationFrame(c), c = requestAnimationFrame(() => {
|
|
48
48
|
const t = l.value ? e.scrollTop : e.scrollLeft;
|
|
49
|
-
m.value = ~~(t /
|
|
49
|
+
m.value = ~~(t / n.value), m.value > s.value - 1 ? v.value = t - n.value * s.value - t % n.value : v.value = t - t % (n.value * s.value), c = 0;
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function y() {
|
|
53
53
|
setTimeout(() => {
|
|
54
|
-
|
|
54
|
+
Y().select(`#${r.id}`).boundingClientRect((e) => {
|
|
55
|
+
if (g) return;
|
|
55
56
|
if (e = e, !(e != null && e.height) || !(e != null && e.width))
|
|
56
|
-
return
|
|
57
|
-
const { height: t, width: o } = e,
|
|
58
|
-
s.value = Math.ceil(
|
|
57
|
+
return y();
|
|
58
|
+
const { height: t, width: o } = e, d = l.value ? t : o;
|
|
59
|
+
s.value = Math.ceil(d / n.value);
|
|
59
60
|
}).exec();
|
|
60
|
-
});
|
|
61
|
+
}, 50);
|
|
61
62
|
}
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
}), (
|
|
63
|
+
return V(() => {
|
|
64
|
+
y();
|
|
65
|
+
}), I(() => {
|
|
66
|
+
g = !0;
|
|
67
|
+
}), (e, t) => (a(), u("scroll-view", oe(e.$attrs, {
|
|
65
68
|
id: e.id,
|
|
66
69
|
class: "sun-virtual-scroll",
|
|
67
70
|
"refresher-enabled": e.refresher,
|
|
@@ -71,49 +74,49 @@ const me = /* @__PURE__ */ F({
|
|
|
71
74
|
"scroll-y": l.value,
|
|
72
75
|
enhanced: !0,
|
|
73
76
|
"lower-threshold": 300,
|
|
74
|
-
onScrollPassive: t[0] || (t[0] = (o) =>
|
|
77
|
+
onScrollPassive: t[0] || (t[0] = (o) => F(o)),
|
|
75
78
|
onRefresherrefresh: t[1] || (t[1] = (o) => {
|
|
76
|
-
|
|
79
|
+
b(X).short("light"), p("refresh");
|
|
77
80
|
}),
|
|
78
81
|
onScrolltolower: t[2] || (t[2] = (o) => p("lower"))
|
|
79
82
|
}), [
|
|
80
83
|
e.items.length ? (a(), u("view", {
|
|
81
84
|
key: 0,
|
|
82
85
|
class: "sun-virtual-scroll-content-container",
|
|
83
|
-
style: h(
|
|
86
|
+
style: h($.value)
|
|
84
87
|
}, [
|
|
85
|
-
(a(!0), u(
|
|
86
|
-
var
|
|
88
|
+
(a(!0), u(J, null, H(T.value, (o, d) => {
|
|
89
|
+
var S;
|
|
87
90
|
return a(), u("view", {
|
|
88
|
-
key: (
|
|
91
|
+
key: (S = o[e.itemKey]) != null ? S : d,
|
|
89
92
|
class: "sun-virtual-scroll-item",
|
|
90
|
-
style: h(
|
|
93
|
+
style: h(_.value)
|
|
91
94
|
}, [
|
|
92
|
-
|
|
95
|
+
k(e.$slots, "default", {
|
|
93
96
|
item: o,
|
|
94
|
-
index:
|
|
97
|
+
index: d
|
|
95
98
|
})
|
|
96
99
|
], 4);
|
|
97
100
|
}), 128))
|
|
98
|
-
], 4)) : (a(), u("view",
|
|
99
|
-
e.loading ? (a(),
|
|
101
|
+
], 4)) : (a(), u("view", ie, [
|
|
102
|
+
e.loading ? (a(), le(b(G), {
|
|
100
103
|
key: 0,
|
|
101
104
|
spinning: !0
|
|
102
105
|
}, {
|
|
103
|
-
default:
|
|
104
|
-
|
|
106
|
+
default: re(() => [
|
|
107
|
+
te(ee(e.loadingText), 1)
|
|
105
108
|
]),
|
|
106
109
|
_: 1
|
|
107
|
-
})) :
|
|
110
|
+
})) : k(e.$slots, "empty", { key: 1 })
|
|
108
111
|
])),
|
|
109
112
|
e.items.length ? (a(), u("view", {
|
|
110
113
|
key: 2,
|
|
111
114
|
class: "sun-virtual-scroll-spacer",
|
|
112
|
-
style: h(
|
|
113
|
-
}, null, 4)) :
|
|
114
|
-
], 16,
|
|
115
|
+
style: h(C.value)
|
|
116
|
+
}, null, 4)) : Z("", !0)
|
|
117
|
+
], 16, ne));
|
|
115
118
|
}
|
|
116
119
|
});
|
|
117
120
|
export {
|
|
118
|
-
|
|
121
|
+
ve as default
|
|
119
122
|
};
|
package/index19.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { renderSlot as r, mergeProps as o, openBlock as t, createElementBlock as n } from "vue";
|
|
2
|
-
import c from "./
|
|
2
|
+
import c from "./index23.js";
|
|
3
3
|
const s = {}, l = r, a = o, f = t, _ = n;
|
|
4
4
|
function m(e, p) {
|
|
5
5
|
return f(), _("view", a(e.$attrs, { class: "sun-fab" }), [
|
package/index20.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { renderSlot as o, mergeProps as r, openBlock as t, createElementBlock as s } from "vue";
|
|
2
|
-
import n from "./
|
|
2
|
+
import n from "./index23.js";
|
|
3
3
|
const c = {}, l = o, m = r, _ = t, a = s;
|
|
4
4
|
function u(e, d) {
|
|
5
5
|
return _(), a("view", m(e.$attrs, { class: "sun-sudoku-item" }), [
|
package/index22.js
CHANGED
package/index23.js
CHANGED
package/index24.js
CHANGED
package/index25.js
CHANGED
package/index26.js
CHANGED
package/index27.js
CHANGED
package/index28.js
CHANGED
package/index29.js
CHANGED
package/index30.js
CHANGED
package/index31.js
CHANGED
package/index32.js
CHANGED
package/index33.js
CHANGED
package/index34.js
CHANGED
package/index35.js
CHANGED
package/index36.js
CHANGED
package/index37.js
CHANGED