@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/index18.js CHANGED
@@ -1,150 +1,55 @@
1
- import { defineComponent as J, ref as d, computed as M, onMounted as q, onUnmounted as F, unref as K, normalizeStyle as O, createElementVNode as Q, openBlock as X, createBlock as Y, createCommentVNode as ee, toDisplayString as te, normalizeClass as ae, createElementBlock as ne } from "vue";
2
- import { HttpClient as se, withInterceptors as oe } from "@ngify/http";
3
- import { withPixel as B } from "@solar-kit/core";
4
- import { CaptchaType as S } from "@solar-kit/planets/mercury";
5
- import { filterResult as ie } from "@solar-kit/planets/sun";
6
- import { useCommonInterceptor as re } from "@solar-taro/http";
7
- import { SunSpinner as ce } from "@solar-taro/ui-sun";
8
- import { attachLoading as le } from "@solar-vue/core";
9
- import { createSelectorQuery as pe, getWindowInfo as ue } from "@tarojs/taro";
10
- import { a as de } from "./index66.js";
11
- import { e as D } from "./index67.js";
12
- import me from "./index68.js";
13
- import ve from "./index69.js";
14
- const g = K, H = O, o = Q, w = X, fe = Y, N = ee, he = te, U = ae, $ = ne, ye = { class: "sun-slider-captcha" }, ge = { class: "sun-slider-captcha-container" }, we = { class: "sun-slider-captcha-mask" }, ke = { class: "sun-slider-captcha-track" }, _e = ["x", "disabled"], V = "sun-slider-captcha", be = 155, Ie = 310, ze = 155, xe = 50, Le = /* @__PURE__ */ J({
15
- __name: "index",
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 "./index70.js";
3
+ const R = y, T = B, b = I, L = O, S = A, $ = { class: "sun-segment-inner" }, M = /* @__PURE__ */ x({
4
+ __name: "segment",
16
5
  props: {
17
- height: { default: 187.5 },
18
- width: { default: 375 },
19
- url: {},
20
- verifyUrl: {},
21
- verifyData: {}
6
+ modelValue: {}
22
7
  },
23
- emits: ["verified"],
24
- setup(Z, { emit: L }) {
25
- let c, p, m, v, k, _ = !1;
26
- const i = Z, R = L, l = d(0), f = d(!1), b = d(!1), y = M(() => ({
27
- width: i.width / Ie,
28
- height: i.height / be
29
- })), I = new se(
30
- oe([
31
- re()
32
- ])
33
- ), n = d({
34
- visible: !1,
35
- type: "success",
36
- content: ""
37
- }), h = d({ type: "primary" }), r = { key: "", token: "" };
38
- function z() {
39
- f.value = !0, I.post(i.url, { captchaType: S.BlockPuzzle }).pipe(
40
- ie()
41
- ).subscribe(async ({ data: t }) => {
42
- r.key = t.secretKey, r.token = t.token, m = c.createImage(), v = c.createImage(), m.src = `data:image/png;base64,${t.originalImageBase64}`, v.src = `data:image/png;base64,${t.jigsawImageBase64}`, await Promise.all([
43
- new Promise((e) => m.onload = () => e()),
44
- new Promise((e) => v.onload = () => e())
45
- ]), k = Date.now(), x(), f.value = !1;
46
- });
47
- }
48
- function x(t = 0) {
49
- const e = i.width, a = i.height;
50
- p.clearRect(0, 0, e, a), p.drawImage(m, 0, 0, e, a), p.drawImage(v, t, 0, y.value.width * xe, y.value.height * ze), l.value = t;
51
- }
52
- function W(t) {
53
- t = t / y.value.width;
54
- const e = Date.now(), a = JSON.stringify({ x: t, y: 5 }), s = r.key ? E(a, r.key) : a, C = {
55
- captchaType: S.BlockPuzzle,
56
- pointJson: s,
57
- token: r.token,
58
- ...i.verifyData
59
- };
60
- I.post(i.verifyUrl, C).pipe(
61
- le(b)
62
- ).subscribe({
63
- next: (u) => {
64
- if (u.code !== 0)
65
- n.value.type = "danger", n.value.content = u.msg, n.value.visible = !0, h.value.type = "danger", setTimeout(() => {
66
- n.value.visible = !1, z();
67
- }, 1e3);
68
- else {
69
- const G = ((e - k) / 1e3).toFixed(2);
70
- n.value.type = "success", n.value.content = `验证成功,耗时 ${G} 秒`, n.value.visible = !0, h.value.type = "primary";
71
- const P = u.data.token + "---" + a;
72
- u.data.captcha = r.key ? E(P, r.key) : P;
73
- }
74
- R("verified", u);
75
- }
76
- });
77
- }
78
- function E(t, e) {
79
- const a = D.parse(e), s = D.parse(t);
80
- return de.encrypt(s, a, { mode: me, padding: ve }).toString();
81
- }
82
- function j(t) {
83
- l.value = t.x, x(l.value);
84
- }
85
- function A() {
86
- W(l.value);
87
- }
88
- function T() {
89
- setTimeout(() => {
90
- pe().select(`#${V}`).fields({ node: !0, size: !0 }).exec(([{ node: t, width: e, height: a }]) => {
91
- if (_) return;
92
- if (!a || !e)
93
- return T();
94
- const s = ue().pixelRatio;
95
- c = t, p = c.getContext("2d"), c.width = e * s, c.height = a * s, p.scale(s, s), z();
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 - _;
96
20
  });
97
- }, 50);
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");
98
36
  }
99
- return q(() => {
100
- T();
101
- }), F(() => {
102
- _ = !0;
103
- }), (t, e) => (w(), $("view", ye, [
104
- o("view", ge, [
105
- o("canvas", {
106
- id: V,
107
- type: "2d",
108
- class: "sun-slider-captcha-canvas",
109
- style: H({ height: g(B)(t.height), width: g(B)(t.width) })
110
- }, null, 4),
111
- o("view", we, [
112
- f.value ? (w(), fe(g(ce), { key: 0 })) : N("", !0),
113
- n.value.visible ? (w(), $("view", {
114
- key: 1,
115
- class: U(["sun-slider-captcha-alert", {
116
- "sun-slider-captcha-alert-success": n.value.type === "success",
117
- "sun-slider-captcha-alert-danger": n.value.type === "danger"
118
- }])
119
- }, he(n.value.content), 3)) : N("", !0)
120
- ])
121
- ]),
122
- o("movable-area", ke, [
123
- e[3] || (e[3] = o("view", { class: "sun-slider-captcha-hint" }, "拖动滑块以完成拼图", -1)),
124
- o("view", {
125
- class: U(["sun-slider-captcha-indicator", {
126
- "sun-slider-captcha-indicator-primary": h.value.type === "primary",
127
- "sun-slider-captcha-indicator-danger": h.value.type === "danger"
128
- }]),
129
- style: H({ transform: `translateX(calc(-100% + ${l.value}px))` })
130
- }, null, 6),
131
- o("movable-view", {
132
- class: "sun-slider-captcha-handler",
133
- x: l.value,
134
- direction: "horizontal",
135
- disabled: f.value || b.value,
136
- onChangePassive: e[0] || (e[0] = (a) => j(a.detail)),
137
- onTouchendPassive: e[1] || (e[1] = (a) => A())
138
- }, e[2] || (e[2] = [
139
- o("van-icon", {
140
- name: "wap-nav",
141
- style: { transform: "rotate(90deg)" }
142
- }, null, -1)
143
- ]), 40, _e)
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")
144
49
  ])
145
- ]));
50
+ ], 16));
146
51
  }
147
52
  });
