evui 3.4.102 → 3.4.104

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,12 +1,9 @@
1
1
  {
2
2
  "name": "evui",
3
- "version": "3.4.102",
3
+ "version": "3.4.104",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
7
- "engines": {
8
- "node": "<=12.0.0"
9
- },
10
7
  "scripts": {
11
8
  "serve": "vue-cli-service serve",
12
9
  "build": "vue-cli-service build",
@@ -126,7 +126,9 @@ class TimeCategoryScale extends Scale {
126
126
  const axisMax = stepInfo.graphMax;
127
127
  const stepValue = stepInfo.rawInterval;
128
128
  const oriSteps = stepInfo.oriSteps;
129
- const count = Math.round(oriSteps / steps);
129
+
130
+ // 2개 이하일 경우, 첫번째와 마지막 라벨만 표시
131
+ const count = steps <= 2 ? oriSteps : Math.round(oriSteps / steps);
130
132
 
131
133
  let startPoint = aPos[this.units.rectStart];
132
134
  const endPoint = aPos[this.units.rectEnd];
@@ -182,7 +184,8 @@ class TimeCategoryScale extends Scale {
182
184
  let labelText;
183
185
  let labelPoint;
184
186
  let ix;
185
- for (ix = 0; ix < oriSteps; ix += count) {
187
+ const maxIndex = oriSteps === count ? oriSteps : oriSteps - 1;
188
+ for (ix = 0; ix <= maxIndex; ix += count) {
186
189
  ticks[ix] = dayjs(axisMin).valueOf() + (ix * stepValue);
187
190
 
188
191
  labelCenter = Math.round(startPoint + (graphGap * ix));
@@ -689,6 +689,20 @@ export default {
689
689
  type: [Array],
690
690
  default: () => [],
691
691
  },
692
+ /**
693
+ * @type {Object}
694
+ * @property {number} columnWidth 컬럼 너비 minWidth
695
+ * @property {number} scrollWidth 스크롤 너비
696
+ * @property {number} rowHeight 행 높이
697
+ * @property {number} gridWidth 그리드 너비 width
698
+ * @property {number} gridHeight 그리드 높이
699
+ * @property {boolean} adjust 컬럼 너비 조정 여부
700
+ * @property {boolean} useGridSetting 그리드 설정 사용 여부
701
+ * @property {number} gridWidth 그리드 너비 width
702
+ * @property {number} gridHeight 그리드 높이
703
+ * @property {boolean} adjust 컬럼 너비 조정 여부
704
+ * @property {boolean} useGridSetting 그리드 설정 사용 여부
705
+ */
692
706
  option: {
693
707
  type: Object,
694
708
  default: () => ({}),
@@ -291,9 +291,14 @@ export const resizeEvent = (params) => {
291
291
 
292
292
  columnWidth = elWidth - result.totalWidth;
293
293
  if (columnWidth > 0) {
294
- remainWidth = columnWidth
295
- - (Math.floor(columnWidth / result.emptyCount) * result.emptyCount);
296
- columnWidth = Math.floor(columnWidth / result.emptyCount);
294
+ const sharePerEmptyCount = result.emptyCount === 0
295
+ ? 0
296
+ : Math.floor(columnWidth / result.emptyCount);
297
+
298
+ remainWidth = columnWidth - (sharePerEmptyCount * result.emptyCount);
299
+ columnWidth = result.emptyCount !== 0
300
+ ? sharePerEmptyCount
301
+ : columnWidth;
297
302
  } else {
298
303
  columnWidth = resizeInfo.columnWidth;
299
304
  }
@@ -302,22 +307,23 @@ export const resizeEvent = (params) => {
302
307
  resizeInfo.columnWidth = columnWidth;
303
308
  }
304
309
 
305
- stores.orderedColumns.forEach((column) => {
306
- const item = column;
307
- const minWidth = isRenderer(column) ? resizeInfo.rendererMinWidth : resizeInfo.minWidth;
308
- if (item.width && item.width < minWidth) {
309
- item.width = minWidth;
310
+ stores.orderedColumns.forEach((col) => {
311
+ const minWidth = isRenderer(col) ? resizeInfo.rendererMinWidth : resizeInfo.minWidth;
312
+ if (col.width && col.width < minWidth) {
313
+ col.width = minWidth;
310
314
  }
311
- if (!item.width && !item.hide) {
312
- item.width = columnWidth;
315
+ if (!col.width && !col.hide) {
316
+ col.width = columnWidth;
313
317
  }
314
- return item;
315
318
  });
316
319
 
317
320
  if (remainWidth) {
318
321
  let index = stores.orderedColumns.length - 1;
319
322
  let lastColumn = stores.orderedColumns[index];
320
- while (lastColumn.hide) {
323
+
324
+ // orderedColumns에 hiddenDisplay === true 컬럼은 포함되어 있지 않다.
325
+ // 하지만 hide === true 컬럼은 포함되어 있다. 그래서 hiddenDisplay 조건은 필요없지만 조건을 추가해서 코드 가독성과 안정성을 높였다.
326
+ while (lastColumn.hide || lastColumn.hiddenDisplay) {
321
327
  index -= 1;
322
328
  lastColumn = stores.orderedColumns[index];
323
329
  }
@@ -236,9 +236,14 @@ export const resizeEvent = (params) => {
236
236
 
237
237
  columnWidth = elWidth - result.totalWidth;
238
238
  if (columnWidth > 0) {
239
- remainWidth = columnWidth
240
- - (Math.floor(columnWidth / result.emptyCount) * result.emptyCount);
241
- columnWidth = Math.floor(columnWidth / result.emptyCount);
239
+ const sharePerEmptyCount = result.emptyCount === 0
240
+ ? 0
241
+ : Math.floor(columnWidth / result.emptyCount);
242
+
243
+ remainWidth = columnWidth - (sharePerEmptyCount * result.emptyCount);
244
+ columnWidth = result.emptyCount !== 0
245
+ ? sharePerEmptyCount
246
+ : columnWidth;
242
247
  } else {
243
248
  columnWidth = resizeInfo.columnWidth;
244
249
  }
@@ -247,22 +252,23 @@ export const resizeEvent = (params) => {
247
252
  resizeInfo.columnWidth = columnWidth;
248
253
  }
249
254
 
250
- stores.orderedColumns.forEach((column) => {
251
- const item = column;
252
- const minWidth = isRenderer(column) ? resizeInfo.rendererMinWidth : resizeInfo.minWidth;
253
- if (item.width && item.width < minWidth) {
254
- item.width = minWidth;
255
+ stores.orderedColumns.forEach((col) => {
256
+ const minWidth = isRenderer(col) ? resizeInfo.rendererMinWidth : resizeInfo.minWidth;
257
+ if (col.width && col.width < minWidth) {
258
+ col.width = minWidth;
255
259
  }
256
- if (!item.width && !item.hide) {
257
- item.width = columnWidth;
260
+ if (!col.width && !col.hide) {
261
+ col.width = columnWidth;
258
262
  }
259
- return item;
260
263
  });
261
264
 
262
265
  if (remainWidth) {
263
266
  let index = stores.orderedColumns.length - 1;
264
267
  let lastColumn = stores.orderedColumns[index];
265
- while (lastColumn.hide) {
268
+
269
+ // orderedColumns에 hiddenDisplay === true 컬럼은 포함되어 있지 않다.
270
+ // 하지만 hide === true 컬럼은 포함되어 있다. 그래서 hiddenDisplay 조건은 필요없지만 조건을 추가해서 코드 가독성과 안정성을 높였다.
271
+ while (lastColumn.hide || lastColumn.hiddenDisplay) {
266
272
  index -= 1;
267
273
  lastColumn = stores.orderedColumns[index];
268
274
  }