open-grid 1.2.1 → 1.3.1
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 +388 -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/FilterSelect.d.ts +26 -5
- package/dist/types/core/FormulaEngine.d.ts +15 -4
- package/dist/types/core/GridRenderer.d.ts +143 -10
- package/dist/types/core/GridShuttle.d.ts +26 -10
- package/dist/types/core/GroupEngine.d.ts +68 -10
- package/dist/types/core/IconRegistry.d.ts +31 -13
- 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 +401 -122
- package/dist/types/core/OrgChart.d.ts +32 -11
- 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 +86 -19
- package/dist/types/core/TreeEngine.d.ts +60 -6
- package/dist/types/core/VirtualScroll.d.ts +64 -0
- package/dist/types/core/XmlConverter.d.ts +40 -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/chart/types.d.ts +102 -21
- 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/LocaleRegistry.d.ts +0 -0
- package/dist/types/core/i18n/types.d.ts +67 -11
- 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 +511 -226
- 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;
|
|
@@ -3,13 +3,22 @@ import { OpenGridInstance } from './types.js';
|
|
|
3
3
|
* 그리드 셔틀 생성 옵션. / Grid shuttle construction options.
|
|
4
4
|
*/
|
|
5
5
|
export interface GridShuttleOptions {
|
|
6
|
-
/** 버튼 배치 방향.
|
|
6
|
+
/** 버튼 배치 방향. 두 그리드가 가로로 나란히 있으면 'vertical'(위아래 버튼), 세로로 쌓여 있으면
|
|
7
|
+
* 'horizontal'을 쓴다. 기본 'vertical'.
|
|
8
|
+
* / Button layout direction. Use 'vertical' (stacked buttons) when the two grids sit side by side,
|
|
9
|
+
* or 'horizontal' when they're stacked vertically. Default 'vertical'.
|
|
7
10
|
* @defaultValue 'vertical' */
|
|
8
11
|
layout?: 'vertical' | 'horizontal';
|
|
9
|
-
/** 전체 이동(≫ ≪) 버튼도 표시.
|
|
12
|
+
/** 전체 이동(≫ ≪) 버튼도 표시. "전체 선택 후 이동"을 한 번의 클릭으로 줄이고 싶을 때 켠다.
|
|
13
|
+
* 기본 false(개별 이동 버튼만 표시).
|
|
14
|
+
* / Also show move-all (≫ ≪) buttons, so a full transfer takes one click instead of
|
|
15
|
+
* "select all, then move". Default false (only the per-check move buttons are shown).
|
|
10
16
|
* @defaultValue false */
|
|
11
17
|
includeAll?: boolean;
|
|
12
|
-
/** 버튼 라벨
|
|
18
|
+
/** 버튼 라벨 커스터마이즈(다국어 문구를 직접 넣고 싶을 때). 생략 시 그리드 로케일의 기본
|
|
19
|
+
* 문구(▶ ◀ ⏩ ⏪)를 사용한다.
|
|
20
|
+
* / Customize button labels (e.g. to hardcode a specific phrase). Falls back to the grid's
|
|
21
|
+
* locale defaults (▶ ◀ ⏩ ⏪) when omitted. */
|
|
13
22
|
labels?: {
|
|
14
23
|
toRight?: string;
|
|
15
24
|
toLeft?: string;
|
|
@@ -20,12 +29,18 @@ export interface GridShuttleOptions {
|
|
|
20
29
|
/**
|
|
21
30
|
* 두 그리드 사이의 셔틀 UI. / Shuttle UI between two grids.
|
|
22
31
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
32
|
+
* "가용 항목 그리드"와 "선택된 항목 그리드"를 나란히 두고, 그 사이에서 체크한 행을 화살표
|
|
33
|
+
* 버튼으로 옮기고 싶을 때 쓴다(권한 배정, 컬럼 표시 여부 선택 같은 화면에 흔한 UI 패턴).
|
|
34
|
+
* 동작 순서는 이렇다: 사용자가 왼쪽 그리드에서 행을 체크하고 ▶ 버튼을 클릭하면, 내부적으로
|
|
35
|
+
* `grid.moveCheckedTo()` 가 호출되어 오른쪽 그리드로 행이 옮겨진다 — 이때 crossGridMapping
|
|
36
|
+
* (필드 매핑)과 3단계 이벤트가 드래그로 옮길 때와 동일하게 적용되므로, 버튼 이동과 드래그
|
|
37
|
+
* 이동을 섞어 써도 동작이 갈리지 않는다.
|
|
38
|
+
* / Places arrow buttons between an "available items" grid and a "selected items" grid so
|
|
39
|
+
* checked rows can be moved between them without dragging (a common pattern for permission
|
|
40
|
+
* assignment, column visibility pickers, etc.). Operation order: the user checks rows in the
|
|
41
|
+
* left grid and clicks ▶, which internally calls `grid.moveCheckedTo()` to move those rows into
|
|
42
|
+
* the right grid — crossGridMapping (field mapping) and the 3-stage events apply identically to
|
|
43
|
+
* drag-based moves, so mixing button moves with drag moves never behaves differently.
|
|
29
44
|
*
|
|
30
45
|
* @example
|
|
31
46
|
* const shuttle = new GridShuttle(leftGrid, rightGrid, document.querySelector('#mid')!, {
|
|
@@ -51,7 +66,8 @@ export declare class GridShuttle {
|
|
|
51
66
|
/**
|
|
52
67
|
* 두 그리드 사이에 셔틀(화살표 이동) 버튼을 만든다. / Create shuttle (arrow-move) buttons between two grids.
|
|
53
68
|
*
|
|
54
|
-
* `new GridShuttle(...)`
|
|
69
|
+
* `new GridShuttle(...)` 과 동일하되, `new` 없이 함수 호출 한 줄로 끝내고 싶을 때 쓰는 편의 팩토리.
|
|
70
|
+
* / Same as `new GridShuttle(...)`, but a convenience factory for callers who'd rather skip `new`.
|
|
55
71
|
*
|
|
56
72
|
* @param left - 왼쪽 그리드 인스턴스 / Left grid instance
|
|
57
73
|
* @param right - 오른쪽 그리드 인스턴스 / Right grid instance
|
|
@@ -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 };
|
|
@@ -11,29 +11,42 @@ export interface IconRenderOptions {
|
|
|
11
11
|
el?: boolean;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* 시맨틱
|
|
15
|
-
*
|
|
14
|
+
* 시맨틱 role → 아이콘 key(`BOOTSTRAP_ICONS` 의 symbolId) 기본 매핑. 이 표 자체를 고치는 것은
|
|
15
|
+
* 라이브러리 소스에 손대는 것과 같으므로, 앱에서 아이콘을 바꾸고 싶으면 이 표 대신
|
|
16
|
+
* `grid.setIcon(role, key)`(인스턴스 한정) 또는 `defineIconSet()`(전역)으로 등록하는 것이 정석이다.
|
|
17
|
+
* / Default map of semantic role → icon key (a `BOOTSTRAP_ICONS` symbolId). Editing this table
|
|
18
|
+
* means touching library source, so apps that want a different icon should instead register one
|
|
19
|
+
* via `grid.setIcon(role, key)` (per instance) or `defineIconSet()` (globally).
|
|
16
20
|
*
|
|
17
|
-
* 렌더 코드는 이 역할 이름만 참조한다.
|
|
18
|
-
* 참고 스왑: `row.delete`→`trash3`(Bootstrap 의 표준
|
|
19
|
-
* /
|
|
21
|
+
* 렌더 코드는 이 역할 이름만 참조한다. / Render code references only these role names.
|
|
22
|
+
* 참고 스왑: `row.delete`→`trash3`(Bootstrap 의 표준 휴지통), `chart.line`→`graph-up`.
|
|
23
|
+
* / Example swap: `row.delete`→`trash3` (Bootstrap's standard trash-can icon), `chart.line`→`graph-up`.
|
|
20
24
|
*/
|
|
21
25
|
export declare const DEFAULT_ICON_ROLES: Readonly<Record<string, string>>;
|
|
22
26
|
/**
|
|
23
|
-
* IconRegistry — role
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
+
* IconRegistry — 시맨틱 role(예: 'sort.asc') 을 실제 아이콘 SVG 로 바꿔주는 등록소.
|
|
28
|
+
* 정렬 화살표·필터 깔때기 같은 아이콘을 코드 곳곳에 인라인 SVG 로 박아 두면, 아이콘 하나를
|
|
29
|
+
* 바꾸려 해도 렌더러 파일들을 찾아 고쳐야 한다 — 대신 렌더 코드는 "sort.asc 를 그려줘"라고만
|
|
30
|
+
* 요청하고, 실제 어떤 글리프인지는 이 레지스트리가 결정한다. 동작 순서: ① `register(role,
|
|
31
|
+
* svgOrKey)` 로 role↔글리프 매핑을 등록해 두면 → ② 렌더 시점에 `render(role)` 가 호출되어
|
|
32
|
+
* → ③ 등록된 본문을 `<svg>` 로 감싸 문자열(또는 SVGElement)로 돌려준다. 저장 단위는
|
|
33
|
+
* **글리프 본문 문자열**(<path>/<g> 마크업)뿐이라, register(role, svgOrKey) 는
|
|
27
34
|
* - svgOrKey 가 `BOOTSTRAP_ICONS` 의 알려진 key 면 그 본문으로,
|
|
28
35
|
* - 아니면 **원시 SVG 본문**(사용자 커스텀 <path…>)으로 저장한다.
|
|
29
36
|
* 부모 체인(_parent)으로 per-instance 오버라이드 레지스트리를 전역 위에 얹는다(멀티그리드 격리).
|
|
30
|
-
* /
|
|
31
|
-
*
|
|
32
|
-
*
|
|
37
|
+
* / IconRegistry — a registry that turns a semantic role (e.g. 'sort.asc') into an actual icon
|
|
38
|
+
* SVG. Hardcoding inline SVG for every sort arrow or filter funnel across render code means
|
|
39
|
+
* hunting down every renderer file just to swap one icon — instead render code simply asks "draw
|
|
40
|
+
* sort.asc", and this registry decides which glyph that is. Flow: ① `register(role, svgOrKey)`
|
|
41
|
+
* records a role↔glyph mapping → ② at render time `render(role)` is called → ③ it wraps the
|
|
42
|
+
* registered body in an `<svg>` and returns a string (or SVGElement). The storage unit is only
|
|
43
|
+
* the glyph body string (<path>/<g> markup), so register(role, svgOrKey) stores either the body
|
|
44
|
+
* of a known `BOOTSTRAP_ICONS` key, or the raw SVG body otherwise. A parent chain (_parent)
|
|
45
|
+
* layers a per-instance override registry on top of the global one (multi-grid isolation).
|
|
33
46
|
*
|
|
34
47
|
* @example
|
|
35
48
|
* const reg = iconRegistry.child();
|
|
36
|
-
* reg.register('sort.asc', 'arrow-up');
|
|
49
|
+
* reg.register('sort.asc', 'arrow-up'); // 이 그리드 인스턴스만 화살표를 교체 / swap the arrow for this grid instance only
|
|
37
50
|
* const svg = reg.render('sort.asc', { size: 16 }) as string;
|
|
38
51
|
*/
|
|
39
52
|
export declare class IconRegistry {
|
|
@@ -49,6 +62,11 @@ export declare class IconRegistry {
|
|
|
49
62
|
* @param role - 시맨틱 역할 키(예: 'sort.asc') / Semantic role key (e.g. 'sort.asc')
|
|
50
63
|
* @param svgOrKey - 알려진 아이콘 key 또는 원시 SVG 본문 / A known icon key or raw SVG body
|
|
51
64
|
* @returns 체이닝용 this / this for chaining
|
|
65
|
+
* @example
|
|
66
|
+
* // 다른 Bootstrap 아이콘 key 로 교체 / Swap to a different Bootstrap icon key
|
|
67
|
+
* iconRegistry.register('row.delete', 'x-circle');
|
|
68
|
+
* // 원시 SVG 본문으로 통째 교체 / Replace entirely with a custom raw SVG body
|
|
69
|
+
* iconRegistry.register('menu', '<path d="M2 4h12v2H2z"/>');
|
|
52
70
|
*/
|
|
53
71
|
register(role: string, svgOrKey: string): this;
|
|
54
72
|
/** role 이 (자신 또는 부모 체인에) 등록돼 있는가. / Whether a role is registered (self or parent chain). */
|
|
@@ -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;
|