@bildvitta/quasar-ui-asteroid 2.12.4 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/QasBox.json +16 -0
- package/dist/api/QasBreakline.json +32 -0
- package/dist/api/QasBtn.json +15 -0
- package/dist/api/QasDebugger.json +13 -0
- package/dist/asteroid.cjs.css +1 -0
- package/dist/asteroid.cjs.js +9154 -0
- package/dist/asteroid.cjs.min.js +6 -0
- package/dist/asteroid.esm.css +1 -0
- package/dist/asteroid.esm.js +9145 -0
- package/dist/asteroid.esm.min.js +6 -0
- package/dist/asteroid.umd.css +1 -0
- package/dist/asteroid.umd.js +9148 -0
- package/dist/asteroid.umd.min.js +6 -0
- package/dist/vetur/asteroid-attributes.json +30 -0
- package/dist/vetur/asteroid-tags.json +29 -0
- package/package.json +42 -56
- package/src/assets/logo-modular.svg +1 -0
- package/src/asteroid.js +1 -0
- package/src/components/actions/QasActions.vue +45 -0
- package/src/components/actions-menu/QasActionsMenu.vue +8 -19
- package/src/components/alert/QasAlert.vue +90 -0
- package/src/components/app-bar/QasAppBar.vue +59 -61
- package/src/components/app-menu/QasAppMenu.vue +128 -41
- package/src/components/avatar/QasAvatar.vue +7 -3
- 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 +12 -0
- package/src/components/card/QasCard.vue +29 -21
- package/src/components/checkbox-group/QasCheckboxGroup.vue +31 -17
- package/src/components/copy/QasCopy.vue +22 -11
- package/src/components/date-time-input/QasDateTimeInput.vue +16 -26
- package/src/components/debugger/QasDebugger.vue +2 -0
- package/src/components/debugger/QasDebugger.yml +10 -0
- package/src/components/delete/QasDelete.vue +28 -15
- package/src/components/dialog/QasDialog.vue +71 -67
- package/src/components/dialog-router/QasDialogRouter.vue +12 -4
- package/src/components/field/QasField.vue +22 -25
- package/src/components/filters/QasFilters.vue +31 -24
- package/src/components/form-generator/QasFormGenerator.vue +13 -15
- package/src/components/form-view/QasFormView.vue +117 -66
- package/src/components/gallery/QasGallery.vue +39 -26
- package/src/components/grid-generator/QasGridGenerator.vue +12 -6
- package/src/components/index.js +0 -0
- package/src/components/input/QasInput.vue +38 -36
- package/src/components/label/QasLabel.vue +14 -15
- package/src/components/layout/QasLayout.vue +81 -0
- package/src/components/list-items/QasListItems.vue +16 -8
- package/src/components/list-view/QasListView.vue +31 -28
- package/src/components/map/QasMap.vue +15 -25
- package/src/components/nested-fields/QasNestedFields.vue +39 -36
- package/src/components/numeric-input/QasNumericInput.vue +125 -0
- package/src/components/page-header/QasPageHeader.vue +19 -10
- package/src/components/password-input/QasPasswordInput.vue +20 -18
- package/src/components/password-strength-checker/QasPasswordStrengthChecker.vue +52 -31
- package/src/components/profile/QasProfile.vue +14 -12
- package/src/components/resizer/QasResizer.vue +1 -1
- package/src/components/search-box/QasSearchBox.vue +36 -20
- package/src/components/select/QasSelect.vue +43 -44
- package/src/components/select-list/QasSelectList.vue +64 -51
- package/src/components/signature-pad/QasSignaturePad.vue +57 -41
- package/src/components/signature-uploader/QasSignatureUploader.vue +15 -13
- package/src/components/single-view/QasSingleView.vue +31 -17
- package/src/components/sortable/QasSortable.vue +45 -27
- package/src/components/table-generator/QasTableGenerator.vue +95 -22
- package/src/components/tabs-generator/QasTabsGenerator.vue +36 -24
- package/src/components/text-truncate/QasTextTruncate.vue +25 -17
- package/src/components/transfer/QasTransfer.vue +57 -53
- package/src/components/uploader/QasUploader.vue +169 -48
- 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 +3 -4
- package/src/helpers/get-slot-children-text.js +15 -0
- package/src/helpers/{greatestCommonDivisor.js → greatest-common-divisor.js} +0 -0
- package/src/helpers/images.js +28 -0
- package/src/helpers/index.js +11 -57
- package/src/helpers/is-local-development.js +3 -0
- package/src/helpers/scroll-on-grap.js +61 -0
- package/src/index.cjs.js +1 -0
- package/src/index.esm.js +4 -0
- package/src/index.scss +18 -20
- 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 +57 -20
- package/src/plugins/Dialog.js +14 -0
- package/src/plugins/NotifySuccess.js +3 -3
- package/src/plugins/index.js +4 -2
- 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 -88
- package/src/components/app-menu/QasAppMenu.stories.js +0 -62
- 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/decimal-input/QasDecimalInput.stories.js +0 -82
- package/src/components/decimal-input/QasDecimalInput.vue +0 -92
- 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 -138
- package/src/components/input/QasInput.stories.js +0 -78
- package/src/components/label/QasLabel.stories.js +0 -60
- package/src/components/list-items/QasListItems.stories.js +0 -130
- 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/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 -116
- 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 -121
- 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 -245
- 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,4 +1,4 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
1
|
+
// import Vue from 'vue'
|
|
2
2
|
|
|
3
3
|
import { format, parseISO, isMatch } from 'date-fns'
|
|
4
4
|
import { ptBR } from 'date-fns/locale'
|
|
@@ -15,8 +15,7 @@ function __format (value, token, options = {}) {
|
|
|
15
15
|
|
|
16
16
|
// Asset
|
|
17
17
|
function asset (value) {
|
|
18
|
-
const
|
|
19
|
-
const bucketURL = process.env.BUCKET_URL || (environment ? environment.bucketURL : location.origin)
|
|
18
|
+
const bucketURL = process.env.BUCKET_URL || location.origin
|
|
20
19
|
|
|
21
20
|
return value ? `${bucketURL}/${value}` : ''
|
|
22
21
|
}
|
|
@@ -97,7 +96,7 @@ function handleMasks (value) {
|
|
|
97
96
|
// Labels
|
|
98
97
|
function humanize (field = {}, value) {
|
|
99
98
|
if (!value) return value
|
|
100
|
-
|
|
99
|
+
|
|
101
100
|
const mappedMasks = handleMasks(value)
|
|
102
101
|
|
|
103
102
|
if (mappedMasks[field.mask]) {
|
|
@@ -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
|
+
}
|
|
File without changes
|
|
@@ -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,57 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
decimal,
|
|
13
|
-
formatCompanyDocument,
|
|
14
|
-
formatDocument,
|
|
15
|
-
formatPersonalDocument,
|
|
16
|
-
formatPhone,
|
|
17
|
-
formatPostalCode,
|
|
18
|
-
handleMasks,
|
|
19
|
-
humanDate,
|
|
20
|
-
humanize,
|
|
21
|
-
money,
|
|
22
|
-
optionLabel,
|
|
23
|
-
parseValue,
|
|
24
|
-
percent,
|
|
25
|
-
squareArea
|
|
26
|
-
} from './filters.js'
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
// filters
|
|
30
|
-
asset,
|
|
31
|
-
booleanLabel,
|
|
32
|
-
constructObject,
|
|
33
|
-
date,
|
|
34
|
-
dateTime,
|
|
35
|
-
decimal,
|
|
36
|
-
formatCompanyDocument,
|
|
37
|
-
formatDocument,
|
|
38
|
-
formatPersonalDocument,
|
|
39
|
-
formatPhone,
|
|
40
|
-
formatPostalCode,
|
|
41
|
-
handleMasks,
|
|
42
|
-
humanDate,
|
|
43
|
-
humanize,
|
|
44
|
-
money,
|
|
45
|
-
optionLabel,
|
|
46
|
-
parseValue,
|
|
47
|
-
percent,
|
|
48
|
-
squareArea,
|
|
49
|
-
|
|
50
|
-
// history
|
|
51
|
-
handleHistory,
|
|
52
|
-
history,
|
|
53
|
-
|
|
54
|
-
base64ToBlob,
|
|
55
|
-
filterObject,
|
|
56
|
-
greatestCommonDivisor
|
|
57
|
-
}
|
|
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 scrollOnGrab } from './scroll-on-grap.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 greatestCommonDivisor } from './greatest-common-divisor.js'
|
|
9
|
+
|
|
10
|
+
export * from './filters.js'
|
|
11
|
+
export * from './images.js'
|
|
@@ -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
11
|
--qas-background-color: #fcfcff;
|
|
13
|
-
--qas-generic-border-radius: 8px;
|
|
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
|
+
good: {
|
|
3
|
+
color: 'warning',
|
|
4
|
+
label: 'Good',
|
|
5
|
+
progress: 0.5,
|
|
6
|
+
textClass: 'text-warning'
|
|
7
|
+
},
|
|
8
|
+
|
|
9
|
+
strong: {
|
|
10
|
+
color: 'positive',
|
|
11
|
+
label: 'Strong',
|
|
12
|
+
progress: 0.75,
|
|
13
|
+
textClass: 'text-positive'
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
veryStrong: {
|
|
17
|
+
color: 'positive',
|
|
18
|
+
label: 'Very strong',
|
|
19
|
+
progress: 1,
|
|
20
|
+
textClass: 'text-positive'
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
veryWeak: {
|
|
24
|
+
color: 'negative',
|
|
25
|
+
label: 'Very weak',
|
|
26
|
+
progress: 0,
|
|
27
|
+
textClass: 'text-negative'
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
weak: {
|
|
31
|
+
color: 'warning',
|
|
32
|
+
label: 'Weak',
|
|
33
|
+
progress: 0.25,
|
|
34
|
+
textClass: 'text-warning'
|
|
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
|
}
|