@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,7 +1,5 @@
1
1
  import { camelize } from 'humps'
2
- import { get } from 'lodash'
3
-
4
- import { NotifyError } from '../plugins'
2
+ import { markRaw } from 'vue'
5
3
 
6
4
  export default {
7
5
  props: {
@@ -17,41 +15,77 @@ export default {
17
15
  url: {
18
16
  default: '',
19
17
  type: String
18
+ },
19
+
20
+ fields: {
21
+ default: () => ({}),
22
+ type: Object
23
+ },
24
+
25
+ errors: {
26
+ default: () => ({}),
27
+ type: Object
28
+ },
29
+
30
+ metadata: {
31
+ default: () => ({}),
32
+ type: Object
33
+ },
34
+
35
+ fetching: {
36
+ type: Boolean
20
37
  }
21
38
  },
22
39
 
40
+ emits: [
41
+ 'update:fields',
42
+ 'update:errors',
43
+ 'update:metadata',
44
+ 'update:fetching'
45
+ ],
46
+
23
47
  data () {
24
48
  return {
25
- errors: {},
26
- fields: {},
27
- metadata: {},
49
+ mx_errors: {},
50
+ mx_fields: {},
51
+ mx_metadata: {},
28
52
 
29
- isFetching: false
53
+ mx_isFetching: false
54
+ }
55
+ },
56
+
57
+ watch: {
58
+ mx_isFetching (value) {
59
+ this.$emit('update:fetching', value)
30
60
  }
31
61
  },
32
62
 
33
63
  computed: {
34
- componentTag () {
64
+ mx_componentTag () {
35
65
  return this.dialog ? 'div' : 'q-page'
36
66
  },
37
67
 
38
- hasFooterSlot () {
39
- return !!(this.$slots.footer || this.$scopedSlots.footer)
68
+ mx_componentClass () {
69
+ return !this.dialog && 'container spaced'
40
70
  },
41
71
 
42
- hasHeaderSlot () {
43
- return !!(this.$slots.header || this.$scopedSlots.header)
72
+ mx_hasFooterSlot () {
73
+ return !!(this.$slots.footer)
74
+ },
75
+
76
+ mx_hasHeaderSlot () {
77
+ return !!(this.$slots.header)
44
78
  }
45
79
  },
46
80
 
47
81
  methods: {
48
- fetchError (error) {
82
+ mx_fetchError (error) {
49
83
  const { response } = error
50
- const exception = get(response, 'data.exception') || error.message
84
+ const exception = response?.data?.exception || error.message
51
85
 
52
- NotifyError('Ops! Erro ao obter os dados.', exception)
86
+ this.$qas.error('Ops! Erro ao obter os dados.', exception)
53
87
 
54
- const status = get(response, 'status')
88
+ const status = response?.status
55
89
  const redirect = ({ 403: 'Forbidden', 404: 'NotFound' })[status]
56
90
 
57
91
  if (redirect) {
@@ -59,20 +93,26 @@ export default {
59
93
  }
60
94
  },
61
95
 
62
- setErrors (errors = {}) {
63
- this.errors = errors
96
+ mx_setErrors (errors = {}) {
97
+ this.mx_errors = markRaw(errors)
64
98
  },
65
99
 
66
- setFields (fields = {}) {
100
+ mx_setFields (fields = {}) {
67
101
  for (const field in fields) {
68
102
  fields[field].name = camelize(fields[field].name)
69
103
  }
70
104
 
71
- this.fields = fields
105
+ this.mx_fields = markRaw(fields)
106
+ },
107
+
108
+ mx_setMetadata (metadata = {}) {
109
+ this.mx_metadata = markRaw(metadata)
72
110
  },
73
111
 
74
- setMetadata (metadata = {}) {
75
- this.metadata = metadata
112
+ mx_updateModels (models) {
113
+ for (const key in models) {
114
+ this.$emit(`update:${key}`, models[key])
115
+ }
76
116
  }
77
117
  }
78
118
  }
@@ -0,0 +1,14 @@
1
+ import { Dialog } from 'quasar'
2
+ import QasDialog from '../../components/dialog/QasDialog.vue'
3
+
4
+ /**
5
+ * @param {object} componentProps={}
6
+ *
7
+ * @example Dialog({ card: { title: 'Esse é o meu titulo!' } })
8
+ */
9
+ export default (componentProps = {}) => {
10
+ Dialog.create({
11
+ component: QasDialog,
12
+ componentProps: { ...componentProps, usePlugin: true }
13
+ })
14
+ }
@@ -0,0 +1,10 @@
1
+ type: component
2
+
3
+ meta:
4
+ desc: Plugin que implementa o "QNotify" do quasar para notificações de sucesso.
5
+
6
+ inject:
7
+ 'this.$qas.dialog(config)':
8
+ params:
9
+ config:
10
+ desc: Mensagem de sucesso para ser exibida na notificação.
@@ -1,7 +1,9 @@
1
- import NotifyError from './NotifyError'
2
- import NotifySuccess from './NotifySuccess'
1
+ import Dialog from './dialog/Dialog.js'
2
+ import NotifyError from './notify-error/NotifyError.js'
3
+ import NotifySuccess from './notify-success/NotifySuccess.js'
3
4
 
4
5
  export {
6
+ Dialog,
5
7
  NotifyError,
6
8
  NotifySuccess
7
9
  }
@@ -0,0 +1,11 @@
1
+ type: component
2
+
3
+ meta:
4
+ desc: Plugin que implementa o "QNotify" do quasar.
5
+
6
+ inject:
7
+ 'this.$qas.error(msg)':
8
+ params:
9
+ msg:
10
+ desc: Mensagem de erro para ser exibida na notificação.
11
+ type: String
@@ -1,10 +1,10 @@
1
1
  import { Notify } from 'quasar'
2
2
 
3
3
  Notify.registerType('success', {
4
- progress: true,
5
- icon: 'o_check'
4
+ icon: 'o_check',
5
+ progress: true
6
6
  })
7
7
 
8
8
  export default (message, caption) => {
9
- Notify.create({ caption, message, type: 'success' })
9
+ Notify?.create({ caption, message, type: 'success' })
10
10
  }
@@ -0,0 +1,11 @@
1
+ type: component
2
+
3
+ meta:
4
+ desc: Plugin que implementa o "QNotify" do quasar para notificações de sucesso.
5
+
6
+ inject:
7
+ 'this.$qas.success(msg)':
8
+ params:
9
+ msg:
10
+ desc: Mensagem de sucesso para ser exibida na notificação.
11
+ type: String
@@ -0,0 +1,43 @@
1
+ import { reactive } from 'vue'
2
+ import { findLastIndex } from 'lodash-es'
3
+
4
+ const history = reactive({ hasPreviousRoute: false, list: [] })
5
+
6
+ function getPreviousRoute (currentRoute) {
7
+ const index = findLastIndex(history.list, item => item.name === currentRoute.name)
8
+
9
+ if (~index) {
10
+ history.list.splice(index, 1)
11
+ }
12
+
13
+ history.hasPreviousRoute = history.list.length > 1
14
+ return history.list[history.list.length - 1]
15
+ }
16
+
17
+ function addRoute (route) {
18
+ const routeExistsInList = history.list?.[history.list?.length - 1]?.name === route.name
19
+
20
+ if (routeExistsInList) return
21
+
22
+ history.list.push(route)
23
+ history.hasPreviousRoute = history.list.length > 1
24
+ }
25
+
26
+ function destroyRoutes (routes) {
27
+ if (!history.list.length) return null
28
+
29
+ routes.forEach(route => {
30
+ const index = history.list.findIndex(item => item.name === route)
31
+
32
+ if (~index) {
33
+ history.list.splice(index, 1)
34
+ }
35
+ })
36
+ }
37
+
38
+ export {
39
+ history,
40
+ getPreviousRoute,
41
+ addRoute,
42
+ destroyRoutes
43
+ }
@@ -0,0 +1 @@
1
+ export * from './history.js'
@@ -0,0 +1,185 @@
1
+ import QasActions from './components/actions/QasActions.vue'
2
+ import QasActionsMenu from './components/actions-menu/QasActionsMenu.vue'
3
+ import QasAlert from './components/alert/QasAlert.vue'
4
+ import QasAppBar from './components/app-bar/QasAppBar.vue'
5
+ import QasAppMenu from './components/app-menu/QasAppMenu.vue'
6
+ import QasAvatar from './components/avatar/QasAvatar.vue'
7
+ import QasBox from './components/box/QasBox.vue'
8
+ import QasBreakline from './components/breakline/QasBreakline.vue'
9
+ import QasBtn from './components/btn/QasBtn.vue'
10
+ import QasCard from './components/card/QasCard.vue'
11
+ import QasCheckboxGroup from './components/checkbox-group/QasCheckboxGroup.vue'
12
+ import QasCopy from './components/copy/QasCopy.vue'
13
+ import QasDateTimeInput from './components/date-time-input/QasDateTimeInput.vue'
14
+ import QasDebugger from './components/debugger/QasDebugger.vue'
15
+ import QasDelete from './components/delete/QasDelete.vue'
16
+ import QasDialog from './components/dialog/QasDialog.vue'
17
+ import QasDialogRouter from './components/dialog-router/QasDialogRouter.vue'
18
+ import QasField from './components/field/QasField.vue'
19
+ import QasFilters from './components/filters/QasFilters.vue'
20
+ import QasFormGenerator from './components/form-generator/QasFormGenerator.vue'
21
+ import QasFormView from './components/form-view/QasFormView.vue'
22
+ import QasGallery from './components/gallery/QasGallery.vue'
23
+ import QasGridGenerator from './components/grid-generator/QasGridGenerator.vue'
24
+ import QasInput from './components/input/QasInput.vue'
25
+ import QasLabel from './components/label/QasLabel.vue'
26
+ import QasLayout from './components/layout/QasLayout.vue'
27
+ import QasListItems from './components/list-items/QasListItems.vue'
28
+ import QasListView from './components/list-view/QasListView.vue'
29
+ import QasMap from './components/map/QasMap.vue'
30
+ import QasNestedFields from './components/nested-fields/QasNestedFields.vue'
31
+ import QasNumericInput from './components/numeric-input/QasNumericInput.vue'
32
+ import QasPageHeader from './components/page-header/QasPageHeader.vue'
33
+ import QasPasswordInput from './components/password-input/QasPasswordInput.vue'
34
+ import QasPasswordStrengthChecker from './components/password-strength-checker/QasPasswordStrengthChecker.vue'
35
+ import QasProfile from './components/profile/QasProfile.vue'
36
+ import QasResizer from './components/resizer/QasResizer.vue'
37
+ import QasSearchBox from './components/search-box/QasSearchBox.vue'
38
+ import QasSelect from './components/select/QasSelect.vue'
39
+ import QasSelectList from './components/select-list/QasSelectList.vue'
40
+ import QasSignaturePad from './components/signature-pad/QasSignaturePad.vue'
41
+ import QasSignatureUploader from './components/signature-uploader/QasSignatureUploader.vue'
42
+ import QasSingleView from './components/single-view/QasSingleView.vue'
43
+ import QasSortable from './components/sortable/QasSortable.vue'
44
+ import QasTableGenerator from './components/table-generator/QasTableGenerator.vue'
45
+ import QasTabsGenerator from './components/tabs-generator/QasTabsGenerator.vue'
46
+ import QasTextTruncate from './components/text-truncate/QasTextTruncate.vue'
47
+ import QasTransfer from './components/transfer/QasTransfer.vue'
48
+ import QasUploader from './components/uploader/QasUploader.vue'
49
+
50
+ import VueGoogleMaps from '@fawmi/vue-google-maps'
51
+ import { Notify, Quasar, Dialog as QuasarDialog } from 'quasar'
52
+
53
+ import {
54
+ Dialog,
55
+ NotifyError,
56
+ NotifySuccess
57
+ } from './plugins'
58
+
59
+ import packageInfo from '../package.json'
60
+
61
+ const version = packageInfo.version
62
+
63
+ function install (app) {
64
+ app.component('QasActions', QasActions)
65
+ app.component('QasActionsMenu', QasActionsMenu)
66
+ app.component('QasAlert', QasAlert)
67
+ app.component('QasAppBar', QasAppBar)
68
+ app.component('QasAppMenu', QasAppMenu)
69
+ app.component('QasAvatar', QasAvatar)
70
+ app.component('QasBox', QasBox)
71
+ app.component('QasBreakline', QasBreakline)
72
+ app.component('QasBtn', QasBtn)
73
+ app.component('QasCard', QasCard)
74
+ app.component('QasCheckboxGroup', QasCheckboxGroup)
75
+ app.component('QasCopy', QasCopy)
76
+ app.component('QasDateTimeInput', QasDateTimeInput)
77
+ app.component('QasDebugger', QasDebugger)
78
+ app.component('QasDelete', QasDelete)
79
+ app.component('QasDialog', QasDialog)
80
+ app.component('QasDialogRouter', QasDialogRouter)
81
+ app.component('QasField', QasField)
82
+ app.component('QasFilters', QasFilters)
83
+ app.component('QasFormGenerator', QasFormGenerator)
84
+ app.component('QasFormView', QasFormView)
85
+ app.component('QasGallery', QasGallery)
86
+ app.component('QasGridGenerator', QasGridGenerator)
87
+ app.component('QasInput', QasInput)
88
+ app.component('QasLabel', QasLabel)
89
+ app.component('QasLayout', QasLayout)
90
+ app.component('QasListItems', QasListItems)
91
+ app.component('QasListView', QasListView)
92
+ app.component('QasMap', QasMap)
93
+ app.component('QasNestedFields', QasNestedFields)
94
+ app.component('QasNumericInput', QasNumericInput)
95
+ app.component('QasPageHeader', QasPageHeader)
96
+ app.component('QasPasswordInput', QasPasswordInput)
97
+ app.component('QasPasswordStrengthChecker', QasPasswordStrengthChecker)
98
+ app.component('QasProfile', QasProfile)
99
+ app.component('QasResizer', QasResizer)
100
+ app.component('QasSearchBox', QasSearchBox)
101
+ app.component('QasSelect', QasSelect)
102
+ app.component('QasSelectList', QasSelectList)
103
+ app.component('QasSignaturePad', QasSignaturePad)
104
+ app.component('QasSignatureUploader', QasSignatureUploader)
105
+ app.component('QasSingleView', QasSingleView)
106
+ app.component('QasSortable', QasSortable)
107
+ app.component('QasTableGenerator', QasTableGenerator)
108
+ app.component('QasTabsGenerator', QasTabsGenerator)
109
+ app.component('QasTextTruncate', QasTextTruncate)
110
+ app.component('QasTransfer', QasTransfer)
111
+ app.component('QasUploader', QasUploader)
112
+
113
+ app.use(Quasar, { plugins: { Notify, QuasarDialog, Dialog } })
114
+
115
+ if (process.env.MAPS_API_KEY) {
116
+ app.use(VueGoogleMaps, { load: { key: process.env.MAPS_API_KEY, libraries: 'places' } })
117
+ }
118
+
119
+ app.config.globalProperties.$qas = {
120
+ dialog: Dialog,
121
+ error: NotifyError,
122
+ success: NotifySuccess
123
+ }
124
+ }
125
+
126
+ export {
127
+ version,
128
+
129
+ // components
130
+ QasActions,
131
+ QasActionsMenu,
132
+ QasAlert,
133
+ QasAppBar,
134
+ QasAppMenu,
135
+ QasAvatar,
136
+ QasBox,
137
+ QasBreakline,
138
+ QasBtn,
139
+ QasCard,
140
+ QasCheckboxGroup,
141
+ QasCopy,
142
+ QasDateTimeInput,
143
+ QasDebugger,
144
+ QasDelete,
145
+ QasDialog,
146
+ QasDialogRouter,
147
+ QasField,
148
+ QasFilters,
149
+ QasFormGenerator,
150
+ QasFormView,
151
+ QasGallery,
152
+ QasGridGenerator,
153
+ QasInput,
154
+ QasLabel,
155
+ QasLayout,
156
+ QasListItems,
157
+ QasListView,
158
+ QasMap,
159
+ QasNestedFields,
160
+ QasNumericInput,
161
+ QasPageHeader,
162
+ QasPasswordInput,
163
+ QasPasswordStrengthChecker,
164
+ QasProfile,
165
+ QasResizer,
166
+ QasSearchBox,
167
+ QasSelect,
168
+ QasSelectList,
169
+ QasSignaturePad,
170
+ QasSignatureUploader,
171
+ QasSingleView,
172
+ QasSortable,
173
+ QasTableGenerator,
174
+ QasTabsGenerator,
175
+ QasTextTruncate,
176
+ QasTransfer,
177
+ QasUploader,
178
+
179
+ // plugin
180
+ Dialog,
181
+ NotifyError,
182
+ NotifySuccess,
183
+
184
+ install
185
+ }
package/.babelrc DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "presets": [
3
- [
4
- "@babel/preset-env",
5
- {
6
- "targets": {
7
- "esmodules": true
8
- }
9
- }
10
- ]
11
- ]
12
- }
@@ -1,35 +0,0 @@
1
- const ESLintPlugin = require('eslint-webpack-plugin')
2
- const path = require('path')
3
-
4
- module.exports = {
5
- addons: [
6
- '@storybook/addon-essentials',
7
- '@storybook/addon-links',
8
- '@storybook/addon-postcss'
9
- ],
10
-
11
- stories: [
12
- '../**/*.stories.mdx',
13
- '../**/*.stories.js'
14
- ],
15
-
16
- webpackFinal: webpack => {
17
- webpack.module.rules.push({
18
- include: path.resolve(__dirname, '../'),
19
- test: /\.scss$/,
20
- use: ['style-loader', 'css-loader', {
21
- loader: 'sass-loader',
22
- options: {
23
- additionalData: '@import \'quasar/src/css/variables.sass\';',
24
- sourceMap: true
25
- }
26
- }],
27
- })
28
-
29
- webpack.plugins.push(
30
- new ESLintPlugin({ extensions: ['vue'] })
31
- )
32
-
33
- return webpack
34
- }
35
- }
@@ -1,26 +0,0 @@
1
- // Storybook
2
- import '@storybook/addon-console'
3
-
4
- // Quasar
5
- import '@quasar/extras/roboto-font/roboto-font.css'
6
- import '@quasar/extras/material-icons/material-icons.css'
7
- import '@quasar/extras/material-icons-outlined/material-icons-outlined.css'
8
-
9
- import 'quasar/dist/quasar.min.css'
10
-
11
- import '../src/index.scss'
12
- import '../index.js'
13
-
14
- export const parameters = {
15
- actions: { argTypesRegex: "^on[A-Z].*" },
16
- viewMode: 'docs'
17
- }
18
-
19
- import Vue from 'vue'
20
- import storeModule from '../src/mocks/storeModule'
21
-
22
- import VueRouter from 'vue-router'
23
- Vue.use(VueRouter)
24
-
25
- import Vuex from 'vuex'
26
- Vue.use(Vuex)
package/debug.log DELETED
@@ -1 +0,0 @@
1
- [0112/132448.838:ERROR:directory_reader_win.cc(43)] FindFirstFile: O sistema n�o pode encontrar o caminho especificado. (0x3)
package/index.js DELETED
@@ -1,4 +0,0 @@
1
- import Vue from 'vue'
2
- import Quasar from 'quasar'
3
-
4
- Vue.use(Quasar)
package/jest-setup.js DELETED
@@ -1 +0,0 @@
1
- import '@testing-library/jest-dom'
package/jest.config.json DELETED
@@ -1,22 +0,0 @@
1
- {
2
- "moduleFileExtensions": [
3
- "js",
4
- "json",
5
- "vue"
6
- ],
7
-
8
- "moduleNameMapper": {
9
- "^@/(.*)$": "<rootDir>/$1"
10
- },
11
-
12
- "setupFilesAfterEnv": ["<rootDir>/jest-setup.js"],
13
-
14
- "transform": {
15
- ".*\\.(js)$": "babel-jest",
16
- ".*\\.(vue)$": "vue-jest"
17
- },
18
-
19
- "transformIgnorePatterns": [
20
- "node_modules"
21
- ]
22
- }
package/postcss.config.js DELETED
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- plugins: [
3
- require('autoprefixer')
4
- ]
5
- }
@@ -1,12 +0,0 @@
1
- import { Meta } from '@storybook/addon-docs/blocks'
2
-
3
- <Meta title="Introduction" />
4
-
5
- # Welcome to Storybook
6
-
7
- Storybook helps you build UI components in isolation from your app's business logic, data, and context.
8
- That makes it easy to develop hard-to-reach states. Save these UI states as **stories** to revisit during development, testing, or QA.
9
-
10
- Browse example stories now by navigating to them in the sidebar.
11
- View their code in the `src/storybook-examples` directory to learn how they work.
12
- We recommend building UIs with a [**component-driven**](https://componentdriven.org) process starting with atomic components and ending with pages.
@@ -1,73 +0,0 @@
1
- import QasActionsMenu from './QasActionsMenu.vue'
2
- import { Notify } from 'quasar'
3
-
4
- export default {
5
- component: QasActionsMenu,
6
- title: 'Components/ActionsMenu',
7
-
8
- parameters: {
9
- docs: {
10
- description: {
11
- component: 'Actions menu.'
12
- }
13
- }
14
- },
15
-
16
- argTypes: {
17
- label: {
18
- description: 'Button label.'
19
- },
20
-
21
- list: {
22
- description: 'Actions list as an object containing `label`, `icon`, `props` and `handler` click event.'
23
- },
24
-
25
- hideLabel: {
26
- description: 'Controls label visibility.'
27
- },
28
-
29
- icon: {
30
- description: 'Icon button.'
31
- },
32
-
33
- // slots
34
- '[dynamic-name]': {
35
- description: 'Each key inside `list` have your own slot to be customized.',
36
- table: {
37
- category: 'slots',
38
- defaultValue: {
39
- detail: JSON.stringify({ item: 'string' }),
40
- summary: '{}'
41
- }
42
- }
43
- },
44
-
45
- default: {
46
- table: { disable: true }
47
- }
48
- }
49
- }
50
-
51
- const Template = (args, { argTypes }) => ({
52
- components: { QasActionsMenu },
53
- props: Object.keys(argTypes),
54
- template:
55
- '<qas-actions-menu v-bind="$props" />'
56
- })
57
-
58
- export const Default = Template.bind({})
59
- Default.args = {
60
- block: {
61
- handler: () => Notify.create('Block clicked!'),
62
- icon: 'o_locked',
63
- label: 'Block'
64
- },
65
-
66
- list: {
67
- delete: {
68
- handler: () => Notify.create('Delete clicked!'),
69
- icon: 'o_delete',
70
- label: 'Delete'
71
- }
72
- }
73
- }