@usssa/component-library 1.0.0-alpha.4 → 1.0.0-alpha.41
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/README.md +4 -1
- package/package.json +6 -4
- package/src/App.vue +9 -0
- package/src/assets/quasar-logo-vertical.svg +15 -0
- package/src/boot/.gitkeep +0 -0
- package/src/boot/google-maps.js +11 -0
- package/src/components/ComponentLink.vue +26 -0
- package/src/components/core/UAvatar.vue +161 -0
- package/src/components/core/UAvatarGroup.vue +119 -0
- package/src/components/core/UBadgeStd.vue +91 -0
- package/src/components/core/UBannerStd.vue +115 -0
- package/src/components/core/UBreadCrumbs.vue +67 -0
- package/src/components/core/UBtnIcon.vue +159 -0
- package/src/components/core/UBtnStd.vue +129 -0
- package/src/components/core/UBtnToggle.vue +68 -0
- package/src/components/core/UCheckboxStd.vue +95 -0
- package/src/components/core/UChip.vue +251 -0
- package/src/components/core/UDialogStd.vue +242 -0
- package/src/components/core/UDrawer.vue +211 -0
- package/src/components/core/UInnerLoader.vue +58 -0
- package/src/components/core/UInputAddressLookup.vue +466 -0
- package/src/components/core/UInputPhoneStd.vue +295 -0
- package/src/components/core/UInputTextStd.vue +293 -0
- package/src/components/core/UMenuButtonStd.vue +274 -0
- package/src/components/core/UMenuDropdown.vue +77 -0
- package/src/components/core/UMenuDropdownAdvancedSearch.vue +262 -0
- package/src/components/core/UMenuItem.vue +132 -0
- package/src/components/core/UMultiSelectStd.vue +259 -0
- package/src/components/core/UPagination.vue +104 -0
- package/src/components/core/URadioBtn.vue +116 -0
- package/src/components/core/URadioStd.vue +62 -0
- package/src/components/core/USelectStd.vue +233 -0
- package/src/components/core/UTabBtnStd.vue +167 -0
- package/src/components/core/UTable/UTable.vue +93 -0
- package/src/components/core/UTable/UTd.vue +63 -0
- package/src/components/core/UTable/UTh.vue +48 -0
- package/src/components/core/UTable/UTr.vue +20 -0
- package/src/components/core/UTableStd.vue +636 -0
- package/src/components/core/UTabsStd.vue +111 -0
- package/src/components/core/UToggleStd.vue +159 -0
- package/src/components/core/UTooltip.vue +71 -0
- package/src/components/index.js +66 -0
- package/src/composables/useNotify.js +79 -0
- package/src/composables/useOverlayLoader.js +23 -0
- package/src/css/app.sass +159 -0
- package/src/css/colors.sass +101 -0
- package/src/css/media.sass +1 -0
- package/src/css/quasar.variables.sass +119 -0
- package/src/css/typography.sass +0 -0
- package/src/css/vars/colors.variables.sass +126 -0
- package/src/layouts/MainLayout.vue +173 -0
- package/src/pages/AdvancedSearch.vue +512 -0
- package/src/pages/Avatar.vue +77 -0
- package/src/pages/AvatarGroup.vue +139 -0
- package/src/pages/BadgeStd.vue +83 -0
- package/src/pages/BannerPage.vue +76 -0
- package/src/pages/BreadCrumbs.vue +100 -0
- package/src/pages/BtnIcon.vue +120 -0
- package/src/pages/BtnStd.vue +138 -0
- package/src/pages/BtnToggle.vue +131 -0
- package/src/pages/CheckBox.vue +62 -0
- package/src/pages/Chip.vue +108 -0
- package/src/pages/ComponentBase.vue +54 -0
- package/src/pages/Dialog.vue +221 -0
- package/src/pages/Drawer.vue +128 -0
- package/src/pages/ErrorNotFound.vue +11 -0
- package/src/pages/IndexPage.vue +11 -0
- package/src/pages/InnerLoader.vue +81 -0
- package/src/pages/InputAddressLookup.vue +258 -0
- package/src/pages/InputPhone.vue +152 -0
- package/src/pages/InputText.vue +140 -0
- package/src/pages/MenuButton.vue +194 -0
- package/src/pages/MenuDropdown.vue +79 -0
- package/src/pages/MenuItem.vue +68 -0
- package/src/pages/MultiSelectStd.vue +174 -0
- package/src/pages/NotifyPage.vue +109 -0
- package/src/pages/OverlayLoader.vue +128 -0
- package/src/pages/Pagination.vue +71 -0
- package/src/pages/Radio.vue +80 -0
- package/src/pages/RadioBtn.vue +104 -0
- package/src/pages/SelectStd.vue +160 -0
- package/src/pages/TabButtonPage.vue +126 -0
- package/src/pages/TablePage.vue +375 -0
- package/src/pages/TabsPage.vue +261 -0
- package/src/pages/TogglePage.vue +58 -0
- package/src/pages/TooltipPage.vue +125 -0
- package/src/router/index.js +34 -0
- package/src/router/routes.js +149 -0
- package/dist/spa/assets/Avatar.45667392.js +0 -9
- package/dist/spa/assets/AvatarGroup.99557443.js +0 -9
- package/dist/spa/assets/AvatarGroup.bb4cd03a.css +0 -1
- package/dist/spa/assets/BadgeStd.ee4129c5.js +0 -6
- package/dist/spa/assets/BannerPage.6c6a98c4.js +0 -10
- package/dist/spa/assets/BannerPage.d195fcac.css +0 -1
- package/dist/spa/assets/BtnIcon.89e50d2e.css +0 -1
- package/dist/spa/assets/BtnIcon.934f8c5b.js +0 -10
- package/dist/spa/assets/BtnStd.95fc4510.js +0 -11
- package/dist/spa/assets/CheckBox.3c204a4b.css +0 -1
- package/dist/spa/assets/CheckBox.fbc0bd1a.js +0 -7
- package/dist/spa/assets/Chip.49ffc857.js +0 -11
- package/dist/spa/assets/Chip.74acaa33.css +0 -1
- package/dist/spa/assets/ComponentBase.1ae19b7e.js +0 -1
- package/dist/spa/assets/ErrorNotFound.6cccfaee.js +0 -1
- package/dist/spa/assets/IndexPage.17d09b76.js +0 -1
- package/dist/spa/assets/InputText.19c0d7d1.css +0 -1
- package/dist/spa/assets/InputText.3fcd97a4.js +0 -20
- package/dist/spa/assets/KFOkCnqEu92Fr1MmgVxIIzQ.34e9582c.woff +0 -0
- package/dist/spa/assets/KFOlCnqEu92Fr1MmEU9fBBc-.9ce7f3ac.woff +0 -0
- package/dist/spa/assets/KFOlCnqEu92Fr1MmSU5fBBc-.bf14c7d7.woff +0 -0
- package/dist/spa/assets/KFOlCnqEu92Fr1MmWUlfBBc-.e0fd57c0.woff +0 -0
- package/dist/spa/assets/KFOlCnqEu92Fr1MmYUtfBBc-.f6537e32.woff +0 -0
- package/dist/spa/assets/KFOmCnqEu92Fr1Mu4mxM.f2abf7fb.woff +0 -0
- package/dist/spa/assets/MainLayout.912bb0f8.js +0 -1
- package/dist/spa/assets/MultiSelectStd.644b108c.js +0 -17
- package/dist/spa/assets/MultiSelectStd.c7af49eb.css +0 -1
- package/dist/spa/assets/QAvatar.5940a79e.js +0 -1
- package/dist/spa/assets/QCheckbox.48b43f7d.js +0 -1
- package/dist/spa/assets/QPage.ca395ec4.js +0 -1
- package/dist/spa/assets/QRadio.0a7f5e2c.js +0 -1
- package/dist/spa/assets/QResizeObserver.30c3566c.js +0 -1
- package/dist/spa/assets/QSelect.a40eb786.js +0 -1
- package/dist/spa/assets/QTabs.72f2507e.js +0 -1
- package/dist/spa/assets/QToggle.376c48be.js +0 -1
- package/dist/spa/assets/QTooltip.5aa8e325.js +0 -1
- package/dist/spa/assets/Radio.0ac35288.js +0 -7
- package/dist/spa/assets/Radio.aca54a89.css +0 -1
- package/dist/spa/assets/SelectStd.5c6891db.css +0 -1
- package/dist/spa/assets/SelectStd.daf1def9.js +0 -16
- package/dist/spa/assets/TabButtonPage.20e871dd.js +0 -7
- package/dist/spa/assets/TabButtonPage.36ce9f9c.css +0 -1
- package/dist/spa/assets/TabsPage.9b94ff39.css +0 -1
- package/dist/spa/assets/TabsPage.b92cccee.js +0 -9
- package/dist/spa/assets/TogglePage.8129b631.css +0 -1
- package/dist/spa/assets/TogglePage.ba6e325c.js +0 -9
- package/dist/spa/assets/UAvatar.dda7e478.js +0 -1
- package/dist/spa/assets/UAvatar.ea8daa38.css +0 -1
- package/dist/spa/assets/UBadgeStd.3965db9a.css +0 -1
- package/dist/spa/assets/UBadgeStd.e165ee05.js +0 -1
- package/dist/spa/assets/UBtnStd.979ec4e8.js +0 -1
- package/dist/spa/assets/UBtnStd.bdd4f5e5.css +0 -1
- package/dist/spa/assets/UTooltip.d2e04d0c.js +0 -1
- package/dist/spa/assets/UTooltip.efa029a7.css +0 -1
- package/dist/spa/assets/dom.e9d4ad51.js +0 -1
- package/dist/spa/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNa.fd84f88b.woff +0 -0
- package/dist/spa/assets/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.4a4dbc62.woff2 +0 -0
- package/dist/spa/assets/format.41663636.js +0 -1
- package/dist/spa/assets/index.43c62a18.js +0 -21
- package/dist/spa/assets/index.4fbd73cf.css +0 -5
- package/dist/spa/assets/option-sizes.10cc02d3.js +0 -1
- package/dist/spa/assets/render.e67ff27a.js +0 -1
- package/dist/spa/assets/tooltip.7c0d0774.js +0 -8
- package/dist/spa/assets/touch.9135741d.js +0 -1
- package/dist/spa/assets/use-checkbox.44a623c0.js +0 -1
- package/dist/spa/favicon.ico +0 -0
- package/dist/spa/icons/caret-down.svg +0 -5
- package/dist/spa/icons/circle-xmark.svg +0 -6
- package/dist/spa/icons/favicon-128x128.png +0 -0
- package/dist/spa/icons/favicon-16x16.png +0 -0
- package/dist/spa/icons/favicon-32x32.png +0 -0
- package/dist/spa/icons/favicon-96x96.png +0 -0
- package/dist/spa/index.html +0 -3
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import UTooltip from './UTooltip.vue'
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
iconClass: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true,
|
|
8
|
+
default: 'fa-kit-duotone fa-circle-bolt',
|
|
9
|
+
},
|
|
10
|
+
ariaLabel: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: '',
|
|
13
|
+
},
|
|
14
|
+
color: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: 'primary',
|
|
17
|
+
},
|
|
18
|
+
round: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: true,
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: 'md',
|
|
25
|
+
validator: (val) => ['sm', 'md', 'lg'].includes(val),
|
|
26
|
+
},
|
|
27
|
+
tooltip: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: '',
|
|
30
|
+
},
|
|
31
|
+
tooltipPosition: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'top',
|
|
34
|
+
},
|
|
35
|
+
anchor: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'center left',
|
|
38
|
+
},
|
|
39
|
+
self: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: 'center end',
|
|
42
|
+
},
|
|
43
|
+
offset: {
|
|
44
|
+
type: Array,
|
|
45
|
+
default: () => [4, 4],
|
|
46
|
+
},
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
const emit = defineEmits(['onClick'])
|
|
50
|
+
|
|
51
|
+
const handleClick = () => {
|
|
52
|
+
return emit('onClick')
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const iconSize = computed(() => {
|
|
56
|
+
if (props.size === 'sm') {
|
|
57
|
+
return 'xs'
|
|
58
|
+
}
|
|
59
|
+
if (props.size === 'md') {
|
|
60
|
+
return 'sm'
|
|
61
|
+
}
|
|
62
|
+
if (props.size === 'lg') {
|
|
63
|
+
return 'md'
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return props.size
|
|
67
|
+
})
|
|
68
|
+
const iconColor = computed(() => {
|
|
69
|
+
if (props.color === 'neutral') {
|
|
70
|
+
return 'neutral-9'
|
|
71
|
+
}
|
|
72
|
+
return props.color
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
const btnClass = computed(() => {
|
|
76
|
+
if (props.color === 'neutral') {
|
|
77
|
+
return 'neutral-4'
|
|
78
|
+
}
|
|
79
|
+
return props.color
|
|
80
|
+
})
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<template>
|
|
84
|
+
<q-btn
|
|
85
|
+
@click="handleClick"
|
|
86
|
+
flat="flat"
|
|
87
|
+
:round="round"
|
|
88
|
+
:aria-label="ariaLabel"
|
|
89
|
+
class="u-btn-icon"
|
|
90
|
+
:class="`size-${size} ${btnClass}`"
|
|
91
|
+
>
|
|
92
|
+
|
|
93
|
+
<template #default>
|
|
94
|
+
<q-icon
|
|
95
|
+
:color="iconColor"
|
|
96
|
+
:aria-hidden="true"
|
|
97
|
+
:class="`${iconClass} size-${size}`"
|
|
98
|
+
:size="iconSize"
|
|
99
|
+
/>
|
|
100
|
+
|
|
101
|
+
<UTooltip
|
|
102
|
+
v-if="tooltip"
|
|
103
|
+
:description="tooltip"
|
|
104
|
+
:anchor="anchor"
|
|
105
|
+
:self="self"
|
|
106
|
+
:offset="offset"
|
|
107
|
+
/>
|
|
108
|
+
<slot name="menu" />
|
|
109
|
+
</template>
|
|
110
|
+
</q-btn>
|
|
111
|
+
</template>
|
|
112
|
+
|
|
113
|
+
<style lang="sass">
|
|
114
|
+
.u-btn-icon
|
|
115
|
+
&.neutral-4
|
|
116
|
+
color: $neutral-4
|
|
117
|
+
|
|
118
|
+
&.transparent
|
|
119
|
+
color: $neutral-1
|
|
120
|
+
|
|
121
|
+
&.size-sm
|
|
122
|
+
height: $md
|
|
123
|
+
width: $md
|
|
124
|
+
|
|
125
|
+
&.size-md
|
|
126
|
+
height: $lg
|
|
127
|
+
width: $lg
|
|
128
|
+
|
|
129
|
+
&.size-lg
|
|
130
|
+
height: $xl
|
|
131
|
+
width: $xl
|
|
132
|
+
|
|
133
|
+
.q-icon
|
|
134
|
+
&.text-transparent
|
|
135
|
+
color: $neutral-1 !important
|
|
136
|
+
|
|
137
|
+
&.size-sm
|
|
138
|
+
height: $ba
|
|
139
|
+
width: $ba
|
|
140
|
+
|
|
141
|
+
&.size-md
|
|
142
|
+
height: $ms
|
|
143
|
+
width: $ms
|
|
144
|
+
|
|
145
|
+
&.size-lg
|
|
146
|
+
height: $md
|
|
147
|
+
width: $md
|
|
148
|
+
&.neutral-9
|
|
149
|
+
color: $neutral-9
|
|
150
|
+
|
|
151
|
+
&.accent:hover
|
|
152
|
+
background: $accent-bg-hover
|
|
153
|
+
|
|
154
|
+
.icon-tooltip
|
|
155
|
+
background: $dark
|
|
156
|
+
border-radius: $xxs
|
|
157
|
+
padding: $xs $sm
|
|
158
|
+
box-shadow: 0px 0px 4px 0px rgba(16, 17, 20, 0.08)
|
|
159
|
+
</style>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
color: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: 'neutral-7',
|
|
8
|
+
},
|
|
9
|
+
disable: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: false,
|
|
12
|
+
},
|
|
13
|
+
flat: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: false,
|
|
16
|
+
},
|
|
17
|
+
label: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'Button',
|
|
20
|
+
},
|
|
21
|
+
leftIcon: {
|
|
22
|
+
type: String,
|
|
23
|
+
},
|
|
24
|
+
rightIcon: {
|
|
25
|
+
type: String,
|
|
26
|
+
},
|
|
27
|
+
outline: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false,
|
|
30
|
+
},
|
|
31
|
+
size: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'md',
|
|
34
|
+
validator: (val) => ['sm', 'md', 'lg'].includes(val),
|
|
35
|
+
},
|
|
36
|
+
fullWidth: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: false,
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const emit = defineEmits(['onClick'])
|
|
43
|
+
|
|
44
|
+
const handleClick = () => {
|
|
45
|
+
return emit('onClick')
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const textClass = computed(() => {
|
|
49
|
+
if (props.color === 'neutral') {
|
|
50
|
+
return 'text-neutral-9'
|
|
51
|
+
}
|
|
52
|
+
return ''
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const isFullWidth = computed(() => {
|
|
56
|
+
if (props.fullWidth === true) {
|
|
57
|
+
return 'full-width'
|
|
58
|
+
}
|
|
59
|
+
return ''
|
|
60
|
+
})
|
|
61
|
+
</script>
|
|
62
|
+
|
|
63
|
+
<template>
|
|
64
|
+
<q-btn
|
|
65
|
+
class="u-btn q-py-none"
|
|
66
|
+
:class="`size-${size} ${textClass} focus-${color} ${isFullWidth}`"
|
|
67
|
+
:color="color"
|
|
68
|
+
:disable="disable"
|
|
69
|
+
:unelevated="!outline"
|
|
70
|
+
:outline="outline"
|
|
71
|
+
no-caps
|
|
72
|
+
:flat="flat"
|
|
73
|
+
@click="handleClick"
|
|
74
|
+
>
|
|
75
|
+
<template #default>
|
|
76
|
+
<slot name="default">
|
|
77
|
+
<div class="row items-center no-wrap">
|
|
78
|
+
<q-icon
|
|
79
|
+
v-if="leftIcon"
|
|
80
|
+
left
|
|
81
|
+
:class="leftIcon"
|
|
82
|
+
class="q-mr-xs"
|
|
83
|
+
size="1rem"
|
|
84
|
+
/>
|
|
85
|
+
|
|
86
|
+
<div class="text-center text-caption-md button-label">
|
|
87
|
+
{{ label }}
|
|
88
|
+
</div>
|
|
89
|
+
<q-icon
|
|
90
|
+
v-if="rightIcon"
|
|
91
|
+
right
|
|
92
|
+
:class="rightIcon"
|
|
93
|
+
class="q-ml-xs"
|
|
94
|
+
size="1rem"
|
|
95
|
+
/>
|
|
96
|
+
</div>
|
|
97
|
+
</slot>
|
|
98
|
+
|
|
99
|
+
<slot name="tooltip" />
|
|
100
|
+
<slot name="menu" />
|
|
101
|
+
</template>
|
|
102
|
+
</q-btn>
|
|
103
|
+
</template>
|
|
104
|
+
|
|
105
|
+
<style lang="sass">
|
|
106
|
+
.u-btn
|
|
107
|
+
border-radius: $xs
|
|
108
|
+
min-width: 5.5rem !important
|
|
109
|
+
|
|
110
|
+
&.bg-neutral
|
|
111
|
+
background-color: $neutral-3
|
|
112
|
+
|
|
113
|
+
&.size-sm
|
|
114
|
+
min-height: $md
|
|
115
|
+
padding: 0 $sm !important
|
|
116
|
+
|
|
117
|
+
&.size-md
|
|
118
|
+
min-height: $lg
|
|
119
|
+
padding: 0 $ba !important
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
&.size-lg
|
|
123
|
+
min-height: $xl
|
|
124
|
+
padding: 0 $ba !important
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
.button-label
|
|
128
|
+
word-break: break-all
|
|
129
|
+
</style>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const props = defineProps({
|
|
3
|
+
options: {
|
|
4
|
+
type: Array,
|
|
5
|
+
require: true,
|
|
6
|
+
},
|
|
7
|
+
})
|
|
8
|
+
const model = defineModel()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<q-btn-toggle
|
|
13
|
+
class="u-btn-toggle"
|
|
14
|
+
v-model="model"
|
|
15
|
+
size="md"
|
|
16
|
+
text-color="dark"
|
|
17
|
+
unelevated
|
|
18
|
+
color="white"
|
|
19
|
+
no-caps
|
|
20
|
+
spread
|
|
21
|
+
toggle-color="primary"
|
|
22
|
+
:options="options"
|
|
23
|
+
>
|
|
24
|
+
<template
|
|
25
|
+
v-for="(option, index) in options"
|
|
26
|
+
v-slot:[option.slot]
|
|
27
|
+
:key="option"
|
|
28
|
+
>
|
|
29
|
+
<div class="row items-center no-wrap slot">
|
|
30
|
+
<q-icon
|
|
31
|
+
:class="options[index].iconClass"
|
|
32
|
+
v-if="options[index].iconClass"
|
|
33
|
+
/>
|
|
34
|
+
<div class="text-center text-caption-md">
|
|
35
|
+
{{ options[index].name }}
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
39
|
+
</q-btn-toggle>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<style lang="sass">
|
|
43
|
+
.slot
|
|
44
|
+
gap: $xxs
|
|
45
|
+
|
|
46
|
+
.u-btn-toggle
|
|
47
|
+
&.q-btn-toggle
|
|
48
|
+
border-radius: $xs
|
|
49
|
+
padding: $xxs
|
|
50
|
+
box-shadow: $shadow-inner
|
|
51
|
+
|
|
52
|
+
.q-btn-item
|
|
53
|
+
.q-btn__content
|
|
54
|
+
font-size: 0.875rem
|
|
55
|
+
line-height: 1.25rem
|
|
56
|
+
letter-spacing: .03333rem
|
|
57
|
+
font-weight: 500
|
|
58
|
+
|
|
59
|
+
.q-btn-item
|
|
60
|
+
border-radius: $xxs !important
|
|
61
|
+
padding: $xs $sm !important
|
|
62
|
+
&[aria-pressed="true"]
|
|
63
|
+
&::before
|
|
64
|
+
color: $neutral-1
|
|
65
|
+
box-shadow: $shadow-skeumorphic-primary
|
|
66
|
+
border: $stroke-skeuomorphic
|
|
67
|
+
z-index: 2
|
|
68
|
+
</style>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onMounted } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
label: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: '',
|
|
8
|
+
},
|
|
9
|
+
name: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: '',
|
|
12
|
+
},
|
|
13
|
+
disabled: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: false,
|
|
16
|
+
},
|
|
17
|
+
showLabel: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: true,
|
|
20
|
+
},
|
|
21
|
+
id: {
|
|
22
|
+
type: [String, Number],
|
|
23
|
+
default: 'u-checkbox',
|
|
24
|
+
required: true, // it is required for to match accessibility crieteria
|
|
25
|
+
},
|
|
26
|
+
indeterminate: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
const isChecked = defineModel({ default: false, type: Boolean })
|
|
33
|
+
|
|
34
|
+
onMounted(() => {
|
|
35
|
+
const checkboxElement = document.getElementById(`${props.id}`)
|
|
36
|
+
if (checkboxElement) {
|
|
37
|
+
const inputElement = checkboxElement.querySelector('input')
|
|
38
|
+
inputElement.id = `${props.id}`
|
|
39
|
+
} else {
|
|
40
|
+
// need to add if element is not found
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
</script>
|
|
44
|
+
|
|
45
|
+
<template>
|
|
46
|
+
<label style="display: none" :for="`${id}`">Checkbox </label>
|
|
47
|
+
<q-checkbox
|
|
48
|
+
:id="`${id}`"
|
|
49
|
+
class="u-checkbox text-caption-lg"
|
|
50
|
+
:name="name"
|
|
51
|
+
v-model="isChecked"
|
|
52
|
+
:disable="disabled"
|
|
53
|
+
:label="showLabel ? label : ''"
|
|
54
|
+
size="md"
|
|
55
|
+
keep-color
|
|
56
|
+
color="primary"
|
|
57
|
+
:toggle-indeterminate="indeterminate"
|
|
58
|
+
v-bind="$attrs"
|
|
59
|
+
/>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<style lang="sass">
|
|
63
|
+
.u-checkbox
|
|
64
|
+
color: $primary
|
|
65
|
+
font-weight: 500
|
|
66
|
+
|
|
67
|
+
.q-checkbox__inner
|
|
68
|
+
display: flex
|
|
69
|
+
justify-content: center
|
|
70
|
+
align-items: center
|
|
71
|
+
height: $ms
|
|
72
|
+
width: $ms
|
|
73
|
+
|
|
74
|
+
.q-checkbox__inner:before
|
|
75
|
+
top: -9px !important
|
|
76
|
+
left: -2px !important
|
|
77
|
+
width: 2.7rem
|
|
78
|
+
height: 2.7rem
|
|
79
|
+
border-radius: 10rem !important
|
|
80
|
+
|
|
81
|
+
.q-checkbox__bg
|
|
82
|
+
border: 0.125rem solid $primary
|
|
83
|
+
border-radius: $xxs
|
|
84
|
+
height: $ms
|
|
85
|
+
width: $ms
|
|
86
|
+
position: static
|
|
87
|
+
display: flex
|
|
88
|
+
justify-content: center
|
|
89
|
+
align-items: center
|
|
90
|
+
|
|
91
|
+
.q-checkbox__svg
|
|
92
|
+
position: static
|
|
93
|
+
height: 1rem !important
|
|
94
|
+
width: 1rem !important
|
|
95
|
+
</style>
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import UTooltip from './UTooltip.vue'
|
|
4
|
+
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
chipLabel: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: 'Chip',
|
|
9
|
+
},
|
|
10
|
+
dense: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false,
|
|
13
|
+
},
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: false,
|
|
17
|
+
},
|
|
18
|
+
avatarLabel: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: '',
|
|
21
|
+
},
|
|
22
|
+
icon: {
|
|
23
|
+
type: String,
|
|
24
|
+
},
|
|
25
|
+
iconClass: {
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
type: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: 'neutral',
|
|
31
|
+
},
|
|
32
|
+
removable: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true,
|
|
35
|
+
},
|
|
36
|
+
remove: {
|
|
37
|
+
type: Function,
|
|
38
|
+
},
|
|
39
|
+
isShowTooltip: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: false,
|
|
42
|
+
},
|
|
43
|
+
offset: {
|
|
44
|
+
default: () => [14, 14],
|
|
45
|
+
type: Array,
|
|
46
|
+
},
|
|
47
|
+
anchor: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: 'bottom middle',
|
|
50
|
+
},
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
const emit = defineEmits(['update:modelValue', 'onClick'])
|
|
54
|
+
|
|
55
|
+
const handleClick = () => {
|
|
56
|
+
return emit('onClick')
|
|
57
|
+
}
|
|
58
|
+
const size = computed(() => {
|
|
59
|
+
if (props.dense) {
|
|
60
|
+
return 'xs'
|
|
61
|
+
}
|
|
62
|
+
return 'sm'
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const avatarLabel = computed(() => {
|
|
66
|
+
if (props.avatarLabel && props.avatarLabel.length > 2) {
|
|
67
|
+
return props.avatarLabel.substring(0, 2)
|
|
68
|
+
}
|
|
69
|
+
return props.avatarLabel
|
|
70
|
+
})
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<template>
|
|
74
|
+
<q-chip
|
|
75
|
+
v-if="chipLabel"
|
|
76
|
+
class="u-chip q-px-xs"
|
|
77
|
+
v-bind="$attrs"
|
|
78
|
+
:class="type"
|
|
79
|
+
:modelValue="modelValue"
|
|
80
|
+
:dense="dense"
|
|
81
|
+
@remove="remove"
|
|
82
|
+
:removable="removable"
|
|
83
|
+
:aria-label="chipLabel"
|
|
84
|
+
@click="handleClick"
|
|
85
|
+
>
|
|
86
|
+
<q-avatar v-if="avatarLabel" class="u-avatar">
|
|
87
|
+
<span class="text-caption-xs">{{ avatarLabel }}</span>
|
|
88
|
+
</q-avatar>
|
|
89
|
+
|
|
90
|
+
<q-icon v-if="iconClass" :class="`iconLeft ${iconClass}`" />
|
|
91
|
+
|
|
92
|
+
<span :class="`chip-label text-overline-${size} text-uppercase`">
|
|
93
|
+
{{ chipLabel }}
|
|
94
|
+
</span>
|
|
95
|
+
<UTooltip
|
|
96
|
+
v-if="isShowTooltip"
|
|
97
|
+
:description="chipLabel"
|
|
98
|
+
:offset="offset"
|
|
99
|
+
:anchor="anchor"
|
|
100
|
+
/>
|
|
101
|
+
</q-chip>
|
|
102
|
+
</template>
|
|
103
|
+
|
|
104
|
+
<style lang="sass">
|
|
105
|
+
.u-chip
|
|
106
|
+
padding: $xs
|
|
107
|
+
border-radius: 20px
|
|
108
|
+
height: $lg
|
|
109
|
+
|
|
110
|
+
.u-avatar
|
|
111
|
+
width: $ms
|
|
112
|
+
height: $ms
|
|
113
|
+
margin-left:0 !important
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
.q-icon
|
|
117
|
+
width: $ba
|
|
118
|
+
height: $ba
|
|
119
|
+
font-size:$ba
|
|
120
|
+
|
|
121
|
+
.iconLeft
|
|
122
|
+
padding-right: $xs
|
|
123
|
+
|
|
124
|
+
.q-chip__icon--remove
|
|
125
|
+
padding: $xs 0 $xs $xs
|
|
126
|
+
margin:0
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
&.neutral
|
|
130
|
+
background-color: $neutral-3
|
|
131
|
+
color: $neutral-9
|
|
132
|
+
.q-avatar
|
|
133
|
+
background-color: $neutral-9 !important
|
|
134
|
+
color: $neutral-3
|
|
135
|
+
|
|
136
|
+
.q-icon
|
|
137
|
+
color: $neutral-9 !important
|
|
138
|
+
|
|
139
|
+
&.primary
|
|
140
|
+
background-color: $blue-2
|
|
141
|
+
color: $primary
|
|
142
|
+
.q-avatar
|
|
143
|
+
background-color: $primary !important
|
|
144
|
+
color: $blue-2 !important
|
|
145
|
+
|
|
146
|
+
.q-icon
|
|
147
|
+
color: $primary !important
|
|
148
|
+
|
|
149
|
+
&.positive
|
|
150
|
+
background-color: $green-2
|
|
151
|
+
color: $green-7
|
|
152
|
+
.q-avatar
|
|
153
|
+
background-color: $green-7 !important
|
|
154
|
+
color: $green-2 !important
|
|
155
|
+
|
|
156
|
+
.q-icon
|
|
157
|
+
color: $green-7 !important
|
|
158
|
+
|
|
159
|
+
&.accent
|
|
160
|
+
background-color: $red-2
|
|
161
|
+
color: $red-7
|
|
162
|
+
.q-avatar
|
|
163
|
+
background-color: $red-7 !important
|
|
164
|
+
color: $red-2 !important
|
|
165
|
+
|
|
166
|
+
.q-icon
|
|
167
|
+
color: $red-7 !important
|
|
168
|
+
|
|
169
|
+
&.info
|
|
170
|
+
background-color: $purple-2
|
|
171
|
+
color: $purple-7
|
|
172
|
+
.q-avatar
|
|
173
|
+
background-color: $purple-7 !important
|
|
174
|
+
color: $purple-2 !important
|
|
175
|
+
|
|
176
|
+
.q-icon
|
|
177
|
+
color: $purple-7 !important
|
|
178
|
+
|
|
179
|
+
&.warning
|
|
180
|
+
background-color: $orange-2
|
|
181
|
+
color: $orange-7
|
|
182
|
+
.q-avatar
|
|
183
|
+
background-color: $orange-7 !important
|
|
184
|
+
color: $orange-2 !important
|
|
185
|
+
|
|
186
|
+
.q-icon
|
|
187
|
+
color: $orange-7 !important
|
|
188
|
+
&.yellow
|
|
189
|
+
background-color: $yellow-1
|
|
190
|
+
color: $yellow-9
|
|
191
|
+
.q-avatar
|
|
192
|
+
background-color: $yellow-9 !important
|
|
193
|
+
color: $yellow-1 !important
|
|
194
|
+
|
|
195
|
+
.q-icon
|
|
196
|
+
color: $yellow-9 !important
|
|
197
|
+
|
|
198
|
+
&.teal
|
|
199
|
+
background-color: $teal-1
|
|
200
|
+
color: $teal-7
|
|
201
|
+
.q-avatar
|
|
202
|
+
background-color: $teal-7 !important
|
|
203
|
+
color: $teal-1 !important
|
|
204
|
+
|
|
205
|
+
.q-icon
|
|
206
|
+
color: $teal-7 !important
|
|
207
|
+
|
|
208
|
+
&.gold
|
|
209
|
+
background-color: $gold-2
|
|
210
|
+
color: $gold-8
|
|
211
|
+
.q-avatar
|
|
212
|
+
background-color: $gold-8 !important
|
|
213
|
+
color: $gold-2 !important
|
|
214
|
+
|
|
215
|
+
.q-icon
|
|
216
|
+
color: $gold-8 !important
|
|
217
|
+
|
|
218
|
+
&.pink
|
|
219
|
+
background-color: $pink-1
|
|
220
|
+
color: $pink-7
|
|
221
|
+
.q-avatar
|
|
222
|
+
background-color: $pink-7 !important
|
|
223
|
+
color: $pink-1 !important
|
|
224
|
+
|
|
225
|
+
.q-icon
|
|
226
|
+
color: $pink-7 !important
|
|
227
|
+
|
|
228
|
+
&.q-chip--dense
|
|
229
|
+
padding: $xxs !important
|
|
230
|
+
height: $ms !important
|
|
231
|
+
.q-avatar
|
|
232
|
+
width: $ba !important
|
|
233
|
+
height: $ba !important
|
|
234
|
+
.q-avatar__content span
|
|
235
|
+
font-size:$xs !important
|
|
236
|
+
line-height:0rem !important
|
|
237
|
+
.q-icon
|
|
238
|
+
width: $sm !important
|
|
239
|
+
height: $sm !important
|
|
240
|
+
font-size:$sm !important
|
|
241
|
+
padding: $xxs $xxs $xxs 0rem
|
|
242
|
+
|
|
243
|
+
.q-chip__icon--remove
|
|
244
|
+
padding: $xxs
|
|
245
|
+
|
|
246
|
+
.chip-label
|
|
247
|
+
max-width: 12.5rem
|
|
248
|
+
white-space: normal
|
|
249
|
+
overflow-wrap: break-word
|
|
250
|
+
line-height: 1.2 !important // over-ridding this in long chip label case
|
|
251
|
+
</style>
|