Browse Source

fix 数组监听

es6
imp 6 years ago
parent
commit
512d633b8c
  1. 5
      dist/base.css
  2. 5
      dist/bundle.css
  3. 138
      dist/bundle.js
  4. 2
      dist/bundle.min.css
  5. 26
      dist/bundle.min.js
  6. 2
      dist/case.js
  7. 1111
      dist/demo.js
  8. 5
      dist/fineui.css
  9. 138
      dist/fineui.js
  10. 2
      dist/fineui.min.css
  11. 26
      dist/fineui.min.js
  12. 62
      dist/fix/fix.js
  13. 74
      dist/widget.js

5
dist/base.css vendored

@ -576,10 +576,6 @@
.bi-small-search-editor .search-font { .bi-small-search-editor .search-font {
font-size: 18px; font-size: 18px;
} }
.bi-sign-initial-editor .sign-initial-editor-text {
font-size: 14px;
}
.bi-message-title { .bi-message-title {
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
@ -1069,7 +1065,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
color: #3685f2; color: #3685f2;
} }
.bi-switch { .bi-switch {
-webkit-border-radius: 40px 40px 40px 40px; -webkit-border-radius: 40px 40px 40px 40px;
-moz-border-radius: 40px 40px 40px 40px; -moz-border-radius: 40px 40px 40px 40px;

5
dist/bundle.css vendored

@ -2506,10 +2506,6 @@ textarea {
.bi-small-search-editor .search-font { .bi-small-search-editor .search-font {
font-size: 18px; font-size: 18px;
} }
.bi-sign-initial-editor .sign-initial-editor-text {
font-size: 14px;
}
.bi-message-title { .bi-message-title {
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
@ -2999,7 +2995,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
color: #3685f2; color: #3685f2;
} }
.bi-switch { .bi-switch {
-webkit-border-radius: 40px 40px 40px 40px; -webkit-border-radius: 40px 40px 40px 40px;
-moz-border-radius: 40px 40px 40px 40px; -moz-border-radius: 40px 40px 40px 40px;

138
dist/bundle.js vendored

@ -34002,8 +34002,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
setImmediate(nextTickHandler); setImmediate(nextTickHandler);
}; };
} else if (typeof MessageChannel !== 'undefined' && (isNative(MessageChannel) || } else if (typeof MessageChannel !== 'undefined' && (isNative(MessageChannel) ||
// PhantomJS // PhantomJS
MessageChannel.toString() === '[object MessageChannelConstructor]')) { MessageChannel.toString() === '[object MessageChannelConstructor]')) {
var channel = new MessageChannel(); var channel = new MessageChannel();
var port = channel.port2; var port = channel.port2;
channel.port1.onmessage = nextTickHandler; channel.port1.onmessage = nextTickHandler;
@ -34011,19 +34011,19 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
port.postMessage(1); port.postMessage(1);
}; };
} else } else
/* istanbul ignore next */ /* istanbul ignore next */
if (typeof Promise !== 'undefined' && isNative(Promise)) { if (typeof Promise !== 'undefined' && isNative(Promise)) {
// use microtask in non-DOM environments, e.g. Weex // use microtask in non-DOM environments, e.g. Weex
var p = Promise.resolve(); var p = Promise.resolve();
timerFunc = function timerFunc() { timerFunc = function timerFunc() {
p.then(nextTickHandler); p.then(nextTickHandler);
}; };
} else { } else {
// fallback to setTimeout // fallback to setTimeout
timerFunc = function timerFunc() { timerFunc = function timerFunc() {
setTimeout(nextTickHandler, 0); setTimeout(nextTickHandler, 0);
}; };
} }
return function queueNextTick(cb, ctx) { return function queueNextTick(cb, ctx) {
var _resolve = void 0; var _resolve = void 0;
@ -34147,7 +34147,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
break; break;
} }
var result = original.apply(this, args); var result = original.apply(this, args);
notify(ob.parent, ob.parentKey, ob.dep); notify(ob.parent, ob.parentKey, ob.dep, true);
return result; return result;
}; };
}); });
@ -34198,7 +34198,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (isIE9Below) { if (isIE9Below) {
var VBClassPool = {}; var VBClassPool = {};
window.execScript([// jshint ignore:line window.execScript([// jshint ignore:line
'Function parseVB(code)', '\tExecuteGlobal(code)', 'End Function' //转换一段文本为VB代码 'Function parseVB(code)', '\tExecuteGlobal(code)', 'End Function' //转换一段文本为VB代码
].join('\n'), 'VBScript'); ].join('\n'), 'VBScript');
var VBMediator = function VBMediator(instance, accessors, name, value) { var VBMediator = function VBMediator(instance, accessors, name, value) {
@ -34214,7 +34214,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
// jshint ignore:line // jshint ignore:line
var buffer = []; var buffer = [];
buffer.push('\tPrivate [$vbsetter]', '\tPublic [$accessors]', '\tPublic Default Function [$vbthis](ac' + timeBucket + ', s' + timeBucket + ')', '\t\tSet [$accessors] = ac' + timeBucket + ': set [$vbsetter] = s' + timeBucket, '\t\tSet [$vbthis] = Me', //链式调用 buffer.push('\tPrivate [$vbsetter]', '\tPublic [$accessors]', '\tPublic Default Function [$vbthis](ac' + timeBucket + ', s' + timeBucket + ')', '\t\tSet [$accessors] = ac' + timeBucket + ': set [$vbsetter] = s' + timeBucket, '\t\tSet [$vbthis] = Me', //链式调用
'\tEnd Function'); '\tEnd Function');
//添加普通属性,因为VBScript对象不能像JS那样随意增删属性,必须在这里预先定义好 //添加普通属性,因为VBScript对象不能像JS那样随意增删属性,必须在这里预先定义好
var uniq = { var uniq = {
$vbthis: true, $vbthis: true,
@ -34234,12 +34234,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
} }
uniq[name] = true; uniq[name] = true;
buffer.push( buffer.push(
//由于不知对方会传入什么,因此set, let都用上 //由于不知对方会传入什么,因此set, let都用上
'\tPublic Property Let [' + name + '](val' + timeBucket + ')', //setter '\tPublic Property Let [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Set [' + name + '](val' + timeBucket + ')', //setter '\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Set [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Get [' + name + ']', //getter '\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Get [' + name + ']', //getter
'\tOn Error Resume Next', //必须优先使用set语句,否则它会误将数组当字符串返回 '\tOn Error Resume Next', //必须优先使用set语句,否则它会误将数组当字符串返回
'\t\tSet[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tIf Err.Number <> 0 Then', '\t\t[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tEnd If', '\tOn Error Goto 0', '\tEnd Property'); '\t\tSet[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tIf Err.Number <> 0 Then', '\t\t[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tEnd If', '\tOn Error Goto 0', '\tEnd Property');
} }
for (name in properties) { for (name in properties) {
@ -34257,7 +34257,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
className = makeHashCode('VBClass'); className = makeHashCode('VBClass');
window.parseVB('Class ' + className + body); window.parseVB('Class ' + className + body);
window.parseVB(['Function ' + className + 'Factory(acc, vbm)', //创建实例并传入两个关键的参数 window.parseVB(['Function ' + className + 'Factory(acc, vbm)', //创建实例并传入两个关键的参数
'\tDim o', '\tSet o = (New ' + className + ')(acc, vbm)', '\tSet ' + className + 'Factory = o', 'End Function'].join('\r\n')); '\tDim o', '\tSet o = (New ' + className + ')(acc, vbm)', '\tSet ' + className + 'Factory = o', 'End Function'].join('\r\n'));
VBClassPool[body] = className; VBClassPool[body] = className;
} }
var ret = window[className + 'Factory'](accessors, VBMediator); //得到其产品 var ret = window[className + 'Factory'](accessors, VBMediator); //得到其产品
@ -34355,8 +34355,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return ob; return ob;
} }
function notify(observer, key, dep) { function notify(observer, key, dep, refresh) {
dep.notify({ observer: observer, key: key }); dep.notify({ observer: observer, key: key, refresh: refresh });
if (observer) { if (observer) {
//触发a.*绑定的依赖 //触发a.*绑定的依赖
_.each(observer._deps, function (dep) { _.each(observer._deps, function (dep) {
@ -34712,10 +34712,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (this.active) { if (this.active) {
var value = this.get(); var value = this.get();
if (value !== this.value || if (value !== this.value ||
// Deep watchers and watchers on Object/Arrays should fire even // Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may // when the value is the same, because the value may
// have mutated. // have mutated.
_.isArray(value) || this.deep) { options && options.refresh || this.deep) {
// set new value // set new value
var oldValue = this.value; var oldValue = this.value;
this.value = value; this.value = value;
@ -50882,7 +50882,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
} }
}] }]
}, o.popup), }, o.popup),
stopPropagation: false, stopPropagation: true,
width: 230 width: 230
}, },
value: o.value value: o.value
@ -64023,10 +64023,10 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
valueTwo = o.digit === false ? valueTwo : valueTwo.toFixed(o.digit); valueTwo = o.digit === false ? valueTwo : valueTwo.toFixed(o.digit);
if (!isNaN(valueOne) && !isNaN(valueTwo)) { if (!isNaN(valueOne) && !isNaN(valueTwo)) {
if (this._checkValidation(valueOne)) { if (this._checkValidation(valueOne)) {
this.valueOne = valueOne; this.valueOne = (this.valueOne <= this.valueTwo ? valueOne : valueTwo);
} }
if (this._checkValidation(valueTwo)) { if (this._checkValidation(valueTwo)) {
this.valueTwo = valueTwo; this.valueTwo = (this.valueOne <= this.valueTwo ? valueTwo : valueOne);
} }
if (valueOne < this.min) { if (valueOne < this.min) {
this.valueOne = this.min; this.valueOne = this.min;
@ -74127,7 +74127,7 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_combo.item", type: "bi.single_select_item",
logic: { logic: {
dynamic: false dynamic: false
}, },
@ -74816,72 +74816,6 @@ BI.extend(BI.SingleSelectInsertCombo, {
BI.SingleSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.SingleSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.single_select_insert_combo", BI.SingleSelectInsertCombo);/** BI.shortcut("bi.single_select_insert_combo", BI.SingleSelectInsertCombo);/**
* guy
* 单选框item
* @type {*|void|Object}
*/
BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectComboItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-single-select-radio-item",
logic: {
dynamic: false
},
height: 24
});
},
_init: function () {
BI.SingleSelectComboItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.radio = BI.createWidget({
type: "bi.radio"
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
type: "bi.center_adapt",
items: [this.radio],
width: 26
}, this.text)
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.SingleSelectComboItem.superclass.doClick.apply(this, arguments);
this.radio.setSelected(this.isSelected());
},
setSelected: function (v) {
BI.SingleSelectComboItem.superclass.setSelected.apply(this, arguments);
this.radio.setSelected(v);
}
});
BI.shortcut("bi.single_select_combo.item", BI.SingleSelectComboItem);/**
* 选择列表 * 选择列表
* *
* Created by GUY on 2015/11/1. * Created by GUY on 2015/11/1.
@ -75119,7 +75053,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_combo.item", type: "bi.single_select_item",
logic: this.options.logic, logic: this.options.logic,
cls: "bi-list-item-active", cls: "bi-list-item-active",
height: 24, height: 24,

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

26
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/case.js vendored

@ -2258,7 +2258,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
} }
}] }]
}, o.popup), }, o.popup),
stopPropagation: false, stopPropagation: true,
width: 230 width: 230
}, },
value: o.value value: o.value

1111
dist/demo.js vendored

File diff suppressed because it is too large Load Diff

5
dist/fineui.css vendored

@ -2506,10 +2506,6 @@ textarea {
.bi-small-search-editor .search-font { .bi-small-search-editor .search-font {
font-size: 18px; font-size: 18px;
} }
.bi-sign-initial-editor .sign-initial-editor-text {
font-size: 14px;
}
.bi-message-title { .bi-message-title {
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
@ -2999,7 +2995,6 @@ body .bi-button.button-ignore.disabled.ghost .b-font:before,
color: #3685f2; color: #3685f2;
} }
.bi-switch { .bi-switch {
-webkit-border-radius: 40px 40px 40px 40px; -webkit-border-radius: 40px 40px 40px 40px;
-moz-border-radius: 40px 40px 40px 40px; -moz-border-radius: 40px 40px 40px 40px;

138
dist/fineui.js vendored

@ -34223,8 +34223,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
setImmediate(nextTickHandler); setImmediate(nextTickHandler);
}; };
} else if (typeof MessageChannel !== 'undefined' && (isNative(MessageChannel) || } else if (typeof MessageChannel !== 'undefined' && (isNative(MessageChannel) ||
// PhantomJS // PhantomJS
MessageChannel.toString() === '[object MessageChannelConstructor]')) { MessageChannel.toString() === '[object MessageChannelConstructor]')) {
var channel = new MessageChannel(); var channel = new MessageChannel();
var port = channel.port2; var port = channel.port2;
channel.port1.onmessage = nextTickHandler; channel.port1.onmessage = nextTickHandler;
@ -34232,19 +34232,19 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
port.postMessage(1); port.postMessage(1);
}; };
} else } else
/* istanbul ignore next */ /* istanbul ignore next */
if (typeof Promise !== 'undefined' && isNative(Promise)) { if (typeof Promise !== 'undefined' && isNative(Promise)) {
// use microtask in non-DOM environments, e.g. Weex // use microtask in non-DOM environments, e.g. Weex
var p = Promise.resolve(); var p = Promise.resolve();
timerFunc = function timerFunc() { timerFunc = function timerFunc() {
p.then(nextTickHandler); p.then(nextTickHandler);
}; };
} else { } else {
// fallback to setTimeout // fallback to setTimeout
timerFunc = function timerFunc() { timerFunc = function timerFunc() {
setTimeout(nextTickHandler, 0); setTimeout(nextTickHandler, 0);
}; };
} }
return function queueNextTick(cb, ctx) { return function queueNextTick(cb, ctx) {
var _resolve = void 0; var _resolve = void 0;
@ -34368,7 +34368,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
break; break;
} }
var result = original.apply(this, args); var result = original.apply(this, args);
notify(ob.parent, ob.parentKey, ob.dep); notify(ob.parent, ob.parentKey, ob.dep, true);
return result; return result;
}; };
}); });
@ -34419,7 +34419,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (isIE9Below) { if (isIE9Below) {
var VBClassPool = {}; var VBClassPool = {};
window.execScript([// jshint ignore:line window.execScript([// jshint ignore:line
'Function parseVB(code)', '\tExecuteGlobal(code)', 'End Function' //转换一段文本为VB代码 'Function parseVB(code)', '\tExecuteGlobal(code)', 'End Function' //转换一段文本为VB代码
].join('\n'), 'VBScript'); ].join('\n'), 'VBScript');
var VBMediator = function VBMediator(instance, accessors, name, value) { var VBMediator = function VBMediator(instance, accessors, name, value) {
@ -34435,7 +34435,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
// jshint ignore:line // jshint ignore:line
var buffer = []; var buffer = [];
buffer.push('\tPrivate [$vbsetter]', '\tPublic [$accessors]', '\tPublic Default Function [$vbthis](ac' + timeBucket + ', s' + timeBucket + ')', '\t\tSet [$accessors] = ac' + timeBucket + ': set [$vbsetter] = s' + timeBucket, '\t\tSet [$vbthis] = Me', //链式调用 buffer.push('\tPrivate [$vbsetter]', '\tPublic [$accessors]', '\tPublic Default Function [$vbthis](ac' + timeBucket + ', s' + timeBucket + ')', '\t\tSet [$accessors] = ac' + timeBucket + ': set [$vbsetter] = s' + timeBucket, '\t\tSet [$vbthis] = Me', //链式调用
'\tEnd Function'); '\tEnd Function');
//添加普通属性,因为VBScript对象不能像JS那样随意增删属性,必须在这里预先定义好 //添加普通属性,因为VBScript对象不能像JS那样随意增删属性,必须在这里预先定义好
var uniq = { var uniq = {
$vbthis: true, $vbthis: true,
@ -34455,12 +34455,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
} }
uniq[name] = true; uniq[name] = true;
buffer.push( buffer.push(
//由于不知对方会传入什么,因此set, let都用上 //由于不知对方会传入什么,因此set, let都用上
'\tPublic Property Let [' + name + '](val' + timeBucket + ')', //setter '\tPublic Property Let [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Set [' + name + '](val' + timeBucket + ')', //setter '\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Set [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Get [' + name + ']', //getter '\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Get [' + name + ']', //getter
'\tOn Error Resume Next', //必须优先使用set语句,否则它会误将数组当字符串返回 '\tOn Error Resume Next', //必须优先使用set语句,否则它会误将数组当字符串返回
'\t\tSet[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tIf Err.Number <> 0 Then', '\t\t[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tEnd If', '\tOn Error Goto 0', '\tEnd Property'); '\t\tSet[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tIf Err.Number <> 0 Then', '\t\t[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tEnd If', '\tOn Error Goto 0', '\tEnd Property');
} }
for (name in properties) { for (name in properties) {
@ -34478,7 +34478,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
className = makeHashCode('VBClass'); className = makeHashCode('VBClass');
window.parseVB('Class ' + className + body); window.parseVB('Class ' + className + body);
window.parseVB(['Function ' + className + 'Factory(acc, vbm)', //创建实例并传入两个关键的参数 window.parseVB(['Function ' + className + 'Factory(acc, vbm)', //创建实例并传入两个关键的参数
'\tDim o', '\tSet o = (New ' + className + ')(acc, vbm)', '\tSet ' + className + 'Factory = o', 'End Function'].join('\r\n')); '\tDim o', '\tSet o = (New ' + className + ')(acc, vbm)', '\tSet ' + className + 'Factory = o', 'End Function'].join('\r\n'));
VBClassPool[body] = className; VBClassPool[body] = className;
} }
var ret = window[className + 'Factory'](accessors, VBMediator); //得到其产品 var ret = window[className + 'Factory'](accessors, VBMediator); //得到其产品
@ -34576,8 +34576,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return ob; return ob;
} }
function notify(observer, key, dep) { function notify(observer, key, dep, refresh) {
dep.notify({ observer: observer, key: key }); dep.notify({ observer: observer, key: key, refresh: refresh });
if (observer) { if (observer) {
//触发a.*绑定的依赖 //触发a.*绑定的依赖
_.each(observer._deps, function (dep) { _.each(observer._deps, function (dep) {
@ -34933,10 +34933,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (this.active) { if (this.active) {
var value = this.get(); var value = this.get();
if (value !== this.value || if (value !== this.value ||
// Deep watchers and watchers on Object/Arrays should fire even // Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may // when the value is the same, because the value may
// have mutated. // have mutated.
_.isArray(value) || this.deep) { options && options.refresh || this.deep) {
// set new value // set new value
var oldValue = this.value; var oldValue = this.value;
this.value = value; this.value = value;
@ -51103,7 +51103,7 @@ BI.ColorChooser = BI.inherit(BI.Widget, {
} }
}] }]
}, o.popup), }, o.popup),
stopPropagation: false, stopPropagation: true,
width: 230 width: 230
}, },
value: o.value value: o.value
@ -64244,10 +64244,10 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
valueTwo = o.digit === false ? valueTwo : valueTwo.toFixed(o.digit); valueTwo = o.digit === false ? valueTwo : valueTwo.toFixed(o.digit);
if (!isNaN(valueOne) && !isNaN(valueTwo)) { if (!isNaN(valueOne) && !isNaN(valueTwo)) {
if (this._checkValidation(valueOne)) { if (this._checkValidation(valueOne)) {
this.valueOne = valueOne; this.valueOne = (this.valueOne <= this.valueTwo ? valueOne : valueTwo);
} }
if (this._checkValidation(valueTwo)) { if (this._checkValidation(valueTwo)) {
this.valueTwo = valueTwo; this.valueTwo = (this.valueOne <= this.valueTwo ? valueTwo : valueOne);
} }
if (valueOne < this.min) { if (valueOne < this.min) {
this.valueOne = this.min; this.valueOne = this.min;
@ -74348,7 +74348,7 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_combo.item", type: "bi.single_select_item",
logic: { logic: {
dynamic: false dynamic: false
}, },
@ -75037,72 +75037,6 @@ BI.extend(BI.SingleSelectInsertCombo, {
BI.SingleSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.SingleSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.single_select_insert_combo", BI.SingleSelectInsertCombo);/** BI.shortcut("bi.single_select_insert_combo", BI.SingleSelectInsertCombo);/**
* guy
* 单选框item
* @type {*|void|Object}
*/
BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectComboItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-single-select-radio-item",
logic: {
dynamic: false
},
height: 24
});
},
_init: function () {
BI.SingleSelectComboItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.radio = BI.createWidget({
type: "bi.radio"
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
type: "bi.center_adapt",
items: [this.radio],
width: 26
}, this.text)
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.SingleSelectComboItem.superclass.doClick.apply(this, arguments);
this.radio.setSelected(this.isSelected());
},
setSelected: function (v) {
BI.SingleSelectComboItem.superclass.setSelected.apply(this, arguments);
this.radio.setSelected(v);
}
});
BI.shortcut("bi.single_select_combo.item", BI.SingleSelectComboItem);/**
* 选择列表 * 选择列表
* *
* Created by GUY on 2015/11/1. * Created by GUY on 2015/11/1.
@ -75340,7 +75274,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_combo.item", type: "bi.single_select_item",
logic: this.options.logic, logic: this.options.logic,
cls: "bi-list-item-active", cls: "bi-list-item-active",
height: 24, height: 24,

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

26
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

62
dist/fix/fix.js vendored

@ -105,8 +105,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
setImmediate(nextTickHandler); setImmediate(nextTickHandler);
}; };
} else if (typeof MessageChannel !== 'undefined' && (isNative(MessageChannel) || } else if (typeof MessageChannel !== 'undefined' && (isNative(MessageChannel) ||
// PhantomJS // PhantomJS
MessageChannel.toString() === '[object MessageChannelConstructor]')) { MessageChannel.toString() === '[object MessageChannelConstructor]')) {
var channel = new MessageChannel(); var channel = new MessageChannel();
var port = channel.port2; var port = channel.port2;
channel.port1.onmessage = nextTickHandler; channel.port1.onmessage = nextTickHandler;
@ -114,19 +114,19 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
port.postMessage(1); port.postMessage(1);
}; };
} else } else
/* istanbul ignore next */ /* istanbul ignore next */
if (typeof Promise !== 'undefined' && isNative(Promise)) { if (typeof Promise !== 'undefined' && isNative(Promise)) {
// use microtask in non-DOM environments, e.g. Weex // use microtask in non-DOM environments, e.g. Weex
var p = Promise.resolve(); var p = Promise.resolve();
timerFunc = function timerFunc() { timerFunc = function timerFunc() {
p.then(nextTickHandler); p.then(nextTickHandler);
}; };
} else { } else {
// fallback to setTimeout // fallback to setTimeout
timerFunc = function timerFunc() { timerFunc = function timerFunc() {
setTimeout(nextTickHandler, 0); setTimeout(nextTickHandler, 0);
}; };
} }
return function queueNextTick(cb, ctx) { return function queueNextTick(cb, ctx) {
var _resolve = void 0; var _resolve = void 0;
@ -250,7 +250,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
break; break;
} }
var result = original.apply(this, args); var result = original.apply(this, args);
notify(ob.parent, ob.parentKey, ob.dep); notify(ob.parent, ob.parentKey, ob.dep, true);
return result; return result;
}; };
}); });
@ -301,7 +301,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (isIE9Below) { if (isIE9Below) {
var VBClassPool = {}; var VBClassPool = {};
window.execScript([// jshint ignore:line window.execScript([// jshint ignore:line
'Function parseVB(code)', '\tExecuteGlobal(code)', 'End Function' //转换一段文本为VB代码 'Function parseVB(code)', '\tExecuteGlobal(code)', 'End Function' //转换一段文本为VB代码
].join('\n'), 'VBScript'); ].join('\n'), 'VBScript');
var VBMediator = function VBMediator(instance, accessors, name, value) { var VBMediator = function VBMediator(instance, accessors, name, value) {
@ -317,7 +317,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
// jshint ignore:line // jshint ignore:line
var buffer = []; var buffer = [];
buffer.push('\tPrivate [$vbsetter]', '\tPublic [$accessors]', '\tPublic Default Function [$vbthis](ac' + timeBucket + ', s' + timeBucket + ')', '\t\tSet [$accessors] = ac' + timeBucket + ': set [$vbsetter] = s' + timeBucket, '\t\tSet [$vbthis] = Me', //链式调用 buffer.push('\tPrivate [$vbsetter]', '\tPublic [$accessors]', '\tPublic Default Function [$vbthis](ac' + timeBucket + ', s' + timeBucket + ')', '\t\tSet [$accessors] = ac' + timeBucket + ': set [$vbsetter] = s' + timeBucket, '\t\tSet [$vbthis] = Me', //链式调用
'\tEnd Function'); '\tEnd Function');
//添加普通属性,因为VBScript对象不能像JS那样随意增删属性,必须在这里预先定义好 //添加普通属性,因为VBScript对象不能像JS那样随意增删属性,必须在这里预先定义好
var uniq = { var uniq = {
$vbthis: true, $vbthis: true,
@ -337,12 +337,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
} }
uniq[name] = true; uniq[name] = true;
buffer.push( buffer.push(
//由于不知对方会传入什么,因此set, let都用上 //由于不知对方会传入什么,因此set, let都用上
'\tPublic Property Let [' + name + '](val' + timeBucket + ')', //setter '\tPublic Property Let [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Set [' + name + '](val' + timeBucket + ')', //setter '\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Set [' + name + '](val' + timeBucket + ')', //setter
'\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Get [' + name + ']', //getter '\t\tCall [$vbsetter](Me, [$accessors], "' + name + '", val' + timeBucket + ')', '\tEnd Property', '\tPublic Property Get [' + name + ']', //getter
'\tOn Error Resume Next', //必须优先使用set语句,否则它会误将数组当字符串返回 '\tOn Error Resume Next', //必须优先使用set语句,否则它会误将数组当字符串返回
'\t\tSet[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tIf Err.Number <> 0 Then', '\t\t[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tEnd If', '\tOn Error Goto 0', '\tEnd Property'); '\t\tSet[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tIf Err.Number <> 0 Then', '\t\t[' + name + '] = [$vbsetter](Me, [$accessors],"' + name + '")', '\tEnd If', '\tOn Error Goto 0', '\tEnd Property');
} }
for (name in properties) { for (name in properties) {
@ -360,7 +360,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
className = makeHashCode('VBClass'); className = makeHashCode('VBClass');
window.parseVB('Class ' + className + body); window.parseVB('Class ' + className + body);
window.parseVB(['Function ' + className + 'Factory(acc, vbm)', //创建实例并传入两个关键的参数 window.parseVB(['Function ' + className + 'Factory(acc, vbm)', //创建实例并传入两个关键的参数
'\tDim o', '\tSet o = (New ' + className + ')(acc, vbm)', '\tSet ' + className + 'Factory = o', 'End Function'].join('\r\n')); '\tDim o', '\tSet o = (New ' + className + ')(acc, vbm)', '\tSet ' + className + 'Factory = o', 'End Function'].join('\r\n'));
VBClassPool[body] = className; VBClassPool[body] = className;
} }
var ret = window[className + 'Factory'](accessors, VBMediator); //得到其产品 var ret = window[className + 'Factory'](accessors, VBMediator); //得到其产品
@ -458,8 +458,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
return ob; return ob;
} }
function notify(observer, key, dep) { function notify(observer, key, dep, refresh) {
dep.notify({ observer: observer, key: key }); dep.notify({ observer: observer, key: key, refresh: refresh });
if (observer) { if (observer) {
//触发a.*绑定的依赖 //触发a.*绑定的依赖
_.each(observer._deps, function (dep) { _.each(observer._deps, function (dep) {
@ -815,10 +815,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
if (this.active) { if (this.active) {
var value = this.get(); var value = this.get();
if (value !== this.value || if (value !== this.value ||
// Deep watchers and watchers on Object/Arrays should fire even // Deep watchers and watchers on Object/Arrays should fire even
// when the value is the same, because the value may // when the value is the same, because the value may
// have mutated. // have mutated.
_.isArray(value) || this.deep) { options && options.refresh || this.deep) {
// set new value // set new value
var oldValue = this.value; var oldValue = this.value;
this.value = value; this.value = value;

74
dist/widget.js vendored

@ -5622,10 +5622,10 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
valueTwo = o.digit === false ? valueTwo : valueTwo.toFixed(o.digit); valueTwo = o.digit === false ? valueTwo : valueTwo.toFixed(o.digit);
if (!isNaN(valueOne) && !isNaN(valueTwo)) { if (!isNaN(valueOne) && !isNaN(valueTwo)) {
if (this._checkValidation(valueOne)) { if (this._checkValidation(valueOne)) {
this.valueOne = valueOne; this.valueOne = (this.valueOne <= this.valueTwo ? valueOne : valueTwo);
} }
if (this._checkValidation(valueTwo)) { if (this._checkValidation(valueTwo)) {
this.valueTwo = valueTwo; this.valueTwo = (this.valueOne <= this.valueTwo ? valueTwo : valueOne);
} }
if (valueOne < this.min) { if (valueOne < this.min) {
this.valueOne = this.min; this.valueOne = this.min;
@ -15726,7 +15726,7 @@ BI.SingleSelectSearchLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_combo.item", type: "bi.single_select_item",
logic: { logic: {
dynamic: false dynamic: false
}, },
@ -16415,72 +16415,6 @@ BI.extend(BI.SingleSelectInsertCombo, {
BI.SingleSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM"; BI.SingleSelectInsertCombo.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.single_select_insert_combo", BI.SingleSelectInsertCombo);/** BI.shortcut("bi.single_select_insert_combo", BI.SingleSelectInsertCombo);/**
* guy
* 单选框item
* @type {*|void|Object}
*/
BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, {
_defaultConfig: function () {
return BI.extend(BI.SingleSelectComboItem.superclass._defaultConfig.apply(this, arguments), {
extraCls: "bi-single-select-radio-item",
logic: {
dynamic: false
},
height: 24
});
},
_init: function () {
BI.SingleSelectComboItem.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.radio = BI.createWidget({
type: "bi.radio"
});
this.text = BI.createWidget({
type: "bi.label",
cls: "list-item-text",
textAlign: "left",
whiteSpace: "nowrap",
textHeight: o.height,
height: o.height,
hgap: o.hgap,
text: o.text,
keyword: o.keyword,
value: o.value,
py: o.py
});
BI.createWidget(BI.extend({
element: this
}, BI.LogicFactory.createLogic("horizontal", BI.extend(o.logic, {
items: BI.LogicFactory.createLogicItemsByDirection("left", {
type: "bi.center_adapt",
items: [this.radio],
width: 26
}, this.text)
}))));
},
doRedMark: function () {
this.text.doRedMark.apply(this.text, arguments);
},
unRedMark: function () {
this.text.unRedMark.apply(this.text, arguments);
},
doClick: function () {
BI.SingleSelectComboItem.superclass.doClick.apply(this, arguments);
this.radio.setSelected(this.isSelected());
},
setSelected: function (v) {
BI.SingleSelectComboItem.superclass.setSelected.apply(this, arguments);
this.radio.setSelected(v);
}
});
BI.shortcut("bi.single_select_combo.item", BI.SingleSelectComboItem);/**
* 选择列表 * 选择列表
* *
* Created by GUY on 2015/11/1. * Created by GUY on 2015/11/1.
@ -16718,7 +16652,7 @@ BI.SingleSelectLoader = BI.inherit(BI.Widget, {
_createItems: function (items) { _createItems: function (items) {
return BI.createItems(items, { return BI.createItems(items, {
type: "bi.single_select_combo.item", type: "bi.single_select_item",
logic: this.options.logic, logic: this.options.logic,
cls: "bi-list-item-active", cls: "bi-list-item-active",
height: 24, height: 24,

Loading…
Cancel
Save