@bildvitta/quasar-ui-asteroid 3.14.0-beta.0 → 3.14.0-beta.2

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.
Files changed (51) hide show
  1. package/package.json +1 -1
  2. package/src/components/actions-menu/QasActionsMenu.vue +16 -14
  3. package/src/components/alert/QasAlert.vue +1 -1
  4. package/src/components/app-bar/QasAppBar.vue +5 -5
  5. package/src/components/app-menu/QasAppMenu.vue +8 -8
  6. package/src/components/app-menu/private/PvAppMenuDropdown.vue +1 -1
  7. package/src/components/app-user/QasAppUser.vue +10 -10
  8. package/src/components/avatar/QasAvatar.vue +2 -2
  9. package/src/components/breakline/QasBreakline.vue +5 -6
  10. package/src/components/btn-dropdown/QasBtnDropdown.vue +74 -95
  11. package/src/components/card/QasCard.vue +55 -73
  12. package/src/components/chart-view/QasChartView.vue +37 -9
  13. package/src/components/chart-view/QasChartView.yml +6 -0
  14. package/src/components/checkbox-group/QasCheckboxGroup.vue +81 -92
  15. package/src/components/copy/QasCopy.vue +20 -27
  16. package/src/components/date/QasDate.vue +316 -355
  17. package/src/components/date/QasDate.yml +0 -5
  18. package/src/components/date/enums/DateMaskOptions.js +6 -0
  19. package/src/components/date-time-input/QasDateTimeInput.vue +198 -209
  20. package/src/components/debugger/QasDebugger.vue +20 -12
  21. package/src/components/delete/QasDelete.vue +70 -80
  22. package/src/components/dialog/QasDialog.vue +7 -7
  23. package/src/components/dialog/composables/use-cancel.js +3 -3
  24. package/src/components/dialog/composables/use-dynamic-components.js +4 -4
  25. package/src/components/dialog/composables/use-ok.js +3 -3
  26. package/src/components/dialog-router/QasDialogRouter.vue +68 -67
  27. package/src/components/empty-result-text/QasEmptyResultText.vue +8 -10
  28. package/src/components/form-generator/QasFormGenerator.vue +2 -2
  29. package/src/components/gallery/QasGallery.vue +175 -196
  30. package/src/components/gallery/composables/use-delete.js +54 -0
  31. package/src/components/gallery/private/PvGalleryCarouselDialog.vue +48 -55
  32. package/src/components/gallery/private/PvGalleryDeleteDialog.vue +41 -50
  33. package/src/components/gallery-card/QasGalleryCard.vue +90 -103
  34. package/src/components/grid-generator/QasGridGenerator.vue +2 -2
  35. package/src/components/header-actions/QasHeaderActions.vue +35 -50
  36. package/src/components/header-actions/QasHeaderActions.yml +1 -1
  37. package/src/components/infinite-scroll/QasInfiniteScroll.vue +2 -2
  38. package/src/components/label/QasLabel.vue +42 -54
  39. package/src/components/list-items/QasListItems.vue +32 -41
  40. package/src/components/map/QasMap.vue +44 -46
  41. package/src/components/numeric-input/QasNumericInput.vue +2 -2
  42. package/src/components/page-header/QasPageHeader.vue +74 -87
  43. package/src/components/pagination/QasPagination.vue +21 -21
  44. package/src/components/select-list-dialog/QasSelectListDialog.vue +4 -2
  45. package/src/components/tabs-generator/QasTabsGenerator.vue +55 -63
  46. package/src/components/timeline/QasTimeline.vue +1 -1
  47. package/src/components/uploader/private/PvUploaderGalleryCard.vue +1 -1
  48. package/src/components/whatsapp-link/QasWhatsappLink.vue +34 -0
  49. package/src/components/whatsapp-link/QasWhatsappLink.yml +18 -0
  50. package/src/composables/private/use-generator.js +0 -8
  51. package/src/vue-plugin.js +7 -1
@@ -1,63 +1,54 @@
1
1
  <template>
2
- <qas-dialog v-bind="mx_defaultDialogProps" />
2
+ <qas-dialog v-bind="defaultDialogProps" />
3
3
  </template>
4
4
 
5
- <script>
6
- import { getAction } from '@bildvitta/store-adapter'
7
-
8
- import QasDialog from '../../dialog/QasDialog.vue'
5
+ <script setup>
9
6
  import { promiseHandler } from '../../../helpers'
