@solar-taro/ui-sun 2.8.9 → 2.8.11

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 +8 -0
  2. package/fab/fab.vue.d.ts +5 -1
  3. package/fab/index.scss +47 -0
  4. package/index.js +17 -17
  5. package/index10.js +19 -25
  6. package/index11.js +24 -33
  7. package/index12.js +33 -75
  8. package/index13.js +75 -19
  9. package/index14.js +19 -49
  10. package/index15.js +46 -141
  11. package/index16.js +142 -27
  12. package/index17.js +29 -21
  13. package/index18.js +20 -42
  14. package/index19.js +42 -23
  15. package/index20.js +21 -9
  16. package/index21.js +10 -27
  17. package/index22.js +29 -18
  18. package/index23.js +17 -118
  19. package/index24.js +123 -14
  20. package/index26.js +1 -1
  21. package/index27.js +1 -1
  22. package/index28.js +1 -1
  23. package/index29.js +1 -1
  24. package/index30.js +1 -1
  25. package/index31.js +1 -1
  26. package/index32.js +1 -1
  27. package/index33.js +1 -1
  28. package/index34.js +1 -1
  29. package/index35.js +1 -1
  30. package/index36.js +2 -7
  31. package/index37.js +1 -1
  32. package/index38.js +7 -2
  33. package/index39.js +1 -1
  34. package/index40.js +1 -1
  35. package/index41.js +1 -1
  36. package/index42.js +1 -1
  37. package/index43.js +1 -1
  38. package/index44.js +1 -1
  39. package/index45.js +1 -1
  40. package/index46.js +1 -1
  41. package/index47.js +1 -1
  42. package/index48.js +1 -1
  43. package/index49.js +2 -66
  44. package/index50.js +2 -12
  45. package/index51.js +2 -25
  46. package/index52.js +2 -14
  47. package/index53.js +2 -526
  48. package/index55.js +66 -2
  49. package/index56.js +12 -2
  50. package/index57.js +25 -2
  51. package/index58.js +14 -2
  52. package/index59.js +1 -1
  53. package/index60.js +524 -24
  54. package/index61.js +26 -2
  55. package/index62.js +2 -506
  56. package/index63.js +481 -54
  57. package/index64.js +72 -63
  58. package/index65.js +64 -63
  59. package/index66.js +46 -520
  60. package/index67.js +543 -2
  61. package/index69.js +2 -2
  62. package/index70.js +2 -4
  63. package/index71.js +4 -2
  64. package/index72.js +2 -4
  65. package/index73.js +4 -2
  66. package/index77.js +3 -3
  67. package/index78.js +3 -3
  68. package/index79.js +2 -2
  69. package/index8.js +16 -30
  70. package/index80.js +2 -2
  71. package/index82.js +4 -0
  72. package/index9.js +29 -17
  73. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 2.8.10 (2026-07-01)
