hash,date,author,commit_message,is_merge,masked_commit_message,type,git_diff fc9486220d6c1a0ae426bd99d0693735ea2dd540,2020-02-08 08:22:21,Razvan Stoenescu,feat(Notify): small tweaks,False,small tweaks,feat,"diff --git a/ui/src/plugins/Notify.js b/ui/src/plugins/Notify.js index 4ce780eb753..771a8b8e22a 100644 --- a/ui/src/plugins/Notify.js +++ b/ui/src/plugins/Notify.js @@ -155,9 +155,6 @@ const Notifications = { } // ok, so it's NOT a new one else { - // do NOT override position - notif.position = groupNotif.position - // reset timeout if any if (groupNotif.__timeout !== void 0) { clearTimeout(groupNotif.__timeout) diff --git a/ui/src/plugins/Notify.json b/ui/src/plugins/Notify.json index b3a172e72ca..ef0c1fb929f 100644 --- a/ui/src/plugins/Notify.json +++ b/ui/src/plugins/Notify.json @@ -63,7 +63,7 @@ ""group"": { ""type"": [ ""String"", ""Number"" ], ""desc"": ""Inform this is part of a specific group, regardless of its options; When a new notification is triggered with same group name, it replaces the old one and shows a badge with how many times the notification was triggered"", - ""default"": ""(message + caption)"", + ""default"": ""(message + caption + position)"", ""examples"": [ ""my-group"" ], ""addedIn"": ""v1.9.0"" }, @@ -193,7 +193,7 @@ ""group"": { ""type"": [ ""String"", ""Number"" ], ""desc"": ""Inform this is part of a specific group, regardless of its options; When a new notification is triggered with same group name, it replaces the old one and shows a badge with how many times the notification was triggered"", - ""default"": ""(message + caption)"", + ""default"": ""(message + caption + position)"", ""examples"": [ ""my-group"" ], ""addedIn"": ""v1.9.0"" }," daf13523b3ba54b9c109945811366a65f1aafeb0,2024-05-08 16:58:13,Razvan Stoenescu,chore(app-webpack): Bump version,False,Bump version,chore,"diff --git a/app-webpack/package.json b/app-webpack/package.json index ebda7b53056..09745f13770 100644 --- a/app-webpack/package.json +++ b/app-webpack/package.json @@ -1,6 +1,6 @@ { ""name"": ""@quasar/app-webpack"", - ""version"": ""4.0.0-beta.14"", + ""version"": ""4.0.0-beta.15"", ""description"": ""Quasar Framework App CLI with Webpack"", ""bin"": { ""quasar"": ""./bin/quasar""" aff533d5e856efb44bbb86d228bef767b1de27cb,2022-12-16 20:41:33,Razvan Stoenescu,fix(vite-plugin): prevent duplicate imports in dev mode (useTreeshaking false) in specific scenarios,False,prevent duplicate imports in dev mode (useTreeshaking false) in specific scenarios,fix,"diff --git a/vite-plugin/example/src/App.vue b/vite-plugin/example/src/App.vue index e16cbdc26a0..9eb6830f36a 100755 --- a/vite-plugin/example/src/App.vue +++ b/vite-plugin/example/src/App.vue @@ -3,10 +3,23 @@ + diff --git a/docs/src/pages/newsletter.md b/docs/src/pages/newsletter.md deleted file mode 100644 index 37907fa964e..00000000000 --- a/docs/src/pages/newsletter.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -title: The Q-News -desc: Signup for the Quasar Newsletter. -heading: false -toc: false -components: - - newsletter/NewsletterSignup ---- - -

Do you want to become a Quasar Superstar?

