Skip to content

Commit

Permalink
fix: 币种组件不再显示币种效果
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYueKai committed Mar 13, 2017
1 parent 51a2f91 commit 70dac96
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 107 deletions.
108 changes: 63 additions & 45 deletions dist/neoui-kero.js
Expand Up @@ -4699,7 +4699,10 @@
var options = this.element.getElementsByTagName('option');
for (i = 0; i < options.length; i++) {
option = options[i];
datas.push({ value: option.value, name: option.text });
datas.push({
value: option.value,
name: option.text
});
}

this._input = this.element.querySelector("input");
Expand Down Expand Up @@ -4876,7 +4879,10 @@
(0, _event.off)(document, 'click', this.callback);
(0, _dom.removeClass)(this._ul, 'is-visible');
this._ul.style.zIndex = -1;
this.trigger('select', { value: this.value, name: this._input.value });
this.trigger('select', {
value: this.value,
name: this._input.value
});
},

/**
Expand All @@ -4893,7 +4899,10 @@
if (!options) this.comboDatas = datas;else {
this.comboDatas = [];
for (var i = 0; i < datas.length; i++) {
this.comboDatas.push({ name: datas[i][options.name], value: datas[i][options.value] });
this.comboDatas.push({
name: datas[i][options.name],
value: datas[i][options.value]
});
}
}

Expand Down Expand Up @@ -4940,6 +4949,9 @@
var flag;
if (this.fullWidth == 0) {
this.fullWidth = this._input.offsetWidth;
if (this.fullWidth < 0 || this.fullWidth == 0) {
this.fullWidth = parseInt($(this._input).width()) + parseInt($(this._input).css('border-left-width')) * 2 + parseInt($(this._input).css('padding-left')) * 2 + 'px';
}
if (this.fullWidth > 0) {
if (this._combo_name_par) {
this._combo_name_par.style.maxWidth = this.fullWidth + 'px';
Expand Down Expand Up @@ -5122,7 +5134,10 @@
if (!this.onlySelect && !matched) {
this.value = value;
this._input.value = value;
this.trigger('select', { value: this.value, name: this._input.value });
this.trigger('select', {
value: this.value,
name: this._input.value
});
}
},

Expand Down Expand Up @@ -5432,6 +5447,7 @@

var CurrencyAdapter = _keroaFloat.FloatAdapter.extend({
init: function init() {
_keroaFloat.FloatAdapter.prototype.init.call(this);
var self = this;
this.maskerMeta = _core.core.getMaskerMeta('currency') || {};
this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
Expand Down Expand Up @@ -16042,7 +16058,7 @@
fetch = true;
this.slice = true;
(0, _dom.addClass)(this.comp.element, 'is-checked');
this.comp._btnElement.click();
//this.comp._btnElement.click(); // https://github.com/iuap-design/tinper.org/issues/41
this.slice = false;
}
}
Expand Down Expand Up @@ -16488,50 +16504,51 @@
/***/ function(module, exports, __webpack_require__) {

var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (global, factory) {
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(52), __webpack_require__(56), __webpack_require__(55), __webpack_require__(53), __webpack_require__(15)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else if (typeof exports !== "undefined") {
factory(exports, require('./keroa-float'), require('tinper-sparrow/src/util/formater'), require('tinper-sparrow/src/util/masker'), require('tinper-sparrow/src/core'), require('compox/src/compMgr'));
} else {
var mod = {
exports: {}
};
factory(mod.exports, global.keroaFloat, global.formater, global.masker, global.core, global.compMgr);
global.keroaPercent = mod.exports;
}
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [exports, __webpack_require__(52), __webpack_require__(56), __webpack_require__(55), __webpack_require__(53), __webpack_require__(15)], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory), __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ? (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
} else if (typeof exports !== "undefined") {
factory(exports, require('./keroa-float'), require('tinper-sparrow/src/util/formater'), require('tinper-sparrow/src/util/masker'), require('tinper-sparrow/src/core'), require('compox/src/compMgr'));
} else {
var mod = {
exports: {}
};
factory(mod.exports, global.keroaFloat, global.formater, global.masker, global.core, global.compMgr);
global.keroaPercent = mod.exports;
}
})(this, function (exports, _keroaFloat, _formater, _masker, _core, _compMgr) {
'use strict';
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PercentAdapter = undefined;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PercentAdapter = undefined;

/**
* 百分比控件
*/
var PercentAdapter = _keroaFloat.FloatAdapter.extend({
init: function init() {
this.validType = 'float';
this.maskerMeta = _core.core.getMaskerMeta('percent') || {};
this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
if (this.maskerMeta.precision) {
this.maskerMeta.precision = parseInt(this.maskerMeta.precision) + 2;
}
this.formater = new _formater.NumberFormater(this.maskerMeta.precision);
this.masker = new _masker.PercentMasker(this.maskerMeta);
}
}); /**
* Module : Kero percent
* Author : Kvkens(yueming@yonyou.com)
* Date : 2016-08-09 20:02:50
*/
/**
* 百分比控件
*/
var PercentAdapter = _keroaFloat.FloatAdapter.extend({
init: function init() {
_keroaFloat.FloatAdapter.prototype.init.call(this);
this.validType = 'float';
this.maskerMeta = _core.core.getMaskerMeta('percent') || {};
this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
if (this.maskerMeta.precision) {
this.maskerMeta.precision = parseInt(this.maskerMeta.precision) + 2;
}
this.formater = new _formater.NumberFormater(this.maskerMeta.precision);
this.masker = new _masker.PercentMasker(this.maskerMeta);
}
}); /**
* Module : Kero percent
* Author : Kvkens(yueming@yonyou.com)
* Date : 2016-08-09 20:02:50
*/

_compMgr.compMgr.addDataAdapter({
adapter: PercentAdapter,
name: 'percent'
});
exports.PercentAdapter = PercentAdapter;
_compMgr.compMgr.addDataAdapter({
adapter: PercentAdapter,
name: 'percent'
});
exports.PercentAdapter = PercentAdapter;
});

