Browse Source

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

* commit '670f525872d5b01875231c9eee5b4909f2b50ca9':
  update
  BI-17580 交互
es6
guy 7 years ago
parent
commit
3a8e0af2ba
  1. 5
      demo/version.js
  2. 34
      dist/_fineui.min.js
  3. 92
      dist/bundle.js
  4. 34
      dist/bundle.min.js
  5. 69
      dist/case.js
  6. 5
      dist/config.js
  7. 18
      dist/widget.js
  8. 5
      public/js/index.js
  9. 1
      src/case/richeditor/bar/texttoolbar.js
  10. 67
      src/case/richeditor/plugins/combo.fontfamily.js
  11. 18
      src/widget/dynamicdate/dynamicdate.trigger.js
  12. 5
      ui/js/index.js

5
demo/version.js

@ -155,5 +155,8 @@ BI.i18n = {
"BI-Conf_Formula_And": "且公式条件",
"BI-Conf_Formula_Or": "或公式条件",
"BI-Conf_Condition_And": "且条件",
"BI-Conf_Condition_Or": "或条件"
"BI-Conf_Condition_Or": "或条件",
"BI-Microsoft_YaHei": "微软雅黑",
"BI-Apple_Light": "苹方-light",
"BI-Font_Family": "字体"
};

34
dist/_fineui.min.js vendored

File diff suppressed because one or more lines are too long

92
dist/bundle.js vendored

