Browse Source

Merge pull request 'feature:适配fix,实现简单版的button_group' (#3) from guy/open-fineui-swing:10.0 into 10.0

Reviewed-on: #3
10.0
guy 3 years ago
parent
commit
3ca189d67c
  1. 16
      src/main/java/com/tptj/tool/hg/fineui/swing/FineUIEngine.java
  2. 13
      src/main/java/com/tptj/tool/hg/fineui/swing/element/AbstractElement.java
  3. 33
      src/main/java/com/tptj/tool/hg/fineui/swing/element/AbstractSingleElement.java
  4. 52
      src/main/java/com/tptj/tool/hg/fineui/swing/element/ButtonElement.java
  5. 3
      src/main/java/com/tptj/tool/hg/fineui/swing/element/Element.java
  6. 15
      src/main/java/com/tptj/tool/hg/fineui/swing/element/LabelElement.java
  7. 38
      src/main/java/com/tptj/tool/hg/fineui/swing/element/ListElement.java
  8. 3
      src/main/java/com/tptj/tool/hg/fineui/swing/element/TextElement.java
  9. 3
      src/main/java/com/tptj/tool/hg/fineui/swing/element/layout/CenterAdaptType.java
  10. 2
      src/main/java/com/tptj/tool/hg/fineui/swing/element/layout/HorizontalAdaptType.java
  11. 2
      src/main/java/com/tptj/tool/hg/fineui/swing/element/layout/VerticalAdaptType.java
  12. 31
      src/main/resources/com/fr/fineui/dist/README.md
  13. 199
      src/main/resources/com/fr/fineui/dist/fix/fix.compact.js
  14. 1526
      src/main/resources/com/fr/fineui/dist/fix/fix.js
  15. 2035
      src/main/resources/com/fr/fineui/dist/fix/fix.proxy.js
  16. 157
      src/main/resources/com/fr/fineui/dist/fix/worker.compact.js
  17. BIN
      src/main/resources/com/fr/fineui/dist/font/iconfont.eot
  18. 1275
      src/main/resources/com/fr/fineui/dist/font/iconfont.svg
  19. BIN
      src/main/resources/com/fr/fineui/dist/font/iconfont.ttf
  20. BIN
      src/main/resources/com/fr/fineui/dist/font/iconfont.woff
  21. BIN
      src/main/resources/com/fr/fineui/dist/font/iconfont.woff2
  22. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/auto_color.png
  23. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/auto_color_disable.png
  24. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/auto_color_normal.png
  25. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/auto_color_normal_disable.png
  26. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/auto_color_normal_select.png
  27. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/auto_color_select.png
  28. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/line_conn.gif
  29. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/marker.png
  30. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/mask.png
  31. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/trans_color.png
  32. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/trans_disable.png
  33. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/trans_normal.png
  34. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/trans_select.png
  35. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/background/wheel.png
  36. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/auto_no_square_normal.png
  37. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/auto_square_normal.png
  38. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/check_box_active.png
  39. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/check_box_disable.png
  40. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/check_box_disable2.png
  41. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/check_box_hover.png
  42. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/check_box_normal.png
  43. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/auto_square_normal.png
  44. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/trans_normal.png
  45. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/trans_select.png
  46. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_collapse_1.png
  47. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_collapse_2.png
  48. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_collapse_3.png
  49. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_collapse_4.png
  50. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_expand_1.png
  51. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_expand_2.png
  52. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_expand_3.png
  53. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_expand_4.png
  54. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_vertical_line_1.png
  55. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_vertical_line_2.png
  56. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_vertical_line_3.png
  57. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_vertical_line_4.png
  58. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_vertical_line_5.png
  59. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/dots.png
  60. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/half_selected.png
  61. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/half_selected_disable.png
  62. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/icon_down_arrow.png
  63. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/loading.gif
  64. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/push_down.png
  65. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/push_up.png
  66. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/radio_active.png
  67. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/radio_disable.png
  68. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/radio_disable2.png
  69. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/radio_hover.png
  70. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/radio_normal.png
  71. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/slider_active.png
  72. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/slider_active_small.png
  73. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/slider_normal.png
  74. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/slider_normal_small.png
  75. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/trans_normal.png
  76. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/trans_select.png
  77. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_collapse_1.png
  78. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_collapse_2.png
  79. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_collapse_3.png
  80. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_collapse_4.png
  81. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_expand_1.png
  82. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_expand_2.png
  83. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_expand_3.png
  84. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_expand_4.png
  85. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_vertical_line_1.png
  86. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_vertical_line_2.png
  87. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_vertical_line_3.png
  88. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_vertical_line_4.png
  89. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_vertical_line_5.png
  90. BIN
      src/main/resources/com/fr/fineui/dist/images/1x/icon/wave_loading.gif
  91. BIN
      src/main/resources/com/fr/fineui/dist/images/2x/background/auto_color_disable.png
  92. BIN
      src/main/resources/com/fr/fineui/dist/images/2x/background/auto_color_normal.png
  93. BIN
      src/main/resources/com/fr/fineui/dist/images/2x/background/auto_color_select.png
  94. BIN
      src/main/resources/com/fr/fineui/dist/images/2x/background/line_conn.gif
  95. BIN
      src/main/resources/com/fr/fineui/dist/images/2x/background/marker.png
  96. BIN
      src/main/resources/com/fr/fineui/dist/images/2x/background/mask.png
  97. BIN
      src/main/resources/com/fr/fineui/dist/images/2x/background/trans_normal.png
  98. BIN
      src/main/resources/com/fr/fineui/dist/images/2x/background/wheel.png
  99. BIN
      src/main/resources/com/fr/fineui/dist/images/2x/icon/auto_no_square_normal.png
  100. BIN
      src/main/resources/com/fr/fineui/dist/images/2x/icon/auto_normal.png
  101. Some files were not shown because too many files have changed in this diff Show More

16
src/main/java/com/tptj/tool/hg/fineui/swing/FineUIEngine.java

@ -64,6 +64,8 @@ public class FineUIEngine {
"com/fr/fineui/core/constant/events.js",
"com/fr/fineui/core/constant/var.js",
"com/fr/fineui/core/controller/0.controller.js",
"com/fr/fineui/core/func/alias.js",
"com/fr/fineui/core/func/array.js",
"com/fr/fineui/core/func/date.js",
@ -109,8 +111,17 @@ public class FineUIEngine {
"com/fr/fineui/core/wrapper/layout/flex/flex.vertical.center.js",
"com/fr/fineui/core/wrapper/layout/flex/flex.leftrightvertical.center.js",
// fix代码
"com/fr/fineui/dist/fix/fix.proxy.js",
"com/fr/fineui/dist/fix/fix.compact.js",
// 通用组价
"com/fr/fineui/base/combination/group.button.js",
//com/tptj/tool/hg/fineui/swing 下的都是适配swing的js代码
// 自定义布局
"com/tptj/tool/hg/fineui/swing/core/wrapper/layout.service.js",
"com/tptj/tool/hg/fineui/swing/core/wrapper/layout.static.js",
"com/tptj/tool/hg/fineui/swing/core/wrapper/layout.horizontal.js",
"com/tptj/tool/hg/fineui/swing/core/wrapper/layout.vertical.js",
@ -129,6 +140,8 @@ public class FineUIEngine {
//自定义的基础控件,最基本的控件需要由swing实现后,映射到fineui中,高级的组件就可以
//由开发者按照fineui的组件继承方式进行组合创建新的组件了
"com/tptj/tool/hg/fineui/swing/base/single/label.js",
"com/tptj/tool/hg/fineui/swing/base/single/button.js",
"com/tptj/tool/hg/fineui/swing/base/single/group.button.js",
"com/tptj/tool/hg/fineui/swing/widget/editor/editor.text.js"
);
@ -228,7 +241,8 @@ public class FineUIEngine {
// .importJs("com/tptj/tool/hg/fineui/swing/demo/layout.tape.js");
// .importJs("com/tptj/tool/hg/fineui/swing/demo/layout.grid.js");
// .importJs("com/tptj/tool/hg/fineui/swing/demo/layout.window.js");
.importJs("com/tptj/tool/hg/fineui/swing/demo/layout.horizontal.js");
// .importJs("com/tptj/tool/hg/fineui/swing/demo/layout.horizontal.js");
.importJs("com/tptj/tool/hg/fineui/swing/demo/group.button.js");
return null;
}).run();

13
src/main/java/com/tptj/tool/hg/fineui/swing/element/AbstractElement.java

@ -1,5 +1,6 @@
package com.tptj.tool.hg.fineui.swing.element;
import com.eclipsesource.v8.V8Array;
import com.eclipsesource.v8.V8Object;
import com.fr.general.GeneralUtils;
import com.fr.log.FineLoggerFactory;
@ -20,7 +21,7 @@ import java.util.List;
**/
public abstract class AbstractElement<T extends JComponent> implements Element<T> {
private T component;
protected T component;
private JComponent wrapper;
private V8Object ref;
private String type;
@ -152,7 +153,8 @@ public abstract class AbstractElement<T extends JComponent> implements Element<T
@Override
public void destroy() {
component.removeAll();
children.clear();
}
@Override
@ -182,7 +184,7 @@ public abstract class AbstractElement<T extends JComponent> implements Element<T
@Override
public void empty() {
children.clear();
}
@Override
@ -263,6 +265,11 @@ public abstract class AbstractElement<T extends JComponent> implements Element<T
return val;
}
@Override
public void populate(V8Array items) {
}
@Override
public int getRectStyleAttr(String name, int max, int min) {
Object val = css.get(name);

33
src/main/java/com/tptj/tool/hg/fineui/swing/element/AbstractSingleElement.java

@ -0,0 +1,33 @@
package com.tptj.tool.hg.fineui.swing.element;
import javax.swing.*;
import java.awt.*;
/**
* @author 秃破天际
* @version 10.0
* Created by 秃破天际 on 2021/10/29
**/
public abstract class AbstractSingleElement<T extends JComponent> extends AbstractElement<T> {
protected AbstractSingleElement(T component) {
super(component);
}
@Override
public void css(String name, String val) {
super.css(name, val);
Dimension dim = getComponent().getPreferredSize();
if ("width".equals(name)) {
if (val.length() > 0) {
dim.width = Integer.parseInt(val);
getComponent().setPreferredSize(dim);
}
}
if ("height".equals(name)) {
if (val.length() > 0) {
dim.height = Integer.parseInt(val);
getComponent().setPreferredSize(dim);
}
}
}
}

52
src/main/java/com/tptj/tool/hg/fineui/swing/element/ButtonElement.java

@ -0,0 +1,52 @@
package com.tptj.tool.hg.fineui.swing.element;
import com.fr.general.GeneralUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* @author 秃破天际
* @version 10.0
* Created by 秃破天际 on 2021/10/29
**/
public class ButtonElement extends AbstractSingleElement<JButton> {
public ButtonElement() {
super(new JButton());
getComponent().addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
callJsMethod("fireEvent", "EVENT_CHANGE", getComponent().getText());
}
});
}
@Override
public Object getVal() {
return getComponent().getText();
}
@Override
public void setVal(Object val) {
super.setVal(val);
getComponent().setText(GeneralUtils.objectToString(val));
}
@Override
public void css(String name, String val) {
super.css(name, val);
val = val.toUpperCase();
if ("text-align".equals(name)) {
if ("LEFT".equals(val)) {
getComponent().setHorizontalAlignment(SwingConstants.LEFT);
} else if ("CENTER".equals(val)) {
getComponent().setHorizontalAlignment(SwingConstants.CENTER);
} else if ("RIGHT".equals(val)) {
getComponent().setHorizontalAlignment(SwingConstants.RIGHT);
}
}
}
}

