y-design-ssr 0.2.2 → 0.2.4

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 (119) hide show
  1. package/libs/button/index.css +1 -579
  2. package/libs/button/index.mjs +66 -111
  3. package/libs/button/index.umd.js +2 -203
  4. package/libs/button/package.json +5 -0
  5. package/libs/cell/index.css +1 -1077
  6. package/libs/cell/index.mjs +104 -167
  7. package/libs/cell/index.umd.js +2 -300
  8. package/libs/cell/package.json +5 -0
  9. package/libs/checkbox/index.css +1 -1053
  10. package/libs/checkbox/index.mjs +127 -242
  11. package/libs/checkbox/index.umd.js +2 -369
  12. package/libs/checkbox/package.json +5 -0
  13. package/libs/checkboxGroup/index.css +1 -422
  14. package/libs/checkboxGroup/index.mjs +87 -173
  15. package/libs/checkboxGroup/index.umd.js +2 -265
  16. package/libs/checkboxGroup/package.json +5 -0
  17. package/libs/col/index.css +1 -615
  18. package/libs/col/index.mjs +81 -246
  19. package/libs/col/index.umd.js +2 -305
  20. package/libs/col/package.json +5 -0
  21. package/libs/countdown/index.css +1 -417
  22. package/libs/countdown/index.mjs +71 -179
  23. package/libs/countdown/index.umd.js +2 -231
  24. package/libs/countdown/package.json +5 -0
  25. package/libs/dialog/index.css +1 -1405
  26. package/libs/dialog/index.mjs +476 -646
  27. package/libs/dialog/index.umd.js +2 -1128
  28. package/libs/dialog/package.json +5 -0
  29. package/libs/empty/index.css +1 -457
  30. package/libs/empty/index.mjs +44 -91
  31. package/libs/empty/index.umd.js +2 -139
  32. package/libs/empty/package.json +5 -0
  33. package/libs/form/index.css +1 -477
  34. package/libs/form/index.mjs +126 -226
  35. package/libs/form/index.umd.js +2 -319
  36. package/libs/form/package.json +5 -0
  37. package/libs/formItem/index.css +1 -477
  38. package/libs/formItem/index.mjs +126 -276
  39. package/libs/formItem/index.umd.js +2 -372
  40. package/libs/formItem/package.json +5 -0
  41. package/libs/icon/index.css +1 -982
  42. package/libs/icon/index.mjs +58 -107
  43. package/libs/icon/index.umd.js +2 -186
  44. package/libs/icon/package.json +5 -0
  45. package/libs/index.css +1 -2902
  46. package/libs/index.mjs +2348 -3789
  47. package/libs/index.umd.js +2 -5509
  48. package/libs/input/index.css +1 -483
  49. package/libs/input/index.mjs +92 -183
  50. package/libs/input/index.umd.js +2 -274
  51. package/libs/input/package.json +5 -0
  52. package/libs/layout/index.css +1 -684
  53. package/libs/layout/index.mjs +130 -230
  54. package/libs/layout/index.umd.js +2 -318
  55. package/libs/layout/package.json +5 -0
  56. package/libs/list/index.css +1 -440
  57. package/libs/list/index.mjs +207 -388
  58. package/libs/list/index.umd.js +2 -571
  59. package/libs/list/package.json +5 -0
  60. package/libs/loading/index.css +1 -548
  61. package/libs/loading/index.mjs +118 -196
  62. package/libs/loading/index.umd.js +2 -321
  63. package/libs/loading/package.json +5 -0
  64. package/libs/mask/index.css +1 -426
  65. package/libs/mask/index.mjs +70 -131
  66. package/libs/mask/index.umd.js +2 -201
  67. package/libs/mask/package.json +5 -0
  68. package/libs/popup/index.css +1 -465
  69. package/libs/popup/index.mjs +134 -210
  70. package/libs/popup/index.umd.js +2 -358
  71. package/libs/popup/package.json +5 -0
  72. package/libs/progress/index.css +1 -488
  73. package/libs/progress/index.mjs +128 -200
  74. package/libs/progress/index.umd.js +2 -322
  75. package/libs/progress/package.json +5 -0
  76. package/libs/pullrefresh/index.css +1 -441
  77. package/libs/pullrefresh/index.mjs +111 -241
  78. package/libs/pullrefresh/index.umd.js +2 -302
  79. package/libs/pullrefresh/package.json +5 -0
  80. package/libs/row/index.css +1 -485
  81. package/libs/row/index.mjs +89 -181
  82. package/libs/row/index.umd.js +2 -237
  83. package/libs/row/package.json +5 -0
  84. package/libs/slider/index.css +1 -558
  85. package/libs/slider/index.mjs +160 -356
  86. package/libs/slider/index.umd.js +2 -453
  87. package/libs/slider/package.json +5 -0
  88. package/libs/stepper/index.css +1 -489
  89. package/libs/stepper/index.mjs +101 -181
  90. package/libs/stepper/index.umd.js +2 -269
  91. package/libs/stepper/package.json +5 -0
  92. package/libs/swipe/index.css +1 -506
  93. package/libs/swipe/index.mjs +259 -542
  94. package/libs/swipe/index.umd.js +2 -703
  95. package/libs/swipe/package.json +5 -0
  96. package/libs/swipeItem/index.css +1 -424
  97. package/libs/swipeItem/index.mjs +52 -111
  98. package/libs/swipeItem/index.umd.js +2 -154
  99. package/libs/swipeItem/package.json +5 -0
  100. package/libs/switch/index.css +1 -472
  101. package/libs/switch/index.mjs +62 -121
  102. package/libs/switch/index.umd.js +2 -200
  103. package/libs/switch/package.json +5 -0
  104. package/libs/tab/index.mjs +68 -131
  105. package/libs/tab/index.umd.js +1 -190
  106. package/libs/tab/package.json +5 -0
  107. package/libs/tabs/index.css +1 -514
  108. package/libs/tabs/index.mjs +410 -751
  109. package/libs/tabs/index.umd.js +2 -1020
  110. package/libs/tabs/package.json +5 -0
  111. package/libs/toast/index.css +1 -1050
  112. package/libs/toast/index.mjs +114 -183
  113. package/libs/toast/index.umd.js +2 -306
  114. package/libs/toast/package.json +5 -0
  115. package/libs/tooltip/index.css +1 -514
  116. package/libs/tooltip/index.mjs +155 -293
  117. package/libs/tooltip/index.umd.js +2 -416
  118. package/libs/tooltip/package.json +5 -0
  119. package/package.json +5 -12