@ -82189,6 +82189,7 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-text-toolbar bi-background",
buttons: [
{type: "bi.rich_editor_font_chooser"},
{type: "bi.rich_editor_size_chooser"},
{type: "bi.rich_editor_bold_button"},
{type: "bi.rich_editor_italic_button"},
@ -83005,7 +83006,73 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
this.colorchooser.setValue("");
}
});
BI.shortcut("bi.rich_editor_color_chooser", BI.RichEditorColorChooser);/**
BI.shortcut("bi.rich_editor_color_chooser", BI.RichEditorColorChooser);BI.RichEditorFontChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorFontChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-font-chooser bi-border bi-card",
command: "FontName",
width: 50,
height: 20
});
},
_init: function () {
BI.RichEditorSizeChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.text_trigger",
readonly: true,
height: o.height,
triggerWidth: 16,
text: BI.i18nText("BI-Font_Family")
});
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
el: this.trigger,
adjustLength: 1,
popup: {
maxWidth: 70,
minWidth: 70,
el: {
type: "bi.button_group",
items: BI.createItems([{
value: "Microsoft YaHei",
text: BI.i18nText("BI-Microsoft_YaHei")
}, {
value: "PingFangSC-Light !important",
text: BI.i18nText("BI-Apple_Light")
}, {
value: "arial",
text: "Arial"
}, {
value: "Verdana",
text: "Verdana"
}], {
type: "bi.single_select_item"
}),
layouts: [{
type: "bi.vertical"
}]
}
}
});
this.combo.on(BI.Combo.EVENT_CHANGE, function () {
var val = this.getValue()[0];
self.doCommand(val);
this.hideView();
this.setValue([]);
});
},
hideIf: function (e) {
if(!this.combo.element.find(e.target).length > 0) {
this.combo.hideView();
}
}
});
BI.shortcut("bi.rich_editor_font_chooser", BI.RichEditorFontChooser);/**
* 字体大小选择
*
* Created by GUY on 2015/11/26.
@ -90733,25 +90800,31 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
_getText: function (obj) {
var value = "";
var endText = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
}
if(BI.isNotNull(obj.month) && obj.month !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
}
if(BI.isNotNull(obj.week) && obj.week !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
}
if(BI.isNotNull(obj.day) && obj.day !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
}
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;
return value + endText;
function getPositionText (baseText, position) {
switch (position) {
@ -111804,5 +111877,8 @@ BI.i18n = {
"BI-Conf_Formula_And": "且公式条件",
"BI-Conf_Formula_Or": "或公式条件",
"BI-Conf_Condition_And": "且条件",
"BI-Conf_Condition_Or": "或条件"
"BI-Conf_Condition_Or": "或条件",
"BI-Microsoft_YaHei": "微软雅黑",
"BI-Apple_Light": "苹方-light",
"BI-Font_Family": "字体"
};

34
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

69
dist/case.js vendored

@ -10241,6 +10241,7 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-text-toolbar bi-background",
buttons: [
{type: "bi.rich_editor_font_chooser"},
{type: "bi.rich_editor_size_chooser"},
{type: "bi.rich_editor_bold_button"},
{type: "bi.rich_editor_italic_button"},
@ -11057,7 +11058,73 @@ BI.RichEditorColorChooser = BI.inherit(BI.RichEditorAction, {
this.colorchooser.setValue("");
}
});
BI.shortcut("bi.rich_editor_color_chooser", BI.RichEditorColorChooser);/**
BI.shortcut("bi.rich_editor_color_chooser", BI.RichEditorColorChooser);BI.RichEditorFontChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorFontChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-font-chooser bi-border bi-card",
command: "FontName",
width: 50,
height: 20
});
},
_init: function () {
BI.RichEditorSizeChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.text_trigger",
readonly: true,
height: o.height,
triggerWidth: 16,
text: BI.i18nText("BI-Font_Family")
});
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
el: this.trigger,
adjustLength: 1,
popup: {
maxWidth: 70,
minWidth: 70,
el: {
type: "bi.button_group",
items: BI.createItems([{
value: "Microsoft YaHei",
text: BI.i18nText("BI-Microsoft_YaHei")
}, {
value: "PingFangSC-Light !important",
text: BI.i18nText("BI-Apple_Light")
}, {
value: "arial",
text: "Arial"
}, {
value: "Verdana",
text: "Verdana"
}], {
type: "bi.single_select_item"
}),
layouts: [{
type: "bi.vertical"
}]
}
}
});
this.combo.on(BI.Combo.EVENT_CHANGE, function () {
var val = this.getValue()[0];
self.doCommand(val);
this.hideView();
this.setValue([]);
});
},
hideIf: function (e) {
if(!this.combo.element.find(e.target).length > 0) {
this.combo.hideView();
}
}
});
BI.shortcut("bi.rich_editor_font_chooser", BI.RichEditorFontChooser);/**
* 字体大小选择
*
* Created by GUY on 2015/11/26.

5
dist/config.js vendored

@ -155,5 +155,8 @@ BI.i18n = {
"BI-Conf_Formula_And": "且公式条件",
"BI-Conf_Formula_Or": "或公式条件",
"BI-Conf_Condition_And": "且条件",
"BI-Conf_Condition_Or": "或条件"
"BI-Conf_Condition_Or": "或条件",
"BI-Microsoft_YaHei": "微软雅黑",
"BI-Apple_Light": "苹方-light",
"BI-Font_Family": "字体"
};

18
dist/widget.js vendored

@ -4159,25 +4159,31 @@ BI.shortcut("bi.dynamic_date_popup", BI.DynamicDatePopup);BI.DynamicDateTrigger
_getText: function (obj) {
var value = "";
var endText = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
}
if(BI.isNotNull(obj.month) && obj.month !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
}
if(BI.isNotNull(obj.week) && obj.week !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
}
if(BI.isNotNull(obj.day) && obj.day !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
}
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;
return value + endText;
function getPositionText (baseText, position) {
switch (position) {

5
public/js/index.js

@ -155,5 +155,8 @@ BI.i18n = {
"BI-Conf_Formula_And": "且公式条件",
"BI-Conf_Formula_Or": "或公式条件",
"BI-Conf_Condition_And": "且条件",
"BI-Conf_Condition_Or": "或条件"
"BI-Conf_Condition_Or": "或条件",
"BI-Microsoft_YaHei": "微软雅黑",
"BI-Apple_Light": "苹方-light",
"BI-Font_Family": "字体"
};

1
src/case/richeditor/bar/texttoolbar.js

@ -10,6 +10,7 @@ BI.RichEditorTextToolbar = BI.inherit(BI.Widget, {
return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-text-toolbar bi-background",
buttons: [
{type: "bi.rich_editor_font_chooser"},
{type: "bi.rich_editor_size_chooser"},
{type: "bi.rich_editor_bold_button"},
{type: "bi.rich_editor_italic_button"},

67
src/case/richeditor/plugins/combo.fontfamily.js

@ -0,0 +1,67 @@
BI.RichEditorFontChooser = BI.inherit(BI.RichEditorAction, {
_defaultConfig: function () {
return BI.extend(BI.RichEditorFontChooser.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-rich-editor-font-chooser bi-border bi-card",
command: "FontName",
width: 50,
height: 20
});
},
_init: function () {
BI.RichEditorSizeChooser.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.trigger = BI.createWidget({
type: "bi.text_trigger",
readonly: true,
height: o.height,
triggerWidth: 16,
text: BI.i18nText("BI-Font_Family")
});
this.combo = BI.createWidget({
type: "bi.combo",
element: this,
el: this.trigger,
adjustLength: 1,
popup: {
maxWidth: 70,
minWidth: 70,
el: {
type: "bi.button_group",
items: BI.createItems([{
value: "Microsoft YaHei",
text: BI.i18nText("BI-Microsoft_YaHei")
}, {
value: "PingFangSC-Light !important",
text: BI.i18nText("BI-Apple_Light")
}, {
value: "arial",
text: "Arial"
}, {
value: "Verdana",
text: "Verdana"
}], {
type: "bi.single_select_item"
}),
layouts: [{
type: "bi.vertical"
}]
}
}
});
this.combo.on(BI.Combo.EVENT_CHANGE, function () {
var val = this.getValue()[0];
self.doCommand(val);
this.hideView();
this.setValue([]);
});
},
hideIf: function (e) {
if(!this.combo.element.find(e.target).length > 0) {
this.combo.hideView();
}
}
});
BI.shortcut("bi.rich_editor_font_chooser", BI.RichEditorFontChooser);

18
src/widget/dynamicdate/dynamicdate.trigger.js

@ -144,25 +144,31 @@ BI.DynamicDateTrigger = BI.inherit(BI.Trigger, {
_getText: function (obj) {
var value = "";
var endText = "";
if(BI.isNotNull(obj.year) && obj.year !== 0) {
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
value += Math.abs(obj.year) + BI.i18nText("BI-Basic_Year") + (obj.year < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
}
if(BI.isNotNull(obj.quarter) && obj.quarter !== 0) {
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Year"), obj.position);
value += Math.abs(obj.quarter) + BI.i18nText("BI-Basic_Single_Quarter") + (obj.quarter < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Single_Quarter"), obj.position);
}
if(BI.isNotNull(obj.month) && obj.month !== 0) {
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
value += Math.abs(obj.month) + BI.i18nText("BI-Basic_Month") + (obj.month < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Month"), obj.position);
}
if(BI.isNotNull(obj.week) && obj.week !== 0) {
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
value += Math.abs(obj.week) + BI.i18nText("BI-Basic_Week") + (obj.week < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = getPositionText(BI.i18nText("BI-Basic_Week"), obj.position);
}
if(BI.isNotNull(obj.day) && obj.day !== 0) {
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind")) + BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
value += Math.abs(obj.day) + BI.i18nText("BI-Basic_Day") + (obj.day < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
endText = BI.size(obj) === 1 ? getPositionText(BI.i18nText("BI-Basic_Month"), obj.position) : "";
}
if(BI.isNotNull(obj.workDay) && obj.workDay !== 0) {
value += Math.abs(obj.workDay) + BI.i18nText("BI-Basic_Work_Day") + (obj.workDay < 0 ? BI.i18nText("BI-Basic_Front") : BI.i18nText("BI-Basic_Behind"));
}
return value;
return value + endText;
function getPositionText (baseText, position) {
switch (position) {

5
ui/js/index.js

@ -155,5 +155,8 @@ BI.i18n = {
"BI-Conf_Formula_And": "且公式条件",
"BI-Conf_Formula_Or": "或公式条件",
"BI-Conf_Condition_And": "且条件",
"BI-Conf_Condition_Or": "或条件"
"BI-Conf_Condition_Or": "或条件",
"BI-Microsoft_YaHei": "微软雅黑",
"BI-Apple_Light": "苹方-light",
"BI-Font_Family": "字体"
};
Loading…
Cancel
Save