/***/ },
Expand Down Expand Up @@ -17278,6 +17295,7 @@
*/
var LandLineAdapter = _keroaString.StringAdapter.extend({
init: function init() {
// StringAdapter.prototype.init.call(this);
var self = this;
this.element = this.element.nodeName === 'INPUT' ? this.element : this.element.querySelector('input');
LandLineAdapter.superclass.init.apply(this);
Expand Down
16 changes: 8 additions & 8 deletions dist/neoui-kero.min.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/keroa-currency.js
Expand Up @@ -30,6 +30,7 @@

var CurrencyAdapter = _keroaFloat.FloatAdapter.extend({
init: function init() {
_keroaFloat.FloatAdapter.prototype.init.call(this);
var self = this;
this.maskerMeta = _core.core.getMaskerMeta('currency') || {};
this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
Expand Down
1 change: 1 addition & 0 deletions lib/keroa-landLine.js
Expand Up @@ -23,6 +23,7 @@
*/
var LandLineAdapter = _keroaString.StringAdapter.extend({
init: function init() {
// StringAdapter.prototype.init.call(this);
var self = this;
this.element = this.element.nodeName === 'INPUT' ? this.element : this.element.querySelector('input');
LandLineAdapter.superclass.init.apply(this);
Expand Down
81 changes: 41 additions & 40 deletions lib/keroa-percent.js
@@ -1,46 +1,47 @@
(function (global, factory) {
if (typeof define === "function" && define.amd) {
define(['exports', './keroa-float', 'tinper-sparrow/src/util/formater', 'tinper-sparrow/src/util/masker', 'tinper-sparrow/src/core', 'compox/src/compMgr'], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require('./keroa-float'), require('tinper-sparrow/src/util/formater'), require('tinper-sparrow/src/util/masker'), require('tinper-sparrow/src/core'), require('compox/src/compMgr'));
} else {
var mod = {
exports: {}
};
factory(mod.exports, global.keroaFloat, global.formater, global.masker, global.core, global.compMgr);
global.keroaPercent = mod.exports;
}
if (typeof define === "function" && define.amd) {
define(['exports', './keroa-float', 'tinper-sparrow/src/util/formater', 'tinper-sparrow/src/util/masker', 'tinper-sparrow/src/core', 'compox/src/compMgr'], factory);
} else if (typeof exports !== "undefined") {
factory(exports, require('./keroa-float'), require('tinper-sparrow/src/util/formater'), require('tinper-sparrow/src/util/masker'), require('tinper-sparrow/src/core'), require('compox/src/compMgr'));
} else {
var mod = {
exports: {}
};
factory(mod.exports, global.keroaFloat, global.formater, global.masker, global.core, global.compMgr);
global.keroaPercent = mod.exports;
}
})(this, function (exports, _keroaFloat, _formater, _masker, _core, _compMgr) {
'use strict';
'use strict';

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PercentAdapter = undefined;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.PercentAdapter = undefined;

/**
* 百分比控件
*/
var PercentAdapter = _keroaFloat.FloatAdapter.extend({
init: function init() {
this.validType = 'float';
this.maskerMeta = _core.core.getMaskerMeta('percent') || {};
this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
if (this.maskerMeta.precision) {
this.maskerMeta.precision = parseInt(this.maskerMeta.precision) + 2;
}
this.formater = new _formater.NumberFormater(this.maskerMeta.precision);
this.masker = new _masker.PercentMasker(this.maskerMeta);
}
}); /**
* Module : Kero percent
* Author : Kvkens(yueming@yonyou.com)
* Date : 2016-08-09 20:02:50
*/
/**
* 百分比控件
*/
var PercentAdapter = _keroaFloat.FloatAdapter.extend({
init: function init() {
_keroaFloat.FloatAdapter.prototype.init.call(this);
this.validType = 'float';
this.maskerMeta = _core.core.getMaskerMeta('percent') || {};
this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
if (this.maskerMeta.precision) {
this.maskerMeta.precision = parseInt(this.maskerMeta.precision) + 2;
}
this.formater = new _formater.NumberFormater(this.maskerMeta.precision);
this.masker = new _masker.PercentMasker(this.maskerMeta);
}
}); /**
* Module : Kero percent
* Author : Kvkens(yueming@yonyou.com)
* Date : 2016-08-09 20:02:50
*/

_compMgr.compMgr.addDataAdapter({
adapter: PercentAdapter,
name: 'percent'
});
exports.PercentAdapter = PercentAdapter;
_compMgr.compMgr.addDataAdapter({
adapter: PercentAdapter,
name: 'percent'
});
exports.PercentAdapter = PercentAdapter;
});
2 changes: 1 addition & 1 deletion lib/keroa-radio.js
Expand Up @@ -204,7 +204,7 @@
fetch = true;
this.slice = true;
(0, _dom.addClass)(this.comp.element, 'is-checked');
this.comp._btnElement.click();
//this.comp._btnElement.click(); // https://github.com/iuap-design/tinper.org/issues/41
this.slice = false;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/keroa-currency.js
Expand Up @@ -20,6 +20,7 @@ import {CurrencyMasker} from 'tinper-sparrow/src/util/masker';
*/
var CurrencyAdapter = FloatAdapter.extend({
init: function () {
FloatAdapter.prototype.init.call(this);
var self = this;
this.maskerMeta = core.getMaskerMeta('currency') || {};
this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
Expand Down
3 changes: 2 additions & 1 deletion src/keroa-password.js
Expand Up @@ -15,6 +15,7 @@ import {compMgr} from 'compox/src/compMgr';
var PassWordAdapter = StringAdapter.extend({
init: function () {
var oThis = this;
StringAdapter.prototype.init.call(this);
if(env.isIE8){
var outStr = this.element.outerHTML;
var l = outStr.length;
Expand Down Expand Up @@ -42,7 +43,7 @@ var PassWordAdapter = StringAdapter.extend({
}
});
}

},
setShowValue: function (showValue) {
this.showValue = showValue;
Expand Down
33 changes: 23 additions & 10 deletions src/keroa-percent.js
Expand Up @@ -3,28 +3,41 @@
* Author : Kvkens(yueming@yonyou.com)
* Date : 2016-08-09 20:02:50
*/
import {FloatAdapter} from './keroa-float';
import {NumberFormater} from 'tinper-sparrow/src/util/formater';
import {PercentMasker} from 'tinper-sparrow/src/util/masker';
import {core} from 'tinper-sparrow/src/core';
import {compMgr} from 'compox/src/compMgr';
import {
FloatAdapter
} from './keroa-float';
import {
NumberFormater
} from 'tinper-sparrow/src/util/formater';
import {
PercentMasker
} from 'tinper-sparrow/src/util/masker';
import {
core
} from 'tinper-sparrow/src/core';
import {
compMgr
} from 'compox/src/compMgr';
/**
* 百分比控件
*/
var PercentAdapter = FloatAdapter.extend({
init: function () {
init: function() {
FloatAdapter.prototype.init.call(this);
this.validType = 'float';
this.maskerMeta = core.getMaskerMeta('percent') || {};
this.maskerMeta.precision = this.getOption('precision') || this.maskerMeta.precision;
if (this.maskerMeta.precision){
if (this.maskerMeta.precision) {
this.maskerMeta.precision = parseInt(this.maskerMeta.precision) + 2;
}
this.formater = new NumberFormater(this.maskerMeta.precision);
this.masker = new PercentMasker(this.maskerMeta);
}
});
compMgr.addDataAdapter({
adapter: PercentAdapter,
name: 'percent'
adapter: PercentAdapter,
name: 'percent'
});
export {PercentAdapter};
export {
PercentAdapter
};
2 changes: 1 addition & 1 deletion src/keroa-radio.js
Expand Up @@ -202,7 +202,7 @@ var RadioAdapter = BaseAdapter.extend({
fetch = true;
this.slice = true;
addClass(this.comp.element,'is-checked')
this.comp._btnElement.click();
//this.comp._btnElement.click(); // https://github.com/iuap-design/tinper.org/issues/41
this.slice = false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/keroa-url.js
Expand Up @@ -10,6 +10,7 @@ import {compMgr} from 'compox/src/compMgr';
var UrlAdapter = StringAdapter.extend({
init: function () {
this.validType = 'url';
UrlAdapter.superclass.init.apply(this);
/*
* 因为需要输入,因此不显示为超链接
*/
Expand Down Expand Up @@ -51,4 +52,3 @@ compMgr.addDataAdapter({
name: 'url'
});
export {UrlAdapter};

0 comments on commit 70dac96

Please sign in to comment.