Browse Source

Merge branch 'master' of ssh://code.fineres.com:7999/~claire.tang/fineui

research/test
Claire 10 months ago
parent
commit
3f4f732e33
  1. BIN
      packages/fineui/dist/font/iconfont.eot
  2. 8
      packages/fineui/dist/font/iconfont.svg
  3. BIN
      packages/fineui/dist/font/iconfont.ttf
  4. BIN
      packages/fineui/dist/font/iconfont.woff
  5. BIN
      packages/fineui/dist/font/iconfont.woff2
  6. 474
      packages/fineui/src/base/foundation/message.js
  7. 50
      packages/fineui/src/base/layer/layer.popover.js
  8. 26
      packages/fineui/src/case/button/switch.js
  9. 2
      packages/fineui/src/component/form/form.field.js
  10. 2
      packages/fineui/src/less/lib/colors.less
  11. 2
      packages/fineui/src/less/lib/constant.less
  12. 5
      packages/fineui/src/less/lib/font.less
  13. 5
      packages/fineui/src/less/resource/font.less
  14. 5
      packages/fineui/src/widget/multiselect/multiselect.loader.js
  15. 5
      packages/fineui/src/widget/multiselect/multiselect.loader.nobar.js
  16. 6
      packages/fineui/src/widget/searchmultitextvaluecombo/multitextvalue.loader.search.js
  17. 18
      packages/fineui/typescript/base/foundation/message.ts
  18. 5
      packages/fineui/typescript/case/button/switch.ts

BIN
packages/fineui/dist/font/iconfont.eot vendored

Binary file not shown.

8
packages/fineui/dist/font/iconfont.svg vendored

