evui 3.4.61 → 3.4.63
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 +65 -26
- package/dist/evui.common.js.map +1 -1
- package/dist/evui.umd.js +65 -26
- 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/plugins/plugins.interaction.js +4 -0
- package/src/components/chart/scale/scale.js +9 -3
- package/src/components/chart/scale/scale.linear.js +3 -3
- package/src/components/chart/scale/scale.logarithmic.js +6 -4
- package/src/components/chart/scale/scale.step.js +3 -2
- package/src/components/chart/scale/scale.time.category.js +15 -5
- package/src/components/chart/scale/scale.time.js +3 -3
- package/src/components/grid/uses.js +4 -4
package/package.json
CHANGED
|
@@ -100,7 +100,9 @@ class Scale {
|
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
const minLabel = this.getLabelFormat(minValue);
|
|
103
|
-
const maxLabel = this.getLabelFormat(maxValue,
|
|
103
|
+
const maxLabel = this.getLabelFormat(maxValue, {
|
|
104
|
+
isMaxValueSameAsMin: isDefaultMaxSameAsMin,
|
|
105
|
+
});
|
|
104
106
|
|
|
105
107
|
return {
|
|
106
108
|
min: minValue,
|
|
@@ -319,14 +321,18 @@ class Scale {
|
|
|
319
321
|
ticks[ix] = axisMinForLabel + (ix * stepValue);
|
|
320
322
|
|
|
321
323
|
linePosition = labelCenter + aliasPixel;
|
|
322
|
-
labelText = this.getLabelFormat(Math.min(axisMax, ticks[ix])
|
|
324
|
+
labelText = this.getLabelFormat(Math.min(axisMax, ticks[ix]), {
|
|
325
|
+
prev: ticks[ix - 1] ?? '',
|
|
326
|
+
});
|
|
323
327
|
|
|
324
328
|
const isBlurredLabel = this.options?.selectLabel?.use
|
|
325
329
|
&& this.options?.selectLabel?.useLabelOpacity
|
|
326
330
|
&& (this.options.horizontal === (this.type === 'y'))
|
|
327
331
|
&& selectLabelInfo?.dataIndex?.length
|
|
328
332
|
&& !selectLabelInfo?.label
|
|
329
|
-
.map(t => this.getLabelFormat(Math.min(axisMax, t)
|
|
333
|
+
.map((t, index) => this.getLabelFormat(Math.min(axisMax, t), {
|
|
334
|
+
prev: selectLabelInfo?.label[index - 1] ?? '',
|
|
335
|
+
})).includes(labelText);
|
|
330
336
|
|
|
331
337
|
const labelColor = this.labelStyle.color;
|
|
332
338
|
let defaultOpacity = 1;
|
|
@@ -5,13 +5,13 @@ class LinearScale extends Scale {
|
|
|
5
5
|
/**
|
|
6
6
|
* Transforming label by designated format
|
|
7
7
|
* @param {number} value label value
|
|
8
|
-
* @param {
|
|
8
|
+
* @param {object} data data for formatting
|
|
9
9
|
*
|
|
10
10
|
* @returns {string} formatted label
|
|
11
11
|
*/
|
|
12
|
-
getLabelFormat(value,
|
|
12
|
+
getLabelFormat(value, data = {}) {
|
|
13
13
|
if (this.formatter) {
|
|
14
|
-
const formattedLabel = this.formatter(value,
|
|
14
|
+
const formattedLabel = this.formatter(value, data);
|
|
15
15
|
|
|
16
16
|
if (typeof formattedLabel === 'string') {
|
|
17
17
|
return formattedLabel;
|
|
@@ -33,7 +33,9 @@ class LogarithmicScale extends Scale {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
const minLabel = this.getLabelFormat(minValue);
|
|
36
|
-
const maxLabel = this.getLabelFormat(maxValue,
|
|
36
|
+
const maxLabel = this.getLabelFormat(maxValue, {
|
|
37
|
+
isMaxValueSameAsMin: isDefaultMaxSameAsMin,
|
|
38
|
+
});
|
|
37
39
|
|
|
38
40
|
return {
|
|
39
41
|
min: minValue,
|
|
@@ -99,13 +101,13 @@ class LogarithmicScale extends Scale {
|
|
|
99
101
|
/**
|
|
100
102
|
* Transforming label by designated format
|
|
101
103
|
* @param {number} value label value
|
|
102
|
-
* @param {
|
|
104
|
+
* @param {object} data data for formatting
|
|
103
105
|
*
|
|
104
106
|
* @returns {string} formatted label
|
|
105
107
|
*/
|
|
106
|
-
getLabelFormat(value,
|
|
108
|
+
getLabelFormat(value, data = {}) {
|
|
107
109
|
if (this.formatter) {
|
|
108
|
-
const formattedLabel = this.formatter(value,
|
|
110
|
+
const formattedLabel = this.formatter(value, data);
|
|
109
111
|
|
|
110
112
|
if (typeof formattedLabel === 'string') {
|
|
111
113
|
return formattedLabel;
|
|
@@ -347,12 +347,13 @@ class StepScale extends Scale {
|
|
|
347
347
|
* Transforming label by designated format
|
|
348
348
|
* @param {string} value label value
|
|
349
349
|
* @param {number} maxWidth max width for each label
|
|
350
|
+
* @param {object} data data for formatting
|
|
350
351
|
*
|
|
351
352
|
* @returns {string} formatted label
|
|
352
353
|
*/
|
|
353
|
-
getLabelFormat(value, maxWidth) {
|
|
354
|
+
getLabelFormat(value, maxWidth, data = {}) {
|
|
354
355
|
if (this.formatter) {
|
|
355
|
-
const formattedLabel = this.formatter(value);
|
|
356
|
+
const formattedLabel = this.formatter(value, data);
|
|
356
357
|
|
|
357
358
|
if (typeof formattedLabel === 'string') {
|
|
358
359
|
return formattedLabel;
|
|
@@ -13,13 +13,13 @@ class TimeCategoryScale extends Scale {
|
|
|
13
13
|
/**
|
|
14
14
|
* Transforming label by designated format
|
|
15
15
|
* @param {number} value label value
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {object} data data for formatting
|
|
17
17
|
*
|
|
18
18
|
* @returns {string} formatted label
|
|
19
19
|
*/
|
|
20
|
-
getLabelFormat(value,
|
|
20
|
+
getLabelFormat(value, data = {}) {
|
|
21
21
|
if (this.formatter) {
|
|
22
|
-
const formattedLabel = this.formatter(value,
|
|
22
|
+
const formattedLabel = this.formatter(value, data);
|
|
23
23
|
|
|
24
24
|
if (typeof formattedLabel === 'string') {
|
|
25
25
|
return formattedLabel;
|
|
@@ -187,14 +187,24 @@ class TimeCategoryScale extends Scale {
|
|
|
187
187
|
|
|
188
188
|
labelCenter = Math.round(startPoint + (graphGap * ix));
|
|
189
189
|
linePosition = labelCenter + aliasPixel;
|
|
190
|
-
|
|
190
|
+
|
|
191
|
+
let prev;
|
|
192
|
+
for (let jx = 0; jx < ticks.length; jx++) {
|
|
193
|
+
if (ticks[jx] !== undefined && jx !== ix) {
|
|
194
|
+
prev = ticks[jx];
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
labelText = this.getLabelFormat(Math.min(axisMax, ticks[ix]), { prev });
|
|
191
199
|
|
|
192
200
|
const isBlurredLabel = this.options?.selectLabel?.use
|
|
193
201
|
&& this.options?.selectLabel?.useLabelOpacity
|
|
194
202
|
&& (this.options.horizontal === (this.type === 'y'))
|
|
195
203
|
&& selectLabelInfo?.dataIndex?.length
|
|
196
204
|
&& !selectLabelInfo?.label
|
|
197
|
-
.map(t => this.getLabelFormat(Math.min(axisMax, t)
|
|
205
|
+
.map((t, index) => this.getLabelFormat(Math.min(axisMax, t), {
|
|
206
|
+
prev: selectLabelInfo?.label[index - 1] ?? '',
|
|
207
|
+
})).includes(labelText);
|
|
198
208
|
|
|
199
209
|
const labelColor = this.labelStyle.color;
|
|
200
210
|
let defaultOpacity = 1;
|
|
@@ -6,13 +6,13 @@ class TimeScale extends Scale {
|
|
|
6
6
|
/**
|
|
7
7
|
* Transforming label by designated format
|
|
8
8
|
* @param {number} value label value
|
|
9
|
-
* @param {
|
|
9
|
+
* @param {object} data data for formatting
|
|
10
10
|
*
|
|
11
11
|
* @returns {string} formatted label
|
|
12
12
|
*/
|
|
13
|
-
getLabelFormat(value,
|
|
13
|
+
getLabelFormat(value, data = {}) {
|
|
14
14
|
if (this.formatter) {
|
|
15
|
-
const formattedLabel = this.formatter(value,
|
|
15
|
+
const formattedLabel = this.formatter(value, data);
|
|
16
16
|
|
|
17
17
|
if (typeof formattedLabel === 'string') {
|
|
18
18
|
return formattedLabel;
|
|
@@ -1180,13 +1180,13 @@ export const contextMenuEvent = (params) => {
|
|
|
1180
1180
|
});
|
|
1181
1181
|
},
|
|
1182
1182
|
disabled: !filterable,
|
|
1183
|
-
hidden: contextInfo.hiddenColumnMenuItem?.filter,
|
|
1183
|
+
hidden: contextInfo.hiddenColumnMenuItem?.filter || !filterInfo.isFiltering,
|
|
1184
1184
|
},
|
|
1185
1185
|
{
|
|
1186
1186
|
text: contextInfo.columnMenuTextInfo?.hide ?? 'Hide',
|
|
1187
1187
|
iconClass: 'ev-icon-visibility-off',
|
|
1188
|
-
disabled:
|
|
1189
|
-
hidden: contextInfo.hiddenColumnMenuItem?.hide,
|
|
1188
|
+
disabled: !useGridSetting.value || stores.orderedColumns.length === 1 || column.fixed,
|
|
1189
|
+
hidden: contextInfo.hiddenColumnMenuItem?.hide || !useGridSetting.value,
|
|
1190
1190
|
click: () => {
|
|
1191
1191
|
setColumnHidden(column.field);
|
|
1192
1192
|
emit('change-column-status', {
|
|
@@ -1201,7 +1201,7 @@ export const contextMenuEvent = (params) => {
|
|
|
1201
1201
|
},
|
|
1202
1202
|
];
|
|
1203
1203
|
contextInfo.columnMenuItems = [];
|
|
1204
|
-
if (!sortable && !filterable) {
|
|
1204
|
+
if (!sortable && !filterable && !useGridSetting.value) {
|
|
1205
1205
|
return;
|
|
1206
1206
|
}
|
|
1207
1207
|
contextInfo.columnMenuItems = columnMenuItems.filter(item => !item.hidden);
|