@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,19 +1,17 @@
1
1
  <template>
2
- <q-input ref="mask" v-model="model" v-bind="$attrs" bottom-slots :type="type" v-on="events">
3
- <template v-if="!hideStrengthChecker" #hint>
4
- <qas-password-strength-checker v-bind="$props" @password-success="onSuccess" />
5
- </template>
6
-
2
+ <qas-input v-model="model" bottom-slots :type="type">
7
3
  <template #append>
8
4
  <q-icon class="cursor-pointer" :color="iconColor" :name="icon" @click="toggle" />
9
5
  </template>
10
6
 
11
- <slot v-for="(slot, key) in $slots" :slot="key" :name="key" />
7
+ <template v-for="(_, name) in $slots" #[name]="context">
8
+ <slot :name="name" v-bind="context || {}" />
9
+ </template>
12
10
 
13
- <template v-for="(slot, key) in $scopedSlots" :slot="key" slot-scope="scope">
14
- <slot :name="key" v-bind="scope" />
11
+ <template v-if="useStrengthChecker" #hint>
12
+ <qas-password-strength-checker v-bind="strengthCheckerProps" :password="model" />
15
13
  </template>
16
- </q-input>
14
+ </qas-input>
17
15
  </template>
18
16
 
19
17
  <script>
@@ -21,6 +19,8 @@ import passwordMixin from '../../mixins/password.js'
21
19
  import QasPasswordStrengthChecker from '../password-strength-checker/QasPasswordStrengthChecker.vue'
22
20
 