@ -14,6 +14,10 @@
/>
<missing-glyph />
<glyph glyph-name="quxiaohebing" unicode="&#60090;" d="M384 728a8 8 0 0 0-8-8H176v-672h200a8 8 0 0 0 8-8v-48a8 8 0 0 0-8-8H128a16 16 0 0 0-16 16V768a16 16 0 0 0 16 16h248a8 8 0 0 0 8-8v-48z m256-736a8 8 0 0 1 8-8h248a16 16 0 0 1 16 16V768a16 16 0 0 1-16 16h-248a8 8 0 0 1-8-8v-48a8 8 0 0 1 8-8h200v-672h-200a8 8 0 0 1-8-8v-48zM480 592a8 8 0 0 1 8-8h48a8 8 0 0 1 8 8V776a8 8 0 0 1-8 8h-48a8 8 0 0 1-8-8v-184z m0-600a8 8 0 0 1 8-8h48a8 8 0 0 1 8 8v184a8 8 0 0 1-8 8h-48a8 8 0 0 1-8-8v-184z m203.412 523.5a8 8 0 0 0 0-11.312l-120.344-120.344 120.344-120.344a8 8 0 0 0 0-11.312l-39.6-39.6a8 8 0 0 0-11.312 0l-120.344 120.344-122.9-122.9a8 8 0 0 0-11.312 0l-39.6 39.596a8 8 0 0 0 0 11.312l122.9 122.904-122.9 122.9a8 8 0 0 0 0 11.316l39.6 39.6a8 8 0 0 0 11.312 0l122.9-122.904 120.344 120.344a8 8 0 0 0 11.316 0l39.596-39.6z" horiz-adv-x="1024" />
<glyph glyph-name="chakanbiduixiangqing" unicode="&#60078;" d="M180 52V716h224v-449.884a331.58 331.58 0 0 0 68 118.616V768a16 16 0 0 1-16 16H128a16 16 0 0 1-16-16v-768a16 16 0 0 1 16-16h312.984A330.54 330.54 0 0 0 404 61.884V52H180zM912 768v-333.116a331.248 331.248 0 0 1-68 37.184V716h-224v-235.324a330.2 330.2 0 0 1-68-30.256V768a16 16 0 0 0 16 16h328a16 16 0 0 0 16-16z m48-600a231.996 231.996 0 0 0-45.328-137.76l80.28-80.28a8 8 0 0 0 0-11.316l-39.596-39.596a8 8 0 0 0-11.316 0l-80.592 80.592a232.024 232.024 0 0 0-299.496 24.312A232 232 0 1 0 960 168z m-400 0a168 168 0 1 1 336.004 0A168 168 0 0 1 560 168z" horiz-adv-x="1024" />
<glyph glyph-name="zhinengwenda" unicode="&#60077;" d="M561.404 272l55.864-38.192L732 160.684V272h164V736H276v-464h285.404z m20.596-91.608L541.616 208H260c-26.508 0-48 21.492-48 48V752c0 26.508 21.492 48 48 48h652c26.508 0 48-21.492 48-48v-496c0-26.508-21.492-48-48-48h-116v-105.656c0-25.264-27.896-40.564-49.2-26.988l-164.8 105.036zM184 524H112c-26.508 0-48-21.492-48-48v-342.688c0-26.512 21.492-48 48-48h116v-101.276c0-25.24 27.86-40.544 49.16-27.008l164.84 104.748 34.532 23.536h87.528v64h-107.264l-49.992-34.072L292 42.284v107.028H128V460h56V524zM696 644l-76-256h64l46 154.948L776 388h64l-76 256h-68zM532 518c0 34.24-27.76 62-62 62-34.24 0-62-27.76-62-62 0-34.24 27.76-62 62-62 34.24 0 62 27.76 62 62z m9.808-103.548A125.4 125.4 0 0 0 470 392C400.412 392 344 448.412 344 518S400.412 644 470 644 596 587.588 596 518c0-19.692-4.516-38.328-12.572-54.932l31.832-27.216-41.592-48.644-31.86 27.244z" horiz-adv-x="1024" />
<glyph glyph-name="a-typeshujuzhongxinstatenormal" unicode="&#60076;" d="M920 624a16 16 0 0 1-16 16h-64a16 16 0 0 1-16-16v-480a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16V624z m-176 88a16 16 0 0 0 16-16v-624a16 16 0 0 0-16-16h-64a16 16 0 0 0-16 16V696a16 16 0 0 0 16 16h64z m-160 72a16 16 0 0 0 16-16v-768a16 16 0 0 0-16-16H128a16 16 0 0 0-16 16V768a16 16 0 0 0 16 16h456z m-116-136H244a8 8 0 0 1-8-8v-56a8 8 0 0 1 8-8h224a8 8 0 0 1 8 8V640a8 8 0 0 1-8 8z m8-160a8 8 0 0 1-8 8H244a8 8 0 0 1-8-8v-56a8 8 0 0 1 8-8h224a8 8 0 0 1 8 8v56z m-8-144H244a8 8 0 0 1-8-8v-56a8 8 0 0 1 8-8h224a8 8 0 0 1 8 8v56a8 8 0 0 1-8 8z m8-160a8 8 0 0 1-8 8H244a8 8 0 0 1-8-8v-56a8 8 0 0 1 8-8h224a8 8 0 0 1 8 8v56z" horiz-adv-x="1024" />
@ -1888,7 +1892,7 @@
<glyph glyph-name="normal63" unicode="&#59160;" d="M725.333333 704h85.333334a85.333333 85.333333 0 0 0 85.333333-85.333333v-512a85.333333 85.333333 0 0 0-85.333333-85.333334H213.333333a85.333333 85.333333 0 0 0-85.333333 85.333334v512a85.333333 85.333333 0 0 0 85.333333 85.333333h85.333334V725.333333a21.333333 21.333333 0 0 0 42.666666 0v-21.333333h341.333334V725.333333a21.333333 21.333333 0 1 0 42.666666 0v-21.333333z m0-42.666667V640a21.333333 21.333333 0 1 0-42.666666 0v21.333333H341.333333V640a21.333333 21.333333 0 0 0-42.666666 0v21.333333H213.333333a42.666667 42.666667 0 0 1-42.666666-42.666666v-85.333334h682.666666v85.333334a42.666667 42.666667 0 0 1-42.666666 42.666666h-85.333334z m-370.389333-237.824a159.530667 159.530667 0 0 0-34.56-27.264c-13.824-7.68-26.496-13.056-38.784-16.128v-41.472c25.344 7.296 46.464 18.816 62.976 34.56V149.333333h41.856v274.176h-31.488z m213.12 40.704l-134.4-353.28h35.712l134.016 353.28h-35.328z m135.552-40.704a159.530667 159.530667 0 0 0-34.56-27.264c-13.824-7.68-26.496-13.056-38.784-16.128v-41.472c25.344 7.296 46.464 18.816 62.976 34.56V149.333333h41.856v274.176h-31.488z" horiz-adv-x="1024" />
<glyph glyph-name="ditupeizhi_fangda" unicode="&#59023;" d="M480 704a8 8 0 0 1-8-8v-272H200a8 8 0 0 1-8-8v-64a8 8 0 0 1 8-8h272v-272a8 8 0 0 1 8-8h64a8 8 0 0 1 8 8v272h272a8 8 0 0 1 8 8v64a8 8 0 0 1-8 8h-272V696a8 8 0 0 1-8 8h-64z" horiz-adv-x="1024" />
<glyph glyph-name="ditupeizhi_fangda" unicode="&#59023;" d="M552 736a8 8 0 0 1-8 8h-64a8 8 0 0 1-8-8v-312H160a8 8 0 0 1-8-8v-64a8 8 0 0 1 8-8h312v-312a8 8 0 0 1 8-8h64a8 8 0 0 1 8 8v312h312a8 8 0 0 1 8 8v64a8 8 0 0 1-8 8h-312V736z" horiz-adv-x="1024" />
<glyph glyph-name="cengjiziduan" unicode="&#59495;" d="M526.532 799.156a8 8 0 0 0 7.156 0L975.8 578.096c5.896-2.948 5.896-11.36 0-14.308l-442.112-221.056a8.016 8.016 0 0 0-7.156 0L84.424 563.788c-5.9 2.948-5.9 11.36 0 14.308L526.532 799.16zM229.548 570.944l300.564-150.28 300.56 150.28-300.56 150.28-300.56-150.28zM98.112 401.784a8 8 0 0 0 11.504 7.192l420.496-204.84 420.496 204.84a8 8 0 0 0 11.504-7.192v-59.216c0-3.048-1.732-5.832-4.468-7.176l-427.532-210.448-427.532 210.448a7.996 7.996 0 0 0-4.468 7.176v59.216zM109.62 190.53200000000004c-5.312 2.592-11.508-1.276-11.508-7.188v-57.724c0-3.032 1.712-5.804 4.424-7.16l427.576-213.516 427.572 213.516a8.008 8.008 0 0 1 4.428 7.16v57.724a8 8 0 0 1-11.508 7.188l-420.492-205.248-420.492 205.248z" horiz-adv-x="1024" />
@ -1900,7 +1904,7 @@
<glyph glyph-name="normal65" unicode="&#59162;" d="M725.333333 704h85.333334a85.333333 85.333333 0 0 0 85.333333-85.333333v-512a85.333333 85.333333 0 0 0-85.333333-85.333334H213.333333a85.333333 85.333333 0 0 0-85.333333 85.333334v512a85.333333 85.333333 0 0 0 85.333333 85.333333h85.333334V725.333333a21.333333 21.333333 0 0 0 42.666666 0v-21.333333h341.333334V725.333333a21.333333 21.333333 0 1 0 42.666666 0v-21.333333z m0-42.666667V640a21.333333 21.333333 0 1 0-42.666666 0v21.333333H341.333333V640a21.333333 21.333333 0 0 0-42.666666 0v21.333333H213.333333a42.666667 42.666667 0 0 1-42.666666-42.666666v-85.333334h682.666666v85.333334a42.666667 42.666667 0 0 1-42.666666 42.666666h-85.333334zM384 426.666667v-42.666667h384v42.666667H384z m-128-256v-42.666667h384v42.666667H256z m0 128v-42.666667h512v42.666667H256z" horiz-adv-x="1024" />
<glyph glyph-name="ditupeizhi_suoxiao" unicode="&#59025;" d="M192 416a8 8 0 0 0 8 8h624a8 8 0 0 0 8-8v-64a8 8 0 0 0-8-8H200a8 8 0 0 0-8 8v64z" horiz-adv-x="1024" />
<glyph glyph-name="ditupeizhi_suoxiao" unicode="&#59025;" d="M152 416a8 8 0 0 0 8 8h704a8 8 0 0 0 8-8v-64a8 8 0 0 0-8-8H160a8 8 0 0 0-8 8v64z" horiz-adv-x="1024" />
<glyph glyph-name="yunhangzhong" unicode="&#59497;" d="M729.088 586.496a24 24 0 0 0 33.472-1.792c58.432-62.08 95.872-179.2 84.864-268.928a23.68 23.68 0 1 0-47.104 5.76c9.344 75.968-22.848 175.68-73.024 231.488a23.68 23.68 0 0 0 1.792 33.472zM810.368 318.08a142.336 142.336 0 1 0-54.272-279.488 142.336 142.336 0 0 0 54.272 279.424z m-12.16-62.912a78.336 78.336 0 1 1-29.952-153.728 78.336 78.336 0 0 1 29.888 153.728zM601.792 67.2a23.68 23.68 0 0 0-15.808-29.632c-84.736-25.856-169.6-18.24-246.272 29.632a23.68 23.68 0 1 0 25.088 40.192c64.896-40.512 135.616-46.336 207.36-24.448a23.68 23.68 0 0 0 29.632-15.744zM352.32 92.864a142.336 142.336 0 1 1-230.272 167.36 142.336 142.336 0 0 1 230.272-167.36z m-51.776 37.632a78.336 78.336 0 1 0-126.72 92.096 78.336 78.336 0 0 0 126.72-92.096zM194.88 415.232a23.68 23.68 0 0 0-16.704 29.056 307.648 307.648 0 0 0 162.624 197.248 23.68 23.68 0 0 0 20.8-42.624A260.224 260.224 0 0 1 224 432a23.68 23.68 0 0 0-29.12-16.768zM355.904 617.216A142.336 142.336 0 1 1 619.84 723.84 142.336 142.336 0 0 1 355.84 617.216z m59.328 23.936a78.336 78.336 0 1 0 145.28 58.688 78.336 78.336 0 0 0-145.28-58.688z" horiz-adv-x="1024" />

