@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.
- package/dist/api/QasActions.json +40 -0
- package/dist/api/QasActionsMenu.json +64 -0
- package/dist/api/QasAlert.json +40 -0
- package/dist/api/QasAppBar.json +52 -0
- package/dist/api/QasAppMenu.json +38 -0
- package/dist/api/QasAvatar.json +44 -0
- package/dist/api/QasBox.json +16 -0
- package/dist/api/QasBreakline.json +32 -0
- package/dist/api/QasBtn.json +16 -0
- package/dist/api/QasCard.json +52 -0
- package/dist/api/QasCheckboxGroup.json +38 -0
- package/dist/api/QasCopy.json +29 -0
- package/dist/api/QasDateTimeInput.json +60 -0
- package/dist/api/QasDebugger.json +13 -0
- package/dist/api/QasDelete.json +64 -0
- package/dist/api/QasDialog.json +109 -0
- package/dist/api/QasDialogRouter.json +31 -0
- package/dist/api/QasField.json +56 -0
- package/dist/api/QasFilters.json +111 -0
- package/dist/api/QasFormGenerator.json +92 -0
- package/dist/api/QasFormView.json +228 -0
- package/dist/api/QasGallery.json +54 -0
- package/dist/api/QasGridGenerator.json +108 -0
- package/dist/api/QasInput.json +40 -0
- package/dist/api/QasLabel.json +40 -0
- package/dist/api/QasLayout.json +47 -0
- package/dist/api/QasListItems.json +72 -0
- package/dist/api/QasListView.json +161 -0
- package/dist/api/QasMap.json +41 -0
- package/dist/api/QasNestedFields.json +223 -0
- package/dist/api/QasNumericInput.json +68 -0
- package/dist/api/QasPageHeader.json +36 -0
- package/dist/api/QasPasswordInput.json +121 -0
- package/dist/api/QasPasswordStrengthChecker.json +126 -0
- package/dist/api/QasProfile.json +74 -0
- package/dist/api/QasResizer.json +34 -0
- package/dist/api/QasSearchBox.json +91 -0
- package/dist/api/QasSelect.json +88 -0
- package/dist/api/QasSelectList.json +134 -0
- package/dist/api/QasSignaturePad.json +63 -0
- package/dist/api/QasSignatureUploader.json +41 -0
- package/dist/api/QasSingleView.json +147 -0
- package/dist/api/QasSortable.json +80 -0
- package/dist/api/QasTableGenerator.json +56 -0
- package/dist/api/QasTabsGenerator.json +90 -0
- package/dist/api/QasTextTruncate.json +38 -0
- package/dist/api/QasTransfer.json +70 -0
- package/dist/api/QasUploader.json +143 -0
- package/dist/asteroid.cjs.css +1 -0
- package/dist/asteroid.cjs.js +9307 -0
- package/dist/asteroid.cjs.min.js +6 -0
- package/dist/asteroid.esm.css +1 -0
- package/dist/asteroid.esm.js +9298 -0
- package/dist/asteroid.esm.min.js +6 -0
- package/dist/asteroid.umd.css +1 -0
- package/dist/asteroid.umd.js +9301 -0
- package/dist/asteroid.umd.min.js +6 -0
- package/dist/vetur/asteroid-attributes.json +1178 -0
- package/dist/vetur/asteroid-tags.json +535 -0
- package/package.json +41 -56
- package/src/assets/logo-modular.svg +1 -1
- package/src/asteroid.js +1 -0
- package/src/components/actions/QasActions.vue +45 -0
- package/src/components/actions/QasActions.yml +24 -0
- package/src/components/actions-menu/QasActionsMenu.vue +41 -14
- package/src/components/actions-menu/QasActionsMenu.yml +63 -0
- package/src/components/alert/QasAlert.vue +90 -0
- package/src/components/alert/QasAlert.yml +33 -0
- package/src/components/app-bar/QasAppBar.vue +16 -13
- package/src/components/app-bar/QasAppBar.yml +51 -0
- package/src/components/app-menu/QasAppMenu.vue +10 -12
- package/src/components/app-menu/QasAppMenu.yml +32 -0
- package/src/components/avatar/QasAvatar.vue +17 -9
- package/src/components/avatar/QasAvatar.yml +38 -0
- package/src/components/box/QasBox.vue +12 -4
- package/src/components/box/QasBox.yml +13 -0
- package/src/components/breakline/QasBreakline.vue +37 -0
- package/src/components/breakline/QasBreakline.yml +25 -0
- package/src/components/btn/QasBtn.vue +27 -24
- package/src/components/btn/QasBtn.yml +13 -0
- package/src/components/card/QasCard.vue +32 -33
- package/src/components/card/QasCard.yml +42 -0
- package/src/components/checkbox-group/QasCheckboxGroup.vue +50 -17
- package/src/components/checkbox-group/QasCheckboxGroup.yml +30 -0
- package/src/components/copy/QasCopy.vue +22 -11
- package/src/components/copy/QasCopy.yml +20 -0
- package/src/components/date-time-input/QasDateTimeInput.vue +18 -26
- package/src/components/date-time-input/QasDateTimeInput.yml +54 -0
- package/src/components/debugger/QasDebugger.vue +2 -0
- package/src/components/debugger/QasDebugger.yml +10 -0
- package/src/components/delete/QasDelete.vue +43 -16
- package/src/components/delete/QasDelete.yml +52 -0
- package/src/components/dialog/QasDialog.vue +63 -67
- package/src/components/dialog/QasDialog.yml +86 -0
- package/src/components/dialog-router/QasDialogRouter.vue +14 -4
- package/src/components/dialog-router/QasDialogRouter.yml +23 -0
- package/src/components/field/QasField.vue +21 -24
- package/src/components/field/QasField.yml +31 -0
- package/src/components/filters/QasFilters.vue +33 -26
- package/src/components/filters/QasFilters.yml +91 -0
- package/src/components/form-generator/QasFormGenerator.vue +13 -15
- package/src/components/form-generator/QasFormGenerator.yml +64 -0
- package/src/components/form-view/QasFormView.vue +129 -69
- package/src/components/form-view/QasFormView.yml +179 -0
- package/src/components/gallery/QasGallery.vue +47 -30
- package/src/components/gallery/QasGallery.yml +51 -0
- package/src/components/grid-generator/QasGridGenerator.vue +15 -7
- package/src/components/grid-generator/QasGridGenerator.yml +73 -0
- package/src/components/index.js +0 -0
- package/src/components/input/QasInput.vue +43 -36
- package/src/components/input/QasInput.yml +32 -0
- package/src/components/label/QasLabel.vue +14 -15
- package/src/components/label/QasLabel.yml +28 -0
- package/src/components/layout/QasLayout.vue +13 -21
- package/src/components/layout/QasLayout.yml +38 -0
- package/src/components/list-items/QasListItems.vue +15 -12
- package/src/components/list-items/QasListItems.yml +57 -0
- package/src/components/list-view/QasListView.vue +57 -31
- package/src/components/list-view/QasListView.yml +132 -0
- package/src/components/map/QasMap.vue +15 -31
- package/src/components/map/QasMap.yml +33 -0
- package/src/components/nested-fields/QasNestedFields.vue +57 -47
- package/src/components/nested-fields/QasNestedFields.yml +180 -0
- package/src/components/numeric-input/QasNumericInput.vue +31 -22
- package/src/components/numeric-input/QasNumericInput.yml +51 -0
- package/src/components/page-header/QasPageHeader.vue +20 -11
- package/src/components/page-header/QasPageHeader.yml +24 -0
- package/src/components/password-input/QasPasswordInput.vue +24 -21
- package/src/components/password-input/QasPasswordInput.yml +103 -0
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.vue +51 -34
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.yml +103 -0
- package/src/components/profile/QasProfile.vue +15 -13
- package/src/components/profile/QasProfile.yml +60 -0
- package/src/components/resizer/QasResizer.vue +3 -3
- package/src/components/resizer/QasResizer.yml +23 -0
- package/src/components/search-box/QasSearchBox.vue +50 -21
- package/src/components/search-box/QasSearchBox.yml +76 -0
- package/src/components/select/QasSelect.vue +51 -50
- package/src/components/select/QasSelect.yml +62 -0
- package/src/components/select-list/QasSelectList.vue +72 -53
- package/src/components/select-list/QasSelectList.yml +116 -0
- package/src/components/signature-pad/QasSignaturePad.vue +60 -40
- package/src/components/signature-pad/QasSignaturePad.yml +53 -0
- package/src/components/signature-uploader/QasSignatureUploader.vue +19 -17
- package/src/components/signature-uploader/QasSignatureUploader.yml +36 -0
- package/src/components/single-view/QasSingleView.vue +41 -22
- package/src/components/single-view/QasSingleView.yml +116 -0
- package/src/components/sortable/QasSortable.vue +51 -30
- package/src/components/sortable/QasSortable.yml +65 -0
- package/src/components/table-generator/QasTableGenerator.vue +112 -21
- package/src/components/table-generator/QasTableGenerator.yml +46 -0
- package/src/components/tabs-generator/QasTabsGenerator.vue +37 -25
- package/src/components/tabs-generator/QasTabsGenerator.yml +67 -0
- package/src/components/text-truncate/QasTextTruncate.vue +25 -17
- package/src/components/text-truncate/QasTextTruncate.yml +32 -0
- package/src/components/transfer/QasTransfer.vue +48 -49
- package/src/components/transfer/QasTransfer.yml +59 -0
- package/src/components/uploader/QasUploader.vue +169 -48
- package/src/components/uploader/QasUploader.yml +117 -0
- package/src/css/background.scss +1 -1
- package/src/css/border.scss +7 -6
- package/src/css/design-system.scss +0 -43
- package/src/css/fonts.scss +2 -28
- package/src/css/opacity.scss +0 -4
- package/src/css/set-brand.scss +15 -0
- package/src/css/transitions.scss +1 -1
- package/src/helpers/add-counter-suffix.js +3 -0
- package/src/helpers/{base64ToBlob.js → base-64-to-blob.js} +0 -0
- package/src/helpers/{constructObject.js → construct-object.js} +0 -0
- package/src/helpers/filter-object.js +8 -6
- package/src/helpers/filters.js +8 -4
- package/src/helpers/{greatestCommonDivisor.js → get-greatest-common-divisor.js} +0 -0
- package/src/helpers/get-slot-children-text.js +15 -0
- package/src/helpers/images.js +28 -0
- package/src/helpers/index.js +11 -59
- package/src/helpers/{isLocalDevelopment.js → is-local-development.js} +0 -0
- package/src/helpers/set-scroll-on-grab.js +61 -0
- package/src/index.cjs.js +1 -0
- package/src/index.esm.js +4 -0
- package/src/index.scss +19 -21
- package/src/index.umd.js +2 -0
- package/src/mixins/context.js +1 -1
- package/src/mixins/dialog-router.js +17 -0
- package/src/mixins/form.js +4 -12
- package/src/mixins/generator.js +14 -14
- package/src/mixins/index.js +2 -8
- package/src/mixins/password.js +73 -11
- package/src/mixins/screen.js +8 -6
- package/src/mixins/view.js +62 -22
- package/src/plugins/dialog/Dialog.js +14 -0
- package/src/plugins/dialog/Dialog.yml +10 -0
- package/src/plugins/index.js +4 -2
- package/src/plugins/{NotifyError.js → notify-error/NotifyError.js} +0 -0
- package/src/plugins/notify-error/NotifyError.yml +11 -0
- package/src/plugins/{NotifySuccess.js → notify-success/NotifySuccess.js} +3 -3
- package/src/plugins/notify-success/NotifySuccess.yml +11 -0
- package/src/store/history.js +43 -0
- package/src/store/index.js +1 -0
- package/src/vue-plugin.js +185 -0
- package/.babelrc +0 -12
- package/.storybook/main.js +0 -35
- package/.storybook/preview.js +0 -26
- package/debug.log +0 -1
- package/index.js +0 -4
- package/jest-setup.js +0 -1
- package/jest.config.json +0 -22
- package/postcss.config.js +0 -5
- package/src/components/Introduction.stories.mdx +0 -12
- package/src/components/actions-menu/QasActionsMenu.stories.js +0 -73
- package/src/components/app-bar/QasAppBar.stories.js +0 -84
- package/src/components/app-menu/QasAppMenu.stories.js +0 -66
- package/src/components/apps-menu/QasAppsMenu.spec.js +0 -58
- package/src/components/apps-menu/QasAppsMenu.stories.js +0 -54
- package/src/components/apps-menu/QasAppsMenu.vue +0 -48
- package/src/components/avatar/QasAvatar.spec.js +0 -14
- package/src/components/avatar/QasAvatar.stories.js +0 -52
- package/src/components/box/QasBox.spec.js +0 -18
- package/src/components/box/QasBox.stories.js +0 -35
- package/src/components/break-line/QasBreakLine.stories.js +0 -57
- package/src/components/break-line/QasBreakLine.vue +0 -52
- package/src/components/btn/QasBtn.stories.js +0 -45
- package/src/components/btn-actions/QasBtnActions.stories.js +0 -77
- package/src/components/btn-actions/QasBtnActions.vue +0 -54
- package/src/components/card/QasCard.stories.js +0 -126
- package/src/components/checkbox-group/QasCheckboxGroup.stories.js +0 -59
- package/src/components/copy/QasCopy.stories.js +0 -41
- package/src/components/date-time-input/QasDateTimeInput.stories.js +0 -67
- package/src/components/debugger/QasDebugger.stories.js +0 -33
- package/src/components/delete/QasDelete.stories.js +0 -80
- package/src/components/dialog/QasDialog.stories.js +0 -139
- package/src/components/dialog-router/QasDialogRouter.stories.js +0 -38
- package/src/components/field/QasField.stories.js +0 -181
- package/src/components/filters/QasFilters.stories.js +0 -121
- package/src/components/form-generator/QasFormGenerator.stories.js +0 -115
- package/src/components/form-view/QasFormView.stories.js +0 -236
- package/src/components/gallery/QasGallery.stories.js +0 -91
- package/src/components/grid-generator/QasGridGenerator.stories.js +0 -142
- package/src/components/input/QasInput.stories.js +0 -78
- package/src/components/label/QasLabel.stories.js +0 -60
- package/src/components/layout/QasLayout.stories.js +0 -104
- package/src/components/list-items/QasListItems.stories.js +0 -135
- package/src/components/list-view/QasListView.stories.js +0 -168
- package/src/components/map/QasMap.stories.js +0 -75
- package/src/components/nested-fields/QasNestedFields.stories.js +0 -255
- package/src/components/numeric-input/QasNumericInput.stories.js +0 -92
- package/src/components/page-header/QasPageHeader.stories.js +0 -61
- package/src/components/password-input/QasPasswordInput.stories.js +0 -76
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.stories.js +0 -54
- package/src/components/profile/QasProfile.stories.js +0 -131
- package/src/components/resizer/QasResizer.stories.js +0 -43
- package/src/components/search-box/QasSearchBox.stories.js +0 -111
- package/src/components/select/QasSelect.stories.js +0 -113
- package/src/components/select-list/QasSelectList.stories.js +0 -153
- package/src/components/signature-pad/QasSignaturePad.stories.js +0 -51
- package/src/components/signature-uploader/QasSignatureUploader.stories.js +0 -69
- package/src/components/single-view/QasSingleView.stories.js +0 -130
- package/src/components/sortable/QasSortable.stories.js +0 -80
- package/src/components/table-generator/QasTableGenerator.stories.js +0 -120
- package/src/components/tabs-generator/QasTabsGenerator.stories.js +0 -145
- package/src/components/text-truncate/QasTextTruncate.stories.js +0 -55
- package/src/components/tip/QasTip.stories.js +0 -57
- package/src/components/tip/QasTip.vue +0 -68
- package/src/components/tooltip/QasTooltip.stories.js +0 -63
- package/src/components/tooltip/QasTooltip.vue +0 -81
- package/src/components/transfer/QasTransfer.stories.js +0 -118
- package/src/components/uploader/QasCustomUploader.vue +0 -120
- package/src/components/uploader/QasUploader.stories.js +0 -139
- package/src/directives/Test.js +0 -13
- package/src/helpers/historyHandler.js +0 -52
- package/src/helpers/label.js +0 -3
- package/src/index.js +0 -249
- package/src/mixins/map-markers.js +0 -26
- package/src/mixins/unsaved-changes.js +0 -24
- package/src/mixins/uploader.js +0 -30
- package/src/mocks/json/user.json +0 -27
- package/src/mocks/json/users-new.json +0 -23
- package/src/mocks/json/users.json +0 -97
- package/src/mocks/storeModule.js +0 -71
- package/src/pages/Forbidden.vue +0 -6
- package/src/pages/NotFound.vue +0 -6
package/src/css/opacity.scss
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@mixin set-brand($name, $color) {
|
|
2
|
+
:root {
|
|
3
|
+
--q-#{$name}: #{$color};
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.text-#{$name} {
|
|
7
|
+
color: $color !important;
|
|
8
|
+
color: var(--q-#{$name}) !important;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.bg-#{$name} {
|
|
12
|
+
background: $color !important;
|
|
13
|
+
background: var(--q-#{$name}) !important;
|
|
14
|
+
}
|
|
15
|
+
}
|
package/src/css/transitions.scss
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Function to filter specific field inside a fields
|
|
3
|
+
* Função para filtrar propriedades espessificas dentro de um objeto
|
|
3
4
|
*
|
|
4
|
-
* @param {object} fields
|
|
5
|
-
* @param {array} models array
|
|
6
|
-
* @
|
|
7
|
-
* @returns {object} filtered object
|
|
5
|
+
* @param {object} fields objeto com propriedades
|
|
6
|
+
* @param {array} models array de string com nomes das proproiedades que serão filtradas
|
|
7
|
+
* @returns {object} objeto com propriedades filtradas
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* filterObject({
|
|
@@ -13,8 +13,10 @@
|
|
|
13
13
|
* }, ['name'])
|
|
14
14
|
*/
|
|
15
15
|
export default function (fields = {}, models) {
|
|
16
|
-
if (!models.length)
|
|
17
|
-
|
|
16
|
+
if (!models.length) return fields
|
|
17
|
+
|
|
18
|
+
if (!Object.keys(fields).length) {
|
|
19
|
+
return {}
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
if (!Object.keys(fields).length) {
|
package/src/helpers/filters.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
|
-
|
|
3
1
|
import { format, parseISO, isMatch } from 'date-fns'
|
|
4
2
|
import { ptBR } from 'date-fns/locale'
|
|
5
3
|
|
|
@@ -15,8 +13,7 @@ function __format (value, token, options = {}) {
|
|
|
15
13
|
|
|
16
14
|
// Asset
|
|
17
15
|
function asset (value) {
|
|
18
|
-
const
|
|
19
|
-
const bucketURL = process.env.BUCKET_URL || (environment ? environment.bucketURL : location.origin)
|
|
16
|
+
const bucketURL = process.env.BUCKET_URL || location.origin
|
|
20
17
|
|
|
21
18
|
return value ? `${bucketURL}/${value}` : ''
|
|
22
19
|
}
|
|
@@ -59,6 +56,11 @@ function squareArea (value = 0, suffix = 'm²') {
|
|
|
59
56
|
return value ? `${value} ${suffix}` : ''
|
|
60
57
|
}
|
|
61
58
|
|
|
59
|
+
function formatPercent (value = 0, places = 2) {
|
|
60
|
+
value = Number(value)
|
|
61
|
+
return value ? value.toLocaleString('pt-BR', { style: 'percent', minimumFractionDigits: places }) : ''
|
|
62
|
+
}
|
|
63
|
+
|
|
62
64
|
function formatCompanyDocument (value) {
|
|
63
65
|
return value.replace(/^(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/g, '$1.$2.$3/$4-$5')
|
|
64
66
|
}
|
|
@@ -111,6 +113,7 @@ function humanize (field = {}, value) {
|
|
|
111
113
|
case 'datetime': return dateTime(value)
|
|
112
114
|
case 'time': return time(value)
|
|
113
115
|
case 'radio': return selectLabel(field.options, value)
|
|
116
|
+
case 'percent': return formatPercent(value)
|
|
114
117
|
default: return value
|
|
115
118
|
}
|
|
116
119
|
}
|
|
@@ -143,6 +146,7 @@ export {
|
|
|
143
146
|
decimal,
|
|
144
147
|
formatCompanyDocument,
|
|
145
148
|
formatDocument,
|
|
149
|
+
formatPercent,
|
|
146
150
|
formatPersonalDocument,
|
|
147
151
|
formatPhone,
|
|
148
152
|
formatPostalCode,
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// https://stackoverflow.com/a/64167032/977687
|
|
2
|
+
|
|
3
|
+
export default function getSlotChildrenText (children) {
|
|
4
|
+
return children.map(node => {
|
|
5
|
+
if (!node.children || typeof node.children === 'string') {
|
|
6
|
+
return node.children || ''
|
|
7
|
+
} else if (Array.isArray(node.children)) {
|
|
8
|
+
return getSlotChildrenText(node.children)
|
|
9
|
+
} else if (node.children.default) {
|
|
10
|
+
return getSlotChildrenText(node.children.default())
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return undefined
|
|
14
|
+
}).join('')
|
|
15
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function getImageSize (image) {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
image.addEventListener('load', () => {
|
|
4
|
+
resolve({ width: image.naturalWidth, height: image.naturalHeight })
|
|
5
|
+
})
|
|
6
|
+
|
|
7
|
+
image.addEventListener('error', reject)
|
|
8
|
+
})
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function getResizeDimensions (sizeLimit, width, height) {
|
|
12
|
+
const factor = sizeLimit / Math.max(width, height)
|
|
13
|
+
|
|
14
|
+
if (factor < 1) {
|
|
15
|
+
width *= factor
|
|
16
|
+
height *= factor
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
width: Math.round(width),
|
|
21
|
+
height: Math.round(height)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export {
|
|
26
|
+
getImageSize,
|
|
27
|
+
getResizeDimensions
|
|
28
|
+
}
|
package/src/helpers/index.js
CHANGED
|
@@ -1,59 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
dateTime,
|
|
13
|
-
decimal,
|
|
14
|
-
formatCompanyDocument,
|
|
15
|
-
formatDocument,
|
|
16
|
-
formatPersonalDocument,
|
|
17
|
-
formatPhone,
|
|
18
|
-
formatPostalCode,
|
|
19
|
-
handleMasks,
|
|
20
|
-
humanDate,
|
|
21
|
-
humanize,
|
|
22
|
-
money,
|
|
23
|
-
optionLabel,
|
|
24
|
-
parseValue,
|
|
25
|
-
percent,
|
|
26
|
-
squareArea
|
|
27
|
-
} from './filters.js'
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
// filters
|
|
31
|
-
asset,
|
|
32
|
-
booleanLabel,
|
|
33
|
-
constructObject,
|
|
34
|
-
date,
|
|
35
|
-
dateTime,
|
|
36
|
-
decimal,
|
|
37
|
-
formatCompanyDocument,
|
|
38
|
-
formatDocument,
|
|
39
|
-
formatPersonalDocument,
|
|
40
|
-
formatPhone,
|
|
41
|
-
formatPostalCode,
|
|
42
|
-
handleMasks,
|
|
43
|
-
humanDate,
|
|
44
|
-
humanize,
|
|
45
|
-
money,
|
|
46
|
-
optionLabel,
|
|
47
|
-
parseValue,
|
|
48
|
-
percent,
|
|
49
|
-
squareArea,
|
|
50
|
-
|
|
51
|
-
// history
|
|
52
|
-
handleHistory,
|
|
53
|
-
history,
|
|
54
|
-
|
|
55
|
-
base64ToBlob,
|
|
56
|
-
filterObject,
|
|
57
|
-
greatestCommonDivisor,
|
|
58
|
-
isLocalDevelopment
|
|
59
|
-
}
|
|
1
|
+
export { default as addCounterSuffix } from './add-counter-suffix.js'
|
|
2
|
+
export { default as getSlotChildrenText } from './get-slot-children-text.js'
|
|
3
|
+
export { default as setScrollOnGrab } from './set-scroll-on-grab.js'
|
|
4
|
+
export { default as isLocalDevelopment } from './is-local-development.js'
|
|
5
|
+
export { default as base64ToBlob } from './base-64-to-blob.js'
|
|
6
|
+
export { default as constructObject } from './construct-object.js'
|
|
7
|
+
export { default as filterObject } from './filter-object.js'
|
|
8
|
+
export { default as getGreatestCommonDivisor } from './get-greatest-common-divisor.js'
|
|
9
|
+
|
|
10
|
+
export * from './filters.js'
|
|
11
|
+
export * from './images.js'
|
|
File without changes
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export default function (element) {
|
|
2
|
+
setStyle()
|
|
3
|
+
|
|
4
|
+
let isDown = false
|
|
5
|
+
let startX
|
|
6
|
+
let scrollLeft
|
|
7
|
+
|
|
8
|
+
element.addEventListener('mousedown', onMouseDown)
|
|
9
|
+
element.addEventListener('mouseleave', onMouseLeave)
|
|
10
|
+
element.addEventListener('mouseup', onMouseUp)
|
|
11
|
+
element.addEventListener('mousemove', onMouseMove)
|
|
12
|
+
|
|
13
|
+
function onMouseDown (event) {
|
|
14
|
+
isDown = true
|
|
15
|
+
element.classList.add('active')
|
|
16
|
+
startX = event.pageX - element.offsetLeft
|
|
17
|
+
scrollLeft = element.scrollLeft
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function onMouseLeave () {
|
|
21
|
+
isDown = false
|
|
22
|
+
element.classList.remove('active')
|
|
23
|
+
|
|
24
|
+
setStyle()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function onMouseUp () {
|
|
28
|
+
isDown = false
|
|
29
|
+
element.classList.remove('active')
|
|
30
|
+
|
|
31
|
+
setStyle()
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function onMouseMove (event) {
|
|
35
|
+
if (!isDown) return
|
|
36
|
+
|
|
37
|
+
event.preventDefault()
|
|
38
|
+
|
|
39
|
+
setStyle('grabbing')
|
|
40
|
+
|
|
41
|
+
const x = event.pageX - element.offsetLeft
|
|
42
|
+
const walk = (x - startX) * 3 // scroll-fast
|
|
43
|
+
element.scrollLeft = scrollLeft - walk
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function setStyle (model = 'grab') {
|
|
47
|
+
element.style.cursor = model
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function destroyEvents () {
|
|
51
|
+
element.removeEventListener('mousedown', onMouseDown)
|
|
52
|
+
element.removeEventListener('mouseleave', onMouseLeave)
|
|
53
|
+
element.removeEventListener('mouseup', onMouseUp)
|
|
54
|
+
element.removeEventListener('mousemove', onMouseMove)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
element,
|
|
59
|
+
destroyEvents
|
|
60
|
+
}
|
|
61
|
+
}
|
package/src/index.cjs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './vue-plugin'
|
package/src/index.esm.js
ADDED
package/src/index.scss
CHANGED
|
@@ -1,31 +1,29 @@
|
|
|
1
|
-
@import 'quasar/src/css/variables
|
|
1
|
+
@import 'quasar/src/css/variables';
|
|
2
2
|
|
|
3
3
|
// Quasar variables
|
|
4
|
-
$primary: var(--q-
|
|
5
|
-
$primary-contrast: var(--q-
|
|
6
|
-
|
|
7
|
-
$secondary: var(--q-
|
|
8
|
-
$secondary-contrast: var(--q-color-secondary-contrast);
|
|
4
|
+
$primary: var(--q-primary);
|
|
5
|
+
$primary-contrast: var(--q-primary-contrast);
|
|
6
|
+
$secondary: var(--q-secondary);
|
|
7
|
+
$secondary-contrast: var(--q-secondary-contrast);
|
|
9
8
|
|
|
10
9
|
// Asteroid variables
|
|
11
10
|
:root {
|
|
12
|
-
--qas-background-color: #
|
|
13
|
-
--qas-generic-border-radius: 8px;
|
|
11
|
+
--qas-background-color: #fcfcff;
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
$background-color: var(--qas-background-color);
|
|
17
|
-
$generic-border-radius: var(--qas-generic-border-radius);
|
|
18
15
|
|
|
19
|
-
@import './css/background
|
|
20
|
-
@import './css/border
|
|
21
|
-
@import './css/border-radius
|
|
22
|
-
@import './css/container
|
|
23
|
-
@import './css/fonts
|
|
24
|
-
@import './css/line-height
|
|
25
|
-
@import './css/opacity
|
|
26
|
-
@import './css/shadow
|
|
27
|
-
@import './css/text
|
|
28
|
-
@import './css/transitions
|
|
29
|
-
@import './css/unset
|
|
16
|
+
@import './css/background';
|
|
17
|
+
@import './css/border';
|
|
18
|
+
@import './css/border-radius';
|
|
19
|
+
@import './css/container';
|
|
20
|
+
@import './css/fonts';
|
|
21
|
+
@import './css/line-height';
|
|
22
|
+
@import './css/opacity';
|
|
23
|
+
@import './css/shadow';
|
|
24
|
+
@import './css/text';
|
|
25
|
+
@import './css/transitions';
|
|
26
|
+
@import './css/unset';
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
// Design System
|
|
29
|
+
@import './css/design-system';
|
package/src/index.umd.js
ADDED
package/src/mixins/context.js
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
methods: {
|
|
3
|
+
mx_dialogRouter (route) {
|
|
4
|
+
this.$refs.dialogRouter.show(route)
|
|
5
|
+
},
|
|
6
|
+
|
|
7
|
+
mx_reload () {
|
|
8
|
+
if (this.$refs.listView) {
|
|
9
|
+
this.$refs.listView.refresh()
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (this.$refs.singleView) {
|
|
13
|
+
this.$refs.singleView.fetchSingle()
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
package/src/mixins/form.js
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
computed: {
|
|
3
|
-
|
|
4
|
-
return ['replace', 'update'].includes(this
|
|
3
|
+
mx_isEditMode () {
|
|
4
|
+
return ['replace', 'update'].includes(this.mx_mode)
|
|
5
5
|
},
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
return this.$
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
$_resolvedRoute () {
|
|
12
|
-
if (this.route && Object.keys(this.route).length) {
|
|
13
|
-
return this.route
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return this.$route
|
|
7
|
+
mx_mode () {
|
|
8
|
+
return this.$route.name.endsWith('Edit') ? 'replace' : 'create'
|
|
17
9
|
}
|
|
18
10
|
}
|
|
19
11
|
}
|
package/src/mixins/generator.js
CHANGED
|
@@ -12,15 +12,15 @@ export default {
|
|
|
12
12
|
type: Object
|
|
13
13
|
},
|
|
14
14
|
|
|
15
|
-
// TODO: Validar entrada e mudar documentação para seletor.
|
|
16
15
|
gutter: {
|
|
17
16
|
default: 'md',
|
|
18
|
-
type: [String, Boolean]
|
|
17
|
+
type: [String, Boolean],
|
|
18
|
+
validator: value => ['xs', 'sm', 'md', 'lg', 'xl'].includes(value)
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
|
|
22
22
|
computed: {
|
|
23
|
-
|
|
23
|
+
mx_classes () {
|
|
24
24
|
const classes = ['row']
|
|
25
25
|
|
|
26
26
|
if (this.gutter) {
|
|
@@ -32,7 +32,7 @@ export default {
|
|
|
32
32
|
},
|
|
33
33
|
|
|
34
34
|
methods: {
|
|
35
|
-
|
|
35
|
+
mx_getBreakpoint (columns) {
|
|
36
36
|
const classes = []
|
|
37
37
|
const profiles = { col: 'col', xs: 'col-xs', sm: 'col-sm', md: 'col-md', lg: 'col-lg', xl: 'col-xl' }
|
|
38
38
|
const { fieldProps, classes: renamedClasses, ...formattedColumns } = columns || {}
|
|
@@ -45,25 +45,25 @@ export default {
|
|
|
45
45
|
return [...classes, renamedClasses]
|
|
46
46
|
},
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
mx_getFieldClass (index, isGridGenerator) {
|
|
49
49
|
if (typeof this.columns === 'string') {
|
|
50
50
|
return irregularClasses.includes(this.columns) ? this.columns : `col-${this.columns}`
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
return Array.isArray(this.columns)
|
|
54
|
-
? this.
|
|
55
|
-
: this.
|
|
54
|
+
? this.mx_handleColumnsByIndex(index, isGridGenerator)
|
|
55
|
+
: this.mx_handleColumnsByField(index, isGridGenerator)
|
|
56
56
|
},
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
mx_handleColumnsByField (index, isGridGenerator) {
|
|
59
59
|
if (!this.columns[index]) {
|
|
60
|
-
return this.
|
|
60
|
+
return this.mx_setDefaultColumnClass(isGridGenerator)
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
return this.
|
|
63
|
+
return this.mx_getBreakpoint(this.columns[index])
|
|
64
64
|
},
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
mx_handleColumnsByIndex (index, isGridGenerator) {
|
|
67
67
|
const fields = isGridGenerator ? this.fields : this.groupedFields.visible
|
|
68
68
|
|
|
69
69
|
if (!Array.isArray(fields)) {
|
|
@@ -73,13 +73,13 @@ export default {
|
|
|
73
73
|
const length = this.columns.length
|
|
74
74
|
|
|
75
75
|
if (!length) {
|
|
76
|
-
return this.
|
|
76
|
+
return this.mx_setDefaultColumnClass(isGridGenerator)
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
return this.
|
|
79
|
+
return this.mx_getBreakpoint(this.columns[index])
|
|
80
80
|
},
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
mx_setDefaultColumnClass (isGridGenerator) {
|
|
83
83
|
return isGridGenerator ? 'col-6 col-xs-12 col-sm-4' : 'col-6'
|
|
84
84
|
}
|
|
85
85
|
}
|
package/src/mixins/index.js
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import contextMixin from './context.js'
|
|
2
2
|
import formMixin from './form.js'
|
|
3
3
|
import generatorMixin from './generator.js'
|
|
4
|
-
import mapMarkersMixin from './map-markers.js'
|
|
5
4
|
import passwordMixin from './password.js'
|
|
6
5
|
import screenMixin from './screen.js'
|
|
7
|
-
import unsavedChangesMixin from './unsaved-changes.js'
|
|
8
|
-
import uploaderMixin from './uploader.js'
|
|
9
6
|
import viewMixin from './view.js'
|
|
10
7
|
|
|
11
8
|
export {
|
|
12
9
|
contextMixin,
|
|
13
10
|
formMixin,
|
|
14
11
|
generatorMixin,
|
|
15
|
-
mapMarkersMixin,
|
|
16
12
|
passwordMixin,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
uploaderMixin,
|
|
20
|
-
viewMixin
|
|
13
|
+
viewMixin,
|
|
14
|
+
screenMixin
|
|
21
15
|
}
|
package/src/mixins/password.js
CHANGED
|
@@ -1,19 +1,81 @@
|
|
|
1
|
+
const levels = {
|
|
2
|
+
0: {
|
|
3
|
+
color: 'negative',
|
|
4
|
+
label: 'Muito fraco',
|
|
5
|
+
progress: 0.05,
|
|
6
|
+
textClass: 'text-negative'
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
1: {
|
|
10
|
+
color: 'warning',
|
|
11
|
+
label: 'Fraco',
|
|
12
|
+
progress: 0.25,
|
|
13
|
+
textClass: 'text-warning'
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
2: {
|
|
17
|
+
color: 'warning',
|
|
18
|
+
label: 'Bom',
|
|
19
|
+
progress: 0.5,
|
|
20
|
+
textClass: 'text-warning'
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
3: {
|
|
24
|
+
color: 'positive',
|
|
25
|
+
label: 'Forte',
|
|
26
|
+
progress: 0.75,
|
|
27
|
+
textClass: 'text-positive'
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
4: {
|
|
31
|
+
color: 'positive',
|
|
32
|
+
label: 'Muito forte',
|
|
33
|
+
progress: 1,
|
|
34
|
+
textClass: 'text-positive'
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
1
38
|
export default {
|
|
2
39
|
props: {
|
|
3
|
-
|
|
4
|
-
default:
|
|
5
|
-
type:
|
|
40
|
+
levels: {
|
|
41
|
+
default: () => levels,
|
|
42
|
+
type: Object
|
|
6
43
|
},
|
|
7
44
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
45
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/minlength
|
|
46
|
+
minlength: {
|
|
47
|
+
default: 8,
|
|
48
|
+
type: [Number, String]
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
specials: {
|
|
52
|
+
default: /[!@#$%^&*()_+\-=[\]{}|;:'",<.>/?`~]/g,
|
|
53
|
+
type: RegExp
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
trackColor: {
|
|
57
|
+
default: 'blue-grey-1',
|
|
58
|
+
type: String
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
useLowercase: {
|
|
62
|
+
default: true,
|
|
63
|
+
type: Boolean
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
useNumbers: {
|
|
67
|
+
default: true,
|
|
68
|
+
type: Boolean
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
useSpecial: {
|
|
72
|
+
default: true,
|
|
73
|
+
type: Boolean
|
|
74
|
+
},
|
|
13
75
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
76
|
+
useUppercase: {
|
|
77
|
+
default: true,
|
|
78
|
+
type: Boolean
|
|
17
79
|
}
|
|
18
80
|
}
|
|
19
81
|
}
|
package/src/mixins/screen.js
CHANGED
|
@@ -1,31 +1,33 @@
|
|
|
1
1
|
export default {
|
|
2
|
+
// TODO: Esses nomes precisam ser alterados para algo mais inteligente.
|
|
3
|
+
|
|
2
4
|
computed: {
|
|
3
|
-
|
|
5
|
+
mx_isSmall () {
|
|
4
6
|
// until 599
|
|
5
7
|
return this.$q.screen.xs
|
|
6
8
|
},
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
mx_isMedium () {
|
|
9
11
|
// from 600 until 1023
|
|
10
12
|
return this.$q.screen.sm
|
|
11
13
|
},
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
mx_isLarge () {
|
|
14
16
|
// from 1024 until the limit
|
|
15
17
|
return this.$q.screen.gt.sm
|
|
16
18
|
},
|
|
17
19
|
|
|
18
|
-
|
|
20
|
+
mx_untilMedium () {
|
|
19
21
|
// from 0 until 599
|
|
20
22
|
return this.$q.screen.lt.sm
|
|
21
23
|
},
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
mx_untilLarge () {
|
|
24
26
|
// from 0 until 1023
|
|
25
27
|
return this.$q.screen.lt.md
|
|
26
28
|
},
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
mx_isMobile () {
|
|
29
31
|
return this.$q.platform.is.mobile
|
|
30
32
|
}
|
|
31
33
|
}
|