@bildvitta/quasar-ui-asteroid 3.13.1 → 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.
Files changed (44) hide show
  1. package/package.json +1 -1
  2. package/src/components/alert/QasAlert.vue +1 -1
  3. package/src/components/app-bar/QasAppBar.vue +5 -5
  4. package/src/components/app-menu/QasAppMenu.vue +8 -8
  5. package/src/components/app-menu/private/PvAppMenuDropdown.vue +1 -1
  6. package/src/components/app-user/QasAppUser.vue +19 -11
  7. package/src/components/avatar/QasAvatar.vue +2 -2
  8. package/src/components/breakline/QasBreakline.vue +5 -6
  9. package/src/components/btn-dropdown/QasBtnDropdown.vue +74 -95
  10. package/src/components/card/QasCard.vue +55 -73
  11. package/src/components/checkbox-group/QasCheckboxGroup.vue +81 -92
  12. package/src/components/copy/QasCopy.vue +20 -27
  13. package/src/components/date/QasDate.vue +316 -355
  14. package/src/components/date/QasDate.yml +0 -5
  15. package/src/components/date/enums/DateMaskOptions.js +6 -0
  16. package/src/components/date-time-input/QasDateTimeInput.vue +198 -209
  17. package/src/components/debugger/QasDebugger.vue +20 -12
  18. package/src/components/delete/QasDelete.vue +70 -80
  19. package/src/components/dialog/QasDialog.vue +7 -7
  20. package/src/components/dialog/composables/use-cancel.js +3 -3
  21. package/src/components/dialog/composables/use-dynamic-components.js +4 -4
  22. package/src/components/dialog/composables/use-ok.js +3 -3
  23. package/src/components/dialog-router/QasDialogRouter.vue +68 -67
  24. package/src/components/empty-result-text/QasEmptyResultText.vue +8 -10
  25. package/src/components/form-generator/QasFormGenerator.vue +2 -2
  26. package/src/components/gallery/QasGallery.vue +175 -196
  27. package/src/components/gallery/composables/use-delete.js +54 -0
  28. package/src/components/gallery/private/PvGalleryCarouselDialog.vue +48 -55
  29. package/src/components/gallery/private/PvGalleryDeleteDialog.vue +41 -50
  30. package/src/components/gallery-card/QasGalleryCard.vue +90 -103
  31. package/src/components/grid-generator/QasGridGenerator.vue +2 -2
  32. package/src/components/header-actions/QasHeaderActions.vue +35 -50
  33. package/src/components/header-actions/QasHeaderActions.yml +1 -1
  34. package/src/components/infinite-scroll/QasInfiniteScroll.vue +2 -2
  35. package/src/components/label/QasLabel.vue +42 -54
  36. package/src/components/list-items/QasListItems.vue +32 -41
  37. package/src/components/map/QasMap.vue +44 -46
  38. package/src/components/page-header/QasPageHeader.vue +74 -87
  39. package/src/components/pagination/QasPagination.vue +21 -21
  40. package/src/components/select-list-dialog/QasSelectListDialog.vue +4 -2
  41. package/src/components/tabs-generator/QasTabsGenerator.vue +55 -63
  42. package/src/components/timeline/QasTimeline.vue +1 -1
  43. package/src/composables/private/use-generator.js +0 -8
  44. package/src/vue-plugin.js +5 -1
@@ -1,118 +1,107 @@
1
1
  <template>
2
2
  <div :class="classes">
3
- <div v-for="(option, index) in options" :key="index">
3
+ <div v-for="(option, index) in props.options" :key="index">
4
4
  <q-checkbox v-if="hasChildren(option)" :class="getCheckboxClass(option)" :label="option.label" :model-value="getModelValue(index)" @update:model-value="updateCheckbox($event, option, index)" />
5
5
 
