@solar-taro/ui-sun 1.3.3 → 1.3.5

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