Browse Source

Merge pull request #266 in FUI/fineui from ~WINDY/fui:master to master

* commit 'c9501fe067298350572609d20b84360343bddd09':
  替换多了BI.getDate
  加object方法
es6
guy 7 years ago
parent
commit
5c883637a9
  1. 4
      demo/js/case/demo.calendar.js
  2. 36
      dist/bundle.js
  3. 48
      dist/bundle.min.js
  4. 22
      dist/core.js
  5. 4
      dist/demo.js
  6. 36
      dist/fineui.js
  7. 46
      dist/fineui.min.js
  8. 14
      dist/widget.js
  9. 2
      lodash.md
  10. 4
      src/core/alias.js
  11. 16
      src/core/lodash.js
  12. 2
      src/core/proto/date.js
  13. 4
      src/widget/date/trigger.date.js
  14. 2
      src/widget/datetime/datetime.combo.js
  15. 2
      src/widget/datetime/datetime.popup.js
  16. 2
      src/widget/multidate/multidate.combo.js
  17. 4
      src/widget/multidate/multidate.popup.js
  18. 22
      utils/utils.js

4
demo/js/case/demo.calendar.js

@ -16,7 +16,7 @@ Demo.Func = BI.inherit(BI.Widget, {
},
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
};
},
@ -25,7 +25,7 @@ Demo.Func = BI.inherit(BI.Widget, {
this.calendar.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
}
});

36
dist/bundle.js vendored

