evui 3.3.18 → 3.3.21

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.
@@ -81,12 +81,12 @@ const modules = {
81
81
 
82
82
  Object.values(seriesList).forEach((series) => {
83
83
  if (!series.isExistGrp && series.showLegend) {
84
- const { colorAxis, valueOpt } = series;
84
+ const { colorState, valueOpt } = series;
85
85
  const { min, max, interval, existError, decimalPoint } = valueOpt;
86
- const length = colorAxis.length;
86
+ const length = colorState.length;
87
87
  const endIndex = existError ? length - 2 : length - 1;
88
88
  for (let index = 0; index < length; index++) {
89
- const colorItem = colorAxis[index];
89
+ const colorItem = colorState[index];
90
90
  const minValue = min + (interval * index);
91
91
  let maxValue = minValue + interval;
92
92
  if (index < endIndex) {
@@ -112,7 +112,7 @@ const modules = {
112
112
 
113
113
  this.addLegend({
114
114
  cId: colorItem.id,
115
- color: colorItem.value,
115
+ color: colorItem.color,
116
116
  name,
117
117
  });
118
118
  }
@@ -292,7 +292,7 @@ const modules = {
292
292
  const nameDOM = targetDOM?.getElementsByClassName('ev-chart-legend-name')[0];
293
293
  const isActive = !colorDOM?.className.includes('inactive');
294
294
  const targetId = nameDOM.series.cId;
295
- const activeCount = series.colorAxis.filter(colorItem => colorItem.show).length;
295
+ const activeCount = series.colorState.filter(colorItem => colorItem.show).length;
296
296
 
297
297
  if (isActive && activeCount === 1) {
298
298
  return;
@@ -311,9 +311,9 @@ const modules = {
311
311
  nameDOM.style.color = opt.color;
312
312
  }
313
313
 
314
- const targetIndex = series.colorAxis.findIndex(colorItem => colorItem.id === targetId);
314
+ const targetIndex = series.colorState.findIndex(colorItem => colorItem.id === targetId);
315
315
  if (targetIndex > -1) {
316
- series.colorAxis[targetIndex].show = !isActive;
316
+ series.colorState[targetIndex].show = !isActive;
317
317
  }
318
318
 
319
319
  colorDOM.classList.toggle('inactive');
@@ -344,7 +344,7 @@ const modules = {
344
344
  const nameDOM = targetDOM.getElementsByClassName('ev-chart-legend-name')[0];
345
345
  const targetId = nameDOM.series.cId;
346
346
 
347
- series.colorAxis.forEach((colorItem) => {
347
+ series.colorState.forEach((colorItem) => {
348
348
  colorItem.state = colorItem.id === targetId ? 'highlight' : 'downplay';
349
349
  });
350
350
 
@@ -361,7 +361,7 @@ const modules = {
361
361
  */
362
362
  this.onLegendBoxLeave = () => {
363
363
  const series = Object.values(this.seriesList)[0];
364
- series.colorAxis.forEach((item) => {
364
+ series.colorState.forEach((item) => {
365
365
  item.state = 'normal';
366
366
  });
367
367
 
@@ -510,6 +510,7 @@ const modules = {
510
510
  }
511
511
  containerDOM.style.height = '18px';
512
512
  containerDOM.style.display = 'inline-block';
513
+ containerDOM.style.overflow = 'hidden';
513
514
  containerDOM.dataset.type = 'container';
514
515
 
515
516
  this.legendBoxDOM.appendChild(containerDOM);
@@ -530,6 +531,7 @@ const modules = {
530
531
  const resizeStyle = this.resizeDOM?.style;
531
532
 
532
533
  let chartRect;
534
+ let legendPad;
533
535
  const title = opt?.title?.show ? opt?.title?.height : 0;
534
536
  const positionTop = title + opt?.legend?.height;
535
537
  const { top = 0, bottom = 0, left = 0, right = 0 } = opt?.legend?.padding ?? {};
@@ -544,9 +546,10 @@ const modules = {
544
546
  case 'top':
545
547
  wrapperStyle.padding = `${positionTop}px 0 0 0`;
546
548
  chartRect = this.chartDOM.getBoundingClientRect();
549
+ legendPad = parseInt(legendStyle.paddingTop) + parseInt(legendStyle.paddingBottom);
547
550
 
548
551
  boxStyle.width = '100%';
549
- boxStyle.height = `${opt.legend.height}px`;
552
+ boxStyle.height = `${opt.legend.height - legendPad}px`;
550
553
 
551
554
  legendStyle.top = `${title}px`;
552
555
  legendStyle.right = '';
@@ -554,7 +557,7 @@ const modules = {
554
557
  legendStyle.left = '';
555
558
 
556
559
  legendStyle.width = `${chartRect.width}px`;
557
- legendStyle.height = `${opt.legend.height + 4}px`; // 4 resize bar size
560
+ legendStyle.height = `${opt.legend.height + (resizeStyle ? 4 : 0)}px`; // 4 resize bar size
558
561
 
559
562
  if (resizeStyle) {
560
563
  resizeStyle.top = `${positionTop}px`;
@@ -597,9 +600,10 @@ const modules = {
597
600
  case 'bottom':
598
601
  wrapperStyle.padding = `${title}px 0 ${opt.legend.height}px 0`;
599
602
  chartRect = this.chartDOM.getBoundingClientRect();
603
+ legendPad = parseInt(legendStyle.paddingTop) + parseInt(legendStyle.paddingBottom);
600
604
 
601
605
  boxStyle.width = '100%';
602
- boxStyle.height = `${opt.legend.height}px`;
606
+ boxStyle.height = `${opt.legend.height - legendPad}px`;
603
607
 
604
608
  legendStyle.top = '';
605
609
  legendStyle.right = '';
@@ -607,7 +611,7 @@ const modules = {
607
611
  legendStyle.left = '0px';
608
612
 
609
613
  legendStyle.width = `${chartRect.width}px`;
610
- legendStyle.height = `${opt.legend.height + 4}px`; // 4 resize bar size
614
+ legendStyle.height = `${opt.legend.height + (resizeStyle ? 4 : 0)}px`; // 4 resize bar size
611
615
 
612
616
  if (resizeStyle) {
613
617
  resizeStyle.top = '';
@@ -3,6 +3,7 @@ import debounce from '@/common/utils.debounce';
3
3
  import dayjs from 'dayjs';
4
4
  import Canvas from '../helpers/helpers.canvas';
5
5
  import Util from '../helpers/helpers.util';
6
+ import { convertToPercent } from '../../../common/utils';
6
7
 
7
8
  const TITLE_HEIGHT = 30;
8
9
  const TEXT_HEIGHT = 14;
@@ -367,9 +368,19 @@ const modules = {
367
368
  const opt = this.options.tooltip;
368
369
  const valueFormatter = typeof opt.formatter === 'function' ? opt.formatter : opt.formatter?.value;
369
370
  const titleFormatter = opt.formatter?.title;
371
+ const series = Object.values(this.seriesList)[0];
372
+
373
+ let isShow = false;
374
+ const { colorState, isGradient } = series;
375
+ if (isGradient) {
376
+ const { min, max } = series.valueOpt;
377
+ const ratio = convertToPercent(hitItem.o - min, max - min);
378
+ const { start, end } = colorState[0];
379
+ isShow = (start <= ratio && ratio <= end) || hitItem.o === -1;
380
+ } else {
381
+ isShow = colorState.find(({ id }) => id === hitItem.cId)?.show;
382
+ }
370
383
 
371
- const colorAxis = Object.values(this.seriesList)[0].colorAxis;
372
- const isShow = colorAxis.find(({ id }) => id === hitItem.cId)?.show;
373
384
  if (!isShow) {
374
385
  this.tooltipClear();
375
386
  return;
@@ -48,11 +48,16 @@ class StepScale extends Scale {
48
48
  if (this.rangeMode) {
49
49
  const { maxSteps } = range;
50
50
 
51
- while (numberOfSteps > maxSteps * 2) {
52
- interval *= 2;
53
- numberOfSteps = Math.round(numberOfSteps / interval);
51
+ if (maxSteps > 2) {
52
+ while (numberOfSteps > maxSteps * 2) {
53
+ interval *= 2;
54
+ numberOfSteps = Math.round(numberOfSteps / interval);
55
+ }
56
+ } else {
57
+ interval = this.labels.length;
54
58
  }
55
59
  }
60
+
56
61
  return {
57
62
  steps: numberOfSteps,
58
63
  interval,
@@ -39,7 +39,6 @@
39
39
 
40
40
  .ev-chart-legend-container {
41
41
  position: relative;
42
- overflow: hidden;
43
42
  }
44
43
 
45
44
  .ev-chart-legend-color {
@@ -96,6 +95,97 @@
96
95
  overflow: hidden;
97
96
  }
98
97
 
98
+ .ev-chart-legend-line {
99
+ position: relative;
100
+ width: 100%;
101
+ height: 100%;
102
+ border-radius: 10px;
103
+ background-color: #E3E3E3;
104
+
105
+ &-layer {
106
+ position: absolute;
107
+ top: 0;
108
+ left: 0;
109
+ width: 100%;
110
+ height: 100%;
111
+ }
112
+ }
113
+
114
+ .ev-chart-legend-thumb {
115
+ position: absolute;
116
+ top: 0;
117
+ left: 0;
118
+ width: 100%;
119
+ height: 100%;
120
+ border-radius: 10px;
121
+ color: #000000;
122
+ }
123
+
124
+ .ev-chart-legend-handle {
125
+ position: absolute;
126
+ top: 0;
127
+ left: 0;
128
+ cursor: pointer;
129
+
130
+ &.dragging,
131
+ &:hover {
132
+ transform: scale(1.2);
133
+ }
134
+
135
+ &-btn {
136
+ width: 100%;
137
+ height: 100%;
138
+ border-radius: 50%;
139
+ background-color: $color-white;
140
+ transition: transform 0.1s ease-in-out;
141
+ box-sizing: border-box;
142
+ border: 2px solid #979797;
143
+
144
+ &-color {
145
+ position: absolute;
146
+ top: 4px;
147
+ left: 4px;
148
+ width: calc(100% - 8px);
149
+ height: calc(100% - 8px);
150
+ border-radius: 50%;
151
+ }
152
+ }
153
+ }
154
+
155
+ .ev-chart-legend-label {
156
+ position: absolute;
157
+ font-size: 12px;
158
+ line-height: 1.4em;
159
+
160
+ &-text {
161
+ display: block;
162
+ white-space: nowrap;
163
+ }
164
+ }
165
+
166
+ .ev-chart-legend-overlay {
167
+ position: absolute;
168
+ top: 0;
169
+ left: 0;
170
+ width: 100%;
171
+ height: 100%;
172
+
173
+ .ev-chart-legend-overlay-item {
174
+ position: absolute;
175
+ top: 1px;
176
+ left: 1px;
177
+ border-radius: 50%;
178
+ border: 1px solid #FFFFFF;
179
+ background-color: transparent;
180
+ }
181
+
182
+ .ev-chart-legend-overlay-tooltip {
183
+ position: absolute;
184
+ font-size: 12px;
185
+ line-height: 1.4em;
186
+ }
187
+ }
188
+
99
189
  .ev-chart-resize-bar {
100
190
  position: absolute;
101
191
  background: transparent;
@@ -22,6 +22,7 @@ const DEFAULT_OPTIONS = {
22
22
  },
23
23
  legend: {
24
24
  show: true,
25
+ type: 'icon',
25
26
  position: 'right',
26
27
  color: '#353740',
27
28
  inactive: '#aaa',
@@ -109,12 +110,13 @@ const DEFAULT_OPTIONS = {
109
110
  heatMapColor: {
110
111
  min: '#FFFFFF',
111
112
  max: '#0052FF',
112
- categoryCnt: 5,
113
+ categoryCnt: 1,
113
114
  stroke: {
114
115
  show: false,
115
116
  color: '#FFFFFF',
116
117
  lineWidth: 1,
117
118
  opacity: 1,
119
+ radius: 0,
118
120
  },
119
121
  error: '#FF0000',
120
122
  decimalPoint: 0,
@@ -118,10 +118,11 @@
118
118
  >
119
119
  <input
120
120
  v-if="filterable"
121
- v-model="filterTextRef"
122
121
  type="text"
123
122
  class="ev-input-query"
124
123
  :placeholder="searchPlaceholder"
124
+ :value="filterTextRef"
125
+ @input="changeFilterText"
125
126
  />
126
127
  <div
127
128
  ref="itemWrapper"
@@ -242,6 +243,7 @@ export default {
242
243
  filteredItems,
243
244
  clickSelectInput,
244
245
  clickOutsideDropbox,
246
+ changeFilterText,
245
247
  changeDropboxPosition,
246
248
  clickItem,
247
249
  selectedItemClass,
@@ -266,6 +268,7 @@ export default {
266
268
  filteredItems,
267
269
  clickSelectInput,
268
270
  clickOutsideDropbox,
271
+ changeFilterText,
269
272
  changeDropboxPosition,
270
273
  clickItem,
271
274
  selectedItemClass,
@@ -127,6 +127,13 @@ export const useDropdown = (param) => {
127
127
  return props.items.filter(v => v.name.toUpperCase().includes(trimText.toUpperCase())) || [];
128
128
  });
129
129
 
130
+ /**
131
+ * filterable 에서 text input 이벤트 핸들러
132
+ */
133
+ const changeFilterText = (e) => {
134
+ filterTextRef.value = e?.target?.value;
135
+ };
136
+
130
137
  /**
131
138
  * dropdown box 위치 변경하는 메소드
132
139
  */
@@ -255,6 +262,7 @@ export const useDropdown = (param) => {
255
262
  filteredItems,
256
263
  clickSelectInput,
257
264
  clickOutsideDropbox,
265
+ changeFilterText,
258
266
  changeDropboxPosition,
259
267
  clickItem,
260
268
  selectedItemClass,
@@ -524,6 +524,7 @@ export default {
524
524
  };
525
525
  const setParentShow = (data) => {
526
526
  if (!data?.parent) {
527
+ setChildShow(data);
527
528
  return;
528
529
  }
529
530
  const { parent } = data;