Browse Source

update

master
imp 7 years ago
parent
commit
bd7bdffc89
  1. 12
      bi/slider.js
  2. 73
      demo/js/widget/slider/demo.slider.js
  3. 289
      dist/demo.js
  4. 12
      dist/slider.js
  5. 8
      src/addons/slider/slider/singleslider/button/iconbutton.slider.js
  6. 2
      src/addons/slider/slider/singleslider/singleslider.js
  7. 2
      src/addons/slider/slider/singleslider/singleslider.normal.js

12
bi/slider.js

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

73
demo/js/widget/slider/demo.slider.js

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

289
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: {
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);/**
* 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, {
props: {
baseCls: "demo-float-center"
@ -4848,6 +4848,55 @@ Demo.GridLayout = BI.inherit(BI.Widget, {
}
});
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.
*/
Demo.HorizontalAdapt = BI.inherit(BI.Widget, {
@ -4964,55 +5013,6 @@ Demo.HorizontalFloat = BI.inherit(BI.Widget, {
}
});
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.
*/
Demo.HtapeLayout = BI.inherit(BI.Widget, {
@ -5358,6 +5358,30 @@ Demo.TdLayout = BI.inherit(BI.Widget, {
}
});
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.
*/
Demo.VerticalAdaptLayout = BI.inherit(BI.Widget, {
@ -5399,30 +5423,6 @@ Demo.VerticalAdaptLayout = BI.inherit(BI.Widget, {
}
});
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.
*/
Demo.VtapeLayout = BI.inherit(BI.Widget, {
@ -8445,32 +8445,67 @@ Demo.Slider = BI.inherit(BI.Widget, {
},
_init: function () {
Demo.Slider.superclass._init.apply(this, arguments);
var self = this;
var slider = BI.createWidget({
type: "bi.slider",
min: 16,
max: 50,
width: 100,
height: 50
});
slider.setValue("30");
slider.on(BI.SliderNormal.EVENT_CHANGE, function () {
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.vertical_adapt",
type: "bi.vtape",
element: this,
width: 100,
items: [{
type: "bi.htape",
el: {
type: "bi.center_adapt",
items: [{
el: slider
}]
},
height: 200
}, {
el: {
type: "bi.slider",
min: 16,
max: 50,
ref: function (_ref) {
self.slider = _ref;
}
}
}],
height: 30,
width: 100
type: "bi.center_adapt",
items: [{
el: singleSlider
}]
},
height: 200
}, {
el: {
type: "bi.center_adapt",
items: [{
el: normalSingleSlider
}]
},
height: 200
}],
hgap: 20
});
this.slider.setValue("30");
this.slider.on(BI.SliderNormal.EVENT_CHANGE, function () {
console.log(this.getValue());
})
}
});
BI.shortcut("demo.slider", Demo.Slider);/**

12
dist/slider.js vendored

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

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

@ -1,17 +1,17 @@
/**
* Created by zcf on 2016/9/22.
*/
BI.Slider = BI.inherit(BI.Widget, {
BI.SliderButton = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.Slider.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-single-button-button"
baseCls: "bi-single-slider-button"
});
},
_init: function () {
BI.extend(BI.Slider.superclass._init.apply(this, arguments));
this.slider = BI.createWidget({
type: "bi.icon_button",
cls: "widget-button-icon button-button",
cls: "widget-slider-icon slider-button",
iconWidth: 14,
iconHeight: 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.slider = BI.createWidget({
type: "bi.single_slider_slider"
type: "bi.single_slider_button"
});
this.slider.element.draggable({
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 track = this._createTrack();
this.slider = BI.createWidget({
type: "bi.single_slider_slider"
type: "bi.single_slider_button"
});
this.slider.element.draggable({
axis: "x",

Loading…
Cancel
Save