From ea5b41bb0e5a59fb295f900b2412c7616f54f42b Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 15 Jul 2022 09:11:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?BI-109153=20feat:=20bi=E5=B7=A5=E7=A8=8B?= =?UTF-8?q?=E5=86=85=EF=BC=8C=E5=9B=A0=E4=B8=BA=E7=A6=81=E7=94=A8=E8=80=8C?= =?UTF-8?q?=E7=BD=AE=E7=81=B0=E7=9A=84=E6=8C=89=E9=92=AE=EF=BC=8C=20?= =?UTF-8?q?=E5=AF=B9=E5=BA=94=E7=9A=84tooltip=E8=A6=81=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E5=BA=95=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/0.single.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js index 9b4b4d118..88e32f29b 100644 --- a/src/base/single/0.single.js +++ b/src/base/single/0.single.js @@ -30,7 +30,7 @@ BI.Single = BI.inherit(BI.Widget, { if (BI.isPlainObject(title)) { tooltipOpt = title; } else { - tooltipOpt.level = this.getTipType() || (this.isEnabled() ? "success" : "warning"); + tooltipOpt.level = this.getTipType() || "success"; tooltipOpt.text = tooltipOpt.level === "success" ? title : (this.getWarningTitle() || title); } if (BI.isKey(tooltipOpt.text)) { From 220ac9a53ff462c22863d7e2fc6b21aa10dbe34e Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 15 Jul 2022 09:11:22 +0800 Subject: [PATCH 2/3] update ts --- typescript/core/base.ts | 108 ++++++++++++++++++++-------------------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/typescript/core/base.ts b/typescript/core/base.ts index 1d6022a1c..b5a3ce55c 100644 --- a/typescript/core/base.ts +++ b/typescript/core/base.ts @@ -1,7 +1,7 @@ import { _Widget } from "./widget"; export interface _base { - assert: (v: any, is: Function) => Boolean + assert: (v: any, is: Function) => Boolean; warn: (message: any) => Boolean; @@ -15,62 +15,62 @@ export interface _base { packageItems: (items: any[], layouts: any[]) => any[]; - formatEL: (obj: T) => {el: T} | T + formatEL: (obj: T) => { el: T } | T; - stripEL: (obj: {el: T} | T) => T; + stripEL: (obj: { el: T } | T) => T; trans2Element: (widgets: any[]) => any[]; // 集合相关方法 - where: (collection: any[]|object|string, source: object) => any[]; + where: (collection: any[] | object | string, source: object) => any[]; - findWhere: (collection: any[]|object|string, callback?: Function|object|string, thisArg?: any) => object|undefined; + findWhere: (collection: any[] | object | string, callback?: Function | object | string, thisArg?: any) => object | undefined; - invoke: (collection: any[]|object|string, methodName: Function|string, arg?: any) => any[]; + invoke: (collection: any[] | object | string, methodName: Function | string, arg?: any) => any[]; - pluck: (collection: any[]|object|string, property: string) => any[]; + pluck: (collection: any[] | object | string, property: string) => any[]; - shuffle: (collection: any[]|object|string) => any[]; + shuffle: (collection: any[] | object | string) => any[]; - sample: (collection: any[]|object|string, n?: number) => any[]; + sample: (collection: any[] | object | string, n?: number) => any[]; - toArray: (collection: any[]|object|string) => any[]; + toArray: (collection: any[] | object | string) => any[]; size: (collection: any) => number; - each: (collection: T[]|object|string, callback?: ((index: number, value: T) => void)|object|string, thisArg?: any) => any; + each: (collection: T[] | object | string, callback?: ((index: number, value: T) => void) | object | string, thisArg?: any) => any; - map: (collection: T[]|object|string|null|undefined, callback?: ((index: number, value: T) => U)|object|string, thisArg?: any) => U[]; + map: (collection: T[] | object | string | null | undefined, callback?: ((index: number, value: T) => U) | object | string, thisArg?: any) => U[]; - reduce: (collection: T[]|object|string, callback?: ((total: U extends T ? U : T, currentValue: T, currentIndex: number) => U extends T ? U : T)|object|string, initialValue?: U|T) => U extends T ? U : T; + reduce: (collection: T[] | object | string, callback?: ((total: U extends T ? U : T, currentValue: T, currentIndex: number) => U extends T ? U : T) | object | string, initialValue?: U | T) => U extends T ? U : T; - reduceRight: (collection: T[]|object|string, callback?: ((total: U extends T ? U : T, currentValue: T, currentIndex: number) => U extends T ? U : T)|object|string, initialValue?: U|T) => U extends T ? U : T; + reduceRight: (collection: T[] | object | string, callback?: ((total: U extends T ? U : T, currentValue: T, currentIndex: number) => U extends T ? U : T) | object | string, initialValue?: U | T) => U extends T ? U : T; - find: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => T | undefined; + find: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => T | undefined; - filter: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => T[]; + filter: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => T[]; - reject: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => T[]; + reject: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => T[]; - every: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => boolean; + every: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => boolean; - all: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => boolean; + all: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => boolean; - some: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => boolean; + some: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => boolean; - any: (collection: T[]|object|string, callback?: ((index: number, value: T) => boolean)|object|string, thisArg?: any) => boolean; + any: (collection: T[] | object | string, callback?: ((index: number, value: T) => boolean) | object | string, thisArg?: any) => boolean; max: (collection: T[]) => T; min: (collection: T[]) => T; - sortBy: (collection: any[]|object|string, callback?: ((index: number, value: T) => number)|object|string, thisArg?: any) => any[]; + sortBy: (collection: any[] | object | string, callback?: ((index: number, value: T) => number) | object | string, thisArg?: any) => any[]; - groupBy: (collection: any[]|object|string, callback?: ((index: number, value: T) => any)|object|string, thisArg?: any) => object; + groupBy: (collection: any[] | object | string, callback?: ((index: number, value: T) => any) | object | string, thisArg?: any) => object; - indexBy: (collection: any[]|object|string, callback?: ((index: number, value: T) => any)|object|string, thisArg?: any) => object; + indexBy: (collection: any[] | object | string, callback?: ((index: number, value: T) => any) | object | string, thisArg?: any) => object; - countBy: (collection: any[]|object|string, callback?: ((index: number, value: T) => any)|object|string, thisArg?: any) => object; + countBy: (collection: any[] | object | string, callback?: ((index: number, value: T) => any) | object | string, thisArg?: any) => object; count: (from: number, to: number, predicate: Function) => number; @@ -99,7 +99,7 @@ export interface _base { remove: (obj: any, predicate: any, context?: any) => void; - removeAt: (obj: any, index: number|number[]) => void; + removeAt: (obj: any, index: number | number[]) => void; string2Array: (str: string) => string[]; @@ -110,17 +110,17 @@ export interface _base { int2Abc: (num: number) => string; // 数组相关的方法 - first: (array: T[], callback?: Function|object|number|string, thisArg?: any) => T; + first: (array: T[], callback?: Function | object | number | string, thisArg?: any) => T; - initial: (array: T[], callback?: Function|object|number|string, thisArg?: any) => T[]; + initial: (array: T[], callback?: Function | object | number | string, thisArg?: any) => T[]; - last: (array: T[], callback?: Function|object|number|string, thisArg?: any) => T; + last: (array: T[], callback?: Function | object | number | string, thisArg?: any) => T; - rest: (array: T[], callback?: Function|object|number|string, thisArg?: any) => T[]; + rest: (array: T[], callback?: Function | object | number | string, thisArg?: any) => T[]; compact: (array: any[]) => any[]; - flatten: (array: any[], isShallow?: boolean, callback?: Function|object|string, thisArg?: any) => any[]; + flatten: (array: any[], isShallow?: boolean, callback?: Function | object | string, thisArg?: any) => any[]; without: (array: any[], value?: any) => any[]; @@ -140,7 +140,7 @@ export interface _base { lastIndexOf: (array: any[], value: any, fromIndex?: number) => number; - sortedIndex: (array: any[], value: any, callback?: Function|object|string, thisArg?: any) => number; + sortedIndex: (array: any[], value: any, callback?: Function | object | string, thisArg?: any) => number; range: (start: number, end: number, step: number) => number[]; @@ -148,9 +148,9 @@ export interface _base { takeRight: (array: T[], n: number) => T[]; - findIndex: (array: any[], value: any, callback?: Function|object|string, thisArg?: any) => number; + findIndex: (array: any[], value: any, callback?: Function | object | string, thisArg?: any) => number; - findLastIndex: (array: any[], value: any, callback?: Function|object|string, thisArg?: any) => number; + findLastIndex: (array: any[], value: any, callback?: Function | object | string, thisArg?: any) => number; makeArray: (length: number, value?: T) => number[] | T[]; @@ -181,7 +181,7 @@ export interface _base { clone: (object: T) => T; - property: (path: any[]|string) => Function; + property: (path: any[] | string) => Function; propertyOf: (object: object) => Function; @@ -189,7 +189,7 @@ export interface _base { isMatch: (object: object, source: object, customizer?: Function, thisArg?: any) => boolean; - isEmpty: (value: any[]|object|string|null|undefined|number) => boolean; + isEmpty: (value: any[] | object | string | null | undefined | number) => boolean; isElement: (value: any) => boolean; @@ -225,11 +225,11 @@ export interface _base { cloneDeep: (value: T) => T; - findKey: (object: object, predicate?: Function|object|string, thisArg?: any) => any; + findKey: (object: object, predicate?: Function | object | string, thisArg?: any) => any; - pick: (object: object, predicate?: Function|string|string[], thisArg?: any) => object; + pick: (object: object, predicate?: Function | string | string[], thisArg?: any) => object; - omit: (object: object, predicate?: Function|string|string[], thisArg?: any) => object; + omit: (object: object, predicate?: Function | string | string[], thisArg?: any) => object; tap: (value: any, interceptor: Function, thisArg?: any) => any; @@ -237,21 +237,21 @@ export interface _base { init: () => void; - has: (obj: object, keys: string|string[]) => boolean; + has: (obj: object, keys: string | string[]) => boolean; freeze: (value: T) => T; isKey: (key: any) => key is (number | string); - isCapitalEqual: (a: string|null|undefined, b: string|null|undefined) => boolean; + isCapitalEqual: (a: string | null | undefined, b: string | null | undefined) => boolean; - isWidthOrHeight: (w: number|string) => boolean; + isWidthOrHeight: (w: number | string) => boolean; isNotNull: (obj: T) => obj is NonNullable; isNull: (obj: any) => obj is (undefined | null); - isEmptyArray: (arr: T[] | U) => arr is T[] & {length: 0}; + isEmptyArray: (arr: T[] | U) => arr is T[] & { length: 0 }; isNotEmptyArray: (arr: T[] | U) => arr is [T, ...T[]]; @@ -263,7 +263,7 @@ export interface _base { deepClone: (obj: T) => T; - deepExtend: merge['deepExtend']; + deepExtend: merge["deepExtend"]; isDeepMatch: (object: any, attrs: any) => boolean; @@ -307,7 +307,7 @@ export interface _base { wrap: (value: any, wrapper: Function) => Function; - nextTick: (func: Function) => Promise; + nextTick: (func?: Function) => Promise; random: (min?: number, max?: number, floating?: boolean) => number; @@ -317,21 +317,21 @@ export interface _base { parseFloat: (string: string) => number; - isNaturalNumber: (value: string|number) => boolean; + isNaturalNumber: (value: string | number) => boolean; - isPositiveInteger: (value: string|number) => boolean; + isPositiveInteger: (value: string | number) => boolean; - isNegativeInteger: (value: string|number) => boolean; + isNegativeInteger: (value: string | number) => boolean; - isInteger: (value: string|number) => boolean; + isInteger: (value: string | number) => boolean; - isNumeric: (value: string|number) => boolean; + isNumeric: (value: string | number) => boolean; - isFloat: (value: string|number) => boolean; + isFloat: (value: string | number) => boolean; - isOdd: (value: string|number) => boolean; + isOdd: (value: string | number) => boolean; - isEven: (value: string|number) => boolean; + isEven: (value: string | number) => boolean; sum: (array: any[], iteratee?: Function, context?: any) => number; @@ -367,7 +367,7 @@ export interface _base { isLeapYear: (year: number) => boolean; - checkDateVoid: (YY: string | number, MM: string | number, DD: string | number, minDate: string, maxDate: string) => (number|string)[]; + checkDateVoid: (YY: string | number, MM: string | number, DD: string | number, minDate: string, maxDate: string) => (number | string)[]; checkDateLegal: (str: string) => boolean; From 772663ba8a9ba34cd72103dc3d70ba0a04b61652 Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 15 Jul 2022 12:07:37 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A0JIRA=20=E8=A7=A3=E5=86=B3=E4=B8=80?= =?UTF-8?q?=E4=B8=8Bsingle=E5=B5=8C=E5=A5=97=E5=AF=BC=E8=87=B4=E7=9A=84too?= =?UTF-8?q?ltip=E4=B8=80=E9=97=AA=E7=9A=84=E9=97=AE=E9=A2=98.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/single/0.single.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/base/single/0.single.js b/src/base/single/0.single.js index 88e32f29b..a5c9f3168 100644 --- a/src/base/single/0.single.js +++ b/src/base/single/0.single.js @@ -9,6 +9,9 @@ * @extends BI.Widget * @abstract */ + +var delayingTooltips; + BI.Single = BI.inherit(BI.Widget, { _defaultConfig: function () { var conf = BI.Single.superclass._defaultConfig.apply(this, arguments); @@ -85,14 +88,16 @@ BI.Single = BI.inherit(BI.Widget, { this.element.on("mouseenter.title" + this.getName(), function (e) { self._e = e; if (self.getTipType() === "warning" || (BI.isKey(self.getWarningTitle()) && !self.isEnabled())) { + delayingTooltips = self.getName(); self.showTimeout = BI.delay(function () { - if (BI.isNotNull(self.showTimeout)) { + if (BI.isNotNull(self.showTimeout) && delayingTooltips === self.getName()) { self._showToolTip(self._e || e, opt); } }, 200); } else if (self.getTipType() === "success" || self.isEnabled()) { + delayingTooltips = self.getName(); self.showTimeout = BI.delay(function () { - if (BI.isNotNull(self.showTimeout)) { + if (BI.isNotNull(self.showTimeout) && delayingTooltips === self.getName()) { self._showToolTip(self._e || e, opt); } }, 500);