@varlet/ui 3.6.5 → 3.7.1-alpha.1732545994482

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.
@@ -3,5 +3,5 @@ import '../../icon/icon.css'
3
3
  import '../../ripple/ripple.css'
4
4
  import '../../popup/popup.css'
5
5
  import '../actionSheet.css'
6
- import '../ActionSheetSfc.css'
7
6
  import '../ActionItemSfc.css'
7
+ import '../ActionSheetSfc.css'
@@ -0,0 +1,71 @@
1
+ import { defineComponent, computed, onMounted, watch } from "vue";
2
+ import { props } from "./props.mjs";
3
+ import { createNamespace } from "../utils/components.mjs";
4
+ import { useMotion } from "@varlet/use";
5
+ import { call, floor, toNumber } from "@varlet/shared";
6
+ const { name, n } = createNamespace("count-to");
7
+ import { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from "vue";
8
+ function __render__(_ctx, _cache) {
9
+ return _openBlock(), _createElementBlock(
10
+ "div",
11
+ {
12
+ class: _normalizeClass(_ctx.n())
13
+ },
14
+ [
15
+ _renderSlot(_ctx.$slots, "default", { value: _ctx.value }, () => [
16
+ _createTextVNode(
17
+ _toDisplayString(_ctx.value),
18
+ 1
19
+ /* TEXT */
20
+ )
21
+ ])
22
+ ],
23
+ 2
24
+ /* CLASS */
25
+ );
26
+ }
27
+ const __sfc__ = defineComponent({
28
+ name,
29
+ props,
30
+ setup(props2) {
31
+ const {
32
+ value: _value,
33
+ reset: _reset,
34
+ // expose
35
+ start,
36
+ // expose
37
+ pause
38
+ } = useMotion({
39
+ from: () => toNumber(props2.from),
40
+ to: () => toNumber(props2.to),
41
+ duration: () => toNumber(props2.duration),
42
+ timingFunction: props2.timingFunction,
43
+ onFinished() {
44
+ call(props2.onEnd);
45
+ }
46
+ });
47
+ const value = computed(() => floor(_value.value, toNumber(props2.precision)));
48
+ watch(() => [props2.from, props2.to, props2.duration], reset);
49
+ onMounted(reset);
50
+ function reset() {
51
+ _reset();
52
+ if (props2.autoStart) {
53
+ start();
54
+ }
55
+ }
56
+ return {
57
+ value,
58
+ n,
59
+ start,
60
+ pause,
61
+ reset,
62
+ toNumber,
63
+ floor
64
+ };
65
+ }
66
+ });
67
+ __sfc__.render = __render__;
68
+ var stdin_default = __sfc__;
69
+ export {
70
+ stdin_default as default
71
+ };
File without changes
@@ -0,0 +1 @@
1
+ :root { --count-to-text-color: var(--color-text); --count-to-text-font-size: var(--font-size-lg);}.var-count-to { color: var(--count-to-text-color); font-size: var(--count-to-text-font-size);}
@@ -0,0 +1,12 @@
1
+ import CountTo from "./CountTo.mjs";
2
+ import { withInstall, withPropsDefaultsSetter } from "../utils/components.mjs";
3
+ import { props as countToProps } from "./props.mjs";
4
+ withInstall(CountTo);
5
+ withPropsDefaultsSetter(CountTo, countToProps);
6
+ const _CountToComponent = CountTo;
7
+ var stdin_default = CountTo;
8
+ export {
9
+ _CountToComponent,
10
+ countToProps,
11
+ stdin_default as default
12
+ };
@@ -0,0 +1,30 @@
1
+ import { defineListenerProp } from "../utils/components.mjs";
2
+ const props = {
3
+ from: {
4
+ type: [String, Number],
5
+ default: 0
6
+ },
7
+ to: {
8
+ type: [String, Number],
9
+ default: 0
10
+ },
11
+ duration: {
12
+ type: [String, Number],
13
+ default: 2e3
14
+ },
15
+ precision: {
16
+ type: [String, Number],
17
+ default: 0
18
+ },
19
+ autoStart: {
20
+ type: Boolean,
21
+ default: true
22
+ },
23
+ timingFunction: {
24
+ type: Function
25
+ },
26
+ onEnd: defineListenerProp()
27
+ };
28
+ export {
29
+ props
30
+ };
@@ -0,0 +1,3 @@
1
+ import '../../styles/common.css'
2
+ import '../countTo.css'
3
+ import '../CountToSfc.css'
@@ -23,6 +23,7 @@ import Collapse from './collapse/index.mjs'
23
23
  import CollapseItem from './collapse-item/index.mjs'
24
24
  import CollapseTransition from './collapse-transition/index.mjs'
25
25
  import Context from './context/index.mjs'
26
+ import CountTo from './count-to/index.mjs'
26
27
  import Countdown from './countdown/index.mjs'
27
28
  import Counter from './counter/index.mjs'
28
29
  import DatePicker from './date-picker/index.mjs'
@@ -116,6 +117,7 @@ export * from './collapse/index.mjs'
116
117
  export * from './collapse-item/index.mjs'
117
118
  export * from './collapse-transition/index.mjs'
118
119
  export * from './context/index.mjs'
120
+ export * from './count-to/index.mjs'
119
121
  export * from './countdown/index.mjs'
120
122
  export * from './counter/index.mjs'
121
123
  export * from './date-picker/index.mjs'
@@ -209,6 +211,7 @@ import './collapse/style/index.mjs'
209
211
  import './collapse-item/style/index.mjs'
210
212
  import './collapse-transition/style/index.mjs'
211
213
  import './context/style/index.mjs'
214
+ import './count-to/style/index.mjs'
212
215
  import './countdown/style/index.mjs'
213
216
  import './counter/style/index.mjs'
214
217
  import './date-picker/style/index.mjs'
@@ -277,7 +280,7 @@ import './tooltip/style/index.mjs'
277
280
  import './uploader/style/index.mjs'
278
281
  import './watermark/style/index.mjs'
279
282
 
280
- const version = '3.6.5'
283
+ const version = '3.7.1-alpha.1732545994482'
281
284
 
282
285
  function install(app) {
283
286
  ActionSheet.install && app.use(ActionSheet)
@@ -305,6 +308,7 @@ function install(app) {
305
308
  CollapseItem.install && app.use(CollapseItem)
306
309
  CollapseTransition.install && app.use(CollapseTransition)
307
310
  Context.install && app.use(Context)
311
+ CountTo.install && app.use(CountTo)
308
312
  Countdown.install && app.use(Countdown)
309
313
  Counter.install && app.use(Counter)
310
314
  DatePicker.install && app.use(DatePicker)
@@ -402,6 +406,7 @@ export {
402
406
  CollapseItem,
403
407
  CollapseTransition,
404
408
  Context,
409
+ CountTo,
405
410
  Countdown,
406
411
  Counter,
407
412
  DatePicker,
@@ -499,6 +504,7 @@ export default {
499
504
  CollapseItem,
500
505
  CollapseTransition,
501
506
  Context,
507
+ CountTo,
502
508
  Countdown,
503
509
  Counter,
504
510
  DatePicker,
package/es/index.mjs CHANGED
@@ -23,6 +23,7 @@ import Collapse from './collapse/index.mjs'
23
23
  import CollapseItem from './collapse-item/index.mjs'
24
24
  import CollapseTransition from './collapse-transition/index.mjs'
25
25
  import Context from './context/index.mjs'
26
+ import CountTo from './count-to/index.mjs'
26
27
  import Countdown from './countdown/index.mjs'
27
28
  import Counter from './counter/index.mjs'
28
29
  import DatePicker from './date-picker/index.mjs'
@@ -116,6 +117,7 @@ export * from './collapse/index.mjs'
116
117
  export * from './collapse-item/index.mjs'
117
118
  export * from './collapse-transition/index.mjs'
118
119
  export * from './context/index.mjs'
120
+ export * from './count-to/index.mjs'
119
121
  export * from './countdown/index.mjs'
120
122
  export * from './counter/index.mjs'
121
123
  export * from './date-picker/index.mjs'
@@ -184,7 +186,7 @@ export * from './tooltip/index.mjs'
184
186
  export * from './uploader/index.mjs'
185
187
  export * from './watermark/index.mjs'
186
188
 
187
- const version = '3.6.5'
189
+ const version = '3.7.1-alpha.1732545994482'
188
190
 
189
191
  function install(app) {
190
192
  ActionSheet.install && app.use(ActionSheet)
@@ -212,6 +214,7 @@ function install(app) {
212
214
  CollapseItem.install && app.use(CollapseItem)
213
215
  CollapseTransition.install && app.use(CollapseTransition)
214
216
  Context.install && app.use(Context)
217
+ CountTo.install && app.use(CountTo)
215
218
  Countdown.install && app.use(Countdown)
216
219
  Counter.install && app.use(Counter)
217
220
  DatePicker.install && app.use(DatePicker)
@@ -309,6 +312,7 @@ export {
309
312
  CollapseItem,
310
313
  CollapseTransition,
311
314
  Context,
315
+ CountTo,
312
316
  Countdown,
313
317
  Counter,
314
318
  DatePicker,
@@ -406,6 +410,7 @@ export default {
406
410
  CollapseItem,
407
411
  CollapseTransition,
408
412
  Context,
413
+ CountTo,
409
414
  Countdown,
410
415
  Counter,
411
416
  DatePicker,