@bildvitta/quasar-ui-asteroid 3.14.0-beta.0 → 3.14.0-beta.1
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 +1 -1
- package/src/components/actions-menu/QasActionsMenu.vue +16 -14
- package/src/components/alert/QasAlert.vue +1 -1
- package/src/components/app-bar/QasAppBar.vue +5 -5
- package/src/components/app-menu/QasAppMenu.vue +8 -8
- package/src/components/app-menu/private/PvAppMenuDropdown.vue +1 -1
- package/src/components/app-user/QasAppUser.vue +10 -10
- package/src/components/avatar/QasAvatar.vue +2 -2
- package/src/components/breakline/QasBreakline.vue +5 -6
- package/src/components/btn-dropdown/QasBtnDropdown.vue +74 -95
- package/src/components/card/QasCard.vue +55 -73
- package/src/components/checkbox-group/QasCheckboxGroup.vue +81 -92
- package/src/components/copy/QasCopy.vue +20 -27
- package/src/components/date/QasDate.vue +316 -355
- package/src/components/date/QasDate.yml +0 -5
- package/src/components/date/enums/DateMaskOptions.js +6 -0
- package/src/components/date-time-input/QasDateTimeInput.vue +198 -209
- package/src/components/debugger/QasDebugger.vue +20 -12
- package/src/components/delete/QasDelete.vue +70 -80
- package/src/components/dialog/QasDialog.vue +7 -7
- package/src/components/dialog/composables/use-cancel.js +3 -3
- package/src/components/dialog/composables/use-dynamic-components.js +4 -4
- package/src/components/dialog/composables/use-ok.js +3 -3
- package/src/components/dialog-router/QasDialogRouter.vue +68 -67
- package/src/components/empty-result-text/QasEmptyResultText.vue +8 -10
- package/src/components/form-generator/QasFormGenerator.vue +2 -2
- package/src/components/gallery/QasGallery.vue +175 -196
- package/src/components/gallery/composables/use-delete.js +54 -0
- package/src/components/gallery/private/PvGalleryCarouselDialog.vue +48 -55
- package/src/components/gallery/private/PvGalleryDeleteDialog.vue +41 -50
- package/src/components/gallery-card/QasGalleryCard.vue +90 -103
- package/src/components/grid-generator/QasGridGenerator.vue +2 -2
- package/src/components/header-actions/QasHeaderActions.vue +35 -50
- package/src/components/header-actions/QasHeaderActions.yml +1 -1
- package/src/components/infinite-scroll/QasInfiniteScroll.vue +2 -2
- package/src/components/label/QasLabel.vue +42 -54
- package/src/components/list-items/QasListItems.vue +32 -41
- package/src/components/map/QasMap.vue +44 -46
- package/src/components/page-header/QasPageHeader.vue +74 -87
- package/src/components/pagination/QasPagination.vue +21 -21
- package/src/components/select-list-dialog/QasSelectListDialog.vue +4 -2
- package/src/components/tabs-generator/QasTabsGenerator.vue +55 -63
- package/src/components/timeline/QasTimeline.vue +1 -1
- package/src/composables/private/use-generator.js +0 -8
- package/src/vue-plugin.js +5 -1
package/package.json
CHANGED
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
</q-item-section>
|
|
10
10
|
|
|
11
11
|
<q-item-section>
|
|
12
|
-
<div>
|
|
12
|
+
<div>
|
|
13
|
+
{{ item.label }}
|
|
14
|
+
</div>
|
|
13
15
|
</q-item-section>
|
|
14
16
|
</q-item>
|
|
15
17
|
</slot>
|
|
@@ -86,7 +88,7 @@ const { deleteBtnProps, hasDelete } = useDelete()
|
|
|
86
88
|
const fullList = computed(() => {
|
|
87
89
|
return {
|
|
88
90
|
...props.list,
|
|
89
|
-
...deleteBtnProps
|
|
91
|
+
...deleteBtnProps.value
|
|
90
92
|
}
|
|
91
93
|
})
|
|
92
94
|
|
|
@@ -189,20 +191,20 @@ function onClick (item = {}) {
|
|
|
189
191
|
|
|
190
192
|
// ------------------------------- composables ---------------------------------
|
|
191
193
|
function useDelete () {
|
|
192
|
-
const deleteBtnProps = {}
|
|
193
|
-
|
|
194
194
|
const hasDelete = computed(() => !!Object.keys(props.deleteProps).length)
|
|
195
195
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
196
|
+
const deleteBtnProps = computed(() => {
|
|
197
|
+
return {
|
|
198
|
+
...(hasDelete.value && {
|
|
199
|
+
delete: {
|
|
200
|
+
color: 'grey-10',
|
|
201
|
+
icon: props.deleteIcon,
|
|
202
|
+
label: props.deleteLabel,
|
|
203
|
+
handler: () => qas.delete(props.deleteProps)
|
|
204
|
+
}
|
|
205
|
+
})
|
|
206
|
+
}
|
|
207
|
+
})
|
|
206
208
|
|
|
207
209
|
return {
|
|
208
210
|
deleteBtnProps,
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
<q-toolbar-title>
|
|
7
7
|
<router-link class="flex items-center no-wrap text-no-decoration" :class="routerLinkClass" :to="rootRoute">
|
|
8
|
-
<img v-if="brand" :alt="title" class="qas-app-bar__brand" :src="brand">
|
|
8
|
+
<img v-if="props.brand" :alt="props.title" class="qas-app-bar__brand" :src="props.brand">
|
|
9
9
|
|
|
10
|
-
<span v-else class="ellipsis text-bold text-primary">{{ title }}</span>
|
|
10
|
+
<span v-else class="ellipsis text-bold text-primary">{{ props.title }}</span>
|
|
11
11
|
|
|
12
12
|
<q-badge v-if="hasDevelopmentBadge" class="q-ml-sm" color="red" :label="developmentBadgeLabel" />
|
|
13
13
|
</router-link>
|
|
@@ -54,7 +54,7 @@ const props = defineProps({
|
|
|
54
54
|
}
|
|
55
55
|
})
|
|
56
56
|
|
|
57
|
-
const
|
|
57
|
+
const emit = defineEmits(['sign-out', 'toggle-menu'])
|
|
58
58
|
|
|
59
59
|
const router = useRouter()
|
|
60
60
|
const screen = useScreen()
|
|
@@ -93,11 +93,11 @@ const hasUser = computed(() => !!Object.keys(defaultAppUserProps.value.user || {
|
|
|
93
93
|
const routerLinkClass = computed(() => screen.isSmall && 'justify-center')
|
|
94
94
|
|
|
95
95
|
function signOut () {
|
|
96
|
-
|
|
96
|
+
emit('sign-out')
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
function toggleMenuDrawer () {
|
|
100
|
-
|
|
100
|
+
emit('toggle-menu')
|
|
101
101
|
}
|
|
102
102
|
</script>
|
|
103
103
|
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
<!-- Brand -->
|
|
7
7
|
<div v-if="!screen.untilLarge" class="q-mb-xl q-pt-xl qas-app-menu__label" :class="classes.spacedItem">
|
|
8
8
|
<router-link class="column flex items-center justify-center relative-position text-no-decoration" :to="rootRoute">
|
|
9
|
-
<q-img v-if="normalizedBrand" :alt="title" class="qas-app-menu__brand qas-app-menu__label" fit="contain" height="27px" img-class="qas-app-menu__brand-img" no-spinner :src="normalizedBrand" />
|
|
9
|
+
<q-img v-if="normalizedBrand" :alt="props.title" class="qas-app-menu__brand qas-app-menu__label" fit="contain" height="27px" img-class="qas-app-menu__brand-img" no-spinner :src="normalizedBrand" />
|
|
10
10
|
|
|
11
|
-
<span v-else-if="!isMiniMode" class="ellipsis text-bold text-primary text-subtitle2">{{ title }}</span>
|
|
11
|
+
<span v-else-if="!isMiniMode" class="ellipsis text-bold text-primary text-subtitle2">{{ props.title }}</span>
|
|
12
12
|
|
|
13
13
|
<q-badge v-if="hasDevelopmentBadge" class="q-mt-sm" color="red" :label="developmentBadgeLabel" />
|
|
14
14
|
</router-link>
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
</div>
|
|
31
31
|
|
|
32
32
|
<!-- List -->
|
|
33
|
-
<q-list v-if="items.length" class="q-mt-xl qas-app-menu__menu text-grey-10">
|
|
34
|
-
<template v-for="(menuItem, index) in items">
|
|
33
|
+
<q-list v-if="props.items.length" class="q-mt-xl qas-app-menu__menu text-grey-10">
|
|
34
|
+
<template v-for="(menuItem, index) in props.items">
|
|
35
35
|
<div v-if="hasChildren(menuItem)" :key="`children-${index}`" class="qas-app-menu__content" :class="classes.content">
|
|
36
36
|
<q-item class="ellipsis items-center q-py-none qas-app-menu__item qas-app-menu__item--label-mini text-weight-bold">
|
|
37
37
|
<div class="ellipsis qas-app-menu__label text-grey-10 text-subtitle2" :class="classes.spacedItem">
|
|
@@ -146,7 +146,7 @@ const props = defineProps({
|
|
|
146
146
|
}
|
|
147
147
|
})
|
|
148
148
|
|
|
149
|
-
const
|
|
149
|
+
const emit = defineEmits(['sign-out', 'update:modelValue'])
|
|
150
150
|
|
|
151
151
|
const screen = useScreen()
|
|
152
152
|
const router = useRouter()
|
|
@@ -159,7 +159,7 @@ const isMini = ref(screen.isLarge)
|
|
|
159
159
|
const composableParams = {
|
|
160
160
|
props,
|
|
161
161
|
onMenuUpdate: setHasOpenedMenu,
|
|
162
|
-
onSignOut: () =>
|
|
162
|
+
onSignOut: () => emit('sign-out')
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
const { defaultAppUserProps, showAppUser } = useAppUser(composableParams)
|
|
@@ -172,7 +172,7 @@ const model = computed({
|
|
|
172
172
|
},
|
|
173
173
|
|
|
174
174
|
set (value) {
|
|
175
|
-
|
|
175
|
+
emit('update:modelValue', value)
|
|
176
176
|
}
|
|
177
177
|
})
|
|
178
178
|
|
|
@@ -195,7 +195,7 @@ const classes = computed(() => {
|
|
|
195
195
|
|
|
196
196
|
// métodos
|
|
197
197
|
function closeDrawer () {
|
|
198
|
-
|
|
198
|
+
emit('update:modelValue', false)
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
function getNormalizedPath (path) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<div class="pv-app-menu-dropdown">
|
|
3
3
|
<qas-btn-dropdown v-bind="defaultButtonDropdownProps">
|
|
4
4
|
<q-list>
|
|
5
|
-
<q-item v-for="item in modules" :key="item" :active="isActive(item)" active-class="text-primary" :href="item.value">
|
|
5
|
+
<q-item v-for="item in props.modules" :key="item" :active="isActive(item)" active-class="text-primary" :href="item.value">
|
|
6
6
|
<q-item-section v-if="item.icon" avatar>
|
|
7
7
|
<q-icon :name="item.icon" />
|
|
8
8
|
</q-item-section>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="cursor-pointer items-center no-wrap q-gutter-sm qas-app-user row" data-cy="app-user">
|
|
3
3
|
<div class="relative-position">
|
|
4
|
-
<qas-avatar :image="user.photo" :size="avatarSize" :title="userName" />
|
|
4
|
+
<qas-avatar :image="props.user.photo" :size="props.avatarSize" :title="userName" />
|
|
5
5
|
|
|
6
6
|
<q-badge v-if="hasNotifications" color="red" floating>
|
|
7
|
-
{{ notifications.count }}
|
|
7
|
+
{{ props.notifications.count }}
|
|
8
8
|
</q-badge>
|
|
9
9
|
</div>
|
|
10
10
|
|
|
@@ -14,26 +14,26 @@
|
|
|
14
14
|
</div>
|
|
15
15
|
|
|
16
16
|
<div class="ellipsis qas-app-user__email text-grey-8">
|
|
17
|
-
{{ user.email }}
|
|
17
|
+
{{ props.user.email }}
|
|
18
18
|
</div>
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
|
-
<q-menu class="shadow-2 text-grey-10" max-height="400px" v-bind="menuProps" @hide="onMenuHide">
|
|
21
|
+
<q-menu class="shadow-2 text-grey-10" max-height="400px" v-bind="props.menuProps" @hide="onMenuHide">
|
|
22
22
|
<div class="q-pb-sm q-pt-md q-px-md qas-app-user__menu">
|
|
23
|
-
<qas-avatar class="q-mb-md" :image="user.photo" size="64px" :title="userName" />
|
|
23
|
+
<qas-avatar class="q-mb-md" :image="props.user.photo" size="64px" :title="userName" />
|
|
24
24
|
|
|
25
25
|
<div class="ellipsis qas-app-user__menu-name">
|
|
26
26
|
{{ userName }}
|
|
27
27
|
</div>
|
|
28
28
|
|
|
29
29
|
<div class="ellipsis">
|
|
30
|
-
{{ user.email }}
|
|
30
|
+
{{ props.user.email }}
|
|
31
31
|
</div>
|
|
32
32
|
|
|
33
33
|
<qas-select v-if="hasCompaniesSelect" v-bind="defaultCompanyProps" v-model="companiesModel" class="q-my-md" data-cy="app-user-companies-select" @update:model-value="setCompanies" />
|
|
34
34
|
|
|
35
35
|
<q-list class="q-mt-md">
|
|
36
|
-
<q-item v-close-popup :active="false" class="qas-app-user__menu-item" clickable :to="user.to">
|
|
36
|
+
<q-item v-close-popup :active="false" class="qas-app-user__menu-item" clickable :to="props.user.to">
|
|
37
37
|
<q-item-section avatar>
|
|
38
38
|
<q-icon name="sym_r_person" />
|
|
39
39
|
</q-item-section>
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
|
|
55
55
|
<q-item-section side>
|
|
56
56
|
<q-badge color="red">
|
|
57
|
-
{{ notifications.count }}
|
|
57
|
+
{{ props.notifications.count }}
|
|
58
58
|
</q-badge>
|
|
59
59
|
</q-item-section>
|
|
60
60
|
</q-item>
|
|
@@ -111,7 +111,7 @@ const props = defineProps({
|
|
|
111
111
|
}
|
|
112
112
|
})
|
|
113
113
|
|
|
114
|
-
const
|
|
114
|
+
const emit = defineEmits(['sign-out'])
|
|
115
115
|
|
|
116
116
|
// vindo direto do boot api.js
|
|
117
117
|
const axios = inject('axios')
|
|
@@ -142,7 +142,7 @@ watch(() => props.companyProps.modelValue, value => {
|
|
|
142
142
|
|
|
143
143
|
// métodos
|
|
144
144
|
function signOut () {
|
|
145
|
-
|
|
145
|
+
emit('sign-out')
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
async function setCompanies (value) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<q-avatar class="text-bold" v-bind="attributes">
|
|
3
|
-
<q-img v-if="hasImage" :alt="title" :ratio="1" spinner-color="primary" spinner-size="16px" :src="image" @error="onImageLoadedError" />
|
|
3
|
+
<q-img v-if="hasImage" :alt="props.title" :ratio="1" spinner-color="primary" spinner-size="16px" :src="props.image" @error="onImageLoadedError" />
|
|
4
4
|
<template v-else-if="hasTitle">{{ firstLetter }}</template>
|
|
5
|
-
<q-icon v-else :name="icon" />
|
|
5
|
+
<q-icon v-else :name="props.icon" />
|
|
6
6
|
</q-avatar>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component :is="tag" v-for="(line, index) in lines" :key="index" v-bind="
|
|
2
|
+
<component :is="props.tag" v-for="(line, index) in lines" :key="index" v-bind="attrs">
|
|
3
3
|
{{ line }}
|
|
4
4
|
</component>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script setup>
|
|
8
|
-
import { computed } from 'vue'
|
|
8
|
+
import { computed, useAttrs, useSlots } from 'vue'
|
|
9
9
|
import { getSlotChildrenText } from '../../helpers'
|
|
10
10
|
|
|
11
|
-
defineOptions({
|
|
12
|
-
name: 'QasBreakline'
|
|
13
|
-
})
|
|
11
|
+
defineOptions({ name: 'QasBreakline' })
|
|
14
12
|
|
|
15
13
|
const props = defineProps({
|
|
16
14
|
split: {
|
|
@@ -29,7 +27,8 @@ const props = defineProps({
|
|
|
29
27
|
}
|
|
30
28
|
})
|
|
31
29
|
|
|
32
|
-
const
|
|
30
|
+
const attrs = useAttrs()
|
|
31
|
+
const slots = useSlots()
|
|
33
32
|
|
|
34
33
|
const lines = computed(() => {
|
|
35
34
|
const text = props.text || getSlotChildrenText(slots.default())
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="qas-btn-dropdown" :class="classes">
|
|
3
|
-
<div v-if="hasLeftButton" :class="
|
|
2
|
+
<div class="qas-btn-dropdown" :class="classes.parent">
|
|
3
|
+
<div v-if="hasLeftButton" :class="classes.leftSide">
|
|
4
4
|
<slot name="left-button">
|
|
5
|
-
<qas-btn variant="tertiary" v-bind="defaultButtonProps" @click="
|
|
5
|
+
<qas-btn variant="tertiary" v-bind="defaultButtonProps" @click="onClick">
|
|
6
6
|
<q-menu v-if="hasMenuOnLeftSide" v-model="isMenuOpened" anchor="bottom right" auto-close self="top right" @update:model-value="onUpdateMenuValue">
|
|
7
|
-
<div :class="
|
|
7
|
+
<div :class="classes.menuContent">
|
|
8
8
|
<slot />
|
|
9
9
|
</div>
|
|
10
10
|
</q-menu>
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
|
|
15
15
|
<q-separator v-if="hasSeparator" class="q-mr-sm qas-btn-dropdown__separator self-center" dark vertical />
|
|
16
16
|
|
|
17
|
-
<div v-if="useSplit">
|
|
18
|
-
<qas-btn color="grey-10" :icon="dropdownIcon" variant="tertiary">
|
|
17
|
+
<div v-if="props.useSplit">
|
|
18
|
+
<qas-btn color="grey-10" :icon="props.dropdownIcon" variant="tertiary">
|
|
19
19
|
<q-menu v-if="hasDefaultSlot" anchor="bottom right" auto-close self="top right">
|
|
20
|
-
<div :class="
|
|
20
|
+
<div :class="classes.menuContent">
|
|
21
21
|
<slot />
|
|
22
22
|
</div>
|
|
23
23
|
</q-menu>
|
|
@@ -26,120 +26,99 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
|
-
<script>
|
|
30
|
-
|
|
31
|
-
name: 'QasBtnDropdown',
|
|
32
|
-
|
|
33
|
-
inheritAttrs: false,
|
|
34
|
-
|
|
35
|
-
props: {
|
|
36
|
-
buttonProps: {
|
|
37
|
-
default: () => ({}),
|
|
38
|
-
type: Object
|
|
39
|
-
},
|
|
29
|
+
<script setup>
|
|
30
|
+
import useScreen from '../../composables/use-screen'
|
|
40
31
|
|
|
41
|
-
|
|
42
|
-
default: 'sym_r_more_vert',
|
|
43
|
-
type: String
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
useSplit: {
|
|
47
|
-
type: Boolean
|
|
48
|
-
},
|
|
32
|
+
import { ref, watch, computed, useSlots } from 'vue'
|
|
49
33
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
34
|
+
defineOptions({
|
|
35
|
+
name: 'QasBtnDropdown',
|
|
36
|
+
inheritAttrs: false
|
|
37
|
+
})
|
|
53
38
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
39
|
+
const props = defineProps({
|
|
40
|
+
buttonProps: {
|
|
41
|
+
default: () => ({}),
|
|
42
|
+
type: Object
|
|
57
43
|
},
|
|
58
44
|
|
|
59
|
-
|
|
45
|
+
dropdownIcon: {
|
|
46
|
+
default: 'sym_r_more_vert',
|
|
47
|
+
type: String
|
|
48
|
+
},
|
|
60
49
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
isMenuOpened: false
|
|
64
|
-
}
|
|
50
|
+
useSplit: {
|
|
51
|
+
type: Boolean
|
|
65
52
|
},
|
|
66
53
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
'flex inline items-center': this.useSplit
|
|
71
|
-
}
|
|
72
|
-
},
|
|
54
|
+
useMenuPadding: {
|
|
55
|
+
type: Boolean
|
|
56
|
+
},
|
|
73
57
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
58
|
+
menu: {
|
|
59
|
+
type: Boolean
|
|
60
|
+
}
|
|
61
|
+
})
|
|
79
62
|
|
|
80
|
-
|
|
81
|
-
return {
|
|
82
|
-
'q-pa-md': this.useMenuPadding
|
|
83
|
-
}
|
|
84
|
-
},
|
|
63
|
+
const emit = defineEmits(['click', 'update:menu'])
|
|
85
64
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
},
|
|
65
|
+
const slots = useSlots()
|
|
66
|
+
const screen = useScreen()
|
|
89
67
|
|
|
90
|
-
|
|
91
|
-
return this.hasDefaultSlot && !this.useSplit
|
|
92
|
-
},
|
|
68
|
+
const isMenuOpened = ref(false)
|
|
93
69
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
70
|
+
const defaultButtonProps = computed(() => {
|
|
71
|
+
const {
|
|
72
|
+
icon,
|
|
73
|
+
iconRight,
|
|
74
|
+
color,
|
|
75
|
+
...defaultProps
|
|
76
|
+
} = props.buttonProps
|
|
101
77
|
|
|
102
|
-
|
|
78
|
+
const defaultIconRight = iconRight || props.dropdownIcon
|
|
103
79
|
|
|
104
|
-
|
|
105
|
-
|
|
80
|
+
return {
|
|
81
|
+
useLabelOnSmallScreen: false,
|
|
106
82
|
|
|
107
|
-
|
|
83
|
+
...defaultProps,
|
|
108
84
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
85
|
+
color: color || (!props.useSplit ? 'grey-10' : 'primary'),
|
|
86
|
+
...(!props.useSplit && { iconRight: defaultIconRight }),
|
|
87
|
+
...(props.useSplit && { icon })
|
|
88
|
+
}
|
|
89
|
+
})
|
|
114
90
|
|
|
115
|
-
|
|
116
|
-
|
|
91
|
+
const classes = computed(() => {
|
|
92
|
+
return {
|
|
93
|
+
parent: {
|
|
94
|
+
'flex inline items-center': props.useSplit
|
|
117
95
|
},
|
|
118
96
|
|
|
119
|
-
|
|
120
|
-
|
|
97
|
+
leftSide: {
|
|
98
|
+
'q-mr-sm': props.useSplit
|
|
121
99
|
},
|
|
122
100
|
|
|
123
|
-
|
|
124
|
-
|
|
101
|
+
menuContent: {
|
|
102
|
+
'q-pa-md': props.useMenuPadding
|
|
125
103
|
}
|
|
126
|
-
}
|
|
104
|
+
}
|
|
105
|
+
})
|
|
127
106
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
},
|
|
107
|
+
const hasDefaultSlot = computed(() => !!slots.default)
|
|
108
|
+
const hasLeftButton = computed(() => !screen.isSmall || !props.useSplit)
|
|
109
|
+
const hasMenuOnLeftSide = computed(() => hasDefaultSlot.value && !props.useSplit)
|
|
110
|
+
const hasSeparator = computed(() => !screen.isSmall && props.useSplit)
|
|
133
111
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
112
|
+
watch(() => props.menu, value => {
|
|
113
|
+
isMenuOpened.value = value
|
|
114
|
+
}, { immediate: true })
|
|
137
115
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
116
|
+
function onUpdateMenuValue (value) {
|
|
117
|
+
emit('update:menu', value)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function onClick (event) {
|
|
121
|
+
emit('click', event)
|
|
143
122
|
}
|
|
144
123
|
</script>
|
|
145
124
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="col-12 col-lg-3 col-md-4 col-sm-6">
|
|
3
3
|
<q-card class="border-radius-lg column full-height overflow-hidden" :class="cardClasses">
|
|
4
|
-
<header v-if="useHeader" class="overflow-hidden relative-position w-full">
|
|
4
|
+
<header v-if="props.useHeader" class="overflow-hidden relative-position w-full">
|
|
5
5
|
<slot name="header">
|
|
6
6
|
<q-carousel v-model="slideImage" animated class="cursor-pointer" height="205px" infinite :navigation="hasImages" navigation-icon="sym_r_fiber_manual_record" swipeable>
|
|
7
7
|
<template #navigation-icon="{ active, btnProps, onClick }">
|
|
@@ -30,84 +30,66 @@
|
|
|
30
30
|
</div>
|
|
31
31
|
</template>
|
|
32
32
|
|
|
33
|
-
<script>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
unelevated: {
|
|
58
|
-
type: Boolean
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
useHeader: {
|
|
62
|
-
type: Boolean
|
|
63
|
-
}
|
|
33
|
+
<script setup>
|
|
34
|
+
import { Spacing } from '../../enums/Spacing'
|
|
35
|
+
|
|
36
|
+
import { ref, computed, useSlots } from 'vue'
|
|
37
|
+
|
|
38
|
+
defineOptions({ name: 'QasCard' })
|
|
39
|
+
|
|
40
|
+
const props = defineProps({
|
|
41
|
+
imagePosition: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'center'
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
gutter: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: Spacing.Sm,
|
|
49
|
+
validator: value => Object.values(Spacing).includes(value)
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
images: {
|
|
53
|
+
default: () => [],
|
|
54
|
+
type: Array
|
|
64
55
|
},
|
|
65
56
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
slideImage: 0
|
|
69
|
-
}
|
|
57
|
+
outlined: {
|
|
58
|
+
type: Boolean
|
|
70
59
|
},
|
|
71
60
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return `bg-position-${this.imagePosition}`
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
cardClasses () {
|
|
78
|
-
return {
|
|
79
|
-
'shadow-2': !this.unelevated,
|
|
80
|
-
'border-primary': this.outlined,
|
|
81
|
-
'no-shadow': this.outlined,
|
|
82
|
-
'bg-white': this.outlined
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
gutterClass () {
|
|
87
|
-
return `q-col-gutter-${this.gutter}`
|
|
88
|
-
},
|
|
89
|
-
|
|
90
|
-
hasActionsSlot () {
|
|
91
|
-
return !!this.$slots.actions
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
hasImages () {
|
|
95
|
-
return this.images.length > 1
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
imagesLength () {
|
|
99
|
-
return this.images?.length
|
|
100
|
-
},
|
|
101
|
-
|
|
102
|
-
imagesList () {
|
|
103
|
-
return this.imagesLength && this.images.slice(0, 3)
|
|
104
|
-
}
|
|
61
|
+
unelevated: {
|
|
62
|
+
type: Boolean
|
|
105
63
|
},
|
|
106
64
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return active ? 'sym_r_radio_button_checked' : icon
|
|
110
|
-
}
|
|
65
|
+
useHeader: {
|
|
66
|
+
type: Boolean
|
|
111
67
|
}
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const slots = useSlots()
|
|
71
|
+
|
|
72
|
+
const slideImage = ref(0)
|
|
73
|
+
|
|
74
|
+
const cardClasses = computed(() => {
|
|
75
|
+
return {
|
|
76
|
+
'shadow-2': !props.unelevated,
|
|
77
|
+
'border-primary': props.outlined,
|
|
78
|
+
'no-shadow': props.outlined,
|
|
79
|
+
'bg-white': props.outlined
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
const imagePositionClass = computed(() => `bg-position-${props.imagePosition}`)
|
|
84
|
+
const gutterClass = computed(() => `q-col-gutter-${props.gutter}`)
|
|
85
|
+
|
|
86
|
+
const hasActionsSlot = computed(() => !!slots.actions)
|
|
87
|
+
const hasImages = computed(() => props.images.length > 1)
|
|
88
|
+
|
|
89
|
+
const imagesLength = computed(() => props.images?.length)
|
|
90
|
+
const imagesList = computed(() => imagesLength.value && props.images.slice(0, 3))
|
|
91
|
+
|
|
92
|
+
function getNavigationIcon (active, { icon }) {
|
|
93
|
+
return active ? 'sym_r_radio_button_checked' : icon
|
|
112
94
|
}
|
|
113
95
|
</script>
|