@solar-taro/ui-sun 1.0.2 → 1.1.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 1.0.3 (2025-02-17)
2
+
3
+ This was a version bump only for ui-sun to align it with other projects, there were no code changes.
4
+
5
+ ## 1.0.2 (2025-02-08)
6
+
7
+ This was a version bump only for ui-sun to align it with other projects, there were no code changes.
8
+
1
9
  ## 1.0.1 (2025-01-22)
2
10
 
3
11
  This was a version bump only for ui-sun to align it with other projects, there were no code changes.
package/index.js CHANGED
@@ -1,485 +1,34 @@
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
- });
1
+ import { default as r } from "./index2.js";
2
+ import { default as u } from "./index3.js";
3
+ import { default as f } from "./index4.js";
4
+ import { default as S } from "./index5.js";
5
+ import { default as d } from "./index6.js";
6
+ import { default as m } from "./index7.js";
7
+ import { default as x } from "./index8.js";
8
+ import { default as i } from "./index9.js";
9
+ import { default as T } from "./index10.js";
10
+ import { default as k } from "./index11.js";
11
+ import { default as C } from "./index12.js";
12
+ import { default as R } from "./index13.js";
13
+ import { default as w } from "./index14.js";
14
+ import { default as z } from "./index15.js";
15
+ import { default as B } from "./index16.js";
16
+ import { default as I } from "./index17.js";
468
17
  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
18
+ r as SunAccordion,
19
+ u as SunChip,
20
+ B as SunFab,
21
+ f as SunFabGroup,
22
+ S as SunLazyRender,
23
+ d as SunNavbar,
24
+ m as SunPopover,
25
+ i as SunSegment,
26
+ x as SunSegmentBtn,
27
+ T as SunSpinner,
28
+ k as SunSudoku,
29
+ I as SunSudokuItem,
30
+ w as SunTb,
31
+ C as SunTbCell,
32
+ R as SunTbRow,
33
+ z as SunVirtualScroll
485
34
  };
