@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/CHANGELOG.md CHANGED
@@ -1,3 +1,23 @@
1
+ ## 3.1.1 (2026-07-10)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **ui-sun/stepper:** add size and expand properties
6
+
7
+ ### ❤️ Thank You
8
+
9
+ - HyperLife1119
10
+
11
+ ## 3.1.0 (2026-07-09)
12
+
13
+ ### 🚀 Features
14
+
15
+ - **ui-sun/stepper:** add Stepper component
16
+
17
+ ### ❤️ Thank You
18
+
19
+ - HyperLife1119
20
+
1
21
  # 3.0.0 (2026-07-08)
2
22
 
3
23
  ### 🚀 Features
package/_color.scss CHANGED
@@ -5,7 +5,7 @@
5
5
  $primary: map-get($primary-colors, "base");
6
6
  $secondary: #616161;
7
7
  $info: #2196f3;
8
- $success: #34d399;
8
+ $success: #10b981;
9
9
  $warning: #fbbf24;
10
10
  $danger: #f43f5e;
11
11
  $light: #f8fafc;
@@ -41,7 +41,7 @@
41
41
  ),
42
42
  warning: (
43
43
  base: $warning,
44
- contrast: #fff,
44
+ contrast: #000,
45
45
  shade: sun.get-color-shade($warning),
46
46
  tint: sun.get-color-tint($warning)
47
47
  ),
@@ -0,0 +1,17 @@
1
+ declare function __VLS_template(): {
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ rootEl: SVGViewElement;
8
+ };
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGViewElement>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
+ export default _default;
13
+ type __VLS_WithTemplateSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,17 @@
1
+ declare function __VLS_template(): {
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ rootEl: SVGViewElement;
8
+ };
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGViewElement>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
+ export default _default;
13
+ type __VLS_WithTemplateSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,17 @@
1
+ declare function __VLS_template(): {
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ rootEl: SVGViewElement;
8
+ };
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGViewElement>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
+ export default _default;
13
+ type __VLS_WithTemplateSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,17 @@
1
+ declare function __VLS_template(): {
2
+ attrs: Partial<{}>;
3
+ slots: {
4
+ default?(_: {}): any;
5
+ };
6
+ refs: {};
7
+ rootEl: SVGViewElement;
8
+ };
9
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
10
+ declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGViewElement>;
11
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
+ export default _default;
13
+ type __VLS_WithTemplateSlots<T, S> = T & {
14
+ new (): {
15
+ $slots: S;
16
+ };
17
+ };
@@ -0,0 +1,23 @@
1
+ import { Color } from '../typing';
2
+ type __VLS_Props = {
3
+ color?: Color;
4
+ };
5
+ declare function __VLS_template(): {
6
+ attrs: Partial<{}>;
7
+ slots: {
8
+ default?(_: {}): any;
9
+ };
10
+ refs: {};
11
+ rootEl: SVGViewElement;
12
+ };
13
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
14
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
15
+ color: Color;
16
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, SVGViewElement>;
17
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
18
+ export default _default;
19
+ type __VLS_WithTemplateSlots<T, S> = T & {
20
+ new (): {
21
+ $slots: S;
22
+ };
23
+ };
@@ -0,0 +1,5 @@
1
+ export { default as SunCardContent } from './card-content.vue';
2
+ export { default as SunCardHeader } from './card-header.vue';
3
+ export { default as SunCardSubtitle } from './card-subtitle.vue';
4
+ export { default as SunCardTitle } from './card-title.vue';
5
+ export { default as SunCard } from './card.vue';
@@ -0,0 +1,90 @@
1
+ .sun-card {
2
+ display: block;
3
+ border-radius: 8px;
4
+ color: rgba(var(--color-rgb), 1);
5
+ background: var(--background);
6
+ transition: transform 500ms cubic-bezier(0.12, 0.72, 0.29, 1);
7
+ font-size: 16px;
8
+ box-shadow: rgba(0, 0, 0, 0.12) 0 4px 16px;
9
+ overflow: hidden;
10
+
11
+ &-primary {
12
+ --color-rgb: var(--color-primary-contrast-rgb);
13
+ --background: var(--color-primary);
14
+ }
15
+
16
+ &-secondary {
17
+ --color-rgb: var(--color-secondary-contrast-rgb);
18
+ --background: var(--color-secondary);
19
+ }
20
+
21
+ &-danger {
22
+ --color-rgb: var(--color-danger-contrast-rgb);
23
+ --background: var(--color-danger);
24
+ }
25
+
26
+ &-success {
27
+ --color-rgb: var(--color-success-contrast-rgb);
28
+ --background: var(--color-success);
29
+ }
30
+
31
+ &-warning {
32
+ --color-rgb: var(--color-warning-contrast-rgb);
33
+ --background: var(--color-warning);
34
+ }
35
+
36
+ &-info {
37
+ --color-rgb: var(--color-info-contrast-rgb);
38
+ --background: var(--color-info);
39
+ }
40
+
41
+ &-light {
42
+ --color-rgb: var(--color-light-contrast-rgb);
43
+ --background: var(--color-light);
44
+ }
45
+
46
+ &-dark {
47
+ --color-rgb: var(--color-dark-contrast-rgb);
48
+ --background: var(--color-dark);
49
+ }
50
+
51
+ &-medium {
52
+ --color-rgb: var(--color-medium-contrast-rgb);
53
+ --background: var(--color-medium);
54
+ }
55
+
56
+ &-black {
57
+ --color-rgb: var(--color-black-contrast-rgb);
58
+ --background: var(--color-black);
59
+ }
60
+
61
+ &-white {
62
+ --color-rgb: var(--color-white-contrast-rgb);
63
+ --background: var(--color-white);
64
+ }
65
+
66
+ &:active,
67
+ &.hover {
68
+ transform: scale(0.98);
69
+ }
70
+
71
+ &-header {
72
+ padding: 16px;
73
+ }
74
+
75
+ &-title {
76
+ font-size: 24px;
77
+ font-weight: bold;
78
+ }
79
+
80
+ &-subtitle {
81
+ font-size: 12px;
82
+ font-weight: bold;
83
+ color: rgba(var(--color-rgb), 0.8);
84
+ }
85
+
86
+ &-content {
87
+ padding: 0 16px 16px;
88
+ color: rgba(var(--color-rgb), 0.8);
89
+ }
90
+ }
package/chip/index.scss CHANGED
@@ -88,6 +88,11 @@
88
88
  --color-contrast: var(--color-medium-contrast);