Before

Width:  |  Height:  |  Size: 1012 KiB

After

Width:  |  Height:  |  Size: 1013 KiB

BIN
packages/fineui/dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
packages/fineui/dist/font/iconfont.woff vendored

Binary file not shown.

BIN
packages/fineui/dist/font/iconfont.woff2 vendored

Binary file not shown.

474
packages/fineui/src/base/foundation/message.js

@ -17,258 +17,270 @@ import {
i18nText,
KeyCode,
isPlainObject,
SIZE_CONSANTS
SIZE_CONSANTS,
CenterAdaptLayout,
VerticalLayout,
HTapeLayout,
RightVerticalAdaptLayout
} from "../../core";
import { Toast } from "../single";
import { Button, IconLabel, Label, Toast } from "../single";
export const Msg = (() => {
let $mask, $pop;
let $mask, $pop;
const messageShows = [];
const messageShows = [];
const toastStack = [];
const toastStack = [];
const defaultConfig = {
buttonHeight: 24,
};
const AlertLevel = {
WARNING: 'warning',
INFO: 'info',
ERROR: 'error',
SUCCESS: 'success',
}
return {
alert(title, message, callback, config = defaultConfig) {
this._show(false, title, message, callback, config);
},
confirm(title, message, callback, config = defaultConfig) {
this._show(true, title, message, callback, config);
},
prompt(title, message, value, callback, min_width) {
// Msg.prompt(title, message, value, callback, min_width);
},
toast(message, options, context) {
isString(options) && (options = { level: options });
options = options || {};
context = context || Widget._renderEngine.createElement("body");
const level = options.level || "common";
const autoClose = isNull(options.autoClose) ? true : options.autoClose;
const callback = isFunction(options.callback) ? options.callback : emptyFn;
const toast = createWidget({
type: "bi.toast",
cls: "bi-message-animate bi-message-leave",
level,
autoClose,
closable: options.closable,
text: message,
listeners: [
{
eventName: Toast.EVENT_DESTORY,
action() {
remove(toastStack, toast.element);
let _height = SIZE_CONSANTS.TOAST_TOP;
each(toastStack, (i, element) => {
element.css({ top: _height });
_height += element.outerHeight() + 10;
});
callback();
},
}
],
});
let height = SIZE_CONSANTS.TOAST_TOP;
each(toastStack, (i, element) => {
height += element.outerHeight() + 10;
});
createWidget({
type: "bi.absolute",
element: context,
items: [
{
el: toast,
left: "50%",
top: height,
}
],
});
toastStack.push(toast.element);
toast.element.css({ "margin-left": (-1 * toast.element.outerWidth()) / 2 });
toast.element.removeClass("bi-message-leave").addClass("bi-message-enter");
function getIconCls(level) {
switch (level) {
case AlertLevel.ERROR:
return 'alert-error-font';
case AlertLevel.SUCCESS:
return 'alert-success-font';
case AlertLevel.INFO:
return 'alert-info-font';
case AlertLevel.WARNING:
default:
return 'alert-warning-font';
}
}
autoClose &&
delay(() => {
toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
toast.destroy?.();
}, 5000);
return function() {
toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
toast.destroy?.();
};
},
_show(hasCancel, title, message, callback, config) {
isNull($mask) &&
($mask = Widget._renderEngine
.createElement("<div class=\"bi-z-index-mask\">")
.css({
position: "absolute",
zIndex: zIndex_tip - 2,
top: 0,
left: 0,
right: 0,
bottom: 0,
opacity: 0.5,
})
.appendTo("body"));
$pop = Widget._renderEngine
.createElement("<div class=\"bi-message-depend\">")
.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;
export const Msg = {
alert(title, message, callback, config) {
_show(false, title, message, callback, config);
},
confirm(title, message, callback, config) {
_show(true, title, message, callback, config);
},
toast(message, options, context) {
isString(options) && (options = { level: options });
options = options || {};
context = context || Widget._renderEngine.createElement("body");
const level = options.level || "common";
const autoClose = isNull(options.autoClose) ? true : options.autoClose;
const callback = isFunction(options.callback) ? options.callback : emptyFn;
const toast = createWidget({
type: "bi.toast",
cls: "bi-message-animate bi-message-leave",
level,
autoClose,
closable: options.closable,
text: message,
listeners: [
{
eventName: Toast.EVENT_DESTORY,
action() {
remove(toastStack, toast.element);
let _height = SIZE_CONSANTS.TOAST_TOP;
each(toastStack, (i, element) => {
element.css({ top: _height });
_height += element.outerHeight() + 10;
});
callback();
},
}
],
});
let height = SIZE_CONSANTS.TOAST_TOP;
each(toastStack, (i, element) => {
height += element.outerHeight() + 10;
});
createWidget({
type: "bi.absolute",
element: context,
items: [
{
el: toast,
left: "50%",
top: height,
}
}
],
});
toastStack.push(toast.element);
toast.element.css({ "margin-left": (-1 * toast.element.outerWidth()) / 2 });
toast.element.removeClass("bi-message-leave").addClass("bi-message-enter");
autoClose &&
delay(() => {
toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
toast.destroy?.();
}, 5000);
return function() {
toast.element.removeClass("bi-message-enter").addClass("bi-message-leave");
toast.destroy?.();
};
},
};
function _show(hasCancel, title, message, callback, config = {}) {
config = {
buttonHeight: 28,
cancelText: i18nText("BI-Basic_Cancel"),
sureText: i18nText("BI-Basic_OK"),
level: AlertLevel.WARNING,
...config,
}
isNull($mask) &&
($mask = Widget._renderEngine
.createElement("<div class=\"bi-z-index-mask\">")
.css({
position: "absolute",
zIndex: zIndex_tip - 2,
top: 0,
left: 0,
right: 0,
bottom: 0,
opacity: 0.5,
})
.appendTo("body"));
$pop = Widget._renderEngine
.createElement("<div class=\"bi-message-depend\">")
.css({
position: "absolute",
zIndex: zIndex_tip - 1,
top: 0,
left: 0,
right: 0,
bottom: 0,
})
.appendTo("body");
const controlItems = [];
if (hasCancel === true) {
controlItems.push({
el: {
type: "bi.button",
height: config.buttonHeight,
text: i18nText("BI-Basic_Cancel"),
light: true,
handler() {
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: Button.xtype,
height: config.buttonHeight,
text: config.cancelText,
light: true,
handler() {
close();
if (isFunction(callback)) {
callback.apply(null, [false]);
}
},
},
});
}
controlItems.push({
el: {
type: Button.xtype,
height: config.buttonHeight,
text: config.sureText,
handler() {
close();
if (isFunction(callback)) {
callback.apply(null, [true]);
}
},
},
});
const conf = {
element: $pop,
type: CenterAdaptLayout.xtype,
items: [
{
type: VerticalLayout.xtype,
cls: "bi-card bi-border-radius",
width: 450,
hgap: 32,
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]);
}
} else if (e.keyCode === KeyCode.ESCAPE) {
close();
if (hasCancel === true) {
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]);
}
},
});
try {
this.element.focus();
} catch (e) {
}
},
});
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]);
}
}
}
});
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,
},
},
el: {
type: HTapeLayout.xtype,
height: 24,
items: [
{
type: IconLabel.xtype,
cls: `${getIconCls(config.level)} icon-size-20`,
width: 24,
height: 24,
},
height: 40,
},
center: {
el: isPlainObject(message)
? message
: {
type: "bi.label",
vgap: 10,
hgap: 20,
whiteSpace: "normal",
text: message,
{
el: {
type: Label.xtype,
css: {"font-size": 16},
cls: 'bi-font-bold', // 16px
textAlign: 'left',
text: title || i18nText('BI-Basic_Prompt'),
lgap: 16,
},
},
south: {
el: {
type: "bi.absolute",
items: [
{
el: {
type: "bi.right_vertical_adapt",
lgap: 10,
items: controlItems,
},
top: 0,
left: 20,
right: 20,
bottom: 0,
}
],
width: 'fill',
},
height: 44,
],
},
tgap: 32,
},
{
el: isPlainObject(message)
? message
: {
type: Label.xtype,
css: { "font-size": 14 },
cls: 'alert-content',
textAlign: 'left',
text: message,
whiteSpace: 'normal',
},
height: 'fill',
tgap: 12,
lgap: 40,
},
{
el: config.footer && isFunction(config.footer) ? config.footer(close) : {
type: RightVerticalAdaptLayout.xtype,
lgap: 12,
items: controlItems,
},
width: 450,
height: 200,
}
tgap: 32,
bgap: 24,
},
],
};
messageShows[messageShows.length] = createWidget(conf);
},
},
],
};
})();
messageShows[messageShows.length] = createWidget(conf);
}

