evui 3.1.54 → 3.1.55

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "evui",
3
- "version": "3.1.54",
3
+ "version": "3.1.55",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
@@ -175,7 +175,7 @@ const modules = {
175
175
  * @returns {undefined}
176
176
  */
177
177
  dragStart(evt, type) {
178
- const [offsetX, offsetY] = this.getMousePosition(evt);
178
+ let [offsetX, offsetY] = this.getMousePosition(evt);
179
179
  const chartRect = this.chartRect;
180
180
  const labelOffset = this.labelOffset;
181
181
  const range = {
@@ -185,11 +185,20 @@ const modules = {
185
185
  y2: chartRect.y2 - labelOffset.bottom,
186
186
  };
187
187
 
188
- // check graph range
189
- if (offsetX < range.x1 || offsetX > range.x2
190
- || offsetY < range.y1 || offsetY > range.y2
191
- ) {
192
- return;
188
+ if (offsetX < range.x1) {
189
+ offsetX = range.x1;
190
+ }
191
+
192
+ if (offsetX > range.x2) {
193
+ offsetX = range.x2;
194
+ }
195
+
196
+ if (offsetY < range.y1) {
197
+ offsetY = range.y1;
198
+ }
199
+
200
+ if (offsetY > range.y2) {
201
+ offsetY = range.y2;
193
202
  }
194
203
 
195
204
  this.dragInfo = {
@@ -219,11 +219,11 @@ const modules = {
219
219
  let prev = a.data.o;
220
220
  let next = b.data.o;
221
221
 
222
- if (!prev) {
222
+ if (prev === null || prev === undefined) {
223
223
  prev = isHorizontal ? a.data.x : a.data.y;
224
224
  }
225
225
 
226
- if (!next) {
226
+ if (next === null || next === undefined) {
227
227
  next = isHorizontal ? b.data.x : b.data.y;
228
228
  }
229
229
  return next - prev;
@@ -4,6 +4,7 @@
4
4
  :class="{
5
5
  checked: modelValue,
6
6
  disabled,
7
+ readonly,
7
8
  }"
8
9
  :style="{
9
10
  width: `${width}px`,
@@ -24,6 +25,10 @@ export default {
24
25
  type: Boolean,
25
26
  default: false,
26
27
  },
28
+ readonly: {
29
+ type: Boolean,
30
+ default: false,
31
+ },
27
32
  disabled: {
28
33
  type: Boolean,
29
34
  default: false,
@@ -51,7 +56,7 @@ export default {
51
56
  },
52
57
  });
53
58
  const clickMv = () => {
54
- if (!props.disabled) {
59
+ if (!props.disabled && !props.readonly) {
55
60
  mv.value = !mv.value;
56
61
  }
57
62
  };
@@ -95,12 +100,14 @@ export default {
95
100
  left: calc(100% - 17px);
96
101
  }
97
102
 
98
- &.disabled {
103
+ &.readonly {
99
104
  opacity: .6;
105
+ cursor: default;
106
+ }
100
107
 
101
- &:hover {
102
- cursor: not-allowed;
103
- }
108
+ &.disabled {
109
+ opacity: .6;
110
+ cursor: not-allowed;
104
111
  }
105
112
  }
106
113