@moda-grid/vue2 1.0.1 → 1.0.2
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/dist/DataGrid.vue +1378 -748
- package/dist/conformance.test.d.ts +2 -0
- package/dist/conformance.test.d.ts.map +1 -0
- package/dist/conformance.test.js +27 -0
- package/dist/conformance.test.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/useGrid.d.ts.map +1 -1
- package/dist/useGrid.js.map +1 -1
- package/dist/useGrid.test.d.ts +2 -0
- package/dist/useGrid.test.d.ts.map +1 -0
- package/dist/useGrid.test.js +66 -0
- package/dist/useGrid.test.js.map +1 -0
- package/package.json +7 -3
package/dist/DataGrid.vue
CHANGED
|
@@ -5,19 +5,25 @@ import {
|
|
|
5
5
|
onBeforeUnmount,
|
|
6
6
|
onMounted,
|
|
7
7
|
ref,
|
|
8
|
+
useSlots,
|
|
8
9
|
watch,
|
|
9
10
|
watchEffect,
|
|
10
11
|
} from "vue";
|
|
11
12
|
import type { CSSProperties, PropType } from "vue";
|
|
12
13
|
import {
|
|
14
|
+
createLongPressTracker,
|
|
15
|
+
createTouchDrag,
|
|
13
16
|
DEFAULT_COLUMN_WIDTH,
|
|
14
17
|
DEFAULT_OPERATOR_BY_TYPE,
|
|
15
18
|
FILTER_OPERATOR_LABELS,
|
|
16
19
|
FILTER_OPERATORS_BY_TYPE,
|
|
17
20
|
formatAggregate,
|
|
21
|
+
gridThemeClasses,
|
|
22
|
+
gridThemeVars,
|
|
18
23
|
} from "@moda-grid/core";
|
|
19
24
|
import type {
|
|
20
25
|
AggregateFn,
|
|
26
|
+
BuiltInAggregateFn,
|
|
21
27
|
AppendScrollOptions,
|
|
22
28
|
PivotOptions,
|
|
23
29
|
PivotZone,
|
|
@@ -30,6 +36,8 @@ import type {
|
|
|
30
36
|
DisplayRow,
|
|
31
37
|
FilterOperator,
|
|
32
38
|
Grid,
|
|
39
|
+
GridDensity,
|
|
40
|
+
GridTheme,
|
|
33
41
|
GridEventHandlers,
|
|
34
42
|
GridEventMap,
|
|
35
43
|
GridOptions,
|
|
@@ -52,15 +60,28 @@ function editorInputValue(v: unknown): string {
|
|
|
52
60
|
return String(v ?? "");
|
|
53
61
|
}
|
|
54
62
|
|
|
63
|
+
const slots = useSlots();
|
|
64
|
+
/** 행 상세 패널 (master-detail) — #detail="{ row, rowIndex }" 슬롯이 있으면 각 행에 ▸ 토글 표시 */
|
|
65
|
+
const hasDetailSlot = computed(() => !!slots.detail);
|
|
66
|
+
|
|
55
67
|
const props = defineProps({
|
|
56
68
|
columns: { type: Array as PropType<ColumnDef[]>, required: true },
|
|
57
69
|
/** 모든 컬럼에 적용되는 공통 기본값 — 컬럼 명시 속성이 우선 (defaultColDef 대응) */
|
|
58
|
-
defaultColDef: {
|
|
70
|
+
defaultColDef: {
|
|
71
|
+
type: Object as PropType<Partial<ColumnDef>>,
|
|
72
|
+
default: undefined,
|
|
73
|
+
},
|
|
59
74
|
/** 행 데이터. `grid`를 직접 넘기는 제어 모드에서는 생략 가능 */
|
|
60
|
-
data: {
|
|
75
|
+
data: {
|
|
76
|
+
type: Array as PropType<Record<string, unknown>[]>,
|
|
77
|
+
default: undefined,
|
|
78
|
+
},
|
|
61
79
|
/** 외부에서 생성/관리하는 GridCore. 생략하면 내부 인스턴스 생성 */
|
|
62
80
|
grid: { type: Object as PropType<Grid<any>>, default: undefined },
|
|
63
|
-
getRowId: {
|
|
81
|
+
getRowId: {
|
|
82
|
+
type: Function as PropType<(row: Record<string, unknown>) => string>,
|
|
83
|
+
default: undefined,
|
|
84
|
+
},
|
|
64
85
|
/** 행 클릭 시 선택 토글 */
|
|
65
86
|
selectable: { type: Boolean, default: true },
|
|
66
87
|
/** 가상 스크롤: 뷰포트 높이(px). `rowHeight`와 함께 지정 시 활성 */
|
|
@@ -75,11 +96,20 @@ const props = defineProps({
|
|
|
75
96
|
reorderable: { type: Boolean, default: true },
|
|
76
97
|
rowResizable: { type: Boolean, default: false },
|
|
77
98
|
/** 셀 선택 모드: 방향키 이동 + Shift 범위 확장 */
|
|
78
|
-
selectionMode: {
|
|
99
|
+
selectionMode: {
|
|
100
|
+
type: String as PropType<SelectionMode>,
|
|
101
|
+
default: undefined,
|
|
102
|
+
},
|
|
79
103
|
/** 서버 사이드 데이터 소스 (내부 GridCore 생성 모드에서만 적용) */
|
|
80
|
-
serverSide: {
|
|
104
|
+
serverSide: {
|
|
105
|
+
type: Object as PropType<ServerSideOptions>,
|
|
106
|
+
default: undefined,
|
|
107
|
+
},
|
|
81
108
|
/** Append Scroll 데이터 소스 — 스크롤 하단에서 자동으로 다음 페이지 로드 (내부 GridCore 생성 모드에서만 적용) */
|
|
82
|
-
appendScroll: {
|
|
109
|
+
appendScroll: {
|
|
110
|
+
type: Object as PropType<AppendScrollOptions>,
|
|
111
|
+
default: undefined,
|
|
112
|
+
},
|
|
83
113
|
/** 계층형 데이터: flat parentId 또는 nested children (내부 GridCore 생성 모드에서만 적용) */
|
|
84
114
|
treeData: { type: Object as PropType<TreeDataOptions>, default: undefined },
|
|
85
115
|
/** 피벗 모드 (내부 GridCore 생성 모드에서만 적용) */
|
|
@@ -89,9 +119,17 @@ const props = defineProps({
|
|
|
89
119
|
/** 내장 UI 문자열 로케일 */
|
|
90
120
|
locale: { type: Object as PropType<Partial<GridLocale>>, default: undefined },
|
|
91
121
|
/** 셀 우클릭 컨텍스트 메뉴 항목 (배열 또는 grid를 받는 함수) */
|
|
92
|
-
contextMenu: {
|
|
122
|
+
contextMenu: {
|
|
123
|
+
type: [Array, Function] as PropType<GridOptions<RowData>["contextMenu"]>,
|
|
124
|
+
default: undefined,
|
|
125
|
+
},
|
|
93
126
|
/** 헤더 우클릭 컨텍스트 메뉴 항목 */
|
|
94
|
-
headerContextMenu: {
|
|
127
|
+
headerContextMenu: {
|
|
128
|
+
type: [Array, Function] as PropType<
|
|
129
|
+
GridOptions<RowData>["headerContextMenu"]
|
|
130
|
+
>,
|
|
131
|
+
default: undefined,
|
|
132
|
+
},
|
|
95
133
|
/** 맨 왼쪽에 행 번호 컬럼 표시 */
|
|
96
134
|
rowNumbers: { type: Boolean, default: false },
|
|
97
135
|
/** 우상단 컬럼 관리 도구(체크박스 팝오버 + 전체 선택/해제) 표시 */
|
|
@@ -117,6 +155,7 @@ const props = defineProps({
|
|
|
117
155
|
singleClickEdit: { type: Boolean, default: false },
|
|
118
156
|
/** 편집 단위 — "cell"(기본) / "fullRow"(행 전체 동시 편집) */
|
|
119
157
|
editType: { type: String as () => "cell" | "fullRow", default: "cell" },
|
|
158
|
+
pasteExtend: { type: Boolean, default: false },
|
|
120
159
|
/** 그리드 상단에 찾기 바 표시 — Enter 다음 매치 / Shift+Enter 이전 매치 */
|
|
121
160
|
findBox: { type: Boolean, default: false },
|
|
122
161
|
/** filterable 컬럼 헤더에 값 목록 필터 드롭다운 버튼 표시 — 엑셀 autofilter */
|
|
@@ -126,22 +165,62 @@ const props = defineProps({
|
|
|
126
165
|
/** 헤더 영역 전체 높이(px) — 헤더 행 수로 균등 분할 */
|
|
127
166
|
headerHeight: { type: Number, default: undefined },
|
|
128
167
|
/** 파이프라인에서 숨길 행 id 목록 — 정렬/필터/집계에서 제외, 원본 데이터는 유지 */
|
|
129
|
-
hiddenRowIds: {
|
|
168
|
+
hiddenRowIds: {
|
|
169
|
+
type: Array as PropType<readonly string[]>,
|
|
170
|
+
default: undefined,
|
|
171
|
+
},
|
|
130
172
|
/** zebra 줄무늬 행 배경 — 짝수 표시 행에 --grid-stripe-bg */
|
|
131
173
|
striped: { type: Boolean, default: false },
|
|
132
174
|
/** 편집 진입 직전 훅 — false 반환 시 편집 취소 (타사 그리드 OnBeforeEdit 대응) */
|
|
133
|
-
beforeEdit: {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
175
|
+
beforeEdit: {
|
|
176
|
+
type: Function as PropType<GridOptions<RowData>["beforeEdit"]>,
|
|
177
|
+
default: undefined,
|
|
178
|
+
},
|
|
179
|
+
isRowSelectable: {
|
|
180
|
+
type: Function as PropType<GridOptions<RowData>["isRowSelectable"]>,
|
|
181
|
+
default: undefined,
|
|
182
|
+
},
|
|
183
|
+
externalFilter: {
|
|
184
|
+
type: Function as PropType<GridOptions<RowData>["externalFilter"]>,
|
|
185
|
+
default: undefined,
|
|
186
|
+
},
|
|
187
|
+
postSort: {
|
|
188
|
+
type: Function as PropType<GridOptions<RowData>["postSort"]>,
|
|
189
|
+
default: undefined,
|
|
190
|
+
},
|
|
191
|
+
beforePaste: {
|
|
192
|
+
type: Function as PropType<GridOptions<RowData>["beforePaste"]>,
|
|
193
|
+
default: undefined,
|
|
194
|
+
},
|
|
195
|
+
beforeCopy: {
|
|
196
|
+
type: Function as PropType<GridOptions<RowData>["beforeCopy"]>,
|
|
197
|
+
default: undefined,
|
|
198
|
+
},
|
|
199
|
+
/** 레이아웃 모드 — "autoHeight"면 내용만큼 늘어남 (내부 스크롤·가상 스크롤 무시) */
|
|
200
|
+
domLayout: {
|
|
201
|
+
type: String as PropType<"normal" | "autoHeight">,
|
|
202
|
+
default: undefined,
|
|
203
|
+
},
|
|
204
|
+
/** 뷰포트 높이/행 높이로 페이지 크기 자동 계산 — height/rowHeight 필요 */
|
|
205
|
+
autoPageSize: { type: Boolean, default: false },
|
|
206
|
+
/** 클립보드 셀 구분자 — 복사/붙여넣기 양쪽에 적용 (기본값: 탭) */
|
|
207
|
+
clipboardDelimiter: { type: String, default: undefined },
|
|
208
|
+
/** 로딩 오버레이 표시 — 그리드 전체를 반투명 레이어로 덮음 */
|
|
209
|
+
loading: { type: Boolean, default: false },
|
|
210
|
+
/**
|
|
211
|
+
* 그리드 테마 — "light"/"dark" 팔레트 또는 `{ base, vars }` 오브젝트로
|
|
212
|
+
* --grid-* 변수를 루트에 인라인 적용한다
|
|
213
|
+
*/
|
|
214
|
+
theme: { type: [String, Object] as PropType<GridTheme>, default: undefined },
|
|
215
|
+
/** 밀도 프리셋 — "compact"/"comfortable"이 폰트·셀 패딩을 일괄 조정 */
|
|
216
|
+
density: { type: String as PropType<GridDensity>, default: undefined },
|
|
141
217
|
/** 선언형 이벤트 핸들러 — 마운트 시 구독, 언마운트 시 해제 (grid.on과 동일) */
|
|
142
218
|
events: { type: Object as PropType<GridEventHandlers>, default: undefined },
|
|
143
219
|
/** GridCore 인스턴스가 준비되면 한 번 호출 — props 모드에서도 grid API 접근 가능 */
|
|
144
|
-
onReady: {
|
|
220
|
+
onReady: {
|
|
221
|
+
type: Function as PropType<(grid: Grid) => void>,
|
|
222
|
+
default: undefined,
|
|
223
|
+
},
|
|
145
224
|
});
|
|
146
225
|
|
|
147
226
|
// 내부 GridCore (grid prop이 없을 때만 생성)
|
|
@@ -166,6 +245,7 @@ const internal = props.grid
|
|
|
166
245
|
copyFormatted: props.copyFormatted,
|
|
167
246
|
singleClickEdit: props.singleClickEdit,
|
|
168
247
|
editType: props.editType,
|
|
248
|
+
pasteExtend: props.pasteExtend,
|
|
169
249
|
headerHeight: props.headerHeight,
|
|
170
250
|
hiddenRowIds: props.hiddenRowIds ? [...props.hiddenRowIds] : undefined,
|
|
171
251
|
striped: props.striped,
|
|
@@ -176,7 +256,10 @@ const internal = props.grid
|
|
|
176
256
|
beforePaste: props.beforePaste,
|
|
177
257
|
beforeCopy: props.beforeCopy,
|
|
178
258
|
virtualScroll:
|
|
179
|
-
props.
|
|
259
|
+
props.domLayout !== "autoHeight" &&
|
|
260
|
+
props.height != null &&
|
|
261
|
+
props.rowHeight != null &&
|
|
262
|
+
props.rowHeight > 0
|
|
180
263
|
? {
|
|
181
264
|
rowHeight: props.rowHeight,
|
|
182
265
|
viewportHeight: props.height,
|
|
@@ -186,6 +269,13 @@ const internal = props.grid
|
|
|
186
269
|
});
|
|
187
270
|
const grid = props.grid ?? internal!.grid;
|
|
188
271
|
const state = props.grid ? useGridState(grid).state : internal!.state;
|
|
272
|
+
// 로딩 오버레이 — prop 또는 코어 상태(grid.setLoading → state.loading) 합산
|
|
273
|
+
const isLoading = computed(() => props.loading || state.value.loading);
|
|
274
|
+
// 테마·밀도 — 코어 헬퍼로 클래스/인라인 var를 선언적 바인딩한다
|
|
275
|
+
const themeClasses = computed(() =>
|
|
276
|
+
gridThemeClasses(props.theme, props.density),
|
|
277
|
+
);
|
|
278
|
+
const themeStyle = computed(() => gridThemeVars(props.theme) as CSSProperties);
|
|
189
279
|
|
|
190
280
|
// 선언형 이벤트 구독 — events 맵의 각 키를 grid.on에 연결
|
|
191
281
|
watch(
|
|
@@ -215,10 +305,18 @@ watchEffect(() => {
|
|
|
215
305
|
if (props.data) grid.setData(props.data);
|
|
216
306
|
});
|
|
217
307
|
watchEffect(() => {
|
|
308
|
+
// 외부 grid 경로에서도 defaultColDef prop이 적용되도록 먼저 동기화 —
|
|
309
|
+
// undefined는 "미지정"이라 기존 기본값이 유지된다
|
|
310
|
+
grid.setDefaultColDef(props.defaultColDef);
|
|
218
311
|
grid.setColumns(props.columns);
|
|
219
312
|
});
|
|
220
313
|
watchEffect(() => {
|
|
221
|
-
if (
|
|
314
|
+
if (
|
|
315
|
+
props.domLayout !== "autoHeight" &&
|
|
316
|
+
props.height != null &&
|
|
317
|
+
props.rowHeight != null &&
|
|
318
|
+
props.rowHeight > 0
|
|
319
|
+
) {
|
|
222
320
|
grid.setVirtualScroll({
|
|
223
321
|
rowHeight: props.rowHeight,
|
|
224
322
|
viewportHeight: props.height,
|
|
@@ -247,6 +345,13 @@ watchEffect(() => {
|
|
|
247
345
|
grid.setPostSort(props.postSort ?? null);
|
|
248
346
|
grid.setBeforePaste(props.beforePaste ?? null);
|
|
249
347
|
grid.setBeforeCopy(props.beforeCopy ?? null);
|
|
348
|
+
// 외부 grid prop 경로에서도 컨텍스트 메뉴 prop이 적용되도록
|
|
349
|
+
// 런타임 setter로 동기화한다
|
|
350
|
+
grid.setContextMenu(props.contextMenu ?? null);
|
|
351
|
+
grid.setHeaderContextMenu(props.headerContextMenu ?? null);
|
|
352
|
+
});
|
|
353
|
+
watchEffect(() => {
|
|
354
|
+
grid.setClipboardDelimiter(props.clipboardDelimiter ?? null);
|
|
250
355
|
});
|
|
251
356
|
|
|
252
357
|
// 가상 스크롤: 코어가 보정한 scrollTop을 DOM에 동기화 (키보드 scrollIntoView)
|
|
@@ -268,9 +373,7 @@ watch(
|
|
|
268
373
|
(scrollEl.value ?? hostEl.value)
|
|
269
374
|
?.querySelector<HTMLElement>(
|
|
270
375
|
`td[data-mg-row="${req.rowIndex}"]` +
|
|
271
|
-
(req.columnIndex != null
|
|
272
|
-
? `[data-mg-col="${req.columnIndex}"]`
|
|
273
|
-
: ""),
|
|
376
|
+
(req.columnIndex != null ? `[data-mg-col="${req.columnIndex}"]` : ""),
|
|
274
377
|
)
|
|
275
378
|
?.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
276
379
|
},
|
|
@@ -289,6 +392,7 @@ watchEffect(() => grid.setEditType(props.editType ?? "cell"));
|
|
|
289
392
|
|
|
290
393
|
// 찾기 바 — findNext로 다음/이전 매치 순환 (Enter / Shift+Enter)
|
|
291
394
|
const findInputEl = ref<HTMLInputElement | null>(null);
|
|
395
|
+
const replaceInputEl = ref<HTMLInputElement | null>(null);
|
|
292
396
|
const findCount = ref("");
|
|
293
397
|
// 찾기 옵션 — 대소문자 구분 / 셀 전체 일치 (타사 그리드 찾기 옵션 대응)
|
|
294
398
|
const findCaseSensitive = ref(false);
|
|
@@ -302,7 +406,9 @@ function currentFindOpts() {
|
|
|
302
406
|
function onFindOptChange() {
|
|
303
407
|
const q = findInputEl.value?.value ?? "";
|
|
304
408
|
grid.setFindQuery(q || null, currentFindOpts());
|
|
305
|
-
findCount.value = q
|
|
409
|
+
findCount.value = q
|
|
410
|
+
? grid.locale.findResult(grid.findCells(q, currentFindOpts()).length)
|
|
411
|
+
: "";
|
|
306
412
|
}
|
|
307
413
|
// Vue2 템플릿은 TS 캐스트 미지원 — 체크박스 change는 스크립트 메서드로 처리
|
|
308
414
|
function onFindCaseChange(e: Event) {
|
|
@@ -317,7 +423,7 @@ function goFind(backward: boolean) {
|
|
|
317
423
|
const q = findInputEl.value?.value ?? "";
|
|
318
424
|
grid.setFindQuery(q || null, currentFindOpts()); // 매치 셀 하이라이트
|
|
319
425
|
const total = grid.findCells(q, currentFindOpts()).length;
|
|
320
|
-
findCount.value = q ?
|
|
426
|
+
findCount.value = q ? grid.locale.findResult(total) : "";
|
|
321
427
|
if (!q || !total) return;
|
|
322
428
|
const m = grid.findNext(q, { ...currentFindOpts(), backward });
|
|
323
429
|
if (m) {
|
|
@@ -328,6 +434,25 @@ function goFind(backward: boolean) {
|
|
|
328
434
|
?.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
329
435
|
}
|
|
330
436
|
}
|
|
437
|
+
// 찾기 바 바꾸기 — 모든 매치를 바꿀 값으로 치환 (grid.replaceAll 경유)
|
|
438
|
+
function replaceAll() {
|
|
439
|
+
const q = findInputEl.value?.value ?? "";
|
|
440
|
+
if (!q) return;
|
|
441
|
+
const n = grid.replaceAll(
|
|
442
|
+
q,
|
|
443
|
+
replaceInputEl.value?.value ?? "",
|
|
444
|
+
currentFindOpts(),
|
|
445
|
+
);
|
|
446
|
+
findCount.value = grid.locale.replaceResult(n);
|
|
447
|
+
}
|
|
448
|
+
function onReplaceKeydown(e: KeyboardEvent) {
|
|
449
|
+
if (e.isComposing) return; // IME 조합 확정 Enter가 바꾸기로 오작동하지 않도록
|
|
450
|
+
if (e.key === "Enter") {
|
|
451
|
+
e.preventDefault();
|
|
452
|
+
replaceAll();
|
|
453
|
+
}
|
|
454
|
+
e.stopPropagation(); // 그리드 키 내비와 충돌 방지
|
|
455
|
+
}
|
|
331
456
|
function onFindKeydown(e: KeyboardEvent) {
|
|
332
457
|
if (e.isComposing) return; // IME 조합 확정 Enter가 매치 이동으로 오작동하지 않도록
|
|
333
458
|
if (e.key === "Enter") {
|
|
@@ -339,7 +464,9 @@ function onFindKeydown(e: KeyboardEvent) {
|
|
|
339
464
|
function onFindInput(e: Event) {
|
|
340
465
|
const q = (e.target as HTMLInputElement).value;
|
|
341
466
|
grid.setFindQuery(q || null, currentFindOpts()); // 입력 즉시 매치 하이라이트
|
|
342
|
-
findCount.value = q
|
|
467
|
+
findCount.value = q
|
|
468
|
+
? grid.locale.findResult(grid.findCells(q, currentFindOpts()).length)
|
|
469
|
+
: "";
|
|
343
470
|
}
|
|
344
471
|
|
|
345
472
|
// 헤더 필터 드롭다운 — 엑셀 autofilter식 값 체크리스트 (한 번에 하나)
|
|
@@ -365,9 +492,7 @@ const filterDropCol = computed(() =>
|
|
|
365
492
|
: null,
|
|
366
493
|
);
|
|
367
494
|
const filterDropAll = computed(() =>
|
|
368
|
-
filterDropCol.value
|
|
369
|
-
? grid.getUniqueValues(filterDropCol.value.field)
|
|
370
|
-
: [],
|
|
495
|
+
filterDropCol.value ? grid.getUniqueValues(filterDropCol.value.field) : [],
|
|
371
496
|
);
|
|
372
497
|
const filterDropActive = computed(() =>
|
|
373
498
|
filterDropCol.value
|
|
@@ -400,7 +525,15 @@ function onFilterDropKeydown(e: KeyboardEvent) {
|
|
|
400
525
|
|
|
401
526
|
// ── 피벗 필드 패널 — 필드 칩을 행/열/값 존으로 드래그해 피벗 구성 ──
|
|
402
527
|
const PIVOT_DATA_TYPE = "application/x-mg-pivot";
|
|
403
|
-
const PIVOT_AGGS:
|
|
528
|
+
const PIVOT_AGGS: BuiltInAggregateFn[] = [
|
|
529
|
+
"sum",
|
|
530
|
+
"avg",
|
|
531
|
+
"min",
|
|
532
|
+
"max",
|
|
533
|
+
"count",
|
|
534
|
+
"first",
|
|
535
|
+
"last",
|
|
536
|
+
];
|
|
404
537
|
const pivotDropZone = ref<string | null>(null);
|
|
405
538
|
function pivotHeaderOf(field: string) {
|
|
406
539
|
return (
|
|
@@ -409,7 +542,7 @@ function pivotHeaderOf(field: string) {
|
|
|
409
542
|
}
|
|
410
543
|
function onPivotAggChange(field: string, e: Event) {
|
|
411
544
|
const v = (e.target as HTMLSelectElement).value;
|
|
412
|
-
grid.setPivotValueAgg(field, v as
|
|
545
|
+
grid.setPivotValueAgg(field, v as BuiltInAggregateFn);
|
|
413
546
|
}
|
|
414
547
|
function pivotChipsOf(zone: string) {
|
|
415
548
|
const p = state.value.pivot;
|
|
@@ -458,7 +591,10 @@ function pivotDragField(e: DragEvent): string {
|
|
|
458
591
|
}
|
|
459
592
|
function pivotDragAccepts(e: DragEvent): boolean {
|
|
460
593
|
const t = e.dataTransfer?.types;
|
|
461
|
-
return
|
|
594
|
+
return (
|
|
595
|
+
!!t &&
|
|
596
|
+
(t.includes(PIVOT_DATA_TYPE) || t.includes("application/x-mg-column"))
|
|
597
|
+
);
|
|
462
598
|
}
|
|
463
599
|
function onPivotZoneDragOver(zone: string, e: DragEvent) {
|
|
464
600
|
if (!pivotDragAccepts(e)) return;
|
|
@@ -489,7 +625,8 @@ function onPivotChipDragOver(e: DragEvent) {
|
|
|
489
625
|
function rowStyleOf(entry: AnyRow, rowIdx: number) {
|
|
490
626
|
const row = rowDataOf(entry);
|
|
491
627
|
const base: Record<string, string> = {};
|
|
492
|
-
const h =
|
|
628
|
+
const h =
|
|
629
|
+
virtual.value && props.rowHeight ? props.rowHeight : grid.getRowHeight(row);
|
|
493
630
|
if (h) base.height = `${h}px`;
|
|
494
631
|
// GridOptions/ColumnDef.rowStyle — kebab-case 맵 병합 (Vue :style이 그대로 적용)
|
|
495
632
|
const custom = grid.getRowStyle(row, entryIndexOf(entry, rowIdx));
|
|
@@ -518,14 +655,37 @@ function onGroupPanelDrop(event: DragEvent) {
|
|
|
518
655
|
groupDropOver.value = false;
|
|
519
656
|
const field = event.dataTransfer?.getData("application/x-mg-column");
|
|
520
657
|
if (field && !state.value.groupBy.includes(field)) {
|
|
521
|
-
grid.setGroupBy([
|
|
522
|
-
...state.value.groupBy,
|
|
523
|
-
field,
|
|
524
|
-
] as (keyof RowT & string)[]);
|
|
658
|
+
grid.setGroupBy([...state.value.groupBy, field] as (keyof RowT & string)[]);
|
|
525
659
|
}
|
|
526
660
|
}
|
|
527
661
|
|
|
528
662
|
const virtual = computed(() => state.value.virtual);
|
|
663
|
+
const autoHeight = computed(() => props.domLayout === "autoHeight");
|
|
664
|
+
|
|
665
|
+
// autoPageSize — 뷰포트 높이/행 높이로 pageSize 자동 계산 (리사이즈 재계산)
|
|
666
|
+
let pageSizeObs: ResizeObserver | null = null;
|
|
667
|
+
onMounted(() => {
|
|
668
|
+
const rh = props.rowHeight;
|
|
669
|
+
if (!props.autoPageSize || !rh) return;
|
|
670
|
+
const sync = () => {
|
|
671
|
+
const host = hostEl.value;
|
|
672
|
+
if (!host) return;
|
|
673
|
+
const headH =
|
|
674
|
+
host.querySelector("thead")?.getBoundingClientRect().height ?? 0;
|
|
675
|
+
const pagerH =
|
|
676
|
+
host.querySelector(".mg-pager")?.getBoundingClientRect().height ?? 0;
|
|
677
|
+
const avail = (props.height ?? host.clientHeight) - headH - pagerH;
|
|
678
|
+
const size = Math.max(1, Math.floor(avail / rh));
|
|
679
|
+
const snap = grid.getSnapshot();
|
|
680
|
+
if (size !== snap.pageSize) grid.setPage(snap.pageIndex, size);
|
|
681
|
+
};
|
|
682
|
+
nextTick(sync);
|
|
683
|
+
if (typeof ResizeObserver !== "undefined") {
|
|
684
|
+
pageSizeObs = new ResizeObserver(sync);
|
|
685
|
+
if (hostEl.value) pageSizeObs.observe(hostEl.value);
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
onBeforeUnmount(() => pageSizeObs?.disconnect());
|
|
529
689
|
// 그룹화 시: displayRows(그룹 헤더 포함)를 virtual 인덱스로 슬라이스
|
|
530
690
|
type RowT = Record<string, unknown>;
|
|
531
691
|
type AnyRow = DisplayRow<RowT> | RowT;
|
|
@@ -569,7 +729,10 @@ const activeFilterCount = computed(
|
|
|
569
729
|
);
|
|
570
730
|
const bottomOffset = computed(() =>
|
|
571
731
|
virtual.value && props.rowHeight
|
|
572
|
-
? Math.max(
|
|
732
|
+
? Math.max(
|
|
733
|
+
0,
|
|
734
|
+
virtual.value.totalHeight - virtual.value.endIndex * props.rowHeight,
|
|
735
|
+
)
|
|
573
736
|
: 0,
|
|
574
737
|
);
|
|
575
738
|
|
|
@@ -655,6 +818,211 @@ function onCellContextMenu(
|
|
|
655
818
|
}
|
|
656
819
|
}
|
|
657
820
|
|
|
821
|
+
// 터치 롱프레스 → contextmenu와 동일 동작 (헤더/셀 공용 트래커)
|
|
822
|
+
const lp = createLongPressTracker();
|
|
823
|
+
|
|
824
|
+
function onCellPointerDown(
|
|
825
|
+
e: PointerEvent,
|
|
826
|
+
rowIndex: number,
|
|
827
|
+
col: ColumnDef,
|
|
828
|
+
): void {
|
|
829
|
+
lp.down(e, (x, y) => grid.openContextMenu(x, y, rowIndex, col.field));
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
function onHeaderPointerDown(e: PointerEvent, col: ColumnDef): void {
|
|
833
|
+
lp.down(e, (x, y) => grid.openHeaderContextMenu(x, y, col.field));
|
|
834
|
+
if (props.reorderable && col.movable !== false)
|
|
835
|
+
touchDrag.col.down(e, col.field);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
// ── 터치 커스텀 DnD — iOS/Android는 HTML5 DnD가 없어 포인터 제스처로 보강 ──
|
|
839
|
+
const touchColField = ref<string | null>(null); // mg-col-dragging 표시용
|
|
840
|
+
let touchColFieldRaw: string | null = null;
|
|
841
|
+
|
|
842
|
+
/** 터치 드롭 대상 해석 — 컬럼 헤더/피벗 존/그룹 패널 */
|
|
843
|
+
function touchHitAt(target: Element | null) {
|
|
844
|
+
const root = hostEl.value;
|
|
845
|
+
const t = target as HTMLElement | null;
|
|
846
|
+
if (!root || !t?.closest) return null;
|
|
847
|
+
const zoneEl = t.closest<HTMLElement>(".mg-pivot-zone");
|
|
848
|
+
if (zoneEl && root.contains(zoneEl)) {
|
|
849
|
+
const chip = t.closest<HTMLElement>(".mg-pivot-chip");
|
|
850
|
+
const idx =
|
|
851
|
+
chip && zoneEl.contains(chip)
|
|
852
|
+
? chip.getAttribute("data-mg-pivot-index")
|
|
853
|
+
: null;
|
|
854
|
+
return {
|
|
855
|
+
kind: "pivot" as const,
|
|
856
|
+
zone: zoneEl.getAttribute("data-mg-pivot-zone") ?? "",
|
|
857
|
+
index: idx != null ? Number(idx) : undefined,
|
|
858
|
+
};
|
|
859
|
+
}
|
|
860
|
+
const gp = t.closest<HTMLElement>(".mg-group-panel");
|
|
861
|
+
if (gp && root.contains(gp)) return { kind: "group" as const };
|
|
862
|
+
const th = t.closest<HTMLElement>("th[data-mg-field]");
|
|
863
|
+
if (th && root.contains(th))
|
|
864
|
+
return {
|
|
865
|
+
kind: "column" as const,
|
|
866
|
+
field: th.getAttribute("data-mg-field")!,
|
|
867
|
+
};
|
|
868
|
+
return null;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
/** 포인터 아래 행의 삽입 갭 — td의 data-mg-row로 행 인덱스를 해석한다 */
|
|
872
|
+
function touchRowGapAt(target: Element | null, y: number): number | null {
|
|
873
|
+
const root = hostEl.value;
|
|
874
|
+
const t = target as HTMLElement | null;
|
|
875
|
+
let td = t?.closest?.("td[data-mg-row]") as HTMLElement | null;
|
|
876
|
+
if (!td)
|
|
877
|
+
td =
|
|
878
|
+
(t?.closest?.("tr") as HTMLElement | null)?.querySelector?.(
|
|
879
|
+
"td[data-mg-row]",
|
|
880
|
+
) ?? null;
|
|
881
|
+
if (!root || !td || !root.contains(td)) return null;
|
|
882
|
+
const rowIndex = Number(td.getAttribute("data-mg-row"));
|
|
883
|
+
const tr = td.closest("tr");
|
|
884
|
+
if (Number.isNaN(rowIndex) || !tr) return null;
|
|
885
|
+
const rect = tr.getBoundingClientRect();
|
|
886
|
+
return y < rect.top + rect.height / 2 ? rowIndex : rowIndex + 1;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
function applyTouchDrop(
|
|
890
|
+
hit: ReturnType<typeof touchHitAt>,
|
|
891
|
+
field: string,
|
|
892
|
+
): void {
|
|
893
|
+
if (!hit || !field) return;
|
|
894
|
+
if (hit.kind === "pivot") {
|
|
895
|
+
if (hit.zone === "fields") grid.removePivotField(field);
|
|
896
|
+
else
|
|
897
|
+
grid.addPivotField(
|
|
898
|
+
hit.zone as PivotZone,
|
|
899
|
+
field,
|
|
900
|
+
hit.index != null ? { index: hit.index } : {},
|
|
901
|
+
);
|
|
902
|
+
} else if (hit.kind === "group") {
|
|
903
|
+
const snap = grid.getSnapshot();
|
|
904
|
+
if (!snap.groupBy.includes(field))
|
|
905
|
+
grid.setGroupBy([...snap.groupBy, field]);
|
|
906
|
+
} else if (hit.field !== field) {
|
|
907
|
+
grid.reorderColumn(field, hit.field);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
function clearTouchDropMarks(): void {
|
|
912
|
+
dragOverField.value = null;
|
|
913
|
+
pivotDropZone.value = null;
|
|
914
|
+
groupDropOver.value = false;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
const touchDrag = {
|
|
918
|
+
// 컬럼 헤더 — 수평 이동으로 확정 (th는 touch-action: pan-y)
|
|
919
|
+
col: createTouchDrag<string>("x", {
|
|
920
|
+
start: (field: string) => {
|
|
921
|
+
// 롱프레스 메뉴가 이미 열렸으면 드래그로 전환하지 않는다
|
|
922
|
+
if (grid.getSnapshot().contextMenu) return false;
|
|
923
|
+
lp.end();
|
|
924
|
+
touchColFieldRaw = field;
|
|
925
|
+
touchColField.value = field;
|
|
926
|
+
return true;
|
|
927
|
+
},
|
|
928
|
+
move: (_x: number, _y: number, target: Element | null) => {
|
|
929
|
+
const hit = touchHitAt(target);
|
|
930
|
+
dragOverField.value =
|
|
931
|
+
hit?.kind === "column" && hit.field !== touchColFieldRaw
|
|
932
|
+
? hit.field
|
|
933
|
+
: null;
|
|
934
|
+
pivotDropZone.value = hit?.kind === "pivot" ? hit.zone : null;
|
|
935
|
+
groupDropOver.value = hit?.kind === "group";
|
|
936
|
+
},
|
|
937
|
+
up: (_x: number, _y: number, target: Element | null, field: string) => {
|
|
938
|
+
applyTouchDrop(touchHitAt(target), field);
|
|
939
|
+
clearTouchDropMarks();
|
|
940
|
+
touchColFieldRaw = null;
|
|
941
|
+
touchColField.value = null;
|
|
942
|
+
},
|
|
943
|
+
cancel: () => {
|
|
944
|
+
clearTouchDropMarks();
|
|
945
|
+
touchColFieldRaw = null;
|
|
946
|
+
touchColField.value = null;
|
|
947
|
+
},
|
|
948
|
+
}),
|
|
949
|
+
// 행 드래그 핸들 — 세로 이동으로 확정 (핸들은 touch-action: none)
|
|
950
|
+
row: createTouchDrag<number>("y", {
|
|
951
|
+
start: (rowIndex: number) => {
|
|
952
|
+
lp.end();
|
|
953
|
+
return grid.beginRowDrag(rowIndex);
|
|
954
|
+
},
|
|
955
|
+
move: (_x: number, y: number, target: Element | null) => {
|
|
956
|
+
const gap = touchRowGapAt(target, y);
|
|
957
|
+
if (gap != null) grid.updateRowDropPosition(gap);
|
|
958
|
+
},
|
|
959
|
+
up: () => grid.endRowDrag(true),
|
|
960
|
+
cancel: () => grid.endRowDrag(false),
|
|
961
|
+
}),
|
|
962
|
+
// 피벗 칩 — 아무 방향이든 이동으로 확정 (칩은 touch-action: none)
|
|
963
|
+
chip: createTouchDrag<string>("any", {
|
|
964
|
+
move: (_x: number, _y: number, target: Element | null) => {
|
|
965
|
+
const hit = touchHitAt(target);
|
|
966
|
+
pivotDropZone.value = hit?.kind === "pivot" ? hit.zone : null;
|
|
967
|
+
},
|
|
968
|
+
up: (_x: number, _y: number, target: Element | null, field: string) => {
|
|
969
|
+
const hit = touchHitAt(target);
|
|
970
|
+
pivotDropZone.value = null;
|
|
971
|
+
if (hit?.kind !== "pivot") return;
|
|
972
|
+
if (hit.zone === "fields") grid.removePivotField(field);
|
|
973
|
+
else
|
|
974
|
+
grid.addPivotField(
|
|
975
|
+
hit.zone as PivotZone,
|
|
976
|
+
field,
|
|
977
|
+
hit.index != null ? { index: hit.index } : {},
|
|
978
|
+
);
|
|
979
|
+
},
|
|
980
|
+
cancel: () => {
|
|
981
|
+
pivotDropZone.value = null;
|
|
982
|
+
},
|
|
983
|
+
}),
|
|
984
|
+
};
|
|
985
|
+
|
|
986
|
+
function onPivotChipPointerDown(field: string, e: PointerEvent): void {
|
|
987
|
+
e.stopPropagation();
|
|
988
|
+
touchDrag.chip.down(e, field);
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
function onRowDragPointerDown(e: PointerEvent, rowIndex: number): void {
|
|
992
|
+
e.stopPropagation();
|
|
993
|
+
if (rowDraggable.value) touchDrag.row.down(e, rowIndex);
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
// 포인터 추적을 document에 위임 — 드래그 중 소스 노드가 재생성돼도 계속된다
|
|
997
|
+
onMounted(() => {
|
|
998
|
+
const move = (e: PointerEvent) => {
|
|
999
|
+
lp.move(e);
|
|
1000
|
+
touchDrag.col.move(e);
|
|
1001
|
+
touchDrag.row.move(e);
|
|
1002
|
+
touchDrag.chip.move(e);
|
|
1003
|
+
};
|
|
1004
|
+
const up = (e: PointerEvent) => {
|
|
1005
|
+
lp.end();
|
|
1006
|
+
touchDrag.col.up(e);
|
|
1007
|
+
touchDrag.row.up(e);
|
|
1008
|
+
touchDrag.chip.up(e);
|
|
1009
|
+
};
|
|
1010
|
+
const cancel = () => {
|
|
1011
|
+
lp.end();
|
|
1012
|
+
touchDrag.col.cancel();
|
|
1013
|
+
touchDrag.row.cancel();
|
|
1014
|
+
touchDrag.chip.cancel();
|
|
1015
|
+
};
|
|
1016
|
+
document.addEventListener("pointermove", move);
|
|
1017
|
+
document.addEventListener("pointerup", up);
|
|
1018
|
+
document.addEventListener("pointercancel", cancel);
|
|
1019
|
+
onBeforeUnmount(() => {
|
|
1020
|
+
document.removeEventListener("pointermove", move);
|
|
1021
|
+
document.removeEventListener("pointerup", up);
|
|
1022
|
+
document.removeEventListener("pointercancel", cancel);
|
|
1023
|
+
});
|
|
1024
|
+
});
|
|
1025
|
+
|
|
658
1026
|
function cellPosFromPoint(
|
|
659
1027
|
x: number,
|
|
660
1028
|
y: number,
|
|
@@ -666,16 +1034,22 @@ function cellPosFromPoint(
|
|
|
666
1034
|
return Number.isNaN(row) || Number.isNaN(col) ? null : { row, col };
|
|
667
1035
|
}
|
|
668
1036
|
|
|
669
|
-
let fillSource: {
|
|
1037
|
+
let fillSource: {
|
|
1038
|
+
startRow: number;
|
|
1039
|
+
endRow: number;
|
|
1040
|
+
startCol: number;
|
|
1041
|
+
endCol: number;
|
|
1042
|
+
} | null = null;
|
|
670
1043
|
|
|
671
|
-
function
|
|
1044
|
+
function onFillPointerDown(e: PointerEvent): void {
|
|
672
1045
|
e.preventDefault();
|
|
673
1046
|
e.stopPropagation();
|
|
674
1047
|
const src = state.value.selectedRange;
|
|
675
1048
|
if (!src) return;
|
|
676
1049
|
fillSource = { ...src };
|
|
677
|
-
const onUp = (ev:
|
|
678
|
-
window.removeEventListener("
|
|
1050
|
+
const onUp = (ev: PointerEvent) => {
|
|
1051
|
+
window.removeEventListener("pointerup", onUp);
|
|
1052
|
+
window.removeEventListener("pointercancel", onUp);
|
|
679
1053
|
const source = fillSource;
|
|
680
1054
|
fillSource = null;
|
|
681
1055
|
const pos = cellPosFromPoint(ev.clientX, ev.clientY);
|
|
@@ -689,7 +1063,8 @@ function onFillMouseDown(e: MouseEvent): void {
|
|
|
689
1063
|
grid.fillRange(source, target);
|
|
690
1064
|
grid.setCellRange(target);
|
|
691
1065
|
};
|
|
692
|
-
window.addEventListener("
|
|
1066
|
+
window.addEventListener("pointerup", onUp);
|
|
1067
|
+
window.addEventListener("pointercancel", onUp);
|
|
693
1068
|
}
|
|
694
1069
|
|
|
695
1070
|
function cellLinkHref(row: RowData, col: ColumnDef): string {
|
|
@@ -723,12 +1098,18 @@ function filterInputType(col: ColumnDef<Record<string, unknown>>) {
|
|
|
723
1098
|
return t === "number" ? "number" : t === "date" ? "date" : "text";
|
|
724
1099
|
}
|
|
725
1100
|
|
|
726
|
-
function filterValueOf(
|
|
1101
|
+
function filterValueOf(
|
|
1102
|
+
col: ColumnDef<Record<string, unknown>>,
|
|
1103
|
+
key: "value" | "valueTo",
|
|
1104
|
+
) {
|
|
727
1105
|
const f = state.value.filters[col.field];
|
|
728
1106
|
return f ? f[key] || "" : "";
|
|
729
1107
|
}
|
|
730
1108
|
|
|
731
|
-
function updateFilter(
|
|
1109
|
+
function updateFilter(
|
|
1110
|
+
col: ColumnDef<Record<string, unknown>>,
|
|
1111
|
+
patch: Partial<ColumnFilter>,
|
|
1112
|
+
) {
|
|
732
1113
|
const f = state.value.filters[col.field];
|
|
733
1114
|
grid.setFilter(col.field, {
|
|
734
1115
|
operator: filterOpOf(col),
|
|
@@ -738,13 +1119,20 @@ function updateFilter(col: ColumnDef<Record<string, unknown>>, patch: Partial<Co
|
|
|
738
1119
|
});
|
|
739
1120
|
}
|
|
740
1121
|
|
|
741
|
-
function onFilterOpChange(
|
|
1122
|
+
function onFilterOpChange(
|
|
1123
|
+
col: ColumnDef<Record<string, unknown>>,
|
|
1124
|
+
event: Event,
|
|
1125
|
+
) {
|
|
742
1126
|
updateFilter(col, {
|
|
743
1127
|
operator: (event.target as HTMLSelectElement).value as FilterOperator,
|
|
744
1128
|
});
|
|
745
1129
|
}
|
|
746
1130
|
|
|
747
|
-
function onFilterInput(
|
|
1131
|
+
function onFilterInput(
|
|
1132
|
+
col: ColumnDef<Record<string, unknown>>,
|
|
1133
|
+
key: "value" | "valueTo",
|
|
1134
|
+
event: Event,
|
|
1135
|
+
) {
|
|
748
1136
|
updateFilter(col, { [key]: (event.target as HTMLInputElement).value });
|
|
749
1137
|
}
|
|
750
1138
|
|
|
@@ -775,7 +1163,11 @@ function setAllCheckedOf(col: ColumnDef<Record<string, unknown>>) {
|
|
|
775
1163
|
return !vals || vals.length >= setValuesOf(col).length;
|
|
776
1164
|
}
|
|
777
1165
|
|
|
778
|
-
function onSetToggle(
|
|
1166
|
+
function onSetToggle(
|
|
1167
|
+
col: ColumnDef<Record<string, unknown>>,
|
|
1168
|
+
v: string,
|
|
1169
|
+
event: Event,
|
|
1170
|
+
) {
|
|
779
1171
|
const checked = (event.target as HTMLInputElement).checked;
|
|
780
1172
|
const all = setValuesOf(col);
|
|
781
1173
|
const f = state.value.filters[col.field];
|
|
@@ -842,14 +1234,12 @@ const headerRows = computed<HeaderCell[][]>(() => {
|
|
|
842
1234
|
);
|
|
843
1235
|
const row2: HeaderCell[] = spans.flatMap((s) =>
|
|
844
1236
|
s.groupId
|
|
845
|
-
? cols
|
|
846
|
-
|
|
847
|
-
.
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
colIndex: s.startIndex + i,
|
|
852
|
-
}))
|
|
1237
|
+
? cols.slice(s.startIndex, s.startIndex + s.colSpan).map((col, i) => ({
|
|
1238
|
+
kind: "col" as const,
|
|
1239
|
+
key: col.field,
|
|
1240
|
+
col,
|
|
1241
|
+
colIndex: s.startIndex + i,
|
|
1242
|
+
}))
|
|
853
1243
|
: [],
|
|
854
1244
|
);
|
|
855
1245
|
return row2.length > 0 ? [row1, row2] : [row1];
|
|
@@ -857,63 +1247,68 @@ const headerRows = computed<HeaderCell[][]>(() => {
|
|
|
857
1247
|
|
|
858
1248
|
const headerRowSpan = computed(() => headerRows.value.length);
|
|
859
1249
|
|
|
860
|
-
// ── 컬럼 리사이즈: document
|
|
1250
|
+
// ── 컬럼 리사이즈: document pointermove를 rAF로 스로틀 ──
|
|
1251
|
+
// pointerdown/move/up — 마우스·터치·펜 공통 경로 (핸들은 touch-action:none)
|
|
861
1252
|
let resizeRaf = 0;
|
|
862
1253
|
let pendingWidth: { field: string; width: number } | null = null;
|
|
863
1254
|
|
|
864
|
-
function onResizeStart(col: ColumnDef, event:
|
|
1255
|
+
function onResizeStart(col: ColumnDef, event: PointerEvent) {
|
|
865
1256
|
const th = (event.currentTarget as HTMLElement).closest("th");
|
|
866
1257
|
const startWidth = th?.getBoundingClientRect().width ?? 0;
|
|
867
1258
|
const startX = event.clientX;
|
|
868
1259
|
const field = col.field;
|
|
869
1260
|
|
|
870
|
-
const onMove = (ev:
|
|
1261
|
+
const onMove = (ev: PointerEvent) => {
|
|
871
1262
|
pendingWidth = { field, width: startWidth + (ev.clientX - startX) };
|
|
872
1263
|
if (resizeRaf === 0) {
|
|
873
1264
|
resizeRaf = requestAnimationFrame(() => {
|
|
874
1265
|
resizeRaf = 0;
|
|
875
|
-
if (pendingWidth)
|
|
1266
|
+
if (pendingWidth)
|
|
1267
|
+
grid.setColumnWidth(pendingWidth.field, pendingWidth.width);
|
|
876
1268
|
});
|
|
877
1269
|
}
|
|
878
1270
|
};
|
|
879
1271
|
const onUp = () => {
|
|
880
|
-
document.removeEventListener("
|
|
881
|
-
document.removeEventListener("
|
|
1272
|
+
document.removeEventListener("pointermove", onMove);
|
|
1273
|
+
document.removeEventListener("pointerup", onUp);
|
|
1274
|
+
document.removeEventListener("pointercancel", onUp);
|
|
882
1275
|
if (resizeRaf !== 0) {
|
|
883
1276
|
cancelAnimationFrame(resizeRaf);
|
|
884
1277
|
resizeRaf = 0;
|
|
885
1278
|
}
|
|
886
|
-
if (pendingWidth)
|
|
1279
|
+
if (pendingWidth)
|
|
1280
|
+
grid.setColumnWidth(pendingWidth.field, pendingWidth.width);
|
|
887
1281
|
pendingWidth = null;
|
|
888
1282
|
};
|
|
889
|
-
document.addEventListener("
|
|
890
|
-
document.addEventListener("
|
|
1283
|
+
document.addEventListener("pointermove", onMove);
|
|
1284
|
+
document.addEventListener("pointerup", onUp);
|
|
1285
|
+
document.addEventListener("pointercancel", onUp);
|
|
891
1286
|
}
|
|
892
1287
|
|
|
893
1288
|
// ── 행 높이 리사이즈: 행 번호 셀 하단 핸들 드래그 → setRowHeight ──
|
|
894
|
-
function onRowResizeStart(rowId: string, event:
|
|
1289
|
+
function onRowResizeStart(rowId: string, event: PointerEvent) {
|
|
895
1290
|
event.preventDefault();
|
|
896
1291
|
event.stopPropagation();
|
|
897
1292
|
const tr = (event.currentTarget as HTMLElement).closest("tr");
|
|
898
1293
|
const startHeight = tr?.getBoundingClientRect().height ?? 0;
|
|
899
1294
|
const startY = event.clientY;
|
|
900
|
-
const onMove = (ev:
|
|
901
|
-
grid.setRowHeight(
|
|
902
|
-
rowId,
|
|
903
|
-
Math.max(16, startHeight + (ev.clientY - startY)),
|
|
904
|
-
);
|
|
1295
|
+
const onMove = (ev: PointerEvent) => {
|
|
1296
|
+
grid.setRowHeight(rowId, Math.max(16, startHeight + (ev.clientY - startY)));
|
|
905
1297
|
};
|
|
906
1298
|
const onUp = () => {
|
|
907
|
-
document.removeEventListener("
|
|
908
|
-
document.removeEventListener("
|
|
1299
|
+
document.removeEventListener("pointermove", onMove);
|
|
1300
|
+
document.removeEventListener("pointerup", onUp);
|
|
1301
|
+
document.removeEventListener("pointercancel", onUp);
|
|
909
1302
|
};
|
|
910
|
-
document.addEventListener("
|
|
911
|
-
document.addEventListener("
|
|
1303
|
+
document.addEventListener("pointermove", onMove);
|
|
1304
|
+
document.addEventListener("pointerup", onUp);
|
|
1305
|
+
document.addEventListener("pointercancel", onUp);
|
|
912
1306
|
}
|
|
913
1307
|
|
|
914
1308
|
// 키보드 리사이즈 (방향키 ±10px)
|
|
915
1309
|
function onResizerKeydown(col: ColumnDef, event: KeyboardEvent) {
|
|
916
|
-
const delta =
|
|
1310
|
+
const delta =
|
|
1311
|
+
event.key === "ArrowLeft" ? -10 : event.key === "ArrowRight" ? 10 : 0;
|
|
917
1312
|
if (delta === 0) return;
|
|
918
1313
|
event.preventDefault();
|
|
919
1314
|
const th = (event.currentTarget as HTMLElement).closest("th");
|
|
@@ -967,7 +1362,10 @@ const rowCount = computed(() => state.value.rows.length);
|
|
|
967
1362
|
const dropGap = computed(() => {
|
|
968
1363
|
const rd = state.value.rowDrag;
|
|
969
1364
|
if (!rd || rd.dropIndex == null) return null;
|
|
970
|
-
if (
|
|
1365
|
+
if (
|
|
1366
|
+
rd.dropIndex === rd.draggingIndex ||
|
|
1367
|
+
rd.dropIndex === rd.draggingIndex + 1
|
|
1368
|
+
)
|
|
971
1369
|
return null;
|
|
972
1370
|
return rd.dropIndex;
|
|
973
1371
|
});
|
|
@@ -998,7 +1396,10 @@ function rowStateOf(row: RowT | null | undefined) {
|
|
|
998
1396
|
/** 변경(I/U/D) 행의 셀 유효성 에러 — required/validate 검사. 없으면 null. */
|
|
999
1397
|
function cellErrorOf(entry: AnyRow, col: ColumnDef): string | null {
|
|
1000
1398
|
const row = rowDataOf(entry);
|
|
1001
|
-
if (!row
|
|
1399
|
+
if (!row) return null;
|
|
1400
|
+
// setCellError 수동 마킹은 행 상태·validate 유무와 무관하게 표시한다
|
|
1401
|
+
if (grid.hasManualCellError(row, col)) return grid.getCellError(row, col);
|
|
1402
|
+
if (!rowStateOf(row)) return null;
|
|
1002
1403
|
if (!col.required && !col.validate) return null;
|
|
1003
1404
|
return grid.getCellError(row, col);
|
|
1004
1405
|
}
|
|
@@ -1187,7 +1588,13 @@ function onGridKeydown(event: KeyboardEvent) {
|
|
|
1187
1588
|
return;
|
|
1188
1589
|
}
|
|
1189
1590
|
// 인쇄 가능한 문자 직접 입력 → 값을 교체하며 편집 진입
|
|
1190
|
-
if (
|
|
1591
|
+
if (
|
|
1592
|
+
event.key.length === 1 &&
|
|
1593
|
+
!event.ctrlKey &&
|
|
1594
|
+
!event.metaKey &&
|
|
1595
|
+
!event.altKey &&
|
|
1596
|
+
active
|
|
1597
|
+
) {
|
|
1191
1598
|
event.preventDefault();
|
|
1192
1599
|
grid.startEditing(active.rowIndex, active.columnIndex, event.key);
|
|
1193
1600
|
}
|
|
@@ -1236,10 +1643,12 @@ function entryIndexOf(entry: AnyRow, rowIdx: number) {
|
|
|
1236
1643
|
return virtual.value ? virtual.value.startIndex + rowIdx : rowIdx;
|
|
1237
1644
|
}
|
|
1238
1645
|
|
|
1239
|
-
function rowKeyOf(entry: AnyRow) {
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1646
|
+
function rowKeyOf(entry: AnyRow, rowIdx: number) {
|
|
1647
|
+
if (isGroupRow(entry)) return groupOf(entry).key;
|
|
1648
|
+
const row = rowDataOf(entry);
|
|
1649
|
+
// 서버 사이드 미로드(스파스) 행은 id가 없으므로 위치로 키잉 — getRowId(undefined) 크래시 방지
|
|
1650
|
+
if (row == null) return `skeleton-${rowIdx}`;
|
|
1651
|
+
return grid.getRowId(row);
|
|
1243
1652
|
}
|
|
1244
1653
|
|
|
1245
1654
|
function groupLabelOf(entry: AnyRow) {
|
|
@@ -1333,6 +1742,11 @@ function editorContext(rowIndex: number, colIndex: number) {
|
|
|
1333
1742
|
return grid.getEditorContext(rowIndex, colIndex) as CellEditorContext;
|
|
1334
1743
|
}
|
|
1335
1744
|
|
|
1745
|
+
// editorOptions — 배열 또는 행별 함수(종속 콤보) 해석
|
|
1746
|
+
function editorOptionsOf(col: ColumnDef, row: RowT) {
|
|
1747
|
+
return grid.getEditorOptions(col, row);
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1336
1750
|
function editorInputType(col: ColumnDef) {
|
|
1337
1751
|
return col.cellEditor === "number"
|
|
1338
1752
|
? "number"
|
|
@@ -1368,10 +1782,22 @@ function onRadioPick(opt: string, col: ColumnDef) {
|
|
|
1368
1782
|
if (state.value.editType !== "fullRow") grid.commitEditing();
|
|
1369
1783
|
}
|
|
1370
1784
|
|
|
1785
|
+
// select 에디터 — 고르는 즉시 커밋 (fullRow에서는 보류 값만 반영)
|
|
1786
|
+
function onSelectPick(event: Event, col: ColumnDef) {
|
|
1787
|
+
grid.updateEditValue((event.target as HTMLSelectElement).value, col.field);
|
|
1788
|
+
if (state.value.editType !== "fullRow") grid.commitEditing();
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
// date 에디터 — 날짜 선택(완성 입력) 즉시 커밋. text/number의 blur change는 무시
|
|
1792
|
+
function onDatePick(event: Event, col: ColumnDef) {
|
|
1793
|
+
if (col.cellEditor !== "date") return;
|
|
1794
|
+
onSelectPick(event, col);
|
|
1795
|
+
}
|
|
1796
|
+
|
|
1371
1797
|
// 커밋 후 이동 시 편집기 언마운트로 빠진 포커스를 그리드로 되돌린다
|
|
1372
1798
|
function commitThenNavigate(
|
|
1373
|
-
|
|
1374
|
-
|
|
1799
|
+
dir: "up" | "down" | "left" | "right" | "tabLeft" | "tabRight",
|
|
1800
|
+
) {
|
|
1375
1801
|
if (grid.commitEditing()) {
|
|
1376
1802
|
grid.navigateCell(dir);
|
|
1377
1803
|
scrollEl.value?.focus();
|
|
@@ -1443,9 +1869,11 @@ watch(
|
|
|
1443
1869
|
ref="hostEl"
|
|
1444
1870
|
:class="[
|
|
1445
1871
|
showOverlay ? 'mg-colctl-host' : undefined,
|
|
1446
|
-
|
|
1872
|
+
...themeClasses,
|
|
1447
1873
|
state.striped && 'mg-striped',
|
|
1874
|
+
isLoading && 'mg-loading-host',
|
|
1448
1875
|
]"
|
|
1876
|
+
:style="themeStyle"
|
|
1449
1877
|
>
|
|
1450
1878
|
<!-- 피벗 필드 패널 — 칩을 존 사이로 드래그해 디멘션 구성 -->
|
|
1451
1879
|
<div v-if="pivotPanel" class="mg-pivot-panel">
|
|
@@ -1453,8 +1881,11 @@ watch(
|
|
|
1453
1881
|
v-for="zone in ['fields', 'rows', 'columns', 'values']"
|
|
1454
1882
|
:key="zone"
|
|
1455
1883
|
:class="['mg-pivot-zone', pivotDropZone === zone && 'mg-drop-over']"
|
|
1884
|
+
:data-mg-pivot-zone="zone"
|
|
1456
1885
|
@dragover="onPivotZoneDragOver(zone, $event)"
|
|
1457
|
-
@dragleave="
|
|
1886
|
+
@dragleave="
|
|
1887
|
+
pivotDropZone = pivotDropZone === zone ? null : pivotDropZone
|
|
1888
|
+
"
|
|
1458
1889
|
@drop="onPivotZoneDrop(zone, $event)"
|
|
1459
1890
|
>
|
|
1460
1891
|
<span class="mg-pivot-zone-label">{{ pivotZoneLabel(zone) }}</span>
|
|
@@ -1463,9 +1894,13 @@ watch(
|
|
|
1463
1894
|
:key="chip.field"
|
|
1464
1895
|
:class="[
|
|
1465
1896
|
'mg-pivot-chip',
|
|
1466
|
-
zone === 'fields' &&
|
|
1897
|
+
zone === 'fields' &&
|
|
1898
|
+
pivotPlaced.has(chip.field) &&
|
|
1899
|
+
'mg-pivot-chip-placed',
|
|
1467
1900
|
]"
|
|
1468
1901
|
draggable="true"
|
|
1902
|
+
:data-mg-pivot-index="i"
|
|
1903
|
+
@pointerdown="onPivotChipPointerDown(chip.field, $event)"
|
|
1469
1904
|
@dragstart="onPivotChipDragStart(chip.field, $event)"
|
|
1470
1905
|
@dragover="onPivotChipDragOver($event)"
|
|
1471
1906
|
@drop="onPivotZoneDrop(zone, $event, i)"
|
|
@@ -1474,7 +1909,7 @@ watch(
|
|
|
1474
1909
|
<select
|
|
1475
1910
|
v-if="zone === 'values'"
|
|
1476
1911
|
class="mg-pivot-agg"
|
|
1477
|
-
:value="chip.agg"
|
|
1912
|
+
:value="typeof chip.agg === 'string' ? chip.agg : 'sum'"
|
|
1478
1913
|
@click.stop
|
|
1479
1914
|
@change="onPivotAggChange(chip.field, $event)"
|
|
1480
1915
|
>
|
|
@@ -1506,16 +1941,15 @@ watch(
|
|
|
1506
1941
|
<label class="mg-colctl-item">
|
|
1507
1942
|
<input
|
|
1508
1943
|
type="checkbox"
|
|
1509
|
-
:checked="
|
|
1944
|
+
:checked="
|
|
1945
|
+
!filterDropActive ||
|
|
1946
|
+
filterDropActive.length >= filterDropAll.length
|
|
1947
|
+
"
|
|
1510
1948
|
@change="grid.setFilter(filterDropCol.field, null)"
|
|
1511
1949
|
/>
|
|
1512
1950
|
{{ state.locale.setFilterAll }}
|
|
1513
1951
|
</label>
|
|
1514
|
-
<label
|
|
1515
|
-
v-for="v in filterDropAll"
|
|
1516
|
-
:key="v"
|
|
1517
|
-
class="mg-colctl-item"
|
|
1518
|
-
>
|
|
1952
|
+
<label v-for="v in filterDropAll" :key="v" class="mg-colctl-item">
|
|
1519
1953
|
<input
|
|
1520
1954
|
type="checkbox"
|
|
1521
1955
|
:checked="filterDropChecked(v)"
|
|
@@ -1532,7 +1966,7 @@ watch(
|
|
|
1532
1966
|
ref="findInputEl"
|
|
1533
1967
|
type="search"
|
|
1534
1968
|
class="mg-find-input"
|
|
1535
|
-
placeholder="
|
|
1969
|
+
:placeholder="state.locale.findPlaceholder"
|
|
1536
1970
|
@keydown="onFindKeydown"
|
|
1537
1971
|
@input="onFindInput"
|
|
1538
1972
|
/>
|
|
@@ -1553,10 +1987,24 @@ watch(
|
|
|
1553
1987
|
{{ state.locale.findWholeCell }}
|
|
1554
1988
|
</label>
|
|
1555
1989
|
<button type="button" class="mg-find-btn" @click="goFind(true)">
|
|
1556
|
-
|
|
1990
|
+
{{ state.locale.findPrev }}
|
|
1557
1991
|
</button>
|
|
1558
1992
|
<button type="button" class="mg-find-btn" @click="goFind(false)">
|
|
1559
|
-
|
|
1993
|
+
{{ state.locale.findNext }}
|
|
1994
|
+
</button>
|
|
1995
|
+
<input
|
|
1996
|
+
ref="replaceInputEl"
|
|
1997
|
+
type="text"
|
|
1998
|
+
class="mg-replace-input"
|
|
1999
|
+
:placeholder="state.locale.replacePlaceholder"
|
|
2000
|
+
@keydown="onReplaceKeydown"
|
|
2001
|
+
/>
|
|
2002
|
+
<button
|
|
2003
|
+
type="button"
|
|
2004
|
+
class="mg-find-btn mg-replace-all"
|
|
2005
|
+
@click="replaceAll"
|
|
2006
|
+
>
|
|
2007
|
+
{{ state.locale.replaceAllLabel }}
|
|
1560
2008
|
</button>
|
|
1561
2009
|
<span class="mg-find-count">{{ findCount }}</span>
|
|
1562
2010
|
</div>
|
|
@@ -1640,270 +2088,176 @@ watch(
|
|
|
1640
2088
|
</div>
|
|
1641
2089
|
<div
|
|
1642
2090
|
ref="scrollEl"
|
|
1643
|
-
:class="{
|
|
2091
|
+
:class="{
|
|
2092
|
+
'mg-scroll': (virtual || hasPinned || hasAppend) && !autoHeight,
|
|
2093
|
+
}"
|
|
1644
2094
|
:style="
|
|
1645
|
-
|
|
1646
|
-
?
|
|
1647
|
-
:
|
|
1648
|
-
? {
|
|
1649
|
-
:
|
|
2095
|
+
autoHeight
|
|
2096
|
+
? undefined
|
|
2097
|
+
: virtual || (hasAppend && height)
|
|
2098
|
+
? { height: `${height}px`, overflow: 'auto' }
|
|
2099
|
+
: hasPinned || hasAppend
|
|
2100
|
+
? { overflowX: 'auto', overflowY: height ? undefined : 'auto' }
|
|
2101
|
+
: undefined
|
|
1650
2102
|
"
|
|
1651
2103
|
@scroll="onScroll"
|
|
1652
2104
|
>
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
>
|
|
1676
|
-
<th
|
|
1677
|
-
v-if="rowStatus && rowIdx === 0"
|
|
1678
|
-
:rowspan="headerRowSpan"
|
|
1679
|
-
class="mg-status-cell"
|
|
1680
|
-
title="행 상태 — I: 입력, U: 수정, D: 삭제"
|
|
1681
|
-
>
|
|
1682
|
-
상태
|
|
1683
|
-
</th>
|
|
1684
|
-
<th
|
|
1685
|
-
v-if="rowCheckboxes && rowIdx === 0"
|
|
1686
|
-
:rowspan="headerRowSpan"
|
|
1687
|
-
class="mg-check-cell"
|
|
2105
|
+
<table
|
|
2106
|
+
class="mg-table"
|
|
2107
|
+
role="grid"
|
|
2108
|
+
tabindex="0"
|
|
2109
|
+
:style="{ minWidth: `${tableMinWidth}px` }"
|
|
2110
|
+
@keydown="onGridKeydown"
|
|
2111
|
+
>
|
|
2112
|
+
<colgroup>
|
|
2113
|
+
<col v-if="rowStatus" class="mg-col-status" />
|
|
2114
|
+
<col v-if="rowCheckboxes" class="mg-col-check" />
|
|
2115
|
+
<col v-if="rowNumbers" class="mg-col-rownum" />
|
|
2116
|
+
<col
|
|
2117
|
+
v-for="col in state.visibleColumns"
|
|
2118
|
+
:key="col.field"
|
|
2119
|
+
:style="{ width: `${col.width ?? DEFAULT_COLUMN_WIDTH}px` }"
|
|
2120
|
+
/>
|
|
2121
|
+
</colgroup>
|
|
2122
|
+
<thead role="rowgroup">
|
|
2123
|
+
<tr
|
|
2124
|
+
v-for="(row, rowIdx) in headerRows"
|
|
2125
|
+
:key="rowIdx"
|
|
2126
|
+
:style="headerTrStyle"
|
|
1688
2127
|
>
|
|
1689
|
-
<input
|
|
1690
|
-
type="checkbox"
|
|
1691
|
-
:aria-label="state.locale.selectAllRowsAria"
|
|
1692
|
-
:checked="grid.isAllSelected()"
|
|
1693
|
-
:indeterminate.prop="grid.isSomeSelected()"
|
|
1694
|
-
@click.stop
|
|
1695
|
-
@change="grid.toggleAllRows()"
|
|
1696
|
-
/>
|
|
1697
|
-
</th>
|
|
1698
|
-
<th
|
|
1699
|
-
v-if="rowNumbers && rowIdx === 0"
|
|
1700
|
-
:rowspan="headerRowSpan"
|
|
1701
|
-
class="mg-rownum-cell"
|
|
1702
|
-
></th>
|
|
1703
|
-
<template v-for="cell in row">
|
|
1704
2128
|
<th
|
|
1705
|
-
v-if="
|
|
1706
|
-
:
|
|
1707
|
-
|
|
1708
|
-
|
|
2129
|
+
v-if="rowStatus && rowIdx === 0"
|
|
2130
|
+
:rowspan="headerRowSpan"
|
|
2131
|
+
class="mg-status-cell"
|
|
2132
|
+
title="행 상태 — I: 입력, U: 수정, D: 삭제"
|
|
1709
2133
|
>
|
|
1710
|
-
|
|
2134
|
+
상태
|
|
1711
2135
|
</th>
|
|
1712
2136
|
<th
|
|
1713
|
-
v-
|
|
1714
|
-
:
|
|
1715
|
-
|
|
1716
|
-
:style="
|
|
1717
|
-
cell.col.pinned
|
|
1718
|
-
? pinStyleOf(cell.col)
|
|
1719
|
-
: cell.col.width
|
|
1720
|
-
? { width: `${cell.col.width}px` }
|
|
1721
|
-
: undefined
|
|
1722
|
-
"
|
|
1723
|
-
:class="[
|
|
1724
|
-
{
|
|
1725
|
-
'mg-sortable': cell.col.sortable !== false,
|
|
1726
|
-
'mg-col-dragover': dragOverField === cell.col.field,
|
|
1727
|
-
'mg-pinned': !!cell.col.pinned,
|
|
1728
|
-
'mg-pin-left-edge': cell.colIndex === lastLeftPinIdx,
|
|
1729
|
-
'mg-pin-right-edge': cell.colIndex === firstRightPinIdx,
|
|
1730
|
-
},
|
|
1731
|
-
(cell.col.headerAlign ?? cell.col.align) &&
|
|
1732
|
-
(cell.col.headerAlign ?? cell.col.align) !== 'left'
|
|
1733
|
-
? `mg-halign-${cell.col.headerAlign ?? cell.col.align}`
|
|
1734
|
-
: '',
|
|
1735
|
-
grid.getHeaderClass(cell.col),
|
|
1736
|
-
]"
|
|
1737
|
-
:title="cell.col.headerTooltip"
|
|
1738
|
-
:aria-sort="sortAria(cell.col.field)"
|
|
1739
|
-
:draggable="reorderable && cell.col.movable !== false"
|
|
1740
|
-
@dragstart="onDragStart(cell.col, $event)"
|
|
1741
|
-
@dragover="onDragOver(cell.col, $event)"
|
|
1742
|
-
@drop="onDrop(cell.col, $event)"
|
|
1743
|
-
@dragend="onDragEnd"
|
|
1744
|
-
@click="grid.toggleSort(cell.col.field, $event.shiftKey)"
|
|
1745
|
-
@contextmenu="onHeaderContextMenu($event, cell.col)"
|
|
2137
|
+
v-if="rowCheckboxes && rowIdx === 0"
|
|
2138
|
+
:rowspan="headerRowSpan"
|
|
2139
|
+
class="mg-check-cell"
|
|
1746
2140
|
>
|
|
1747
2141
|
<input
|
|
1748
|
-
v-if="cell.col.cellEditor === 'checkbox' && cell.col.headerCheckbox"
|
|
1749
2142
|
type="checkbox"
|
|
1750
|
-
|
|
1751
|
-
:
|
|
1752
|
-
:
|
|
1753
|
-
:indeterminate.prop="grid.checkboxColumnState(cell.col) === 'some'"
|
|
2143
|
+
:aria-label="state.locale.selectAllRowsAria"
|
|
2144
|
+
:checked="grid.isAllSelected()"
|
|
2145
|
+
:indeterminate.prop="grid.isSomeSelected()"
|
|
1754
2146
|
@click.stop
|
|
1755
|
-
@change="grid.
|
|
2147
|
+
@change="grid.toggleAllRows()"
|
|
1756
2148
|
/>
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
2149
|
+
</th>
|
|
2150
|
+
<th
|
|
2151
|
+
v-if="rowNumbers && rowIdx === 0"
|
|
2152
|
+
:rowspan="headerRowSpan"
|
|
2153
|
+
class="mg-rownum-cell"
|
|
2154
|
+
></th>
|
|
2155
|
+
<template v-for="cell in row">
|
|
2156
|
+
<th
|
|
2157
|
+
v-if="cell.kind === 'group'"
|
|
2158
|
+
:key="cell.key"
|
|
2159
|
+
:colspan="cell.colSpan"
|
|
2160
|
+
class="mg-colgroup"
|
|
2161
|
+
>
|
|
2162
|
+
{{ cell.header }}
|
|
2163
|
+
</th>
|
|
2164
|
+
<th
|
|
2165
|
+
v-else
|
|
2166
|
+
:key="cell.key"
|
|
2167
|
+
:rowspan="cell.rowSpan"
|
|
2168
|
+
:style="
|
|
2169
|
+
cell.col.pinned
|
|
2170
|
+
? pinStyleOf(cell.col)
|
|
2171
|
+
: cell.col.width
|
|
2172
|
+
? { width: `${cell.col.width}px` }
|
|
2173
|
+
: undefined
|
|
2174
|
+
"
|
|
1768
2175
|
:class="[
|
|
1769
|
-
|
|
1770
|
-
|
|
2176
|
+
{
|
|
2177
|
+
'mg-sortable': cell.col.sortable !== false,
|
|
2178
|
+
'mg-col-dragover': dragOverField === cell.col.field,
|
|
2179
|
+
'mg-col-dragging': touchColField === cell.col.field,
|
|
2180
|
+
'mg-pinned': !!cell.col.pinned,
|
|
2181
|
+
'mg-pin-left-edge': cell.colIndex === lastLeftPinIdx,
|
|
2182
|
+
'mg-pin-right-edge': cell.colIndex === firstRightPinIdx,
|
|
2183
|
+
},
|
|
2184
|
+
(cell.col.headerAlign ?? cell.col.align) &&
|
|
2185
|
+
(cell.col.headerAlign ?? cell.col.align) !== 'left'
|
|
2186
|
+
? `mg-halign-${cell.col.headerAlign ?? cell.col.align}`
|
|
2187
|
+
: '',
|
|
2188
|
+
grid.getHeaderClass(cell.col),
|
|
1771
2189
|
]"
|
|
1772
|
-
:
|
|
1773
|
-
|
|
2190
|
+
:title="cell.col.headerTooltip"
|
|
2191
|
+
:aria-sort="sortAria(cell.col.field)"
|
|
2192
|
+
:draggable="reorderable && cell.col.movable !== false"
|
|
2193
|
+
@dragstart="onDragStart(cell.col, $event)"
|
|
2194
|
+
@dragover="onDragOver(cell.col, $event)"
|
|
2195
|
+
@drop="onDrop(cell.col, $event)"
|
|
2196
|
+
@dragend="onDragEnd"
|
|
2197
|
+
@click="grid.toggleSort(cell.col.field, $event.shiftKey)"
|
|
2198
|
+
@contextmenu="onHeaderContextMenu($event, cell.col)"
|
|
2199
|
+
:data-mg-field="cell.col.field"
|
|
2200
|
+
@pointerdown="onHeaderPointerDown($event, cell.col)"
|
|
1774
2201
|
>
|
|
1775
|
-
▾
|
|
1776
|
-
</button>
|
|
1777
|
-
<button
|
|
1778
|
-
v-if="resizable && cell.col.resizable !== false"
|
|
1779
|
-
type="button"
|
|
1780
|
-
class="mg-resizer"
|
|
1781
|
-
:aria-label="`${cell.col.field} 너비 조절`"
|
|
1782
|
-
@mousedown.stop.prevent="onResizeStart(cell.col, $event)"
|
|
1783
|
-
@dblclick.stop="grid.autoSizeColumn(cell.col.field)"
|
|
1784
|
-
@keydown.stop="onResizerKeydown(cell.col, $event)"
|
|
1785
|
-
@click.stop
|
|
1786
|
-
/>
|
|
1787
|
-
</th>
|
|
1788
|
-
</template>
|
|
1789
|
-
</tr>
|
|
1790
|
-
<tr v-if="hasFilterRow" class="mg-filter-row">
|
|
1791
|
-
<th v-if="rowStatus" class="mg-status-cell" />
|
|
1792
|
-
<th v-if="rowCheckboxes" class="mg-check-cell" />
|
|
1793
|
-
<th v-if="rowNumbers" class="mg-rownum-cell" />
|
|
1794
|
-
<th
|
|
1795
|
-
v-for="(col, colIndex) in state.visibleColumns"
|
|
1796
|
-
:key="col.field"
|
|
1797
|
-
:class="{
|
|
1798
|
-
'mg-pinned': !!col.pinned,
|
|
1799
|
-
'mg-pin-left-edge': colIndex === lastLeftPinIdx,
|
|
1800
|
-
'mg-pin-right-edge': colIndex === firstRightPinIdx,
|
|
1801
|
-
}"
|
|
1802
|
-
:style="pinStyleOf(col)"
|
|
1803
|
-
>
|
|
1804
|
-
<div v-if="col.filterable" class="mg-filter-cell">
|
|
1805
|
-
<details v-if="isSetFilter(col)" class="mg-setfilter">
|
|
1806
|
-
<summary>{{ setFilterLabel(col) }}</summary>
|
|
1807
|
-
<div class="mg-setfilter-panel">
|
|
1808
|
-
<label class="mg-setfilter-item">
|
|
1809
|
-
<input
|
|
1810
|
-
type="checkbox"
|
|
1811
|
-
:checked="setAllCheckedOf(col)"
|
|
1812
|
-
@change="grid.setFilter(col.field, null)"
|
|
1813
|
-
/>
|
|
1814
|
-
{{ state.locale.setFilterAll }}
|
|
1815
|
-
</label>
|
|
1816
|
-
<label
|
|
1817
|
-
v-for="v in setValuesOf(col)"
|
|
1818
|
-
:key="v"
|
|
1819
|
-
class="mg-setfilter-item"
|
|
1820
|
-
>
|
|
1821
|
-
<input
|
|
1822
|
-
type="checkbox"
|
|
1823
|
-
:checked="setCheckedOf(col, v)"
|
|
1824
|
-
@change="onSetToggle(col, v, $event)"
|
|
1825
|
-
/>
|
|
1826
|
-
{{ v }}
|
|
1827
|
-
</label>
|
|
1828
|
-
</div>
|
|
1829
|
-
</details>
|
|
1830
|
-
<template v-else>
|
|
1831
|
-
<select
|
|
1832
|
-
class="mg-filter-op"
|
|
1833
|
-
:value="filterOpOf(col)"
|
|
1834
|
-
@change="onFilterOpChange(col, $event)"
|
|
1835
|
-
>
|
|
1836
|
-
<option v-for="op in filterOpsOf(col)" :key="op" :value="op">
|
|
1837
|
-
{{ FILTER_OPERATOR_LABELS[op] }}
|
|
1838
|
-
</option>
|
|
1839
|
-
</select>
|
|
1840
2202
|
<input
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
2203
|
+
v-if="
|
|
2204
|
+
cell.col.cellEditor === 'checkbox' &&
|
|
2205
|
+
cell.col.headerCheckbox
|
|
2206
|
+
"
|
|
2207
|
+
type="checkbox"
|
|
2208
|
+
class="mg-header-checkbox"
|
|
2209
|
+
:aria-label="`${cell.col.header || cell.col.field} 전체 체크`"
|
|
2210
|
+
:checked="grid.checkboxColumnState(cell.col) === 'all'"
|
|
2211
|
+
:indeterminate.prop="
|
|
2212
|
+
grid.checkboxColumnState(cell.col) === 'some'
|
|
2213
|
+
"
|
|
2214
|
+
:disabled="!grid.isCheckboxColumnEditable(cell.col)"
|
|
2215
|
+
@click.stop
|
|
2216
|
+
@change="grid.toggleAllChecked(cell.col)"
|
|
1846
2217
|
/>
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
2218
|
+
{{ cell.col.header || cell.col.field }}
|
|
2219
|
+
<span v-if="cell.col.required" class="mg-required-mark">*</span>
|
|
2220
|
+
<span v-if="sortArrowOf(cell.col.field)" class="mg-sort-arrow">
|
|
2221
|
+
{{ sortArrowOf(cell.col.field) }}
|
|
2222
|
+
</span>
|
|
2223
|
+
<span
|
|
2224
|
+
v-if="sortPriorityOf(cell.col.field)"
|
|
2225
|
+
class="mg-sort-priority"
|
|
2226
|
+
>
|
|
2227
|
+
{{ sortPriorityOf(cell.col.field) }}
|
|
2228
|
+
</span>
|
|
2229
|
+
<button
|
|
2230
|
+
v-if="headerFilters && cell.col.filterable"
|
|
2231
|
+
type="button"
|
|
2232
|
+
:class="[
|
|
2233
|
+
'mg-header-filter-btn',
|
|
2234
|
+
state.filters[cell.col.field] && 'mg-active',
|
|
2235
|
+
]"
|
|
2236
|
+
:aria-label="`${cell.col.header || cell.col.field} 필터`"
|
|
2237
|
+
@click="toggleFilterDrop(cell.col, $event)"
|
|
2238
|
+
>
|
|
2239
|
+
▾
|
|
2240
|
+
</button>
|
|
2241
|
+
<button
|
|
2242
|
+
v-if="resizable && cell.col.resizable !== false"
|
|
2243
|
+
type="button"
|
|
2244
|
+
class="mg-resizer"
|
|
2245
|
+
:aria-label="`${cell.col.field} 너비 조절`"
|
|
2246
|
+
@pointerdown.stop.prevent="onResizeStart(cell.col, $event)"
|
|
2247
|
+
@dblclick.stop="grid.autoSizeColumn(cell.col.field)"
|
|
2248
|
+
@keydown.stop="onResizerKeydown(cell.col, $event)"
|
|
2249
|
+
@click.stop
|
|
1854
2250
|
/>
|
|
1855
|
-
</
|
|
1856
|
-
</
|
|
1857
|
-
</
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
:key="`pin-top-${pIdx}`"
|
|
1864
|
-
class="mg-pinned-top-row"
|
|
1865
|
-
>
|
|
1866
|
-
<td v-if="rowStatus" class="mg-status-cell" />
|
|
1867
|
-
<td v-if="rowCheckboxes" class="mg-check-cell" />
|
|
1868
|
-
<td v-if="rowNumbers" class="mg-rownum-cell" />
|
|
1869
|
-
<td
|
|
1870
|
-
v-for="(col, colIndex) in state.visibleColumns"
|
|
1871
|
-
:key="col.field"
|
|
1872
|
-
:class="{
|
|
1873
|
-
'mg-pinned': !!col.pinned,
|
|
1874
|
-
'mg-pin-left-edge': colIndex === lastLeftPinIdx,
|
|
1875
|
-
'mg-pin-right-edge': colIndex === firstRightPinIdx,
|
|
1876
|
-
}"
|
|
1877
|
-
:style="pinStyleOf(col)"
|
|
1878
|
-
>
|
|
1879
|
-
{{ grid.getCellText(prow, col) }}
|
|
1880
|
-
</td>
|
|
1881
|
-
</tr>
|
|
1882
|
-
<tr
|
|
1883
|
-
v-if="virtual && virtual.startOffset > 0"
|
|
1884
|
-
class="mg-spacer"
|
|
1885
|
-
aria-hidden="true"
|
|
1886
|
-
>
|
|
1887
|
-
<td :colspan="colSpan" :style="{ height: `${virtual.startOffset}px`, padding: 0 }" />
|
|
1888
|
-
</tr>
|
|
1889
|
-
<tr v-if="bodyRows.length === 0">
|
|
1890
|
-
<td class="mg-empty" :colspan="colSpan">{{ state.locale.noRows }}</td>
|
|
1891
|
-
</tr>
|
|
1892
|
-
<template v-for="(entry, rowIdx) in bodyRows">
|
|
1893
|
-
<!-- 그룹 헤더 행 -->
|
|
1894
|
-
<tr
|
|
1895
|
-
v-if="isGroupRow(entry)"
|
|
1896
|
-
:key="rowKeyOf(entry)"
|
|
1897
|
-
class="mg-group-row"
|
|
1898
|
-
@click="onToggleGroup(entry)"
|
|
1899
|
-
>
|
|
1900
|
-
<td v-if="rowStatus" class="mg-status-cell" />
|
|
1901
|
-
<td v-if="rowCheckboxes" class="mg-check-cell" />
|
|
1902
|
-
<td v-if="rowNumbers" class="mg-rownum-cell" />
|
|
1903
|
-
<td
|
|
2251
|
+
</th>
|
|
2252
|
+
</template>
|
|
2253
|
+
</tr>
|
|
2254
|
+
<tr v-if="hasFilterRow" class="mg-filter-row">
|
|
2255
|
+
<th v-if="rowStatus" class="mg-status-cell" />
|
|
2256
|
+
<th v-if="rowCheckboxes" class="mg-check-cell" />
|
|
2257
|
+
<th v-if="rowNumbers" class="mg-rownum-cell" />
|
|
2258
|
+
<th
|
|
1904
2259
|
v-for="(col, colIndex) in state.visibleColumns"
|
|
1905
2260
|
:key="col.field"
|
|
1906
|
-
class="mg-group-cell"
|
|
1907
2261
|
:class="{
|
|
1908
2262
|
'mg-pinned': !!col.pinned,
|
|
1909
2263
|
'mg-pin-left-edge': colIndex === lastLeftPinIdx,
|
|
@@ -1911,35 +2265,78 @@ watch(
|
|
|
1911
2265
|
}"
|
|
1912
2266
|
:style="pinStyleOf(col)"
|
|
1913
2267
|
>
|
|
1914
|
-
<
|
|
1915
|
-
v-if="
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
2268
|
+
<div v-if="col.filterable" class="mg-filter-cell">
|
|
2269
|
+
<details v-if="isSetFilter(col)" class="mg-setfilter">
|
|
2270
|
+
<summary>{{ setFilterLabel(col) }}</summary>
|
|
2271
|
+
<div class="mg-setfilter-panel">
|
|
2272
|
+
<label class="mg-setfilter-item">
|
|
2273
|
+
<input
|
|
2274
|
+
type="checkbox"
|
|
2275
|
+
:checked="setAllCheckedOf(col)"
|
|
2276
|
+
@change="grid.setFilter(col.field, null)"
|
|
2277
|
+
/>
|
|
2278
|
+
{{ state.locale.setFilterAll }}
|
|
2279
|
+
</label>
|
|
2280
|
+
<label
|
|
2281
|
+
v-for="v in setValuesOf(col)"
|
|
2282
|
+
:key="v"
|
|
2283
|
+
class="mg-setfilter-item"
|
|
2284
|
+
>
|
|
2285
|
+
<input
|
|
2286
|
+
type="checkbox"
|
|
2287
|
+
:checked="setCheckedOf(col, v)"
|
|
2288
|
+
@change="onSetToggle(col, v, $event)"
|
|
2289
|
+
/>
|
|
2290
|
+
{{ v }}
|
|
2291
|
+
</label>
|
|
2292
|
+
</div>
|
|
2293
|
+
</details>
|
|
2294
|
+
<template v-else>
|
|
2295
|
+
<select
|
|
2296
|
+
class="mg-filter-op"
|
|
2297
|
+
:value="filterOpOf(col)"
|
|
2298
|
+
@change="onFilterOpChange(col, $event)"
|
|
2299
|
+
>
|
|
2300
|
+
<option
|
|
2301
|
+
v-for="op in filterOpsOf(col)"
|
|
2302
|
+
:key="op"
|
|
2303
|
+
:value="op"
|
|
2304
|
+
>
|
|
2305
|
+
{{ FILTER_OPERATOR_LABELS[op] }}
|
|
2306
|
+
</option>
|
|
2307
|
+
</select>
|
|
2308
|
+
<input
|
|
2309
|
+
class="mg-filter-input"
|
|
2310
|
+
:type="filterInputType(col)"
|
|
2311
|
+
:value="filterValueOf(col, 'value')"
|
|
2312
|
+
:placeholder="`${col.header || col.field} 필터`"
|
|
2313
|
+
@input="onFilterInput(col, 'value', $event)"
|
|
2314
|
+
/>
|
|
2315
|
+
<input
|
|
2316
|
+
v-if="filterOpOf(col) === 'inRange'"
|
|
2317
|
+
class="mg-filter-input mg-filter-to"
|
|
2318
|
+
:type="filterInputType(col)"
|
|
2319
|
+
:value="filterValueOf(col, 'valueTo')"
|
|
2320
|
+
:placeholder="state.locale.rangeEndPlaceholder"
|
|
2321
|
+
@input="onFilterInput(col, 'valueTo', $event)"
|
|
2322
|
+
/>
|
|
2323
|
+
</template>
|
|
2324
|
+
</div>
|
|
2325
|
+
</th>
|
|
1929
2326
|
</tr>
|
|
1930
|
-
|
|
2327
|
+
</thead>
|
|
2328
|
+
<tbody role="rowgroup">
|
|
1931
2329
|
<tr
|
|
1932
|
-
v-
|
|
1933
|
-
:key="
|
|
1934
|
-
class="mg-
|
|
2330
|
+
v-for="(prow, pIdx) in state.pinnedTopRows"
|
|
2331
|
+
:key="`pin-top-${pIdx}`"
|
|
2332
|
+
class="mg-pinned-top-row"
|
|
1935
2333
|
>
|
|
1936
2334
|
<td v-if="rowStatus" class="mg-status-cell" />
|
|
1937
2335
|
<td v-if="rowCheckboxes" class="mg-check-cell" />
|
|
1938
|
-
|
|
2336
|
+
<td v-if="rowNumbers" class="mg-rownum-cell" />
|
|
1939
2337
|
<td
|
|
1940
2338
|
v-for="(col, colIndex) in state.visibleColumns"
|
|
1941
2339
|
:key="col.field"
|
|
1942
|
-
class="mg-subtotal-cell"
|
|
1943
2340
|
:class="{
|
|
1944
2341
|
'mg-pinned': !!col.pinned,
|
|
1945
2342
|
'mg-pin-left-edge': colIndex === lastLeftPinIdx,
|
|
@@ -1947,434 +2344,656 @@ watch(
|
|
|
1947
2344
|
}"
|
|
1948
2345
|
:style="pinStyleOf(col)"
|
|
1949
2346
|
>
|
|
1950
|
-
|
|
1951
|
-
v-if="colIndex === 0"
|
|
1952
|
-
class="mg-subtotal-label"
|
|
1953
|
-
:style="{ paddingLeft: `${groupOf(entry).depth * 16}px` }"
|
|
1954
|
-
>
|
|
1955
|
-
{{ state.locale.subtotalLabel }}: {{ groupLabelOf(entry) }}
|
|
1956
|
-
</span>
|
|
1957
|
-
<span v-else-if="groupAggOf(entry, col)" class="mg-agg">
|
|
1958
|
-
{{ groupAggOf(entry, col) }}
|
|
1959
|
-
</span>
|
|
2347
|
+
{{ grid.getCellText(prow, col) }}
|
|
1960
2348
|
</td>
|
|
1961
2349
|
</tr>
|
|
1962
|
-
<!-- 서버 사이드 미로드 행 → 스켈레톤 -->
|
|
1963
2350
|
<tr
|
|
1964
|
-
v-
|
|
1965
|
-
|
|
1966
|
-
class="mg-skeleton-row"
|
|
2351
|
+
v-if="virtual && virtual.startOffset > 0"
|
|
2352
|
+
class="mg-spacer"
|
|
1967
2353
|
aria-hidden="true"
|
|
1968
2354
|
>
|
|
1969
|
-
<td v-if="rowStatus" class="mg-status-cell" />
|
|
1970
|
-
<td v-if="rowCheckboxes" class="mg-check-cell" />
|
|
1971
|
-
<td v-if="rowNumbers" class="mg-rownum-cell" />
|
|
1972
2355
|
<td
|
|
1973
|
-
|
|
1974
|
-
:
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
}
|
|
1980
|
-
:style="pinStyleOf(col)"
|
|
1981
|
-
>
|
|
1982
|
-
<span class="mg-skeleton-bar" />
|
|
2356
|
+
:colspan="colSpan"
|
|
2357
|
+
:style="{ height: `${virtual.startOffset}px`, padding: 0 }"
|
|
2358
|
+
/>
|
|
2359
|
+
</tr>
|
|
2360
|
+
<tr v-if="bodyRows.length === 0">
|
|
2361
|
+
<td class="mg-empty" :colspan="colSpan">
|
|
2362
|
+
{{ state.locale.noRows }}
|
|
1983
2363
|
</td>
|
|
1984
2364
|
</tr>
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
:style="rowStyleOf(entry, rowIdx)"
|
|
1993
|
-
@click="selectable && grid.toggleRowSelection(grid.getRowId(rowDataOf(entry)))"
|
|
1994
|
-
@dragover="onRowDragOver(entryIndexOf(entry, rowIdx), $event)"
|
|
1995
|
-
@drop="onRowDrop($event)"
|
|
1996
|
-
>
|
|
1997
|
-
<td
|
|
1998
|
-
v-if="rowStatus"
|
|
1999
|
-
class="mg-status-cell"
|
|
2000
|
-
:class="
|
|
2001
|
-
rowStateOf(rowDataOf(entry))
|
|
2002
|
-
? `mg-status-${rowStateOf(rowDataOf(entry))}`
|
|
2003
|
-
: undefined
|
|
2004
|
-
"
|
|
2365
|
+
<template v-for="(entry, rowIdx) in bodyRows">
|
|
2366
|
+
<!-- 그룹 헤더 행 -->
|
|
2367
|
+
<tr
|
|
2368
|
+
v-if="isGroupRow(entry)"
|
|
2369
|
+
:key="rowKeyOf(entry, rowIdx)"
|
|
2370
|
+
class="mg-group-row"
|
|
2371
|
+
@click="onToggleGroup(entry)"
|
|
2005
2372
|
>
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2373
|
+
<td v-if="rowStatus" class="mg-status-cell" />
|
|
2374
|
+
<td v-if="rowCheckboxes" class="mg-check-cell" />
|
|
2375
|
+
<td v-if="rowNumbers" class="mg-rownum-cell" />
|
|
2376
|
+
<td
|
|
2377
|
+
v-for="(col, colIndex) in state.visibleColumns"
|
|
2378
|
+
:key="col.field"
|
|
2379
|
+
class="mg-group-cell"
|
|
2380
|
+
:class="{
|
|
2381
|
+
'mg-pinned': !!col.pinned,
|
|
2382
|
+
'mg-pin-left-edge': colIndex === lastLeftPinIdx,
|
|
2383
|
+
'mg-pin-right-edge': colIndex === firstRightPinIdx,
|
|
2384
|
+
}"
|
|
2385
|
+
:style="pinStyleOf(col)"
|
|
2386
|
+
>
|
|
2387
|
+
<span
|
|
2388
|
+
v-if="colIndex === 0"
|
|
2389
|
+
class="mg-group-label"
|
|
2390
|
+
:style="{ paddingLeft: `${groupOf(entry).depth * 16}px` }"
|
|
2391
|
+
>
|
|
2392
|
+
<span class="mg-group-toggle">
|
|
2393
|
+
{{ groupOf(entry).expanded ? "▾" : "▸" }}
|
|
2394
|
+
</span>
|
|
2395
|
+
<strong>{{ groupLabelOf(entry) }}</strong>
|
|
2396
|
+
<span class="mg-group-count"
|
|
2397
|
+
>({{ groupOf(entry).rowCount }})</span
|
|
2398
|
+
>
|
|
2399
|
+
</span>
|
|
2400
|
+
<span v-else-if="groupAggOf(entry, col)" class="mg-agg">
|
|
2401
|
+
{{ groupAggOf(entry, col) }}
|
|
2402
|
+
</span>
|
|
2403
|
+
</td>
|
|
2404
|
+
</tr>
|
|
2405
|
+
<!-- 그룹 소계 행 -->
|
|
2406
|
+
<tr
|
|
2407
|
+
v-else-if="isSubtotalRow(entry)"
|
|
2408
|
+
:key="rowKeyOf(entry, rowIdx)"
|
|
2409
|
+
class="mg-subtotal-row"
|
|
2012
2410
|
>
|
|
2013
|
-
<
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
"
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2411
|
+
<td v-if="rowStatus" class="mg-status-cell" />
|
|
2412
|
+
<td v-if="rowCheckboxes" class="mg-check-cell" />
|
|
2413
|
+
<td v-if="rowNumbers" class="mg-rownum-cell" />
|
|
2414
|
+
<td
|
|
2415
|
+
v-for="(col, colIndex) in state.visibleColumns"
|
|
2416
|
+
:key="col.field"
|
|
2417
|
+
class="mg-subtotal-cell"
|
|
2418
|
+
:class="{
|
|
2419
|
+
'mg-pinned': !!col.pinned,
|
|
2420
|
+
'mg-pin-left-edge': colIndex === lastLeftPinIdx,
|
|
2421
|
+
'mg-pin-right-edge': colIndex === firstRightPinIdx,
|
|
2422
|
+
}"
|
|
2423
|
+
:style="pinStyleOf(col)"
|
|
2424
|
+
>
|
|
2425
|
+
<span
|
|
2426
|
+
v-if="colIndex === 0"
|
|
2427
|
+
class="mg-subtotal-label"
|
|
2428
|
+
:style="{ paddingLeft: `${groupOf(entry).depth * 16}px` }"
|
|
2429
|
+
>
|
|
2430
|
+
{{ state.locale.subtotalLabel }}: {{ groupLabelOf(entry) }}
|
|
2431
|
+
</span>
|
|
2432
|
+
<span v-else-if="groupAggOf(entry, col)" class="mg-agg">
|
|
2433
|
+
{{ groupAggOf(entry, col) }}
|
|
2434
|
+
</span>
|
|
2435
|
+
</td>
|
|
2436
|
+
</tr>
|
|
2437
|
+
<!-- 서버 사이드 미로드 행 → 스켈레톤 -->
|
|
2438
|
+
<tr
|
|
2439
|
+
v-else-if="rowDataOf(entry) == null"
|
|
2440
|
+
:key="rowKeyOf(entry, rowIdx)"
|
|
2441
|
+
class="mg-skeleton-row"
|
|
2442
|
+
aria-hidden="true"
|
|
2034
2443
|
>
|
|
2035
|
-
|
|
2036
|
-
v-if="
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
{
|
|
2043
|
-
'mg-cell-readonly': !grid.isCellEditable(entryIndexOf(entry, rowIdx), colIndex),
|
|
2044
|
-
'mg-cell-active': grid.isActiveCell(entryIndexOf(entry, rowIdx), colIndex),
|
|
2045
|
-
'mg-cell-selected': grid.isCellInRange(entryIndexOf(entry, rowIdx), colIndex),
|
|
2046
|
-
'mg-cell-editing': isEditingCell(entryIndexOf(entry, rowIdx), colIndex),
|
|
2047
|
-
'mg-cell-invalid': !!cellErrorOf(entry, col),
|
|
2048
|
-
'mg-find-match': isFindMatch(entry, col),
|
|
2049
|
-
'mg-cell-flash': state.flashedCells?.has(grid.getRowId(rowDataOf(entry)) + '|' + String(col.field)),
|
|
2050
|
-
'mg-multiline': !!col.multiLine,
|
|
2444
|
+
<td v-if="rowStatus" class="mg-status-cell" />
|
|
2445
|
+
<td v-if="rowCheckboxes" class="mg-check-cell" />
|
|
2446
|
+
<td v-if="rowNumbers" class="mg-rownum-cell" />
|
|
2447
|
+
<td
|
|
2448
|
+
v-for="(col, colIndex) in state.visibleColumns"
|
|
2449
|
+
:key="col.field"
|
|
2450
|
+
:class="{
|
|
2051
2451
|
'mg-pinned': !!col.pinned,
|
|
2052
2452
|
'mg-pin-left-edge': colIndex === lastLeftPinIdx,
|
|
2053
2453
|
'mg-pin-right-edge': colIndex === firstRightPinIdx,
|
|
2054
|
-
}
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
"
|
|
2065
|
-
:
|
|
2066
|
-
|
|
2067
|
-
colIndex === 0 && leafDepthOf(entry)
|
|
2068
|
-
? { paddingLeft: `${leafDepthOf(entry) * 16 + 12}px` }
|
|
2069
|
-
: undefined,
|
|
2070
|
-
grid.getCellStyle(
|
|
2071
|
-
rowDataOf(entry),
|
|
2072
|
-
entryIndexOf(entry, rowIdx),
|
|
2073
|
-
col,
|
|
2074
|
-
) ?? undefined,
|
|
2075
|
-
]"
|
|
2076
|
-
:data-mg-row="entryIndexOf(entry, rowIdx)"
|
|
2077
|
-
:data-mg-col="colIndex"
|
|
2078
|
-
@mousedown="
|
|
2079
|
-
onCellMouseDown(
|
|
2080
|
-
$event,
|
|
2081
|
-
entryIndexOf(entry, rowIdx),
|
|
2082
|
-
colIndex,
|
|
2083
|
-
col,
|
|
2084
|
-
)
|
|
2085
|
-
"
|
|
2086
|
-
@mouseenter="
|
|
2087
|
-
onCellMouseEnter(entryIndexOf(entry, rowIdx), colIndex)
|
|
2454
|
+
}"
|
|
2455
|
+
:style="pinStyleOf(col)"
|
|
2456
|
+
>
|
|
2457
|
+
<span class="mg-skeleton-bar" />
|
|
2458
|
+
</td>
|
|
2459
|
+
</tr>
|
|
2460
|
+
<!-- 리프(데이터) 행 -->
|
|
2461
|
+
<tr
|
|
2462
|
+
v-else
|
|
2463
|
+
:key="rowKeyOf(entry, rowIdx)"
|
|
2464
|
+
role="row"
|
|
2465
|
+
:aria-selected="
|
|
2466
|
+
state.selectedRowIds.has(grid.getRowId(rowDataOf(entry)))
|
|
2088
2467
|
"
|
|
2468
|
+
:class="rowClassOf(entry, rowIdx)"
|
|
2469
|
+
:style="rowStyleOf(entry, rowIdx)"
|
|
2089
2470
|
@click="
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
@dblclick="
|
|
2093
|
-
grid.notifyCellEvent('cellDblClick', entryIndexOf(entry, rowIdx), colIndex);
|
|
2094
|
-
grid.startEditing(entryIndexOf(entry, rowIdx), colIndex);
|
|
2471
|
+
selectable &&
|
|
2472
|
+
grid.toggleRowSelection(grid.getRowId(rowDataOf(entry)))
|
|
2095
2473
|
"
|
|
2096
|
-
@
|
|
2474
|
+
@dragover="onRowDragOver(entryIndexOf(entry, rowIdx), $event)"
|
|
2475
|
+
@drop="onRowDrop($event)"
|
|
2097
2476
|
>
|
|
2098
|
-
<
|
|
2099
|
-
v-if="
|
|
2100
|
-
|
|
2101
|
-
class="
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
>
|
|
2107
|
-
{{ leafHasChildren(entry) ? (leafExpanded(entry) ? "▾" : "▸") : "" }}
|
|
2108
|
-
</button>
|
|
2109
|
-
<span
|
|
2110
|
-
v-if="grid.isActiveCell(entryIndexOf(entry, rowIdx), colIndex) && !isEditingCell(entryIndexOf(entry, rowIdx), colIndex)"
|
|
2111
|
-
class="mg-fill-handle"
|
|
2112
|
-
@mousedown="onFillMouseDown"
|
|
2113
|
-
></span>
|
|
2114
|
-
<span
|
|
2115
|
-
v-if="col.rowDrag && !isEditingCell(entryIndexOf(entry, rowIdx), colIndex)"
|
|
2116
|
-
class="mg-row-drag-handle"
|
|
2117
|
-
:class="{ 'mg-disabled': !rowDraggable }"
|
|
2118
|
-
:draggable="rowDraggable"
|
|
2119
|
-
title="행 이동"
|
|
2120
|
-
@dragstart="onRowDragStart(entryIndexOf(entry, rowIdx), $event)"
|
|
2121
|
-
@dragend="onRowDragEnd"
|
|
2122
|
-
>⠿</span
|
|
2477
|
+
<td
|
|
2478
|
+
v-if="rowStatus"
|
|
2479
|
+
class="mg-status-cell"
|
|
2480
|
+
:class="
|
|
2481
|
+
rowStateOf(rowDataOf(entry))
|
|
2482
|
+
? `mg-status-${rowStateOf(rowDataOf(entry))}`
|
|
2483
|
+
: undefined
|
|
2484
|
+
"
|
|
2123
2485
|
>
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2486
|
+
{{ rowStateOf(rowDataOf(entry)) ?? "" }}
|
|
2487
|
+
</td>
|
|
2488
|
+
<td v-if="rowCheckboxes" class="mg-check-cell" @click.stop>
|
|
2489
|
+
<input
|
|
2490
|
+
type="checkbox"
|
|
2491
|
+
aria-label="행 선택"
|
|
2492
|
+
:checked="isSelected(rowDataOf(entry))"
|
|
2493
|
+
:indeterminate.prop="
|
|
2494
|
+
grid.isRowSelectionIndeterminate(
|
|
2495
|
+
grid.getRowId(rowDataOf(entry)),
|
|
2496
|
+
)
|
|
2497
|
+
"
|
|
2498
|
+
:disabled="!grid.isRowSelectable(rowDataOf(entry))"
|
|
2499
|
+
@change="
|
|
2500
|
+
grid.toggleRowSelection(grid.getRowId(rowDataOf(entry)))
|
|
2501
|
+
"
|
|
2502
|
+
/>
|
|
2503
|
+
</td>
|
|
2504
|
+
<td v-if="rowNumbers" class="mg-rownum-cell">
|
|
2505
|
+
{{ entryIndexOf(entry, rowIdx) + 1 }}
|
|
2506
|
+
<span
|
|
2507
|
+
v-if="rowResizable && !virtual"
|
|
2508
|
+
class="mg-row-resizer"
|
|
2509
|
+
title="행 높이 조정"
|
|
2510
|
+
@pointerdown="
|
|
2511
|
+
onRowResizeStart(grid.getRowId(rowDataOf(entry)), $event)
|
|
2512
|
+
"
|
|
2513
|
+
/>
|
|
2514
|
+
</td>
|
|
2515
|
+
<template v-for="(col, colIndex) in state.visibleColumns">
|
|
2516
|
+
<td
|
|
2517
|
+
v-if="!cellSpanOf(rowDataOf(entry), col).hidden"
|
|
2518
|
+
:key="col.field"
|
|
2519
|
+
:rowspan="cellSpanOf(rowDataOf(entry), col).rowSpan"
|
|
2520
|
+
:colspan="cellSpanOf(rowDataOf(entry), col).colSpan"
|
|
2521
|
+
:class="[
|
|
2522
|
+
col.align && col.align !== 'left'
|
|
2523
|
+
? `mg-align-${col.align}`
|
|
2524
|
+
: '',
|
|
2525
|
+
{
|
|
2526
|
+
'mg-cell-readonly': !grid.isCellEditable(
|
|
2527
|
+
entryIndexOf(entry, rowIdx),
|
|
2528
|
+
colIndex,
|
|
2529
|
+
),
|
|
2530
|
+
'mg-cell-active': grid.isActiveCell(
|
|
2531
|
+
entryIndexOf(entry, rowIdx),
|
|
2532
|
+
colIndex,
|
|
2533
|
+
),
|
|
2534
|
+
'mg-cell-selected': grid.isCellInRange(
|
|
2535
|
+
entryIndexOf(entry, rowIdx),
|
|
2536
|
+
colIndex,
|
|
2537
|
+
),
|
|
2538
|
+
'mg-cell-editing': isEditingCell(
|
|
2539
|
+
entryIndexOf(entry, rowIdx),
|
|
2540
|
+
colIndex,
|
|
2541
|
+
),
|
|
2542
|
+
'mg-cell-invalid': !!cellErrorOf(entry, col),
|
|
2543
|
+
'mg-find-match': isFindMatch(entry, col),
|
|
2544
|
+
'mg-cell-flash': state.flashedCells?.has(
|
|
2545
|
+
grid.getRowId(rowDataOf(entry)) +
|
|
2546
|
+
'|' +
|
|
2547
|
+
String(col.field),
|
|
2548
|
+
),
|
|
2549
|
+
'mg-multiline': !!col.multiLine,
|
|
2550
|
+
'mg-pinned': !!col.pinned,
|
|
2551
|
+
'mg-pin-left-edge': colIndex === lastLeftPinIdx,
|
|
2552
|
+
'mg-pin-right-edge': colIndex === firstRightPinIdx,
|
|
2553
|
+
},
|
|
2554
|
+
cellClassOf(entry, rowIdx, col),
|
|
2555
|
+
cellNoteOf(entry, col) && 'mg-cell-note',
|
|
2556
|
+
]"
|
|
2557
|
+
role="gridcell"
|
|
2558
|
+
:title="
|
|
2559
|
+
cellErrorOf(entry, col) ||
|
|
2560
|
+
grid.getCellTooltip(rowDataOf(entry), col) ||
|
|
2561
|
+
cellNoteOf(entry, col) ||
|
|
2562
|
+
undefined
|
|
2563
|
+
"
|
|
2564
|
+
:style="[
|
|
2565
|
+
pinStyleOf(col),
|
|
2566
|
+
colIndex === 0 && leafDepthOf(entry)
|
|
2567
|
+
? { paddingLeft: `${leafDepthOf(entry) * 16 + 12}px` }
|
|
2568
|
+
: undefined,
|
|
2569
|
+
grid.getCellStyle(
|
|
2570
|
+
rowDataOf(entry),
|
|
2571
|
+
entryIndexOf(entry, rowIdx),
|
|
2572
|
+
col,
|
|
2573
|
+
) ?? undefined,
|
|
2574
|
+
]"
|
|
2575
|
+
:data-mg-row="entryIndexOf(entry, rowIdx)"
|
|
2576
|
+
:data-mg-col="colIndex"
|
|
2577
|
+
@mousedown="
|
|
2578
|
+
onCellMouseDown(
|
|
2579
|
+
$event,
|
|
2580
|
+
entryIndexOf(entry, rowIdx),
|
|
2581
|
+
colIndex,
|
|
2582
|
+
col,
|
|
2583
|
+
)
|
|
2584
|
+
"
|
|
2585
|
+
@mouseenter="
|
|
2586
|
+
onCellMouseEnter(entryIndexOf(entry, rowIdx), colIndex)
|
|
2587
|
+
"
|
|
2588
|
+
@click="onCellClick(entryIndexOf(entry, rowIdx), colIndex)"
|
|
2589
|
+
@dblclick="
|
|
2590
|
+
grid.notifyCellEvent(
|
|
2591
|
+
'cellDblClick',
|
|
2592
|
+
entryIndexOf(entry, rowIdx),
|
|
2593
|
+
colIndex,
|
|
2594
|
+
);
|
|
2595
|
+
grid.startEditing(entryIndexOf(entry, rowIdx), colIndex);
|
|
2596
|
+
"
|
|
2597
|
+
@contextmenu="
|
|
2598
|
+
onCellContextMenu($event, entryIndexOf(entry, rowIdx), col)
|
|
2599
|
+
"
|
|
2600
|
+
@pointerdown="
|
|
2601
|
+
onCellPointerDown($event, entryIndexOf(entry, rowIdx), col)
|
|
2602
|
+
"
|
|
2129
2603
|
>
|
|
2130
|
-
<
|
|
2131
|
-
v-if="
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
@keydown="onEditorKeydown"
|
|
2137
|
-
@click.stop
|
|
2604
|
+
<button
|
|
2605
|
+
v-if="hasDetailSlot && colIndex === 0"
|
|
2606
|
+
type="button"
|
|
2607
|
+
class="mg-detail-toggle"
|
|
2608
|
+
title="행 상세"
|
|
2609
|
+
aria-label="행 상세 펼치기/접기"
|
|
2138
2610
|
@mousedown.stop
|
|
2611
|
+
@click.stop="
|
|
2612
|
+
grid.toggleRowDetail(grid.getRowId(rowDataOf(entry)))
|
|
2613
|
+
"
|
|
2139
2614
|
>
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2615
|
+
{{
|
|
2616
|
+
state.detailExpanded.has(grid.getRowId(rowDataOf(entry)))
|
|
2617
|
+
? "▾"
|
|
2618
|
+
: "▸"
|
|
2619
|
+
}}
|
|
2620
|
+
</button>
|
|
2621
|
+
<button
|
|
2622
|
+
v-if="
|
|
2623
|
+
colIndex === 0 && leafHasChildren(entry) !== undefined
|
|
2624
|
+
"
|
|
2625
|
+
type="button"
|
|
2626
|
+
class="mg-tree-toggle"
|
|
2627
|
+
:class="{ 'mg-tree-leaf': !leafHasChildren(entry) }"
|
|
2628
|
+
:aria-label="leafExpanded(entry) ? '접기' : '펼치기'"
|
|
2629
|
+
:disabled="!leafHasChildren(entry)"
|
|
2630
|
+
@click.stop="
|
|
2631
|
+
grid.toggleTreeExpanded(grid.getRowId(rowDataOf(entry)))
|
|
2632
|
+
"
|
|
2154
2633
|
>
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2634
|
+
{{
|
|
2635
|
+
leafHasChildren(entry)
|
|
2636
|
+
? leafExpanded(entry)
|
|
2637
|
+
? "▾"
|
|
2638
|
+
: "▸"
|
|
2639
|
+
: ""
|
|
2640
|
+
}}
|
|
2641
|
+
</button>
|
|
2642
|
+
<span
|
|
2643
|
+
v-if="
|
|
2644
|
+
grid.isActiveCell(
|
|
2645
|
+
entryIndexOf(entry, rowIdx),
|
|
2646
|
+
colIndex,
|
|
2647
|
+
) && !isEditingCell(entryIndexOf(entry, rowIdx), colIndex)
|
|
2648
|
+
"
|
|
2649
|
+
class="mg-fill-handle"
|
|
2650
|
+
@pointerdown="onFillPointerDown"
|
|
2651
|
+
></span>
|
|
2652
|
+
<span
|
|
2653
|
+
v-if="
|
|
2654
|
+
col.rowDrag &&
|
|
2655
|
+
!isEditingCell(entryIndexOf(entry, rowIdx), colIndex)
|
|
2656
|
+
"
|
|
2657
|
+
class="mg-row-drag-handle"
|
|
2658
|
+
:class="{ 'mg-disabled': !rowDraggable }"
|
|
2659
|
+
:draggable="rowDraggable"
|
|
2660
|
+
title="행 이동"
|
|
2661
|
+
@pointerdown="
|
|
2662
|
+
onRowDragPointerDown($event, entryIndexOf(entry, rowIdx))
|
|
2663
|
+
"
|
|
2664
|
+
@dragstart="
|
|
2665
|
+
onRowDragStart(entryIndexOf(entry, rowIdx), $event)
|
|
2666
|
+
"
|
|
2667
|
+
@dragend="onRowDragEnd"
|
|
2668
|
+
>⠿</span
|
|
2168
2669
|
>
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2670
|
+
<template
|
|
2671
|
+
v-if="isEditingCell(entryIndexOf(entry, rowIdx), colIndex)"
|
|
2672
|
+
>
|
|
2673
|
+
<!-- 커스텀 에디터 슬롯: #editor-{field}="ctx" -->
|
|
2674
|
+
<slot
|
|
2675
|
+
:name="`editor-${col.field}`"
|
|
2676
|
+
v-bind="
|
|
2677
|
+
editorContext(entryIndexOf(entry, rowIdx), colIndex)
|
|
2678
|
+
"
|
|
2173
2679
|
>
|
|
2680
|
+
<select
|
|
2681
|
+
v-if="col.cellEditor === 'select'"
|
|
2682
|
+
class="mg-editor"
|
|
2683
|
+
:class="{ 'mg-editor-error': editErrorOf(col) }"
|
|
2684
|
+
:value="editorInputValue(editValueOf(col))"
|
|
2685
|
+
@change="onSelectPick($event, col)"
|
|
2686
|
+
@keydown="onEditorKeydown"
|
|
2687
|
+
@click.stop
|
|
2688
|
+
@mousedown.stop
|
|
2689
|
+
>
|
|
2690
|
+
<option
|
|
2691
|
+
v-for="opt in editorOptionsOf(col, rowDataOf(entry))"
|
|
2692
|
+
:key="opt"
|
|
2693
|
+
:value="opt"
|
|
2694
|
+
>
|
|
2695
|
+
{{ opt }}
|
|
2696
|
+
</option>
|
|
2697
|
+
</select>
|
|
2698
|
+
<select
|
|
2699
|
+
v-else-if="col.cellEditor === 'multiselect'"
|
|
2700
|
+
class="mg-editor"
|
|
2701
|
+
:class="{ 'mg-editor-error': editErrorOf(col) }"
|
|
2702
|
+
multiple
|
|
2703
|
+
:size="
|
|
2704
|
+
Math.min(
|
|
2705
|
+
Math.max(
|
|
2706
|
+
editorOptionsOf(col, rowDataOf(entry)).length,
|
|
2707
|
+
2,
|
|
2708
|
+
),
|
|
2709
|
+
8,
|
|
2710
|
+
)
|
|
2711
|
+
"
|
|
2712
|
+
@change="onMultiselectChange($event, col)"
|
|
2713
|
+
@keydown="onEditorKeydown"
|
|
2714
|
+
@click.stop
|
|
2715
|
+
@mousedown.stop
|
|
2716
|
+
>
|
|
2717
|
+
<option
|
|
2718
|
+
v-for="opt in editorOptionsOf(col, rowDataOf(entry))"
|
|
2719
|
+
:key="opt"
|
|
2720
|
+
:value="opt"
|
|
2721
|
+
:selected="isEditOptSelected(opt, col)"
|
|
2722
|
+
>
|
|
2723
|
+
{{ opt }}
|
|
2724
|
+
</option>
|
|
2725
|
+
</select>
|
|
2726
|
+
<div
|
|
2727
|
+
v-else-if="col.cellEditor === 'radio'"
|
|
2728
|
+
class="mg-radio-group"
|
|
2729
|
+
role="radiogroup"
|
|
2730
|
+
>
|
|
2731
|
+
<label
|
|
2732
|
+
v-for="opt in editorOptionsOf(col, rowDataOf(entry))"
|
|
2733
|
+
:key="opt"
|
|
2734
|
+
class="mg-radio-label"
|
|
2735
|
+
>
|
|
2736
|
+
<input
|
|
2737
|
+
type="radio"
|
|
2738
|
+
:checked="String(editValueOf(col) ?? '') === opt"
|
|
2739
|
+
@change="onRadioPick(opt, col)"
|
|
2740
|
+
@click.stop
|
|
2741
|
+
@mousedown.stop
|
|
2742
|
+
/>
|
|
2743
|
+
<span>{{ opt }}</span>
|
|
2744
|
+
</label>
|
|
2745
|
+
</div>
|
|
2746
|
+
<textarea
|
|
2747
|
+
v-else-if="col.cellEditor === 'textarea'"
|
|
2748
|
+
class="mg-editor mg-editor-textarea"
|
|
2749
|
+
:class="{ 'mg-editor-error': editErrorOf(col) }"
|
|
2750
|
+
:value="editorInputValue(editValueOf(col))"
|
|
2751
|
+
@input="onEditorInput($event, col)"
|
|
2752
|
+
@keydown="onTextareaKeydown"
|
|
2753
|
+
@blur="
|
|
2754
|
+
state.editType !== 'fullRow' && grid.commitEditing()
|
|
2755
|
+
"
|
|
2756
|
+
@click.stop
|
|
2757
|
+
@dblclick.stop
|
|
2758
|
+
@mousedown.stop
|
|
2759
|
+
/>
|
|
2174
2760
|
<input
|
|
2175
|
-
|
|
2176
|
-
:
|
|
2177
|
-
|
|
2761
|
+
v-else
|
|
2762
|
+
:type="editorInputType(col)"
|
|
2763
|
+
class="mg-editor"
|
|
2764
|
+
:class="{ 'mg-editor-error': editErrorOf(col) }"
|
|
2765
|
+
:value="editorInputValue(editValueOf(col))"
|
|
2766
|
+
:list="
|
|
2767
|
+
editorInputType(col) === 'text' &&
|
|
2768
|
+
editorOptionsOf(col, rowDataOf(entry)).length
|
|
2769
|
+
? `mg-dl-${col.field}`
|
|
2770
|
+
: undefined
|
|
2771
|
+
"
|
|
2772
|
+
@input="onEditorInput($event, col)"
|
|
2773
|
+
@change="onDatePick($event, col)"
|
|
2774
|
+
@keydown="onEditorKeydown"
|
|
2178
2775
|
@click.stop
|
|
2179
2776
|
@mousedown.stop
|
|
2180
2777
|
/>
|
|
2181
|
-
<
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2778
|
+
<datalist
|
|
2779
|
+
v-if="
|
|
2780
|
+
editorInputType(col) === 'text' &&
|
|
2781
|
+
editorOptionsOf(col, rowDataOf(entry)).length
|
|
2782
|
+
"
|
|
2783
|
+
:id="`mg-dl-${col.field}`"
|
|
2784
|
+
>
|
|
2785
|
+
<option
|
|
2786
|
+
v-for="opt in editorOptionsOf(col, rowDataOf(entry))"
|
|
2787
|
+
:key="opt"
|
|
2788
|
+
:value="opt"
|
|
2789
|
+
/>
|
|
2790
|
+
</datalist>
|
|
2791
|
+
</slot>
|
|
2792
|
+
<span v-if="editErrorOf(col)" class="mg-edit-error">{{
|
|
2793
|
+
editErrorOf(col)
|
|
2794
|
+
}}</span>
|
|
2795
|
+
</template>
|
|
2796
|
+
<!-- 커스텀 셀 슬롯: #cell-{field}="{ value, row, column }" -->
|
|
2797
|
+
<slot
|
|
2197
2798
|
v-else
|
|
2198
|
-
:
|
|
2199
|
-
|
|
2200
|
-
:
|
|
2201
|
-
:
|
|
2202
|
-
:list="
|
|
2203
|
-
editorInputType(col) === 'text' && col.editorOptions?.length
|
|
2204
|
-
? `mg-dl-${col.field}`
|
|
2205
|
-
: undefined
|
|
2206
|
-
"
|
|
2207
|
-
@input="onEditorInput($event, col)"
|
|
2208
|
-
@keydown="onEditorKeydown"
|
|
2209
|
-
@click.stop
|
|
2210
|
-
@mousedown.stop
|
|
2211
|
-
/>
|
|
2212
|
-
<datalist
|
|
2213
|
-
v-if="
|
|
2214
|
-
editorInputType(col) === 'text' &&
|
|
2215
|
-
col.editorOptions?.length
|
|
2216
|
-
"
|
|
2217
|
-
:id="`mg-dl-${col.field}`"
|
|
2799
|
+
:name="`cell-${col.field}`"
|
|
2800
|
+
:value="grid.getCellValue(rowDataOf(entry), col)"
|
|
2801
|
+
:row="rowDataOf(entry)"
|
|
2802
|
+
:column="col"
|
|
2218
2803
|
>
|
|
2219
|
-
<
|
|
2220
|
-
v-
|
|
2221
|
-
|
|
2222
|
-
|
|
2804
|
+
<img
|
|
2805
|
+
v-if="
|
|
2806
|
+
col.cellType === 'image' &&
|
|
2807
|
+
grid.getCellValue(rowDataOf(entry), col) != null
|
|
2808
|
+
"
|
|
2809
|
+
class="mg-cell-image"
|
|
2810
|
+
:src="String(grid.getCellValue(rowDataOf(entry), col))"
|
|
2811
|
+
:alt="col.cellOptions?.alt?.(rowDataOf(entry)) ?? ''"
|
|
2812
|
+
/>
|
|
2813
|
+
<button
|
|
2814
|
+
v-else-if="col.cellType === 'button'"
|
|
2815
|
+
type="button"
|
|
2816
|
+
class="mg-cell-button"
|
|
2817
|
+
@click.stop="col.cellOptions?.onClick?.(rowDataOf(entry))"
|
|
2818
|
+
@dblclick.stop
|
|
2819
|
+
>
|
|
2820
|
+
{{ grid.getCellText(rowDataOf(entry), col) }}
|
|
2821
|
+
</button>
|
|
2822
|
+
<a
|
|
2823
|
+
v-else-if="col.cellType === 'link'"
|
|
2824
|
+
class="mg-cell-link"
|
|
2825
|
+
:href="cellLinkHref(rowDataOf(entry), col)"
|
|
2826
|
+
:target="col.cellOptions?.target ?? '_blank'"
|
|
2827
|
+
rel="noreferrer"
|
|
2828
|
+
@click.stop
|
|
2829
|
+
>
|
|
2830
|
+
{{ grid.getCellText(rowDataOf(entry), col) }}
|
|
2831
|
+
</a>
|
|
2832
|
+
<span
|
|
2833
|
+
v-else-if="col.cellType === 'progress'"
|
|
2834
|
+
class="mg-cell-progress"
|
|
2835
|
+
role="progressbar"
|
|
2836
|
+
:aria-valuenow="progressValueOf(rowDataOf(entry), col)"
|
|
2837
|
+
:aria-valuemax="col.cellOptions?.max ?? 100"
|
|
2838
|
+
>
|
|
2839
|
+
<span
|
|
2840
|
+
class="mg-cell-progress-bar"
|
|
2841
|
+
:style="{
|
|
2842
|
+
width: `${progressPctOf(rowDataOf(entry), col)}%`,
|
|
2843
|
+
}"
|
|
2844
|
+
/>
|
|
2845
|
+
<span class="mg-cell-progress-text"
|
|
2846
|
+
>{{
|
|
2847
|
+
Math.round(progressPctOf(rowDataOf(entry), col))
|
|
2848
|
+
}}%</span
|
|
2849
|
+
>
|
|
2850
|
+
</span>
|
|
2851
|
+
<!-- XSS 주의: html 셀은 신뢰할 수 있는 HTML만 -->
|
|
2852
|
+
<span
|
|
2853
|
+
v-else-if="col.cellType === 'html'"
|
|
2854
|
+
class="mg-cell-html"
|
|
2855
|
+
v-html="grid.getCellText(rowDataOf(entry), col)"
|
|
2223
2856
|
/>
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2857
|
+
<input
|
|
2858
|
+
v-else-if="col.cellEditor === 'checkbox'"
|
|
2859
|
+
type="checkbox"
|
|
2860
|
+
class="mg-cell-checkbox"
|
|
2861
|
+
:checked="grid.isCellChecked(rowDataOf(entry), col)"
|
|
2862
|
+
:disabled="
|
|
2863
|
+
!grid.isCellEditable(
|
|
2864
|
+
entryIndexOf(entry, rowIdx),
|
|
2865
|
+
colIndex,
|
|
2866
|
+
)
|
|
2867
|
+
"
|
|
2868
|
+
@click.stop
|
|
2869
|
+
@dblclick.stop
|
|
2870
|
+
@change="grid.toggleCellChecked(rowDataOf(entry), col)"
|
|
2871
|
+
/>
|
|
2872
|
+
<template v-else>{{
|
|
2873
|
+
grid.getCellText(rowDataOf(entry), col)
|
|
2874
|
+
}}</template>
|
|
2875
|
+
</slot>
|
|
2876
|
+
</td>
|
|
2227
2877
|
</template>
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
<
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
@dblclick.stop
|
|
2248
|
-
>
|
|
2249
|
-
{{ grid.getCellText(rowDataOf(entry), col) }}
|
|
2250
|
-
</button>
|
|
2251
|
-
<a
|
|
2252
|
-
v-else-if="col.cellType === 'link'"
|
|
2253
|
-
class="mg-cell-link"
|
|
2254
|
-
:href="cellLinkHref(rowDataOf(entry), col)"
|
|
2255
|
-
:target="col.cellOptions?.target ?? '_blank'"
|
|
2256
|
-
rel="noreferrer"
|
|
2257
|
-
@click.stop
|
|
2258
|
-
>
|
|
2259
|
-
{{ grid.getCellText(rowDataOf(entry), col) }}
|
|
2260
|
-
</a>
|
|
2261
|
-
<span
|
|
2262
|
-
v-else-if="col.cellType === 'progress'"
|
|
2263
|
-
class="mg-cell-progress"
|
|
2264
|
-
role="progressbar"
|
|
2265
|
-
:aria-valuenow="progressValueOf(rowDataOf(entry), col)"
|
|
2266
|
-
:aria-valuemax="col.cellOptions?.max ?? 100"
|
|
2267
|
-
>
|
|
2268
|
-
<span
|
|
2269
|
-
class="mg-cell-progress-bar"
|
|
2270
|
-
:style="{ width: `${progressPctOf(rowDataOf(entry), col)}%` }"
|
|
2878
|
+
</tr>
|
|
2879
|
+
<!-- 행 상세 패널 (master-detail) — #detail 슬롯 -->
|
|
2880
|
+
<tr
|
|
2881
|
+
v-if="
|
|
2882
|
+
hasDetailSlot &&
|
|
2883
|
+
!isGroupRow(entry) &&
|
|
2884
|
+
!isSubtotalRow(entry) &&
|
|
2885
|
+
rowDataOf(entry) != null &&
|
|
2886
|
+
state.detailExpanded.has(grid.getRowId(rowDataOf(entry)))
|
|
2887
|
+
"
|
|
2888
|
+
:key="rowKeyOf(entry, rowIdx) + '-detail'"
|
|
2889
|
+
class="mg-detail-row"
|
|
2890
|
+
>
|
|
2891
|
+
<td class="mg-detail-cell" :colspan="colSpan">
|
|
2892
|
+
<div class="mg-detail-content">
|
|
2893
|
+
<slot
|
|
2894
|
+
name="detail"
|
|
2895
|
+
:row="rowDataOf(entry)"
|
|
2896
|
+
:row-index="entryIndexOf(entry, rowIdx)"
|
|
2271
2897
|
/>
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
:disabled="!grid.isCellEditable(entryIndexOf(entry, rowIdx), colIndex)"
|
|
2286
|
-
@click.stop
|
|
2287
|
-
@dblclick.stop
|
|
2288
|
-
@change="grid.toggleCellChecked(rowDataOf(entry), col)"
|
|
2289
|
-
/>
|
|
2290
|
-
<template v-else>{{ grid.getCellText(rowDataOf(entry), col) }}</template>
|
|
2291
|
-
</slot>
|
|
2292
|
-
</td>
|
|
2293
|
-
</template>
|
|
2898
|
+
</div>
|
|
2899
|
+
</td>
|
|
2900
|
+
</tr>
|
|
2901
|
+
</template>
|
|
2902
|
+
<tr
|
|
2903
|
+
v-if="virtual && bottomOffset > 0"
|
|
2904
|
+
class="mg-spacer"
|
|
2905
|
+
aria-hidden="true"
|
|
2906
|
+
>
|
|
2907
|
+
<td
|
|
2908
|
+
:colspan="colSpan"
|
|
2909
|
+
:style="{ height: `${bottomOffset}px`, padding: 0 }"
|
|
2910
|
+
/>
|
|
2294
2911
|
</tr>
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
aria-hidden="true"
|
|
2300
|
-
>
|
|
2301
|
-
<td :colspan="colSpan" :style="{ height: `${bottomOffset}px`, padding: 0 }" />
|
|
2302
|
-
</tr>
|
|
2303
|
-
<tr
|
|
2304
|
-
v-for="(prow, pIdx) in state.pinnedBottomRows"
|
|
2305
|
-
:key="`pin-bottom-${pIdx}`"
|
|
2306
|
-
class="mg-pinned-bottom-row"
|
|
2307
|
-
>
|
|
2308
|
-
<td v-if="rowStatus" class="mg-status-cell" />
|
|
2309
|
-
<td v-if="rowCheckboxes" class="mg-check-cell" />
|
|
2310
|
-
<td v-if="rowNumbers" class="mg-rownum-cell" />
|
|
2311
|
-
<td
|
|
2312
|
-
v-for="(col, colIndex) in state.visibleColumns"
|
|
2313
|
-
:key="col.field"
|
|
2314
|
-
:class="{
|
|
2315
|
-
'mg-pinned': !!col.pinned,
|
|
2316
|
-
'mg-pin-left-edge': colIndex === lastLeftPinIdx,
|
|
2317
|
-
'mg-pin-right-edge': colIndex === firstRightPinIdx,
|
|
2318
|
-
}"
|
|
2319
|
-
:style="pinStyleOf(col)"
|
|
2912
|
+
<tr
|
|
2913
|
+
v-for="(prow, pIdx) in state.pinnedBottomRows"
|
|
2914
|
+
:key="`pin-bottom-${pIdx}`"
|
|
2915
|
+
class="mg-pinned-bottom-row"
|
|
2320
2916
|
>
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
class="mg-append-btn"
|
|
2334
|
-
@click="onLoadMore"
|
|
2917
|
+
<td v-if="rowStatus" class="mg-status-cell" />
|
|
2918
|
+
<td v-if="rowCheckboxes" class="mg-check-cell" />
|
|
2919
|
+
<td v-if="rowNumbers" class="mg-rownum-cell" />
|
|
2920
|
+
<td
|
|
2921
|
+
v-for="(col, colIndex) in state.visibleColumns"
|
|
2922
|
+
:key="col.field"
|
|
2923
|
+
:class="{
|
|
2924
|
+
'mg-pinned': !!col.pinned,
|
|
2925
|
+
'mg-pin-left-edge': colIndex === lastLeftPinIdx,
|
|
2926
|
+
'mg-pin-right-edge': colIndex === firstRightPinIdx,
|
|
2927
|
+
}"
|
|
2928
|
+
:style="pinStyleOf(col)"
|
|
2335
2929
|
>
|
|
2336
|
-
|
|
2337
|
-
</
|
|
2338
|
-
</
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
<td v-if="rowNumbers" class="mg-rownum-cell" />
|
|
2346
|
-
<td
|
|
2347
|
-
v-for="(col, colIndex) in state.visibleColumns"
|
|
2348
|
-
:key="col.field"
|
|
2349
|
-
:class="{
|
|
2350
|
-
'mg-pinned': !!col.pinned,
|
|
2351
|
-
'mg-pin-left-edge': colIndex === lastLeftPinIdx,
|
|
2352
|
-
'mg-pin-right-edge': colIndex === firstRightPinIdx,
|
|
2353
|
-
}"
|
|
2354
|
-
:style="pinStyleOf(col)"
|
|
2930
|
+
{{ grid.getCellText(prow, col) }}
|
|
2931
|
+
</td>
|
|
2932
|
+
</tr>
|
|
2933
|
+
<tr
|
|
2934
|
+
v-if="
|
|
2935
|
+
state.appendScroll &&
|
|
2936
|
+
(state.appendScroll.loading || state.appendScroll.hasMore)
|
|
2937
|
+
"
|
|
2938
|
+
class="mg-append-row"
|
|
2355
2939
|
>
|
|
2356
|
-
<
|
|
2357
|
-
v-if="
|
|
2358
|
-
|
|
2940
|
+
<td :colspan="colSpan">
|
|
2941
|
+
<span v-if="state.appendScroll.loading">{{
|
|
2942
|
+
state.locale.loadingMore
|
|
2943
|
+
}}</span>
|
|
2944
|
+
<button
|
|
2945
|
+
v-else
|
|
2946
|
+
type="button"
|
|
2947
|
+
class="mg-append-btn"
|
|
2948
|
+
@click="onLoadMore"
|
|
2949
|
+
>
|
|
2950
|
+
더 보기
|
|
2951
|
+
</button>
|
|
2952
|
+
</td>
|
|
2953
|
+
</tr>
|
|
2954
|
+
</tbody>
|
|
2955
|
+
<tfoot v-if="state.grandTotals">
|
|
2956
|
+
<tr class="mg-total-row">
|
|
2957
|
+
<td v-if="rowStatus" class="mg-status-cell" />
|
|
2958
|
+
<td v-if="rowCheckboxes" class="mg-check-cell" />
|
|
2959
|
+
<td v-if="rowNumbers" class="mg-rownum-cell" />
|
|
2960
|
+
<td
|
|
2961
|
+
v-for="(col, colIndex) in state.visibleColumns"
|
|
2962
|
+
:key="col.field"
|
|
2963
|
+
:class="{
|
|
2964
|
+
'mg-pinned': !!col.pinned,
|
|
2965
|
+
'mg-pin-left-edge': colIndex === lastLeftPinIdx,
|
|
2966
|
+
'mg-pin-right-edge': colIndex === firstRightPinIdx,
|
|
2967
|
+
}"
|
|
2968
|
+
:style="pinStyleOf(col)"
|
|
2359
2969
|
>
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2970
|
+
<span
|
|
2971
|
+
v-if="col.aggregationFn && state.grandTotals[col.field] != null"
|
|
2972
|
+
class="mg-agg"
|
|
2973
|
+
>
|
|
2974
|
+
{{ formatAggregate(state.grandTotals[col.field]) }}
|
|
2975
|
+
</span>
|
|
2976
|
+
<template v-else-if="colIndex === 0">{{
|
|
2977
|
+
state.locale.totalLabel
|
|
2978
|
+
}}</template>
|
|
2979
|
+
</td>
|
|
2980
|
+
</tr>
|
|
2981
|
+
</tfoot>
|
|
2982
|
+
</table>
|
|
2983
|
+
<div v-if="state.serverSide?.loading" class="mg-loading">
|
|
2984
|
+
{{ state.locale.loadingMore }}
|
|
2985
|
+
</div>
|
|
2368
2986
|
</div>
|
|
2369
|
-
<div
|
|
2370
|
-
v-if="statusBar && state.selectionAggregates"
|
|
2371
|
-
class="mg-statusbar"
|
|
2372
|
-
>
|
|
2987
|
+
<div v-if="statusBar && state.selectionAggregates" class="mg-statusbar">
|
|
2373
2988
|
<span>
|
|
2374
2989
|
<span class="mg-status-value">
|
|
2375
|
-
{{
|
|
2990
|
+
{{
|
|
2991
|
+
state.selectionAggregates.rows > 0
|
|
2992
|
+
? state.selectionAggregates.rows
|
|
2993
|
+
: state.selectionAggregates.cells
|
|
2994
|
+
}}
|
|
2376
2995
|
</span>
|
|
2377
|
-
셀 선택
|
|
2996
|
+
{{ state.selectionAggregates.rows > 0 ? "행 선택" : "셀 선택" }}
|
|
2378
2997
|
</span>
|
|
2379
2998
|
<template v-if="state.selectionAggregates.count > 0">
|
|
2380
2999
|
<span>
|
|
@@ -2418,10 +3037,18 @@ watch(
|
|
|
2418
3037
|
<ul
|
|
2419
3038
|
class="mg-ctx-menu"
|
|
2420
3039
|
role="menu"
|
|
2421
|
-
:style="{
|
|
3040
|
+
:style="{
|
|
3041
|
+
left: `${state.contextMenu.x}px`,
|
|
3042
|
+
top: `${state.contextMenu.y}px`,
|
|
3043
|
+
}"
|
|
2422
3044
|
>
|
|
2423
3045
|
<template v-for="item in state.contextMenu.items">
|
|
2424
|
-
<li
|
|
3046
|
+
<li
|
|
3047
|
+
v-if="item.separator"
|
|
3048
|
+
:key="item.id"
|
|
3049
|
+
class="mg-ctx-separator"
|
|
3050
|
+
role="separator"
|
|
3051
|
+
/>
|
|
2425
3052
|
<li v-else :key="item.id" role="none">
|
|
2426
3053
|
<button
|
|
2427
3054
|
type="button"
|
|
@@ -2436,5 +3063,8 @@ watch(
|
|
|
2436
3063
|
</template>
|
|
2437
3064
|
</ul>
|
|
2438
3065
|
</template>
|
|
3066
|
+
<div v-if="isLoading" class="mg-loading-overlay">
|
|
3067
|
+
{{ state.locale.loadingMore }}
|
|
3068
|
+
</div>
|
|
2439
3069
|
</div>
|
|
2440
3070
|
</template>
|