@bildvitta/quasar-ui-asteroid 3.13.0-beta.8 → 3.13.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.
Files changed (65) hide show
  1. package/package.json +1 -1
  2. package/src/components/actions/QasActions.vue +54 -47
  3. package/src/components/actions-menu/QasActionsMenu.vue +147 -149
  4. package/src/components/actions-menu/QasActionsMenu.yml +13 -0
  5. package/src/components/app-bar/QasAppBar.vue +59 -87
  6. package/src/components/app-menu/QasAppMenu.vue +128 -256
  7. package/src/components/app-menu/composables/use-app-menu-dropdown.js +71 -0
  8. package/src/components/app-menu/composables/use-app-user.js +46 -0
  9. package/src/components/app-menu/composables/use-development-badge.js +23 -0
  10. package/src/components/app-menu/private/PvAppMenuDropdown.vue +33 -39
  11. package/src/components/app-user/QasAppUser.vue +94 -92
  12. package/src/components/avatar/QasAvatar.vue +67 -85
  13. package/src/components/avatar/enums/AvatarColors.js +9 -0
  14. package/src/components/badge/QasBadge.vue +21 -22
  15. package/src/components/badge/QasBadge.yml +1 -1
  16. package/src/components/box/QasBox.vue +17 -19
  17. package/src/components/btn/QasBtn.vue +132 -135
  18. package/src/components/btn/QasBtn.yml +3 -3
  19. package/src/components/btn-dropdown/QasBtnDropdown.vue +2 -2
  20. package/src/components/chart-view/QasChartView.vue +2 -2
  21. package/src/components/date/QasDate.vue +3 -3
  22. package/src/components/date-time-input/QasDateTimeInput.vue +2 -2
  23. package/src/components/delete/QasDelete.vue +1 -1
  24. package/src/components/dialog/QasDialog.vue +135 -244
  25. package/src/components/dialog/composables/use-cancel.js +40 -0
  26. package/src/components/dialog/composables/use-dynamic-components.js +86 -0
  27. package/src/components/dialog/composables/use-ok.js +45 -0
  28. package/src/components/filters/QasFilters.vue +1 -1
  29. package/src/components/filters/private/PvFiltersButton.vue +2 -2
  30. package/src/components/form-generator/QasFormGenerator.yml +1 -1
  31. package/src/components/gallery/QasGallery.vue +1 -1
  32. package/src/components/gallery/private/PvGalleryCarouselDialog.vue +2 -2
  33. package/src/components/gallery-card/QasGalleryCard.vue +2 -2
  34. package/src/components/label/QasLabel.vue +1 -1
  35. package/src/components/label/QasLabel.yml +1 -1
  36. package/src/components/nested-fields/QasNestedFields.vue +37 -14
  37. package/src/components/nested-fields/QasNestedFields.yml +63 -17
  38. package/src/components/page-header/QasPageHeader.vue +1 -11
  39. package/src/components/pagination/QasPagination.vue +1 -1
  40. package/src/components/search-input/QasSearchInput.vue +2 -2
  41. package/src/components/select-list-dialog/QasSelectListDialog.vue +3 -3
  42. package/src/components/table-generator/QasTableGenerator.vue +8 -4
  43. package/src/components/tabs-generator/QasTabsGenerator.vue +1 -1
  44. package/src/components/timeline/QasTimeline.vue +2 -2
  45. package/src/components/tree-generator/QasTreeGenerator.vue +1 -1
  46. package/src/components/uploader/QasUploader.vue +1 -1
  47. package/src/components/uploader/private/PvUploaderGalleryCard.vue +1 -1
  48. package/src/components/welcome/QasWelcome.vue +2 -2
  49. package/src/composables/use-history.js +4 -4
  50. package/src/css/components/base.scss +1 -0
  51. package/src/css/components/button.scss +2 -2
  52. package/src/css/components/checkbox.scss +12 -0
  53. package/src/css/components/editor.scss +7 -0
  54. package/src/css/components/field.scss +23 -3
  55. package/src/css/components/index.scss +3 -0
  56. package/src/css/components/item.scss +1 -1
  57. package/src/css/components/radio.scss +15 -2
  58. package/src/css/components/toggle.scss +11 -0
  59. package/src/css/variables/typography.scss +11 -1
  60. package/src/enums/Align.js +7 -0
  61. package/src/index.scss +4 -4
  62. package/src/pages/ErrorComponent.vue +1 -2
  63. package/src/plugins/dialog/Dialog.js +1 -1
  64. package/src/shared/notify-config.js +1 -1
  65. package/src/vue-plugin.js +4 -0
