Browse Source

Merge branch 'master' of ssh://cloud.finedevelop.com:7999/~kira/fineui

es6
Kira 4 years ago
parent
commit
8d367e73ed
  1. 7
      demo/js/config/fix.js
  2. 10
      demo/js/fix-2.0/context.js
  3. 102
      demo/js/fix-2.0/inject.js
  4. 2
      dist/2.0/fineui.css
  5. 4
      dist/2.0/fineui.ie.min.js
  6. 2
      dist/2.0/fineui.ie.min.js.map
  7. 5
      dist/2.0/fineui.js
  8. 2
      dist/2.0/fineui.js.map
  9. 2
      dist/2.0/fineui.min.css
  10. 4
      dist/2.0/fineui.min.js
  11. 2
      dist/2.0/fineui.min.js.map
  12. 2
      dist/2.0/fineui_without_normalize.css
  13. 2
      dist/2.0/fineui_without_normalize.min.css
  14. 2
      dist/bundle.min.css
  15. 4
      dist/bundle.min.js
  16. 2
      dist/bundle.min.js.map
  17. 2
      dist/demo.css
  18. 215
      dist/demo.js
  19. 2
      dist/demo.js.map
  20. 2
      dist/fineui.css
  21. 4
      dist/fineui.ie.min.js
  22. 2
      dist/fineui.ie.min.js.map
  23. 5
      dist/fineui.js
  24. 2
      dist/fineui.js.map
  25. 2
      dist/fineui.min.css
  26. 4
      dist/fineui.min.js
  27. 2
      dist/fineui.min.js.map
  28. 10
      dist/fineui_without_jquery_polyfill.js
  29. 2
      dist/fineui_without_jquery_polyfill.js.map
  30. 2
      dist/font.css
  31. 2
      dist/utils.js
  32. 2
      dist/utils.min.js
  33. 8
      karma.conf.js
  34. 2
      package.json
  35. 17
      src/case/combo/searchtextvaluecombo/__test__/combo.searchtextvaluecombo.test.js
  36. 2
      src/core/__test__/alias.test.js
  37. 322
      src/core/__test__/context.test.js
  38. 117
      src/widget/multiselect/__test__/multiselect.loader.nobar.test.js
  39. 7
      src/widget/multiselectlist/__test__/multiselectlist.insert.test.js
  40. 3
      src/widget/multiselectlist/multiselectlist.insert.js

7
demo/js/config/fix.js

@ -46,4 +46,9 @@ Demo.FIX_CONFIG = [{
pId: 7,
text: "场景",
value: "demo.fix_scene"
}];
}, {
id: 80,
pId: 7,
text: "inject",
value: "demo.fix_inject"
}];

10
demo/js/fix-2.0/context.js

