timered-counter 1.2.0 → 1.3.0-beta.1
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.
- package/custom-elements.json +264 -64
- package/dist/custom-elements.json +264 -64
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/timered-counter-adapter.d.ts +2 -1
- package/dist/src/timered-counter-adapter.js +4 -1
- package/dist/src/timered-counter-adapter.js.map +1 -1
- package/dist/src/timered-counter-datetime-duration.js +5 -7
- package/dist/src/timered-counter-datetime-duration.js.map +1 -1
- package/dist/src/timered-counter-number.js +5 -7
- package/dist/src/timered-counter-number.js.map +1 -1
- package/dist/src/timered-counter-string.js +4 -8
- package/dist/src/timered-counter-string.js.map +1 -1
- package/dist/src/timered-counter.js +5 -7
- package/dist/src/timered-counter.js.map +1 -1
- package/dist/src/transitions/roller/roller-digit.js +5 -7
- package/dist/src/transitions/roller/roller-digit.js.map +1 -1
- package/dist/src/transitions/roller/roller.js +5 -7
- package/dist/src/transitions/roller/roller.js.map +1 -1
- package/dist/src/utils/grace-define-custom-element.d.ts +1 -0
- package/dist/src/utils/grace-define-custom-element.js +10 -0
- package/dist/src/utils/grace-define-custom-element.js.map +1 -0
- package/dist/src/wrappers/vue/format-props.d.ts +1 -0
- package/dist/src/wrappers/vue/format-props.js +22 -0
- package/dist/src/wrappers/vue/format-props.js.map +1 -0
- package/dist/src/wrappers/vue/index.d.ts +14 -0
- package/dist/src/wrappers/vue/index.js +13 -0
- package/dist/src/wrappers/vue/index.js.map +1 -0
- package/dist/src/wrappers/vue/timered-counter-datetime-duration.d.ts +14 -0
- package/dist/src/wrappers/vue/timered-counter-datetime-duration.js +39 -0
- package/dist/src/wrappers/vue/timered-counter-datetime-duration.js.map +1 -0
- package/dist/src/wrappers/vue/timered-counter-number.d.ts +14 -0
- package/dist/src/wrappers/vue/timered-counter-number.js +39 -0
- package/dist/src/wrappers/vue/timered-counter-number.js.map +1 -0
- package/dist/src/wrappers/vue/timered-counter-string.d.ts +14 -0
- package/dist/src/wrappers/vue/timered-counter-string.js +38 -0
- package/dist/src/wrappers/vue/timered-counter-string.js.map +1 -0
- package/dist/stories/timered-counter/decimaljs.stories.js +1 -1
- package/dist/stories/timered-counter/decimaljs.stories.js.map +1 -1
- package/dist/stories/timered-counter-number/decimaljs.stories.js +1 -1
- package/dist/stories/timered-counter-number/decimaljs.stories.js.map +1 -1
- package/dist/stories/timered-counter-string/decimaljs.stories.js +1 -1
- package/dist/stories/timered-counter-string/decimaljs.stories.js.map +1 -1
- package/dist/stories/timered-counter-string/grapheme-splitter.stories.js +2 -2
- package/dist/stories/timered-counter-string/grapheme-splitter.stories.js.map +1 -1
- package/dist/stories/timered-counter-string/intl-segmenter.stories.js +1 -1
- package/dist/stories/timered-counter-string/intl-segmenter.stories.js.map +1 -1
- package/dist/timered-counter.esm-browser.js +53 -58
- package/dist/timered-counter.esm-browser.js.map +1 -1
- package/dist/timered-counter.global.js +47 -52
- package/dist/timered-counter.global.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -2
@@ -0,0 +1,14 @@
|
|
1
|
+
import type { Plugin } from 'vue';
|
2
|
+
import { TimeredCounterNumber } from './timered-counter-number.js';
|
3
|
+
import { TimeredCounterDatetimeDuration } from './timered-counter-datetime-duration.js';
|
4
|
+
import { TimeredCounterString } from './timered-counter-string.js';
|
5
|
+
declare const TimeredCounterPlugin: Plugin;
|
6
|
+
export { TimeredCounterNumber, TimeredCounterString, TimeredCounterDatetimeDuration, };
|
7
|
+
export default TimeredCounterPlugin;
|
8
|
+
declare module 'vue' {
|
9
|
+
interface GlobalComponents {
|
10
|
+
TimeredCounterNumber: typeof import('timered-counter/vue').TimeredCounterNumber;
|
11
|
+
TimeredCounterDatetimeDuration: typeof import('timered-counter/vue').TimeredCounterDatetimeDuration;
|
12
|
+
TimeredCounterString: typeof import('timered-counter/vue').TimeredCounterString;
|
13
|
+
}
|
14
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { TimeredCounterNumber } from './timered-counter-number.js';
|
2
|
+
import { TimeredCounterDatetimeDuration } from './timered-counter-datetime-duration.js';
|
3
|
+
import { TimeredCounterString } from './timered-counter-string.js';
|
4
|
+
const TimeredCounterPlugin = {
|
5
|
+
install: (app) => {
|
6
|
+
app.component('TimeredCounterNumber', TimeredCounterNumber);
|
7
|
+
app.component('TimeredCounterDatetimeDuration', TimeredCounterDatetimeDuration);
|
8
|
+
app.component('TimeredCounterString', TimeredCounterString);
|
9
|
+
},
|
10
|
+
};
|
11
|
+
export { TimeredCounterNumber, TimeredCounterString, TimeredCounterDatetimeDuration, };
|
12
|
+
export default TimeredCounterPlugin;
|
13
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/wrappers/vue/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,MAAM,oBAAoB,GAAW;IACnC,OAAO,EAAE,CAAC,GAAQ,EAAE,EAAE;QACpB,GAAG,CAAC,SAAS,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;QAC5D,GAAG,CAAC,SAAS,CACX,gCAAgC,EAChC,8BAA8B,CAC/B,CAAC;QACF,GAAG,CAAC,SAAS,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;IAC9D,CAAC;CACF,CAAC;AAEF,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,8BAA8B,GAC/B,CAAC;AAEF,eAAe,oBAAoB,CAAC","sourcesContent":["import type { App, Plugin } from 'vue';\nimport { TimeredCounterNumber } from './timered-counter-number.js';\nimport { TimeredCounterDatetimeDuration } from './timered-counter-datetime-duration.js';\nimport { TimeredCounterString } from './timered-counter-string.js';\n\nconst TimeredCounterPlugin: Plugin = {\n install: (app: App) => {\n app.component('TimeredCounterNumber', TimeredCounterNumber);\n app.component(\n 'TimeredCounterDatetimeDuration',\n TimeredCounterDatetimeDuration,\n );\n app.component('TimeredCounterString', TimeredCounterString);\n },\n};\n\nexport {\n TimeredCounterNumber,\n TimeredCounterString,\n TimeredCounterDatetimeDuration,\n};\n\nexport default TimeredCounterPlugin;\n\ndeclare module 'vue' {\n interface GlobalComponents {\n TimeredCounterNumber: typeof import('timered-counter/vue').TimeredCounterNumber;\n TimeredCounterDatetimeDuration: typeof import('timered-counter/vue').TimeredCounterDatetimeDuration;\n TimeredCounterString: typeof import('timered-counter/vue').TimeredCounterString;\n }\n}\n"]}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { FunctionalComponent } from 'vue';
|
2
|
+
import type { TimeredCounterDatetimeDuration as WCTimeredCounterDatetimeDuration } from '../../timered-counter-datetime-duration.js';
|
3
|
+
import '../../timered-counter-datetime-duration.js';
|
4
|
+
type ComponentProps = Pick<WCTimeredCounterDatetimeDuration, 'precision' | 'animationOptions' | 'keyframes' | 'cellStyles' | 'digitStyles' | 'partStyles' | 'color' | 'partsOptions' | 'value' | 'oldValue' | 'initialValue' | 'locale'>;
|
5
|
+
type Events = {
|
6
|
+
'timeredCounterAnimationStart'(): void;
|
7
|
+
'timeredCounterAnimationEnd'(): void;
|
8
|
+
};
|
9
|
+
type Slots = {
|
10
|
+
prefix: () => any;
|
11
|
+
suffix: () => any;
|
12
|
+
};
|
13
|
+
export declare const TimeredCounterDatetimeDuration: FunctionalComponent<ComponentProps, Events, Partial<Slots>>;
|
14
|
+
export {};
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { h } from 'vue';
|
2
|
+
import { isNonNullish } from 'remeda';
|
3
|
+
import '../../timered-counter-datetime-duration.js';
|
4
|
+
import { formatProps } from './format-props.js';
|
5
|
+
export const TimeredCounterDatetimeDuration = (props, { attrs, slots, emit }) => {
|
6
|
+
const { prefix, suffix } = slots;
|
7
|
+
return h('timered-counter-datetime-duration', {
|
8
|
+
...attrs,
|
9
|
+
...formatProps(props),
|
10
|
+
onTimeredCounterAnimationStart: () => emit('timeredCounterAnimationStart'),
|
11
|
+
onTimeredCounterAnimationEnd: () => emit('timeredCounterAnimationEnd'),
|
12
|
+
}, [
|
13
|
+
isNonNullish(prefix)
|
14
|
+
? h('slot', { slot: 'prefix' }, prefix())
|
15
|
+
: undefined,
|
16
|
+
isNonNullish(suffix)
|
17
|
+
? h('slot', { slot: 'suffix' }, suffix())
|
18
|
+
: undefined,
|
19
|
+
]);
|
20
|
+
};
|
21
|
+
TimeredCounterDatetimeDuration.props = [
|
22
|
+
'precision',
|
23
|
+
'animationOptions',
|
24
|
+
'keyframes',
|
25
|
+
'cellStyles',
|
26
|
+
'digitStyles',
|
27
|
+
'partStyles',
|
28
|
+
'color',
|
29
|
+
'partsOptions',
|
30
|
+
'value',
|
31
|
+
'oldValue',
|
32
|
+
'initialValue',
|
33
|
+
'locale',
|
34
|
+
];
|
35
|
+
TimeredCounterDatetimeDuration.emits = [
|
36
|
+
'timeredCounterAnimationStart',
|
37
|
+
'timeredCounterAnimationEnd',
|
38
|
+
];
|
39
|
+
//# sourceMappingURL=timered-counter-datetime-duration.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"timered-counter-datetime-duration.js","sourceRoot":"","sources":["../../../../src/wrappers/vue/timered-counter-datetime-duration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,4CAA4C,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA4BhD,MAAM,CAAC,MAAM,8BAA8B,GAIvC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IACpC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEjC,OAAO,CAAC,CACN,mCAAmC,EACnC;QACE,GAAG,KAAK;QACR,GAAG,WAAW,CAAC,KAAK,CAAC;QACrB,8BAA8B,EAAE,GAAG,EAAE,CACnC,IAAI,CAAC,8BAA8B,CAAC;QACtC,4BAA4B,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,4BAA4B,CAAC;KACvE,EACD;QACE,YAAY,CAAC,MAAM,CAAC;YAClB,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC;YACzC,CAAC,CAAC,SAAS;QACb,YAAY,CAAC,MAAM,CAAC;YAClB,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC;YACzC,CAAC,CAAC,SAAS;KACd,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,8BAA8B,CAAC,KAAK,GAAG;IACrC,WAAW;IACX,kBAAkB;IAClB,WAAW;IACX,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,OAAO;IACP,cAAc;IACd,OAAO;IACP,UAAU;IACV,cAAc;IACd,QAAQ;CACT,CAAC;AAEF,8BAA8B,CAAC,KAAK,GAAG;IACrC,8BAA8B;IAC9B,4BAA4B;CAC7B,CAAC","sourcesContent":["import { FunctionalComponent, h } from 'vue';\nimport { isNonNullish } from 'remeda';\nimport type { TimeredCounterDatetimeDuration as WCTimeredCounterDatetimeDuration } from '../../timered-counter-datetime-duration.js';\nimport '../../timered-counter-datetime-duration.js';\nimport { formatProps } from './format-props.js';\n\ntype ComponentProps = Pick<\n WCTimeredCounterDatetimeDuration,\n | 'precision'\n | 'animationOptions'\n | 'keyframes'\n | 'cellStyles'\n | 'digitStyles'\n | 'partStyles'\n | 'color'\n | 'partsOptions'\n | 'value'\n | 'oldValue'\n | 'initialValue'\n | 'locale'\n>;\n\ntype Events = {\n 'timeredCounterAnimationStart'(): void;\n 'timeredCounterAnimationEnd'(): void;\n};\n\ntype Slots = {\n prefix: () => any;\n suffix: () => any;\n};\n\nexport const TimeredCounterDatetimeDuration: FunctionalComponent<\n ComponentProps,\n Events,\n Partial<Slots>\n> = (props, { attrs, slots, emit }) => {\n const { prefix, suffix } = slots;\n\n return h(\n 'timered-counter-datetime-duration',\n {\n ...attrs,\n ...formatProps(props),\n onTimeredCounterAnimationStart: () =>\n emit('timeredCounterAnimationStart'),\n onTimeredCounterAnimationEnd: () => emit('timeredCounterAnimationEnd'),\n },\n [\n isNonNullish(prefix)\n ? h('slot', { slot: 'prefix' }, prefix())\n : undefined,\n isNonNullish(suffix)\n ? h('slot', { slot: 'suffix' }, suffix())\n : undefined,\n ],\n );\n};\n\nTimeredCounterDatetimeDuration.props = [\n 'precision',\n 'animationOptions',\n 'keyframes',\n 'cellStyles',\n 'digitStyles',\n 'partStyles',\n 'color',\n 'partsOptions',\n 'value',\n 'oldValue',\n 'initialValue',\n 'locale',\n];\n\nTimeredCounterDatetimeDuration.emits = [\n 'timeredCounterAnimationStart',\n 'timeredCounterAnimationEnd',\n];\n"]}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { FunctionalComponent, Slot } from 'vue';
|
2
|
+
import type { TimeredCounterNumber as WCTimeredCounterNumber } from '../../timered-counter-number.js';
|
3
|
+
import '../../timered-counter-number.js';
|
4
|
+
type ComponentProps = Pick<WCTimeredCounterNumber, 'localeNumber' | 'animationOptions' | 'keyframes' | 'cellStyles' | 'digitStyles' | 'partStyles' | 'color' | 'partsOptions' | 'value' | 'oldValue' | 'initialValue' | 'locale'>;
|
5
|
+
type Events = {
|
6
|
+
'timeredCounterAnimationStart'(): void;
|
7
|
+
'timeredCounterAnimationEnd'(): void;
|
8
|
+
};
|
9
|
+
type Slots = {
|
10
|
+
prefix: Slot;
|
11
|
+
suffix: Slot;
|
12
|
+
};
|
13
|
+
export declare const TimeredCounterNumber: FunctionalComponent<ComponentProps, Events, Partial<Slots>>;
|
14
|
+
export {};
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import { h } from 'vue';
|
2
|
+
import { isNonNullish } from 'remeda';
|
3
|
+
import '../../timered-counter-number.js';
|
4
|
+
import { formatProps } from './format-props.js';
|
5
|
+
export const TimeredCounterNumber = (props, { attrs, slots, emit }) => {
|
6
|
+
const { prefix, suffix } = slots;
|
7
|
+
return h('timered-counter-number', {
|
8
|
+
...attrs,
|
9
|
+
...formatProps(props),
|
10
|
+
onTimeredCounterAnimationStart: () => emit('timeredCounterAnimationStart'),
|
11
|
+
onTimeredCounterAnimationEnd: () => emit('timeredCounterAnimationEnd'),
|
12
|
+
}, [
|
13
|
+
isNonNullish(prefix)
|
14
|
+
? h('slot', { slot: 'prefix' }, prefix())
|
15
|
+
: undefined,
|
16
|
+
isNonNullish(suffix)
|
17
|
+
? h('slot', { slot: 'suffix' }, suffix())
|
18
|
+
: undefined,
|
19
|
+
]);
|
20
|
+
};
|
21
|
+
TimeredCounterNumber.props = [
|
22
|
+
'localeNumber',
|
23
|
+
'animationOptions',
|
24
|
+
'keyframes',
|
25
|
+
'cellStyles',
|
26
|
+
'digitStyles',
|
27
|
+
'partStyles',
|
28
|
+
'color',
|
29
|
+
'partsOptions',
|
30
|
+
'value',
|
31
|
+
'oldValue',
|
32
|
+
'initialValue',
|
33
|
+
'locale',
|
34
|
+
];
|
35
|
+
TimeredCounterNumber.emits = [
|
36
|
+
'timeredCounterAnimationStart',
|
37
|
+
'timeredCounterAnimationEnd',
|
38
|
+
];
|
39
|
+
//# sourceMappingURL=timered-counter-number.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"timered-counter-number.js","sourceRoot":"","sources":["../../../../src/wrappers/vue/timered-counter-number.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,CAAC,EAAQ,MAAM,KAAK,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,iCAAiC,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA4BhD,MAAM,CAAC,MAAM,oBAAoB,GAI7B,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE;IACpC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAEjC,OAAO,CAAC,CACN,wBAAwB,EACxB;QACE,GAAG,KAAK;QACR,GAAG,WAAW,CAAC,KAAK,CAAC;QACrB,8BAA8B,EAAE,GAAG,EAAE,CACnC,IAAI,CAAC,8BAA8B,CAAC;QACtC,4BAA4B,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,4BAA4B,CAAC;KACvE,EACD;QACE,YAAY,CAAC,MAAM,CAAC;YAClB,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC;YACzC,CAAC,CAAC,SAAS;QACb,YAAY,CAAC,MAAM,CAAC;YAClB,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,CAAC;YACzC,CAAC,CAAC,SAAS;KACd,CACF,CAAC;AACJ,CAAC,CAAC;AAEF,oBAAoB,CAAC,KAAK,GAAG;IAC3B,cAAc;IACd,kBAAkB;IAClB,WAAW;IACX,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,OAAO;IACP,cAAc;IACd,OAAO;IACP,UAAU;IACV,cAAc;IACd,QAAQ;CACT,CAAC;AAEF,oBAAoB,CAAC,KAAK,GAAG;IAC3B,8BAA8B;IAC9B,4BAA4B;CAC7B,CAAC","sourcesContent":["import { FunctionalComponent, h, Slot } from 'vue';\nimport { isNonNullish } from 'remeda';\nimport type { TimeredCounterNumber as WCTimeredCounterNumber } from '../../timered-counter-number.js';\nimport '../../timered-counter-number.js';\nimport { formatProps } from './format-props.js';\n\ntype ComponentProps = Pick<\n WCTimeredCounterNumber,\n | 'localeNumber'\n | 'animationOptions'\n | 'keyframes'\n | 'cellStyles'\n | 'digitStyles'\n | 'partStyles'\n | 'color'\n | 'partsOptions'\n | 'value'\n | 'oldValue'\n | 'initialValue'\n | 'locale'\n>;\n\ntype Events = {\n 'timeredCounterAnimationStart'(): void;\n 'timeredCounterAnimationEnd'(): void;\n};\n\ntype Slots = {\n prefix: Slot;\n suffix: Slot;\n};\n\nexport const TimeredCounterNumber: FunctionalComponent<\n ComponentProps,\n Events,\n Partial<Slots>\n> = (props, { attrs, slots, emit }) => {\n const { prefix, suffix } = slots;\n\n return h(\n 'timered-counter-number',\n {\n ...attrs,\n ...formatProps(props),\n onTimeredCounterAnimationStart: () =>\n emit('timeredCounterAnimationStart'),\n onTimeredCounterAnimationEnd: () => emit('timeredCounterAnimationEnd'),\n },\n [\n isNonNullish(prefix)\n ? h('slot', { slot: 'prefix' }, prefix())\n : undefined,\n isNonNullish(suffix)\n ? h('slot', { slot: 'suffix' }, suffix())\n : undefined,\n ],\n );\n};\n\nTimeredCounterNumber.props = [\n 'localeNumber',\n 'animationOptions',\n 'keyframes',\n 'cellStyles',\n 'digitStyles',\n 'partStyles',\n 'color',\n 'partsOptions',\n 'value',\n 'oldValue',\n 'initialValue',\n 'locale',\n];\n\nTimeredCounterNumber.emits = [\n 'timeredCounterAnimationStart',\n 'timeredCounterAnimationEnd',\n];\n"]}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { FunctionalComponent } from 'vue';
|
2
|
+
import type { TimeredCounterString as WCTimeredCounterString } from '../../timered-counter-string.js';
|
3
|
+
import '../../timered-counter-string.js';
|
4
|
+
type ComponentProps = Pick<WCTimeredCounterString, 'animationOptions' | 'keyframes' | 'cellStyles' | 'digitStyles' | 'partStyles' | 'color' | 'partsOptions' | 'value' | 'oldValue' | 'initialValue' | 'locale'>;
|
5
|
+
type Events = {
|
6
|
+
'timeredCounterAnimationStart'(): void;
|
7
|
+
'timeredCounterAnimationEnd'(): void;
|
8
|
+
};
|
9
|
+
type Slots = {
|
10
|
+
prefix: () => any;
|
11
|
+
suffix: () => any;
|
12
|
+
};
|
13
|
+
export declare const TimeredCounterString: FunctionalComponent<ComponentProps, Events, Partial<Slots>>;
|
14
|
+
export {};
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import { h } from 'vue';
|
2
|
+
import { isNonNullish } from 'remeda';
|
3
|
+
import '../../timered-counter-string.js';
|
4
|
+
import { formatProps } from './format-props.js';
|
5
|
+
export const TimeredCounterString = (props, { attrs, slots, emit }) => {
|
6
|
+
const { prefix, suffix } = slots;
|
7
|
+
return h('timered-counter-string', {
|
8
|
+
...attrs,
|
9
|
+
...formatProps(props),
|
10
|
+
onTimeredCounterAnimationStart: () => emit('timeredCounterAnimationStart'),
|
11
|
+
onTimeredCounterAnimationEnd: () => emit('timeredCounterAnimationEnd'),
|
12
|
+
}, [
|
13
|
+
isNonNullish(prefix)
|
14
|
+
? h('slot', { slot: 'prefix' }, prefix())
|
15
|
+
: undefined,
|
16
|
+
isNonNullish(suffix)
|
17
|
+
? h('slot', { slot: 'suffix' }, suffix())
|
18
|
+
: undefined,
|
19
|
+
]);
|
20
|
+
};
|
21
|
+
TimeredCounterString.props = [
|
22
|
+
'animationOptions',
|
23
|
+
'keyframes',
|
24
|
+
'cellStyles',
|
25
|
+
'digitStyles',
|
26
|
+
'partStyles',
|
27
|
+
'color',
|
28
|
+
'partsOptions',
|
29
|
+
'value',
|
30
|
+
'oldValue',
|
31
|
+
'initialValue',
|
32
|
+
'locale',
|
33
|
+
];
|
34
|
+
TimeredCounterString.emits = [
|
35
|
+
'timeredCounterAnimationStart',
|
36
|
+
'timeredCounterAnimationEnd',
|
37
|
+
];
|
38
|
+
//# sourceMappingURL=timered-counter-string.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"timered-counter-string.js","sourceRoot":"","sources":["../../../../src/wrappers/vue/timered-counter-string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} from 'remeda';\nimport type { TimeredCounterString as WCTimeredCounterString } from '../../timered-counter-string.js';\nimport '../../timered-counter-string.js';\nimport { formatProps } from './format-props.js';\n\ntype ComponentProps = Pick<\n WCTimeredCounterString,\n | 'animationOptions'\n | 'keyframes'\n | 'cellStyles'\n | 'digitStyles'\n | 'partStyles'\n | 'color'\n | 'partsOptions'\n | 'value'\n | 'oldValue'\n | 'initialValue'\n | 'locale'\n>;\n\ntype Events = {\n 'timeredCounterAnimationStart'(): void;\n 'timeredCounterAnimationEnd'(): void;\n};\n\ntype Slots = {\n prefix: () => any;\n suffix: () => any;\n};\n\nexport const TimeredCounterString: FunctionalComponent<\n ComponentProps,\n Events,\n Partial<Slots>\n> = (props, { attrs, slots, emit }) => {\n const { prefix, suffix } = slots;\n\n return h(\n 'timered-counter-string',\n {\n ...attrs,\n ...formatProps(props),\n onTimeredCounterAnimationStart: () =>\n emit('timeredCounterAnimationStart'),\n onTimeredCounterAnimationEnd: () => emit('timeredCounterAnimationEnd'),\n },\n [\n isNonNullish(prefix)\n ? h('slot', { slot: 'prefix' }, prefix())\n : undefined,\n isNonNullish(suffix)\n ? h('slot', { slot: 'suffix' }, suffix())\n : undefined,\n ],\n );\n};\n\nTimeredCounterString.props = [\n 'animationOptions',\n 'keyframes',\n 'cellStyles',\n 'digitStyles',\n 'partStyles',\n 'color',\n 'partsOptions',\n 'value',\n 'oldValue',\n 'initialValue',\n 'locale',\n];\n\nTimeredCounterString.emits = [\n 'timeredCounterAnimationStart',\n 'timeredCounterAnimationEnd',\n];\n"]}
|
@@ -13,7 +13,7 @@ const meta = {
|
|
13
13
|
controls: { expanded: true },
|
14
14
|
},
|
15
15
|
beforeEach: () => {
|
16
|
-
TimeredCounterAdapter.
|
16
|
+
TimeredCounterAdapter.registerAdapter(DecimalJsNumberAdapter);
|
17
17
|
TimeredCounterAdapter.setNumberAdapter('decimal.js');
|
18
18
|
},
|
19
19
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"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AEpB,MAAM,IAAI,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAC9C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAClD,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE,CAC7C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAClD,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import {\n Meta,\n setCustomElementsManifest,\n StoryObj,\n} from '@storybook/web-components';\nimport customElementsManifest from '../../custom-elements.json' with { type: 'json' };\nimport { TimeredCounterAdapter, type TimeredCounter } from '../../src/index.js';\nimport DecimalJsNumberAdapter from '../../src/number-adapter/decimal-js.js';\nimport { bigNumber } from '../story-parts/big-number.js';\nimport { setByAttr, setByProp } from '../utils/index.js';\n\nsetCustomElementsManifest(customElementsManifest);\n\nconst meta: Meta = {\n title: 'TimeredCounter/with decimal.js',\n component: 'timered-counter',\n tags: ['autodocs', 'timered-counter'],\n parameters: {\n controls: { expanded: true },\n },\n beforeEach: () => {\n TimeredCounterAdapter.
|
1
|
+
{"version":3,"file":"decimaljs.stories.js","sourceRoot":"","sources":["../../../stories/timered-counter/decimaljs.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,GAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtF,OAAO,EAAE,qBAAqB,EAAuB,MAAM,oBAAoB,CAAC;AAChF,OAAO,sBAAsB,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;AAElD,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,gCAAgC;IACvC,SAAS,EAAE,iBAAiB;IAC5B,IAAI,EAAE,CAAC,UAAU,EAAE,iBAAiB,CAAC;IACrC,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC7B;IACD,UAAU,EAAE,GAAG,EAAE;QACf,qBAAqB,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC;QAC9D,qBAAqB,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACvD,CAAC;CACF,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,OAAO,EACL,KAAK,EACL,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,MAAM,GACP,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,SAAS,GAA6B;IACjD,IAAI,EAAE;QACJ,SAAS,EAAE,aAAa;QACxB,gBAAgB,EAAE;YAChB,QAAQ,EAAE,GAAG;SACd;KACF;IACD,KAAK,CAAC,IAAI,CAAC,OAAO;QAChB,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACxC,MAAM,OAAO,GAAG,aAAa,CAAC,aAAa,CACzC,cAAc,CACG,CAAC;QAEpB,MAAM,IAAI,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAC9C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAClD,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE,CAC7C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAClD,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import {\n Meta,\n setCustomElementsManifest,\n StoryObj,\n} from '@storybook/web-components';\nimport customElementsManifest from '../../custom-elements.json' with { type: 'json' };\nimport { TimeredCounterAdapter, type TimeredCounter } from '../../src/index.js';\nimport DecimalJsNumberAdapter from '../../src/number-adapter/decimal-js.js';\nimport { bigNumber } from '../story-parts/big-number.js';\nimport { setByAttr, setByProp } from '../utils/index.js';\n\nsetCustomElementsManifest(customElementsManifest);\n\nconst meta: Meta = {\n title: 'TimeredCounter/with decimal.js',\n component: 'timered-counter',\n tags: ['autodocs', 'timered-counter'],\n parameters: {\n controls: { expanded: true },\n },\n beforeEach: () => {\n TimeredCounterAdapter.registerAdapter(DecimalJsNumberAdapter);\n TimeredCounterAdapter.setNumberAdapter('decimal.js');\n },\n};\nexport default meta;\n\nexport {\n Basic,\n Events,\n AnimationOptions,\n Slots,\n Styles,\n} from './index.stories.js';\n\nexport const BigNumber: StoryObj<TimeredCounter> = {\n args: {\n className: 'test-target',\n animationOptions: {\n duration: 100,\n },\n },\n async play(context) {\n const { canvasElement, step } = context;\n const counter = canvasElement.querySelector(\n '.test-target',\n ) as TimeredCounter;\n\n await step('Testing with attribute', async () =>\n bigNumber(context, { counter, setBy: setByAttr }),\n );\n\n await step('Testing with property', async () =>\n bigNumber(context, { counter, setBy: setByProp }),\n );\n },\n};\n"]}
|
@@ -14,7 +14,7 @@ const meta = {
|
|
14
14
|
controls: { expanded: true },
|
15
15
|
},
|
16
16
|
beforeEach: () => {
|
17
|
-
TimeredCounterAdapter.
|
17
|
+
TimeredCounterAdapter.registerAdapter(DecimalJsNumberAdapter);
|
18
18
|
TimeredCounterAdapter.setNumberAdapter('decimal.js');
|
19
19
|
},
|
20
20
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"decimaljs.stories.js","sourceRoot":"","sources":["../../../stories/timered-counter-number/decimaljs.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,GAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtF,OAAO,EACL,qBAAqB,GAGtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,sBAAsB,M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,CAAC,CAClD,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import {\n Meta,\n setCustomElementsManifest,\n StoryObj,\n} from '@storybook/web-components';\nimport customElementsManifest from '../../custom-elements.json' with { type: 'json' };\nimport {\n TimeredCounterAdapter,\n type TimeredCounter,\n TimeredCounterNumber,\n} from '../../src/index.js';\nimport DecimalJsNumberAdapter from '../../src/number-adapter/decimal-js.js';\nimport { setByAttr, setByProp } from '../utils/index.js';\nimport { bigNumber } from '../story-parts/big-number.js';\n\nexport {\n Basic,\n Events,\n Styles,\n LocaleNumber,\n AnimationOptions,\n} from './index.stories.js';\n\nsetCustomElementsManifest(customElementsManifest);\n\nconst meta: Meta = {\n title: 'TimeredCounterNumber/with decimal.js',\n component: 'timered-counter-number',\n tags: ['autodocs', 'timered-counter-number'],\n parameters: {\n controls: { expanded: true },\n },\n beforeEach: () => {\n TimeredCounterAdapter.
|
1
|
+
{"version":3,"file":"decimaljs.stories.js","sourceRoot":"","sources":["../../../stories/timered-counter-number/decimaljs.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,GAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,sBAAsB,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtF,OAAO,EACL,qBAAqB,GAGtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,sBAAsB,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,EACL,KAAK,EACL,MAAM,EACN,MAAM,EACN,YAAY,EACZ,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAE5B,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;AAElD,MAAM,IAAI,GAAS;IACjB,KAAK,EAAE,sCAAsC;IAC7C,SAAS,EAAE,wBAAwB;IACnC,IAAI,EAAE,CAAC,UAAU,EAAE,wBAAwB,CAAC;IAC5C,UAAU,EAAE;QACV,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC7B;IACD,UAAU,EAAE,GAAG,EAAE;QACf,qBAAqB,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC;QAC9D,qBAAqB,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC;IACvD,CAAC;CACF,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,MAAM,CAAC,MAAM,SAAS,GAAmC;IACvD,IAAI,EAAE;QACJ,SAAS,EAAE,aAAa;QACxB,gBAAgB,EAAE;YAChB,QAAQ,EAAE,GAAG;SACd;KACF;IACD,KAAK,CAAC,IAAI,CAAC,OAAO;QAChB,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACxC,MAAM,OAAO,GAAG,aAAa,CAAC,aAAa,CACzC,cAAc,CACG,CAAC;QAEpB,MAAM,IAAI,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAC9C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAClD,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE,CAC7C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAClD,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import {\n Meta,\n setCustomElementsManifest,\n StoryObj,\n} from '@storybook/web-components';\nimport customElementsManifest from '../../custom-elements.json' with { type: 'json' };\nimport {\n TimeredCounterAdapter,\n type TimeredCounter,\n TimeredCounterNumber,\n} from '../../src/index.js';\nimport DecimalJsNumberAdapter from '../../src/number-adapter/decimal-js.js';\nimport { setByAttr, setByProp } from '../utils/index.js';\nimport { bigNumber } from '../story-parts/big-number.js';\n\nexport {\n Basic,\n Events,\n Styles,\n LocaleNumber,\n AnimationOptions,\n} from './index.stories.js';\n\nsetCustomElementsManifest(customElementsManifest);\n\nconst meta: Meta = {\n title: 'TimeredCounterNumber/with decimal.js',\n component: 'timered-counter-number',\n tags: ['autodocs', 'timered-counter-number'],\n parameters: {\n controls: { expanded: true },\n },\n beforeEach: () => {\n TimeredCounterAdapter.registerAdapter(DecimalJsNumberAdapter);\n TimeredCounterAdapter.setNumberAdapter('decimal.js');\n },\n};\nexport default meta;\n\nexport const BigNumber: StoryObj<TimeredCounterNumber> = {\n args: {\n className: 'test-target',\n animationOptions: {\n duration: 100,\n },\n },\n async play(context) {\n const { canvasElement, step } = context;\n const counter = canvasElement.querySelector(\n '.test-target',\n ) as TimeredCounter;\n\n await step('Testing with attribute', async () =>\n bigNumber(context, { counter, setBy: setByAttr }),\n );\n\n await step('Testing with property', async () =>\n bigNumber(context, { counter, setBy: setByProp }),\n );\n },\n};\n"]}
|
@@ -22,7 +22,7 @@ const meta = {
|
|
22
22
|
controls: { expanded: true },
|
23
23
|
},
|
24
24
|
beforeEach: () => {
|
25
|
-
TimeredCounterAdapter.
|
25
|
+
TimeredCounterAdapter.registerAdapter(DecimalJsNumberAdapter);
|
26
26
|
TimeredCounterAdapter.setNumberAdapter('decimal.js');
|
27
27
|
},
|
28
28
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"decimaljs.stories.js","sourceRoot":"","sources":["../../../stories/timered-counter-string/decimaljs.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,GAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,sBAAsB,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtF,OAAO,EACL,qBAAqB,GAGtB,MAAM,oBAAoB,CAAC;AA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AC;CACF,CAAC","sourcesContent":["import {\n Meta,\n setCustomElementsManifest,\n StoryObj,\n} from '@storybook/web-components';\nimport { expect } from '@storybook/test';\nimport { range } from 'remeda';\nimport { faker } from '@faker-js/faker';\nimport customElementsManifest from '../../custom-elements.json' with { type: 'json' };\nimport {\n TimeredCounterAdapter,\n type TimeredCounter,\n TimeredCounterString,\n} from '../../src/index.js';\nimport DecimalJsNumberAdapter from '../../src/number-adapter/decimal-js.js';\n\nimport { bigNumber } from '../story-parts/big-number.js';\nimport { setByAttr, setByProp } from '../utils/index.js';\nimport { animationEvents } from '../story-parts/animation-events.js';\n\nexport { Basic, AnimationOptions, Styles, Emoji } from './index.stories.js';\n\nsetCustomElementsManifest(customElementsManifest);\n\nfunction equal(counter: TimeredCounter, a: any, b: any) {\n a = counter.getAttribute('aria-label')?.replaceAll(/\\s/g, ' ');\n return expect(a).toBe(b.toString());\n}\n\nconst meta: Meta = {\n title: 'TimeredCounterString/with decimal.js',\n component: 'timered-counter-string',\n tags: ['autodocs', 'timered-counter-string'],\n parameters: {\n controls: { expanded: true },\n },\n beforeEach: () => {\n TimeredCounterAdapter.
|
1
|
+
{"version":3,"file":"decimaljs.stories.js","sourceRoot":"","sources":["../../../stories/timered-counter-string/decimaljs.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,GAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,sBAAsB,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtF,OAAO,EACL,qBAAqB,GAGtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,sBAAsB,MAAM,wCAAwC,CAAC;AAE5E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACz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E,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAChC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CACzC,CAAC;QAEF,MAAM,IAAI,CAAC,wBAAwB,EAAE,GAAG,EAAE,CACxC,eAAe,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACrE,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,EAAE,GAAG,EAAE,CACvC,eAAe,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACrE,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAmC;IACvD,IAAI,EAAE;QACJ,SAAS,EAAE,aAAa;QACxB,gBAAgB,EAAE;YAChB,QAAQ,EAAE,GAAG;SACd;KACF;IACD,KAAK,CAAC,IAAI,CAAC,OAAO;QAChB,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACxC,MAAM,OAAO,GAAG,aAAa,CAAC,aAAa,CACzC,cAAc,CACG,CAAC;QAEpB,MAAM,IAAI,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAC9C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACzD,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE,CAC7C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACzD,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import {\n Meta,\n setCustomElementsManifest,\n StoryObj,\n} from '@storybook/web-components';\nimport { expect } from '@storybook/test';\nimport { range } from 'remeda';\nimport { faker } from '@faker-js/faker';\nimport customElementsManifest from '../../custom-elements.json' with { type: 'json' };\nimport {\n TimeredCounterAdapter,\n type TimeredCounter,\n TimeredCounterString,\n} from '../../src/index.js';\nimport DecimalJsNumberAdapter from '../../src/number-adapter/decimal-js.js';\n\nimport { bigNumber } from '../story-parts/big-number.js';\nimport { setByAttr, setByProp } from '../utils/index.js';\nimport { animationEvents } from '../story-parts/animation-events.js';\n\nexport { Basic, AnimationOptions, Styles, Emoji } from './index.stories.js';\n\nsetCustomElementsManifest(customElementsManifest);\n\nfunction equal(counter: TimeredCounter, a: any, b: any) {\n a = counter.getAttribute('aria-label')?.replaceAll(/\\s/g, ' ');\n return expect(a).toBe(b.toString());\n}\n\nconst meta: Meta = {\n title: 'TimeredCounterString/with decimal.js',\n component: 'timered-counter-string',\n tags: ['autodocs', 'timered-counter-string'],\n parameters: {\n controls: { expanded: true },\n },\n beforeEach: () => {\n TimeredCounterAdapter.registerAdapter(DecimalJsNumberAdapter);\n TimeredCounterAdapter.setNumberAdapter('decimal.js');\n },\n};\nexport default meta;\n\nexport const Events: StoryObj<TimeredCounterString> = {\n args: {\n className: 'test-target',\n animationOptions: { duration: 100 },\n },\n async play(context) {\n const { canvasElement, step } = context;\n const counter = canvasElement.querySelector(\n '.test-target',\n ) as TimeredCounter;\n\n const list = range(0, 5).map(() =>\n faker.lorem.sentence({ min: 1, max: 2 }),\n );\n\n await step('Testing with attribute', () =>\n animationEvents(context, { counter, list, setBy: setByAttr, equal }),\n );\n\n await step('Testing with property', () =>\n animationEvents(context, { counter, list, setBy: setByProp, equal }),\n );\n },\n};\n\nexport const BigNumber: StoryObj<TimeredCounterString> = {\n args: {\n className: 'test-target',\n animationOptions: {\n duration: 100,\n },\n },\n async play(context) {\n const { canvasElement, step } = context;\n const counter = canvasElement.querySelector(\n '.test-target',\n ) as TimeredCounter;\n\n await step('Testing with attribute', async () =>\n bigNumber(context, { counter, setBy: setByAttr, equal }),\n );\n\n await step('Testing with property', async () =>\n bigNumber(context, { counter, setBy: setByProp, equal }),\n );\n },\n};\n"]}
|
@@ -23,8 +23,8 @@ const meta = {
|
|
23
23
|
controls: { expanded: true },
|
24
24
|
},
|
25
25
|
beforeEach: () => {
|
26
|
-
TimeredCounterAdapter.
|
27
|
-
TimeredCounterAdapter.
|
26
|
+
TimeredCounterAdapter.registerAdapter(DecimalJsNumberAdapter);
|
27
|
+
TimeredCounterAdapter.registerAdapter(GraphemeSplitterStringAdapter);
|
28
28
|
TimeredCounterAdapter.setNumberAdapter('decimal.js');
|
29
29
|
TimeredCounterAdapter.setStringAdapter('grapheme-splitter');
|
30
30
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"grapheme-splitter.stories.js","sourceRoot":"","sources":["../../../stories/timered-counter-string/grapheme-splitter.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,GAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,sBAAsB,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtF,OAAO,EACL,qBAAqB,GAGtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,sBAAsB,MAAM,wCAAwC,CAAC;AAC5E,OAAO,6BAA6B,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE5E,yBAAyB,CAAC,sB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AE,GAAG,EAAE,CAAC,EAAE,CAAC,CACzC,CAAC;QAEF,MAAM,IAAI,CAAC,wBAAwB,EAAE,GAAG,EAAE,CACxC,eAAe,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACrE,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,EAAE,GAAG,EAAE,CACvC,eAAe,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACrE,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAmC;IACvD,IAAI,EAAE;QACJ,SAAS,EAAE,aAAa;QACxB,gBAAgB,EAAE;YAChB,QAAQ,EAAE,GAAG;SACd;KACF;IACD,KAAK,CAAC,IAAI,CAAC,OAAO;QAChB,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACxC,MAAM,OAAO,GAAG,aAAa,CAAC,aAAa,CACzC,cAAc,CACG,CAAC;QAEpB,MAAM,IAAI,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAC9C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACzD,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE,CAC7C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACzD,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import {\n Meta,\n setCustomElementsManifest,\n StoryObj,\n} from '@storybook/web-components';\nimport { expect } from '@storybook/test';\nimport { range } from 'remeda';\nimport { faker } from '@faker-js/faker';\nimport customElementsManifest from '../../custom-elements.json' with { type: 'json' };\nimport {\n TimeredCounterAdapter,\n type TimeredCounter,\n TimeredCounterString,\n} from '../../src/index.js';\nimport DecimalJsNumberAdapter from '../../src/number-adapter/decimal-js.js';\nimport GraphemeSplitterStringAdapter from '../../src/string-adapter/grapheme-splitter.js';\nimport { bigNumber } from '../story-parts/big-number.js';\nimport { setByAttr, setByProp } from '../utils/index.js';\nimport { animationEvents } from '../story-parts/animation-events.js';\n\nexport { Basic, AnimationOptions, Styles, Emoji } from './index.stories.js';\n\nsetCustomElementsManifest(customElementsManifest);\n\nfunction equal(counter: TimeredCounter, a: any, b: any) {\n a = counter.getAttribute('aria-label')?.replaceAll(/\\s/g, ' ');\n return expect(a).toBe(b.toString());\n}\n\nconst meta: Meta = {\n title: 'TimeredCounterString/with grapheme-splitter',\n component: 'timered-counter-string',\n tags: ['autodocs', 'timered-counter-string'],\n parameters: {\n controls: { expanded: true },\n },\n beforeEach: () => {\n TimeredCounterAdapter.
|
1
|
+
{"version":3,"file":"grapheme-splitter.stories.js","sourceRoot":"","sources":["../../../stories/timered-counter-string/grapheme-splitter.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,GAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,sBAAsB,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtF,OAAO,EACL,qBAAqB,GAGtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,sBAAsB,MAAM,wCAAwC,CAAC;AAC5E,OAAO,6BAA6B,MAAM,+CAA+C,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC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E,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,CAChC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CACzC,CAAC;QAEF,MAAM,IAAI,CAAC,wBAAwB,EAAE,GAAG,EAAE,CACxC,eAAe,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACrE,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,EAAE,GAAG,EAAE,CACvC,eAAe,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACrE,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAmC;IACvD,IAAI,EAAE;QACJ,SAAS,EAAE,aAAa;QACxB,gBAAgB,EAAE;YAChB,QAAQ,EAAE,GAAG;SACd;KACF;IACD,KAAK,CAAC,IAAI,CAAC,OAAO;QAChB,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACxC,MAAM,OAAO,GAAG,aAAa,CAAC,aAAa,CACzC,cAAc,CACG,CAAC;QAEpB,MAAM,IAAI,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAC9C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACzD,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE,CAC7C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACzD,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import {\n Meta,\n setCustomElementsManifest,\n StoryObj,\n} from '@storybook/web-components';\nimport { expect } from '@storybook/test';\nimport { range } from 'remeda';\nimport { faker } from '@faker-js/faker';\nimport customElementsManifest from '../../custom-elements.json' with { type: 'json' };\nimport {\n TimeredCounterAdapter,\n type TimeredCounter,\n TimeredCounterString,\n} from '../../src/index.js';\nimport DecimalJsNumberAdapter from '../../src/number-adapter/decimal-js.js';\nimport GraphemeSplitterStringAdapter from '../../src/string-adapter/grapheme-splitter.js';\nimport { bigNumber } from '../story-parts/big-number.js';\nimport { setByAttr, setByProp } from '../utils/index.js';\nimport { animationEvents } from '../story-parts/animation-events.js';\n\nexport { Basic, AnimationOptions, Styles, Emoji } from './index.stories.js';\n\nsetCustomElementsManifest(customElementsManifest);\n\nfunction equal(counter: TimeredCounter, a: any, b: any) {\n a = counter.getAttribute('aria-label')?.replaceAll(/\\s/g, ' ');\n return expect(a).toBe(b.toString());\n}\n\nconst meta: Meta = {\n title: 'TimeredCounterString/with grapheme-splitter',\n component: 'timered-counter-string',\n tags: ['autodocs', 'timered-counter-string'],\n parameters: {\n controls: { expanded: true },\n },\n beforeEach: () => {\n TimeredCounterAdapter.registerAdapter(DecimalJsNumberAdapter);\n TimeredCounterAdapter.registerAdapter(GraphemeSplitterStringAdapter);\n\n TimeredCounterAdapter.setNumberAdapter('decimal.js');\n TimeredCounterAdapter.setStringAdapter('grapheme-splitter');\n },\n};\nexport default meta;\n\nexport const Events: StoryObj<TimeredCounterString> = {\n args: {\n className: 'test-target',\n animationOptions: { duration: 100 },\n },\n async play(context) {\n const { canvasElement, step } = context;\n const counter = canvasElement.querySelector(\n '.test-target',\n ) as TimeredCounter;\n\n const list = range(0, 5).map(() =>\n faker.lorem.sentence({ min: 1, max: 2 }),\n );\n\n await step('Testing with attribute', () =>\n animationEvents(context, { counter, list, setBy: setByAttr, equal }),\n );\n\n await step('Testing with property', () =>\n animationEvents(context, { counter, list, setBy: setByProp, equal }),\n );\n },\n};\n\nexport const BigNumber: StoryObj<TimeredCounterString> = {\n args: {\n className: 'test-target',\n animationOptions: {\n duration: 100,\n },\n },\n async play(context) {\n const { canvasElement, step } = context;\n const counter = canvasElement.querySelector(\n '.test-target',\n ) as TimeredCounter;\n\n await step('Testing with attribute', async () =>\n bigNumber(context, { counter, setBy: setByAttr, equal }),\n );\n\n await step('Testing with property', async () =>\n bigNumber(context, { counter, setBy: setByProp, equal }),\n );\n },\n};\n"]}
|
@@ -22,7 +22,7 @@ const meta = {
|
|
22
22
|
controls: { expanded: true },
|
23
23
|
},
|
24
24
|
beforeEach: () => {
|
25
|
-
TimeredCounterAdapter.
|
25
|
+
TimeredCounterAdapter.registerAdapter(DecimalJsNumberAdapter);
|
26
26
|
TimeredCounterAdapter.setNumberAdapter('decimal.js');
|
27
27
|
TimeredCounterAdapter.setStringAdapter('intl-segmenter');
|
28
28
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"intl-segmenter.stories.js","sourceRoot":"","sources":["../../../stories/timered-counter-string/intl-segmenter.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,GAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,sBAAsB,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtF,OAAO,EACL,qBAAqB,GAGtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,sBAAsB,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE5E,yBAA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AAC;QAEF,MAAM,IAAI,CAAC,wBAAwB,EAAE,GAAG,EAAE,CACxC,eAAe,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACrE,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,EAAE,GAAG,EAAE,CACvC,eAAe,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACrE,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAmC;IACvD,IAAI,EAAE;QACJ,SAAS,EAAE,aAAa;QACxB,gBAAgB,EAAE;YAChB,QAAQ,EAAE,GAAG;SACd;KACF;IACD,KAAK,CAAC,IAAI,CAAC,OAAO;QAChB,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACxC,MAAM,OAAO,GAAG,aAAa,CAAC,aAAa,CACzC,cAAc,CACG,CAAC;QAEpB,MAAM,IAAI,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAC9C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACzD,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE,CAC7C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACzD,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import {\n Meta,\n setCustomElementsManifest,\n StoryObj,\n} from '@storybook/web-components';\nimport { expect } from '@storybook/test';\nimport { range } from 'remeda';\nimport { faker } from '@faker-js/faker';\nimport customElementsManifest from '../../custom-elements.json' with { type: 'json' };\nimport {\n TimeredCounterAdapter,\n type TimeredCounter,\n TimeredCounterString,\n} from '../../src/index.js';\nimport DecimalJsNumberAdapter from '../../src/number-adapter/decimal-js.js';\nimport { bigNumber } from '../story-parts/big-number.js';\nimport { setByAttr, setByProp } from '../utils/index.js';\nimport { animationEvents } from '../story-parts/animation-events.js';\n\nexport { Basic, AnimationOptions, Styles, Emoji } from './index.stories.js';\n\nsetCustomElementsManifest(customElementsManifest);\n\nfunction equal(counter: TimeredCounter, a: any, b: any) {\n a = counter.getAttribute('aria-label')?.replaceAll(/\\s/g, ' ');\n return expect(a).toBe(b.toString());\n}\n\nconst meta: Meta = {\n title: 'TimeredCounterString/with Intl Segmenter',\n component: 'timered-counter-string',\n tags: ['autodocs', 'timered-counter-string'],\n parameters: {\n controls: { expanded: true },\n },\n beforeEach: () => {\n TimeredCounterAdapter.
|
1
|
+
{"version":3,"file":"intl-segmenter.stories.js","sourceRoot":"","sources":["../../../stories/timered-counter-string/intl-segmenter.stories.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,yBAAyB,GAE1B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,sBAAsB,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtF,OAAO,EACL,qBAAqB,GAGtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,sBAAsB,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,gBAAgB,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE5E,yBAAyB,CAAC,sBAAsB,CAAC,CAAC;AAEl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wB,EAAE,GAAG,EAAE,CACxC,eAAe,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACrE,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,EAAE,GAAG,EAAE,CACvC,eAAe,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACrE,CAAC;IACJ,CAAC;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAmC;IACvD,IAAI,EAAE;QACJ,SAAS,EAAE,aAAa;QACxB,gBAAgB,EAAE;YAChB,QAAQ,EAAE,GAAG;SACd;KACF;IACD,KAAK,CAAC,IAAI,CAAC,OAAO;QAChB,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC;QACxC,MAAM,OAAO,GAAG,aAAa,CAAC,aAAa,CACzC,cAAc,CACG,CAAC;QAEpB,MAAM,IAAI,CAAC,wBAAwB,EAAE,KAAK,IAAI,EAAE,CAC9C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACzD,CAAC;QAEF,MAAM,IAAI,CAAC,uBAAuB,EAAE,KAAK,IAAI,EAAE,CAC7C,SAAS,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CACzD,CAAC;IACJ,CAAC;CACF,CAAC","sourcesContent":["import {\n Meta,\n setCustomElementsManifest,\n StoryObj,\n} from '@storybook/web-components';\nimport { expect } from '@storybook/test';\nimport { range } from 'remeda';\nimport { faker } from '@faker-js/faker';\nimport customElementsManifest from '../../custom-elements.json' with { type: 'json' };\nimport {\n TimeredCounterAdapter,\n type TimeredCounter,\n TimeredCounterString,\n} from '../../src/index.js';\nimport DecimalJsNumberAdapter from '../../src/number-adapter/decimal-js.js';\nimport { bigNumber } from '../story-parts/big-number.js';\nimport { setByAttr, setByProp } from '../utils/index.js';\nimport { animationEvents } from '../story-parts/animation-events.js';\n\nexport { Basic, AnimationOptions, Styles, Emoji } from './index.stories.js';\n\nsetCustomElementsManifest(customElementsManifest);\n\nfunction equal(counter: TimeredCounter, a: any, b: any) {\n a = counter.getAttribute('aria-label')?.replaceAll(/\\s/g, ' ');\n return expect(a).toBe(b.toString());\n}\n\nconst meta: Meta = {\n title: 'TimeredCounterString/with Intl Segmenter',\n component: 'timered-counter-string',\n tags: ['autodocs', 'timered-counter-string'],\n parameters: {\n controls: { expanded: true },\n },\n beforeEach: () => {\n TimeredCounterAdapter.registerAdapter(DecimalJsNumberAdapter);\n\n TimeredCounterAdapter.setNumberAdapter('decimal.js');\n TimeredCounterAdapter.setStringAdapter('intl-segmenter');\n },\n};\nexport default meta;\n\nexport const Events: StoryObj<TimeredCounterString> = {\n args: {\n className: 'test-target',\n animationOptions: { duration: 100 },\n },\n async play(context) {\n const { canvasElement, step } = context;\n const counter = canvasElement.querySelector(\n '.test-target',\n ) as TimeredCounter;\n\n const list = range(0, 5).map(() =>\n faker.lorem.sentence({ min: 1, max: 2 }),\n );\n\n await step('Testing with attribute', () =>\n animationEvents(context, { counter, list, setBy: setByAttr, equal }),\n );\n\n await step('Testing with property', () =>\n animationEvents(context, { counter, list, setBy: setByProp, equal }),\n );\n },\n};\n\nexport const BigNumber: StoryObj<TimeredCounterString> = {\n args: {\n className: 'test-target',\n animationOptions: {\n duration: 100,\n },\n },\n async play(context) {\n const { canvasElement, step } = context;\n const counter = canvasElement.querySelector(\n '.test-target',\n ) as TimeredCounter;\n\n await step('Testing with attribute', async () =>\n bigNumber(context, { counter, setBy: setByAttr, equal }),\n );\n\n await step('Testing with property', async () =>\n bigNumber(context, { counter, setBy: setByProp, equal }),\n );\n },\n};\n"]}
|