50
packages/fineui/src/base/layer/layer.popover.js

@ -47,7 +47,7 @@ export class Popover extends Widget {
body: null,
footer: null,
footerHeight: 44,
footerButtonHeight: 24,
footerButtonHeight: 28,
closable: true, // BI-40839 是否显示右上角的关闭按钮
bodyHgap: SIZE_CONSANTS.H_GAP_SIZE,
bodyTgap: SIZE_CONSANTS.V_GAP_SIZE,
@ -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;

26
packages/fineui/src/case/button/switch.js

@ -1,15 +1,13 @@
import { AbsoluteLayout, shortcut, i18nText } from "@/core";
import { TextButton, Label, BasicButton } from "@/base";
const CIRCLE_SIZE = 12;
@shortcut()
export class Switch extends BasicButton {
static xtype = "bi.switch";
static EVENT_CHANGE = "EVENT_CHANGE";
constants = {
CIRCLE_SIZE: 12,
};
props = {
extraCls: "bi-switch",
attributes: {
@ -18,12 +16,12 @@ export class Switch extends BasicButton {
height: 20,
width: 44,
showTip: false,
textGap: 8,
};
render() {
const o = this.options,
c = this.constants;
const tgap = (o.height - c.CIRCLE_SIZE) / 2;
const { selected, width, height, textGap, showTip } = this.options;
const tgap = (height - CIRCLE_SIZE) / 2;
return {
type: AbsoluteLayout.xtype,
@ -39,15 +37,15 @@ export class Switch extends BasicButton {
width: 12,
height: 12,
top: tgap,
left: o.selected ? 28 : 4,
left: selected ? width - height + tgap : tgap,
},
{
type: Label.xtype,
text: i18nText("BI-Basic_Simple_Open"),
cls: "content-tip",
left: 8,
left: textGap,
top: tgap - 2,
invisible: !(o.showTip && o.selected),
invisible: !(showTip && selected),
ref: _ref => {
this.openTip = _ref;
},
@ -56,9 +54,9 @@ export class Switch extends BasicButton {
type: Label.xtype,
text: i18nText("BI-Basic_Simple_Close"),
cls: "content-tip",
right: 8,
right: textGap,
top: tgap - 2,
invisible: !(o.showTip && !o.selected),
invisible: !(showTip && !selected),
ref: _ref => {
this.closeTip = _ref;
},
@ -78,7 +76,9 @@ export class Switch extends BasicButton {
setSelected(v) {
super.setSelected(...arguments);
this.layout.attr("items")[0].left = v ? 28 : 4;
const { width, height } = this.options;
const tgap = (height - CIRCLE_SIZE) / 2;
this.layout.attr("items")[0].left = v ? width - height + tgap : tgap;
this.layout.resize();
this.options.showTip && this.openTip.setVisible(v);
this.options.showTip && this.closeTip.setVisible(!v);

2
packages/fineui/src/component/form/form.field.js

@ -69,7 +69,7 @@ export class FormField extends Widget {
return {
type: VerticalAdaptLayout.xtype,
columnSize: ["auto", "fill"],
columnSize: isKey(o.label) ? ["auto", "fill"] : ["fill"],
verticalAlign: VerticalAlign.Stretch,
items: isKey(o.label)
? [

2
packages/fineui/src/less/lib/colors.less

@ -132,3 +132,5 @@
@color-bi-border-warning: @border-color-warning;
//边框提亮
@color-bi-border-highlight: @border-color-highlight;
@color-bi-alert-warning: @color-bi-orange;

2
packages/fineui/src/less/lib/constant.less

@ -248,3 +248,5 @@
//box-shadow效果
@box-shadow-toast: 0 6px 20px -2px rgba(9, 30, 64, 0.16);
@color-bi-orange: #f0ac3c;

5
packages/fineui/src/less/lib/font.less

@ -58,3 +58,8 @@
@font-key: "e1d0";
@font-add: "e1c7";
@font-alert-warning: 'e755';
@font-alert-success: 'e6de';
@font-alert-info: 'e74b';
@font-alert-error: 'e757';

5
packages/fineui/src/less/resource/font.less

@ -118,3 +118,8 @@
.font(text-align-left-font, @font-align-left);
.font(text-align-center-font, @font-align-center);
.font(text-align-right-font, @font-align-right);
.font(alert-success-font, @font-alert-success, @color-sea-green-100);
.font(alert-warning-font, @font-alert-warning, @color-bi-alert-warning);
.font(alert-error-font, @font-alert-error, @color-red-100);
.font(alert-info-font, @font-alert-info, @color-bi-text-highlight);

5
packages/fineui/src/widget/multiselect/multiselect.loader.js

@ -107,7 +107,10 @@ export class MultiSelectLoader extends Widget {
}
firstItems = self._createItems(json);
}
callback(firstItems.concat(self._createItems(ob.items)), ob.keyword || "");
const context = {
tipText: ob.tipText,
};
callback(firstItems.concat(self._createItems(ob.items)), ob.keyword || "", context);
if (op.times === 1 && self.storeValue) {
isKey(startValue) &&
(self.storeValue.type === Selection.All

5
packages/fineui/src/widget/multiselect/multiselect.loader.nobar.js

@ -115,7 +115,10 @@ export class MultiSelectNoBarLoader extends Widget {
}
firstItems = self._createItems(json);
}
callback(firstItems.concat(self._createItems(ob.items)), ob.keyword || "");
const context = {
tipText: ob.tipText,
};
callback(firstItems.concat(self._createItems(ob.items)), ob.keyword || "", context);
if (op.times === 1 && self.storeValue) {
isKey(startValue) &&
(self.storeValue.type === Selection.All

6
packages/fineui/src/widget/searchmultitextvaluecombo/multitextvalue.loader.search.js

@ -120,8 +120,10 @@ export class SearchMultiSelectLoader extends Widget {
}
firstItems = this._createItems(json);
}
callback(firstItems.concat(this._createItems(ob.items)), ob.keyword || "");
const context = {
tipText: ob.tipText,
};
callback(firstItems.concat(this._createItems(ob.items)), ob.keyword || "", context);
if (op.times === 1 && this.storeValue) {
isKey(startValue) &&
(this.storeValue.type === Selection.All

18
packages/fineui/typescript/base/foundation/message.ts

@ -8,13 +8,23 @@ type toastOptions = {
export declare namespace Msg {
function alert(title: string, message?: string | {
[key: string]: any
}, callback?: (result?: boolean) => void): void
}, callback?: (result?: boolean) => void, config?: {
buttonHeight?: number,
sureText?: string,
cancelText?: string,
level?: 'success' | 'warning' | 'error' | 'info',
footer?: (onClose: Function) => Obj;
}): void
function confirm(title: string, message?: string | {
[key: string]: any
}, callback?: (result: boolean) => void): void
function prompt(title: string, message?: string, value?: any, callback?: (result: string) => void, minWidth?: number): void
}, callback?: (result: boolean) => void, config?: {
buttonHeight?: number,
sureText?: string,
cancelText?: string,
level?: 'success' | 'warning' | 'error' | 'info',
footer?: (onClose: Function) => Obj;
}): void
function toast(message: string | Obj, options?: toastOptions | string, context?: HTMLElement): Function
}

5
packages/fineui/typescript/case/button/switch.ts

@ -1,6 +1,11 @@
import { BasicButton } from "../../base/single/button/button.basic";
export declare class Switch extends BasicButton {
props: {
textGap: number;
} & BasicButton['props']
static xtype: string;
static EVENT_CHANGE: string;
}

Loading…
Cancel
Save