@solar-taro/ui-sun 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.
Files changed (73) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/accordion/index.vue.d.ts +25 -0
  3. package/{src/chip → chip}/index.scss +1 -1
  4. package/chip/index.vue.d.ts +45 -0
  5. package/fab/fab-group.vue.d.ts +23 -0
  6. package/fab/fab.vue.d.ts +11 -0
  7. package/index.js +485 -0
  8. package/lazy-render/index.vue.d.ts +43 -0
  9. package/navbar/index.vue.d.ts +12 -0
  10. package/package.json +1 -1
  11. package/popover/index.vue.d.ts +92 -0
  12. package/segment/injection.d.ts +8 -0
  13. package/segment/segment-btn.vue.d.ts +24 -0
  14. package/segment/segment.vue.d.ts +36 -0
  15. package/spinner/index.vue.d.ts +26 -0
  16. package/sudoku/sudoku-item.vue.d.ts +11 -0
  17. package/sudoku/sudoku.vue.d.ts +25 -0
  18. package/table/table-cell.vue.d.ts +36 -0
  19. package/table/table-row.vue.d.ts +26 -0
  20. package/table/table.vue.d.ts +53 -0
  21. package/virtual-scroll/index.vue.d.ts +70 -0
  22. package/eslint.config.cjs +0 -22
  23. package/project.json +0 -28
  24. package/shims-vue.d.ts +0 -5
  25. package/src/accordion/index.vue +0 -27
  26. package/src/chip/index.vue +0 -27
  27. package/src/fab/fab-group.vue +0 -17
  28. package/src/fab/fab.vue +0 -5
  29. package/src/lazy-render/index.vue +0 -38
  30. package/src/navbar/index.vue +0 -26
  31. package/src/popover/index.vue +0 -56
  32. package/src/segment/injection.ts +0 -8
  33. package/src/segment/segment-btn.vue +0 -28
  34. package/src/segment/segment.vue +0 -86
  35. package/src/spinner/index.vue +0 -26
  36. package/src/sudoku/sudoku-item.vue +0 -5
  37. package/src/sudoku/sudoku.vue +0 -23
  38. package/src/table/table-cell.vue +0 -26
  39. package/src/table/table-row.vue +0 -12
  40. package/src/table/table.vue +0 -39
  41. package/src/virtual-scroll/index.vue +0 -138
  42. package/tsconfig.json +0 -21
  43. package/tsconfig.lib.json +0 -26
  44. package/tsconfig.spec.json +0 -28
  45. package/vite.config.ts +0 -130
  46. /package/{src/_color.scss → _color.scss} +0 -0
  47. /package/{src/_sun.scss → _sun.scss} +0 -0
  48. /package/{src/_wx.scss → _wx.scss} +0 -0
  49. /package/{src/accordion/index.ts → accordion/index.d.ts} +0 -0
  50. /package/{src/accordion → accordion}/index.scss +0 -0
  51. /package/{src/chip/index.ts → chip/index.d.ts} +0 -0
  52. /package/{src/fab/index.ts → fab/index.d.ts} +0 -0
  53. /package/{src/fab → fab}/index.scss +0 -0
  54. /package/{src/index.ts → index.d.ts} +0 -0
  55. /package/{src/index.scss → index.scss} +0 -0
  56. /package/{src/lazy-render/index.ts → lazy-render/index.d.ts} +0 -0
  57. /package/{src/navbar/index.ts → navbar/index.d.ts} +0 -0
  58. /package/{src/navbar → navbar}/index.scss +0 -0
  59. /package/{src/popover/index.ts → popover/index.d.ts} +0 -0
  60. /package/{src/popover → popover}/index.scss +0 -0
  61. /package/{src/segment/index.ts → segment/index.d.ts} +0 -0
  62. /package/{src/segment → segment}/index.scss +0 -0
  63. /package/{src/spinner/index.ts → spinner/index.d.ts} +0 -0
  64. /package/{src/spinner → spinner}/index.scss +0 -0
  65. /package/{src/sudoku/index.ts → sudoku/index.d.ts} +0 -0
  66. /package/{src/sudoku → sudoku}/index.scss +0 -0
  67. /package/{src/table → table}/_table-cell.scss +0 -0
  68. /package/{src/table → table}/_table-row.scss +0 -0
  69. /package/{src/table → table}/_table.scss +0 -0
  70. /package/{src/table/index.ts → table/index.d.ts} +0 -0
  71. /package/{src/table → table}/index.scss +0 -0
  72. /package/{src/virtual-scroll/index.ts → virtual-scroll/index.d.ts} +0 -0
  73. /package/{src/virtual-scroll → virtual-scroll}/index.scss +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## 1.0.1 (2025-01-22)
