Skip to content

Commit c0ca2a8

Browse files
committed
Dev environment - Add testing arena for VueUiDigits
1 parent 2d4c0b2 commit c0ca2a8

File tree

3 files changed

+83
-2
lines changed

3 files changed

+83
-2
lines changed

TestingArena/ArenaVueUiDigits.vue

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<script setup>
2+
import { ref, computed } from "vue";
3+
import LocalVueUiDigits from "../src/components/vue-ui-digits.vue";
4+
import LocalVueDataUi from '../src/components/vue-data-ui.vue';
5+
import Box from "./Box.vue";
6+
import convertArrayToObject from "./convertModel";
7+
import { VueUiDigits } from "vue-data-ui";
8+
import { VueUiDigits as VueUiDigitsTreeshaken } from "vue-data-ui/vue-ui-digits";
9+
import ConfigKnobs from "./ConfigKnobs.vue";
10+
import { useConfigurationControls } from "./createConfigModel";
11+
import { useConfig } from "../src/useConfig"
12+
13+
const { vue_ui_digits: DEFAULT_CONFIG } = useConfig();
14+
15+
const {
16+
RANGE,
17+
TEXT,
18+
COLOR,
19+
createModel
20+
} = useConfigurationControls(DEFAULT_CONFIG);
21+
22+
const dataset = ref(0.123456789);
23+
24+
const model = createModel([
25+
TEXT('height', { def: '100%' }),
26+
TEXT('width', { def: null }),
27+
COLOR('backgroundColor', { def: '#FFFFFF '}),
28+
COLOR('digits.color', { def: '#1A1A1A' }),
29+
COLOR('digits.skeletonColor', { def: '#E1E5E8' }),
30+
RANGE('digits.thickness', { def: 1, step: 0.1, min: 0.1, max: 3 })
31+
]);
32+
33+
const config = computed(() => {
34+
const c = convertArrayToObject(model.value);
35+
return {
36+
...c
37+
}
38+
})
39+
40+
</script>
41+
42+
<template>
43+
<Box comp="VueUiDigits" :dataset="dataset" :config="config">
44+
<template #title>VueUiDigits</template>
45+
46+
<template #responsive>
47+
<div style="width: 300px; height: 80px; resize: both; overflow: auto; background: white">
48+
<LocalVueUiDigits :dataset="dataset" :config="{
49+
width: '100%',
50+
height: '100%'
51+
}"/>
52+
</div>
53+
</template>
54+
55+
<template #local>
56+
<LocalVueUiDigits :dataset="dataset" :config="config"/>
57+
</template>
58+
59+
<template #VDUI-local>
60+
<LocalVueDataUi component="VueUiDigits" :dataset="dataset" :config="config"/>
61+
</template>
62+
63+
<template #build>
64+
<VueUiDigits :dataset="dataset" :config="config"/>
65+
</template>
66+
67+
<template #build-treesh>
68+
<VueUiDigitsTreeshaken :dataset="dataset" :config="config"/>
69+
</template>
70+
71+
<template #VDUI-build>
72+
<VueDataUi component="VueUiDigits" :dataset="dataset" :config="config"/>
73+
</template>
74+
75+
<template #knobs>
76+
<ConfigKnobs :model="model" @change="step += 1"/>
77+
</template>
78+
</Box>
79+
</template>

manual-testing/src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ const components = [
6666
{ name: 'ArenaVueUiXy', icon: 'chartLine'},
6767
{ name: 'ArenaVueUiXyCanvas', icon: 'chartLine'},
6868
{ name: 'ArenaVueUiAnnotator', icon: 'annotator'},
69-
{ name: 'ArenaVueUiCursor', icon: 'cursor'}
69+
{ name: 'ArenaVueUiCursor', icon: 'cursor'},
70+
{ name: 'ArenaVueUiDigits', icon: 'digit8'},
7071
].map(componentItem => ({
7172
path: `/${componentItem.name}`,
7273
name: componentItem.name.replace('Arena', ''),

manual-testing/src/router/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ const components = [
6161
'ArenaVueUiChord',
6262
'ArenaVueUiDashboard',
6363
'ArenaVueUiAnnotator',
64-
'ArenaVueUiCursor'
64+
'ArenaVueUiCursor',
65+
'ArenaVueUiDigits'
6566
].map(c => ({
6667
path: `/${c}`,
6768
name: c,

0 commit comments

Comments
 (0)