3
src/main/java/com/tptj/tool/hg/fineui/swing/element/Element.java

@ -1,5 +1,6 @@
package com.tptj.tool.hg.fineui.swing.element;
import com.eclipsesource.v8.V8Array;
import com.eclipsesource.v8.V8Object;
import javax.swing.*;
@ -60,4 +61,6 @@ public interface Element<T extends JComponent> {
void setVal(Object val);
Object getVal();
void populate(V8Array items);
}

15
src/main/java/com/tptj/tool/hg/fineui/swing/element/LabelElement.java

@ -11,7 +11,7 @@ import java.awt.*;
* @version 10.0
* Created by 秃破天际 on 2021/10/29
**/
public class LabelElement extends AbstractElement<UILabel> {
public class LabelElement extends AbstractSingleElement<UILabel> {
public LabelElement() {
super(new UILabel());
@ -41,18 +41,5 @@ public class LabelElement extends AbstractElement<UILabel> {
getComponent().setHorizontalAlignment(SwingConstants.RIGHT);
}
}
Dimension dim = getComponent().getPreferredSize();
if ("width".equals(name)) {
if (val.length() > 0) {
dim.width = Integer.parseInt(val);
getComponent().setPreferredSize(dim);
}
}
if ("height".equals(name)) {
if (val.length() > 0) {
dim.height = Integer.parseInt(val);
getComponent().setPreferredSize(dim);
}
}
}
}

