mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 23:07:28 +08:00
DEV: add toast progress bar to styleguide (#26767)
This commit is contained in:
@ -61,6 +61,12 @@
|
|||||||
{{on "click" this.toggleAutoClose}}
|
{{on "click" this.toggleAutoClose}}
|
||||||
/>
|
/>
|
||||||
</Styleguide::Controls::Row>
|
</Styleguide::Controls::Row>
|
||||||
|
<Styleguide::Controls::Row @name="[@options.showProgressBar]">
|
||||||
|
<DToggleSwitch
|
||||||
|
@state={{this.showProgressBar}}
|
||||||
|
{{on "click" this.toggleShowProgressBar}}
|
||||||
|
/>
|
||||||
|
</Styleguide::Controls::Row>
|
||||||
{{#if this.autoClose}}
|
{{#if this.autoClose}}
|
||||||
<Styleguide::Controls::Row @name="[@options.duration] ms">
|
<Styleguide::Controls::Row @name="[@options.duration] ms">
|
||||||
<Input @value={{this.duration}} @type="number" />
|
<Input @value={{this.duration}} @type="number" />
|
||||||
|
@ -12,6 +12,7 @@ export default class Toasts extends Component {
|
|||||||
@tracked message = "Message";
|
@tracked message = "Message";
|
||||||
@tracked duration = TOAST.options.duration;
|
@tracked duration = TOAST.options.duration;
|
||||||
@tracked autoClose = TOAST.options.autoClose;
|
@tracked autoClose = TOAST.options.autoClose;
|
||||||
|
@tracked showProgressBar = TOAST.options.showProgressBar;
|
||||||
@tracked class;
|
@tracked class;
|
||||||
@tracked action = true;
|
@tracked action = true;
|
||||||
@tracked icon;
|
@tracked icon;
|
||||||
@ -48,6 +49,7 @@ export default class Toasts extends Component {
|
|||||||
this.toasts[theme]({
|
this.toasts[theme]({
|
||||||
duration: this.duration,
|
duration: this.duration,
|
||||||
autoClose: this.autoClose,
|
autoClose: this.autoClose,
|
||||||
|
showProgressBar: this.showProgressBar,
|
||||||
class: this.class,
|
class: this.class,
|
||||||
data: {
|
data: {
|
||||||
title: this.title,
|
title: this.title,
|
||||||
@ -67,4 +69,9 @@ export default class Toasts extends Component {
|
|||||||
toggleAutoClose() {
|
toggleAutoClose() {
|
||||||
this.autoClose = !this.autoClose;
|
this.autoClose = !this.autoClose;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@action
|
||||||
|
toggleShowProgressBar() {
|
||||||
|
this.showProgressBar = !this.showProgressBar;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user