Browse Source

Pull request #3407: 无Jira refact:combo的xtype写的有点问题

Merge in VISUAL/fineui from ~TREECAT/fineui:es6 to es6

* commit '3e7e83b692fc881e5451eb26404f294e921e4b84':
  无Jira refact:combo的xtype写的有点问题
  无jira refact:base重新跑一下脚本
es6
treecat-罗群 2 years ago
parent
commit
d806aa87fb
  1. 7
      src/base/1.pane.js
  2. 14
      src/base/layer/layer.drawer.js
  3. 6
      src/base/layer/layer.popover.js
  4. 2
      src/base/single/0.single.js
  5. 37
      src/base/single/button/button.basic.js
  6. 2
      src/base/single/editor/editor.js
  7. 2
      src/base/single/editor/editor.textarea.js
  8. 2
      src/case/combo/bubblecombo/popup.bubble.js

7
src/base/1.pane.js

@ -1,5 +1,5 @@
import { Label, Text } from "./single";
import { import {
AbsoluteCenterLayout,
CenterAdaptLayout, CenterAdaptLayout,
HorizontalAdaptLayout, HorizontalAdaptLayout,
VerticalLayout, VerticalLayout,
@ -12,7 +12,8 @@ import {
createWidget, createWidget,
Providers Providers
} from "@/core"; } from "@/core";
import { Layers } from "@/base"; import { Label, Text } from "./single";
import { Layers } from "@/base/0.base";
/** /**
* 当没有元素时有提示信息的view * 当没有元素时有提示信息的view
@ -43,7 +44,7 @@ export class Pane extends Widget {
_assertTip() { _assertTip() {
if (!this._tipText) { if (!this._tipText) {
createWidget({ createWidget({
type: "bi.absolute_center_adapt", type: AbsoluteCenterLayout.xtype,
element: this, element: this,
items: [ items: [
{ {

14
src/base/layer/layer.drawer.js

@ -1,4 +1,14 @@
import { HTapeLayout, AbsoluteLayout, Layout, VerticalLayout, Widget, shortcut, isPlainObject, extend } from "@/core"; import {
VTapeLayout,
HTapeLayout,
AbsoluteLayout,
Layout,
VerticalLayout,
Widget,
shortcut,
isPlainObject,
extend
} from "@/core";
import { Label, IconButton } from "../single"; import { Label, IconButton } from "../single";
/** /**
@ -128,7 +138,7 @@ export class Drawer extends Widget {
return extend( return extend(
{ {
type: "bi.vtape", type: VTapeLayout.xtype,
items, items,
}, },
this._getSuitableSize() this._getSuitableSize()

6
src/base/layer/layer.popover.js

@ -1,4 +1,6 @@
import { import {
VTapeLayout,
RightVerticalAdaptLayout,
HTapeLayout, HTapeLayout,
AbsoluteLayout, AbsoluteLayout,
VerticalLayout, VerticalLayout,
@ -202,7 +204,7 @@ export class Popover extends Widget {
scrolly: false, scrolly: false,
} }
: { : {
type: "bi.vtape", type: VTapeLayout.xtype,
height: this._getSuitableHeight(size.height), height: this._getSuitableHeight(size.height),
} }
); );
@ -302,7 +304,7 @@ export class BarPopover extends Popover {
const { footer, warningTitle } = this.options; const { footer, warningTitle } = this.options;
footer || footer ||
(this.options.footer = { (this.options.footer = {
type: "bi.right_vertical_adapt", type: RightVerticalAdaptLayout.xtype,
lgap: 10, lgap: 10,
items: [ items: [
{ {

2
src/base/single/0.single.js

@ -1,5 +1,5 @@
import { Widget, shortcut, Actions, extend, isKey, isNotNull, isFunction, isPlainObject, isNull, delay } from "@/core"; import { Widget, shortcut, Actions, extend, isKey, isNotNull, isFunction, isPlainObject, isNull, delay } from "@/core";
import { Tooltips } from "@/base"; import { Tooltips } from "@/base/0.base";
/** /**
* guy * guy

37
src/base/single/button/button.basic.js

@ -12,6 +12,7 @@ import {
} from "@/core"; } from "@/core";
import { BubbleCombo } from "@/case/combo/bubblecombo/combo.bubble"; import { BubbleCombo } from "@/case/combo/bubblecombo/combo.bubble";
import { Single } from "../0.single"; import { Single } from "../0.single";
import { BubblePopupView } from "@/case/combo/bubblecombo/popup.bubble";
/** /**
* guy * guy
@ -105,7 +106,7 @@ export class BasicButton extends Single {
right: 0, right: 0,
top: 0, top: 0,
bottom: 0, bottom: 0,
}, }
], ],
}); });
} }
@ -117,7 +118,7 @@ export class BasicButton extends Single {
this.$mask.invisible(); this.$mask.invisible();
} }
}); });
this.element.on(`mouseenter.${this.getName()}`, (e) => { this.element.on(`mouseenter.${this.getName()}`, e => {
if (this.element.__isMouseInBounds__(e)) { if (this.element.__isMouseInBounds__(e)) {
if (this.isEnabled() && !this._hover && (o.isShadowShowingOnSelected || !this.isSelected())) { if (this.isEnabled() && !this._hover && (o.isShadowShowingOnSelected || !this.isSelected())) {
assertMask(); assertMask();
@ -125,7 +126,7 @@ export class BasicButton extends Single {
} }
} }
}); });
this.element.on(`mousemove.${this.getName()}`, (e) => { this.element.on(`mousemove.${this.getName()}`, e => {
if (!this.element.__isMouseInBounds__(e)) { if (!this.element.__isMouseInBounds__(e)) {
if (this.isEnabled() && !this._hover) { if (this.isEnabled() && !this._hover) {
assertMask(); assertMask();
@ -158,7 +159,7 @@ export class BasicButton extends Single {
return bubble; return bubble;
}; };
const clk = (e) => { const clk = e => {
ev(e); ev(e);
if (!this.isEnabled() || !this.isValid()) { if (!this.isEnabled() || !this.isValid()) {
return; return;
@ -179,7 +180,7 @@ export class BasicButton extends Single {
trigger: "", trigger: "",
// bubble的提示不需要一直存在在界面上 // bubble的提示不需要一直存在在界面上
destroyWhenHide: true, destroyWhenHide: true,
ref: (_ref) => { ref: _ref => {
this.combo = _ref; this.combo = _ref;
}, },
el: { el: {
@ -187,9 +188,9 @@ export class BasicButton extends Single {
height: "100%", height: "100%",
}, },
popup: { popup: {
type: "bi.text_bubble_bar_popup_view", type: BubblePopupView.xtype,
text: getBubble(), text: getBubble(),
ref: (_ref) => { ref: _ref => {
popup = _ref; popup = _ref;
}, },
listeners: [ listeners: [
@ -202,7 +203,7 @@ export class BasicButton extends Single {
onClick.apply(this, args); onClick.apply(this, args);
} }
}, },
}, }
], ],
}, },
listeners: [ listeners: [
@ -211,14 +212,14 @@ export class BasicButton extends Single {
action() { action() {
popup.populate(getBubble()); popup.populate(getBubble());
}, },
}, }
], ],
}, },
left: 0, left: 0,
right: 0, right: 0,
bottom: 0, bottom: 0,
top: 0, top: 0,
}, }
], ],
}); });
} }
@ -234,7 +235,7 @@ export class BasicButton extends Single {
}; };
const triggerArr = (o.trigger || "").split(","); const triggerArr = (o.trigger || "").split(",");
triggerArr.forEach((trigger) => { triggerArr.forEach(trigger => {
let mouseDown = false; let mouseDown = false;
let selected = false; let selected = false;
let interval; let interval;
@ -243,7 +244,7 @@ export class BasicButton extends Single {
hand.mousedown(() => { hand.mousedown(() => {
mouseDown = true; mouseDown = true;
}); });
hand.mouseup((e) => { hand.mouseup(e => {
if (mouseDown === true) { if (mouseDown === true) {
clk(e); clk(e);
} }
@ -253,9 +254,9 @@ export class BasicButton extends Single {
break; break;
case "mousedown": case "mousedown":
// let mouseDown = false; // let mouseDown = false;
hand.mousedown((e) => { hand.mousedown(e => {
// if (e.button === 0) { // if (e.button === 0) {
Widget._renderEngine.createElement(document).bind(`mouseup.${this.getName()}`, (e) => { Widget._renderEngine.createElement(document).bind(`mouseup.${this.getName()}`, e => {
// if (e.button === 0) { // if (e.button === 0) {
if ( if (
BI.DOM.isExist(this) && BI.DOM.isExist(this) &&
@ -282,7 +283,7 @@ export class BasicButton extends Single {
ev(e); ev(e);
// } // }
}); });
hand.mouseup((e) => { hand.mouseup(e => {
// if (e.button === 0) { // if (e.button === 0) {
if (BI.DOM.isExist(this) && mouseDown === true && selected === true) { if (BI.DOM.isExist(this) && mouseDown === true && selected === true) {
clk(e); clk(e);
@ -297,7 +298,7 @@ export class BasicButton extends Single {
hand.dblclick(clk); hand.dblclick(clk);
break; break;
case "lclick": case "lclick":
hand.mousedown((e) => { hand.mousedown(e => {
Widget._renderEngine.createElement(document).bind(`mouseup.${this.getName()}`, () => { Widget._renderEngine.createElement(document).bind(`mouseup.${this.getName()}`, () => {
interval && clearInterval(interval); interval && clearInterval(interval);
interval = null; interval = null;
@ -322,7 +323,7 @@ export class BasicButton extends Single {
break; break;
default: default:
if (o.stopEvent || o.stopPropagation) { if (o.stopEvent || o.stopPropagation) {
hand.mousedown((e) => { hand.mousedown(e => {
ev(e); ev(e);
}); });
} }
@ -330,7 +331,7 @@ export class BasicButton extends Single {
// enter键等同于点击 // enter键等同于点击
o.attributes && o.attributes &&
o.attributes.zIndex >= 0 && o.attributes.zIndex >= 0 &&
hand.keyup((e) => { hand.keyup(e => {
if (e.keyCode === BI.KeyCode.ENTER) { if (e.keyCode === BI.KeyCode.ENTER) {
clk(e); clk(e);
} }

2
src/base/single/editor/editor.js

@ -13,7 +13,7 @@ import {
} from "@/core"; } from "@/core";
import { Label } from "../label"; import { Label } from "../label";
import { Single } from "../0.single"; import { Single } from "../0.single";
import { Bubbles } from "@/base"; import { Bubbles } from "@/base/0.base";
/** /**
* Created by GUY on 2015/4/15. * Created by GUY on 2015/4/15.

2
src/base/single/editor/editor.textarea.js

@ -16,7 +16,7 @@ import {
} from "@/core"; } from "@/core";
import { Label } from "../label"; import { Label } from "../label";
import { Single } from "../0.single"; import { Single } from "../0.single";
import { Bubbles } from "@/base"; import { Bubbles } from "@/base/0.base";
/** /**
* *

2
src/case/combo/bubblecombo/popup.bubble.js

@ -4,7 +4,7 @@ import { Label } from "@/base/single/label/label";
@shortcut() @shortcut()
export class BubblePopupView extends PopupView { export class BubblePopupView extends PopupView {
static xtype = "bi.bubble_popup_view"; static xtype = "bi.text_bubble_bar_popup_view";
static EVENT_CLICK_TOOLBAR_BUTTON = "EVENT_CLICK_TOOLBAR_BUTTON"; static EVENT_CLICK_TOOLBAR_BUTTON = "EVENT_CLICK_TOOLBAR_BUTTON";
static EVENT_CHANGE = "EVENT_CLICK_TOOLBAR_BUTTON"; static EVENT_CHANGE = "EVENT_CLICK_TOOLBAR_BUTTON";

Loading…
Cancel
Save