38
src/main/java/com/tptj/tool/hg/fineui/swing/element/ListElement.java

@ -0,0 +1,38 @@
package com.tptj.tool.hg.fineui.swing.element;
import com.eclipsesource.v8.V8Array;
import javax.swing.*;
import java.util.Vector;
/**
* @author 秃破天际
* @version 10.0
* Created by 秃破天际 on 2021/10/29
**/
public class ListElement extends AbstractSingleElement<JList> {
public ListElement() {
super(new JList());
}
@Override
public void populate(V8Array items) {
Vector<String> vector = new Vector<>();
for (int i = 0, len = items.length(); i < len; i++) {
vector.add(items.getString(i));
}
component.setModel(new DefaultComboBoxModel<>(vector));
}
@Override
public void setVal(Object val) {
super.setVal(val);
}
@Override
public void css(String name, String val) {
super.css(name, val);
}
}

3
src/main/java/com/tptj/tool/hg/fineui/swing/element/TextElement.java

@ -19,7 +19,7 @@ import java.awt.event.KeyListener;
* @version 10.0
* Created by 秃破天际 on 2021/11/2
**/
public class TextElement extends AbstractElement<JTextField>{
public class TextElement extends AbstractSingleElement<JTextField>{
public TextElement() {
super(new UITextField());
init();
@ -138,7 +138,6 @@ public class TextElement extends AbstractElement<JTextField>{
@Override
public void css(String name, String val){
super.css(name, val);
}
@Override

3
src/main/java/com/tptj/tool/hg/fineui/swing/element/layout/CenterAdaptType.java

@ -2,7 +2,6 @@ package com.tptj.tool.hg.fineui.swing.element.layout;
import com.tptj.tool.hg.fineui.swing.element.Element;
import com.tptj.tool.hg.fineui.swing.element.VerticalFlowLayout;
import com.tptj.tool.hg.fineui.swing.element.layout.impl.HorizontalLayout;
import com.tptj.tool.hg.fineui.swing.element.layout.impl.VerticalLayout;
import javax.swing.*;
@ -20,7 +19,7 @@ public class CenterAdaptType extends AbstractLayoutType {
public LayoutManager init() {
wrapComponent = new JPanel();
wrapComponent.setOpaque(false);
wrapComponent.setLayout(new HorizontalLayout(element, FlowLayout.CENTER, 0, 0));
wrapComponent.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
element.getComponent().add(wrapComponent);
return new VerticalLayout(element, VerticalFlowLayout.CENTER, 0, 0, true);
}

2
src/main/java/com/tptj/tool/hg/fineui/swing/element/layout/HorizontalAdaptType.java

@ -27,7 +27,7 @@ public class HorizontalAdaptType extends AbstractLayoutType {
if (w > 0) {
JComponent wrapComponent = new JPanel();
wrapComponent.setOpaque(false);
wrapComponent.setLayout(new HorizontalLayout(element, FlowLayout.CENTER, 0, 0));
wrapComponent.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
wrapComponent.add(child.getWrapper());
element.getComponent().add(wrapComponent);
} else {

2
src/main/java/com/tptj/tool/hg/fineui/swing/element/layout/VerticalAdaptType.java

@ -17,7 +17,7 @@ public class VerticalAdaptType extends CenterAdaptType {
public LayoutManager init() {
wrapComponent = new JPanel();
wrapComponent.setOpaque(false);
wrapComponent.setLayout(new HorizontalLayout(element, FlowLayout.LEFT, 0, 0));
wrapComponent.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
element.getComponent().add(wrapComponent);
return new VerticalLayout(element, VerticalFlowLayout.CENTER, 0, 0, true);
}

31
src/main/resources/com/fr/fineui/dist/README.md vendored

@ -0,0 +1,31 @@
#### fineui.js
整个fineui打包文件,不包括配置文件
#### fineui.css
整个fineui打包文件,不包括资源文件
#### config.js
配置文件,这只是一个案例,集成进系统的时候需要进行配置
#### resource.css
app.css background.css icon.css font.css的合并文件,集成进系统的时候需要进行配置
#### router.js
#### 路由文件,使用fineui路由的时候才需要引入
#### bundle.js bundle.css
所有文件的合并文件, 主要给在线demo和文档用的
#### core_without_normalize.css
不带标准化的core.css文件,只引入通用css样式的时候才需要
#### chart.js
封装好的一层图表api

199
src/main/resources/com/fr/fineui/dist/fix/fix.compact.js vendored

@ -0,0 +1,199 @@
;(function () {
function initWatch (vm, watch) {
vm._watchers || (vm._watchers = []);
for (var key in watch) {
var handler = watch[key];
if (BI.isArray(handler)) {
for (var i = 0; i < handler.length; i++) {
vm._watchers.push(createWatcher(vm, key, handler[i]));
}
} else {
vm._watchers.push(createWatcher(vm, key, handler));
}
}
BI.each(vm.$watchDelayCallbacks, function (i, watchDelayCallback) {
var innerWatch = watchDelayCallback[0];
var innerHandler = watchDelayCallback[1];
if (BI.isKey(innerWatch)) {
var key = innerWatch;
innerWatch = {};
innerWatch[key] = innerHandler;
}
for (var key in innerWatch) {
var handler = innerWatch[key];
if (BI.isArray(handler)) {
for (var i = 0; i < handler.length; i++) {
vm._watchers.push(createWatcher(vm, key, handler[i]));
}
} else {
vm._watchers.push(createWatcher(vm, key, handler));
}
}
});
}
function createWatcher (vm, keyOrFn, cb, options) {
if (BI.isPlainObject(cb)) {
options = cb;
cb = cb.handler;
}
options = options || {};
return Fix.watch(vm.model, keyOrFn, _.bind(cb, vm), BI.extend(options, {
store: vm.store
}));
}
var target = null;
var targetStack = [];
function pushTarget (_target) {
if (target) targetStack.push(target);
Fix.Model.target = target = _target;
}
function popTarget () {
Fix.Model.target = target = targetStack.pop();
}
var oldWatch = Fix.watch;
Fix.watch = function (model, expOrFn, cb, options) {
if (BI.isPlainObject(cb)) {
options = cb;
cb = cb.handler;
}
if (typeof cb === "string") {
cb = model[cb];
}
return oldWatch.call(this, model, expOrFn, function () {
options && options.store && pushTarget(options.store);
try {
var res = cb.apply(this, arguments);
} catch (e) {
console.error(e);
}
options && options.store && popTarget();
return res;
}, options);
};
function findStore (widget) {
if (target != null) {
return target;
}
widget = widget || BI.Widget.context;
var p = widget;
while (p) {
if (p instanceof Fix.Model || p.store || p.__cacheStore) {
break;
}
p = p._parent || (p.options && p.options.element) || p._context;
}
if (p) {
if (p instanceof Fix.Model) {
return widget.__cacheStore = p;
}
widget.__cacheStore = p.store || p.__cacheStore;
return p.__cacheStore || p.store;
}
}
// _.each(["populate", "addItems", "prependItems"], function (name) {
// var old = BI.Loader.prototype[name];
// BI.Loader.prototype[name] = function () {
// BI.Widget.pushContext(this);
// try {
// var result = old.apply(this, arguments);
// } catch (e) {
// console.error(e);
// }
// BI.Widget.popContext();
// return result;
// };
// });
function createStore () {
var needPop = false;
if (_global.Fix && this._store) {
var store = findStore(this.options.context || this._parent || this.options.element || this._context);
if (store) {
pushTarget(store);
needPop = true;
}
this.store = this._store();
this.store && (this.store._widget = this);
needPop && popTarget();
needPop = false;
pushTarget(this.store);
if (this.store instanceof Fix.Model) {
this.model = this.store.model;
} else {
this.model = this.store;
}
needPop = true;
}
return needPop;
}
var _init = BI.Widget.prototype._init;
BI.Widget.prototype._init = function () {
var self = this;
var needPop = createStore.call(this);
try {
_init.apply(this, arguments);
} catch (e) {
console.error(e);
}
needPop && popTarget();
};
var _render = BI.Widget.prototype._render;
BI.Widget.prototype._render = function () {
var needPop = false;
if (_global.Fix && this._store) {
needPop = true;
pushTarget(this.store);
}
_render.apply(this, arguments);
if (_global.Fix && this._store) {
initWatch(this, this.watch);
}
needPop && popTarget();
};
var unMount = BI.Widget.prototype.__d;
BI.Widget.prototype.__d = function () {
try {
unMount.apply(this, arguments);
} catch (e) {
console.error(e);
}
this.store && BI.isFunction(this.store.destroy) && this.store.destroy();
BI.each(this._watchers, function (i, unwatches) {
unwatches = BI.isArray(unwatches) ? unwatches : [unwatches];
BI.each(unwatches, function (j, unwatch) {
unwatch();
});
});
this._watchers && (this._watchers = []);
if (this.store) {
this.store._parent && (this.store._parent = null);
this.store._widget && (this.store._widget = null);
this.store = null;
}
delete this.__cacheStore;
};
_.each(["__afterRender", "_mount", "__afterMount"], function (name) {
var old = BI.Widget.prototype[name];
old && (BI.Widget.prototype[name] = function () {
this.store && pushTarget(this.store);
try {
var res = old.apply(this, arguments);
} catch (e) {
console.error(e);
}
this.store && popTarget();
return res;
});
});
}());

1526
src/main/resources/com/fr/fineui/dist/fix/fix.js vendored

File diff suppressed because it is too large Load Diff

2035
src/main/resources/com/fr/fineui/dist/fix/fix.proxy.js vendored

File diff suppressed because it is too large Load Diff

157
src/main/resources/com/fr/fineui/dist/fix/worker.compact.js vendored

@ -0,0 +1,157 @@
;(function () {
var contexts = {};
var WORKER;
BI.useWorker = function (wk) {
WORKER = wk;
var _init = BI.Widget.prototype._init;
BI.Widget.prototype._init = function () {
this.$destroyWorker = createWorker.call(this);
try {
_init.apply(this, arguments);
} catch (e) {
console.error(e);
}
};
var _initRender = BI.Widget.prototype._initRender;
var postMessage = function (data) {
switch (data.eventType) {
case "create":
this.model = data.msg;
_initRender.call(this);
break;
case "watch":
var watchArgs = data.args;
this.watch[data.currentWatchType].apply(this, watchArgs);
break;
}
};
BI.Widget.prototype._initRender = function () {
if (WORKER && this._worker) {
this.__asking = true;
this.__async = true;
} else {
_initRender.apply(this, arguments);
}
};
var unMount = BI.Widget.prototype.__d;
BI.Widget.prototype.__d = function () {
this.$destroyWorker && this.$destroyWorker();
try {
unMount.apply(this, arguments);
} catch (e) {
console.error(e);
}
};
if (WORKER) {
WORKER.addEventListener("message", function (e) {
var data = e.data;
postMessage.apply(contexts[data.name], [data]);
}, false);
}
};
function createWorker () {
var self = this;
if (this._worker) {
var name = this.getName();
var modelType = this._worker();
var options;
if (BI.isArray(modelType)) {
options = modelType[1];
modelType = modelType[0];
}
if (WORKER) {
contexts[name] = this;
WORKER.postMessage({
type: modelType,
name: name,
eventType: "create",
options: options,
watches: BI.map(this.watch, function (key) {
return key;
})
});
var store = {};
this.store = new Proxy(store, {
get: function (target, key) {
return function () {
WORKER.postMessage({
type: modelType,
name: name,
eventType: "action",
action: key,
args: [].slice.call(arguments)
});
};
},
set: function (target, key, value) {
return Reflect.set(target, key, value);
}
});
return function () {
delete contexts[name];
WORKER.postMessage({
type: modelType,
name: name,
eventType: "destroy"
});
};
} else {
this.store = BI.Models.getModel(modelType, options);
this.store && (this.store._widget = this);
if (this.store instanceof Fix.Model) {
this.model = this.store.model;
} else {
this.model = this.store;
}
initWatch(this, this.watch);
return function () {
this.store && BI.isFunction(this.store.destroy) && this.store.destroy();
BI.each(this._watchers, function (i, unwatches) {
unwatches = BI.isArray(unwatches) ? unwatches : [unwatches];
BI.each(unwatches, function (j, unwatch) {
unwatch();
});
});
this._watchers && (this._watchers = []);
if (this.store) {
this.store._parent && (this.store._parent = null);
this.store._widget && (this.store._widget = null);
this.store = null;
}
};
}
}
}
function initWatch (vm, watch) {
vm._watchers || (vm._watchers = []);
for (var key in watch) {
var handler = watch[key];
if (BI.isArray(handler)) {
for (var i = 0; i < handler.length; i++) {
vm._watchers.push(createWatcher(vm, key, handler[i]));
}
} else {
vm._watchers.push(createWatcher(vm, key, handler));
}
}
}
function createWatcher (vm, keyOrFn, cb, options) {
if (BI.isPlainObject(cb)) {
options = cb;
cb = cb.handler;
}
options = options || {};
return Fix.watch(vm.model, keyOrFn, _.bind(cb, vm), BI.extend(options, {
store: vm.store
}));
}
}());

BIN
src/main/resources/com/fr/fineui/dist/font/iconfont.eot vendored

Binary file not shown.

1275
src/main/resources/com/fr/fineui/dist/font/iconfont.svg vendored

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 426 KiB

BIN
src/main/resources/com/fr/fineui/dist/font/iconfont.ttf vendored

Binary file not shown.

BIN
src/main/resources/com/fr/fineui/dist/font/iconfont.woff vendored

Binary file not shown.

BIN
src/main/resources/com/fr/fineui/dist/font/iconfont.woff2 vendored

Binary file not shown.

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/auto_color.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 771 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/auto_color_disable.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/auto_color_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/auto_color_normal_disable.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/auto_color_normal_select.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 617 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/auto_color_select.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 744 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/line_conn.gif vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/marker.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/mask.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/trans_color.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 301 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/trans_disable.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/trans_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/trans_select.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/background/wheel.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/auto_no_square_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/auto_square_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/check_box_active.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/check_box_disable.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/check_box_disable2.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/check_box_hover.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/check_box_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 202 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/auto_square_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/trans_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/trans_select.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_collapse_1.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_collapse_2.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_collapse_3.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_collapse_4.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 238 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_expand_1.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_expand_2.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_expand_3.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_expand_4.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_vertical_line_1.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_vertical_line_2.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_vertical_line_3.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_vertical_line_4.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dark/tree_vertical_line_5.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/dots.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/half_selected.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/half_selected_disable.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/icon_down_arrow.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/loading.gif vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/push_down.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/push_up.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/radio_active.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/radio_disable.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/radio_disable2.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/radio_hover.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/radio_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 382 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/slider_active.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 416 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/slider_active_small.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 289 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/slider_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 425 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/slider_normal_small.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/trans_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 458 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/trans_select.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 456 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_collapse_1.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_collapse_2.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_collapse_3.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_collapse_4.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_expand_1.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_expand_2.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 209 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_expand_3.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_expand_4.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_vertical_line_1.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_vertical_line_2.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_vertical_line_3.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_vertical_line_4.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/tree_vertical_line_5.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

BIN
src/main/resources/com/fr/fineui/dist/images/1x/icon/wave_loading.gif vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

BIN
src/main/resources/com/fr/fineui/dist/images/2x/background/auto_color_disable.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/main/resources/com/fr/fineui/dist/images/2x/background/auto_color_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/main/resources/com/fr/fineui/dist/images/2x/background/auto_color_select.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

BIN
src/main/resources/com/fr/fineui/dist/images/2x/background/line_conn.gif vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 B

BIN
src/main/resources/com/fr/fineui/dist/images/2x/background/marker.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 652 B

BIN
src/main/resources/com/fr/fineui/dist/images/2x/background/mask.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

BIN
src/main/resources/com/fr/fineui/dist/images/2x/background/trans_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

BIN
src/main/resources/com/fr/fineui/dist/images/2x/background/wheel.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
src/main/resources/com/fr/fineui/dist/images/2x/icon/auto_no_square_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 707 B

BIN
src/main/resources/com/fr/fineui/dist/images/2x/icon/auto_normal.png vendored

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save