@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,88 +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
- apps: {
21
- description: 'List of apps with `href`, `image` and `label`. Used by QasAppsMenu.'
22
- },
23
-
24
- brand: {
25
- description: 'Brand image path.'
26
- },
27
-
28
- isAuth: {
29
- description: 'Toggle visibility of user menu.'
30
- },
31
-
32
- title: {
33
- description: '[QToolbarTitle](https://quasar.dev/vue-components/toolbar#QToolbarTitle-API).'
34
- },
35
-
36
- tools: {
37
- description: '[QToolbar](https://quasar.dev/vue-components/toolbar) content.',
38
- table: noSummary
39
- },
40
-
41
- user: {
42
- description: 'User object with `name`, `giveName`, `email` and `to` keys.',
43
- table: { ...noSummary, category: 'props' }
44
- },
45
-
46
- // Events
47
- 'sign-out': {
48
- description: 'Fires when click on sign out button.',
49
- table: noSummary
50
- },
51
-
52
- 'toggle-menu': {
53
- description: 'Fires when click on app menu button.',
54
- table: noSummary
55
- },
56
-
57
- // Slots
58
- // TODO: o nome da prop é o mesmo do slot, não consegui definir uma descrição para cada um, precisar rever
59
- // Caio aqui: Vamos mudar o nome do slot para user-menu.
60
- '[user]': {
61
- description: 'User menu slot.',
62
- table: {
63
- category: 'slots',
64
- ...noSummary
65
- }
66
- }
67
- }
68
- }
69
-
70
- const Template = (args, { argTypes }) => ({
71
- components: { QasAppBar },
72
- props: Object.keys(argTypes),
73
- template:
74
- '<qas-app-bar v-bind="$props" />'
75
- })
76
-
77
- export const Default = Template.bind({})
78
-
79
- Default.args = {
80
- brand: '//placehold.it/100',
81
- isAuth: true,
82
- title: 'My Title',
83
- user: {
84
- email: 'jon-snow@email.com',
85
- name: 'Jon Snow',
86
- photo: 'https://www.abc.net.au/cm/lb/6367016/data/alan2c-see-the-person-data.jpg'
87
- }
88
- }
@@ -1,62 +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
- // Events
34
- input: {
35
- description: 'Fires when opening or closing the drawer menu.'
36
- }
37
- }
38
- }
39
-
40
- const Template = (args, { argTypes }) => ({
41
- components: { QasAppMenu },
42
- props: Object.keys(argTypes),
43
- template:
44
- `<q-layout class="shadow-1" container style="height: 300px" view="hHh Lpr lff">
45
- <qas-app-menu v-bind="$props" />
46
- </q-layout>`
47
- })
48
-
49
- export const Default = Template.bind({})
50
- Default.args = {
51
- items: [
52
- { label: 'single item' },
53
- { label: 'with icon', icon: 'today' },
54
- {
55
- label: 'with children',
56
- children: [
57
- { label: 'children 1' },
58
- { label: 'children 2' }
59
- ]
60
- }
61
- ]
62
- }
@@ -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
- }