create-buntui 0.1.0-alpha.2 → 0.1.0-alpha.3
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/dist/buntui.so +0 -0
- package/dist/index.js +6 -6
- package/package.json +4 -4
- package/templates/basic/src/App.vue +8 -10
- package/templates/basic/src/main.ts +1 -1
- package/templates/full/src/components/BoxDemo.vue +26 -31
- package/templates/full/src/components/ButtonDemo.vue +4 -4
- package/templates/full/src/components/CheckboxDemo.vue +5 -5
- package/templates/full/src/components/InputDemo.vue +6 -8
- package/templates/full/src/components/ProgressDemo.vue +3 -3
- package/templates/full/src/components/RadioDemo.vue +2 -2
- package/templates/full/src/components/ScrollBoxDemo.vue +6 -11
- package/templates/full/src/components/SelectDemo.vue +6 -8
- package/templates/full/src/components/SwitchDemo.vue +5 -5
- package/templates/full/src/components/TableDemo.vue +2 -4
- package/templates/full/src/components/TextDemo.vue +18 -24
- package/templates/full/src/components/TextareaDemo.vue +15 -14
- package/templates/full/src/main.ts +1 -1
- package/templates/sfc/src/App.vue +11 -13
- package/templates/sfc/src/main.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-buntui",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/AlphaFoxz/buntui.git",
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"dev": "bun --preload @buntui/compiler/vue-plugin ./src/index.ts"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@buntui/core": "^0.1.0-alpha.
|
|
21
|
+
"@buntui/core": "^0.1.0-alpha.3"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@buntui/compiler": "^0.1.0-alpha.
|
|
25
|
-
"@buntui/native": "^0.1.0-alpha.
|
|
24
|
+
"@buntui/compiler": "^0.1.0-alpha.3",
|
|
25
|
+
"@buntui/native": "^0.1.0-alpha.3",
|
|
26
26
|
"@vue/reactivity": "^3.5.34",
|
|
27
27
|
"@types/bun": "^1.3.14"
|
|
28
28
|
}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Box
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
x="20%"
|
|
4
|
+
y="30%"
|
|
5
|
+
width="60%"
|
|
6
6
|
:height="9"
|
|
7
|
-
:colorBg="'rgba(30,30,46,1)'"
|
|
8
|
-
:borderColor="'rgba(137,180,250,1)'"
|
|
9
7
|
borderStyle="rounded"
|
|
10
|
-
|
|
8
|
+
direction="vertical"
|
|
11
9
|
:gap="1"
|
|
12
|
-
|
|
10
|
+
align="center"
|
|
13
11
|
>
|
|
14
|
-
<Text :
|
|
15
|
-
<Text
|
|
16
|
-
<Text :
|
|
12
|
+
<Text :value="title" styleModifier="bold" />
|
|
13
|
+
<Text value="Edit src/App.vue to get started" />
|
|
14
|
+
<Text :value="clock" />
|
|
17
15
|
</Box>
|
|
18
16
|
</template>
|
|
19
17
|
|
|
@@ -4,7 +4,7 @@ import App from './App.vue';
|
|
|
4
4
|
export const ENTRY = 'App.vue';
|
|
5
5
|
|
|
6
6
|
export function run() {
|
|
7
|
-
const app = createApp({logLevel: '
|
|
7
|
+
const app = createApp({logLevel: 'info', clearLog: true, tickRate: 120, renderRate: 60});
|
|
8
8
|
const scene = app.createScene(App, {bgHexRgb: 0x1A_1B_26, visible: true});
|
|
9
9
|
app.start();
|
|
10
10
|
return {app, scene};
|
|
@@ -1,83 +1,78 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Text :x="1" :y="3"
|
|
2
|
+
<Text :x="1" :y="3" value="Box widget — layout container with borders, padding, alignment" />
|
|
3
3
|
|
|
4
4
|
<Box
|
|
5
5
|
:x="1"
|
|
6
6
|
:y="4"
|
|
7
7
|
:width="30"
|
|
8
|
-
:height="
|
|
9
|
-
|
|
10
|
-
:borderColor="'rgba(137,180,250,1)'"
|
|
8
|
+
:height="6"
|
|
9
|
+
borderColor="rgba(137,180,250,1)"
|
|
11
10
|
borderStyle="rounded"
|
|
12
|
-
|
|
11
|
+
direction="vertical"
|
|
13
12
|
:gap="1"
|
|
14
13
|
:paddingTop="1"
|
|
15
14
|
:paddingLeft="1"
|
|
16
15
|
>
|
|
17
|
-
<Text
|
|
18
|
-
<Text
|
|
16
|
+
<Text value="Rounded border" />
|
|
17
|
+
<Text value="With padding and gap" />
|
|
19
18
|
</Box>
|
|
20
19
|
|
|
21
20
|
<Box
|
|
22
21
|
:x="33"
|
|
23
22
|
:y="4"
|
|
24
23
|
:width="30"
|
|
25
|
-
:height="
|
|
26
|
-
|
|
27
|
-
:borderColor="'rgba(166,227,161,1)'"
|
|
24
|
+
:height="6"
|
|
25
|
+
borderColor="rgba(166,227,161,1)"
|
|
28
26
|
borderStyle="double"
|
|
29
|
-
|
|
27
|
+
direction="vertical"
|
|
30
28
|
:gap="1"
|
|
31
29
|
:paddingTop="1"
|
|
32
30
|
:paddingLeft="1"
|
|
33
31
|
>
|
|
34
|
-
<Text
|
|
35
|
-
<Text
|
|
32
|
+
<Text value="Double border" />
|
|
33
|
+
<Text value="Vertical layout" />
|
|
36
34
|
</Box>
|
|
37
35
|
|
|
38
36
|
<Box
|
|
39
37
|
:x="1"
|
|
40
|
-
:y="
|
|
38
|
+
:y="11"
|
|
41
39
|
:width="30"
|
|
42
40
|
:height="3"
|
|
43
|
-
|
|
44
|
-
:borderColor="'rgba(250,179,135,1)'"
|
|
41
|
+
borderColor="rgba(250,179,135,1)"
|
|
45
42
|
borderStyle="solid"
|
|
46
|
-
|
|
43
|
+
direction="horizontal"
|
|
47
44
|
:gap="2"
|
|
48
|
-
|
|
45
|
+
align="center"
|
|
49
46
|
>
|
|
50
|
-
<Text
|
|
51
|
-
<Text
|
|
47
|
+
<Text value="Horizontal" />
|
|
48
|
+
<Text value="center aligned" />
|
|
52
49
|
</Box>
|
|
53
50
|
|
|
54
51
|
<Box
|
|
55
52
|
:x="33"
|
|
56
|
-
:y="
|
|
53
|
+
:y="11"
|
|
57
54
|
:width="30"
|
|
58
55
|
:height="3"
|
|
59
|
-
|
|
60
|
-
:borderColor="'rgba(243,139,168,1)'"
|
|
56
|
+
borderColor="rgba(243,139,168,1)"
|
|
61
57
|
borderStyle="dashed"
|
|
62
|
-
|
|
58
|
+
direction="horizontal"
|
|
63
59
|
:gap="2"
|
|
64
|
-
|
|
60
|
+
align="center"
|
|
65
61
|
>
|
|
66
|
-
<Text
|
|
67
|
-
<Text
|
|
62
|
+
<Text value="Dashed border" />
|
|
63
|
+
<Text value="gap=2" />
|
|
68
64
|
</Box>
|
|
69
65
|
|
|
70
66
|
<Box
|
|
71
67
|
:draggable="true"
|
|
72
68
|
:x="1"
|
|
73
|
-
:y="
|
|
69
|
+
:y="15"
|
|
74
70
|
:width="20"
|
|
75
71
|
:height="3"
|
|
76
|
-
|
|
77
|
-
:borderColor="'rgba(203,166,245,1)'"
|
|
72
|
+
borderColor="rgba(203,166,245,1)"
|
|
78
73
|
borderStyle="rounded"
|
|
79
74
|
>
|
|
80
|
-
<Text
|
|
75
|
+
<Text value="Drag me!" />
|
|
81
76
|
</Box>
|
|
82
77
|
</template>
|
|
83
78
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Text :x="1" :y="3"
|
|
2
|
+
<Text :x="1" :y="3" value="Button widget — interactive clickable element" />
|
|
3
3
|
|
|
4
4
|
<Button :x="1" :y="4" :width="18" :height="3" value="Click me" @click="handleClick" />
|
|
5
|
-
<Text :x="21" :y="5" :
|
|
5
|
+
<Text :x="21" :y="5" :value="log" />
|
|
6
6
|
|
|
7
|
-
<Text :x="1" :y="8"
|
|
7
|
+
<Text :x="1" :y="8" value="Border variants:" />
|
|
8
8
|
<Button :x="1" :y="9" :width="12" :height="3" value="Solid" borderStyleNormal="solid" @click="handleClick" />
|
|
9
9
|
<Button :x="15" :y="9" :width="12" :height="3" value="Rounded" borderStyleNormal="rounded" @click="handleClick" />
|
|
10
10
|
<Button :x="29" :y="9" :width="12" :height="3" value="Bold" borderStyleNormal="bold" @click="handleClick" />
|
|
11
11
|
<Button :x="43" :y="9" :width="12" :height="3" value="Double" borderStyleNormal="double" @click="handleClick" />
|
|
12
12
|
|
|
13
|
-
<Text :x="1" :y="13"
|
|
13
|
+
<Text :x="1" :y="13" value="States:" />
|
|
14
14
|
<Button :x="1" :y="14" :width="18" :height="3" value="Disabled" :disabled="disabled" />
|
|
15
15
|
<Button :x="21" :y="14" :width="18" :height="3" value="Toggle me" @click="toggleDisabled" />
|
|
16
16
|
</template>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Text :x="1" :y="3"
|
|
2
|
+
<Text :x="1" :y="3" value="Checkbox widget — boolean toggle" />
|
|
3
3
|
|
|
4
|
-
<Checkbox :x="1" :y="4"
|
|
5
|
-
<Checkbox :x="1" :y="5"
|
|
6
|
-
<Checkbox :x="1" :y="6"
|
|
4
|
+
<Checkbox :x="1" :y="4" label="Enable feature A" @change="handleChange('A', $event)" />
|
|
5
|
+
<Checkbox :x="1" :y="5" label="Enable feature B" @change="handleChange('B', $event)" />
|
|
6
|
+
<Checkbox :x="1" :y="6" label="Disabled option" :disabled="true" />
|
|
7
7
|
|
|
8
|
-
<Text :x="1" :y="8" :
|
|
8
|
+
<Text :x="1" :y="8" :value="log" />
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script setup lang="ts">
|
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Text :x="1" :y="3"
|
|
2
|
+
<Text :x="1" :y="3" value="Input widget — text field with editing support" />
|
|
3
3
|
|
|
4
4
|
<Box
|
|
5
5
|
:x="1"
|
|
6
6
|
:y="4"
|
|
7
7
|
:width="50"
|
|
8
|
-
:height="
|
|
9
|
-
:colorBg="'rgba(30,30,46,1)'"
|
|
10
|
-
:borderColor="'rgba(137,180,250,0.5)'"
|
|
8
|
+
:height="8"
|
|
11
9
|
borderStyle="rounded"
|
|
12
|
-
|
|
10
|
+
direction="vertical"
|
|
13
11
|
:gap="1"
|
|
14
12
|
:paddingTop="1"
|
|
15
13
|
:paddingLeft="1"
|
|
16
14
|
>
|
|
17
|
-
<Text
|
|
15
|
+
<Text value="Type something and press Enter:" />
|
|
18
16
|
<Input
|
|
19
17
|
:width="46"
|
|
20
|
-
|
|
18
|
+
placeholder="Enter text here..."
|
|
21
19
|
@submit="handleSubmit"
|
|
22
20
|
/>
|
|
23
21
|
</Box>
|
|
24
22
|
|
|
25
|
-
<Text :x="1" :y="
|
|
23
|
+
<Text :x="1" :y="13" :value="submittedValue" />
|
|
26
24
|
</template>
|
|
27
25
|
|
|
28
26
|
<script setup lang="ts">
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Text :x="1" :y="3"
|
|
2
|
+
<Text :x="1" :y="3" value="Progress widget — bar indicator" />
|
|
3
3
|
|
|
4
|
-
<Text :x="1" :y="4"
|
|
4
|
+
<Text :x="1" :y="4" value="Determinate:" />
|
|
5
5
|
<Progress :x="1" :y="5" :width="40" :height="1" :value="progress" />
|
|
6
6
|
|
|
7
|
-
<Text :x="1" :y="7" :
|
|
7
|
+
<Text :x="1" :y="7" :value="`${Math.round(progress * 100)}%`" />
|
|
8
8
|
|
|
9
9
|
<Button :x="1" :y="9" :width="20" :height="3" value="Reset" @click="reset" />
|
|
10
10
|
<Button :x="23" :y="9" :width="20" :height="3" value="Set 75%" @click="set75" />
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Text :x="1" :y="3"
|
|
2
|
+
<Text :x="1" :y="3" value="RadioGroup widget — single selection from options" />
|
|
3
3
|
|
|
4
4
|
<RadioGroup
|
|
5
5
|
:x="1"
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
@change="handleChange"
|
|
10
10
|
/>
|
|
11
11
|
|
|
12
|
-
<Text :x="1" :y="8" :
|
|
12
|
+
<Text :x="1" :y="8" :value="log" />
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script setup lang="ts">
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Text :x="1" :y="3"
|
|
2
|
+
<Text :x="1" :y="3" value="ScrollBox widget — scrollable container" />
|
|
3
3
|
|
|
4
4
|
<ScrollBox
|
|
5
5
|
:x="1"
|
|
6
6
|
:y="4"
|
|
7
7
|
:width="40"
|
|
8
8
|
:height="8"
|
|
9
|
-
:colorBg="'rgba(30,30,46,1)'"
|
|
10
|
-
:borderColor="'rgba(137,180,250,0.5)'"
|
|
11
9
|
borderStyle="rounded"
|
|
12
|
-
:direction="'vertical'"
|
|
13
10
|
:gap="1"
|
|
14
11
|
:paddingTop="1"
|
|
15
12
|
:paddingLeft="1"
|
|
16
13
|
:alwaysShowScrollbar="true"
|
|
17
14
|
>
|
|
18
|
-
<Text v-for="item in items" :key="item" :
|
|
15
|
+
<Text v-for="item in items" :key="item" :value="item" />
|
|
19
16
|
</ScrollBox>
|
|
20
17
|
|
|
21
18
|
<Box
|
|
@@ -23,17 +20,15 @@
|
|
|
23
20
|
:y="4"
|
|
24
21
|
:width="30"
|
|
25
22
|
:height="8"
|
|
26
|
-
:colorBg="'rgba(30,30,46,1)'"
|
|
27
|
-
:borderColor="'rgba(166,227,161,0.5)'"
|
|
28
23
|
borderStyle="rounded"
|
|
29
|
-
|
|
24
|
+
direction="vertical"
|
|
30
25
|
:gap="1"
|
|
31
26
|
:paddingTop="1"
|
|
32
27
|
:paddingLeft="1"
|
|
33
28
|
>
|
|
34
|
-
<Text
|
|
35
|
-
<Text
|
|
36
|
-
<Text
|
|
29
|
+
<Text value="Scroll with arrow keys" />
|
|
30
|
+
<Text value="Content overflows the visible area" />
|
|
31
|
+
<Text value="Scrollbar appears automatically" />
|
|
37
32
|
</Box>
|
|
38
33
|
</template>
|
|
39
34
|
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Text :x="1" :y="3"
|
|
2
|
+
<Text :x="1" :y="3" value="Select widget — dropdown selection" />
|
|
3
3
|
|
|
4
4
|
<Box
|
|
5
5
|
:x="1"
|
|
6
6
|
:y="4"
|
|
7
7
|
:width="50"
|
|
8
|
-
:height="
|
|
9
|
-
:colorBg="'rgba(30,30,46,1)'"
|
|
10
|
-
:borderColor="'rgba(137,180,250,0.5)'"
|
|
8
|
+
:height="8"
|
|
11
9
|
borderStyle="rounded"
|
|
12
|
-
|
|
10
|
+
direction="vertical"
|
|
13
11
|
:gap="1"
|
|
14
12
|
:paddingTop="1"
|
|
15
13
|
:paddingLeft="1"
|
|
16
14
|
>
|
|
17
|
-
<Text
|
|
15
|
+
<Text value="Choose a framework:" />
|
|
18
16
|
<Select
|
|
19
17
|
:width="46"
|
|
20
18
|
:options="frameworks"
|
|
21
|
-
|
|
19
|
+
placeholder="Select a framework..."
|
|
22
20
|
@change="handleChange"
|
|
23
21
|
/>
|
|
24
22
|
</Box>
|
|
25
23
|
|
|
26
|
-
<Text :x="1" :y="
|
|
24
|
+
<Text :x="1" :y="13" :value="selected" />
|
|
27
25
|
</template>
|
|
28
26
|
|
|
29
27
|
<script setup lang="ts">
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Text :x="1" :y="3"
|
|
2
|
+
<Text :x="1" :y="3" value="Switch widget — on/off toggle" />
|
|
3
3
|
|
|
4
|
-
<Switch :x="1" :y="4"
|
|
5
|
-
<Switch :x="1" :y="5"
|
|
6
|
-
<Switch :x="1" :y="6"
|
|
4
|
+
<Switch :x="1" :y="4" label="Dark mode" @change="handleChange('Dark mode', $event)" />
|
|
5
|
+
<Switch :x="1" :y="5" label="Notifications" @change="handleChange('Notifications', $event)" />
|
|
6
|
+
<Switch :x="1" :y="6" label="Disabled" :disabled="true" />
|
|
7
7
|
|
|
8
|
-
<Text :x="1" :y="8" :
|
|
8
|
+
<Text :x="1" :y="8" :value="log" />
|
|
9
9
|
</template>
|
|
10
10
|
|
|
11
11
|
<script setup lang="ts">
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Text :x="1" :y="3"
|
|
2
|
+
<Text :x="1" :y="3" value="Table widget — structured data display with selection" />
|
|
3
3
|
|
|
4
4
|
<Table
|
|
5
5
|
:x="1"
|
|
6
6
|
:y="4"
|
|
7
7
|
:width="60"
|
|
8
8
|
:height="8"
|
|
9
|
-
:colorBg="'rgba(30,30,46,1)'"
|
|
10
|
-
:borderColor="'rgba(137,180,250,0.5)'"
|
|
11
9
|
borderStyle="rounded"
|
|
12
10
|
:columns="columns"
|
|
13
11
|
:rows="rows"
|
|
14
12
|
/>
|
|
15
13
|
|
|
16
|
-
<Text :x="1" :y="13"
|
|
14
|
+
<Text :x="1" :y="13" value="Use arrow keys to navigate rows" />
|
|
17
15
|
</template>
|
|
18
16
|
|
|
19
17
|
<script setup lang="ts">
|
|
@@ -1,58 +1,52 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Text :x="1" :y="3"
|
|
2
|
+
<Text :x="1" :y="3" value="Text widget — display styled text" />
|
|
3
3
|
|
|
4
4
|
<Box
|
|
5
5
|
:x="1"
|
|
6
6
|
:y="4"
|
|
7
|
-
|
|
8
|
-
:height="
|
|
9
|
-
:colorBg="'rgba(30,30,46,1)'"
|
|
10
|
-
:borderColor="'rgba(137,180,250,0.5)'"
|
|
7
|
+
width="45%"
|
|
8
|
+
:height="8"
|
|
11
9
|
borderStyle="rounded"
|
|
12
|
-
|
|
10
|
+
direction="vertical"
|
|
13
11
|
:gap="1"
|
|
14
12
|
:paddingTop="1"
|
|
15
13
|
:paddingLeft="1"
|
|
16
14
|
>
|
|
17
|
-
<Text
|
|
18
|
-
<Text styleModifier="bold"
|
|
19
|
-
<Text styleModifier="italic"
|
|
15
|
+
<Text value="Font styles" />
|
|
16
|
+
<Text styleModifier="bold" value="Bold text" />
|
|
17
|
+
<Text styleModifier="italic" value="Italic text" />
|
|
20
18
|
</Box>
|
|
21
19
|
|
|
22
20
|
<Box
|
|
23
21
|
x="50%"
|
|
24
22
|
:y="4"
|
|
25
23
|
width="45%"
|
|
26
|
-
:height="
|
|
27
|
-
:colorBg="'rgba(30,30,46,1)'"
|
|
28
|
-
:borderColor="'rgba(166,227,161,0.5)'"
|
|
24
|
+
:height="10"
|
|
29
25
|
borderStyle="rounded"
|
|
30
|
-
|
|
26
|
+
direction="vertical"
|
|
31
27
|
:gap="1"
|
|
32
28
|
:paddingTop="1"
|
|
33
29
|
:paddingLeft="1"
|
|
34
30
|
>
|
|
35
|
-
<Text
|
|
36
|
-
<Text
|
|
37
|
-
<Text
|
|
38
|
-
<Text
|
|
31
|
+
<Text value="Colors" />
|
|
32
|
+
<Text colorFg="rgba(243,139,168,1)" value="Red " />
|
|
33
|
+
<Text colorFg="rgba(137,180,250,1)" value="Blue " />
|
|
34
|
+
<Text colorFg="rgba(166,227,161,1)" value="Green" />
|
|
39
35
|
</Box>
|
|
40
36
|
|
|
41
37
|
<Box
|
|
42
38
|
:x="1"
|
|
43
|
-
:y="
|
|
39
|
+
:y="15"
|
|
44
40
|
width="95%"
|
|
45
|
-
:height="
|
|
46
|
-
:colorBg="'rgba(30,30,46,1)'"
|
|
47
|
-
:borderColor="'rgba(250,179,135,0.5)'"
|
|
41
|
+
:height="6"
|
|
48
42
|
borderStyle="rounded"
|
|
49
|
-
|
|
43
|
+
direction="vertical"
|
|
50
44
|
:gap="1"
|
|
51
45
|
:paddingTop="1"
|
|
52
46
|
:paddingLeft="1"
|
|
53
47
|
>
|
|
54
|
-
<Text
|
|
55
|
-
<Text :
|
|
48
|
+
<Text value="Dynamic clock:" />
|
|
49
|
+
<Text :value="clock" />
|
|
56
50
|
</Box>
|
|
57
51
|
</template>
|
|
58
52
|
|
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<Text :x="1" :y="3"
|
|
2
|
+
<Text :x="1" :y="3" value="Textarea widget — multi-line text editor" />
|
|
3
3
|
|
|
4
4
|
<Box
|
|
5
5
|
:x="1"
|
|
6
6
|
:y="4"
|
|
7
7
|
:width="50"
|
|
8
|
-
:height="
|
|
9
|
-
:colorBg="'rgba(30,30,46,1)'"
|
|
10
|
-
:borderColor="'rgba(137,180,250,0.5)'"
|
|
8
|
+
:height="8"
|
|
11
9
|
borderStyle="rounded"
|
|
12
|
-
|
|
10
|
+
direction="vertical"
|
|
13
11
|
:gap="1"
|
|
14
12
|
:paddingTop="1"
|
|
15
13
|
:paddingLeft="1"
|
|
16
14
|
>
|
|
17
|
-
<Text :
|
|
15
|
+
<Text :value="label" />
|
|
18
16
|
<Textarea
|
|
19
17
|
:width="46"
|
|
20
18
|
:height="3"
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
placeholder="Enter multi-line text..."
|
|
20
|
+
v-model="text"
|
|
23
21
|
/>
|
|
24
22
|
</Box>
|
|
25
23
|
|
|
26
|
-
<Text :x="1" :y="
|
|
24
|
+
<Text :x="1" :y="13" :value="preview" />
|
|
27
25
|
</template>
|
|
28
26
|
|
|
29
27
|
<script setup lang="ts">
|
|
30
|
-
import { ref } from '@vue/reactivity'
|
|
28
|
+
import { ref, computed } from '@vue/reactivity'
|
|
31
29
|
|
|
32
|
-
const
|
|
30
|
+
const text = ref('')
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
const label = computed(() => text.value.length > 0 ? `Characters: ${text.value.length}` : 'Type something below:')
|
|
33
|
+
|
|
34
|
+
const preview = computed(() => {
|
|
35
|
+
const lines = text.value.split('\n')
|
|
36
|
+
return text.value.length > 0 ? `${lines.length} lines, ${text.value.length} chars` : 'Preview appears here'
|
|
37
|
+
})
|
|
37
38
|
</script>
|
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<Box
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
:height="
|
|
7
|
-
:colorBg="'rgba(30,30,46,1)'"
|
|
8
|
-
:borderColor="'rgba(137,180,250,1)'"
|
|
3
|
+
x="20%"
|
|
4
|
+
y="25%"
|
|
5
|
+
width="60%"
|
|
6
|
+
:height="17"
|
|
9
7
|
borderStyle="rounded"
|
|
10
|
-
|
|
8
|
+
direction="vertical"
|
|
11
9
|
:gap="1"
|
|
12
|
-
|
|
10
|
+
align="center"
|
|
13
11
|
:paddingTop="1"
|
|
14
12
|
:paddingBottom="1"
|
|
15
13
|
:paddingLeft="2"
|
|
16
14
|
:paddingRight="2"
|
|
17
15
|
>
|
|
18
|
-
<Text :
|
|
19
|
-
<Text
|
|
20
|
-
<Text
|
|
21
|
-
<Text :
|
|
22
|
-
<Box
|
|
16
|
+
<Text :value="title" styleModifier="bold" />
|
|
17
|
+
<Text value="SFC template with hot reload" />
|
|
18
|
+
<Text value="Edit src/App.vue to get started" />
|
|
19
|
+
<Text :value="clock" />
|
|
20
|
+
<Box direction="horizontal" :gap="2" align="center">
|
|
23
21
|
<Button :value="'Count: ' + count" @click="increment" />
|
|
24
22
|
</Box>
|
|
25
23
|
</Box>
|