2
+
3
+ This was a version bump only for ui-sun to align it with other projects, there were no code changes.
4
+
5
+ ## 2.8.9 (2026-06-30)
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
  ## 2.8.8 (2026-06-30)
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/fab/fab.vue.d.ts CHANGED
@@ -1,3 +1,7 @@
1
+ import { Color } from '../typing';
2
+ type __VLS_Props = {
3
+ color: Color;
4
+ };
1
5
  declare function __VLS_template(): {
2
6
  attrs: Partial<{}>;
3
7
  slots: {
@@ -7,7 +11,7 @@ declare function __VLS_template(): {
7
11
  rootEl: SVGViewElement;
8
12
  };
9
13
  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>;
14
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, SVGViewElement>;
11
15
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
12
16
  export default _default;
13
17
  type __VLS_WithTemplateSlots<T, S> = T & {
package/fab/index.scss CHANGED
@@ -6,6 +6,8 @@
6
6
  width: 56px;
7
7
  height: 56px;
8
8
  border-radius: 18px;
9
+ color: var(--color);
10
+ background: var(--background);
9
11
  box-shadow:
10
12
  0 10px 15px -3px rgb(0 0 0 / 0.1),
11
13
  0 4px 6px -4px rgb(0 0 0 / 0.1);
@@ -19,6 +21,51 @@
19
21
  transform: scale(1.1);
20
22
  }
21
23
 
24
+ &-primary {
25
+ --color: var(--color-primary-contrast);
26
+ --background: var(--color-primary);
27
+ }
28
+
29
+ &-secondary {
30
+ --color: var(--color-secondary-contrast);
31
+ --background: var(--color-secondary);
32
+ }
33
+
34
+ &-danger {
35
+ --color: var(--color-danger-contrast);
36
+ --background: var(--color-danger);
37
+ }
38
+
39
+ &-success {
40
+ --color: var(--color-success-contrast);
41
+ --background: var(--color-success);
42
+ }
43
+
44
+ &-warning {
45
+ --color: var(--color-warning-contrast);
46
+ --background: var(--color-warning);
47
+ }
48
+
49
+ &-info {
50
+ --color: var(--color-info-contrast);
51
+ --background: var(--color-info);
52
+ }
53
+
54
+ &-light {
55
+ --color: var(--color-light-contrast);
56
+ --background: var(--color-light);
57
+ }
58
+
59
+ &-dark {
60
+ --color: var(--color-dark-contrast);
61
+ --background: var(--color-dark);
62
+ }
63
+
64
+ &-medium {
65
+ --color: var(--color-medium-contrast);
66
+ --background: var(--color-medium);
67
+ }
68
+
22
69
  &-group {
23
70
  position: fixed;
24
71
  right: calc(15px + var(--safe-right));
package/index.js CHANGED
@@ -33,28 +33,28 @@ export {
33
33
  f as SunBackButton,
34
34
  l as SunChip,
35
35
  d as SunCircularProgress,
36
- O as SunFab,
36
+ x as SunFab,
37
37
  m as SunFabGroup,
38
38
  W as SunIcon,
39
- x as SunItem,
40
- c as SunLazyRender,
39
+ c as SunItem,
40
+ T as SunLazyRender,
41
41
  Y as SunListHeader,
42
- T as SunNavbar,
42
+ k as SunNavbar,
43
43
  _ as SunPageHeader,
44
- k as SunPopover,
45
- B as SunQrcode,
46
- v as SunSegment,
47
- P as SunSegmentBtn,
44
+ B as SunPopover,
45
+ P as SunQrcode,
46
+ H as SunSegment,
47
+ v as SunSegmentBtn,
48
48
  ee as SunSkeleton,
49
- H as SunSliderCaptcha,
50
- R as SunSpinner,
51
- y as SunSudoku,
49
+ R as SunSliderCaptcha,
50
+ y as SunSpinner,
51
+ A as SunSudoku,
52
52
  ae as SunSudokuItem,
53
- A as SunTabbar,
54
- E as SunTag,
55
- q as SunTb,
56
- N as SunTbCell,
57
- V as SunTbRow,
53
+ N as SunTabbar,
54
+ K as SunTag,
55
+ E as SunTb,
56
+ V as SunTbCell,
57
+ q as SunTbRow,
58
58
  te as SunTitle,
59
- K as SunVirtualScroll
59
+ O as SunVirtualScroll
60
60
  };
package/index10.js CHANGED
@@ -1,30 +1,24 @@
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({
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({
5
3
  __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
- ]));
4
+ props: {
5
+ hook: { default: "activated" }
6
+ },
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);
26
20
  }
27
21
  });
28
22
  export {
29
- k as default
23
+ v as default
30
24
  };
