@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.
Files changed (280) hide show
  1. package/dist/api/QasActions.json +40 -0
  2. package/dist/api/QasActionsMenu.json +64 -0
  3. package/dist/api/QasAlert.json +40 -0
  4. package/dist/api/QasAppBar.json +52 -0
  5. package/dist/api/QasAppMenu.json +38 -0
  6. package/dist/api/QasAvatar.json +44 -0
  7. package/dist/api/QasBox.json +16 -0
  8. package/dist/api/QasBreakline.json +32 -0
  9. package/dist/api/QasBtn.json +16 -0
  10. package/dist/api/QasCard.json +52 -0
  11. package/dist/api/QasCheckboxGroup.json +38 -0
  12. package/dist/api/QasCopy.json +29 -0
  13. package/dist/api/QasDateTimeInput.json +60 -0
  14. package/dist/api/QasDebugger.json +13 -0
  15. package/dist/api/QasDelete.json +64 -0
  16. package/dist/api/QasDialog.json +109 -0
  17. package/dist/api/QasDialogRouter.json +31 -0
  18. package/dist/api/QasField.json +56 -0
  19. package/dist/api/QasFilters.json +111 -0
  20. package/dist/api/QasFormGenerator.json +92 -0
  21. package/dist/api/QasFormView.json +228 -0
  22. package/dist/api/QasGallery.json +54 -0
  23. package/dist/api/QasGridGenerator.json +108 -0
  24. package/dist/api/QasInput.json +40 -0
  25. package/dist/api/QasLabel.json +40 -0
  26. package/dist/api/QasLayout.json +47 -0
  27. package/dist/api/QasListItems.json +72 -0
  28. package/dist/api/QasListView.json +161 -0
  29. package/dist/api/QasMap.json +41 -0
  30. package/dist/api/QasNestedFields.json +223 -0
  31. package/dist/api/QasNumericInput.json +68 -0
  32. package/dist/api/QasPageHeader.json +36 -0
  33. package/dist/api/QasPasswordInput.json +121 -0
  34. package/dist/api/QasPasswordStrengthChecker.json +126 -0
  35. package/dist/api/QasProfile.json +74 -0
  36. package/dist/api/QasResizer.json +34 -0
  37. package/dist/api/QasSearchBox.json +91 -0
  38. package/dist/api/QasSelect.json +88 -0
  39. package/dist/api/QasSelectList.json +134 -0
  40. package/dist/api/QasSignaturePad.json +63 -0
  41. package/dist/api/QasSignatureUploader.json +41 -0
  42. package/dist/api/QasSingleView.json +147 -0
  43. package/dist/api/QasSortable.json +80 -0
  44. package/dist/api/QasTableGenerator.json +56 -0
  45. package/dist/api/QasTabsGenerator.json +90 -0
  46. package/dist/api/QasTextTruncate.json +38 -0
  47. package/dist/api/QasTransfer.json +70 -0
  48. package/dist/api/QasUploader.json +143 -0
  49. package/dist/asteroid.cjs.css +1 -0
  50. package/dist/asteroid.cjs.js +9307 -0
  51. package/dist/asteroid.cjs.min.js +6 -0
  52. package/dist/asteroid.esm.css +1 -0
  53. package/dist/asteroid.esm.js +9298 -0
  54. package/dist/asteroid.esm.min.js +6 -0
  55. package/dist/asteroid.umd.css +1 -0
  56. package/dist/asteroid.umd.js +9301 -0
  57. package/dist/asteroid.umd.min.js +6 -0
  58. package/dist/vetur/asteroid-attributes.json +1178 -0
  59. package/dist/vetur/asteroid-tags.json +535 -0
  60. package/package.json +41 -56
  61. package/src/assets/logo-modular.svg +1 -1
  62. package/src/asteroid.js +1 -0
  63. package/src/components/actions/QasActions.vue +45 -0
  64. package/src/components/actions/QasActions.yml +24 -0
  65. package/src/components/actions-menu/QasActionsMenu.vue +41 -14
  66. package/src/components/actions-menu/QasActionsMenu.yml +63 -0
  67. package/src/components/alert/QasAlert.vue +90 -0
  68. package/src/components/alert/QasAlert.yml +33 -0
  69. package/src/components/app-bar/QasAppBar.vue +16 -13
  70. package/src/components/app-bar/QasAppBar.yml +51 -0
  71. package/src/components/app-menu/QasAppMenu.vue +10 -12
  72. package/src/components/app-menu/QasAppMenu.yml +32 -0
  73. package/src/components/avatar/QasAvatar.vue +17 -9
  74. package/src/components/avatar/QasAvatar.yml +38 -0
  75. package/src/components/box/QasBox.vue +12 -4
  76. package/src/components/box/QasBox.yml +13 -0
  77. package/src/components/breakline/QasBreakline.vue +37 -0
  78. package/src/components/breakline/QasBreakline.yml +25 -0
  79. package/src/components/btn/QasBtn.vue +27 -24
  80. package/src/components/btn/QasBtn.yml +13 -0
  81. package/src/components/card/QasCard.vue +32 -33
  82. package/src/components/card/QasCard.yml +42 -0
  83. package/src/components/checkbox-group/QasCheckboxGroup.vue +50 -17
  84. package/src/components/checkbox-group/QasCheckboxGroup.yml +30 -0
  85. package/src/components/copy/QasCopy.vue +22 -11
  86. package/src/components/copy/QasCopy.yml +20 -0
  87. package/src/components/date-time-input/QasDateTimeInput.vue +18 -26
  88. package/src/components/date-time-input/QasDateTimeInput.yml +54 -0
  89. package/src/components/debugger/QasDebugger.vue +2 -0
  90. package/src/components/debugger/QasDebugger.yml +10 -0
  91. package/src/components/delete/QasDelete.vue +43 -16
  92. package/src/components/delete/QasDelete.yml +52 -0
  93. package/src/components/dialog/QasDialog.vue +63 -67
  94. package/src/components/dialog/QasDialog.yml +86 -0
  95. package/src/components/dialog-router/QasDialogRouter.vue +14 -4
  96. package/src/components/dialog-router/QasDialogRouter.yml +23 -0
  97. package/src/components/field/QasField.vue +21 -24
  98. package/src/components/field/QasField.yml +31 -0
  99. package/src/components/filters/QasFilters.vue +33 -26
  100. package/src/components/filters/QasFilters.yml +91 -0
  101. package/src/components/form-generator/QasFormGenerator.vue +13 -15
  102. package/src/components/form-generator/QasFormGenerator.yml +64 -0
  103. package/src/components/form-view/QasFormView.vue +129 -69
  104. package/src/components/form-view/QasFormView.yml +179 -0
  105. package/src/components/gallery/QasGallery.vue +47 -30
  106. package/src/components/gallery/QasGallery.yml +51 -0
  107. package/src/components/grid-generator/QasGridGenerator.vue +15 -7
  108. package/src/components/grid-generator/QasGridGenerator.yml +73 -0
  109. package/src/components/index.js +0 -0
  110. package/src/components/input/QasInput.vue +43 -36
  111. package/src/components/input/QasInput.yml +32 -0
  112. package/src/components/label/QasLabel.vue +14 -15
  113. package/src/components/label/QasLabel.yml +28 -0
  114. package/src/components/layout/QasLayout.vue +13 -21
  115. package/src/components/layout/QasLayout.yml +38 -0
  116. package/src/components/list-items/QasListItems.vue +15 -12
  117. package/src/components/list-items/QasListItems.yml +57 -0
  118. package/src/components/list-view/QasListView.vue +57 -31
  119. package/src/components/list-view/QasListView.yml +132 -0
  120. package/src/components/map/QasMap.vue +15 -31
  121. package/src/components/map/QasMap.yml +33 -0
  122. package/src/components/nested-fields/QasNestedFields.vue +57 -47
  123. package/src/components/nested-fields/QasNestedFields.yml +180 -0
  124. package/src/components/numeric-input/QasNumericInput.vue +31 -22
  125. package/src/components/numeric-input/QasNumericInput.yml +51 -0
  126. package/src/components/page-header/QasPageHeader.vue +20 -11
  127. package/src/components/page-header/QasPageHeader.yml +24 -0
  128. package/src/components/password-input/QasPasswordInput.vue +24 -21
  129. package/src/components/password-input/QasPasswordInput.yml +103 -0
  130. package/src/components/password-strength-checker/QasPasswordStrengthChecker.vue +51 -34
  131. package/src/components/password-strength-checker/QasPasswordStrengthChecker.yml +103 -0
  132. package/src/components/profile/QasProfile.vue +15 -13
  133. package/src/components/profile/QasProfile.yml +60 -0
  134. package/src/components/resizer/QasResizer.vue +3 -3
  135. package/src/components/resizer/QasResizer.yml +23 -0
  136. package/src/components/search-box/QasSearchBox.vue +50 -21
  137. package/src/components/search-box/QasSearchBox.yml +76 -0
  138. package/src/components/select/QasSelect.vue +51 -50
  139. package/src/components/select/QasSelect.yml +62 -0
  140. package/src/components/select-list/QasSelectList.vue +72 -53
  141. package/src/components/select-list/QasSelectList.yml +116 -0
  142. package/src/components/signature-pad/QasSignaturePad.vue +60 -40
  143. package/src/components/signature-pad/QasSignaturePad.yml +53 -0
  144. package/src/components/signature-uploader/QasSignatureUploader.vue +19 -17
  145. package/src/components/signature-uploader/QasSignatureUploader.yml +36 -0
  146. package/src/components/single-view/QasSingleView.vue +41 -22
  147. package/src/components/single-view/QasSingleView.yml +116 -0
  148. package/src/components/sortable/QasSortable.vue +51 -30
  149. package/src/components/sortable/QasSortable.yml +65 -0
  150. package/src/components/table-generator/QasTableGenerator.vue +112 -21
  151. package/src/components/table-generator/QasTableGenerator.yml +46 -0
  152. package/src/components/tabs-generator/QasTabsGenerator.vue +37 -25
  153. package/src/components/tabs-generator/QasTabsGenerator.yml +67 -0
  154. package/src/components/text-truncate/QasTextTruncate.vue +25 -17
  155. package/src/components/text-truncate/QasTextTruncate.yml +32 -0
  156. package/src/components/transfer/QasTransfer.vue +48 -49
  157. package/src/components/transfer/QasTransfer.yml +59 -0
  158. package/src/components/uploader/QasUploader.vue +169 -48
  159. package/src/components/uploader/QasUploader.yml +117 -0
  160. package/src/css/background.scss +1 -1
  161. package/src/css/border.scss +7 -6
  162. package/src/css/design-system.scss +0 -43
  163. package/src/css/fonts.scss +2 -28
  164. package/src/css/opacity.scss +0 -4
  165. package/src/css/set-brand.scss +15 -0
  166. package/src/css/transitions.scss +1 -1
  167. package/src/helpers/add-counter-suffix.js +3 -0
  168. package/src/helpers/{base64ToBlob.js → base-64-to-blob.js} +0 -0
  169. package/src/helpers/{constructObject.js → construct-object.js} +0 -0
  170. package/src/helpers/filter-object.js +8 -6
  171. package/src/helpers/filters.js +8 -4
  172. package/src/helpers/{greatestCommonDivisor.js → get-greatest-common-divisor.js} +0 -0
  173. package/src/helpers/get-slot-children-text.js +15 -0
  174. package/src/helpers/images.js +28 -0
  175. package/src/helpers/index.js +11 -59
  176. package/src/helpers/{isLocalDevelopment.js → is-local-development.js} +0 -0
  177. package/src/helpers/set-scroll-on-grab.js +61 -0
  178. package/src/index.cjs.js +1 -0
  179. package/src/index.esm.js +4 -0
  180. package/src/index.scss +19 -21
  181. package/src/index.umd.js +2 -0
  182. package/src/mixins/context.js +1 -1
  183. package/src/mixins/dialog-router.js +17 -0
  184. package/src/mixins/form.js +4 -12
  185. package/src/mixins/generator.js +14 -14
  186. package/src/mixins/index.js +2 -8
  187. package/src/mixins/password.js +73 -11
  188. package/src/mixins/screen.js +8 -6
  189. package/src/mixins/view.js +62 -22
  190. package/src/plugins/dialog/Dialog.js +14 -0
  191. package/src/plugins/dialog/Dialog.yml +10 -0
  192. package/src/plugins/index.js +4 -2
  193. package/src/plugins/{NotifyError.js → notify-error/NotifyError.js} +0 -0
  194. package/src/plugins/notify-error/NotifyError.yml +11 -0
  195. package/src/plugins/{NotifySuccess.js → notify-success/NotifySuccess.js} +3 -3
  196. package/src/plugins/notify-success/NotifySuccess.yml +11 -0
  197. package/src/store/history.js +43 -0
  198. package/src/store/index.js +1 -0
  199. package/src/vue-plugin.js +185 -0
  200. package/.babelrc +0 -12
  201. package/.storybook/main.js +0 -35
  202. package/.storybook/preview.js +0 -26
  203. package/debug.log +0 -1
  204. package/index.js +0 -4
  205. package/jest-setup.js +0 -1
  206. package/jest.config.json +0 -22
  207. package/postcss.config.js +0 -5
  208. package/src/components/Introduction.stories.mdx +0 -12
  209. package/src/components/actions-menu/QasActionsMenu.stories.js +0 -73
  210. package/src/components/app-bar/QasAppBar.stories.js +0 -84
  211. package/src/components/app-menu/QasAppMenu.stories.js +0 -66
  212. package/src/components/apps-menu/QasAppsMenu.spec.js +0 -58
  213. package/src/components/apps-menu/QasAppsMenu.stories.js +0 -54
  214. package/src/components/apps-menu/QasAppsMenu.vue +0 -48
  215. package/src/components/avatar/QasAvatar.spec.js +0 -14
  216. package/src/components/avatar/QasAvatar.stories.js +0 -52
  217. package/src/components/box/QasBox.spec.js +0 -18
  218. package/src/components/box/QasBox.stories.js +0 -35
  219. package/src/components/break-line/QasBreakLine.stories.js +0 -57
  220. package/src/components/break-line/QasBreakLine.vue +0 -52
  221. package/src/components/btn/QasBtn.stories.js +0 -45
  222. package/src/components/btn-actions/QasBtnActions.stories.js +0 -77
  223. package/src/components/btn-actions/QasBtnActions.vue +0 -54
  224. package/src/components/card/QasCard.stories.js +0 -126
  225. package/src/components/checkbox-group/QasCheckboxGroup.stories.js +0 -59
  226. package/src/components/copy/QasCopy.stories.js +0 -41
  227. package/src/components/date-time-input/QasDateTimeInput.stories.js +0 -67
  228. package/src/components/debugger/QasDebugger.stories.js +0 -33
  229. package/src/components/delete/QasDelete.stories.js +0 -80
  230. package/src/components/dialog/QasDialog.stories.js +0 -139
  231. package/src/components/dialog-router/QasDialogRouter.stories.js +0 -38
  232. package/src/components/field/QasField.stories.js +0 -181
  233. package/src/components/filters/QasFilters.stories.js +0 -121
  234. package/src/components/form-generator/QasFormGenerator.stories.js +0 -115
  235. package/src/components/form-view/QasFormView.stories.js +0 -236
  236. package/src/components/gallery/QasGallery.stories.js +0 -91
  237. package/src/components/grid-generator/QasGridGenerator.stories.js +0 -142
  238. package/src/components/input/QasInput.stories.js +0 -78
  239. package/src/components/label/QasLabel.stories.js +0 -60
  240. package/src/components/layout/QasLayout.stories.js +0 -104
  241. package/src/components/list-items/QasListItems.stories.js +0 -135
  242. package/src/components/list-view/QasListView.stories.js +0 -168
  243. package/src/components/map/QasMap.stories.js +0 -75
  244. package/src/components/nested-fields/QasNestedFields.stories.js +0 -255
  245. package/src/components/numeric-input/QasNumericInput.stories.js +0 -92
  246. package/src/components/page-header/QasPageHeader.stories.js +0 -61
  247. package/src/components/password-input/QasPasswordInput.stories.js +0 -76
  248. package/src/components/password-strength-checker/QasPasswordStrengthChecker.stories.js +0 -54
  249. package/src/components/profile/QasProfile.stories.js +0 -131
  250. package/src/components/resizer/QasResizer.stories.js +0 -43
  251. package/src/components/search-box/QasSearchBox.stories.js +0 -111
  252. package/src/components/select/QasSelect.stories.js +0 -113
  253. package/src/components/select-list/QasSelectList.stories.js +0 -153
  254. package/src/components/signature-pad/QasSignaturePad.stories.js +0 -51
  255. package/src/components/signature-uploader/QasSignatureUploader.stories.js +0 -69
  256. package/src/components/single-view/QasSingleView.stories.js +0 -130
  257. package/src/components/sortable/QasSortable.stories.js +0 -80
  258. package/src/components/table-generator/QasTableGenerator.stories.js +0 -120
  259. package/src/components/tabs-generator/QasTabsGenerator.stories.js +0 -145
  260. package/src/components/text-truncate/QasTextTruncate.stories.js +0 -55
  261. package/src/components/tip/QasTip.stories.js +0 -57
  262. package/src/components/tip/QasTip.vue +0 -68
  263. package/src/components/tooltip/QasTooltip.stories.js +0 -63
  264. package/src/components/tooltip/QasTooltip.vue +0 -81
  265. package/src/components/transfer/QasTransfer.stories.js +0 -118
  266. package/src/components/uploader/QasCustomUploader.vue +0 -120
  267. package/src/components/uploader/QasUploader.stories.js +0 -139
  268. package/src/directives/Test.js +0 -13
  269. package/src/helpers/historyHandler.js +0 -52
  270. package/src/helpers/label.js +0 -3
  271. package/src/index.js +0 -249
  272. package/src/mixins/map-markers.js +0 -26
  273. package/src/mixins/unsaved-changes.js +0 -24
  274. package/src/mixins/uploader.js +0 -30
  275. package/src/mocks/json/user.json +0 -27
  276. package/src/mocks/json/users-new.json +0 -23
  277. package/src/mocks/json/users.json +0 -97
  278. package/src/mocks/storeModule.js +0 -71
  279. package/src/pages/Forbidden.vue +0 -6
  280. package/src/pages/NotFound.vue +0 -6
