diff --git a/demo/js/case/combo/demo.text_value_combo.js b/demo/js/case/combo/demo.text_value_combo.js
index 50e3fea43..15df83c54 100644
--- a/demo/js/case/combo/demo.text_value_combo.js
+++ b/demo/js/case/combo/demo.text_value_combo.js
@@ -146,7 +146,7 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
type: "bi.button",
text: "setValue(1)",
handler: function () {
- combo1.setValue();
+ combo1.setValue(1);
},
},
vgap: 10,
@@ -184,6 +184,27 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, {
vgap: 10,
}
]
+ }),
+ this.createCombo("支持复选", {
+ type: "bi.vertical",
+ items: [
+ {
+ type: "bi.text_value_combo",
+ width: 300,
+ items: items,
+ allowClear: true,
+ defaultText: "请选择",
+ chooseType: BI.Selection.Multi,
+ listeners: [
+ {
+ eventName: BI.TextValueCombo.EVENT_CHANGE,
+ action: function () {
+ console.log(this.getValue());
+ }
+ }
+ ]
+ }
+ ]
})
]
};
diff --git a/demo/js/widget/slider/demo.slider.js b/demo/js/widget/slider/demo.slider.js
index 61ebe57e7..2116ff99e 100644
--- a/demo/js/widget/slider/demo.slider.js
+++ b/demo/js/widget/slider/demo.slider.js
@@ -17,16 +17,11 @@ Demo.Slider = BI.inherit(BI.Widget, {
digit: 0,
width: o.width,
height: o.height,
- cls: "layout-bg-white"
- });
-
- singleSlider.setMinAndMax({
+ cls: "layout-bg-white",
+ value: 30,
min: 10,
- max: o.max
+ max: 100
});
-
- singleSlider.setValue(30);
- singleSlider.populate();
singleSlider.on(BI.SingleSlider.EVENT_CHANGE, function () {
console.log(this.getValue());
});
@@ -35,14 +30,14 @@ Demo.Slider = BI.inherit(BI.Widget, {
type: "bi.single_slider_normal",
width: o.width,
height: 30,
- cls: "layout-bg-white"
- });
- normalSingleSlider.setMinAndMax({
+ cls: "layout-bg-white",
min: o.min,
- max: o.max
+ max: o.max,
+ value: 30,
+ });
+ normalSingleSlider.on(BI.SingleSliderNormal.EVENT_DRAG, function () {
+ console.log(this.getValue());
});
- normalSingleSlider.setValue(10);
- normalSingleSlider.populate();
var singleSliderLabel = BI.createWidget({
type: "bi.single_slider_label",
@@ -50,47 +45,38 @@ Demo.Slider = BI.inherit(BI.Widget, {
height: o.height,
digit: 0,
unit: "个",
- cls: "layout-bg-white"
- });
- singleSliderLabel.setMinAndMax({
+ cls: "layout-bg-white",
min: o.min,
- max: o.max
+ max: o.max,
+ value: 10,
});
- singleSliderLabel.setValue(10);
- singleSliderLabel.populate();
var intervalSlider = BI.createWidget({
type: "bi.interval_slider",
width: o.width,
digit: 0,
- cls: "layout-bg-white"
- });
- intervalSlider.setMinAndMax({
+ cls: "layout-bg-white",
min: o.min,
- max: o.max
- });
- intervalSlider.setValue({
- min: 10,
- max: 120
+ max: o.max,
+ value: {
+ min: 10,
+ max: 70
+ }
});
- intervalSlider.populate();
var intervalSliderLabel = BI.createWidget({
type: "bi.interval_slider",
width: o.width,
unit: "px",
cls: "layout-bg-white",
- digit: 1
- });
- intervalSliderLabel.setMinAndMax({
+ digit: 1,
min: 0,
- max: 120
- });
- intervalSliderLabel.setValue({
- min: 10,
- max: 120
+ max: 120,
+ value: {
+ min: 60,
+ max: 120
+ }
});
- intervalSliderLabel.populate();
return {
@@ -126,4 +112,4 @@ Demo.Slider = BI.inherit(BI.Widget, {
};
}
});
-BI.shortcut("demo.slider", Demo.Slider);
\ No newline at end of file
+BI.shortcut("demo.slider", Demo.Slider);
diff --git a/lodash.md b/lodash.md
index 8faeb0142..411585265 100644
--- a/lodash.md
+++ b/lodash.md
@@ -1 +1 @@
-lodash core plus="debounce,throttle,get,set,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy,uniqBy,before,after,unescape,chunk"
+lodash core plus="debounce,throttle,get,set,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy,uniqBy,before,after,unescape,chunk,pick,pickBy,identity"
diff --git a/package.json b/package.json
index a8a0753c1..3a02cb058 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "fineui",
- "version": "2.0.20220916093936",
+ "version": "2.0.20220920140416",
"description": "fineui",
"main": "dist/fineui_without_conflict.min.js",
"types": "dist/lib/index.d.ts",
diff --git a/src/base/combination/bubble.js b/src/base/combination/bubble.js
index d4c240b17..d3bc2975a 100644
--- a/src/base/combination/bubble.js
+++ b/src/base/combination/bubble.js
@@ -83,6 +83,7 @@
BI.createWidget(BI.extend({
element: this,
+ scrolly: false,
}, BI.LogicFactory.createLogic("vertical", BI.extend(o.logic, {
items: [
{ el: this.combo }
diff --git a/src/base/combination/combo.js b/src/base/combination/combo.js
index 5fc2f8008..587ddf802 100644
--- a/src/base/combination/combo.js
+++ b/src/base/combination/combo.js
@@ -93,6 +93,7 @@
BI.createWidget(BI.extend({
element: this,
+ scrolly: false,
}, BI.LogicFactory.createLogic("vertical", BI.extend(o.logic, {
items: [
{ el: this.combo }
diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js
index f6794f7bd..ac39d5158 100644
--- a/src/case/combo/textvaluecombo/combo.textvalue.js
+++ b/src/case/combo/textvaluecombo/combo.textvalue.js
@@ -16,7 +16,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
el: {},
allowClear: false,
status: "success", // success | warning | error,
- title: null,
+ title: null
});
},
@@ -44,11 +44,11 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
if (this.options.status === "error") {
return {
level: "warning",
- text: o.warningTitle,
+ text: o.warningTitle
};
}
return {
- level: "success",
+ level: "success"
};
};
@@ -85,17 +85,33 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
eventName: BI.TextValueComboPopup.EVENT_CHANGE,
action: (...args) => {
changeTag = true;
- this.setValue(this.popup.getValue());
+ const value = this.popup.getValue();
+ this.setValue(value);
if (o.chooseType === BI.ButtonGroup.CHOOSE_TYPE_SINGLE) {
this.combo.hideView();
this.fireEvent(BI.TextValueCombo.EVENT_CHANGE, ...args);
}
+ if (o.chooseType === BI.ButtonGroup.CHOOSE_TYPE_MULTI && BI.isEmptyArray(value)) {
+ this._clear();
+ }
}
}, {
eventName: BI.Controller.EVENT_CHANGE,
action: (...args) => {
this.fireEvent(BI.Controller.EVENT_CHANGE, ...args);
}
+ }, {
+ eventName: BI.TextValueComboPopup.EVENT_CLEAR,
+ action: (...args) => {
+ changeTag = true;
+ this._clear();
+ this.combo.hideView();
+ }
+ }, {
+ eventName: BI.TextValueComboPopup.EVENT_CONFIRM,
+ action: (...args) => {
+ this.combo.hideView();
+ }
}
]
};
@@ -139,6 +155,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
},
_clear: function () {
+ this.trigger.setText("");
this.combo.setValue();
this.setStatus("success");
},
@@ -152,7 +169,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
var vals = BI.isArray(v) ? v : [v];
- var result = BI.intersection(BI.map(this.options.items, (i, item) => item.value), vals);
+ var result = BI.intersection(BI.map(this.options.items, "value"), vals);
if (result.length !== vals.length) {
this.setStatus("error");
@@ -165,6 +182,10 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
this._clear();
},
+ setText: function (text) {
+ this.trigger.setText(text);
+ },
+
setValue: function (v) {
this.combo.setValue(v);
this._checkError(v);
diff --git a/src/case/combo/textvaluecombo/popup.textvalue.js b/src/case/combo/textvaluecombo/popup.textvalue.js
index 1876c9a55..9ea5eaa58 100644
--- a/src/case/combo/textvaluecombo/popup.textvalue.js
+++ b/src/case/combo/textvaluecombo/popup.textvalue.js
@@ -6,33 +6,93 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, {
});
},
- _init: function () {
- BI.TextValueComboPopup.superclass._init.apply(this, arguments);
+ render () {
var o = this.options, self = this;
- this.popup = BI.createWidget({
- type: "bi.button_group",
- items: this._formatItems(o.items),
- chooseType: o.chooseType,
- layouts: [{
- type: "bi.vertical"
- }],
- value: o.value
- });
+ if (o.chooseType === BI.ButtonGroup.CHOOSE_TYPE_SINGLE) {
+ return {
+ type: "bi.vertical",
+ vgap: 5,
+ items: [{
+ type: "bi.button_group",
+ ref: (_ref) => {
+ this.popup = _ref;
+ },
+ items: this._formatItems(o.items),
+ chooseType: o.chooseType,
+ layouts: [{
+ type: "bi.vertical"
+ }],
+ value: o.value,
+ listeners: [{
+ eventName: BI.Controller.EVENT_CHANGE,
+ action: function (type, val, obj) {
+ self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
+ if (type === BI.Events.CLICK) {
+ self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val, obj);
+ }
+ }
+ }]
+ }]
+ };
+ }
+ return {
+ type: "bi.vertical",
+ verticalAlign: BI.VerticalAlign.Stretch,
+ rowSize: ["fill", ""],
+ items: [{
+ type: "bi.select_list",
+ logic: {
+ dynamic: true,
+ innerVgap: 5,
+ rowSize: ["", "fill"],
+ verticalAlign: BI.VerticalAlign.Stretch
+ },
+ ref: (_ref) => {
+ this.popup = _ref;
+ },
+ el: {
+ el: {
+ chooseType: o.chooseType
+ }
+ },
+ items: this._formatItems(o.items),
+ value: {
+ type: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
+ value: o.value
+ },
+ listeners: [{
+ eventName: BI.SelectList.EVENT_CHANGE,
+ action: function (val) {
+ self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val);
+ }
+ }]
+ }, {
+ type: "bi.center",
+ cls: "list-view-toolbar bi-high-light bi-split-top",
+ height: 24,
+ items: BI.createItems([{
+ type: "bi.text_button",
+ text: BI.i18nText("BI-Basic_Clears"),
+ handler: function () {
+ self.fireEvent(BI.TextValueComboPopup.EVENT_CLEAR);
+ }
+ }, {
+ type: "bi.text_button",
+ text: BI.i18nText("BI-Basic_OK"),
+ handler: function () {
+ self.fireEvent(BI.TextValueComboPopup.EVENT_CONFIRM);
+ }
+ }], {
+ once: false,
+ shadow: true,
+ isShadowShowingOnSelected: true
+ })
+ }]
+ };
+ },
- this.popup.on(BI.Controller.EVENT_CHANGE, function (type, val, obj) {
- self.fireEvent(BI.Controller.EVENT_CHANGE, arguments);
- if (type === BI.Events.CLICK) {
- self.fireEvent(BI.TextValueComboPopup.EVENT_CHANGE, val, obj);
- }
- });
+ mounted: function () {
this.check();
-
- BI.createWidget({
- type: "bi.vertical",
- element: this,
- vgap: 5,
- items: [this.popup]
- });
},
_formatItems: function (items) {
@@ -40,6 +100,7 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, {
return BI.map(items, function (i, item) {
return BI.extend({
type: o.chooseType === BI.ButtonGroup.CHOOSE_TYPE_SINGLE ? "bi.single_select_item" : "bi.multi_select_item",
+ iconWrapperWidth: 36,
textAlign: o.textAlign,
title: item.title || item.text
}, item);
@@ -52,13 +113,29 @@ BI.TextValueComboPopup = BI.inherit(BI.Pane, {
},
getValue: function () {
- return this.popup.getValue();
+ if (this.options.chooseType === BI.ButtonGroup.CHOOSE_TYPE_SINGLE) {
+ return this.popup.getValue();
+ }
+ var val = this.popup.getValue();
+ if (val.type === BI.ButtonGroup.CHOOSE_TYPE_MULTI) {
+ return val.value;
+ } else {
+ return val.assist;
+ }
},
setValue: function (v) {
- this.popup.setValue(v);
+ if (this.options.chooseType === BI.ButtonGroup.CHOOSE_TYPE_SINGLE) {
+ return this.popup.setValue(v);
+ }
+ this.popup.setValue({
+ type: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
+ value: v
+ });
}
});
BI.TextValueComboPopup.EVENT_CHANGE = "EVENT_CHANGE";
+BI.TextValueComboPopup.EVENT_CLEAR = "EVENT_CLEAR";
+BI.TextValueComboPopup.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.shortcut("bi.text_value_combo_popup", BI.TextValueComboPopup);
diff --git a/src/case/trigger/trigger.text.select.js b/src/case/trigger/trigger.text.select.js
index 5a171be2e..cf1e2cdd9 100644
--- a/src/case/trigger/trigger.text.select.js
+++ b/src/case/trigger/trigger.text.select.js
@@ -20,15 +20,14 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
_init: function () {
BI.SelectTextTrigger.superclass._init.apply(this, arguments);
var self = this, o = this.options;
- var obj = this._digest(o.value, o.items);
+ var text = this._digest(o.value, o.items);
this.trigger = BI.createWidget({
type: "bi.text_trigger",
element: this,
height: o.height,
readonly: o.readonly,
- text: obj.text,
+ text: text,
defaultText: o.defaultText,
- textCls: obj.textCls,
textHgap: o.textHgap,
textVgap: o.textVgap,
textLgap: o.textLgap,
@@ -73,21 +72,9 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
});
if (result.length > 0 && val.length === 0) {
- return {
- textCls: "",
- text: result.join(","),
- };
+ return result.join(",");
} else {
- var text = BI.isFunction(o.text) ? o.text() : o.text;
- if (BI.isEmptyString(text)) {
- return {
- textCls: "bi-tips",
- text: ""
- };
- }
- return {
- text,
- };
+ return BI.isFunction(o.text) ? o.text() : o.text;
}
},
@@ -97,9 +84,8 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
},
setValue: function (val) {
- var formatValue = this._digest(val, this.options.items);
- this.trigger.setTextCls(formatValue.textCls);
- this.trigger.setText(formatValue.text);
+ var formatText = this._digest(val, this.options.items);
+ this.trigger.setText(formatText);
},
setTipType: function (v) {
diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js
index eb918abf9..53e31298f 100644
--- a/src/component/treevaluechooser/abstract.treevaluechooser.js
+++ b/src/component/treevaluechooser/abstract.treevaluechooser.js
@@ -532,70 +532,81 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
var checkState = op.checkState || {};
var parentValues = op.parentValues || [];
var selectedValues = op.selectedValues || {};
- var valueMap = {};
- // if (judgeState(parentValues, selectedValues, checkState)) {
- valueMap = dealWithSelectedValue(parentValues, selectedValues);
- // }
- var nodes = this._getChildren(parentValues);
- for (var i = (times - 1) * this._const.perPage; nodes[i] && i < times * this._const.perPage; i++) {
- var state = getCheckState(nodes[i].value, parentValues, valueMap, checkState);
- result.push({
- id: nodes[i].id,
- pId: nodes[i].pId,
- value: nodes[i].value,
- text: nodes[i].text,
- times: 1,
- isParent: nodes[i].getChildrenLength() > 0,
- checked: state[0],
- halfCheck: state[1],
- open: o.open,
- disabled: nodes[i].disabled,
- title: nodes[i].title || nodes[i].text,
- warningTitle: nodes[i].warningTitle,
- });
- }
- // 如果指定节点全部打开
- if (o.open) {
- var allNodes = [];
- // 获取所有节点
- BI.each(nodes, function (idx, node) {
- allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
- });
- var lastFind;
- BI.each(allNodes, function (idx, node) {
- var valueMap = dealWithSelectedValue(node.parentValues, selectedValues);
- // REPORT-24409 fix: 设置节点全部展开,添加的节点没有给状态
- var parentCheckState = {};
- var find = BI.find(result, function (idx, pNode) {
- return pNode.id === node.pId;
- });
- if (find) {
- parentCheckState.checked = find.halfCheck ? false : find.checked;
- parentCheckState.half = find.halfCheck;
- // 默认展开也需要重置父节点的halfCheck
- if (BI.isNotNull(lastFind) && (lastFind !== find || allNodes.length - 1 === idx)) {
- lastFind.half = lastFind.halfCheck;
- lastFind.halfCheck = false;
- }
- }
- lastFind = find;
- var state = getCheckState(node.value, node.parentValues, valueMap, parentCheckState);
+ function getResult(parentValues, checkState) {
+ var valueMap = {};
+ // if (judgeState(parentValues, selectedValues, checkState)) {
+ valueMap = dealWithSelectedValue(parentValues, selectedValues);
+ // }
+ var nodes = self._getChildren(parentValues);
+ for (var i = (times - 1) * self._const.perPage; nodes[i] && i < times * self._const.perPage; i++) {
+ var state = getCheckState(nodes[i].value, parentValues, valueMap, checkState);
+ var openState = o.open || nodes[i].open;
result.push({
- id: node.id,
- pId: node.pId,
- value: node.value,
- text: node.text,
+ id: nodes[i].id,
+ pId: nodes[i].pId,
+ value: nodes[i].value,
+ text: nodes[i].text,
times: 1,
- isParent: node.getChildrenLength() > 0,
+ isParent: nodes[i].getChildrenLength() > 0,
checked: state[0],
- halfCheck: state[1],
- open: self.options.open,
- disabled: node.disabled,
- title: node.title || node.text,
- warningTitle: node.warningTitle,
+ half: state[1],
+ halfCheck: openState ? false : state[1],
+ open: openState,
+ disabled: nodes[i].disabled,
+ title: nodes[i].title || nodes[i].text,
+ warningTitle: nodes[i].warningTitle,
});
- });
+ if (openState) {
+ getResult(parentValues.concat([nodes[i].value]), {checked: state[0], half: state[1]});
+ }
+ }
}
+
+ getResult(parentValues, checkState);
+
+ // 如果指定节点全部打开
+ // if (o.open) {
+ // var allNodes = [];
+ // // 获取所有节点
+ // BI.each(nodes, function (idx, node) {
+ // allNodes = BI.concat(allNodes, self._getAllChildren(parentValues.concat([node.value])));
+ // });
+ // var lastFind;
+ // BI.each(allNodes, function (idx, node) {
+ // var valueMap = dealWithSelectedValue(node.parentValues, selectedValues);
+ // // REPORT-24409 fix: 设置节点全部展开,添加的节点没有给状态
+ // var parentCheckState = {};
+ // var find = BI.find(result, function (idx, pNode) {
+ // return pNode.id === node.pId;
+ // });
+ // if (find) {
+ // parentCheckState.checked = find.halfCheck ? false : find.checked;
+ // parentCheckState.half = find.halfCheck;
+ // // 默认展开也需要重置父节点的halfCheck
+ // if (BI.isNotNull(lastFind) && (lastFind !== find || allNodes.length - 1 === idx)) {
+ // lastFind.half = lastFind.halfCheck;
+ // lastFind.halfCheck = false;
+ // }
+ // }
+ // lastFind = find;
+ // var state = getCheckState(node.value, node.parentValues, valueMap, parentCheckState);
+ // result.push({
+ // id: node.id,
+ // pId: node.pId,
+ // value: node.value,
+ // text: node.text,
+ // times: 1,
+ // isParent: node.getChildrenLength() > 0,
+ // checked: state[0],
+ // halfCheck: state[1],
+ // open: true,
+ // disabled: node.disabled,
+ // title: node.title || node.text,
+ // warningTitle: node.warningTitle,
+ // });
+ // });
+ // }
+
// 深层嵌套的比较麻烦,这边先实现的是在根节点添加
if (parentValues.length === 0 && times === 1) {
result = BI.concat(self._getAddedValueNode(parentValues, selectedValues), result);
@@ -603,17 +614,17 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, {
BI.nextTick(function () {
callback({
items: result,
- hasNext: nodes.length > times * self._const.perPage
+ hasNext: self._getChildren(parentValues).length > times * self._const.perPage
});
});
- function judgeState(parentValues, selected_value, checkState) {
- var checked = checkState.checked, half = checkState.half;
- if (parentValues.length > 0 && !checked) {
- return false;
- }
- return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
- }
+ // function judgeState(parentValues, selected_value, checkState) {
+ // var checked = checkState.checked, half = checkState.half;
+ // if (parentValues.length > 0 && !checked) {
+ // return false;
+ // }
+ // return (parentValues.length === 0 || (checked && half) && !BI.isEmpty(selected_value));
+ // }
function dealWithSelectedValue(parentValues, selectedValues) {
var valueMap = {}, parents = (parentValues || []).slice(0);
diff --git a/src/component/treevaluechooser/pane.treevaluechooser.js b/src/component/treevaluechooser/pane.treevaluechooser.js
index e6fc4f07a..66486711a 100644
--- a/src/component/treevaluechooser/pane.treevaluechooser.js
+++ b/src/component/treevaluechooser/pane.treevaluechooser.js
@@ -29,6 +29,9 @@ BI.TreeValueChooserPane = BI.inherit(BI.AbstractTreeValueChooser, {
this.pane.on(BI.MultiSelectTree.EVENT_CHANGE, function () {
self.fireEvent(BI.TreeValueChooserPane.EVENT_CHANGE);
});
+ if (BI.isNotNull(o.value)) {
+ this.pane.setSelectedValue(o.value);
+ }
if (BI.isNotNull(o.items)) {
this._initData(o.items);
this.pane.populate();
diff --git a/src/core/1.lodash.js b/src/core/1.lodash.js
index 934448ac6..1fdf1bbc4 100644
--- a/src/core/1.lodash.js
+++ b/src/core/1.lodash.js
@@ -1,13 +1,13 @@
/**
* @license
* Lodash (Custom Build)
- * Build: `lodash core plus="debounce,throttle,get,set,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy,uniqBy,before,after,unescape,chunk"`
+ * Build: `lodash core plus="debounce,throttle,get,set,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,union,zipObject,initial,cloneDeep,clamp,isPlainObject,take,takeRight,without,difference,defaultsDeep,trim,merge,groupBy,uniqBy,before,after,unescape,chunk,pick,pickBy,identity"`
* Copyright JS Foundation and other contributors
* Released under MIT license
* Based on Underscore.js 1.8.3
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/
-;(function () {
+;(function() {
/** Used as a safe reference for `undefined` in pre-ES5 environments. */
var undefined;
@@ -191,7 +191,7 @@
var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
- var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
+ var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
/** Used to identify `toStringTag` values of typed arrays. */
var typedArrayTags = {};
@@ -269,11 +269,10 @@
var freeProcess = moduleExports && freeGlobal.process;
/** Used to access faster Node.js helpers. */
- var nodeUtil = (function () {
+ var nodeUtil = (function() {
try {
return freeProcess && freeProcess.binding && freeProcess.binding('util');
- } catch (e) {
- }
+ } catch (e) {}
}());
/* Node.js helper references. */
@@ -297,14 +296,10 @@
*/
function apply(func, thisArg, args) {
switch (args.length) {
- case 0:
- return func.call(thisArg);
- case 1:
- return func.call(thisArg, args[0]);
- case 2:
- return func.call(thisArg, args[0], args[1]);
- case 3:
- return func.call(thisArg, args[0], args[1], args[2]);
+ case 0: return func.call(thisArg);
+ case 1: return func.call(thisArg, args[0]);
+ case 2: return func.call(thisArg, args[0], args[1]);
+ case 3: return func.call(thisArg, args[0], args[1], args[2]);
}
return func.apply(thisArg, args);
}
@@ -551,7 +546,7 @@
*/
function baseFindKey(collection, predicate, eachFunc) {
var result;
- eachFunc(collection, function (value, key, collection) {
+ eachFunc(collection, function(value, key, collection) {
if (predicate(value, key, collection)) {
result = key;
return false;
@@ -617,7 +612,7 @@
* @returns {Function} Returns the new accessor function.
*/
function baseProperty(key) {
- return function (object) {
+ return function(object) {
return object == null ? undefined : object[key];
};
}
@@ -630,7 +625,7 @@
* @returns {Function} Returns the new accessor function.
*/
function basePropertyOf(object) {
- return function (key) {
+ return function(key) {
return object == null ? undefined : object[key];
};
}
@@ -649,7 +644,7 @@
* @returns {*} Returns the accumulated value.
*/
function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
- eachFunc(collection, function (value, index, collection) {
+ eachFunc(collection, function(value, index, collection) {
accumulator = initAccum
? (initAccum = false, value)
: iteratee(accumulator, value, index, collection);
@@ -704,7 +699,7 @@
* @returns {Function} Returns the new capped function.
*/
function baseUnary(func) {
- return function (value) {
+ return function(value) {
return func(value);
};
}
@@ -720,7 +715,7 @@
* @returns {Object} Returns the array of property values.
*/
function baseValues(object, props) {
- return arrayMap(props, function (key) {
+ return arrayMap(props, function(key) {
return object[key];
});
}
@@ -750,8 +745,7 @@
var index = -1,
length = strSymbols.length;
- while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
- }
+ while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
return index;
}
@@ -767,8 +761,7 @@
function charsEndIndex(strSymbols, chrSymbols) {
var index = strSymbols.length;
- while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {
- }
+ while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
return index;
}
@@ -852,7 +845,7 @@
var index = -1,
result = Array(map.size);
- map.forEach(function (value, key) {
+ map.forEach(function(value, key) {
result[++index] = [key, value];
});
return result;
@@ -867,7 +860,7 @@
* @returns {Function} Returns the new function.
*/
function overArg(func, transform) {
- return function (arg) {
+ return function(arg) {
return func(transform(arg));
};
}
@@ -922,7 +915,7 @@
var index = -1,
result = Array(set.size);
- set.forEach(function (value) {
+ set.forEach(function(value) {
result[++index] = value;
});
return result;
@@ -1031,7 +1024,7 @@
var idCounter = 0;
/** Used to detect methods masquerading as native. */
- var maskSrcKey = (function () {
+ var maskSrcKey = (function() {
var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
return uid ? ('Symbol(src)_1.' + uid) : '';
}());
@@ -1068,13 +1061,12 @@
symIterator = Symbol ? Symbol.iterator : undefined,
symToStringTag = Symbol ? Symbol.toStringTag : undefined;
- var defineProperty = (function () {
+ var defineProperty = (function() {
try {
var func = getNative(Object, 'defineProperty');
func({}, '', {});
return func;
- } catch (e) {
- }
+ } catch (e) {}
}());
/* Built-in method references for those with the same name as other `lodash` methods. */
@@ -1255,11 +1247,9 @@
* @param {Object} proto The object to inherit from.
* @returns {Object} Returns the new object.
*/
- var baseCreate = (function () {
- function object() {
- }
-
- return function (proto) {
+ var baseCreate = (function() {
+ function object() {}
+ return function(proto) {
if (!isObject(proto)) {
return {};
}
@@ -2002,7 +1992,7 @@
* @returns {Function} Returns `accumulator`.
*/
function baseAggregator(collection, setter, iteratee, accumulator) {
- baseEach(collection, function (value, key, collection) {
+ baseEach(collection, function(value, key, collection) {
setter(accumulator, value, iteratee(value), collection);
});
return accumulator;
@@ -2164,7 +2154,7 @@
stack.set(value, result);
if (isSet(value)) {
- value.forEach(function (subValue) {
+ value.forEach(function(subValue) {
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
});
@@ -2172,7 +2162,7 @@
}
if (isMap(value)) {
- value.forEach(function (subValue, key) {
+ value.forEach(function(subValue, key) {
result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
});
@@ -2184,7 +2174,7 @@
: (isFlat ? keysIn : keys);
var props = isArr ? undefined : keysFunc(value);
- arrayEach(props || value, function (subValue, key) {
+ arrayEach(props || value, function(subValue, key) {
if (props) {
key = subValue;
subValue = value[key];
@@ -2209,9 +2199,7 @@
if (typeof func != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
- return setTimeout(function () {
- func.apply(undefined, args);
- }, wait);
+ return setTimeout(function() { func.apply(undefined, args); }, wait);
}
/**
@@ -2242,7 +2230,8 @@
if (comparator) {
includes = arrayIncludesWith;
isCommon = false;
- } else if (values.length >= LARGE_ARRAY_SIZE) {
+ }
+ else if (values.length >= LARGE_ARRAY_SIZE) {
includes = cacheHas;
isCommon = false;
values = new SetCache(values);
@@ -2261,7 +2250,8 @@
}
}
result.push(value);
- } else if (!includes(values, computed, comparator)) {
+ }
+ else if (!includes(values, computed, comparator)) {
result.push(value);
}
}
@@ -2289,7 +2279,7 @@
*/
function baseEvery(collection, predicate) {
var result = true;
- baseEach(collection, function (value, index, collection) {
+ baseEach(collection, function(value, index, collection) {
result = !!predicate(value, index, collection);
return result;
});
@@ -2335,7 +2325,7 @@
*/
function baseFilter(collection, predicate) {
var result = [];
- baseEach(collection, function (value, index, collection) {
+ baseEach(collection, function(value, index, collection) {
if (predicate(value, index, collection)) {
result.push(value);
}
@@ -2436,7 +2426,7 @@
* @returns {Array} Returns the function names.
*/
function baseFunctions(object, props) {
- return arrayFilter(props, function (key) {
+ return arrayFilter(props, function(key) {
return isFunction(object[key]);
});
}
@@ -2605,7 +2595,7 @@
* @returns {Function} Returns `accumulator`.
*/
function baseInverter(object, setter, iteratee, accumulator) {
- baseForOwn(object, function (value, key, object) {
+ baseForOwn(object, function(value, key, object) {
setter(accumulator, iteratee(value), key, object);
});
return accumulator;
@@ -2939,7 +2929,7 @@
var index = -1,
result = isArrayLike(collection) ? Array(collection.length) : [];
- baseEach(collection, function (value, key, collection) {
+ baseEach(collection, function(value, key, collection) {
result[++index] = iteratee(value, key, collection);
});
return result;
@@ -2957,7 +2947,7 @@
if (matchData.length == 1 && matchData[0][2]) {
return matchesStrictComparable(matchData[0][0], matchData[0][1]);
}
- return function (object) {
+ return function(object) {
return object === source || baseIsMatch(object, source, matchData);
};
}
@@ -2974,7 +2964,7 @@
if (isKey(path) && isStrictComparable(srcValue)) {
return matchesStrictComparable(toKey(path), srcValue);
}
- return function (object) {
+ return function(object) {
var objValue = get(object, path);
return (objValue === undefined && objValue === srcValue)
? hasIn(object, path)
@@ -2997,11 +2987,12 @@
if (object === source) {
return;
}
- baseFor(source, function (srcValue, key) {
+ baseFor(source, function(srcValue, key) {
if (isObject(srcValue)) {
stack || (stack = new Stack);
baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
- } else {
+ }
+ else {
var newValue = customizer
? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
: undefined;
@@ -3053,25 +3044,32 @@
if (isArr || isBuff || isTyped) {
if (isArray(objValue)) {
newValue = objValue;
- } else if (isArrayLikeObject(objValue)) {
+ }
+ else if (isArrayLikeObject(objValue)) {
newValue = copyArray(objValue);
- } else if (isBuff) {
+ }
+ else if (isBuff) {
isCommon = false;
newValue = cloneBuffer(srcValue, true);
- } else if (isTyped) {
+ }
+ else if (isTyped) {
isCommon = false;
newValue = cloneTypedArray(srcValue, true);
- } else {
+ }
+ else {
newValue = [];
}
- } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
+ }
+ else if (isPlainObject(srcValue) || isArguments(srcValue)) {
newValue = objValue;
if (isArguments(objValue)) {
newValue = toPlainObject(objValue);
- } else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
+ }
+ else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
newValue = initCloneObject(srcValue);
}
- } else {
+ }
+ else {
isCommon = false;
}
}
@@ -3097,14 +3095,14 @@
var index = -1;
iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(baseIteratee));
- var result = baseMap(collection, function (value, key, collection) {
- var criteria = arrayMap(iteratees, function (iteratee) {
+ var result = baseMap(collection, function(value, key, collection) {
+ var criteria = arrayMap(iteratees, function(iteratee) {
return iteratee(value);
});
return { 'criteria': criteria, 'index': ++index, 'value': value };
});
- return baseSortBy(result, function (object, other) {
+ return baseSortBy(result, function(object, other) {
return compareMultiple(object, other, orders);
});
}
@@ -3119,7 +3117,7 @@
* @returns {Object} Returns the new object.
*/
function basePick(object, paths) {
- return basePickBy(object, paths, function (value, path) {
+ return basePickBy(object, paths, function(value, path) {
return hasIn(object, path);
});
}
@@ -3157,7 +3155,7 @@
* @returns {Function} Returns the new accessor function.
*/
function basePropertyDeep(path) {
- return function (object) {
+ return function(object) {
return baseGet(object, path);
};
}
@@ -3258,7 +3256,7 @@
* @param {*} data The metadata.
* @returns {Function} Returns `func`.
*/
- var baseSetData = !metaMap ? identity : function (func, data) {
+ var baseSetData = !metaMap ? identity : function(func, data) {
metaMap.set(func, data);
return func;
};
@@ -3271,7 +3269,7 @@
* @param {Function} string The `toString` result.
* @returns {Function} Returns `func`.
*/
- var baseSetToString = !defineProperty ? identity : function (func, string) {
+ var baseSetToString = !defineProperty ? identity : function(func, string) {
return defineProperty(func, 'toString', {
'configurable': true,
'enumerable': false,
@@ -3322,7 +3320,7 @@
function baseSome(collection, predicate) {
var result;
- baseEach(collection, function (value, index, collection) {
+ baseEach(collection, function(value, index, collection) {
result = predicate(value, index, collection);
return !result;
});
@@ -3373,7 +3371,8 @@
if (comparator) {
isCommon = false;
includes = arrayIncludesWith;
- } else if (length >= LARGE_ARRAY_SIZE) {
+ }
+ else if (length >= LARGE_ARRAY_SIZE) {
var set = iteratee ? null : createSet(array);
if (set) {
return setToArray(set);
@@ -3381,7 +3380,8 @@
isCommon = false;
includes = cacheHas;
seen = new SetCache;
- } else {
+ }
+ else {
seen = iteratee ? [] : result;
}
outer:
@@ -3401,7 +3401,8 @@
seen.push(computed);
}
result.push(value);
- } else if (!includes(seen, computed, comparator)) {
+ }
+ else if (!includes(seen, computed, comparator)) {
if (seen !== result) {
seen.push(computed);
}
@@ -3440,7 +3441,7 @@
if (result instanceof LazyWrapper) {
result = result.value();
}
- return arrayReduce(actions, function (result, action) {
+ return arrayReduce(actions, function(result, action) {
return action.func.apply(action.thisArg, arrayPush([result], action.args));
}, result);
}
@@ -3829,7 +3830,7 @@
* @returns {Function} Returns the new aggregator function.
*/
function createAggregator(setter, initializer) {
- return function (collection, iteratee) {
+ return function(collection, iteratee) {
var func = isArray(collection) ? arrayAggregator : baseAggregator,
accumulator = initializer ? initializer() : {};
@@ -3845,7 +3846,7 @@
* @returns {Function} Returns the new assigner function.
*/
function createAssigner(assigner) {
- return baseRest(function (object, sources) {
+ return baseRest(function(object, sources) {
var index = -1,
length = sources.length,
customizer = length > 1 ? sources[length - 1] : undefined,
@@ -3879,7 +3880,7 @@
* @returns {Function} Returns the new base function.
*/
function createBaseEach(eachFunc, fromRight) {
- return function (collection, iteratee) {
+ return function(collection, iteratee) {
if (collection == null) {
return collection;
}
@@ -3907,7 +3908,7 @@
* @returns {Function} Returns the new base function.
*/
function createBaseFor(fromRight) {
- return function (object, iteratee, keysFunc) {
+ return function(object, iteratee, keysFunc) {
var index = -1,
iterable = Object(object),
props = keysFunc(object),
@@ -3941,7 +3942,6 @@
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return fn.apply(isBind ? thisArg : this, arguments);
}
-
return wrapper;
}
@@ -3954,28 +3954,20 @@
* @returns {Function} Returns the new wrapped function.
*/
function createCtor(Ctor) {
- return function () {
+ return function() {
// Use a `switch` statement to work with class constructors. See
// http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
// for more details.
var args = arguments;
switch (args.length) {
- case 0:
- return new Ctor;
- case 1:
- return new Ctor(args[0]);
- case 2:
- return new Ctor(args[0], args[1]);
- case 3:
- return new Ctor(args[0], args[1], args[2]);
- case 4:
- return new Ctor(args[0], args[1], args[2], args[3]);
- case 5:
- return new Ctor(args[0], args[1], args[2], args[3], args[4]);
- case 6:
- return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
- case 7:
- return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
+ case 0: return new Ctor;
+ case 1: return new Ctor(args[0]);
+ case 2: return new Ctor(args[0], args[1]);
+ case 3: return new Ctor(args[0], args[1], args[2]);
+ case 4: return new Ctor(args[0], args[1], args[2], args[3]);
+ case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
+ case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
+ case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
}
var thisBinding = baseCreate(Ctor.prototype),
result = Ctor.apply(thisBinding, args);
@@ -4020,7 +4012,6 @@
var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
return apply(fn, this, args);
}
-
return wrapper;
}
@@ -4032,14 +4023,12 @@
* @returns {Function} Returns the new find function.
*/
function createFind(findIndexFunc) {
- return function (collection, predicate, fromIndex) {
+ return function(collection, predicate, fromIndex) {
var iterable = Object(collection);
if (!isArrayLike(collection)) {
var iteratee = baseIteratee(predicate, 3);
collection = keys(collection);
- predicate = function (key) {
- return iteratee(iterable[key], key, iterable);
- };
+ predicate = function(key) { return iteratee(iterable[key], key, iterable); };
}
var index = findIndexFunc(collection, predicate, fromIndex);
return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
@@ -4116,7 +4105,6 @@
}
return fn.apply(thisBinding, args);
}
-
return wrapper;
}
@@ -4129,7 +4117,7 @@
* @returns {Function} Returns the new inverter function.
*/
function createInverter(setter, toIteratee) {
- return function (object, iteratee) {
+ return function(object, iteratee) {
return baseInverter(object, setter, toIteratee(iteratee), {});
};
}
@@ -4166,7 +4154,6 @@
}
return apply(fn, isBind ? thisArg : this, args);
}
-
return wrapper;
}
@@ -4178,7 +4165,7 @@
* @returns {Function} Returns the new range function.
*/
function createRange(fromRight) {
- return function (start, end, step) {
+ return function(start, end, step) {
if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
end = step = undefined;
}
@@ -4245,7 +4232,7 @@
* @param {Array} values The values to add to the set.
* @returns {Object} Returns the new set.
*/
- var createSet = !(Set && (1 / setToArray(new Set([, -0]))[1]) == INFINITY) ? noop : function (values) {
+ var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
return new Set(values);
};
@@ -4418,7 +4405,7 @@
}
// Recursively compare arrays (susceptible to call stack limits).
if (seen) {
- if (!arraySome(other, function (othValue, othIndex) {
+ if (!arraySome(other, function(othValue, othIndex) {
if (!cacheHas(seen, othIndex) &&
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
return seen.push(othIndex);
@@ -4640,7 +4627,7 @@
* @param {Function} func The function to query.
* @returns {*} Returns the metadata for `func`.
*/
- var getData = !metaMap ? noop : function (func) {
+ var getData = !metaMap ? noop : function(func) {
return metaMap.get(func);
};
@@ -4740,8 +4727,7 @@
try {
value[symToStringTag] = undefined;
var unmasked = true;
- } catch (e) {
- }
+ } catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
@@ -4761,12 +4747,12 @@
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
- var getSymbols = !nativeGetSymbols ? stubArray : function (object) {
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
if (object == null) {
return [];
}
object = Object(object);
- return arrayFilter(nativeGetSymbols(object), function (symbol) {
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
return propertyIsEnumerable.call(object, symbol);
});
};
@@ -4778,7 +4764,7 @@
* @param {Object} object The object to query.
* @returns {Array} Returns the array of symbols.
*/
- var getSymbolsIn = !nativeGetSymbols ? stubArray : function (object) {
+ var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
var result = [];
while (object) {
arrayPush(result, getSymbols(object));
@@ -4802,23 +4788,18 @@
(Promise && getTag(Promise.resolve()) != promiseTag) ||
(Set && getTag(new Set) != setTag) ||
(WeakMap && getTag(new WeakMap) != weakMapTag)) {
- getTag = function (value) {
+ getTag = function(value) {
var result = baseGetTag(value),
Ctor = result == objectTag ? value.constructor : undefined,
ctorString = Ctor ? toSource(Ctor) : '';
if (ctorString) {
switch (ctorString) {
- case dataViewCtorString:
- return dataViewTag;
- case mapCtorString:
- return mapTag;
- case promiseCtorString:
- return promiseTag;
- case setCtorString:
- return setTag;
- case weakMapCtorString:
- return weakMapTag;
+ case dataViewCtorString: return dataViewTag;
+ case mapCtorString: return mapTag;
+ case promiseCtorString: return promiseTag;
+ case setCtorString: return setTag;
+ case weakMapCtorString: return weakMapTag;
}
}
return result;
@@ -4844,18 +4825,10 @@
size = data.size;
switch (data.type) {
- case 'drop':
- start += size;
- break;
- case 'dropRight':
- end -= size;
- break;
- case 'take':
- end = nativeMin(end, start + size);
- break;
- case 'takeRight':
- start = nativeMax(start, end - size);
- break;
+ case 'drop': start += size; break;
+ case 'dropRight': end -= size; break;
+ case 'take': end = nativeMin(end, start + size); break;
+ case 'takeRight': start = nativeMax(start, end - size); break;
}
}
return { 'start': start, 'end': end };
@@ -4961,15 +4934,9 @@
case dataViewTag:
return cloneDataView(object, isDeep);
- case float32Tag:
- case float64Tag:
- case int8Tag:
- case int16Tag:
- case int32Tag:
- case uint8Tag:
- case uint8ClampedTag:
- case uint16Tag:
- case uint32Tag:
+ case float32Tag: case float64Tag:
+ case int8Tag: case int16Tag: case int32Tag:
+ case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
return cloneTypedArray(object, isDeep);
case mapTag:
@@ -5167,7 +5134,7 @@
* @returns {Function} Returns the new spec function.
*/
function matchesStrictComparable(key, srcValue) {
- return function (object) {
+ return function(object) {
if (object == null) {
return false;
}
@@ -5185,7 +5152,7 @@
* @returns {Function} Returns the new memoized function.
*/
function memoizeCapped(func) {
- var result = memoize(func, function (key) {
+ var result = memoize(func, function(key) {
if (cache.size === MAX_MEMOIZE_SIZE) {
cache.clear();
}
@@ -5308,7 +5275,7 @@
*/
function overRest(func, start, transform) {
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
- return function () {
+ return function() {
var args = arguments,
index = -1,
length = nativeMax(args.length - start, 0),
@@ -5415,7 +5382,7 @@
var count = 0,
lastCalled = 0;
- return function () {
+ return function() {
var stamp = nativeNow(),
remaining = HOT_SPAN - (stamp - lastCalled);
@@ -5438,12 +5405,12 @@
* @param {string} string The string to convert.
* @returns {Array} Returns the property path array.
*/
- var stringToPath = memoizeCapped(function (string) {
+ var stringToPath = memoizeCapped(function(string) {
var result = [];
if (string.charCodeAt(0) === 46 /* . */) {
result.push('');
}
- string.replace(rePropName, function (match, number, quote, subString) {
+ string.replace(rePropName, function(match, number, quote, subString) {
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
});
return result;
@@ -5475,12 +5442,10 @@
if (func != null) {
try {
return funcToString.call(func);
- } catch (e) {
- }
+ } catch (e) {}
try {
return (func + '');
- } catch (e) {
- }
+ } catch (e) {}
}
return '';
}
@@ -5494,7 +5459,7 @@
* @returns {Array} Returns `details`.
*/
function updateWrapDetails(details, bitmask) {
- arrayEach(wrapFlags, function (pair) {
+ arrayEach(wrapFlags, function(pair) {
var value = '_.' + pair[0];
if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
details.push(value);
@@ -5516,7 +5481,7 @@
}
var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
result.__actions__ = copyArray(wrapper.__actions__);
- result.__index__ = wrapper.__index__;
+ result.__index__ = wrapper.__index__;
result.__values__ = wrapper.__values__;
return result;
}
@@ -5652,7 +5617,7 @@
* _.difference([2, 1], [2, 3]);
* // => [1]
*/
- var difference = baseRest(function (array, values) {
+ var difference = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
: [];
@@ -5920,7 +5885,7 @@
* _.intersection([2, 1], [2, 3]);
* // => [2]
*/
- var intersection = baseRest(function (arrays) {
+ var intersection = baseRest(function(arrays) {
var mapped = arrayMap(arrays, castArrayLikeObject);
return (mapped.length && mapped[0] === arrays[0])
? baseIntersection(mapped)
@@ -5997,7 +5962,8 @@
if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
start = 0;
end = length;
- } else {
+ }
+ else {
start = start == null ? 0 : toInteger(start);
end = end === undefined ? length : toInteger(end);
}
@@ -6088,7 +6054,7 @@
* _.union([2], [1, 2]);
* // => [2, 1]
*/
- var union = baseRest(function (arrays) {
+ var union = baseRest(function(arrays) {
return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
});
@@ -6165,13 +6131,13 @@
return [];
}
var length = 0;
- array = arrayFilter(array, function (group) {
+ array = arrayFilter(array, function(group) {
if (isArrayLikeObject(group)) {
length = nativeMax(group.length, length);
return true;
}
});
- return baseTimes(length, function (index) {
+ return baseTimes(length, function(index) {
return arrayMap(array, baseProperty(index));
});
}
@@ -6196,7 +6162,7 @@
* _.without([2, 1, 2, 3], 1, 2);
* // => [3]
*/
- var without = baseRest(function (array, values) {
+ var without = baseRest(function(array, values) {
return isArrayLikeObject(array)
? baseDifference(array, values)
: [];
@@ -6348,13 +6314,11 @@
* _(object).at(['a[0].b.c', 'a[1]']).value();
* // => [3, 4]
*/
- var wrapperAt = flatRest(function (paths) {
+ var wrapperAt = flatRest(function(paths) {
var length = paths.length,
start = length ? paths[0] : 0,
value = this.__wrapped__,
- interceptor = function (object) {
- return baseAt(object, paths);
- };
+ interceptor = function(object) { return baseAt(object, paths); };
if (length > 1 || this.__actions__.length ||
!(value instanceof LazyWrapper) || !isIndex(start)) {
@@ -6366,7 +6330,7 @@
'args': [interceptor],
'thisArg': undefined
});
- return new LodashWrapper(value, this.__chain__).thru(function (array) {
+ return new LodashWrapper(value, this.__chain__).thru(function(array) {
if (length && !array.length) {
array.push(undefined);
}
@@ -6613,7 +6577,7 @@
* _.countBy(['one', 'two', 'three'], 'length');
* // => { '3': 2, '5': 1 }
*/
- var countBy = createAggregator(function (result, value, key) {
+ var countBy = createAggregator(function(result, value, key) {
if (hasOwnProperty.call(result, key)) {
++result[key];
} else {
@@ -6808,7 +6772,7 @@
* _.groupBy(['one', 'two', 'three'], 'length');
* // => { '3': ['one', 'two'], '5': ['three'] }
*/
- var groupBy = createAggregator(function (result, value, key) {
+ var groupBy = createAggregator(function(result, value, key) {
if (hasOwnProperty.call(result, key)) {
result[key].push(value);
} else {
@@ -7054,7 +7018,7 @@
* _.sortBy(users, ['user', 'age']);
* // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
*/
- var sortBy = baseRest(function (collection, iteratees) {
+ var sortBy = baseRest(function(collection, iteratees) {
if (collection == null) {
return [];
}
@@ -7085,7 +7049,7 @@
* }, _.now());
* // => Logs the number of milliseconds it took for the deferred invocation.
*/
- var now = function () {
+ var now = function() {
return root.Date.now();
};
@@ -7120,7 +7084,7 @@
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
- return function () {
+ return function() {
if (--n < 1) {
return func.apply(this, arguments);
}
@@ -7150,7 +7114,7 @@
throw new TypeError(FUNC_ERROR_TEXT);
}
n = toInteger(n);
- return function () {
+ return function() {
if (--n > 0) {
result = func.apply(this, arguments);
}
@@ -7196,7 +7160,7 @@
* bound('hi');
* // => 'hi fred!'
*/
- var bind = baseRest(function (func, thisArg, partials) {
+ var bind = baseRest(function(func, thisArg, partials) {
var bitmask = WRAP_BIND_FLAG;
if (partials.length) {
var holders = replaceHolders(partials, getHolder(bind));
@@ -7378,7 +7342,6 @@
}
return result;
}
-
debounced.cancel = cancel;
debounced.flush = flush;
return debounced;
@@ -7402,7 +7365,7 @@
* }, 'deferred');
* // => Logs 'deferred' after one millisecond.
*/
- var defer = baseRest(function (func, args) {
+ var defer = baseRest(function(func, args) {
return baseDelay(func, 1, args);
});
@@ -7425,7 +7388,7 @@
* }, 1000, 'later');
* // => Logs 'later' after one second.
*/
- var delay = baseRest(function (func, wait, args) {
+ var delay = baseRest(function(func, wait, args) {
return baseDelay(func, toNumber(wait) || 0, args);
});
@@ -7477,7 +7440,7 @@
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
throw new TypeError(FUNC_ERROR_TEXT);
}
- var memoized = function () {
+ var memoized = function() {
var args = arguments,
key = resolver ? resolver.apply(this, args) : args[0],
cache = memoized.cache;
@@ -7520,17 +7483,13 @@
if (typeof predicate != 'function') {
throw new TypeError(FUNC_ERROR_TEXT);
}
- return function () {
+ return function() {
var args = arguments;
switch (args.length) {
- case 0:
- return !predicate.call(this);
- case 1:
- return !predicate.call(this, args[0]);
- case 2:
- return !predicate.call(this, args[0], args[1]);
- case 3:
- return !predicate.call(this, args[0], args[1], args[2]);
+ case 0: return !predicate.call(this);
+ case 1: return !predicate.call(this, args[0]);
+ case 2: return !predicate.call(this, args[0], args[1]);
+ case 3: return !predicate.call(this, args[0], args[1], args[2]);
}
return !predicate.apply(this, args);
};
@@ -7761,9 +7720,7 @@
* _.isArguments([1, 2, 3]);
* // => false
*/
- var isArguments = baseIsArguments(function () {
- return arguments;
- }()) ? baseIsArguments : function (value) {
+ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
!propertyIsEnumerable.call(value, 'callee');
};
@@ -8652,7 +8609,7 @@
* _.assignIn({ 'a': 0 }, new Foo, new Bar);
* // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
*/
- var assignIn = createAssigner(function (object, source) {
+ var assignIn = createAssigner(function(object, source) {
copyObject(source, keysIn(source), object);
});
@@ -8716,7 +8673,7 @@
* _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
* // => { 'a': 1, 'b': 2 }
*/
- var defaults = baseRest(function (object, sources) {
+ var defaults = baseRest(function(object, sources) {
object = Object(object);
var index = -1;
@@ -8766,7 +8723,7 @@
* _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
* // => { 'a': { 'b': 2, 'c': 3 } }
*/
- var defaultsDeep = baseRest(function (args) {
+ var defaultsDeep = baseRest(function(args) {
args.push(undefined, customDefaultsMerge);
return apply(mergeWith, undefined, args);
});
@@ -8958,7 +8915,7 @@
* _.invert(object);
* // => { '1': 'c', '2': 'b' }
*/
- var invert = createInverter(function (result, value, key) {
+ var invert = createInverter(function(result, value, key) {
if (value != null &&
typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
@@ -8993,7 +8950,7 @@
* });
* // => { 'group1': ['a', 'c'], 'group2': ['b'] }
*/
- var invertBy = createInverter(function (result, value, key) {
+ var invertBy = createInverter(function(result, value, key) {
if (value != null &&
typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
@@ -9096,7 +9053,7 @@
* _.merge(object, other);
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
*/
- var merge = createAssigner(function (object, source, srcIndex) {
+ var merge = createAssigner(function(object, source, srcIndex) {
baseMerge(object, source, srcIndex);
});
@@ -9131,7 +9088,7 @@
* _.mergeWith(object, other, customizer);
* // => { 'a': [1, 3], 'b': [2, 4] }
*/
- var mergeWith = createAssigner(function (object, source, srcIndex, customizer) {
+ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
baseMerge(object, source, srcIndex, customizer);
});
@@ -9155,13 +9112,13 @@
* _.omit(object, ['a', 'c']);
* // => { 'b': '2' }
*/
- var omit = flatRest(function (object, paths) {
+ var omit = flatRest(function(object, paths) {
var result = {};
if (object == null) {
return result;
}
var isDeep = false;
- paths = arrayMap(paths, function (path) {
+ paths = arrayMap(paths, function(path) {
path = castPath(path, object);
isDeep || (isDeep = path.length > 1);
return path;
@@ -9218,7 +9175,7 @@
* _.pick(object, ['a', 'c']);
* // => { 'a': 1, 'c': 3 }
*/
- var pick = flatRest(function (object, paths) {
+ var pick = flatRest(function(object, paths) {
return object == null ? {} : basePick(object, paths);
});
@@ -9244,11 +9201,11 @@
if (object == null) {
return {};
}
- var props = arrayMap(getAllKeysIn(object), function (prop) {
+ var props = arrayMap(getAllKeysIn(object), function(prop) {
return [prop];
});
predicate = baseIteratee(predicate);
- return basePickBy(object, props, function (value, path) {
+ return basePickBy(object, props, function(value, path) {
return predicate(value, path[0]);
});
}
@@ -9442,7 +9399,8 @@
if (typeof upper == 'boolean') {
floating = upper;
upper = undefined;
- } else if (typeof lower == 'boolean') {
+ }
+ else if (typeof lower == 'boolean') {
floating = lower;
lower = undefined;
}
@@ -9450,7 +9408,8 @@
if (lower === undefined && upper === undefined) {
lower = 0;
upper = 1;
- } else {
+ }
+ else {
lower = toFinite(lower);
if (upper === undefined) {
upper = lower;
@@ -9594,7 +9553,7 @@
* // => true
*/
function constant(value) {
- return function () {
+ return function() {
return value;
};
}
@@ -9747,11 +9706,11 @@
var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
isFunc = isFunction(object);
- arrayEach(methodNames, function (methodName) {
+ arrayEach(methodNames, function(methodName) {
var func = source[methodName];
object[methodName] = func;
if (isFunc) {
- object.prototype[methodName] = function () {
+ object.prototype[methodName] = function() {
var chainAll = this.__chain__;
if (chain || chainAll) {
var result = object(this.__wrapped__),
@@ -10024,6 +9983,7 @@
lodash.omitBy = omitBy;
lodash.once = once;
lodash.pick = pick;
+ lodash.pickBy = pickBy;
lodash.range = range;
lodash.reject = reject;
lodash.rest = rest;
@@ -10105,9 +10065,9 @@
lodash.each = forEach;
lodash.first = head;
- mixin(lodash, (function () {
+ mixin(lodash, (function() {
var source = {};
- baseForOwn(lodash, function (func, methodName) {
+ baseForOwn(lodash, function(func, methodName) {
if (!hasOwnProperty.call(lodash.prototype, methodName)) {
source[methodName] = func;
}
@@ -10127,8 +10087,8 @@
lodash.VERSION = VERSION;
// Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
- arrayEach(['drop', 'take'], function (methodName, index) {
- LazyWrapper.prototype[methodName] = function (n) {
+ arrayEach(['drop', 'take'], function(methodName, index) {
+ LazyWrapper.prototype[methodName] = function(n) {
n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
var result = (this.__filtered__ && !index)
@@ -10146,17 +10106,17 @@
return result;
};
- LazyWrapper.prototype[methodName + 'Right'] = function (n) {
+ LazyWrapper.prototype[methodName + 'Right'] = function(n) {
return this.reverse()[methodName](n).reverse();
};
});
// Add `LazyWrapper` methods that accept an `iteratee` value.
- arrayEach(['filter', 'map', 'takeWhile'], function (methodName, index) {
+ arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
var type = index + 1,
isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
- LazyWrapper.prototype[methodName] = function (iteratee) {
+ LazyWrapper.prototype[methodName] = function(iteratee) {
var result = this.clone();
result.__iteratees__.push({
'iteratee': getIteratee(iteratee, 3),
@@ -10168,49 +10128,49 @@
});
// Add `LazyWrapper` methods for `_.head` and `_.last`.
- arrayEach(['head', 'last'], function (methodName, index) {
+ arrayEach(['head', 'last'], function(methodName, index) {
var takeName = 'take' + (index ? 'Right' : '');
- LazyWrapper.prototype[methodName] = function () {
+ LazyWrapper.prototype[methodName] = function() {
return this[takeName](1).value()[0];
};
});
// Add `LazyWrapper` methods for `_.initial` and `_.tail`.
- arrayEach(['initial', 'tail'], function (methodName, index) {
+ arrayEach(['initial', 'tail'], function(methodName, index) {
var dropName = 'drop' + (index ? '' : 'Right');
- LazyWrapper.prototype[methodName] = function () {
+ LazyWrapper.prototype[methodName] = function() {
return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
};
});
- LazyWrapper.prototype.compact = function () {
+ LazyWrapper.prototype.compact = function() {
return this.filter(identity);
};
- LazyWrapper.prototype.find = function (predicate) {
+ LazyWrapper.prototype.find = function(predicate) {
return this.filter(predicate).head();
};
- LazyWrapper.prototype.findLast = function (predicate) {
+ LazyWrapper.prototype.findLast = function(predicate) {
return this.reverse().find(predicate);
};
- LazyWrapper.prototype.invokeMap = baseRest(function (path, args) {
+ LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
if (typeof path == 'function') {
return new LazyWrapper(this);
}
- return this.map(function (value) {
+ return this.map(function(value) {
return baseInvoke(value, path, args);
});
});
- LazyWrapper.prototype.reject = function (predicate) {
+ LazyWrapper.prototype.reject = function(predicate) {
return this.filter(negate(getIteratee(predicate)));
};
- LazyWrapper.prototype.slice = function (start, end) {
+ LazyWrapper.prototype.slice = function(start, end) {
start = toInteger(start);
var result = this;
@@ -10229,16 +10189,16 @@
return result;
};
- LazyWrapper.prototype.takeRightWhile = function (predicate) {
+ LazyWrapper.prototype.takeRightWhile = function(predicate) {
return this.reverse().takeWhile(predicate).reverse();
};
- LazyWrapper.prototype.toArray = function () {
+ LazyWrapper.prototype.toArray = function() {
return this.take(MAX_ARRAY_LENGTH);
};
// Add `LazyWrapper` methods to `lodash.prototype`.
- baseForOwn(LazyWrapper.prototype, function (func, methodName) {
+ baseForOwn(LazyWrapper.prototype, function(func, methodName) {
var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
isTaker = /^(?:head|last)$/.test(methodName),
lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
@@ -10247,14 +10207,14 @@
if (!lodashFunc) {
return;
}
- lodash.prototype[methodName] = function () {
+ lodash.prototype[methodName] = function() {
var value = this.__wrapped__,
args = isTaker ? [1] : arguments,
isLazy = value instanceof LazyWrapper,
iteratee = args[0],
useLazy = isLazy || isArray(value);
- var interceptor = function (value) {
+ var interceptor = function(value) {
var result = lodashFunc.apply(lodash, arrayPush([value], args));
return (isTaker && chainAll) ? result[0] : result;
};
@@ -10283,25 +10243,25 @@
});
// Add `Array` methods to `lodash.prototype`.
- arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function (methodName) {
+ arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
var func = arrayProto[methodName],
chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
retUnwrapped = /^(?:pop|shift)$/.test(methodName);
- lodash.prototype[methodName] = function () {
+ lodash.prototype[methodName] = function() {
var args = arguments;
if (retUnwrapped && !this.__chain__) {
var value = this.value();
return func.apply(isArray(value) ? value : [], args);
}
- return this[chainName](function (value) {
+ return this[chainName](function(value) {
return func.apply(isArray(value) ? value : [], args);
});
};
});
// Map minified method names to their real names.
- baseForOwn(LazyWrapper.prototype, function (func, methodName) {
+ baseForOwn(LazyWrapper.prototype, function(func, methodName) {
var lodashFunc = lodash[methodName];
if (lodashFunc) {
var key = (lodashFunc.name + ''),
@@ -10336,11 +10296,11 @@
// loaded by a script tag in the presence of an AMD loader.
// See http://requirejs.org/docs/errors.html#mismatch for more details.
// Use `_.noConflict` to remove Lodash from the global object.
- BI._ = lodash;
+ root._ = lodash;
// Define as an anonymous module so, through path mapping, it can be
// referenced as the "underscore" module.
- define(function () {
+ define(function() {
return lodash;
});
}
@@ -10350,7 +10310,8 @@
(freeModule.exports = lodash)._ = lodash;
// Export for CommonJS support.
freeExports._ = lodash;
- } else {
+ }
+ else {
// Export to the global object.
BI._ = lodash;
}
diff --git a/src/core/logic/logic.layout.js b/src/core/logic/logic.layout.js
index 21ce0f9b8..94cac3b2f 100644
--- a/src/core/logic/logic.layout.js
+++ b/src/core/logic/logic.layout.js
@@ -32,7 +32,7 @@ BI.VerticalLayoutLogic = BI.inherit(BI.Logic, {
} else {
layout = "bi.vtape";
}
- return {
+ return _.pickBy({
type: layout,
scrollable: o.scrollable,
scrolly: o.scrolly,
@@ -45,8 +45,12 @@ BI.VerticalLayoutLogic = BI.inherit(BI.Logic, {
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
- items: o.items
- };
+ items: o.items,
+ horizontalAlign: o.horizontalAlign,
+ verticalAlign: o.verticalAlign,
+ columnSize: o.columnSize,
+ rowSize: o.rowSize
+ }, _.identity);
}
});
@@ -85,7 +89,7 @@ BI.HorizontalLayoutLogic = BI.inherit(BI.Logic, {
} else {
layout = "bi.htape";
}
- return {
+ return _.pickBy({
type: layout,
scrollable: o.scrollable,
scrolly: o.scrolly,
@@ -98,8 +102,12 @@ BI.HorizontalLayoutLogic = BI.inherit(BI.Logic, {
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
- items: o.items
- };
+ items: o.items,
+ horizontalAlign: o.horizontalAlign,
+ verticalAlign: o.verticalAlign,
+ columnSize: o.columnSize,
+ rowSize: o.rowSize
+ }, _.identity);
}
});
@@ -135,19 +143,21 @@ BI.TableLayoutLogic = BI.inherit(BI.Logic, {
} else {
layout = "bi.window";
}
- return {
+ return _.pickBy({
type: layout,
scrollable: o.scrollable,
scrolly: o.scrolly,
scrollx: o.scrollx,
columns: o.columns,
rows: o.rows,
- columnSize: o.columnSize,
- rowSize: o.rowSize,
hgap: o.hgap,
vgap: o.vgap,
- items: o.items
- };
+ items: o.items,
+ horizontalAlign: o.horizontalAlign,
+ verticalAlign: o.verticalAlign,
+ columnSize: o.columnSize,
+ rowSize: o.rowSize
+ }, _.identity);
}
});
@@ -188,9 +198,8 @@ BI.HorizontalFillLayoutLogic = BI.inherit(BI.Logic, {
} else {
layout = "bi.htape";
}
- return {
+ return _.pickBy({
type: layout,
- columnSize: columnSize,
scrollable: o.scrollable,
scrolly: o.scrolly,
scrollx: o.scrollx,
@@ -202,7 +211,11 @@ BI.HorizontalFillLayoutLogic = BI.inherit(BI.Logic, {
bgap: o.bgap,
innerHgap: o.innerHgap,
innerVgap: o.innerVgap,
- items: o.items
- };
+ items: o.items,
+ horizontalAlign: o.horizontalAlign,
+ verticalAlign: o.verticalAlign,
+ columnSize: columnSize,
+ rowSize: o.rowSize
+ }, _.identity);
}
});
diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js
index 6a955a27e..66440ccf8 100644
--- a/src/core/platform/web/config.js
+++ b/src/core/platform/web/config.js
@@ -62,6 +62,13 @@
})
});
}
+ if (ob.verticalAlign === BI.VerticalAlign.Stretch) {
+ if (isSupportFlex()) {
+ return BI.extend({
+ horizontalAlign: BI.HorizontalAlign.Stretch,
+ }, ob, { type: "bi.flex_vertical" });
+ }
+ }
return ob;
});
BI.Plugin.configWidget("bi.inline", function (ob) {
@@ -229,7 +236,7 @@
return ob;
});
BI.Plugin.configWidget("bi.flex_horizontal", function (ob) {
- if (ob.scrollable === true || ob.scrollx !== false) {
+ if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) {
if (ob.hgap > 0 || ob.lgap > 0 || ob.rgap > 0) {
if (BI.Providers.getProvider("bi.provider.system").getResponsiveMode()) {
return BI.extend({}, ob, { type: "bi.responsive_flex_scrollable_horizontal" });
@@ -242,7 +249,7 @@
}
});
BI.Plugin.configWidget("bi.flex_vertical", function (ob) {
- if (ob.scrollable === true || ob.scrollx === true) {
+ if (ob.scrollable === true || ob.scrollx === true || ob.scrolly === true) {
if (ob.hgap > 0 || ob.lgap > 0 || ob.rgap > 0) {
return BI.extend({}, ob, { type: "bi.flex_scrollable_vertical" });
}
diff --git a/src/widget/intervalslider/intervalslider.js b/src/widget/intervalslider/intervalslider.js
index 68f098f37..130165680 100644
--- a/src/widget/intervalslider/intervalslider.js
+++ b/src/widget/intervalslider/intervalslider.js
@@ -15,7 +15,23 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
props: {
baseCls: "bi-interval-slider bi-slider-track",
digit: false,
- unit: ""
+ unit: "",
+ min: 0,
+ max: 100,
+ value: {
+ min: "",
+ max: "",
+ }
+ },
+
+ beforeMount: function () {
+ const { value, min, max } = this.options;
+ this.setMinAndMax({
+ min,
+ max,
+ });
+ this.setValue(value);
+ this.populate();
},
render: function () {
@@ -25,13 +41,8 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
this.enable = false;
this.valueOne = "";
this.valueTwo = "";
- this.calculation = new BI.AccurateCalculationModel();
- // this.backgroundTrack = BI.createWidget({
- // type: "bi.layout",
- // cls: "background-track",
- // height: c.TRACK_HEIGHT
- // });
+ this.calculation = new BI.AccurateCalculationModel();
this.grayTrack = BI.createWidget({
type: "bi.layout",
cls: "gray-track",
@@ -539,4 +550,4 @@ BI.IntervalSlider = BI.inherit(BI.Single, {
}
});
BI.IntervalSlider.EVENT_CHANGE = "EVENT_CHANGE";
-BI.shortcut("bi.interval_slider", BI.IntervalSlider);
\ No newline at end of file
+BI.shortcut("bi.interval_slider", BI.IntervalSlider);
diff --git a/src/widget/multiselectlist/multiselectlist.js b/src/widget/multiselectlist/multiselectlist.js
index eb0baaed1..bf152a17a 100644
--- a/src/widget/multiselectlist/multiselectlist.js
+++ b/src/widget/multiselectlist/multiselectlist.js
@@ -15,7 +15,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
BI.MultiSelectList.superclass._init.apply(this, arguments);
var self = this, o = this.options;
- this.storeValue = {};
+ 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));
@@ -31,6 +31,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
logic: {
dynamic: false
},
+ value: o.value,
isDefaultInit: true,
// onLoaded: o.onLoaded,
el: {}
@@ -198,6 +199,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
val || (val = {});
val.type || (val.type = BI.Selection.Multi);
val.value || (val.value = []);
+ return val;
},
_makeMap: function (values) {
diff --git a/src/widget/multitree/multi.tree.combo.js b/src/widget/multitree/multi.tree.combo.js
index f222e6f6e..96d448862 100644
--- a/src/widget/multitree/multi.tree.combo.js
+++ b/src/widget/multitree/multi.tree.combo.js
@@ -80,7 +80,8 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
};
self.trigger.getSearcher().setState(val);
self.numberCounter.setButtonChecked(val);
- self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM, self.combo.getValue());
+ self.storeValue.value = val;
+ self.fireEvent(BI.MultiTreeCombo.EVENT_CLICK_ITEM, self.getValue());
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
diff --git a/src/widget/multitree/multi.tree.insert.combo.js b/src/widget/multitree/multi.tree.insert.combo.js
index 5159c60dd..34cefda3f 100644
--- a/src/widget/multitree/multi.tree.insert.combo.js
+++ b/src/widget/multitree/multi.tree.insert.combo.js
@@ -97,7 +97,8 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
};
self.trigger.getSearcher().setState(val);
self.numberCounter.setButtonChecked(val);
- self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.combo.getValue());
+ self.storeValue.value = val;
+ self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CLICK_ITEM, self.getValue());
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
diff --git a/src/widget/multitree/multi.tree.list.combo.js b/src/widget/multitree/multi.tree.list.combo.js
index e22c5a7e0..ed0f8e47f 100644
--- a/src/widget/multitree/multi.tree.list.combo.js
+++ b/src/widget/multitree/multi.tree.list.combo.js
@@ -114,7 +114,8 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
};
self.trigger.getSearcher().setState(val);
self.numberCounter.setButtonChecked(val);
- self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.combo.getValue());
+ self.storeValue.value = val;
+ self.fireEvent(BI.MultiTreeListCombo.EVENT_CLICK_ITEM, self.getValue());
}
}, {
eventName: BI.MultiTreePopup.EVENT_CLICK_CONFIRM,
diff --git a/src/widget/singleslider/singleslider.js b/src/widget/singleslider/singleslider.js
index ea51dbace..a330115b9 100644
--- a/src/widget/singleslider/singleslider.js
+++ b/src/widget/singleslider/singleslider.js
@@ -16,7 +16,20 @@ BI.SingleSlider = BI.inherit(BI.Single, {
props: {
baseCls: "bi-single-slider bi-slider-track",
digit: false,
- unit: ""
+ unit: "",
+ value: "",
+ min: 0,
+ max: 100,
+ },
+
+ beforeMount: function () {
+ const { value, min, max } = this.options;
+ this.setMinAndMax({
+ min,
+ max,
+ });
+ this.setValue(value);
+ this.populate();
},
render: function () {
@@ -340,4 +353,4 @@ BI.SingleSlider = BI.inherit(BI.Single, {
}
});
BI.SingleSlider.EVENT_CHANGE = "EVENT_CHANGE";
-BI.shortcut("bi.single_slider", BI.SingleSlider);
\ No newline at end of file
+BI.shortcut("bi.single_slider", BI.SingleSlider);
diff --git a/src/widget/singleslider/singleslider.label.js b/src/widget/singleslider/singleslider.label.js
index fce46f013..d6b8aa639 100644
--- a/src/widget/singleslider/singleslider.label.js
+++ b/src/widget/singleslider/singleslider.label.js
@@ -13,16 +13,27 @@ BI.SingleSliderLabel = BI.inherit(BI.Single, {
TRACK_GAP_HALF: 7,
TRACK_GAP: 14
},
- _defaultConfig: function () {
- return BI.extend(BI.SingleSliderLabel.superclass._defaultConfig.apply(this, arguments), {
- baseCls: "bi-single-slider-label bi-slider-track",
- digit: false,
- unit: ""
+
+ props: {
+ baseCls: "bi-single-slider-label bi-slider-track",
+ digit: false,
+ unit: "",
+ value: "",
+ min: 0,
+ max: 100,
+ },
+
+ beforeMount: function () {
+ const { value, min, max } = this.options;
+ this.setMinAndMax({
+ min,
+ max,
});
+ this.setValue(value);
+ this.populate();
},
- _init: function () {
- BI.SingleSliderLabel.superclass._init.apply(this, arguments);
+ render: function () {
var self = this, o = this.options;
var c = this._constant;
this.enable = false;
@@ -83,9 +94,8 @@ BI.SingleSliderLabel = BI.inherit(BI.Single, {
});
this._setVisible(false);
- BI.createWidget({
+ return ({
type: "bi.absolute",
- element: this,
items: [{
el: {
type: "bi.vertical",
@@ -308,4 +318,4 @@ BI.SingleSliderLabel = BI.inherit(BI.Single, {
}
});
BI.SingleSliderLabel.EVENT_CHANGE = "EVENT_CHANGE";
-BI.shortcut("bi.single_slider_label", BI.SingleSliderLabel);
\ No newline at end of file
+BI.shortcut("bi.single_slider_label", BI.SingleSliderLabel);
diff --git a/src/widget/singleslider/singleslider.normal.js b/src/widget/singleslider/singleslider.normal.js
index 2ba74c8b9..095a5fadf 100644
--- a/src/widget/singleslider/singleslider.normal.js
+++ b/src/widget/singleslider/singleslider.normal.js
@@ -16,16 +16,27 @@ BI.SingleSliderNormal = BI.inherit(BI.Single, {
props: {
baseCls: "bi-single-slider-normal bi-slider-track",
- minMax: {
- min: 0,
- max: 100
- }
+ min: 0,
+ max: 100,
+ value: "",
// color: "#3f8ce8"
},
+ beforeMount: function () {
+ const { value, min, max } = this.options;
+ this.setMinAndMax({
+ min,
+ max,
+ });
+ this.setValue(value);
+ this.populate();
+ },
+
render: function () {
var self = this;
+ var o = this.options;
var c = this._constant;
+
var track = this._createTrack();
this.slider = BI.createWidget({
type: "bi.single_slider_button"
@@ -282,4 +293,4 @@ BI.SingleSliderNormal = BI.inherit(BI.Single, {
}
});
BI.SingleSliderNormal.EVENT_DRAG = "EVENT_DRAG";
-BI.shortcut("bi.single_slider_normal", BI.SingleSliderNormal);
\ No newline at end of file
+BI.shortcut("bi.single_slider_normal", BI.SingleSliderNormal);