")
- .css({
- position: "absolute",
- zIndex: zIndex_tip - 1,
- top: 0,
- left: 0,
- right: 0,
- bottom: 0,
- })
- .appendTo("body");
+ return function() {
+ toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
+ toast.destroy?.();
+ };
+ },
+};
- function close() {
- messageShows[messageShows.length - 1].destroy();
- messageShows.pop();
- if (messageShows.length === 0) {
- $mask.remove();
- $mask = null;
- }
- }
+function _show(hasCancel, title, message, callback, config) {
+ isNull($mask) &&
+ ($mask = Widget._renderEngine
+ .createElement("
")
+ .css({
+ position: "absolute",
+ zIndex: zIndex_tip - 2,
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ opacity: 0.5,
+ })
+ .appendTo("body"));
+ $pop = Widget._renderEngine
+ .createElement("
")
+ .css({
+ position: "absolute",
+ zIndex: zIndex_tip - 1,
+ top: 0,
+ left: 0,
+ right: 0,
+ bottom: 0,
+ })
+ .appendTo("body");
+
+ function close() {
+ messageShows[messageShows.length - 1].destroy();
+ messageShows.pop();
+ if (messageShows.length === 0) {
+ $mask.remove();
+ $mask = null;
+ }
+ }
- const controlItems = [];
- if (hasCancel === true) {
- controlItems.push({
- el: {
- type: "bi.button",
- height: config.buttonHeight,
- text: i18nText("BI-Basic_Cancel"),
- light: true,
- handler() {
+ const controlItems = [];
+ if (hasCancel === true) {
+ controlItems.push({
+ el: {
+ type: "bi.button",
+ height: config.buttonHeight,
+ text: i18nText("BI-Basic_Cancel"),
+ light: true,
+ handler() {
+ close();
+ if (isFunction(callback)) {
+ callback.apply(null, [false]);
+ }
+ },
+ },
+ });
+ }
+ controlItems.push({
+ el: {
+ type: "bi.button",
+ height: config.buttonHeight,
+ text: i18nText("BI-Basic_OK"),
+ handler() {
+ close();
+ if (isFunction(callback)) {
+ callback.apply(null, [true]);
+ }
+ },
+ },
+ });
+ const conf = {
+ element: $pop,
+ type: "bi.center_adapt",
+ items: [
+ {
+ type: "bi.border",
+ attributes: {
+ tabIndex: 1,
+ },
+ mounted() {
+ this.element.keyup(e => {
+ if (e.keyCode === KeyCode.ENTER) {
close();
if (isFunction(callback)) {
- callback.apply(null, [false]);
+ callback.apply(null, [true]);
}
- },
- },
- });
- }
- controlItems.push({
- el: {
- type: "bi.button",
- height: config.buttonHeight,
- text: i18nText("BI-Basic_OK"),
- handler() {
- close();
- if (isFunction(callback)) {
- callback.apply(null, [true]);
- }
- },
- },
- });
- const conf = {
- element: $pop,
- type: "bi.center_adapt",
- items: [
- {
- type: "bi.border",
- attributes: {
- tabIndex: 1,
- },
- mounted() {
- this.element.keyup(e => {
- if (e.keyCode === KeyCode.ENTER) {
- close();
- if (isFunction(callback)) {
- callback.apply(null, [true]);
- }
- } else if (e.keyCode === KeyCode.ESCAPE) {
- close();
- if (hasCancel === true) {
- if (isFunction(callback)) {
- callback.apply(null, [false]);
- }
- }
+ } else if (e.keyCode === KeyCode.ESCAPE) {
+ close();
+ if (hasCancel === true) {
+ if (isFunction(callback)) {
+ callback.apply(null, [false]);
}
- });
- try {
- this.element.focus();
- } catch (e) {
}
- },
- cls: "bi-card",
- items: {
- north: {
- el: {
- type: "bi.border",
- cls: "bi-message-title bi-background",
- items: {
- center: {
- el: {
- type: "bi.label",
- cls: "bi-font-bold",
- text: title || i18nText("BI-Basic_Prompt"),
- textAlign: "left",
- hgap: 20,
- height: 40,
- },
- },
- east: {
- el: {
- type: "bi.icon_button",
- cls: "bi-message-close close-font",
- // height: 50,
- handler() {
- close();
- if (isFunction(callback)) {
- callback.apply(null, [false]);
- }
- },
- },
- width: 56,
- },
- },
- },
- height: 40,
- },
- center: {
- el: isPlainObject(message)
- ? message
- : {
+ }
+ });
+ try {
+ this.element.focus();
+ } catch (e) {
+ }
+ },
+ cls: "bi-card",
+ items: {
+ north: {
+ el: {
+ type: "bi.border",
+ cls: "bi-message-title bi-background",
+ items: {
+ center: {
+ el: {
type: "bi.label",
- vgap: 10,
+ cls: "bi-font-bold",
+ text: title || i18nText("BI-Basic_Prompt"),
+ textAlign: "left",
hgap: 20,
- whiteSpace: "normal",
- text: message,
+ height: 40,
},
- },
- south: {
- el: {
- type: "bi.absolute",
- items: [
- {
- el: {
- type: "bi.right_vertical_adapt",
- lgap: 10,
- items: controlItems,
- },
- top: 0,
- left: 20,
- right: 20,
- bottom: 0,
- }
- ],
},
- height: 44,
+ east: {
+ el: {
+ type: "bi.icon_button",
+ cls: "bi-message-close close-font",
+ // height: 50,
+ handler() {
+ close();
+ if (isFunction(callback)) {
+ callback.apply(null, [false]);
+ }
+ },
+ },
+ width: 56,
+ },
},
},
- width: 450,
- height: 200,
- }
- ],
- };
-
- messageShows[messageShows.length] = createWidget(conf);
- },
+ height: 40,
+ },
+ center: {
+ el: isPlainObject(message)
+ ? message
+ : {
+ type: "bi.label",
+ vgap: 10,
+ hgap: 20,
+ whiteSpace: "normal",
+ text: message,
+ },
+ },
+ south: {
+ el: {
+ type: "bi.absolute",
+ items: [
+ {
+ el: {
+ type: "bi.right_vertical_adapt",
+ lgap: 10,
+ items: controlItems,
+ },
+ top: 0,
+ left: 20,
+ right: 20,
+ bottom: 0,
+ }
+ ],
+ },
+ height: 44,
+ },
+ },
+ width: 450,
+ height: 200,
+ }
+ ],
};
-})();
+
+ messageShows[messageShows.length] = createWidget(conf);
+}
diff --git a/packages/fineui/src/base/layer/layer.popover.js b/packages/fineui/src/base/layer/layer.popover.js
index ea6db3662..50e99a60e 100644
--- a/packages/fineui/src/base/layer/layer.popover.js
+++ b/packages/fineui/src/base/layer/layer.popover.js
@@ -64,30 +64,7 @@ export class Popover extends Widget {
// var self = this;
const { header, headerHeight, closable, logic, footer, footerHeight, body, bodyTgap, bodyHgap } = this.options;
const c = this._constant;
- this.startX = 0;
- this.startY = 0;
const size = this._calculateSize();
- const bodyDom = getOuterBody();
- this.tracker = new MouseMoveTracker(
- (deltaX, deltaY) => {
- const W = Widget._renderEngine.createElement(bodyDom).width();
- const H = Widget._renderEngine.createElement(bodyDom).height();
- this.startX += deltaX;
- this.startY += deltaY;
- this.element.css({
- left: `${clamp(this.startX, 0, W - this.element.width())}px`,
- top: `${clamp(this.startY, 0, H - this.element.height())}px`,
- });
- // BI-12134 没有什么特别好的方法
- Resizers._resize({
- target: this.element[0],
- });
- },
- () => {
- this.tracker.releaseMouseMoves();
- },
- _global
- );
const items = [
{
el: {
@@ -219,7 +196,30 @@ export class Popover extends Widget {
// mounted之后绑定事件
mounted() {
- this.dragger.element.mousedown(e => {
+ this.startX = 0;
+ this.startY = 0;
+ const bodyDom = getOuterBody();
+ this.tracker = new MouseMoveTracker(
+ (deltaX, deltaY) => {
+ const W = Widget._renderEngine.createElement(bodyDom).width();
+ const H = Widget._renderEngine.createElement(bodyDom).height();
+ this.startX += deltaX;
+ this.startY += deltaY;
+ this.element.css({
+ left: `${clamp(this.startX, 0, W - this.element.width())}px`,
+ top: `${clamp(this.startY, 0, H - this.element.height())}px`,
+ });
+ // BI-12134 没有什么特别好的方法
+ Resizers._resize({
+ target: this.element[0],
+ });
+ },
+ () => {
+ this.tracker.releaseMouseMoves();
+ },
+ _global
+ );
+ this.dragger?.element.mousedown(e => {
if (this.options.draggable !== false) {
this.startX = this.element[0].offsetLeft;
this.startY = this.element[0].offsetTop;
diff --git a/packages/fineui/src/case/button/item.multiselect.js b/packages/fineui/src/case/button/item.multiselect.js
index 2d4879079..e3e909d13 100644
--- a/packages/fineui/src/case/button/item.multiselect.js
+++ b/packages/fineui/src/case/button/item.multiselect.js
@@ -19,6 +19,7 @@ export class MultiSelectItem extends BasicButton {
},
height: SIZE_CONSANTS.LIST_ITEM_HEIGHT,
iconWrapperWidth: 26,
+ el: {},
});
}
@@ -55,6 +56,7 @@ export class MultiSelectItem extends BasicButton {
keyword: o.keyword,
value: o.value,
py: o.py,
+ ...o.el
},
}
],
diff --git a/packages/fineui/src/case/colorchooser/colorchooser.js b/packages/fineui/src/case/colorchooser/colorchooser.js
index 81d0594ea..a846a2cab 100644
--- a/packages/fineui/src/case/colorchooser/colorchooser.js
+++ b/packages/fineui/src/case/colorchooser/colorchooser.js
@@ -24,7 +24,6 @@ export class ColorChooser extends Widget {
height: 24,
el: {},
simple: false,
- colorItems: null,
colorBoardHeight: 80,
});
}
diff --git a/packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js b/packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js
index d653de37a..aaaa91cd0 100644
--- a/packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js
+++ b/packages/fineui/src/case/colorchooser/colorchooser.popup.hex.js
@@ -47,7 +47,6 @@ export class HexColorChooserPopup extends Widget {
width: 300,
recommendColorsGetter: emptyFn, // 推荐色获取接口
simple: false, // 简单模式, popup中没有自动和透明
- colorItems: null,
colorBoardHeight: 80,
};
diff --git a/packages/fineui/typescript/base/foundation/message.ts b/packages/fineui/typescript/base/foundation/message.ts
index 2094d7fea..421d6e2a7 100644
--- a/packages/fineui/typescript/base/foundation/message.ts
+++ b/packages/fineui/typescript/base/foundation/message.ts
@@ -14,7 +14,5 @@ export declare namespace Msg {
[key: string]: any
}, callback?: (result: boolean) => void): void
- function prompt(title: string, message?: string, value?: any, callback?: (result: string) => void, minWidth?: number): void
-
function toast(message: string | Obj, options?: toastOptions | string, context?: HTMLElement): Function
}