@@ -1,40 +1,11 @@
1
- import { ref, reactive, defineComponent, computed, createVNode } from "vue";
2
- const getMods = (el, mods) => {
3
- if (!mods) {
4
- return "";
5
- }
6
- if (typeof mods === "string") {
7
- return ` ${el}--${mods}`;
8
- }
9
- if (Array.isArray(mods)) {
10
- return mods.reduce((acc, cur) => acc + getMods(el, cur), "");
11
- }
12
- return Object.keys(mods).reduce(
13
- (acc, cur) => acc + (mods[cur] ? getMods(el, cur) : ""),
14
- ""
15
- );
16
- };
17
- const createBEM = (block) => {
18
- return (el, mods) => {
19
- let _el = el;
20
- let _mods = mods;
21
- if (_el && typeof _el !== "string") {
22
- _mods = _el;
23
- _el = "";
24
- }
25
- _el = _el ? `${block}__${_el}` : block;
26
- return `${_el}${getMods(_el, _mods)}`;
27
- };
28
- };
29
- const createGlobalBem = () => {
30
- return (el, mods) => {
31
- if (!mods) {
32
- return `y-${el}`;
33
- }
34
- return `${getMods(`y-${el}`, mods)}`;
35
- };
36
- };
37
- const defaultLang = {
1
+ import { ref as s, reactive as E, defineComponent as H, computed as V, createVNode as g } from "vue";
2
+ const $ = (e, a) => a ? typeof a == "string" ? ` ${e}--${a}` : Array.isArray(a) ? a.reduce((o, n) => o + $(e, n), "") : Object.keys(a).reduce(
3
+ (o, n) => o + (a[n] ? $(e, n) : ""),
4
+ ""
5
+ ) : "", P = (e) => (a, o) => {
6
+ let n = a, u = o;
7
+ return n && typeof n != "string" && (u = n, n = ""), n = n ? `${e}__${n}` : e, `${n}${$(n, u)}`;
8
+ }, G = () => (e, a) => a ? `${$(`y-${e}`, a)}` : `y-${e}`, J = {
38
9
  "pull-refresh": {
39
10
  pulling: "下拉刷新...",
40
11
  loosing: "释放刷新...",
@@ -46,94 +17,39 @@ const defaultLang = {
46
17
  validateMessage: "请输入正确内容"
47
18
  }
48
19
  };
49
- ref("zh-CN");
50
- reactive({
51
- "zh-CN": defaultLang
20
+ s("zh-CN");
21
+ E({
22
+ "zh-CN": J
52
23
  });
53
- const createNamespace = (name) => {
54
- const prefixedName = `y-${name}`;
55
- return [prefixedName, createBEM(prefixedName), createGlobalBem()];
56
- };
57
- const parseUnit = (val) => {
58
- if (isNaN(Number(val)) && typeof val === "string") {
59
- return val;
60
- }
61
- return `${val}px`;
62
- };
63
- const MIN_DISTANCE = 10;
64
- const getDirection = (x, y) => {
65
- if (x > y && x > MIN_DISTANCE) {
66
- return "horizontal";
67
- }
68
- if (y > x && y > MIN_DISTANCE) {
69
- return "vertical";
70
- }
71
- return "";
72
- };
73
- const getTouchDirection = (x, y) => {
74
- if (Math.abs(x) > Math.abs(y)) {
75
- if (x > 0)
76
- return "right";
77
- return "left";
78
- }
79
- if (y > 0)
80
- return "bottom";
81
- return "top";
82
- };
83
- const useTouch = () => {
84
- const startX = ref(0);
85
- const startY = ref(0);
86
- const deltaX = ref(0);
87
- const deltaY = ref(0);
88
- const offsetX = ref(0);
89
- const offsetY = ref(0);
90
- const direction = ref("");
91
- const touchDirection = ref("");
92
- const isVertical = () => direction.value === "vertical";
93
- const isHorizontal = () => direction.value === "horizontal";
94
- const reset2 = () => {
95
- deltaX.value = 0;
96
- deltaY.value = 0;
97
- offsetX.value = 0;
98
- offsetY.value = 0;
99
- direction.value = "";
100
- touchDirection.value = "";
101
- };
102
- const start = (event) => {
103
- reset2();
104
- startX.value = event.touches[0].clientX;
105
- startY.value = event.touches[0].clientY;
106
- };
107
- const move = (event) => {
108
- const touch = event.touches[0];
109
- deltaX.value = touch.clientX < 0 ? 0 : touch.clientX - startX.value;
110
- deltaY.value = touch.clientY - startY.value;
111
- offsetX.value = Math.abs(deltaX.value);
112
- offsetY.value = Math.abs(deltaY.value);
113
- if (!direction.value) {
114
- direction.value = getDirection(offsetX.value, offsetY.value);
115
- }
116
- touchDirection.value = getTouchDirection(deltaX.value, deltaY.value);
24
+ const j = (e) => {
25
+ const a = `y-${e}`;
26
+ return [a, P(a), G()];
27
+ }, L = (e) => isNaN(Number(e)) && typeof e == "string" ? e : `${e}px`, _ = 10, U = (e, a) => e > a && e > _ ? "horizontal" : a > e && a > _ ? "vertical" : "", p = (e, a) => Math.abs(e) > Math.abs(a) ? e > 0 ? "right" : "left" : a > 0 ? "bottom" : "top", q = () => {
28
+ const e = s(0), a = s(0), o = s(0), n = s(0), u = s(0), i = s(0), c = s(""), C = s(""), h = () => c.value === "vertical", b = () => c.value === "horizontal", N = () => {
29
+ o.value = 0, n.value = 0, u.value = 0, i.value = 0, c.value = "", C.value = "";
117
30
  };
118
31
  return {
119
- move,
120
- start,
121
- reset: reset2,
122
- startX,
123
- startY,
124
- deltaX,
125
- deltaY,
126
- offsetX,
127
- offsetY,
128
- direction,
129
- touchDirection,
130
- isVertical,
131
- isHorizontal
32
+ move: (m) => {
33
+ const y = m.touches[0];
34
+ o.value = y.clientX < 0 ? 0 : y.clientX - e.value, n.value = y.clientY - a.value, u.value = Math.abs(o.value), i.value = Math.abs(n.value), c.value || (c.value = U(u.value, i.value)), C.value = p(o.value, n.value);
35
+ },
36
+ start: (m) => {
37
+ N(), e.value = m.touches[0].clientX, a.value = m.touches[0].clientY;
38
+ },
39
+ reset: N,
40
+ startX: e,
41
+ startY: a,
42
+ deltaX: o,
43
+ deltaY: n,
44
+ offsetX: u,
45
+ offsetY: i,
46
+ direction: c,
47
+ touchDirection: C,
48
+ isVertical: h,
49
+ isHorizontal: b
132
50
  };
133
- };
134
- const [cname, bem] = createNamespace("slider");
135
- const Slider = /* @__PURE__ */ defineComponent({
136
- name: cname,
51
+ }, [F, d] = j("slider"), R = /* @__PURE__ */ H({
52
+ name: F,
137
53
  props: {
138
54
  modelValue: {
139
55
  type: [Number, Array],
@@ -165,11 +81,11 @@ const Slider = /* @__PURE__ */ defineComponent({
165
81
  },
166
82
  disabled: {
167
83
  type: Boolean,
168
- default: false
84
+ default: !1
169
85
  },
170
86
  showTooltip: {
171
87
  type: Boolean,
172
- default: false
88
+ default: !1
173
89
  },
174
90
  step: {
175
91
  type: Number,
@@ -189,259 +105,147 @@ const Slider = /* @__PURE__ */ defineComponent({
189
105
  }
190
106
  },
191
107
  emits: ["change", "drag-start", "drag-end", "update:modelValue"],
192
- setup(props, {
193
- emit,
194
- slots
108
+ setup(e, {
109
+ emit: a,
110
+ slots: o
195
111
  }) {
196
- const rootRef = ref();
197
- const startRef = ref(0);
198
- const curRef = ref(0);
199
- const moveStatusRef = ref("");
200
- const touch = useTouch();
201
- const isRangeRef = computed(() => Array.isArray(props.modelValue));
202
- const formatValue = (value) => {
112
+ const n = s(), u = s(0), i = s(0), c = s(""), C = q(), h = V(() => Array.isArray(e.modelValue)), b = (t) => {
203
113
  const {
204
- min,
205
- max,
206
- step
207
- } = props;
208
- const val = Math.max(min, Math.min(value, max));
209
- return Math.round(val / step) * step;
210
- };
211
- const handleClick = (event) => {
212
- event.stopPropagation();
213
- if (props.disabled)
114
+ min: r,
115
+ max: l,
116
+ step: f
117
+ } = e, v = Math.max(r, Math.min(t, l));
118
+ return Math.round(v / f) * f;
119
+ }, N = (t) => {
120
+ if (t.stopPropagation(), e.disabled)
214
121
  return;
215
122
  const {
216
- min,
217
- modelValue
218
- } = props;
123
+ min: r,
124
+ modelValue: l
125
+ } = e, {
126
+ left: f,
127
+ width: v
128
+ } = n.value.getBoundingClientRect(), S = t.clientX - f, T = Math.floor(r + S / v * M.value);
129
+ if (h.value) {
130
+ const X = l[0], x = l[1], W = (X + x) / 2;
131
+ T <= W ? m([T, x]) : m([X, T]);
132
+ } else
133
+ m(T);
134
+ }, w = (t) => t[0] > t[1] ? [t[1], t[0]] : t, k = (t, r) => JSON.stringify(t) === JSON.stringify(r), m = (t, r) => {
135
+ let l = 0;
136
+ h.value ? l = w(t).map(b) : l = b(t), a("update:modelValue", l), typeof r > "u" && !k(u.value, i.value) && a("change", l);
137
+ }, y = V(() => {
219
138
  const {
220
- left: rootLeft,
221
- width: rootWidth
222
- } = rootRef.value.getBoundingClientRect();
223
- const delta = event.clientX - rootLeft;
224
- const curValue = Math.floor(min + delta / rootWidth * numberGapRef.value);
225
- if (isRangeRef.value) {
226
- const left = modelValue[0];
227
- const right = modelValue[1];
228
- const middle = (left + right) / 2;
229
- if (curValue <= middle) {
230
- updateValue([curValue, right]);
231
- } else {
232
- updateValue([left, curValue]);
233
- }
234
- } else {
235
- updateValue(curValue);
236
- }
237
- };
238
- const handlePositionOrder = (value) => {
239
- if (value[0] > value[1]) {
240
- return [value[1], value[0]];
241
- }
242
- return value;
243
- };
244
- const isSameValue = (beforeValue, curValue) => JSON.stringify(beforeValue) === JSON.stringify(curValue);
245
- const updateValue = (value, unfinished) => {
246
- let newValue = 0;
247
- if (isRangeRef.value) {
248
- newValue = handlePositionOrder(value).map(formatValue);
249
- } else {
250
- newValue = formatValue(value);
251
- }
252
- emit("update:modelValue", newValue);
253
- if (typeof unfinished === "undefined" && !isSameValue(startRef.value, curRef.value)) {
254
- emit("change", newValue);
255
- }
256
- };
257
- const getInnerLengthPercentRef = computed(() => {
139
+ modelValue: t,
140
+ min: r
141
+ } = e;
142
+ let l = null;
143
+ return h.value ? l = Math.floor((b(t[1]) - b(t[0])) * 100 / M.value) : l = Math.floor((b(t) - r) * 100 / M.value), `${l}%`;
144
+ }), A = V(() => {
258
145
  const {
259
- modelValue,
260
- min
261
- } = props;
262
- let tmpVal = null;
263
- if (isRangeRef.value) {
264
- tmpVal = Math.floor((formatValue(modelValue[1]) - formatValue(modelValue[0])) * 100 / numberGapRef.value);
265
- } else {
266
- tmpVal = Math.floor((formatValue(modelValue) - min) * 100 / numberGapRef.value);
267
- }
268
- return `${tmpVal}%`;
269
- });
270
- const getOffsetRef = computed(() => {
271
- const {
272
- modelValue,
273
- min
274
- } = props;
275
- if (isRangeRef.value) {
276
- return `${Math.floor((formatValue(modelValue[0]) - min) * 100 / numberGapRef.value)}%`;
277
- }
278
- return "0%";
279
- });
280
- const toolTipStyle = computed(() => {
281
- return {
282
- left: getInnerLengthPercentRef.value,
283
- transition: moveStatusRef.value === "moving" ? "none" : `${props.transitionTime}ms ease-in-out`
284
- };
285
- });
286
- const numberGapRef = computed(() => props.max - props.min);
287
- const handleTouchStart = (event) => {
288
- if (props.disabled)
289
- return;
290
- touch.start(event);
291
- moveStatusRef.value = "startMove";
292
- curRef.value = props.modelValue;
293
- if (isRangeRef.value) {
294
- startRef.value = [...curRef.value];
295
- } else {
296
- startRef.value = curRef.value;
297
- }
298
- };
299
- const handleTouchMove = (event, pos) => {
300
- if (props.disabled)
146
+ modelValue: t,
147
+ min: r
148
+ } = e;
149
+ return h.value ? `${Math.floor((b(t[0]) - r) * 100 / M.value)}%` : "0%";
150
+ }), z = V(() => ({
151
+ left: y.value,
152
+ transition: c.value === "moving" ? "none" : `${e.transitionTime}ms ease-in-out`
153
+ })), M = V(() => e.max - e.min), D = (t) => {
154
+ e.disabled || (C.start(t), c.value = "startMove", i.value = e.modelValue, h.value ? u.value = [...i.value] : u.value = i.value);
155
+ }, I = (t, r) => {
156
+ if (e.disabled)
301
157
  return;
302
- touch.move(event);
303
- if (moveStatusRef.value === "startMove") {
304
- emit("drag-start");
305
- }
306
- moveStatusRef.value = "moving";
158
+ C.move(t), c.value === "startMove" && a("drag-start"), c.value = "moving";
307
159
  const {
308
- width
309
- } = rootRef.value.getBoundingClientRect();
310
- const delta = touch.deltaX.value;
311
- const diff = Math.floor(delta / width * numberGapRef.value);
312
- if (Array.isArray(startRef.value) && Array.isArray(curRef.value)) {
313
- if (pos === "left") {
314
- curRef.value[0] = startRef.value[0] + diff;
315
- } else {
316
- curRef.value[1] = startRef.value[1] + diff;
160
+ width: l
161
+ } = n.value.getBoundingClientRect(), f = C.deltaX.value, v = Math.floor(f / l * M.value);
162
+ Array.isArray(u.value) && Array.isArray(i.value) ? r === "left" ? i.value[0] = u.value[0] + v : i.value[1] = u.value[1] + v : i.value = u.value + v, m(i.value, !0);
163
+ }, O = () => {
164
+ e.disabled || (c.value === "moving" && (m(i.value), a("drag-end")), c.value = "endMove");
165
+ }, B = (t) => {
166
+ let r = "", l = {}, f = 0, v = d("button-wrapper");
167
+ return t === 0 ? (r = "left", l = {
168
+ left: A.value,
169
+ backgroundColor: Array.isArray(e.buttonBgColor) ? e.buttonBgColor[0] : e.buttonBgColor
170
+ }, f = e.modelValue[t], v = d("button-wrapper", "left")) : t === 1 ? (r = "right", f = e.modelValue[t], l = {
171
+ left: `${parseInt(y.value) + parseInt(A.value)}%`,
172
+ backgroundColor: Array.isArray(e.buttonBgColor) ? e.buttonBgColor[1] : e.buttonBgColor
173
+ }, v = d("button-wrapper", "right")) : (f = e.modelValue, l = {
174
+ left: y.value,
175
+ backgroundColor: e.buttonBgColor
176
+ }), g("div", {
177
+ role: "slider",
178
+ "aria-valuemin": e.min,
179
+ "aria-valuemax": e.max,
180
+ "aria-valuenow": f,
181
+ class: v,
182
+ onTouchstart: D,
183
+ onTouchmove: (S) => I(S, r),
184
+ onTouchend: O,
185
+ style: {
186
+ ...l,
187
+ transition: c.value === "moving" ? "none" : `${e.transitionTime}ms ease-in-out`
317
188
  }
318
- } else {
319
- curRef.value = startRef.value + diff;
320
- }
321
- updateValue(curRef.value, true);
322
- };
323
- const handleTouchEnd = () => {
324
- if (props.disabled)
325
- return;
326
- if (moveStatusRef.value === "moving") {
327
- updateValue(curRef.value);
328
- emit("drag-end");
329
- }
330
- moveStatusRef.value = "endMove";
331
- };
332
- const renderButton = (index) => {
333
- let pos = "";
334
- let posStyle = {};
335
- let curValue = 0;
336
- let buttonWrapperClass = bem("button-wrapper");
337
- if (index === 0) {
338
- pos = "left";
339
- posStyle = {
340
- left: getOffsetRef.value,
341
- backgroundColor: Array.isArray(props.buttonBgColor) ? props.buttonBgColor[0] : props.buttonBgColor
342
- };
343
- curValue = props.modelValue[index];
344
- buttonWrapperClass = bem("button-wrapper", "left");
345
- } else if (index === 1) {
346
- pos = "right";
347
- curValue = props.modelValue[index];
348
- posStyle = {
349
- left: `${parseInt(getInnerLengthPercentRef.value) + parseInt(getOffsetRef.value)}%`,
350
- backgroundColor: Array.isArray(props.buttonBgColor) ? props.buttonBgColor[1] : props.buttonBgColor
351
- };
352
- buttonWrapperClass = bem("button-wrapper", "right");
353
- } else {
354
- curValue = props.modelValue;
355
- posStyle = {
356
- left: getInnerLengthPercentRef.value,
357
- backgroundColor: props.buttonBgColor
358
- };
359
- }
360
- return createVNode("div", {
361
- "role": "slider",
362
- "aria-valuemin": props.min,
363
- "aria-valuemax": props.max,
364
- "aria-valuenow": curValue,
365
- "class": buttonWrapperClass,
366
- "onTouchstart": handleTouchStart,
367
- "onTouchmove": (e) => handleTouchMove(e, pos),
368
- "onTouchend": handleTouchEnd,
369
- "style": {
370
- ...posStyle,
371
- transition: moveStatusRef.value === "moving" ? "none" : `${props.transitionTime}ms ease-in-out`
372
- }
373
- }, [slots.button ? slots.button() : createVNode("div", {
374
- "class": bem("inner-button"),
375
- "style": posStyle
189
+ }, [o.button ? o.button() : g("div", {
190
+ class: d("inner-button"),
191
+ style: l
376
192
  }, null)]);
377
- };
378
- const getDotListRef = computed(() => {
379
- const arr = Array((props.max - props.min) / props.step).fill({});
380
- return arr.map((_, index) => ({
381
- position: `${index * props.step}%`
382
- }));
383
- });
193
+ }, Y = V(() => Array((e.max - e.min) / e.step).fill({}).map((r, l) => ({
194
+ position: `${l * e.step}%`
195
+ })));
384
196
  return () => {
385
- var _a;
386
- return createVNode("div", {
387
- "class": bem()
388
- }, [slots.iconLeft && createVNode("div", {
389
- "class": bem("icon", {
390
- left: true
197
+ var t;
198
+ return g("div", {
199
+ class: d()
200
+ }, [o.iconLeft && g("div", {
201
+ class: d("icon", {
202
+ left: !0
391
203
  })
392
- }, [slots.iconLeft()]), createVNode("div", {
393
- "role": "presentation",
394
- "ref": rootRef,
395
- "class": bem("wrapper-main", {
396
- disabled: props.disabled
204
+ }, [o.iconLeft()]), g("div", {
205
+ role: "presentation",
206
+ ref: n,
207
+ class: d("wrapper-main", {
208
+ disabled: e.disabled
397
209
  }),
398
- "style": {
399
- background: props.inactiveColor,
400
- height: parseUnit(props.barHeight)
210
+ style: {
211
+ background: e.inactiveColor,
212
+ height: L(e.barHeight)
401
213
  },
402
- "onClick": handleClick
403
- }, [props.step !== 1 && createVNode("div", {
404
- "class": bem("dots")
405
- }, [getDotListRef.value.map((item) => {
406
- return createVNode("div", {
407
- "class": bem("dot"),
408
- "style": {
409
- left: item.position,
410
- background: props.gapColor,
411
- width: parseUnit(props.gapWidth)
412
- }
413
- }, null);
414
- })]), props.showTooltip && createVNode("div", {
415
- "class": bem("tooltip", {
416
- wrapper: slots.toolTip
214
+ onClick: N
215
+ }, [e.step !== 1 && g("div", {
216
+ class: d("dots")
217
+ }, [Y.value.map((r) => g("div", {
218
+ class: d("dot"),
219
+ style: {
220
+ left: r.position,
221
+ background: e.gapColor,
222
+ width: L(e.gapWidth)
223
+ }
224
+ }, null))]), e.showTooltip && g("div", {
225
+ class: d("tooltip", {
226
+ wrapper: o.toolTip
417
227
  }),
418
- "style": toolTipStyle.value
419
- }, [((_a = slots.toolTip) == null ? void 0 : _a.call(slots)) || props.modelValue]), createVNode("div", {
420
- "style": {
421
- left: getOffsetRef.value,
422
- width: getInnerLengthPercentRef.value,
423
- background: props.activeColor,
424
- transition: moveStatusRef.value === "moving" ? "none" : `${props.transitionTime}ms ease-in-out`
228
+ style: z.value
229
+ }, [((t = o.toolTip) == null ? void 0 : t.call(o)) || e.modelValue]), g("div", {
230
+ style: {
231
+ left: A.value,
232
+ width: y.value,
233
+ background: e.activeColor,
234
+ transition: c.value === "moving" ? "none" : `${e.transitionTime}ms ease-in-out`
425
235
  },
426
- "class": bem("inner")
427
- }, null), isRangeRef.value ? [renderButton(0), renderButton(1)] : renderButton()]), slots.iconRight && createVNode("div", {
428
- "class": bem("icon", {
429
- right: true
236
+ class: d("inner")
237
+ }, null), h.value ? [B(0), B(1)] : B()]), o.iconRight && g("div", {
238
+ class: d("icon", {
239
+ right: !0
430
240
  })
431
- }, [slots.iconRight()])]);
241
+ }, [o.iconRight()])]);
432
242
  };
433
243
  }
434
244
  });
435
- const reset = "";
436
- const libs = "";
437
- const font = "";
438
- const animation = "";
439
- const theme = "";
440
- const style = "";
441
- Slider.install = (Vue) => {
442
- const { name } = Slider;
443
- Vue.component(name, Slider);
245
+ R.install = (e) => {
246
+ const { name: a } = R;
247
+ e.component(a, R);
444
248
  };
445
249
  export {
446
- Slider as default
250
+ R as default
447
251
  };