@bildvitta/quasar-ui-asteroid 2.16.0 → 3.0.0-alpha.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.
- package/dist/api/QasActions.json +40 -0
- package/dist/api/QasActionsMenu.json +64 -0
- package/dist/api/QasAlert.json +40 -0
- package/dist/api/QasAppBar.json +52 -0
- package/dist/api/QasAppMenu.json +38 -0
- package/dist/api/QasAvatar.json +44 -0
- package/dist/api/QasBox.json +16 -0
- package/dist/api/QasBreakline.json +32 -0
- package/dist/api/QasBtn.json +16 -0
- package/dist/api/QasCard.json +52 -0
- package/dist/api/QasCheckboxGroup.json +38 -0
- package/dist/api/QasCopy.json +29 -0
- package/dist/api/QasDateTimeInput.json +60 -0
- package/dist/api/QasDebugger.json +13 -0
- package/dist/api/QasDelete.json +64 -0
- package/dist/api/QasDialog.json +109 -0
- package/dist/api/QasDialogRouter.json +31 -0
- package/dist/api/QasField.json +56 -0
- package/dist/api/QasFilters.json +111 -0
- package/dist/api/QasFormGenerator.json +92 -0
- package/dist/api/QasFormView.json +228 -0
- package/dist/api/QasGallery.json +54 -0
- package/dist/api/QasGridGenerator.json +108 -0
- package/dist/api/QasInput.json +40 -0
- package/dist/api/QasLabel.json +40 -0
- package/dist/api/QasLayout.json +47 -0
- package/dist/api/QasListItems.json +72 -0
- package/dist/api/QasListView.json +161 -0
- package/dist/api/QasMap.json +41 -0
- package/dist/api/QasNestedFields.json +223 -0
- package/dist/api/QasNumericInput.json +68 -0
- package/dist/api/QasPageHeader.json +36 -0
- package/dist/api/QasPasswordInput.json +121 -0
- package/dist/api/QasPasswordStrengthChecker.json +126 -0
- package/dist/api/QasProfile.json +74 -0
- package/dist/api/QasResizer.json +34 -0
- package/dist/api/QasSearchBox.json +91 -0
- package/dist/api/QasSelect.json +88 -0
- package/dist/api/QasSelectList.json +134 -0
- package/dist/api/QasSignaturePad.json +63 -0
- package/dist/api/QasSignatureUploader.json +41 -0
- package/dist/api/QasSingleView.json +147 -0
- package/dist/api/QasSortable.json +80 -0
- package/dist/api/QasTableGenerator.json +56 -0
- package/dist/api/QasTabsGenerator.json +90 -0
- package/dist/api/QasTextTruncate.json +38 -0
- package/dist/api/QasTransfer.json +70 -0
- package/dist/api/QasUploader.json +143 -0
- package/dist/asteroid.cjs.css +1 -0
- package/dist/asteroid.cjs.js +9307 -0
- package/dist/asteroid.cjs.min.js +6 -0
- package/dist/asteroid.esm.css +1 -0
- package/dist/asteroid.esm.js +9298 -0
- package/dist/asteroid.esm.min.js +6 -0
- package/dist/asteroid.umd.css +1 -0
- package/dist/asteroid.umd.js +9301 -0
- package/dist/asteroid.umd.min.js +6 -0
- package/dist/vetur/asteroid-attributes.json +1178 -0
- package/dist/vetur/asteroid-tags.json +535 -0
- package/package.json +41 -56
- package/src/assets/logo-modular.svg +1 -1
- package/src/asteroid.js +1 -0
- package/src/components/actions/QasActions.vue +45 -0
- package/src/components/actions/QasActions.yml +24 -0
- package/src/components/actions-menu/QasActionsMenu.vue +41 -14
- package/src/components/actions-menu/QasActionsMenu.yml +63 -0
- package/src/components/alert/QasAlert.vue +90 -0
- package/src/components/alert/QasAlert.yml +33 -0
- package/src/components/app-bar/QasAppBar.vue +16 -13
- package/src/components/app-bar/QasAppBar.yml +51 -0
- package/src/components/app-menu/QasAppMenu.vue +10 -12
- package/src/components/app-menu/QasAppMenu.yml +32 -0
- package/src/components/avatar/QasAvatar.vue +17 -9
- package/src/components/avatar/QasAvatar.yml +38 -0
- 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 +13 -0
- package/src/components/card/QasCard.vue +32 -33
- package/src/components/card/QasCard.yml +42 -0
- package/src/components/checkbox-group/QasCheckboxGroup.vue +50 -17
- package/src/components/checkbox-group/QasCheckboxGroup.yml +30 -0
- package/src/components/copy/QasCopy.vue +22 -11
- package/src/components/copy/QasCopy.yml +20 -0
- package/src/components/date-time-input/QasDateTimeInput.vue +18 -26
- package/src/components/date-time-input/QasDateTimeInput.yml +54 -0
- package/src/components/debugger/QasDebugger.vue +2 -0
- package/src/components/debugger/QasDebugger.yml +10 -0
- package/src/components/delete/QasDelete.vue +43 -16
- package/src/components/delete/QasDelete.yml +52 -0
- package/src/components/dialog/QasDialog.vue +63 -67
- package/src/components/dialog/QasDialog.yml +86 -0
- package/src/components/dialog-router/QasDialogRouter.vue +14 -4
- package/src/components/dialog-router/QasDialogRouter.yml +23 -0
- package/src/components/field/QasField.vue +21 -24
- package/src/components/field/QasField.yml +31 -0
- package/src/components/filters/QasFilters.vue +33 -26
- package/src/components/filters/QasFilters.yml +91 -0
- package/src/components/form-generator/QasFormGenerator.vue +13 -15
- package/src/components/form-generator/QasFormGenerator.yml +64 -0
- package/src/components/form-view/QasFormView.vue +129 -69
- package/src/components/form-view/QasFormView.yml +179 -0
- package/src/components/gallery/QasGallery.vue +47 -30
- package/src/components/gallery/QasGallery.yml +51 -0
- package/src/components/grid-generator/QasGridGenerator.vue +15 -7
- package/src/components/grid-generator/QasGridGenerator.yml +73 -0
- package/src/components/index.js +0 -0
- package/src/components/input/QasInput.vue +43 -36
- package/src/components/input/QasInput.yml +32 -0
- package/src/components/label/QasLabel.vue +14 -15
- package/src/components/label/QasLabel.yml +28 -0
- package/src/components/layout/QasLayout.vue +13 -21
- package/src/components/layout/QasLayout.yml +38 -0
- package/src/components/list-items/QasListItems.vue +15 -12
- package/src/components/list-items/QasListItems.yml +57 -0
- package/src/components/list-view/QasListView.vue +57 -31
- package/src/components/list-view/QasListView.yml +132 -0
- package/src/components/map/QasMap.vue +15 -31
- package/src/components/map/QasMap.yml +33 -0
- package/src/components/nested-fields/QasNestedFields.vue +57 -47
- package/src/components/nested-fields/QasNestedFields.yml +180 -0
- package/src/components/numeric-input/QasNumericInput.vue +31 -22
- package/src/components/numeric-input/QasNumericInput.yml +51 -0
- package/src/components/page-header/QasPageHeader.vue +20 -11
- package/src/components/page-header/QasPageHeader.yml +24 -0
- package/src/components/password-input/QasPasswordInput.vue +24 -21
- package/src/components/password-input/QasPasswordInput.yml +103 -0
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.vue +51 -34
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.yml +103 -0
- package/src/components/profile/QasProfile.vue +15 -13
- package/src/components/profile/QasProfile.yml +60 -0
- package/src/components/resizer/QasResizer.vue +3 -3
- package/src/components/resizer/QasResizer.yml +23 -0
- package/src/components/search-box/QasSearchBox.vue +50 -21
- package/src/components/search-box/QasSearchBox.yml +76 -0
- package/src/components/select/QasSelect.vue +51 -50
- package/src/components/select/QasSelect.yml +62 -0
- package/src/components/select-list/QasSelectList.vue +72 -53
- package/src/components/select-list/QasSelectList.yml +116 -0
- package/src/components/signature-pad/QasSignaturePad.vue +60 -40
- package/src/components/signature-pad/QasSignaturePad.yml +53 -0
- package/src/components/signature-uploader/QasSignatureUploader.vue +19 -17
- package/src/components/signature-uploader/QasSignatureUploader.yml +36 -0
- package/src/components/single-view/QasSingleView.vue +41 -22
- package/src/components/single-view/QasSingleView.yml +116 -0
- package/src/components/sortable/QasSortable.vue +51 -30
- package/src/components/sortable/QasSortable.yml +65 -0
- package/src/components/table-generator/QasTableGenerator.vue +112 -21
- package/src/components/table-generator/QasTableGenerator.yml +46 -0
- package/src/components/tabs-generator/QasTabsGenerator.vue +37 -25
- package/src/components/tabs-generator/QasTabsGenerator.yml +67 -0
- package/src/components/text-truncate/QasTextTruncate.vue +25 -17
- package/src/components/text-truncate/QasTextTruncate.yml +32 -0
- package/src/components/transfer/QasTransfer.vue +48 -49
- package/src/components/transfer/QasTransfer.yml +59 -0
- package/src/components/uploader/QasUploader.vue +169 -48
- package/src/components/uploader/QasUploader.yml +117 -0
- 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 +8 -4
- package/src/helpers/{greatestCommonDivisor.js → get-greatest-common-divisor.js} +0 -0
- package/src/helpers/get-slot-children-text.js +15 -0
- package/src/helpers/images.js +28 -0
- package/src/helpers/index.js +11 -59
- package/src/helpers/{isLocalDevelopment.js → is-local-development.js} +0 -0
- package/src/helpers/set-scroll-on-grab.js +61 -0
- package/src/index.cjs.js +1 -0
- package/src/index.esm.js +4 -0
- package/src/index.scss +19 -21
- 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 +62 -22
- package/src/plugins/dialog/Dialog.js +14 -0
- package/src/plugins/dialog/Dialog.yml +10 -0
- package/src/plugins/index.js +4 -2
- package/src/plugins/{NotifyError.js → notify-error/NotifyError.js} +0 -0
- package/src/plugins/notify-error/NotifyError.yml +11 -0
- package/src/plugins/{NotifySuccess.js → notify-success/NotifySuccess.js} +3 -3
- package/src/plugins/notify-success/NotifySuccess.yml +11 -0
- 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 -84
- package/src/components/app-menu/QasAppMenu.stories.js +0 -66
- 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/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 -142
- package/src/components/input/QasInput.stories.js +0 -78
- package/src/components/label/QasLabel.stories.js +0 -60
- package/src/components/layout/QasLayout.stories.js +0 -104
- package/src/components/list-items/QasListItems.stories.js +0 -135
- 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/numeric-input/QasNumericInput.stories.js +0 -92
- 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 -120
- 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 -120
- 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 -249
- 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,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
|
-
}
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
import QasFormView from './QasFormView.vue'
|
|
2
|
-
import QasDebugger from '../debugger/QasDebugger'
|
|
3
|
-
|
|
4
|
-
import Vuex from 'vuex'
|
|
5
|
-
import users from '../../mocks/storeModule'
|
|
6
|
-
|
|
7
|
-
const slotDefaults = {
|
|
8
|
-
defaultValue: {
|
|
9
|
-
detail: JSON.stringify({
|
|
10
|
-
errors: 'object',
|
|
11
|
-
fields: 'object',
|
|
12
|
-
metadata: 'object'
|
|
13
|
-
}),
|
|
14
|
-
summary: '{}'
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
type: {
|
|
18
|
-
summary: null
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default {
|
|
23
|
-
component: QasFormView,
|
|
24
|
-
title: 'Components/FormView',
|
|
25
|
-
|
|
26
|
-
parameters: {
|
|
27
|
-
docs: {
|
|
28
|
-
description: {
|
|
29
|
-
component: 'Create forms like a magic, you can use this component with create and edit mode.'
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
argTypes: {
|
|
35
|
-
// Props
|
|
36
|
-
cancelButton: {
|
|
37
|
-
description: 'Cancel button label.'
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
cancelRoute: {
|
|
41
|
-
description: 'Cancel button route.'
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
customId: {
|
|
45
|
-
control: null,
|
|
46
|
-
description: 'Sets a custom id to `entity`. When not set, will use the `:id` route param.'
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
dialog: {
|
|
50
|
-
description: 'Use when the component is inside a dialog.'
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
disable: {
|
|
54
|
-
description: 'Disable actions buttons.'
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
entity: {
|
|
58
|
-
control: null,
|
|
59
|
-
description: '[VuexStoreModule](https://github.com/bildvitta/vuex-store-module) entity.'
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
mode: {
|
|
63
|
-
control: { type: 'select', options: ['create', 'replace', 'update'] },
|
|
64
|
-
description: 'Use `create` when you want to create a new entry (`POST`). To edit an existing entry, use `replace` (`PUT`) or `update` (`PATCH`).'
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
readOnly: {
|
|
68
|
-
description: 'Disable action buttons and submit method.'
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
route: {
|
|
72
|
-
description: 'Page route.'
|
|
73
|
-
},
|
|
74
|
-
|
|
75
|
-
showDialogOnUnsavedChanges: {
|
|
76
|
-
description: 'Enable dialog when leave page without save changes.'
|
|
77
|
-
},
|
|
78
|
-
|
|
79
|
-
submitButton: {
|
|
80
|
-
description: 'Submit button label.'
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
url: {
|
|
84
|
-
control: null,
|
|
85
|
-
description: 'Ignore entity and specify another endpoint.'
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
value: {
|
|
89
|
-
description: 'Model value.'
|
|
90
|
-
},
|
|
91
|
-
|
|
92
|
-
// Events
|
|
93
|
-
'fetch-error': {
|
|
94
|
-
description: 'Fires when occur an error fetching value.',
|
|
95
|
-
table: {
|
|
96
|
-
defaultValue: {
|
|
97
|
-
detail: JSON.stringify({ value: 'object' }),
|
|
98
|
-
summary: '{}'
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
'fetch-success': {
|
|
104
|
-
description: 'Fires when successfully get the value.',
|
|
105
|
-
table: {
|
|
106
|
-
defaultValue: {
|
|
107
|
-
detail: JSON.stringify({ response: 'object', value: 'object' }),
|
|
108
|
-
summary: '{}'
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
input: {
|
|
114
|
-
description: 'Fires when model changes. Is also used by `v-model`.',
|
|
115
|
-
table: {
|
|
116
|
-
defaultValue: {
|
|
117
|
-
detail: JSON.stringify({ error: 'object' }),
|
|
118
|
-
summary: '{}'
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
'submit-error': {
|
|
124
|
-
description: 'Fires when occur an error updating value.',
|
|
125
|
-
table: {
|
|
126
|
-
defaultValue: {
|
|
127
|
-
detail: JSON.stringify({ response: 'object', value: 'object' }),
|
|
128
|
-
summary: '{}'
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
'submit-success': {
|
|
134
|
-
description: 'Fires when the value is successfully updated.',
|
|
135
|
-
table: {
|
|
136
|
-
defaultValue: {
|
|
137
|
-
detail: JSON.stringify({ error: 'object', value: 'object' }),
|
|
138
|
-
summary: '{}'
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
},
|
|
142
|
-
|
|
143
|
-
// Slots
|
|
144
|
-
default: {
|
|
145
|
-
description: 'Main content.',
|
|
146
|
-
table: {
|
|
147
|
-
...slotDefaults
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
|
|
151
|
-
actions: {
|
|
152
|
-
description: 'Actions buttons content.',
|
|
153
|
-
table: {
|
|
154
|
-
...slotDefaults
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
|
|
158
|
-
footer: {
|
|
159
|
-
description: 'Page\'s footer content.',
|
|
160
|
-
table: {
|
|
161
|
-
...slotDefaults
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
|
|
165
|
-
header: {
|
|
166
|
-
description: 'Page\'s header content.',
|
|
167
|
-
table: {
|
|
168
|
-
...slotDefaults
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
const Template = (args, { argTypes }) => ({
|
|
175
|
-
components: { QasFormView, QasDebugger },
|
|
176
|
-
props: Object.keys(argTypes),
|
|
177
|
-
|
|
178
|
-
store: new Vuex.Store({
|
|
179
|
-
modules: { users }
|
|
180
|
-
}),
|
|
181
|
-
|
|
182
|
-
data () {
|
|
183
|
-
return {
|
|
184
|
-
values: {}
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
template:
|
|
189
|
-
`<q-layout>
|
|
190
|
-
<q-page-container>
|
|
191
|
-
<qas-form-view v-model="values" v-bind="$props">
|
|
192
|
-
<template v-slot="{ errors, fields, metadata }">
|
|
193
|
-
Fields: <qas-debugger :inspect="[fields]" />
|
|
194
|
-
Values: <qas-debugger :inspect="[values]" />
|
|
195
|
-
</template>
|
|
196
|
-
</qas-form-view>
|
|
197
|
-
</q-page-container>
|
|
198
|
-
</q-layout>`
|
|
199
|
-
})
|
|
200
|
-
|
|
201
|
-
const template = `
|
|
202
|
-
<qas-form-view v-model="values" entity="users">
|
|
203
|
-
<template v-slot="{ errors, fields, metadata }">
|
|
204
|
-
Fields: <qas-debugger :inspect="[fields]" />
|
|
205
|
-
Values: <qas-debugger :inspect="[values]" />
|
|
206
|
-
</template>
|
|
207
|
-
</qas-form-view>
|
|
208
|
-
`
|
|
209
|
-
|
|
210
|
-
export const CreateMode = Template.bind({})
|
|
211
|
-
|
|
212
|
-
CreateMode.args = {
|
|
213
|
-
customId: '123',
|
|
214
|
-
entity: 'users',
|
|
215
|
-
url: 'users'
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
CreateMode.parameters = {
|
|
219
|
-
docs: {
|
|
220
|
-
source: { code: template }
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
export const EditMode = Template.bind({})
|
|
225
|
-
|
|
226
|
-
EditMode.args = {
|
|
227
|
-
customId: 'a755a6d1-fc4a-4961-a8cc-b2293fe5b81c',
|
|
228
|
-
entity: 'users',
|
|
229
|
-
mode: 'replace'
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
EditMode.parameters = {
|
|
233
|
-
docs: {
|
|
234
|
-
source: { code: template }
|
|
235
|
-
}
|
|
236
|
-
}
|