package/index11.js CHANGED
@@ -1,39 +1,30 @@
1
- import { defineComponent as m, mergeModels as d, useModel as v, computed as t, renderSlot as w, createElementVNode as g, mergeProps as k, withModifiers as y, normalizeClass as $, normalizeStyle as h, openBlock as b, createElementBlock as B } from "vue";
2
- const p = w, n = g, M = k, z = y, E = $, S = h, C = b, N = B, T = /* @__PURE__ */ m({
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({
3
5
  __name: "index",
4
- props: /* @__PURE__ */ d({
5
- placement: {},
6
- offset: { default: "6px" },
7
- background: { default: "rgba(0, 0, 0, 0.5)" },
8
- color: { default: "#fff" }
9
- }, {
10
- show: { type: Boolean },
11
- showModifiers: {}
12
- }),
13
- emits: ["update:show"],
14
- setup(r) {
15
- const o = r, l = v(r, "show"), a = t(() => ["left", "right"].includes(o.placement[0])), u = t(() => ["top", "bottom"].includes(o.placement[1])), f = t(() => a.value ? o.offset : "0px"), i = t(() => u.value ? o.offset : "0px");
16
- return (e, s) => (C(), N("view", {
17
- class: E(["sun-popover", [{ "sun-popover-show": l.value }, `sun-popover-x-${e.placement[0]}`, `sun-popover-y-${e.placement[1]}`]]),
18
- style: S({ "--popover-x-offset": f.value, "--popover-y-offset": i.value, "--popover-background": e.background }),
19
- onTap: z((c) => !1, ["stop"])
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
20
18
  }, [
21
- n("view", {
22
- class: "sun-popover-trigger",
23
- onTap: s[0] || (s[0] = (c) => l.value = !l.value)
24
- }, [
25
- p(e.$slots, "default")
26
- ], 32),
27
- n("view", M(e.$attrs, {
28
- class: "sun-popover-container",
29
- style: { color: e.color }
30
- }), [
31
- s[1] || (s[1] = n("view", { class: "sun-popover-arrow" }, null, -1)),
32
- p(e.$slots, "content")
33
- ], 16)
34
- ], 38));
19
+ o("view", v, [
20
+ a(n.$slots, "default"),
21
+ o("view", b, [
22
+ a(n.$slots, "center")
23
+ ])
24
+ ])
25
+ ]));
35
26
  }
36
27
  });
37
28
  export {
38
- T as default
29
+ k as default
39
30
  };
