From e62789b795bd5bbc286cad02ac76910f5868c76d Mon Sep 17 00:00:00 2001 From: data Date: Fri, 16 Sep 2022 14:24:32 +0800 Subject: [PATCH 01/24] auto upgrade version to 2.0.20220916142417 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bea49278e..528ee1a3e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220916093936", + "version": "2.0.20220916142417", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 0a753b689be6fd971089257a1ac950d8ca59f63e Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 16 Sep 2022 14:26:14 +0800 Subject: [PATCH 02/24] KERNEL-12794 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bi.slider数值滑块控件,支持通过props设置初始值 --- demo/js/widget/slider/demo.slider.js | 64 ++++++++----------- src/widget/intervalslider/intervalslider.js | 27 +++++--- src/widget/singleslider/singleslider.js | 17 ++++- src/widget/singleslider/singleslider.label.js | 30 ++++++--- .../singleslider/singleslider.normal.js | 21 ++++-- 5 files changed, 95 insertions(+), 64 deletions(-) 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/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/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); From 182c811769fc42b1275290a9d0aceb4e0ef0e6c9 Mon Sep 17 00:00:00 2001 From: data Date: Fri, 16 Sep 2022 16:34:26 +0800 Subject: [PATCH 03/24] auto upgrade version to 2.0.20220916163417 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 528ee1a3e..943412e92 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220916142417", + "version": "2.0.20220916163417", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 3e9d6add1c27b9feffa6c7fbf04fe0b85bb78fb4 Mon Sep 17 00:00:00 2001 From: guy Date: Fri, 16 Sep 2022 17:20:50 +0800 Subject: [PATCH 04/24] =?UTF-8?q?feature:=E6=8F=90=E4=BE=9Btextvaluecombo?= =?UTF-8?q?=E7=9A=84=E5=A4=8D=E9=80=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lodash.md | 2 +- .../combo/textvaluecombo/combo.textvalue.js | 18 +- .../combo/textvaluecombo/popup.textvalue.js | 129 ++++-- src/core/1.lodash.js | 437 ++++++++---------- src/core/logic/logic.layout.js | 43 +- src/core/platform/web/config.js | 7 + 6 files changed, 353 insertions(+), 283 deletions(-) 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/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index f6794f7bd..9a708cc83 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" }; }; @@ -96,6 +96,18 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { action: (...args) => { this.fireEvent(BI.Controller.EVENT_CHANGE, ...args); } + }, { + eventName: BI.TextValueComboPopup.EVENT_CLEAR, + action: (...args) => { + changeTag = true; + this.setValue([]); + this.combo.hideView(); + } + }, { + eventName: BI.TextValueComboPopup.EVENT_CONFIRM, + action: (...args) => { + this.combo.hideView(); + } } ] }; 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/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..efa5b0fe6 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) { From 4ae9acac39e9a98ab9a419dbd542d56e23c1d1fe Mon Sep 17 00:00:00 2001 From: data Date: Fri, 16 Sep 2022 17:44:25 +0800 Subject: [PATCH 05/24] auto upgrade version to 2.0.20220916174411 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 943412e92..c0b92a566 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220916163417", + "version": "2.0.20220916174411", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From cad3be1d060efd8a8f6ae4ff2cc59bed70de4bc9 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 17 Sep 2022 21:28:04 +0800 Subject: [PATCH 06/24] =?UTF-8?q?chore=EF=BC=9A=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/treevaluechooser/abstract.treevaluechooser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index eb918abf9..e4c78c9c5 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -548,7 +548,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { isParent: nodes[i].getChildrenLength() > 0, checked: state[0], halfCheck: state[1], - open: o.open, + open: nodes[i].open, disabled: nodes[i].disabled, title: nodes[i].title || nodes[i].text, warningTitle: nodes[i].warningTitle, From 6ddb1411c88dfc93516f9d0dfd6628a8be5b14d3 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 17 Sep 2022 21:55:18 +0800 Subject: [PATCH 07/24] =?UTF-8?q?chore=EF=BC=9A=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/treevaluechooser/abstract.treevaluechooser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index e4c78c9c5..33a824709 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -548,7 +548,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { isParent: nodes[i].getChildrenLength() > 0, checked: state[0], halfCheck: state[1], - open: nodes[i].open, + open: o.open || nodes[i].open, disabled: nodes[i].disabled, title: nodes[i].title || nodes[i].text, warningTitle: nodes[i].warningTitle, From 9cfb917a1d5d57f6297fa9b1ca21827625ef2a46 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 17 Sep 2022 21:56:29 +0800 Subject: [PATCH 08/24] =?UTF-8?q?chore=EF=BC=9A=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/treevaluechooser/abstract.treevaluechooser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index 33a824709..40c10350c 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -589,7 +589,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { isParent: node.getChildrenLength() > 0, checked: state[0], halfCheck: state[1], - open: self.options.open, + open: true, disabled: node.disabled, title: node.title || node.text, warningTitle: node.warningTitle, From b0863a623fc466cd694a29785a9e9ef6bca2fe7d Mon Sep 17 00:00:00 2001 From: data Date: Sat, 17 Sep 2022 21:56:41 +0800 Subject: [PATCH 09/24] auto upgrade version to 2.0.20220917215627 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c0b92a566..97a50c3d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220916174411", + "version": "2.0.20220917215627", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From de3c11fcc60376e383e9dd3dbd5f8679fc41f4bc Mon Sep 17 00:00:00 2001 From: data Date: Sat, 17 Sep 2022 22:15:33 +0800 Subject: [PATCH 10/24] auto upgrade version to 2.0.20220917221523 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 97a50c3d9..22d8677f5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220917215627", + "version": "2.0.20220917221523", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 8b857fe737ae302734f1a517e56164cc5164dd63 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 17 Sep 2022 23:11:54 +0800 Subject: [PATCH 11/24] =?UTF-8?q?chore=EF=BC=9A=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../abstract.treevaluechooser.js | 145 ++++++++++-------- 1 file changed, 78 insertions(+), 67 deletions(-) diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index 40c10350c..db31a1500 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 || nodes[i].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) { + 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: true, - 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])); + } + } } + + getResult(parentValues); + + // 如果指定节点全部打开 + // 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); From b1dd1b0954c9af7b4dc652875206a0514e23da11 Mon Sep 17 00:00:00 2001 From: guy Date: Sat, 17 Sep 2022 23:24:32 +0800 Subject: [PATCH 12/24] =?UTF-8?q?chore=EF=BC=9A=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/treevaluechooser/abstract.treevaluechooser.js | 6 +++--- src/component/treevaluechooser/pane.treevaluechooser.js | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/component/treevaluechooser/abstract.treevaluechooser.js b/src/component/treevaluechooser/abstract.treevaluechooser.js index db31a1500..53e31298f 100644 --- a/src/component/treevaluechooser/abstract.treevaluechooser.js +++ b/src/component/treevaluechooser/abstract.treevaluechooser.js @@ -532,7 +532,7 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { var checkState = op.checkState || {}; var parentValues = op.parentValues || []; var selectedValues = op.selectedValues || {}; - function getResult(parentValues) { + function getResult(parentValues, checkState) { var valueMap = {}; // if (judgeState(parentValues, selectedValues, checkState)) { valueMap = dealWithSelectedValue(parentValues, selectedValues); @@ -557,12 +557,12 @@ BI.AbstractTreeValueChooser = BI.inherit(BI.Widget, { warningTitle: nodes[i].warningTitle, }); if (openState) { - getResult(parentValues.concat([nodes[i].value])); + getResult(parentValues.concat([nodes[i].value]), {checked: state[0], half: state[1]}); } } } - getResult(parentValues); + getResult(parentValues, checkState); // 如果指定节点全部打开 // if (o.open) { 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(); From edfb23ef8f8a5f2d7e26556a6a00a387d46c1020 Mon Sep 17 00:00:00 2001 From: data Date: Sat, 17 Sep 2022 23:46:48 +0800 Subject: [PATCH 13/24] auto upgrade version to 2.0.20220917234637 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 22d8677f5..95bd1f80a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220917221523", + "version": "2.0.20220917234637", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 1f87e4ba3d694264d218cfada42b1fa4aab531c3 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 18 Sep 2022 00:18:31 +0800 Subject: [PATCH 14/24] =?UTF-8?q?chore=EF=BC=9A=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselectlist/multiselectlist.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { From 4d5c2bb996976fea17ac95884abf33ceda73c826 Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 18 Sep 2022 00:46:03 +0800 Subject: [PATCH 15/24] =?UTF-8?q?chore=EF=BC=9A=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/platform/web/config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/platform/web/config.js b/src/core/platform/web/config.js index efa5b0fe6..66440ccf8 100644 --- a/src/core/platform/web/config.js +++ b/src/core/platform/web/config.js @@ -236,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" }); @@ -249,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" }); } From b996f9b4aa31fcc7f3932bf1cb0b9c6b3756cfcc Mon Sep 17 00:00:00 2001 From: data Date: Sun, 18 Sep 2022 09:07:05 +0800 Subject: [PATCH 16/24] auto upgrade version to 2.0.20220918090653 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 95bd1f80a..65e12264f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220917234637", + "version": "2.0.20220918090653", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From f30c37926d491e3d8784de86fdc0111f4f6d2ac3 Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 19 Sep 2022 16:59:56 +0800 Subject: [PATCH 17/24] =?UTF-8?q?=E6=97=A0JIRA=20fix:=20bi.combo=E5=B8=83?= =?UTF-8?q?=E5=B1=80overflow=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/base/combination/bubble.js | 1 + src/base/combination/combo.js | 1 + 2 files changed, 2 insertions(+) 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 } From 2f91a2c93f8b2b71dcc106e16a45331ac6ca127c Mon Sep 17 00:00:00 2001 From: zsmj Date: Mon, 19 Sep 2022 19:25:32 +0800 Subject: [PATCH 18/24] =?UTF-8?q?=E6=97=A0JIRA=20feat:=20text=5Fvalue=5Fco?= =?UTF-8?q?mbo=E5=A4=9A=E9=80=89=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/case/combo/demo.text_value_combo.js | 26 ++++++++++++++++++- .../combo/textvaluecombo/combo.textvalue.js | 3 ++- src/case/trigger/trigger.text.select.js | 26 +++++-------------- 3 files changed, 33 insertions(+), 22 deletions(-) diff --git a/demo/js/case/combo/demo.text_value_combo.js b/demo/js/case/combo/demo.text_value_combo.js index 50e3fea43..44847adae 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,30 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, { vgap: 10, } ] + }), + this.createCombo("支持复选", { + type: "bi.vertical", + items: [ + { + type: "bi.text_value_combo", + ref: function () { + combo2 = this; + }, + 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/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index 9a708cc83..7f726bd13 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -100,7 +100,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { eventName: BI.TextValueComboPopup.EVENT_CLEAR, action: (...args) => { changeTag = true; - this.setValue([]); + this._clear(); this.combo.hideView(); } }, { @@ -151,6 +151,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { }, _clear: function () { + this.trigger.setText(""); this.combo.setValue(); this.setStatus("success"); }, 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) { From f262de07a33dd154c927a3a12e364c5f98e4653f Mon Sep 17 00:00:00 2001 From: data Date: Mon, 19 Sep 2022 19:48:00 +0800 Subject: [PATCH 19/24] auto upgrade version to 2.0.20220919194720 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 65e12264f..5a77fa775 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220918090653", + "version": "2.0.20220919194720", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 8b35f6aed2db0c582afad5b446096aeaccd94d47 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 20 Sep 2022 10:18:25 +0800 Subject: [PATCH 20/24] =?UTF-8?q?=E6=97=A0JIRA=20feat:=20text=5Fvalue=5Fco?= =?UTF-8?q?mbo=E5=A4=9A=E9=80=89=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/case/combo/demo.text_value_combo.js | 3 --- src/case/combo/textvaluecombo/combo.textvalue.js | 12 ++++++++++-- src/case/trigger/trigger.text.select.js | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/demo/js/case/combo/demo.text_value_combo.js b/demo/js/case/combo/demo.text_value_combo.js index 44847adae..15df83c54 100644 --- a/demo/js/case/combo/demo.text_value_combo.js +++ b/demo/js/case/combo/demo.text_value_combo.js @@ -190,9 +190,6 @@ Demo.TextValueCombo = BI.inherit(BI.Widget, { items: [ { type: "bi.text_value_combo", - ref: function () { - combo2 = this; - }, width: 300, items: items, allowClear: true, diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index 7f726bd13..ac39d5158 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -85,11 +85,15 @@ 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, @@ -165,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"); @@ -178,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/trigger/trigger.text.select.js b/src/case/trigger/trigger.text.select.js index cf1e2cdd9..b20b4f1b5 100644 --- a/src/case/trigger/trigger.text.select.js +++ b/src/case/trigger/trigger.text.select.js @@ -85,7 +85,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { setValue: function (val) { var formatText = this._digest(val, this.options.items); - this.trigger.setText(formatText); + this.setText(formatText); }, setTipType: function (v) { From d6c9f0c4181aedffe79963d0ba4da8982bd23afe Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 20 Sep 2022 11:22:33 +0800 Subject: [PATCH 21/24] =?UTF-8?q?=E6=97=A0JIRA=20feat:=20text=5Fvalue=5Fco?= =?UTF-8?q?mbo=E5=A4=9A=E9=80=89=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/trigger/trigger.text.select.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/case/trigger/trigger.text.select.js b/src/case/trigger/trigger.text.select.js index b20b4f1b5..cf1e2cdd9 100644 --- a/src/case/trigger/trigger.text.select.js +++ b/src/case/trigger/trigger.text.select.js @@ -85,7 +85,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { setValue: function (val) { var formatText = this._digest(val, this.options.items); - this.setText(formatText); + this.trigger.setText(formatText); }, setTipType: function (v) { From b7b185d31fcda9cdf77ece48f640c8b24f64a61f Mon Sep 17 00:00:00 2001 From: data Date: Tue, 20 Sep 2022 11:46:53 +0800 Subject: [PATCH 22/24] auto upgrade version to 2.0.20220920114639 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5a77fa775..7e551355f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220919194720", + "version": "2.0.20220920114639", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts", From 461f456fe5d4e014097d6992c826a5018a2c4d87 Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 20 Sep 2022 13:36:35 +0800 Subject: [PATCH 23/24] =?UTF-8?q?chore=EF=BC=9A=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multitree/multi.tree.combo.js | 3 ++- src/widget/multitree/multi.tree.insert.combo.js | 3 ++- src/widget/multitree/multi.tree.list.combo.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) 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, From 18463cfa6c40db1814cceb8536363118a84eb35f Mon Sep 17 00:00:00 2001 From: data Date: Tue, 20 Sep 2022 14:04:22 +0800 Subject: [PATCH 24/24] auto upgrade version to 2.0.20220920140416 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7e551355f..10d1d7a40 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "fineui", - "version": "2.0.20220920114639", + "version": "2.0.20220920140416", "description": "fineui", "main": "dist/fineui_without_conflict.min.js", "types": "dist/lib/index.d.ts",