1+ <script setup>
2+ import { ref , computed } from " vue" ;
3+ import LocalVueUiTiremarks from ' ../src/components/vue-ui-tiremarks.vue' ;
4+ import LocalVueDataUi from ' ../src/components/vue-data-ui.vue' ;
5+ import Box from " ./Box.vue" ;
6+ import convertArrayToObject from " ./convertModel" ;
7+
8+ const dataset = ref ({ percentage: 66.6 })
9+
10+ const model = ref ([
11+ { key: ' style.fontFamily' , def: ' inherit' , type: ' text' },
12+ { key: ' style.chart.backgroundColor' , def: ' #FFFFFF' , type: ' color' },
13+ { key: ' style.chart.color' , def: ' #1A1A1A' , type: ' color' },
14+ { key: ' style.chart.animation.use' , def: true , type: ' checkbox' },
15+ { key: ' style.chart.animation.speed' , def: 0.5 , type: ' number' , min: 0 , max: 2 , step: 0.01 },
16+ { key: ' style.chart.animation.acceleration' , def: 1 , type: ' number' , min: 0 , max: 10 , step: 0.1 },
17+ { key: ' style.chart.layout.display' , def: ' horizontal' , type: ' select' , options: [' horizontal' , ' vertical' ]},
18+ { key: ' style.chart.layout.crescendo' , def: false , type: ' checkbox' },
19+ { key: ' style.chart.layout.curved' , def: false , type: ' checkbox' },
20+ { key: ' style.chart.layout.curveAngleX' , def: 10 , type: ' number' , min: - 360 , max: 360 },
21+ { key: ' style.chart.layout.curveAngleY' , def: 10 , type: ' number' , min: - 360 , max: 360 },
22+ { key: ' style.chart.layout.activeColor' , def: ' #5f8bee' , type: ' color' },
23+ { key: ' style.chart.layout.inactiveColor' , def: ' #e1e5e8' , type: ' color' },
24+ { key: ' style.chart.layout.ticks.gradient.show' , def: true , type: ' checkbox' },
25+ { key: ' style.chart.layout.ticks.gradient.shiftHueIntensity' , def: 100 , type: ' range' , min: 0 , max: 100 },
26+ { key: ' style.chart.percentage.show' , def: true , type: ' checkbox' },
27+ { key: ' style.chart.percentage.fontSize' , def: 16 , type: ' range' , min: 8 , max: 100 },
28+ { key: ' style.chart.percentage.rounding' , def: 1 , type: ' range' , min: 0 , max: 12 },
29+ { key: ' style.chart.percentage.bold' , def: true , type: ' checkbox' },
30+ { key: ' style.chart.percentage.useGradientColor' , def: true , type: ' checkbox' },
31+ { key: ' style.chart.percentage.color' , def: ' #1A1A1A' , type: ' color' },
32+ { key: ' style.chart.percentage.verticalPosition' , def: ' bottom' , type: ' select' , options: [' top' , ' bottom' ]},
33+ { key: ' style.chart.percentage.horizontalPosition' , def: ' left' , type: ' select' , options: [' left' , ' right' , ' top' ]},
34+ { key: ' style.chart.title.text' , def: ' Lorem ipsum dolor sic amet' , type: ' text' },
35+ { key: ' style.chart.title.text' , def: ' At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis' , type: ' text' },
36+ { key: ' style.chart.title.color' , def: ' #1A1A1A' , type: ' color' },
37+ { key: ' style.chart.title.fontSize' , def: 20 , type: ' number' , min: 8 , max: 48 },
38+ { key: ' style.chart.title.bold' , def: true , type: ' checkbox' },
39+ { key: ' style.chart.title.subtitle.text' , def: ' At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis' , type: ' text' },
40+ { key: ' style.chart.title.subtitle.color' , def: ' #CCCCCC' , type: ' color' },
41+ { key: ' style.chart.title.subtitle.fontSize' , def: 16 , type: ' range' , min: 8 , max: 48 },
42+ { key: ' style.chart.title.subtitle.bold' , def: false , type: ' checkbox' },
43+ { key: ' userOptions.show' , def: true , type: ' checkbox' }
44+ ])
45+
46+ const config = computed (() => convertArrayToObject (model .value ));
47+
48+ const step = ref (0 )
49+
50+ </script >
51+
52+ <template >
53+ <Box >
54+ <template #title >VueUiTiremarks</template >
55+
56+ <template #local >
57+ <LocalVueUiTiremarks :dataset =" dataset" :config =" config" :key =" `local_${step}`" >
58+ </LocalVueUiTiremarks >
59+ </template >
60+
61+ <template #VDUI-local >
62+ <LocalVueDataUi component =" VueUiTiremarks" :dataset =" dataset" :config =" config" :key =" `VDUI-lodal_${step}`" >
63+ </LocalVueDataUi >
64+ </template >
65+
66+ <template #build >
67+ <VueUiTiremarks :dataset =" dataset" :config =" config" :key =" `build_${step}`" >
68+ </VueUiTiremarks >
69+ </template >
70+
71+ <template #VDUI-build >
72+ <VueDataUi component =" VueUiTiremarks" :dataset =" dataset" :config =" config" :key =" `VDUI-build_${step}`" >
73+ </VueDataUi >
74+ </template >
75+
76+ <template #knobs >
77+ <div
78+ style =" display : flex ; flex-direction : row ; flex-wrap :wrap ; align-items :center ; width : 100% ; color : #CCCCCC ; gap :24px ;" >
79+ <div v-for =" knob in model" >
80+ <label style =" font-size : 10px " >{{ knob.key }}</label >
81+ <div
82+ style =" display :flex ; flex-direction :row ; flex-wrap : wrap ; align-items :center ; gap :6px ; height : 40px " >
83+ <input v-if =" !['none', 'select'].includes(knob.type)" :step =" knob.step" :type =" knob.type" :min =" knob.min ?? 0"
84+ :max =" knob.max ?? 0" v-model =" knob.def" @change =" step += 1" >
85+ <select v-if =" knob.type === 'select'" v-model =" knob.def" @change =" step += 1" >
86+ <option v-for =" opt in knob.options" >{{ opt }}</option >
87+ </select >
88+ </div >
89+ </div >
90+ </div >
91+ </template >
92+
93+ <template #config >
94+ {{ config }}
95+ </template >
96+ </Box >
97+ </template >
0 commit comments