package/index12.js CHANGED
@@ -1,81 +1,39 @@
1
- import { defineComponent as C, watch as I, onMounted as L, onUnmounted as M, createElementVNode as k, unref as w, openBlock as z, createElementBlock as R } from "vue";
2
- import { createSelectorQuery as y, getWindowInfo as Q, previewImage as S } from "@tarojs/taro";
3
- import { QrCode as U, QrCodeEcc as a } from "./index53.js";
4
- const h = k, A = w, B = z, D = R;
5
- let T = 1;
6
- const N = /* @__PURE__ */ C({
1
+ import { defineComponent as m, mergeModels as d, useModel as v, computed as t, renderSlot as w, createElementVNode as g, mergeProps as k, withModifiers as y, normalizeClass as $, normalizeStyle as h, openBlock as b, createElementBlock as B } from "vue";
2
+ const p = w, n = g, M = k, z = y, E = $, S = h, C = b, N = B, T = /* @__PURE__ */ m({
7
3
  __name: "index",
8
- props: {
9
- value: {},
10
- color: { default: "#000000" },
11
- backgroundColor: { default: "transparent" },
12
- level: { default: "M" }
13
- },
14
- emits: ["rendered"],
15
- setup(m, { expose: v, emit: g }) {
16
- let n, i, l, s = !1;
17
- const u = `sun-qrcode-captcha-${T++}`, x = {
18
- L: a.LOW,
19
- M: a.MEDIUM,
20
- Q: a.QUARTILE,
21
- H: a.HIGH
22
- }, _ = g, c = m;
23
- v({
24
- getDataURL: p
25
- });
26
- function d() {
27
- setTimeout(() => {
28
- y().select(`#${u}`).fields({ node: !0, size: !0 }).exec(([{ node: t, width: e, height: r }]) => {
29
- if (s) return;
30
- if (!r || !e)
31
- return d();
32
- const o = Q().pixelRatio;
33
- n = t, l = n.getContext("2d"), i = e, n.width = e * o, n.height = r * o, l.scale(o, o), f();
34
- });
35
- }, 50);
36
- }
37
- function f() {
38
- const t = U.encodeText(c.value, x[c.level]), e = i / (t.size + 2);
39
- l.fillStyle = c.backgroundColor, l.fillRect(0, 0, n.width, n.height), l.fillStyle = c.color;
40
- for (let r = 0; r < t.size; r++)
41
- for (let o = 0; o < t.size; o++)
42
- t.getModule(o, r) && l.fillRect(
43
- o * e + e,
44
- // +moduleSize 留出边距
45
- r * e + e,
46
- e,
47
- e
48
- );
49
- _("rendered");
50
- }
51
- function p() {
52
- return n.toDataURL("image/png", 1);
53
- }
54
- function E() {
55
- const t = p();
56
- S({
57
- current: t,
58
- urls: [t]
59
- });
60
- }
61
- return I(() => c.value, () => {
62
- l && f();
63
- }), L(() => {
64
- d();
65
- }), M(() => {
66
- s = !0;
67
- }), (t, e) => (B(), D("view", {
68
- class: "sun-qrcode",
69
- onTap: e[0] || (e[0] = (r) => A(n) && E())
4
+ props: /* @__PURE__ */ d({
5
+ placement: {},
6
+ offset: { default: "6px" },
7
+ background: { default: "rgba(0, 0, 0, 0.5)" },
8
+ color: { default: "#fff" }
9
+ }, {
10
+ show: { type: Boolean },
11
+ showModifiers: {}
12
+ }),
13
+ emits: ["update:show"],
14
+ setup(r) {
15
+ const o = r, l = v(r, "show"), a = t(() => ["left", "right"].includes(o.placement[0])), u = t(() => ["top", "bottom"].includes(o.placement[1])), f = t(() => a.value ? o.offset : "0px"), i = t(() => u.value ? o.offset : "0px");
16
+ return (e, s) => (C(), N("view", {
17
+ class: E(["sun-popover", [{ "sun-popover-show": l.value }, `sun-popover-x-${e.placement[0]}`, `sun-popover-y-${e.placement[1]}`]]),
18
+ style: S({ "--popover-x-offset": f.value, "--popover-y-offset": i.value, "--popover-background": e.background }),
19
+ onTap: z((c) => !1, ["stop"])
70
20
  }, [
71
- h("canvas", {
72
- id: u,
73
- type: "2d",
74
- class: "sun-slider-captcha-canvas"
75
- })
76
- ], 32));
21
+ n("view", {
22
+ class: "sun-popover-trigger",
23
+ onTap: s[0] || (s[0] = (c) => l.value = !l.value)
24
+ }, [
25
+ p(e.$slots, "default")
26
+ ], 32),
27
+ n("view", M(e.$attrs, {
28
+ class: "sun-popover-container",
29
+ style: { color: e.color }
30
+ }), [
31
+ s[1] || (s[1] = n("view", { class: "sun-popover-arrow" }, null, -1)),
32
+ p(e.$slots, "content")
33
+ ], 16)
34
+ ], 38));
77
35
  }
78
36
  });
79
37
  export {
80
- N as default
38
+ T as default
81
39
  };
package/index13.js CHANGED
@@ -1,25 +1,81 @@
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 "./index54.js";
3
- const o = u, k = i, C = _, B = f, E = v, $ = /* @__PURE__ */ p({
4
- __name: "segment-btn",
1
+ import { defineComponent as C, watch as I, onMounted as L, onUnmounted as M, createElementVNode as k, unref as w, openBlock as z, createElementBlock as R } from "vue";
2
+ import { createSelectorQuery as y, getWindowInfo as Q, previewImage as S } from "@tarojs/taro";
3
+ import { QrCode as U, QrCodeEcc as a } from "./index60.js";
4
+ const h = k, A = w, B = z, D = R;
5
+ let T = 1;
6
+ const N = /* @__PURE__ */ C({
7
+ __name: "index",
5
8
  props: {
6
- value: {}
9
+ value: {},
10
+ color: { default: "#000000" },
11
+ backgroundColor: { default: "transparent" },
12
+ level: { default: "M" }
7
13
  },
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
- };
14
+ emits: ["rendered"],
15
+ setup(m, { expose: v, emit: g }) {
16
+ let n, i, l, s = !1;
17
+ const u = `sun-qrcode-captcha-${T++}`, x = {
18
+ L: a.LOW,
19
+ M: a.MEDIUM,
20
+ Q: a.QUARTILE,
21
+ H: a.HIGH
22
+ }, _ = g, c = m;
23
+ v({
24
+ getDataURL: p
25
+ });
26
+ function d() {
27
+ setTimeout(() => {
28
+ y().select(`#${u}`).fields({ node: !0, size: !0 }).exec(([{ node: t, width: e, height: r }]) => {
29
+ if (s) return;
30
+ if (!r || !e)
31
+ return d();
32
+ const o = Q().pixelRatio;
33
+ n = t, l = n.getContext("2d"), i = e, n.width = e * o, n.height = r * o, l.scale(o, o), f();
34
+ });
35
+ }, 50);
36
+ }
37
+ function f() {
38
+ const t = U.encodeText(c.value, x[c.level]), e = i / (t.size + 2);
39
+ l.fillStyle = c.backgroundColor, l.fillRect(0, 0, n.width, n.height), l.fillStyle = c.color;
40
+ for (let r = 0; r < t.size; r++)
41
+ for (let o = 0; o < t.size; o++)
42
+ t.getModule(o, r) && l.fillRect(
43
+ o * e + e,
44
+ // +moduleSize 留出边距
45
+ r * e + e,
46
+ e,
47
+ e
48
+ );
49
+ _("rendered");
50
+ }
51
+ function p() {
52
+ return n.toDataURL("image/png", 1);
53
+ }
54
+ function E() {
55
+ const t = p();
56
+ S({
57
+ current: t,
58
+ urls: [t]
59
+ });
60
+ }
61
+ return I(() => c.value, () => {
62
+ l && f();
63
+ }), L(() => {
64
+ d();
65
+ }), M(() => {
66
+ s = !0;
67
+ }), (t, e) => (B(), D("view", {
68
+ class: "sun-qrcode",
69
+ onTap: e[0] || (e[0] = (r) => A(n) && E())
70
+ }, [
71
+ h("canvas", {
72
+ id: u,
73
+ type: "2d",
74
+ class: "sun-slider-captcha-canvas"
75
+ })
76
+ ], 32));
21
77
  }
22
78
  });
23
79
  export {
24
- $ as default
80
+ N as default
25
81
  };
package/index14.js CHANGED
@@ -1,55 +1,25 @@
1
- import { defineComponent as x, getCurrentInstance as V, shallowRef as E, shallowReactive as k, computed as a, provide as i, 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 "./index54.js";
3
- const R = y, T = B, b = I, L = O, S = A, $ = { class: "sun-segment-inner" }, M = /* @__PURE__ */ x({
4
- __name: "segment",
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 "./index54.js";
3
+ const o = u, k = i, C = _, B = f, E = v, $ = /* @__PURE__ */ p({
4
+ __name: "segment-btn",
5
5
  props: {
6
- modelValue: {}
6
+ value: {}
7
7
  },
8
- emits: ["update:modelValue", "change"],
9
- setup(p, { emit: v }) {
10
- const r = v, c = p, m = V(), o = E(null), t = k([]), d = a(() => t.indexOf(o.value)), f = a(() => t.length), g = a(() => ({
11
- "--segment-length": f.value,
12
- "--segment-active-index": d.value
13
- }));
14
- i(N, o), i(P, {
15
- link: (e) => {
16
- const n = u();
17
- t.push(e), t.sort((s, l) => {
18
- const h = n.indexOf(s.vnode), _ = n.indexOf(l.vnode);
19
- return h - _;
20
- });
21
- },
22
- unlink: (e) => {
23
- t.slice(t.indexOf(e), 1);
24
- },
25
- active: (e) => {
26
- r("change", {
27
- value: e.props.value,
28
- index: d.value
29
- }), r("update:modelValue", e.props.value), o.value = e;
30
- }
31
- }), C(() => c.modelValue, (e) => {
32
- o.value = t.find((n) => n.props.value === e);
33
- });
34
- function u() {
35
- return m.subTree.children[0].children[0].children.filter((e) => typeof e.type != "symbol");
36
- }
37
- return w(() => {
38
- const e = u();
39
- t.forEach((n) => {
40
- const s = e.findIndex((l) => l === n.vnode);
41
- n.props.value === void 0 && (n.props.value = s), n.props.value === c.modelValue && (o.value = n);
42
- });
43
- }), (e, n) => (L(), S("view", b(e.$attrs, {
44
- class: "sun-segment",
45
- style: g.value
46
- }), [
47
- T("view", $, [
48
- R(e.$slots, "default")
49
- ])
50
- ], 16));
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
+ };
51
21
  }
52
22
  });
53
23
  export {
54
- M as default
24
+ $ as default
55
25
  };