@bildvitta/quasar-ui-asteroid 2.12.4 → 3.0.0-alpha.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/dist/api/QasBox.json +16 -0
- package/dist/api/QasBreakline.json +32 -0
- package/dist/api/QasBtn.json +15 -0
- package/dist/api/QasDebugger.json +13 -0
- package/dist/asteroid.cjs.css +1 -0
- package/dist/asteroid.cjs.js +9154 -0
- package/dist/asteroid.cjs.min.js +6 -0
- package/dist/asteroid.esm.css +1 -0
- package/dist/asteroid.esm.js +9145 -0
- package/dist/asteroid.esm.min.js +6 -0
- package/dist/asteroid.umd.css +1 -0
- package/dist/asteroid.umd.js +9148 -0
- package/dist/asteroid.umd.min.js +6 -0
- package/dist/vetur/asteroid-attributes.json +30 -0
- package/dist/vetur/asteroid-tags.json +29 -0
- package/package.json +42 -56
- package/src/assets/logo-modular.svg +1 -0
- package/src/asteroid.js +1 -0
- package/src/components/actions/QasActions.vue +45 -0
- package/src/components/actions-menu/QasActionsMenu.vue +8 -19
- package/src/components/alert/QasAlert.vue +90 -0
- package/src/components/app-bar/QasAppBar.vue +59 -61
- package/src/components/app-menu/QasAppMenu.vue +128 -41
- package/src/components/avatar/QasAvatar.vue +7 -3
- package/src/components/box/QasBox.vue +12 -4
- package/src/components/box/QasBox.yml +13 -0
- package/src/components/breakline/QasBreakline.vue +37 -0
- package/src/components/breakline/QasBreakline.yml +25 -0
- package/src/components/btn/QasBtn.vue +27 -24
- package/src/components/btn/QasBtn.yml +12 -0
- package/src/components/card/QasCard.vue +29 -21
- package/src/components/checkbox-group/QasCheckboxGroup.vue +31 -17
- package/src/components/copy/QasCopy.vue +22 -11
- package/src/components/date-time-input/QasDateTimeInput.vue +16 -26
- package/src/components/debugger/QasDebugger.vue +2 -0
- package/src/components/debugger/QasDebugger.yml +10 -0
- package/src/components/delete/QasDelete.vue +28 -15
- package/src/components/dialog/QasDialog.vue +71 -67
- package/src/components/dialog-router/QasDialogRouter.vue +12 -4
- package/src/components/field/QasField.vue +22 -25
- package/src/components/filters/QasFilters.vue +31 -24
- package/src/components/form-generator/QasFormGenerator.vue +13 -15
- package/src/components/form-view/QasFormView.vue +117 -66
- package/src/components/gallery/QasGallery.vue +39 -26
- package/src/components/grid-generator/QasGridGenerator.vue +12 -6
- package/src/components/index.js +0 -0
- package/src/components/input/QasInput.vue +38 -36
- package/src/components/label/QasLabel.vue +14 -15
- package/src/components/layout/QasLayout.vue +81 -0
- package/src/components/list-items/QasListItems.vue +16 -8
- package/src/components/list-view/QasListView.vue +31 -28
- package/src/components/map/QasMap.vue +15 -25
- package/src/components/nested-fields/QasNestedFields.vue +39 -36
- package/src/components/numeric-input/QasNumericInput.vue +125 -0
- package/src/components/page-header/QasPageHeader.vue +19 -10
- package/src/components/password-input/QasPasswordInput.vue +20 -18
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.vue +52 -31
- package/src/components/profile/QasProfile.vue +14 -12
- package/src/components/resizer/QasResizer.vue +1 -1
- package/src/components/search-box/QasSearchBox.vue +36 -20
- package/src/components/select/QasSelect.vue +43 -44
- package/src/components/select-list/QasSelectList.vue +64 -51
- package/src/components/signature-pad/QasSignaturePad.vue +57 -41
- package/src/components/signature-uploader/QasSignatureUploader.vue +15 -13
- package/src/components/single-view/QasSingleView.vue +31 -17
- package/src/components/sortable/QasSortable.vue +45 -27
- package/src/components/table-generator/QasTableGenerator.vue +95 -22
- package/src/components/tabs-generator/QasTabsGenerator.vue +36 -24
- package/src/components/text-truncate/QasTextTruncate.vue +25 -17
- package/src/components/transfer/QasTransfer.vue +57 -53
- package/src/components/uploader/QasUploader.vue +169 -48
- package/src/css/background.scss +1 -1
- package/src/css/border.scss +7 -6
- package/src/css/design-system.scss +0 -43
- package/src/css/fonts.scss +2 -28
- package/src/css/opacity.scss +0 -4
- package/src/css/set-brand.scss +15 -0
- package/src/css/transitions.scss +1 -1
- package/src/helpers/add-counter-suffix.js +3 -0
- package/src/helpers/{base64ToBlob.js → base-64-to-blob.js} +0 -0
- package/src/helpers/{constructObject.js → construct-object.js} +0 -0
- package/src/helpers/filter-object.js +8 -6
- package/src/helpers/filters.js +3 -4
- package/src/helpers/get-slot-children-text.js +15 -0
- package/src/helpers/{greatestCommonDivisor.js → greatest-common-divisor.js} +0 -0
- package/src/helpers/images.js +28 -0
- package/src/helpers/index.js +11 -57
- package/src/helpers/is-local-development.js +3 -0
- package/src/helpers/scroll-on-grap.js +61 -0
- package/src/index.cjs.js +1 -0
- package/src/index.esm.js +4 -0
- package/src/index.scss +18 -20
- package/src/index.umd.js +2 -0
- package/src/mixins/context.js +1 -1
- package/src/mixins/dialog-router.js +17 -0
- package/src/mixins/form.js +4 -12
- package/src/mixins/generator.js +14 -14
- package/src/mixins/index.js +2 -8
- package/src/mixins/password.js +73 -11
- package/src/mixins/screen.js +8 -6
- package/src/mixins/view.js +57 -20
- package/src/plugins/Dialog.js +14 -0
- package/src/plugins/NotifySuccess.js +3 -3
- package/src/plugins/index.js +4 -2
- package/src/store/history.js +43 -0
- package/src/store/index.js +1 -0
- package/src/vue-plugin.js +185 -0
- package/.babelrc +0 -12
- package/.storybook/main.js +0 -35
- package/.storybook/preview.js +0 -26
- package/debug.log +0 -1
- package/index.js +0 -4
- package/jest-setup.js +0 -1
- package/jest.config.json +0 -22
- package/postcss.config.js +0 -5
- package/src/components/Introduction.stories.mdx +0 -12
- package/src/components/actions-menu/QasActionsMenu.stories.js +0 -73
- package/src/components/app-bar/QasAppBar.stories.js +0 -88
- package/src/components/app-menu/QasAppMenu.stories.js +0 -62
- package/src/components/apps-menu/QasAppsMenu.spec.js +0 -58
- package/src/components/apps-menu/QasAppsMenu.stories.js +0 -54
- package/src/components/apps-menu/QasAppsMenu.vue +0 -48
- package/src/components/avatar/QasAvatar.spec.js +0 -14
- package/src/components/avatar/QasAvatar.stories.js +0 -52
- package/src/components/box/QasBox.spec.js +0 -18
- package/src/components/box/QasBox.stories.js +0 -35
- package/src/components/break-line/QasBreakLine.stories.js +0 -57
- package/src/components/break-line/QasBreakLine.vue +0 -52
- package/src/components/btn/QasBtn.stories.js +0 -45
- package/src/components/btn-actions/QasBtnActions.stories.js +0 -77
- package/src/components/btn-actions/QasBtnActions.vue +0 -54
- package/src/components/card/QasCard.stories.js +0 -126
- package/src/components/checkbox-group/QasCheckboxGroup.stories.js +0 -59
- package/src/components/copy/QasCopy.stories.js +0 -41
- package/src/components/date-time-input/QasDateTimeInput.stories.js +0 -67
- package/src/components/debugger/QasDebugger.stories.js +0 -33
- package/src/components/decimal-input/QasDecimalInput.stories.js +0 -82
- package/src/components/decimal-input/QasDecimalInput.vue +0 -92
- package/src/components/delete/QasDelete.stories.js +0 -80
- package/src/components/dialog/QasDialog.stories.js +0 -139
- package/src/components/dialog-router/QasDialogRouter.stories.js +0 -38
- package/src/components/field/QasField.stories.js +0 -181
- package/src/components/filters/QasFilters.stories.js +0 -121
- package/src/components/form-generator/QasFormGenerator.stories.js +0 -115
- package/src/components/form-view/QasFormView.stories.js +0 -236
- package/src/components/gallery/QasGallery.stories.js +0 -91
- package/src/components/grid-generator/QasGridGenerator.stories.js +0 -138
- package/src/components/input/QasInput.stories.js +0 -78
- package/src/components/label/QasLabel.stories.js +0 -60
- package/src/components/list-items/QasListItems.stories.js +0 -130
- package/src/components/list-view/QasListView.stories.js +0 -168
- package/src/components/map/QasMap.stories.js +0 -75
- package/src/components/nested-fields/QasNestedFields.stories.js +0 -255
- package/src/components/page-header/QasPageHeader.stories.js +0 -61
- package/src/components/password-input/QasPasswordInput.stories.js +0 -76
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.stories.js +0 -54
- package/src/components/profile/QasProfile.stories.js +0 -131
- package/src/components/resizer/QasResizer.stories.js +0 -43
- package/src/components/search-box/QasSearchBox.stories.js +0 -111
- package/src/components/select/QasSelect.stories.js +0 -113
- package/src/components/select-list/QasSelectList.stories.js +0 -153
- package/src/components/signature-pad/QasSignaturePad.stories.js +0 -51
- package/src/components/signature-uploader/QasSignatureUploader.stories.js +0 -69
- package/src/components/single-view/QasSingleView.stories.js +0 -130
- package/src/components/sortable/QasSortable.stories.js +0 -80
- package/src/components/table-generator/QasTableGenerator.stories.js +0 -116
- package/src/components/tabs-generator/QasTabsGenerator.stories.js +0 -145
- package/src/components/text-truncate/QasTextTruncate.stories.js +0 -55
- package/src/components/tip/QasTip.stories.js +0 -57
- package/src/components/tip/QasTip.vue +0 -68
- package/src/components/tooltip/QasTooltip.stories.js +0 -63
- package/src/components/tooltip/QasTooltip.vue +0 -81
- package/src/components/transfer/QasTransfer.stories.js +0 -118
- package/src/components/uploader/QasCustomUploader.vue +0 -121
- package/src/components/uploader/QasUploader.stories.js +0 -139
- package/src/directives/Test.js +0 -13
- package/src/helpers/historyHandler.js +0 -52
- package/src/helpers/label.js +0 -3
- package/src/index.js +0 -245
- package/src/mixins/map-markers.js +0 -26
- package/src/mixins/unsaved-changes.js +0 -24
- package/src/mixins/uploader.js +0 -30
- package/src/mocks/json/user.json +0 -27
- package/src/mocks/json/users-new.json +0 -23
- package/src/mocks/json/users.json +0 -97
- package/src/mocks/storeModule.js +0 -71
- package/src/pages/Forbidden.vue +0 -6
- package/src/pages/NotFound.vue +0 -6
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="text-bold text-subtitle2" :class="
|
|
3
|
-
|
|
4
|
-
<slot :formattedLabel="formattedLabel">
|
|
5
|
-
{{ formattedLabel }}
|
|
6
|
-
</slot>
|
|
2
|
+
<div class="text-bold text-subtitle2" :class="labelClass">
|
|
3
|
+
<slot :label-with-suffix="labelWithSuffix">{{ labelWithSuffix }}</slot>
|
|
7
4
|
</div>
|
|
8
5
|
</template>
|
|
9
6
|
|
|
10
7
|
<script>
|
|
11
|
-
import
|
|
8
|
+
import { addCounterSuffix } from '../../helpers'
|
|
12
9
|
|
|
13
10
|
export default {
|
|
11
|
+
name: 'QasLabel',
|
|
12
|
+
|
|
14
13
|
props: {
|
|
14
|
+
count: {
|
|
15
|
+
default: 0,
|
|
16
|
+
type: [Number, String]
|
|
17
|
+
},
|
|
18
|
+
|
|
15
19
|
label: {
|
|
16
20
|
default: '',
|
|
17
21
|
type: String
|
|
@@ -20,21 +24,16 @@ export default {
|
|
|
20
24
|
margin: {
|
|
21
25
|
default: 'sm',
|
|
22
26
|
type: String
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
quantity: {
|
|
26
|
-
default: 0,
|
|
27
|
-
type: Number
|
|
28
27
|
}
|
|
29
28
|
},
|
|
30
29
|
|
|
31
30
|
computed: {
|
|
32
|
-
|
|
33
|
-
return
|
|
31
|
+
labelClass () {
|
|
32
|
+
return `q-mb-${this.margin}`
|
|
34
33
|
},
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
return
|
|
35
|
+
labelWithSuffix () {
|
|
36
|
+
return addCounterSuffix(this.label, parseFloat(this.count))
|
|
38
37
|
}
|
|
39
38
|
}
|
|
40
39
|
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<q-layout view="hHh Lpr lFf">
|
|
3
|
+
<slot name="app-bar">
|
|
4
|
+
<qas-app-bar v-bind="appBarProps" @toggle-menu="toggleMenuDrawer" />
|
|
5
|
+
</slot>
|
|
6
|
+
|
|
7
|
+
<slot name="app-menu">
|
|
8
|
+
<qas-app-menu v-model="menuDrawer" v-bind="defaultAppMenuProps" />
|
|
9
|
+
</slot>
|
|
10
|
+
|
|
11
|
+
<slot>
|
|
12
|
+
<q-page-container>
|
|
13
|
+
<router-view />
|
|
14
|
+
</q-page-container>
|
|
15
|
+
</slot>
|
|
16
|
+
</q-layout>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script>
|
|
20
|
+
import QasAppBar from '../app-bar/QasAppBar.vue'
|
|
21
|
+
import QasAppMenu from '../app-menu/QasAppMenu.vue'
|
|
22
|
+
|
|
23
|
+
export default {
|
|
24
|
+
name: 'QasLayout',
|
|
25
|
+
|
|
26
|
+
components: {
|
|
27
|
+
QasAppBar,
|
|
28
|
+
QasAppMenu
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
props: {
|
|
32
|
+
appBarProps: {
|
|
33
|
+
default: () => ({}),
|
|
34
|
+
type: Object
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
appMenuProps: {
|
|
38
|
+
default: () => ({}),
|
|
39
|
+
type: Object
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
modelValue: {
|
|
43
|
+
default: true,
|
|
44
|
+
type: Boolean
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
emits: ['update:modelValue'],
|
|
49
|
+
|
|
50
|
+
data () {
|
|
51
|
+
return {
|
|
52
|
+
menuDrawer: true
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
computed: {
|
|
57
|
+
defaultAppMenuProps () {
|
|
58
|
+
return {
|
|
59
|
+
...this.appMenuProps,
|
|
60
|
+
title: this.appBarProps?.title
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
watch: {
|
|
66
|
+
modelValue: {
|
|
67
|
+
handler (value) {
|
|
68
|
+
this.menuDrawer = value
|
|
69
|
+
},
|
|
70
|
+
immediate: true
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
methods: {
|
|
75
|
+
toggleMenuDrawer () {
|
|
76
|
+
this.menuDrawer = !this.menuDrawer
|
|
77
|
+
this.$emit('update:modelValue', this.menuDrawer)
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</script>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="qas-list-items shadow-primary">
|
|
3
3
|
<q-list bordered class="rounded-borders" separator>
|
|
4
|
-
<q-item v-for="(item, index) in list" :key="index" v-ripple :clickable="!
|
|
4
|
+
<q-item v-for="(item, index) in list" :key="index" v-ripple :clickable="!redirectOnIcon" :to="redirect(item)">
|
|
5
5
|
<slot :index="index" :item="item" name="item">
|
|
6
6
|
<q-item-section>
|
|
7
7
|
<slot :index="index" :item="item" name="item-section-left" />
|
|
8
8
|
</q-item-section>
|
|
9
9
|
|
|
10
|
-
<q-item-section side>
|
|
10
|
+
<q-item-section v-if="useSectionActions" side>
|
|
11
11
|
<slot :index="index" :item="item" name="item-section-side">
|
|
12
12
|
<qas-btn flat round :to="getRedirectPayload(item)">
|
|
13
13
|
<q-icon v-bind="iconProps" />
|
|
@@ -24,13 +24,15 @@
|
|
|
24
24
|
import QasBtn from '../btn/QasBtn.vue'
|
|
25
25
|
|
|
26
26
|
export default {
|
|
27
|
+
name: 'QasListItems',
|
|
28
|
+
|
|
27
29
|
components: {
|
|
28
30
|
QasBtn
|
|
29
31
|
},
|
|
30
32
|
|
|
31
33
|
props: {
|
|
32
34
|
iconProps: {
|
|
33
|
-
default: () => ({
|
|
35
|
+
default: () => ({ color: 'primary', name: 'o_chevron_right' }),
|
|
34
36
|
type: Object
|
|
35
37
|
},
|
|
36
38
|
|
|
@@ -44,26 +46,32 @@ export default {
|
|
|
44
46
|
type: String
|
|
45
47
|
},
|
|
46
48
|
|
|
49
|
+
redirectOnIcon: {
|
|
50
|
+
default: true,
|
|
51
|
+
type: Boolean
|
|
52
|
+
},
|
|
53
|
+
|
|
47
54
|
to: {
|
|
48
55
|
default: () => ({}),
|
|
49
56
|
type: Object
|
|
50
57
|
},
|
|
51
58
|
|
|
52
|
-
|
|
59
|
+
useSectionActions: {
|
|
60
|
+
default: true,
|
|
53
61
|
type: Boolean
|
|
54
62
|
}
|
|
55
63
|
},
|
|
56
64
|
|
|
57
65
|
methods: {
|
|
58
|
-
redirect (item) {
|
|
59
|
-
return this.useIconRedirect ? undefined : this.getRedirectPayload(item)
|
|
60
|
-
},
|
|
61
|
-
|
|
62
66
|
getRedirectPayload (item) {
|
|
63
67
|
return {
|
|
64
68
|
params: { [this.redirectKey]: item[this.redirectKey] },
|
|
65
69
|
...this.to
|
|
66
70
|
}
|
|
71
|
+
},
|
|
72
|
+
|
|
73
|
+
redirect (item) {
|
|
74
|
+
return this.redirectOnIcon ? undefined : this.getRedirectPayload(item)
|
|
67
75
|
}
|
|
68
76
|
}
|
|
69
77
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<component :is="
|
|
2
|
+
<component :is="mx_componentTag">
|
|
3
3
|
<q-pull-to-refresh :disable="disableRefresh" @refresh="refresh">
|
|
4
4
|
<header v-if="hasHeaderSlot">
|
|
5
|
-
<slot :fields="
|
|
5
|
+
<slot :fields="mx_fields" :metadata="mx_metadata" name="header" :results="results" />
|
|
6
6
|
</header>
|
|
7
7
|
|
|
8
|
-
<slot v-if="
|
|
8
|
+
<slot v-if="useFilter" :entity="entity" :errors="mx_errors" :fields="mx_fields" :metadata="mx_metadata" name="filter" :results="results">
|
|
9
9
|
<qas-filters v-bind="filtersProps" :entity="entity" />
|
|
10
10
|
</slot>
|
|
11
11
|
|
|
12
12
|
<main class="relative-position">
|
|
13
13
|
<div v-if="hasResults">
|
|
14
|
-
<slot :fields="
|
|
14
|
+
<slot :fields="mx_fields" :metadata="mx_metadata" :results="results" />
|
|
15
15
|
</div>
|
|
16
16
|
|
|
17
|
-
<div v-else-if="!
|
|
18
|
-
<slot :fields="
|
|
17
|
+
<div v-else-if="!mx_isFetching">
|
|
18
|
+
<slot :fields="mx_fields" :metadata="mx_metadata" name="empty-results">
|
|
19
19
|
<div class="q-my-xl text-center">
|
|
20
20
|
<q-icon class="q-mb-sm text-center" color="grey-6" name="o_search" size="38px" />
|
|
21
21
|
<div class="text-grey-6">Nenhum item encontrado.</div>
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<q-pagination v-model="page" boundary-links class="flex-center" direction-links :input="$q.screen.lt.sm" :max="totalPages" :max-pages="6" @click="changePage" />
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
|
-
<q-inner-loading :showing="hasResults &&
|
|
34
|
+
<q-inner-loading :showing="hasResults && mx_isFetching">
|
|
35
35
|
<q-spinner color="grey" size="3em" />
|
|
36
36
|
</q-inner-loading>
|
|
37
37
|
</main>
|
|
@@ -42,9 +42,7 @@
|
|
|
42
42
|
</template>
|
|
43
43
|
|
|
44
44
|
<script>
|
|
45
|
-
import contextMixin from '../../mixins
|
|
46
|
-
import viewMixin from '../../mixins/view.js'
|
|
47
|
-
|
|
45
|
+
import { viewMixin, contextMixin } from '../../mixins'
|
|
48
46
|
import QasFilters from '../filters/QasFilters.vue'
|
|
49
47
|
|
|
50
48
|
export default {
|
|
@@ -59,8 +57,8 @@ export default {
|
|
|
59
57
|
type: Boolean
|
|
60
58
|
},
|
|
61
59
|
|
|
62
|
-
|
|
63
|
-
default:
|
|
60
|
+
useFilter: {
|
|
61
|
+
default: true,
|
|
64
62
|
type: Boolean
|
|
65
63
|
},
|
|
66
64
|
|
|
@@ -70,6 +68,8 @@ export default {
|
|
|
70
68
|
}
|
|
71
69
|
},
|
|
72
70
|
|
|
71
|
+
emits: ['fetch-success', 'fetch-error'],
|
|
72
|
+
|
|
73
73
|
data () {
|
|
74
74
|
return {
|
|
75
75
|
page: 1
|
|
@@ -77,13 +77,8 @@ export default {
|
|
|
77
77
|
},
|
|
78
78
|
|
|
79
79
|
computed: {
|
|
80
|
-
context () {
|
|
81
|
-
const { limit, ordering, page, search, ...filters } = this.$route.query
|
|
82
|
-
return { filters, limit, ordering, page: page ? parseInt(page) : 1, search }
|
|
83
|
-
},
|
|
84
|
-
|
|
85
80
|
hasHeaderSlot () {
|
|
86
|
-
return !!
|
|
81
|
+
return !!this.$slots.header
|
|
87
82
|
},
|
|
88
83
|
|
|
89
84
|
hasPages () {
|
|
@@ -104,9 +99,11 @@ export default {
|
|
|
104
99
|
},
|
|
105
100
|
|
|
106
101
|
watch: {
|
|
107
|
-
$route () {
|
|
108
|
-
|
|
109
|
-
|
|
102
|
+
$route (to, from) {
|
|
103
|
+
if (to.name === from.name) {
|
|
104
|
+
this.fetchList()
|
|
105
|
+
this.setCurrentPage()
|
|
106
|
+
}
|
|
110
107
|
}
|
|
111
108
|
},
|
|
112
109
|
|
|
@@ -122,22 +119,28 @@ export default {
|
|
|
122
119
|
},
|
|
123
120
|
|
|
124
121
|
async fetchList () {
|
|
125
|
-
this.
|
|
122
|
+
this.mx_isFetching = true
|
|
126
123
|
|
|
127
124
|
try {
|
|
128
|
-
const response = await this.$store.dispatch(`${this.entity}/fetchList`, { ...this.
|
|
125
|
+
const response = await this.$store.dispatch(`${this.entity}/fetchList`, { ...this.mx_context, url: this.url })
|
|
129
126
|
const { errors, fields, metadata } = response.data
|
|
130
127
|
|
|
131
|
-
this.
|
|
132
|
-
this.
|
|
133
|
-
this.
|
|
128
|
+
this.mx_setErrors(errors)
|
|
129
|
+
this.mx_setFields(fields)
|
|
130
|
+
this.mx_setMetadata(metadata)
|
|
131
|
+
|
|
132
|
+
this.mx_updateModels({
|
|
133
|
+
errors: errors,
|
|
134
|
+
fields: this.mx_fields,
|
|
135
|
+
metadata: metadata
|
|
136
|
+
})
|
|
134
137
|
|
|
135
138
|
this.$emit('fetch-success', response)
|
|
136
139
|
} catch (error) {
|
|
137
|
-
this.
|
|
140
|
+
this.mx_fetchError(error)
|
|
138
141
|
this.$emit('fetch-error', error)
|
|
139
142
|
} finally {
|
|
140
|
-
this.
|
|
143
|
+
this.mx_isFetching = false
|
|
141
144
|
}
|
|
142
145
|
},
|
|
143
146
|
|
|
@@ -1,25 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="qas-map">
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
<q-icon color="primary" name="o_search" size="24px" />
|
|
7
|
-
</div> -->
|
|
8
|
-
<gmap-map :center="centerPosition" class="qas-map__draw" :zoom="zoom">
|
|
9
|
-
<gmap-marker v-for="(marker, index) in markers" :key="index" :draggable="marker.draggable" :icon="marker.icon" :position="marker.position" @dragend="getPosition" @mouseout="closePopup" @mouseover="openPopup(marker, index)">
|
|
10
|
-
<gmap-info-window :opened="canShowPopup(index)">
|
|
3
|
+
<g-map-map :center="centerPosition" class="qas-map__draw" :zoom="zoom">
|
|
4
|
+
<g-map-marker v-for="(marker, index) in markers" :key="index" :draggable="marker.draggable" :icon="marker.icon" :position="marker.position" @dragend="updatePosition" @mouseout="closePopup" @mouseover="openPopup(marker, index)">
|
|
5
|
+
<g-map-info-window :opened="canShowPopup(index)">
|
|
11
6
|
<div class="text-weight-bold">{{ marker.title }}</div>
|
|
12
7
|
<div>{{ marker.description }}</div>
|
|
13
|
-
</
|
|
14
|
-
</
|
|
15
|
-
</
|
|
8
|
+
</g-map-info-window>
|
|
9
|
+
</g-map-marker>
|
|
10
|
+
</g-map-map>
|
|
16
11
|
</div>
|
|
17
12
|
</template>
|
|
18
13
|
|
|
19
14
|
<script>
|
|
20
|
-
import formMixin from '../../mixins
|
|
15
|
+
import { formMixin } from '../../mixins'
|
|
21
16
|
|
|
22
17
|
export default {
|
|
18
|
+
name: 'QasMap',
|
|
19
|
+
|
|
23
20
|
mixins: [
|
|
24
21
|
formMixin
|
|
25
22
|
],
|
|
@@ -27,11 +24,7 @@ export default {
|
|
|
27
24
|
props: {
|
|
28
25
|
centerPosition: {
|
|
29
26
|
type: Object,
|
|
30
|
-
default: () => {}
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
hasSearch: {
|
|
34
|
-
type: Boolean
|
|
27
|
+
default: () => ({})
|
|
35
28
|
},
|
|
36
29
|
|
|
37
30
|
markers: {
|
|
@@ -49,11 +42,13 @@ export default {
|
|
|
49
42
|
}
|
|
50
43
|
},
|
|
51
44
|
|
|
45
|
+
emits: ['update-position'],
|
|
46
|
+
|
|
52
47
|
data () {
|
|
53
48
|
return {
|
|
54
49
|
isPopupDisplayed: false,
|
|
55
50
|
currentPlace: null,
|
|
56
|
-
indexMarker:
|
|
51
|
+
indexMarker: null
|
|
57
52
|
}
|
|
58
53
|
},
|
|
59
54
|
|
|
@@ -71,21 +66,16 @@ export default {
|
|
|
71
66
|
this.isPopupDisplayed = false
|
|
72
67
|
},
|
|
73
68
|
|
|
74
|
-
|
|
69
|
+
updatePosition (mouseEvent) {
|
|
75
70
|
this.$emit('update-position', mouseEvent.latLng.toJSON())
|
|
76
71
|
}
|
|
77
|
-
|
|
78
|
-
// TODO descomentar quando implementar o input de pesquisa
|
|
79
|
-
// setPlace (place) {
|
|
80
|
-
// this.currentPlace = place
|
|
81
|
-
// }
|
|
82
72
|
}
|
|
83
73
|
}
|
|
84
74
|
</script>
|
|
85
75
|
|
|
86
76
|
<style lang="scss">
|
|
87
77
|
.qas-map {
|
|
88
|
-
&__draw{
|
|
78
|
+
&__draw {
|
|
89
79
|
height: 300px;
|
|
90
80
|
width: 100%;
|
|
91
81
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div :id="fieldName" class="qas-nested-fields">
|
|
3
3
|
<div class="text-left">
|
|
4
|
-
<qas-label v-if="useSingleLabel" :label="
|
|
4
|
+
<qas-label v-if="useSingleLabel" :label="fieldLabel" />
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
<div>
|
|
8
|
-
<component :is="
|
|
8
|
+
<component :is="componentTag" ref="inputContent" name="fade" tag="div">
|
|
9
9
|
<div v-for="(row, index) in nested" :id="`row-${index}`" :key="index" class="full-width">
|
|
10
|
-
<component :is="
|
|
10
|
+
<component :is="componentTag" name="fade" tag="div">
|
|
11
11
|
<div v-if="!row[destroyKey]" :key="index" class="col-12 q-mt-md">
|
|
12
12
|
<div>
|
|
13
13
|
<div class="flex items-center justify-between q-py-xs">
|
|
@@ -21,16 +21,20 @@
|
|
|
21
21
|
|
|
22
22
|
<div ref="formGenerator" class="col-12 justify-between q-col-gutter-x-md row">
|
|
23
23
|
<slot :errors="transformedErrors" :fields="children" :index="index" name="fields" :update-value="updateValuesFromInput">
|
|
24
|
-
<qas-form-generator v-model="nested[index]" :class="formClasses" :columns="formColumns" :errors="transformedErrors[index]" :fields="children" :fields-
|
|
25
|
-
<template v-for="(slot, key) in $
|
|
24
|
+
<qas-form-generator v-model="nested[index]" :class="formClasses" :columns="formColumns" :errors="transformedErrors[index]" :fields="children" :fields-props="fieldsProps" @update:model-value="updateValuesFromInput($event, index)">
|
|
25
|
+
<template v-for="(slot, key) in $slots" #[key]="scope">
|
|
26
26
|
<slot :name="key" v-bind="scope" />
|
|
27
27
|
</template>
|
|
28
28
|
</qas-form-generator>
|
|
29
29
|
</slot>
|
|
30
30
|
|
|
31
31
|
<div v-if="useInlineActions" class="flex items-center qas-nested-fields__actions">
|
|
32
|
-
<
|
|
33
|
-
|
|
32
|
+
<div class="col-auto">
|
|
33
|
+
<qas-btn v-if="useDuplicate" color="primary" flat icon="o_content_copy" round @click="add(row)" />
|
|
34
|
+
</div>
|
|
35
|
+
<div class="col-auto">
|
|
36
|
+
<qas-btn v-if="showDestroyBtn" color="negative" flat icon="o_cancel" round @click="destroy(index, row)" />
|
|
37
|
+
</div>
|
|
34
38
|
</div>
|
|
35
39
|
</div>
|
|
36
40
|
|
|
@@ -45,15 +49,17 @@
|
|
|
45
49
|
|
|
46
50
|
<slot :add="add" name="add-input">
|
|
47
51
|
<div v-if="useInlineActions" class="cursor-pointer items-center q-col-gutter-x-md q-mt-md row" @click="add()">
|
|
48
|
-
<
|
|
52
|
+
<div class="col">
|
|
53
|
+
<qas-input class="disabled no-pointer-events" hide-bottom-space :label="addInputLabel" outlined @focus="add()" />
|
|
54
|
+
</div>
|
|
49
55
|
|
|
50
|
-
<div>
|
|
51
|
-
<qas-btn
|
|
56
|
+
<div class="col-auto">
|
|
57
|
+
<qas-btn color="green" flat icon="o_add_circle_outline" round />
|
|
52
58
|
</div>
|
|
53
59
|
</div>
|
|
54
60
|
|
|
55
61
|
<div v-else class="q-mt-lg">
|
|
56
|
-
<qas-btn
|
|
62
|
+
<qas-btn class="full-width q-py-sm" icon="o_add" outline @click="add()">{{ addInputLabel }}</qas-btn>
|
|
57
63
|
</div>
|
|
58
64
|
</slot>
|
|
59
65
|
</div>
|
|
@@ -61,12 +67,12 @@
|
|
|
61
67
|
</template>
|
|
62
68
|
|
|
63
69
|
<script>
|
|
64
|
-
import QasBtn from '../btn/QasBtn'
|
|
65
|
-
import QasFormGenerator from '../form-generator/QasFormGenerator'
|
|
66
|
-
import QasInput from '../input/QasInput'
|
|
67
|
-
import QasLabel from '../label/QasLabel'
|
|
68
|
-
import { constructObject } from '../../helpers'
|
|
70
|
+
import QasBtn from '../btn/QasBtn.vue'
|
|
71
|
+
import QasFormGenerator from '../form-generator/QasFormGenerator.vue'
|
|
72
|
+
import QasInput from '../input/QasInput.vue'
|
|
73
|
+
import QasLabel from '../label/QasLabel.vue'
|
|
69
74
|
|
|
75
|
+
import { constructObject } from '../../helpers'
|
|
70
76
|
import { extend } from 'quasar'
|
|
71
77
|
import { camelize } from 'humps'
|
|
72
78
|
|
|
@@ -126,11 +132,6 @@ export default {
|
|
|
126
132
|
default: () => ({})
|
|
127
133
|
},
|
|
128
134
|
|
|
129
|
-
fieldsEvents: {
|
|
130
|
-
type: Object,
|
|
131
|
-
default: () => ({})
|
|
132
|
-
},
|
|
133
|
-
|
|
134
135
|
fieldsProps: {
|
|
135
136
|
type: Object,
|
|
136
137
|
default: () => ({})
|
|
@@ -191,12 +192,14 @@ export default {
|
|
|
191
192
|
type: Boolean
|
|
192
193
|
},
|
|
193
194
|
|
|
194
|
-
|
|
195
|
+
modelValue: {
|
|
195
196
|
type: Array,
|
|
196
197
|
default: () => []
|
|
197
198
|
}
|
|
198
199
|
},
|
|
199
200
|
|
|
201
|
+
emits: ['update:modelValue'],
|
|
202
|
+
|
|
200
203
|
data () {
|
|
201
204
|
return {
|
|
202
205
|
nested: []
|
|
@@ -204,7 +207,7 @@ export default {
|
|
|
204
207
|
},
|
|
205
208
|
|
|
206
209
|
computed: {
|
|
207
|
-
|
|
210
|
+
fieldLabel () {
|
|
208
211
|
return this.field?.label
|
|
209
212
|
},
|
|
210
213
|
|
|
@@ -234,16 +237,16 @@ export default {
|
|
|
234
237
|
},
|
|
235
238
|
|
|
236
239
|
transformedErrors () {
|
|
237
|
-
return constructObject(this.fieldName, this.errors)
|
|
240
|
+
return Array.isArray(this.errors) ? this.errors : constructObject(this.fieldName, this.errors)
|
|
238
241
|
},
|
|
239
242
|
|
|
240
|
-
|
|
243
|
+
componentTag () {
|
|
241
244
|
return this.useAnimation ? 'transition-group' : 'div'
|
|
242
245
|
}
|
|
243
246
|
},
|
|
244
247
|
|
|
245
248
|
watch: {
|
|
246
|
-
|
|
249
|
+
modelValue: {
|
|
247
250
|
handler (value) {
|
|
248
251
|
this.nested = extend(true, [], value)
|
|
249
252
|
},
|
|
@@ -251,8 +254,8 @@ export default {
|
|
|
251
254
|
},
|
|
252
255
|
|
|
253
256
|
field: {
|
|
254
|
-
handler (
|
|
255
|
-
!this.
|
|
257
|
+
handler () {
|
|
258
|
+
!this.modelValue.length && this.setDefaultNestedValue()
|
|
256
259
|
},
|
|
257
260
|
immediate: true
|
|
258
261
|
}
|
|
@@ -267,7 +270,7 @@ export default {
|
|
|
267
270
|
this.setFocus()
|
|
268
271
|
})
|
|
269
272
|
|
|
270
|
-
return this.
|
|
273
|
+
return this.updateModelValue()
|
|
271
274
|
},
|
|
272
275
|
|
|
273
276
|
setFocus () {
|
|
@@ -277,8 +280,8 @@ export default {
|
|
|
277
280
|
return firstElementToBeFocused?.focus && firstElementToBeFocused.focus()
|
|
278
281
|
},
|
|
279
282
|
|
|
280
|
-
|
|
281
|
-
return this.$emit('
|
|
283
|
+
updateModelValue (value) {
|
|
284
|
+
return this.$emit('update:modelValue', value || this.nested)
|
|
282
285
|
},
|
|
283
286
|
|
|
284
287
|
destroy (index, row) {
|
|
@@ -286,22 +289,22 @@ export default {
|
|
|
286
289
|
? this.nested.splice(index, 1, { [this.destroyKey]: true, ...row })
|
|
287
290
|
: this.nested.splice(index, 1)
|
|
288
291
|
|
|
289
|
-
return this.
|
|
292
|
+
return this.updateModelValue()
|
|
290
293
|
},
|
|
291
294
|
|
|
292
295
|
updateValuesFromInput (value, index) {
|
|
293
296
|
this.nested.splice(index, 1, value)
|
|
294
297
|
|
|
295
|
-
return this.
|
|
298
|
+
return this.updateModelValue(null, index)
|
|
296
299
|
},
|
|
297
300
|
|
|
298
|
-
|
|
301
|
+
setDefaultNestedValue () {
|
|
299
302
|
this.nested.splice(0, 0, { ...this.rowObject })
|
|
300
303
|
},
|
|
301
304
|
|
|
302
305
|
setScroll () {
|
|
303
306
|
const elements = this.$refs.inputContent.children
|
|
304
|
-
const element = elements[elements.length - 1]
|
|
307
|
+
const element = elements[elements.length - 1]
|
|
305
308
|
const { top } = element.getBoundingClientRect()
|
|
306
309
|
const pageOffset = window.pageYOffset
|
|
307
310
|
|
|
@@ -316,7 +319,7 @@ export default {
|
|
|
316
319
|
return this.useIndexLabel ? `${this.rowLabel} ${rowKey + 1}` : this.rowLabel
|
|
317
320
|
}
|
|
318
321
|
|
|
319
|
-
return this.
|
|
322
|
+
return this.fieldLabel
|
|
320
323
|
}
|
|
321
324
|
}
|
|
322
325
|
}
|