Skip to content

Commit ff73eb5

Browse files
authored
feat(QIcon/lang): backport from Qv2 - QIcon implementation and Quasar lang (quasarframework#11586)
* chore: fix linting errors * chore: update some dependencies * chore: test IE, RTL and dark auto in dev * feat(lang): sync lang with improvements in Q2 * feat(QIcon): sync with Q2 implementation (and fix SVG detection) * fix(Loading/LoadingBar,Notify): hide top app and prevent error related to vue-router in Vue Devtools beta * Revert "chore: update some dependencies" This reverts commit a6bacd9. * Revert "feat(lang): sync lang with improvements in Q2" This reverts commit c9d6f77. * feat(lang): sync lang with improvements in Q2
1 parent 44b4943 commit ff73eb5

31 files changed

+567
-187
lines changed

ui/.eslintrc.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,32 @@ module.exports = {
1919
'vue'
2020
],
2121
globals: {
22-
'cordova': true,
23-
'__THEME__': true,
24-
'__statics': true
22+
cordova: true,
23+
__THEME__: true,
24+
__statics: true
2525
},
2626
// add your custom rules here
27-
'rules': {
28-
'brace-style': [2, 'stroustrup', { 'allowSingleLine': true }],
27+
rules: {
28+
'brace-style': [ 2, 'stroustrup', { allowSingleLine: true } ],
2929
'prefer-const': 2,
30+
'no-undefined': 2,
31+
'no-void': 0,
3032

31-
'vue/max-attributes-per-line': 'off',
32-
'vue/valid-v-for': 'off',
33-
'vue/require-default-prop': 'off',
34-
'vue/require-prop-types': 'off',
35-
'vue/require-v-for-key': 'off',
36-
'vue/return-in-computed-property': 'off',
37-
'vue/require-render-return': 'off',
38-
'vue/singleline-html-element-content-newline': 'off',
39-
'vue/no-side-effects-in-computed-properties': 'off',
40-
'vue/array-bracket-spacing': 'off',
41-
'vue/object-curly-spacing': 'off',
42-
'vue/script-indent': 'off',
33+
'vue/max-attributes-per-line': 0,
34+
'vue/valid-v-for': 0,
35+
'vue/require-default-prop': 0,
36+
'vue/require-prop-types': 0,
37+
'vue/require-v-for-key': 0,
38+
'vue/return-in-computed-property': 0,
39+
'vue/require-render-return': 0,
40+
'vue/singleline-html-element-content-newline': 0,
41+
'vue/no-side-effects-in-computed-properties': 0,
42+
'vue/array-bracket-spacing': 0,
43+
'vue/object-curly-spacing': 0,
44+
'vue/script-indent': 0,
4345

4446
// allow async-await
45-
'generator-star-spacing': 'off',
47+
'generator-star-spacing': 0,
4648

4749
// allow paren-less arrow functions
4850
'arrow-parens': 0,

ui/build/build.api.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function parseObject ({ banner, api, itemName, masterType, verifyCategory }) {
217217

218218
const def = objectTypes[type]
219219

220-
for (let prop in obj) {
220+
for (const prop in obj) {
221221
if ([ 'type', '__exemption' ].includes(prop)) {
222222
continue
223223
}
@@ -298,7 +298,7 @@ function parseObject ({ banner, api, itemName, masterType, verifyCategory }) {
298298
;[ 'params', 'definition', 'scope', 'props' ].forEach(prop => {
299299
if (!obj[prop]) { return }
300300

301-
for (let item in obj[prop]) {
301+
for (const item in obj[prop]) {
302302
parseObject({
303303
banner: `${banner}/"${prop}"/"${item}"`,
304304
api: api[itemName][prop],
@@ -375,7 +375,7 @@ function parseAPI (file, apiType) {
375375
}
376376

377377
// "props", "slots", ...
378-
for (let type in api) {
378+
for (const type in api) {
379379
if (!topSections[apiType].includes(type)) {
380380
logError(`${banner} "${type}" is not recognized for a ${apiType}`)
381381
process.exit(1)
@@ -428,7 +428,7 @@ function parseAPI (file, apiType) {
428428

429429
const isComponent = banner.indexOf('component') > -1
430430

431-
for (let itemName in api[type]) {
431+
for (const itemName in api[type]) {
432432
parseObject({
433433
banner: `${banner} "${type}"/"${itemName}"`,
434434
api: api[type],

ui/build/build.types.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function convertTypeVal (type, def, required) {
6868
if (fallbackComplexTypeMap.has(t)) {
6969
if (def.definition) {
7070
const propDefinitions = getPropDefinitions(def.definition, required, true)
71-
let lines = []
71+
const lines = []
7272
propDefinitions.forEach(p => lines.push(...p.split('\n')))
7373
return propDefinitions && propDefinitions.length > 0 ? `{\n ${lines.join('\n ')} }${t === 'Array' ? '[]' : ''}` : fallbackComplexTypeMap.get(t)
7474
}
@@ -143,7 +143,7 @@ function getMethodDefinition (key, methodDef, required) {
143143
}
144144

145145
function getObjectParamDefinition (def, required) {
146-
let res = []
146+
const res = []
147147

148148
Object.keys(def).forEach(propName => {
149149
const propDef = def[propName]
@@ -365,10 +365,10 @@ function writeIndexDTS (apis) {
365365
for (const key in injections) {
366366
const injectionDefs = injections[key]
367367
if (injectionDefs) {
368-
const injectionName = `${ key.toUpperCase().replace('$', '') }VueGlobals`
369-
writeLine(contents, `import { ${ injectionName }, QSingletonGlobals } from "./globals";`)
368+
const injectionName = `${key.toUpperCase().replace('$', '')}VueGlobals`
369+
writeLine(contents, `import { ${injectionName}, QSingletonGlobals } from "./globals";`)
370370
writeLine(contents, `declare module "./globals" {`)
371-
writeLine(contents, `export interface ${ injectionName } {`)
371+
writeLine(contents, `export interface ${injectionName} {`)
372372
for (const defKey in injectionDefs) {
373373
writeLines(contents, injectionDefs[defKey], 1)
374374
}

ui/build/build.web-types.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module.exports.generate = function (data) {
3737
html: {
3838
'types-syntax': 'typescript',
3939
tags: data.components.map(({ api: { events, props, scopedSlots, slots, meta }, name }) => {
40-
let slotTypes = []
40+
const slotTypes = []
4141
if (slots) {
4242
Object.entries(slots).forEach(([name, slotApi]) => {
4343
slotTypes.push({
@@ -71,7 +71,7 @@ module.exports.generate = function (data) {
7171
symbol: name
7272
},
7373
attributes: props && Object.entries(props).map(([name, propApi]) => {
74-
let result = {
74+
const result = {
7575
name,
7676
value: {
7777
kind: 'expression',
@@ -122,8 +122,8 @@ module.exports.generate = function (data) {
122122
return result
123123
}),
124124
attributes: data.directives.map(({ name, api: { modifiers, value, meta } }) => {
125-
let valueType = value.type
126-
let result = {
125+
const valueType = value.type
126+
const result = {
127127
name: 'v-' + kebabCase(name),
128128
source: {
129129
module: 'quasar',
@@ -151,7 +151,7 @@ module.exports.generate = function (data) {
151151
}
152152
}
153153
}, null, 2)
154-
let webTypesPath = path.resolve(__dirname, '../dist/web-types')
154+
const webTypesPath = path.resolve(__dirname, '../dist/web-types')
155155

156156
if (!fs.existsSync(webTypesPath)) {
157157
fs.mkdirSync(webTypesPath)

ui/dev/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"last 3 ChromeAndroid versions",
1818
"last 3 FirefoxAndroid versions",
1919
"last 2 iOS versions",
20-
"last 2 Opera versions"
20+
"last 2 Opera versions",
21+
"ie 11"
2122
],
2223
"engines": {
2324
"node": ">= 10.18.1",

ui/dev/quasar.conf.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@ module.exports = function (ctx) {
2626
framework: {
2727
// iconSet: 'svg-mdi-v4',
2828
// config: { ripple: { early: true } },
29+
config: {
30+
dark: 'auto'
31+
},
2932
importStrategy: 'all'
3033
},
3134

3235
build: {
33-
rtl: false,
36+
rtl: true,
3437
vueRouterMode: 'history',
3538
// showProgress: false,
3639

ui/dev/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
>
1111
<q-btn dense flat size="sm" icon="visibility" @click="showSelector = !showSelector" class="absolute-top-right z-top" />
1212
<template v-if="showSelector">
13-
<q-toggle :value="$q.dark.isActive" @input="$q.dark.toggle" :label="`Dark Mode (${$q.dark.mode})`" />
13+
<q-toggle :value="$q.dark.mode" @input="val => $q.dark.set(val)" toggle-indeterminate indeterminate-value="auto" :label="`Dark Mode (${$q.dark.mode})`" />
1414

1515
<q-btn dense flat size="sm" :icon="lang === 'he' ? 'navigate_before' : 'navigate_next'" @click="lang = lang === 'en-us' ? 'he' : 'en-us'" class="absolute-bottom-right z-top" />
1616
<q-select

0 commit comments

Comments
 (0)