- -## Profit from our experts - -* Expert tips and tricks to extend your Quasar expertise -* Frequent bite-sized nuggets of information direct to your inbox -* Plus a monthly newsletter packed with goodness - -" 957981595beccc86282d4726ea50d5f00dfe1251,2021-12-08 23:39:35,Yusuf Kandemir,feat(ts/use-validation): Greatly improve the 'rules' prop type (fix: #11043) (#11597),False,Greatly improve the 'rules' prop type (fix: #11043) (#11597),feat,"diff --git a/ui/build/build.api.js b/ui/build/build.api.js index dfbc2e5743b..473ced401e7 100644 --- a/ui/build/build.api.js +++ b/ui/build/build.api.js @@ -74,7 +74,7 @@ const objectTypes = { }, Array: { - props: [ 'tsInjectionPoint', 'desc', 'required', 'reactive', 'sync', 'link', 'values', 'default', 'definition', 'examples', 'category', 'addedIn', 'internal' ], + props: [ 'tsInjectionPoint', 'tsType', 'desc', 'required', 'reactive', 'sync', 'link', 'values', 'default', 'definition', 'examples', 'category', 'addedIn', 'internal' ], required: [ 'desc', 'examples' ], isBoolean: [ 'tsInjectionPoint', 'required', 'reactive', 'sync', 'internal' ], isObject: [ 'definition' ], diff --git a/ui/build/build.types.js b/ui/build/build.types.js index 346eb600214..1a440b950b6 100644 --- a/ui/build/build.types.js +++ b/ui/build/build.types.js @@ -48,7 +48,7 @@ const dontNarrowValues = [ function convertTypeVal (type, def) { if (def.tsType !== void 0) { - return def.tsType + return `${ def.tsType }${ def.type === 'Array' ? '[]' : '' }` } if (def.values && type === 'String') { diff --git a/ui/src/composables/private/use-validate.json b/ui/src/composables/private/use-validate.json index 13cd26df269..8b3e6e149ff 100644 --- a/ui/src/composables/private/use-validate.json +++ b/ui/src/composables/private/use-validate.json @@ -28,6 +28,7 @@ ""rules"": { ""type"": ""Array"", + ""tsType"": ""ValidationRule"", ""desc"": ""Array of Functions/Strings; If String, then it must be a name of one of the embedded validation rules"", ""examples"": [ "":rules=\""[ val => val.length <= 3 || 'Please use maximum 3 characters' ]\"""", diff --git a/ui/src/utils/patterns.js b/ui/src/utils/patterns.js index 7abba0b6c26..61741c13843 100644 --- a/ui/src/utils/patterns.js +++ b/ui/src/utils/patterns.js @@ -7,6 +7,7 @@ const rgb = /^rgb\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5])\)$/, rgba = /^rgba\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),(0|0\.[0-9]+[1-9]|0\.[1-9]+|1)\)$/ +// Keep in sync with ui/types/api/validation.d.ts export const testPattern = { date: v => /^-?[\d]+\/[0-1]\d\/[0-3]\d$/.test(v), time: v => /^([0-1]?\d|2[0-3]):[0-5]\d$/.test(v), diff --git a/ui/types/api.d.ts b/ui/types/api.d.ts index 1b27c4a5001..85133930dd2 100644 --- a/ui/types/api.d.ts +++ b/ui/types/api.d.ts @@ -1,2 +1,3 @@ export * from ""./api/cookies""; export * from ""./api/web-storage""; +export * from ""./api/validation""; diff --git a/ui/types/api/validation.d.ts b/ui/types/api/validation.d.ts new file mode 100644 index 00000000000..b2daeb3adbe --- /dev/null +++ b/ui/types/api/validation.d.ts @@ -0,0 +1,4 @@ +// Keep in sync with ui/src/utils/patterns.js +export type EmbeddedValidationRule = ""date"" | ""time"" | ""fulltime"" | ""timeOrFulltime"" | ""hexColor"" | ""hexaColor"" | ""hexOrHexaColor"" | ""rgbColor"" | ""rgbaColor"" | ""rgbOrRgbaColor"" | ""hexOrRgbColor"" | ""hexaOrRgbaColor"" | ""anyColor""; + +export type ValidationRule = EmbeddedValidationRule | ((value: T) => boolean | string);" db1196501a199b27e506bdbb8a80915667bb9287,2018-11-28 00:01:14,Razvan Stoenescu,feat: QSelect work [WIP],False,QSelect work [WIP],feat,"diff --git a/dev/components/form/select.vue b/dev/components/form/select.vue index 82b581152ba..e6bce1639cb 100644 --- a/dev/components/form/select.vue +++ b/dev/components/form/select.vue @@ -9,97 +9,120 @@
+ +
-
{{ select1 }}
-
{{ multi1 }}
+
String options
-
Single
+
{{ stringSingle }}
+
{{ stringMultiple }}
- - - - Click on me - - + v-model=""stringMultiple"" + :options=""stringOptions"" + label=""Multiple"" + multiple + /> - - +
Object options
+ +
{{ objectSingle }}
+ -
Multiple
+
{{ objectMultiple }}
+
+ Null model + +
+ +
{{ stringNullSingle }}
+
{{ objectNullSingle }}
+ + +
{{ stringNullMultiple }}
+ - - - - Click on me - - + /> - - +
{{ objectNullMultiple }}
+ -
Slot: option
+
+ Model value not in options + +
+
{{ bogusModel }}
+
{{ bogusMultiModel }}
+ - - - + /> +
Scoped Slot: option
+ @@ -109,68 +132,42 @@ {{ scope.opt.description }} + + - - + + {{ scope.opt.description }} - - - - - - - - - - - - {{ scope.opt.description }} - - +
Scoped slot: selected
@@ -178,7 +175,7 @@ slot=""selected"" slot-scope=""scope"" removable - @remove=""scope.remove"" + @remove=""scope.toggleOption(scope.opt)"" color=""white"" text-color=""primary"" > @@ -190,160 +187,81 @@
Max values (in this case 2)
- - - - - - -
Use object
- +
Heavy test (10k options)
-
Use object, slot: selected
- - + +
No options
-
- None - - {{ objMulti[0].label }} - 1"">+ {{ objMulti.length - 1 }} more - -
-
- -
Readonly
- - - -
Disable
- -
Heavy test (10k options)
+
No options, slot: no-options
- - - - - + + No options slot + + - -
- Bogus model test - -
-
{{ bogusModel }}
- -
{{ bogusMultiModel }}
- @@ -361,343 +279,90 @@ export default { return { type: 'filled', + readonly: false, + disable: false, dense: false, expandBesides: false, - heavyModel: [], - heavyOptions, - - select1: 'fb', - select2: 'fb', - multi1: ['goog', 'twtr'], - multi2: [], - - bogusModel: 'bogus', - bogusMultiModel: ['bogus', 'gigi'], + stringSingle: 'Facebook', + stringMultiple: ['Facebook', 'Twitter'], + stringOptions: [ + 'Google', 'Facebook', 'Twitter', 'Apple', 'Oracle' + ], - objSingle: { + objectSingle: { label: 'Facebook', - value: 'fb', + value: 'Facebook', description: 'Social media', icon: 'bluetooth' }, - objMulti: [{ - label: 'Facebook', - value: 'fb', - description: 'Social media', - icon: 'bluetooth' - }], - - selectOptions: [ + objectMultiple: [ { - label: 'VW³ Google', - value: 'goog', + label: 'Google', + value: 'Google', description: 'Search engine', icon: 'mail' }, { label: 'Facebook', - value: 'fb', + value: 'Facebook', + description: 'Social media', + icon: 'bluetooth' + } + ], + objectOptions: [ + { + label: 'Google', + value: 'Google', + description: 'Search engine', + icon: 'mail' + }, + { + label: 'Facebook', + value: 'Facebook', description: 'Social media', icon: 'bluetooth' }, { label: 'Twitter', - value: 'twtr', + value: 'Twitter', description: 'Quick updates', icon: 'map' }, { - label: 'Apple Inc.', - value: 'appl', + label: 'Apple', + value: 'Apple', description: 'iStuff', icon: 'golf_course' }, { label: 'Oracle', - value: 'ora', + value: 'Oracle', disable: true, description: 'Databases', icon: 'casino' } ], - selectDisabledOptions: [ - { - label: 'VW³ Google', - value: 'goog' - }, - { - label: 'Facebook', - value: 'fb', - disable: true - }, - { - label: 'Twitter', - value: 'twtr' - }, - { - label: 'Apple Inc.', - value: 'appl', - disable: true - }, - { - label: 'Oracle', - value: 'ora' - } - ], - selectListOptions: [ - { - label: 'VW³ Google', - icon: 'email', - value: 'goog' - }, - { - label: 'Facebook', - inset: true, - description: 'Enables communication', - value: 'fb' - }, - { - label: 'Twitter Twitter Twitter Twitter Twitter Twitter Twitter', - inset: true, - rightIcon: 'alarm', - value: 'twtr' - }, - { - label: 'Apple Inc.', - inset: true, - stamp: '10 min', - value: 'appl' - }, - { - label: 'Oracle', - description: 'Some Java for today?', - icon: 'mail', - rightIcon: 'alarm', - value: 'ora', - color: 'red-4' - } - ], - selectListOptionColors: [ - { - label: 'VW³ Google', - icon: 'email', - value: 'goog' - }, - { - label: 'Facebook', - inset: true, - description: 'Enables communication', - value: 'fb' - }, - { - label: 'Twitter', - inset: true, - rightIcon: 'alarm', - value: 'twtr' - }, - { - label: 'Apple Inc.', - inset: true, - stamp: '10 min', - value: 'appl' - }, - { - label: 'Oracle', - description: 'Some Java for today?', - icon: 'mail', - rightIcon: 'alarm', - value: 'ora', - color: 'red-4' - } - ], - selectLongListOptions: [ - { - label: 'VW³ Google', - icon: 'email', - value: 'goog' - }, - { - label: 'Facebook', - inset: true, - description: 'Enables communication', - value: 'fb' - }, - { - label: 'Twitter', - inset: true, - rightIcon: 'alarm', - value: 'twtr' - }, - { - label: 'Apple Inc.', - inset: true, - stamp: '10 min', - value: 'appl' - }, - { - label: 'Oracle', - sublabel: 'Oracle that is', - inset: true, - description: 'Some Java for today?', - icon: 'mail', - rightIcon: 'alarm', - value: 'ora' - }, - { - label: 'Google - again', - icon: 'email', - value: 'goog-a' - }, - { - label: 'Facebook - again', - inset: true, - description: 'Enables communication', - value: 'fb-a' - }, - { - label: 'Twitter - again', - inset: true, - rightIcon: 'alarm', - value: 'twtr-a' - }, - { - label: 'Apple Inc. - again', - inset: true, - stamp: '10 min', - value: 'appl-a' - }, - { - label: 'Oracle - again', - description: 'Some Java for today?', - icon: 'mail', - rightIcon: 'alarm', - value: 'ora-a' - }, - { - label: 'Google - trice', - icon: 'email', - value: 'goog-b' - }, - { - label: 'Facebook - trice', - inset: true, - description: 'Enables communication', - value: 'fb-b' - }, - { - label: 'Twitter - trice', - inset: true, - rightIcon: 'alarm', - value: 'twtr-b' - }, - { - label: 'Apple Inc. - trice', - inset: true, - stamp: '10 min', - value: 'appl-b' - }, - { - label: 'Oracle - trice', - description: 'Some Java for today?', - icon: 'mail', - rightIcon: 'alarm', - value: 'ora-b' - }, - { - label: 'Google - more', - icon: 'email', - value: 'goog-c' - }, - { - label: 'Facebook - more', - inset: true, - description: 'Enables communication', - value: 'fb-c' - }, - { - label: 'Twitter - more', - inset: true, - rightIcon: 'alarm', - value: 'twtr-c' - }, - { - label: 'Apple Inc. - more', - inset: true, - stamp: '10 min', - value: 'appl-c' - }, - { - label: 'Oracle - more', - description: 'Some Java for today?', - icon: 'mail', - rightIcon: 'alarm', - value: 'ora-c' - }, - { - label: 'Google - extra', - icon: 'email', - value: 'goog-d' - }, - { - label: 'Facebook - extra', - inset: true, - description: 'Enables communication', - value: 'fb-d' - }, - { - label: 'Twitter - extra', - inset: true, - rightIcon: 'alarm', - value: 'twtr-d' - }, - { - label: 'Apple Inc. - extra', - inset: true, - stamp: '10 min', - value: 'appl-d' - }, - { - label: 'Oracle - extra', - description: 'Some Java for today?', - icon: 'mail', - rightIcon: 'alarm', - value: 'ora-d' - } - ], - selectObjectOptions: [ - { - label: 'Option 1', - value: { id: 1 } - }, - { - label: 'Option 2', - value: { id: 2 } - }, - { - label: 'Option 3', - value: { id: 3 } - } - ] - } - }, - watch: { - select (val, old) { - console.log(`Changed from ${JSON.stringify(old)} to ${JSON.stringify(val)}`) - }, - multipleSelect (val, old) { - console.log(`Changed from ${JSON.stringify(old)} to ${JSON.stringify(val)}`) + + stringNullSingle: null, + stringNullMultiple: null, + objectNullSingle: null, + objectNullMultiple: null, + + heavyModel: [], + heavyOptions, + + bogusModel: 'bogus', + bogusMultiModel: ['bogus', 'gigi'] } }, + methods: { - onChange (val) { - console.log('@change', JSON.stringify(val)) - }, - onBlur (val) { - console.log('@blur', JSON.stringify(val)) - }, - onInput (val) { - console.log('@input', JSON.stringify(val)) + resetNull () { + this.stringNullSingle = null + this.stringNullMultiple = null + this.objectNullSingle = null + this.objectNullMultiple = null }, resetBogus () { @@ -710,6 +375,8 @@ export default { props () { return { [this.type]: true, + readonly: this.readonly, + disable: this.disable, dense: this.dense, expandBesides: this.expandBesides } diff --git a/src/components/select/QSelect.js b/src/components/select/QSelect.js index 7cf5c388ca2..14bcb059fb2 100644 --- a/src/components/select/QSelect.js +++ b/src/components/select/QSelect.js @@ -19,7 +19,6 @@ export default Vue.extend({ required: true }, - useObject: Boolean, multiple: Boolean, displayValue: [String, Number], @@ -30,14 +29,8 @@ export default Vue.extend({ default: () => [] }, - optionLabel: { - type: [Function, String], - default: 'label' - }, - optionValue: { - type: [Function, String], - default: 'value' - }, + optionValue: [Function, String], + optionLabel: [Function, String], counter: Boolean, maxValues: [Number, String], @@ -47,57 +40,48 @@ export default Vue.extend({ data () { return { - optionsToShow: 20, - innerValue: this.__getInnerValue(this.options) - } - }, - - watch: { - value (v) { - if (this.avoidValueWatcher === true) { - this.avoidValueWatcher = false - } - else { - this.innerValue = this.__getInnerValue(this.options) - } - }, - - options (opts) { - this.innerValue = this.__getInnerValue(opts) + optionsToShow: 20 } }, computed: { - selected () { - const filter = this.innerValue - .map(opt => this.__getOptionLabel(opt)) + innerValue () { + return this.value !== void 0 && this.value !== null + ? (this.multiple === true ? this.value : [ this.value ]) + : [] + }, - return this.multiple === true - ? filter.join(', ') - : (filter[0] !== void 0 ? filter[0] : '') + noOptions () { + return this.options.length === 0 }, - computedCounter () { - if (this.multiple === true && this.counter === true) { - return this.value.length + (this.maxValues !== void 0 ? ' / ' + this.maxValues : '') - } + selectedString () { + return this.innerValue + .map(opt => this.__getOptionLabel(opt)) + .join(', ') }, selectedScope () { return this.innerValue.map((opt, i) => ({ index: i, opt, - selected: this.__isSelected(opt), - remove: () => { this.toggleOption(opt) } + selected: true, + toggleOption: this.toggleOption })) }, + computedCounter () { + if (this.multiple === true && this.counter === true) { + return this.value.length + (this.maxValues !== void 0 ? ' / ' + this.maxValues : '') + } + }, + optionScope () { return this.options.slice(0, this.optionsToShow).map((opt, i) => ({ index: i, opt, selected: this.__isSelected(opt), - click: () => { this.toggleOption(opt) } + toggleOption: this.toggleOption })) }, @@ -112,72 +96,66 @@ export default Vue.extend({ toggleOption (opt) { if (opt.disable === true) { return } - const val = this.__getOptionValue(opt) - - if (this.multiple === true) { - const - model = [].concat(this.value), - index = model.findIndex(v => isDeepEqual(v, val)) - - if (index > -1) { - this.$emit('remove', { index, value: model.splice(index, 1) }) - this.innerValue = this.innerValue.filter(v => v !== opt) + if (this.multiple !== true) { + if (!isDeepEqual(this.value, opt)) { + this.$emit('input', opt) } - else { - if (this.maxValues !== void 0 && model.length >= this.maxValues) { - return - } - this.$emit('add', { index: model.length, value: opt }) - model.push(val) - this.innerValue.push(opt) - } - - this.avoidValueWatcher = true - this.$emit('input', model) + return } - else if (!isDeepEqual(this.value, val)) { - this.innerValue = this.__getInnerValue(this.options, val) - this.avoidValueWatcher = true - this.$emit('input', val) + + if (this.innerValue.length === 0) { + this.$emit('add', { index: 0, value: opt }) + this.$emit('input', this.multiple === true ? [ opt ] : opt) + return } - }, - __getInnerValue (opts, value = this.value) { - if (value === void 0 || value === null) { - return [] + const + model = [].concat(this.value), + index = this.value.findIndex(v => isDeepEqual(v, opt)) + + if (index > -1) { + this.$emit('remove', { index, value: model.splice(index, 1) }) } + else { + if (this.maxValues !== void 0 && model.length >= this.maxValues) { + return + } - if (this.multiple === true) { - const optValue = opts.map(opt => this.__getOptionValue(opt)) - return value.map(val => opts.find((opt, i) => isDeepEqual(optValue[i], val))) - .filter(v => v !== void 0) + this.$emit('add', { index: model.length, value: opt }) + model.push(opt) } - const res = opts.find(opt => isDeepEqual(this.__getOptionValue(opt), value)) - return res !== void 0 ? [ res ] : [] + this.$emit('input', model) }, __getOptionValue (opt) { - if (this.useObject === true) { - return opt + if (typeof this.optionValue === 'function') { + return this.optionValue(opt) } - - const prop = this.optionValue - return typeof prop === 'function' - ? prop(opt) - : opt[prop] + if (Object(opt) === opt) { + return typeof this.optionValue === 'string' + ? opt[this.optionValue] + : opt.value + } + return opt }, __getOptionLabel (opt) { - const prop = this.optionLabel - return typeof prop === 'function' - ? prop(opt) - : opt[prop] + if (typeof this.optionLabel === 'function') { + return this.optionLabel(opt) + } + if (Object(opt) === opt) { + return typeof this.optionLabel === 'string' + ? opt[this.optionLabel] + : opt.label + } + return opt }, __isSelected (opt) { - return this.innerValue.includes(opt) + const val = this.__getOptionValue(opt) + return this.innerValue.find(v => isDeepEqual(this.__getOptionValue(v), val)) !== void 0 }, __onFocus (e) { @@ -211,7 +189,7 @@ export default Vue.extend({ : ( this.$slots.selected !== void 0 ? this.$slots.selected - : [ this.displayValue || h('span', { domProps: { innerHTML: this.selected } }) ] + : [ this.displayValue || h('span', { domProps: { innerHTML: this.selectedString } }) ] ) return h('div', { @@ -234,7 +212,7 @@ export default Vue.extend({ active: scope.selected }, on: { - click: scope.click + click: () => { scope.toggleOption(scope.opt) } } }, [ h(QItemSection, { @@ -248,20 +226,25 @@ export default Vue.extend({ }, __getDefaultSlot (h) { - if (this.editable === false) { return } + if ( + this.editable === false || + (this.noOptions === true && this.$slots['no-option'] === void 0) + ) { + return + } return h(QMenu, { ref: 'menu', props: { - [this.expandBesides === true ? 'fit' : 'cover']: true, - autoClose: this.multiple !== true + [this.expandBesides === true || this.noOptions === true ? 'fit' : 'cover']: true, + autoClose: this.multiple !== true && this.noOptions !== true }, on: { 'before-show': this.__onFocus, 'before-hide': this.__onBlur, '&scroll': this.__onScroll } - }, this.__getOptions(h)) + }, this.options.length === 0 ? this.$slots['no-option'] : this.__getOptions(h)) }, __getInnerAppend (h) {" 1ebec0e6fb21e95d377e8ca12f6f3bfb93c6f40f,2018-07-21 06:35:25,Razvan Stoenescu,fix: Q-Table - sort by non visible column #1886,False,Q-Table - sort by non visible column #1886,fix,"diff --git a/dev/components/components/data-table.vue b/dev/components/components/data-table.vue index b7328647603..7c37fd670ef 100644 --- a/dev/components/components/data-table.vue +++ b/dev/components/components/data-table.vue @@ -25,6 +25,7 @@ :loading=""loading"" selection=""multiple"" :selected.sync=""selected"" + :visible-columns=""visibleColumns"" row-key=""name"" :pagination.sync=""serverPagination"" :separator=""separator"" diff --git a/src/components/table/table-sort.js b/src/components/table/table-sort.js index 4528690ec6f..513c68fe567 100644 --- a/src/components/table/table-sort.js +++ b/src/components/table/table-sort.js @@ -6,7 +6,7 @@ export default { sortMethod: { type: Function, default (data, sortBy, descending) { - const col = this.computedCols.find(def => def.name === sortBy) + const col = this.columns.find(def => def.name === sortBy) if (col === null || col.field === void 0) { return data } @@ -55,8 +55,7 @@ export default { const { sortBy } = this.computedPagination if (sortBy) { - const col = this.computedCols.find(def => def.name === sortBy) - return col || null + return this.columns.find(def => def.name === sortBy) || null } } }," 466f39fc37c3a802c3ec01da3b7f6db91c57d850,2024-04-15 21:39:29,Razvan Stoenescu,feat(ui/testing): README - add important links for reading,False,README - add important links for reading,feat,"diff --git a/ui/testing/README.md b/ui/testing/README.md index 80abcc5a5a3..8eb0b7ad997 100644 --- a/ui/testing/README.md +++ b/ui/testing/README.md @@ -173,6 +173,12 @@ $ pnpm test:specs --target * There are some custom matchers that you can use (`$any`, `$arrayValues`, `$objectValues`, `$ref`, `$reactive`) and also some extra @vue/test-utils mount() additions (`$style`, `$computedStyle`): [code](https://github.com/quasarframework/quasar/blob/dev/ui/testing/setup.js) * Use of Copilot when writing the tests is allowed ;) +Important reading list: +* https://vitest.dev/api/expect.html +* https://test-utils.vuejs.org/api/ +* https://vitest.dev/api/ +* https://vitest.dev/api/vi.html + ## Common formulas for writing tests > When instructed to search for something, do it in /ui/src/**/*.test.js files." fedc5c90c493b1a328e43b784b7bcfcdb994fd1a,2024-10-18 17:02:13,Razvan Stoenescu,feat(vite-plugin): upgrade to Sass v1.80+ specs; suppress deprecation warnings,False,upgrade to Sass v1.80+ specs; suppress deprecation warnings,feat,"diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0b1ad050e7d..aeac1555ce3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,7 +40,7 @@ importers: version: 4.17.21 '@vitejs/plugin-vue': specifier: ^5.1.3 - version: 5.1.4(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0))(vue@3.5.6(typescript@5.6.2)) + version: 5.1.4(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0))(vue@3.5.6(typescript@5.6.2)) archiver: specifier: ^7.0.1 version: 7.0.1 @@ -118,7 +118,7 @@ importers: version: 9.4.2(typescript@5.6.2) vite: specifier: ^5.4.5 - version: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + version: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) webpack-merge: specifier: ^6.0.1 version: 6.0.1 @@ -311,7 +311,7 @@ importers: version: 1.80.2 sass-loader: specifier: ^16.0.1 - version: 16.0.1(sass-embedded@1.80.2)(sass@1.79.1)(webpack@5.94.0(esbuild@0.23.1)) + version: 16.0.1(sass-embedded@1.80.2)(sass@1.80.2)(webpack@5.94.0(esbuild@0.23.1)) semver: specifier: ^7.6.3 version: 7.6.3 @@ -552,7 +552,7 @@ importers: version: 3.0.0 vite-plugin-checker: specifier: ^0.7.2 - version: 0.7.2(eslint@8.57.1)(optionator@0.9.4)(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0)) + version: 0.7.2(eslint@8.57.1)(optionator@0.9.4)(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0)) workbox-build: specifier: ^7.1.1 version: 7.1.1 @@ -694,7 +694,7 @@ importers: version: 8.4.47 vite-plugin-checker: specifier: ^0.7.2 - version: 0.7.2(eslint@8.57.1)(optionator@0.9.4)(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0)) + version: 0.7.2(eslint@8.57.1)(optionator@0.9.4)(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0)) ui/testing: dependencies: @@ -713,7 +713,7 @@ importers: version: link:../../vite-plugin '@vitejs/plugin-vue': specifier: ^5.1.3 - version: 5.1.4(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0))(vue@3.5.6(typescript@5.6.2)) + version: 5.1.4(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0))(vue@3.5.6(typescript@5.6.2)) '@vitest/ui': specifier: ^2.1.1 version: 2.1.1(vitest@2.1.1) @@ -737,13 +737,13 @@ importers: version: 2.4.2 vite: specifier: ^5.4.5 - version: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + version: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) vite-plugin-checker: specifier: ^0.7.2 - version: 0.7.2(eslint@9.10.0)(optionator@0.9.4)(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0)) + version: 0.7.2(eslint@9.10.0)(optionator@0.9.4)(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0)) vitest: specifier: ^2.1.1 - version: 2.1.1(@types/node@22.5.5)(@vitest/ui@2.1.1)(jsdom@24.1.3)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + version: 2.1.1(@types/node@22.5.5)(@vitest/ui@2.1.1)(jsdom@24.1.3)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) vue: specifier: ^3.5.5 version: 3.5.6(typescript@5.6.2) @@ -804,7 +804,7 @@ importers: version: link:../../ui vite: specifier: ^5.4.5 - version: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + version: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) vue: specifier: ^3.5.5 version: 3.5.6(typescript@5.6.2) @@ -832,7 +832,7 @@ importers: dependencies: '@vitejs/plugin-vue': specifier: ^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 - version: 5.1.4(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0))(vue@3.5.6(typescript@5.6.2)) + version: 5.1.4(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0))(vue@3.5.6(typescript@5.6.2)) devDependencies: '@vue/test-utils': specifier: ^2.4.6 @@ -860,13 +860,13 @@ importers: version: 4.21.3 vite: specifier: ^5.4.5 - version: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + version: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) vite-plugin-checker: specifier: ^0.7.2 - version: 0.7.2(eslint@8.57.1)(optionator@0.9.4)(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0)) + version: 0.7.2(eslint@8.57.1)(optionator@0.9.4)(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0)) vitest: specifier: ^2.1.1 - version: 2.1.1(@types/node@22.5.5)(@vitest/ui@2.1.1)(jsdom@24.1.3)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + version: 2.1.1(@types/node@22.5.5)(@vitest/ui@2.1.1)(jsdom@24.1.3)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) vue: specifier: ^3.5.5 version: 3.5.6(typescript@5.6.2) @@ -885,16 +885,16 @@ importers: devDependencies: '@vitejs/plugin-vue': specifier: ^5.1.3 - version: 5.1.4(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0))(vue@3.5.6(typescript@5.6.2)) + version: 5.1.4(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0))(vue@3.5.6(typescript@5.6.2)) pug: specifier: ^3.0.3 version: 3.0.3 - sass: - specifier: ^1.78.0 - version: 1.79.1 + sass-embedded: + specifier: ^1.80.2 + version: 1.80.2 vite: specifier: ^5.4.5 - version: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + version: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) packages: @@ -2086,6 +2086,82 @@ packages: '@one-ini/wasm@0.1.1': resolution: {integrity: sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==} + '@parcel/watcher-android-arm64@2.4.1': + resolution: {integrity: sha512-LOi/WTbbh3aTn2RYddrO8pnapixAziFl6SMxHM69r3tvdSm94JtCenaKgk1GRg5FJ5wpMCpHeW+7yqPlvZv7kg==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [android] + + '@parcel/watcher-darwin-arm64@2.4.1': + resolution: {integrity: sha512-ln41eihm5YXIY043vBrrHfn94SIBlqOWmoROhsMVTSXGh0QahKGy77tfEywQ7v3NywyxBBkGIfrWRHm0hsKtzA==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [darwin] + + '@parcel/watcher-darwin-x64@2.4.1': + resolution: {integrity: sha512-yrw81BRLjjtHyDu7J61oPuSoeYWR3lDElcPGJyOvIXmor6DEo7/G2u1o7I38cwlcoBHQFULqF6nesIX3tsEXMg==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [darwin] + + '@parcel/watcher-freebsd-x64@2.4.1': + resolution: {integrity: sha512-TJa3Pex/gX3CWIx/Co8k+ykNdDCLx+TuZj3f3h7eOjgpdKM+Mnix37RYsYU4LHhiYJz3DK5nFCCra81p6g050w==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [freebsd] + + '@parcel/watcher-linux-arm-glibc@2.4.1': + resolution: {integrity: sha512-4rVYDlsMEYfa537BRXxJ5UF4ddNwnr2/1O4MHM5PjI9cvV2qymvhwZSFgXqbS8YoTk5i/JR0L0JDs69BUn45YA==} + engines: {node: '>= 10.0.0'} + cpu: [arm] + os: [linux] + + '@parcel/watcher-linux-arm64-glibc@2.4.1': + resolution: {integrity: sha512-BJ7mH985OADVLpbrzCLgrJ3TOpiZggE9FMblfO65PlOCdG++xJpKUJ0Aol74ZUIYfb8WsRlUdgrZxKkz3zXWYA==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [linux] + + '@parcel/watcher-linux-arm64-musl@2.4.1': + resolution: {integrity: sha512-p4Xb7JGq3MLgAfYhslU2SjoV9G0kI0Xry0kuxeG/41UfpjHGOhv7UoUDAz/jb1u2elbhazy4rRBL8PegPJFBhA==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [linux] + + '@parcel/watcher-linux-x64-glibc@2.4.1': + resolution: {integrity: sha512-s9O3fByZ/2pyYDPoLM6zt92yu6P4E39a03zvO0qCHOTjxmt3GHRMLuRZEWhWLASTMSrrnVNWdVI/+pUElJBBBg==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [linux] + + '@parcel/watcher-linux-x64-musl@2.4.1': + resolution: {integrity: sha512-L2nZTYR1myLNST0O632g0Dx9LyMNHrn6TOt76sYxWLdff3cB22/GZX2UPtJnaqQPdCRoszoY5rcOj4oMTtp5fQ==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [linux] + + '@parcel/watcher-win32-arm64@2.4.1': + resolution: {integrity: sha512-Uq2BPp5GWhrq/lcuItCHoqxjULU1QYEcyjSO5jqqOK8RNFDBQnenMMx4gAl3v8GiWa59E9+uDM7yZ6LxwUIfRg==} + engines: {node: '>= 10.0.0'} + cpu: [arm64] + os: [win32] + + '@parcel/watcher-win32-ia32@2.4.1': + resolution: {integrity: sha512-maNRit5QQV2kgHFSYwftmPBxiuK5u4DXjbXx7q6eKjq5dsLXZ4FJiVvlcw35QXzk0KrUecJmuVFbj4uV9oYrcw==} + engines: {node: '>= 10.0.0'} + cpu: [ia32] + os: [win32] + + '@parcel/watcher-win32-x64@2.4.1': + resolution: {integrity: sha512-+DvS92F9ezicfswqrvIRM2njcYJbd5mb9CUgtrHCHmvn7pPPa+nMDRu1o1bYYz/l5IB2NVGNJWiH7h1E58IF2A==} + engines: {node: '>= 10.0.0'} + cpu: [x64] + os: [win32] + + '@parcel/watcher@2.4.1': + resolution: {integrity: sha512-HNjmfLQEVRZmHRET336f20H/8kOozUGwk7yajvsonjNxbj2wBTK1WsQuHkD5yYh9RxFGL2EyDHryOihOwUoKDA==} + engines: {node: '>= 10.0.0'} + '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} @@ -3653,6 +3729,11 @@ packages: resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + detect-libc@1.0.3: + resolution: {integrity: sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==} + engines: {node: '>=0.10'} + hasBin: true + detect-libc@2.0.3: resolution: {integrity: sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==} engines: {node: '>=8'} @@ -5463,6 +5544,9 @@ packages: node-addon-api@1.7.2: resolution: {integrity: sha512-ibPK3iA+vaY1eEjESkQkM0BbCqFOaZMiXRTtdB0u7b4djtY6JnsjvPdUHVMg6xQt3B8fpTTWHI9A+ADjM9frzg==} + node-addon-api@7.1.1: + resolution: {integrity: sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==} + node-api-version@0.2.0: resolution: {integrity: sha512-fthTTsi8CxaBXMaBAD7ST2uylwvsnYxh2PfaScwpMhos6KlSFajXQPcM4ogNE1q2s3Lbz9GCGqeIHC+C6OZnKg==} @@ -6583,8 +6667,8 @@ packages: webpack: optional: true - sass@1.79.1: - resolution: {integrity: sha512-+mA7svoNKeL0DiJqZGeR/ZGUu8he4I8o3jyUcOFyo4eBJrwNgIMmAEwCMo/N2Y3wdjOBcRzoNxZIOtrtMX8EXg==} + sass@1.80.2: + resolution: {integrity: sha512-9wXY8cGBlUmoUoT+vwOZOFCiS+naiWVjqlreN9ar9PudXbGwlMTFwCR5K9kB4dFumJ6ib98wZyAObJKsWf1nAA==} engines: {node: '>=14.0.0'} hasBin: true @@ -9250,6 +9334,63 @@ snapshots: '@one-ini/wasm@0.1.1': {} + '@parcel/watcher-android-arm64@2.4.1': + optional: true + + '@parcel/watcher-darwin-arm64@2.4.1': + optional: true + + '@parcel/watcher-darwin-x64@2.4.1': + optional: true + + '@parcel/watcher-freebsd-x64@2.4.1': + optional: true + + '@parcel/watcher-linux-arm-glibc@2.4.1': + optional: true + + '@parcel/watcher-linux-arm64-glibc@2.4.1': + optional: true + + '@parcel/watcher-linux-arm64-musl@2.4.1': + optional: true + + '@parcel/watcher-linux-x64-glibc@2.4.1': + optional: true + + '@parcel/watcher-linux-x64-musl@2.4.1': + optional: true + + '@parcel/watcher-win32-arm64@2.4.1': + optional: true + + '@parcel/watcher-win32-ia32@2.4.1': + optional: true + + '@parcel/watcher-win32-x64@2.4.1': + optional: true + + '@parcel/watcher@2.4.1': + dependencies: + detect-libc: 1.0.3 + is-glob: 4.0.3 + micromatch: 4.0.8 + node-addon-api: 7.1.1 + optionalDependencies: + '@parcel/watcher-android-arm64': 2.4.1 + '@parcel/watcher-darwin-arm64': 2.4.1 + '@parcel/watcher-darwin-x64': 2.4.1 + '@parcel/watcher-freebsd-x64': 2.4.1 + '@parcel/watcher-linux-arm-glibc': 2.4.1 + '@parcel/watcher-linux-arm64-glibc': 2.4.1 + '@parcel/watcher-linux-arm64-musl': 2.4.1 + '@parcel/watcher-linux-x64-glibc': 2.4.1 + '@parcel/watcher-linux-x64-musl': 2.4.1 + '@parcel/watcher-win32-arm64': 2.4.1 + '@parcel/watcher-win32-ia32': 2.4.1 + '@parcel/watcher-win32-x64': 2.4.1 + optional: true + '@pkgjs/parseargs@0.11.0': optional: true @@ -9711,9 +9852,9 @@ snapshots: '@ungap/structured-clone@1.2.0': {} - '@vitejs/plugin-vue@5.1.4(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0))(vue@3.5.6(typescript@5.6.2))': + '@vitejs/plugin-vue@5.1.4(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0))(vue@3.5.6(typescript@5.6.2))': dependencies: - vite: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + vite: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) vue: 3.5.6(typescript@5.6.2) '@vitest/expect@2.1.1': @@ -9723,13 +9864,13 @@ snapshots: chai: 5.1.1 tinyrainbow: 1.2.0 - '@vitest/mocker@2.1.1(@vitest/spy@2.1.1)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0))': + '@vitest/mocker@2.1.1(@vitest/spy@2.1.1)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0))': dependencies: '@vitest/spy': 2.1.1 estree-walker: 3.0.3 magic-string: 0.30.11 optionalDependencies: - vite: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + vite: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) '@vitest/pretty-format@2.1.1': dependencies: @@ -9759,7 +9900,7 @@ snapshots: sirv: 2.0.4 tinyglobby: 0.2.6 tinyrainbow: 1.2.0 - vitest: 2.1.1(@types/node@22.5.5)(@vitest/ui@2.1.1)(jsdom@24.1.3)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + vitest: 2.1.1(@types/node@22.5.5)(@vitest/ui@2.1.1)(jsdom@24.1.3)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) '@vitest/utils@2.1.1': dependencies: @@ -11147,6 +11288,9 @@ snapshots: destroy@1.2.0: {} + detect-libc@1.0.3: + optional: true + detect-libc@2.0.3: {} detect-node@2.1.0: {} @@ -13326,6 +13470,9 @@ snapshots: node-addon-api@1.7.2: optional: true + node-addon-api@7.1.1: + optional: true + node-api-version@0.2.0: dependencies: semver: 7.6.3 @@ -14419,19 +14566,21 @@ snapshots: sass-embedded-win32-ia32: 1.80.2 sass-embedded-win32-x64: 1.80.2 - sass-loader@16.0.1(sass-embedded@1.80.2)(sass@1.79.1)(webpack@5.94.0(esbuild@0.23.1)): + sass-loader@16.0.1(sass-embedded@1.80.2)(sass@1.80.2)(webpack@5.94.0(esbuild@0.23.1)): dependencies: neo-async: 2.6.2 optionalDependencies: - sass: 1.79.1 + sass: 1.80.2 sass-embedded: 1.80.2 webpack: 5.94.0(esbuild@0.23.1) - sass@1.79.1: + sass@1.80.2: dependencies: + '@parcel/watcher': 2.4.1 chokidar: 4.0.0 immutable: 4.3.7 source-map-js: 1.2.1 + optional: true sax@1.1.4: {} @@ -15232,12 +15381,12 @@ snapshots: extsprintf: 1.4.1 optional: true - vite-node@2.1.1(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0): + vite-node@2.1.1(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0): dependencies: cac: 6.7.14 debug: 4.3.7 pathe: 1.1.2 - vite: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + vite: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) transitivePeerDependencies: - '@types/node' - less @@ -15249,7 +15398,7 @@ snapshots: - supports-color - terser - vite-plugin-checker@0.7.2(eslint@8.57.1)(optionator@0.9.4)(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0)): + vite-plugin-checker@0.7.2(eslint@8.57.1)(optionator@0.9.4)(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0)): dependencies: '@babel/code-frame': 7.24.7 ansi-escapes: 4.3.2 @@ -15261,7 +15410,7 @@ snapshots: npm-run-path: 4.0.1 strip-ansi: 6.0.1 tiny-invariant: 1.3.3 - vite: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + vite: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) vscode-languageclient: 7.0.0 vscode-languageserver: 7.0.0 vscode-languageserver-textdocument: 1.0.12 @@ -15271,7 +15420,7 @@ snapshots: optionator: 0.9.4 typescript: 5.6.2 - vite-plugin-checker@0.7.2(eslint@9.10.0)(optionator@0.9.4)(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0)): + vite-plugin-checker@0.7.2(eslint@9.10.0)(optionator@0.9.4)(typescript@5.6.2)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0)): dependencies: '@babel/code-frame': 7.24.7 ansi-escapes: 4.3.2 @@ -15283,7 +15432,7 @@ snapshots: npm-run-path: 4.0.1 strip-ansi: 6.0.1 tiny-invariant: 1.3.3 - vite: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + vite: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) vscode-languageclient: 7.0.0 vscode-languageserver: 7.0.0 vscode-languageserver-textdocument: 1.0.12 @@ -15293,7 +15442,7 @@ snapshots: optionator: 0.9.4 typescript: 5.6.2 - vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0): + vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0): dependencies: esbuild: 0.21.5 postcss: 8.4.47 @@ -15301,14 +15450,14 @@ snapshots: optionalDependencies: '@types/node': 22.5.5 fsevents: 2.3.3 - sass: 1.79.1 + sass: 1.80.2 sass-embedded: 1.80.2 terser: 5.33.0 - vitest@2.1.1(@types/node@22.5.5)(@vitest/ui@2.1.1)(jsdom@24.1.3)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0): + vitest@2.1.1(@types/node@22.5.5)(@vitest/ui@2.1.1)(jsdom@24.1.3)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0): dependencies: '@vitest/expect': 2.1.1 - '@vitest/mocker': 2.1.1(@vitest/spy@2.1.1)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0)) + '@vitest/mocker': 2.1.1(@vitest/spy@2.1.1)(vite@5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0)) '@vitest/pretty-format': 2.1.1 '@vitest/runner': 2.1.1 '@vitest/snapshot': 2.1.1 @@ -15323,8 +15472,8 @@ snapshots: tinyexec: 0.3.0 tinypool: 1.0.1 tinyrainbow: 1.2.0 - vite: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) - vite-node: 2.1.1(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.79.1)(terser@5.33.0) + vite: 5.4.6(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) + vite-node: 2.1.1(@types/node@22.5.5)(sass-embedded@1.80.2)(sass@1.80.2)(terser@5.33.0) why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.5.5 diff --git a/vite-plugin/playground/package.json b/vite-plugin/playground/package.json index f8d9cd12fdd..52d6ff42256 100644 --- a/vite-plugin/playground/package.json +++ b/vite-plugin/playground/package.json @@ -17,7 +17,7 @@ ""devDependencies"": { ""@vitejs/plugin-vue"": ""^5.1.3"", ""pug"": ""^3.0.3"", - ""sass"": ""^1.78.0"", + ""sass-embedded"": ""^1.80.2"", ""vite"": ""^5.4.5"" } } diff --git a/vite-plugin/playground/vite.config.js b/vite-plugin/playground/vite.config.js index 1b7124ae1fe..fc4569410f8 100755 --- a/vite-plugin/playground/vite.config.js +++ b/vite-plugin/playground/vite.config.js @@ -20,7 +20,7 @@ export default defineConfig(() => { quasar({ devTreeshaking: true, - sassVariables: 'src/quasar-variables.sass', + sassVariables: resolve('src/quasar-variables.sass'), autoImportComponentCase: 'combined' }), diff --git a/vite-plugin/src/vite-config.js b/vite-plugin/src/vite-config.js index fbe7c00ce1d..a818eb7bd5d 100644 --- a/vite-plugin/src/vite-config.js +++ b/vite-plugin/src/vite-config.js @@ -14,6 +14,20 @@ export function getViteConfig (runMode, viteMode, externalViteCfg) { __QUASAR_SSR__: false, __QUASAR_SSR_SERVER__: false, __QUASAR_SSR_CLIENT__: false + }, + + css: { + preprocessorOptions: { + // Use sass-embedded for better stability and performance + sass: { + api: 'modern-compiler', + silenceDeprecations: [ 'import', 'global-builtin' ] + }, + scss: { + api: 'modern-compiler', + silenceDeprecations: [ 'import', 'global-builtin' ] + } + } } }" 0f57fb74f7d8e1e17e904b2d686d1f03ab358f87,2020-10-04 09:56:47,Razvan Stoenescu,feat(vue3): correctly detect listeners,False,correctly detect listeners,feat,"diff --git a/ui/dev/src/pages/layout/layout-container.vue b/ui/dev/src/pages/layout/layout-container.vue index 35482f3f754..e030749a865 100644 --- a/ui/dev/src/pages/layout/layout-container.vue +++ b/ui/dev/src/pages/layout/layout-container.vue @@ -52,7 +52,7 @@ Title - + @@ -117,7 +117,7 @@ Title - + diff --git a/ui/dev/src/pages/layout/layout-keep-state-above.vue b/ui/dev/src/pages/layout/layout-keep-state-above.vue index a220b51653a..c882f403368 100644 --- a/ui/dev/src/pages/layout/layout-keep-state-above.vue +++ b/ui/dev/src/pages/layout/layout-keep-state-above.vue @@ -8,7 +8,7 @@ round icon=""menu"" aria-label=""Menu"" - @click=""leftDrawerOpen = !leftDrawerOpen"" + @click=""toggleLeft"" /> @@ -23,7 +23,7 @@ round icon=""settings"" aria-label=""settings"" - @click=""rightDrawerOpen = !rightDrawerOpen"" + @click=""toggleRight"" /> @@ -81,6 +81,16 @@ export default { leftDrawerOpen: false, rightDrawerOpen: false } + }, + + methods: { + toggleLeft () { + this.leftDrawerOpen = !this.leftDrawerOpen + }, + + toggleRight () { + this.rightDrawerOpen = !this.rightDrawerOpen + } } } diff --git a/ui/src/components/drawer/QDrawer.js b/ui/src/components/drawer/QDrawer.js index 732a3d71576..8bef5b93970 100644 --- a/ui/src/components/drawer/QDrawer.js +++ b/ui/src/components/drawer/QDrawer.js @@ -60,8 +60,8 @@ export default defineComponent({ bordered: Boolean, elevated: Boolean, - contentStyle: [String, Object, Array], - contentClass: [String, Object, Array], + contentStyle: [ String, Object, Array ], + contentClass: [ String, Object, Array ], overlay: Boolean, persistent: Boolean, @@ -71,7 +71,7 @@ export default defineComponent({ }, emits: [ - 'update:modelValue', 'on-layout', 'mini-state', 'click' + 'on-layout', 'mini-state', 'click' ], data () { @@ -353,7 +353,7 @@ export default defineComponent({ this.__applyPosition(this.stateDirection * position) }) } - else if (this.$refs.content !== void 0) { + else if (this.$refs.content !== void 0 && this.$refs.content !== null) { if ( this.layout.container === true && this.rightSide === true && @@ -660,7 +660,7 @@ export default defineComponent({ this.showIfAbove === true && this.modelValue !== true && this.showing === true && - this.$attrs['onUpdate:modelValue'] !== void 0 + this.$.vnode.props['onUpdate:modelValue'] !== void 0 ) { this.$emit('update:modelValue', true) } diff --git a/ui/src/components/editor/QEditor.js b/ui/src/components/editor/QEditor.js index b90393d6d40..ab2d3440490 100644 --- a/ui/src/components/editor/QEditor.js +++ b/ui/src/components/editor/QEditor.js @@ -345,21 +345,21 @@ export default defineComponent({ __onMouseup (e) { this.caret.save() - if (this.$attrs.onMouseup !== void 0) { + if (this.$.vnode.props.onMouseup !== void 0) { this.$emit('mouseup', e) } }, __onKeyup (e) { this.caret.save() - if (this.$attrs.onKeyup !== void 0) { + if (this.$.vnode.props.onKeyup !== void 0) { this.$emit('keyup', e) } }, __onTouchend (e) { this.caret.save() - if (this.$attrs.onTouchend !== void 0) { + if (this.$.vnode.props.onTouchend !== void 0) { this.$emit('touchend', e) } }, diff --git a/ui/src/components/footer/QFooter.js b/ui/src/components/footer/QFooter.js index bc2a88ec482..73d2fc1061b 100644 --- a/ui/src/components/footer/QFooter.js +++ b/ui/src/components/footer/QFooter.js @@ -18,7 +18,7 @@ export default defineComponent({ }, props: { - value: { + modelValue: { type: Boolean, default: true }, @@ -43,7 +43,7 @@ export default defineComponent({ }, watch: { - value (val) { + modelValue (val) { this.__update('space', val) this.__updateLocal('revealed', true) this.layout.__animate() @@ -54,7 +54,7 @@ export default defineComponent({ }, reveal (val) { - val === false && this.__updateLocal('revealed', this.value) + val === false && this.__updateLocal('revealed', this.modelValue) }, revealed (val) { @@ -87,7 +87,7 @@ export default defineComponent({ }, offset () { - if (this.value !== true) { + if (this.modelValue !== true) { return 0 } if (this.fixed === true) { @@ -98,11 +98,11 @@ export default defineComponent({ }, hidden () { - return this.value !== true || (this.fixed === true && this.revealed !== true) + return this.modelValue !== true || (this.fixed === true && this.revealed !== true) }, revealOnFocus () { - return this.value === true && this.hidden === true && this.reveal === true + return this.modelValue === true && this.hidden === true && this.reveal === true }, classes () { @@ -110,8 +110,11 @@ export default defineComponent({ (this.fixed === true ? 'fixed' : 'absolute') + '-bottom' + (this.bordered === true ? ' q-footer--bordered' : '') + (this.hidden === true ? ' q-footer--hidden' : '') + - (this.value !== true ? ' q-layout--prevent-focus' : '') + - (this.value !== true && this.fixed !== true ? ' hidden' : '') + ( + this.modelValue !== true + ? ' q-layout--prevent-focus' + (this.fixed !== true ? ' hidden' : '') + : '' + ) }, style () { @@ -153,8 +156,8 @@ export default defineComponent({ created () { this.layout.instances.footer = this - this.value === true && this.__update('size', this.size) - this.__update('space', this.value) + this.modelValue === true && this.__update('size', this.size) + this.__update('space', this.modelValue) this.__update('offset', this.offset) }, diff --git a/ui/src/components/form/QForm.js b/ui/src/components/form/QForm.js index 79fd64c4c49..6387fc0ead1 100644 --- a/ui/src/components/form/QForm.js +++ b/ui/src/components/form/QForm.js @@ -111,7 +111,7 @@ export default defineComponent({ this.validate().then(val => { if (val === true) { - if (this.$attrs.onSubmit !== void 0) { + if (this.$.vnode.props.onSubmit !== void 0) { this.$emit('submit', evt) } else if (evt !== void 0 && evt.target !== void 0 && typeof evt.target.submit === 'function') { diff --git a/ui/src/components/header/QHeader.js b/ui/src/components/header/QHeader.js index 0723e8660a8..fb5144429ad 100644 --- a/ui/src/components/header/QHeader.js +++ b/ui/src/components/header/QHeader.js @@ -16,7 +16,7 @@ export default defineComponent({ }, props: { - value: { + modelValue: { type: Boolean, default: true }, @@ -44,7 +44,7 @@ export default defineComponent({ }, watch: { - value (val) { + modelValue (val) { this.__update('space', val) this.__updateLocal('revealed', true) this.layout.__animate() @@ -55,7 +55,7 @@ export default defineComponent({ }, reveal (val) { - val === false && this.__updateLocal('revealed', this.value) + val === false && this.__updateLocal('revealed', this.modelValue) }, revealed (val) { @@ -80,7 +80,7 @@ export default defineComponent({ }, offset () { - if (this.value !== true) { + if (this.modelValue !== true) { return 0 } if (this.fixed === true) { @@ -91,11 +91,11 @@ export default defineComponent({ }, hidden () { - return this.value !== true || (this.fixed === true && this.revealed !== true) + return this.modelValue !== true || (this.fixed === true && this.revealed !== true) }, revealOnFocus () { - return this.value === true && this.hidden === true && this.reveal === true + return this.modelValue === true && this.hidden === true && this.reveal === true }, classes () { @@ -103,7 +103,7 @@ export default defineComponent({ (this.fixed === true ? 'fixed' : 'absolute') + '-top' + (this.bordered === true ? ' q-header--bordered' : '') + (this.hidden === true ? ' q-header--hidden' : '') + - (this.value !== true ? ' q-layout--prevent-focus' : '') + (this.modelValue !== true ? ' q-layout--prevent-focus' : '') }, style () { @@ -147,8 +147,8 @@ export default defineComponent({ created () { this.layout.instances.header = this - this.value === true && this.__update('size', this.size) - this.__update('space', this.value) + this.modelValue === true && this.__update('size', this.size) + this.__update('space', this.modelValue) this.__update('offset', this.offset) }, diff --git a/ui/src/components/intersection/QIntersection.js b/ui/src/components/intersection/QIntersection.js index a1656e18673..b754b6fa665 100644 --- a/ui/src/components/intersection/QIntersection.js +++ b/ui/src/components/intersection/QIntersection.js @@ -71,7 +71,7 @@ export default defineComponent({ __trigger (entry) { if (this.showing !== entry.isIntersecting) { this.showing = entry.isIntersecting - this.$attrs.onVisibility !== void 0 && this.$emit('visibility', this.showing) + this.$.vnode.props.onVisibility !== void 0 && this.$emit('visibility', this.showing) } }, diff --git a/ui/src/components/layout/QLayout.js b/ui/src/components/layout/QLayout.js index d21e20f548c..d834a230406 100644 --- a/ui/src/components/layout/QLayout.js +++ b/ui/src/components/layout/QLayout.js @@ -82,26 +82,26 @@ export default defineComponent({ }, style () { - if (this.container === true) { - return { minHeight: this.$q.screen.height + 'px' } - } + return this.container === false + ? { minHeight: this.$q.screen.height + 'px' } + : null }, // used by container only targetStyle () { - if (this.scrollbarWidth !== 0) { - return { [this.$q.lang.rtl === true ? 'left' : 'right']: `${this.scrollbarWidth}px` } - } + return this.scrollbarWidth !== 0 + ? { [this.$q.lang.rtl === true ? 'left' : 'right']: `${this.scrollbarWidth}px` } + : null }, targetChildStyle () { - if (this.scrollbarWidth !== 0) { - return { + return this.scrollbarWidth !== 0 + ? { [this.$q.lang.rtl === true ? 'right' : 'left']: 0, [this.$q.lang.rtl === true ? 'left' : 'right']: `-${this.scrollbarWidth}px`, width: `calc(100% + ${this.scrollbarWidth}px)` } - } + : null }, totalWidth () { @@ -127,7 +127,7 @@ export default defineComponent({ if (this.container === true || document.qScrollPrevented !== true) { this.scroll = data } - this.$attrs.onScroll !== void 0 && this.$emit('scroll', data) + this.$.vnode.props.onScroll !== void 0 && this.$emit('scroll', data) }, __onPageResize ({ height, width }) { @@ -136,7 +136,7 @@ export default defineComponent({ if (this.height !== height) { resized = true this.height = height - this.$attrs['onScroll-height'] !== void 0 && this.$emit('scroll-height', height) + this.$.vnode.props['onScroll-height'] !== void 0 && this.$emit('scroll-height', height) this.__updateScrollbarWidth() } if (this.width !== width) { @@ -145,7 +145,7 @@ export default defineComponent({ } if (resized === true) { - this.$attrs.onResize !== void 0 && this.$emit('resize', { height, width }) + this.$.vnode.props.onResize !== void 0 && this.$emit('resize', { height, width }) } }, diff --git a/ui/src/components/parallax/QParallax.js b/ui/src/components/parallax/QParallax.js index 8771e2f80f8..c5f15a6dd35 100644 --- a/ui/src/components/parallax/QParallax.js +++ b/ui/src/components/parallax/QParallax.js @@ -53,7 +53,7 @@ export default defineComponent({ methods: { __update (percentage) { this.percentScrolled = percentage - this.$attrs.onScroll !== void 0 && this.$emit('scroll', percentage) + this.$.vnode.props.onScroll !== void 0 && this.$emit('scroll', percentage) }, __updatePos () { diff --git a/ui/src/components/scroll-area/QScrollArea.js b/ui/src/components/scroll-area/QScrollArea.js index 95378d7fa91..cadc9e731eb 100644 --- a/ui/src/components/scroll-area/QScrollArea.js +++ b/ui/src/components/scroll-area/QScrollArea.js @@ -312,7 +312,7 @@ export default defineComponent({ // ensure we're not emitting same info // multiple times this.__emitScroll = debounce(() => { - if (this.$attrs.onScroll !== void 0) { + if (this.$.vnode.props.onScroll !== void 0) { const info = { ref: this } const prefix = this.dirProps.prefix diff --git a/ui/src/components/select/QSelect.js b/ui/src/components/select/QSelect.js index 5c1ac604fe4..b5e40c81a5a 100755 --- a/ui/src/components/select/QSelect.js +++ b/ui/src/components/select/QSelect.js @@ -614,7 +614,7 @@ export default defineComponent({ } const newValueModeValid = this.inputValue.length > 0 && - (this.newValueMode !== void 0 || this.$attrs['onNew-value'] !== void 0) + (this.newValueMode !== void 0 || this.$.vnode.props['onNew-value'] !== void 0) const tabShouldSelect = e.shiftKey !== true && this.multiple !== true && (this.optionIndex > -1 || newValueModeValid === true) @@ -760,7 +760,7 @@ export default defineComponent({ } } - if (this.$attrs['onNew-value'] !== void 0) { + if (this.$.vnode.props['onNew-value'] !== void 0) { this.$emit('new-value', this.inputValue, done) } else { @@ -919,7 +919,7 @@ export default defineComponent({ this.__focus() } - if (this.$attrs.onFilter !== void 0) { + if (this.$.vnode.props.onFilter !== void 0) { this.inputTimer = setTimeout(() => { this.filter(this.inputValue) }, this.inputDebounce) @@ -948,7 +948,7 @@ export default defineComponent({ }, filter (val) { - if (this.$attrs.onFilter === void 0 || this.focused !== true) { + if (this.$.vnode.props.onFilter === void 0 || this.focused !== true) { return } @@ -1215,7 +1215,7 @@ export default defineComponent({ this.__focus() } - if (this.$attrs.onFilter !== void 0) { + if (this.$.vnode.props.onFilter !== void 0) { this.filter(this.inputValue) } else if (this.noOptions !== true || this.$slots['no-option'] !== void 0) { @@ -1265,7 +1265,7 @@ export default defineComponent({ ? false : this.behavior !== 'menu' && ( this.useInput === true - ? this.$slots['no-option'] !== void 0 || this.$attrs.onFilter !== void 0 || this.noOptions === false + ? this.$slots['no-option'] !== void 0 || this.$.vnode.props.onFilter !== void 0 || this.noOptions === false : true ) diff --git a/ui/src/components/table/table-body.js b/ui/src/components/table/table-body.js index c2c0d44c736..f32b3ba1216 100644 --- a/ui/src/components/table/table-body.js +++ b/ui/src/components/table/table-body.js @@ -58,14 +58,14 @@ export default { const data = { key, class: { selected } } - if (this.$attrs['onRow-click'] !== void 0) { + if (this.$.vnode.props['onRow-click'] !== void 0) { data.class['cursor-pointer'] = true data.onClick = evt => { this.$emit('row-click', evt, row, pageIndex) } } - if (this.$attrs['onRow-dblclick'] !== void 0) { + if (this.$.vnode.props['onRow-dblclick'] !== void 0) { data.class['cursor-pointer'] = true data.onDblclick = evt => { this.$emit('row-dblclick', evt, row, pageIndex) diff --git a/ui/src/components/table/table-grid.js b/ui/src/components/table/table-grid.js index 041097394db..06b54205bdb 100644 --- a/ui/src/components/table/table-grid.js +++ b/ui/src/components/table/table-grid.js @@ -62,19 +62,22 @@ export default { style: this.cardStyle } - if (this.$attrs['onRow-click'] !== void 0 || this.$attrs['onRow-dblclick'] !== void 0) { + if ( + this.$.vnode.props['onRow-click'] !== void 0 || + this.$.vnode.props['onRow-dblclick'] !== void 0 + ) { data.class[0] += ' cursor-pointer' - } - if (this.$attrs['onRow-click'] !== void 0) { - data.onClick = evt => { - this.$emit('row-click', evt, scope.row, scope.pageIndex) + if (this.$.vnode.props['onRow-click'] !== void 0) { + data.onClick = evt => { + this.$emit('row-click', evt, scope.row, scope.pageIndex) + } } - } - if (this.$attrs['onRow-dblclick'] !== void 0) { - data.onDblclick = evt => { - this.$emit('row-dblclick', evt, scope.row, scope.pageIndex) + if (this.$.vnode.props['onRow-dblclick'] !== void 0) { + data.onDblclick = evt => { + this.$emit('row-dblclick', evt, scope.row, scope.pageIndex) + } } } diff --git a/ui/src/components/table/table-pagination.js b/ui/src/components/table/table-pagination.js index 238fa9ff222..b96bb1f710b 100644 --- a/ui/src/components/table/table-pagination.js +++ b/ui/src/components/table/table-pagination.js @@ -30,7 +30,7 @@ export default { computed: { computedPagination () { - const pag = this.$attrs['onUpdate:pagination'] !== void 0 + const pag = this.$.vnode.props['onUpdate:pagination'] !== void 0 ? { ...this.innerPagination, ...this.pagination } : this.innerPagination @@ -120,7 +120,10 @@ export default { return } - if (this.pagination !== void 0 && this.$attrs['onUpdate:pagination'] !== void 0) { + if ( + this.pagination !== void 0 && + this.$.vnode.props['onUpdate:pagination'] !== void 0 + ) { this.$emit('update:pagination', newPagination) } else { @@ -152,7 +155,7 @@ export default { }, created () { - if (this.$attrs['onUpdate:pagination'] !== void 0) { + if (this.$.vnode.props['onUpdate:pagination'] !== void 0) { this.$emit('update:pagination', { ...this.computedPagination }) } } diff --git a/ui/src/components/tabs/QRouteTab.js b/ui/src/components/tabs/QRouteTab.js index 831377ee206..4bda8b6fd41 100644 --- a/ui/src/components/tabs/QRouteTab.js +++ b/ui/src/components/tabs/QRouteTab.js @@ -60,7 +60,7 @@ export default defineComponent({ ) } - this.$attrs.onClick !== void 0 && this.$emit('click', e, go) + this.$.vnode.props.onClick !== void 0 && this.$emit('click', e, go) e.navigate !== false && go() } } diff --git a/ui/src/components/tabs/QTab.js b/ui/src/components/tabs/QTab.js index a83414a99ff..cf04f97de6e 100644 --- a/ui/src/components/tabs/QTab.js +++ b/ui/src/components/tabs/QTab.js @@ -43,6 +43,8 @@ export default defineComponent({ contentClass: String }, + emits: [ 'click' ], + computed: { isActive () { return this.__qTabs.currentModel === this.name @@ -86,7 +88,7 @@ export default defineComponent({ keyboard !== true && this.$refs.blurTarget !== void 0 && this.$refs.blurTarget.focus() if (this.disable !== true) { - this.$attrs.onClick !== void 0 && this.$emit('click', e) + this.$.vnode.props.onClick !== void 0 && this.$emit('click', e) this.__qTabs.__activateTab({ name: this.name }) } }, diff --git a/ui/src/components/tabs/QTabs.js b/ui/src/components/tabs/QTabs.js index b01b144e063..52d50286e23 100644 --- a/ui/src/components/tabs/QTabs.js +++ b/ui/src/components/tabs/QTabs.js @@ -176,7 +176,10 @@ export default defineComponent({ __activateTab ({ name, setCurrent, skipEmit }) { if (this.currentModel !== name) { skipEmit !== true && this.$emit('update:modelValue', name) - if (setCurrent === true || this.$attrs['onUpdate:modelValue'] === void 0) { + if ( + setCurrent === true || + this.$.vnode.props['onUpdate:modelValue'] === void 0 + ) { this.__animate(this.currentModel, name) this.currentModel = name } diff --git a/ui/src/mixins/model-toggle.js b/ui/src/mixins/model-toggle.js index 81f304bd775..212363914c8 100644 --- a/ui/src/mixins/model-toggle.js +++ b/ui/src/mixins/model-toggle.js @@ -36,11 +36,13 @@ export default { }, show (evt) { - if (isSSR === true || this.disable === true || (this.__showCondition !== void 0 && this.__showCondition(evt) !== true)) { + if (this.disable === true || (this.__showCondition !== void 0 && this.__showCondition(evt) !== true)) { return } - if (this.modelValue === false) { + const listener = this.$.vnode.props['onUpdate:modelValue'] !== void 0 + + if (listener === true && isSSR === false) { this.$emit('update:modelValue', true) this.payload = evt this.$nextTick(() => { @@ -49,7 +51,8 @@ export default { } }) } - else if (this.modelValue === null) { + + if (this.modelValue === null || listener === false || isSSR === true) { this.__processShow(evt) } }, @@ -78,7 +81,9 @@ export default { return } - if (this.modelValue === true) { + const listener = this.$.vnode.props['onUpdate:modelValue'] !== void 0 + + if (listener === true && isSSR === false) { this.$emit('update:modelValue', false) this.payload = evt this.$nextTick(() => { @@ -87,7 +92,8 @@ export default { } }) } - else if (this.modelValue === null) { + + if (this.modelValue === null || listener === false || isSSR === true) { this.__processHide(evt) } }, @@ -113,7 +119,7 @@ export default { __processModelChange (val) { if (this.disable === true && val === true) { - this.modelValue !== null && this.$emit('update:modelValue', false) + this.$.vnode.props['onUpdate:modelValue'] !== void 0 && this.$emit('update:modelValue', false) } else if ((val === true) !== this.showing) { this[`__process${val === true ? 'Show' : 'Hide'}`](this.payload) diff --git a/ui/src/mixins/virtual-scroll.js b/ui/src/mixins/virtual-scroll.js index 535434563d8..fa81f9c138a 100644 --- a/ui/src/mixins/virtual-scroll.js +++ b/ui/src/mixins/virtual-scroll.js @@ -599,7 +599,7 @@ export default { __emitScroll (index) { if (this.prevToIndex !== index) { - this.$attrs['onVirtual-scroll'] !== void 0 && this.$emit('virtual-scroll', { + this.$.vnode.props['onVirtual-scroll'] !== void 0 && this.$emit('virtual-scroll', { index, from: this.virtualScrollSliceRange.from, to: this.virtualScrollSliceRange.to - 1," a69dc1325006d2ebaab2e8e2149c67219bd49f80,2021-05-12 16:59:18,Razvan Stoenescu,feat(QChatMessage): new slots - stamp & name #9148,False,new slots - stamp & name #9148,feat,"diff --git a/docs/src/examples/QChatMessage/SlotAvatar.vue b/docs/src/examples/QChatMessage/SlotAvatarStampName.vue similarity index 87% rename from docs/src/examples/QChatMessage/SlotAvatar.vue rename to docs/src/examples/QChatMessage/SlotAvatarStampName.vue index 8f4b78939b1..4ec8033cf59 100644 --- a/docs/src/examples/QChatMessage/SlotAvatar.vue +++ b/docs/src/examples/QChatMessage/SlotAvatarStampName.vue @@ -2,13 +2,13 @@
+ + @@ -36,13 +41,35 @@ export default { data () { return { ready: false, - finished: false + finished: false, + currentStep: 0, + stepMessage: '' } }, methods: { finish () { this.finished = true }, + onStep (currentStep) { + this.currentStep = currentStep + switch (this.currentStep) { + case 1: + this.stepMessage = 'started' + break + case 2: + this.stepMessage = 'second step' + break + case 3: + this.stepMessage = 'next to finish' + break + case 4: + this.stepMessage = 'done!' + break + default: + this.stepMessage = '' + break + } + }, reset () { this.$refs.stepper.reset() this.finished = false diff --git a/src/vue-components/stepper/Stepper.vue b/src/vue-components/stepper/Stepper.vue index 8ea0107c2aa..4e3b6457f14 100644 --- a/src/vue-components/stepper/Stepper.vue +++ b/src/vue-components/stepper/Stepper.vue @@ -35,18 +35,22 @@ export default { methods: { reset () { this.config.currentStep = 1 + this.$emit('step', this.config.currentStep) }, nextStep () { this.config.currentStep++ + this.$emit('step', this.config.currentStep) if (this.config.currentStep > this.config.steps) { this.$emit('finish') } }, previousStep () { this.config.currentStep-- + this.$emit('step', this.config.currentStep) }, finish () { this.config.currentStep = this.config.steps + 1 + this.$emit('step', this.config.currentStep) this.$emit('finish') } }, @@ -54,6 +58,7 @@ export default { let step = 1 this.config.currentStep = this.config.currentStep || 1 this.config.steps = this.$children.length + this.$emit('step', this.config.currentStep) this.$children.forEach(child => { child.step = step step++" b2c9f3ebb20d9f8b57b48baf9cdccbfd8efa80c3,2021-03-20 07:40:43,Razvan Stoenescu,"feat(ui): multi app support (stage 3, probably last one) (#8510) (#8634)",False,"multi app support (stage 3, probably last one) (#8510) (#8634)",feat,"diff --git a/ui/dev-umd/index-multiapp.umd.html b/ui/dev-umd/index-multiapp.umd.html index b3b8d612feb..b009033a69b 100644 --- a/ui/dev-umd/index-multiapp.umd.html +++ b/ui/dev-umd/index-multiapp.umd.html @@ -62,6 +62,7 @@ + @@ -77,7 +78,11 @@ }) app1.use(Quasar, { + lang: Quasar.lang.es, config: { + // globalNodes: { + // class: 'gigi' + // } brand: { primary: '#ff0000' } @@ -95,7 +100,9 @@ } }) - app2.use(Quasar) + app2.use(Quasar, { + lang: Quasar.lang.de + }) Quasar.Notify.create('Startup notification') diff --git a/ui/dev-umd/index.umd.html b/ui/dev-umd/index.umd.html index bef02db03b7..6ee06a7e8c5 100644 --- a/ui/dev-umd/index.umd.html +++ b/ui/dev-umd/index.umd.html @@ -148,13 +148,7 @@ } }) - app.use(Quasar, { - config: { - brand: { - primary: '#ff0000' - } - } - }) + app.use(Quasar) Quasar.Notify.create('Startup notification') diff --git a/ui/dev/src/pages/components/icon.vue b/ui/dev/src/pages/components/icon.vue index c06d9aaabc1..eb9b70a435b 100644 --- a/ui/dev/src/pages/components/icon.vue +++ b/ui/dev/src/pages/components/icon.vue @@ -171,10 +171,10 @@ export default { useMapFn (val) { if (val === true) { this.icon = TOP_ICON - this.$q.iconMapFn.value = customIconMapFn + this.$q.iconMapFn = customIconMapFn } else { - this.$q.iconMapFn.value = null + this.$q.iconMapFn = null } } }, diff --git a/ui/src/body.js b/ui/src/body.js index d1ea852c177..f7e24dd1928 100644 --- a/ui/src/body.js +++ b/ui/src/body.js @@ -74,10 +74,10 @@ function setColors (brand) { export default { install (opts) { if (__QUASAR_SSR_SERVER__) { - const { cfg, $q, ssrContext } = opts - const cls = getBodyClasses($q.platform, cfg) + const { $q, ssrContext } = opts + const cls = getBodyClasses($q.platform, $q.config) - if (cfg.screen !== void 0 && cfg.screen.bodyClass === true) { + if ($q.config.screen !== void 0 && $q.config.screen.bodyClass === true) { cls.push('screen--xs') } @@ -85,20 +85,20 @@ export default { return } - if (this.__installed === true) { return } + const { $q } = opts + + $q.config.brand !== void 0 && setColors($q.config.brand) - const { cfg } = opts + if (this.__installed === true) { return } if (isRuntimeSsrPreHydration === true) { applyClientSsrCorrections() } else { - const cls = getBodyClasses(client, cfg) + const cls = getBodyClasses(client, $q.config) document.body.classList.add.apply(document.body.classList, cls) } - cfg.brand !== void 0 && setColors(cfg.brand) - if (client.is.ios === true) { // needed for iOS button active state document.body.addEventListener('touchstart', noop) diff --git a/ui/src/composables/private/use-portal.js b/ui/src/composables/private/use-portal.js index 7dee7f8d1c3..0242fb4ed31 100644 --- a/ui/src/composables/private/use-portal.js +++ b/ui/src/composables/private/use-portal.js @@ -1,4 +1,4 @@ -import { h, ref, onUnmounted, Teleport, getCurrentInstance } from 'vue' +import { h, ref, onUnmounted, Teleport } from 'vue' import { noop } from '../../utils/event.js' import { createGlobalNode, removeGlobalNode } from '../../utils/private/global-nodes.js' @@ -39,11 +39,9 @@ export default function (vm, innerRef, renderPortalContent, checkGlobalDialog) { const onGlobalDialog = checkGlobalDialog === true && isOnGlobalDialog(vm) const portalIsActive = ref(false) - const { proxy: { $q } } = getCurrentInstance() - function showPortal () { if (onGlobalDialog === false) { - portalEl = createGlobalNode($q.config.globalNodes) + portalEl = createGlobalNode() } portalIsActive.value = true diff --git a/ui/src/config.js b/ui/src/config.js deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/ui/src/history.js b/ui/src/history.js index 122a7349c30..2c1122bb0eb 100644 --- a/ui/src/history.js +++ b/ui/src/history.js @@ -42,7 +42,7 @@ export default { add: noop, remove: noop, - install (opts) { + install ({ $q }) { if (__QUASAR_SSR_SERVER__ || this.__installed === true) { return } const { cordova, capacitor } = client.is @@ -51,7 +51,7 @@ export default { return } - const qConf = opts.cfg[ cordova === true ? 'cordova' : 'capacitor' ] + const qConf = $q.config[ cordova === true ? 'cordova' : 'capacitor' ] if (qConf !== void 0 && qConf.backButton === false) { return diff --git a/ui/src/icon-set.js b/ui/src/icon-set.js index 68e324216d4..de1d7aacc67 100644 --- a/ui/src/icon-set.js +++ b/ui/src/icon-set.js @@ -1,8 +1,11 @@ -import { ref, reactive } from 'vue' +import { ref } from 'vue' +import defineReactivePlugin from './utils/private/define-reactive-plugin.js' import materialIcons from '../icon-set/material-icons.js' -const Plugin = { +const Plugin = defineReactivePlugin({ + __icons: {} +}, { set (setObject, ssrContext) { const def = { ...setObject, rtl: setObject.rtl === true } @@ -17,19 +20,18 @@ const Plugin = { } else { def.set = Plugin.set - Object.assign(Plugin.__q.iconSet, def) + Object.assign(Plugin.__icons, def) } }, - install (opts) { - const initialSet = opts.iconSet || materialIcons - const { $q } = opts - + install ({ $q, iconSet, ssrContext }) { if (__QUASAR_SSR_SERVER__) { + const initialSet = iconSet || materialIcons + $q.iconMapFn = null $q.iconSet = {} $q.iconSet.set = setObject => { - this.set(setObject, opts.ssrContext) + this.set(setObject, ssrContext) } $q.iconSet.set(initialSet) @@ -37,17 +39,23 @@ const Plugin = { else { const iconMapFn = ref(null) - $q.iconSet = reactive({}) + $q.iconSet = Plugin.__icons - Object.defineProperty($q, 'iconMapFn', { - get: () => iconMapFn.value, - set: val => { iconMapFn.value = val } + Object.defineProperties($q, { + iconMapFn: { + get: () => iconMapFn.value, + set: val => { iconMapFn.value = val } + } }) - this.__q = $q - this.set(initialSet) + if (this.__installed === true) { + iconSet !== void 0 && this.set(iconSet) + } + else { + this.set(iconSet || materialIcons) + } } } -} +}) export default Plugin diff --git a/ui/src/install-quasar.js b/ui/src/install-quasar.js index bfeca5bb36a..031dfc47790 100644 --- a/ui/src/install-quasar.js +++ b/ui/src/install-quasar.js @@ -9,17 +9,18 @@ import Body from './body.js' import IconSet from './icon-set.js' import { quasarKey } from './utils/private/symbols.js' +import { globalConfig, globalConfigIsFrozen, freezeGlobalConfig } from './utils/private/global-config.js' const autoInstalled = [ Platform, Screen, Dark ] -export function createChildApp (appCfg, appInstance) { +export function createChildApp (appCfg, parentApp) { const app = createApp(appCfg) - app.config.globalProperties = appInstance.config.globalProperties + app.config.globalProperties = parentApp.config.globalProperties - const { reload, ...appContext } = appInstance._context + const { reload, ...appContext } = parentApp._context Object.assign(app._context, appContext) return app @@ -67,10 +68,10 @@ function prepareApp (app, uiOpts, pluginOpts) { } export default __QUASAR_SSR_SERVER__ - ? function (app, opts = {}, ssrContext) { + ? function (parentApp, opts = {}, ssrContext) { const $q = { version: __QUASAR_VERSION__, - config: Object.freeze(opts.config || {}) + config: opts.config || {} } ssrContext.$q = $q @@ -83,27 +84,34 @@ export default __QUASAR_SSR_SERVER__ bodyTags: '' }) - app.config.globalProperties.ssrContext = ssrContext + parentApp.config.globalProperties.ssrContext = ssrContext - prepareApp(app, opts, { - app, + prepareApp(parentApp, opts, { + parentApp, $q, - cfg: $q.config, lang: opts.lang, iconSet: opts.iconSet, ssrContext }) } - : function (app, opts = {}) { - const $q = { - version: __QUASAR_VERSION__, - config: Object.freeze(opts.config || {}) + : function (parentApp, opts = {}) { + const $q = { version: __QUASAR_VERSION__ } + + if (globalConfigIsFrozen === false) { + if (opts.config !== void 0) { + Object.assign(globalConfig, opts.config) + } + + $q.config = { ...globalConfig } + freezeGlobalConfig() + } + else { + $q.config = opts.config || {} } - prepareApp(app, opts, { - app, + prepareApp(parentApp, opts, { + parentApp, $q, - cfg: $q.config, lang: opts.lang, iconSet: opts.iconSet, onSSRHydrated: [] diff --git a/ui/src/lang.js b/ui/src/lang.js index db693e33005..5df7e441cfc 100644 --- a/ui/src/lang.js +++ b/ui/src/lang.js @@ -1,5 +1,4 @@ -import { reactive } from 'vue' - +import defineReactivePlugin from './utils/private/define-reactive-plugin.js' import langEn from '../lang/en-US.js' import { isRuntimeSsrPreHydration } from './plugins/Platform.js' @@ -23,7 +22,9 @@ function getLocale () { } } -const Plugin = { +const Plugin = defineReactivePlugin({ + __langPack: {} +}, { getLocale, set (langObject = langEn, ssrContext) { @@ -60,7 +61,7 @@ const Plugin = { lang.set = Plugin.set - Object.assign(Plugin.__q.lang, lang) + Object.assign(Plugin.__langPack, lang) Plugin.props = lang Plugin.isoName = lang.isoName @@ -68,11 +69,9 @@ const Plugin = { } }, - install (opts) { - const initialLang = opts.lang || langEn - + install ({ $q, lang, ssrContext }) { if (__QUASAR_SSR_SERVER__) { - const { $q, ssrContext } = opts + const initialLang = lang || langEn $q.lang = {} $q.lang.set = langObject => { @@ -89,12 +88,16 @@ const Plugin = { } } else { - opts.$q.lang = reactive({}) + $q.lang = Plugin.__langPack - this.__q = opts.$q - this.set(initialLang) + if (this.__installed === true) { + lang !== void 0 && this.set(lang) + } + else { + this.set(lang || langEn) + } } } -} +}) export default Plugin diff --git a/ui/src/plugins/AddressbarColor.js b/ui/src/plugins/AddressbarColor.js index d22a59e70b5..ddf910ee434 100644 --- a/ui/src/plugins/AddressbarColor.js +++ b/ui/src/plugins/AddressbarColor.js @@ -45,28 +45,28 @@ function setColor (hexColor) { } export default { - install ({ $q, cfg }) { + install ({ $q }) { $q.addressbarColor = this - if (this.__installed === true) { return } - - this.set = __QUASAR_SSR_SERVER__ !== true && Platform.is.mobile === true && ( - Platform.is.nativeMobile === true - || Platform.is.winphone === true || Platform.is.safari === true - || Platform.is.webkit === true || Platform.is.vivaldi === true - ) - ? hexColor => { - const val = hexColor || getCssVar('primary') + if (this.__installed !== true) { + this.set = __QUASAR_SSR_SERVER__ !== true && Platform.is.mobile === true && ( + Platform.is.nativeMobile === true + || Platform.is.winphone === true || Platform.is.safari === true + || Platform.is.webkit === true || Platform.is.vivaldi === true + ) + ? hexColor => { + const val = hexColor || getCssVar('primary') - if (Platform.is.nativeMobile === true && window.StatusBar) { - window.StatusBar.backgroundColorByHexString(val) + if (Platform.is.nativeMobile === true && window.StatusBar) { + window.StatusBar.backgroundColorByHexString(val) + } + else { + setColor(val) + } } - else { - setColor(val) - } - } - : noop + : noop + } - cfg.addressbarColor && this.set(cfg.addressbarColor) + $q.config.addressbarColor && this.set($q.config.addressbarColor) } } diff --git a/ui/src/plugins/BottomSheet.js b/ui/src/plugins/BottomSheet.js index 0250bf2b1a7..549c0ecb34f 100644 --- a/ui/src/plugins/BottomSheet.js +++ b/ui/src/plugins/BottomSheet.js @@ -2,12 +2,12 @@ import BottomSheet from '../components/dialog-bottom-sheet/BottomSheet.js' import globalDialog from '../utils/private/global-dialog.js' export default { - install (pluginOpts) { + install ({ $q, parentApp }) { if (this.__installed === true) { - pluginOpts.$q.bottomSheet = this.create + $q.bottomSheet = globalDialog(BottomSheet, false, parentApp) } else { - this.create = pluginOpts.$q.bottomSheet = globalDialog(BottomSheet, false, pluginOpts) + this.create = $q.bottomSheet = globalDialog(BottomSheet, false, parentApp) } } } diff --git a/ui/src/plugins/Cookies.js b/ui/src/plugins/Cookies.js index 84b95dc8c68..f8b806465cb 100644 --- a/ui/src/plugins/Cookies.js +++ b/ui/src/plugins/Cookies.js @@ -181,19 +181,13 @@ export function getObject (ssr) { } } -export default { - parseSSR (ssrContext) { - return ssrContext !== void 0 - ? getObject(ssrContext) - : this - }, - - install (opts) { +const Cookies = { + install ({ $q, ssrContext }) { if (__QUASAR_SSR_SERVER__) { - opts.$q.cookies = getObject(opts.ssrContext) + $q.cookies = getObject(ssrContext) } else { - opts.$q.cookies = this + $q.cookies = this if (this.__installed !== true) { Object.assign(this, getObject()) @@ -201,3 +195,13 @@ export default { } } } + +if (__QUASAR_SSR__) { + Cookies.parseSSR = ssrContext => { + if (ssrContext !== void 0) { + return getObject(ssrContext) + } + } +} + +export default Cookies diff --git a/ui/src/plugins/Dark.js b/ui/src/plugins/Dark.js index 3e21b67e14d..bfc897b316b 100644 --- a/ui/src/plugins/Dark.js +++ b/ui/src/plugins/Dark.js @@ -38,12 +38,12 @@ const Plugin = defineReactivePlugin({ } }, - install (opts) { - const { dark } = opts.cfg - this.isActive = dark === true + install ({ $q, onSSRHydrated, ssrContext }) { + const { dark } = $q.config if (__QUASAR_SSR_SERVER__) { - const { $q, ssrContext } = opts + this.isActive = dark === true + $q.dark = { isActive: false, mode: false, @@ -64,9 +64,13 @@ const Plugin = defineReactivePlugin({ return } - opts.$q.dark = this + $q.dark = this + + if (this.__installed === true && dark === void 0) { + return + } - if (this.__installed === true) { return } + this.isActive = dark === true const initialVal = dark !== void 0 ? dark : false @@ -80,7 +84,7 @@ const Plugin = defineReactivePlugin({ this.set = ssrSet ssrSet(initialVal) - opts.onSSRHydrated.push(() => { + onSSRHydrated.push(() => { this.set = originalSet this.set(this.__fromSSR) }) diff --git a/ui/src/plugins/Dialog.js b/ui/src/plugins/Dialog.js index 14802051855..675e6448392 100644 --- a/ui/src/plugins/Dialog.js +++ b/ui/src/plugins/Dialog.js @@ -2,12 +2,12 @@ import DialogPlugin from '../components/dialog-plugin/DialogPlugin.js' import globalDialog from '../utils/private/global-dialog.js' export default { - install (pluginOpts) { + install ({ $q, parentApp }) { if (this.__installed === true) { - pluginOpts.$q.dialog = this.create + $q.dialog = globalDialog(DialogPlugin, true, parentApp) } else { - this.create = pluginOpts.$q.dialog = globalDialog(DialogPlugin, true, pluginOpts) + this.create = $q.dialog = globalDialog(DialogPlugin, true, parentApp) } } } diff --git a/ui/src/plugins/Loading.js b/ui/src/plugins/Loading.js index ae9c382aacb..55cd361a74d 100644 --- a/ui/src/plugins/Loading.js +++ b/ui/src/plugins/Loading.js @@ -13,20 +13,20 @@ let timeout, props = {} -const - originalDefaults = { - delay: 0, - message: false, - html: false, - spinnerSize: 80, - spinnerColor: '', - messageColor: '', - backgroundColor: '', - boxClass: '', - spinner: QSpinner, - customClass: '' - }, - defaults = { ...originalDefaults } +const originalDefaults = { + delay: 0, + message: false, + html: false, + spinnerSize: 80, + spinnerColor: '', + messageColor: '', + backgroundColor: '', + boxClass: '', + spinner: QSpinner, + customClass: '' +} + +const defaults = { ...originalDefaults } const Plugin = defineReactivePlugin({ isActive: false @@ -52,7 +52,7 @@ const Plugin = defineReactivePlugin({ timeout = setTimeout(() => { timeout = void 0 - const el = createGlobalNode({ ...this.globalNodesCfg, id: 'q-loading' }) + const el = createGlobalNode('q-loading') app = createApp({ name: 'QLoading', @@ -139,16 +139,12 @@ const Plugin = defineReactivePlugin({ } }, - install ({ $q, cfg }) { + install ({ $q }) { $q.loading = this - if (this.__installed === true) { return } - - if (__QUASAR_SSR_SERVER__ !== true) { - this.setDefaults(cfg.loading) + if (__QUASAR_SSR_SERVER__ !== true && $q.config.loading !== void 0) { + this.setDefaults($q.config.loading) } - - this.globalNodesCfg = cfg.globalNodes } }) diff --git a/ui/src/plugins/LoadingBar.js b/ui/src/plugins/LoadingBar.js index 664fe9b2c82..3357a8be66a 100644 --- a/ui/src/plugins/LoadingBar.js +++ b/ui/src/plugins/LoadingBar.js @@ -17,23 +17,30 @@ export default defineReactivePlugin({ increment: noop, setDefaults: noop, - install ({ $q, cfg, app }) { + install ({ $q, parentApp }) { $q.loadingBar = this - if (__QUASAR_SSR_SERVER__ || this.__installed === true) { return } + if (__QUASAR_SSR_SERVER__) { return } + + if (this.__installed === true) { + if ($q.config.loadingBar !== void 0) { + this.setDefaults($q.config.loadingBar) + } + return + } const props = ref( - cfg.loadingBar !== void 0 - ? { ...cfg.loadingBar, ...reqProps } + $q.config.loadingBar !== void 0 + ? { ...$q.config.loadingBar, ...reqProps } : { ...reqProps } ) - const el = createGlobalNode({ ...cfg.globalNodes, id: 'q-loading-bar' }) + const el = createGlobalNode('q-loading-bar') const vm = createChildApp({ name: 'LoadingBar', setup: () => () => h(QAjaxBar, props.value) - }, app).mount(el) + }, parentApp).mount(el) Object.assign(this, { start: speed => { diff --git a/ui/src/plugins/Notify.js b/ui/src/plugins/Notify.js index d59f1815f3c..178118f554b 100644 --- a/ui/src/plugins/Notify.js +++ b/ui/src/plugins/Notify.js @@ -503,7 +503,7 @@ export default { } }, - install ({ $q, cfg, app: appInstance }) { + install ({ $q, parentApp }) { if (__QUASAR_SSR_SERVER__) { $q.notify = noop $q.notify.setDefaults = noop @@ -515,12 +515,14 @@ export default { $q.notify.setDefaults = this.setDefaults $q.notify.registerType = this.registerType - if (this.__installed === true) { return } + if ($q.config.notify !== void 0) { + this.setDefaults($q.config.notify) + } - this.setDefaults(cfg.notify) + if (this.__installed === true) { return } - const el = createGlobalNode({ ...cfg.globalNodes, id: 'q-notify' }) - const app = createChildApp(Notifications, appInstance) + const el = createGlobalNode('q-notify') + const app = createChildApp(Notifications, parentApp) vm = app.mount(el) } diff --git a/ui/src/plugins/Screen.js b/ui/src/plugins/Screen.js index dd7cfcacee1..79d418a0c06 100644 --- a/ui/src/plugins/Screen.js +++ b/ui/src/plugins/Screen.js @@ -41,14 +41,26 @@ export default defineReactivePlugin({ setSizes: noop, setDebounce: noop, - install (opts) { - opts.$q.screen = this + install ({ $q, onSSRHydrated }) { + $q.screen = this - if (__QUASAR_SSR_SERVER__ || this.__installed === true) { return } + if (__QUASAR_SSR_SERVER__) { return } - const classes = opts.cfg.screen !== void 0 && opts.cfg.screen.bodyClasses === true + if (this.__installed === true) { + if ($q.config.screen !== void 0) { + if ($q.config.screen.bodyClasses === false) { + document.body.classList.remove(`screen--${ this.name }`) + } + else { + this.__update(true) + } + } + return + } + + const classes = $q.config.screen !== void 0 && $q.config.screen.bodyClasses === true - const update = force => { + this.__update = force => { const w = window.innerWidth, h = window.innerHeight @@ -128,14 +140,14 @@ export default defineReactivePlugin({ this.sizes[ name ] = sizes[ name ] } }) - update(true) + this.__update(true) } this.setDebounce = delay => { updateEvt !== void 0 && target.removeEventListener('resize', updateEvt, passive) updateEvt = delay > 0 - ? debounce(update, delay) - : update + ? debounce(this.__update, delay) + : this.__update target.addEventListener('resize', updateEvt, passive) } @@ -146,7 +158,7 @@ export default defineReactivePlugin({ updateSizes = void 0 // free up memory } else { - update() + this.__update() } // due to optimizations, this would be left out otherwise @@ -155,7 +167,7 @@ export default defineReactivePlugin({ } if (isRuntimeSsrPreHydration === true) { - opts.onSSRHydrated.push(start) + onSSRHydrated.push(start) } else { start() diff --git a/ui/src/utils/private/global-config.js b/ui/src/utils/private/global-config.js new file mode 100644 index 00000000000..0eb3dbaaaf1 --- /dev/null +++ b/ui/src/utils/private/global-config.js @@ -0,0 +1,7 @@ + +export const globalConfig = {} +export let globalConfigIsFrozen = false + +export function freezeGlobalConfig () { + globalConfigIsFrozen = true +} diff --git a/ui/src/utils/private/global-dialog.js b/ui/src/utils/private/global-dialog.js index 536e7d9089c..a32c1a76e85 100644 --- a/ui/src/utils/private/global-dialog.js +++ b/ui/src/utils/private/global-dialog.js @@ -25,7 +25,7 @@ export function merge (target, source) { } } -export default function (DefaultComponent, supportsCustomComponent, pluginOpts) { +export default function (DefaultComponent, supportsCustomComponent, parentApp) { return pluginProps => { if (__QUASAR_SSR_SERVER__) { return ssrAPI } @@ -91,7 +91,7 @@ export default function (DefaultComponent, supportsCustomComponent, pluginOpts) } } - const el = createGlobalNode(pluginOpts.cfg.globalNodes) + const el = createGlobalNode() let emittedOK = false @@ -123,7 +123,7 @@ export default function (DefaultComponent, supportsCustomComponent, pluginOpts) onHide }) } - }, pluginOpts.app) + }, parentApp) let vm = app.mount(el) diff --git a/ui/src/utils/private/global-nodes.js b/ui/src/utils/private/global-nodes.js index 58d3aa1f9e9..a8144fee406 100644 --- a/ui/src/utils/private/global-nodes.js +++ b/ui/src/utils/private/global-nodes.js @@ -1,18 +1,21 @@ +import { globalConfig } from './global-config.js' + const globalNodes = [] let target = __QUASAR_SSR_SERVER__ ? void 0 : document.body -export function createGlobalNode (opts) { +export function createGlobalNode (id) { const el = document.createElement('div') - if (opts !== void 0) { - if (opts.id !== void 0) { - el.id = opts.id - } + if (id !== void 0) { + el.id = id + } - if (opts.class !== void 0) { - el.className = opts.class + if (globalConfig.globalNodes !== void 0) { + const cls = globalConfig.globalNodes.class + if (cls !== void 0) { + el.className = cls } }" 9293b6febf120fefe6668dd62050d3a6befe3702,2020-05-14 22:16:28,Popescu Dan,fix(QSelect): backspace should not remove selected options when hideSelected is used (no visual feedback) #7039 (#7042),False,backspace should not remove selected options when hideSelected is used (no visual feedback) #7039 (#7042),fix,"diff --git a/ui/src/components/select/QSelect.js b/ui/src/components/select/QSelect.js index a362086daf9..06ca78edd15 100755 --- a/ui/src/components/select/QSelect.js +++ b/ui/src/components/select/QSelect.js @@ -655,6 +655,7 @@ export default Vue.extend({ if ( e.keyCode === 8 && this.multiple === true && + this.hideSelected !== true && this.inputValue.length === 0 && Array.isArray(this.value) ) {" 74dd6cd6862a1773b1142a3e1acc74e6d3f88761,2019-01-28 14:26:52,Razvan Stoenescu,feat(docs): QMenu review,False,QMenu review,feat,"diff --git a/docs/src/components/page-parts/menu/MenuPositioning.vue b/docs/src/components/page-parts/menu/MenuPositioning.vue new file mode 100644 index 00000000000..4bb7dbd8423 --- /dev/null +++ b/docs/src/components/page-parts/menu/MenuPositioning.vue @@ -0,0 +1,113 @@ + + + + + diff --git a/docs/src/examples/QMarkupTable/Customization.vue b/docs/src/examples/QMarkupTable/Customization.vue index dc3f9803dde..abb5e75bd3e 100644 --- a/docs/src/examples/QMarkupTable/Customization.vue +++ b/docs/src/examples/QMarkupTable/Customization.vue @@ -8,10 +8,11 @@ -
Desserts
+
Treats
diff --git a/docs/src/examples/QMenu/Basic.vue b/docs/src/examples/QMenu/Basic.vue index 2b421502f54..dd97b7e259d 100644 --- a/docs/src/examples/QMenu/Basic.vue +++ b/docs/src/examples/QMenu/Basic.vue @@ -1,33 +1,32 @@ diff --git a/ui/src/components/uploader/QUploaderBase.js b/ui/src/components/uploader/QUploaderBase.js index 4a4b718bfb9..ae83a42dffa 100644 --- a/ui/src/components/uploader/QUploaderBase.js +++ b/ui/src/components/uploader/QUploaderBase.js @@ -75,6 +75,12 @@ export default { this.queuedFiles.length > 0 }, + canAddFiles () { + return this.editable && + this.isUploading !== true && + (this.multiple === true || this.queuedFiles.length === 0) + }, + extensions () { if (this.accept !== void 0) { return this.accept.split(',').map(ext => { @@ -381,9 +387,9 @@ export default { ]) ]), - this.__getBtn(h, this.editable && this.isUploading !== true && (this.multiple || this.queuedFiles.length === 0), 'add', this.pickFiles), - this.__getBtn(h, this.editable && this.hideUploadBtn === false && this.queuedFiles.length > 0, 'upload', this.upload), - this.__getBtn(h, this.editable && this.isUploading === true, 'clear', this.abort) + this.__getBtn(h, this.canAddFiles, 'add', this.pickFiles), + this.__getBtn(h, this.hideUploadBtn === false && this.canUpload === true, 'upload', this.upload), + this.__getBtn(h, this.isUploading, 'clear', this.abort) ]) }," 8dbe5e266616ac46fb800e172bba5998573d77f4,2019-12-23 22:19:53,Jeff Galbraith,feat(docs): multi-image slide with QCarousel (#5938),False,multi-image slide with QCarousel (#5938),feat,"diff --git a/docs/src/examples/QCarousel/MultiImageSlides.vue b/docs/src/examples/QCarousel/MultiImageSlides.vue new file mode 100644 index 00000000000..215a2a696dc --- /dev/null +++ b/docs/src/examples/QCarousel/MultiImageSlides.vue @@ -0,0 +1,52 @@ + + + diff --git a/docs/src/pages/vue-components/carousel.md b/docs/src/pages/vue-components/carousel.md index 84192e96c90..4e2dba98659 100644 --- a/docs/src/pages/vue-components/carousel.md +++ b/docs/src/pages/vue-components/carousel.md @@ -30,6 +30,7 @@ In the examples above, you can also swipe with your finger (or swiping with the ### Media content + " d7df6664d432383e3510e4b69a7269273d087454,2018-04-04 04:11:48,Razvan Stoenescu,chore: Update backers,False,Update backers,chore,"diff --git a/backers.md b/backers.md index 4180e757261..d271b058b6b 100644 --- a/backers.md +++ b/backers.md @@ -47,6 +47,7 @@ You can join them in supporting Quasar development by [pledging on Patreon](http - Bobby Ross - Nikolaj Frey - Netanel Edri +- Yatima Kagurazaka ---" cd1c79fa854cb669ff6014344e4de78a38c2a0fc,2024-03-08 16:32:38,Razvan Stoenescu,feat(docs): upgrade the q/app-vite beta upgrade guide,False,upgrade the q/app-vite beta upgrade guide,feat,"diff --git a/docs/src/pages/quasar-cli-vite/upgrade-guide.md b/docs/src/pages/quasar-cli-vite/upgrade-guide.md index 4c0a0efa9cb..5699551984e 100644 --- a/docs/src/pages/quasar-cli-vite/upgrade-guide.md +++ b/docs/src/pages/quasar-cli-vite/upgrade-guide.md @@ -33,6 +33,7 @@ api.compatibleWith( * Typescript detection is based on the quasar.config file being in TS form (quasar.config.ts) and tsconfig.json file presence. * feat+refactor(app-vite): ability to run multiple modes + dev/build simultaneously (huge effort!) * SSR and Electron modes now build in ESM format. +* Dropped support for our internal linting system (quasar.config file > eslint). Should use `vite-plugin-checker` instead. * **We will detail more breaking changes for each of the Quasar modes below**. ### Highlights on what's new @@ -70,6 +71,7 @@ Some of the work below has already been backported to the old @quasar/app-vite v * refactor(app-vite): the ""clean"" cmd now works different, since the CLI can be run in multiple instances on the same project folder (multiple modes on dev or build) * feat(app-vite): Support for Bun as package manager #16335 * feat(app-vite): for default /src-ssr template -> prod ssr -> on error, print err stack if built with debugging enabled +* feat(app-vite): extend build > vitePlugins form (additional { server?: boolean, client?: boolean } param ### Beginning of the upgrade process @@ -139,12 +141,144 @@ Preparations:
-* You might want to add the following to your `/.gitignore` file. These kind of files are left for inspection purposes when something fails with your `/quasar.config` file (and can be removed by the `quasar clean` command): +* You might want to add the following to your `/.gitignore` file. The `/quasar.config.*.temporary.compiled*` entry refers to files that are left for inspection purposes when something fails with your `/quasar.config` file (and can be removed by the `quasar clean` command): - ```bash /.gitignore + ```bash [highlight=8,11] /.gitignore + .DS_Store + .thumbs.db + node_modules + + # Quasar core related directories + .quasar + /dist /quasar.config.*.temporary.compiled* + + # local .env files + .env.local* + + # Cordova related directories and files + /src-cordova/node_modules + /src-cordova/platforms + /src-cordova/plugins + /src-cordova/www + + # Capacitor related directories and files + /src-capacitor/www + /src-capacitor/node_modules + + # Log files + npm-debug.log* + yarn-debug.log* + yarn-error.log* + + # Editor directories and files + .idea + *.suo + *.ntvs* + *.njsproj + *.sln ``` +### Linting (TS or JS) + +We dropped support for our internal linting (quasar.config file > eslint) in favor of the `vite-plugin-checker` package. We will detail below the changes that you need to make based on if you use TS or not. + +#### Typescript projects linting + +```tabs +<<| bash Yarn |>> +$ yarn add --dev vite-plugin-checker vue-tsc@^1.0.0 typescript@~5.3.0 +<<| bash NPM |>> +$ npm install --save-dev vite-plugin-checker vue-tsc@^1.0.0 typescript@~5.3.0 +<<| bash PNPM |>> +$ pnpm add -D vite-plugin-checker vue-tsc@^1.0.0 typescript@~5.3.0 +<<| bash Bun |>> +$ bun add --dev vite-plugin-checker vue-tsc@^1.0.0 typescript@~5.3.0 +``` + +::: warning +Notice the `typescript` dependency is <= 5.3. There is currently an issue with ESLint and newer TS (5.4+). This is only a temporary thing until upstream fixes it. +::: + +```bash [highlight=6,7] /.eslintignore +/dist +/src-capacitor +/src-cordova +/.quasar +/node_modules +.eslintrc.cjs +/quasar.config.*.temporary.compiled* +``` + +Create a new file called `tsconfig-vue-tsc.json` in the root of your project folder: + +```json /tsconfig-vue-tsc.json +{ + ""extends"": ""./tsconfig.json"", + ""compilerOptions"": { + ""skipLibCheck"": true + } +} +``` + +```diff /quasar.config file +- eslint: { +- // ... +- }, + + build: { + vitePlugins: [ ++ ['vite-plugin-checker', { ++ vueTsc: { ++ tsconfigPath: 'tsconfig-vue-tsc.json' ++ }, ++ eslint: { ++ lintCommand: 'eslint ""./**/*.{js,mjs,cjs,vue}""' ++ } ++ }, { server: false }] + ] + } +``` + +#### Javascript projects linting + +```tabs +<<| bash Yarn |>> +$ yarn add --dev vite-plugin-checker +<<| bash NPM |>> +$ npm install --save-dev vite-plugin-checker +<<| bash PNPM |>> +$ pnpm add -D vite-plugin-checker +<<| bash Bun |>> +$ bun add --dev vite-plugin-checker +``` + +```bash [highlight=6,7] /.eslintignore +/dist +/src-capacitor +/src-cordova +/.quasar +/node_modules +.eslintrc.cjs +/quasar.config.*.temporary.compiled* +``` + +```diff /quasar.config file +- eslint: { +- // ... +- }, + + build: { + vitePlugins: [ ++ ['vite-plugin-checker', { ++ eslint: { ++ lintCommand: 'eslint ""./**/*.{js,mjs,cjs,vue}""' ++ } ++ }, { server: false }] + ] + } +``` + ### SPA / Capacitor / Cordova modes changes * No need to change anything in the `/src`, `/src-capacitor` or `/src-cordova` folders." 59a61a8171196b25ef1f2dd8e98b9bf8fc33bc15,2022-06-16 22:30:39,Jade Jinyong Choi,feat(ui): Update ko-KR.js (#13620),False,Update ko-KR.js (#13620),feat,"diff --git a/ui/lang/ko-KR.js b/ui/lang/ko-KR.js index 2a0b2d78d96..1b10410c3d2 100644 --- a/ui/lang/ko-KR.js +++ b/ui/lang/ko-KR.js @@ -47,46 +47,46 @@ module.exports = { editor: { url: 'URL', bold: '굵게', - italic: '이탤릭', + italic: '기울이기', strikethrough: '취소선', underline: '밑줄', - unorderedList: '정렬되지 않은 목록', + unorderedList: '비순차 목록', orderedList: '순서 목록', subscript: '아래 첨자', superscript: '위 첨자', - hyperlink: '링크', + hyperlink: '하이퍼링크', toggleFullscreen: '전체 화면', quote: '따옴표', left: '왼쪽 정렬', center: '가운데 정렬', right: '오른쪽 정렬', - justify: '정렬', + justify: '세로 정렬', print: '출력', - outdent: '들여 쓰기 감소', - indent: '들여 쓰기 증가', + outdent: '들여 쓰기', + indent: '내어 쓰기', removeFormat: '포맷팅 제거', formatting: '포맷팅', - fontSize: '폰트 크기', - align: '정렬', - hr: '가로 룰 삽입', - undo: '되돌리기', - redo: '다시 하기', - heading1: '헤더 1', - heading2: '헤더 2', - heading3: '헤더 3', - heading4: '헤더 4', - heading5: '헤더 5', - heading6: '헤더 6', - paragraph: '절', + fontSize: '글꼴 크기', + align: '가로 정렬', + hr: '가로줄 넣기', + undo: '실행취소', + redo: '다시하기', + heading1: '제목 1', + heading2: '제목 2', + heading3: '제목 3', + heading4: '제목 4', + heading5: '제목 5', + heading6: '제목 6', + paragraph: '단락', code: '코드', - size1: '아주 작음', - size2: '작음', + size1: '매우 작게', + size2: '작게', size3: '보통', size4: '약간 크게', size5: '크게', size6: '아주 크게', size7: '최대', - defaultFont: '기본 폰트', + defaultFont: '기본 글꼴', viewSource: '소스보기' }, tree: {" 3f06a75ab6678dc2675a93824336c629921b62cc,2020-08-21 23:02:21,Razvan Stoenescu,"feat(QDate): ""@input"" details now contain year/month/day of date where user clicked/tapped even when adding/removing a range",False,"""@input"" details now contain year/month/day of date where user clicked/tapped even when adding/removing a range",feat,"diff --git a/ui/src/components/date/QDate.js b/ui/src/components/date/QDate.js index 0a8812d9cda..a4e73d11b90 100644 --- a/ui/src/components/date/QDate.js +++ b/ui/src/components/date/QDate.js @@ -1191,7 +1191,7 @@ export default Vue.extend({ const dayProps = this.days.find(day => day.fill !== true && day.i === dayIndex) if (dayProps.range !== void 0) { - this.__removeFromModel({ from: dayProps.range.from, to: dayProps.range.to }) + this.__removeFromModel({ target: day, from: dayProps.range.from, to: dayProps.range.to }) return } @@ -1220,7 +1220,7 @@ export default Vue.extend({ : { from: day, to: this.editRange.init } this.editRange = void 0 - this.__addToModel(initHash === finalHash ? day : payload) + this.__addToModel(initHash === finalHash ? day : { target: day, ...payload }) this.$emit('range-end', { from: this.__getPublicData(payload.from), @@ -1291,13 +1291,14 @@ export default Vue.extend({ ? { reason: `${action}-range`, details: { - from: { year: date.from.year, month: date.from.month, day: date.from.day }, - to: { year: date.to.year, month: date.to.month, day: date.to.day } + ...this.__getPublicData(date.target), + from: this.__getPublicData(date.from), + to: this.__getPublicData(date.to) } } : { reason: `${action}-day`, - details: { year: date.year, month: date.month, day: date.day } + details: this.__getPublicData(date) } }, diff --git a/ui/src/components/date/QDate.json b/ui/src/components/date/QDate.json index 21cbbfa629a..df81a6bd2f9 100644 --- a/ui/src/components/date/QDate.json +++ b/ui/src/components/date/QDate.json @@ -175,22 +175,22 @@ ""definition"": { ""year"": { ""type"": ""Number"", - ""desc"": ""The year of the date (if non-range)"", + ""desc"": ""The year of the date that the user has clicked/tapped on"", ""__exemption"": [ ""examples"" ] }, ""month"": { ""type"": ""Number"", - ""desc"": ""The month of the date (if non-range)"", + ""desc"": ""The month of the date that the user has clicked/tapped on"", ""__exemption"": [ ""examples"" ] }, ""day"": { ""type"": ""Number"", - ""desc"": ""The day of month (if non-range)"", + ""desc"": ""The day of the month that the user has clicked/tapped on"", ""__exemption"": [ ""examples"" ] }, ""from"": { ""type"": ""Object"", - ""desc"": ""Object of properties of the range starting point"", + ""desc"": ""Object of properties of the range starting point (only if range)"", ""definition"": { ""year"": { ""type"": ""Number"", @@ -212,7 +212,7 @@ }, ""to"": { ""type"": ""Object"", - ""desc"": ""Object of properties of the range ending point"", + ""desc"": ""Object of properties of the range ending point (only if range)"", ""definition"": { ""year"": { ""type"": ""Number""," 22512f092fe489552b8534324f068a3f22687014,2020-10-01 15:45:34,Razvan Stoenescu,feat(vue3): further various work on components,False,further various work on components,feat,"diff --git a/ui/src/components/drawer/QDrawer.js b/ui/src/components/drawer/QDrawer.js index 241bbe8ed25..9af68907946 100644 --- a/ui/src/components/drawer/QDrawer.js +++ b/ui/src/components/drawer/QDrawer.js @@ -378,7 +378,7 @@ export default defineComponent({ }, __applyBackdrop (x, retry) { - if (this.$refs.backdrop !== void 0) { + if (this.$refs.backdrop) { this.$refs.backdrop.style.backgroundColor = this.lastBackdropBg = `rgba(0,0,0,${x * 0.4})` } @@ -393,7 +393,7 @@ export default defineComponent({ }, __setBackdropVisible (v) { - if (this.$refs.backdrop !== void 0) { + if (this.$refs.backdrop) { this.$refs.backdrop.classList[v === true ? 'remove' : 'add']('hidden') } }, @@ -645,6 +645,8 @@ export default defineComponent({ }, created () { + this.lastBackdropBg = void 0 + this.layout.instances[this.side] = this this.__updateSizeOnLayout(this.miniToOverlay, this.size) this.__update('space', this.onLayout) diff --git a/ui/src/components/field/QField.js b/ui/src/components/field/QField.js index e0b6e20dc0e..91c69585729 100644 --- a/ui/src/components/field/QField.js +++ b/ui/src/components/field/QField.js @@ -465,8 +465,7 @@ export default defineComponent({ document.hasFocus() === true && ( this.hasPopupOpen === true || this.$refs === void 0 || - this.$refs.control === void 0 || - this.$refs.control === null || // TODO vue3 - temp, remove after portal transition is ready + !this.$refs.control || this.$refs.control.contains(document.activeElement) !== false ) ) { diff --git a/ui/src/components/input/QInput.js b/ui/src/components/input/QInput.js index 9cbc8b6fba7..01a5675878d 100644 --- a/ui/src/components/input/QInput.js +++ b/ui/src/components/input/QInput.js @@ -278,10 +278,7 @@ export default defineComponent({ delete this.temp.value this.type !== 'file' && this.$nextTick(() => { - if ( - this.$refs.input !== void 0 && - this.$refs.input !== null // TODO vue3 - temp, remove after portal transition is ready - ) { + if (this.$refs.input) { this.$refs.input.value = this.innerValue !== void 0 ? this.innerValue : '' } }) diff --git a/ui/src/components/menu/QMenu.js b/ui/src/components/menu/QMenu.js index 384c075c42b..4b82d88d6fb 100644 --- a/ui/src/components/menu/QMenu.js +++ b/ui/src/components/menu/QMenu.js @@ -256,16 +256,12 @@ export default defineComponent({ }, updatePosition () { - if ( - this.anchorEl === void 0 || - this.$refs.inner === void 0 || - this.$refs.inner === null // TODO vue3 - temp, remove after portal transition is ready - ) { + const el = this.$refs.inner + + if (this.anchorEl === void 0 || !el) { return } - const el = this.$refs.inner - if (el.nodeType === 8) { // IE replaces the comment with delay setTimeout(this.updatePosition, 25) return diff --git a/ui/src/components/tooltip/QTooltip.js b/ui/src/components/tooltip/QTooltip.js index eb35b165ab7..bb296014b25 100644 --- a/ui/src/components/tooltip/QTooltip.js +++ b/ui/src/components/tooltip/QTooltip.js @@ -117,16 +117,12 @@ export default defineComponent({ }, updatePosition () { - if ( - this.anchorEl === void 0 || - this.$refs.inner === void 0 || - this.$refs.inner === null // TODO vue3 - temp, remove after portal transition is ready - ) { + const el = this.$refs.inner + + if (this.anchorEl === void 0 || !el) { return } - const el = this.$refs.inner - if (el.nodeType === 8) { // IE replaces the comment with delay setTimeout(this.updatePosition, 25) return diff --git a/ui/src/mixins/virtual-scroll.js b/ui/src/mixins/virtual-scroll.js index 835955b6a11..4bfa6bd82a0 100644 --- a/ui/src/mixins/virtual-scroll.js +++ b/ui/src/mixins/virtual-scroll.js @@ -437,10 +437,7 @@ export default { __updateVirtualScrollSizes (from) { const contentEl = this.$refs.content - if ( - contentEl !== void 0 && - contentEl !== null // TODO vue3 - temp, remove after portal transition is ready - ) { + if (contentEl) { const children = slice.call(contentEl.children) .filter(el => el.classList.contains('q-virtual-scroll--skip') === false)," 184752781f0eb4f1df2245b1aceb9a697a145c51,2020-12-04 06:45:13,Rodrigo Vieira,feat(ui): Inset shadow down CSS helper class (#8143),False,Inset shadow down CSS helper class (#8143),feat,"diff --git a/docs/src/pages/style/shadows.md b/docs/src/pages/style/shadows.md index d7c6976ecb5..44db6e17289 100644 --- a/docs/src/pages/style/shadows.md +++ b/docs/src/pages/style/shadows.md @@ -10,7 +10,8 @@ The shadows are in accordance to Material Design specifications (24 levels of de | CSS Class Name | Description | | --- | --- | | `no-shadow` | Remove any shadow | -| `inset-shadow` | Set an inset shadow | +| `inset-shadow` | Set an inset shadow on top | +| `inset-shadow-down` | Set an inset shadow on bottom | | `shadow-1` | Set a depth of 1 | | `shadow-2` | Set a depth of 2 | | `shadow-N` | Where `N` is an integer from 1 to 24. | diff --git a/ui/dev/src/pages/css/shadows.vue b/ui/dev/src/pages/css/shadows.vue index 6219d0cc27c..43a402af374 100644 --- a/ui/dev/src/pages/css/shadows.vue +++ b/ui/dev/src/pages/css/shadows.vue @@ -13,11 +13,17 @@ .shadow-up-{{ n }}

- Inset Shadow + Inset Shadow on top

.inset-shadow
+

+ Inset Shadow on bottom +

+
+ .inset-shadow-down +
diff --git a/ui/src/css/core/elevation.sass b/ui/src/css/core/elevation.sass index 892d8dd8124..f97e2b390f6 100644 --- a/ui/src/css/core/elevation.sass +++ b/ui/src/css/core/elevation.sass @@ -11,6 +11,8 @@ box-shadow: none !important .inset-shadow box-shadow: $inset-shadow !important +.inset-shadow-down + box-shadow: $inset-shadow-down !important .z-marginals z-index: $z-marginals diff --git a/ui/src/css/core/elevation.styl b/ui/src/css/core/elevation.styl index 0972ae94ba3..2847faccae9 100644 --- a/ui/src/css/core/elevation.styl +++ b/ui/src/css/core/elevation.styl @@ -11,6 +11,8 @@ for $z in 1..24 box-shadow: none !important .inset-shadow box-shadow: $inset-shadow !important +.inset-shadow-down + box-shadow: $inset-shadow-down !important .z-marginals z-index: $z-marginals diff --git a/ui/src/css/variables.sass b/ui/src/css/variables.sass index 1d31392a228..e8790dd8e70 100644 --- a/ui/src/css/variables.sass +++ b/ui/src/css/variables.sass @@ -397,6 +397,7 @@ $z-max : 9998 !default $shadow-color : #000 !default $shadow-transition : box-shadow .28s cubic-bezier(.4, 0, .2, 1) !default $inset-shadow : 0 7px 9px -7px rgba($shadow-color, .7) inset !default +$inset-shadow-down : 0 -7px 9px -7px rgba($shadow-color, .7) inset !default $elevation-umbra : rgba($shadow-color, .2) !default $elevation-penumbra : rgba($shadow-color, .14) !default diff --git a/ui/src/css/variables.styl b/ui/src/css/variables.styl index 0274f8b43d4..a539315319b 100644 --- a/ui/src/css/variables.styl +++ b/ui/src/css/variables.styl @@ -484,6 +484,7 @@ $z-max ?= 9998 $shadow-color ?= black $shadow-transition ?= box-shadow .28s cubic-bezier(.4, 0, .2, 1) $inset-shadow ?= 0 7px 9px -7px rgba($shadow-color, .7) inset +$inset-shadow-down ?= 0 -7px 9px -7px rgba($shadow-color, .7) inset $elevation-umbra ?= rgba($shadow-color, .2) $elevation-penumbra ?= rgba($shadow-color, .14)" c81599e52e928dedd23c2f4a2cd40a2564785d77,2022-01-11 18:17:56,Yusuf Kandemir,fix: Use correct template path on issue workflow (#11983),False,Use correct template path on issue workflow (#11983),fix,"diff --git a/.github/workflows/process-created-issue.yml b/.github/workflows/process-created-issue.yml index dc1ce98a477..06ba3dae2a3 100644 --- a/.github/workflows/process-created-issue.yml +++ b/.github/workflows/process-created-issue.yml @@ -21,7 +21,7 @@ jobs: - uses: stefanbuck/github-issue-parser@v2 id: issue-parser with: - template-path: .github/ISSUE_TEMPLATE/${{ env.TEMPLATE_TYPE }}-report--${{ env.TEMPLATE_VERSION }}.yml + template-path: .github/ISSUE_TEMPLATE/${{ env.TEMPLATE_TYPE }}-report--quasar-${{ env.TEMPLATE_VERSION }}.yml - uses: actions/github-script@v5 env:" 2a4fa79cd7bae5f4fcdc4544a7809697fa871b3d,2019-10-18 16:10:14,Razvan Stoenescu,feat(app/capacitor): devserver HTTPS support for iOS,False,devserver HTTPS support for iOS,feat,"diff --git a/app/lib/capacitor/capacitor-config.js b/app/lib/capacitor/capacitor-config.js index 60463a02fb6..0ca941bf63d 100644 --- a/app/lib/capacitor/capacitor-config.js +++ b/app/lib/capacitor/capacitor-config.js @@ -101,6 +101,144 @@ class CapacitorConfig { fs.writeFileSync(capPkgPath, JSON.stringify(capPkg, null, 2), 'utf-8') } + + prepareSSL (add, target) { + if (target === 'ios') { + this.__handleSSLonIOS(add) + } + else { + this.__handleSSLonAndroid() + } + } + + __handleSSLonIOS (add) { + const + file = appPaths.resolve.capacitor('node_modules/@capacitor/ios/ios/Capacitor/Capacitor/CAPBridgeViewController.swift'), + needle = 'public func getWebView() -> WKWebView {', + content = ` + // The following part was dynamically added by Quasar. + // This should NOT be part of the app when building for production, + // and it will be removed by Quasar automatically on ""quasar build"": + public func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { + let cred = URLCredential(trust: challenge.protectionSpace.serverTrust!) + completionHandler(.useCredential, cred) + } + + ` + + if (add) { + this.__injectIntoFile(file, needle, content) + } + else { + this.__removeFromFile(file, content) + } + } + + __injectIntoFile (file, needle, content) { + const shortFilename = path.basename(file) + + const sslWarn = () => { + warn() + warn() + warn() + warn() + warn(`${shortFilename} not found or content is unrecognized.`) + warn(`Your App will revoke the devserver's SSL certificate.`) + warn(`Please disable HTTPS from quasar.conf.js > devServer > https`) + warn() + warn() + warn() + warn() + } + + if (!fs.existsSync(file)) { + sslWarn() + return + } + + const originalContent = fs.readFileSync(file, 'utf-8') + + if (originalContent.indexOf(content) > -1) { + // it's already there + return + } + + const index = originalContent.indexOf(needle) + + if (index === -1) { + sslWarn() + return + } + + const newContent = originalContent.substring(0, index) + content + originalContent.substring(index) + + fs.writeFileSync(file, newContent, 'utf-8') + } + + __removeFromFile (file, content) { + if (!fs.existsSync(file)) { + return + } + + const originalContent = fs.readFileSync(file, 'utf-8') + const index = originalContent.indexOf(content) + + if (index > -1) { + const newContent = originalContent.replace(content, '') + fs.writeFileSync(file, newContent, 'utf-8') + } + } + + __handleSSLonAndroid () { + const mainActivityPath = appPaths.resolve.capacitor( + 'android/app/src/main/java/org/cordova/quasar/app/MainActivity.java' + ) + const enableHttpsSelfSignedPath = appPaths.resolve.capacitor( + 'android/app/src/main/java/org/cordova/quasar/app/EnableHttpsSelfSigned.java' + ) + + if (fs.existsSync(mainActivityPath)) { + // Allow unsigned certificates in MainActivity + let mainActivity = fs.readFileSync(mainActivityPath, 'utf8') + + if (!/EnableHttpsSelfSigned\.enable/.test(mainActivity)) { + mainActivity = mainActivity.replace( + /this\.init\(.*}}\);/ms, + match => `${match} + if (BuildConfig.DEBUG) { + EnableHttpsSelfSigned.enable(findViewById(R.id.webview)); + } + ` + ) + + fs.writeFileSync(mainActivityPath, mainActivity, 'utf-8') + } + + // Add helper file + if (!fs.existsSync(enableHttpsSelfSignedPath)) { + const appId = mainActivity.match(/package ([a-zA-Z\.]*);/)[1] + fs.writeFileSync( + enableHttpsSelfSignedPath, + ` +package ${appId}; +import android.net.http.SslError; +import android.webkit.SslErrorHandler; +import android.webkit.WebView; +import android.webkit.WebViewClient; +public class EnableHttpsSelfSigned { + public static void enable(WebView webview) { + webview.setWebViewClient(new WebViewClient() { + @Override + public void onReceivedSslError(WebView view, final SslErrorHandler handler, SslError error) { + handler.proceed(); + } + }); + } +}` + ) + } + } + } } module.exports = CapacitorConfig diff --git a/app/lib/capacitor/index.js b/app/lib/capacitor/index.js index e712e5022b1..44690d5c092 100644 --- a/app/lib/capacitor/index.js +++ b/app/lib/capacitor/index.js @@ -47,6 +47,9 @@ class CapacitorRunner { this.config.prepare(cfg) await this.__runCapacitorCommand(['sync', this.target]) + + this.config.prepareSSL(cfg.devServer.https, this.target) + await openIde('capacitor', cfg.bin, this.target, true) } @@ -57,6 +60,8 @@ class CapacitorRunner { await this.__runCapacitorCommand(['sync', this.target]) + this.config.prepareSSL(false, this.target) + if (argv['skip-pkg'] === true) { return } diff --git a/app/lib/quasar-config.js b/app/lib/quasar-config.js index fe33b2aacac..fc55bbcbcbf 100644 --- a/app/lib/quasar-config.js +++ b/app/lib/quasar-config.js @@ -594,13 +594,6 @@ class QuasarConfig { if (this.ctx.mode.cordova || this.ctx.mode.capacitor || this.ctx.mode.electron) { cfg.devServer.open = false - if (cfg.devServer.https === true && this.ctx.mode.capacitor) { - console.log(` ⚠️ `) - console.log(` ⚠️ Capacitor does not currently supports HTTPS protocol. Please disable it from quasar.conf.js > devServer > https`) - console.log(` ⚠️ `) - console.log() - } - if (this.ctx.mode.electron) { cfg.devServer.https = false }" f113ba6c99f46ca7aa1bce500511274ac7c95940,2016-02-06 01:23:07,Razvan Stoenescu,chore: Small update to Preview main layout,False,Small update to Preview main layout,chore,"diff --git a/preview/src/layouts/main/layout.main.html b/preview/src/layouts/main/layout.main.html index 616b813874f..09e8a8c3c5d 100644 --- a/preview/src/layouts/main/layout.main.html +++ b/preview/src/layouts/main/layout.main.html @@ -23,10 +23,12 @@ --> + diff --git a/docs/src/components/page-parts/tooltip/TooltipPositioning.vue b/docs/src/components/page-parts/tooltip/TooltipPositioning.vue index 313cb0d500c..06a4a3fa5fe 100644 --- a/docs/src/components/page-parts/tooltip/TooltipPositioning.vue +++ b/docs/src/components/page-parts/tooltip/TooltipPositioning.vue @@ -44,7 +44,7 @@ q-card(flat, bordered) q-separator - .q-pa-md.relative-position + .q-pa-md.relative-position.bg-grey-2 doc-code(lang=""html"", :code=""tooltipExport"") " e25a362dbfbe32ab3d96856ed96db9417daf5392,2020-09-28 16:13:12,Razvan Stoenescu,fix(Notify): setDefaults() with type does not works correctly #7830,False,setDefaults() with type does not works correctly #7830,fix,"diff --git a/ui/src/plugins/Notify.js b/ui/src/plugins/Notify.js index 84e489fb660..5cc8d1ab969 100644 --- a/ui/src/plugins/Notify.js +++ b/ui/src/plugins/Notify.js @@ -88,25 +88,22 @@ const Notifications = { let Api const notif = { textColor: 'white' } - if (typeof config === 'string' || config.ignoreDefaults !== true) { + if (config.ignoreDefaults !== true) { Object.assign(notif, defaults) } - if (Object(config) === config) { - Object.assign(notif, notifTypes[config.type], config) - - if (typeof notif.icon === 'function') { - notif.icon = notif.icon.call(this) + if (Object(config) !== config) { + if (notif.type) { + Object.assign(notif, notifTypes[notif.type]) } + + config = { message: config } } - else { - notif.message = config - if (notif.group === false) { - // maybe it'll get updated, and - // we need config as an Object - config = { message: config } - } + Object.assign(notif, notifTypes[config.type || notif.type], config) + + if (typeof notif.icon === 'function') { + notif.icon = notif.icon.call(this) } if (notif.spinner === void 0) {"