@ -18198,6 +18198,21 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
return baseRandom(lower, upper);
}
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
function object (list, values) {
var result = {};
for (var i = 0, length = list && list.length; i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
}
/*------------------------------------------------------------------------*/
/**
@ -18745,6 +18760,7 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
lodash.size = size;
lodash.some = some;
lodash.uniqueId = uniqueId;
lodash.object = object;
// Add aliases.
lodash.each = forEach;
@ -25732,9 +25748,9 @@ BI.PopoverSection.EVENT_CLOSE = "EVENT_CLOSE";(function () {
break;
case "d": // 日
if (len > 1) {
str = BI.leftPad(BI.getDate() + "", 2, "0");
str = BI.leftPad(date.getDate() + "", 2, "0");
} else {
str = BI.getDate();
str = date.getDate();
}
break;
case "h": // 时(12)
@ -28967,7 +28983,7 @@ Date.prototype.getWeekEndDate = function () {
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == BI.getDate()) &&
(this.getDate() == date.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()) &&
(this.getSeconds() == date.getSeconds()));
@ -85688,12 +85704,12 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
switch (type) {
case BI.DateTrigger.MULTI_DATE_YEAR_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_PREV];
date = BI.getDate((date.getFullYear() - 1 * value), date.getMonth(), BI.getDate());
date = BI.getDate((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_AFTER];
date = BI.getDate((date.getFullYear() + 1 * value), date.getMonth(), BI.getDate());
date = BI.getDate((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_BEGIN:
@ -86000,7 +86016,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
this.storeValue = BI.isNotNull(opts.value) ? opts.value : {
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate(),
day: date.getDate(),
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
@ -86243,7 +86259,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
this.hour.setValue(date.getHours());
this.minute.setValue(date.getMinutes());
@ -89387,7 +89403,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
self.combo.hideView();
self.fireEvent(BI.MultiDateCombo.EVENT_CONFIRM);
@ -89827,7 +89843,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
self._setInnerValue(self.ymd);
break;
@ -89947,7 +89963,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
this.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));
} else {

48
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

22
dist/core.js vendored

@ -18198,6 +18198,21 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
return baseRandom(lower, upper);
}
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
function object (list, values) {
var result = {};
for (var i = 0, length = list && list.length; i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
}
/*------------------------------------------------------------------------*/
/**
@ -18745,6 +18760,7 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
lodash.size = size;
lodash.some = some;
lodash.uniqueId = uniqueId;
lodash.object = object;
// Add aliases.
lodash.each = forEach;
@ -25732,9 +25748,9 @@ BI.PopoverSection.EVENT_CLOSE = "EVENT_CLOSE";(function () {
break;
case "d": // 日
if (len > 1) {
str = BI.leftPad(BI.getDate() + "", 2, "0");
str = BI.leftPad(date.getDate() + "", 2, "0");
} else {
str = BI.getDate();
str = date.getDate();
}
break;
case "h": // 时(12)
@ -28967,7 +28983,7 @@ Date.prototype.getWeekEndDate = function () {
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == BI.getDate()) &&
(this.getDate() == date.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()) &&
(this.getSeconds() == date.getSeconds()));

4
dist/demo.js vendored

@ -2300,7 +2300,7 @@ BI.shortcut("demo.text_value_check_combo", Demo.TextValueCheckCombo);Demo.Func =
},
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
};
},
@ -2309,7 +2309,7 @@ BI.shortcut("demo.text_value_check_combo", Demo.TextValueCheckCombo);Demo.Func =
this.calendar.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
}
});

36
dist/fineui.js vendored

@ -18399,6 +18399,21 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
return baseRandom(lower, upper);
}
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
function object (list, values) {
var result = {};
for (var i = 0, length = list && list.length; i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
}
/*------------------------------------------------------------------------*/
/**
@ -18946,6 +18961,7 @@ if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
lodash.size = size;
lodash.some = some;
lodash.uniqueId = uniqueId;
lodash.object = object;
// Add aliases.
lodash.each = forEach;
@ -25933,9 +25949,9 @@ BI.PopoverSection.EVENT_CLOSE = "EVENT_CLOSE";(function () {
break;
case "d": // 日
if (len > 1) {
str = BI.leftPad(BI.getDate() + "", 2, "0");
str = BI.leftPad(date.getDate() + "", 2, "0");
} else {
str = BI.getDate();
str = date.getDate();
}
break;
case "h": // 时(12)
@ -29168,7 +29184,7 @@ Date.prototype.getWeekEndDate = function () {
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == BI.getDate()) &&
(this.getDate() == date.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()) &&
(this.getSeconds() == date.getSeconds()));
@ -87452,12 +87468,12 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
switch (type) {
case BI.DateTrigger.MULTI_DATE_YEAR_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_PREV];
date = BI.getDate((date.getFullYear() - 1 * value), date.getMonth(), BI.getDate());
date = BI.getDate((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_AFTER];
date = BI.getDate((date.getFullYear() + 1 * value), date.getMonth(), BI.getDate());
date = BI.getDate((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_BEGIN:
@ -87764,7 +87780,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
this.storeValue = BI.isNotNull(opts.value) ? opts.value : {
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate(),
day: date.getDate(),
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
@ -88007,7 +88023,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
this.hour.setValue(date.getHours());
this.minute.setValue(date.getMinutes());
@ -91151,7 +91167,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
self.combo.hideView();
self.fireEvent(BI.MultiDateCombo.EVENT_CONFIRM);
@ -91591,7 +91607,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
self._setInnerValue(self.ymd);
break;
@ -91711,7 +91727,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
this.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));
} else {

46
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

14
dist/widget.js vendored

@ -1066,12 +1066,12 @@ BI.shortcut("bi.date_combo", BI.DateCombo);BI.DateTrigger = BI.inherit(BI.Trigge
switch (type) {
case BI.DateTrigger.MULTI_DATE_YEAR_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_PREV];
date = BI.getDate((date.getFullYear() - 1 * value), date.getMonth(), BI.getDate());
date = BI.getDate((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_AFTER];
date = BI.getDate((date.getFullYear() + 1 * value), date.getMonth(), BI.getDate());
date = BI.getDate((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_BEGIN:
@ -1378,7 +1378,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
this.storeValue = BI.isNotNull(opts.value) ? opts.value : {
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate(),
day: date.getDate(),
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()
@ -1621,7 +1621,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
this.hour.setValue(date.getHours());
this.minute.setValue(date.getMinutes());
@ -4765,7 +4765,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
self.combo.hideView();
self.fireEvent(BI.MultiDateCombo.EVENT_CONFIRM);
@ -5205,7 +5205,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
self._setInnerValue(self.ymd);
break;
@ -5325,7 +5325,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
this.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));
} else {

2
lodash.md

@ -1 +1 @@
lodash core plus=debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy
lodash core plus=debounce,throttle,get,findIndex,findLastIndex,findKey,findLastKey,isArrayLike,invert,invertBy,uniq,uniqBy,omit,omitBy,zip,unzip,rest,range,random,reject,intersection,drop,countBy,object

4
src/core/alias.js

@ -573,9 +573,9 @@
break;
case "d": // 日
if (len > 1) {
str = BI.leftPad(BI.getDate() + "", 2, "0");
str = BI.leftPad(date.getDate() + "", 2, "0");
} else {
str = BI.getDate();
str = date.getDate();
}
break;
case "h": // 时(12)

16
src/core/lodash.js

@ -8600,6 +8600,21 @@
return baseRandom(lower, upper);
}
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
function object (list, values) {
var result = {};
for (var i = 0, length = list && list.length; i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
}
/*------------------------------------------------------------------------*/
/**
@ -9147,6 +9162,7 @@
lodash.size = size;
lodash.some = some;
lodash.uniqueId = uniqueId;
lodash.object = object;
// Add aliases.
lodash.each = forEach;

2
src/core/proto/date.js

@ -149,7 +149,7 @@ Date.prototype.getWeekEndDate = function () {
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == BI.getDate()) &&
(this.getDate() == date.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()) &&
(this.getSeconds() == date.getSeconds()));

4
src/widget/date/trigger.date.js

@ -150,12 +150,12 @@ BI.DateTrigger = BI.inherit(BI.Trigger, {
switch (type) {
case BI.DateTrigger.MULTI_DATE_YEAR_PREV:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_PREV];
date = BI.getDate((date.getFullYear() - 1 * value), date.getMonth(), BI.getDate());
date = BI.getDate((date.getFullYear() - 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_AFTER:
var text = value + BI.DateTrigger.MULTI_DATE_SEGMENT_NUM[BI.DateTrigger.MULTI_DATE_YEAR_AFTER];
date = BI.getDate((date.getFullYear() + 1 * value), date.getMonth(), BI.getDate());
date = BI.getDate((date.getFullYear() + 1 * value), date.getMonth(), date.getDate());
_setInnerValue(date, text);
break;
case BI.DateTrigger.MULTI_DATE_YEAR_BEGIN:

2
src/widget/datetime/datetime.combo.js

@ -24,7 +24,7 @@ BI.DateTimeCombo = BI.inherit(BI.Single, {
this.storeValue = BI.isNotNull(opts.value) ? opts.value : {
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate(),
day: date.getDate(),
hour: date.getHours(),
minute: date.getMinutes(),
second: date.getSeconds()

2
src/widget/datetime/datetime.popup.js

@ -134,7 +134,7 @@ BI.DateTimePopup = BI.inherit(BI.Widget, {
this.dateCombo.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
this.hour.setValue(date.getHours());
this.minute.setValue(date.getMinutes());

2
src/widget/multidate/multidate.combo.js

@ -95,7 +95,7 @@ BI.MultiDateCombo = BI.inherit(BI.Single, {
self.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
self.combo.hideView();
self.fireEvent(BI.MultiDateCombo.EVENT_CONFIRM);

4
src/widget/multidate/multidate.popup.js

@ -161,7 +161,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
self.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
self._setInnerValue(self.ymd);
break;
@ -281,7 +281,7 @@ BI.MultiDatePopup = BI.inherit(BI.Widget, {
this.ymd.setValue({
year: date.getFullYear(),
month: date.getMonth(),
day: BI.getDate()
day: date.getDate()
});
this.textButton.setValue(BI.i18nText("BI-Multi_Date_Today"));
} else {

22
utils/utils.js

@ -8600,6 +8600,21 @@
return baseRandom(lower, upper);
}
// Converts lists into objects. Pass either a single array of `[key, value]`
// pairs, or two parallel arrays of the same length -- one of keys, and one of
// the corresponding values.
function object (list, values) {
var result = {};
for (var i = 0, length = list && list.length; i < length; i++) {
if (values) {
result[list[i]] = values[i];
} else {
result[list[i][0]] = list[i][1];
}
}
return result;
}
/*------------------------------------------------------------------------*/
/**
@ -9147,6 +9162,7 @@
lodash.size = size;
lodash.some = some;
lodash.uniqueId = uniqueId;
lodash.object = object;
// Add aliases.
lodash.each = forEach;
@ -10110,7 +10126,7 @@ Date.prototype.getWeekEndDate = function () {
Date.prototype.equalsTo = function (date) {
return ((this.getFullYear() == date.getFullYear()) &&
(this.getMonth() == date.getMonth()) &&
(this.getDate() == BI.getDate()) &&
(this.getDate() == date.getDate()) &&
(this.getHours() == date.getHours()) &&
(this.getMinutes() == date.getMinutes()) &&
(this.getSeconds() == date.getSeconds()));
@ -12466,9 +12482,9 @@ _.extend(BI.OB.prototype, {
break;
case "d": // 日
if (len > 1) {
str = BI.leftPad(BI.getDate() + "", 2, "0");
str = BI.leftPad(date.getDate() + "", 2, "0");
} else {
str = BI.getDate();
str = date.getDate();
}
break;
case "h": // 时(12)

Loading…
Cancel
Save