Browse Source

Merge branch 'master' of http://cloud.finedevelop.com:2015/scm/visual/fineui

# Conflicts:
#	dist/base.js
#	dist/bundle.ie.js
#	dist/bundle.ie.min.js
#	dist/bundle.js
#	dist/bundle.min.js
#	dist/fineui.ie.js
#	dist/fineui.ie.min.js
#	dist/fineui.js
#	dist/fineui.min.js
#	dist/fineui_without_jquery_polyfill.js
#	dist/utils.min.js
#	src/base/combination/loader.js
es6
windy 6 years ago
parent
commit
7482e77dc0
  1. 61
      dist/bundle.ie.js
  2. 61
      dist/bundle.js
  3. 12
      dist/case.js
  4. 2
      dist/core.js
  5. 61
      dist/fineui.ie.js
  6. 61
      dist/fineui.js
  7. 61
      dist/fineui_without_jquery_polyfill.js
  8. 2
      dist/utils.js
  9. 47
      dist/widget.js
  10. 9
      src/case/combo/icontextvaluecombo/popup.icontextvalue.js
  11. 47
      src/component/treevaluechooser/abstract.treevaluechooser.js
  12. 2
      src/core/inject.js

61
dist/bundle.ie.js vendored

@ -18631,7 +18631,7 @@ _.extend(BI, {
providers[type] = new providerInjection[type](); providers[type] = new providerInjection[type]();
} }
if (!providerInstance[type]) { if (!providerInstance[type]) {
providerInstance[type] = new providers[type].$get()(config); providerInstance[type] = new (providers[type].$get())(config);
} }
return providerInstance[type]; return providerInstance[type];
} }
@ -53805,6 +53805,11 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
layouts: [{ layouts: [{
type: "bi.vertical" type: "bi.vertical"
}], }],
behaviors: {
redmark: function () {
return true;
}
},
value: o.value value: o.value
}); });
@ -53823,7 +53828,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
}); });
}, },
populate: function (items) { populate: function (items, keyword) {
BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments); BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments);
var o = this.options; var o = this.options;
items = BI.createItems(items, { items = BI.createItems(items, {
@ -53833,7 +53838,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
iconHeight: o.iconHeight, iconHeight: o.iconHeight,
iconWidth: o.iconWidth iconWidth: o.iconWidth
}); });
this.popup.populate(items); this.popup.populate(items, keyword);
}, },
getValue: function () { getValue: function () {
@ -53846,7 +53851,8 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
}); });
BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);/** BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);
/**
* Created by Windy on 2018/2/2. * Created by Windy on 2018/2/2.
*/ */
BI.SearchTextValueCombo = BI.inherit(BI.Widget, { BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
@ -81478,7 +81484,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} else { } else {
call(); call();
} }
function call () {
function call() {
switch (options.type) { switch (options.type) {
case BI.TreeView.REQ_TYPE_INIT_DATA: case BI.TreeView.REQ_TYPE_INIT_DATA:
self._reqInitTreeNode(options, callback); self._reqInitTreeNode(options, callback);
@ -81515,7 +81522,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
items: result items: result
}); });
function doCheck (parentValues, node, selected) { function doCheck(parentValues, node, selected) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
BI.each(node.getChildren(), function (i, child) { BI.each(node.getChildren(), function (i, child) {
var newParents = BI.clone(parentValues); var newParents = BI.clone(parentValues);
@ -81535,7 +81542,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function getCount (jo, parentValues) { function getCount(jo, parentValues) {
if (jo == null) { if (jo == null) {
return 0; return 0;
} }
@ -81546,7 +81553,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return BI.size(jo); return BI.size(jo);
} }
function createOneJson (node, pId, llen) { function createOneJson(node, pId, llen) {
result.push({ result.push({
id: node.id, id: node.id,
pId: pId, pId: pId,
@ -81573,7 +81580,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
callback(selectedValues); callback(selectedValues);
function dealWithSelectedValues (selectedValues) { function dealWithSelectedValues(selectedValues) {
var p = parentValues.concat(notSelectedValue); var p = parentValues.concat(notSelectedValue);
// 存储的值中存在这个值就把它删掉 // 存储的值中存在这个值就把它删掉
// 例如选中了中国-江苏-南京, 取消中国或江苏或南京 // 例如选中了中国-江苏-南京, 取消中国或江苏或南京
@ -81629,7 +81636,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} }
function expandSelectedValue (selectedValues, parents, notSelectedValue) { function expandSelectedValue(selectedValues, parents, notSelectedValue) {
var next = selectedValues; var next = selectedValues;
var childrenCount = []; var childrenCount = [];
var path = []; var path = [];
@ -81674,7 +81681,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function search (parents, current, result, searched) { function search(parents, current, result, searched) {
var newParents = BI.clone(parents); var newParents = BI.clone(parents);
newParents.push(current); newParents.push(current);
if (self._isMatch(parents, current, keyword)) { if (self._isMatch(parents, current, keyword)) {
@ -81704,16 +81711,16 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can; return can;
} }
function isSearchValueInParent (parentValues) { function isSearchValueInParent(parentValues) {
for (var i = 0, len = parentValues.length; i < len; i++) { for (var i = 0, len = parentValues.length; i < len; i++) {
if (self._isMatch(parentValues.slice(0, parentValues.length - 1), parentValues[i], keyword)) { if (self._isMatch(parentValues.slice(0, parentValues.length - 1 - i), parentValues[i], keyword)) {
return true; return true;
} }
} }
return false; return false;
} }
function canFindKey (selectedValues, parents) { function canFindKey(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -81725,7 +81732,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return true; return true;
} }
function isChild (selectedValues, parents) { function isChild(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -81761,7 +81768,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
callback(jo); callback(jo);
function dealWithSelectedValues (selected, parents) { function dealWithSelectedValues(selected, parents) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
return true; return true;
} }
@ -81781,7 +81788,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can && isAllSelected(selected, parents); return can && isAllSelected(selected, parents);
} }
function isAllSelected (selected, parents) { function isAllSelected(selected, parents) {
return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected); return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected);
} }
}, },
@ -81801,7 +81808,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function search () { function search() {
var children = self._getChildren([]); var children = self._getChildren([]);
var start = children.length; var start = children.length;
if (lastSearchValue !== "") { if (lastSearchValue !== "") {
@ -81831,7 +81838,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return output; return output;
} }
function nodeSearch (deep, parentValues, current, isAllSelect, result) { function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(parentValues, current, keyword)) { if (self._isMatch(parentValues, current, keyword)) {
var checked = isAllSelect || isSelected(parentValues, current); var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result); createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
@ -81860,7 +81867,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return [can, checked]; return [can, checked];
} }
function createOneJson (parentValues, value, isOpen, checked, half, flag, result) { function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self._getTreeNode(parentValues, value); var node = self._getTreeNode(parentValues, value);
result.push({ result.push({
id: node.id, id: node.id,
@ -81876,7 +81883,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isHalf (parentValues, value) { function isHalf(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -81890,7 +81897,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isAllSelected (parentValues, value) { function isAllSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -81904,7 +81911,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isSelected (parentValues, value) { function isSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return false; return false;
@ -81916,7 +81923,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function findSelectedObj (parentValues) { function findSelectedObj(parentValues) {
var find = selectedValues; var find = selectedValues;
if (find == null) { if (find == null) {
return null; return null;
@ -81964,7 +81971,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function judgeState (parentValues, selected_value, checkState) { function judgeState(parentValues, selected_value, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
if (parentValues.length > 0 && !checked) { if (parentValues.length > 0 && !checked) {
return false; return false;
@ -81972,7 +81979,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
} }
function dealWidthSelectedValue (parentValues, selectedValues) { function dealWidthSelectedValue(parentValues, selectedValues) {
var valueMap = {}; var valueMap = {};
BI.each(parentValues, function (i, v) { BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {}; selectedValues = selectedValues[v] || {};
@ -81997,7 +82004,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return valueMap; return valueMap;
} }
function getCheckState (current, parentValues, valueMap, checkState) { function getCheckState(current, parentValues, valueMap, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false; var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) { if (BI.has(valueMap, current)) {

61
dist/bundle.js vendored

@ -18631,7 +18631,7 @@ _.extend(BI, {
providers[type] = new providerInjection[type](); providers[type] = new providerInjection[type]();
} }
if (!providerInstance[type]) { if (!providerInstance[type]) {
providerInstance[type] = new providers[type].$get()(config); providerInstance[type] = new (providers[type].$get())(config);
} }
return providerInstance[type]; return providerInstance[type];
} }
@ -54209,6 +54209,11 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
layouts: [{ layouts: [{
type: "bi.vertical" type: "bi.vertical"
}], }],
behaviors: {
redmark: function () {
return true;
}
},
value: o.value value: o.value
}); });
@ -54227,7 +54232,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
}); });
}, },
populate: function (items) { populate: function (items, keyword) {
BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments); BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments);
var o = this.options; var o = this.options;
items = BI.createItems(items, { items = BI.createItems(items, {
@ -54237,7 +54242,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
iconHeight: o.iconHeight, iconHeight: o.iconHeight,
iconWidth: o.iconWidth iconWidth: o.iconWidth
}); });
this.popup.populate(items); this.popup.populate(items, keyword);
}, },
getValue: function () { getValue: function () {
@ -54250,7 +54255,8 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
}); });
BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);/** BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);
/**
* Created by Windy on 2018/2/2. * Created by Windy on 2018/2/2.
*/ */
BI.SearchTextValueCombo = BI.inherit(BI.Widget, { BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
@ -81882,7 +81888,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} else { } else {
call(); call();
} }
function call () {
function call() {
switch (options.type) { switch (options.type) {
case BI.TreeView.REQ_TYPE_INIT_DATA: case BI.TreeView.REQ_TYPE_INIT_DATA:
self._reqInitTreeNode(options, callback); self._reqInitTreeNode(options, callback);
@ -81919,7 +81926,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
items: result items: result
}); });
function doCheck (parentValues, node, selected) { function doCheck(parentValues, node, selected) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
BI.each(node.getChildren(), function (i, child) { BI.each(node.getChildren(), function (i, child) {
var newParents = BI.clone(parentValues); var newParents = BI.clone(parentValues);
@ -81939,7 +81946,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function getCount (jo, parentValues) { function getCount(jo, parentValues) {
if (jo == null) { if (jo == null) {
return 0; return 0;
} }
@ -81950,7 +81957,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return BI.size(jo); return BI.size(jo);
} }
function createOneJson (node, pId, llen) { function createOneJson(node, pId, llen) {
result.push({ result.push({
id: node.id, id: node.id,
pId: pId, pId: pId,
@ -81977,7 +81984,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
callback(selectedValues); callback(selectedValues);
function dealWithSelectedValues (selectedValues) { function dealWithSelectedValues(selectedValues) {
var p = parentValues.concat(notSelectedValue); var p = parentValues.concat(notSelectedValue);
// 存储的值中存在这个值就把它删掉 // 存储的值中存在这个值就把它删掉
// 例如选中了中国-江苏-南京, 取消中国或江苏或南京 // 例如选中了中国-江苏-南京, 取消中国或江苏或南京
@ -82033,7 +82040,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} }
function expandSelectedValue (selectedValues, parents, notSelectedValue) { function expandSelectedValue(selectedValues, parents, notSelectedValue) {
var next = selectedValues; var next = selectedValues;
var childrenCount = []; var childrenCount = [];
var path = []; var path = [];
@ -82078,7 +82085,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function search (parents, current, result, searched) { function search(parents, current, result, searched) {
var newParents = BI.clone(parents); var newParents = BI.clone(parents);
newParents.push(current); newParents.push(current);
if (self._isMatch(parents, current, keyword)) { if (self._isMatch(parents, current, keyword)) {
@ -82108,16 +82115,16 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can; return can;
} }
function isSearchValueInParent (parentValues) { function isSearchValueInParent(parentValues) {
for (var i = 0, len = parentValues.length; i < len; i++) { for (var i = 0, len = parentValues.length; i < len; i++) {
if (self._isMatch(parentValues.slice(0, parentValues.length - 1), parentValues[i], keyword)) { if (self._isMatch(parentValues.slice(0, parentValues.length - 1 - i), parentValues[i], keyword)) {
return true; return true;
} }
} }
return false; return false;
} }
function canFindKey (selectedValues, parents) { function canFindKey(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -82129,7 +82136,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return true; return true;
} }
function isChild (selectedValues, parents) { function isChild(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -82165,7 +82172,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
callback(jo); callback(jo);
function dealWithSelectedValues (selected, parents) { function dealWithSelectedValues(selected, parents) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
return true; return true;
} }
@ -82185,7 +82192,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can && isAllSelected(selected, parents); return can && isAllSelected(selected, parents);
} }
function isAllSelected (selected, parents) { function isAllSelected(selected, parents) {
return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected); return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected);
} }
}, },
@ -82205,7 +82212,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function search () { function search() {
var children = self._getChildren([]); var children = self._getChildren([]);
var start = children.length; var start = children.length;
if (lastSearchValue !== "") { if (lastSearchValue !== "") {
@ -82235,7 +82242,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return output; return output;
} }
function nodeSearch (deep, parentValues, current, isAllSelect, result) { function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(parentValues, current, keyword)) { if (self._isMatch(parentValues, current, keyword)) {
var checked = isAllSelect || isSelected(parentValues, current); var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result); createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
@ -82264,7 +82271,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return [can, checked]; return [can, checked];
} }
function createOneJson (parentValues, value, isOpen, checked, half, flag, result) { function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self._getTreeNode(parentValues, value); var node = self._getTreeNode(parentValues, value);
result.push({ result.push({
id: node.id, id: node.id,
@ -82280,7 +82287,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isHalf (parentValues, value) { function isHalf(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -82294,7 +82301,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isAllSelected (parentValues, value) { function isAllSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -82308,7 +82315,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isSelected (parentValues, value) { function isSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return false; return false;
@ -82320,7 +82327,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function findSelectedObj (parentValues) { function findSelectedObj(parentValues) {
var find = selectedValues; var find = selectedValues;
if (find == null) { if (find == null) {
return null; return null;
@ -82368,7 +82375,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function judgeState (parentValues, selected_value, checkState) { function judgeState(parentValues, selected_value, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
if (parentValues.length > 0 && !checked) { if (parentValues.length > 0 && !checked) {
return false; return false;
@ -82376,7 +82383,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
} }
function dealWidthSelectedValue (parentValues, selectedValues) { function dealWidthSelectedValue(parentValues, selectedValues) {
var valueMap = {}; var valueMap = {};
BI.each(parentValues, function (i, v) { BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {}; selectedValues = selectedValues[v] || {};
@ -82401,7 +82408,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return valueMap; return valueMap;
} }
function getCheckState (current, parentValues, valueMap, checkState) { function getCheckState(current, parentValues, valueMap, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false; var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) { if (BI.has(valueMap, current)) {

12
dist/case.js vendored

@ -4610,6 +4610,11 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
layouts: [{ layouts: [{
type: "bi.vertical" type: "bi.vertical"
}], }],
behaviors: {
redmark: function () {
return true;
}
},
value: o.value value: o.value
}); });
@ -4628,7 +4633,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
}); });
}, },
populate: function (items) { populate: function (items, keyword) {
BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments); BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments);
var o = this.options; var o = this.options;
items = BI.createItems(items, { items = BI.createItems(items, {
@ -4638,7 +4643,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
iconHeight: o.iconHeight, iconHeight: o.iconHeight,
iconWidth: o.iconWidth iconWidth: o.iconWidth
}); });
this.popup.populate(items); this.popup.populate(items, keyword);
}, },
getValue: function () { getValue: function () {
@ -4651,7 +4656,8 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
}); });
BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);/** BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);
/**
* Created by Windy on 2018/2/2. * Created by Windy on 2018/2/2.
*/ */
BI.SearchTextValueCombo = BI.inherit(BI.Widget, { BI.SearchTextValueCombo = BI.inherit(BI.Widget, {

2
dist/core.js vendored

@ -18631,7 +18631,7 @@ _.extend(BI, {
providers[type] = new providerInjection[type](); providers[type] = new providerInjection[type]();
} }
if (!providerInstance[type]) { if (!providerInstance[type]) {
providerInstance[type] = new providers[type].$get()(config); providerInstance[type] = new (providers[type].$get())(config);
} }
return providerInstance[type]; return providerInstance[type];
} }

61
dist/fineui.ie.js vendored

@ -18873,7 +18873,7 @@ _.extend(BI, {
providers[type] = new providerInjection[type](); providers[type] = new providerInjection[type]();
} }
if (!providerInstance[type]) { if (!providerInstance[type]) {
providerInstance[type] = new providers[type].$get()(config); providerInstance[type] = new (providers[type].$get())(config);
} }
return providerInstance[type]; return providerInstance[type];
} }
@ -54047,6 +54047,11 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
layouts: [{ layouts: [{
type: "bi.vertical" type: "bi.vertical"
}], }],
behaviors: {
redmark: function () {
return true;
}
},
value: o.value value: o.value
}); });
@ -54065,7 +54070,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
}); });
}, },
populate: function (items) { populate: function (items, keyword) {
BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments); BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments);
var o = this.options; var o = this.options;
items = BI.createItems(items, { items = BI.createItems(items, {
@ -54075,7 +54080,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
iconHeight: o.iconHeight, iconHeight: o.iconHeight,
iconWidth: o.iconWidth iconWidth: o.iconWidth
}); });
this.popup.populate(items); this.popup.populate(items, keyword);
}, },
getValue: function () { getValue: function () {
@ -54088,7 +54093,8 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
}); });
BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);/** BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);
/**
* Created by Windy on 2018/2/2. * Created by Windy on 2018/2/2.
*/ */
BI.SearchTextValueCombo = BI.inherit(BI.Widget, { BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
@ -81720,7 +81726,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} else { } else {
call(); call();
} }
function call () {
function call() {
switch (options.type) { switch (options.type) {
case BI.TreeView.REQ_TYPE_INIT_DATA: case BI.TreeView.REQ_TYPE_INIT_DATA:
self._reqInitTreeNode(options, callback); self._reqInitTreeNode(options, callback);
@ -81757,7 +81764,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
items: result items: result
}); });
function doCheck (parentValues, node, selected) { function doCheck(parentValues, node, selected) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
BI.each(node.getChildren(), function (i, child) { BI.each(node.getChildren(), function (i, child) {
var newParents = BI.clone(parentValues); var newParents = BI.clone(parentValues);
@ -81777,7 +81784,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function getCount (jo, parentValues) { function getCount(jo, parentValues) {
if (jo == null) { if (jo == null) {
return 0; return 0;
} }
@ -81788,7 +81795,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return BI.size(jo); return BI.size(jo);
} }
function createOneJson (node, pId, llen) { function createOneJson(node, pId, llen) {
result.push({ result.push({
id: node.id, id: node.id,
pId: pId, pId: pId,
@ -81815,7 +81822,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
callback(selectedValues); callback(selectedValues);
function dealWithSelectedValues (selectedValues) { function dealWithSelectedValues(selectedValues) {
var p = parentValues.concat(notSelectedValue); var p = parentValues.concat(notSelectedValue);
// 存储的值中存在这个值就把它删掉 // 存储的值中存在这个值就把它删掉
// 例如选中了中国-江苏-南京, 取消中国或江苏或南京 // 例如选中了中国-江苏-南京, 取消中国或江苏或南京
@ -81871,7 +81878,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} }
function expandSelectedValue (selectedValues, parents, notSelectedValue) { function expandSelectedValue(selectedValues, parents, notSelectedValue) {
var next = selectedValues; var next = selectedValues;
var childrenCount = []; var childrenCount = [];
var path = []; var path = [];
@ -81916,7 +81923,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function search (parents, current, result, searched) { function search(parents, current, result, searched) {
var newParents = BI.clone(parents); var newParents = BI.clone(parents);
newParents.push(current); newParents.push(current);
if (self._isMatch(parents, current, keyword)) { if (self._isMatch(parents, current, keyword)) {
@ -81946,16 +81953,16 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can; return can;
} }
function isSearchValueInParent (parentValues) { function isSearchValueInParent(parentValues) {
for (var i = 0, len = parentValues.length; i < len; i++) { for (var i = 0, len = parentValues.length; i < len; i++) {
if (self._isMatch(parentValues.slice(0, parentValues.length - 1), parentValues[i], keyword)) { if (self._isMatch(parentValues.slice(0, parentValues.length - 1 - i), parentValues[i], keyword)) {
return true; return true;
} }
} }
return false; return false;
} }
function canFindKey (selectedValues, parents) { function canFindKey(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -81967,7 +81974,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return true; return true;
} }
function isChild (selectedValues, parents) { function isChild(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -82003,7 +82010,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
callback(jo); callback(jo);
function dealWithSelectedValues (selected, parents) { function dealWithSelectedValues(selected, parents) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
return true; return true;
} }
@ -82023,7 +82030,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can && isAllSelected(selected, parents); return can && isAllSelected(selected, parents);
} }
function isAllSelected (selected, parents) { function isAllSelected(selected, parents) {
return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected); return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected);
} }
}, },
@ -82043,7 +82050,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function search () { function search() {
var children = self._getChildren([]); var children = self._getChildren([]);
var start = children.length; var start = children.length;
if (lastSearchValue !== "") { if (lastSearchValue !== "") {
@ -82073,7 +82080,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return output; return output;
} }
function nodeSearch (deep, parentValues, current, isAllSelect, result) { function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(parentValues, current, keyword)) { if (self._isMatch(parentValues, current, keyword)) {
var checked = isAllSelect || isSelected(parentValues, current); var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result); createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
@ -82102,7 +82109,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return [can, checked]; return [can, checked];
} }
function createOneJson (parentValues, value, isOpen, checked, half, flag, result) { function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self._getTreeNode(parentValues, value); var node = self._getTreeNode(parentValues, value);
result.push({ result.push({
id: node.id, id: node.id,
@ -82118,7 +82125,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isHalf (parentValues, value) { function isHalf(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -82132,7 +82139,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isAllSelected (parentValues, value) { function isAllSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -82146,7 +82153,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isSelected (parentValues, value) { function isSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return false; return false;
@ -82158,7 +82165,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function findSelectedObj (parentValues) { function findSelectedObj(parentValues) {
var find = selectedValues; var find = selectedValues;
if (find == null) { if (find == null) {
return null; return null;
@ -82206,7 +82213,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function judgeState (parentValues, selected_value, checkState) { function judgeState(parentValues, selected_value, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
if (parentValues.length > 0 && !checked) { if (parentValues.length > 0 && !checked) {
return false; return false;
@ -82214,7 +82221,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
} }
function dealWidthSelectedValue (parentValues, selectedValues) { function dealWidthSelectedValue(parentValues, selectedValues) {
var valueMap = {}; var valueMap = {};
BI.each(parentValues, function (i, v) { BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {}; selectedValues = selectedValues[v] || {};
@ -82239,7 +82246,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return valueMap; return valueMap;
} }
function getCheckState (current, parentValues, valueMap, checkState) { function getCheckState(current, parentValues, valueMap, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false; var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) { if (BI.has(valueMap, current)) {

61
dist/fineui.js vendored

@ -18873,7 +18873,7 @@ _.extend(BI, {
providers[type] = new providerInjection[type](); providers[type] = new providerInjection[type]();
} }
if (!providerInstance[type]) { if (!providerInstance[type]) {
providerInstance[type] = new providers[type].$get()(config); providerInstance[type] = new (providers[type].$get())(config);
} }
return providerInstance[type]; return providerInstance[type];
} }
@ -54451,6 +54451,11 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
layouts: [{ layouts: [{
type: "bi.vertical" type: "bi.vertical"
}], }],
behaviors: {
redmark: function () {
return true;
}
},
value: o.value value: o.value
}); });
@ -54469,7 +54474,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
}); });
}, },
populate: function (items) { populate: function (items, keyword) {
BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments); BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments);
var o = this.options; var o = this.options;
items = BI.createItems(items, { items = BI.createItems(items, {
@ -54479,7 +54484,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
iconHeight: o.iconHeight, iconHeight: o.iconHeight,
iconWidth: o.iconWidth iconWidth: o.iconWidth
}); });
this.popup.populate(items); this.popup.populate(items, keyword);
}, },
getValue: function () { getValue: function () {
@ -54492,7 +54497,8 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
}); });
BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);/** BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);
/**
* Created by Windy on 2018/2/2. * Created by Windy on 2018/2/2.
*/ */
BI.SearchTextValueCombo = BI.inherit(BI.Widget, { BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
@ -82124,7 +82130,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} else { } else {
call(); call();
} }
function call () {
function call() {
switch (options.type) { switch (options.type) {
case BI.TreeView.REQ_TYPE_INIT_DATA: case BI.TreeView.REQ_TYPE_INIT_DATA:
self._reqInitTreeNode(options, callback); self._reqInitTreeNode(options, callback);
@ -82161,7 +82168,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
items: result items: result
}); });
function doCheck (parentValues, node, selected) { function doCheck(parentValues, node, selected) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
BI.each(node.getChildren(), function (i, child) { BI.each(node.getChildren(), function (i, child) {
var newParents = BI.clone(parentValues); var newParents = BI.clone(parentValues);
@ -82181,7 +82188,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function getCount (jo, parentValues) { function getCount(jo, parentValues) {
if (jo == null) { if (jo == null) {
return 0; return 0;
} }
@ -82192,7 +82199,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return BI.size(jo); return BI.size(jo);
} }
function createOneJson (node, pId, llen) { function createOneJson(node, pId, llen) {
result.push({ result.push({
id: node.id, id: node.id,
pId: pId, pId: pId,
@ -82219,7 +82226,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
callback(selectedValues); callback(selectedValues);
function dealWithSelectedValues (selectedValues) { function dealWithSelectedValues(selectedValues) {
var p = parentValues.concat(notSelectedValue); var p = parentValues.concat(notSelectedValue);
// 存储的值中存在这个值就把它删掉 // 存储的值中存在这个值就把它删掉
// 例如选中了中国-江苏-南京, 取消中国或江苏或南京 // 例如选中了中国-江苏-南京, 取消中国或江苏或南京
@ -82275,7 +82282,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} }
function expandSelectedValue (selectedValues, parents, notSelectedValue) { function expandSelectedValue(selectedValues, parents, notSelectedValue) {
var next = selectedValues; var next = selectedValues;
var childrenCount = []; var childrenCount = [];
var path = []; var path = [];
@ -82320,7 +82327,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function search (parents, current, result, searched) { function search(parents, current, result, searched) {
var newParents = BI.clone(parents); var newParents = BI.clone(parents);
newParents.push(current); newParents.push(current);
if (self._isMatch(parents, current, keyword)) { if (self._isMatch(parents, current, keyword)) {
@ -82350,16 +82357,16 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can; return can;
} }
function isSearchValueInParent (parentValues) { function isSearchValueInParent(parentValues) {
for (var i = 0, len = parentValues.length; i < len; i++) { for (var i = 0, len = parentValues.length; i < len; i++) {
if (self._isMatch(parentValues.slice(0, parentValues.length - 1), parentValues[i], keyword)) { if (self._isMatch(parentValues.slice(0, parentValues.length - 1 - i), parentValues[i], keyword)) {
return true; return true;
} }
} }
return false; return false;
} }
function canFindKey (selectedValues, parents) { function canFindKey(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -82371,7 +82378,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return true; return true;
} }
function isChild (selectedValues, parents) { function isChild(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -82407,7 +82414,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
callback(jo); callback(jo);
function dealWithSelectedValues (selected, parents) { function dealWithSelectedValues(selected, parents) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
return true; return true;
} }
@ -82427,7 +82434,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can && isAllSelected(selected, parents); return can && isAllSelected(selected, parents);
} }
function isAllSelected (selected, parents) { function isAllSelected(selected, parents) {
return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected); return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected);
} }
}, },
@ -82447,7 +82454,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function search () { function search() {
var children = self._getChildren([]); var children = self._getChildren([]);
var start = children.length; var start = children.length;
if (lastSearchValue !== "") { if (lastSearchValue !== "") {
@ -82477,7 +82484,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return output; return output;
} }
function nodeSearch (deep, parentValues, current, isAllSelect, result) { function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(parentValues, current, keyword)) { if (self._isMatch(parentValues, current, keyword)) {
var checked = isAllSelect || isSelected(parentValues, current); var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result); createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
@ -82506,7 +82513,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return [can, checked]; return [can, checked];
} }
function createOneJson (parentValues, value, isOpen, checked, half, flag, result) { function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self._getTreeNode(parentValues, value); var node = self._getTreeNode(parentValues, value);
result.push({ result.push({
id: node.id, id: node.id,
@ -82522,7 +82529,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isHalf (parentValues, value) { function isHalf(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -82536,7 +82543,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isAllSelected (parentValues, value) { function isAllSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -82550,7 +82557,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isSelected (parentValues, value) { function isSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return false; return false;
@ -82562,7 +82569,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function findSelectedObj (parentValues) { function findSelectedObj(parentValues) {
var find = selectedValues; var find = selectedValues;
if (find == null) { if (find == null) {
return null; return null;
@ -82610,7 +82617,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function judgeState (parentValues, selected_value, checkState) { function judgeState(parentValues, selected_value, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
if (parentValues.length > 0 && !checked) { if (parentValues.length > 0 && !checked) {
return false; return false;
@ -82618,7 +82625,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
} }
function dealWidthSelectedValue (parentValues, selectedValues) { function dealWidthSelectedValue(parentValues, selectedValues) {
var valueMap = {}; var valueMap = {};
BI.each(parentValues, function (i, v) { BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {}; selectedValues = selectedValues[v] || {};
@ -82643,7 +82650,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return valueMap; return valueMap;
} }
function getCheckState (current, parentValues, valueMap, checkState) { function getCheckState(current, parentValues, valueMap, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false; var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) { if (BI.has(valueMap, current)) {

61
dist/fineui_without_jquery_polyfill.js vendored

@ -18377,7 +18377,7 @@ _.extend(BI, {
providers[type] = new providerInjection[type](); providers[type] = new providerInjection[type]();
} }
if (!providerInstance[type]) { if (!providerInstance[type]) {
providerInstance[type] = new providers[type].$get()(config); providerInstance[type] = new (providers[type].$get())(config);
} }
return providerInstance[type]; return providerInstance[type];
} }
@ -37469,6 +37469,11 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
layouts: [{ layouts: [{
type: "bi.vertical" type: "bi.vertical"
}], }],
behaviors: {
redmark: function () {
return true;
}
},
value: o.value value: o.value
}); });
@ -37487,7 +37492,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
}); });
}, },
populate: function (items) { populate: function (items, keyword) {
BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments); BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments);
var o = this.options; var o = this.options;
items = BI.createItems(items, { items = BI.createItems(items, {
@ -37497,7 +37502,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
iconHeight: o.iconHeight, iconHeight: o.iconHeight,
iconWidth: o.iconWidth iconWidth: o.iconWidth
}); });
this.popup.populate(items); this.popup.populate(items, keyword);
}, },
getValue: function () { getValue: function () {
@ -37510,7 +37515,8 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
}); });
BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.IconTextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);/** BI.shortcut("bi.icon_text_value_combo_popup", BI.IconTextValueComboPopup);
/**
* Created by Windy on 2018/2/2. * Created by Windy on 2018/2/2.
*/ */
BI.SearchTextValueCombo = BI.inherit(BI.Widget, { BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
@ -64943,7 +64949,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} else { } else {
call(); call();
} }
function call () {
function call() {
switch (options.type) { switch (options.type) {
case BI.TreeView.REQ_TYPE_INIT_DATA: case BI.TreeView.REQ_TYPE_INIT_DATA:
self._reqInitTreeNode(options, callback); self._reqInitTreeNode(options, callback);
@ -64980,7 +64987,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
items: result items: result
}); });
function doCheck (parentValues, node, selected) { function doCheck(parentValues, node, selected) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
BI.each(node.getChildren(), function (i, child) { BI.each(node.getChildren(), function (i, child) {
var newParents = BI.clone(parentValues); var newParents = BI.clone(parentValues);
@ -65000,7 +65007,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function getCount (jo, parentValues) { function getCount(jo, parentValues) {
if (jo == null) { if (jo == null) {
return 0; return 0;
} }
@ -65011,7 +65018,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return BI.size(jo); return BI.size(jo);
} }
function createOneJson (node, pId, llen) { function createOneJson(node, pId, llen) {
result.push({ result.push({
id: node.id, id: node.id,
pId: pId, pId: pId,
@ -65038,7 +65045,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
callback(selectedValues); callback(selectedValues);
function dealWithSelectedValues (selectedValues) { function dealWithSelectedValues(selectedValues) {
var p = parentValues.concat(notSelectedValue); var p = parentValues.concat(notSelectedValue);
// 存储的值中存在这个值就把它删掉 // 存储的值中存在这个值就把它删掉
// 例如选中了中国-江苏-南京, 取消中国或江苏或南京 // 例如选中了中国-江苏-南京, 取消中国或江苏或南京
@ -65094,7 +65101,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} }
function expandSelectedValue (selectedValues, parents, notSelectedValue) { function expandSelectedValue(selectedValues, parents, notSelectedValue) {
var next = selectedValues; var next = selectedValues;
var childrenCount = []; var childrenCount = [];
var path = []; var path = [];
@ -65139,7 +65146,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function search (parents, current, result, searched) { function search(parents, current, result, searched) {
var newParents = BI.clone(parents); var newParents = BI.clone(parents);
newParents.push(current); newParents.push(current);
if (self._isMatch(parents, current, keyword)) { if (self._isMatch(parents, current, keyword)) {
@ -65169,16 +65176,16 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can; return can;
} }
function isSearchValueInParent (parentValues) { function isSearchValueInParent(parentValues) {
for (var i = 0, len = parentValues.length; i < len; i++) { for (var i = 0, len = parentValues.length; i < len; i++) {
if (self._isMatch(parentValues.slice(0, parentValues.length - 1), parentValues[i], keyword)) { if (self._isMatch(parentValues.slice(0, parentValues.length - 1 - i), parentValues[i], keyword)) {
return true; return true;
} }
} }
return false; return false;
} }
function canFindKey (selectedValues, parents) { function canFindKey(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -65190,7 +65197,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return true; return true;
} }
function isChild (selectedValues, parents) { function isChild(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -65226,7 +65233,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
callback(jo); callback(jo);
function dealWithSelectedValues (selected, parents) { function dealWithSelectedValues(selected, parents) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
return true; return true;
} }
@ -65246,7 +65253,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can && isAllSelected(selected, parents); return can && isAllSelected(selected, parents);
} }
function isAllSelected (selected, parents) { function isAllSelected(selected, parents) {
return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected); return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected);
} }
}, },
@ -65266,7 +65273,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function search () { function search() {
var children = self._getChildren([]); var children = self._getChildren([]);
var start = children.length; var start = children.length;
if (lastSearchValue !== "") { if (lastSearchValue !== "") {
@ -65296,7 +65303,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return output; return output;
} }
function nodeSearch (deep, parentValues, current, isAllSelect, result) { function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(parentValues, current, keyword)) { if (self._isMatch(parentValues, current, keyword)) {
var checked = isAllSelect || isSelected(parentValues, current); var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result); createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
@ -65325,7 +65332,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return [can, checked]; return [can, checked];
} }
function createOneJson (parentValues, value, isOpen, checked, half, flag, result) { function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self._getTreeNode(parentValues, value); var node = self._getTreeNode(parentValues, value);
result.push({ result.push({
id: node.id, id: node.id,
@ -65341,7 +65348,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isHalf (parentValues, value) { function isHalf(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -65355,7 +65362,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isAllSelected (parentValues, value) { function isAllSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -65369,7 +65376,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isSelected (parentValues, value) { function isSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return false; return false;
@ -65381,7 +65388,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function findSelectedObj (parentValues) { function findSelectedObj(parentValues) {
var find = selectedValues; var find = selectedValues;
if (find == null) { if (find == null) {
return null; return null;
@ -65429,7 +65436,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function judgeState (parentValues, selected_value, checkState) { function judgeState(parentValues, selected_value, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
if (parentValues.length > 0 && !checked) { if (parentValues.length > 0 && !checked) {
return false; return false;
@ -65437,7 +65444,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
} }
function dealWidthSelectedValue (parentValues, selectedValues) { function dealWidthSelectedValue(parentValues, selectedValues) {
var valueMap = {}; var valueMap = {};
BI.each(parentValues, function (i, v) { BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {}; selectedValues = selectedValues[v] || {};
@ -65462,7 +65469,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return valueMap; return valueMap;
} }
function getCheckState (current, parentValues, valueMap, checkState) { function getCheckState(current, parentValues, valueMap, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false; var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) { if (BI.has(valueMap, current)) {

2
dist/utils.js vendored

@ -13585,7 +13585,7 @@ if (!_global.BI) {
providers[type] = new providerInjection[type](); providers[type] = new providerInjection[type]();
} }
if (!providerInstance[type]) { if (!providerInstance[type]) {
providerInstance[type] = new providers[type].$get()(config); providerInstance[type] = new (providers[type].$get())(config);
} }
return providerInstance[type]; return providerInstance[type];
} }

47
dist/widget.js vendored

@ -22481,7 +22481,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} else { } else {
call(); call();
} }
function call () {
function call() {
switch (options.type) { switch (options.type) {
case BI.TreeView.REQ_TYPE_INIT_DATA: case BI.TreeView.REQ_TYPE_INIT_DATA:
self._reqInitTreeNode(options, callback); self._reqInitTreeNode(options, callback);
@ -22518,7 +22519,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
items: result items: result
}); });
function doCheck (parentValues, node, selected) { function doCheck(parentValues, node, selected) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
BI.each(node.getChildren(), function (i, child) { BI.each(node.getChildren(), function (i, child) {
var newParents = BI.clone(parentValues); var newParents = BI.clone(parentValues);
@ -22538,7 +22539,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function getCount (jo, parentValues) { function getCount(jo, parentValues) {
if (jo == null) { if (jo == null) {
return 0; return 0;
} }
@ -22549,7 +22550,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return BI.size(jo); return BI.size(jo);
} }
function createOneJson (node, pId, llen) { function createOneJson(node, pId, llen) {
result.push({ result.push({
id: node.id, id: node.id,
pId: pId, pId: pId,
@ -22576,7 +22577,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
callback(selectedValues); callback(selectedValues);
function dealWithSelectedValues (selectedValues) { function dealWithSelectedValues(selectedValues) {
var p = parentValues.concat(notSelectedValue); var p = parentValues.concat(notSelectedValue);
// 存储的值中存在这个值就把它删掉 // 存储的值中存在这个值就把它删掉
// 例如选中了中国-江苏-南京, 取消中国或江苏或南京 // 例如选中了中国-江苏-南京, 取消中国或江苏或南京
@ -22632,7 +22633,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} }
function expandSelectedValue (selectedValues, parents, notSelectedValue) { function expandSelectedValue(selectedValues, parents, notSelectedValue) {
var next = selectedValues; var next = selectedValues;
var childrenCount = []; var childrenCount = [];
var path = []; var path = [];
@ -22677,7 +22678,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function search (parents, current, result, searched) { function search(parents, current, result, searched) {
var newParents = BI.clone(parents); var newParents = BI.clone(parents);
newParents.push(current); newParents.push(current);
if (self._isMatch(parents, current, keyword)) { if (self._isMatch(parents, current, keyword)) {
@ -22707,16 +22708,16 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can; return can;
} }
function isSearchValueInParent (parentValues) { function isSearchValueInParent(parentValues) {
for (var i = 0, len = parentValues.length; i < len; i++) { for (var i = 0, len = parentValues.length; i < len; i++) {
if (self._isMatch(parentValues.slice(0, parentValues.length - 1), parentValues[i], keyword)) { if (self._isMatch(parentValues.slice(0, parentValues.length - 1 - i), parentValues[i], keyword)) {
return true; return true;
} }
} }
return false; return false;
} }
function canFindKey (selectedValues, parents) { function canFindKey(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -22728,7 +22729,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return true; return true;
} }
function isChild (selectedValues, parents) { function isChild(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -22764,7 +22765,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
callback(jo); callback(jo);
function dealWithSelectedValues (selected, parents) { function dealWithSelectedValues(selected, parents) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
return true; return true;
} }
@ -22784,7 +22785,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can && isAllSelected(selected, parents); return can && isAllSelected(selected, parents);
} }
function isAllSelected (selected, parents) { function isAllSelected(selected, parents) {
return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected); return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected);
} }
}, },
@ -22804,7 +22805,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function search () { function search() {
var children = self._getChildren([]); var children = self._getChildren([]);
var start = children.length; var start = children.length;
if (lastSearchValue !== "") { if (lastSearchValue !== "") {
@ -22834,7 +22835,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return output; return output;
} }
function nodeSearch (deep, parentValues, current, isAllSelect, result) { function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(parentValues, current, keyword)) { if (self._isMatch(parentValues, current, keyword)) {
var checked = isAllSelect || isSelected(parentValues, current); var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result); createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
@ -22863,7 +22864,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return [can, checked]; return [can, checked];
} }
function createOneJson (parentValues, value, isOpen, checked, half, flag, result) { function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self._getTreeNode(parentValues, value); var node = self._getTreeNode(parentValues, value);
result.push({ result.push({
id: node.id, id: node.id,
@ -22879,7 +22880,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isHalf (parentValues, value) { function isHalf(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -22893,7 +22894,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isAllSelected (parentValues, value) { function isAllSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -22907,7 +22908,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isSelected (parentValues, value) { function isSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return false; return false;
@ -22919,7 +22920,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function findSelectedObj (parentValues) { function findSelectedObj(parentValues) {
var find = selectedValues; var find = selectedValues;
if (find == null) { if (find == null) {
return null; return null;
@ -22967,7 +22968,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function judgeState (parentValues, selected_value, checkState) { function judgeState(parentValues, selected_value, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
if (parentValues.length > 0 && !checked) { if (parentValues.length > 0 && !checked) {
return false; return false;
@ -22975,7 +22976,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
} }
function dealWidthSelectedValue (parentValues, selectedValues) { function dealWidthSelectedValue(parentValues, selectedValues) {
var valueMap = {}; var valueMap = {};
BI.each(parentValues, function (i, v) { BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {}; selectedValues = selectedValues[v] || {};
@ -23000,7 +23001,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return valueMap; return valueMap;
} }
function getCheckState (current, parentValues, valueMap, checkState) { function getCheckState(current, parentValues, valueMap, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false; var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) { if (BI.has(valueMap, current)) {

9
src/case/combo/icontextvaluecombo/popup.icontextvalue.js

@ -24,6 +24,11 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
layouts: [{ layouts: [{
type: "bi.vertical" type: "bi.vertical"
}], }],
behaviors: {
redmark: function () {
return true;
}
},
value: o.value value: o.value
}); });
@ -42,7 +47,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
}); });
}, },
populate: function (items) { populate: function (items, keyword) {
BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments); BI.IconTextValueComboPopup.superclass.populate.apply(this, arguments);
var o = this.options; var o = this.options;
items = BI.createItems(items, { items = BI.createItems(items, {
@ -52,7 +57,7 @@ BI.IconTextValueComboPopup = BI.inherit(BI.Pane, {
iconHeight: o.iconHeight, iconHeight: o.iconHeight,
iconWidth: o.iconWidth iconWidth: o.iconWidth
}); });
this.popup.populate(items); this.popup.populate(items, keyword);
}, },
getValue: function () { getValue: function () {

47
src/component/treevaluechooser/abstract.treevaluechooser.js

@ -41,7 +41,8 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} else { } else {
call(); call();
} }
function call () {
function call() {
switch (options.type) { switch (options.type) {
case BI.TreeView.REQ_TYPE_INIT_DATA: case BI.TreeView.REQ_TYPE_INIT_DATA:
self._reqInitTreeNode(options, callback); self._reqInitTreeNode(options, callback);
@ -78,7 +79,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
items: result items: result
}); });
function doCheck (parentValues, node, selected) { function doCheck(parentValues, node, selected) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
BI.each(node.getChildren(), function (i, child) { BI.each(node.getChildren(), function (i, child) {
var newParents = BI.clone(parentValues); var newParents = BI.clone(parentValues);
@ -98,7 +99,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function getCount (jo, parentValues) { function getCount(jo, parentValues) {
if (jo == null) { if (jo == null) {
return 0; return 0;
} }
@ -109,7 +110,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return BI.size(jo); return BI.size(jo);
} }
function createOneJson (node, pId, llen) { function createOneJson(node, pId, llen) {
result.push({ result.push({
id: node.id, id: node.id,
pId: pId, pId: pId,
@ -136,7 +137,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
callback(selectedValues); callback(selectedValues);
function dealWithSelectedValues (selectedValues) { function dealWithSelectedValues(selectedValues) {
var p = parentValues.concat(notSelectedValue); var p = parentValues.concat(notSelectedValue);
// 存储的值中存在这个值就把它删掉 // 存储的值中存在这个值就把它删掉
// 例如选中了中国-江苏-南京, 取消中国或江苏或南京 // 例如选中了中国-江苏-南京, 取消中国或江苏或南京
@ -192,7 +193,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
} }
function expandSelectedValue (selectedValues, parents, notSelectedValue) { function expandSelectedValue(selectedValues, parents, notSelectedValue) {
var next = selectedValues; var next = selectedValues;
var childrenCount = []; var childrenCount = [];
var path = []; var path = [];
@ -237,7 +238,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function search (parents, current, result, searched) { function search(parents, current, result, searched) {
var newParents = BI.clone(parents); var newParents = BI.clone(parents);
newParents.push(current); newParents.push(current);
if (self._isMatch(parents, current, keyword)) { if (self._isMatch(parents, current, keyword)) {
@ -267,16 +268,16 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can; return can;
} }
function isSearchValueInParent (parentValues) { function isSearchValueInParent(parentValues) {
for (var i = 0, len = parentValues.length; i < len; i++) { for (var i = 0, len = parentValues.length; i < len; i++) {
if (self._isMatch(parentValues.slice(0, parentValues.length - 1), parentValues[i], keyword)) { if (self._isMatch(parentValues.slice(0, parentValues.length - 1 - i), parentValues[i], keyword)) {
return true; return true;
} }
} }
return false; return false;
} }
function canFindKey (selectedValues, parents) { function canFindKey(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -288,7 +289,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return true; return true;
} }
function isChild (selectedValues, parents) { function isChild(selectedValues, parents) {
var t = selectedValues; var t = selectedValues;
for (var i = 0; i < parents.length; i++) { for (var i = 0; i < parents.length; i++) {
var v = parents[i]; var v = parents[i];
@ -324,7 +325,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
callback(jo); callback(jo);
function dealWithSelectedValues (selected, parents) { function dealWithSelectedValues(selected, parents) {
if (selected == null || BI.isEmpty(selected)) { if (selected == null || BI.isEmpty(selected)) {
return true; return true;
} }
@ -344,7 +345,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return can && isAllSelected(selected, parents); return can && isAllSelected(selected, parents);
} }
function isAllSelected (selected, parents) { function isAllSelected(selected, parents) {
return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected); return BI.isEmpty(selected) || self._getChildCount(parents) === BI.size(selected);
} }
}, },
@ -364,7 +365,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function search () { function search() {
var children = self._getChildren([]); var children = self._getChildren([]);
var start = children.length; var start = children.length;
if (lastSearchValue !== "") { if (lastSearchValue !== "") {
@ -394,7 +395,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return output; return output;
} }
function nodeSearch (deep, parentValues, current, isAllSelect, result) { function nodeSearch(deep, parentValues, current, isAllSelect, result) {
if (self._isMatch(parentValues, current, keyword)) { if (self._isMatch(parentValues, current, keyword)) {
var checked = isAllSelect || isSelected(parentValues, current); var checked = isAllSelect || isSelected(parentValues, current);
createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result); createOneJson(parentValues, current, false, checked, !isAllSelect && isHalf(parentValues, current), true, result);
@ -423,7 +424,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return [can, checked]; return [can, checked];
} }
function createOneJson (parentValues, value, isOpen, checked, half, flag, result) { function createOneJson(parentValues, value, isOpen, checked, half, flag, result) {
var node = self._getTreeNode(parentValues, value); var node = self._getTreeNode(parentValues, value);
result.push({ result.push({
id: node.id, id: node.id,
@ -439,7 +440,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isHalf (parentValues, value) { function isHalf(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -453,7 +454,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isAllSelected (parentValues, value) { function isAllSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return null; return null;
@ -467,7 +468,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function isSelected (parentValues, value) { function isSelected(parentValues, value) {
var find = findSelectedObj(parentValues); var find = findSelectedObj(parentValues);
if (find == null) { if (find == null) {
return false; return false;
@ -479,7 +480,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
} }
function findSelectedObj (parentValues) { function findSelectedObj(parentValues) {
var find = selectedValues; var find = selectedValues;
if (find == null) { if (find == null) {
return null; return null;
@ -527,7 +528,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
}); });
}); });
function judgeState (parentValues, selected_value, checkState) { function judgeState(parentValues, selected_value, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
if (parentValues.length > 0 && !checked) { if (parentValues.length > 0 && !checked) {
return false; return false;
@ -535,7 +536,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value)); return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
} }
function dealWidthSelectedValue (parentValues, selectedValues) { function dealWidthSelectedValue(parentValues, selectedValues) {
var valueMap = {}; var valueMap = {};
BI.each(parentValues, function (i, v) { BI.each(parentValues, function (i, v) {
selectedValues = selectedValues[v] || {}; selectedValues = selectedValues[v] || {};
@ -560,7 +561,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
return valueMap; return valueMap;
} }
function getCheckState (current, parentValues, valueMap, checkState) { function getCheckState(current, parentValues, valueMap, checkState) {
var checked = checkState.checked, half = checkState.half; var checked = checkState.checked, half = checkState.half;
var tempCheck = false, halfCheck = false; var tempCheck = false, halfCheck = false;
if (BI.has(valueMap, current)) { if (BI.has(valueMap, current)) {

2
src/core/inject.js

@ -195,7 +195,7 @@
providers[type] = new providerInjection[type](); providers[type] = new providerInjection[type]();
} }
if (!providerInstance[type]) { if (!providerInstance[type]) {
providerInstance[type] = new providers[type].$get()(config); providerInstance[type] = new (providers[type].$get())(config);
} }
return providerInstance[type]; return providerInstance[type];
} }

Loading…
Cancel
Save