Skip to content

Commit

Permalink
feat(QInput, QChipsInput, QUploader): Add custom loading slot as QBtn (
Browse files Browse the repository at this point in the history
  • Loading branch information
jcperez-ch authored and rstoenescu committed Sep 17, 2018
1 parent 2763455 commit 0e253cc
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 15 deletions.
17 changes: 12 additions & 5 deletions src/components/chips-input/QChipsInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,18 @@ export default {
])),

this.isLoading
? h(QSpinner, {
slot: 'after',
staticClass: 'q-if-control',
props: { size: '24px' }
})
? (
this.$slots.loading
? h('div', {
staticClass: 'q-if-control',
slot: 'after'
}, this.$slots.loading)
: h(QSpinner, {
slot: 'after',
staticClass: 'q-if-control',
props: { size: '24px' }
})
)
: ((this.editable && h(QIcon, {
slot: 'after',
staticClass: 'q-if-control',
Expand Down
15 changes: 10 additions & 5 deletions src/components/input/QInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,11 +397,16 @@ export default {
}
})) || void 0,

(this.isLoading && h(QSpinner, {
slot: 'after',
staticClass: 'q-if-control',
props: { size: '24px' }
})) || void 0
(this.isLoading && (this.$slots.loading
? h('div', {
staticClass: 'q-if-control',
slot: 'after'
}, this.$slots.loading)
: h(QSpinner, {
slot: 'after',
staticClass: 'q-if-control',
props: { size: '24px' }
}))) || void 0
]).concat(this.$slots.after).concat(this.$slots.default
? h('div', { staticClass: 'absolute-full no-pointer-events', slot: 'after' }, this.$slots.default)
: void 0
Expand Down
15 changes: 10 additions & 5 deletions src/components/uploader/QUploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,11 +435,16 @@ export default {

if (this.uploading) {
child.push(
h(QSpinner, {
slot: 'after',
staticClass: 'q-if-end self-center',
props: { size: '24px' }
}),
this.$slots.loading
? h('div', {
slot: 'after',
staticClass: 'q-if-end self-center q-if-control'
}, this.$slots.loading)
: h(QSpinner, {
slot: 'after',
staticClass: 'q-if-end self-center',
props: { size: '24px' }
}),
h(QIcon, {
slot: 'after',
staticClass: 'q-if-end self-center q-if-control',
Expand Down

0 comments on commit 0e253cc

Please sign in to comment.