evui 3.4.88 → 3.4.89
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/dist/evui.common.js +94 -76
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +94 -76
- package/dist/evui.umd.js.map +1 -1
- package/dist/evui.umd.min.js +1 -1
- package/dist/evui.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/chart/element/element.line.js +3 -3
- package/src/components/chart/helpers/helpers.constant.js +1 -0
- package/src/components/textField/TextField.vue +32 -14
package/package.json
CHANGED
|
@@ -77,7 +77,7 @@ class Line {
|
|
|
77
77
|
const mainColorOpacity = getOpacity(mainColor);
|
|
78
78
|
const pointFillColor = this.pointFill;
|
|
79
79
|
const pointFillColorOpacity = getOpacity(pointFillColor);
|
|
80
|
-
const fillOpacity =
|
|
80
|
+
const fillOpacity = this.fillOpacity;
|
|
81
81
|
const lineWidth = this.lineWidth * extent.lineWidth;
|
|
82
82
|
|
|
83
83
|
ctx.beginPath();
|
|
@@ -163,7 +163,7 @@ class Line {
|
|
|
163
163
|
if (this.fill && this.data.length) {
|
|
164
164
|
ctx.beginPath();
|
|
165
165
|
|
|
166
|
-
const fillColor = Util.colorStringToRgba(mainColor, fillOpacity);
|
|
166
|
+
const fillColor = Util.colorStringToRgba(this.fillColor || mainColor, fillOpacity);
|
|
167
167
|
if (this.fill?.gradient) {
|
|
168
168
|
let maxValueYPos = this.data[0].yp;
|
|
169
169
|
let minValueYBottomPos = this.data[0].y;
|
|
@@ -283,7 +283,7 @@ class Line {
|
|
|
283
283
|
const { xp, yp, o } = gdata;
|
|
284
284
|
|
|
285
285
|
ctx.save();
|
|
286
|
-
if (xp !== null && yp !== null && o !== this.passingValue) {
|
|
286
|
+
if (xp !== null && yp !== null && o !== this.passingValue && this.pointHighlight) {
|
|
287
287
|
ctx.strokeStyle = Util.colorStringToRgba(this.color, 0);
|
|
288
288
|
ctx.fillStyle = Util.colorStringToRgba(this.color, this.highlight.maxShadowOpacity);
|
|
289
289
|
Canvas.drawPoint(ctx, this.pointStyle, this.highlight.maxShadowSize, xp, yp);
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
:placeholder="placeholder"
|
|
27
27
|
:disabled="disabled"
|
|
28
28
|
:readonly="readonly"
|
|
29
|
-
:maxlength="maxLength"
|
|
30
29
|
:autocomplete="autocomplete"
|
|
30
|
+
:maxlength="maxUnit === 'byte' ? null : maxLength"
|
|
31
31
|
@focus="focusInput"
|
|
32
32
|
@blur="blurInput"
|
|
33
33
|
@input="inputMv"
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
:placeholder="placeholder"
|
|
43
43
|
:disabled="disabled"
|
|
44
44
|
:readonly="readonly"
|
|
45
|
-
:maxlength="maxLength"
|
|
46
45
|
:autocomplete="autocomplete"
|
|
46
|
+
:maxlength="maxUnit === 'byte' ? null : maxLength"
|
|
47
47
|
@focus="focusInput"
|
|
48
48
|
@blur="blurInput"
|
|
49
49
|
@input="inputMv"
|
|
@@ -95,15 +95,16 @@
|
|
|
95
95
|
<div
|
|
96
96
|
v-if="maxLength && showMaxLength"
|
|
97
97
|
class="ev-text-field-maxlength"
|
|
98
|
-
:class="{ max:
|
|
98
|
+
:class="{ max: currentLength > maxLength }"
|
|
99
99
|
>
|
|
100
|
-
<span class="curr-length">{{
|
|
100
|
+
<span class="curr-length">{{ currentLength }}</span> / {{ maxLength
|
|
101
|
+
}}{{ maxUnit === 'byte' ? ' Bytes' : '' }}
|
|
101
102
|
</div>
|
|
102
103
|
</div>
|
|
103
104
|
</template>
|
|
104
105
|
|
|
105
106
|
<script>
|
|
106
|
-
import { ref, computed
|
|
107
|
+
import { ref, computed } from 'vue';
|
|
107
108
|
|
|
108
109
|
export default {
|
|
109
110
|
name: 'EvTextField',
|
|
@@ -140,6 +141,10 @@ export default {
|
|
|
140
141
|
type: Number,
|
|
141
142
|
default: null,
|
|
142
143
|
},
|
|
144
|
+
maxUnit: {
|
|
145
|
+
type: String,
|
|
146
|
+
default: 'count',
|
|
147
|
+
},
|
|
143
148
|
showMaxLength: {
|
|
144
149
|
type: Boolean,
|
|
145
150
|
default: false,
|
|
@@ -206,19 +211,31 @@ export default {
|
|
|
206
211
|
const blurInput = (e) => {
|
|
207
212
|
emit('blur', e);
|
|
208
213
|
};
|
|
214
|
+
|
|
215
|
+
const getByteLength = text => new TextEncoder().encode(text).length;
|
|
216
|
+
|
|
217
|
+
const currentLength = computed(() =>
|
|
218
|
+
(props.maxUnit === 'byte'
|
|
219
|
+
? getByteLength(mv.value || '')
|
|
220
|
+
: (mv.value || '').length),
|
|
221
|
+
);
|
|
222
|
+
|
|
209
223
|
const inputMv = (e) => {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
224
|
+
let value = e.target.value;
|
|
225
|
+
|
|
226
|
+
if (props.maxLength && props.maxUnit === 'byte') {
|
|
227
|
+
while (getByteLength(value) > props.maxLength) {
|
|
228
|
+
value = value.slice(0, -1);
|
|
229
|
+
}
|
|
230
|
+
e.target.value = value;
|
|
213
231
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
};
|
|
218
|
-
const changeMv = (e) => {
|
|
219
|
-
emit('change', mv.value, e);
|
|
232
|
+
|
|
233
|
+
mv.value = value;
|
|
234
|
+
emit('input', value, e);
|
|
220
235
|
};
|
|
221
236
|
|
|
237
|
+
const changeMv = e => emit('change', mv.value, e);
|
|
238
|
+
|
|
222
239
|
return {
|
|
223
240
|
mv,
|
|
224
241
|
inputType,
|
|
@@ -231,6 +248,7 @@ export default {
|
|
|
231
248
|
blurInput,
|
|
232
249
|
inputMv,
|
|
233
250
|
changeMv,
|
|
251
|
+
currentLength,
|
|
234
252
|
};
|
|
235
253
|
},
|
|
236
254
|
};
|