open-grid 1.2.1 → 1.3.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/CHANGELOG.md +376 -365
- package/dist/{OpenGrid-0r_543Kj.cjs → OpenGrid-B7m7ei7f.cjs} +1222 -1029
- package/dist/{OpenGrid-HmhGVC2V.js → OpenGrid-CeUdO_fM.js} +1613 -1418
- package/dist/index-CeJ-0-80.cjs +260 -0
- package/dist/index-DnarQ4eR.js +266 -0
- package/dist/index-DrCPRuYi.js +548 -0
- package/dist/index-JjfWY3Bt.cjs +520 -0
- package/dist/open-grid-base.css +12 -1
- package/dist/open-grid-react.cjs +1 -1
- package/dist/open-grid-react.js +1 -1
- package/dist/open-grid-vue.cjs +7 -7
- package/dist/open-grid-vue.js +2 -2
- package/dist/open-grid.cjs +1 -1
- package/dist/open-grid.js +2 -2
- package/dist/types/bench/perf.d.ts +14 -8
- package/dist/types/core/AppearanceResolver.d.ts +98 -11
- package/dist/types/core/CFRenderBridge.d.ts +13 -0
- package/dist/types/core/CellTypeRegistry.d.ts +24 -0
- package/dist/types/core/ColumnLayout.d.ts +100 -2
- package/dist/types/core/CrossGridMapper.d.ts +43 -5
- package/dist/types/core/DataLayer.d.ts +210 -15
- package/dist/types/core/DragVisuals.d.ts +33 -4
- package/dist/types/core/EventEmitter.d.ts +54 -0
- package/dist/types/core/FormulaEngine.d.ts +15 -4
- package/dist/types/core/GridRenderer.d.ts +143 -10
- package/dist/types/core/GroupEngine.d.ts +68 -10
- package/dist/types/core/MathUtils.d.ts +58 -5
- package/dist/types/core/MergeEngine.d.ts +45 -10
- package/dist/types/core/OGDecimal.d.ts +144 -13
- package/dist/types/core/OpenGrid.d.ts +99 -0
- package/dist/types/core/PivotEngine.d.ts +37 -0
- package/dist/types/core/RowDragDrop.d.ts +52 -6
- package/dist/types/core/SkinRegistry.d.ts +4 -0
- package/dist/types/core/TreeEngine.d.ts +60 -6
- package/dist/types/core/VirtualScroll.d.ts +64 -0
- package/dist/types/core/a11y/AccessibilityAdapter.d.ts +103 -0
- package/dist/types/core/a11y/AriaIntent.d.ts +34 -0
- package/dist/types/core/a11y/KeyboardInteractionModel.d.ts +64 -0
- package/dist/types/core/a11y/LiveRegionController.d.ts +89 -0
- package/dist/types/core/a11y/OverlayStack.d.ts +36 -0
- package/dist/types/core/a11y/VisualEquivRegistry.d.ts +37 -0
- package/dist/types/core/a11y/index.d.ts +13 -0
- package/dist/types/core/a11y/ports.d.ts +24 -0
- package/dist/types/core/appearance/Appearance.d.ts +68 -0
- package/dist/types/core/appearance/AppearanceAxis.d.ts +94 -0
- package/dist/types/core/appearance/AppearanceComposer.d.ts +45 -0
- package/dist/types/core/appearance/AppearanceProvider.d.ts +50 -0
- package/dist/types/core/appearance/AppearanceView.d.ts +51 -0
- package/dist/types/core/appearance/DensityRegistry.d.ts +36 -0
- package/dist/types/core/appearance/ResolvedAppearanceSnapshot.d.ts +84 -0
- package/dist/types/core/appearance/TextureRegistry.d.ts +32 -0
- package/dist/types/core/appearance/ThemeMetaRegistry.d.ts +67 -0
- package/dist/types/core/appearance/axisAdapters.d.ts +37 -0
- package/dist/types/core/appearance/defaults.d.ts +10 -0
- package/dist/types/core/appearance/index.d.ts +20 -0
- package/dist/types/core/appearance/tokenCatalog.d.ts +30 -0
- package/dist/types/core/cf/CFEngine.d.ts +56 -0
- package/dist/types/core/cf/CFEvaluator.d.ts +24 -0
- package/dist/types/core/cf/CFRule.d.ts +127 -0
- package/dist/types/core/cf/ColorScale.d.ts +49 -0
- package/dist/types/core/cf/InkResolver.d.ts +33 -0
- package/dist/types/core/cf/appearance.d.ts +20 -0
- package/dist/types/core/cf/encoders.d.ts +61 -0
- package/dist/types/core/cf/eval-types.d.ts +93 -0
- package/dist/types/core/cf/index.d.ts +21 -0
- package/dist/types/core/cf/lineage.d.ts +32 -0
- package/dist/types/core/cf/predicates.d.ts +27 -0
- package/dist/types/core/cf/serialize.d.ts +46 -0
- package/dist/types/core/chart/CanvasAdapter.d.ts +50 -1
- package/dist/types/core/chart/DataExtractor.d.ts +53 -12
- package/dist/types/core/chart/a11y.d.ts +22 -0
- package/dist/types/core/chart/chart-type-registry.d.ts +53 -0
- package/dist/types/core/chart/downsample-report.d.ts +36 -0
- package/dist/types/core/chart/downsample.d.ts +26 -1
- package/dist/types/core/chart/engine/ChartEngineRegistry.d.ts +52 -0
- package/dist/types/core/chart/geometry.d.ts +96 -0
- package/dist/types/core/chart/hittest.d.ts +21 -3
- package/dist/types/core/chart/palette.d.ts +96 -12
- package/dist/types/core/chart/parity.d.ts +12 -0
- package/dist/types/core/chart/provenance.d.ts +47 -0
- package/dist/types/core/chart/scales.d.ts +28 -1
- package/dist/types/core/chart/scene.d.ts +102 -0
- package/dist/types/core/chart/server.d.ts +36 -0
- package/dist/types/core/chart/surfaces/CanvasSurface.d.ts +48 -0
- package/dist/types/core/chart/surfaces/ServerRasterSurface.d.ts +26 -0
- package/dist/types/core/chart/surfaces/SvgSurface.d.ts +24 -0
- package/dist/types/core/chart/surfaces/pattern-overlay.d.ts +24 -0
- package/dist/types/core/command/CommandBus.d.ts +51 -0
- package/dist/types/core/command/CommandRegistry.d.ts +43 -0
- package/dist/types/core/command/CommandStack.d.ts +38 -0
- package/dist/types/core/command/ICommand.d.ts +110 -0
- package/dist/types/core/command/commands/CellWriteCommand.d.ts +32 -0
- package/dist/types/core/command/commands/CompositeCommand.d.ts +17 -0
- package/dist/types/core/command/commands/RowCommands.d.ts +39 -0
- package/dist/types/core/command/index.d.ts +9 -0
- package/dist/types/core/command/support.d.ts +51 -0
- package/dist/types/core/coordinate/ColumnMetrics.d.ts +30 -0
- package/dist/types/core/coordinate/CoordinateKernel.d.ts +88 -0
- package/dist/types/core/coordinate/FrozenPanes.d.ts +29 -0
- package/dist/types/core/coordinate/MergeSourceAdapter.d.ts +18 -0
- package/dist/types/core/coordinate/NodeBudget.d.ts +33 -0
- package/dist/types/core/coordinate/ResizeGovernor.d.ts +50 -0
- package/dist/types/core/coordinate/RowMetrics.d.ts +37 -0
- package/dist/types/core/coordinate/ViewPermutation.d.ts +23 -0
- package/dist/types/core/coordinate/index.d.ts +10 -0
- package/dist/types/core/coordinate/ports.d.ts +45 -0
- package/dist/types/core/coordinate/types.d.ts +76 -0
- package/dist/types/core/detail/DetailGlyph.d.ts +42 -7
- package/dist/types/core/detail/DetailSplice.d.ts +42 -11
- package/dist/types/core/detail/DetailState.d.ts +80 -11
- package/dist/types/core/detail/SubgridCache.d.ts +72 -10
- package/dist/types/core/detail/index.d.ts +8 -0
- package/dist/types/core/domain/AggregateResult.d.ts +54 -0
- package/dist/types/core/domain/CellAddress.d.ts +61 -0
- package/dist/types/core/domain/CellValueAccess.d.ts +29 -0
- package/dist/types/core/domain/Delta.d.ts +37 -0
- package/dist/types/core/domain/DomainValue.d.ts +80 -0
- package/dist/types/core/domain/Missing.d.ts +65 -0
- package/dist/types/core/domain/Money.d.ts +42 -0
- package/dist/types/core/domain/NormalizationBasis.d.ts +47 -0
- package/dist/types/core/domain/Plain.d.ts +45 -0
- package/dist/types/core/domain/Quantity.d.ts +32 -0
- package/dist/types/core/domain/Ratios.d.ts +100 -0
- package/dist/types/core/domain/ThresholdSet.d.ts +46 -0
- package/dist/types/core/domain/ValueType.d.ts +71 -0
- package/dist/types/core/domain/rounding.d.ts +25 -0
- package/dist/types/core/domain/strategies.d.ts +38 -0
- package/dist/types/core/editors/DateEditor.d.ts +18 -0
- package/dist/types/core/editors/SelectEditor.d.ts +29 -0
- package/dist/types/core/export/ChannelRegistry.d.ts +18 -0
- package/dist/types/core/export/ExportManifest.d.ts +13 -0
- package/dist/types/core/export/GridArtifactSource.d.ts +62 -0
- package/dist/types/core/export/Provenance.d.ts +34 -0
- package/dist/types/core/export/StreamPump.d.ts +28 -0
- package/dist/types/core/export/channels/CsvChannel.d.ts +20 -0
- package/dist/types/core/export/channels/JsonChannel.d.ts +18 -0
- package/dist/types/core/export/channels/XlsxChannel.d.ts +53 -0
- package/dist/types/core/export/channels/XmlChannel.d.ts +21 -0
- package/dist/types/core/export/channels/capabilities.d.ts +13 -0
- package/dist/types/core/export/index.d.ts +24 -0
- package/dist/types/core/export/print/OutputChannelAdapter.d.ts +61 -0
- package/dist/types/core/export/print/Paginator.d.ts +48 -0
- package/dist/types/core/export/print/PrintRenderTarget.d.ts +36 -0
- package/dist/types/core/export/sinks.d.ts +40 -0
- package/dist/types/core/export/types.d.ts +211 -0
- package/dist/types/core/extension/DeprecationManager.d.ts +42 -0
- package/dist/types/core/extension/IExtension.d.ts +90 -0
- package/dist/types/core/extension/Registry.d.ts +142 -0
- package/dist/types/core/extension/SlotRegistry.d.ts +46 -0
- package/dist/types/core/extension/adapters.d.ts +44 -0
- package/dist/types/core/extension/conformance.d.ts +47 -0
- package/dist/types/core/extension/index.d.ts +16 -0
- package/dist/types/core/extension/registries.d.ts +31 -0
- package/dist/types/core/extension/reserved.d.ts +10 -0
- package/dist/types/core/format/DisplayFormatter.d.ts +47 -0
- package/dist/types/core/format/FormatCache.d.ts +20 -0
- package/dist/types/core/format/FormatterRegistry.d.ts +22 -0
- package/dist/types/core/format/grammar/AstRenderer.d.ts +10 -0
- package/dist/types/core/format/grammar/FormatCompiler.d.ts +16 -0
- package/dist/types/core/format/index.d.ts +55 -0
- package/dist/types/core/format/pipeline/DomainTypeResolver.d.ts +8 -0
- package/dist/types/core/format/pipeline/LocaleFormat.d.ts +11 -0
- package/dist/types/core/format/pipeline/ValueInterpreter.d.ts +8 -0
- package/dist/types/core/format/policy/MaskPolicy.d.ts +8 -0
- package/dist/types/core/format/policy/NegativePolicy.d.ts +12 -0
- package/dist/types/core/format/policy/NullPolicy.d.ts +10 -0
- package/dist/types/core/format/policy/TruncatePolicy.d.ts +11 -0
- package/dist/types/core/format/types.d.ts +292 -0
- package/dist/types/core/formula/CalcCacheStore.d.ts +89 -0
- package/dist/types/core/formula/CalcProvenance.d.ts +44 -0
- package/dist/types/core/formula/CalcService.d.ts +137 -0
- package/dist/types/core/formula/CyclePathReporter.d.ts +28 -0
- package/dist/types/core/formula/FormulaEvaluator.d.ts +35 -1
- package/dist/types/core/formula/FormulaGraph.d.ts +84 -7
- package/dist/types/core/formula/FormulaParser.d.ts +9 -0
- package/dist/types/core/formula/FormulaStore.d.ts +63 -1
- package/dist/types/core/formula/FunctionRegistry.d.ts +138 -0
- package/dist/types/core/formula/Generation.d.ts +86 -0
- package/dist/types/core/formula/RecalcCoordinator.d.ts +151 -9
- package/dist/types/core/formula/ReferenceRewriter.d.ts +81 -0
- package/dist/types/core/formula/functions/essential.d.ts +3 -0
- package/dist/types/core/formula/functions/extended/index.d.ts +10 -0
- package/dist/types/core/formula/normalizeRefs.d.ts +34 -3
- package/dist/types/core/formula/numericLiteral.d.ts +11 -1
- package/dist/types/core/formula/serializeFormula.d.ts +10 -1
- package/dist/types/core/host/CapabilityRegistry.d.ts +61 -0
- package/dist/types/core/host/GridHostDriver.d.ts +27 -0
- package/dist/types/core/host/GridHostPort.d.ts +37 -0
- package/dist/types/core/host/SliceOwnershipGuard.d.ts +27 -0
- package/dist/types/core/host/archCheck.d.ts +26 -0
- package/dist/types/core/host/index.d.ts +6 -0
- package/dist/types/core/host/reconcile.d.ts +22 -0
- package/dist/types/core/i18n/LocaleContext.d.ts +40 -0
- package/dist/types/core/i18n/types.d.ts +26 -1
- package/dist/types/core/icons/bootstrap-icons.d.ts +4 -2
- package/dist/types/core/quality/ContrastAuditor.d.ts +64 -0
- package/dist/types/core/quality/DeterminismKernel.d.ts +68 -0
- package/dist/types/core/quality/PerfBaseline.d.ts +23 -0
- package/dist/types/core/quality/PerfSpec.d.ts +95 -0
- package/dist/types/core/quality/RealBrowserGate.d.ts +69 -0
- package/dist/types/core/quality/RegressionJudge.d.ts +35 -0
- package/dist/types/core/quality/ReleaseGate.d.ts +94 -0
- package/dist/types/core/quality/VisualRegression.d.ts +74 -0
- package/dist/types/core/quality/hooks.d.ts +53 -0
- package/dist/types/core/quality/index.d.ts +20 -0
- package/dist/types/core/quality/pixelMetrics.d.ts +24 -0
- package/dist/types/core/range/ClipboardCodec.d.ts +46 -4
- package/dist/types/core/range/FillEngine.d.ts +69 -9
- package/dist/types/core/range/RangeModel.d.ts +100 -13
- package/dist/types/core/range/types.d.ts +27 -11
- package/dist/types/core/realtime/BackpressureScheduler.d.ts +0 -0
- package/dist/types/core/realtime/FreshnessClock.d.ts +34 -0
- package/dist/types/core/realtime/IRealtimeSource.d.ts +82 -0
- package/dist/types/core/realtime/LiveStateGuard.d.ts +23 -0
- package/dist/types/core/realtime/PollingSource.d.ts +42 -0
- package/dist/types/core/realtime/RealtimeController.d.ts +54 -0
- package/dist/types/core/realtime/RtAnnouncePolicy.d.ts +53 -0
- package/dist/types/core/realtime/RtApplyCommand.d.ts +29 -0
- package/dist/types/core/realtime/RtChartTargetTrigger.d.ts +26 -0
- package/dist/types/core/realtime/StreamingSource.d.ts +47 -0
- package/dist/types/core/realtime/backoff.d.ts +12 -0
- package/dist/types/core/realtime/index.d.ts +13 -0
- package/dist/types/core/realtime/ports.d.ts +80 -0
- package/dist/types/core/render/CellApplier.d.ts +18 -0
- package/dist/types/core/render/CellErrorBoundary.d.ts +65 -0
- package/dist/types/core/render/CellPipeline.d.ts +39 -0
- package/dist/types/core/render/CellRenderRequest.d.ts +209 -0
- package/dist/types/core/render/CellStageRegistry.d.ts +53 -0
- package/dist/types/core/render/OverlayCompositor.d.ts +38 -0
- package/dist/types/core/render/RenderBudget.d.ts +67 -0
- package/dist/types/core/render/contrast.d.ts +33 -0
- package/dist/types/core/render/index.d.ts +35 -0
- package/dist/types/core/render/stages/BackgroundStage.d.ts +14 -0
- package/dist/types/core/render/stages/DecoratorStage.d.ts +12 -0
- package/dist/types/core/render/stages/OverlayStage.d.ts +12 -0
- package/dist/types/core/render/stages/ValueRendererStage.d.ts +15 -0
- package/dist/types/core/render/stages/index.d.ts +14 -0
- package/dist/types/core/state/AutosaveController.d.ts +63 -0
- package/dist/types/core/state/IStatePersistence.d.ts +59 -0
- package/dist/types/core/state/MultiTabGuard.d.ts +33 -0
- package/dist/types/core/state/SchemaMigrator.d.ts +33 -0
- package/dist/types/core/state/SemVerPolicy.d.ts +39 -0
- package/dist/types/core/state/StateCodec.d.ts +75 -0
- package/dist/types/core/state/index.d.ts +6 -0
- package/dist/types/core/types.d.ts +17 -0
- package/dist/types/react/OpenGrid.d.ts +54 -0
- package/dist/types/react/index.d.ts +5 -0
- package/dist/types/realtime/index.d.ts +1 -0
- package/dist/types/vue/index.d.ts +5 -0
- package/dist/types/vue/types.d.ts +35 -0
- package/package.json +112 -111
|
@@ -3,39 +3,80 @@ import { RowDragDrop } from './RowDragDrop.js';
|
|
|
3
3
|
import { MergeEngine } from './MergeEngine.js';
|
|
4
4
|
import { AppearanceResolver } from './AppearanceResolver.js';
|
|
5
5
|
import { ColumnDef, SortItem, CellRange, GridOptions, FilterItem } from './types.js';
|
|
6
|
+
/**
|
|
7
|
+
* R9(§6-R9 / §2.5 R-4a): 렌더러가 소비하는 opts 타입. 공개 GridOptions(생성 시 기본값 병합
|
|
8
|
+
* 완료 = Required) 위에, 렌더 파이프라인이 매 프레임 주입하는 내부 증강 필드(언더스코어 접두)를
|
|
9
|
+
* 얹은 것. 내부 필드는 렌더 파이프라인에서만 채워지며 공개 API 가 아니다(값은 항상 매니저 최신값).
|
|
10
|
+
* / R9 (§6-R9 / §2.5 R-4a): the opts type the renderer consumes. On top of the public GridOptions
|
|
11
|
+
* (defaults already merged at construction = Required), it adds internal augmentation fields
|
|
12
|
+
* (underscore-prefixed) injected each frame by the render pipeline. The internal fields are filled
|
|
13
|
+
* only by the render pipeline and are not public API (values are always the manager's latest).
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
6
16
|
export interface RenderOptions extends Required<GridOptions> {
|
|
7
|
-
/** ColumnLayout.frozenCount — 고정 컬럼 수(헤더/본문 좌측 오프셋 계산). */
|
|
17
|
+
/** ColumnLayout.frozenCount — 고정 컬럼 수(헤더/본문 좌측 오프셋 계산). / Frozen column count (header/body left-offset calc). */
|
|
8
18
|
_frozenCount?: number;
|
|
9
|
-
/**
|
|
19
|
+
/** 활성 필터 — 필터 아이콘 활성 표시용. / Active filters — to mark the filter icon active. */
|
|
10
20
|
_activeFilters?: Record<string, FilterItem[]>;
|
|
11
|
-
/** DnD 핸들에 넘길 총 행수. */
|
|
21
|
+
/** DnD 핸들에 넘길 총 행수. / Total row count passed to the DnD handle. */
|
|
12
22
|
_totalRows?: number;
|
|
13
|
-
/**
|
|
23
|
+
/** 포커스 셀 — 포커스 셀 하이라이트. / The focus cell — for focus-cell highlighting. */
|
|
14
24
|
_focusCell?: {
|
|
15
25
|
ri: number;
|
|
16
26
|
ci: number;
|
|
17
27
|
} | null;
|
|
18
|
-
/**
|
|
28
|
+
/** 범위 선택 rect 하이라이트 재적용 재료(비-'cells' 모드면 없음). / Rects to re-apply range-selection highlight (absent outside 'cells' mode). */
|
|
19
29
|
_rangeRects?: CellRange[];
|
|
20
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* R3(§6-R3 / §2.5 R-4b): renderBody 의 위치 인자 묶음을 단일 파라미터 객체로.
|
|
33
|
+
* R9: opts 필드 타입 복원(any → RenderOptions). 나머지 필드는 기존 위치 인자의 타입 그대로.
|
|
34
|
+
* / R3 (§6-R3 / §2.5 R-4b): renderBody's positional arguments gathered into a single parameter
|
|
35
|
+
* object. R9: opts field typed as RenderOptions (was any); the remaining fields keep the types of
|
|
36
|
+
* the former positional arguments.
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
21
39
|
export interface RenderFrame {
|
|
40
|
+
/** 가시 구간 시작 flat 행 인덱스. / First visible flat row index. */
|
|
22
41
|
startIndex: number;
|
|
42
|
+
/** 가시 구간 끝 flat 행 인덱스. / Last visible flat row index. */
|
|
23
43
|
endIndex: number;
|
|
44
|
+
/** 행 데이터 소스. / Row data source. */
|
|
24
45
|
data: DataLayer<any>;
|
|
46
|
+
/** 리프 컬럼 정의 배열. / Leaf column definitions. */
|
|
25
47
|
leaves: ColumnDef[];
|
|
48
|
+
/** 리프 컬럼별 너비(px). / Per-leaf column widths (px). */
|
|
26
49
|
widths: number[];
|
|
50
|
+
/** 렌더 옵션(내부 증강 포함). / Render options (with internal augmentation). */
|
|
27
51
|
opts: RenderOptions;
|
|
52
|
+
/** 가상 스크롤 상단 오프셋(px). / Virtual-scroll top offset (px). */
|
|
28
53
|
offsetY: number;
|
|
54
|
+
/** 전체 스크롤 높이(px). / Total scroll height (px). */
|
|
29
55
|
totalHeight: number;
|
|
56
|
+
/** 선택된 행 집합. / Set of selected rows. */
|
|
30
57
|
selectedRows: Set<number>;
|
|
58
|
+
/** 체크된 행 집합. / Set of checked rows. */
|
|
31
59
|
checkedRows: Set<number>;
|
|
60
|
+
/** 그룹/트리 플랫 행(그룹핑 시). / Grouped/tree flat rows (when grouping). */
|
|
32
61
|
groupFlatRows?: Array<any> | null;
|
|
62
|
+
/** 그룹 접기/펴기 콜백. / Group collapse/expand callback. */
|
|
33
63
|
onGroupToggle?: ((key: string) => void) | undefined;
|
|
64
|
+
/** 트리 노드 접기/펴기 콜백. / Tree-node collapse/expand callback. */
|
|
34
65
|
onTreeToggle?: ((nodeId: any) => void) | undefined;
|
|
66
|
+
/** opts 위에 병합할 추가 옵션(DnD 총행수 등). / Extra options merged over opts (e.g. DnD total rows). */
|
|
35
67
|
extraOpts?: Record<string, any>;
|
|
68
|
+
/** 셀 병합 엔진(있으면). / Cell-merge engine (if any). */
|
|
36
69
|
mergeEngine?: MergeEngine | undefined;
|
|
70
|
+
/** 마스터/디테일 렌더 배선(F2, 비활성 시 undefined). / Master/detail render wiring (F2; undefined when disabled). */
|
|
37
71
|
detailApi?: DetailRenderContext | undefined;
|
|
38
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* 렌더러가 상위(RenderController/OpenGrid)로 이벤트를 되돌리고 상태를 질의하는 콜백 묶음.
|
|
75
|
+
* 매 렌더 최신값으로 채워진다.
|
|
76
|
+
* / The callback bundle through which the renderer sends events back to and queries state from the
|
|
77
|
+
* host (RenderController/OpenGrid). Filled with the latest values each render.
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
39
80
|
export interface RendererCallbacks {
|
|
40
81
|
onHeaderClick: (field: string, shiftKey: boolean) => void;
|
|
41
82
|
onCellClick: (ri: number, ci: number, e: MouseEvent) => void;
|
|
@@ -62,27 +103,49 @@ export interface RendererCallbacks {
|
|
|
62
103
|
approx: boolean;
|
|
63
104
|
} | null;
|
|
64
105
|
t?: (key: string, params?: Record<string, string | number>) => string;
|
|
106
|
+
applyCF?: (cellEl: HTMLElement, rowIndex: number, field: string, value: unknown, cellW: number, cellH: number) => void;
|
|
65
107
|
}
|
|
66
108
|
/**
|
|
67
|
-
* F2(
|
|
68
|
-
*
|
|
69
|
-
*
|
|
109
|
+
* F2(§4/§5, C6/C10): renderBody 가 detail head/filler 분기·expander 셀을 그릴 때 소비하는 배선
|
|
110
|
+
* 콜백 묶음. 매 렌더 새로 만들어 넘긴다(옵션/상태는 항상 DetailManager 최신값). masterDetail.enabled
|
|
111
|
+
* 가 아니면 undefined.
|
|
112
|
+
* / F2 (§4/§5, C6/C10): the wiring-callback bundle renderBody consumes when drawing detail
|
|
113
|
+
* head/filler branches and the expander cell. Rebuilt and passed each render (options/state are
|
|
114
|
+
* always DetailManager's latest). undefined unless masterDetail.enabled.
|
|
115
|
+
* @internal
|
|
70
116
|
*/
|
|
71
117
|
export interface DetailRenderContext {
|
|
118
|
+
/** 토글 위치 모드(전용 컬럼 vs 첫 셀). / Toggle placement mode (dedicated column vs first cell). */
|
|
72
119
|
toggleMode: 'expander-col' | 'first-cell';
|
|
120
|
+
/** 디테일 패널 aria-label. / Detail-panel aria-label. */
|
|
73
121
|
ariaLabel: string;
|
|
122
|
+
/** 행 → rowId 해소. / Resolve a row to its rowId. */
|
|
74
123
|
getRowId: (row: any) => string;
|
|
124
|
+
/** rowId 가 펼쳐졌는가. / Whether the rowId is expanded. */
|
|
75
125
|
isExpanded: (rowId: string) => boolean;
|
|
126
|
+
/** 토글 클릭 처리. / Handle a toggle click. */
|
|
76
127
|
onToggle: (rowIndex: number, rowId: string) => void;
|
|
128
|
+
/** 확장 상태별 글리프·라벨·title. / Glyph/label/title per expanded state. */
|
|
77
129
|
getGlyph: (expanded: boolean) => {
|
|
78
130
|
glyph: string;
|
|
79
131
|
ariaLabel: string;
|
|
80
132
|
title: string;
|
|
81
133
|
};
|
|
134
|
+
/** rowId 의 영속 패널 host 요소. / The persistent panel host element for a rowId. */
|
|
82
135
|
getPanelHost: (rowId: string) => HTMLElement;
|
|
83
|
-
/** renderBody 매 호출 시작(teardown 직전) — 편집중 host hoist + 나머지 detach(§5). */
|
|
136
|
+
/** renderBody 매 호출 시작(teardown 직전) — 편집중 host hoist + 나머지 detach(§5). / Start of each renderBody call (just before teardown) — hoist the editing host, detach the rest (§5). */
|
|
84
137
|
onBeforeTeardown: () => void;
|
|
85
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* 그리드의 DOM 렌더러. 루트에 헤더·본문 래퍼를 마운트하고, 가상 스크롤 프레임마다 헤더/본문 셀을
|
|
141
|
+
* 다시 그린다. 스타일 결정은 AppearanceResolver(R12a C10) 한 곳을 경유하고, host-isolation 을 위해
|
|
142
|
+
* load-bearing 스타일은 인라인으로 쓴다. 상위 상태 접근·이벤트 반환은 전부 RendererCallbacks 경유.
|
|
143
|
+
* / The grid's DOM renderer. Mounts the header and body wrapper into the root and repaints
|
|
144
|
+
* header/body cells for each virtual-scroll frame. Style decisions route through the single
|
|
145
|
+
* AppearanceResolver (R12a C10), and load-bearing styles are written inline for host isolation.
|
|
146
|
+
* All host-state access and event return goes through RendererCallbacks.
|
|
147
|
+
* @internal
|
|
148
|
+
*/
|
|
86
149
|
export declare class GridRenderer {
|
|
87
150
|
private _root;
|
|
88
151
|
private _header;
|
|
@@ -92,15 +155,68 @@ export declare class GridRenderer {
|
|
|
92
155
|
private _cbs;
|
|
93
156
|
private _ap;
|
|
94
157
|
private _cellMap;
|
|
158
|
+
/** 본문 스크롤 래퍼 요소(스크롤/뷰포트 계산 접근용). / The body scroll-wrapper element (for scroll/viewport calculations). */
|
|
95
159
|
get bodyWrapper(): HTMLElement;
|
|
96
160
|
/** i18n: 렌더 로케일 해석기 — cbs.t(인스턴스 로케일) 우선, 미주입 시 전역 t. / i18n: cbs.t (instance locale) first, global t otherwise. */
|
|
97
161
|
private _t;
|
|
162
|
+
/**
|
|
163
|
+
* 루트에 헤더·본문 래퍼를 마운트하고 헤더-본문 가로 스크롤을 동기화한다.
|
|
164
|
+
* / Mount the header and body wrapper into the root and sync header–body horizontal scroll.
|
|
165
|
+
*
|
|
166
|
+
* @param root - 렌더러가 채울 컨테이너 요소 / Container element the renderer fills
|
|
167
|
+
* @param opts - 렌더 옵션(기본값 병합 완료) / Render options (defaults already merged)
|
|
168
|
+
* @param cbs - 이벤트/상태 콜백 묶음 / Event/state callback bundle
|
|
169
|
+
* @param appearance - 스타일 결정 resolver(미주입 시 테마 컨텍스트로 생성) / Style-decision resolver (created from the theme context if not injected)
|
|
170
|
+
*/
|
|
98
171
|
constructor(root: HTMLElement, opts: RenderOptions, cbs: RendererCallbacks, appearance?: AppearanceResolver);
|
|
172
|
+
/**
|
|
173
|
+
* 본문 래퍼 높이를 전체 높이에서 헤더 높이를 뺀 값으로 설정한다.
|
|
174
|
+
* / Set the body wrapper's height to the total height minus the header height.
|
|
175
|
+
*
|
|
176
|
+
* @param totalHeight - 그리드 전체 높이(px) / Total grid height (px)
|
|
177
|
+
* @param headerHeight - 헤더 높이(px) / Header height (px)
|
|
178
|
+
*/
|
|
99
179
|
updateSize(totalHeight: number, headerHeight: number): void;
|
|
100
|
-
/**
|
|
180
|
+
/**
|
|
181
|
+
* 현재 렌더된 헤더 영역의 실제 높이(px). 헤더 줄바꿈으로 늘어난 높이를 레이아웃에 반영할 때 사용.
|
|
182
|
+
* / The actual height (px) of the currently rendered header. Used to reflect height grown by
|
|
183
|
+
* header wrapping back into layout.
|
|
184
|
+
*
|
|
185
|
+
* @returns 헤더 offsetHeight(px) / The header offsetHeight (px)
|
|
186
|
+
*/
|
|
101
187
|
getHeaderHeight(): number;
|
|
188
|
+
/**
|
|
189
|
+
* 헤더 영역을 다시 그린다 — 다단 헤더 행·정렬/필터 아이콘·리사이저·컬럼 재정렬·고정 컬럼
|
|
190
|
+
* 오프셋을 반영한다. 매 호출 헤더 innerHTML 을 재구성한다.
|
|
191
|
+
* / Repaint the header — reflecting multi-row headers, sort/filter icons, resizers, column
|
|
192
|
+
* reordering, and frozen-column offsets. Rebuilds the header innerHTML each call.
|
|
193
|
+
*
|
|
194
|
+
* @param headerRows - 다단 헤더 셀 행렬 / Multi-row header cell matrix
|
|
195
|
+
* @param leaves - 리프 컬럼 정의 / Leaf column definitions
|
|
196
|
+
* @param widths - 리프 컬럼 너비(px) / Leaf column widths (px)
|
|
197
|
+
* @param sortList - 활성 정렬 항목 / Active sort items
|
|
198
|
+
* @param opts - 렌더 옵션(고정 컬럼 수·필터 등) / Render options (frozen count, filters, …)
|
|
199
|
+
*/
|
|
102
200
|
renderHeader(headerRows: any[][], leaves: ColumnDef[], widths: number[], sortList: SortItem[], opts: RenderOptions): void;
|
|
201
|
+
/**
|
|
202
|
+
* 본문 가시 구간을 다시 그린다 — 그룹/트리 행·상태/선택 배경·고정 컬럼·셀 병합·마스터/디테일
|
|
203
|
+
* 패널·수식 메타를 반영하고, rowIndex→colIndex→cellEl 맵을 재구성한다(getCellEl 근거).
|
|
204
|
+
* / Repaint the visible body range — reflecting group/tree rows, state/selection backgrounds,
|
|
205
|
+
* frozen columns, cell merges, master/detail panels, and formula meta, and rebuilding the
|
|
206
|
+
* rowIndex→colIndex→cellEl map (the basis for getCellEl).
|
|
207
|
+
*
|
|
208
|
+
* @param frame - 렌더 프레임(구간·데이터·컬럼·상태·배선) / The render frame (range, data, columns, state, wiring)
|
|
209
|
+
*/
|
|
103
210
|
renderBody(frame: RenderFrame): void;
|
|
211
|
+
/**
|
|
212
|
+
* 마지막 renderBody 가 만든 셀 요소를 조회한다(맵 미스면 undefined — 가시 구간 밖이거나 병합 은닉).
|
|
213
|
+
* / Look up a cell element from the last renderBody (undefined on map miss — outside the visible
|
|
214
|
+
* range or hidden by a merge).
|
|
215
|
+
*
|
|
216
|
+
* @param rowIndex - flat 행 인덱스 / Flat row index
|
|
217
|
+
* @param colIndex - 리프 컬럼 인덱스 / Leaf column index
|
|
218
|
+
* @returns 셀 요소 또는 undefined / The cell element, or undefined
|
|
219
|
+
*/
|
|
104
220
|
getCellEl(rowIndex: number, colIndex: number): HTMLElement | undefined;
|
|
105
221
|
/**
|
|
106
222
|
* F2(§4.3 C6): full-width 디테일 패널을 body-absolute 로 그린다(병합 마스터셀 선례
|
|
@@ -109,8 +225,25 @@ export declare class GridRenderer {
|
|
|
109
225
|
* DOM 이동만 발생하므로(파괴 아님) 재렌더/스크롤 왕복에도 인스턴스 상태가 생존한다.
|
|
110
226
|
*/
|
|
111
227
|
private _appendDetailPanel;
|
|
228
|
+
/**
|
|
229
|
+
* 렌더러가 마운트한 DOM 을 전부 제거해 루트를 비운다.
|
|
230
|
+
* / Remove all DOM the renderer mounted, emptying the root.
|
|
231
|
+
*/
|
|
112
232
|
destroy(): void;
|
|
113
233
|
}
|
|
234
|
+
/**
|
|
235
|
+
* 태그(+선택 className)로 요소를 만든다. / Create an element from a tag (+optional className).
|
|
236
|
+
* @internal
|
|
237
|
+
*/
|
|
114
238
|
export declare function _el(tag: string, className?: string): HTMLElement;
|
|
239
|
+
/**
|
|
240
|
+
* 요소 style 에 부분 스타일을 병합한다. / Merge a partial style bag into an element's style.
|
|
241
|
+
* @internal
|
|
242
|
+
*/
|
|
115
243
|
export declare function _style(el: HTMLElement, styles: Partial<CSSStyleDeclaration>): void;
|
|
244
|
+
/**
|
|
245
|
+
* 문자열 내용을 파일로 다운로드시킨다(Blob URL 생성 후 즉시 해제).
|
|
246
|
+
* / Trigger a file download of string content (creates then immediately revokes a Blob URL).
|
|
247
|
+
* @internal
|
|
248
|
+
*/
|
|
116
249
|
export declare function _downloadText(content: string, filename: string, mime?: string): void;
|
|
@@ -1,50 +1,108 @@
|
|
|
1
1
|
import { SummaryOp } from './types.js';
|
|
2
|
+
/** 그룹 헤더 행 — 하위 행 집계·상태·펼침 메타를 담는다. / A group header row — carries child aggregation, state, and expansion metadata. */
|
|
2
3
|
export interface GroupRow<T = any> {
|
|
4
|
+
/** 그룹 행 판별 플래그(항상 true). / Group-row discriminant flag (always true). */
|
|
3
5
|
_isGroup: true;
|
|
6
|
+
/** 그룹핑 기준 필드명. / Field this level is grouped by. */
|
|
4
7
|
_groupField: string;
|
|
8
|
+
/** 그룹 값(원본). / Raw group value. */
|
|
5
9
|
_groupValue: any;
|
|
10
|
+
/** 표시용 그룹 라벨(null 값은 전역 로케일 라벨로 대체). / Display label (null values fall back to the global locale label). */
|
|
6
11
|
_groupLabel: string;
|
|
12
|
+
/** 그룹 깊이(0-base). / Group depth (0-based). */
|
|
7
13
|
_depth: number;
|
|
14
|
+
/** 펼침 여부. / Whether the group is expanded. */
|
|
8
15
|
_expanded: boolean;
|
|
16
|
+
/** 하위 행 수. / Number of child rows. */
|
|
9
17
|
_childCount: number;
|
|
18
|
+
/** { field → 계산값(number) }. / { field → computed value (number) }. */
|
|
10
19
|
_summary: Record<string, any>;
|
|
20
|
+
/** { field → 포맷된 문자열 }. / { field → formatted string }. */
|
|
11
21
|
_summaryFmt: Record<string, string>;
|
|
22
|
+
/** 하위 행 편집 상태 카운트. / Edit-state counts among child rows. */
|
|
12
23
|
_states: {
|
|
13
24
|
added: number;
|
|
14
25
|
edited: number;
|
|
15
26
|
removed: number;
|
|
16
27
|
};
|
|
28
|
+
/** 자식(중첩 그룹 또는 원본 행). / Children (nested groups or raw rows). */
|
|
17
29
|
children: Array<GroupRow<T> | T>;
|
|
18
30
|
}
|
|
31
|
+
/** 그룹 항목 — 그룹 헤더 행 또는 원본 행. / A group item — either a group header row or a raw row. */
|
|
19
32
|
export type GroupItem<T> = GroupRow<T> | T;
|
|
33
|
+
/** 그룹 집계(summary) 정의. / A group summary (aggregation) definition. */
|
|
20
34
|
export interface SummaryDef {
|
|
35
|
+
/** 집계 대상 필드명. / Field to aggregate. */
|
|
21
36
|
field: string;
|
|
37
|
+
/** 집계 연산(SUM/AVG/COUNT/MIN/MAX). / Aggregation op (SUM/AVG/COUNT/MIN/MAX). */
|
|
22
38
|
op: SummaryOp;
|
|
39
|
+
/** 표시 라벨(선택). / Display label (optional). */
|
|
23
40
|
label?: string;
|
|
41
|
+
/** 숫자 포맷 예: '#,##0' | '#,##0.00' | '0.00' | '2'. / Number format, e.g. '#,##0' | '#,##0.00' | '0.00' | '2'. */
|
|
24
42
|
format?: string;
|
|
25
43
|
}
|
|
26
44
|
declare function _isGroup<T>(item: any): item is GroupRow<T>;
|
|
27
45
|
/**
|
|
28
|
-
* flat 데이터를 fields 기준으로 계층 그룹핑.
|
|
46
|
+
* flat 데이터를 fields 기준으로 계층 그룹핑. / Hierarchically group flat data by `fields`.
|
|
47
|
+
*
|
|
29
48
|
* Phase 2 슬롯 #5: groupKeyFn(getKey) — 미지정 시 default = `row[field]`(현행 단일 필드 키).
|
|
30
49
|
* GroupTreeManager 가 host.getStrategy 로 주입. ⚠️ 핫패스(행당) — 슬롯 예외 비격리.
|
|
50
|
+
* / Phase 2 slot #5: groupKeyFn (`getKey`) — when unset the default is `row[field]` (the current
|
|
51
|
+
* single-field key), injected by GroupTreeManager via host.getStrategy. ⚠️ Hot path (per row) —
|
|
52
|
+
* exceptions thrown by the slot are not isolated.
|
|
53
|
+
*
|
|
54
|
+
* @typeParam T - 행 데이터 타입 / Row data type
|
|
55
|
+
* @param data - flat 행 배열 / Flat rows
|
|
56
|
+
* @param fields - 그룹핑 기준 필드 순서 / Fields to group by, in order
|
|
57
|
+
* @param summaryDefs - 그룹별 집계 정의(기본 없음) / Per-group aggregation defs (default none)
|
|
58
|
+
* @param expandedKeys - 펼침 상태 그룹 키 집합 / Set of expanded group keys
|
|
59
|
+
* @param getRowState - 행 편집 상태 조회자(선택) / Optional row edit-state accessor
|
|
60
|
+
* @param getKey - 그룹 키 계산 슬롯(선택) / Optional group-key computation slot
|
|
61
|
+
* @returns 최상위 그룹 행 배열 / Array of top-level group rows
|
|
62
|
+
* @example
|
|
63
|
+
* const groups = buildGroups(rows, ['region', 'city'], [{ field: 'amount', op: 'SUM' }]);
|
|
64
|
+
* const flat = flattenGroups(groups); // 화면 표시용 / for on-screen display
|
|
31
65
|
*/
|
|
32
66
|
export declare function buildGroups<T extends Record<string, any>>(data: T[], fields: string[], summaryDefs?: SummaryDef[], expandedKeys?: Set<string>, getRowState?: (row: T) => string, getKey?: (row: T, remainingFields: string[]) => any): GroupRow<T>[];
|
|
33
67
|
/**
|
|
34
|
-
* 숫자 포맷팅
|
|
35
|
-
*
|
|
36
|
-
* '#,##0
|
|
37
|
-
* '0.00'
|
|
38
|
-
* '
|
|
68
|
+
* 숫자 포맷팅(GroupEngine 내부 + 외부 공용). / Number formatting (used inside GroupEngine and shared externally).
|
|
69
|
+
*
|
|
70
|
+
* '#,##0' → 천단위 콤마, 정수 / thousands comma, integer
|
|
71
|
+
* '#,##0.00' → 천단위 콤마, 소수 2자리 / thousands comma, 2 decimals
|
|
72
|
+
* '0.00' → 소수 2자리 (콤마 없음) / 2 decimals, no comma
|
|
73
|
+
* '2' → 소수 2자리 (하위 호환) / 2 decimals (legacy compatibility)
|
|
74
|
+
*
|
|
75
|
+
* @param value - 포맷할 숫자 / Number to format
|
|
76
|
+
* @param fmt - 포맷 패턴(생략 시 자동: 정수/소수 판별) / Format pattern (auto integer/decimal when omitted)
|
|
77
|
+
* @returns 포맷된 문자열 / The formatted string
|
|
39
78
|
*/
|
|
40
79
|
export declare function _fmtNum(value: number, fmt?: string): string;
|
|
41
80
|
/**
|
|
42
|
-
* 그룹 트리를 화면에 표시할 flat 행 배열로 변환.
|
|
43
|
-
*
|
|
81
|
+
* 그룹 트리를 화면에 표시할 flat 행 배열로 변환. / Flatten a group tree into a display row array.
|
|
82
|
+
*
|
|
83
|
+
* 접힌 그룹(expanded=false)의 자식은 포함하지 않음. / Children of collapsed groups (expanded=false) are excluded.
|
|
84
|
+
*
|
|
85
|
+
* @typeParam T - 행 데이터 타입 / Row data type
|
|
86
|
+
* @param groups - 최상위 그룹 행 배열 / Top-level group rows
|
|
87
|
+
* @returns 펼침 상태에 따른 표시 행(그룹 헤더 + 원본 행) / Visible rows per expansion state (group headers + raw rows)
|
|
44
88
|
*/
|
|
45
89
|
export declare function flattenGroups<T>(groups: GroupRow<T>[]): Array<GroupRow<T> | T>;
|
|
46
|
-
/**
|
|
90
|
+
/**
|
|
91
|
+
* 특정 그룹 키의 펼침 상태를 토글. / Toggle the expansion state of a group key.
|
|
92
|
+
*
|
|
93
|
+
* @typeParam T - 행 데이터 타입 / Row data type
|
|
94
|
+
* @param groups - 그룹 행 배열(시그니처 호환용) / Group rows (kept for signature compatibility)
|
|
95
|
+
* @param groupKey - 토글할 그룹 키 / Group key to toggle
|
|
96
|
+
* @param expandedKeys - 펼침 상태 집합(제자리 변경) / Set of expanded keys (mutated in place)
|
|
97
|
+
*/
|
|
47
98
|
export declare function toggleGroup<T>(groups: GroupRow<T>[], groupKey: string, expandedKeys: Set<string>): void;
|
|
48
|
-
/**
|
|
99
|
+
/**
|
|
100
|
+
* 모든 그룹 키 수집(전체 펼침/접기 등에 사용). / Collect every group key (used for expand-all/collapse-all).
|
|
101
|
+
*
|
|
102
|
+
* @typeParam T - 행 데이터 타입 / Row data type
|
|
103
|
+
* @param groups - 그룹 행 배열 / Group rows
|
|
104
|
+
* @param parentKey - 상위 키 접두(재귀용, 기본 '') / Parent key prefix (for recursion, default '')
|
|
105
|
+
* @returns 중첩 포함 전체 그룹 키 배열 / All group keys including nested ones
|
|
106
|
+
*/
|
|
49
107
|
export declare function collectAllKeys<T>(groups: GroupRow<T>[], parentKey?: string): string[];
|
|
50
108
|
export { _isGroup };
|
|
@@ -1,26 +1,79 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 소수점 precision 자리로 반올림 (epsilon round).
|
|
2
|
+
* 소수점 precision 자리로 반올림 (epsilon round). / Round to `precision` decimal places (epsilon round).
|
|
3
|
+
*
|
|
3
4
|
* 0.1+0.2+... 누적 오차를 최종 표시 단계에서 제거한다.
|
|
5
|
+
* / Removes accumulated 0.1+0.2+… floating-point error at the final display step.
|
|
6
|
+
*
|
|
7
|
+
* @param val - 반올림할 값 / Value to round
|
|
8
|
+
* @param precision - 소수점 자리수(기본 10) / Number of decimal places (default 10)
|
|
9
|
+
* @returns 반올림된 값 / The rounded value
|
|
4
10
|
*/
|
|
5
11
|
export declare function round(val: number, precision?: number): number;
|
|
6
12
|
/**
|
|
7
13
|
* Kahan compensated summation — 대량 합산 시 부동소수점 오차 최소화.
|
|
14
|
+
* / Kahan compensated summation — minimizes floating-point error over large sums.
|
|
15
|
+
*
|
|
8
16
|
* 시간복잡도 O(n), 공간 O(1). 빈 배열 → 0 반환.
|
|
17
|
+
* / Time O(n), space O(1). Empty array → returns 0.
|
|
18
|
+
*
|
|
19
|
+
* @param arr - 합산할 숫자 배열 / Numbers to sum
|
|
20
|
+
* @returns 보정 합계 / The compensated sum
|
|
9
21
|
*/
|
|
10
22
|
export declare function kahanSum(arr: number[]): number;
|
|
11
23
|
/**
|
|
12
|
-
* 안전
|
|
24
|
+
* 안전 덧셈 — 결과를 precision 반올림해 소수점 오차 방지. / Safe addition — rounds the result to `precision` to avoid float error.
|
|
25
|
+
*
|
|
26
|
+
* @param a - 피연산자 1 / First operand
|
|
27
|
+
* @param b - 피연산자 2 / Second operand
|
|
28
|
+
* @param precision - 소수점 자리수(기본 10) / Decimal places (default 10)
|
|
29
|
+
* @returns 반올림된 합 / The rounded sum
|
|
13
30
|
*/
|
|
14
31
|
export declare function safeAdd(a: number, b: number, precision?: number): number;
|
|
32
|
+
/**
|
|
33
|
+
* 안전 뺄셈 — 결과를 precision 반올림. / Safe subtraction — rounds the result to `precision`.
|
|
34
|
+
*
|
|
35
|
+
* @param a - 피연산자 1 / First operand
|
|
36
|
+
* @param b - 피연산자 2 / Second operand
|
|
37
|
+
* @param precision - 소수점 자리수(기본 10) / Decimal places (default 10)
|
|
38
|
+
* @returns 반올림된 차 / The rounded difference
|
|
39
|
+
*/
|
|
15
40
|
export declare function safeSub(a: number, b: number, precision?: number): number;
|
|
41
|
+
/**
|
|
42
|
+
* 안전 곱셈 — 결과를 precision 반올림. / Safe multiplication — rounds the result to `precision`.
|
|
43
|
+
*
|
|
44
|
+
* @param a - 피연산자 1 / First operand
|
|
45
|
+
* @param b - 피연산자 2 / Second operand
|
|
46
|
+
* @param precision - 소수점 자리수(기본 10) / Decimal places (default 10)
|
|
47
|
+
* @returns 반올림된 곱 / The rounded product
|
|
48
|
+
*/
|
|
16
49
|
export declare function safeMul(a: number, b: number, precision?: number): number;
|
|
50
|
+
/**
|
|
51
|
+
* 안전 나눗셈 — 결과를 precision 반올림. 0 나눗셈은 예외. / Safe division — rounds the result; throws on divide-by-zero.
|
|
52
|
+
*
|
|
53
|
+
* @param a - 피제수 / Dividend
|
|
54
|
+
* @param b - 제수(0 금지) / Divisor (must be non-zero)
|
|
55
|
+
* @param precision - 소수점 자리수(기본 10) / Decimal places (default 10)
|
|
56
|
+
* @returns 반올림된 몫 / The rounded quotient
|
|
57
|
+
* @throws b 가 0 이면 Error / Error when `b` is 0
|
|
58
|
+
*/
|
|
17
59
|
export declare function safeDiv(a: number, b: number, precision?: number): number;
|
|
18
60
|
/**
|
|
19
|
-
* Kahan 합산 후 precision 반올림.
|
|
20
|
-
*
|
|
61
|
+
* Kahan 합산 후 precision 반올림. / Kahan sum followed by `precision` rounding.
|
|
62
|
+
*
|
|
63
|
+
* SUM/AVG footer 계산에 사용. / Used for SUM/AVG footer computation.
|
|
64
|
+
*
|
|
65
|
+
* @param arr - 합산할 숫자 배열 / Numbers to sum
|
|
66
|
+
* @param precision - 소수점 자리수(기본 10) / Decimal places (default 10)
|
|
67
|
+
* @returns 반올림된 보정 합계 / The rounded compensated sum
|
|
21
68
|
*/
|
|
22
69
|
export declare function kahanSumRounded(arr: number[], precision?: number): number;
|
|
23
70
|
/**
|
|
24
|
-
* Kahan AVG — 합산 후 count로 나누기.
|
|
71
|
+
* Kahan AVG — 합산 후 count로 나누기. / Kahan average — sum, then divide by count.
|
|
72
|
+
*
|
|
73
|
+
* 빈 배열 → 0 반환. / Empty array → returns 0.
|
|
74
|
+
*
|
|
75
|
+
* @param arr - 평균 낼 숫자 배열 / Numbers to average
|
|
76
|
+
* @param precision - 소수점 자리수(기본 10) / Decimal places (default 10)
|
|
77
|
+
* @returns 반올림된 평균 / The rounded average
|
|
25
78
|
*/
|
|
26
79
|
export declare function kahanAvg(arr: number[], precision?: number): number;
|
|
@@ -1,35 +1,70 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* 셀 병합 관리 엔진.
|
|
2
|
+
* 셀 병합 관리 엔진. / Cell-merge management engine.
|
|
3
3
|
*
|
|
4
|
-
* 두 가지 병합 방식
|
|
5
|
-
* 1. 동적
|
|
6
|
-
* 2. 자동
|
|
4
|
+
* 두 가지 병합 방식 지원 / Supports two merge modes:
|
|
5
|
+
* 1. 동적 병합 / Explicit merge: applyMergeCells([{row, col, rowSpan, colSpan}])
|
|
6
|
+
* 2. 자동 병합 / Auto merge: 같은 필드에 같은 값이 연속되면 자동으로 rowSpan
|
|
7
|
+
* / consecutive equal values in a field collapse into a rowSpan automatically
|
|
7
8
|
*/
|
|
9
|
+
/** 병합 대상 셀 정의(기준 셀). / A cell to merge (the anchor cell). */
|
|
8
10
|
export interface MergeCell {
|
|
11
|
+
/** 표시 행 인덱스(0-base). / Display row index (0-based). */
|
|
9
12
|
row: number;
|
|
13
|
+
/** 리프 컬럼 인덱스(0-base). / Leaf column index (0-based). */
|
|
10
14
|
col: number;
|
|
15
|
+
/** 세로 병합 칸 수(1 이상, 기본 1). / Vertical span count (>=1, default 1). */
|
|
11
16
|
rowSpan?: number;
|
|
17
|
+
/** 가로 병합 칸 수(1 이상, 기본 1). / Horizontal span count (>=1, default 1). */
|
|
12
18
|
colSpan?: number;
|
|
13
19
|
}
|
|
20
|
+
/** 특정 (row,col) 셀의 병합 결과 정보. / Resolved merge info for a specific (row,col) cell. */
|
|
14
21
|
export interface MergeInfo {
|
|
22
|
+
/** 세로 병합 칸 수. / Vertical span count. */
|
|
15
23
|
rowSpan: number;
|
|
24
|
+
/** 가로 병합 칸 수. / Horizontal span count. */
|
|
16
25
|
colSpan: number;
|
|
26
|
+
/** 병합으로 숨겨진 셀(렌더링 생략). / Cell hidden by a merge (skipped in rendering). */
|
|
17
27
|
hidden: boolean;
|
|
18
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* 병합 맵 계산·조회를 담당하는 엔진. / Engine that computes and serves the merge map.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* const merge = new MergeEngine();
|
|
34
|
+
* merge.applyMergeCells([{ row: 0, col: 1, rowSpan: 2 }]);
|
|
35
|
+
* merge.getInfo(0, 1); // { rowSpan: 2, colSpan: 1, hidden: false }
|
|
36
|
+
*/
|
|
19
37
|
export declare class MergeEngine {
|
|
20
38
|
private _map;
|
|
21
39
|
private static _key;
|
|
22
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* 수동 병합 정의 목록으로 맵 구성. / Build the merge map from an explicit list of merge cells.
|
|
42
|
+
*
|
|
43
|
+
* 각 기준 셀은 span 을 갖고, 병합에 삼켜진 하위 셀은 `hidden:true` 로 표시된다.
|
|
44
|
+
* / Each anchor cell keeps its span; cells swallowed by the merge are marked `hidden:true`.
|
|
45
|
+
*
|
|
46
|
+
* @param cells - 병합할 셀 정의 목록 / List of cells to merge
|
|
47
|
+
*/
|
|
23
48
|
applyMergeCells(cells: MergeCell[]): void;
|
|
24
49
|
/**
|
|
25
|
-
* 자동 병합: 지정
|
|
26
|
-
*
|
|
27
|
-
*
|
|
50
|
+
* 자동 병합: 지정 컬럼에서 연속 같은 값을 rowSpan 으로 병합.
|
|
51
|
+
* / Auto merge: collapse consecutive equal values in the given columns into rowSpans.
|
|
52
|
+
*
|
|
53
|
+
* @param data - 현재 표시 순서의 행 배열 / Rows in current display order
|
|
54
|
+
* @param colIndexes - 자동 병합할 leaf 컬럼 인덱스 목록 / Leaf column indexes to auto-merge
|
|
55
|
+
* @param fields - colIndexes[i] 에 대응하는 field 이름 / Field names matching each `colIndexes[i]`
|
|
28
56
|
*/
|
|
29
57
|
applyAutoMerge(data: Record<string, any>[], colIndexes: number[], fields: string[]): void;
|
|
30
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* 셀 병합 정보 조회. / Look up merge info for a cell.
|
|
60
|
+
*
|
|
61
|
+
* @param row - 표시 행 인덱스 / Display row index
|
|
62
|
+
* @param col - 리프 컬럼 인덱스 / Leaf column index
|
|
63
|
+
* @returns 병합 정보, 없으면 null / Merge info, or null if the cell is not merged
|
|
64
|
+
*/
|
|
31
65
|
getInfo(row: number, col: number): MergeInfo | null;
|
|
32
|
-
/** 병합 맵
|
|
66
|
+
/** 병합 맵 초기화. / Clear the merge map. */
|
|
33
67
|
clear(): void;
|
|
68
|
+
/** 병합 맵이 비었는지 여부. / Whether the merge map is empty. */
|
|
34
69
|
get isEmpty(): boolean;
|
|
35
70
|
}
|