package/index10.js ADDED
@@ -0,0 +1,35 @@
1
+ import { defineComponent as a, computed as c, renderList as p, Fragment as m, openBlock as d, createElementBlock as u, createElementVNode as _, renderSlot as f, createCommentVNode as k, normalizeClass as g } from "vue";
2
+ const v = p, B = m, e = d, n = u, o = _, C = f, N = k, w = g, z = { class: "sun-spinner-dot" }, E = {
3
+ key: 0,
4
+ class: "sun-spinner-desc"
5
+ }, y = /* @__PURE__ */ a({
6
+ __name: "index",
7
+ props: {
8
+ size: {},
9
+ spinning: { type: Boolean }
10
+ },
11
+ setup(r) {
12
+ const s = r, i = c(() => [
13
+ {
14
+ "sun-spinner-spinning": s.spinning
15
+ },
16
+ `sun-spinner-${s.size}`
17
+ ]);
18
+ return (t, V) => (e(), n("view", {
19
+ class: w(["sun-spinner", i.value])
20
+ }, [
21
+ o("view", z, [
22
+ (e(), n(B, null, v(4, (l) => o("view", {
23
+ key: l,
24
+ class: "sun-spinner-dot-item"
25
+ })), 64))
26
+ ]),
27
+ t.$slots.default ? (e(), n("view", E, [
28
+ C(t.$slots, "default")
29
+ ])) : N("", !0)
30
+ ], 2));
31
+ }
32
+ });
33
+ export {
34
+ y as default
35
+ };
package/index11.js ADDED
@@ -0,0 +1,27 @@
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",
4
+ props: {
5
+ size: String,
6
+ count: {
7
+ type: Number,
8
+ default: 9
9
+ }
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 }
20
+ }), [
21
+ a(s.$slots, "default")
22
+ ], 16));
23
+ }
24
+ });
25
+ export {
26
+ _ as default
27
+ };
package/index12.js ADDED
@@ -0,0 +1,28 @@
1
+ import { defineComponent as o, computed as r, renderSlot as i, mergeProps as n, openBlock as c, createElementBlock as a } from "vue";
2
+ const p = i, d = n, m = c, k = a, b = /* @__PURE__ */ o({
3
+ __name: "table-cell",
4
+ props: {
5
+ sticky: {},
6
+ width: {},
7
+ maxWidth: {},
8
+ ellipsis: { type: Boolean },
9
+ breakWord: { type: Boolean }
10
+ },
11
+ setup(l) {
12
+ const t = l, s = r(() => ({
13
+ "sun-tb-cell-sticky-left": t.sticky === "left",
14
+ "sun-tb-cell-sticky-right": t.sticky === "right",
15
+ "sun-tb-cell-ellipsis": t.ellipsis,
16
+ "sun-tb-cell-break-word": t.breakWord
17
+ }));
18
+ return (e, u) => (m(), k("view", d(e.$attrs, {
19
+ class: ["sun-tb-cell", s.value],
20
+ style: { width: e.width, "min-width": e.width, "max-width": e.maxWidth }
21
+ }), [
22
+ p(e.$slots, "default")
23
+ ], 16));
24
+ }
25
+ });
26
+ export {
27
+ b as default
28
+ };
package/index13.js ADDED
@@ -0,0 +1,18 @@
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
+ props: {
5
+ head: { type: Boolean },
6
+ foot: { type: Boolean }
7
+ },
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 }]
11
+ }), [
12
+ a(e.$slots, "default")
13
+ ], 16));
14
+ }
15
+ });
16
+ export {
17
+ u as default
18
+ };
package/index14.js ADDED
@@ -0,0 +1,35 @@
1
+ import { defineComponent as a, computed as t, 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, z = c, y = p, k = /* @__PURE__ */ a({
3
+ __name: "table",
4
+ props: {
5
+ rounded: { type: Boolean, default: !0 },
6
+ bordered: { type: Boolean },
7
+ outerBordered: { type: Boolean, default: !0 },
8
+ zebra: { type: Boolean },
9
+ size: {},
10
+ layout: {}
11
+ },
12
+ setup(r) {
13
+ const e = r, n = t(() => ({
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
+ })), s = t(() => ({
19
+ "sun-tb-zebra": e.zebra,
20
+ [`sun-tb-layout-${e.layout}`]: e.layout
21
+ }));
22
+ return (o, f) => (z(), y("view", _(o.$attrs, {
23
+ class: ["sun-tb", n.value]
24
+ }), [
25
+ B("view", {
26
+ class: i(["sun-tb-inner", s.value])
27
+ }, [
28
+ m(o.$slots, "default")
29
+ ], 2)
30
+ ], 16));
31
+ }
32
+ });
33
+ export {
34
+ k as default
35
+ };
package/index15.js ADDED
@@ -0,0 +1,101 @@
1
+ import { defineComponent as I, ref as m, computed as s, onMounted as C, renderList as E, Fragment as V, openBlock as _, createElementBlock as L, renderSlot as M, normalizeStyle as T, createElementVNode as A, unref as K, mergeProps as N } from "vue";
2
+ import { withPixel as y } from "@solar-kit/core";
3
+ import { rpxToPx as R, vibrator as q } from "@solar-taro/core";
4
+ import { createSelectorQuery as D } from "@tarojs/taro";
5
+ const O = E, Q = V, f = _, d = L, W = M, p = T, w = A, X = K, Y = N, j = ["id", "refresher-enabled", "refresher-triggered", "refresher-background", "scroll-x", "scroll-y"];
6
+ let G = 1;
7
+ const ee = /* @__PURE__ */ I({
8
+ __name: "index",
9
+ props: {
10
+ refreshing: { type: Boolean },
11
+ refresher: { type: Boolean },
12
+ refresherBg: { default: "transparent" },
13
+ direction: { default: "vertical" },
14
+ items: {},
15
+ itemSize: {},
16
+ itemKey: {},
17
+ id: { default: () => `sun-virtual-scroll-${G++}` },
18
+ bottomSpace: { default: 0 }
19
+ },
20
+ emits: ["refresh", "lower"],
21
+ setup(b, { emit: z }) {
22
+ const h = z, t = b;
23
+ let a;
24
+ const i = m(0), u = m(0), v = m(0), l = s(() => t.direction === "vertical"), k = s(() => ({
25
+ right: l.value ? "0" : "auto",
26
+ transform: `translate${l.value ? "Y" : "X"}(${v.value}px)`,
27
+ "white-space": l.value ? "normal" : "nowrap"
28
+ })), n = s(() => typeof t.itemSize == "number" ? t.itemSize : t.itemSize.endsWith("rpx") ? R(parseFloat(t.itemSize)) : parseFloat(t.itemSize)), B = s(() => n.value * t.items.length), $ = s(() => ({
29
+ [l.value ? "height" : "width"]: y(B.value + t.bottomSpace)
30
+ })), x = s(() => ({
31
+ display: l.value ? "block" : "inline-block",
32
+ [l.value ? "height" : "width"]: y(n.value)
33
+ })), F = s(
34
+ () => t.items.slice(
35
+ Math.max(u.value - i.value, 0),
36
+ u.value + i.value * 2
37
+ )
38
+ );
39
+ function P({ detail: r }) {
40
+ a && cancelAnimationFrame(a), a = requestAnimationFrame(() => {
41
+ const e = l.value ? r.scrollTop : r.scrollLeft;
42
+ u.value = ~~(e / n.value), u.value > i.value - 1 ? v.value = e - n.value * i.value - e % n.value : v.value = e - e % (n.value * i.value), a = 0;
43
+ });
44
+ }
45
+ function S() {
46
+ setTimeout(() => {
47
+ D().select(`#${t.id}`).boundingClientRect((r) => {
48
+ if (!r)
49
+ return S();
50
+ const { height: e, width: o } = r, c = l.value ? e : o;
51
+ i.value = Math.ceil(c / n.value);
52
+ }).exec();
53
+ });
54
+ }
55
+ return C(() => {
56
+ S();
57
+ }), (r, e) => (f(), d("scroll-view", Y(r.$attrs, {
58
+ id: r.id,
59
+ class: "sun-virtual-scroll",
60
+ "refresher-enabled": r.refresher,
61
+ "refresher-triggered": r.refreshing,
62
+ "refresher-background": r.refresherBg,
63
+ "scroll-x": !l.value,
64
+ "scroll-y": l.value,
65
+ enhanced: !0,
66
+ "enable-passive": !0,
67
+ "lower-threshold": 300,
68
+ onScrollPassive: e[0] || (e[0] = (o) => P(o)),
69
+ onRefresherrefresh: e[1] || (e[1] = (o) => {
70
+ X(q).short("light"), h("refresh");
71
+ }),
72
+ onScrolltolower: e[2] || (e[2] = (o) => h("lower"))
73
+ }), [
74
+ w("view", {
75
+ class: "sun-virtual-scroll-content-container",
76
+ style: p(k.value)
77
+ }, [
78
+ (f(!0), d(Q, null, O(F.value, (o, c) => {
79
+ var g;
80
+ return f(), d("view", {
81
+ key: (g = o[r.itemKey]) != null ? g : c,
82
+ class: "sun-virtual-scroll-item",
83
+ style: p(x.value)
84
+ }, [
85
+ W(r.$slots, "default", {
86
+ item: o,
87
+ index: c
88
+ })
89
+ ], 4);
90
+ }), 128))
91
+ ], 4),
92
+ w("view", {
93
+ class: "sun-virtual-scroll-spacer",
94
+ style: p($.value)
95
+ }, null, 4)
96
+ ], 16, j));
97
+ }
98
+ });
99
+ export {
100
+ ee as default
101
+ };
package/index16.js ADDED
@@ -0,0 +1,12 @@
1
+ import { renderSlot as r, mergeProps as o, openBlock as t, createElementBlock as n } from "vue";
2
+ import c from "./index19.js";
3
+ const s = {}, l = r, a = o, f = t, _ = n;
4
+ function m(e, p) {
5
+ return f(), _("view", a(e.$attrs, { class: "sun-fab" }), [
6
+ l(e.$slots, "default")
7
+ ], 16);
8
+ }
9
+ const u = /* @__PURE__ */ c(s, [["render", m]]);
10
+ export {
11
+ u as default
12
+ };
package/index17.js ADDED
@@ -0,0 +1,12 @@
1
+ import { renderSlot as o, mergeProps as r, openBlock as t, createElementBlock as s } from "vue";
2
+ import n from "./index19.js";
3
+ const c = {}, l = o, m = r, _ = t, a = s;
4
+ function u(e, d) {
5
+ return _(), a("view", m(e.$attrs, { class: "sun-sudoku-item" }), [
6
+ l(e.$slots, "default")
7
+ ], 16);
8
+ }
9
+ const i = /* @__PURE__ */ n(c, [["render", u]]);
10
+ export {
11
+ i as default
12
+ };
package/index18.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index4.js";
2
+ export {
3
+ f as default
4
+ };
package/index19.js ADDED
@@ -0,0 +1,9 @@
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
+ };
7
+ export {
8
+ s as default
9
+ };
package/index2.js ADDED
@@ -0,0 +1,35 @@
1
+ import { defineComponent as c, mergeModels as r, useModel as i, renderSlot as p, createElementVNode as u, normalizeClass as m, openBlock as _, createElementBlock as f } from "vue";
2
+ const d = p, n = u, v = m, x = _, B = f, k = { class: "sun-accordion-content" }, w = { class: "sun-accordion-content-inner" }, C = /* @__PURE__ */ c({
3
+ __name: "index",
4
+ props: /* @__PURE__ */ r({
5
+ disabled: { type: Boolean }
6
+ }, {
7
+ expanded: { type: Boolean },
8
+ expandedModifiers: {}
9
+ }),
10
+ emits: ["update:expanded"],
11
+ setup(o) {
12
+ const l = o, e = i(o, "expanded");
13
+ function t() {
14
+ l.disabled || (e.value = !e.value);
15
+ }
16
+ return (s, a) => (x(), B("view", {
17
+ class: v(["sun-accordion", { "sun-accordion-expanded": e.value }])
18
+ }, [
19
+ n("view", {
20
+ class: "sun-accordion-header",
21
+ onTap: a[0] || (a[0] = (E) => t())
22
+ }, [
23
+ d(s.$slots, "default")
24
+ ], 32),
25
+ n("view", k, [
26
+ n("view", w, [
27
+ d(s.$slots, "content", { toggle: t })
28
+ ])
29
+ ])
30
+ ], 2));
31
+ }
32
+ });
33
+ export {
34
+ C as default
35
+ };
package/index20.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index2.js";
2
+ export {
3
+ f as default
4
+ };
package/index21.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index5.js";
2
+ export {
3
+ f as default
4
+ };
package/index22.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index6.js";
2
+ export {
3
+ f as default
4
+ };
package/index23.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index10.js";
2
+ export {
3
+ f as default
4
+ };
package/index24.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index7.js";
2
+ export {
3
+ f as default
4
+ };
package/index25.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index3.js";
2
+ export {
3
+ f as default
4
+ };
package/index26.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index8.js";
2
+ export {
3
+ f as default
4
+ };
package/index27.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index9.js";
2
+ export {
3
+ f as default
4
+ };
package/index28.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index12.js";
2
+ export {
3
+ f as default
4
+ };
package/index29.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index13.js";
2
+ export {
3
+ f as default
4
+ };
package/index3.js ADDED
@@ -0,0 +1,24 @@
1
+ import { defineComponent as n, computed as l, renderSlot as c, normalizeClass as r, openBlock as a, createElementBlock as p } from "vue";
2
+ const u = c, i = r, d = a, m = p, h = /* @__PURE__ */ n({
3
+ __name: "index",
4
+ props: {
5
+ type: { default: "translucent" },
6
+ size: { default: "default" },
7
+ color: {}
8
+ },
9
+ setup(o) {
10
+ const e = o, s = l(() => [
11
+ `sun-chip-${e.size}`,
12
+ `sun-chip-${e.type}`,
13
+ `sun-chip-${e.color}`
14
+ ]);
15
+ return (t, _) => (d(), m("view", {
16
+ class: i(["sun-chip", s.value])
17
+ }, [
18
+ u(t.$slots, "default")
19
+ ], 2));
20
+ }
21
+ });
22
+ export {
23
+ h as default
24
+ };
package/index30.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index14.js";
2
+ export {
3
+ f as default
4
+ };
package/index31.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index11.js";
2
+ export {
3
+ f as default
4
+ };
package/index32.js ADDED
@@ -0,0 +1,4 @@
1
+ import f from "./index15.js";
2
+ export {
3
+ f as default
4
+ };
package/index33.js ADDED
@@ -0,0 +1,5 @@
1
+ const o = Symbol(), t = Symbol();
2
+ export {
3
+ o as ACTIVE_CHILD,
4
+ t as PARENT
5
+ };
package/index4.js ADDED
@@ -0,0 +1,21 @@
1
+ import { defineComponent as o, renderSlot as r, mergeProps as s, openBlock as n, createElementBlock as a } from "vue";
2
+ const l = r, p = s, c = n, f = a, _ = /* @__PURE__ */ o({
3
+ __name: "fab-group",
4
+ props: {
5
+ offsetY: {
6
+ type: [Number, String],
7
+ default: 0
8
+ }
9
+ },
10
+ setup(t) {
11
+ return (e, m) => (c(), f("view", p(e.$attrs, {
12
+ class: "sun-fab-group",
13
+ style: { bottom: `calc(${15 + +t.offsetY}px + var(--safe-bottom))` }
14
+ }), [
15
+ l(e.$slots, "default")
16
+ ], 16));
17
+ }
18
+ });
19
+ export {
20
+ _ as default
21
+ };
package/index5.js ADDED
@@ -0,0 +1,25 @@
1
+ import { defineComponent as d, ref as l, onActivated as c, onDeactivated as s, renderSlot as u, createCommentVNode as f } from "vue";
2
+ const i = u, m = f, v = /* @__PURE__ */ d({
3
+ __name: "index",
4
+ props: {
5
+ delay: { default: 50 },
6
+ hook: { default: "activated" }
7
+ },
8
+ setup(r) {
9
+ const o = r, e = l(!1);
10
+ let t;
11
+ function a() {
12
+ t = setTimeout(() => {
13
+ e.value = !0;
14
+ }, o.delay);
15
+ }
16
+ return o.hook === "created" && a(), c(() => {
17
+ a();
18
+ }), s(() => {
19
+ e.value = !1, t && clearTimeout(t);
20
+ }), (n, p) => e.value ? i(n.$slots, "default", { key: 0 }) : m("", !0);
21
+ }
22
+ });
23
+ export {
24
+ v as default
25
+ };
package/index6.js ADDED
@@ -0,0 +1,30 @@
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({
5
+ __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")
23
+ ])
24
+ ])
25
+ ]));
26
+ }
27
+ });
28
+ export {
29
+ k as default
30
+ };
package/index7.js ADDED
@@ -0,0 +1,62 @@
1
+ import { defineComponent as l, renderSlot as s, createElementVNode as a, mergeProps as f, withModifiers as p, normalizeClass as i, normalizeStyle as u, openBlock as d, createElementBlock as c } from "vue";
2
+ const n = s, t = a, v = f, m = p, y = i, g = u, w = d, S = c, x = { class: "sun-popover-trigger" }, k = /* @__PURE__ */ l({
3
+ __name: "index",
4
+ props: {
5
+ /** 是否显示 */
6
+ show: {
7
+ type: Boolean,
8
+ default: void 0
9
+ },
10
+ /** popover的横轴位置:left,right,start,end,center */
11
+ x: {
12
+ type: String,
13
+ default: "left"
14
+ },
15
+ /** popover的纵轴位置:top,bottom,start,end,center */
16
+ y: {
17
+ type: String,
18
+ default: "center"
19
+ },
20
+ /** 横轴偏移度 */
21
+ offsetX: {
22
+ type: String,
23
+ default: "7.5rpx"
24
+ },
25
+ /** 纵轴偏移度 */
26
+ offsetY: {
27
+ type: String,
28
+ default: "7.5rpx"
29
+ },
30
+ /** popover背景 */
31
+ bg: {
32
+ type: String,
33
+ default: "#fff"
34
+ },
35
+ /** popover文字颜色 */
36
+ color: {
37
+ type: String,
38
+ default: "#000"
39
+ }
40
+ },
41
+ setup(e) {
42
+ return (o, r) => (w(), S("view", {
43
+ class: y(["sun-popover", [{ "sun-popover-show": e.show }, `sun-popover-x-${e.x}`, `sun-popover-y-${e.y}`]]),
44
+ style: g({ "--popover-x-offset": e.offsetX, "--popover-y-offset": e.offsetY, "--popover-background": e.bg }),
45
+ onTap: m(($) => !1, ["stop"])
46
+ }, [
47
+ t("view", x, [
48
+ n(o.$slots, "default")
49
+ ]),
50
+ t("view", v(o.$attrs, {
51
+ class: "sun-popover-container",
52
+ style: { color: e.color }
53
+ }), [
54
+ r[0] || (r[0] = t("view", { class: "sun-popover-arrow" }, null, -1)),
55
+ n(o.$slots, "content")
56
+ ], 16)
57
+ ], 38));
58
+ }
59
+ });
60
+ export {
61
+ k as default
62
+ };
package/index8.js ADDED
@@ -0,0 +1,25 @@
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 "./index33.js";
3
+ const o = u, k = i, C = _, B = f, E = v, $ = /* @__PURE__ */ p({
4
+ __name: "segment-btn",
5
+ props: {
6
+ value: {}
7
+ },
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
+ };
21
+ }
22
+ });
23
+ export {
24
+ $ as default
25
+ };
package/index9.js ADDED
@@ -0,0 +1,56 @@
1
+ import { defineComponent as x, getCurrentInstance as V, shallowRef as E, shallowReactive as k, computed as c, provide as m, 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 "./index33.js";
3
+ const R = y, T = B, b = I, L = O, S = A, $ = { class: "sun-segment-inner" }, M = /* @__PURE__ */ x({
4
+ __name: "segment",
5
+ props: {
6
+ modelValue: {}
7
+ },
8
+ emits: ["update:modelValue", "change"],
9
+ setup(v, { emit: f }) {
10
+ const d = f, u = v, g = V(), o = E(null), t = k([]), i = c(() => t.indexOf(o.value)), h = c(() => t.length), _ = c(() => ({
11
+ "--segment-length": h.value,
12
+ "--segment-active-index": i.value
13
+ }));
14
+ m(N, o), m(P, {
15
+ link: (e) => {
16
+ const n = p();
17
+ t.push(e), t.sort((a, s) => {
18
+ const l = n.indexOf(a.vnode), r = n.indexOf(s.vnode);
19
+ return l - r;
20
+ });
21
+ },
22
+ unlink: (e) => {
23
+ t.slice(t.indexOf(e), 1);
24
+ },
25
+ active: (e) => {
26
+ d("change", {
27
+ value: e.props.value,
28
+ index: i.value
29
+ }), d("update:modelValue", e.props.value), o.value = e;
30
+ }
31
+ }), C(() => u.modelValue, (e) => {
32
+ o.value = t.find((n) => n.props.value === e);
33
+ });
34
+ function p() {
35
+ return g.subTree.children[0].children[0].children.filter((e) => typeof e.type != "symbol");
36
+ }
37
+ return w(() => {
38
+ const e = p();
39
+ t.forEach((n) => {
40
+ var s, l;
41
+ const a = e.findIndex((r) => r === n.vnode);
42
+ (l = (s = n.props).value) != null || (s.value = a), n.props.value === u.modelValue && (o.value = n);
43
+ });
44
+ }), (e, n) => (L(), S("view", b(e.$attrs, {
45
+ class: "sun-segment",
46
+ style: _.value
47
+ }), [
48
+ T("view", $, [
49
+ R(e.$slots, "default")
50
+ ])
51
+ ], 16));
52
+ }
53
+ });
54
+ export {
55
+ M as default
56
+ };
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@solar-taro/ui-sun",
3
- "version": "1.0.2",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
+ "module": "./index.js",
6
7
  "typings": "./index.d.ts",
7
8
  "sideEffects": false,
8
9
  "publishConfig": {