eoss-ui 0.4.78 → 0.4.79

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/lib/button-group.js +2 -2
  2. package/lib/button.js +147 -136
  3. package/lib/card.js +2 -2
  4. package/lib/cascader.js +2 -2
  5. package/lib/checkbox-group.js +2 -2
  6. package/lib/clients.js +2 -2
  7. package/lib/data-table-form.js +3 -2
  8. package/lib/data-table.js +3 -2
  9. package/lib/date-picker.js +2 -2
  10. package/lib/dialog.js +7 -5
  11. package/lib/enterprise.js +2 -2
  12. package/lib/eoss-ui.common.js +435 -194
  13. package/lib/error-page.js +2 -2
  14. package/lib/flow-group.js +2 -2
  15. package/lib/flow-list.js +2 -2
  16. package/lib/flow.js +3 -2
  17. package/lib/form.js +54 -6
  18. package/lib/handle-user.js +2 -2
  19. package/lib/handler.js +2 -2
  20. package/lib/icons.js +4 -4
  21. package/lib/index.js +1 -1
  22. package/lib/input-number.js +2 -2
  23. package/lib/input.js +9 -9
  24. package/lib/label.js +2 -2
  25. package/lib/layout.js +182 -11
  26. package/lib/login.js +4 -2
  27. package/lib/main.js +10 -9
  28. package/lib/menu.js +2 -2
  29. package/lib/nav.js +2 -2
  30. package/lib/notify.js +2 -2
  31. package/lib/page.js +2 -2
  32. package/lib/pagination.js +2 -2
  33. package/lib/player.js +8 -8
  34. package/lib/qr-code.js +4 -4
  35. package/lib/radio-group.js +2 -2
  36. package/lib/retrial-auth.js +2 -2
  37. package/lib/select-ganged.js +2 -2
  38. package/lib/select.js +4 -4
  39. package/lib/selector-panel.js +44 -54
  40. package/lib/selector.js +4 -4
  41. package/lib/sizer.js +2 -2
  42. package/lib/steps.js +2 -2
  43. package/lib/switch.js +2 -2
  44. package/lib/table-form.js +20 -8
  45. package/lib/tabs-panel.js +2 -2
  46. package/lib/tabs.js +2 -2
  47. package/lib/theme-chalk/index.css +1 -1
  48. package/lib/theme-chalk/layout.css +1 -0
  49. package/lib/tips.js +2 -2
  50. package/lib/toolbar.js +2 -2
  51. package/lib/tree-group.js +2 -2
  52. package/lib/tree.js +2 -2
  53. package/lib/upload.js +2 -2
  54. package/lib/wujie.js +2 -2
  55. package/lib/wxlogin.js +2 -2
  56. package/package.json +2 -1
  57. package/packages/button/src/main.vue +178 -158
  58. package/packages/form/src/main.vue +10 -6
  59. package/packages/form/src/table.vue +3 -2
  60. package/packages/layout/src/item.vue +104 -0
  61. package/packages/layout/src/main.vue +7 -2
  62. package/packages/theme-chalk/lib/index.css +1 -1
  63. package/packages/theme-chalk/lib/layout.css +1 -0
  64. package/packages/theme-chalk/src/layout.scss +44 -0
  65. package/src/index.js +1 -1
@@ -0,0 +1,104 @@
1
+ <template>
2
+ <div class="es-layout-item" ref="move" :style="defaultaStyle">
3
+ <es-card> </es-card>
4
+ <div class="es-layout-resizable-width"></div>
5
+ <div class="es-layout-resizable-height"></div>
6
+ <div class="es-layout-resizable"></div>
7
+ </div>
8
+ </template>
9
+ <script>
10
+ // import '@interactjs/auto-start';
11
+ // import '@interactjs/auto-scroll';
12
+ // import '@interactjs/actions/drag';
13
+ // import '@interactjs/actions/resize';
14
+ // import '@interactjs/modifiers';
15
+ // import '@interactjs/dev-tools';
16
+ import interact from 'interactjs';
17
+ export default {
18
+ name: 'LayoutItem',
19
+ components: {},
20
+ props: {
21
+ redact: {
22
+ type: Boolean,
23
+ default: true
24
+ },
25
+ width: {
26
+ type: String,
27
+ default: '100%'
28
+ },
29
+ height: {
30
+ type: String,
31
+ default: '100px'
32
+ },
33
+ left: String,
34
+ top: String
35
+ },
36
+ computed: {
37
+ defaultaStyle() {
38
+ return {
39
+ width: this.width,
40
+ height: this.height,
41
+ left: this.left,
42
+ top: this.top
43
+ };
44
+ },
45
+ cardStyle() {
46
+ return {
47
+ width: this.width,
48
+ height: this.height
49
+ };
50
+ }
51
+ },
52
+ watch: {},
53
+ data() {
54
+ return {
55
+ position: { x: 0, y: 0 },
56
+ move: null
57
+ };
58
+ },
59
+ created() {
60
+ this.position = {
61
+ x: parseInt(this.left) || 0,
62
+ y: parseInt(this.top) || 0
63
+ };
64
+ console.log(this.position);
65
+ },
66
+ mounted() {
67
+ console.log(interact, this.$refs.move);
68
+ this.move = interact(this.$refs.move);
69
+ this.move.draggable({
70
+ listeners: {
71
+ start: (event) => {
72
+ console.log(event.type, event.target);
73
+ },
74
+ move: (event) => {
75
+ this.position.x += event.dx;
76
+ this.position.y += event.dy;
77
+ event.target.style.transform = `translate(${this.position.x}px, ${this.position.y}px)`;
78
+ }
79
+ }
80
+ });
81
+ this.move.resizable({
82
+ edges: { top: true, left: true, bottom: true, right: true },
83
+ listeners: {
84
+ move: function (event) {
85
+ let { x, y } = event.target.dataset;
86
+
87
+ x = (parseFloat(x) || 0) + event.deltaRect.left;
88
+ y = (parseFloat(y) || 0) + event.deltaRect.top;
89
+
90
+ Object.assign(event.target.style, {
91
+ width: `${event.rect.width}px`,
92
+ height: `${event.rect.height}px`,
93
+ transform: `translate(${x}px, ${y}px)`
94
+ });
95
+
96
+ Object.assign(event.target.dataset, { x, y });
97
+ }
98
+ }
99
+ });
100
+ },
101
+ methods: {},
102
+ beforeDestroy() {}
103
+ };
104
+ </script>
@@ -1,8 +1,13 @@
1
- <template></template>
1
+ <template>
2
+ <div class="es-layout">
3
+ <layout-item></layout-item>
4
+ </div>
5
+ </template>
2
6
  <script>
7
+ import layoutItem from './item.vue';
3
8
  export default {
4
9
  name: 'EsLayout',
5
- components: {},
10
+ components: { layoutItem },
6
11
  props: {},
7
12
  computed: {},
8
13
  watch: {},