@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.
Files changed (188) hide show
  1. package/dist/api/QasBox.json +16 -0
  2. package/dist/api/QasBreakline.json +32 -0
  3. package/dist/api/QasBtn.json +15 -0
  4. package/dist/api/QasDebugger.json +13 -0
  5. package/dist/asteroid.cjs.css +1 -0
  6. package/dist/asteroid.cjs.js +9154 -0
  7. package/dist/asteroid.cjs.min.js +6 -0
  8. package/dist/asteroid.esm.css +1 -0
  9. package/dist/asteroid.esm.js +9145 -0
  10. package/dist/asteroid.esm.min.js +6 -0
  11. package/dist/asteroid.umd.css +1 -0
  12. package/dist/asteroid.umd.js +9148 -0
  13. package/dist/asteroid.umd.min.js +6 -0
  14. package/dist/vetur/asteroid-attributes.json +30 -0
  15. package/dist/vetur/asteroid-tags.json +29 -0
  16. package/package.json +42 -56
  17. package/src/assets/logo-modular.svg +1 -0
  18. package/src/asteroid.js +1 -0
  19. package/src/components/actions/QasActions.vue +45 -0
  20. package/src/components/actions-menu/QasActionsMenu.vue +8 -19
  21. package/src/components/alert/QasAlert.vue +90 -0
  22. package/src/components/app-bar/QasAppBar.vue +59 -61
  23. package/src/components/app-menu/QasAppMenu.vue +128 -41
  24. package/src/components/avatar/QasAvatar.vue +7 -3
  25. package/src/components/box/QasBox.vue +12 -4
  26. package/src/components/box/QasBox.yml +13 -0
  27. package/src/components/breakline/QasBreakline.vue +37 -0
  28. package/src/components/breakline/QasBreakline.yml +25 -0
  29. package/src/components/btn/QasBtn.vue +27 -24
  30. package/src/components/btn/QasBtn.yml +12 -0
  31. package/src/components/card/QasCard.vue +29 -21
  32. package/src/components/checkbox-group/QasCheckboxGroup.vue +31 -17
  33. package/src/components/copy/QasCopy.vue +22 -11
  34. package/src/components/date-time-input/QasDateTimeInput.vue +16 -26
  35. package/src/components/debugger/QasDebugger.vue +2 -0
  36. package/src/components/debugger/QasDebugger.yml +10 -0
  37. package/src/components/delete/QasDelete.vue +28 -15
  38. package/src/components/dialog/QasDialog.vue +71 -67
  39. package/src/components/dialog-router/QasDialogRouter.vue +12 -4
  40. package/src/components/field/QasField.vue +22 -25
  41. package/src/components/filters/QasFilters.vue +31 -24
  42. package/src/components/form-generator/QasFormGenerator.vue +13 -15
  43. package/src/components/form-view/QasFormView.vue +117 -66
  44. package/src/components/gallery/QasGallery.vue +39 -26
  45. package/src/components/grid-generator/QasGridGenerator.vue +12 -6
  46. package/src/components/index.js +0 -0
  47. package/src/components/input/QasInput.vue +38 -36
  48. package/src/components/label/QasLabel.vue +14 -15
  49. package/src/components/layout/QasLayout.vue +81 -0
  50. package/src/components/list-items/QasListItems.vue +16 -8
  51. package/src/components/list-view/QasListView.vue +31 -28
  52. package/src/components/map/QasMap.vue +15 -25
  53. package/src/components/nested-fields/QasNestedFields.vue +39 -36
  54. package/src/components/numeric-input/QasNumericInput.vue +125 -0
  55. package/src/components/page-header/QasPageHeader.vue +19 -10
  56. package/src/components/password-input/QasPasswordInput.vue +20 -18
  57. package/src/components/password-strength-checker/QasPasswordStrengthChecker.vue +52 -31
  58. package/src/components/profile/QasProfile.vue +14 -12
  59. package/src/components/resizer/QasResizer.vue +1 -1
  60. package/src/components/search-box/QasSearchBox.vue +36 -20
  61. package/src/components/select/QasSelect.vue +43 -44
  62. package/src/components/select-list/QasSelectList.vue +64 -51
  63. package/src/components/signature-pad/QasSignaturePad.vue +57 -41
  64. package/src/components/signature-uploader/QasSignatureUploader.vue +15 -13
  65. package/src/components/single-view/QasSingleView.vue +31 -17
  66. package/src/components/sortable/QasSortable.vue +45 -27
  67. package/src/components/table-generator/QasTableGenerator.vue +95 -22
  68. package/src/components/tabs-generator/QasTabsGenerator.vue +36 -24
  69. package/src/components/text-truncate/QasTextTruncate.vue +25 -17
  70. package/src/components/transfer/QasTransfer.vue +57 -53
  71. package/src/components/uploader/QasUploader.vue +169 -48
  72. package/src/css/background.scss +1 -1
  73. package/src/css/border.scss +7 -6
  74. package/src/css/design-system.scss +0 -43
  75. package/src/css/fonts.scss +2 -28
  76. package/src/css/opacity.scss +0 -4
  77. package/src/css/set-brand.scss +15 -0
  78. package/src/css/transitions.scss +1 -1
  79. package/src/helpers/add-counter-suffix.js +3 -0
  80. package/src/helpers/{base64ToBlob.js → base-64-to-blob.js} +0 -0
  81. package/src/helpers/{constructObject.js → construct-object.js} +0 -0
  82. package/src/helpers/filter-object.js +8 -6
  83. package/src/helpers/filters.js +3 -4
  84. package/src/helpers/get-slot-children-text.js +15 -0
  85. package/src/helpers/{greatestCommonDivisor.js → greatest-common-divisor.js} +0 -0
  86. package/src/helpers/images.js +28 -0
  87. package/src/helpers/index.js +11 -57
  88. package/src/helpers/is-local-development.js +3 -0
  89. package/src/helpers/scroll-on-grap.js +61 -0
  90. package/src/index.cjs.js +1 -0
  91. package/src/index.esm.js +4 -0
  92. package/src/index.scss +18 -20
  93. package/src/index.umd.js +2 -0
  94. package/src/mixins/context.js +1 -1
  95. package/src/mixins/dialog-router.js +17 -0
  96. package/src/mixins/form.js +4 -12
  97. package/src/mixins/generator.js +14 -14
  98. package/src/mixins/index.js +2 -8
  99. package/src/mixins/password.js +73 -11
  100. package/src/mixins/screen.js +8 -6
  101. package/src/mixins/view.js +57 -20
  102. package/src/plugins/Dialog.js +14 -0
  103. package/src/plugins/NotifySuccess.js +3 -3
  104. package/src/plugins/index.js +4 -2
  105. package/src/store/history.js +43 -0
  106. package/src/store/index.js +1 -0
  107. package/src/vue-plugin.js +185 -0
  108. package/.babelrc +0 -12
  109. package/.storybook/main.js +0 -35
  110. package/.storybook/preview.js +0 -26
  111. package/debug.log +0 -1
  112. package/index.js +0 -4
  113. package/jest-setup.js +0 -1
  114. package/jest.config.json +0 -22
  115. package/postcss.config.js +0 -5
  116. package/src/components/Introduction.stories.mdx +0 -12
  117. package/src/components/actions-menu/QasActionsMenu.stories.js +0 -73
  118. package/src/components/app-bar/QasAppBar.stories.js +0 -88
  119. package/src/components/app-menu/QasAppMenu.stories.js +0 -62
  120. package/src/components/apps-menu/QasAppsMenu.spec.js +0 -58
  121. package/src/components/apps-menu/QasAppsMenu.stories.js +0 -54
  122. package/src/components/apps-menu/QasAppsMenu.vue +0 -48
  123. package/src/components/avatar/QasAvatar.spec.js +0 -14
  124. package/src/components/avatar/QasAvatar.stories.js +0 -52
  125. package/src/components/box/QasBox.spec.js +0 -18
  126. package/src/components/box/QasBox.stories.js +0 -35
  127. package/src/components/break-line/QasBreakLine.stories.js +0 -57
  128. package/src/components/break-line/QasBreakLine.vue +0 -52
  129. package/src/components/btn/QasBtn.stories.js +0 -45
  130. package/src/components/btn-actions/QasBtnActions.stories.js +0 -77
  131. package/src/components/btn-actions/QasBtnActions.vue +0 -54
  132. package/src/components/card/QasCard.stories.js +0 -126
  133. package/src/components/checkbox-group/QasCheckboxGroup.stories.js +0 -59
  134. package/src/components/copy/QasCopy.stories.js +0 -41
  135. package/src/components/date-time-input/QasDateTimeInput.stories.js +0 -67
  136. package/src/components/debugger/QasDebugger.stories.js +0 -33
  137. package/src/components/decimal-input/QasDecimalInput.stories.js +0 -82
  138. package/src/components/decimal-input/QasDecimalInput.vue +0 -92
  139. package/src/components/delete/QasDelete.stories.js +0 -80
  140. package/src/components/dialog/QasDialog.stories.js +0 -139
  141. package/src/components/dialog-router/QasDialogRouter.stories.js +0 -38
  142. package/src/components/field/QasField.stories.js +0 -181
  143. package/src/components/filters/QasFilters.stories.js +0 -121
  144. package/src/components/form-generator/QasFormGenerator.stories.js +0 -115
  145. package/src/components/form-view/QasFormView.stories.js +0 -236
  146. package/src/components/gallery/QasGallery.stories.js +0 -91
  147. package/src/components/grid-generator/QasGridGenerator.stories.js +0 -138
  148. package/src/components/input/QasInput.stories.js +0 -78
  149. package/src/components/label/QasLabel.stories.js +0 -60
  150. package/src/components/list-items/QasListItems.stories.js +0 -130
  151. package/src/components/list-view/QasListView.stories.js +0 -168
  152. package/src/components/map/QasMap.stories.js +0 -75
  153. package/src/components/nested-fields/QasNestedFields.stories.js +0 -255
  154. package/src/components/page-header/QasPageHeader.stories.js +0 -61
  155. package/src/components/password-input/QasPasswordInput.stories.js +0 -76
  156. package/src/components/password-strength-checker/QasPasswordStrengthChecker.stories.js +0 -54
  157. package/src/components/profile/QasProfile.stories.js +0 -131
  158. package/src/components/resizer/QasResizer.stories.js +0 -43
  159. package/src/components/search-box/QasSearchBox.stories.js +0 -111
  160. package/src/components/select/QasSelect.stories.js +0 -113
  161. package/src/components/select-list/QasSelectList.stories.js +0 -153
  162. package/src/components/signature-pad/QasSignaturePad.stories.js +0 -51
  163. package/src/components/signature-uploader/QasSignatureUploader.stories.js +0 -69
  164. package/src/components/single-view/QasSingleView.stories.js +0 -130
  165. package/src/components/sortable/QasSortable.stories.js +0 -80
  166. package/src/components/table-generator/QasTableGenerator.stories.js +0 -116
  167. package/src/components/tabs-generator/QasTabsGenerator.stories.js +0 -145
  168. package/src/components/text-truncate/QasTextTruncate.stories.js +0 -55
  169. package/src/components/tip/QasTip.stories.js +0 -57
  170. package/src/components/tip/QasTip.vue +0 -68
  171. package/src/components/tooltip/QasTooltip.stories.js +0 -63
  172. package/src/components/tooltip/QasTooltip.vue +0 -81
  173. package/src/components/transfer/QasTransfer.stories.js +0 -118
  174. package/src/components/uploader/QasCustomUploader.vue +0 -121
  175. package/src/components/uploader/QasUploader.stories.js +0 -139
  176. package/src/directives/Test.js +0 -13
  177. package/src/helpers/historyHandler.js +0 -52
  178. package/src/helpers/label.js +0 -3
  179. package/src/index.js +0 -245
  180. package/src/mixins/map-markers.js +0 -26
  181. package/src/mixins/unsaved-changes.js +0 -24
  182. package/src/mixins/uploader.js +0 -30
  183. package/src/mocks/json/user.json +0 -27
  184. package/src/mocks/json/users-new.json +0 -23
  185. package/src/mocks/json/users.json +0 -97
  186. package/src/mocks/storeModule.js +0 -71
  187. package/src/pages/Forbidden.vue +0 -6
  188. 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
- }