evui 3.4.135 → 3.4.136

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.4.135",
3
+ "version": "3.4.136",
4
4
  "description": "A EXEM Library project",
5
5
  "author": "exem <dev_client@ex-em.com>",
6
6
  "license": "MIT",
@@ -78,20 +78,17 @@ export const commonFunctions = () => {
78
78
  };
79
79
 
80
80
  export const getUpdatedColumns = (stores) => {
81
- if (stores.movedColumns?.length) {
82
- const orderedColumnsIndexes = stores.orderedColumns?.map(column => column.index);
83
- const extraColumns = stores.originColumns?.filter(
84
- column => !orderedColumnsIndexes.includes(column.index),
85
- );
86
- const copyOrderedColumns = stores.orderedColumns;
87
- return [...copyOrderedColumns, ...extraColumns];
88
- }
89
- const { originColumns, filteredColumns } = stores;
90
- return originColumns.map((col) => {
91
- const changedCol = filteredColumns.find(fcol => fcol.index === col.index) ?? {};
81
+ const baseColumns = (
82
+ stores.movedColumns?.length ? stores.movedColumns : stores.originColumns
83
+ ) ?? [];
84
+ const filteredColumnsMap = new Map(
85
+ (stores.filteredColumns ?? []).map(filtered => [filtered.index, filtered]),
86
+ );
87
+ return baseColumns.map((column) => {
88
+ const filteredColumn = filteredColumnsMap.get(column.index) ?? {};
92
89
  return {
93
- ...col,
94
- ...changedCol,
90
+ ...column,
91
+ ...filteredColumn,
95
92
  };
96
93
  });
97
94
  };
@@ -1475,6 +1472,28 @@ export const columnSettingEvent = (params) => {
1475
1472
  columnSettingInfo.visibleColumnIdx = [];
1476
1473
  columnSettingInfo.hiddenColumn = '';
1477
1474
  };
1475
+ const getBaseColumns = () => {
1476
+ if (Array.isArray(stores.movedColumns) && stores.movedColumns.length) {
1477
+ return stores.movedColumns;
1478
+ }
1479
+ return stores.originColumns || [];
1480
+ };
1481
+ const syncHiddenState = (column, hidden) => {
1482
+ if (!column) {
1483
+ return;
1484
+ }
1485
+ column.hiddenDisplay = hidden;
1486
+ const originColumn = stores.originColumns?.find(col => col.index === column.index);
1487
+ if (originColumn && originColumn !== column) {
1488
+ originColumn.hiddenDisplay = hidden;
1489
+ }
1490
+ if (Array.isArray(stores.movedColumns)) {
1491
+ const movedColumn = stores.movedColumns.find(col => col.index === column.index);
1492
+ if (movedColumn && movedColumn !== column) {
1493
+ movedColumn.hiddenDisplay = hidden;
1494
+ }
1495
+ }
1496
+ };
1478
1497
  const setFilteringColumn = () => {
1479
1498
  columnSettingInfo.visibleColumnIdx = stores.filteredColumns.map(col => col.index);
1480
1499
 
@@ -1499,18 +1518,13 @@ export const columnSettingEvent = (params) => {
1499
1518
  return;
1500
1519
  }
1501
1520
 
1502
- stores.filteredColumns = stores.originColumns
1503
- .filter((col) => {
1504
- if (columnNames.includes(col.field) || !col.caption) {
1505
- // 보여줄 컬럼들은 hiddenDisplay 속성을 false로 전부 적용
1506
- col.hiddenDisplay = false;
1507
- return true;
1508
- }
1509
-
1510
- // 보여주지 않을 컬럼들은 hiddenDisplay 속성을 전부 ture로 적용
1511
- col.hiddenDisplay = true;
1512
- return false;
1513
- });
1521
+ const baseColumns = getBaseColumns();
1522
+ const columnNameSet = new Set(columnNames);
1523
+ stores.filteredColumns = baseColumns.filter((col) => {
1524
+ const shouldShow = columnNameSet.has(col.field) || !col.caption;
1525
+ syncHiddenState(col, !shouldShow);
1526
+ return shouldShow;
1527
+ });
1514
1528
  columnSettingInfo.hiddenColumn = '';
1515
1529
  setFilteringColumn();
1516
1530
  emit('change-column-status', {
@@ -1530,13 +1544,16 @@ export const columnSettingEvent = (params) => {
1530
1544
  }
1531
1545
  stores.filteredColumns = columns
1532
1546
  .filter((col) => {
1533
- if (col.field !== val) {
1534
- col.hiddenDisplay = false;
1535
- return true;
1536
- }
1537
- col.hiddenDisplay = true;
1538
- return false;
1547
+ const shouldHide = col.field === val;
1548
+ syncHiddenState(col, shouldHide);
1549
+ return !shouldHide;
1539
1550
  });
1551
+ const baseColumns = getBaseColumns();
1552
+ baseColumns.forEach((col) => {
1553
+ if (col.field === val) {
1554
+ syncHiddenState(col, true);
1555
+ }
1556
+ });
1540
1557
  columnSettingInfo.hiddenColumn = val;
1541
1558
  setFilteringColumn();
1542
1559
  };
@@ -1551,6 +1568,19 @@ export const columnSettingEvent = (params) => {
1551
1568
 
1552
1569
  export const dragEvent = ({ stores }) => {
1553
1570
  const { emit } = getCurrentInstance();
1571
+ const buildMovedColumns = (visibleColumns) => {
1572
+ const baseColumns = (stores.movedColumns?.length
1573
+ ? [...stores.movedColumns]
1574
+ : [...stores.originColumns]);
1575
+ const queue = [...visibleColumns];
1576
+ const visibleIndexSet = new Set(queue.map(column => column.index));
1577
+ stores.movedColumns = baseColumns.map((column) => {
1578
+ if (visibleIndexSet.has(column.index)) {
1579
+ return queue.shift();
1580
+ }
1581
+ return column;
1582
+ });
1583
+ };
1554
1584
  const setColumnMoving = (currentIndex, droppedIndex) => {
1555
1585
  const oldIndex = parseInt(currentIndex, 10);
1556
1586
  const newPositionIndex = parseInt(droppedIndex, 10);
@@ -1567,9 +1597,8 @@ export const dragEvent = ({ stores }) => {
1567
1597
 
1568
1598
  if (stores.filteredColumns.length) {
1569
1599
  stores.filteredColumns = columns;
1570
- } else {
1571
- stores.movedColumns = columns;
1572
1600
  }
1601
+ buildMovedColumns(columns);
1573
1602
  };
1574
1603
  const onDragStart = (e) => {
1575
1604
  e.dataTransfer.setData('text/plain', e.currentTarget.dataset.index);
@@ -4,6 +4,7 @@
4
4
  icon,
5
5
  { [`ev-icon-${size}`]: !!size },
6
6
  ]"
7
+ :style="{ color }"
7
8
  @click="onClick"
8
9
  @dblClick="onDblClick"
9
10
  @contextmenu="onContextMenu"
@@ -22,6 +23,10 @@ export default {
22
23
  type: String,
23
24
  default: '',
24
25
  },
26
+ color: {
27
+ type: String,
28
+ default: '',
29
+ },
25
30
  },
26
31
  emits: {
27
32
  click: null,
@@ -235,8 +235,14 @@ export default {
235
235
  const isDataIcon = computed(() => ((parentIconMV.value !== 'none' || childIconMV.value !== 'none')));
236
236
 
237
237
  const expandColumnIdx = computed(() => {
238
- const expandColumnIndex = props.orderedColumns.findIndex(v => v.expandColumn);
239
- return expandColumnIndex > 0 ? expandColumnIndex : 0;
238
+ const columns = props.orderedColumns || [];
239
+ const visibleExpandIdx = columns.findIndex(column =>
240
+ column.expandColumn && !column.hide && !column.hiddenDisplay);
241
+ if (visibleExpandIdx !== -1) {
242
+ return visibleExpandIdx;
243
+ }
244
+ const firstVisibleIdx = columns.findIndex(column => !column.hide && !column.hiddenDisplay);
245
+ return firstVisibleIdx !== -1 ? firstVisibleIdx : 0;
240
246
  });
241
247
  const getRowClass = nodeInfo => ({
242
248
  row: true,
@@ -10,7 +10,7 @@
10
10
  font-display: block;
11
11
  }
12
12
 
13
- [class^="ev-icon-"], [class*=" ev-icon-"] {
13
+ [class^='ev-icon-'], [class*=' ev-icon-'] {
14
14
  /* use !important to prevent issues with browser extensions that change fonts */
15
15
  font-family: 'EVUI' !important;
16
16
  speak: none;