Browse Source

Pull request #2728: DESIGN-3918 feat: toast新增loading效果

Merge in VISUAL/fineui from ~DAILER/fineui:master to master

* commit '7229faac6a1dd7a506ebac47ce1ed97a96799512':
  DESIGN-3918 feat: toast新增loading效果
  DESIGN-3918 feat: toast新增loading效果
  DESIGN-3918 feat: toast新增loading效果
  DESIGN-3918 feat: toast新增loading效果
es6
Dailer 3 years ago
parent
commit
d4f962e969
  1. 3
      src/base/single/tip/tip.toast.js
  2. 7
      src/less/base/single/tip/tip.toast.less
  3. 1
      src/less/lib/font.less
  4. 1
      src/less/resource/font.less
  5. 8
      typescript/base/foundation/message.ts

3
src/base/single/tip/tip.toast.js

@ -56,6 +56,9 @@ BI.Toast = BI.inherit(BI.Tip, {
case "warning":
cls = "toast-warning-font";
break;
case "loading":
cls = "toast-loading-font anim-rotate";
break;
case "normal":
default:
cls = "toast-message-font";

7
src/less/base/single/tip/tip.toast.less

@ -4,18 +4,23 @@
color: @color-bi-color-toast-text;
line-height: @font-size-16;
.border-radius(2px);
&.toast-success {
background: @color-bi-background-toast-success;
}
&.toast-warning {
background: @color-bi-background-toast-warning;
}
&.toast-error {
background: @color-bi-background-toast-error;
}
&.toast-normal, &.toast-common{
&.toast-normal, &.toast-common, &.toast-loading {
background: @color-bi-background-toast-normal;
}
& .toast-icon {
font-size: @font-size-16;
}

1
src/less/lib/font.less

@ -51,6 +51,7 @@
@font-tip-success: "e1db";
@font-tip-warning: "e1d7";
@font-tip-message: "e1d9";
@font-tip-loading: "e7cd";
@font-key: "e1d0";

1
src/less/resource/font.less

@ -86,6 +86,7 @@
.font(toast-success-font, @font-tip-success, @color-bi-color-toast-success);
.font(toast-warning-font, @font-tip-warning, @color-bi-color-toast-warning);
.font(toast-message-font, @font-tip-message, @color-bi-color-toast-normal);
.font(toast-loading-font, @font-tip-loading, @color-bi-color-toast-normal);
//数值区间
.font(less-font, @font-less);

8
typescript/base/foundation/message.ts

@ -1,6 +1,12 @@
type toastOptions = {
level: "success" | "warning" | "error" | "normal" | "loading"
autoClose?: boolean
callback?: Function
}
export type _msg = {
alert: (title: string, message?: string | { [key: string]: any }, callback?: (result?: boolean) => void) => void
confirm: (title: string, message?: string | { [key: string]: any }, callback?: (result: boolean) => void) => void
prompt: (title: string, message?: string, value?: any, callback?: (result: string) => void, minWidth?: number) => void
toast: (message: string, options?: object | string, context?: HTMLElement) => void
toast: (message: string | Obj, options?: toastOptions | string, context?: HTMLElement) => void
}

Loading…
Cancel
Save