89
89
  }
90
90
 
91
+ &-black {
92
+ --color-rgb: 0, 0, 0;
93
+ --color-contrast: var(--color-black);
94
+ }
95
+
91
96
  &-white {
92
97
  --color-rgb: 255, 255, 255;
93
98
  --color-contrast: var(--color-dark);
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './accordion';
2
2
  export * from './back-button';
3
+ export * from './card';
3
4
  export * from './chip';
4
5
  export * from './circular-progress';
5
6
  export * from './empty';
package/index.js CHANGED
@@ -1,18 +1,18 @@
1
- import { SolarSun as o } from "./index2.js";
2
- import { default as t } from "./index3.js";
1
+ import { SolarSun as a } from "./index2.js";
2
+ import { default as o } from "./index3.js";
3
3
  import { default as f } from "./index4.js";
4
- import { default as n } from "./index5.js";
5
- import { default as d } from "./index6.js";
4
+ import { default as l } from "./index5.js";
5
+ import { default as S } from "./index6.js";
6
6
  import { default as m } from "./index7.js";
7
7
  import { default as x } from "./index8.js";
8
- import { default as b } from "./index9.js";
9
- import { default as g } from "./index10.js";
10
- import { default as k } from "./index11.js";
8
+ import { default as C } from "./index9.js";
9
+ import { default as c } from "./index10.js";
10
+ import { default as g } from "./index11.js";
11
11
  import { default as I } from "./index12.js";
12
12
  import { default as B } from "./index13.js";
13
- import { default as P } from "./index14.js";
14
- import { default as y } from "./index15.js";
15
- import { default as H } from "./index16.js";
13
+ import { default as L } from "./index14.js";
14
+ import { default as h } from "./index15.js";
15
+ import { default as F } from "./index16.js";
16
16
  import { default as w } from "./index17.js";
17
17
  import { default as A } from "./index18.js";
18
18
  import { default as E } from "./index19.js";
@@ -25,46 +25,56 @@ import { default as W } from "./index25.js";
25
25
  import { default as Y } from "./index26.js";
26
26
  import { default as _ } from "./index27.js";
27
27
  import { default as ee } from "./index28.js";
28
- import { default as oe } from "./index29.js";
29
- import { default as te } from "./index30.js";
28
+ import { default as ae } from "./index29.js";
29
+ import { default as oe } from "./index30.js";
30
30
  import { default as fe } from "./index31.js";
31
- import { default as ne } from "./index32.js";
32
- import { default as de } from "./index33.js";
31
+ import { default as le } from "./index32.js";
32
+ import { default as Se } from "./index33.js";
33
33
  import { default as me } from "./index34.js";
34
34
  import { default as xe } from "./index35.js";
35
+ import { default as Ce } from "./index36.js";
36
+ import { default as ce } from "./index37.js";
37
+ import { default as ge } from "./index38.js";
38
+ import { default as Ie } from "./index39.js";
39
+ import { default as Be } from "./index40.js";
35
40
  export {
36
- o as SolarSun,
37
- t as SunAccordion,
41
+ a as SolarSun,
42
+ o as SunAccordion,
38
43
  f as SunBackButton,
39
- n as SunChip,
40
- d as SunCircularProgress,
41
- m as SunEmpty,
42
- b as SunFab,
43
- x as SunFabGroup,
44
- oe as SunIcon,
44
+ l as SunCard,
45
+ oe as SunCardContent,
46
+ fe as SunCardHeader,
47
+ le as SunCardSubtitle,
48
+ Se as SunCardTitle,
49
+ S as SunChip,
50
+ m as SunCircularProgress,
51
+ x as SunEmpty,
52
+ c as SunFab,
53
+ C as SunFabGroup,
54
+ me as SunIcon,
45
55
  g as SunItem,
46
- te as SunItemDivider,
47
- k as SunLazyRender,
48
- I as SunList,
49
- fe as SunListHeader,
50
- B as SunNavbar,
51
- ne as SunPageHeader,
52
- P as SunPopover,
53
- y as SunQrcode,
54
- w as SunSegment,
55
- H as SunSegmentBtn,
56
- de as SunSkeleton,
57
- A as SunSliderCaptcha,
58
- E as SunSpinner,
59
- N as SunStepper,
60
- V as SunSudoku,
61
- me as SunSudokuItem,
62
- q as SunTabbar,
63
- Y as SunTag,
64
- W as SunTb,
65
- K as SunTbCell,
66
- O as SunTbRow,
67
- xe as SunTitle,
68
- _ as SunToggle,
69
- ee as SunVirtualScroll
56
+ xe as SunItemDivider,
57
+ I as SunLazyRender,
58
+ B as SunList,
59
+ Ce as SunListHeader,
60
+ L as SunNavbar,
61
+ ce as SunPageHeader,
62
+ h as SunPopover,
63
+ F as SunQrcode,
64
+ A as SunSegment,
65
+ w as SunSegmentBtn,
66
+ ge as SunSkeleton,
67
+ E as SunSliderCaptcha,
68
+ N as SunSpinner,
69
+ V as SunStepper,
70
+ q as SunSudoku,
71
+ Ie as SunSudokuItem,
72
+ K as SunTabbar,
73
+ _ as SunTag,
74
+ Y as SunTb,
75
+ O as SunTbCell,
76
+ W as SunTbRow,
77
+ Be as SunTitle,
78
+ ee as SunToggle,
79
+ ae as SunVirtualScroll
70
80
  };
package/index10.js CHANGED
@@ -1,36 +1,22 @@
1
- import { defineComponent as r, computed as c, renderSlot as i, createElementVNode as m, unref as d, openBlock as u, createBlock as p, createCommentVNode as _, normalizeClass as f, createElementBlock as k } from "vue";
2
- import B from "./index29.js";
3
- const n = i, o = m, v = d, s = u, h = p, w = _, C = f, y = k, E = { class: "sun-item-inner" }, N = { class: "sun-item-content-wrapper" }, z = /* @__PURE__ */ r({
4
- __name: "index",
1
+ import { defineComponent as t, computed as n, renderSlot as c, mergeProps as a, openBlock as l, createElementBlock as p } from "vue";
2
+ const m = c, u = a, f = l, _ = p, v = /* @__PURE__ */ t({
3
+ __name: "fab",
5
4
  props: {
6
- detail: { type: Boolean },
7
- lines: { type: Boolean, default: !0 },
8
- clickable: { type: Boolean }
5
+ color: {}
9
6
  },
10
- setup(l) {
11
- const t = l, a = c(() => ({
12
- "sun-item-lines-none": !t.lines,
13
- "sun-item-clickable": t.detail || t.clickable
14
- }));
15
- return (e, V) => (s(), y("view", {
16
- class: C(["sun-item", a.value]),
17
- "hover-class": "hover"
18
- }, [
19
- n(e.$slots, "start"),
20
- o("view", E, [
21
- o("view", N, [
22
- n(e.$slots, "default")
23
- ]),
24
- n(e.$slots, "end"),
25
- e.detail ? (s(), h(v(B), {
26
- key: 0,
27
- class: "sun-item-detail-icon",
28
- name: "chevron-forward"
29
- })) : w("", !0)
30
- ])
31
- ], 2));
7
+ setup(o) {
8
+ const r = o, s = n(() => [
9
+ `sun-fab-${r.color}`
10
+ ]);
11
+ return (e, d) => (f(), _("view", u(e.$attrs, {
12
+ class: ["sun-fab", s.value],
13
+ "hover-class": "hover",
14
+ "hover-stay-time": "200"
15
+ }), [
16
+ m(e.$slots, "default")
17
+ ], 16));
32
18
  }
33
19
  });
34
20
  export {
35
- z as default
21
+ v as default
36
22
  };
package/index11.js CHANGED
@@ -1,24 +1,36 @@
1
- import { defineComponent as c, ref as d, onActivated as s, onDeactivated as i, renderSlot as l, createCommentVNode as f } from "vue";
2
- const m = l, u = f, v = /* @__PURE__ */ c({
1
+ import { defineComponent as r, computed as c, renderSlot as i, createElementVNode as m, unref as d, openBlock as u, createBlock as p, createCommentVNode as _, normalizeClass as f, createElementBlock as k } from "vue";
2
+ import B from "./index34.js";
3
+ const n = i, o = m, v = d, s = u, h = p, w = _, C = f, y = k, E = { class: "sun-item-inner" }, N = { class: "sun-item-content-wrapper" }, z = /* @__PURE__ */ r({
3
4
  __name: "index",
4
5
  props: {
5
- hook: { default: "activated" }
6
+ detail: { type: Boolean },
7
+ lines: { type: Boolean, default: !0 },
8
+ clickable: { type: Boolean }
6
9
  },
7
- setup(a) {
8
- const n = a, e = d(!1);
9
- let t;
10
- function o() {
11
- t = requestAnimationFrame(() => {
12
- e.value = !0;
13
- });
14
- }
15
- return n.hook === "created" && o(), s(() => {
16
- o();
17
- }), i(() => {
18
- e.value = !1, t && cancelAnimationFrame(t);
19
- }), (r, p) => e.value ? m(r.$slots, "default", { key: 0 }) : u("", !0);
10
+ setup(l) {
11
+ const t = l, a = c(() => ({
12
+ "sun-item-lines-none": !t.lines,
13
+ "sun-item-clickable": t.detail || t.clickable
14
+ }));
15
+ return (e, V) => (s(), y("view", {
16
+ class: C(["sun-item", a.value]),
17
+ "hover-class": "hover"
18
+ }, [
19
+ n(e.$slots, "start"),
20
+ o("view", E, [
21
+ o("view", N, [
22
+ n(e.$slots, "default")
23
+ ]),
24
+ n(e.$slots, "end"),
25
+ e.detail ? (s(), h(v(B), {
26
+ key: 0,
27
+ class: "sun-item-detail-icon",
28
+ name: "chevron-forward"
29
+ })) : w("", !0)
30
+ ])
31
+ ], 2));
20
32
  }
21
33
  });
22
34
  export {
23
- v as default
35
+ z as default
24
36
  };
package/index12.js CHANGED
@@ -1,86 +1,24 @@
1
- import { defineComponent as c, renderSlot as m, toDisplayString as y, createTextVNode as w, unref as p, withCtx as x, openBlock as v, createBlock as B, createVNode as S, vShow as k, createElementVNode as b, withDirectives as N, mergeProps as V, createElementBlock as E } from "vue";
2
- import { vibrator as $ } from "@solar-taro/core";
3
- import { SunSpinner as a, SunEmpty as D } from "@solar-taro/ui-sun";
4
- const s = m, T = y, C = w, r = p, z = x, i = v, P = B, d = S, f = k, n = b, h = N, j = V, A = E, L = ["enable-flex", "refresher-enabled", "refresher-triggered", "refresher-background"], R = {
5
- class: "sun-list-placeholder",
6
- style: { display: "flex", "justify-content": "center", "align-items": "center", height: "85%" }
7
- }, q = {
8
- class: "sun-list-loading-wrapper",
9
- style: { "text-align": "center", padding: "6px" }
10
- }, I = /* @__PURE__ */ c({
1
+ import { defineComponent as c, ref as d, onActivated as s, onDeactivated as i, renderSlot as l, createCommentVNode as f } from "vue";
2
+ const m = l, u = f, v = /* @__PURE__ */ c({
11
3
  __name: "index",
12
4
  props: {
13
- refreshing: {
14
- type: Boolean,
15
- default: !1
16
- },
17
- flex: {
18
- type: Boolean,
19
- default: !1
20
- },
21
- loading: {
22
- type: Boolean,
23
- default: !1
24
- },
25
- loadingText: {
26
- type: String,
27
- default: "Loading"
28
- },
29
- data: {
30
- type: Array,
31
- default: []
32
- },
33
- refresher: {
34
- type: Boolean,
35
- default: !0
36
- },
37
- refresherBg: {
38
- type: String,
39
- default: "transparent"
40
- }
5
+ hook: { default: "activated" }
41
6
  },
42
- emits: ["refresh", "lower"],
43
- setup(e, { emit: g }) {
44
- const o = g;
45
- return (l, t) => (i(), A("scroll-view", j(l.$attrs, {
46
- class: "sun-list",
47
- enhanced: !0,
48
- "scroll-y": !0,
49
- "lower-threshold": 300,
50
- "enable-flex": e.flex,
51
- "refresher-enabled": e.refresher,
52
- "refresher-triggered": e.refreshing,
53
- "refresher-background": e.refresherBg,
54
- onRefresherrefresh: t[0] || (t[0] = (u) => {
55
- r($).short("light"), o("refresh");
56
- }),
57
- onScrolltolower: t[1] || (t[1] = (u) => o("lower"))
58
- }), [
59
- s(l.$slots, "default"),
60
- h(n("view", R, [
61
- e.loading ? (i(), P(r(a), {
62
- key: 0,
63
- size: "large"
64
- }, {
65
- default: z(() => [
66
- C(T(e.loadingText), 1)
67
- ]),
68
- _: 1
69
- })) : s(l.$slots, "empty", { key: 1 }, () => [
70
- d(r(D))
71
- ])
72
- ], 512), [
73
- [f, !e.data.length]
74
- ]),
75
- h(n("view", q, [
76
- d(r(a), { size: "small" })
77
- ], 512), [
78
- [f, e.data.length && e.loading && !e.refreshing]
79
- ]),
80
- t[2] || (t[2] = n("view", { style: { position: "absolute", height: "1px", width: "1px", overflow: "hidden" } }, null, -1))
81
- ], 16, L));
7
+ setup(a) {
8
+ const n = a, e = d(!1);
9
+ let t;
10
+ function o() {
11
+ t = requestAnimationFrame(() => {
12
+ e.value = !0;
13
+ });
14
+ }
15
+ return n.hook === "created" && o(), s(() => {
16
+ o();
17
+ }), i(() => {
18
+ e.value = !1, t && cancelAnimationFrame(t);
19
+ }), (r, p) => e.value ? m(r.$slots, "default", { key: 0 }) : u("", !0);
82
20
  }
83
21
  });
84
22
  export {
85
- I as default
23
+ v as default
86
24
  };