Browse Source

update

master
imp 7 years ago
parent
commit
bd7bdffc89
  1. 70826
      bi/base.js
  2. 25192
      bi/case.js
  3. 12
      bi/slider.js
  4. 79
      demo/js/widget/slider/demo.slider.js
  5. 295
      dist/demo.js
  6. 12
      dist/slider.js
  7. 8
      src/addons/slider/slider/singleslider/button/iconbutton.slider.js
  8. 2
      src/addons/slider/slider/singleslider/singleslider.js
  9. 2
      src/addons/slider/slider/singleslider/singleslider.normal.js

70826
bi/base.js

File diff suppressed because it is too large Load Diff

25192
bi/case.js

File diff suppressed because it is too large Load Diff

12
bi/slider.js

@ -1,17 +1,17 @@
/** /**
* Created by zcf on 2016/9/22. * Created by zcf on 2016/9/22.
*/ */
BI.Slider = BI.inherit(BI.Widget, { BI.SliderButton = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.Slider.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.Slider.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-button-button" baseCls: "bi-single-slider-button"
}); });
}, },
_init: function () { _init: function () {
BI.extend(BI.Slider.superclass._init.apply(this, arguments)); BI.extend(BI.Slider.superclass._init.apply(this, arguments));
this.slider = BI.createWidget({ this.slider = BI.createWidget({
type: "bi.icon_button", type: "bi.icon_button",
cls: "widget-button-icon button-button", cls: "widget-slider-icon slider-button",
iconWidth: 14, iconWidth: 14,
iconHeight: 14, iconHeight: 14,
height: 14, height: 14,
@ -30,7 +30,7 @@ BI.Slider = BI.inherit(BI.Widget, {
}); });
} }
}); });
BI.shortcut("bi.single_slider_slider", BI.Slider);/** BI.shortcut("bi.single_slider_button", BI.SliderButton);/**
* Created by zcf on 2016/9/22. * Created by zcf on 2016/9/22.
*/ */
BI.SingleSlider = BI.inherit(BI.Widget, { BI.SingleSlider = BI.inherit(BI.Widget, {
@ -69,7 +69,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
this.track = this._createTrackWrapper(); this.track = this._createTrackWrapper();
this.slider = BI.createWidget({ this.slider = BI.createWidget({
type: "bi.single_slider_slider" type: "bi.single_slider_button"
}); });
this.slider.element.draggable({ this.slider.element.draggable({
axis: "x", axis: "x",
@ -338,7 +338,7 @@ BI.SingleSliderNormal = BI.inherit(BI.Widget, {
var c = this._constant; var c = this._constant;
var track = this._createTrack(); var track = this._createTrack();
this.slider = BI.createWidget({ this.slider = BI.createWidget({
type: "bi.single_slider_slider" type: "bi.single_slider_button"
}); });
this.slider.element.draggable({ this.slider.element.draggable({
axis: "x", axis: "x",

79
demo/js/widget/slider/demo.slider.js

@ -11,32 +11,67 @@ Demo.Slider = BI.inherit(BI.Widget, {
}, },
_init: function () { _init: function () {
Demo.Slider.superclass._init.apply(this, arguments); Demo.Slider.superclass._init.apply(this, arguments);
var self = this;
BI.createWidget({ var slider = BI.createWidget({
type: "bi.vertical_adapt", type: "bi.slider",
element: this, min: 16,
max: 50,
width: 100, width: 100,
items: [{ height: 50
type: "bi.htape",
items: [{
el: {
type: "bi.slider",
min: 16,
max: 50,
ref: function (_ref) {
self.slider = _ref;
}
}
}],
height: 30,
width: 100
}]
}); });
this.slider.setValue("30");
this.slider.on(BI.SliderNormal.EVENT_CHANGE, function () { slider.setValue("30");
slider.on(BI.SliderNormal.EVENT_CHANGE, function () {
console.log(this.getValue()); console.log(this.getValue());
}) });
var singleSlider = BI.createWidget({
type: "bi.single_slider",
min: 16,
max: 50
});
singleSlider.populate();
var normalSingleSlider = BI.createWidget({
type: "bi.single_slider_normal",
min: 16,
max: 50
});
normalSingleSlider.populate();
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: {
type: "bi.center_adapt",
items: [{
el: slider
}]
},
height: 200
}, {
el: {
type: "bi.center_adapt",
items: [{
el: singleSlider
}]
},
height: 200
}, {
el: {
type: "bi.center_adapt",
items: [{
el: normalSingleSlider
}]
},
height: 200
}],
hgap: 20
});
} }
}); });
BI.shortcut("demo.slider", Demo.Slider); BI.shortcut("demo.slider", Demo.Slider);

295
dist/demo.js vendored

@ -4487,7 +4487,41 @@ Demo.BorderLayout = BI.inherit(BI.Widget, {
} }
} }
}); });
BI.shortcut("demo.border", Demo.BorderLayout);Demo.CenterAdapt = BI.inherit(BI.Widget, { BI.shortcut("demo.border", Demo.BorderLayout);/**
* Created by User on 2017/3/22.
*/
Demo.CenterLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-center"
},
render: function () {
return {
type: "bi.center",
items: [{
type: "bi.label",
text: "Center 1,这里虽然设置label的高度30,但是最终影响高度的是center布局",
cls: "layout-bg1",
whiteSpace: "normal"
},{
type: "bi.label",
text: "Center 2,为了演示label是占满整个的,用了一个whiteSpace:normal",
cls: "layout-bg2",
whiteSpace: "normal"
},{
type: "bi.label",
text: "Center 3",
cls: "layout-bg3"
},{
type: "bi.label",
text: "Center 4",
cls: "layout-bg5"
}],
hgap: 20,
vgap: 20
}
}
});
BI.shortcut("demo.center_layout", Demo.CenterLayout);Demo.CenterAdapt = BI.inherit(BI.Widget, {
props: { props: {
baseCls: "demo-absolute" baseCls: "demo-absolute"
}, },
@ -4570,40 +4604,6 @@ BI.shortcut("demo.border", Demo.BorderLayout);Demo.CenterAdapt = BI.inherit(BI.W
BI.shortcut("demo.center_adapt", Demo.CenterAdapt);/** BI.shortcut("demo.center_adapt", Demo.CenterAdapt);/**
* Created by User on 2017/3/22. * Created by User on 2017/3/22.
*/ */
Demo.CenterLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-center"
},
render: function () {
return {
type: "bi.center",
items: [{
type: "bi.label",
text: "Center 1,这里虽然设置label的高度30,但是最终影响高度的是center布局",
cls: "layout-bg1",
whiteSpace: "normal"
},{
type: "bi.label",
text: "Center 2,为了演示label是占满整个的,用了一个whiteSpace:normal",
cls: "layout-bg2",
whiteSpace: "normal"
},{
type: "bi.label",
text: "Center 3",
cls: "layout-bg3"
},{
type: "bi.label",
text: "Center 4",
cls: "layout-bg5"
}],
hgap: 20,
vgap: 20
}
}
});
BI.shortcut("demo.center_layout", Demo.CenterLayout);/**
* Created by User on 2017/3/22.
*/
Demo.FloatCenterLayout = BI.inherit(BI.Widget, { Demo.FloatCenterLayout = BI.inherit(BI.Widget, {
props: { props: {
baseCls: "demo-float-center" baseCls: "demo-float-center"
@ -4848,6 +4848,55 @@ Demo.GridLayout = BI.inherit(BI.Widget, {
} }
}); });
BI.shortcut("demo.grid", Demo.GridLayout);/** BI.shortcut("demo.grid", Demo.GridLayout);/**
* Created by User on 2017/3/21.
*/
Demo.Horizontal = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-horizontal"
},
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.horizontal",
items: [{
type: "bi.absolute",
items: [{
el: {
type: "bi.text_button",
cls: "layout-bg1",
text: "这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)",
height: 30
},
left: 0,
right: 0
}],
width: 100,
height: 30
}, {
type: "bi.absolute",
items: [{
el: {
type: "bi.text_button",
cls: "layout-bg2",
text: "这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)",
height: 30
},
left: 0,
right: 0
}],
width: 200,
height: 30
}]
}],
lgap: 20,
rgap: 80,
tgap: 80,
bgap: 50
}
}
});
BI.shortcut("demo.horizontal", Demo.Horizontal);/**
* Created by User on 2017/3/22. * Created by User on 2017/3/22.
*/ */
Demo.HorizontalAdapt = BI.inherit(BI.Widget, { Demo.HorizontalAdapt = BI.inherit(BI.Widget, {
@ -4964,55 +5013,6 @@ Demo.HorizontalFloat = BI.inherit(BI.Widget, {
} }
}); });
BI.shortcut("demo.horizontal_float", Demo.HorizontalFloat);/** BI.shortcut("demo.horizontal_float", Demo.HorizontalFloat);/**
* Created by User on 2017/3/21.
*/
Demo.Horizontal = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-horizontal"
},
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.horizontal",
items: [{
type: "bi.absolute",
items: [{
el: {
type: "bi.text_button",
cls: "layout-bg1",
text: "这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)",
height: 30
},
left: 0,
right: 0
}],
width: 100,
height: 30
}, {
type: "bi.absolute",
items: [{
el: {
type: "bi.text_button",
cls: "layout-bg2",
text: "这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)这里设置了lgap(左边距),rgap(右边距),tgap(上边距),bgap(下边距)",
height: 30
},
left: 0,
right: 0
}],
width: 200,
height: 30
}]
}],
lgap: 20,
rgap: 80,
tgap: 80,
bgap: 50
}
}
});
BI.shortcut("demo.horizontal", Demo.Horizontal);/**
* Created by User on 2017/3/22. * Created by User on 2017/3/22.
*/ */
Demo.HtapeLayout = BI.inherit(BI.Widget, { Demo.HtapeLayout = BI.inherit(BI.Widget, {
@ -5358,6 +5358,30 @@ Demo.TdLayout = BI.inherit(BI.Widget, {
} }
}); });
BI.shortcut("demo.td", Demo.TdLayout);/** BI.shortcut("demo.td", Demo.TdLayout);/**
* Created by User on 2017/3/21.
*/
Demo.VerticalLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-vertical"
},
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.label",
cls: "layout-bg1",
text: "这里设置了hgap(水平间距),vgap(垂直间距)",
height: 30
}, {
type: "bi.label",
cls: "layout-bg2",
text: "这里设置了hgap(水平间距),vgap(垂直间距)",
height: 30
}]
}
}
});
BI.shortcut("demo.vertical", Demo.VerticalLayout);/**
* Created by User on 2017/3/22. * Created by User on 2017/3/22.
*/ */
Demo.VerticalAdaptLayout = BI.inherit(BI.Widget, { Demo.VerticalAdaptLayout = BI.inherit(BI.Widget, {
@ -5399,30 +5423,6 @@ Demo.VerticalAdaptLayout = BI.inherit(BI.Widget, {
} }
}); });
BI.shortcut("demo.vertical_adapt", Demo.VerticalAdaptLayout);/** BI.shortcut("demo.vertical_adapt", Demo.VerticalAdaptLayout);/**
* Created by User on 2017/3/21.
*/
Demo.VerticalLayout = BI.inherit(BI.Widget, {
props: {
baseCls: "demo-vertical"
},
render: function () {
return {
type: "bi.vertical",
items: [{
type: "bi.label",
cls: "layout-bg1",
text: "这里设置了hgap(水平间距),vgap(垂直间距)",
height: 30
}, {
type: "bi.label",
cls: "layout-bg2",
text: "这里设置了hgap(水平间距),vgap(垂直间距)",
height: 30
}]
}
}
});
BI.shortcut("demo.vertical", Demo.VerticalLayout);/**
* Created by User on 2017/3/22. * Created by User on 2017/3/22.
*/ */
Demo.VtapeLayout = BI.inherit(BI.Widget, { Demo.VtapeLayout = BI.inherit(BI.Widget, {
@ -8445,32 +8445,67 @@ Demo.Slider = BI.inherit(BI.Widget, {
}, },
_init: function () { _init: function () {
Demo.Slider.superclass._init.apply(this, arguments); Demo.Slider.superclass._init.apply(this, arguments);
var self = this;
BI.createWidget({ var slider = BI.createWidget({
type: "bi.vertical_adapt", type: "bi.slider",
element: this, min: 16,
max: 50,
width: 100, width: 100,
items: [{ height: 50
type: "bi.htape",
items: [{
el: {
type: "bi.slider",
min: 16,
max: 50,
ref: function (_ref) {
self.slider = _ref;
}
}
}],
height: 30,
width: 100
}]
}); });
this.slider.setValue("30");
this.slider.on(BI.SliderNormal.EVENT_CHANGE, function () { slider.setValue("30");
slider.on(BI.SliderNormal.EVENT_CHANGE, function () {
console.log(this.getValue()); console.log(this.getValue());
}) });
var singleSlider = BI.createWidget({
type: "bi.single_slider",
min: 16,
max: 50
});
singleSlider.populate();
var normalSingleSlider = BI.createWidget({
type: "bi.single_slider_normal",
min: 16,
max: 50
});
normalSingleSlider.populate();
BI.createWidget({
type: "bi.vtape",
element: this,
items: [{
el: {
type: "bi.center_adapt",
items: [{
el: slider
}]
},
height: 200
}, {
el: {
type: "bi.center_adapt",
items: [{
el: singleSlider
}]
},
height: 200
}, {
el: {
type: "bi.center_adapt",
items: [{
el: normalSingleSlider
}]
},
height: 200
}],
hgap: 20
});
} }
}); });
BI.shortcut("demo.slider", Demo.Slider);/** BI.shortcut("demo.slider", Demo.Slider);/**

12
dist/slider.js vendored

@ -1,17 +1,17 @@
/** /**
* Created by zcf on 2016/9/22. * Created by zcf on 2016/9/22.
*/ */
BI.Slider = BI.inherit(BI.Widget, { BI.SliderButton = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.Slider.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.Slider.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-button-button" baseCls: "bi-single-slider-button"
}); });
}, },
_init: function () { _init: function () {
BI.extend(BI.Slider.superclass._init.apply(this, arguments)); BI.extend(BI.Slider.superclass._init.apply(this, arguments));
this.slider = BI.createWidget({ this.slider = BI.createWidget({
type: "bi.icon_button", type: "bi.icon_button",
cls: "widget-button-icon button-button", cls: "widget-slider-icon slider-button",
iconWidth: 14, iconWidth: 14,
iconHeight: 14, iconHeight: 14,
height: 14, height: 14,
@ -30,7 +30,7 @@ BI.Slider = BI.inherit(BI.Widget, {
}); });
} }
}); });
BI.shortcut("bi.single_slider_slider", BI.Slider);/** BI.shortcut("bi.single_slider_button", BI.SliderButton);/**
* Created by zcf on 2016/9/22. * Created by zcf on 2016/9/22.
*/ */
BI.SingleSlider = BI.inherit(BI.Widget, { BI.SingleSlider = BI.inherit(BI.Widget, {
@ -69,7 +69,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
this.track = this._createTrackWrapper(); this.track = this._createTrackWrapper();
this.slider = BI.createWidget({ this.slider = BI.createWidget({
type: "bi.single_slider_slider" type: "bi.single_slider_button"
}); });
this.slider.element.draggable({ this.slider.element.draggable({
axis: "x", axis: "x",
@ -338,7 +338,7 @@ BI.SingleSliderNormal = BI.inherit(BI.Widget, {
var c = this._constant; var c = this._constant;
var track = this._createTrack(); var track = this._createTrack();
this.slider = BI.createWidget({ this.slider = BI.createWidget({
type: "bi.single_slider_slider" type: "bi.single_slider_button"
}); });
this.slider.element.draggable({ this.slider.element.draggable({
axis: "x", axis: "x",

8
src/addons/slider/slider/singleslider/button/iconbutton.slider.js

@ -1,17 +1,17 @@
/** /**
* Created by zcf on 2016/9/22. * Created by zcf on 2016/9/22.
*/ */
BI.Slider = BI.inherit(BI.Widget, { BI.SliderButton = BI.inherit(BI.Widget, {
_defaultConfig: function () { _defaultConfig: function () {
return BI.extend(BI.Slider.superclass._defaultConfig.apply(this, arguments), { return BI.extend(BI.Slider.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-button-button" baseCls: "bi-single-slider-button"
}); });
}, },
_init: function () { _init: function () {
BI.extend(BI.Slider.superclass._init.apply(this, arguments)); BI.extend(BI.Slider.superclass._init.apply(this, arguments));
this.slider = BI.createWidget({ this.slider = BI.createWidget({
type: "bi.icon_button", type: "bi.icon_button",
cls: "widget-button-icon button-button", cls: "widget-slider-icon slider-button",
iconWidth: 14, iconWidth: 14,
iconHeight: 14, iconHeight: 14,
height: 14, height: 14,
@ -30,4 +30,4 @@ BI.Slider = BI.inherit(BI.Widget, {
}); });
} }
}); });
BI.shortcut("bi.single_slider_slider", BI.Slider); BI.shortcut("bi.single_slider_button", BI.SliderButton);

2
src/addons/slider/slider/singleslider/singleslider.js

@ -37,7 +37,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, {
this.track = this._createTrackWrapper(); this.track = this._createTrackWrapper();
this.slider = BI.createWidget({ this.slider = BI.createWidget({
type: "bi.single_slider_slider" type: "bi.single_slider_button"
}); });
this.slider.element.draggable({ this.slider.element.draggable({
axis: "x", axis: "x",

2
src/addons/slider/slider/singleslider/singleslider.normal.js

@ -28,7 +28,7 @@ BI.SingleSliderNormal = BI.inherit(BI.Widget, {
var c = this._constant; var c = this._constant;
var track = this._createTrack(); var track = this._createTrack();
this.slider = BI.createWidget({ this.slider = BI.createWidget({
type: "bi.single_slider_slider" type: "bi.single_slider_button"
}); });
this.slider.element.draggable({ this.slider.element.draggable({
axis: "x", axis: "x",

Loading…
Cancel
Save