@bildvitta/quasar-ui-asteroid 3.5.0-beta.9 → 3.6.0-beta.0
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/QasActions.vue +32 -6
- package/src/components/actions/QasActions.yml +11 -1
- package/src/components/actions-menu/QasActionsMenu.vue +28 -11
- package/src/components/actions-menu/QasActionsMenu.yml +13 -4
- package/src/components/alert/QasAlert.vue +1 -1
- package/src/components/app-bar/QasAppBar.vue +7 -3
- package/src/components/app-menu/QasAppMenu.vue +55 -10
- package/src/components/app-user/QasAppUser.vue +8 -4
- package/src/components/avatar/QasAvatar.vue +1 -1
- package/src/components/avatar/QasAvatar.yml +1 -1
- package/src/components/badge/QasBadge.vue +34 -0
- package/src/components/badge/QasBadge.yml +28 -0
- package/src/components/card/QasCard.vue +2 -2
- package/src/components/copy/QasCopy.vue +1 -1
- package/src/components/copy/QasCopy.yml +1 -1
- package/src/components/date-time-input/QasDateTimeInput.vue +92 -10
- package/src/components/delete/QasDelete.vue +0 -1
- package/src/components/dialog/QasDialog.vue +56 -28
- package/src/components/dialog/QasDialog.yml +0 -9
- package/src/components/filters/QasFilters.vue +82 -67
- package/src/components/form-view/QasFormView.vue +0 -1
- package/src/components/gallery/QasGallery.vue +3 -3
- package/src/components/gallery/private/PvGalleryCarouselDialog.vue +3 -3
- package/src/components/header-actions/QasHeaderActions.vue +62 -0
- package/src/components/header-actions/QasHeaderActions.yml +26 -0
- package/src/components/list-items/QasListItems.vue +1 -1
- package/src/components/list-items/QasListItems.yml +1 -1
- package/src/components/nested-fields/QasNestedFields.vue +4 -4
- package/src/components/nested-fields/QasNestedFields.yml +2 -2
- package/src/components/numeric-input/QasNumericInput.vue +9 -0
- package/src/components/page-header/QasPageHeader.vue +92 -17
- package/src/components/page-header/QasPageHeader.yml +19 -1
- package/src/components/pagination/QasPagination.vue +12 -1
- package/src/components/password-input/QasPasswordInput.vue +1 -1
- package/src/components/search-box/QasSearchBox.vue +3 -4
- package/src/components/search-box/QasSearchBox.yml +1 -1
- package/src/components/select/QasSelect.vue +6 -6
- package/src/components/select/QasSelect.yml +1 -1
- package/src/components/select-list/QasSelectList.vue +1 -1
- package/src/components/signature-pad/QasSignaturePad.vue +1 -1
- package/src/components/signature-uploader/QasSignatureUploader.vue +7 -8
- package/src/components/single-view/QasSingleView.vue +1 -1
- package/src/components/status/QasStatus.vue +32 -0
- package/src/components/status/QasStatus.yml +10 -0
- package/src/components/table-generator/QasTableGenerator.vue +29 -4
- package/src/components/tabs-generator/QasTabsGenerator.vue +140 -37
- package/src/components/tabs-generator/QasTabsGenerator.yml +4 -24
- package/src/components/text-truncate/QasTextTruncate.vue +24 -10
- package/src/components/transfer/QasTransfer.vue +2 -2
- package/src/components/tree-generator/QasTreeGenerator.vue +4 -5
- package/src/components/uploader/QasUploader.vue +8 -8
- package/src/components/welcome/QasWelcome.vue +108 -0
- package/src/components/welcome/QasWelcome.yml +14 -0
- package/src/components/welcome/private/PvWelcomeShortcutCard.vue +58 -0
- package/src/css/components/base.scss +8 -0
- package/src/css/components/item.scss +8 -3
- package/src/css/mixins/index.scss +1 -0
- package/src/css/mixins/set-typography.scss +8 -0
- package/src/css/variables/index.scss +1 -0
- package/src/css/variables/shadow.scss +3 -0
- package/src/css/variables/spacing.scss +15 -0
- package/src/css/variables/typography.scss +12 -12
- package/src/index.scss +1 -1
- package/src/mixins/delete.js +0 -1
- package/src/plugins/notify-error/NotifyError.js +1 -1
- package/src/plugins/notify-success/NotifySuccess.js +1 -1
- package/src/shared/date-config.js +26 -0
- package/src/vue-plugin.js +12 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<qas-input ref="input" v-bind="attributes" v-model="currentValue" :unmasked-value="false" @update:model-value="updateModelValue">
|
|
2
|
+
<qas-input ref="input" v-bind="attributes" v-model="currentValue" :unmasked-value="false" @blur="validateDateTimeOnBlur" @focus="resetError" @update:model-value="updateModelValue">
|
|
3
3
|
<template #append>
|
|
4
|
-
<
|
|
4
|
+
<qas-btn v-if="!useTimeOnly" color="grey-9" dense :disable="$attrs.readonly" flat icon="sym_r_event" rounded>
|
|
5
5
|
<q-popup-proxy ref="dateProxy" transition-hide="scale" transition-show="scale">
|
|
6
|
-
<q-date v-model="currentValue" v-bind="
|
|
6
|
+
<q-date v-model="currentValue" v-bind="defaultDateProps" :mask="maskDate" @update:model-value="updateModelValue" />
|
|
7
7
|
</q-popup-proxy>
|
|
8
|
-
</
|
|
8
|
+
</qas-btn>
|
|
9
9
|
|
|
10
|
-
<
|
|
10
|
+
<qas-btn v-if="!useDateOnly" class="q-ml-sm" color="grey-9" dense :disable="$attrs.readonly" flat icon="sym_r_access_time" rounded>
|
|
11
11
|
<q-popup-proxy ref="timeProxy" transition-hide="scale" transition-show="scale">
|
|
12
|
-
<q-time v-model="currentValue" v-bind="
|
|
12
|
+
<q-time v-model="currentValue" v-bind="defaultTimeProps" format24h :mask="maskDate" @update:model-value="updateModelValue" />
|
|
13
13
|
</q-popup-proxy>
|
|
14
|
-
</
|
|
14
|
+
</qas-btn>
|
|
15
15
|
</template>
|
|
16
16
|
</qas-input>
|
|
17
17
|
</template>
|
|
@@ -69,6 +69,9 @@ export default {
|
|
|
69
69
|
data () {
|
|
70
70
|
return {
|
|
71
71
|
currentValue: '',
|
|
72
|
+
error: false,
|
|
73
|
+
errorMessage: '',
|
|
74
|
+
hasInvalidDate: false,
|
|
72
75
|
lastValue: ''
|
|
73
76
|
}
|
|
74
77
|
},
|
|
@@ -78,11 +81,34 @@ export default {
|
|
|
78
81
|
const { modelValue, ...attributes } = this.$attrs
|
|
79
82
|
|
|
80
83
|
return {
|
|
84
|
+
error: this.error,
|
|
85
|
+
errorMessage: this.errorMessage,
|
|
81
86
|
...attributes,
|
|
82
87
|
mask: this.mask
|
|
83
88
|
}
|
|
84
89
|
},
|
|
85
90
|
|
|
91
|
+
defaultDateProps () {
|
|
92
|
+
return {
|
|
93
|
+
...this.defaultDateTimeProps,
|
|
94
|
+
...this.dateProps
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
defaultTimeProps () {
|
|
99
|
+
return {
|
|
100
|
+
...this.defaultDateTimeProps,
|
|
101
|
+
...this.timeProps
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
defaultDateTimeProps () {
|
|
106
|
+
return {
|
|
107
|
+
readonly: this.$attrs.readonly,
|
|
108
|
+
disable: this.$attrs.disable
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
|
|
86
112
|
inputElement () {
|
|
87
113
|
return this.$refs.input
|
|
88
114
|
},
|
|
@@ -131,6 +157,16 @@ export default {
|
|
|
131
157
|
this.currentValue = value
|
|
132
158
|
const valueLength = value?.replace?.(/_/g, '')?.length
|
|
133
159
|
|
|
160
|
+
this.error = this.validateDateAndTime(value)
|
|
161
|
+
|
|
162
|
+
if (this.error) {
|
|
163
|
+
this.hasInvalidDate = true
|
|
164
|
+
this.errorMessage = 'Data inválida.'
|
|
165
|
+
return
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
this.hasInvalidDate = false
|
|
169
|
+
|
|
134
170
|
if (value === '' || valueLength === this.mask.length) {
|
|
135
171
|
this.lastValue = this.useTimeOnly ? value : this.toISOString(value)
|
|
136
172
|
this.$emit('update:modelValue', this.lastValue)
|
|
@@ -146,9 +182,7 @@ export default {
|
|
|
146
182
|
},
|
|
147
183
|
|
|
148
184
|
toISOString (value) {
|
|
149
|
-
if (!value)
|
|
150
|
-
return ''
|
|
151
|
-
}
|
|
185
|
+
if (!value) return ''
|
|
152
186
|
|
|
153
187
|
if (this.useDateOnly && !this.useIso) {
|
|
154
188
|
return dateFn(date.extractDate(value, this.maskDate), 'yyyy-MM-dd')
|
|
@@ -172,6 +206,54 @@ export default {
|
|
|
172
206
|
this.useDateOnly ? newDate.slice(0, 23) : newDate,
|
|
173
207
|
this.maskDate
|
|
174
208
|
)
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
validateDateTimeOnBlur () {
|
|
212
|
+
const valueLength = this.currentValue?.replace?.(/_/g, '')?.length
|
|
213
|
+
|
|
214
|
+
// valida se o tamanho digitado é o tamanho que a mascara espera receber
|
|
215
|
+
this.error = !!((valueLength < this.mask.length || this.error) && valueLength)
|
|
216
|
+
|
|
217
|
+
if (this.error && !this.hasInvalidDate) {
|
|
218
|
+
this.errorMessage = 'Data incompleta.'
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (this.hasInvalidDate) {
|
|
222
|
+
this.currentValue = ''
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (this.error || this.hasInvalidDate) {
|
|
226
|
+
this.$emit('update:modelValue', '')
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
|
|
230
|
+
validateDateAndTime (value) {
|
|
231
|
+
if (!value) return false
|
|
232
|
+
|
|
233
|
+
if (this.useDateOnly) return this.validateDateOnly(value)
|
|
234
|
+
if (this.useTimeOnly) return this.validateTimeOnly(value)
|
|
235
|
+
|
|
236
|
+
const [date, time] = value?.split(' ')
|
|
237
|
+
|
|
238
|
+
return this.validateDateOnly(date) || this.validateTimeOnly(time)
|
|
239
|
+
},
|
|
240
|
+
|
|
241
|
+
validateDateOnly (value = '') {
|
|
242
|
+
const [day, month] = value.split('/')
|
|
243
|
+
|
|
244
|
+
return day > 31 || month > 12
|
|
245
|
+
},
|
|
246
|
+
|
|
247
|
+
validateTimeOnly (value = '') {
|
|
248
|
+
const [hour, minute] = value.split(':')
|
|
249
|
+
|
|
250
|
+
return hour > 23 || minute > 59
|
|
251
|
+
},
|
|
252
|
+
|
|
253
|
+
resetError () {
|
|
254
|
+
if (!this.currentValue) {
|
|
255
|
+
this.error = false
|
|
256
|
+
}
|
|
175
257
|
}
|
|
176
258
|
}
|
|
177
259
|
}
|
|
@@ -1,37 +1,38 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<q-dialog ref="dialog" :persistent="persistent" v-bind="dialogProps" @update:model-value="updateModelValue">
|
|
3
|
-
<
|
|
4
|
-
<q-
|
|
2
|
+
<q-dialog ref="dialog" class="qas-dialog" :persistent="persistent" v-bind="dialogProps" @update:model-value="updateModelValue">
|
|
3
|
+
<div class="bg-white q-pa-lg" :style="style">
|
|
4
|
+
<header v-if="hasHeader" class="q-mb-lg">
|
|
5
5
|
<slot name="header">
|
|
6
|
-
<div class="justify-between row">
|
|
7
|
-
<
|
|
8
|
-
|
|
6
|
+
<div class="items-center justify-between row">
|
|
7
|
+
<h5 class="text-grey-9 text-h5">{{ card.title }}</h5>
|
|
8
|
+
|
|
9
|
+
<qas-btn v-if="isInfoDialog" v-close-popup color="grey-9" dense flat icon="sym_r_close" rounded />
|
|
9
10
|
</div>
|
|
10
11
|
</slot>
|
|
11
|
-
</
|
|
12
|
+
</header>
|
|
12
13
|
|
|
13
|
-
<
|
|
14
|
+
<section class="text-body1 text-grey-8">
|
|
14
15
|
<component :is="componentTag" ref="form">
|
|
15
16
|
<slot name="description">
|
|
16
17
|
<div v-if="card.description">{{ card.description }}</div>
|
|
17
18
|
</slot>
|
|
18
19
|
</component>
|
|
19
|
-
</
|
|
20
|
+
</section>
|
|
20
21
|
|
|
21
|
-
<q-
|
|
22
|
+
<footer v-if="!isInfoDialog" class="q-mt-xl">
|
|
22
23
|
<slot name="actions">
|
|
23
|
-
<qas-actions v-bind="actionsProps">
|
|
24
|
-
<template #primary>
|
|
25
|
-
<qas-btn v-
|
|
24
|
+
<qas-actions v-bind="actionsProps" :use-equal-width="hasAllActions" :use-full-width="hasSingleAction">
|
|
25
|
+
<template v-if="hasOk" #primary>
|
|
26
|
+
<qas-btn v-close-popup="!useForm" class="full-width" v-bind="defaultOk" @click="submitHandler" />
|
|
26
27
|
</template>
|
|
27
28
|
|
|
28
|
-
<template #secondary>
|
|
29
|
-
<qas-btn v-
|
|
29
|
+
<template v-if="hasCancel" #secondary>
|
|
30
|
+
<qas-btn v-close-popup class="full-width" v-bind="defaultCancel" />
|
|
30
31
|
</template>
|
|
31
32
|
</qas-actions>
|
|
32
33
|
</slot>
|
|
33
|
-
</
|
|
34
|
-
</
|
|
34
|
+
</footer>
|
|
35
|
+
</div>
|
|
35
36
|
</q-dialog>
|
|
36
37
|
</template>
|
|
37
38
|
|
|
@@ -63,11 +64,6 @@ export default {
|
|
|
63
64
|
type: Object
|
|
64
65
|
},
|
|
65
66
|
|
|
66
|
-
cardProps: {
|
|
67
|
-
default: () => ({}),
|
|
68
|
-
type: Object
|
|
69
|
-
},
|
|
70
|
-
|
|
71
67
|
maxWidth: {
|
|
72
68
|
default: '',
|
|
73
69
|
type: String
|
|
@@ -100,10 +96,6 @@ export default {
|
|
|
100
96
|
type: Boolean
|
|
101
97
|
},
|
|
102
98
|
|
|
103
|
-
useCloseButton: {
|
|
104
|
-
type: Boolean
|
|
105
|
-
},
|
|
106
|
-
|
|
107
99
|
useFullMaxWidth: {
|
|
108
100
|
type: Boolean
|
|
109
101
|
},
|
|
@@ -138,8 +130,8 @@ export default {
|
|
|
138
130
|
style () {
|
|
139
131
|
return {
|
|
140
132
|
...(this.useFullMaxWidth && { width: '100%' }),
|
|
141
|
-
maxWidth: this.maxWidth ||
|
|
142
|
-
minWidth: this.minWidth || (this.$qas.screen.isSmall ? '' : '
|
|
133
|
+
maxWidth: this.maxWidth || '470px',
|
|
134
|
+
minWidth: this.minWidth || (this.$qas.screen.isSmall ? '' : '366px')
|
|
143
135
|
}
|
|
144
136
|
},
|
|
145
137
|
|
|
@@ -152,6 +144,34 @@ export default {
|
|
|
152
144
|
...(!this.usePlugin && { modelValue: this.modelValue }),
|
|
153
145
|
...this.$attrs
|
|
154
146
|
}
|
|
147
|
+
},
|
|
148
|
+
|
|
149
|
+
hasOk () {
|
|
150
|
+
return typeof this.ok === 'boolean' ? this.ok : !!Object.keys(this.ok)
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
hasCancel () {
|
|
154
|
+
return typeof this.cancel === 'boolean' ? this.cancel : !!Object.keys(this.cancel)
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
hasAllActions () {
|
|
158
|
+
return this.hasOk && this.hasCancel
|
|
159
|
+
},
|
|
160
|
+
|
|
161
|
+
hasSingleAction () {
|
|
162
|
+
return (this.hasOk && !this.hasCancel) || (!this.hasOk && this.hasCancel)
|
|
163
|
+
},
|
|
164
|
+
|
|
165
|
+
hasHeaderSlot () {
|
|
166
|
+
return !!this.$slots.header
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
hasHeader () {
|
|
170
|
+
return this.hasHeaderSlot || this.card.title
|
|
171
|
+
},
|
|
172
|
+
|
|
173
|
+
isInfoDialog () {
|
|
174
|
+
return !this.hasOk && !this.hasCancel
|
|
155
175
|
}
|
|
156
176
|
},
|
|
157
177
|
|
|
@@ -195,3 +215,11 @@ export default {
|
|
|
195
215
|
}
|
|
196
216
|
}
|
|
197
217
|
</script>
|
|
218
|
+
|
|
219
|
+
<style lang="scss">
|
|
220
|
+
.qas-dialog {
|
|
221
|
+
.q-dialog__inner > div {
|
|
222
|
+
box-shadow: $shadow-2;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
</style>
|
|
@@ -15,11 +15,6 @@ props:
|
|
|
15
15
|
type: [Object, Boolean]
|
|
16
16
|
examples: ["{ label: 'Meu botão de cancelar', onClick: () => alert('fui clicado!') }"]
|
|
17
17
|
|
|
18
|
-
card-props:
|
|
19
|
-
desc: Props repassadas para o componente "<q-card />".
|
|
20
|
-
default: {}
|
|
21
|
-
type: Object
|
|
22
|
-
|
|
23
18
|
card:
|
|
24
19
|
desc: Objeto contendo as informações para serem exibidas dentro do dialog como "title" e "description".
|
|
25
20
|
default: {}
|
|
@@ -52,10 +47,6 @@ props:
|
|
|
52
47
|
default: true
|
|
53
48
|
type: Boolean
|
|
54
49
|
|
|
55
|
-
use-close-button:
|
|
56
|
-
desc: Define se vai ter ou não Ícone de fechar o dialog.
|
|
57
|
-
type: Boolean
|
|
58
|
-
|
|
59
50
|
use-form:
|
|
60
51
|
desc: Define se a tag onde fica a descrição no dialog vai ser um "<q-form />" ou "<div />".
|
|
61
52
|
type: Boolean
|
|
@@ -4,44 +4,46 @@
|
|
|
4
4
|
<div v-if="showSearch" class="col-12 col-md-6">
|
|
5
5
|
<slot :filter="filter" name="search">
|
|
6
6
|
<q-form v-if="useSearch" @submit.prevent="filter()">
|
|
7
|
-
<
|
|
8
|
-
<
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
<div v-else-if="hasFetchError" class="q-pa-xl text-center">
|
|
23
|
-
<q-icon color="negative" name="o_warning" size="2em" />
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<q-form v-else class="q-gutter-y-md q-pa-md" @submit.prevent="filter()">
|
|
27
|
-
<div v-for="(field, index) in fields" :key="index">
|
|
28
|
-
<qas-field v-model="filters[field.name]" :data-cy="`filters-${field.name}-field`" :field="field" v-bind="fieldsProps[field.name]" />
|
|
7
|
+
<div class="qas-filters__input-content">
|
|
8
|
+
<qas-input v-model="search" class="bg-white q-px-sm rounded-borders-sm shadow-2" data-cy="filters-search-input" :debounce="debounce" dense hide-bottom-space input-class="ellipsis text-grey-8" :outlined="false" :placeholder="searchPlaceholder" type="search">
|
|
9
|
+
<template #prepend>
|
|
10
|
+
<q-icon v-if="useSearchOnType" color="grey-8" name="sym_r_search" />
|
|
11
|
+
<qas-btn v-else color="grey-9" flat icon="sym_r_search" padding="0" @click="filter()" />
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<template #append>
|
|
15
|
+
<qas-btn v-if="hasSearch" class="q-mr-sm" color="grey-9" flat icon="sym_r_clear" padding="0" size="sm" @click="clearSearch" />
|
|
16
|
+
|
|
17
|
+
<qas-btn v-if="useFilterButton" :color="filterButtonColor" data-cy="filters-btn" flat icon="sym_r_tune" padding="0">
|
|
18
|
+
<q-menu anchor="center right" class="full-width" max-width="270px" self="top right">
|
|
19
|
+
<div v-if="isFetching" class="q-pa-xl text-center">
|
|
20
|
+
<q-spinner color="grey" size="2em" />
|
|
29
21
|
</div>
|
|
30
22
|
|
|
31
|
-
<div class="q-
|
|
32
|
-
<
|
|
33
|
-
|
|
23
|
+
<div v-else-if="hasFetchError" class="q-pa-xl text-center">
|
|
24
|
+
<q-icon color="negative" name="sym_r_warning" size="2em" />
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<q-form v-else class="q-gutter-y-md q-pa-md" @submit.prevent="filter()">
|
|
28
|
+
<div v-for="(field, index) in fields" :key="index">
|
|
29
|
+
<qas-field v-model="filters[field.name]" :data-cy="`filters-${field.name}-field`" :field="field" v-bind="fieldsProps[field.name]" />
|
|
34
30
|
</div>
|
|
35
31
|
|
|
36
|
-
<div class="col-
|
|
37
|
-
<
|
|
32
|
+
<div class="q-col-gutter-x-md q-mt-xl row">
|
|
33
|
+
<div class="col-6">
|
|
34
|
+
<qas-btn class="full-width" data-cy="filters-clear-btn" label="Limpar" outline size="12px" @click="clearFilters" />
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div class="col-6">
|
|
38
|
+
<qas-btn class="full-width" color="primary" data-cy="filters-submit-btn" label="Filtrar" size="12px" type="submit" />
|
|
39
|
+
</div>
|
|
38
40
|
</div>
|
|
39
|
-
</
|
|
40
|
-
</q-
|
|
41
|
-
</
|
|
42
|
-
</
|
|
43
|
-
</
|
|
44
|
-
</
|
|
41
|
+
</q-form>
|
|
42
|
+
</q-menu>
|
|
43
|
+
</qas-btn>
|
|
44
|
+
</template>
|
|
45
|
+
</qas-input>
|
|
46
|
+
</div>
|
|
45
47
|
</q-form>
|
|
46
48
|
</slot>
|
|
47
49
|
</div>
|
|
@@ -53,7 +55,7 @@
|
|
|
53
55
|
|
|
54
56
|
<div v-if="hasChip" class="q-mt-md">
|
|
55
57
|
<!-- TODO rever com novo estilo -->
|
|
56
|
-
<q-chip v-for="(filterItem, key) in activeFilters" :key="key" color="white" :data-cy="`filters-${filterItem.value}-chip`" dense icon-remove="
|
|
58
|
+
<q-chip v-for="(filterItem, key) in activeFilters" :key="key" color="white" :data-cy="`filters-${filterItem.value}-chip`" dense icon-remove="sym_r_close" removable size="md" text-color="grey-8" @remove="removeFilter(filterItem)">{{ getChipValue(filterItem.value) }}</q-chip>
|
|
57
59
|
</div>
|
|
58
60
|
|
|
59
61
|
<slot :context="mx_context" :filter="filter" :filters="activeFilters" :remove-filter="removeFilter" />
|
|
@@ -162,7 +164,7 @@ export default {
|
|
|
162
164
|
},
|
|
163
165
|
|
|
164
166
|
debounce () {
|
|
165
|
-
return this.useSearchOnType ? '
|
|
167
|
+
return this.useSearchOnType ? '1200' : ''
|
|
166
168
|
},
|
|
167
169
|
|
|
168
170
|
fields () {
|
|
@@ -225,6 +227,7 @@ export default {
|
|
|
225
227
|
created () {
|
|
226
228
|
this.fetchFilters()
|
|
227
229
|
this.watchOnceFields()
|
|
230
|
+
this.handleSearchModelOnCreate()
|
|
228
231
|
},
|
|
229
232
|
|
|
230
233
|
methods: {
|
|
@@ -322,8 +325,9 @@ export default {
|
|
|
322
325
|
},
|
|
323
326
|
|
|
324
327
|
updateValues () {
|
|
325
|
-
|
|
326
|
-
|
|
328
|
+
this.setSearch()
|
|
329
|
+
|
|
330
|
+
const { filters } = this.mx_context
|
|
327
331
|
|
|
328
332
|
for (const key in filters) {
|
|
329
333
|
this.filters[key] = parseValue(this.normalizeValues(filters[key], this.fields[key]?.multiple))
|
|
@@ -343,6 +347,15 @@ export default {
|
|
|
343
347
|
watchOnce()
|
|
344
348
|
}
|
|
345
349
|
})
|
|
350
|
+
},
|
|
351
|
+
|
|
352
|
+
handleSearchModelOnCreate () {
|
|
353
|
+
!this.useFilterButton && this.setSearch()
|
|
354
|
+
},
|
|
355
|
+
|
|
356
|
+
setSearch () {
|
|
357
|
+
const { search } = this.mx_context
|
|
358
|
+
this.search = search || ''
|
|
346
359
|
}
|
|
347
360
|
}
|
|
348
361
|
}
|
|
@@ -351,41 +364,43 @@ export default {
|
|
|
351
364
|
<style lang="scss">
|
|
352
365
|
// TODO rever
|
|
353
366
|
.qas-filters {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
367
|
+
&__input-content {
|
|
368
|
+
.q-field {
|
|
369
|
+
&::before {
|
|
370
|
+
border: 2px solid transparent;
|
|
371
|
+
border-radius: var(--qas-generic-border-radius);
|
|
372
|
+
bottom: 0;
|
|
373
|
+
content: '';
|
|
374
|
+
left: 0;
|
|
375
|
+
pointer-events: none;
|
|
376
|
+
position: absolute;
|
|
377
|
+
right: 0;
|
|
378
|
+
top: 0;
|
|
379
|
+
transition: border-color var(--qas-generic-transition);
|
|
380
|
+
}
|
|
366
381
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
}
|
|
382
|
+
&--dense .q-field__prepend {
|
|
383
|
+
padding-right: var(--qas-spacing-xs);
|
|
384
|
+
}
|
|
371
385
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
386
|
+
&--dense .q-field__append {
|
|
387
|
+
padding-left: var(--qas-spacing-sm);
|
|
388
|
+
}
|
|
375
389
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
390
|
+
&--focused::before {
|
|
391
|
+
border-color: var(--q-primary);
|
|
392
|
+
color: var(--q-primary);
|
|
393
|
+
}
|
|
379
394
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
}
|
|
395
|
+
&__control::after,
|
|
396
|
+
&__control::before {
|
|
397
|
+
display: none !important;
|
|
398
|
+
}
|
|
385
399
|
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
400
|
+
&__native {
|
|
401
|
+
padding-bottom: var(--qas-spacing-sm);
|
|
402
|
+
padding-top: var(--qas-spacing-sm);
|
|
403
|
+
}
|
|
389
404
|
}
|
|
390
405
|
}
|
|
391
406
|
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<div v-if="useDestroy">
|
|
15
15
|
<slot :destroy="onDestroy" :image="image" :index="index" name="destroy">
|
|
16
16
|
<qas-btn color="grey-9" dense :disabled="isDestroyDisabled(image)" flat round size="sm" @click="onDestroy(image, index)">
|
|
17
|
-
<q-icon name="
|
|
17
|
+
<q-icon name="sym_r_delete" size="xs" />
|
|
18
18
|
</qas-btn>
|
|
19
19
|
</slot>
|
|
20
20
|
</div>
|
|
@@ -58,12 +58,12 @@ export default {
|
|
|
58
58
|
props: {
|
|
59
59
|
carouselNextIcon: {
|
|
60
60
|
type: String,
|
|
61
|
-
default: '
|
|
61
|
+
default: 'sym_r_chevron_right'
|
|
62
62
|
},
|
|
63
63
|
|
|
64
64
|
carouselPreviousIcon: {
|
|
65
65
|
type: String,
|
|
66
|
-
default: '
|
|
66
|
+
default: 'sym_r_chevron_left'
|
|
67
67
|
},
|
|
68
68
|
|
|
69
69
|
initialSize: {
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
<qas-dialog v-model="model" :cancel="false" class="q-pa-xl" max-width="1100px" :ok="false" :persistent="false" use-full-max-width>
|
|
3
3
|
<template #header>
|
|
4
4
|
<div class="text-right">
|
|
5
|
-
<qas-btn v-close-popup dense flat icon="
|
|
5
|
+
<qas-btn v-close-popup dense flat icon="sym_r_close" rounded @click="close" />
|
|
6
6
|
</div>
|
|
7
7
|
</template>
|
|
8
8
|
|
|
9
9
|
<template #description>
|
|
10
|
-
<q-carousel v-model="imageIndexModel" animated :arrows="!$qas.screen.isSmall" control-text-color="primary" data-cy="gallery-carousel" :fullscreen="$qas.screen.isSmall" :height="carouselImageHeight" next-icon="
|
|
10
|
+
<q-carousel v-model="imageIndexModel" animated :arrows="!$qas.screen.isSmall" control-text-color="primary" data-cy="gallery-carousel" :fullscreen="$qas.screen.isSmall" :height="carouselImageHeight" next-icon="sym_r_chevron_right" prev-icon="sym_r_chevron_left" swipeable :thumbnails="!isSingleImage">
|
|
11
11
|
<q-carousel-slide v-for="(image, index) in images" :key="index" class="bg-no-repeat bg-size-contain" :data-cy="`gallery-carousel-slide-${index}`" :img-src="image.url" :name="index">
|
|
12
12
|
<div v-if="$qas.screen.isSmall" class="full-width justify-end row">
|
|
13
|
-
<qas-btn dense flat icon="
|
|
13
|
+
<qas-btn dense flat icon="sym_r_close" @click="close" />
|
|
14
14
|
</div>
|
|
15
15
|
</q-carousel-slide>
|
|
16
16
|
</q-carousel>
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="items-center justify-between no-wrap q-col-gutter-x-md q-mb-xl row text-body1 text-grey-8">
|
|
3
|
+
<div :class="leftClass">
|
|
4
|
+
<slot name="left">
|
|
5
|
+
{{ text }}
|
|
6
|
+
</slot>
|
|
7
|
+
</div>
|
|
8
|
+
|
|
9
|
+
<div v-if="hasRightSide" class="col-3 col-md-3 col-sm-4 justify-end row">
|
|
10
|
+
<slot name="right">
|
|
11
|
+
<qas-actions-menu v-if="hasDefaultActionsMenu" v-bind="actionsMenuProps" />
|
|
12
|
+
|
|
13
|
+
<qas-btn v-if="hasDefaultButton" :use-label-on-small-screen="false" v-bind="buttonProps" />
|
|
14
|
+
</slot>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
export default {
|
|
21
|
+
name: 'QasHeaderActions',
|
|
22
|
+
|
|
23
|
+
props: {
|
|
24
|
+
actionsMenuProps: {
|
|
25
|
+
type: Object,
|
|
26
|
+
default: () => ({})
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
buttonProps: {
|
|
30
|
+
default: () => ({}),
|
|
31
|
+
type: Object
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
text: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: ''
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
computed: {
|
|
41
|
+
hasDefaultButton () {
|
|
42
|
+
return !!Object.keys(this.buttonProps).length
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
hasDefaultActionsMenu () {
|
|
46
|
+
return !!Object.keys(this.actionsMenuProps).length
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
hasRightSlot () {
|
|
50
|
+
return !!this.$slots.right
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
hasRightSide () {
|
|
54
|
+
return this.hasRightSlot || this.hasDefaultActionsMenu || this.hasDefaultButton
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
leftClass () {
|
|
58
|
+
return this.hasRightSide ? 'col-9 col-md-9 col-sm-8' : 'col-12'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
</script>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
type: component
|
|
2
|
+
|
|
3
|
+
meta:
|
|
4
|
+
desc: Componente para cabeçalho usado com alguma descrição e ação.
|
|
5
|
+
|
|
6
|
+
props:
|
|
7
|
+
actions-menu-props:
|
|
8
|
+
desc: Propriedades do QasActionsMenu.
|
|
9
|
+
default: {}
|
|
10
|
+
type: Object
|
|
11
|
+
|
|
12
|
+
button-props:
|
|
13
|
+
desc: Propriedades do QasBtn.
|
|
14
|
+
default: {}
|
|
15
|
+
type: Object
|
|
16
|
+
|
|
17
|
+
text:
|
|
18
|
+
desc: Descrição da seção a esquerda.
|
|
19
|
+
type: String
|
|
20
|
+
|
|
21
|
+
slots:
|
|
22
|
+
left:
|
|
23
|
+
desc: slot para acessar seção da esquerda (descrição).
|
|
24
|
+
|
|
25
|
+
right:
|
|
26
|
+
desc: slot para acessar seção da direita (ação).
|