6
- <q-option-group v-if="hasChildren(option)" class="q-ml-sm" :inline="inline" :model-value="modelValue" :options="option.children" type="checkbox" @update:model-value="updateChildren($event, option, index)" />
6
+ <q-option-group v-if="hasChildren(option)" class="q-ml-sm" :inline="props.inline" :model-value="props.modelValue" :options="option.children" type="checkbox" @update:model-value="updateChildren($event, option, index)" />
7
7
 
8
- <q-option-group v-else v-model="model" v-bind="$attrs" :options="[option]" type="checkbox" />
8
+ <q-option-group v-else v-model="model" v-bind="attrs" :options="[option]" type="checkbox" />
9
9
  </div>
10
10
  </div>
11
11
  </template>
12
12
 
13
- <script>
14
- export default {
15
- name: 'QasCheckboxGroup',
13
+ <script setup>
14
+ import { watch, computed, ref, onMounted, useAttrs } from 'vue'
16
15
 
17
- props: {
18
- options: {
19
- default: () => [],
20
- type: Array
21
- },
16
+ defineOptions({ name: 'QasCheckboxGroup' })
22
17
 
23
- modelValue: {
24
- default: () => [],
25
- type: Array
26
- },
18
+ const props = defineProps({
19
+ options: {
20
+ default: () => [],
21
+ type: Array
22
+ },
27
23
 
28
- inline: {
29
- default: true,
30
- type: Boolean
31
- }
24
+ modelValue: {
25
+ default: () => [],
26
+ type: Array
32
27
  },
33
28
 
34
- emits: ['update:modelValue'],
29
+ inline: {
30
+ default: true,
31
+ type: Boolean
32
+ }
33
+ })
35
34
 
36
- data () {
37
- return {
38
- group: {}
39
- }
40
- },
35
+ const emit = defineEmits(['update:modelValue'])
41
36
 
42
- computed: {
43
- model: {
44
- get () {
45
- return this.modelValue
46
- },
37
+ const attrs = useAttrs()
47
38
 
48
- set (value) {
49
- this.$emit('update:modelValue', value)
50
- }
51
- },
39
+ onMounted(handleParent)
52
40
 
53
- classes () {
54
- return this.inline && 'flex q-gutter-x-sm'
55
- }
56
- },
41
+ const group = ref({})
57
42
 
58
- watch: {
59
- options () {
60
- this.handleParent()
61
- }
62
- },
43
+ const classes = computed(() => props.inline && 'flex q-gutter-x-sm')
63
44
 
64
- created () {
65
- this.handleParent()
45
+ const model = computed({
46
+ get () {
47
+ return props.modelValue
66
48
  },
67
49
 
68
- methods: {
69
- handleParent () {
70
- for (const index in this.options) {
71
- const option = this.options[index]
72
- if (this.hasChildren(option)) {
73
- this.setGroupIntersection(this.modelValue, option, index)
74
- }
75
- }
76
- },
77
-
78
- hasChildren (option) {
79
- return Object.prototype.hasOwnProperty.call(option, 'children')
80
- },
81
-
82
- setGroupIntersection (value, option, index) {
83
- const options = option.children.map(item => item.value)
84
- const intersection = options.filter(item => value.includes(item))
85
-
86
- this.group[index] = intersection.length && (intersection.length === options.length ? true : null)
87
- },
88
-
89
- updateCheckbox (value, option, index) {
90
- this.group[index] = value
91
- const groupValues = option.children.map(item => item.value)
92
-
93
- const updatedValue = value
94
- ? [...new Set([...this.modelValue, ...groupValues])]
95
- : this.modelValue.filter(item => !groupValues.includes(item))
96
-
97
- this.updateModelValue(updatedValue)
98
- },
99
-
100
- updateChildren (value, option, index) {
101
- this.setGroupIntersection(value, option, index)
102
- this.updateModelValue(value)
103
- },
104
-
105
- getCheckboxClass (option) {
106
- return this.hasChildren(option) && 'text-weight-bold'
107
- },
108
-
109
- getModelValue (index) {
110
- return this.group[index]
111
- },
112
-
113
- updateModelValue (value) {
114
- this.$emit('update:modelValue', value)
50
+ set (value) {
51
+ updateModelValue(value)
52
+ }
53
+ })
54
+
55
+ watch(() => props.options, handleParent)
56
+
57
+ // functions
58
+ function handleParent () {
59
+ for (const index in props.options) {
60
+ const option = props.options[index]
61
+ if (hasChildren(option)) {
62
+ setGroupIntersection(props.modelValue, option, index)
115
63
  }
116
64
  }
117
65
  }
66
+
67
+ function hasChildren (option) {
68
+ return Object.prototype.hasOwnProperty.call(option, 'children')
69
+ }
70
+
71
+ function setGroupIntersection (value, option, index) {
72
+ const options = option.children.map(item => item.value)
73
+ const intersection = options.filter(item => value.includes(item))
74
+
75
+ group.value[index] = intersection.length && (intersection.length === options.length ? true : null)
76
+ }
77
+
78
+ function updateCheckbox (value, option, index) {
79
+ group.value[index] = value
80
+
81
+ const groupValues = option.children.map(item => item.value)
82
+
83
+ const updatedValue = value
84
+ ? [...new Set([...props.modelValue, ...groupValues])]
85
+ : props.modelValue.filter(item => !groupValues.includes(item))
86
+
87
+ updateModelValue(updatedValue)
88
+ }
89
+
90
+ function updateChildren (value, option, index) {
91
+ setGroupIntersection(value, option, index)
92
+ updateModelValue(value)
93
+ }
94
+
95
+ function updateModelValue (value) {
96
+ emit('update:modelValue', value)
97
+ }
98
+
99
+ function getCheckboxClass (option) {
100
+ return hasChildren(option) && 'text-weight-bold'
101
+ }
102
+
103
+ function getModelValue (index) {
104
+ return group.value[index]
105
+ }
106
+
118
107
  </script>
@@ -1,43 +1,36 @@
1
1
  <template>
2
2
  <span>
3
- <slot>{{ text }}</slot>
3
+ <slot>{{ props.text }}</slot>
4
4
 
5
- <qas-btn class="q-ml-xs" color="primary" :icon="icon" :loading="isLoading" variant="tertiary" @click.stop.prevent="copy">
5
+ <qas-btn class="q-ml-xs" color="primary" :icon="props.icon" :loading="isLoading" variant="tertiary" @click.stop.prevent="copy">
6
6
  <q-tooltip>Copiar</q-tooltip>
7
7
  </qas-btn>
8
8
  </span>
9
9
  </template>
10
10
 
11
- <script>
11
+ <script setup>
12
12
  import { copyToClipboard } from '../../helpers'
13
+ import { ref } from 'vue'
13
14
 
14
- export default {
15
- name: 'QasCopy',
15
+ defineOptions({ name: 'QasCopy' })
16
16
 
17
- props: {
18
- icon: {
19
- default: 'sym_r_file_copy',
20
- type: String
21
- },
22
-
23
- text: {
24
- required: true,
25
- type: String
26
- }
27
- },
28
-
29
- data () {
30
- return {
31
- isLoading: false
32
- }
17
+ const props = defineProps({
18
+ icon: {
19
+ default: 'sym_r_file_copy',
20
+ type: String
33
21
  },
34
22
 
35
- methods: {
36
- copy () {
37
- copyToClipboard(this.text, isLoading => {
38
- this.isLoading = isLoading
39
- })
40
- }
23
+ text: {
24
+ required: true,
25
+ type: String
41
26
  }
27
+ })
28
+
29
+ const isLoading = ref(false)
30
+
31
+ function copy () {
32
+ copyToClipboard(props.text, value => {
33
+ isLoading.value = value
34
+ })
42
35
  }
43
36
  </script>