10
- import { deleteMixin } from '../../../mixins'
11
-
12
- export default {
13
- name: 'PvGalleryDeleteDialog',
7
+ import useDelete, { baseProps } from '../composables/use-delete'
14
8
 
15
- components: {
16
- QasDialog
17
- },
9
+ import { inject } from 'vue'
18
10
 
19
- mixins: [deleteMixin],
11
+ defineOptions({ name: 'PvGalleryDeleteDialog' })
20
12
 
21
- props: {
22
- payload: {
23
- type: Array,
24
- default: () => []
25
- },
13
+ const props = defineProps({
14
+ ...baseProps,
26
15
 
27
- modelKey: {
28
- type: String,
29
- default: ''
30
- }
16
+ payload: {
17
+ type: Array,
18
+ default: () => []
31
19
  },
32
20
 
33
- emits: [
34
- 'success',
35
- 'error',
36
- 'cancel'
37
- ],
38
-
39
- methods: {
40
- // chamado no mixin
41
- async destroy () {
42
- const { data, error } = await promiseHandler(
43
- getAction.call(this, {
44
- entity: this.entity,
45
- key: 'update',
46
- payload: {
47
- id: this.mx_id,
48
- url: this.url,
49
- payload: { [this.modelKey]: this.payload }
50
- }
51
- }),
52
- {
53
- errorMessage: 'Ops! Não foi possível deletar o item.',
54
- successMessage: 'Item deletado com sucesso!'
55
- }
56
- )
57
-
58
- if (data) return this.$emit('success', data)
59
- if (error) return this.$emit('error', error)
60
- }
21
+ modelKey: {
22
+ type: String,
23
+ default: ''
61
24
  }
25
+ })
26
+
27
+ const emit = defineEmits(['success', 'error', 'cancel'])
28
+
29
+ const qas = inject('qas')
30
+
31
+ const { defaultDialogProps, id } = useDelete({ props, emit, destroyFn: destroy })
32
+
33
+ async function destroy () {
34
+ const { data, error } = await promiseHandler(
35
+ qas.getAction({
36
+ entity: props.entity,
37
+ key: 'update',
38
+ payload: {
39
+ id: id.value,
40
+ url: props.url,
41
+ payload: { [props.modelKey]: props.payload }
42
+ }
43
+ }),
44
+ {
45
+ errorMessage: 'Ops! Não foi possível deletar o item.',
46
+ successMessage: 'Item deletado com sucesso!'
47
+ }
48
+ )
49
+
50
+ if (data) return emit('success', data)
51
+
52
+ if (error) emit('error', error)
62
53
  }
63
54
  </script>
@@ -3,8 +3,8 @@
3
3
  <header class="flat items-center no-wrap row" :class="headerClasses">
4
4
  <slot name="header">
5
5
  <div class="ellipsis q-mr-xs qas-gallery__name text-subtitle1">
6
- <slot v-if="card.name" name="name">
7
- {{ card.name }}
6
+ <slot v-if="props.card.name" name="name">
7
+ {{ props.card.name }}
8
8
  </slot>
9
9
  </div>
10
10
 
@@ -18,19 +18,19 @@
18
18
 
19
19
  <div class="qas-gallery-card__image">
20
20
  <slot name="image">
21
- <q-img class="rounded-borders" height="100%" :src="card.url" v-bind="imageProps">
21
+ <q-img class="rounded-borders" height="100%" :src="props.card.url" v-bind="props.imageProps">
22
22
  <template #error>
23
23
  <div :class="errorClasses">
24
24
  <div class="text-center">
25
25
  <slot name="image-error-icon">
26
- <div v-if="errorIcon">
27
- <q-icon :name="errorIcon" size="sm" />
26
+ <div v-if="props.errorIcon">
27
+ <q-icon :name="props.errorIcon" size="sm" />
28
28
  </div>
29
29
  </slot>
30
30
 
31
31
  <slot name="image-error">
32
32
  <div>
33
- {{ errorMessage }}
33
+ {{ props.errorMessage }}
34
34
  </div>
35
35
  </slot>
36
36
  </div>
@@ -42,112 +42,99 @@
42
42
 
43
43
  <div v-if="hasBottom" class="q-mt-md">
44
44
  <slot name="bottom">
45
- <qas-grid-generator v-if="hasGridGenerator" v-bind="gridGeneratorProps" />
45
+ <qas-grid-generator v-if="hasGridGenerator" v-bind="props.gridGeneratorProps" />
46
46
  </slot>
47
47
  </div>
48
48
  </div>
49
49
  </template>
50
50
 
51
- <script>
52
- export default {
53
- name: 'QasGalleryCard',
54
-
55
- props: {
56
- actionsMenuProps: {
57
- type: Object,
58
- default: () => ({})
59
- },
60
-
61
- card: {
62
- type: Object,
63
- default: () => ({})
64
- },
65
-
66
- disable: {
67
- type: Boolean
68
- },
69
-
70
- errorIcon: {
71
- type: String,
72
- default: ''
73
- },
74
-
75
- errorMessage: {
76
- type: String,
77
- default: ''
78
- },
79
-
80
- gridGeneratorProps: {
81
- type: Object,
82
- default: () => ({})
83
- },
84
-
85
- imageProps: {
86
- type: Object,
87
- default: () => ({})
88
- }
51
+ <script setup>
52
+ import { computed, useSlots } from 'vue'
53
+
54
+ defineOptions({ name: 'QasGalleryCard' })
55
+
56
+ const props = defineProps({
57
+ actionsMenuProps: {
58
+ type: Object,
59
+ default: () => ({})
60
+ },
61
+
62
+ card: {
63
+ type: Object,
64
+ default: () => ({})
65
+ },
66
+
67
+ disable: {
68
+ type: Boolean
69
+ },
70
+
71
+ errorIcon: {
72
+ type: String,
73
+ default: ''
74
+ },
75
+
76
+ errorMessage: {
77
+ type: String,
78
+ default: ''
89
79
  },
90
80
 
91
- computed: {
92
- classes () {
93
- return {
94
- 'text-grey-6': this.disable
95
- }
96
- },
97
-
98
- defaultActionsMenuProps () {
99
- const { buttonProps } = this.actionsMenuProps
100
-
101
- return {
102
- useLabel: false,
103
- ...this.actionsMenuProps,
104
-
105
- buttonProps: {
106
- disable: this.disable,
107
- ...buttonProps
108
- }
109
- }
110
- },
111
-
112
- hasActions () {
113
- return !!Object.keys(this.actionsMenuProps).length || this.hasActionsSlot
114
- },
115
-
116
- hasActionsSlot () {
117
- return !!this.$slots.actions
118
- },
119
-
120
- hasBottom () {
121
- return !!this.$slots.bottom || this.hasGridGenerator
122
- },
123
-
124
- hasGridGenerator () {
125
- return !!Object.keys(this.gridGeneratorProps).length
126
- },
127
-
128
- headerClasses () {
129
- return {
130
- 'justify-between': this.card.name,
131
- 'justify-right': !this.card.name,
132
- 'text-grey-10': !this.disable,
133
- 'q-mb-md': this.hasActions || this.card.name
134
- }
135
- },
136
-
137
- errorClasses () {
138
- return [
139
- 'bg-grey-4',
140
- 'flex',
141
- 'full-height',
142
- 'full-width',
143
- 'items-center',
144
- 'justify-center',
145
- 'text-grey-10',
146
- 'text-subtitle2'
147
- ]
81
+ gridGeneratorProps: {
82
+ type: Object,
83
+ default: () => ({})
84
+ },
85
+
86
+ imageProps: {
87
+ type: Object,
88
+ default: () => ({})
89
+ }
90
+ })
91
+
92
+ const slots = useSlots()
93
+
94
+ const errorClasses = [
95
+ 'bg-grey-4',
96
+ 'flex',
97
+ 'full-height',
98
+ 'full-width',
99
+ 'items-center',
100
+ 'justify-center',
101
+ 'text-grey-10',
102
+ 'text-subtitle2'
103
+ ]
104
+
105
+ const classes = computed(() => {
106
+ return {
107
+ 'text-grey-6': props.disable
108
+ }
109
+ })
110
+
111
+ const headerClasses = computed(() => {
112
+ return {
113
+ 'justify-between': props.card.name,
114
+ 'justify-right': !props.card.name,
115
+ 'text-grey-10': !props.disable,
116
+ 'q-mb-md': hasActions.value || props.card.name
117
+ }
118
+ })
119
+
120
+ const defaultActionsMenuProps = computed(() => {
121
+ const { buttonProps } = props.actionsMenuProps
122
+
123
+ return {
124
+ useLabel: false,
125
+ ...props.actionsMenuProps,
126
+
127
+ buttonProps: {
128
+ disable: props.disable,
129
+ ...buttonProps
148
130
  }
149
131
  }
150
- }
132
+ })
133
+
134
+ const hasActionsSlot = computed(() => !!slots.actions)
135
+ const hasActions = computed(() => !!Object.keys(props.actionsMenuProps).length || hasActionsSlot.value)
136
+ const hasGridGenerator = computed(() => !!Object.keys(props.gridGeneratorProps).length)
137
+ const hasBottom = computed(() => !!slots.bottom || hasGridGenerator.value)
151
138
  </script>
152
139
 
153
140
  <style lang="scss">
@@ -3,13 +3,13 @@
3
3
  <div v-for="(field, key) in fieldsByResult" :key="key" :class="getFieldClass({ index: key, isGridGenerator: true })">
4
4
  <slot :field="field" :name="`field-${field.name}`">
5
5
  <slot :field="field" name="header">
6
- <header :class="headerClass" :data-cy="`grid-generator-${field.name}-field`">
6
+ <header :class="props.headerClass" :data-cy="`grid-generator-${field.name}-field`">
7
7
  {{ field.label }}
8
8
  </header>
9
9
  </slot>
10
10
 
11
11
  <slot :field="field" name="content">
12
- <div :class="contentClass" :data-cy="`grid-generator-${field.name}-result`">
12
+ <div :class="props.contentClass" :data-cy="`grid-generator-${field.name}-result`">
13
13
  {{ field.formattedResult }}
14
14
  </div>
15
15
  </slot>
@@ -2,77 +2,62 @@
2
2
  <div class="justify-between no-wrap q-col-gutter-x-md q-mb-xl row text-body1 text-grey-8" :class="containerClass">
3
3
  <div :class="leftClass">
4
4
  <slot name="left">
5
- {{ text }}
5
+ {{ props.text }}
6
6
  </slot>
7
7
  </div>
8
8
 
9
9
  <div v-if="hasRightSide" class="col-3 col-md-3 col-sm-4 justify-end row">
10
10
  <slot name="right">
11
- <qas-actions-menu v-if="hasDefaultActionsMenu" v-bind="actionsMenuProps" />
11
+ <qas-actions-menu v-if="hasDefaultActionsMenu" v-bind="props.actionsMenuProps" />
12
12
 
13
- <qas-btn v-if="hasDefaultButton" :use-label-on-small-screen="false" v-bind="buttonProps" />
13
+ <qas-btn v-if="hasDefaultButton" :use-label-on-small-screen="false" v-bind="props.buttonProps" />
14
14
  </slot>
15
15
  </div>
16
16
  </div>
17
17
  </template>
18
18
 
19
- <script>
20
- const AlignTypes = {
21
- Start: 'start',
22
- Center: 'center',
23
- End: 'end'
24
- }
19
+ <script setup>
20
+ import { FlexAlign } from '../../enums/Align'
25
21
 
26
- export default {
27
- name: 'QasHeaderActions',
22
+ import { computed, useSlots } from 'vue'
28
23
 
29
- props: {
30
- actionsMenuProps: {
31
- type: Object,
32
- default: () => ({})
33
- },
24
+ defineOptions({ name: 'QasHeaderActions' })
34
25
 
35
- alignColumns: {
36
- default: AlignTypes.Center,
37
- type: String,
38
- validator: value => Object.values(AlignTypes).includes(value)
39
- },
26
+ const props = defineProps({
27
+ actionsMenuProps: {
28
+ type: Object,
29
+ default: () => ({})
30
+ },
40
31
 
41
- buttonProps: {
42
- default: () => ({}),
43
- type: Object
44
- },
32
+ alignColumns: {
33
+ default: FlexAlign.Center,
34
+ type: String,
35
+ validator: value => Object.values(FlexAlign).includes(value)
36
+ },
45
37
 
46
- text: {
47
- type: String,
48
- default: ''
49
- }
38
+ buttonProps: {
39
+ default: () => ({}),
40
+ type: Object
50
41
  },
51
42
 
52
- computed: {
53
- containerClass () {
54
- return `items-${this.alignColumns}`
55
- },
43
+ text: {
44
+ type: String,
45
+ default: ''
46
+ }
47
+ })
56
48
 
57
- hasDefaultButton () {
58
- return !!Object.keys(this.buttonProps).length
59
- },
49
+ const slots = useSlots()
60
50
 
61
- hasDefaultActionsMenu () {
62
- return !!Object.keys(this.actionsMenuProps).length
63
- },
51
+ // computed
52
+ const containerClass = computed(() => `items-${props.alignColumns}`)
53
+ const leftClass = computed(() => hasRightSide.value ? 'col-9 col-md-9 col-sm-8' : 'col-12')
64
54
 
65
- hasRightSlot () {
66
- return !!this.$slots.right
67
- },
55
+ const hasDefaultButton = computed(() => !!Object.keys(props.buttonProps).length)
56
+ const hasDefaultActionsMenu = computed(() => !!Object.keys(props.actionsMenuProps).length)
68
57
 
69
- hasRightSide () {
70
- return this.hasRightSlot || this.hasDefaultActionsMenu || this.hasDefaultButton
71
- },
58
+ const hasRightSide = computed(() => {
59
+ const hasRightSlot = !!slots.right
72
60
 
73
- leftClass () {
74
- return this.hasRightSide ? 'col-9 col-md-9 col-sm-8' : 'col-12'
75
- }
76
- }
77
- }
61
+ return hasRightSlot || hasDefaultActionsMenu.value || hasDefaultButton.value
62
+ })
78
63
  </script>
@@ -13,7 +13,7 @@ props:
13
13
  desc: Alinhamento vertical das colunas.
14
14
  default: center
15
15
  type: String
16
- examples: [start, center, end]
16
+ examples: [start, center, end, between, around]
17
17
 
18
18
  button-props:
19
19
  desc: Propriedades do QasBtn.
@@ -62,7 +62,7 @@ const props = defineProps({
62
62
 
63
63
  defineExpose({ refresh, remove })
64
64
 
65
- const emits = defineEmits(['update:list'])
65
+ const emit = defineEmits(['update:list'])
66
66
 
67
67
  const axios = inject('axios')
68
68
 
@@ -97,7 +97,7 @@ const model = computed({
97
97
  },
98
98
 
99
99
  set (newList) {
100
- emits('update:list', newList)
100
+ emit('update:list', newList)
101
101
  }
102
102
  })
103
103
 
@@ -4,70 +4,58 @@
4
4
  </div>
5
5
  </template>
6
6
 
7
- <script>
8
- import { addCounterSuffix, getRequiredLabel } from '../../helpers'
7
+ <script setup>
9
8
  import { Spacing } from '../../enums/Spacing'
9
+ import { addCounterSuffix, getRequiredLabel } from '../../helpers'
10
10
 
11
- export default {
12
- name: 'QasLabel',
13
-
14
- props: {
15
- color: {
16
- type: String,
17
- default: 'grey-10'
18
- },
19
-
20
- count: {
21
- default: 0,
22
- type: [Number, String]
23
- },
11
+ import { computed } from 'vue'
24
12
 
25
- label: {
26
- default: '',
27
- type: String
28
- },
13
+ defineOptions({ name: 'QasLabel' })
29
14
 
30
- margin: {
31
- default: Spacing.Md,
32
- type: String,
33
- validator: value => {
34
- const availableSpacings = Object.values(Spacing)
15
+ const props = defineProps({
16
+ color: {
17
+ type: String,
18
+ default: 'grey-10'
19
+ },
35
20
 
36
- return availableSpacings.includes(value)
37
- }
38
- },
21
+ count: {
22
+ default: 0,
23
+ type: [Number, String]
24
+ },
39
25
 
40
- required: {
41
- type: Boolean
42
- },
26
+ label: {
27
+ default: '',
28
+ type: String
29
+ },
43
30
 
44
- typography: {
45
- default: 'h4',
46
- type: String,
47
- validator: value => {
48
- const availableTypography = ['h4', 'h5']
31
+ margin: {
32
+ default: Spacing.Md,
33
+ type: String,
34
+ validator: value => Object.values(Spacing).includes(value)
35
+ },
49
36
 
50
- return availableTypography.includes(value)
51
- }
52
- }
37
+ required: {
38
+ type: Boolean
53
39
  },
54
40
 
55
- computed: {
56
- labelWithSuffix () {
57
- return addCounterSuffix(this.label, parseFloat(this.count))
58
- },
41
+ typography: {
42
+ default: 'h4',
43
+ type: String,
44
+ validator: value => ['h4', 'h5'].includes(value)
45
+ }
46
+ })
59
47
 
60
- formattedLabel () {
61
- return getRequiredLabel({ label: this.labelWithSuffix, required: this.required })
62
- },
48
+ const classes = computed(() => {
49
+ return [
50
+ `q-mb-${props.margin}`,
51
+ `text-${props.color}`,
52
+ `text-${props.typography}`
53
+ ]
54
+ })
63
55
 
64
- classes () {
65
- return [
66
- `q-mb-${this.margin}`,
67
- `text-${this.color}`,
68
- `text-${this.typography}`
69
- ]
70
- }
71
- }
72
- }
56
+ const labelWithSuffix = computed(() => addCounterSuffix(props.label, parseFloat(props.count)))
57
+
58
+ const formattedLabel = computed(() => {
59
+ return getRequiredLabel({ label: labelWithSuffix.value, required: props.required })
60
+ })
73
61
  </script>