23
21
  export default {
22
+ name: 'QasPasswordInput',
23
+
24
24
  components: {
25
25
  QasPasswordStrengthChecker
26
26
  },
@@ -28,8 +28,9 @@ export default {
28
28
  mixins: [passwordMixin],
29
29
 
30
30
  props: {
31
- hideStrengthChecker: {
32
- type: Boolean
31
+ useStrengthChecker: {
32
+ type: Boolean,
33
+ default: true
33
34
  },
34
35
 
35
36
  iconColor: {
@@ -37,46 +38,48 @@ export default {
37
38
  default: 'primary'
38
39
  },
39
40
 
40
- value: {
41
+ modelValue: {
41
42
  type: String,
42
43
  default: ''
43
44
  }
44
45
  },
45
46
 
47
+ emits: ['update:modelValue'],
48
+
46
49
  data () {
47
50
  return {
51
+ key: 'error',
48
52
  toggleType: true
49
53
  }
50
54
  },
51
55
 
52
56
  computed: {
53
- events () {
54
- const { input, ...events } = this.$listeners
55
-
56
- return events
57
- },
58
-
59
57
  icon () {
60
58
  return this.toggleType ? 'o_visibility_off' : 'o_visibility'
61
59
  },
62
60
 
63
61
  model: {
64
62
  get () {
65
- return this.value
63
+ return this.modelValue
66
64
  },
67
65
 
68
66
  set (value) {
69
- return this.$emit('input', value)
67
+ return this.$emit('update:modelValue', value)
70
68
  }
71
69
  },
72
70
 
71
+ strengthCheckerProps () {
72
+ const { modelValue, ...props } = this.$props
73
+ return props
74
+ },
75
+
73
76
  type () {
74
77
  return this.toggleType ? 'password' : 'text'
75
78
  }
76
79
  },
77
80
 
78
81
  watch: {
79
- value () {
82
+ modelValue () {
80
83
  if (this.$attrs.error) {
81
84
  this.$attrs.error = false
82
85
  this.$attrs.errorMessage = ''
@@ -0,0 +1,103 @@
1
+ type: component
2
+
3
+ meta:
4
+ desc: Componente para input de senhas que implementa o "QasInput" repassando todos os slots menos "#hint" e todos os eventos.
5
+
6
+ mixins:
7
+ - '@bildvitta/quasar-ui-asteroid/dist/api/QasInput.json'
8
+
9
+ props:
10
+ use-strength-checker:
11
+ desc: Controla exibição do componente `QasStrenghtChecker`.
12
+ default: true
13
+ type: Boolean
14
+
15
+ icon-color:
16
+ desc: Cor do ícone do input.
17
+ default: primary
18
+ type: String
19
+
20
+ model-value:
21
+ desc: Model do componente.
22
+ type: String
23
+ examples: [v-model="value"]
24
+ model: true
25
+
26
+ levels:
27
+ desc: Níveis de força da senha, é um objeto de objeto.
28
+ type: [Object, Boolean]
29
+ examples: ["{ label: 'Meu botão de cancelar', onClick: () => alert('fui clicado!') }"]
30
+ debugger: true
31
+ default:
32
+ 0:
33
+ color: 'negative'
34
+ label: 'Muito fraco'
35
+ progress: 0.05
36
+ textClass: 'text-negative'
37
+
38
+ 1:
39
+ color: warning
40
+ label: Fraco
41
+ progress: 0.25
42
+ textClass: text-warning
43
+
44
+ 2:
45
+ color: warning
46
+ label: Bom
47
+ progress: 0.5
48
+ textClass: text-warning
49
+
50
+ 3:
51
+ color: positive
52
+ label: Forte
53
+ progress: 0.75
54
+ textClass: text-positive
55
+
56
+ 4:
57
+ color: positive
58
+ label: Muito forte
59
+ progress: 1
60
+ textClass: text-positive
61
+
62
+ minlength:
63
+ desc: Número mínimo de caracteres.
64
+ default: 8
65
+ type: [Number, String]
66
+
67
+ specials:
68
+ desc: Expressão regular para definir quais tipos de caracteres especiais vai aceitar.
69
+ default: /[!@#$%^&*()_+\-=[\]{}|;:'",<.>/?`~]/g
70
+ type: RegExp
71
+
72
+ track-color:
73
+ desc: Cor da barra de progresso.
74
+ default: blue-grey-1
75
+ type: String
76
+
77
+ use-lowercase:
78
+ desc: Obrigatório uso de letra(s) minuscula.
79
+ default: true
80
+ type: Boolean
81
+
82
+ use-numbers:
83
+ desc: Obrigatório uso de número(s) minuscula.
84
+ default: true
85
+ type: Boolean
86
+
87
+ use-special:
88
+ desc: Obrigatório uso de carácter especial.
89
+ default: true
90
+ type: Boolean
91
+
92
+ use-uppercase:
93
+ desc: Obrigatório uso de letra(s) maiúsculas.
94
+ default: true
95
+ type: Boolean
96
+
97
+ events:
98
+ '@update:model-value -> function (value)':
99
+ desc: Dispara toda vez que o model é atualizado, também utilizado para v-model.
100
+ params:
101
+ value:
102
+ desc: Novo valor do v-model
103
+ type: Boolean
@@ -1,7 +1,9 @@
1
1
  <template>
2
2
  <div v-if="length">
3
- <q-linear-progress :color="option.color" rounded :track-color="trackColor" :value="option.progress" />
4
- <div class="q-mt-xs text-subtitle2" :class="option.textClass">{{ option.label }}</div>
3
+ <slot :level="level">
4
+ <q-linear-progress :color="level.color" :track-color="trackColor" :value="level.progress" />
5
+ <div class="text-caption" :class="level.textClass">{{ level.label }}</div>
6
+ </slot>
5
7
  </div>
6
8
  </template>
7
9
 
@@ -9,56 +11,71 @@
9
11
  import passwordMixin from '../../mixins/password.js'
10
12
 
11
13
  export default {
14
+ name: 'QasPasswordStrengthChecker',
15
+
12
16
  mixins: [passwordMixin],
13
17
 
14
18
  props: {
15
- trackColor: {
16
- default: 'blue-grey-1',
17
- type: String
19
+ modelValue: {
20
+ default: false,
21
+ type: Boolean
18
22
  },
19
23
 
20
- value: {
24
+ password: {
21
25
  default: '',
22
26
  type: String
23
27
  }
24
28
  },
25
29
 
30
+ emits: ['update:modelValue'],
31
+
26
32
  computed: {
27
33
  length () {
28
- return (this.value || '').length
34
+ return this.password.length
35
+ },
36
+
37
+ level () {
38
+ return this.levels[this.score]
29
39
  },
30
40
 
31
- option () {
32
- if (this.value.match(this.pattern)) {
33
- return {
34
- color: 'positive',
35
- label: 'Forte',
36
- progress: 1,
37
- textClass: 'text-positive'
38
- }
39
- }
40
-
41
- if (this.length >= this.weak) {
42
- return {
43
- color: 'warning',
44
- label: 'Fraca',
45
- progress: 0.5,
46
- textClass: 'text-warning'
47
- }
48
- }
49
-
50
- return {
51
- color: 'negative',
52
- label: 'Muito fraca',
53
- progress: 0.25,
54
- textClass: 'text-negative'
55
- }
41
+ score () {
42
+ let score = -1
43
+
44
+ score += this.useLowercase
45
+ ? (this.password.match(/[a-z]/g) ? 1 : 0)
46
+ : 1
47
+
48
+ score += this.useNumbers
49
+ ? (this.password.match(/[0-9]/g) ? 1 : 0)
50
+ : 1
51
+
52
+ score += this.useSpecial
53
+ ? (this.password.match(this.specials) ? 1 : 0)
54
+ : 1
55
+
56
+ score += this.useUppercase
57
+ ? (this.password.match(/[A-Z]/g) ? 1 : 0)
58
+ : 1
59
+
60
+ score += this.length >= parseInt(this.minlength) ? 1 : 0
61
+
62
+ return score
56
63
  }
57
64
  },
58
65
 
59
66
  watch: {
60
- isSuccess (value) {
61
- value && this.onSuccess()
67
+ password () {
68
+ this.emitValue()
69
+ }
70
+ },
71
+
72
+ created () {
73
+ this.emitValue()
74
+ },
75
+
76
+ methods: {
77
+ emitValue () {
78
+ this.$emit('update:modelValue', this.score === 4)
62
79
  }
63
80
  }
64
81
  }
@@ -0,0 +1,103 @@
1
+ type: component
2
+
3
+ meta:
4
+ desc: Componente para checar nível de força da senha.
5
+
6
+ props:
7
+ model-value:
8
+ desc: Model do componente, retorna se passou ou não na validação de senha.
9
+ type: Boolean
10
+ examples: [v-model="value"]
11
+ model: true
12
+
13
+ password:
14
+ desc: Senha para ser usado nas validações.
15
+ type: String
16
+
17
+ levels:
18
+ desc: Níveis de força da senha, é um objeto de objeto.
19
+ type: [Object, Boolean]
20
+ examples: ["{ label: 'Meu botão de cancelar', onClick: () => alert('fui clicado!') }"]
21
+ debugger: true
22
+ default:
23
+ 0:
24
+ color: 'negative'
25
+ label: 'Muito fraco'
26
+ progress: 0.05
27
+ textClass: 'text-negative'
28
+
29
+ 1:
30
+ color: warning
31
+ label: Fraco
32
+ progress: 0.25
33
+ textClass: text-warning
34
+
35
+ 2:
36
+ color: warning
37
+ label: Bom
38
+ progress: 0.5
39
+ textClass: text-warning
40
+
41
+ 3:
42
+ color: positive
43
+ label: Forte
44
+ progress: 0.75
45
+ textClass: text-positive
46
+
47
+ 4:
48
+ color: positive
49
+ label: Muito forte
50
+ progress: 1
51
+ textClass: text-positive
52
+
53
+ minlength:
54
+ desc: Número mínimo de caracteres.
55
+ default: 8
56
+ type: [Number, String]
57
+ examples: ["{ title: 'Meu título', description: 'Minha descrição' }"]
58
+
59
+ specials:
60
+ desc: Expressão regular para definir quais tipos de caracteres especiais vai aceitar.
61
+ default: /[!@#$%^&*()_+\-=[\]{}|;:'",<.>/?`~]/g
62
+ type: RegExp
63
+
64
+ track-color:
65
+ desc: Cor da barra de progresso.
66
+ default: blue-grey-1
67
+ type: String
68
+
69
+ use-lowercase:
70
+ desc: Obrigatório uso de letra(s) minuscula.
71
+ default: true
72
+ type: Boolean
73
+
74
+ use-numbers:
75
+ desc: Obrigatório uso de número(s) minuscula.
76
+ default: true
77
+ type: Boolean
78
+
79
+ use-special:
80
+ desc: Obrigatório uso de carácter especial.
81
+ default: true
82
+ type: Boolean
83
+
84
+ use-uppercase:
85
+ desc: Obrigatório uso de letra(s) maiúsculas.
86
+ default: true
87
+ type: Boolean
88
+
89
+ slots:
90
+ default:
91
+ desc: Slot para substituir o componente de progresso.
92
+ scope:
93
+ level:
94
+ desc: Retorna o nível de força.
95
+ type: Object
96
+
97
+ events:
98
+ '@update:model-value -> function (value)':
99
+ desc: Dispara toda vez que o model é atualizado, também utilizado para v-model.
100
+ params:
101
+ value:
102
+ desc: Novo valor do v-model
103
+ type: Boolean
@@ -4,7 +4,7 @@
4
4
  <div class="col-lg-5 col-xs-12">
5
5
  <div class="no-wrap q-col-gutter-md" :class="directionClasses">
6
6
  <div class="justify-center lg:q-mb-none md:q-mr-lg row xs:q-mb-md">
7
- <qas-avatar :image="userAvatarImage" :size="getAvatarSize" :title="title" />
7
+ <qas-avatar :image="userAvatarImage" :size="avatarSize" :title="title" />
8
8
  </div>
9
9
  <slot>
10
10
  <h6 class="text-bold text-h6">{{ title }}</h6>
@@ -13,7 +13,11 @@
13
13
  </div>
14
14
  </div>
15
15
  <slot name="grid">
16
- <qas-grid-generator class="col-lg-7 col-xs-12 items-center" :columns="columns" :fields="filterObject(fields, list)" hide-empty-result :result="result" />
16
+ <qas-grid-generator class="col-lg-7 col-xs-12 items-center" :columns="columns" :fields="filterObject(fields, list)" hide-empty-result :result="result">
17
+ <template v-for="(_, name) in $slots" #[name]="context">
18
+ <slot :name="name" v-bind="context || {}" />
19
+ </template>
20
+ </qas-grid-generator>
17
21
  </slot>
18
22
  </div>
19
23
  </component>
@@ -23,11 +27,13 @@
23
27
  import filterObject from '../../helpers/filter-object'
24
28
  import screenMixin from '../../mixins/screen'
25
29
 
26
- import QasAvatar from '../avatar/QasAvatar'
27
- import QasBox from '../box/QasBox'
28
- import QasGridGenerator from '../grid-generator/QasGridGenerator'
30
+ import QasAvatar from '../avatar/QasAvatar.vue'
31
+ import QasBox from '../box/QasBox.vue'
32
+ import QasGridGenerator from '../grid-generator/QasGridGenerator.vue'
29
33
 
30
34
  export default {
35
+ name: 'QasProfile',
36
+
31
37
  components: {
32
38
  QasAvatar,
33
39
  QasBox,
@@ -47,13 +53,9 @@ export default {
47
53
  default: () => ({})
48
54
  },
49
55
 
50
- hideStatus: {
51
- type: Boolean
52
- },
53
-
54
56
  list: {
55
57
  type: Array,
56
- default: () => ([])
58
+ default: () => []
57
59
  },
58
60
 
59
61
  result: {
@@ -80,15 +82,15 @@ export default {
80
82
 
81
83
  computed: {
82
84
  directionClasses () {
83
- return this.$_untilMedium ? 'col' : 'row items-center'
85
+ return this.mx_untilMedium ? 'col' : 'row items-center'
84
86
  },
85
87
 
86
88
  userAvatarImage () {
87
89
  return this.result.image
88
90
  },
89
91
 
90
- getAvatarSize () {
91
- return this.$_isSmall ? '145px' : '188px'
92
+ avatarSize () {
93
+ return this.mx_isSmall ? '145px' : '188px'
92
94
  }
93
95
  },
94
96
 
@@ -0,0 +1,60 @@
1
+ type: component
2
+
3
+ meta:
4
+ desc: Componente para cabeçalho de perfil.
5
+
6
+ props:
7
+ columns:
8
+ desc: Colunas do grid de cada campo.
9
+ default: col-6
10
+ type: Object
11
+ examples:
12
+ name:
13
+ col: 6
14
+
15
+ fields:
16
+ desc: Lista de field contendo informações necessárias para a criação do campo correspondente.
17
+ default: {}
18
+ type: Object
19
+ examples: ["{ email: { name: 'email', type: 'email', label: 'E-mail' } }"]
20
+
21
+ list:
22
+ desc: Lista de campos para filtrar da propriedade "fields".
23
+ default: []
24
+ type: Array
25
+ examples: ["[name, email]"]
26
+
27
+ result:
28
+ desc: Resultado contendo todas informações para serem exibidas na tela.
29
+ default: {}
30
+ type: Object
31
+ examples: ["{ 'joah@examples.com' }"]
32
+
33
+ subtitle:
34
+ desc: Subtitulo do cabeçalho de perfil.
35
+ type: String
36
+
37
+ title:
38
+ desc: Título do cabeçalho de perfil.
39
+ type: String
40
+ required: true
41
+
42
+ tag:
43
+ desc: Tag do componente pai.
44
+ default: qas-box
45
+ type: String
46
+
47
+ slots:
48
+ default:
49
+ desc: Slot para acessar seção de título e subtitulo.
50
+
51
+ grid:
52
+ desc: Slot para acessar seção do grid, onde fica o "QasGridGenerator";
53
+
54
+ 'field-[nome-da-chave]':
55
+ desc: Slot para todo o conteúdo dentro de cada grid (header e content), repassado do componente "QasGridGenerator".
56
+ scope:
57
+ field:
58
+ desc: Conteúdo do field atual mais o resultado formatado.
59
+ default: {}
60
+ type: Object
@@ -7,7 +7,7 @@
7
7
  </template>
8
8
 
9
9
  <script>
10
- import { greatestCommonDivisor } from '../../helpers'
10
+ import { getGreatestCommonDivisor } from '../../helpers'
11
11
 
12
12
  const baseURL = 'https://image-resize.nave.dev/'
13
13
 
@@ -40,7 +40,7 @@ export default {
40
40
 
41
41
  imageParameters () {
42
42
  const parameters = {
43
- bucket: this.$environment?.bucket,
43
+ bucket: process.env.BUCKET,
44
44
  key: this.source,
45
45
  edits: {}
46
46
  }
@@ -77,7 +77,7 @@ export default {
77
77
  const height = parseInt(this.height)
78
78
  const width = parseInt(this.width)
79
79
 
80
- const divisor = greatestCommonDivisor(height, width)
80
+ const divisor = getGreatestCommonDivisor(height, width)
81
81
 
82
82
  return (width / divisor) / (height / divisor)
83
83
  },
@@ -0,0 +1,23 @@
1
+ type: component
2
+
3
+ mixins:
4
+ - quasar/dist/api/QImg.json
5
+
6
+ meta:
7
+ desc: Componente para exibir imagem redimensionadas, implementa o "QImg".
8
+
9
+ props:
10
+ size:
11
+ desc: Tamanho da imagem.
12
+ type: String
13
+
14
+ source:
15
+ desc: Caminho da imagem.
16
+ type: String
17
+ examples: [bild-vitta.png]
18
+
19
+ resize:
20
+ desc: Formato de ajuste.
21
+ default: cover
22
+ type: String
23
+ examples: [cover, contain, fill, inside, outside]