diff --git a/src/base/single/button/buttons/button.icon.js b/src/base/single/button/buttons/button.icon.js index ec059e8bc2..62f9a5bd03 100644 --- a/src/base/single/button/buttons/button.icon.js +++ b/src/base/single/button/buttons/button.icon.js @@ -48,5 +48,5 @@ BI.IconButton = BI.inherit(BI.BasicButton, { } } }); -BI.IconButton.EVENT_CHANGE = "IconButton.EVENT_CHANGE"; +BI.IconButton.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.icon_button", BI.IconButton); \ No newline at end of file diff --git a/src/base/single/button/buttons/button.image.js b/src/base/single/button/buttons/button.image.js index 085e901a8c..503ce034a5 100644 --- a/src/base/single/button/buttons/button.image.js +++ b/src/base/single/button/buttons/button.image.js @@ -83,5 +83,5 @@ BI.ImageButton = BI.inherit(BI.BasicButton, { } } }); -BI.ImageButton.EVENT_CHANGE = "ImageButton.EVENT_CHANGE"; +BI.ImageButton.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.image_button", BI.ImageButton); \ No newline at end of file diff --git a/src/base/single/editor/editor.multifile.js b/src/base/single/editor/editor.multifile.js index 9284c12e89..f4aa6073b4 100644 --- a/src/base/single/editor/editor.multifile.js +++ b/src/base/single/editor/editor.multifile.js @@ -82,9 +82,9 @@ BI.MultifileEditor = BI.inherit(BI.Widget, { this.file.reset(); } }); -BI.MultifileEditor.EVENT_CHANGE = "MultifileEditor.EVENT_CHANGE"; -BI.MultifileEditor.EVENT_UPLOADSTART = "MultifileEditor.EVENT_UPLOADSTART"; -BI.MultifileEditor.EVENT_ERROR = "MultifileEditor.EVENT_ERROR"; -BI.MultifileEditor.EVENT_PROGRESS = "MultifileEditor.EVENT_PROGRESS"; -BI.MultifileEditor.EVENT_UPLOADED = "MultifileEditor.EVENT_UPLOADED"; +BI.MultifileEditor.EVENT_CHANGE = "EVENT_CHANGE"; +BI.MultifileEditor.EVENT_UPLOADSTART = "EVENT_UPLOADSTART"; +BI.MultifileEditor.EVENT_ERROR = "EVENT_ERROR"; +BI.MultifileEditor.EVENT_PROGRESS = "EVENT_PROGRESS"; +BI.MultifileEditor.EVENT_UPLOADED = "EVENT_UPLOADED"; BI.shortcut("bi.multifile_editor", BI.MultifileEditor); \ No newline at end of file diff --git a/src/base/single/input/checkbox/checkbox.image.js b/src/base/single/input/checkbox/checkbox.image.js index e326c53613..c20127f602 100644 --- a/src/base/single/input/checkbox/checkbox.image.js +++ b/src/base/single/input/checkbox/checkbox.image.js @@ -28,6 +28,6 @@ BI.ImageCheckbox = BI.inherit(BI.IconButton, { } } }); -BI.ImageCheckbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE"; +BI.ImageCheckbox.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.image_checkbox", BI.ImageCheckbox); \ No newline at end of file diff --git a/src/base/single/input/checkbox/checkbox.js b/src/base/single/input/checkbox/checkbox.js index 87c1843a46..f9574dbdb0 100644 --- a/src/base/single/input/checkbox/checkbox.js +++ b/src/base/single/input/checkbox/checkbox.js @@ -56,6 +56,6 @@ BI.Checkbox = BI.inherit(BI.BasicButton, { } } }); -BI.Checkbox.EVENT_CHANGE = "Checkbox.EVENT_CHANGE"; +BI.Checkbox.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.checkbox", BI.Checkbox); \ No newline at end of file diff --git a/src/base/single/input/file.js b/src/base/single/input/file.js index 2697920a42..0ed1b7e2e2 100644 --- a/src/base/single/input/file.js +++ b/src/base/single/input/file.js @@ -617,7 +617,7 @@ } } }); - BI.File.EVENT_CHANGE = "BI.File.EVENT_CHANGE"; + BI.File.EVENT_CHANGE = "EVENT_CHANGE"; BI.File.EVENT_UPLOADSTART = "EVENT_UPLOADSTART"; BI.File.EVENT_ERROR = "EVENT_ERROR"; BI.File.EVENT_PROGRESS = "EVENT_PROGRESS"; diff --git a/src/base/single/input/radio/radio.image.js b/src/base/single/input/radio/radio.image.js index 6349024edf..7fc365aea6 100644 --- a/src/base/single/input/radio/radio.image.js +++ b/src/base/single/input/radio/radio.image.js @@ -28,6 +28,6 @@ BI.ImageRadio = BI.inherit(BI.IconButton, { } } }); -BI.ImageRadio.EVENT_CHANGE = "Radio.EVENT_CHANGE"; +BI.ImageRadio.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.image_radio", BI.ImageRadio); \ No newline at end of file diff --git a/src/base/single/input/radio/radio.js b/src/base/single/input/radio/radio.js index eadb0bc297..6cf5e36353 100644 --- a/src/base/single/input/radio/radio.js +++ b/src/base/single/input/radio/radio.js @@ -57,6 +57,6 @@ BI.Radio = BI.inherit(BI.BasicButton, { } } }); -BI.Radio.EVENT_CHANGE = "Radio.EVENT_CHANGE"; +BI.Radio.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.radio", BI.Radio); \ No newline at end of file diff --git a/src/case/button/icon/icon.change.js b/src/case/button/icon/icon.change.js index 9f7326d470..8790008e29 100644 --- a/src/case/button/icon/icon.change.js +++ b/src/case/button/icon/icon.change.js @@ -79,5 +79,5 @@ BI.IconChangeButton = BI.inherit(BI.Single, { } } }); -BI.IconChangeButton.EVENT_CHANGE = "IconChangeButton.EVENT_CHANGE"; +BI.IconChangeButton.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.icon_change_button", BI.IconChangeButton); \ No newline at end of file diff --git a/src/case/button/icon/icon.trigger.js b/src/case/button/icon/icon.trigger.js index 8ae75e3cf8..f37906a750 100644 --- a/src/case/button/icon/icon.trigger.js +++ b/src/case/button/icon/icon.trigger.js @@ -26,5 +26,5 @@ BI.TriggerIconButton = BI.inherit(BI.IconButton, { } } }); -BI.TriggerIconButton.EVENT_CHANGE = "TriggerIconButton.EVENT_CHANGE"; +BI.TriggerIconButton.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.trigger_icon_button", BI.TriggerIconButton); \ No newline at end of file diff --git a/src/case/button/icon/iconhalf/icon.half.image.js b/src/case/button/icon/iconhalf/icon.half.image.js index 5c93f75852..925f1211dc 100644 --- a/src/case/button/icon/iconhalf/icon.half.image.js +++ b/src/case/button/icon/iconhalf/icon.half.image.js @@ -27,6 +27,6 @@ BI.HalfIconButton = BI.inherit(BI.IconButton, { } } }); -BI.HalfIconButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE"; +BI.HalfIconButton.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.half_icon_button", BI.HalfIconButton); \ No newline at end of file diff --git a/src/case/button/icon/iconhalf/icon.half.js b/src/case/button/icon/iconhalf/icon.half.js index f89dda240e..83cdedcecc 100644 --- a/src/case/button/icon/iconhalf/icon.half.js +++ b/src/case/button/icon/iconhalf/icon.half.js @@ -35,6 +35,6 @@ BI.HalfButton = BI.inherit(BI.BasicButton, { } } }); -BI.HalfButton.EVENT_CHANGE = "HalfIconButton.EVENT_CHANGE"; +BI.HalfButton.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.half_button", BI.HalfButton); \ No newline at end of file diff --git a/src/case/button/item.singleselect.js b/src/case/button/item.singleselect.js index f30ccce01b..04420722d1 100644 --- a/src/case/button/item.singleselect.js +++ b/src/case/button/item.singleselect.js @@ -43,7 +43,7 @@ BI.SingleSelectItem = BI.inherit(BI.BasicButton, { doClick: function () { BI.SingleSelectItem.superclass.doClick.apply(this, arguments); if (this.isValid()) { - this.fireEvent(BI.MultiSelectItem.EVENT_CHANGE, this.getValue(), this); + this.fireEvent(BI.SingleSelectItem.EVENT_CHANGE, this.isSelected(), this); } }, @@ -51,5 +51,6 @@ BI.SingleSelectItem = BI.inherit(BI.BasicButton, { BI.SingleSelectItem.superclass.setSelected.apply(this, arguments); } }); -BI.SingleSelectItem.EVENT_CHANGE = "SingleSelectItem.EVENT_CHANGE"; + +BI.SingleSelectItem.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.single_select_item", BI.SingleSelectItem); \ No newline at end of file diff --git a/src/case/button/item.singleselect.radio.js b/src/case/button/item.singleselect.radio.js index ce49b215f5..272fe2939e 100644 --- a/src/case/button/item.singleselect.radio.js +++ b/src/case/button/item.singleselect.radio.js @@ -56,6 +56,9 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { doClick: function () { BI.SingleSelectRadioItem.superclass.doClick.apply(this, arguments); this.radio.setSelected(this.isSelected()); + if (this.isValid()) { + this.fireEvent(BI.SingleSelectItem.EVENT_CHANGE, this.isSelected(), this); + } }, setSelected: function (v) { @@ -65,4 +68,5 @@ BI.SingleSelectRadioItem = BI.inherit(BI.BasicButton, { } }); +BI.SingleSelectItem.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.single_select_radio_item", BI.SingleSelectRadioItem); \ No newline at end of file diff --git a/src/case/calendar/calendar.year.js b/src/case/calendar/calendar.year.js index f7e0fb19a5..cd70532beb 100644 --- a/src/case/calendar/calendar.year.js +++ b/src/case/calendar/calendar.year.js @@ -24,9 +24,12 @@ BI.YearCalendar = BI.inherit(BI.Widget, { Y = Y | 0; var start = BI.YearCalendar.getStartYear(Y); var items = []; + // 对于年控件来说,只要传入的minDate和maxDate的year区间包含v就是合法的 + var startDate = BI.parseDateTime(o.min, "%Y-%X-%d"); + var endDate = BI.parseDateTime(o.max, "%Y-%X-%d"); BI.each(BI.range(BI.YearCalendar.INTERVAL), function (i) { var td = {}; - if (BI.checkDateVoid(start + i, 1, 1, o.min, o.max)[0]) { + if (BI.checkDateVoid(start + i, 1, 1, BI.print(BI.getDate(startDate.getFullYear(), 0, 1), "%Y-%X-%d"), BI.print(BI.getDate(endDate.getFullYear(), 0, 1), "%Y-%X-%d"))[0]) { td.disabled = true; } td.text = start + i; diff --git a/src/case/colorchooser/colorchooser.custom.js b/src/case/colorchooser/colorchooser.custom.js index 99120d6dcc..445b99530f 100644 --- a/src/case/colorchooser/colorchooser.custom.js +++ b/src/case/colorchooser/colorchooser.custom.js @@ -65,5 +65,5 @@ BI.CustomColorChooser = BI.inherit(BI.Widget, { return this.editor.getValue(); } }); -BI.CustomColorChooser.EVENT_CHANGE = "CustomColorChooser.EVENT_CHANGE"; +BI.CustomColorChooser.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.custom_color_chooser", BI.CustomColorChooser); \ No newline at end of file diff --git a/src/case/colorchooser/colorchooser.js b/src/case/colorchooser/colorchooser.js index 02b1efd5fc..d1fc4a74d1 100644 --- a/src/case/colorchooser/colorchooser.js +++ b/src/case/colorchooser/colorchooser.js @@ -104,5 +104,5 @@ BI.ColorChooser = BI.inherit(BI.Widget, { return this.combo.getValue(); } }); -BI.ColorChooser.EVENT_CHANGE = "ColorChooser.EVENT_CHANGE"; +BI.ColorChooser.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.color_chooser", BI.ColorChooser); \ No newline at end of file diff --git a/src/case/colorchooser/colorchooser.popup.js b/src/case/colorchooser/colorchooser.popup.js index 0e3861ef05..5e4f0b87ed 100644 --- a/src/case/colorchooser/colorchooser.popup.js +++ b/src/case/colorchooser/colorchooser.popup.js @@ -220,6 +220,6 @@ BI.ColorChooserPopup = BI.inherit(BI.Widget, { return this.colorEditor.getValue(); } }); -BI.ColorChooserPopup.EVENT_VALUE_CHANGE = "ColorChooserPopup.EVENT_VALUE_CHANGE"; -BI.ColorChooserPopup.EVENT_CHANGE = "ColorChooserPopup.EVENT_CHANGE"; +BI.ColorChooserPopup.EVENT_VALUE_CHANGE = "EVENT_VALUE_CHANGE"; +BI.ColorChooserPopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.color_chooser_popup", BI.ColorChooserPopup); \ No newline at end of file diff --git a/src/case/colorchooser/colorchooser.popup.simple.js b/src/case/colorchooser/colorchooser.popup.simple.js index 4e9386203a..8f77dbd458 100644 --- a/src/case/colorchooser/colorchooser.popup.simple.js +++ b/src/case/colorchooser/colorchooser.popup.simple.js @@ -44,6 +44,6 @@ BI.SimpleColorChooserPopup = BI.inherit(BI.Widget, { return this.popup.getValue(); } }); -BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE = "ColorChooserPopup.EVENT_VALUE_CHANGE"; -BI.SimpleColorChooserPopup.EVENT_CHANGE = "ColorChooserPopup.EVENT_CHANGE"; +BI.SimpleColorChooserPopup.EVENT_VALUE_CHANGE = "EVENT_VALUE_CHANGE"; +BI.SimpleColorChooserPopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.simple_color_chooser_popup", BI.SimpleColorChooserPopup); \ No newline at end of file diff --git a/src/case/colorchooser/colorchooser.simple.js b/src/case/colorchooser/colorchooser.simple.js index 2f68ffcd32..d3fa702858 100644 --- a/src/case/colorchooser/colorchooser.simple.js +++ b/src/case/colorchooser/colorchooser.simple.js @@ -54,5 +54,5 @@ BI.SimpleColorChooser = BI.inherit(BI.Widget, { return this.combo.getValue(); } }); -BI.SimpleColorChooser.EVENT_CHANGE = "ColorChooser.EVENT_CHANGE"; +BI.SimpleColorChooser.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.simple_color_chooser", BI.SimpleColorChooser); \ No newline at end of file diff --git a/src/case/colorchooser/colorchooser.trigger.js b/src/case/colorchooser/colorchooser.trigger.js index 0f1ade649d..9cd3d2f09e 100644 --- a/src/case/colorchooser/colorchooser.trigger.js +++ b/src/case/colorchooser/colorchooser.trigger.js @@ -61,5 +61,5 @@ BI.ColorChooserTrigger = BI.inherit(BI.Trigger, { } } }); -BI.ColorChooserTrigger.EVENT_CHANGE = "ColorChooserTrigger.EVENT_CHANGE"; +BI.ColorChooserTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.color_chooser_trigger", BI.ColorChooserTrigger); \ No newline at end of file diff --git a/src/case/colorchooser/colorchooser.trigger.long.js b/src/case/colorchooser/colorchooser.trigger.long.js index 9eedd3659a..04c88b88af 100644 --- a/src/case/colorchooser/colorchooser.trigger.long.js +++ b/src/case/colorchooser/colorchooser.trigger.long.js @@ -93,5 +93,5 @@ BI.LongColorChooserTrigger = BI.inherit(BI.Trigger, { } } }); -BI.LongColorChooserTrigger.EVENT_CHANGE = "ColorChooserTrigger.EVENT_CHANGE"; +BI.LongColorChooserTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.long_color_chooser_trigger", BI.LongColorChooserTrigger); \ No newline at end of file diff --git a/src/case/colorchooser/colorpicker/button/button.colorpicker.js b/src/case/colorchooser/colorpicker/button/button.colorpicker.js index df5412c51e..caa8956207 100644 --- a/src/case/colorchooser/colorpicker/button/button.colorpicker.js +++ b/src/case/colorchooser/colorpicker/button/button.colorpicker.js @@ -56,5 +56,5 @@ BI.ColorPickerButton = BI.inherit(BI.BasicButton, { BI.Maskers[b ? "show" : "hide"](this.getName()); } }); -BI.ColorPickerButton.EVENT_CHANGE = "ColorPickerButton.EVENT_CHANGE"; +BI.ColorPickerButton.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.color_picker_button", BI.ColorPickerButton); \ No newline at end of file diff --git a/src/case/colorchooser/colorpicker/colorpicker.js b/src/case/colorchooser/colorpicker/colorpicker.js index a35b88dd09..b6c8c9fe3d 100644 --- a/src/case/colorchooser/colorpicker/colorpicker.js +++ b/src/case/colorchooser/colorpicker/colorpicker.js @@ -186,5 +186,5 @@ BI.ColorPicker = BI.inherit(BI.Widget, { return this.colors.getValue(); } }); -BI.ColorPicker.EVENT_CHANGE = "ColorPicker.EVENT_CHANGE"; +BI.ColorPicker.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.color_picker", BI.ColorPicker); \ No newline at end of file diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.js b/src/case/colorchooser/colorpicker/editor.colorpicker.js index bbb2d39bb4..3afacdd836 100644 --- a/src/case/colorchooser/colorpicker/editor.colorpicker.js +++ b/src/case/colorchooser/colorpicker/editor.colorpicker.js @@ -240,5 +240,5 @@ BI.ColorPickerEditor = BI.inherit(BI.Widget, { })); } }); -BI.ColorPickerEditor.EVENT_CHANGE = "ColorPickerEditor.EVENT_CHANGE"; +BI.ColorPickerEditor.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.color_picker_editor", BI.ColorPickerEditor); \ No newline at end of file diff --git a/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js b/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js index 49c759548a..819a0b3ab2 100644 --- a/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js +++ b/src/case/colorchooser/colorpicker/editor.colorpicker.simple.js @@ -106,5 +106,5 @@ BI.SimpleColorPickerEditor = BI.inherit(BI.Widget, { })); } }); -BI.SimpleColorPickerEditor.EVENT_CHANGE = "ColorPickerEditor.EVENT_CHANGE"; +BI.SimpleColorPickerEditor.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.simple_color_picker_editor", BI.SimpleColorPickerEditor); \ No newline at end of file diff --git a/src/case/colorchooser/farbtastic/farbtastic.js b/src/case/colorchooser/farbtastic/farbtastic.js index 630cf9af57..cba596bc5f 100644 --- a/src/case/colorchooser/farbtastic/farbtastic.js +++ b/src/case/colorchooser/farbtastic/farbtastic.js @@ -276,5 +276,5 @@ BI.Farbtastic = BI.inherit(BI.BasicButton, { return this.value; } }); -BI.Farbtastic.EVENT_CHANGE = "Farbtastic.EVENT_CHANGE"; +BI.Farbtastic.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.farbtastic", BI.Farbtastic); \ No newline at end of file diff --git a/src/case/layer/panel.js b/src/case/layer/panel.js index 4cbc74b167..d24b7b546a 100644 --- a/src/case/layer/panel.js +++ b/src/case/layer/panel.js @@ -74,6 +74,6 @@ BI.Panel = BI.inherit(BI.Widget, { this.text.setValue(title); } }); -BI.Panel.EVENT_CHANGE = "Panel.EVENT_CHANGE"; +BI.Panel.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.panel", BI.Panel); diff --git a/src/case/toolbar/toolbar.multiselect.js b/src/case/toolbar/toolbar.multiselect.js index f2bf90c21c..0821356971 100644 --- a/src/case/toolbar/toolbar.multiselect.js +++ b/src/case/toolbar/toolbar.multiselect.js @@ -135,5 +135,5 @@ BI.MultiSelectBar = BI.inherit(BI.BasicButton, { } } }); -BI.MultiSelectBar.EVENT_CHANGE = "MultiSelectBar.EVENT_CHANGE"; +BI.MultiSelectBar.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.multi_select_bar", BI.MultiSelectBar); diff --git a/src/case/trigger/trigger.editor.js b/src/case/trigger/trigger.editor.js index 5a1d281c76..d76f5ff5dd 100644 --- a/src/case/trigger/trigger.editor.js +++ b/src/case/trigger/trigger.editor.js @@ -76,5 +76,5 @@ BI.EditorTrigger = BI.inherit(BI.Trigger, { this.editor.setState(text); } }); -BI.EditorTrigger.EVENT_CHANGE = "BI.EditorTrigger.EVENT_CHANGE"; +BI.EditorTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.editor_trigger", BI.EditorTrigger); diff --git a/src/component/allvaluechooser/pane.allvaluechooser.js b/src/component/allvaluechooser/pane.allvaluechooser.js index 301223b627..1e2c6837df 100644 --- a/src/component/allvaluechooser/pane.allvaluechooser.js +++ b/src/component/allvaluechooser/pane.allvaluechooser.js @@ -60,5 +60,5 @@ BI.AllValueChooserPane = BI.inherit(BI.AbstractAllValueChooser, { this.list.populate.apply(this.list, arguments); } }); -BI.AllValueChooserPane.EVENT_CHANGE = "AllValueChooserPane.EVENT_CHANGE"; +BI.AllValueChooserPane.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.all_value_chooser_pane", BI.AllValueChooserPane); \ No newline at end of file diff --git a/src/component/treevaluechooser/pane.treevaluechooser.js b/src/component/treevaluechooser/pane.treevaluechooser.js index 457ee13ced..87c80ce8be 100644 --- a/src/component/treevaluechooser/pane.treevaluechooser.js +++ b/src/component/treevaluechooser/pane.treevaluechooser.js @@ -49,5 +49,5 @@ BI.TreeValueChooserPane = BI.inherit(BI.AbstractTreeValueChooser, { this.pane.populate.apply(this.pane, arguments); } }); -BI.TreeValueChooserPane.EVENT_CHANGE = "TreeValueChooserPane.EVENT_CHANGE"; +BI.TreeValueChooserPane.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.tree_value_chooser_pane", BI.TreeValueChooserPane); \ No newline at end of file diff --git a/src/component/valuechooser/pane.valuechooser.js b/src/component/valuechooser/pane.valuechooser.js index fd6b5d699b..eb53acca60 100644 --- a/src/component/valuechooser/pane.valuechooser.js +++ b/src/component/valuechooser/pane.valuechooser.js @@ -54,5 +54,5 @@ BI.ValueChooserPane = BI.inherit(BI.AbstractValueChooser, { this.list.populate.apply(this.list, arguments); } }); -BI.ValueChooserPane.EVENT_CHANGE = "ValueChooserPane.EVENT_CHANGE"; +BI.ValueChooserPane.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.value_chooser_pane", BI.ValueChooserPane); \ No newline at end of file diff --git a/src/core/listener/listener.show.js b/src/core/listener/listener.show.js index e571dac7ef..c27eb4e13b 100644 --- a/src/core/listener/listener.show.js +++ b/src/core/listener/listener.show.js @@ -46,4 +46,4 @@ BI.ShowListener = BI.inherit(BI.OB, { } } }); -BI.ShowListener.EVENT_CHANGE = "ShowListener.EVENT_CHANGE"; \ No newline at end of file +BI.ShowListener.EVENT_CHANGE = "EVENT_CHANGE"; \ No newline at end of file diff --git a/src/core/utils/aes.js b/src/core/utils/aes.js index 9971ebdd42..1d739a8faa 100644 --- a/src/core/utils/aes.js +++ b/src/core/utils/aes.js @@ -2317,7 +2317,7 @@ * * var ciphertext = BI.aesEncrypt(text, key); */ - aesEncrypt: function (text, key) { + encrypt: function (text, key) { key = CryptoJS.enc.Utf8.parse(key); var cipher = CryptoJS.AES.encrypt(text, key, { mode: CryptoJS.mode.ECB, diff --git a/src/widget/date/calendar/popup.year.js b/src/widget/date/calendar/popup.year.js index f0d4795936..15654c0043 100644 --- a/src/widget/date/calendar/popup.year.js +++ b/src/widget/date/calendar/popup.year.js @@ -95,7 +95,10 @@ BI.YearPopup = BI.inherit(BI.Widget, { setValue: function (v) { var o = this.options; v = BI.parseInt(v); - if (BI.checkDateVoid(v, 1, 1, o.min, o.max)[0]) { + // 对于年控件来说,只要传入的minDate和maxDate的year区间包含v就是合法的 + var startDate = BI.parseDateTime(o.min, "%Y-%X-%d"); + var endDate = BI.parseDateTime(o.max, "%Y-%X-%d"); + if (BI.checkDateVoid(v, 1, 1, BI.print(BI.getDate(startDate.getFullYear(), 0, 1), "%Y-%X-%d"), BI.print(BI.getDate(endDate.getFullYear(), 0, 1), "%Y-%X-%d"))[0]) { v = BI.getDate().getFullYear(); this.selectedYear = ""; this.navigation.setSelect(BI.YearCalendar.getPageByYear(v)); diff --git a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js index 7524165704..74d8792fa6 100644 --- a/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js +++ b/src/widget/multilayerselecttree/multilayerselecttree.leveltree.js @@ -98,7 +98,7 @@ BI.MultiLayerSelectLevelTree = BI.inherit(BI.Pane, { }); o.itemsCreator(op, function (ob) { hasNext = ob.hasNext; - self._populate(ob.items); + (op.times === 1 && !op.node) && self._populate(ob.items); callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items), op.node ? op.node.layer + 1 : 0, op.node)); self.setValue(self.storeValue); (op.times === 1 && !op.node) && BI.nextTick(function () { diff --git a/src/widget/multilayersingletree/multilayersingletree.leveltree.js b/src/widget/multilayersingletree/multilayersingletree.leveltree.js index 8b897354e2..f067f2ef02 100644 --- a/src/widget/multilayersingletree/multilayersingletree.leveltree.js +++ b/src/widget/multilayersingletree/multilayersingletree.leveltree.js @@ -98,7 +98,7 @@ BI.MultiLayerSingleLevelTree = BI.inherit(BI.Pane, { }); o.itemsCreator(op, function (ob) { hasNext = ob.hasNext; - self._populate(ob.items); + (op.times === 1 && !op.node) && self._populate(ob.items); callback(self._formatItems(BI.Tree.transformToTreeFormat(ob.items), op.node ? op.node.layer + 1 : 0, op.node)); self.setValue(self.storeValue); (op.times === 1 && !op.node) && BI.nextTick(function () { diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index de914f3377..fc8a893f0c 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -13,7 +13,8 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { height: 24, attributes: { tabIndex: 0 - } + }, + allowEdit: true }); }, @@ -35,6 +36,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { this.trigger = BI.createWidget({ type: "bi.multi_select_trigger", + allowEdit: o.allowEdit, height: o.height, text: o.text, // adapter: this.popup, diff --git a/src/widget/multiselectlist/multiselectlist.insert.js b/src/widget/multiselectlist/multiselectlist.insert.js index 09c2f84bd7..6cc5959d93 100644 --- a/src/widget/multiselectlist/multiselectlist.insert.js +++ b/src/widget/multiselectlist/multiselectlist.insert.js @@ -332,5 +332,5 @@ BI.extend(BI.MultiSelectInsertList, { REQ_GET_ALL_DATA: -1 }); -BI.MultiSelectInsertList.EVENT_CHANGE = "BI.MultiSelectInsertList.EVENT_CHANGE"; +BI.MultiSelectInsertList.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.multi_select_insert_list", BI.MultiSelectInsertList); \ No newline at end of file diff --git a/src/widget/multiselectlist/multiselectlist.insert.nobar.js b/src/widget/multiselectlist/multiselectlist.insert.nobar.js index 17e641eccc..a273d942de 100644 --- a/src/widget/multiselectlist/multiselectlist.insert.nobar.js +++ b/src/widget/multiselectlist/multiselectlist.insert.nobar.js @@ -342,5 +342,5 @@ BI.extend(BI.MultiSelectInsertNoBarList, { REQ_GET_ALL_DATA: -1 }); -BI.MultiSelectInsertNoBarList.EVENT_CHANGE = "BI.MultiSelectInsertNoBarList.EVENT_CHANGE"; +BI.MultiSelectInsertNoBarList.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.multi_select_insert_no_bar_list", BI.MultiSelectInsertNoBarList); \ No newline at end of file diff --git a/src/widget/multiselectlist/multiselectlist.js b/src/widget/multiselectlist/multiselectlist.js index d111db5835..3b52b9e56b 100644 --- a/src/widget/multiselectlist/multiselectlist.js +++ b/src/widget/multiselectlist/multiselectlist.js @@ -344,5 +344,5 @@ BI.extend(BI.MultiSelectList, { REQ_GET_ALL_DATA: -1 }); -BI.MultiSelectList.EVENT_CHANGE = "BI.MultiSelectList.EVENT_CHANGE"; +BI.MultiSelectList.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.multi_select_list", BI.MultiSelectList); \ No newline at end of file diff --git a/src/widget/multiselecttree/multiselecttree.js b/src/widget/multiselecttree/multiselecttree.js index 36bd7d5c82..f980b0456e 100644 --- a/src/widget/multiselecttree/multiselecttree.js +++ b/src/widget/multiselecttree/multiselecttree.js @@ -163,5 +163,5 @@ BI.MultiSelectTree = BI.inherit(BI.Single, { this.adapter.populate.apply(this.adapter, arguments); } }); -BI.MultiSelectTree.EVENT_CHANGE = "BI.MultiSelectTree.EVENT_CHANGE"; +BI.MultiSelectTree.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.multi_select_tree", BI.MultiSelectTree); \ No newline at end of file diff --git a/src/widget/multiselecttree/multiselecttree.popup.js b/src/widget/multiselecttree/multiselecttree.popup.js index fe635f157a..4c28651a8f 100644 --- a/src/widget/multiselecttree/multiselecttree.popup.js +++ b/src/widget/multiselecttree/multiselecttree.popup.js @@ -52,6 +52,6 @@ BI.MultiSelectTreePopup = BI.inherit(BI.Widget, { } }); -BI.MultiSelectTreePopup.EVENT_AFTER_INIT = "BI.MultiSelectTreePopup.EVENT_AFTER_INIT"; -BI.MultiSelectTreePopup.EVENT_CHANGE = "BI.MultiSelectTreePopup.EVENT_CHANGE"; +BI.MultiSelectTreePopup.EVENT_AFTER_INIT = "EVENT_AFTER_INIT"; +BI.MultiSelectTreePopup.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.multi_select_tree_popup", BI.MultiSelectTreePopup); \ No newline at end of file diff --git a/src/widget/singleselect/singleselect.combo.js b/src/widget/singleselect/singleselect.combo.js index 574a3e23e7..9382ff8aa2 100644 --- a/src/widget/singleselect/singleselect.combo.js +++ b/src/widget/singleselect/singleselect.combo.js @@ -14,7 +14,8 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { height: 24, attributes: { tabIndex: 0 - } + }, + allowEdit: true }); }, @@ -35,6 +36,7 @@ BI.SingleSelectCombo = BI.inherit(BI.Single, { height: o.height, // adapter: this.popup, allowNoSelect: o.allowNoSelect, + allowEdit: o.allowEdit, valueFormatter: o.valueFormatter, itemsCreator: function (op, callback) { o.itemsCreator(op, function (res) { diff --git a/src/widget/singleselect/singleselect.insert.combo.js b/src/widget/singleselect/singleselect.insert.combo.js index 717ef2e62e..dd1218a661 100644 --- a/src/widget/singleselect/singleselect.insert.combo.js +++ b/src/widget/singleselect/singleselect.insert.combo.js @@ -14,7 +14,8 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, { height: 24, attributes: { tabIndex: 0 - } + }, + allowEdit: true }); }, @@ -34,6 +35,7 @@ BI.SingleSelectInsertCombo = BI.inherit(BI.Single, { type: "bi.single_select_trigger", height: o.height, allowNoSelect: o.allowNoSelect, + allowEdit: o.allowEdit, // adapter: this.popup, valueFormatter: o.valueFormatter, itemsCreator: function (op, callback) { diff --git a/src/widget/singleselect/singleselect.item.js b/src/widget/singleselect/singleselect.item.js index 2c90ba2d96..b3a053f010 100644 --- a/src/widget/singleselect/singleselect.item.js +++ b/src/widget/singleselect/singleselect.item.js @@ -55,6 +55,9 @@ BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, { doClick: function () { BI.SingleSelectComboItem.superclass.doClick.apply(this, arguments); this.radio.setSelected(this.isSelected()); + if (this.isValid()) { + this.fireEvent(BI.SingleSelectComboItem.EVENT_CHANGE, this.isSelected(), this); + } }, setSelected: function (v) { @@ -63,5 +66,5 @@ BI.SingleSelectComboItem = BI.inherit(BI.BasicButton, { } }); - +BI.SingleSelectComboItem.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.single_select_combo_item", BI.SingleSelectComboItem); \ No newline at end of file diff --git a/src/widget/singleselect/singleselect.trigger.js b/src/widget/singleselect/singleselect.trigger.js index 1cdf39aca4..06cf1a0548 100644 --- a/src/widget/singleselect/singleselect.trigger.js +++ b/src/widget/singleselect/singleselect.trigger.js @@ -23,7 +23,8 @@ BI.SingleSelectTrigger = BI.inherit(BI.Trigger, { switcher: {}, adapter: null, - masker: {} + masker: {}, + allowEdit: true }); }, @@ -75,6 +76,20 @@ BI.SingleSelectTrigger = BI.inherit(BI.Trigger, { width: 24 }] }); + + !o.allowEdit && BI.createWidget({ + type: "bi.absolute", + element: this, + items: [{ + el: { + type: "bi.layout" + }, + left: 0, + right: 24, + top: 0, + bottom: 0 + }] + }); }, getSearcher: function () { diff --git a/src/widget/singleselect/singleselectlist.insert.js b/src/widget/singleselect/singleselectlist.insert.js index b1adc0b0d1..fb687e7f05 100644 --- a/src/widget/singleselect/singleselectlist.insert.js +++ b/src/widget/singleselect/singleselectlist.insert.js @@ -233,5 +233,5 @@ BI.extend(BI.SingleSelectInsertList, { REQ_GET_ALL_DATA: -1 }); -BI.SingleSelectInsertList.EVENT_CHANGE = "BI.SingleSelectInsertList.EVENT_CHANGE"; +BI.SingleSelectInsertList.EVENT_CHANGE = "EVENT_CHANGE"; BI.shortcut("bi.single_select_insert_list", BI.SingleSelectInsertList); diff --git a/src/widget/singletree/singletree.combo.js b/src/widget/singletree/singletree.combo.js index f7e9c98284..fae7f8ff50 100644 --- a/src/widget/singletree/singletree.combo.js +++ b/src/widget/singletree/singletree.combo.js @@ -76,6 +76,6 @@ BI.SingleTreeCombo = BI.inherit(BI.Widget, { } }); -BI.SingleTreeCombo.EVENT_CHANGE = "SingleTreeCombo.EVENT_CHANGE"; +BI.SingleTreeCombo.EVENT_CHANGE = "EVENT_CHANGE"; BI.SingleTreeCombo.EVENT_BEFORE_POPUPVIEW = "EVENT_BEFORE_POPUPVIEW"; BI.shortcut("bi.single_tree_combo", BI.SingleTreeCombo); \ No newline at end of file