@vmscloud/moz-ui-gantt-core 0.1.0 → 0.2.0
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/Interactions.d.ts +60 -0
- package/dist/MozGantt.d.ts +24 -4
- package/dist/SearchController.d.ts +2 -0
- package/dist/gantt/GanttCanvasRenderer.d.ts +27 -1
- package/dist/gantt/GanttEditor.d.ts +4 -4
- package/dist/gantt/features.d.ts +34 -0
- package/dist/index.cjs +1642 -214
- package/dist/index.d.ts +3 -0
- package/dist/index.js +1644 -216
- package/dist/locale.d.ts +30 -0
- package/dist/pivotor/HeaderRenderer.d.ts +8 -0
- package/dist/pivotor/TimeAxisBuilder.d.ts +7 -0
- package/dist/pivotor/internal/timeUnit.d.ts +10 -8
- package/dist/pivotor/internal/timeZone.d.ts +15 -0
- package/dist/pivotor/internal/workingCalendar.d.ts +6 -0
- package/dist/pivotor/types.d.ts +44 -1
- package/dist/style.css +397 -8
- package/dist/theme.d.ts +17 -0
- package/dist/time.d.ts +17 -0
- package/dist/types.d.ts +85 -1
- package/dist/validate.d.ts +5 -3
- package/package.json +1 -1
package/dist/locale.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TimeUnit } from './pivotor/types';
|
|
2
|
+
/** 기본 문구와 교체 가능한 템플릿. HTML 대신 텍스트로만 렌더한다. */
|
|
3
|
+
export interface GanttMessages {
|
|
4
|
+
controls: string;
|
|
5
|
+
search: string;
|
|
6
|
+
previous: string;
|
|
7
|
+
next: string;
|
|
8
|
+
zoomOut: string;
|
|
9
|
+
zoomIn: string;
|
|
10
|
+
timeline: string;
|
|
11
|
+
keyboardHelp: string;
|
|
12
|
+
loading: string;
|
|
13
|
+
empty: string;
|
|
14
|
+
taskCount: string;
|
|
15
|
+
task: string;
|
|
16
|
+
milestone: string;
|
|
17
|
+
start: string;
|
|
18
|
+
end: string;
|
|
19
|
+
details: string;
|
|
20
|
+
focusTask: string;
|
|
21
|
+
contextMenu: string;
|
|
22
|
+
expand: string;
|
|
23
|
+
collapse: string;
|
|
24
|
+
subtotal: string;
|
|
25
|
+
resizeColumn: string;
|
|
26
|
+
}
|
|
27
|
+
export declare function ganttMessages(locale?: string, overrides?: Partial<GanttMessages>, timeZone?: string): GanttMessages;
|
|
28
|
+
export declare function message(template: string, values: Record<string, string | number>): string;
|
|
29
|
+
export declare function formatTimeLabel(ms: number, unit: TimeUnit, locale: string, timeZone?: string): string;
|
|
30
|
+
export declare function formatGanttDateTime(ms: number, locale?: string, timeZone?: string): string;
|
|
@@ -6,6 +6,12 @@ export interface HeaderRendererOptions {
|
|
|
6
6
|
rowHeaderWidth: number;
|
|
7
7
|
/** rowFields 정의 (헤더 라벨 + level별 width 결정) */
|
|
8
8
|
rowFields: readonly PivotRowField[];
|
|
9
|
+
labels?: {
|
|
10
|
+
subtotal: string;
|
|
11
|
+
expand: string;
|
|
12
|
+
collapse: string;
|
|
13
|
+
resizeColumn: string;
|
|
14
|
+
};
|
|
9
15
|
/** ancestor 접힘 상태 조회 — collapsible row header 버튼 icon 결정에 사용. */
|
|
10
16
|
isAncestorCollapsed?: (ancestorKey: string) => boolean;
|
|
11
17
|
/**
|
|
@@ -90,6 +96,8 @@ export declare class HeaderRenderer {
|
|
|
90
96
|
* `invalidate()` 전체 invalidate 보다 가볍다. `Pivotor.notifyHeaderChanged()` 가 호출.
|
|
91
97
|
*/
|
|
92
98
|
invalidateColumnHeaders(): void;
|
|
99
|
+
/** 조회 patch는 행만 바뀐다. 고정 코너와 시간 헤더의 DOM을 보존한다. */
|
|
100
|
+
invalidateRowHeaders(): void;
|
|
93
101
|
/** 좌상단 코너 — rowField 헤더 라벨 표시 */
|
|
94
102
|
/**
|
|
95
103
|
* 좌상단 corner pane 렌더 — row header tier 라벨 (자원그룹/자원 등) 표시.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { CellValue, PhysicalColumn, PivotHeaderNode, PivotTimeColumnField, TickLadderStep, TimeAxisSpec, TimeUnit } from './types';
|
|
2
|
+
export { validateCalendar } from './internal/workingCalendar';
|
|
3
|
+
/** 공개 facade와 직접 사용하는 축 모두 같은 경계/업무 달력 검사를 거친다. */
|
|
4
|
+
export declare function validateTimeAxisSpec(spec: TimeAxisSpec): void;
|
|
5
|
+
/** ladder 전환은 24시간이 아니라 실제 tick당 업무 시간 비율을 유지한다. 설정 참조별로 재사용한다. */
|
|
6
|
+
export declare function averageTickDuration(spec: TimeAxisSpec, unit: TimeUnit): number;
|
|
2
7
|
/**
|
|
3
8
|
* 정규화된 ladder — `ticks` (단일 모드) / `tickLadder` (다단 모드) 를 단일 형태로 흡수.
|
|
4
9
|
* 단일 모드는 1-step ladder 로 변환. 모든 builder/zoom 코드가 이 형태만 다룸.
|
|
@@ -51,5 +56,7 @@ export declare function msToPx(col: PhysicalColumn, ms: number): number;
|
|
|
51
56
|
* findColAtContentX 의 ms 버전 — zoom 후 anchor 시간이 어느 새 col 에 들어가는지 식별.
|
|
52
57
|
*/
|
|
53
58
|
export declare function findColAtMs(cols: readonly PhysicalColumn[], ms: number): PhysicalColumn | null;
|
|
59
|
+
/** 완전히 제외된 작업은 최소 폭 막대로도 그리지 않는다. 0길이는 시작 포함/끝 미포함으로 판정한다. */
|
|
60
|
+
export declare function hasVisibleTime(cols: readonly PhysicalColumn[], startMs: number, endMs: number): boolean;
|
|
54
61
|
/** 같은 배열에서 시간 경계를 바꾸는 내부 사용자는 명시적으로 무효화한다. 일반 축 재구축은 배열 교체다. */
|
|
55
62
|
export declare function invalidateTimeColumnLookup(cols: readonly PhysicalColumn[]): void;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { TimeUnit, TimeRange } from '../types';
|
|
1
|
+
import { TimeUnit, TimeRange, TimeCalendar } from '../types';
|
|
2
2
|
/** 한 leaf tick 의 시작/끝 ms + 사람 읽는 라벨 */
|
|
3
3
|
export interface TimeTick {
|
|
4
4
|
startMs: number;
|
|
5
5
|
endMs: number;
|
|
6
6
|
label: string;
|
|
7
|
+
/** 업무 달력이 있는 경우 이 tick 안에서 실제로 표시할 시간 구간. */
|
|
8
|
+
segments?: readonly Readonly<TimeRange>[];
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* `[startMs, endMs)` 를 `unit` 단위로 쪼개 leaf tick 배열 생성.
|
|
@@ -12,7 +14,7 @@ export interface TimeTick {
|
|
|
12
14
|
* - **end** 는 unit 경계로 ceil (마지막 tick 이 end 포함하도록).
|
|
13
15
|
* - 결과 tick 의 endMs 는 다음 tick 의 startMs 와 정확히 같음 (반-개구간).
|
|
14
16
|
*/
|
|
15
|
-
export declare function enumerateTicks(range: Readonly<TimeRange>, unit: TimeUnit): TimeTick[];
|
|
17
|
+
export declare function enumerateTicks(range: Readonly<TimeRange>, unit: TimeUnit, calendar?: Readonly<TimeCalendar>, timeZone?: string): TimeTick[];
|
|
16
18
|
/**
|
|
17
19
|
* leaf tick 들을 상위 unit (parentUnit) 으로 grouping.
|
|
18
20
|
* 반환: 각 그룹은 [child tick 시작 idx, 개수] + 그룹 라벨.
|
|
@@ -27,13 +29,13 @@ export interface TickGroup {
|
|
|
27
29
|
leafCount: number;
|
|
28
30
|
label: string;
|
|
29
31
|
}
|
|
30
|
-
export declare function groupByUnit(leaves: readonly TimeTick[], parentUnit: TimeUnit): TickGroup[];
|
|
31
|
-
/** unit
|
|
32
|
-
export declare function floorTo(ms: number, unit: TimeUnit): number;
|
|
32
|
+
export declare function groupByUnit(leaves: readonly TimeTick[], parentUnit: TimeUnit, calendar?: Readonly<TimeCalendar>, timeZone?: string): TickGroup[];
|
|
33
|
+
/** unit의 현지 시작 경계. 중복된 분/시간은 해당 절대 시각의 occurrence를 선택한다. */
|
|
34
|
+
export declare function floorTo(ms: number, unit: TimeUnit, calendar?: Readonly<TimeCalendar>, timeZone?: string): number;
|
|
33
35
|
/** unit 다음 경계로 ceil. ms 가 이미 경계면 그대로. */
|
|
34
|
-
export declare function ceilTo(ms: number, unit: TimeUnit): number;
|
|
36
|
+
export declare function ceilTo(ms: number, unit: TimeUnit, calendar?: Readonly<TimeCalendar>, timeZone?: string): number;
|
|
35
37
|
/** unit 만큼 step 회 진행 (UTC 기준). */
|
|
36
|
-
export declare function advance(ms: number, unit: TimeUnit, step: number): number;
|
|
38
|
+
export declare function advance(ms: number, unit: TimeUnit, step: number, calendar?: Readonly<TimeCalendar>, timeZone?: string): number;
|
|
37
39
|
/**
|
|
38
40
|
* unit 별 기본 라벨 포맷.
|
|
39
41
|
* - hour: '08'
|
|
@@ -44,7 +46,7 @@ export declare function advance(ms: number, unit: TimeUnit, step: number): numbe
|
|
|
44
46
|
*
|
|
45
47
|
* 사용자 `TimeAxisSpec.format` 을 제공하면 그 콜백이 우선.
|
|
46
48
|
*/
|
|
47
|
-
export declare function defaultFormat(ms: number, unit: TimeUnit): string;
|
|
49
|
+
export declare function defaultFormat(ms: number, unit: TimeUnit, timeZone?: string): string;
|
|
48
50
|
/**
|
|
49
51
|
* 추정 tick 개수 (TimeAxisBuilder 의 hard-cap 검사용. 실제 enumerate 전에 cheap 계산).
|
|
50
52
|
*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare function validateTimeZone(timeZone?: string): void;
|
|
2
|
+
/** 반환값의 UTC getter가 지정 시간대의 현지 날짜·시각이다. 서버/브라우저 기본 시간대를 쓰지 않는다. */
|
|
3
|
+
export declare function wallTime(ms: number, timeZone?: string): number;
|
|
4
|
+
/**
|
|
5
|
+
* 중복 시각은 이른/늦은 두 절대 시각을 반환한다. 없는 시각은 DST 간격만큼 앞으로 이동한다.
|
|
6
|
+
* 오프셋은 대상 날짜 주변에서 구하므로 30/45분 시간대와 날짜 전체를 건너뛴 변경도 지원한다.
|
|
7
|
+
*/
|
|
8
|
+
export declare function wallTimeCandidates(localMs: number, timeZone?: string): number[];
|
|
9
|
+
export declare function fromWallTime(localMs: number, timeZone?: string): number;
|
|
10
|
+
/** 현지 하루의 고정 오프셋 구간. 중복된 근무시간을 두 번, 존재하지 않는 근무시간을 0번 반영한다. */
|
|
11
|
+
export declare function localDayPeriods(localDay: number, timeZone?: string): Array<{
|
|
12
|
+
startMs: number;
|
|
13
|
+
endMs: number;
|
|
14
|
+
offset: number;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { TimeCalendar, TimeRange } from '../types';
|
|
2
|
+
/** 달력은 데이터가 아닌 설정이다. 잘못된 입력은 현재 화면을 바꾸기 전에 거부한다. */
|
|
3
|
+
export declare function validateCalendar(calendar?: Readonly<TimeCalendar>): void;
|
|
4
|
+
export declare function hasWorkingCalendar(calendar?: Readonly<TimeCalendar>): boolean;
|
|
5
|
+
/** 현지 근무일·휴일을 절대 시각 구간으로 바꾸고 원본 제외 구간과 합성한다. */
|
|
6
|
+
export declare function calendarProjector(calendar: Readonly<TimeCalendar>, range: Readonly<TimeRange>, timeZone?: string): (start: number, end: number) => TimeRange[];
|
package/dist/pivotor/types.d.ts
CHANGED
|
@@ -31,8 +31,15 @@ export interface PivotFieldBase {
|
|
|
31
31
|
}
|
|
32
32
|
/** 행 축 필드 */
|
|
33
33
|
export interface PivotRowField extends PivotFieldBase {
|
|
34
|
+
/** 텍스트·class만 꾸미는 콜백. 원본값과 그룹 경로는 바꾸지 않는다. */
|
|
35
|
+
formatter?: (value: CellValue, context: RowHeaderContext) => string;
|
|
36
|
+
cellClass?: string | ((context: RowHeaderContext) => string);
|
|
37
|
+
/** 신뢰하는 앱 코드만 전달한다. SW JSON에서는 텍스트 preset으로 대응한다. */
|
|
38
|
+
renderCell?: (container: HTMLElement, context: RowHeaderContext) => void;
|
|
34
39
|
/** 정렬 방향 (logical 그룹핑에서 적용) */
|
|
35
40
|
sort?: 'asc' | 'desc';
|
|
41
|
+
/** 표시값과 별도인 정렬 필드. 같은 prefix 그룹의 최솟값을 사용하며 동률은 표시값으로 비교한다. */
|
|
42
|
+
sortField?: string;
|
|
36
43
|
/**
|
|
37
44
|
* View-derived 표시값 콜백.
|
|
38
45
|
*
|
|
@@ -57,6 +64,13 @@ export interface PivotRowField extends PivotFieldBase {
|
|
|
57
64
|
*/
|
|
58
65
|
collapsible?: boolean;
|
|
59
66
|
}
|
|
67
|
+
export interface RowHeaderContext {
|
|
68
|
+
value: CellValue;
|
|
69
|
+
field: string;
|
|
70
|
+
rowPath: readonly CellValue[];
|
|
71
|
+
slotIndex: number;
|
|
72
|
+
isSubtotal: boolean;
|
|
73
|
+
}
|
|
60
74
|
/** displayFromSlotIndex 콜백 파라미터 */
|
|
61
75
|
export interface SlotDisplayParams {
|
|
62
76
|
/** cell 안 row 의 0-based slot index (mutation handler 가 직접 조작) */
|
|
@@ -98,6 +112,10 @@ export interface PivotTimeColumnField extends Omit<PivotFieldBase, 'field'> {
|
|
|
98
112
|
*/
|
|
99
113
|
export interface TimeAxisSpec {
|
|
100
114
|
range: Readonly<TimeRange>;
|
|
115
|
+
/** 눈금·헤더·업무 달력의 IANA 시간대. 기본 UTC. 데이터/제외 구간의 절대 ms는 바꾸지 않는다. */
|
|
116
|
+
timeZone?: string;
|
|
117
|
+
/** timeZone 기준 업무 시간만 표시한다. 미지정 시 기존 연속 시간축을 사용한다. */
|
|
118
|
+
calendar?: Readonly<TimeCalendar>;
|
|
101
119
|
/** 단일 unit 모드. `tickLadder` 와 둘 중 하나만 지정. */
|
|
102
120
|
ticks?: Readonly<TimeTickPolicy>;
|
|
103
121
|
/**
|
|
@@ -146,7 +164,20 @@ export interface TimeTickPolicy {
|
|
|
146
164
|
/** 한 tick 당 픽셀 너비 */
|
|
147
165
|
width: number;
|
|
148
166
|
}
|
|
149
|
-
export type TimeUnit = 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
167
|
+
export type TimeUnit = 'minute' | 'hour' | 'oneThirdHour' | 'shift' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
168
|
+
/** 일중 시각과 휴일은 timeAxis.timeZone 기준이며 종료 분은 미포함이다. 야간 근무는 자정을 기준으로 두 구간으로 나눈다. */
|
|
169
|
+
export interface TimeCalendar {
|
|
170
|
+
workingDays?: readonly number[];
|
|
171
|
+
workingHours?: readonly Readonly<{
|
|
172
|
+
startMinute: number;
|
|
173
|
+
endMinute: number;
|
|
174
|
+
}>[];
|
|
175
|
+
excludedRanges?: readonly Readonly<TimeRange>[];
|
|
176
|
+
excludedDates?: readonly string[];
|
|
177
|
+
dayStartHour?: number;
|
|
178
|
+
/** 기본 [6,14,22]. 간격이 다른 교대도 실제 다음 시작 시각으로 진행한다. */
|
|
179
|
+
shiftHours?: readonly number[];
|
|
180
|
+
}
|
|
150
181
|
export type TimeFormatFn = (ms: number, tier: TimeUnit) => string;
|
|
151
182
|
/**
|
|
152
183
|
* 열 축 필드 union.
|
|
@@ -222,6 +253,7 @@ export type RowExpansionPolicy =
|
|
|
222
253
|
kind: 'collapse';
|
|
223
254
|
rowHeight?: number;
|
|
224
255
|
subtotalHeight?: number;
|
|
256
|
+
levelField?: string;
|
|
225
257
|
}
|
|
226
258
|
/** slotCount = max(col별 source row 수). 셀당 0/1 source row. (Kanban 기본) */
|
|
227
259
|
| {
|
|
@@ -288,6 +320,13 @@ export interface PhysicalLayout {
|
|
|
288
320
|
cellAssignments?: (Row | null)[][];
|
|
289
321
|
}
|
|
290
322
|
export interface PivotConfig {
|
|
323
|
+
labels?: {
|
|
324
|
+
subtotal: string;
|
|
325
|
+
expand: string;
|
|
326
|
+
collapse: string;
|
|
327
|
+
resizeColumn: string;
|
|
328
|
+
};
|
|
329
|
+
rowHeaderResizable?: boolean;
|
|
291
330
|
/**
|
|
292
331
|
* 안정 ID를 구성하는 필드 목록 (복합 키 지원).
|
|
293
332
|
*
|
|
@@ -480,6 +519,8 @@ export interface PhysicalColumn {
|
|
|
480
519
|
*/
|
|
481
520
|
tickStartMs?: number;
|
|
482
521
|
tickEndMs?: number;
|
|
522
|
+
/** 달력으로 압축된 업무 구간. 이 tick의 width는 구간들의 총 업무 시간에 균등 배분된다. */
|
|
523
|
+
timeSegments?: readonly Readonly<TimeRange>[];
|
|
483
524
|
}
|
|
484
525
|
/**
|
|
485
526
|
* 시간축 leaf column 인지 type guard. paintBar 안에서 `col.tickStartMs!` non-null assertion
|
|
@@ -753,6 +794,8 @@ export interface PivotBodyRenderer {
|
|
|
753
794
|
}
|
|
754
795
|
/** body renderer가 사용하는 Pivotor 핸들 (양방향 피드백용 최소 표면) */
|
|
755
796
|
export interface PivotorHandle {
|
|
797
|
+
/** 표시 좌표 인덱스용 전체 슬롯. 가상 스크롤 밖 작업의 의존선에도 사용한다. */
|
|
798
|
+
getAllSlots?(): readonly PhysicalRowSlot[];
|
|
756
799
|
setRowHeight(slotId: string, height: number): void;
|
|
757
800
|
setColumnWidth(colId: string, width: number): void;
|
|
758
801
|
toggleCollapse(nodeId: string): void;
|