evui 3.1.57 → 3.1.58

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.1.57",
3
+ "version": "3.1.58",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
@@ -93,7 +93,7 @@
93
93
  <span
94
94
  :title="column.caption"
95
95
  class="column-name"
96
- @click.stop="onSort(column.field)"
96
+ @click.stop="onSort(column)"
97
97
  >
98
98
  {{ column.caption }}
99
99
  </span>
@@ -475,17 +475,20 @@ export const sortEvent = (params) => {
475
475
  /**
476
476
  * sort 이벤트를 처리한다.
477
477
  *
478
- * @param {string} field - 컬럼 field
478
+ * @param {object} column - 컬럼 정보
479
479
  */
480
- const onSort = (field) => {
481
- if (sortInfo.sortField !== field) {
482
- order.orders = ['asc', 'desc', 'init'];
483
- sortInfo.sortField = field;
484
- }
485
- sortInfo.sortOrder = order.dequeue();
486
- order.enqueue(sortInfo.sortOrder);
480
+ const onSort = (column) => {
481
+ const sortable = column.sortable === undefined ? true : column.sortable;
482
+ if (sortable) {
483
+ if (sortInfo.sortField !== column?.field) {
484
+ order.orders = ['asc', 'desc', 'init'];
485
+ sortInfo.sortField = column?.field;
486
+ }
487
+ sortInfo.sortOrder = order.dequeue();
488
+ order.enqueue(sortInfo.sortOrder);
487
489
 
488
- sortInfo.isSorting = true;
490
+ sortInfo.isSorting = true;
491
+ }
489
492
  };
490
493
  /**
491
494
  * 설정값에 따라 해당 컬럼 데이터에 대해 정렬한다.
@@ -56,7 +56,7 @@ const useModel = () => {
56
56
  return result;
57
57
  };
58
58
 
59
- const removeUnit = (input, direction) => {
59
+ const removeUnit = (input, direction = 'horizontal') => {
60
60
  if (typeof input === 'number') {
61
61
  return input;
62
62
  } else if (!input) {
@@ -226,9 +226,9 @@ const useMouseEvent = (param) => {
226
226
  const posY = +y - rect.top;
227
227
  const headerAreaStyleInfo = headerRef.value.style;
228
228
  const headerPaddingInfo = {
229
- top: removeUnit(headerAreaStyleInfo.paddingTop),
230
- left: removeUnit(headerAreaStyleInfo.paddingLeft),
231
- right: removeUnit(headerAreaStyleInfo.paddingRight),
229
+ top: removeUnit(headerAreaStyleInfo.paddingTop, 'vertical'),
230
+ left: removeUnit(headerAreaStyleInfo.paddingLeft, 'horizontal'),
231
+ right: removeUnit(headerAreaStyleInfo.paddingRight, 'horizontal'),
232
232
  };
233
233
  const startPosX = headerPaddingInfo.left;
234
234
  const endPosX = rect.width - headerPaddingInfo.right;
@@ -279,17 +279,17 @@ const useMouseEvent = (param) => {
279
279
  if (hasOwnProperty.call(paramObj, 'minWidth')) {
280
280
  tMinWidth = paramObj.minWidth;
281
281
  } else {
282
- tMinWidth = removeUnit(props.minWidth, 'horizontal');
282
+ tMinWidth = props.minWidth;
283
283
  }
284
284
 
285
285
  if (hasOwnProperty.call(paramObj, 'minHeight')) {
286
286
  tMinHeight = paramObj.minHeight;
287
287
  } else {
288
- tMinHeight = removeUnit(props.minHeight, 'vertical');
288
+ tMinHeight = props.minHeight;
289
289
  }
290
290
 
291
- width = Math.max(width, tMinWidth);
292
- height = Math.max(height, tMinHeight);
291
+ width = removeUnit(width, 'horizontal') > removeUnit(tMinWidth, 'horizontal') ? width : tMinWidth;
292
+ height = removeUnit(height, 'vertical') > removeUnit(tMinHeight, 'vertical') ? height : tMinHeight;
293
293
 
294
294
  dragStyle.top = numberToUnit(top);
295
295
  dragStyle.left = numberToUnit(left);
@@ -433,6 +433,8 @@ const useMouseEvent = (param) => {
433
433
  setDragStyle({
434
434
  top: `${tempTop}px`,
435
435
  left: `${tempLeft}px`,
436
+ width: props.width,
437
+ height: props.height,
436
438
  });
437
439
  } else if (props.resizable && clickedInfo.pressedSpot === 'border') {
438
440
  resizeWindow(e);