@@ -1,84 +0,0 @@
1
- import QasAppBar from './QasAppBar.vue'
2
-
3
- const noSummary = {
4
- type: { summary: null }
5
- }
6
-
7
- export default {
8
- component: QasAppBar,
9
- title: 'Components/AppBar',
10
-
11
- parameters: {
12
- docs: {
13
- description: {
14
- component: 'Creates application header with [QDrawer](https://quasar.dev/layout/drawer) menu and authenticated user data, such as name and photo.'
15
- }
16
- }
17
- },
18
-
19
- argTypes: {
20
- brand: {
21
- description: 'Brand image path.'
22
- },
23
-
24
- isAuth: {
25
- description: 'Toggle visibility of user menu.'
26
- },
27
-
28
- title: {
29
- description: '[QToolbarTitle](https://quasar.dev/vue-components/toolbar#QToolbarTitle-API).'
30
- },
31
-
32
- tools: {
33
- description: '[QToolbar](https://quasar.dev/vue-components/toolbar) content.',
34
- table: noSummary
35
- },
36
-
37
- user: {
38
- description: 'User object with `name`, `giveName`, `email` and `to` keys.',
39
- table: { ...noSummary, category: 'props' }
40
- },
41
-
42
- // Events
43
- 'sign-out': {
44
- description: 'Fires when click on sign out button.',
45
- table: noSummary
46
- },
47
-
48
- 'toggle-menu': {
49
- description: 'Fires when click on app menu button.',
50
- table: noSummary
51
- },
52
-
53
- // Slots
54
- // TODO: o nome da prop é o mesmo do slot, não consegui definir uma descrição para cada um, precisar rever
55
- // Caio aqui: Vamos mudar o nome do slot para user-menu.
56
- '[user]': {
57
- description: 'User menu slot.',
58
- table: {
59
- category: 'slots',
60
- ...noSummary
61
- }
62
- }
63
- }
64
- }
65
-
66
- const Template = (args, { argTypes }) => ({
67
- components: { QasAppBar },
68
- props: Object.keys(argTypes),
69
- template:
70
- '<qas-app-bar v-bind="$props" />'
71
- })
72
-
73
- export const Default = Template.bind({})
74
-
75
- Default.args = {
76
- brand: '//placehold.it/100',
77
- isAuth: true,
78
- title: 'My Title',
79
- user: {
80
- email: 'jon-snow@email.com',
81
- name: 'Jon Snow',
82
- photo: 'https://www.abc.net.au/cm/lb/6367016/data/alan2c-see-the-person-data.jpg'
83
- }
84
- }
@@ -1,66 +0,0 @@
1
- import QasAppMenu from './QasAppMenu.vue'
2
-
3
- export default {
4
- component: QasAppMenu,
5
- title: 'Components/AppMenu',
6
-
7
- parameters: {
8
- docs: {
9
- description: {
10
- component: 'Creates a top-level drawer menu from an array of items.'
11
- }
12
- }
13
- },
14
-
15
- argTypes: {
16
- // Props
17
- itemClass: {
18
- description: 'CSS classes for each item on menu, including children.'
19
- },
20
-
21
- items: {
22
- description: 'Array of object with menu items. Can receive a children items with same structure (first level only).'
23
- },
24
-
25
- scrollAreaClass: {
26
- description: 'CSS classes for the scroll area component.'
27
- },
28
-
29
- value: {
30
- description: 'Controls drawer menu visibility.'
31
- },
32
-
33
- title: {
34
- description: 'Title for displaying inside "modules" as label when is in development (local).'
35
- },
36
-
37
- // Events
38
- input: {
39
- description: 'Fires when opening or closing the drawer menu.'
40
- }
41
- }
42
- }
43
-
44
- const Template = (args, { argTypes }) => ({
45
- components: { QasAppMenu },
46
- props: Object.keys(argTypes),
47
- template:
48
- `<q-layout class="shadow-1" container style="height: 300px" view="hHh Lpr lff">
49
- <qas-app-menu v-bind="$props" />
50
- </q-layout>`
51
- })
52
-
53
- export const Default = Template.bind({})
54
- Default.args = {
55
- items: [
56
- { label: 'single item' },
57
- { label: 'with icon', icon: 'today' },
58
- {
59
- label: 'with children',
60
- children: [
61
- { label: 'children 1' },
62
- { label: 'children 2' }
63
- ]
64
- }
65
- ]
66
- }
@@ -1,58 +0,0 @@
1
- import { mount, shallowMount } from '@vue/test-utils'
2
-
3
- import '@/index.js'
4
- import QasAppsMenu from './QasAppsMenu.vue'
5
-
6
- describe('Test QasAppsMenu component', () => {
7
- const apps = [
8
- {
9
- image: '//placehold.it/100',
10
- label: 'My image',
11
- href: 'https://www.google.com'
12
- },
13
- {
14
- image: 'aaaaaaaaa//placehold.it/100',
15
- label: 'My image',
16
- href: 'https://www.google.com'
17
- },
18
- {
19
- image: '//placehold.it/100',
20
- label: 'My image',
21
- href: 'https://www.google.com'
22
- }
23
- ]
24
-
25
- const shallowWrapper = shallowMount(QasAppsMenu, {
26
- propsData: {
27
- apps
28
- }
29
- })
30
-
31
- const wrapper = mount(QasAppsMenu, {
32
- propsData: {
33
- apps
34
- }
35
- })
36
-
37
- it('Open menu', async () => {
38
- await wrapper.trigger('click')
39
- const menuElement = document.querySelector('.q-menu')
40
-
41
- expect(menuElement).toBeVisible()
42
- })
43
-
44
- it('check links', async () => {
45
- const links = shallowWrapper.findAll('[data-test="apps-menu-link"]')
46
-
47
- expect(links).toHaveLength(3)
48
-
49
- for (let index = 1; index < links.length; index++) {
50
- const linkWrapper = links.at(index)
51
- const avatarWrapper = linkWrapper.get('img')
52
-
53
- expect(avatarWrapper.isVisible()).toBe(true)
54
- expect(linkWrapper.text()).toBe('My image')
55
- expect(linkWrapper.attributes().href).toBe('https://www.google.com')
56
- }
57
- })
58
- })
@@ -1,54 +0,0 @@
1
- import QasAppsMenu from './QasAppsMenu.vue'
2
-
3
- export default {
4
- component: QasAppsMenu,
5
- title: 'Components/AppsMenu',
6
-
7
- parameters: {
8
- docs: {
9
- description: {
10
- component: 'Menu button for apps ecosystem.'
11
- }
12
- }
13
- },
14
-
15
- argTypes: {
16
- apps: {
17
- description: 'List of apps with `href`, `label` and `image`.'
18
- }
19
- }
20
- }
21
-
22
- const Template = (args, { argTypes }) => ({
23
- components: { QasAppsMenu },
24
- props: Object.keys(argTypes),
25
- template:
26
- '<qas-apps-menu v-bind="$props" />'
27
- })
28
-
29
- export const Default = Template.bind({})
30
-
31
- Default.args = {
32
- apps: [
33
- {
34
- href: 'https://google.com',
35
- image: '//placehold.it/100',
36
- label: 'Company 1'
37
- },
38
- {
39
- href: 'https://google.com',
40
- image: '//placehold.it/100',
41
- label: 'Company 2'
42
- },
43
- {
44
- href: 'https://google.com',
45
- image: '//placehold.it/100',
46
- label: 'Company 3'
47
- },
48
- {
49
- href: 'https://google.com',
50
- image: '//placehold.it/100',
51
- label: 'Company 4'
52
- }
53
- ]
54
- }
@@ -1,48 +0,0 @@
1
- <template>
2
- <q-btn v-bind="$attrs" dense icon="o_apps" round unelevated>
3
- <q-menu anchor="bottom middle" max-width="400px" self="top middle">
4
- <div class="q-col-gutter-md q-pa-md row">
5
- <!-- TODO: Revisitar os estilos dos links. -->
6
- <a v-for="(app, index) in apps" :key="index" v-test:apps-menu-link class="col-6 col-sm-4 flex justify-center text-undecoration" :href="app.href">
7
- <div>
8
- <q-avatar class="q-m-x-auto" :size="avatarSize">
9
- <img :alt="app.label" class="rounded-borders" :src="app.image">
10
- </q-avatar>
11
- </div>
12
-
13
- <div class="full-width q-mt-xs text-black text-center">{{ app.label }}</div>
14
- </a>
15
- </div>
16
- </q-menu>
17
- </q-btn>
18
- </template>
19
-
20
- <script>
21
- // TODO ver uma forma de adicionar globalmente as diretivas
22
- import test from '../../directives/Test'
23
-
24
- export default {
25
- name: 'QasAppsMenu',
26
-
27
- directives: {
28
- test
29
- },
30
-
31
- props: {
32
- apps: {
33
- default: () => [],
34
- type: Array
35
- }
36
- },
37
-
38
- computed: {
39
- avatarSize () {
40
- return this.isExtraSmallScreen ? '50px' : '70px'
41
- },
42
-
43
- isExtraSmallScreen () {
44
- return this.$q.screen.xs
45
- }
46
- }
47
- }
48
- </script>
@@ -1,14 +0,0 @@
1
- import { mount } from '@vue/test-utils'
2
-
3
- import '@/index.js'
4
- import QasAvatar from './QasAvatar.vue'
5
-
6
- test('displays message', () => {
7
- const wrapper = mount(QasAvatar, {
8
- propsData: {
9
- title: 'Hello world'
10
- }
11
- })
12
-
13
- expect(wrapper.text()).toContain('H')
14
- })
@@ -1,52 +0,0 @@
1
- import QasAvatar from './QasAvatar.vue'
2
-
3
- export default {
4
- component: QasAvatar,
5
- title: 'Components/Avatar',
6
-
7
- parameters: {
8
- docs: {
9
- description: {
10
- component: 'Automatic handler for [QAvatar](https://quasar.dev/vue-components/avatar).'
11
- }
12
- }
13
- },
14
-
15
- argTypes: {
16
- color: {
17
- description: 'Set the main color.'
18
- },
19
-
20
- dark: {
21
- description: 'Enables dark mode.'
22
- },
23
-
24
- icon: {
25
- description: 'Icon name following Quasar convention to show when there is no image or title.'
26
- },
27
-
28
- image: {
29
- description: 'Image source URL.'
30
- },
31
-
32
- textColor: {
33
- description: 'Overrides text color (if needed).'
34
- },
35
-
36
- title: {
37
- description: 'Defines the first letter.'
38
- }
39
- }
40
- }
41
-
42
- const Template = (args, { argTypes }) => ({
43
- components: { QasAvatar },
44
- props: Object.keys(argTypes),
45
- template: '<qas-avatar v-bind="$props" />'
46
- })
47
-
48
- export const Default = Template.bind({})
49
-
50
- Default.args = {
51
- title: 'John Appleseed'
52
- }
@@ -1,18 +0,0 @@
1
- import { mount } from '@vue/test-utils'
2
-
3
- import '@/index.js'
4
- import QasBox from './QasBox.vue'
5
-
6
- describe('Test QasBox component', () => {
7
- const wrapper = mount(QasBox)
8
-
9
- it('Mount component', async () => {
10
- expect(wrapper.exists()).toBe(true)
11
- expect(wrapper.classes()).toContain('qas-box__elevated')
12
- })
13
-
14
- it('Display mode as form', async () => {
15
- await wrapper.setProps({ formMode: true })
16
- expect(wrapper.classes()).toContain('qas-box__outlined')
17
- })
18
- })
@@ -1,35 +0,0 @@
1
- import QasBox from './QasBox.vue'
2
-
3
- export default {
4
- component: QasBox,
5
- title: 'Components/Box',
6
-
7
- parameters: {
8
- docs: {
9
- description: {
10
- component: 'Simple box wrapper.'
11
- }
12
- }
13
- },
14
-
15
- argTypes: {
16
- formMode: {
17
- description: 'Changes the component style.'
18
- }
19
- }
20
- }
21
-
22
- const Template = (args, { argTypes }) => ({
23
- components: { QasBox },
24
- props: Object.keys(argTypes),
25
- template:
26
- `<qas-box v-bind="$props">
27
- Hello, world!
28
- </qas-box>`
29
- })
30
-
31
- export const Default = Template.bind({})
32
- Default.args = {}
33
-
34
- export const FormMode = Template.bind({})
35
- FormMode.args = { formMode: true }
@@ -1,57 +0,0 @@
1
- import QasBreakLine from './QasBreakLine.vue'
2
-
3
- export default {
4
- component: QasBreakLine,
5
- title: 'Components/BreakLine',
6
-
7
- parameters: {
8
- docs: {
9
- description: {
10
- component: 'Insert line breaks where newlines `\\n` occur in the string.'
11
- }
12
- }
13
- },
14
-
15
- argTypes: {
16
- parentTag: {
17
- description: 'Tag to wrap all lines.'
18
- },
19
-
20
- split: {
21
- description: 'Characters to split text.'
22
- },
23
-
24
- tag: {
25
- description: 'Tag to wrap each line'
26
- },
27
-
28
- tagClass: {
29
- description: 'CSS classes for tag element.'
30
- },
31
-
32
- tagStyle: {
33
- description: 'CSS styles for tag element.'
34
- },
35
-
36
- text: {
37
- description: 'Text to be splitted into lines.'
38
- }
39
- }
40
- }
41
-
42
- const Template = (args, { argTypes }) => ({
43
- components: { QasBreakLine },
44
- props: Object.keys(argTypes),
45
- template:
46
- `<qas-break-line v-bind="$props">
47
- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam tincidunt consequat luctus.
48
- Curabitur ultrices maximus erat, et egestas enim mollis vitae.
49
- Proin quis enim eu ex volutpat elementum quis eu nisl.
50
- </qas-break-line>`
51
- })
52
-
53
- export const Default = Template.bind({})
54
-
55
- Default.args = {
56
- tag: 'div'
57
- }
@@ -1,52 +0,0 @@
1
- <template>
2
- <component :is="parentTag">
3
- <component :is="tag" v-for="(item, index) in items" :key="index" :class="tagClass" :style="tagStyle">
4
- {{ item }}
5
- </component>
6
- </component>
7
- </template>
8
-
9
- <script>
10
- export default {
11
- props: {
12
- parentTag: {
13
- default: 'div',
14
- type: String
15
- },
16
-
17
- split: {
18
- default: '\n',
19
- type: String
20
- },
21
-
22
- tag: {
23
- default: 'div',
24
- type: String
25
- },
26
-
27
- tagClass: {
28
- default: null,
29
- type: [Array, Object, String]
30
- },
31
-
32
- tagStyle: {
33
- default: null,
34
- type: [Object, String]
35
- },
36
-
37
- text: {
38
- default: '',
39
- type: String
40
- }
41
- },
42
-
43
- computed: {
44
- items () {
45
- const slot = this.$slots.default
46
- const text = this.text || (slot ? slot[0].text : '')
47
-
48
- return text.split(this.split)
49
- }
50
- }
51
- }
52
- </script>
@@ -1,45 +0,0 @@
1
- import QasBtn from './QasBtn.vue'
2
-
3
- export default {
4
- component: QasBtn,
5
- title: 'Components/Btn',
6
-
7
- parameters: {
8
- docs: {
9
- description: {
10
- component: 'Extends [QBtn](https://quasar.dev/vue-components/button).'
11
- }
12
- }
13
- },
14
-
15
- argTypes: {
16
- color: {
17
- description: 'Color name for component from the [Quasar Color Palette](https://quasar.dev/style/color-palette#Color-List).'
18
- },
19
-
20
- hideMobileLabel: {
21
- description: 'Hides label in mobile, showing only the icon.'
22
- },
23
-
24
- noCaps: {
25
- description: 'Avoid turning label text into caps (which happens by default).'
26
- },
27
-
28
- unelevated: {
29
- description: 'Removes shadow.'
30
- }
31
- }
32
- }
33
-
34
- const Template = (args, { argTypes }) => ({
35
- components: { QasBtn },
36
- props: Object.keys(argTypes),
37
- template:
38
- '<qas-btn v-bind="$props" />'
39
- })
40
-
41
- export const Default = Template.bind({})
42
-
43
- Default.args = {
44
- label: 'Click here!'
45
- }
@@ -1,77 +0,0 @@
1
- import QasBtn from '../btn/QasBtn.vue'
2
- import QasBtnActions from './QasBtnActions.vue'
3
-
4
- const noSummary = {
5
- type: { summary: null }
6
- }
7
-
8
- // Options
9
- // TODO: Importar de um futuro arquivo constraints.js
10
- const alignOptions = ['start', 'around', 'between', 'center', 'end']
11
- const gutterOptions = ['xs', 'sm', 'md', 'lg', 'xl']
12
-
13
- export default {
14
- component: QasBtnActions,
15
- title: 'Components/BtnActions',
16
-
17
- parameters: {
18
- docs: {
19
- description: {
20
- component: 'Actions for pages that deals with primary and secondary buttons, like a form or dialog.'
21
- }
22
- }
23
- },
24
-
25
- argTypes: {
26
- // Props
27
- align: {
28
- control: { type: 'select', options: alignOptions },
29
- description: 'Actions alignment.'
30
- },
31
-
32
- // TODO: Rever necessidade.
33
- btnCol: {
34
- description: 'Col sizes for actions wrapper.'
35
- },
36
-
37
- gutter: {
38
- control: { type: 'select', options: gutterOptions },
39
- description: 'Distance between actions.'
40
- },
41
-
42
- // Slots
43
- primary: {
44
- description: 'Primary action slot.',
45
- table: noSummary
46
- },
47
-
48
- secondary: {
49
- description: 'Secondary action slot.',
50
- table: noSummary
51
- }
52
- }
53
- }
54
-
55
- const templates = `
56
- <template v-slot:primary>
57
- <qas-btn label="Confirm" />
58
- </template>
59
- <template v-slot:secondary>
60
- <qas-btn color="white" label="Cancel" outline text-color="primary" />
61
- </template>
62
- `
63
-
64
- const Template = (args, { argTypes }) => ({
65
- components: { QasBtn, QasBtnActions },
66
- props: Object.keys(argTypes),
67
- template:
68
- `<qas-btn-actions v-bind="$props">${templates}</qas-btn-actions>`
69
- })
70
-
71
- export const Default = Template.bind({})
72
-
73
- Default.parameters = {
74
- docs: {
75
- source: { code: `<qas-btn-actions>${templates}</qas-btn-actions>` }
76
- }
77
- }