@usssa/component-library 1.0.0-alpha.113 → 1.0.0-alpha.114
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/package.json
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
|
|
4
|
+
const emit = defineEmits(['onClick'])
|
|
5
|
+
|
|
4
6
|
const props = defineProps({
|
|
5
7
|
color: {
|
|
6
8
|
type: String,
|
|
7
9
|
default: 'neutral-7',
|
|
8
10
|
},
|
|
11
|
+
dataTestId: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: 'button-std'
|
|
14
|
+
},
|
|
9
15
|
disable: {
|
|
10
16
|
type: Boolean,
|
|
11
17
|
default: false,
|
|
@@ -14,6 +20,10 @@ const props = defineProps({
|
|
|
14
20
|
type: Boolean,
|
|
15
21
|
default: false,
|
|
16
22
|
},
|
|
23
|
+
fullWidth: {
|
|
24
|
+
type: Boolean,
|
|
25
|
+
default: false,
|
|
26
|
+
},
|
|
17
27
|
label: {
|
|
18
28
|
type: String,
|
|
19
29
|
default: 'Button',
|
|
@@ -21,26 +31,20 @@ const props = defineProps({
|
|
|
21
31
|
leftIcon: {
|
|
22
32
|
type: String,
|
|
23
33
|
},
|
|
24
|
-
rightIcon: {
|
|
25
|
-
type: String,
|
|
26
|
-
},
|
|
27
34
|
outline: {
|
|
28
35
|
type: Boolean,
|
|
29
36
|
default: false,
|
|
30
37
|
},
|
|
38
|
+
rightIcon: {
|
|
39
|
+
type: String,
|
|
40
|
+
},
|
|
31
41
|
size: {
|
|
32
42
|
type: String,
|
|
33
43
|
default: 'md',
|
|
34
44
|
validator: (val) => ['sm', 'md', 'lg'].includes(val),
|
|
35
45
|
},
|
|
36
|
-
fullWidth: {
|
|
37
|
-
type: Boolean,
|
|
38
|
-
default: false,
|
|
39
|
-
},
|
|
40
46
|
})
|
|
41
47
|
|
|
42
|
-
const emit = defineEmits(['onClick'])
|
|
43
|
-
|
|
44
48
|
const handleClick = () => {
|
|
45
49
|
return emit('onClick')
|
|
46
50
|
}
|
|
@@ -65,11 +69,12 @@ const isFullWidth = computed(() => {
|
|
|
65
69
|
class="u-btn q-py-none"
|
|
66
70
|
:class="`size-${size} ${textClass} focus-${color} ${isFullWidth}`"
|
|
67
71
|
:color="color"
|
|
72
|
+
:dataTestId="dataTestId"
|
|
68
73
|
:disable="disable"
|
|
74
|
+
:flat="flat"
|
|
75
|
+
no-caps
|
|
69
76
|
:unelevated="!outline"
|
|
70
77
|
:outline="outline"
|
|
71
|
-
no-caps
|
|
72
|
-
:flat="flat"
|
|
73
78
|
@click="handleClick"
|
|
74
79
|
>
|
|
75
80
|
<template #default>
|
|
@@ -77,9 +82,9 @@ const isFullWidth = computed(() => {
|
|
|
77
82
|
<div class="row items-center no-wrap">
|
|
78
83
|
<q-icon
|
|
79
84
|
v-if="leftIcon"
|
|
80
|
-
left
|
|
81
85
|
:class="leftIcon"
|
|
82
86
|
class="q-mr-xs"
|
|
87
|
+
left
|
|
83
88
|
size="1rem"
|
|
84
89
|
/>
|
|
85
90
|
|
|
@@ -88,9 +93,9 @@ const isFullWidth = computed(() => {
|
|
|
88
93
|
</div>
|
|
89
94
|
<q-icon
|
|
90
95
|
v-if="rightIcon"
|
|
91
|
-
right
|
|
92
96
|
:class="rightIcon"
|
|
93
97
|
class="q-ml-xs"
|
|
98
|
+
right
|
|
94
99
|
size="1rem"
|
|
95
100
|
/>
|
|
96
101
|
</div>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
const props = defineProps({
|
|
3
|
+
dataTestId: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: 'toggle-btn',
|
|
6
|
+
},
|
|
3
7
|
options: {
|
|
4
8
|
type: Array,
|
|
5
9
|
require: true,
|
|
@@ -10,16 +14,17 @@ const model = defineModel()
|
|
|
10
14
|
|
|
11
15
|
<template>
|
|
12
16
|
<q-btn-toggle
|
|
13
|
-
class="u-btn-toggle"
|
|
14
17
|
v-model="model"
|
|
15
|
-
|
|
16
|
-
text-color="dark"
|
|
17
|
-
unelevated
|
|
18
|
+
class="u-btn-toggle"
|
|
18
19
|
color="white"
|
|
20
|
+
:dataTestId="dataTestId"
|
|
19
21
|
no-caps
|
|
22
|
+
:options="options"
|
|
23
|
+
size="md"
|
|
20
24
|
spread
|
|
25
|
+
text-color="dark"
|
|
21
26
|
toggle-color="primary"
|
|
22
|
-
|
|
27
|
+
unelevated
|
|
23
28
|
>
|
|
24
29
|
<template
|
|
25
30
|
v-for="(option, index) in options"
|
|
@@ -28,8 +33,8 @@ const model = defineModel()
|
|
|
28
33
|
>
|
|
29
34
|
<div class="row items-center no-wrap slot">
|
|
30
35
|
<q-icon
|
|
31
|
-
:class="options[index].iconClass"
|
|
32
36
|
v-if="options[index].iconClass"
|
|
37
|
+
:class="options[index].iconClass"
|
|
33
38
|
/>
|
|
34
39
|
<div class="text-center text-caption-md">
|
|
35
40
|
{{ options[index].name }}
|