@ -8,6 +8,8 @@
childContext: ["context"]
});
BI.model("demo.model.context.parent_store",ParentStore)
var ChildStore = BI.inherit(Fix.Model, {
context: ["context"],
computed: {
@ -22,9 +24,11 @@
}
});
BI.model("demo.model.context.child_store",ChildStore)
var Child = BI.inherit(BI.Widget, {
_store: function () {
return new ChildStore();
return BI.Models.getModel("demo.model.context.child_store");
},
watch: {
currContext: function (val) {
@ -53,7 +57,7 @@
var Parent = BI.inherit(BI.Widget, {
_store: function () {
return new ParentStore();
return BI.Models.getModel("demo.model.context.parent_store");
},
render: function () {
var self = this;
@ -72,4 +76,4 @@
});
BI.shortcut("demo.fix_context", Parent);
}());
}());

102
demo/js/fix-2.0/inject.js

@ -0,0 +1,102 @@
(function () {
var ParentStore = BI.inherit(Fix.Model, {
state: function () {
return {
context: {
one: {
key: "one.key"
}
}
};
},
childContext: ["context"],
actions: {
changeContext: function () {
this.model.context = {
two: {
key: "two.key"
}
};
}
}
});
BI.model("demo.model.inject.parent_store", ParentStore);
var ChildStore = BI.inherit(Fix.Model, {
inject: ["context"],
computed: {
currContext: function () {
return this.model.context.one.key;
}
},
actions: {
changeContext: function () {
this.model.context = {
one: {
key: "one.changed_key"
}
};
}
}
});
BI.model("demo.model.inject.child_store", ChildStore);
var Child = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel("demo.model.inject.child_store");
},
watch: {
currContext: function (val) {
this.button.setText(val);
}
},
render: function () {
var self = this;
return {
type: "bi.button",
ref: function () {
self.button = this;
},
text: this.model.currContext,
handler: function () {
self.store.changeContext();
}
};
},
});
BI.shortcut("demo.fix_inject_child", Child);
var Parent = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel("demo.model.inject.parent_store");
},
render: function () {
var self = this;
return {
type: "bi.vertical",
items: [{
el: {
type: "demo.fix_inject_child"
}
}, {
el: {
type: "bi.button",
text: "点击修改parent state",
handler: function () {
self.store.changeContext();
}
}
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.fix_inject", Parent);
}());

2
dist/2.0/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

5
dist/2.0/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-10-13 11:40:24 */
/*! time: 2020-10-19 14:10:27 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -54647,7 +54647,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
BI.MultiSelectInsertList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value || {};
this.storeValue = this._assertValue(o.value || {});
var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));
@ -54845,6 +54845,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
return val;
},
_makeMap: function (values) {

2
dist/2.0/fineui.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/2.0/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui_without_normalize.css vendored

File diff suppressed because one or more lines are too long

2
dist/2.0/fineui_without_normalize.min.css vendored

File diff suppressed because one or more lines are too long

2
dist/bundle.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/bundle.min.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/demo.css vendored

File diff suppressed because one or more lines are too long

215
dist/demo.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-10-13 11:40:24 */
/*! time: 2020-10-19 14:10:27 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -54647,7 +54647,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
BI.MultiSelectInsertList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value || {};
this.storeValue = this._assertValue(o.value || {});
var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));
@ -54845,6 +54845,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
return val;
},
_makeMap: function (values) {
@ -98447,7 +98448,8 @@ __webpack_require__(1246);
__webpack_require__(1247);
__webpack_require__(1248);
__webpack_require__(1249);
module.exports = __webpack_require__(1250);
__webpack_require__(1250);
module.exports = __webpack_require__(1251);
/***/ }),
@ -102865,8 +102867,14 @@ Demo.FIX_CONFIG = [{
pId: 7,
text: "场景",
value: "demo.fix_scene"
}, {
id: 80,
pId: 7,
text: "inject",
value: "demo.fix_inject"
}];
/***/ }),
/* 1161 */
/***/ (function(module, exports) {
@ -107173,6 +107181,8 @@ BI.shortcut("demo.face", Demo.Face);
childContext: ["context"]
});
BI.model("demo.model.context.parent_store",ParentStore)
var ChildStore = BI.inherit(Fix.Model, {
context: ["context"],
computed: {
@ -107187,9 +107197,11 @@ BI.shortcut("demo.face", Demo.Face);
}
});
BI.model("demo.model.context.child_store",ChildStore)
var Child = BI.inherit(BI.Widget, {
_store: function () {
return new ChildStore();
return BI.Models.getModel("demo.model.context.child_store");
},
watch: {
currContext: function (val) {
@ -107218,7 +107230,7 @@ BI.shortcut("demo.face", Demo.Face);
var Parent = BI.inherit(BI.Widget, {
_store: function () {
return new ParentStore();
return BI.Models.getModel("demo.model.context.parent_store");
},
render: function () {
var self = this;
@ -107239,6 +107251,7 @@ BI.shortcut("demo.face", Demo.Face);
BI.shortcut("demo.fix_context", Parent);
}());
/***/ }),
/* 1205 */
/***/ (function(module, exports) {
@ -107430,6 +107443,114 @@ BI.shortcut("demo.face", Demo.Face);
/* 1208 */
/***/ (function(module, exports) {
(function () {
var ParentStore = BI.inherit(Fix.Model, {
state: function () {
return {
context: {
one: {
key: "one.key"
}
}
};
},
childContext: ["context"],
actions: {
changeContext: function () {
this.model.context = {
two: {
key: "two.key"
}
};
}
}
});
BI.model("demo.model.inject.parent_store", ParentStore);
var ChildStore = BI.inherit(Fix.Model, {
inject: ["context"],
computed: {
currContext: function () {
return this.model.context.one.key;
}
},
actions: {
changeContext: function () {
this.model.context = {
one: {
key: "one.changed_key"
}
};
}
}
});
BI.model("demo.model.inject.child_store", ChildStore);
var Child = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel("demo.model.inject.child_store");
},
watch: {
currContext: function (val) {
this.button.setText(val);
}
},
render: function () {
var self = this;
return {
type: "bi.button",
ref: function () {
self.button = this;
},
text: this.model.currContext,
handler: function () {
self.store.changeContext();
}
};
},
});
BI.shortcut("demo.fix_inject_child", Child);
var Parent = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel("demo.model.inject.parent_store");
},
render: function () {
var self = this;
return {
type: "bi.vertical",
items: [{
el: {
type: "demo.fix_inject_child"
}
}, {
el: {
type: "bi.button",
text: "点击修改parent state",
handler: function () {
self.store.changeContext();
}
}
}]
};
},
mounted: function () {
}
});
BI.shortcut("demo.fix_inject", Parent);
}());
/***/ }),
/* 1209 */
/***/ (function(module, exports) {
/**
* @Author: Young
* @CreationDate 2017-11-06 10:32
@ -107877,7 +107998,7 @@ BI.shortcut("demo.face", Demo.Face);
})();
/***/ }),
/* 1209 */
/* 1210 */
/***/ (function(module, exports) {
(function () {
@ -107931,7 +108052,7 @@ BI.shortcut("demo.face", Demo.Face);
}());
/***/ }),
/* 1210 */
/* 1211 */
/***/ (function(module, exports) {
(function () {
@ -107996,7 +108117,7 @@ BI.shortcut("demo.face", Demo.Face);
}());
/***/ }),
/* 1211 */
/* 1212 */
/***/ (function(module, exports) {
(function () {
@ -108052,7 +108173,7 @@ BI.shortcut("demo.face", Demo.Face);
}());
/***/ }),
/* 1212 */
/* 1213 */
/***/ (function(module, exports) {
Demo.Main = BI.inherit(BI.Widget, {
@ -108118,7 +108239,7 @@ Demo.Main = BI.inherit(BI.Widget, {
BI.shortcut("demo.main", Demo.Main);
/***/ }),
/* 1213 */
/* 1214 */
/***/ (function(module, exports) {
!(function () {
@ -108188,7 +108309,7 @@ BI.shortcut("demo.main", Demo.Main);
})();
/***/ }),
/* 1214 */
/* 1215 */
/***/ (function(module, exports) {
Demo.North = BI.inherit(BI.Widget, {
@ -108239,7 +108360,7 @@ Demo.North.EVENT_VALUE_CHANGE = "EVENT_VALUE_CHANGE";
BI.shortcut("demo.north", Demo.North);
/***/ }),
/* 1215 */
/* 1216 */
/***/ (function(module, exports) {
Demo.Preview = BI.inherit(BI.Widget, {
@ -108325,7 +108446,7 @@ Demo.Preview = BI.inherit(BI.Widget, {
BI.shortcut("demo.preview", Demo.Preview);
/***/ }),
/* 1216 */
/* 1217 */
/***/ (function(module, exports) {
Demo.West = BI.inherit(BI.Widget, {
@ -108403,7 +108524,7 @@ Demo.West.EVENT_VALUE_CHANGE = "EVENT_VALUE_CHANGE";
BI.shortcut("demo.west", Demo.West);
/***/ }),
/* 1217 */
/* 1218 */
/***/ (function(module, exports) {
/**
@ -108488,7 +108609,7 @@ Demo.Buttons = BI.inherit(BI.Widget, {
BI.shortcut("demo.buttons", Demo.Buttons);
/***/ }),
/* 1218 */
/* 1219 */
/***/ (function(module, exports) {
/**
@ -108533,7 +108654,7 @@ Demo.Items = BI.inherit(BI.Widget, {
BI.shortcut("demo.items", Demo.Items);
/***/ }),
/* 1219 */
/* 1220 */
/***/ (function(module, exports) {
/**
@ -108574,7 +108695,7 @@ Demo.Nodes = BI.inherit(BI.Widget, {
BI.shortcut("demo.nodes", Demo.Nodes);
/***/ }),
/* 1220 */
/* 1221 */
/***/ (function(module, exports) {
/**
@ -108614,7 +108735,7 @@ Demo.Segments = BI.inherit(BI.Widget, {
BI.shortcut("demo.segments", Demo.Segments);
/***/ }),
/* 1221 */
/* 1222 */
/***/ (function(module, exports) {
/**
@ -108765,7 +108886,7 @@ Demo.Tips = BI.inherit(BI.Widget, {
BI.shortcut("demo.tips", Demo.Tips);
/***/ }),
/* 1222 */
/* 1223 */
/***/ (function(module, exports) {
Demo.DatePane = BI.inherit(BI.Widget, {
@ -108851,7 +108972,7 @@ Demo.DatePane = BI.inherit(BI.Widget, {
BI.shortcut("demo.date_pane", Demo.DatePane);
/***/ }),
/* 1223 */
/* 1224 */
/***/ (function(module, exports) {
/**
@ -108961,7 +109082,7 @@ Demo.Date = BI.inherit(BI.Widget, {
BI.shortcut("demo.multidate_combo", Demo.Date);
/***/ }),
/* 1224 */
/* 1225 */
/***/ (function(module, exports) {
/**
@ -109007,7 +109128,7 @@ Demo.CustomDateTime = BI.inherit(BI.Widget, {
BI.shortcut("demo.date_time", Demo.CustomDateTime);
/***/ }),
/* 1225 */
/* 1226 */
/***/ (function(module, exports) {
Demo.Downlist = BI.inherit(BI.Widget, {
@ -109205,7 +109326,7 @@ Demo.Downlist = BI.inherit(BI.Widget, {
BI.shortcut("demo.down_list", Demo.Downlist);
/***/ }),
/* 1226 */
/* 1227 */
/***/ (function(module, exports) {
/**
@ -109239,7 +109360,7 @@ Demo.SearchEditor = BI.inherit(BI.Widget, {
BI.shortcut("demo.search_editor", Demo.SearchEditor);
/***/ }),
/* 1227 */
/* 1228 */
/***/ (function(module, exports) {
/**
@ -109272,7 +109393,7 @@ Demo.TextEditor = BI.inherit(BI.Widget, {
BI.shortcut("demo.text_editor", Demo.TextEditor);
/***/ }),
/* 1228 */
/* 1229 */
/***/ (function(module, exports) {
/**
@ -109365,7 +109486,7 @@ Demo.MultiSelectCombo = BI.inherit(BI.Widget, {
BI.shortcut("demo.multi_select_combo", Demo.MultiSelectCombo);
/***/ }),
/* 1229 */
/* 1230 */
/***/ (function(module, exports) {
/**
@ -109465,7 +109586,7 @@ Demo.MultiSelectList = BI.inherit(BI.Widget, {
BI.shortcut("demo.multi_select_list", Demo.MultiSelectList);
/***/ }),
/* 1230 */
/* 1231 */
/***/ (function(module, exports) {
/**
@ -109525,7 +109646,7 @@ Demo.MultiTreeCombo = BI.inherit(BI.Widget, {
BI.shortcut("demo.multi_tree_combo", Demo.MultiTreeCombo);
/***/ }),
/* 1231 */
/* 1232 */
/***/ (function(module, exports) {
/**
@ -109599,7 +109720,7 @@ Demo.MultiTreeCombo = BI.inherit(BI.Widget, {
BI.shortcut("demo.multi_select_tree", Demo.MultiTreeCombo);
/***/ }),
/* 1232 */
/* 1233 */
/***/ (function(module, exports) {
/*
@ -109640,7 +109761,7 @@ Demo.FileManager = BI.inherit(BI.Widget, {
BI.shortcut("demo.number_editor", Demo.FileManager);
/***/ }),
/* 1233 */
/* 1234 */
/***/ (function(module, exports) {
/**
@ -109692,7 +109813,7 @@ Demo.NumericalInterval = BI.inherit(BI.Widget, {
BI.shortcut("demo.number_interval", Demo.NumericalInterval);
/***/ }),
/* 1234 */
/* 1235 */
/***/ (function(module, exports) {
/**
@ -109740,7 +109861,7 @@ Demo.MultiLayerSelectTreeCombo = BI.inherit(BI.Widget, {
BI.shortcut("demo.multilayer_select_tree_combo", Demo.MultiLayerSelectTreeCombo);
/***/ }),
/* 1235 */
/* 1236 */
/***/ (function(module, exports) {
/**
@ -109788,7 +109909,7 @@ Demo.SelectTreeCombo = BI.inherit(BI.Widget, {
BI.shortcut("demo.select_tree_combo", Demo.SelectTreeCombo);
/***/ }),
/* 1236 */
/* 1237 */
/***/ (function(module, exports) {
/**
@ -109892,7 +110013,7 @@ Demo.SingleSelectCombo = BI.inherit(BI.Widget, {
BI.shortcut("demo.single_select_combo", Demo.SingleSelectCombo);
/***/ }),
/* 1237 */
/* 1238 */
/***/ (function(module, exports) {
/**
@ -109939,7 +110060,7 @@ Demo.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
BI.shortcut("demo.multilayer_single_tree_combo", Demo.MultiLayerSingleTreeCombo);
/***/ }),
/* 1238 */
/* 1239 */
/***/ (function(module, exports) {
/**
@ -109987,7 +110108,7 @@ Demo.SingleTreeCombo = BI.inherit(BI.Widget, {
BI.shortcut("demo.single_tree_combo", Demo.SingleTreeCombo);
/***/ }),
/* 1239 */
/* 1240 */
/***/ (function(module, exports) {
/**
@ -110121,7 +110242,7 @@ Demo.Slider = BI.inherit(BI.Widget, {
BI.shortcut("demo.slider", Demo.Slider);
/***/ }),
/* 1240 */
/* 1241 */
/***/ (function(module, exports) {
/**
@ -110174,7 +110295,7 @@ Demo.TimeCombo = BI.inherit(BI.Widget, {
BI.shortcut("demo.time_combo", Demo.TimeCombo);
/***/ }),
/* 1241 */
/* 1242 */
/***/ (function(module, exports) {
/**
@ -110284,7 +110405,7 @@ Demo.TimeInterval = BI.inherit(BI.Widget, {
BI.shortcut("demo.time_interval", Demo.TimeInterval);
/***/ }),
/* 1242 */
/* 1243 */
/***/ (function(module, exports) {
/**
@ -110336,7 +110457,7 @@ Demo.MultiLayerSelectLevelTree = BI.inherit(BI.Widget, {
BI.shortcut("demo.multilayer_select_level_tree", Demo.MultiLayerSelectLevelTree);
/***/ }),
/* 1243 */
/* 1244 */
/***/ (function(module, exports) {
/**
@ -110413,7 +110534,7 @@ Demo.MultiLayerSingleLevelTree = BI.inherit(BI.Widget, {
BI.shortcut("demo.multilayer_single_level_tree", Demo.MultiLayerSingleLevelTree);
/***/ }),
/* 1244 */
/* 1245 */
/***/ (function(module, exports) {
/**
@ -110465,7 +110586,7 @@ Demo.SelectLevelTree = BI.inherit(BI.Widget, {
BI.shortcut("demo.select_level_tree", Demo.SelectLevelTree);
/***/ }),
/* 1245 */
/* 1246 */
/***/ (function(module, exports) {
/**
@ -110517,7 +110638,7 @@ Demo.SingleLevelTree = BI.inherit(BI.Widget, {
BI.shortcut("demo.single_level_tree", Demo.SingleLevelTree);
/***/ }),
/* 1246 */
/* 1247 */
/***/ (function(module, exports) {
/**
@ -110567,7 +110688,7 @@ Demo.Year = BI.inherit(BI.Widget, {
BI.shortcut("demo.year", Demo.Year);
/***/ }),
/* 1247 */
/* 1248 */
/***/ (function(module, exports) {
/**
@ -110621,7 +110742,7 @@ Demo.YearMonthCombo = BI.inherit(BI.Widget, {
BI.shortcut("demo.year_month_combo", Demo.YearMonthCombo);
/***/ }),
/* 1248 */
/* 1249 */
/***/ (function(module, exports) {
Demo.YearMonthInterval = BI.inherit(BI.Widget, {
@ -110671,7 +110792,7 @@ Demo.YearMonthInterval = BI.inherit(BI.Widget, {
BI.shortcut("demo.year_month_interval", Demo.YearMonthInterval);
/***/ }),
/* 1249 */
/* 1250 */
/***/ (function(module, exports) {
/**
@ -110726,7 +110847,7 @@ Demo.YearQuarterCombo = BI.inherit(BI.Widget, {
BI.shortcut("demo.year_quarter_combo", Demo.YearQuarterCombo);
/***/ }),
/* 1250 */
/* 1251 */
/***/ (function(module, exports) {
Demo.CONFIG = Demo.CORE_CONFIG.concat(Demo.BASE_CONFIG).concat(Demo.CASE_CONFIG).concat(Demo.WIDGET_CONFIG).concat(Demo.COMPONENT_CONFIG).concat(Demo.FIX_CONFIG);

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.ie.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.ie.min.js.map vendored

File diff suppressed because one or more lines are too long

5
dist/fineui.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-10-13 11:40:24 */
/*! time: 2020-10-19 14:10:27 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -54647,7 +54647,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
BI.MultiSelectInsertList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value || {};
this.storeValue = this._assertValue(o.value || {});
var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));
@ -54845,6 +54845,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
return val;
},
_makeMap: function (values) {

2
dist/fineui.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.css vendored

File diff suppressed because one or more lines are too long

4
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
dist/fineui.min.js.map vendored

File diff suppressed because one or more lines are too long

10
dist/fineui_without_jquery_polyfill.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-10-13 11:40:24 */
/*! time: 2020-10-19 14:10:27 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
@ -82,7 +82,7 @@
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1253);
/******/ return __webpack_require__(__webpack_require__.s = 1254);
/******/ })
/************************************************************************/
/******/ ([
@ -50679,7 +50679,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
BI.MultiSelectInsertList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value || {};
this.storeValue = this._assertValue(o.value || {});
var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));
@ -50877,6 +50877,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
return val;
},
_makeMap: function (values) {
@ -68893,7 +68894,8 @@ exports.Model = Model;
/* 1250 */,
/* 1251 */,
/* 1252 */,
/* 1253 */
/* 1253 */,
/* 1254 */
/***/ (function(module, exports, __webpack_require__) {
__webpack_require__(101);

2
dist/fineui_without_jquery_polyfill.js.map vendored

File diff suppressed because one or more lines are too long

2
dist/font.css vendored

File diff suppressed because one or more lines are too long

2
dist/utils.js vendored

@ -1,4 +1,4 @@
/*! time: 2020-10-13 11:40:24 */
/*! time: 2020-10-19 14:10:27 */
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};

2
dist/utils.min.js vendored

File diff suppressed because one or more lines are too long

8
karma.conf.js

@ -19,11 +19,7 @@ module.exports = function (config) {
// list of files / patterns to load in the browser
files: [
"src/css/core/**/*.css",
"src/css/theme/**/*.css",
"src/css/base/**/*.css",
"src/css/widget/**/*.css",
"public/css/app.css",
"dist/fineui.min.css",
"src/core/foundation.js",
"src/core/lodash.js",
"src/core/base.js",
@ -58,6 +54,8 @@ module.exports = function (config) {
"src/case/**/*.js",
"src/widget/**/*.js",
"src/component/**/*.js",
"dist/fix/fix.js",
"dist/fix/fix.compact.js",
"src/**/*.test.js",
"test/**/*.js"
],

2
package.json

@ -1,6 +1,6 @@
{
"name": "fineui",
"version": "2.0.20201013114147",
"version": "2.0.20201019141200",
"description": "fineui",
"main": "dist/fineui.min.js",
"types": "dist/lib/index.d.ts",

17
src/case/combo/searchtextvaluecombo/__test__/combo.searchtextvaluecombo.test.js

@ -6,12 +6,15 @@
describe("search_text_value_combo", function () {
var items = BI.map(BI.makeArray(100, null), function(idx, v) {
return {
text: idx,
value: idx,
title: idx
};
var items;
before(function () {
items = BI.map(BI.makeArray(100, null), function(idx, v) {
return {
text: idx,
value: idx,
title: idx
};
});
});
/**
@ -77,7 +80,7 @@ describe("search_text_value_combo", function () {
BI.nextTick(function () {
BI.Test.triggerKeyDown(widget.element.find(".bi-search-text-value-trigger .bi-input"), "2", 50, function () {
BI.nextTick(function () {
widget.element.find(".bi-search-text-value-popup .bi-single-select-item").click();
widget.element.find(".bi-search-text-value-popup .bi-single-select-item")[0].click();
expect(widget.getValue()[0]).to.deep.equal(2);
widget.destroy();
done();

2
src/core/__test__/alias.test.js

@ -18,7 +18,7 @@ describe("aliasFunctionTest", function () {
var targetString = "<a>1 2&</a>";
var encodeString = BI.htmlEncode(targetString);
expect(encodeString).to.equal("&lt;a&gt;1 2&amp;&lt;/a&gt;");
expect(encodeString).to.equal("&lt;a&gt;1&nbsp;2&amp;&lt;/a&gt;");
expect(BI.htmlDecode(encodeString)).to.equal(targetString);
});

322
src/core/__test__/context.test.js

@ -0,0 +1,322 @@
/**
* Created by windy on 2018/01/23.
*/
describe("contextTest", function () {
before(function () {
});
/**
* test_author_guy
*/
it("context测试", function () {
var ParentStore = BI.inherit(Fix.Model, {
state: function () {
return {
context: "默认context"
};
},
childContext: ["context"]
});
BI.model("demo.model.parent_store", ParentStore);
var ChildStore = BI.inherit(Fix.Model, {
context: ["context"],
computed: {
currContext: function () {
return this.model.context;
}
},
actions: {
changeContext: function () {
this.model.context = "改变后的context";
}
}
});
BI.model("demo.model.child_store", ChildStore);
var Label = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel("demo.model.child_store");
},
render: function () {
return {
type: "bi.label",
text: this.model.currContext
};
}
});
BI.shortcut("demo.label", Label);
var Demo = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel("demo.model.parent_store");
},
render: function () {
var self = this;
return {
type: "demo.label",
ref: function (_ref) {
self.child = _ref;
}
};
}
});
BI.shortcut("demo.demo", Demo);
var demo = BI.Test.createWidget({
type: "demo.demo"
});
expect(demo.child.model.currContext).to.equal("默认context");
demo.child.store.changeContext();
expect(demo.model.context).to.equal("改变后的context");
demo.destroy();
});
/**
* test_author_guy
*/
it("异步context测试-loader的populate测试", function (done) {
var ParentStore = BI.inherit(Fix.Model, {
state: function () {
return {
context: "默认context"
};
},
childContext: ["context"]
});
BI.model("demo.model.parent_store", ParentStore);
var ChildStore = BI.inherit(Fix.Model, {
context: ["context"],
computed: {
currContext: function () {
return this.model.context;
}
},
actions: {
changeContext: function () {
this.model.context = "改变后的context";
}
}
});
BI.model("demo.model.child_store", ChildStore);
var Label = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel("demo.model.child_store");
},
render: function () {
return {
type: "bi.label",
text: this.model.currContext
};
}
});
BI.shortcut("demo.label", Label);
var Demo = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel("demo.model.parent_store");
},
render: function () {
var items = BI.map([1, 2, 3], function (i, v) {
return {
text: v,
value: v,
title: v
};
});
var self = this;
this.labels = {};
return {
type: "bi.loader",
ref: function (_ref) {
self.child = _ref;
},
itemsCreator: function (options, populate) {
setTimeout(function () {
populate(BI.map(items.slice((options.times - 1) * 10, options.times * 10), function (i, v) {
return BI.extend(v, {
type: "demo.label",
ref: function (_ref) {
self.labels[i] = _ref;
},
height: 25
});
}));
}, 0);
},
hasNext: function (options) {
return options.times * 10 < items.length;
}
};
}
});
BI.shortcut("demo.demo", Demo);
var demo = BI.Test.createWidget({
type: "demo.demo"
});
demo.child.populate();
setTimeout(function () {
expect(demo.labels[0].model.currContext).to.equal("默认context");
demo.destroy();
done();
}, 0);
});
/**
* test_author_guy
*/
it("异步context测试-beforeInit测试", function (done) {
var ParentStore = BI.inherit(Fix.Model, {
state: function () {
return {
context: "默认context"
};
},
childContext: ["context"]
});
BI.model("demo.model.parent_store", ParentStore);
var ChildStore = BI.inherit(Fix.Model, {
context: ["context"],
computed: {
currContext: function () {
return this.model.context;
}
},
actions: {
changeContext: function () {
this.model.context = "改变后的context";
}
}
});
BI.model("demo.model.child_store", ChildStore);
var Label = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel("demo.model.child_store");
},
render: function () {
return {
type: "bi.label",
text: this.model.currContext
};
}
});
BI.shortcut("demo.label", Label);
var Demo = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel("demo.model.parent_store");
},
beforeInit: function (callback) {
setTimeout(callback, 0);
},
render: function () {
var self = this;
return {
type: "demo.label",
ref: function (_ref) {
self.child = _ref;
}
};
}
});
BI.shortcut("demo.demo", Demo);
var demo = BI.Test.createWidget({
type: "demo.demo"
});
setTimeout(function () {
expect(demo.child.model.currContext).to.equal("默认context");
demo.destroy();
done();
}, 0);
});
/**
* test_author_guy
*/
it("inject测试", function () {
var ParentStore = BI.inherit(Fix.Model, {
state: function () {
return {
context: "默认context"
};
},
childContext: ["context"]
});
BI.model("demo.model.parent_store", ParentStore);
var ChildStore = BI.inherit(Fix.Model, {
inject: ["context"],
computed: {
currContext: function () {
return this.model.context;
}
},
actions: {
changeContext: function () {
this.model.context = "改变后的context";
}
}
});
BI.model("demo.model.child_store", ChildStore);
var Label = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel("demo.model.child_store");
},
render: function () {
return {
type: "bi.label",
text: this.model.currContext
};
}
});
BI.shortcut("demo.label", Label);
var Demo = BI.inherit(BI.Widget, {
_store: function () {
return BI.Models.getModel("demo.model.parent_store");
},
render: function () {
var self = this;
return {
type: "demo.label",
ref: function (_ref) {
self.child = _ref;
}
};
}
});
BI.shortcut("demo.demo", Demo);
var demo = BI.Test.createWidget({
type: "demo.demo"
});
expect(demo.child.model.currContext).to.equal("默认context");
demo.child.store.changeContext();
expect(demo.model.context).to.equal("默认context");
demo.destroy();
});
});

117
src/widget/multiselect/__test__/multiselect.loader.nobar.test.js

@ -6,67 +6,71 @@
describe("multi_select_no_bar_series", function () {
var _getItemsByTimes = function (items, times) {
var res = [];
for (var i = (times - 1) * 100; items[i] && i < times * 100; i++) {
res.push(items[i]);
}
return res;
};
var _getItemsByTimes, _itemsCreator, itemSelectorGetter, searchItemSelectorGetter, _hasNextByTimes, items;
before(function () {
_getItemsByTimes = function (items, times) {
var res = [];
for (var i = (times - 1) * 100; items[i] && i < times * 100; i++) {
res.push(items[i]);
}
return res;
};
var _hasNextByTimes = function (items, times) {
return times * 100 < items.length;
};
_hasNextByTimes = function (items, times) {
return times * 100 < items.length;
};
var _itemsCreator = function (options, callback) {
var items = BI.map(BI.makeArray(100, null), function(idx, v) {
return {
text: idx,
value: idx,
title: idx
};
});
var keywords = (options.keywords || []).slice();
if (options.keyword) {
keywords.push(options.keyword);
}
BI.each(keywords, function (i, kw) {
var search = BI.Func.getSearchResult(items, kw);
items = search.match.concat(search.find);
});
if (options.selectedValues) {// 过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
_itemsCreator = function (options, callback) {
var items = BI.map(BI.makeArray(100, null), function(idx, v) {
return {
text: idx,
value: idx,
title: idx
};
});
var keywords = (options.keywords || []).slice();
if (options.keyword) {
keywords.push(options.keyword);
}
BI.each(keywords, function (i, kw) {
var search = BI.Func.getSearchResult(items, kw);
items = search.match.concat(search.find);
});
}
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
if (options.selectedValues) {// 过滤
var filter = BI.makeObject(options.selectedValues, true);
items = BI.filter(items, function (i, ob) {
return !filter[ob.value];
});
}
if (options.type == BI.MultiSelectCombo.REQ_GET_ALL_DATA) {
callback({
items: items
});
return;
}
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}
callback({
items: items
items: _getItemsByTimes(items, options.times),
hasNext: _hasNextByTimes(items, options.times)
});
return;
}
if (options.type == BI.MultiSelectCombo.REQ_GET_DATA_LENGTH) {
callback({count: items.length});
return;
}
callback({
items: _getItemsByTimes(items, options.times),
hasNext: _hasNextByTimes(items, options.times)
});
};
};
var itemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
itemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-popup-view .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
var searchItemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
searchItemSelectorGetter = function (array) {
return BI.map(array, function (idx, num) {
return ".bi-multi-select-search-pane .bi-loader .bi-button-group .bi-multi-select-item:nth-child(" + num + ")";
});
};
})
/**
* test_author_windy
@ -159,7 +163,10 @@ describe("multi_select_no_bar_series", function () {
type: "bi.multi_select_no_bar_combo",
width: 220,
itemsCreator: function (op, callback) {
callback(items);
callback({
items: items,
hasNext: false
});
},
value: [1, 2]
});

7
src/widget/multiselectlist/__test__/multiselectlist.insert.test.js

@ -144,6 +144,13 @@ describe("multi_list_insert_pane", function () {
type: "bi.multi_select_insert_list",
width: 220,
itemsCreator: function (op, callback) {
if (op.keywords) {
callback({
items: [],
hasNext: false
})
return;
}
callback({
items: items,
hasNext: false

3
src/widget/multiselectlist/multiselectlist.insert.js

@ -15,7 +15,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
BI.MultiSelectInsertList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.storeValue = o.value || {};
this.storeValue = this._assertValue(o.value || {});
var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));
@ -213,6 +213,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
return val;
},
_makeMap: function (values) {

Loading…
Cancel
Save