@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,139 +0,0 @@
|
|
|
1
|
-
import QasDialog from './QasDialog.vue'
|
|
2
|
-
import QasBtn from '../btn/QasBtn.vue'
|
|
3
|
-
|
|
4
|
-
const noSummary = {
|
|
5
|
-
type: { summary: null }
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
component: QasDialog,
|
|
10
|
-
title: 'Components/Dialog',
|
|
11
|
-
|
|
12
|
-
parameters: {
|
|
13
|
-
docs: {
|
|
14
|
-
description: {
|
|
15
|
-
component: 'Extends [QDialog](https://quasar.dev/vue-components/dialog).'
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
argTypes: {
|
|
21
|
-
// Props
|
|
22
|
-
btnActions: {
|
|
23
|
-
description: 'Props of QasBtnActions component.'
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
cancel: {
|
|
27
|
-
description: '[QBtn](https://quasar.dev/vue-components/button) props and events for "Cancel" button. Use `props` and `events` keys to configure the component, or use `false` to hide the button.',
|
|
28
|
-
table: {
|
|
29
|
-
defaultValue: {
|
|
30
|
-
detail: JSON.stringify({ props: { label: 'Cancel', outline: true } }),
|
|
31
|
-
summary: '{}'
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
card: {
|
|
37
|
-
description: 'Content of [QCard](https://quasar.dev/vue-components/card), mast have key <strong>title</strong> and <strong>description</strong>'
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
cardProps: {
|
|
41
|
-
description: 'Props of [QCard](https://quasar.dev/vue-components/card) component.'
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
maxWidth: {
|
|
45
|
-
description: 'Max width of QCard.',
|
|
46
|
-
table: {
|
|
47
|
-
defaultValue: { summary: '600px' }
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
minWidth: {
|
|
52
|
-
description: 'Min width of QCard.',
|
|
53
|
-
table: {
|
|
54
|
-
defaultValue: { summary: '400px' }
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
ok: {
|
|
59
|
-
description: '[QBtn](https://quasar.dev/vue-components/button) props and events for "Ok" button. Use `props` and `events` keys to configure the component, or use `false` to hide the button.',
|
|
60
|
-
table: {
|
|
61
|
-
defaultValue: {
|
|
62
|
-
detail: JSON.stringify({ props: { label: 'Ok' } }),
|
|
63
|
-
summary: '{}'
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
persistent: {
|
|
69
|
-
description: 'User cannot dismiss [QDialog](https://quasar.dev/vue-components/dialog) if clicking outside of it or hitting ESC key. Also, an app route change won\'t dismiss it.'
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
value: {
|
|
73
|
-
description: 'Model value to toggle the visibility of the dialog.',
|
|
74
|
-
table: {
|
|
75
|
-
control: { summary: null },
|
|
76
|
-
defaultValue: { summary: true }
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
useForm: {
|
|
81
|
-
description: 'Generate form and trigger validate based input rules'
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
// Events
|
|
85
|
-
input: {
|
|
86
|
-
description: 'Fires when toggles the dialog\'s visibility.'
|
|
87
|
-
},
|
|
88
|
-
|
|
89
|
-
// Slots
|
|
90
|
-
actions: {
|
|
91
|
-
description: 'Actions slot.',
|
|
92
|
-
table: noSummary
|
|
93
|
-
},
|
|
94
|
-
|
|
95
|
-
description: {
|
|
96
|
-
description: 'Description slot.',
|
|
97
|
-
table: noSummary
|
|
98
|
-
},
|
|
99
|
-
|
|
100
|
-
header: {
|
|
101
|
-
description: 'Header slot',
|
|
102
|
-
table: noSummary
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const Template = (args, { argTypes }) => ({
|
|
108
|
-
components: { QasBtn, QasDialog },
|
|
109
|
-
props: Object.keys(argTypes),
|
|
110
|
-
|
|
111
|
-
data () {
|
|
112
|
-
return {
|
|
113
|
-
dialog: false
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
template:
|
|
118
|
-
`<div>
|
|
119
|
-
<qas-btn label="Open dialog!" @click="dialog = !dialog"/>
|
|
120
|
-
<qas-dialog v-bind="$props" v-model="dialog" />
|
|
121
|
-
</div>`
|
|
122
|
-
})
|
|
123
|
-
|
|
124
|
-
export const Default = Template.bind({})
|
|
125
|
-
|
|
126
|
-
Default.args = {
|
|
127
|
-
cancel: {
|
|
128
|
-
props: { label: 'Cancel', outline: true }
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
card: {
|
|
132
|
-
description: 'This is a description.',
|
|
133
|
-
title: 'This is a title.'
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
ok: {
|
|
137
|
-
props: { label: 'Ok, thanks!' }
|
|
138
|
-
}
|
|
139
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import VueRouter from 'vue-router'
|
|
2
|
-
|
|
3
|
-
import QasBtn from '../btn/QasBtn.vue'
|
|
4
|
-
import QasDialogRouter from './QasDialogRouter.vue'
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
component: QasDialogRouter,
|
|
8
|
-
title: 'Components/DialogRouter',
|
|
9
|
-
|
|
10
|
-
parameters: {
|
|
11
|
-
docs: {
|
|
12
|
-
description: {
|
|
13
|
-
component: 'Open an Vue component (like a page) inside [QDialog](https://quasar.dev/vue-components/dialog).'
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
argTypes: {
|
|
19
|
-
hide: {
|
|
20
|
-
description: 'Controls dialog\'s visibility.'
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// TODO: Fazer um mock de componente na rota para o exemplo funcionar.
|
|
26
|
-
const Template = (args, { argTypes }) => ({
|
|
27
|
-
components: { QasBtn, QasDialogRouter },
|
|
28
|
-
props: Object.keys(argTypes),
|
|
29
|
-
router: new VueRouter(),
|
|
30
|
-
template:
|
|
31
|
-
`<div>
|
|
32
|
-
<qas-btn label="Open dialog" @click="$refs.dialog.show('')" />
|
|
33
|
-
<qas-dialog-router ref="dialog" v-bind="$props" />
|
|
34
|
-
</div>`
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
export const Default = Template.bind({})
|
|
38
|
-
Default.args = {}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import QasField from './QasField.vue'
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
component: QasField,
|
|
5
|
-
title: 'Components/Field',
|
|
6
|
-
|
|
7
|
-
parameters: {
|
|
8
|
-
docs: {
|
|
9
|
-
description: {
|
|
10
|
-
component: 'Wildcard form field component based on their types. Used by `QasFormGenerator`.'
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
argTypes: {
|
|
16
|
-
// Props
|
|
17
|
-
error: {
|
|
18
|
-
description: 'Error messages.'
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
field: {
|
|
22
|
-
description: 'An object with props to be bypassed to matched field component.'
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
// Events
|
|
26
|
-
input: {
|
|
27
|
-
description: 'Fires when model changes. Is also used by `v-model`.',
|
|
28
|
-
table: {
|
|
29
|
-
defaultValue: { summary: null }
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function templateGenerator (model) {
|
|
36
|
-
return (args, { argTypes }) => ({
|
|
37
|
-
components: { QasField },
|
|
38
|
-
props: Object.keys(argTypes),
|
|
39
|
-
|
|
40
|
-
data () {
|
|
41
|
-
return {
|
|
42
|
-
model
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
template: '<qas-field v-model="model" v-bind="$props" />'
|
|
47
|
-
})
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const Template = templateGenerator('')
|
|
51
|
-
const NumberTemplate = templateGenerator(0)
|
|
52
|
-
const CheckboxTemplate = templateGenerator([])
|
|
53
|
-
const DecimalInputTemplate = templateGenerator(0)
|
|
54
|
-
|
|
55
|
-
export const Default = Template.bind({})
|
|
56
|
-
Default.args = {
|
|
57
|
-
field: { label: 'Name', type: 'text' }
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export const Textarea = Template.bind({})
|
|
61
|
-
Textarea.args = {
|
|
62
|
-
field: { label: 'Textarea', type: 'textarea' }
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Email
|
|
66
|
-
export const Email = Template.bind({})
|
|
67
|
-
|
|
68
|
-
Email.args = {
|
|
69
|
-
field: { label: 'E-mail', type: 'email' }
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Password
|
|
73
|
-
export const Password = Template.bind({})
|
|
74
|
-
|
|
75
|
-
Password.args = {
|
|
76
|
-
field: { label: 'Password', type: 'password', pattern: /(?=^.{8,}$)((?=.*\d)|(?=.*\W+))(?![.\n])(?=.*[A-Z])(?=.*[a-z]).*$/ }
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Number
|
|
80
|
-
export const Number = NumberTemplate.bind({})
|
|
81
|
-
|
|
82
|
-
Number.args = {
|
|
83
|
-
field: { label: 'Number', type: 'number' }
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Decimal
|
|
87
|
-
export const Decimal = DecimalInputTemplate.bind({})
|
|
88
|
-
|
|
89
|
-
Decimal.args = {
|
|
90
|
-
field: { label: 'Decimal', type: 'decimal' }
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// Percent
|
|
94
|
-
export const Percent = DecimalInputTemplate.bind({})
|
|
95
|
-
|
|
96
|
-
Percent.args = {
|
|
97
|
-
field: { label: 'Percent', type: 'percent' }
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Money
|
|
101
|
-
export const Money = DecimalInputTemplate.bind({})
|
|
102
|
-
|
|
103
|
-
Money.args = {
|
|
104
|
-
field: { label: 'Money', type: 'money' }
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Date Time
|
|
108
|
-
export const DateTime = Template.bind({})
|
|
109
|
-
|
|
110
|
-
DateTime.args = {
|
|
111
|
-
field: { label: 'Datetime', type: 'datetime' }
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
// Date
|
|
115
|
-
export const Date = Template.bind({})
|
|
116
|
-
|
|
117
|
-
Date.args = {
|
|
118
|
-
field: { label: 'Date', type: 'date' }
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
// Time
|
|
122
|
-
export const Time = Template.bind({})
|
|
123
|
-
|
|
124
|
-
Time.args = {
|
|
125
|
-
field: { label: 'Time', type: 'time' }
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Boolean
|
|
129
|
-
export const Boolean = Template.bind({})
|
|
130
|
-
|
|
131
|
-
Boolean.args = {
|
|
132
|
-
field: { label: 'Boolean', default: true, type: 'boolean' }
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
// Checkbox
|
|
136
|
-
export const Checkbox = CheckboxTemplate.bind({})
|
|
137
|
-
|
|
138
|
-
Checkbox.args = {
|
|
139
|
-
field: { name: 'Checkbox', label: 'Checkbox', type: 'checkbox', options: [{ label: 'Example1', value: 'Example1' }, { label: 'Example2', value: 'Example2' }] }
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
// Radio
|
|
143
|
-
export const Radio = Template.bind({})
|
|
144
|
-
|
|
145
|
-
Radio.args = {
|
|
146
|
-
field: {
|
|
147
|
-
options: [{ label: 'Example1', value: 'Example1' }, { label: 'Example2', value: 'Example2' }],
|
|
148
|
-
type: 'radio'
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// Select
|
|
153
|
-
export const Select = Template.bind({})
|
|
154
|
-
|
|
155
|
-
Select.args = {
|
|
156
|
-
field: {
|
|
157
|
-
options: [{ label: 'Example1', value: 'Example1' }, { label: 'Example2', value: 'Example2' }, { label: 'Example3', value: 'Example3' }, { label: 'Example4', value: 'Example4' }],
|
|
158
|
-
type: 'select'
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// Upload
|
|
163
|
-
export const Upload = Template.bind({})
|
|
164
|
-
|
|
165
|
-
Upload.args = {
|
|
166
|
-
field: { entity: 'posts/image', label: 'Image', type: 'upload' }
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
// Editor
|
|
170
|
-
export const Editor = Template.bind({})
|
|
171
|
-
|
|
172
|
-
Editor.args = {
|
|
173
|
-
field: { name: 'Editor', type: 'editor', value: '' }
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// Hidden
|
|
177
|
-
export const Hidden = Template.bind({})
|
|
178
|
-
|
|
179
|
-
Hidden.args = {
|
|
180
|
-
field: { label: 'Hidden', type: 'hidden' }
|
|
181
|
-
}
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import Vuex from 'vuex'
|
|
2
|
-
import VueRouter from 'vue-router'
|
|
3
|
-
|
|
4
|
-
import users from '../../mocks/storeModule'
|
|
5
|
-
|
|
6
|
-
import QasFilters from './QasFilters.vue'
|
|
7
|
-
|
|
8
|
-
const noSummary = {
|
|
9
|
-
type: { summary: null }
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
component: QasFilters,
|
|
14
|
-
title: 'Components/Filters',
|
|
15
|
-
|
|
16
|
-
parameters: {
|
|
17
|
-
docs: {
|
|
18
|
-
description: {
|
|
19
|
-
component: 'Generates fields to be used as filters. Used by `QasListView`.'
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
argTypes: {
|
|
25
|
-
badges: {
|
|
26
|
-
description: 'Show current filters as badges.'
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
entity: {
|
|
30
|
-
control: null,
|
|
31
|
-
description: '[VuexStoreModule](https://github.com/bildvitta/vuex-store-module) entity.'
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
noFilterButton: {
|
|
35
|
-
description: 'Hides filter button.'
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
noSearch: {
|
|
39
|
-
description: 'Hides search field.'
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
searchOnType: {
|
|
43
|
-
description: 'Search on type.'
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
searchPlaceholder: {
|
|
47
|
-
description: 'Search field placeholder.'
|
|
48
|
-
},
|
|
49
|
-
|
|
50
|
-
url: {
|
|
51
|
-
control: null,
|
|
52
|
-
description: 'Ignore entity and specify another endpoint.'
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
// Events
|
|
56
|
-
'fetch-error': {
|
|
57
|
-
description: 'Fires when occur an error fetching value.',
|
|
58
|
-
table: {
|
|
59
|
-
defaultValue: { summary: JSON.stringify({ error: 'object' }) }
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
'fetch-success': {
|
|
64
|
-
description: 'Fires when successfully get the value.',
|
|
65
|
-
table: {
|
|
66
|
-
defaultValue: { summary: JSON.stringify({ response: 'object' }) }
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
// Slots
|
|
71
|
-
default: {
|
|
72
|
-
description: 'Bottom content.',
|
|
73
|
-
table: {
|
|
74
|
-
...noSummary,
|
|
75
|
-
defaultValue: {
|
|
76
|
-
summary: JSON.stringify({
|
|
77
|
-
context: 'object',
|
|
78
|
-
filter: 'function',
|
|
79
|
-
filters: 'object',
|
|
80
|
-
removeFilter: 'function'
|
|
81
|
-
})
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
'filter-button': {
|
|
87
|
-
description: 'Filter button content.',
|
|
88
|
-
table: {
|
|
89
|
-
defaultValue: { summary: JSON.stringify({ filter: 'function' }) },
|
|
90
|
-
...noSummary
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
|
|
94
|
-
search: {
|
|
95
|
-
description: 'Search input content.',
|
|
96
|
-
table: {
|
|
97
|
-
defaultValue: { summary: JSON.stringify({ filter: 'function' }) },
|
|
98
|
-
...noSummary
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
const Template = (args, { argTypes }) => ({
|
|
105
|
-
components: { QasFilters },
|
|
106
|
-
props: Object.keys(argTypes),
|
|
107
|
-
|
|
108
|
-
router: new VueRouter(),
|
|
109
|
-
|
|
110
|
-
store: new Vuex.Store({
|
|
111
|
-
modules: { users }
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
template: '<qas-filters v-bind="$props" />'
|
|
115
|
-
})
|
|
116
|
-
|
|
117
|
-
export const Default = Template.bind({})
|
|
118
|
-
|
|
119
|
-
Default.args = {
|
|
120
|
-
entity: 'users'
|
|
121
|
-
}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import QasFormGenerator from './QasFormGenerator.vue'
|
|
2
|
-
|
|
3
|
-
const slotDefaults = {
|
|
4
|
-
table: {
|
|
5
|
-
category: 'slots',
|
|
6
|
-
defaultValue: { summary: JSON.stringify({ field: 'object' }) },
|
|
7
|
-
type: { summary: null }
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export default {
|
|
12
|
-
component: QasFormGenerator,
|
|
13
|
-
title: 'Components/FormGenerator',
|
|
14
|
-
|
|
15
|
-
parameters: {
|
|
16
|
-
docs: {
|
|
17
|
-
description: {
|
|
18
|
-
component: 'Generates form fields like a magic!'
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
argTypes: {
|
|
24
|
-
columns: {
|
|
25
|
-
description: 'Define size of each field column.',
|
|
26
|
-
table: {
|
|
27
|
-
defaultValue: { summary: '[] || {}' }
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
errors: {
|
|
32
|
-
description: 'Each field error.'
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
fields: {
|
|
36
|
-
description: 'Fields to be dynamic generated.'
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
fieldsEvents: {
|
|
40
|
-
description: 'Defines each field events.'
|
|
41
|
-
},
|
|
42
|
-
|
|
43
|
-
fieldsProps: {
|
|
44
|
-
description: 'Defines each field prop.'
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
gutter: {
|
|
48
|
-
description: 'Gutter space by Quasar convention. `q-col-gutter-{$gutter}`.'
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
value: {
|
|
52
|
-
description: 'Model value.'
|
|
53
|
-
},
|
|
54
|
-
|
|
55
|
-
// Events
|
|
56
|
-
input: {
|
|
57
|
-
description: 'Fires when model changes. Is also used by `v-model`.',
|
|
58
|
-
table: {
|
|
59
|
-
defaultValue: { summary: JSON.stringify({ value: 'object' }) }
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
|
|
63
|
-
// slot
|
|
64
|
-
default: {
|
|
65
|
-
table: { disable: true }
|
|
66
|
-
},
|
|
67
|
-
|
|
68
|
-
'field-[field.name]': {
|
|
69
|
-
description: 'Each field inside `fields` is a slot.',
|
|
70
|
-
...slotDefaults
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const Template = (args, { argTypes }) => ({
|
|
76
|
-
components: { QasFormGenerator },
|
|
77
|
-
props: Object.keys(argTypes),
|
|
78
|
-
|
|
79
|
-
data () {
|
|
80
|
-
return {
|
|
81
|
-
values: {}
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
|
|
85
|
-
template:
|
|
86
|
-
`<div>
|
|
87
|
-
<qas-form-generator v-model="values" v-bind="$props" />
|
|
88
|
-
<pre>{{ values }}</pre>
|
|
89
|
-
</div>`
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
const fields = {
|
|
93
|
-
name: { name: 'name', label: 'Full name', type: 'text' },
|
|
94
|
-
email: { name: 'email', label: 'E-mail', type: 'email' },
|
|
95
|
-
phone: { name: 'phone', label: 'Phone', type: 'text', mask: 'phone' },
|
|
96
|
-
gender: { name: 'gender', label: 'Gender', type: 'text' },
|
|
97
|
-
document: { name: 'document', label: 'Document', type: 'text', mask: 'document' },
|
|
98
|
-
address: { name: 'address', label: 'Address', type: 'text' }
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const columns = {
|
|
102
|
-
name: { col: 12, sm: 6 },
|
|
103
|
-
email: { col: 12, sm: 6 },
|
|
104
|
-
phone: { col: 12, sm: 6 },
|
|
105
|
-
gender: { col: 12, sm: 6 },
|
|
106
|
-
document: { col: 12 },
|
|
107
|
-
address: { col: 12 }
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export const Default = Template.bind({})
|
|
111
|
-
|
|
112
|
-
Default.args = {
|
|
113
|
-
columns,
|
|
114
|
-
fields
|
|
115
|
-
}
|