From a9f41e3a1758aa534fc616272dc7213c4bcc0528 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 24 May 2022 16:43:42 +0800 Subject: [PATCH 1/4] =?UTF-8?q?DESIGN-3918=20feat:=20toast=E6=96=B0?= =?UTF-8?q?=E5=A2=9Eloading=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/tip/tip.toast.js | 3 +++ src/less/base/single/tip/tip.toast.less | 17 +++++++++++------ src/less/lib/font.less | 1 + src/less/resource/font.less | 1 + 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/base/single/tip/tip.toast.js b/src/base/single/tip/tip.toast.js index ffbf2b336..bf00dc014 100644 --- a/src/base/single/tip/tip.toast.js +++ b/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"; diff --git a/src/less/base/single/tip/tip.toast.less b/src/less/base/single/tip/tip.toast.less index 875dfa586..4e33930ac 100644 --- a/src/less/base/single/tip/tip.toast.less +++ b/src/less/base/single/tip/tip.toast.less @@ -1,22 +1,27 @@ @import "../../../index.less"; -.bi-toast{ +.bi-toast { color: @color-bi-color-toast-text; line-height: @font-size-16; .border-radius(2px); - &.toast-success{ + + &.toast-success { background: @color-bi-background-toast-success; } - &.toast-warning{ + + &.toast-warning { background: @color-bi-background-toast-warning; } - &.toast-error{ + + &.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{ + + & .toast-icon { font-size: @font-size-16; } } diff --git a/src/less/lib/font.less b/src/less/lib/font.less index d4760ec0e..ce865e30e 100644 --- a/src/less/lib/font.less +++ b/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"; diff --git a/src/less/resource/font.less b/src/less/resource/font.less index a6551f864..be6730eca 100644 --- a/src/less/resource/font.less +++ b/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); From c76dee91695f78951f44bfa4232942d61d44deba Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 24 May 2022 16:50:09 +0800 Subject: [PATCH 2/4] =?UTF-8?q?DESIGN-3918=20feat:=20toast=E6=96=B0?= =?UTF-8?q?=E5=A2=9Eloading=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/foundation/message.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/typescript/base/foundation/message.ts b/typescript/base/foundation/message.ts index 63790d1cb..5f847653f 100644 --- a/typescript/base/foundation/message.ts +++ b/typescript/base/foundation/message.ts @@ -1,6 +1,12 @@ +type toastOptions = { + level: "success" | "warning" | "error" | "common" | "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 + 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?: toastOptions | string, context?: HTMLElement) => void } From 877946c848c24c4a116c82a5f913effa72dee4b2 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 24 May 2022 16:51:51 +0800 Subject: [PATCH 3/4] =?UTF-8?q?DESIGN-3918=20feat:=20toast=E6=96=B0?= =?UTF-8?q?=E5=A2=9Eloading=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/foundation/message.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/base/foundation/message.ts b/typescript/base/foundation/message.ts index 5f847653f..732375e4e 100644 --- a/typescript/base/foundation/message.ts +++ b/typescript/base/foundation/message.ts @@ -8,5 +8,5 @@ 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?: toastOptions | string, context?: HTMLElement) => void + toast: (message: string | Obj, options?: toastOptions | string, context?: HTMLElement) => void } From 7229faac6a1dd7a506ebac47ce1ed97a96799512 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 24 May 2022 16:55:37 +0800 Subject: [PATCH 4/4] =?UTF-8?q?DESIGN-3918=20feat:=20toast=E6=96=B0?= =?UTF-8?q?=E5=A2=9Eloading=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- typescript/base/foundation/message.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typescript/base/foundation/message.ts b/typescript/base/foundation/message.ts index 732375e4e..e1506c35a 100644 --- a/typescript/base/foundation/message.ts +++ b/typescript/base/foundation/message.ts @@ -1,5 +1,5 @@ type toastOptions = { - level: "success" | "warning" | "error" | "common" | "loading" + level: "success" | "warning" | "error" | "normal" | "loading" autoClose?: boolean callback?: Function }