148
53
  export {
149
- Le as default
54
+ M as default
150
55
  };
package/index19.js CHANGED
@@ -1,35 +1,150 @@
1
- import { defineComponent as a, computed as c, renderList as d, Fragment as m, openBlock as p, createElementBlock as u, createElementVNode as _, renderSlot as f, createCommentVNode as k, normalizeClass as g } from "vue";
2
- const v = d, B = m, e = p, 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({
1
+ import { defineComponent as J, ref as d, computed as M, onMounted as q, onUnmounted as F, unref as K, normalizeStyle as O, createElementVNode as Q, openBlock as X, createBlock as Y, createCommentVNode as ee, toDisplayString as te, normalizeClass as ae, createElementBlock as ne } from "vue";
2
+ import { HttpClient as se, withInterceptors as oe } from "@ngify/http";
3
+ import { withPixel as B } from "@solar-kit/core";
4
+ import { CaptchaType as S } from "@solar-kit/planets/mercury";
5
+ import { filterResult as ie } from "@solar-kit/planets/sun";
6
+ import { useCommonInterceptor as re } from "@solar-taro/http";
7
+ import { SunSpinner as ce } from "@solar-taro/ui-sun";
8
+ import { attachLoading as le } from "@solar-vue/core";
9
+ import { createSelectorQuery as pe, getWindowInfo as ue } from "@tarojs/taro";
10
+ import { a as de } from "./index72.js";
11
+ import { e as D } from "./index73.js";
12
+ import me from "./index74.js";
13
+ import ve from "./index75.js";
14
+ const g = K, H = O, o = Q, w = X, fe = Y, N = ee, he = te, U = ae, $ = ne, ye = { class: "sun-slider-captcha" }, ge = { class: "sun-slider-captcha-container" }, we = { class: "sun-slider-captcha-mask" }, ke = { class: "sun-slider-captcha-track" }, _e = ["x", "disabled"], V = "sun-slider-captcha", be = 155, Ie = 310, ze = 155, xe = 50, Le = /* @__PURE__ */ J({
6
15
  __name: "index",
7
16
  props: {
8
- size: { default: "middle" },
9
- spinning: { type: Boolean, default: !0 }
17
+ height: { default: 187.5 },
18
+ width: { default: 375 },
19
+ url: {},
20
+ verifyUrl: {},
21
+ verifyData: {}
10
22
  },
11
- setup(r) {
12
- const s = r, l = 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", l.value])
20
- }, [
21
- o("view", z, [
22
- (e(), n(B, null, v(4, (i) => o("view", {
23
- key: i,
24
- class: "sun-spinner-dot-item"
25
- })), 64))
23
+ emits: ["verified"],
24
+ setup(Z, { emit: L }) {
25
+ let c, p, m, v, k, _ = !1;
26
+ const i = Z, R = L, l = d(0), f = d(!1), b = d(!1), y = M(() => ({
27
+ width: i.width / Ie,
28
+ height: i.height / be
29
+ })), I = new se(
30
+ oe([
31
+ re()
32
+ ])
33
+ ), n = d({
34
+ visible: !1,
35
+ type: "success",
36
+ content: ""
37
+ }), h = d({ type: "primary" }), r = { key: "", token: "" };
38
+ function z() {
39
+ f.value = !0, I.post(i.url, { captchaType: S.BlockPuzzle }).pipe(
40
+ ie()
41
+ ).subscribe(async ({ data: t }) => {
42
+ r.key = t.secretKey, r.token = t.token, m = c.createImage(), v = c.createImage(), m.src = `data:image/png;base64,${t.originalImageBase64}`, v.src = `data:image/png;base64,${t.jigsawImageBase64}`, await Promise.all([
43
+ new Promise((e) => m.onload = () => e()),
44
+ new Promise((e) => v.onload = () => e())
45
+ ]), k = Date.now(), x(), f.value = !1;
46
+ });
47
+ }
48
+ function x(t = 0) {
49
+ const e = i.width, a = i.height;
50
+ p.clearRect(0, 0, e, a), p.drawImage(m, 0, 0, e, a), p.drawImage(v, t, 0, y.value.width * xe, y.value.height * ze), l.value = t;
51
+ }
52
+ function W(t) {
53
+ t = t / y.value.width;
54
+ const e = Date.now(), a = JSON.stringify({ x: t, y: 5 }), s = r.key ? E(a, r.key) : a, C = {
55
+ captchaType: S.BlockPuzzle,
56
+ pointJson: s,
57
+ token: r.token,
58
+ ...i.verifyData
59
+ };
60
+ I.post(i.verifyUrl, C).pipe(
61
+ le(b)
62
+ ).subscribe({
63
+ next: (u) => {
64
+ if (u.code !== 0)
65
+ n.value.type = "danger", n.value.content = u.msg, n.value.visible = !0, h.value.type = "danger", setTimeout(() => {
66
+ n.value.visible = !1, z();
67
+ }, 1e3);
68
+ else {
69
+ const G = ((e - k) / 1e3).toFixed(2);
70
+ n.value.type = "success", n.value.content = `验证成功,耗时 ${G} 秒`, n.value.visible = !0, h.value.type = "primary";
71
+ const P = u.data.token + "---" + a;
72
+ u.data.captcha = r.key ? E(P, r.key) : P;
73
+ }
74
+ R("verified", u);
75
+ }
76
+ });
77
+ }
78
+ function E(t, e) {
79
+ const a = D.parse(e), s = D.parse(t);
80
+ return de.encrypt(s, a, { mode: me, padding: ve }).toString();
81
+ }
82
+ function j(t) {
83
+ l.value = t.x, x(l.value);
84
+ }
85
+ function A() {
86
+ W(l.value);
87
+ }
88
+ function T() {
89
+ setTimeout(() => {
90
+ pe().select(`#${V}`).fields({ node: !0, size: !0 }).exec(([{ node: t, width: e, height: a }]) => {
91
+ if (_) return;
92
+ if (!a || !e)
93
+ return T();
94
+ const s = ue().pixelRatio;
95
+ c = t, p = c.getContext("2d"), c.width = e * s, c.height = a * s, p.scale(s, s), z();
96
+ });
97
+ }, 50);
98
+ }
99
+ return q(() => {
100
+ T();
101
+ }), F(() => {
102
+ _ = !0;
103
+ }), (t, e) => (w(), $("view", ye, [
104
+ o("view", ge, [
105
+ o("canvas", {
106
+ id: V,
107
+ type: "2d",
108
+ class: "sun-slider-captcha-canvas",
109
+ style: H({ height: g(B)(t.height), width: g(B)(t.width) })
110
+ }, null, 4),
111
+ o("view", we, [
112
+ f.value ? (w(), fe(g(ce), { key: 0 })) : N("", !0),
113
+ n.value.visible ? (w(), $("view", {
114
+ key: 1,
115
+ class: U(["sun-slider-captcha-alert", {
116
+ "sun-slider-captcha-alert-success": n.value.type === "success",
117
+ "sun-slider-captcha-alert-danger": n.value.type === "danger"
118
+ }])
119
+ }, he(n.value.content), 3)) : N("", !0)
120
+ ])
26
121
  ]),
27
- t.$slots.default ? (e(), n("view", E, [
28
- C(t.$slots, "default")
29
- ])) : N("", !0)
30
- ], 2));
122
+ o("movable-area", ke, [
123
+ e[3] || (e[3] = o("view", { class: "sun-slider-captcha-hint" }, "拖动滑块以完成拼图", -1)),
124
+ o("view", {
125
+ class: U(["sun-slider-captcha-indicator", {
126
+ "sun-slider-captcha-indicator-primary": h.value.type === "primary",
127
+ "sun-slider-captcha-indicator-danger": h.value.type === "danger"
128
+ }]),
129
+ style: H({ transform: `translateX(calc(-100% + ${l.value}px))` })
130
+ }, null, 6),
131
+ o("movable-view", {
132
+ class: "sun-slider-captcha-handler",
133
+ x: l.value,
134
+ direction: "horizontal",
135
+ disabled: f.value || b.value,
136
+ onChangePassive: e[0] || (e[0] = (a) => j(a.detail)),
137
+ onTouchendPassive: e[1] || (e[1] = (a) => A())
138
+ }, e[2] || (e[2] = [
139
+ o("van-icon", {
140
+ name: "wap-nav",
141
+ style: { transform: "rotate(90deg)" }
142
+ }, null, -1)
143
+ ]), 40, _e)
144
+ ])
145
+ ]));
31
146
  }
32
147
  });
33
148
  export {
34
- y as default
149
+ Le as default
35
150
  };
package/index20.js CHANGED
@@ -1,81 +1,35 @@
1
- import { defineComponent as I, mergeModels as w, useModel as z, ref as f, computed as r, effect as C, unref as T, createVNode as _, normalizeClass as h, createElementVNode as S, openBlock as j, createElementBlock as q } from "vue";
2
- import { vibrator as v } from "@solar-taro/core";
3
- import c from "./index29.js";
4
- const b = T, V = _, m = h, d = S, A = j, D = q, G = ["type", "value", "disabled"], L = /* @__PURE__ */ I({
1
+ import { defineComponent as a, computed as c, renderList as d, Fragment as m, openBlock as p, createElementBlock as u, createElementVNode as _, renderSlot as f, createCommentVNode as k, normalizeClass as g } from "vue";
2
+ const v = d, B = m, e = p, 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({
5
6
  __name: "index",
6
- props: /* @__PURE__ */ w({
7
- type: { default: "decimal" },
8
- min: { default: -1 / 0 },
9
- max: { default: 1 / 0 },
10
- disabled: { type: Boolean }
11
- }, {
12
- modelValue: { default: 0 },
13
- modelModifiers: {}
14
- }),
15
- emits: ["update:modelValue"],
16
- setup(p) {
17
- const t = p, u = z(p, "modelValue"), a = f(""), x = r(() => t.type === "integer" ? "number" : "digit"), y = r(() => ({
18
- "sun-stepper-disabled": t.disabled
19
- })), o = f(!1), M = r(() => u.value <= t.min), B = r(() => u.value >= t.max);
20
- function g() {
21
- const e = u.value;
22
- e >= t.max || (u.value = i(Math.min(t.max, e + 1)), a.value = s(u.value), v.short());
23
- }
24
- function F() {
25
- const e = u.value;
26
- e <= t.min || (u.value = i(Math.max(t.min, e - 1)), a.value = s(u.value), v.short());
27
- }
28
- function N(e) {
29
- a.value = e.detail.value;
30
- let n = E(a.value);
31
- n > t.max ? n = t.max : n < t.min && (n = t.min), u.value = n;
32
- }
33
- function $() {
34
- o.value = !0;
35
- }
36
- function k() {
37
- a.value = s(u.value), o.value = !1;
38
- }
39
- function E(e) {
40
- return e ? i(Number.parseFloat(e) || 0) : 0;
41
- }
42
- function s(e) {
43
- return e = +e, Number.isFinite(e) ? (t.type === "integer" ? Math.trunc(e) : e).toString() : "";
44
- }
45
- function i(e) {
46
- return t.type === "integer" ? Math.trunc(e) : +e.toFixed(2);
47
- }
48
- return C(() => {
49
- o.value || (a.value = s(u.value));
50
- }), (e, n) => (A(), D("view", {
51
- class: m(["sun-stepper", y.value])
7
+ props: {
8
+ size: { default: "middle" },
9
+ spinning: { type: Boolean, default: !0 }
10
+ },
11
+ setup(r) {
12
+ const s = r, l = 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", l.value])
52
20
  }, [
53
- d("view", {
54
- class: m(["sun-stepper-btn sun-stepper-btn-dec", { "sun-stepper-btn-disabled": M.value }]),
55
- "hover-class": "hover",
56
- onTap: n[0] || (n[0] = (l) => F())
57
- }, [
58
- V(b(c), { name: "remove" })
59
- ], 34),
60
- d("input", {
61
- class: "sun-stepper-input",
62
- type: x.value,
63
- value: a.value,
64
- disabled: e.disabled,
65
- onInput: n[1] || (n[1] = (l) => N(l)),
66
- onFocus: n[2] || (n[2] = (l) => $()),
67
- onBlur: n[3] || (n[3] = (l) => k())
68
- }, null, 40, G),
69
- d("view", {
70
- class: m(["sun-stepper-btn sun-stepper-btn-inc", { "sun-stepper-btn-disabled": B.value }]),
71
- "hover-class": "hover",
72
- onTap: n[4] || (n[4] = (l) => g())
73
- }, [
74
- V(b(c), { name: "add" })
75
- ], 34)
21
+ o("view", z, [
22
+ (e(), n(B, null, v(4, (i) => o("view", {
23
+ key: i,
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)
76
30
  ], 2));
77
31
  }
78
32
  });
79
33
  export {
80
- L as default
34
+ y as default
81
35
  };
package/index21.js CHANGED
@@ -1,27 +1,90 @@
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));
1
+ import { defineComponent as w, mergeModels as C, useModel as D, ref as f, computed as a, effect as T, unref as _, createVNode as h, normalizeClass as S, createElementVNode as j, openBlock as q, createElementBlock as A } from "vue";
2
+ import { vibrator as b } from "@solar-taro/core";
3
+ import x from "./index34.js";
4
+ const V = _, y = h, d = S, p = j, G = q, H = A, J = ["type", "value", "disabled"], P = /* @__PURE__ */ w({
5
+ __name: "index",
6
+ props: /* @__PURE__ */ C({
7
+ type: { default: "decimal" },
8
+ expand: { default: "inline" },
9
+ size: { default: "middle" },
10
+ min: { default: -1 / 0 },
11
+ max: { default: 1 / 0 },
12
+ disabled: { type: Boolean }
13
+ }, {
14
+ modelValue: { default: 0 },
15
+ modelModifiers: {}
16
+ }),
17
+ emits: ["update:modelValue"],
18
+ setup(m) {
19
+ const e = m, l = D(m, "modelValue"), s = f(""), M = a(() => e.type === "integer" ? "number" : "digit"), g = a(() => ({
20
+ "sun-stepper-disabled": e.disabled,
21
+ "sun-stepper-inline": e.expand === "inline",
22
+ "sun-stepper-block": e.expand === "block",
23
+ "sun-stepper-small": e.size === "small",
24
+ "sun-stepper-middle": e.size === "middle",
25
+ "sun-stepper-large": e.size === "large"
26
+ })), r = f(!1), z = a(() => l.value <= e.min), B = a(() => l.value >= e.max), v = a(() => e.disabled || z.value), c = a(() => e.disabled || B.value);
27
+ function k() {
28
+ if (c.value) return;
29
+ const n = l.value;
30
+ l.value = o(Math.min(e.max, n + 1)), s.value = i(l.value), b.short();
31
+ }
32
+ function F() {
33
+ if (v.value) return;
34
+ const n = l.value;
35
+ l.value = o(Math.max(e.min, n - 1)), s.value = i(l.value), b.short();
36
+ }
37
+ function N(n) {
38
+ s.value = n.detail.value;
39
+ let t = E(s.value);
40
+ t > e.max ? t = e.max : t < e.min && (t = e.min), l.value = t;
41
+ }
42
+ function I() {
43
+ r.value = !0;
44
+ }
45
+ function $() {
46
+ s.value = i(l.value), r.value = !1;
47
+ }
48
+ function E(n) {
49
+ return n ? o(Number.parseFloat(n) || 0) : 0;
50
+ }
51
+ function i(n) {
52
+ return n = +n, Number.isFinite(n) ? (e.type === "integer" ? Math.trunc(n) : n).toString() : "";
53
+ }
54
+ function o(n) {
55
+ return e.type === "integer" ? Math.trunc(n) : +n.toFixed(2);
56
+ }
57
+ return T(() => {
58
+ r.value || (s.value = i(l.value));
59
+ }), (n, t) => (G(), H("view", {
60
+ class: d(["sun-stepper", g.value])
61
+ }, [
62
+ p("view", {
63
+ class: d(["sun-stepper-btn sun-stepper-btn-dec", { "sun-stepper-btn-disabled": v.value }]),
64
+ "hover-class": "hover",
65
+ onTap: t[0] || (t[0] = (u) => F())
66
+ }, [
67
+ y(V(x), { name: "remove" })
68
+ ], 34),
69
+ p("input", {
70
+ class: "sun-stepper-input",
71
+ type: M.value,
72
+ value: s.value,
73
+ disabled: n.disabled,
74
+ onInput: t[1] || (t[1] = (u) => N(u)),
75
+ onFocus: t[2] || (t[2] = (u) => I()),
76
+ onBlur: t[3] || (t[3] = (u) => $())
77
+ }, null, 40, J),
78
+ p("view", {
79
+ class: d(["sun-stepper-btn sun-stepper-btn-inc", { "sun-stepper-btn-disabled": c.value }]),
80
+ "hover-class": "hover",
81
+ onTap: t[4] || (t[4] = (u) => k())
82
+ }, [
83
+ y(V(x), { name: "add" })
84
+ ], 34)
85
+ ], 2));
23
86
  }
24
87
  });
25
88
  export {
26
- _ as default
89
+ P as default
27
90
  };