@@ -2,150 +2,147 @@
2
2
  <q-btn ref="button" class="qas-btn" v-bind="attributes">
3
3
  <slot />
4
4
 
5
- <template v-for="(_, name) in slots" #[name]="context">
5
+ <template v-for="(_, name) in nonDefaultSlots" #[name]="context">
6
6
  <slot :name="name" v-bind="context || {}" />
7
7
  </template>
8
8
  </q-btn>
9
9
  </template>
10
10
 
11
- <script>
12
- export default {
11
+ <script setup>
12
+ import { useScreen } from '../../composables'
13
+
14
+ import { computed, useAttrs, useSlots } from 'vue'
15
+
16
+ defineOptions({
13
17
  name: 'QasBtn',
18
+ inheritAttrs: false
19
+ })
20
+
21
+ const props = defineProps({
22
+ color: {
23
+ default: 'primary',
24
+ type: String,
25
+ validator: value => ['grey-10', 'primary', 'white'].includes(value)
26
+ },
14
27
 
15
- inheritAttrs: false,
16
-
17
- props: {
18
- color: {
19
- default: 'primary',
20
- type: String,
21
- validator: value => ['grey-9', 'primary', 'white'].includes(value)
22
- },
23
-
24
- icon: {
25
- type: String,
26
- default: undefined
27
- },
28
-
29
- iconRight: {
30
- type: String,
31
- default: undefined
32
- },
33
-
34
- useLabelOnSmallScreen: {
35
- default: true,
36
- type: Boolean
37
- },
38
-
39
- label: {
40
- default: '',
41
- type: String
42
- },
43
-
44
- variant: {
45
- type: String,
46
- default: 'tertiary',
47
- validator: value => {
48
- const variants = ['primary', 'secondary', 'tertiary']
49
-
50
- return variants.includes(value)
51
- }
52
- },
53
-
54
- useEllipsis: {
55
- type: Boolean
56
- },
57
-
58
- useHoverOnWhiteColor: {
59
- default: true,
60
- type: Boolean
61
- }
28
+ icon: {
29
+ default: undefined,
30
+ type: String
31
+ },
32
+
33
+ iconRight: {
34
+ default: undefined,
35
+ type: String
36
+ },
37
+
38
+ useLabelOnSmallScreen: {
39
+ default: true,
40
+ type: Boolean
62
41
  },
63
42
 
64
- computed: {
65
- attributes () {
66
- const {
67
- dense,
68
- fab,
69
- fabMini,
70
- flat,
71
- glossy,
72
- noWrap,
73
- outline,
74
- padding,
75
- push,
76
- ripple,
77
- round,
78
- size,
79
- square,
80
- stack,
81
- stretch,
82
- textColor,
83
- unelevated,
84
- class: externalClass,
85
- ...attributes
86
- } = this.$attrs
87
-
88
- return {
89
- ...(this.showLabel && { label: this.label }),
90
-
91
- ...attributes,
92
- icon: this.icon,
93
- iconRight: this.iconRight,
94
- class: [this.classes, externalClass]
95
- }
96
- },
97
-
98
- hasIconOnly () {
99
- return (
100
- (!this.label || !this.showLabel) &&
101
- ((this.icon && !this.iconRight) || (this.iconRight && !this.icon))
102
- )
103
- },
104
-
105
- classes () {
106
- return {
107
- 'qas-btn--primary': this.isPrimary,
108
- 'qas-btn--secondary': this.isSecondary,
109
- 'qas-btn--tertiary': this.isTertiary,
110
-
111
- // color
112
- [`qas-btn--tertiary-${this.color}`]: this.isTertiary,
113
-
114
- // icon
115
- 'qas-btn--icon-only': this.hasIconOnly,
116
-
117
- 'qas-btn--primary-icon-only': this.hasIconOnly && this.isPrimary,
118
- 'qas-btn--secondary-icon-only': this.hasIconOnly && this.isSecondary,
119
- 'qas-btn--tertiary-icon-only': this.hasIconOnly && this.isTertiary,
120
-
121
- // hover
122
- 'qas-btn--no-hover-on-white': !this.useHoverOnWhiteColor,
123
-
124
- // ellipsis
125
- 'qas-btn--ellipsis': this.useEllipsis
126
- }
127
- },
128
-
129
- isPrimary () {
130
- return this.variant === 'primary'
131
- },
132
-
133
- isSecondary () {
134
- return this.variant === 'secondary'
135
- },
136
-
137
- isTertiary () {
138
- return this.variant === 'tertiary'
139
- },
140
-
141
- showLabel () {
142
- return this.useLabelOnSmallScreen || !this.$qas.screen.isSmall
143
- },
144
-
145
- slots () {
146
- const { default: _, ...slots } = this.$slots
147
- return slots
43
+ label: {
44
+ default: '',
45
+ type: String
46
+ },
47
+
48
+ variant: {
49
+ default: 'tertiary',
50
+ type: String,
51
+ validator: value => {
52
+ const variants = ['primary', 'secondary', 'tertiary']
53
+
54
+ return variants.includes(value)
148
55
  }
56
+ },
57
+
58
+ useEllipsis: {
59
+ type: Boolean
60
+ },
61
+
62
+ useHoverOnWhiteColor: {
63
+ default: true,
64
+ type: Boolean
149
65
  }
150
- }
66
+ })
67
+
68
+ const attrs = useAttrs()
69
+ const slots = useSlots()
70
+ const screen = useScreen()
71
+
72
+ // variantes
73
+ const isPrimary = computed(() => props.variant === 'primary')
74
+ const isSecondary = computed(() => props.variant === 'secondary')
75
+ const isTertiary = computed(() => props.variant === 'tertiary')
76
+
77
+ const showLabel = computed(() => props.useLabelOnSmallScreen || !screen.isSmall)
78
+
79
+ const hasIconOnly = computed(() => {
80
+ return (
81
+ (!props.label || !showLabel.value) &&
82
+ ((props.icon && !props.iconRight) || (props.iconRight && !props.icon))
83
+ )
84
+ })
85
+
86
+ const classes = computed(() => {
87
+ return {
88
+ 'qas-btn--primary': isPrimary.value,
89
+ 'qas-btn--secondary': isSecondary.value,
90
+ 'qas-btn--tertiary': isTertiary.value,
91
+
92
+ // color
93
+ [`qas-btn--tertiary-${props.color}`]: isTertiary.value,
94
+
95
+ // icon
96
+ 'qas-btn--icon-only': hasIconOnly.value,
97
+
98
+ 'qas-btn--primary-icon-only': hasIconOnly.value && isPrimary.value,
99
+ 'qas-btn--secondary-icon-only': hasIconOnly.value && isSecondary.value,
100
+ 'qas-btn--tertiary-icon-only': hasIconOnly.value && isTertiary.value,
101
+
102
+ // hover
103
+ 'qas-btn--no-hover-on-white': !props.useHoverOnWhiteColor,
104
+
105
+ // ellipsis
106
+ 'qas-btn--ellipsis': props.useEllipsis
107
+ }
108
+ })
109
+
110
+ const attributes = computed(() => {
111
+ const {
112
+ dense,
113
+ fab,
114
+ fabMini,
115
+ flat,
116
+ glossy,
117
+ noWrap,
118
+ outline,
119
+ padding,
120
+ push,
121
+ ripple,
122
+ round,
123
+ size,
124
+ square,
125
+ stack,
126
+ stretch,
127
+ textColor,
128
+ unelevated,
129
+ class: externalClass,
130
+ ...attributesPayload
131
+ } = attrs
132
+
133
+ return {
134
+ ...(showLabel.value && { label: props.label }),
135
+
136
+ ...attributesPayload,
137
+ icon: props.icon,
138
+ iconRight: props.iconRight,
139
+ class: [classes.value, externalClass]
140
+ }
141
+ })
142
+
143
+ const nonDefaultSlots = computed(() => {
144
+ const { default: _, ...nonDefaults } = slots
145
+
146
+ return nonDefaults
147
+ })
151
148
  </script>
@@ -8,10 +8,10 @@ meta:
8
8
 
9
9
  props:
10
10
  color:
11
- desc: Cor do botão, sendo possível alterar somente quando a variante for "tertiary", podendo ser "primary", "grey-9" ou "white".
11
+ desc: Cor do botão, sendo possível alterar somente quando a variante for "tertiary", podendo ser "primary", "grey-10" ou "white".
12
12
  default: primary
13
13
  type: String
14
- examples: ['grey-9', 'primary', 'white']
14
+ examples: ['grey-10', 'primary', 'white']
15
15
 
16
16
  icon:
17
17
  desc: Ícone a esquerda.
@@ -45,4 +45,4 @@ props:
45
45
  desc: Variantes do botão, que define para qual comportamento o botão será usado, podendo ser "primary", "secondary" ou "tertiary".
46
46
  default: tertiary
47
47
  type: String
48
- examples: ['primary', 'secondary', 'tertiary']
48
+ examples: ['primary', 'secondary', 'tertiary']
@@ -15,7 +15,7 @@
15
15
  <q-separator v-if="hasSeparator" class="q-mr-sm qas-btn-dropdown__separator self-center" dark vertical />
16
16
 
17
17
  <div v-if="useSplit">
18
- <qas-btn color="grey-9" :icon="dropdownIcon" variant="tertiary">
18
+ <qas-btn color="grey-10" :icon="dropdownIcon" variant="tertiary">
19
19
  <q-menu v-if="hasDefaultSlot" anchor="bottom right" auto-close self="top right">
20
20
  <div :class="menuContentClasses">
21
21
  <slot />
@@ -106,7 +106,7 @@ export default {
106
106
 
107
107
  ...defaultProps,
108
108
 
109
- color: color || (!this.useSplit ? 'grey-9' : 'primary'),
109
+ color: color || (!this.useSplit ? 'grey-10' : 'primary'),
110
110
  ...(!this.useSplit && { iconRight: defaultIconRight }),
111
111
  ...(this.useSplit && { icon })
112
112
  }
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <qas-header-actions v-if="hasHeaderActions" align-columns="end">
3
3
  <template #left>
4
- <div v-if="title" class="text-grey-9 text-h3">
4
+ <h3 v-if="title" class="text-h3">
5
5
  {{ title }}
6
- </div>
6
+ </h3>
7
7
 
8
8
  <div v-if="subtitle" class="text-body1 text-grey-8">
9
9
  {{ subtitle }}
@@ -559,7 +559,7 @@ export default {
559
559
  justify-content: space-between;
560
560
 
561
561
  .q-btn {
562
- @include set-button(tertiary, false, false, grey-9);
562
+ @include set-button(tertiary, false, false, grey-10);
563
563
  @include set-typography($subtitle2);
564
564
 
565
565
  .q-icon {
@@ -592,7 +592,7 @@ export default {
592
592
  color: $primary !important;
593
593
  }
594
594
 
595
- @include set-button(tertiary, false, false, grey-9);
595
+ @include set-button(tertiary, false, false, grey-10);
596
596
  }
597
597
  }
598
598
 
@@ -601,7 +601,7 @@ export default {
601
601
  }
602
602
 
603
603
  &__calendar-days-container {
604
- color: $grey-9;
604
+ color: $grey-10;
605
605
  min-height: auto;
606
606
 
607
607
  .q-btn {
@@ -1,13 +1,13 @@
1
1
  <template>
2
2
  <qas-input ref="input" v-bind="attributes" v-model="currentValue" inputmode="numeric" :unmasked-value="false" @blur="validateDateTimeOnBlur" @focus="resetError" @update:model-value="updateModelValue">
3
3
  <template #append>
4
- <qas-btn v-if="!useTimeOnly" color="grey-9" :disable="$attrs.readonly" icon="sym_r_event" variant="tertiary">
4
+ <qas-btn v-if="!useTimeOnly" color="grey-10" :disable="$attrs.readonly" icon="sym_r_event" variant="tertiary">
5
5
  <q-popup-proxy ref="dateProxy" transition-hide="scale" transition-show="scale" v-bind="datePopupProxyProps">
6
6
  <qas-date v-model="currentValue" v-bind="defaultDateProps" :mask="maskDate" width="290px" @update:model-value="updateModelValue" />
7
7
  </q-popup-proxy>
8
8
  </qas-btn>
9
9
 
10
- <qas-btn v-if="!useDateOnly" class="q-ml-sm" color="grey-9" :disable="$attrs.readonly" icon="sym_r_access_time">
10
+ <qas-btn v-if="!useDateOnly" class="q-ml-sm" color="grey-10" :disable="$attrs.readonly" icon="sym_r_access_time">
11
11
  <q-popup-proxy ref="timeProxy" transition-hide="scale" transition-show="scale" v-bind="timePopupProxyProps">
12
12
  <q-time v-model="currentValue" v-bind="defaultTimeProps" format24h :mask="maskDate" @update:model-value="updateModelValue" />
13
13
  </q-popup-proxy>
@@ -69,7 +69,7 @@ export default {
69
69
  attributes () {
70
70
  return {
71
71
  ...this.$attrs,
72
- color: this.isButton ? 'grey-9' : this.$attrs.color
72
+ color: this.isButton ? 'grey-10' : this.$attrs.color
73
73
  }
74
74
  },
75
75