quasar 2.4.13 → 2.5.3
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/QCheckbox.json +27 -0
- package/dist/api/QRadio.json +18 -0
- package/dist/api/QTime.json +8 -2
- package/dist/api/QToggle.json +24 -24
- package/dist/icon-set/bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5-pro.umd.prod.js +1 -1
- package/dist/icon-set/fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/material-icons.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v3.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v4.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v5.umd.prod.js +1 -1
- package/dist/icon-set/mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-bootstrap-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-eva-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-fontawesome-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v4.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-ionicons-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-line-awesome.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-outlined.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-round.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons-sharp.umd.prod.js +1 -1
- package/dist/icon-set/svg-material-icons.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v4.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v5.umd.prod.js +1 -1
- package/dist/icon-set/svg-mdi-v6.umd.prod.js +1 -1
- package/dist/icon-set/svg-themify.umd.prod.js +1 -1
- package/dist/icon-set/themify.umd.prod.js +1 -1
- package/dist/lang/ar.umd.prod.js +1 -1
- package/dist/lang/az-Latn.umd.prod.js +1 -1
- package/dist/lang/bg.umd.prod.js +1 -1
- package/dist/lang/bn.umd.prod.js +1 -1
- package/dist/lang/ca.umd.prod.js +1 -1
- package/dist/lang/cs.umd.prod.js +1 -1
- package/dist/lang/da.umd.prod.js +1 -1
- package/dist/lang/de.umd.prod.js +1 -1
- package/dist/lang/el.umd.prod.js +1 -1
- package/dist/lang/en-GB.umd.prod.js +1 -1
- package/dist/lang/en-US.umd.prod.js +1 -1
- package/dist/lang/eo.umd.prod.js +1 -1
- package/dist/lang/es.umd.prod.js +1 -1
- package/dist/lang/et.umd.prod.js +1 -1
- package/dist/lang/fa-IR.umd.prod.js +1 -1
- package/dist/lang/fa.umd.prod.js +1 -1
- package/dist/lang/fi.umd.prod.js +1 -1
- package/dist/lang/fr.umd.prod.js +1 -1
- package/dist/lang/gn.umd.prod.js +1 -1
- package/dist/lang/he.umd.prod.js +1 -1
- package/dist/lang/hr.umd.prod.js +1 -1
- package/dist/lang/hu.umd.prod.js +1 -1
- package/dist/lang/id.umd.prod.js +1 -1
- package/dist/lang/is.umd.prod.js +1 -1
- package/dist/lang/it.umd.prod.js +1 -1
- package/dist/lang/ja.umd.prod.js +1 -1
- package/dist/lang/km.umd.prod.js +1 -1
- package/dist/lang/ko-KR.umd.prod.js +1 -1
- package/dist/lang/kur-CKB.umd.prod.js +1 -1
- package/dist/lang/lt.umd.prod.js +1 -1
- package/dist/lang/lu.umd.prod.js +1 -1
- package/dist/lang/lv.umd.prod.js +1 -1
- package/dist/lang/ml.umd.prod.js +1 -1
- package/dist/lang/ms.umd.prod.js +1 -1
- package/dist/lang/my.umd.prod.js +1 -1
- package/dist/lang/nb-NO.umd.prod.js +1 -1
- package/dist/lang/nl.umd.prod.js +1 -1
- package/dist/lang/pl.umd.prod.js +1 -1
- package/dist/lang/pt-BR.umd.prod.js +1 -1
- package/dist/lang/pt.umd.prod.js +1 -1
- package/dist/lang/ro.umd.prod.js +1 -1
- package/dist/lang/ru.umd.prod.js +1 -1
- package/dist/lang/sk.umd.prod.js +1 -1
- package/dist/lang/sl.umd.prod.js +1 -1
- package/dist/lang/sr-CYR.umd.prod.js +1 -1
- package/dist/lang/sr.umd.prod.js +1 -1
- package/dist/lang/sv.umd.prod.js +1 -1
- package/dist/lang/ta.umd.prod.js +1 -1
- package/dist/lang/th.umd.prod.js +1 -1
- package/dist/lang/tr.umd.prod.js +1 -1
- package/dist/lang/ug.umd.prod.js +1 -1
- package/dist/lang/uk.umd.prod.js +1 -1
- package/dist/lang/vi.umd.prod.js +1 -1
- package/dist/lang/zh-CN.umd.prod.js +1 -1
- package/dist/lang/zh-TW.umd.prod.js +1 -1
- package/dist/quasar.cjs.prod.js +2 -2
- package/dist/quasar.css +38 -10
- package/dist/quasar.esm.prod.js +2 -2
- package/dist/quasar.prod.css +1 -1
- package/dist/quasar.rtl.css +55 -23
- package/dist/quasar.rtl.prod.css +1 -1
- package/dist/quasar.sass +31 -11
- package/dist/quasar.umd.js +307 -158
- package/dist/quasar.umd.prod.js +2 -2
- package/dist/ssr-directives/Morph.js +1 -1
- package/dist/transforms/auto-import.json +39 -3
- package/dist/transforms/import-map.json +18 -0
- package/dist/types/index.d.ts +35 -13
- package/dist/types/utils/date.d.ts +25 -13
- package/dist/vetur/quasar-attributes.json +32 -12
- package/dist/vetur/quasar-tags.json +8 -3
- package/dist/web-types/web-types.json +73 -28
- package/package.json +13 -3
- package/src/components/avatar/__tests__/QAvatar.spec.js +121 -0
- package/src/components/badge/__tests__/QBadge.spec.js +74 -0
- package/src/components/breadcrumbs/QBreadcrumbs.js +1 -1
- package/src/components/btn/__tests__/QBtn.spec.js +55 -0
- package/src/components/btn/__tests__/use-btn.spec.js +189 -0
- package/src/components/checkbox/QCheckbox.js +34 -3
- package/src/components/checkbox/QCheckbox.json +17 -0
- package/src/components/checkbox/QCheckbox.sass +17 -5
- package/src/components/checkbox/use-checkbox.js +4 -0
- package/src/components/checkbox/use-checkbox.json +18 -0
- package/src/components/chip/__tests__/QChip.spec.js +155 -0
- package/src/components/date/__tests__/QDate.spec.js +189 -0
- package/src/components/date/__tests__/use-datetime.spec.js +83 -0
- package/src/components/dialog/__tests__/QDialog.spec.js +129 -0
- package/src/components/editor/__tests__/QEditor.spec.js +195 -0
- package/src/components/field/QField.sass +2 -0
- package/src/components/form/QForm.js +26 -24
- package/src/components/input/QInput.js +9 -0
- package/src/components/input/__tests__/QInput.spec.js +105 -0
- package/src/components/input/__tests__/use-mask.spec.js +29 -0
- package/src/components/menu/__tests__/QMenu.spec.js +610 -0
- package/src/components/menu/__tests__/WrapperOne.vue +51 -0
- package/src/components/menu/__tests__/WrapperTwo.vue +38 -0
- package/src/components/radio/QRadio.js +26 -1
- package/src/components/radio/QRadio.json +16 -0
- package/src/components/radio/QRadio.sass +17 -6
- package/src/components/select/QSelect.js +1 -1
- package/src/components/select/__tests__/QSelect.spec.js +2003 -0
- package/src/components/select/__tests__/WrapperOne.vue +28 -0
- package/src/components/table/__tests__/QTable.spec.js +635 -0
- package/src/components/table/__tests__/QTd.spec.js +35 -0
- package/src/components/table/__tests__/QTh.spec.js +27 -0
- package/src/components/table/__tests__/QTr.spec.js +27 -0
- package/src/components/tabs/__tests__/QRouteTab.spec.js +9 -0
- package/src/components/tabs/__tests__/QTab.spec.js +79 -0
- package/src/components/tabs/__tests__/QTabs.spec.js +147 -0
- package/src/components/time/QTime.json +2 -2
- package/src/components/toggle/QToggle.js +5 -13
- package/src/components/toggle/QToggle.json +3 -12
- package/src/components/tree/QTree.js +39 -41
- package/src/components/uploader/__tests__/QUploader.spec.js +161 -0
- package/src/composables/private/__tests__/FieldWrapper.vue +39 -0
- package/src/composables/private/__tests__/use-anchor.spec.js +99 -0
- package/src/composables/private/__tests__/use-field.spec.js +351 -0
- package/src/composables/private/__tests__/use-file.spec.js +69 -0
- package/src/composables/private/__tests__/use-form.spec.js +11 -0
- package/src/composables/private/__tests__/use-fullscreen.spec.js +37 -0
- package/src/composables/private/__tests__/use-model-toggle.spec.js +306 -0
- package/src/composables/private/__tests__/use-portal.spec.js +4 -0
- package/src/composables/private/__tests__/use-router-link.spec.js +55 -0
- package/src/composables/private/__tests__/use-size.spec.js +37 -0
- package/src/composables/private/__tests__/use-transition.spec.js +108 -0
- package/src/composables/private/__tests__/use-validate.spec.js +111 -0
- package/src/composables/private/use-fullscreen.js +1 -1
- package/src/composables/private/use-model-toggle.js +1 -1
- package/src/composables/private/use-validate.js +22 -22
- package/src/plugins/Meta.js +1 -1
- package/src/plugins/Screen.js +16 -9
- package/src/utils/date.js +111 -32
- package/src/utils/private/vm.js +14 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quasar",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"description": "Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time",
|
|
5
5
|
"main": "dist/quasar.cjs.prod.js",
|
|
6
6
|
"module": "dist/quasar.esm.prod.js",
|
|
@@ -27,7 +27,10 @@
|
|
|
27
27
|
"build": "node build/script.build.js",
|
|
28
28
|
"test": "yarn lint && yarn build",
|
|
29
29
|
"lint": "eslint --ext .js,.vue src dev",
|
|
30
|
-
"lint-fix": "eslint --ext .js,.vue src dev --fix"
|
|
30
|
+
"lint-fix": "eslint --ext .js,.vue src dev --fix",
|
|
31
|
+
"test:unit": "cd ./dev && cypress open-ct && cd ..",
|
|
32
|
+
"test:unit:ci": "cd ./dev && cypress run-ct && cd ..",
|
|
33
|
+
"test:create": "node ./test/cypress/helpers/create-spec.js -c"
|
|
31
34
|
},
|
|
32
35
|
"repository": {
|
|
33
36
|
"type": "git",
|
|
@@ -64,6 +67,7 @@
|
|
|
64
67
|
"@babel/eslint-parser": "^7.13.14",
|
|
65
68
|
"@quasar/app": "^3.0.0",
|
|
66
69
|
"@quasar/extras": "^1.12.0",
|
|
70
|
+
"@quasar/quasar-app-extension-testing-e2e-cypress": "^4.0.1",
|
|
67
71
|
"@rollup/plugin-node-resolve": "^11.2.1",
|
|
68
72
|
"@rollup/plugin-replace": "^2.3.3",
|
|
69
73
|
"babel-preset-es2015-rollup": "^3.0.0",
|
|
@@ -72,7 +76,9 @@
|
|
|
72
76
|
"eslint": "^7.4.0",
|
|
73
77
|
"eslint-config-standard": "^16.0.2",
|
|
74
78
|
"eslint-friendly-formatter": "^4.0.1",
|
|
79
|
+
"eslint-plugin-cypress": "^2.12.1",
|
|
75
80
|
"eslint-plugin-import": "^2.18.2",
|
|
81
|
+
"eslint-plugin-no-only-tests": "^2.6.0",
|
|
76
82
|
"eslint-plugin-node": "^11.1.0",
|
|
77
83
|
"eslint-plugin-promise": "^4.2.1",
|
|
78
84
|
"eslint-plugin-vue": "^7.0.0",
|
|
@@ -81,13 +87,17 @@
|
|
|
81
87
|
"json-beautify": "^1.1.1",
|
|
82
88
|
"module-alias": "^2.2.2",
|
|
83
89
|
"prettier": "^2.4.1",
|
|
90
|
+
"quasar": "^2.1.9",
|
|
84
91
|
"recast": "^0.18.5",
|
|
85
92
|
"rimraf": "^3.0.1",
|
|
86
93
|
"rollup": "^2.34.0",
|
|
87
94
|
"rollup-plugin-typescript2": "^0.29.0",
|
|
88
95
|
"table": "^6.0.4",
|
|
89
96
|
"tslib": "^2.0.3",
|
|
90
|
-
"uglify-es": "^3.3.9"
|
|
97
|
+
"uglify-es": "^3.3.9",
|
|
98
|
+
"vue": "^3.0.0",
|
|
99
|
+
"vue-router": "^4.0.0",
|
|
100
|
+
"yargs": "^17.3.0"
|
|
91
101
|
},
|
|
92
102
|
"vetur": {
|
|
93
103
|
"tags": "dist/vetur/quasar-tags.json",
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { mount } from '@cypress/vue'
|
|
2
|
+
import QAvatar from '../QAvatar'
|
|
3
|
+
|
|
4
|
+
describe('Avatar API', () => {
|
|
5
|
+
describe('Props', () => {
|
|
6
|
+
describe('Category: content', () => {
|
|
7
|
+
describe('(prop): icon', () => {
|
|
8
|
+
it('should render an icon', () => {
|
|
9
|
+
const icon = 'bug_report'
|
|
10
|
+
mount(QAvatar, {
|
|
11
|
+
props: {
|
|
12
|
+
icon,
|
|
13
|
+
color: 'grey'
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
cy.get('.q-avatar')
|
|
18
|
+
.get('.q-icon')
|
|
19
|
+
.should('have.text', `${ icon }`)
|
|
20
|
+
})
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
describe('Category: style', () => {
|
|
25
|
+
describe('(prop): font-size', () => {
|
|
26
|
+
it('should set the font-size', () => {
|
|
27
|
+
const size = '40px'
|
|
28
|
+
// Doing em/rem units here does not work
|
|
29
|
+
// Cypress looks at actual computed values in the browser
|
|
30
|
+
const fontSize = '32px'
|
|
31
|
+
mount(QAvatar, {
|
|
32
|
+
props: {
|
|
33
|
+
size,
|
|
34
|
+
fontSize,
|
|
35
|
+
color: 'grey'
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
cy.get('.q-avatar')
|
|
40
|
+
.should('have.css', 'font-size', size)
|
|
41
|
+
.get('.q-avatar__content')
|
|
42
|
+
.should('have.css', 'font-size', fontSize)
|
|
43
|
+
})
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
describe('(prop): color', () => {
|
|
47
|
+
it('should set a background color', () => {
|
|
48
|
+
const color = 'red'
|
|
49
|
+
mount(QAvatar, {
|
|
50
|
+
props: {
|
|
51
|
+
color
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
cy.get('.q-avatar')
|
|
56
|
+
.should('have.class', `bg-${ color }`)
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
describe('(prop): text-color', () => {
|
|
61
|
+
it('should set a text color', () => {
|
|
62
|
+
const textColor = 'red'
|
|
63
|
+
mount(QAvatar, {
|
|
64
|
+
props: {
|
|
65
|
+
textColor
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
cy.get('.q-avatar')
|
|
70
|
+
.should('have.class', `text-${ textColor }`)
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
|
|
74
|
+
describe('(prop): square', () => {
|
|
75
|
+
it('should create a square avatar', () => {
|
|
76
|
+
mount(QAvatar, {
|
|
77
|
+
props: {
|
|
78
|
+
square: true,
|
|
79
|
+
color: 'grey'
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
cy.get('.q-avatar')
|
|
84
|
+
.should('have.class', 'q-avatar--square')
|
|
85
|
+
.should('have.css', 'border-radius', '0px')
|
|
86
|
+
})
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
describe('(prop): rounded', () => {
|
|
90
|
+
it('should create a rounded avatar', () => {
|
|
91
|
+
mount(QAvatar, {
|
|
92
|
+
props: {
|
|
93
|
+
rounded: true,
|
|
94
|
+
color: 'grey'
|
|
95
|
+
}
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
cy.get('.q-avatar')
|
|
99
|
+
.should('have.class', 'rounded-borders')
|
|
100
|
+
})
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
describe('Slots', () => {
|
|
106
|
+
describe('(slot): default', () => {
|
|
107
|
+
it('render the text in the default slot', () => {
|
|
108
|
+
const text = 'QQ'
|
|
109
|
+
mount(QAvatar, {
|
|
110
|
+
slots: {
|
|
111
|
+
// Using only a string here results in an error, this is a workaround
|
|
112
|
+
default: () => text
|
|
113
|
+
}
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
cy.get('.q-avatar')
|
|
117
|
+
.should('have.text', text)
|
|
118
|
+
})
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
})
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// import { mount } from '@cypress/vue'
|
|
2
|
+
// import QBadge from '../QBadge'
|
|
3
|
+
|
|
4
|
+
// const snapshotOptions = { customSnapshotsDir: '../src/components/badge/__tests__' }
|
|
5
|
+
|
|
6
|
+
describe('Badge API', () => {
|
|
7
|
+
describe('Props', () => {
|
|
8
|
+
describe('Category: content', () => {
|
|
9
|
+
describe('(prop): floating', () => {
|
|
10
|
+
it.skip(' ', () => {
|
|
11
|
+
//
|
|
12
|
+
})
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
describe('(prop): multi-line', () => {
|
|
16
|
+
it.skip(' ', () => {
|
|
17
|
+
//
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
describe('(prop): label', () => {
|
|
22
|
+
it.skip(' ', () => {
|
|
23
|
+
//
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
describe('(prop): align', () => {
|
|
28
|
+
it.skip(' ', () => {
|
|
29
|
+
//
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
describe('Category: style', () => {
|
|
35
|
+
describe('(prop): color', () => {
|
|
36
|
+
it.skip(' ', () => {
|
|
37
|
+
//
|
|
38
|
+
})
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
describe('(prop): text-color', () => {
|
|
42
|
+
it.skip(' ', () => {
|
|
43
|
+
//
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
describe('(prop): transparent', () => {
|
|
48
|
+
it.skip(' ', () => {
|
|
49
|
+
//
|
|
50
|
+
})
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
describe('(prop): outline', () => {
|
|
54
|
+
it.skip(' ', () => {
|
|
55
|
+
//
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
describe('(prop): rounded', () => {
|
|
60
|
+
it.skip(' ', () => {
|
|
61
|
+
//
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
describe('Slots', () => {
|
|
68
|
+
describe('(slot): default', () => {
|
|
69
|
+
it.skip(' ', () => {
|
|
70
|
+
//
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
})
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
describe('Btn API', () => {
|
|
2
|
+
describe('Props', () => {
|
|
3
|
+
describe('Category: behavior', () => {
|
|
4
|
+
describe('(prop): percentage', () => {
|
|
5
|
+
it.skip(' ', () => {
|
|
6
|
+
//
|
|
7
|
+
})
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
describe('(prop): dark-percentage', () => {
|
|
11
|
+
it.skip(' ', () => {
|
|
12
|
+
//
|
|
13
|
+
})
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
describe('Category: style', () => {
|
|
18
|
+
describe('(prop): round', () => {
|
|
19
|
+
it.skip(' ', () => {
|
|
20
|
+
//
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
describe('Slots', () => {
|
|
27
|
+
describe('(slot): default', () => {
|
|
28
|
+
it.skip(' ', () => {
|
|
29
|
+
//
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
|
|
33
|
+
describe('(slot): loading', () => {
|
|
34
|
+
it.skip(' ', () => {
|
|
35
|
+
//
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
describe('Events', () => {
|
|
41
|
+
describe('(event): click', () => {
|
|
42
|
+
it.skip(' ', () => {
|
|
43
|
+
//
|
|
44
|
+
})
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
describe('Methods', () => {
|
|
49
|
+
describe('(method): click', () => {
|
|
50
|
+
it.skip(' ', () => {
|
|
51
|
+
//
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
})
|
|
55
|
+
})
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
describe('use-btn API', () => {
|
|
2
|
+
describe('Props', () => {
|
|
3
|
+
describe('Category: behavior|state', () => {
|
|
4
|
+
describe('(prop): loading', () => {
|
|
5
|
+
it.skip(' ', () => {
|
|
6
|
+
//
|
|
7
|
+
})
|
|
8
|
+
})
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
describe('Category: content', () => {
|
|
12
|
+
describe('(prop): label', () => {
|
|
13
|
+
it.skip(' ', () => {
|
|
14
|
+
//
|
|
15
|
+
})
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
describe('(prop): icon', () => {
|
|
19
|
+
it.skip(' ', () => {
|
|
20
|
+
//
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
describe('(prop): icon-right', () => {
|
|
25
|
+
it.skip(' ', () => {
|
|
26
|
+
//
|
|
27
|
+
})
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
describe('(prop): no-caps', () => {
|
|
31
|
+
it.skip(' ', () => {
|
|
32
|
+
//
|
|
33
|
+
})
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
describe('(prop): no-wrap', () => {
|
|
37
|
+
it.skip(' ', () => {
|
|
38
|
+
//
|
|
39
|
+
})
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
describe('(prop): align', () => {
|
|
43
|
+
it.skip(' ', () => {
|
|
44
|
+
//
|
|
45
|
+
})
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
describe('(prop): stack', () => {
|
|
49
|
+
it.skip(' ', () => {
|
|
50
|
+
//
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
describe('(prop): stretch', () => {
|
|
55
|
+
it.skip(' ', () => {
|
|
56
|
+
//
|
|
57
|
+
})
|
|
58
|
+
})
|
|
59
|
+
})
|
|
60
|
+
|
|
61
|
+
describe('Category: general', () => {
|
|
62
|
+
describe('(prop): type', () => {
|
|
63
|
+
it.skip(' ', () => {
|
|
64
|
+
//
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
describe('(prop): tabindex', () => {
|
|
69
|
+
it.skip(' ', () => {
|
|
70
|
+
//
|
|
71
|
+
})
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
|
|
75
|
+
describe('Category: navigation', () => {
|
|
76
|
+
describe('(prop): to', () => {
|
|
77
|
+
it.skip(' ', () => {
|
|
78
|
+
//
|
|
79
|
+
})
|
|
80
|
+
})
|
|
81
|
+
|
|
82
|
+
describe('(prop): replace', () => {
|
|
83
|
+
it.skip(' ', () => {
|
|
84
|
+
//
|
|
85
|
+
})
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
describe('(prop): href', () => {
|
|
89
|
+
it.skip(' ', () => {
|
|
90
|
+
//
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
|
|
94
|
+
describe('(prop): target', () => {
|
|
95
|
+
it.skip(' ', () => {
|
|
96
|
+
//
|
|
97
|
+
})
|
|
98
|
+
})
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
describe('Category: state', () => {
|
|
102
|
+
describe('(prop): disable', () => {
|
|
103
|
+
it.skip(' ', () => {
|
|
104
|
+
//
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
})
|
|
108
|
+
|
|
109
|
+
describe('Category: style', () => {
|
|
110
|
+
describe('(prop): outline', () => {
|
|
111
|
+
it.skip(' ', () => {
|
|
112
|
+
//
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
describe('(prop): flat', () => {
|
|
117
|
+
it.skip(' ', () => {
|
|
118
|
+
//
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
describe('(prop): unelevated', () => {
|
|
123
|
+
it.skip(' ', () => {
|
|
124
|
+
//
|
|
125
|
+
})
|
|
126
|
+
})
|
|
127
|
+
|
|
128
|
+
describe('(prop): rounded', () => {
|
|
129
|
+
it.skip(' ', () => {
|
|
130
|
+
//
|
|
131
|
+
})
|
|
132
|
+
})
|
|
133
|
+
|
|
134
|
+
describe('(prop): push', () => {
|
|
135
|
+
it.skip(' ', () => {
|
|
136
|
+
//
|
|
137
|
+
})
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
describe('(prop): glossy', () => {
|
|
141
|
+
it.skip(' ', () => {
|
|
142
|
+
//
|
|
143
|
+
})
|
|
144
|
+
})
|
|
145
|
+
|
|
146
|
+
describe('(prop): fab', () => {
|
|
147
|
+
it.skip(' ', () => {
|
|
148
|
+
//
|
|
149
|
+
})
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
describe('(prop): fab-mini', () => {
|
|
153
|
+
it.skip(' ', () => {
|
|
154
|
+
//
|
|
155
|
+
})
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
describe('(prop): padding', () => {
|
|
159
|
+
it.skip(' ', () => {
|
|
160
|
+
//
|
|
161
|
+
})
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
describe('(prop): color', () => {
|
|
165
|
+
it.skip(' ', () => {
|
|
166
|
+
//
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
describe('(prop): text-color', () => {
|
|
171
|
+
it.skip(' ', () => {
|
|
172
|
+
//
|
|
173
|
+
})
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
describe('(prop): dense', () => {
|
|
177
|
+
it.skip(' ', () => {
|
|
178
|
+
//
|
|
179
|
+
})
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
describe('(prop): ripple', () => {
|
|
183
|
+
it.skip(' ', () => {
|
|
184
|
+
//
|
|
185
|
+
})
|
|
186
|
+
})
|
|
187
|
+
})
|
|
188
|
+
})
|
|
189
|
+
})
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { h } from 'vue'
|
|
1
|
+
import { h, computed } from 'vue'
|
|
2
|
+
|
|
3
|
+
import QIcon from '../icon/QIcon.js'
|
|
2
4
|
|
|
3
5
|
import { createComponent } from '../../utils/private/create.js'
|
|
4
6
|
import useCheckbox, { useCheckboxProps, useCheckboxEmits } from './use-checkbox.js'
|
|
5
7
|
|
|
6
8
|
const bgNode = h('div', {
|
|
9
|
+
key: 'svg',
|
|
7
10
|
class: 'q-checkbox__bg absolute'
|
|
8
11
|
}, [
|
|
9
12
|
h('svg', {
|
|
@@ -30,7 +33,35 @@ export default createComponent({
|
|
|
30
33
|
props: useCheckboxProps,
|
|
31
34
|
emits: useCheckboxEmits,
|
|
32
35
|
|
|
33
|
-
setup () {
|
|
34
|
-
|
|
36
|
+
setup (props) {
|
|
37
|
+
function getInner (isTrue, isIndeterminate) {
|
|
38
|
+
const icon = computed(() =>
|
|
39
|
+
(isTrue.value === true
|
|
40
|
+
? props.checkedIcon
|
|
41
|
+
: (isIndeterminate.value === true
|
|
42
|
+
? props.indeterminateIcon
|
|
43
|
+
: props.uncheckedIcon
|
|
44
|
+
)
|
|
45
|
+
) || null
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
return () => (
|
|
49
|
+
icon.value !== null
|
|
50
|
+
? [
|
|
51
|
+
h('div', {
|
|
52
|
+
key: 'icon',
|
|
53
|
+
class: 'q-checkbox__icon-container absolute flex flex-center no-wrap'
|
|
54
|
+
}, [
|
|
55
|
+
h(QIcon, {
|
|
56
|
+
class: 'q-checkbox__icon',
|
|
57
|
+
name: icon.value
|
|
58
|
+
})
|
|
59
|
+
])
|
|
60
|
+
]
|
|
61
|
+
: [ bgNode ]
|
|
62
|
+
)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return useCheckbox('checkbox', getInner)
|
|
35
66
|
}
|
|
36
67
|
})
|
|
@@ -3,5 +3,22 @@
|
|
|
3
3
|
|
|
4
4
|
"meta": {
|
|
5
5
|
"docsUrl": "https://v2.quasar.dev/vue-components/checkbox"
|
|
6
|
+
},
|
|
7
|
+
|
|
8
|
+
"props": {
|
|
9
|
+
"checked-icon": {
|
|
10
|
+
"desc": "The icon to be used when the model is truthy (instead of the default design)",
|
|
11
|
+
"addedIn": "v2.5"
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
"unchecked-icon": {
|
|
15
|
+
"desc": "The icon to be used when the toggle is falsy (instead of the default design)",
|
|
16
|
+
"addedIn": "v2.5"
|
|
17
|
+
},
|
|
18
|
+
|
|
19
|
+
"indeterminate-icon": {
|
|
20
|
+
"desc": "The icon to be used when the model is indeterminate (instead of the default design)",
|
|
21
|
+
"addedIn": "v2.5"
|
|
22
|
+
}
|
|
6
23
|
}
|
|
7
24
|
}
|
|
@@ -3,19 +3,27 @@ $checkbox-transition: .22s cubic-bezier(0,0,.2,1) 0ms
|
|
|
3
3
|
.q-checkbox
|
|
4
4
|
vertical-align: middle
|
|
5
5
|
|
|
6
|
-
&
|
|
6
|
+
&__native
|
|
7
|
+
width: 1px
|
|
8
|
+
height: 1px
|
|
9
|
+
|
|
10
|
+
&__bg,
|
|
11
|
+
&__icon-container
|
|
7
12
|
top: 25%
|
|
8
13
|
left: 25%
|
|
9
14
|
width: 50%
|
|
10
15
|
height: 50%
|
|
16
|
+
user-select: none
|
|
17
|
+
|
|
18
|
+
&__bg
|
|
11
19
|
border: 2px solid currentColor
|
|
12
20
|
border-radius: 2px
|
|
13
21
|
transition: background $checkbox-transition
|
|
14
22
|
-webkit-print-color-adjust: exact
|
|
15
23
|
|
|
16
|
-
&
|
|
17
|
-
|
|
18
|
-
|
|
24
|
+
&__icon
|
|
25
|
+
color: currentColor
|
|
26
|
+
font-size: .6em
|
|
19
27
|
|
|
20
28
|
&__svg
|
|
21
29
|
color: #fff
|
|
@@ -68,12 +76,16 @@ $checkbox-transition: .22s cubic-bezier(0,0,.2,1) 0ms
|
|
|
68
76
|
|
|
69
77
|
&--dense
|
|
70
78
|
|
|
79
|
+
.q-checkbox__icon
|
|
80
|
+
font-size: .6em
|
|
81
|
+
|
|
71
82
|
.q-checkbox__inner
|
|
72
83
|
width: .5em
|
|
73
84
|
min-width: .5em
|
|
74
85
|
height: .5em
|
|
75
86
|
|
|
76
|
-
.q-checkbox__bg
|
|
87
|
+
.q-checkbox__bg,
|
|
88
|
+
.q-checkbox__icon-container
|
|
77
89
|
left: 5%
|
|
78
90
|
top: 5%
|
|
79
91
|
width: 90%
|
|
@@ -24,6 +24,10 @@ export const useCheckboxProps = {
|
|
|
24
24
|
falseValue: { default: false },
|
|
25
25
|
indeterminateValue: { default: null },
|
|
26
26
|
|
|
27
|
+
checkedIcon: String,
|
|
28
|
+
uncheckedIcon: String,
|
|
29
|
+
indeterminateIcon: String,
|
|
30
|
+
|
|
27
31
|
toggleOrder: {
|
|
28
32
|
type: String,
|
|
29
33
|
validator: v => v === 'tf' || v === 'ft'
|
|
@@ -66,6 +66,24 @@
|
|
|
66
66
|
"category": "label"
|
|
67
67
|
},
|
|
68
68
|
|
|
69
|
+
"checked-icon": {
|
|
70
|
+
"type": "String",
|
|
71
|
+
"examples": [ "visibility" ],
|
|
72
|
+
"category": "icons"
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
"unchecked-icon": {
|
|
76
|
+
"type": "String",
|
|
77
|
+
"examples": [ "visibility_off" ],
|
|
78
|
+
"category": "icons"
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
"indeterminate-icon": {
|
|
82
|
+
"type": "String",
|
|
83
|
+
"examples": [ "help" ],
|
|
84
|
+
"category": "icons"
|
|
85
|
+
},
|
|
86
|
+
|
|
69
87
|
"color": {
|
|
70
88
|
"extends": "color"
|
|
71
89
|
},
|