2
+
3
+ This was a version bump only for ui-sun to align it with other projects, there were no code changes.
@@ -0,0 +1,25 @@
1
+ declare function toggle(): void;
2
+ declare function __VLS_template(): {
3
+ default?(_: {}): any;
4
+ content?(_: {
5
+ toggle: typeof toggle;
6
+ }): any;
7
+ };
8
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
9
+ expanded: import('vue').PropType<boolean>;
10
+ disabled: {
11
+ type: import('vue').PropType<boolean>;
12
+ };
13
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
14
+ expanded: import('vue').PropType<boolean>;
15
+ disabled: {
16
+ type: import('vue').PropType<boolean>;
17
+ };
18
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
19
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
20
+ export default _default;
21
+ type __VLS_WithTemplateSlots<T, S> = T & {
22
+ new (): {
23
+ $slots: S;
24
+ };
25
+ };
@@ -38,7 +38,7 @@
38
38
  border: 1px solid rgba(var(--color-rgb), 1);
39
39
  }
40
40
 
41
- &-light {
41
+ &-translucent {
42
42
  --color: rgba(var(--color-rgb), 1);
43
43
  --background: rgba(var(--color-rgb, 0, 0, 0), 0.12);
44
44
  }
@@ -0,0 +1,45 @@
1
+ declare function __VLS_template(): {
2
+ default?(_: {}): any;
3
+ };
4
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
+ type?: "solid" | "translucent" | "outline";
6
+ size?: "small" | "default" | "large";
7
+ color: "primary" | "success" | "danger" | "warning" | "info" | "dark" | "light" | "secondary";
8
+ }>, {
9
+ type: string;
10
+ size: string;
11
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
12
+ type?: "solid" | "translucent" | "outline";
13
+ size?: "small" | "default" | "large";
14
+ color: "primary" | "success" | "danger" | "warning" | "info" | "dark" | "light" | "secondary";
15
+ }>, {
16
+ type: string;
17
+ size: string;
18
+ }>>> & Readonly<{}>, {
19
+ type: "solid" | "translucent" | "outline";
20
+ size: "small" | "default" | "large";
21
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
22
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
23
+ export default _default;
24
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
25
+ type __VLS_TypePropsToRuntimeProps<T> = {
26
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
27
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
28
+ } : {
29
+ type: import('vue').PropType<T[K]>;
30
+ required: true;
31
+ };
32
+ };
33
+ type __VLS_WithDefaults<P, D> = {
34
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
35
+ default: D[K];
36
+ }> : P[K];
37
+ };
38
+ type __VLS_Prettify<T> = {
39
+ [K in keyof T]: T[K];
40
+ } & {};
41
+ type __VLS_WithTemplateSlots<T, S> = T & {
42
+ new (): {
43
+ $slots: S;
44
+ };
45
+ };
@@ -0,0 +1,23 @@
1
+ declare function __VLS_template(): {
2
+ default?(_: {}): any;
3
+ };
4
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
5
+ offsetY: {
6
+ type: (NumberConstructor | StringConstructor)[];
7
+ default: number;
8
+ };
9
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
10
+ offsetY: {
11
+ type: (NumberConstructor | StringConstructor)[];
12
+ default: number;
13
+ };
14
+ }>> & Readonly<{}>, {
15
+ offsetY: string | number;
16
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
17
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
18
+ export default _default;
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,11 @@
1
+ declare function __VLS_template(): {
2
+ default?(_: {}): any;
3
+ };
4
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
5
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
6
+ export default _default;
7
+ type __VLS_WithTemplateSlots<T, S> = T & {
8
+ new (): {
9
+ $slots: S;
10
+ };
11
+ };
package/index.js ADDED
@@ -0,0 +1,485 @@
1
+ import { defineComponent as m, mergeModels as oe, useModel as re, renderSlot as c, createElementVNode as S, normalizeClass as E, openBlock as i, createElementBlock as d, computed as u, mergeProps as _, ref as x, onActivated as le, onDeactivated as ae, createCommentVNode as q, withModifiers as ue, normalizeStyle as G, inject as O, getCurrentInstance as Q, onUnmounted as ce, unref as U, shallowRef as ie, shallowReactive as de, provide as W, watch as pe, onMounted as J, renderList as Z, Fragment as ee } from "vue";
2
+ import { withPixel as g } from "@solar-kit/core";
3
+ import { getNavbarRect as me, rpxToPx as ve, vibrator as fe } from "@solar-taro/core";
4
+ import { createSelectorQuery as $e } from "@tarojs/taro";
5
+ const Y = c, P = S, _e = E, he = i, be = d, ge = { class: "sun-accordion-content" }, ye = { class: "sun-accordion-content-inner" }, jt = /* @__PURE__ */ m({
6
+ __name: "index",
7
+ props: /* @__PURE__ */ oe({
8
+ disabled: { type: Boolean }
9
+ }, {
10
+ expanded: { type: Boolean },
11
+ expandedModifiers: {}
12
+ }),
13
+ emits: ["update:expanded"],
14
+ setup(n) {
15
+ const e = n, s = re(n, "expanded");
16
+ function t() {
17
+ e.disabled || (s.value = !s.value);
18
+ }
19
+ return (o, r) => (he(), be("view", {
20
+ class: _e(["sun-accordion", { "sun-accordion-expanded": s.value }])
21
+ }, [
22
+ P("view", {
23
+ class: "sun-accordion-header",
24
+ onTap: r[0] || (r[0] = (l) => t())
25
+ }, [
26
+ Y(o.$slots, "default")
27
+ ], 32),
28
+ P("view", ge, [
29
+ P("view", ye, [
30
+ Y(o.$slots, "content", { toggle: t })
31
+ ])
32
+ ])
33
+ ], 2));
34
+ }
35
+ }), Se = c, ke = E, we = i, Be = d, qt = /* @__PURE__ */ m({
36
+ __name: "index",
37
+ props: {
38
+ type: { default: "translucent" },
39
+ size: { default: "default" },
40
+ color: {}
41
+ },
42
+ setup(n) {
43
+ const e = n, s = u(() => [
44
+ `sun-chip-${e.size}`,
45
+ `sun-chip-${e.type}`,
46
+ `sun-chip-${e.color}`
47
+ ]);
48
+ return (t, o) => (we(), Be("view", {
49
+ class: ke(["sun-chip", s.value])
50
+ }, [
51
+ Se(t.$slots, "default")
52
+ ], 2));
53
+ }
54
+ }), ze = c, Ee = _, Ce = i, xe = d, Gt = /* @__PURE__ */ m({
55
+ __name: "fab-group",
56
+ props: {
57
+ offsetY: {
58
+ type: [Number, String],
59
+ default: 0
60
+ }
61
+ },
62
+ setup(n) {
63
+ return (e, s) => (Ce(), xe("view", Ee(e.$attrs, {
64
+ class: "sun-fab-group",
65
+ style: { bottom: `calc(${15 + +n.offsetY}px + var(--safe-bottom))` }
66
+ }), [
67
+ ze(e.$slots, "default")
68
+ ], 16));
69
+ }
70
+ }), te = (n, e) => {
71
+ const s = n.__vccOpts || n;
72
+ for (const [t, o] of e)
73
+ s[t] = o;
74
+ return s;
75
+ }, Ve = {}, Pe = c, Ne = _, Te = i, Ie = d;
76
+ function Re(n, e) {
77
+ return Te(), Ie("view", Ne(n.$attrs, { class: "sun-fab" }), [
78
+ Pe(n.$slots, "default")
79
+ ], 16);
80
+ }
81
+ const Qt = /* @__PURE__ */ te(Ve, [["render", Re]]), Fe = c, Le = q, Ut = /* @__PURE__ */ m({
82
+ __name: "index",
83
+ props: {
84
+ delay: { default: 50 },
85
+ hook: { default: "activated" }
86
+ },
87
+ setup(n) {
88
+ const e = n, s = x(!1);
89
+ let t;
90
+ function o() {
91
+ t = setTimeout(() => {
92
+ s.value = !0;
93
+ }, e.delay);
94
+ }
95
+ return e.hook === "created" && o(), le(() => {
96
+ o();
97
+ }), ae(() => {
98
+ s.value = !1, t && clearTimeout(t);
99
+ }), (r, l) => s.value ? Fe(r.$slots, "default", { key: 0 }) : Le("", !0);
100
+ }
101
+ }), D = c, X = S, Me = i, Ae = d, Oe = { class: "sun-navbar-inner" }, We = { class: "sun-navbar-center" }, Jt = /* @__PURE__ */ m({
102
+ __name: "index",
103
+ setup(n) {
104
+ const e = me(), s = {
105
+ "--navbar-height": g(e.height),
106
+ "--navbar-content-height": g(e.buttonHeight),
107
+ "--navbar-padding-top": g(e.paddingTop),
108
+ "--navbar-padding-bottom": g(e.paddingBottom),
109
+ "--navbar-padding-left": g(e.paddingLeft),
110
+ "--navbar-padding-right": g(e.paddingRight)
111
+ };
112
+ return (t, o) => (Me(), Ae("view", {
113
+ class: "sun-navbar",
114
+ style: s
115
+ }, [
116
+ X("view", Oe, [
117
+ D(t.$slots, "default"),
118
+ X("view", We, [
119
+ D(t.$slots, "center")
120
+ ])
121
+ ])
122
+ ]));
123
+ }
124
+ }), H = c, N = S, Ye = _, De = ue, Xe = E, He = G, Ke = i, je = d, qe = { class: "sun-popover-trigger" }, Zt = /* @__PURE__ */ m({
125
+ __name: "index",
126
+ props: {
127
+ /** 是否显示 */
128
+ show: {
129
+ type: Boolean,
130
+ default: void 0
131
+ },
132
+ /** popover的横轴位置:left,right,start,end,center */
133
+ x: {
134
+ type: String,
135
+ default: "left"
136
+ },
137
+ /** popover的纵轴位置:top,bottom,start,end,center */
138
+ y: {
139
+ type: String,
140
+ default: "center"
141
+ },
142
+ /** 横轴偏移度 */
143
+ offsetX: {
144
+ type: String,
145
+ default: "7.5rpx"
146
+ },
147
+ /** 纵轴偏移度 */
148
+ offsetY: {
149
+ type: String,
150
+ default: "7.5rpx"
151
+ },
152
+ /** popover背景 */
153
+ bg: {
154
+ type: String,
155
+ default: "#fff"
156
+ },
157
+ /** popover文字颜色 */
158
+ color: {
159
+ type: String,
160
+ default: "#000"
161
+ }
162
+ },
163
+ setup(n) {
164
+ return (e, s) => (Ke(), je("view", {
165
+ class: Xe(["sun-popover", [{ "sun-popover-show": n.show }, `sun-popover-x-${n.x}`, `sun-popover-y-${n.y}`]]),
166
+ style: He({ "--popover-x-offset": n.offsetX, "--popover-y-offset": n.offsetY, "--popover-background": n.bg }),
167
+ onTap: De((t) => !1, ["stop"])
168
+ }, [
169
+ N("view", qe, [
170
+ H(e.$slots, "default")
171
+ ]),
172
+ N("view", Ye(e.$attrs, {
173
+ class: "sun-popover-container",
174
+ style: { color: n.color }
175
+ }), [
176
+ s[0] || (s[0] = N("view", { class: "sun-popover-arrow" }, null, -1)),
177
+ H(e.$slots, "content")
178
+ ], 16)
179
+ ], 38));
180
+ }
181
+ }), ne = Symbol(), se = Symbol(), T = U, Ge = c, Qe = _, Ue = i, Je = d, en = /* @__PURE__ */ m({
182
+ __name: "segment-btn",
183
+ props: {
184
+ value: {}
185
+ },
186
+ setup(n) {
187
+ const e = O(ne), s = O(se), t = Q();
188
+ return ce(() => {
189
+ s.unlink(t);
190
+ }), s.link(t), (o, r) => {
191
+ var l;
192
+ return Ue(), Je("view", Qe(o.$attrs, {
193
+ class: ["sun-segment-btn", { "sun-segment-btn-active": ((l = T(e)) == null ? void 0 : l.props.value) === o.value }],
194
+ onTap: r[0] || (r[0] = (y) => T(s).active(T(t)))
195
+ }), [
196
+ Ge(o.$slots, "default")
197
+ ], 16);
198
+ };
199
+ }
200
+ }), Ze = c, et = S, tt = _, nt = i, st = d, ot = { class: "sun-segment-inner" }, tn = /* @__PURE__ */ m({
201
+ __name: "segment",
202
+ props: {
203
+ modelValue: {}
204
+ },
205
+ emits: ["update:modelValue", "change"],
206
+ setup(n, { emit: e }) {
207
+ const s = e, t = n, o = Q(), r = ie(null), l = de([]), y = u(() => l.indexOf(r.value)), f = u(() => l.length), V = u(() => ({
208
+ "--segment-length": f.value,
209
+ "--segment-active-index": y.value
210
+ }));
211
+ W(ne, r), W(se, {
212
+ link: (a) => {
213
+ const $ = h();
214
+ l.push(a), l.sort((z, k) => {
215
+ const w = $.indexOf(z.vnode), B = $.indexOf(k.vnode);
216
+ return w - B;
217
+ });
218
+ },
219
+ unlink: (a) => {
220
+ l.slice(l.indexOf(a), 1);
221
+ },
222
+ active: (a) => {
223
+ s("change", {
224
+ value: a.props.value,
225
+ index: y.value
226
+ }), s("update:modelValue", a.props.value), r.value = a;
227
+ }
228
+ }), pe(() => t.modelValue, (a) => {
229
+ r.value = l.find(($) => $.props.value === a);
230
+ });
231
+ function h() {
232
+ return o.subTree.children[0].children[0].children.filter((a) => typeof a.type != "symbol");
233
+ }
234
+ return J(() => {
235
+ const a = h();
236
+ l.forEach(($) => {
237
+ var k, w;
238
+ const z = a.findIndex((B) => B === $.vnode);
239
+ (w = (k = $.props).value) != null || (k.value = z), $.props.value === t.modelValue && (r.value = $);
240
+ });
241
+ }), (a, $) => (nt(), st("view", tt(a.$attrs, {
242
+ class: "sun-segment",
243
+ style: V.value
244
+ }), [
245
+ et("view", ot, [
246
+ Ze(a.$slots, "default")
247
+ ])
248
+ ], 16));
249
+ }
250
+ }), rt = Z, lt = ee, I = i, R = d, K = S, at = c, ut = q, ct = E, it = { class: "sun-spinner-dot" }, dt = {
251
+ key: 0,
252
+ class: "sun-spinner-desc"
253
+ }, nn = /* @__PURE__ */ m({
254
+ __name: "index",
255
+ props: {
256
+ size: {},
257
+ spinning: { type: Boolean }
258
+ },
259
+ setup(n) {
260
+ const e = n, s = u(() => [
261
+ {
262
+ "sun-spinner-spinning": e.spinning
263
+ },
264
+ `sun-spinner-${e.size}`
265
+ ]);
266
+ return (t, o) => (I(), R("view", {
267
+ class: ct(["sun-spinner", s.value])
268
+ }, [
269
+ K("view", it, [
270
+ (I(), R(lt, null, rt(4, (r) => K("view", {
271
+ key: r,
272
+ class: "sun-spinner-dot-item"
273
+ })), 64))
274
+ ]),
275
+ t.$slots.default ? (I(), R("view", dt, [
276
+ at(t.$slots, "default")
277
+ ])) : ut("", !0)
278
+ ], 2));
279
+ }
280
+ }), pt = {}, mt = c, vt = _, ft = i, $t = d;
281
+ function _t(n, e) {
282
+ return ft(), $t("view", vt(n.$attrs, { class: "sun-sudoku-item" }), [
283
+ mt(n.$slots, "default")
284
+ ], 16);
285
+ }
286
+ const sn = /* @__PURE__ */ te(pt, [["render", _t]]), ht = c, bt = _, gt = i, yt = d, on = /* @__PURE__ */ m({
287
+ __name: "sudoku",
288
+ props: {
289
+ size: String,
290
+ count: {
291
+ type: Number,
292
+ default: 9
293
+ }
294
+ },
295
+ setup(n) {
296
+ const e = n, s = u(() => ({
297
+ "sun-sudoku-sm": e.count === 1,
298
+ "sun-sudoku-md": e.count === 2 || e.count === 4,
299
+ "sun-sudoku-lg": e.count === 3 || e.count > 4
300
+ }));
301
+ return (t, o) => (gt(), yt("view", bt(t.$attrs, {
302
+ class: ["sun-sudoku", s.value],
303
+ style: { "--sudoku-width": n.size }
304
+ }), [
305
+ ht(t.$slots, "default")
306
+ ], 16));
307
+ }
308
+ }), St = c, kt = _, wt = i, Bt = d, rn = /* @__PURE__ */ m({
309
+ __name: "table-cell",
310
+ props: {
311
+ sticky: {},
312
+ width: {},
313
+ maxWidth: {},
314
+ ellipsis: { type: Boolean },
315
+ breakWord: { type: Boolean }
316
+ },
317
+ setup(n) {
318
+ const e = n, s = u(() => ({
319
+ "sun-tb-cell-sticky-left": e.sticky === "left",
320
+ "sun-tb-cell-sticky-right": e.sticky === "right",
321
+ "sun-tb-cell-ellipsis": e.ellipsis,
322
+ "sun-tb-cell-break-word": e.breakWord
323
+ }));
324
+ return (t, o) => (wt(), Bt("view", kt(t.$attrs, {
325
+ class: ["sun-tb-cell", s.value],
326
+ style: { width: t.width, "min-width": t.width, "max-width": t.maxWidth }
327
+ }), [
328
+ St(t.$slots, "default")
329
+ ], 16));
330
+ }
331
+ }), zt = c, Et = _, Ct = i, xt = d, ln = /* @__PURE__ */ m({
332
+ __name: "table-row",
333
+ props: {
334
+ head: { type: Boolean },
335
+ foot: { type: Boolean }
336
+ },
337
+ setup(n) {
338
+ return (e, s) => (Ct(), xt("view", Et(e.$attrs, {
339
+ class: ["sun-tb-row", { "sun-tb-head": e.head, "sun-tb-foot": e.foot }]
340
+ }), [
341
+ zt(e.$slots, "default")
342
+ ], 16));
343
+ }
344
+ }), Vt = c, Pt = E, Nt = S, Tt = _, It = i, Rt = d, an = /* @__PURE__ */ m({
345
+ __name: "table",
346
+ props: {
347
+ rounded: { type: Boolean, default: !0 },
348
+ bordered: { type: Boolean },
349
+ outerBordered: { type: Boolean, default: !0 },
350
+ zebra: { type: Boolean },
351
+ size: {},
352
+ layout: {}
353
+ },
354
+ setup(n) {
355
+ const e = n, s = u(() => ({
356
+ "sun-tb-rounded": e.rounded,
357
+ "sun-tb-bordered": e.bordered,
358
+ "sun-tb-outer-bordered": e.outerBordered,
359
+ [`sun-tb-size-${e.size}`]: e.size
360
+ })), t = u(() => ({
361
+ "sun-tb-zebra": e.zebra,
362
+ [`sun-tb-layout-${e.layout}`]: e.layout
363
+ }));
364
+ return (o, r) => (It(), Rt("view", Tt(o.$attrs, {
365
+ class: ["sun-tb", s.value]
366
+ }), [
367
+ Nt("view", {
368
+ class: Pt(["sun-tb-inner", t.value])
369
+ }, [
370
+ Vt(o.$slots, "default")
371
+ ], 2)
372
+ ], 16));
373
+ }
374
+ }), Ft = Z, Lt = ee, F = i, L = d, Mt = c, M = G, j = S, At = U, Ot = _, Wt = ["id", "refresher-enabled", "refresher-triggered", "refresher-background", "scroll-x", "scroll-y"];
375
+ let Yt = 1;
376
+ const un = /* @__PURE__ */ m({
377
+ __name: "index",
378
+ props: {
379
+ refreshing: { type: Boolean },
380
+ refresher: { type: Boolean },
381
+ refresherBg: { default: "transparent" },
382
+ direction: { default: "vertical" },
383
+ items: {},
384
+ itemSize: {},
385
+ itemKey: {},
386
+ id: { default: () => `sun-virtual-scroll-${Yt++}` },
387
+ bottomSpace: { default: 0 }
388
+ },
389
+ emits: ["refresh", "lower"],
390
+ setup(n, { emit: e }) {
391
+ const s = e, t = n;
392
+ let o;
393
+ const r = x(0), l = x(0), y = x(0), f = u(() => t.direction === "vertical"), V = u(() => ({
394
+ right: f.value ? "0" : "auto",
395
+ transform: `translate${f.value ? "Y" : "X"}(${y.value}px)`,
396
+ "white-space": f.value ? "normal" : "nowrap"
397
+ })), h = u(() => typeof t.itemSize == "number" ? t.itemSize : t.itemSize.endsWith("rpx") ? ve(parseFloat(t.itemSize)) : parseFloat(t.itemSize)), a = u(() => h.value * t.items.length), $ = u(() => ({
398
+ [f.value ? "height" : "width"]: g(a.value + t.bottomSpace)
399
+ })), z = u(() => ({
400
+ display: f.value ? "block" : "inline-block",
401
+ [f.value ? "height" : "width"]: g(h.value)
402
+ })), k = u(
403
+ () => t.items.slice(
404
+ Math.max(l.value - r.value, 0),
405
+ l.value + r.value * 2
406
+ )
407
+ );
408
+ function w({ detail: v }) {
409
+ o && cancelAnimationFrame(o), o = requestAnimationFrame(() => {
410
+ const p = f.value ? v.scrollTop : v.scrollLeft;
411
+ l.value = ~~(p / h.value), l.value > r.value - 1 ? y.value = p - h.value * r.value - p % h.value : y.value = p - p % (h.value * r.value), o = 0;
412
+ });
413
+ }
414
+ function B() {
415
+ setTimeout(() => {
416
+ $e().select(`#${t.id}`).boundingClientRect((v) => {
417
+ if (!v)
418
+ return B();
419
+ const { height: p, width: b } = v, C = f.value ? p : b;
420
+ r.value = Math.ceil(C / h.value);
421
+ }).exec();
422
+ });
423
+ }
424
+ return J(() => {
425
+ B();
426
+ }), (v, p) => (F(), L("scroll-view", Ot(v.$attrs, {
427
+ id: v.id,
428
+ class: "sun-virtual-scroll",
429
+ "refresher-enabled": v.refresher,
430
+ "refresher-triggered": v.refreshing,
431
+ "refresher-background": v.refresherBg,
432
+ "scroll-x": !f.value,
433
+ "scroll-y": f.value,
434
+ enhanced: !0,
435
+ "enable-passive": !0,
436
+ "lower-threshold": 300,
437
+ onScrollPassive: p[0] || (p[0] = (b) => w(b)),
438
+ onRefresherrefresh: p[1] || (p[1] = (b) => {
439
+ At(fe).short("light"), s("refresh");
440
+ }),
441
+ onScrolltolower: p[2] || (p[2] = (b) => s("lower"))
442
+ }), [
443
+ j("view", {
444
+ class: "sun-virtual-scroll-content-container",
445
+ style: M(V.value)
446
+ }, [
447
+ (F(!0), L(Lt, null, Ft(k.value, (b, C) => {
448
+ var A;
449
+ return F(), L("view", {
450
+ key: (A = b[v.itemKey]) != null ? A : C,
451
+ class: "sun-virtual-scroll-item",
452
+ style: M(z.value)
453
+ }, [
454
+ Mt(v.$slots, "default", {
455
+ item: b,
456
+ index: C
457
+ })
458
+ ], 4);
459
+ }), 128))
460
+ ], 4),
461
+ j("view", {
462
+ class: "sun-virtual-scroll-spacer",
463
+ style: M($.value)
464
+ }, null, 4)
465
+ ], 16, Wt));
466
+ }
467
+ });
468
+ export {
469
+ jt as SunAccordion,
470
+ qt as SunChip,
471
+ Qt as SunFab,
472
+ Gt as SunFabGroup,
473
+ Ut as SunLazyRender,
474
+ Jt as SunNavbar,
475
+ Zt as SunPopover,
476
+ tn as SunSegment,
477
+ en as SunSegmentBtn,
478
+ nn as SunSpinner,
479
+ on as SunSudoku,
480
+ sn as SunSudokuItem,
481
+ an as SunTb,
482
+ rn as SunTbCell,
483
+ ln as SunTbRow,
484
+ un as SunVirtualScroll
485
+ };
@@ -0,0 +1,43 @@
1
+ declare function __VLS_template(): {
2
+ default?(_: {}): any;
3
+ };
4
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
+ delay?: number;
6
+ hook?: "activated" | "created";
7
+ }>, {
8
+ delay: number;
9
+ hook: string;
10
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
11
+ delay?: number;
12
+ hook?: "activated" | "created";
13
+ }>, {
14
+ delay: number;
15
+ hook: string;
16
+ }>>> & Readonly<{}>, {
17
+ delay: number;
18
+ hook: "activated" | "created";
19
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
20
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
21
+ export default _default;
22
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
23
+ type __VLS_TypePropsToRuntimeProps<T> = {
24
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
25
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
26
+ } : {
27
+ type: import('vue').PropType<T[K]>;
28
+ required: true;
29
+ };
30
+ };
31
+ type __VLS_WithDefaults<P, D> = {
32
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
33
+ default: D[K];
34
+ }> : P[K];
35
+ };
36
+ type __VLS_Prettify<T> = {
37
+ [K in keyof T]: T[K];
38
+ } & {};
39
+ type __VLS_WithTemplateSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -0,0 +1,12 @@
1
+ declare function __VLS_template(): {
2
+ default?(_: {}): any;
3
+ center?(_: {}): any;
4
+ };
5
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
6
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
7
+ export default _default;
8
+ type __VLS_WithTemplateSlots<T, S> = T & {
9
+ new (): {
10
+ $slots: S;
11
+ };
12
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solar-taro/ui-sun",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",