evui 3.3.47 → 3.3.48

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.3.47",
3
+ "version": "3.3.48",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
@@ -35,7 +35,7 @@ class HeatMap {
35
35
  createColorState(colorOpt) {
36
36
  const colorState = [];
37
37
  const regex = /[^0-9]&[^,]/g;
38
- const { min, max, categoryCnt, error, stroke } = colorOpt;
38
+ const { min, max, categoryCnt, categoryColors, error, stroke } = colorOpt;
39
39
 
40
40
  const minColor = min.includes('#') ? Util.hexToRgb(min) : min.replace(regex, '');
41
41
  const maxColor = max.includes('#') ? Util.hexToRgb(max) : max.replace(regex, '');
@@ -52,6 +52,17 @@ class HeatMap {
52
52
  end: 100,
53
53
  selectedValue: null,
54
54
  });
55
+ } else if (categoryColors.length) {
56
+ colorOpt.categoryCnt = categoryColors.length;
57
+ categoryColors.forEach(({ color, label }, ix) => {
58
+ colorState.push({
59
+ id: `color#${ix}`,
60
+ color,
61
+ label,
62
+ state: 'normal',
63
+ show: true,
64
+ });
65
+ });
55
66
  } else {
56
67
  const unitR = Math.floor((minR - maxR) / (categoryCnt - 1));
57
68
  const unitG = Math.floor((minG - maxG) / (categoryCnt - 1));
@@ -129,7 +129,7 @@ export default {
129
129
  getLabelStyle(style) {
130
130
  const {
131
131
  fontStyle = 'normal',
132
- fontWeight = 'norma',
132
+ fontWeight = 'normal',
133
133
  fontSize = '12',
134
134
  fontFamily = 'Roboto',
135
135
  } = style;
@@ -450,6 +450,7 @@ const modules = {
450
450
  id: `color#${categoryCnt}`,
451
451
  color: colorOpt.error,
452
452
  state: 'normal',
453
+ label: 'Error',
453
454
  show: true,
454
455
  });
455
456
  }
@@ -147,8 +147,9 @@ const modules = {
147
147
  const { min, max, interval, existError, decimalPoint } = valueOpt;
148
148
  const length = colorState.length;
149
149
  const endIndex = existError ? length - 2 : length - 1;
150
+
150
151
  for (let index = 0; index < length; index++) {
151
- const colorItem = colorState[index];
152
+ const { id, color, label = '' } = colorState[index];
152
153
  const minValue = min + (interval * index);
153
154
  let maxValue = minValue + interval;
154
155
  if (index < endIndex) {
@@ -157,24 +158,25 @@ const modules = {
157
158
  maxValue = max + (0.1 ** decimalPoint);
158
159
  }
159
160
 
160
- let name = `${minValue.toFixed(decimalPoint)} - ${maxValue.toFixed(decimalPoint)}`;
161
- if (min === undefined || max === undefined) {
162
- if (index === 0) {
163
- name = '0';
164
- } else {
161
+ let name = label;
162
+ if (!name) {
163
+ name = `${minValue.toFixed(decimalPoint)} - ${maxValue.toFixed(decimalPoint)}`;
164
+ if (min === undefined || max === undefined) {
165
+ if (index === 0) {
166
+ name = '0';
167
+ } else {
168
+ break;
169
+ }
170
+ } else if (minValue > max) {
165
171
  break;
172
+ } else if (interval <= 1 && decimalPoint === 0) {
173
+ name = minValue;
166
174
  }
167
- } else if (existError && index === endIndex + 1) {
168
- name = 'error';
169
- } else if (minValue > max) {
170
- break;
171
- } else if (interval <= 1 && decimalPoint === 0) {
172
- name = minValue;
173
175
  }
174
176
 
175
177
  this.addLegend({
176
- cId: colorItem.id,
177
- color: colorItem.color,
178
+ cId: id,
179
+ color,
178
180
  name,
179
181
  show: true,
180
182
  });
@@ -349,6 +349,7 @@ const modules = {
349
349
  const series = Object.values(this.seriesList)[0];
350
350
 
351
351
  let isShow = false;
352
+ let valueText = hitItem.formatted;
352
353
  const { colorState, isGradient } = series;
353
354
  if (isGradient) {
354
355
  const { min, max } = series.valueOpt;
@@ -356,7 +357,9 @@ const modules = {
356
357
  const { start, end } = colorState[0];
357
358
  isShow = (start <= ratio && ratio <= end) || hitItem.o === -1;
358
359
  } else {
359
- isShow = colorState.find(({ id }) => id === hitItem.cId)?.show;
360
+ const colorItem = colorState.find(({ id }) => id === hitItem.cId);
361
+ isShow = colorItem?.show;
362
+ valueText = colorItem?.label ?? valueText;
360
363
  }
361
364
 
362
365
  if (!isShow) {
@@ -392,7 +395,6 @@ const modules = {
392
395
 
393
396
  const itemX = boxPadding.l + 2;
394
397
  const itemY = boxPadding.t + TEXT_HEIGHT + 2;
395
- const valueText = hitItem.formatted;
396
398
 
397
399
  ctx.font = fontStyle;
398
400
 
@@ -197,6 +197,7 @@ const DEFAULT_OPTIONS = {
197
197
  min: '#FFFFFF',
198
198
  max: '#0052FF',
199
199
  categoryCnt: 1,
200
+ categoryColors: [],
200
201
  stroke: {
201
202
  show: false,
202
203
  color: '#FFFFFF',
@@ -33,13 +33,13 @@
33
33
  <div>
34
34
  <!--Level Depth-->
35
35
  <span
36
- v-if="cellIndex === 0"
36
+ v-if="cellIndex === expandColumnIdx"
37
37
  :style="getDepthStyle(node.level)"
38
38
  >
39
39
  </span>
40
40
  <!--Expand Icon-->
41
41
  <span
42
- v-if="cellIndex === 0"
42
+ v-if="cellIndex === expandColumnIdx"
43
43
  :class="{
44
44
  expand: node.expand,
45
45
  'ev-tree-toggle': true
@@ -63,7 +63,7 @@
63
63
  </span>
64
64
  <!--Data Icon-->
65
65
  <span
66
- v-if="cellIndex === 0 && isDataIcon"
66
+ v-if="cellIndex === expandColumnIdx && isDataIcon"
67
67
  :title="node[column.field]"
68
68
  :class="{
69
69
  expand: node.expand,
@@ -179,6 +179,10 @@ export default {
179
179
  const childIconMV = computed(() => (props.childIcon || 'tree-child-icon'));
180
180
  const isDataIcon = computed(() => ((parentIconMV.value !== 'none' || childIconMV.value !== 'none')));
181
181
 
182
+ const expandColumnIdx = computed(() => {
183
+ const expandColumnIndex = props.orderedColumns.findIndex(v => v.expandColumn);
184
+ return expandColumnIndex > 0 ? expandColumnIndex : 0;
185
+ });
182
186
  const getRowClass = nodeInfo => ({
183
187
  row: true,
184
188
  'tree-row': true,
@@ -217,6 +221,7 @@ export default {
217
221
  node,
218
222
  isDataIcon,
219
223
  checkboxClass,
224
+ expandColumnIdx,
220
225
  onCheck,
221
226
  onExpand,
222
227
  onClick,