open-grid 1.2.0 → 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 -353
- package/README.md +1 -1
- package/dist/OpenGrid-B7m7ei7f.cjs +7385 -0
- package/dist/OpenGrid-CeUdO_fM.js +7398 -0
- 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 +27 -1
- package/dist/open-grid-react.js +22 -82
- package/dist/open-grid-vue.cjs +31 -1
- package/dist/open-grid-vue.js +29 -79
- package/dist/open-grid.cjs +272 -6
- package/dist/open-grid.js +177 -266
- 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/CellEditManager.d.ts +73 -0
- package/dist/types/core/CellEventHandler.d.ts +99 -2
- package/dist/types/core/CellTypeRegistry.d.ts +24 -0
- package/dist/types/core/ChartManager.d.ts +51 -3
- package/dist/types/core/ColumnLayout.d.ts +100 -2
- package/dist/types/core/ContextMenu.d.ts +43 -2
- package/dist/types/core/CrossGridController.d.ts +86 -15
- package/dist/types/core/CrossGridMapper.d.ts +43 -5
- package/dist/types/core/CrossGridRegistry.d.ts +36 -2
- package/dist/types/core/DataLayer.d.ts +210 -15
- package/dist/types/core/DetailManager.d.ts +106 -15
- package/dist/types/core/DragVisuals.d.ts +33 -4
- package/dist/types/core/EventEmitter.d.ts +54 -0
- package/dist/types/core/ExportManager.d.ts +66 -1
- package/dist/types/core/ExtensionPointRegistry.d.ts +160 -14
- package/dist/types/core/FilterPanel.d.ts +17 -2
- package/dist/types/core/FilterSelect.d.ts +37 -13
- package/dist/types/core/FindBarManager.d.ts +26 -0
- package/dist/types/core/FlatRowModel.d.ts +54 -11
- package/dist/types/core/FooterManager.d.ts +53 -1
- package/dist/types/core/FormulaController.d.ts +139 -10
- package/dist/types/core/FormulaEngine.d.ts +15 -4
- package/dist/types/core/GridComposer.d.ts +54 -6
- package/dist/types/core/GridRenderer.d.ts +143 -10
- package/dist/types/core/GridShuttle.d.ts +44 -4
- package/dist/types/core/GroupEngine.d.ts +68 -10
- package/dist/types/core/GroupTreeManager.d.ts +86 -2
- package/dist/types/core/IconRegistry.d.ts +56 -9
- package/dist/types/core/KeyboardManager.d.ts +88 -4
- package/dist/types/core/MaskingEngine.d.ts +10 -9
- package/dist/types/core/MathUtils.d.ts +58 -5
- package/dist/types/core/MergeEngine.d.ts +45 -10
- package/dist/types/core/MutationService.d.ts +113 -10
- package/dist/types/core/OGDecimal.d.ts +144 -13
- package/dist/types/core/OpenGrid.d.ts +99 -0
- package/dist/types/core/OrgChart.d.ts +56 -1
- package/dist/types/core/OverrideKernel.d.ts +59 -15
- package/dist/types/core/Pagination.d.ts +38 -4
- package/dist/types/core/PivotEngine.d.ts +37 -0
- package/dist/types/core/RangeSelectionManager.d.ts +121 -7
- package/dist/types/core/RenderController.d.ts +56 -0
- package/dist/types/core/RowDragDrop.d.ts +52 -6
- package/dist/types/core/RowManager.d.ts +55 -0
- package/dist/types/core/SkinRegistry.d.ts +55 -15
- package/dist/types/core/SortFilterManager.d.ts +80 -1
- package/dist/types/core/TreeEngine.d.ts +60 -6
- package/dist/types/core/TriggerManager.d.ts +46 -0
- package/dist/types/core/VirtualScroll.d.ts +64 -0
- package/dist/types/core/WorksheetManager.d.ts +61 -2
- package/dist/types/core/XmlConverter.d.ts +56 -23
- 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 +107 -10
- 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/CellEditor.d.ts +29 -2
- 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/formula/types.d.ts +71 -8
- 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/RangeQuery.d.ts +24 -2
- 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/renderers/CellRenderer.d.ts +100 -8
- 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/dist/xlsx.min-BQ1o3sB6.cjs +11793 -0
- package/dist/{xlsx.min-Wavxcamn.js → xlsx.min-Bbz2ZypC.js} +453 -566
- package/package.json +112 -110
- package/dist/OpenGrid-B0Spm0rU.js +0 -10404
- package/dist/OpenGrid-CuXj0isp.cjs +0 -97
- package/dist/xlsx.min-Bx-LxWOf.cjs +0 -138
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Px, ViewIndex } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 세로 축(행) 메트릭. 균일/가변(autoHeight) 겸용. 순수 불변.
|
|
4
|
+
* / Vertical row metrics; uniform and variable (autoHeight). Pure & immutable.
|
|
5
|
+
*/
|
|
6
|
+
export declare class RowMetrics {
|
|
7
|
+
private readonly _rowHeight;
|
|
8
|
+
private readonly _total;
|
|
9
|
+
private readonly _overrides;
|
|
10
|
+
private readonly _pos;
|
|
11
|
+
private readonly _prefDelta;
|
|
12
|
+
private readonly _totalDelta;
|
|
13
|
+
/**
|
|
14
|
+
* @param opts.rowHeight 균일 행 높이(px) / uniform row height
|
|
15
|
+
* @param opts.total 가시(view) 행 총수 / total visible rows
|
|
16
|
+
* @param overrides autoHeight 측정 override(내부 재조립용, 선택) / measured overrides (internal)
|
|
17
|
+
*/
|
|
18
|
+
constructor(opts: {
|
|
19
|
+
rowHeight: Px;
|
|
20
|
+
total: number;
|
|
21
|
+
}, overrides?: ReadonlyMap<number, number>);
|
|
22
|
+
/** 가시(view) 행 총수. / Total visible rows. */
|
|
23
|
+
get total(): number;
|
|
24
|
+
/** 콘텐츠 전체 높이(spacer 산출용). / Total content height (for spacer). */
|
|
25
|
+
totalHeight(): Px;
|
|
26
|
+
/** 행 상단 y(부분합). / Row top y (prefix sum). */
|
|
27
|
+
topOf(view: ViewIndex): Px;
|
|
28
|
+
/** 행 높이(override 우선). / Row height (override wins). */
|
|
29
|
+
heightOf(view: ViewIndex): Px;
|
|
30
|
+
/** y → view(이분탐색, 클램프). / y → view (binary search, clamped). */
|
|
31
|
+
indexAt(y: Px): ViewIndex;
|
|
32
|
+
/** 측정 캐시 주입(되먹임 차단의 핵심) — 새 불변 인스턴스 반환. / Apply measured overrides; returns a new instance. */
|
|
33
|
+
applyMeasured(overrides: ReadonlyMap<ViewIndex, Px>): RowMetrics;
|
|
34
|
+
/** 총 행수 변경 — 새 불변 인스턴스 반환. / Change total; returns a new instance. */
|
|
35
|
+
setTotal(total: number): RowMetrics;
|
|
36
|
+
private _clampView;
|
|
37
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ModelIndex, ViewIndex } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* model↔view 순열. 미필터면 항등(null). 순수 불변.
|
|
4
|
+
* / model↔view permutation; identity when null. Pure & immutable.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ViewPermutation {
|
|
7
|
+
private readonly _viewOrder;
|
|
8
|
+
private readonly _modelTotal;
|
|
9
|
+
private readonly _reverse;
|
|
10
|
+
/**
|
|
11
|
+
* @param viewOrder viewOrder[v] = m; null = 항등 / identity when null
|
|
12
|
+
* @param modelTotal 원본 행 총수 / total model rows
|
|
13
|
+
*/
|
|
14
|
+
constructor(viewOrder: readonly ModelIndex[] | null, modelTotal: number);
|
|
15
|
+
/** 가시(view) 행 총수. / Total visible rows. */
|
|
16
|
+
get viewCount(): number;
|
|
17
|
+
/** v → m. 항등이면 그대로. / view → model. */
|
|
18
|
+
toModel(view: ViewIndex): ModelIndex;
|
|
19
|
+
/** m → v(숨김/필터아웃이면 -1). 역인덱스 O(1). / model → view (-1 if hidden). */
|
|
20
|
+
toView(model: ModelIndex): ViewIndex | -1;
|
|
21
|
+
/** model 이 현재 가시인지. / Whether a model row is currently visible. */
|
|
22
|
+
isVisible(model: ModelIndex): boolean;
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { type ModelIndex, type ViewIndex, type LeafColIndex, type Px, type IndexRange, type CellRect, type PaneId, type CellPlacement, px, modelIndex, viewIndex, leafColIndex, makeRange, makeRect, unbrandPx, } from './types.js';
|
|
2
|
+
export { RowMetrics } from './RowMetrics.js';
|
|
3
|
+
export { ColumnMetrics } from './ColumnMetrics.js';
|
|
4
|
+
export { ViewPermutation } from './ViewPermutation.js';
|
|
5
|
+
export { FrozenPanes } from './FrozenPanes.js';
|
|
6
|
+
export { NodeBudget, type NodeBudgetResult } from './NodeBudget.js';
|
|
7
|
+
export { ResizeGovernor, type ResizeDecision, type ResizeStats } from './ResizeGovernor.js';
|
|
8
|
+
export { CoordinateKernel, type CoordinateSnapshot, type CoordinateKernelDeps, } from './CoordinateKernel.js';
|
|
9
|
+
export { type IWindowingPort, type IMeasurementSeam, type IMergeSource, type SliceKey, SLICE_OWNERSHIP, } from './ports.js';
|
|
10
|
+
export { MergeSourceAdapter, EMPTY_MERGE_SOURCE } from './MergeSourceAdapter.js';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Px, ViewIndex, LeafColIndex, IndexRange } from './types.js';
|
|
2
|
+
/** 세로/가로 공통 윈도잉 포트(REQ-T3-817). / Common vertical/horizontal windowing port. */
|
|
3
|
+
export interface IWindowingPort {
|
|
4
|
+
verticalWindow(scrollTop: Px, viewportH: Px): IndexRange;
|
|
5
|
+
horizontalWindow(scrollLeft: Px, viewportW: Px): {
|
|
6
|
+
start: LeafColIndex;
|
|
7
|
+
end: LeafColIndex;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/** DOM 측정 이음새(humble shell 구현) — 커널은 촉발하지 않음. / DOM measurement seam (shell-implemented). */
|
|
11
|
+
export interface IMeasurementSeam {
|
|
12
|
+
/** view 행들의 실제 렌더 높이 읽기(reflow 는 shell 책임). / Read rendered heights of rows. */
|
|
13
|
+
measureRows(views: readonly ViewIndex[]): ReadonlyMap<ViewIndex, Px>;
|
|
14
|
+
/** 컨테이너 clientHeight/Width 읽기(언바운드/0 감지 원천). / Read container box. */
|
|
15
|
+
readViewportBox(): {
|
|
16
|
+
height: number;
|
|
17
|
+
width: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** 병합 스팬 조회 어댑터 — MergeEngine.getInfo 를 커널 계약으로 래핑. 순수. / Merge span source. */
|
|
21
|
+
export interface IMergeSource {
|
|
22
|
+
getInfo(view: ViewIndex, col: LeafColIndex): {
|
|
23
|
+
rowSpan: number;
|
|
24
|
+
colSpan: number;
|
|
25
|
+
hidden: boolean;
|
|
26
|
+
} | null;
|
|
27
|
+
readonly isEmpty: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 슬라이스별 단일 소유자 규정(REQ-TX-841) — 비소유 모듈 직접 변이 차단(lint/런타임 가드 근거).
|
|
31
|
+
* 좌표 커널은 아래 슬라이스를 읽기 전용 입력으로만 받는다.
|
|
32
|
+
* / Single-owner map for state slices; the kernel takes these as read-only inputs only.
|
|
33
|
+
*/
|
|
34
|
+
export declare const SLICE_OWNERSHIP: {
|
|
35
|
+
readonly totalRows: "DataLayer";
|
|
36
|
+
readonly viewOrder: "SortFilterManager";
|
|
37
|
+
readonly scroll: "ViewportController";
|
|
38
|
+
readonly frozen: "ViewportController";
|
|
39
|
+
readonly viewport: "ViewportController";
|
|
40
|
+
readonly rowHeight: "AppearanceResolver";
|
|
41
|
+
readonly measured: "MeasurementSeam";
|
|
42
|
+
readonly selection: "SelectionModel";
|
|
43
|
+
};
|
|
44
|
+
/** 슬라이스 키. / Slice key. */
|
|
45
|
+
export type SliceKey = keyof typeof SLICE_OWNERSHIP;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/** 원본 데이터 행 인덱스(0-base). / Original data row index (0-based). */
|
|
2
|
+
export type ModelIndex = number & {
|
|
3
|
+
readonly __brand: 'ModelIndex';
|
|
4
|
+
};
|
|
5
|
+
/** filter/sort/group 후 가시 순번(0-base). / Visible order index after filter/sort/group. */
|
|
6
|
+
export type ViewIndex = number & {
|
|
7
|
+
readonly __brand: 'ViewIndex';
|
|
8
|
+
};
|
|
9
|
+
/** 표시 리프 컬럼 순번(0-base). / Visible leaf column index. */
|
|
10
|
+
export type LeafColIndex = number & {
|
|
11
|
+
readonly __brand: 'LeafColIndex';
|
|
12
|
+
};
|
|
13
|
+
/** 콘텐츠 절대 픽셀. / Content-absolute pixel. */
|
|
14
|
+
export type Px = number & {
|
|
15
|
+
readonly __brand: 'Px';
|
|
16
|
+
};
|
|
17
|
+
/** number → Px. / Brand a number as Px. */
|
|
18
|
+
export declare const px: (n: number) => Px;
|
|
19
|
+
/** number → ModelIndex. */
|
|
20
|
+
export declare const modelIndex: (n: number) => ModelIndex;
|
|
21
|
+
/** number → ViewIndex. */
|
|
22
|
+
export declare const viewIndex: (n: number) => ViewIndex;
|
|
23
|
+
/** number → LeafColIndex. */
|
|
24
|
+
export declare const leafColIndex: (n: number) => LeafColIndex;
|
|
25
|
+
/** 반열림 index 범위 [start, end). 불변. / Half-open index range [start, end). Immutable. */
|
|
26
|
+
export interface IndexRange {
|
|
27
|
+
readonly start: ViewIndex;
|
|
28
|
+
readonly end: ViewIndex;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 콘텐츠 좌표계 사각형(스크롤 절대·frozen 반영 전). 불변.
|
|
32
|
+
* ★대표 소유(SSOT) = DD-02.
|
|
33
|
+
* / Content-coordinate rectangle (scroll-absolute, pre-frozen). Immutable. Owned by DD-02.
|
|
34
|
+
*/
|
|
35
|
+
export interface CellRect {
|
|
36
|
+
readonly x: Px;
|
|
37
|
+
readonly y: Px;
|
|
38
|
+
readonly w: Px;
|
|
39
|
+
readonly h: Px;
|
|
40
|
+
}
|
|
41
|
+
/** 어느 팬(pane)에 속하는지 — 좌표 소비처의 컨테이너 선택 키. / Which pane a cell belongs to. */
|
|
42
|
+
export type PaneId = 'body' | 'frozen-left' | 'frozen-top' | 'frozen-corner';
|
|
43
|
+
/** 셀 하나의 완전 배치 — 소비처가 자체 산술 없이 그대로 쓴다. / Full placement of a single cell. */
|
|
44
|
+
export interface CellPlacement {
|
|
45
|
+
readonly view: ViewIndex;
|
|
46
|
+
readonly col: LeafColIndex;
|
|
47
|
+
/** 콘텐츠 좌표 사각형(merge 반영). / Content-coordinate rect (merge-applied). */
|
|
48
|
+
readonly rect: CellRect;
|
|
49
|
+
/** 소속 팬(고정/본문). / Owning pane (frozen/body). */
|
|
50
|
+
readonly pane: PaneId;
|
|
51
|
+
/** merge 반영 세로 스팬. / Row span (merge). */
|
|
52
|
+
readonly rowSpan: number;
|
|
53
|
+
/** merge 반영 가로 스팬. / Column span (merge). */
|
|
54
|
+
readonly colSpan: number;
|
|
55
|
+
/** merge 에 삼켜진 셀(렌더 생략). / Cell swallowed by a merge (render-skipped). */
|
|
56
|
+
readonly hidden: boolean;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 반열림 index 범위 생성(불변식 start ≤ end 보증). / Build an IndexRange (guarantees start ≤ end).
|
|
60
|
+
*/
|
|
61
|
+
export declare function makeRange(start: number, end: number): IndexRange;
|
|
62
|
+
/**
|
|
63
|
+
* 콘텐츠 사각형 생성(불변식 w,h ≥ 0 클램프). / Build a CellRect (clamps w,h ≥ 0).
|
|
64
|
+
*/
|
|
65
|
+
export declare function makeRect(x: number, y: number, w: number, h: number): CellRect;
|
|
66
|
+
/**
|
|
67
|
+
* 경계 1회 언브랜드(§2.0 계약) — 소비처(DD-03 렌더)는 커널 출력 수령 지점에서 1회만 언브랜드하고
|
|
68
|
+
* 내부는 순수 number 로 흐르되 좌표 재산술은 금지한다.
|
|
69
|
+
* / Single unbrand at the boundary; consumers flow plain numbers inward without re-deriving coords.
|
|
70
|
+
*/
|
|
71
|
+
export declare function unbrandPx(rect: CellRect): {
|
|
72
|
+
x: number;
|
|
73
|
+
y: number;
|
|
74
|
+
w: number;
|
|
75
|
+
h: number;
|
|
76
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DetailGlyph — F2 디테일 expander 글리프/aria 정책 (C10 R-DETAIL-GLYPH, HANMS-06 해소).
|
|
3
|
+
* / DetailGlyph — F2 detail-expander glyph / aria policy (C10 R-DETAIL-GLYPH, resolves review item HANMS-06).
|
|
3
4
|
*
|
|
4
5
|
* 계약 근거:
|
|
5
6
|
* - docs/design/grid-features-2026-07/15_cross_contracts.md C10 "R-DETAIL-GLYPH": detail expander는
|
|
@@ -8,43 +9,77 @@
|
|
|
8
9
|
* - docs/design/grid-features-2026-07/11_design_F2_v2.md §4.5(글리프/aria 상세), §1.2 NFR-5(접근성
|
|
9
10
|
* 측정가능 AC: aria-expanded 토글, aria-controls 연결), §4.3(panel.id 규칙 = aria-controls 타겟),
|
|
10
11
|
* C8.4(터치 히트 타겟 ≥44×44 CSS px).
|
|
12
|
+
* / Contract basis:
|
|
13
|
+
* - 15_cross_contracts.md C10 "R-DETAIL-GLYPH": the detail expander **must not use a chevron (▸/▾)**.
|
|
14
|
+
* It is distinguished from the tree chevron by a separate glyph (`⊕/⊖` or `▤ detail`) + tooltip ("View detail")
|
|
15
|
+
* + aria-label. A chevron is allowed only when the tree is **inactive**.
|
|
16
|
+
* - 11_design_F2_v2.md §4.5 (glyph/aria detail), §1.2 NFR-5 (measurable accessibility AC: aria-expanded toggle,
|
|
17
|
+
* aria-controls linkage), §4.3 (panel.id rule = aria-controls target), C8.4 (touch hit target ≥44×44 CSS px).
|
|
11
18
|
*
|
|
12
19
|
* 렌더 배선(GridRenderer expander 셀)이 이 모듈의 순수 함수/상수를 소비해 실제 DOM 속성을 채운다.
|
|
13
20
|
* 이 파일은 DOM 을 만들지 않는다 — 문자열/속성 값만 생성.
|
|
21
|
+
* / Render wiring (GridRenderer expander cell) consumes this module's pure functions/constants to populate the
|
|
22
|
+
* actual DOM attributes. This file creates no DOM — only string/attribute values.
|
|
14
23
|
*/
|
|
15
24
|
/** i18n: 글리프 aria/툴팁 로케일 해석기(주입 없으면 전역 t). / i18n: glyph aria/tooltip resolver (global t when not injected). */
|
|
16
25
|
export type DetailGlyphT = (key: string, params?: Record<string, string | number>) => string;
|
|
17
|
-
/** 트리 셰브론
|
|
26
|
+
/** 접힘 상태 전용 글리프(트리 셰브론 ▸/▾과 충돌하지 않는 C10 기본값). / Collapsed-state glyph (C10 default that does not collide with the tree chevron ▸/▾). */
|
|
18
27
|
export declare const DETAIL_GLYPH_COLLAPSED = "\u2295";
|
|
28
|
+
/** 펼침 상태 전용 글리프(트리 셰브론과 충돌하지 않는 C10 기본값). / Expanded-state glyph (C10 default that does not collide with the tree chevron). */
|
|
19
29
|
export declare const DETAIL_GLYPH_EXPANDED = "\u2296";
|
|
20
|
-
/** 라벨형 대안(옵션) — 기본은 원형 글리프, toggle:'first-cell' 등 배치에서 선택적으로 사용. */
|
|
30
|
+
/** 라벨형 대안(옵션) — 기본은 원형 글리프, toggle:'first-cell' 등 배치에서 선택적으로 사용. / Label-style alternative (optional) — the circular glyph is default; used selectively in layouts like toggle:'first-cell'. */
|
|
21
31
|
export declare const DETAIL_GLYPH_LABEL_COLLAPSED = "\u25A4 \uC0C1\uC138";
|
|
32
|
+
/** 툴팁 고정 문구(C10 "상세 보기"). / Fixed tooltip text (C10 "View detail"). */
|
|
22
33
|
export declare const DETAIL_GLYPH_TOOLTIP = "\uC0C1\uC138 \uBCF4\uAE30";
|
|
23
|
-
/** C8.4: expander 히트 타겟 최소 CSS px(가로/세로). */
|
|
34
|
+
/** C8.4: expander 히트 타겟 최소 CSS px(가로/세로). / C8.4: minimum expander hit-target size in CSS px (width/height). */
|
|
24
35
|
export declare const DETAIL_EXPANDER_MIN_HIT_TARGET_PX = 44;
|
|
36
|
+
/** getDetailGlyph 반환 구조 — 렌더 배선이 소비할 글리프/aria/title 묶음. / Return shape of getDetailGlyph — glyph/aria/title bundle for render wiring to consume. */
|
|
25
37
|
export interface DetailGlyphInfo {
|
|
26
|
-
/** 화면에 그릴 문자(셰브론 아님, C10). */
|
|
38
|
+
/** 화면에 그릴 문자(셰브론 아님, C10). / Character to render (not a chevron, C10). */
|
|
27
39
|
glyph: string;
|
|
28
|
-
/** expander 자체 aria-label(NFR-5, HANMS-06 — SR 에서 트리 토글과 구분). */
|
|
40
|
+
/** expander 자체 aria-label(NFR-5, HANMS-06 — SR 에서 트리 토글과 구분). / The expander's own aria-label (NFR-5, HANMS-06 — distinguished from the tree toggle for screen readers). */
|
|
29
41
|
ariaLabel: string;
|
|
30
|
-
/** 툴팁 title 속성(C10 "상세 보기" 고정 문구). */
|
|
42
|
+
/** 툴팁 title 속성(C10 "상세 보기" 고정 문구). / Tooltip title attribute (C10 fixed text "View detail"). */
|
|
31
43
|
title: string;
|
|
32
44
|
}
|
|
33
45
|
/**
|
|
34
46
|
* 펼침 여부에 따른 글리프/aria-label/title 조합을 반환한다. 트리 셰브론과 절대 겹치지 않는
|
|
35
47
|
* 문자셋만 사용(C10 R-DETAIL-GLYPH 하드 룰).
|
|
48
|
+
* / Return the glyph/aria-label/title combination for the given expanded state. Uses only a character set that
|
|
49
|
+
* never overlaps the tree chevron (C10 R-DETAIL-GLYPH hard rule).
|
|
50
|
+
*
|
|
51
|
+
* @param expanded - 현재 펼침 여부 / Whether currently expanded
|
|
52
|
+
* @param t - i18n 로케일 해석기(미주입 시 전역 t) / i18n locale resolver (global t when not injected)
|
|
53
|
+
* @returns 글리프/aria-label/title 묶음 / glyph/aria-label/title bundle
|
|
36
54
|
*/
|
|
37
55
|
export declare function getDetailGlyph(expanded: boolean, t?: DetailGlyphT): DetailGlyphInfo;
|
|
38
|
-
/**
|
|
56
|
+
/**
|
|
57
|
+
* NFR-5(1): 마스터 행 `aria-expanded` 값(문자열 — DOM setAttribute 그대로 사용).
|
|
58
|
+
* / NFR-5(1): master-row `aria-expanded` value (string — used directly in DOM setAttribute).
|
|
59
|
+
*
|
|
60
|
+
* @param expanded - 현재 펼침 여부 / Whether currently expanded
|
|
61
|
+
* @returns 'true' 또는 'false' 문자열 / 'true' or 'false' string
|
|
62
|
+
*/
|
|
39
63
|
export declare function getMasterRowAriaExpanded(expanded: boolean): 'true' | 'false';
|
|
40
64
|
/**
|
|
41
65
|
* NFR-5(2)/§4.3: 패널 DOM id 규칙. expander 의 `aria-controls` 와 패널의 `id` 는 반드시 이
|
|
42
66
|
* 한 함수로만 생성해 두 값의 불일치를 구조적으로 차단한다.
|
|
67
|
+
* / NFR-5(2)/§4.3: panel DOM id rule. The expander's `aria-controls` and the panel's `id` must be generated only
|
|
68
|
+
* by this single function, structurally preventing any mismatch between the two.
|
|
69
|
+
*
|
|
70
|
+
* @param rowId - stable rowId / stable rowId
|
|
71
|
+
* @returns 패널 DOM id(`og-detail-<rowId>`) / Panel DOM id (`og-detail-<rowId>`)
|
|
43
72
|
*/
|
|
44
73
|
export declare function getDetailPanelId(rowId: string): string;
|
|
45
74
|
/**
|
|
46
75
|
* §4.5 "트리 동시 활성 시 충돌 해소" 규칙의 판별 헬퍼: 트리가 활성화된 그리드에서는 셰브론을
|
|
47
76
|
* 쓸 수 없다(트리 셰브론과 자리를 공유하지 않도록 렌더 배선이 별도 컬럼/색을 쓰게 강제하는 신호).
|
|
48
77
|
* 트리 비활성일 때만 셰브론 허용 여부를 true 로 반환한다.
|
|
78
|
+
* / Decision helper for the §4.5 "resolve conflict when tree is simultaneously active" rule: a chevron cannot be
|
|
79
|
+
* used in a tree-active grid (a signal that forces render wiring to use a separate column/color so it does not
|
|
80
|
+
* share space with the tree chevron). Returns true only when the tree is inactive.
|
|
81
|
+
*
|
|
82
|
+
* @param treeActive - 트리 활성 여부 / Whether the tree is active
|
|
83
|
+
* @returns 셰브론 허용 여부 / Whether a chevron is allowed
|
|
49
84
|
*/
|
|
50
85
|
export declare function isChevronAllowedForDetail(treeActive: boolean): boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DetailSplice — 상류 flat 배열에 F2 디테일 head/filler 의사행을 끼워 넣는 순수 함수.
|
|
3
|
+
* / DetailSplice — pure function that splices F2 detail head/filler pseudo-rows into the upstream flat array.
|
|
3
4
|
*
|
|
4
5
|
* 계약 근거:
|
|
5
6
|
* - docs/design/grid-features-2026-07/11_design_F2_v2.md §2.2/§3.2(단방향 합성 체인의 마지막 단계:
|
|
@@ -7,61 +8,91 @@
|
|
|
7
8
|
* §4.1(DetailHeadRow/DetailFillerRow 형태), §7(그룹 헤더엔 미부착·트리 데이터 행엔 허용)
|
|
8
9
|
* - docs/design/grid-features-2026-07/15_cross_contracts.md C0.3(FlatRowRef.kind
|
|
9
10
|
* 'detailHead'/'detailFiller' — filler 에 writeCell 절대 금지의 판별 재료)
|
|
11
|
+
* / Contract basis:
|
|
12
|
+
* - 11_design_F2_v2.md §2.2/§3.2 (last stage of the one-way composition chain:
|
|
13
|
+
* plain → group/tree (owned by GroupTreeManager) → **detail splice (this file)** → FlatRowModel.updateFlatModel),
|
|
14
|
+
* §4.1 (DetailHeadRow/DetailFillerRow shape), §7 (not attached to group headers; allowed on tree data rows)
|
|
15
|
+
* - 15_cross_contracts.md C0.3 (FlatRowRef.kind 'detailHead'/'detailFiller' — basis for absolutely forbidding
|
|
16
|
+
* writeCell on fillers)
|
|
10
17
|
*
|
|
11
18
|
* MVP는 (b) 정수-슬롯: 디테일 높이 = span(=ceil(height/rowHeight)) × rowHeight 개의 **정수 rowHeight
|
|
12
19
|
* 슬롯**으로 표현한다. 1개 head(span 보유) + (span-1)개 filler. VirtualScroll 은 이 슬롯들도 여느
|
|
13
20
|
* 인덱스와 동일한 rowHeight 로 보고 무변경(CON-1)으로 남는다.
|
|
21
|
+
* / MVP uses (b) integer slots: the detail height is represented as span (=ceil(height/rowHeight)) **integer
|
|
22
|
+
* rowHeight slots**. One head (holding span) + (span-1) fillers. VirtualScroll treats these slots at the same
|
|
23
|
+
* rowHeight as any other index and stays unchanged (CON-1).
|
|
14
24
|
*
|
|
15
25
|
* ⚠️ 이 함수는 실제 GroupTreeManager/FlatRowModel(둘 다 이 작업과 동시에 변경 중)을 import 하지
|
|
16
26
|
* 않는다. 대신 GridRenderer.ts 가 이미 소비하는 런타임 관례(`_isGroup`/`_isTree` 플래그, 트리 노드의
|
|
17
27
|
* `.data`)를 로컬 타입 가드로만 재선언해 상류 flat 항목을 분류한다 — 배선 단계에서 실제 등록
|
|
18
28
|
* 어댑터가 이 함수를 호출한다.
|
|
29
|
+
* / This function does not import the real GroupTreeManager/FlatRowModel (both changing concurrently with this
|
|
30
|
+
* work). Instead it reclassifies upstream flat items using only local type guards for the runtime conventions
|
|
31
|
+
* GridRenderer.ts already consumes (`_isGroup`/`_isTree` flags, a tree node's `.data`) — a real registration
|
|
32
|
+
* adapter calls this function at the wiring stage.
|
|
19
33
|
*/
|
|
20
|
-
/** GroupTreeManager 산출물(GroupRow)과 동형의 최소 구조 — 로컬 판별용(실제 타입 import 안 함). */
|
|
34
|
+
/** GroupTreeManager 산출물(GroupRow)과 동형의 최소 구조 — 로컬 판별용(실제 타입 import 안 함). / Minimal shape isomorphic to the GroupTreeManager output (GroupRow) — for local discrimination only (real type not imported). */
|
|
21
35
|
interface GroupLikeItem {
|
|
22
36
|
_isGroup: true;
|
|
23
37
|
}
|
|
24
|
-
/** TreeEngine TreeNode 와 동형의 최소 구조 — 로컬 판별용(실제 타입 import 안 함). */
|
|
38
|
+
/** TreeEngine TreeNode 와 동형의 최소 구조 — 로컬 판별용(실제 타입 import 안 함). / Minimal shape isomorphic to a TreeEngine TreeNode — for local discrimination only (real type not imported). */
|
|
25
39
|
interface TreeLikeItem<T = any> {
|
|
26
40
|
_isTree: true;
|
|
27
41
|
data: T;
|
|
28
42
|
}
|
|
29
|
-
/** F2 디테일 head 의사행(§4.1). span 개의 rowHeight 슬롯 중 첫 슬롯 — 실제 패널이 여기 그려진다. */
|
|
43
|
+
/** F2 디테일 head 의사행(§4.1). span 개의 rowHeight 슬롯 중 첫 슬롯 — 실제 패널이 여기 그려진다. / F2 detail head pseudo-row (§4.1). The first of span rowHeight slots — the actual panel is drawn here. */
|
|
30
44
|
export interface DetailHeadItem<T = any> {
|
|
45
|
+
/** head 의사행 판별 플래그. / Discriminator flag for a head pseudo-row. */
|
|
31
46
|
_isDetailHead: true;
|
|
47
|
+
/** 마스터의 stable rowId. / Master's stable rowId. */
|
|
32
48
|
_rowId: string;
|
|
33
|
-
/** 마스터 원본 flat 항목(트리/그룹 컨텍스트 유지용, optional — §4.1). */
|
|
49
|
+
/** 마스터 원본 flat 항목(트리/그룹 컨텍스트 유지용, optional — §4.1). / Original master flat item (retains tree/group context, optional — §4.1). */
|
|
34
50
|
_masterFlatBase?: T | GroupLikeItem | TreeLikeItem<T>;
|
|
35
|
-
/** k = ceil(height/rowHeight). 슬롯 총 개수(head 포함). */
|
|
51
|
+
/** k = ceil(height/rowHeight). 슬롯 총 개수(head 포함). / k = ceil(height/rowHeight). Total slot count (including head). */
|
|
36
52
|
_span: number;
|
|
37
53
|
}
|
|
38
|
-
/** F2 디테일 filler 의사행(§4.1). span-1 개. renderBody 는 이 인덱스를 만나면 continue(패널이 덮음). */
|
|
54
|
+
/** F2 디테일 filler 의사행(§4.1). span-1 개. renderBody 는 이 인덱스를 만나면 continue(패널이 덮음). / F2 detail filler pseudo-row (§4.1). span-1 of them. renderBody continues past this index (the panel covers it). */
|
|
39
55
|
export interface DetailFillerItem {
|
|
56
|
+
/** filler 의사행 판별 플래그. / Discriminator flag for a filler pseudo-row. */
|
|
40
57
|
_isDetailFiller: true;
|
|
58
|
+
/** 마스터의 stable rowId. / Master's stable rowId. */
|
|
41
59
|
_rowId: string;
|
|
42
60
|
}
|
|
61
|
+
/** splice 후 flat 배열의 항목 합집합(원본 행/그룹/트리/디테일 의사행). / Union of items in the spliced flat array (source row / group / tree / detail pseudo-rows). */
|
|
43
62
|
export type DetailSplicedItem<T = any> = T | GroupLikeItem | TreeLikeItem<T> | DetailHeadItem<T> | DetailFillerItem;
|
|
44
|
-
/** 행별 슬롯수 콜백(옵션) — 지정 시 고정 height 대신 이 값을 사용(반올림 후 ceil 없이 그대로 슬롯수로 채택). */
|
|
63
|
+
/** 행별 슬롯수 콜백(옵션) — 지정 시 고정 height 대신 이 값을 사용(반올림 후 ceil 없이 그대로 슬롯수로 채택). / Per-row slot-count callback (optional) — when set, used instead of a fixed height (floored, then taken directly as the slot count without ceil). */
|
|
45
64
|
export type SlotCountFn<T = any> = (row: T, rowId: string) => number;
|
|
65
|
+
/** spliceDetails 옵션. / Options for spliceDetails. */
|
|
46
66
|
export interface DetailSpliceOptions<T = any> {
|
|
47
|
-
/** DetailState.expandedRowIds — stable rowId 앵커(정렬/필터 넘어 보존, FR-4/C0.5). */
|
|
67
|
+
/** DetailState.expandedRowIds — stable rowId 앵커(정렬/필터 넘어 보존, FR-4/C0.5). / DetailState.expandedRowIds — stable rowId anchors (preserved across sort/filter, FR-4/C0.5). */
|
|
48
68
|
expandedRowIds: ReadonlySet<string>;
|
|
49
|
-
/** 마스터 후보 row(T)에서 stable rowId 를 뽑는다. undefined/null 이면 해당 항목은 detail 부착 대상에서 제외. */
|
|
69
|
+
/** 마스터 후보 row(T)에서 stable rowId 를 뽑는다. undefined/null 이면 해당 항목은 detail 부착 대상에서 제외. / Extract a stable rowId from a candidate master row (T). undefined/null excludes that item from detail attachment. */
|
|
50
70
|
getRowId: (row: T) => string | undefined | null;
|
|
71
|
+
/** 그리드 행 높이(px). / Grid row height (px). */
|
|
51
72
|
rowHeight: number;
|
|
52
|
-
/** masterDetail.height(px). 기본 200. getSlotCount 미지정 시 이 값으로 ceil(height/rowHeight) 계산(EC-10 양자화). */
|
|
73
|
+
/** masterDetail.height(px). 기본 200. getSlotCount 미지정 시 이 값으로 ceil(height/rowHeight) 계산(EC-10 양자화). / masterDetail.height (px). Default 200. When getSlotCount is unset, computes ceil(height/rowHeight) from this (EC-10 quantization). */
|
|
53
74
|
height?: number;
|
|
54
|
-
/** 지정 시 height 대신 이 콜백으로 슬롯수(정수, 최소 1) 결정 — masterDetail.detailRowCount 류 확장 지점. */
|
|
75
|
+
/** 지정 시 height 대신 이 콜백으로 슬롯수(정수, 최소 1) 결정 — masterDetail.detailRowCount 류 확장 지점. / When set, determines slot count (integer, min 1) via this callback instead of height — an extension point akin to masterDetail.detailRowCount. */
|
|
55
76
|
getSlotCount?: SlotCountFn<T>;
|
|
56
77
|
}
|
|
57
78
|
/**
|
|
58
79
|
* baseFlat(plain rows 또는 GroupTreeManager 산출물)을 순회하며, 펼쳐진 stable rowId 를 만난
|
|
59
80
|
* 마스터 행 **직후**에 `[head, ...filler×(span-1)]` 를 삽입한다(§4.1). 순수 함수 — baseFlat 은
|
|
60
81
|
* 변경하지 않고 새 배열을 반환한다.
|
|
82
|
+
* / Iterate baseFlat (plain rows or GroupTreeManager output) and, **immediately after** a master row whose
|
|
83
|
+
* stable rowId is expanded, insert `[head, ...filler×(span-1)]` (§4.1). Pure function — returns a new array
|
|
84
|
+
* without mutating baseFlat.
|
|
61
85
|
*
|
|
62
86
|
* expandedRowIds 가 비어 있으면(펼침 0/F2 비활성) 항등에 가깝게 동작하되, §3.2 v2 규범대로
|
|
63
87
|
* "DetailManager는 항상 최종 flat 소유자"이므로 얕은 복사본을 반환한다(호출자가 항상 새 배열을
|
|
64
88
|
* updateFlatModel 에 넘기는 계약을 일관되게 유지하기 위함 — 참조 동일성에 의존한 버그 예방).
|
|
89
|
+
* / When expandedRowIds is empty (0 expansions / F2 inactive) it behaves near-identity but, per §3.2 v2 norm
|
|
90
|
+
* "DetailManager is always the final flat owner", still returns a shallow copy (so the caller consistently keeps
|
|
91
|
+
* the contract of always passing a new array to updateFlatModel — preventing bugs that rely on reference identity).
|
|
92
|
+
*
|
|
93
|
+
* @param baseFlat - 상류 flat 배열(불변 취급) / Upstream flat array (treated as immutable)
|
|
94
|
+
* @param opts - splice 옵션(펼침 집합/rowId 추출/높이 등) / Splice options (expanded set / rowId extractor / height, etc.)
|
|
95
|
+
* @returns 디테일 의사행이 삽입된 새 flat 배열 / New flat array with detail pseudo-rows inserted
|
|
65
96
|
*/
|
|
66
97
|
export declare function spliceDetails<T = any>(baseFlat: ReadonlyArray<DetailSplicedItem<T>>, opts: DetailSpliceOptions<T>): DetailSplicedItem<T>[];
|
|
67
98
|
export {};
|
|
@@ -1,67 +1,136 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DetailState — F2 마스터/디테일 펼침 상태 (헤드리스).
|
|
3
|
+
* / DetailState — F2 master/detail expansion state (headless).
|
|
3
4
|
*
|
|
4
5
|
* 계약 근거:
|
|
5
6
|
* - docs/design/grid-features-2026-07/11_design_F2_v2.md §3.1(DetailManager 상태 부분),
|
|
6
7
|
* §6.1(masterDetail.maxDepth/expandMultiple 기본값), §6.3(rowExpand/rowCollapse payload)
|
|
7
8
|
* - docs/design/grid-features-2026-07/15_cross_contracts.md C0.5(범위/선택 정체성 = stable-id 앵커 —
|
|
8
9
|
* F2 펼침도 동일 원칙), C5.2(이벤트명 `<subject><Verb>` camelCase)
|
|
10
|
+
* / Contract basis:
|
|
11
|
+
* - 11_design_F2_v2.md §3.1 (the state portion of DetailManager), §6.1 (masterDetail.maxDepth/expandMultiple
|
|
12
|
+
* defaults), §6.3 (rowExpand/rowCollapse payload)
|
|
13
|
+
* - 15_cross_contracts.md C0.5 (range/selection identity = stable-id anchors — F2 expansion follows the same
|
|
14
|
+
* principle), C5.2 (event names `<subject><Verb>` camelCase)
|
|
9
15
|
*
|
|
10
16
|
* 책임 경계: 이 파일은 **펼침 상태(Set<rowId>)와 규칙**만 다룬다. DOM/서브그리드 생명주기는
|
|
11
17
|
* SubgridCache, flat 배열 스플라이스는 DetailSplice 가 담당한다(관심사 분리, Booch 경계).
|
|
18
|
+
* / Responsibility boundary: this file handles **only the expansion state (Set<rowId>) and its rules**. DOM /
|
|
19
|
+
* subgrid lifecycle belongs to SubgridCache; flat-array splicing belongs to DetailSplice (separation of concerns).
|
|
12
20
|
*
|
|
13
21
|
* ⚠️ FlatRowModel(src/core/FlatRowModel.ts)은 착륙 중인 별도 파일이라 여기서 직접 import 하지 않는다.
|
|
14
22
|
* rowIndex→rowId 해소는 배선 단계(OpenGrid/DetailManager)에서 FlatRowModel 경유로 수행하고,
|
|
15
23
|
* 이 클래스는 이미 해소된 stable rowId(string)만 입력받는다.
|
|
24
|
+
* / FlatRowModel (src/core/FlatRowModel.ts) is a separate file still landing, so it is not imported here directly.
|
|
25
|
+
* rowIndex→rowId resolution is done at the wiring stage (OpenGrid/DetailManager) via FlatRowModel; this class only
|
|
26
|
+
* takes already-resolved stable rowIds (string).
|
|
16
27
|
*/
|
|
17
|
-
/** FR-6 rowExpand/rowCollapse 이벤트 payload 재료. rowIndex/host 는 배선 단계에서 채운다(§6.3). */
|
|
28
|
+
/** FR-6 rowExpand/rowCollapse 이벤트 payload 재료. rowIndex/host 는 배선 단계에서 채운다(§6.3). / Material for the FR-6 rowExpand/rowCollapse event payload. rowIndex/host are filled at the wiring stage (§6.3). */
|
|
18
29
|
export interface RowExpandEventPayload {
|
|
30
|
+
/** 대상 행의 flat index. / Flat index of the target row. */
|
|
19
31
|
rowIndex: number;
|
|
32
|
+
/** 대상 행의 stable rowId. / Stable rowId of the target row. */
|
|
20
33
|
rowId: string;
|
|
34
|
+
/** 대상 행 데이터. / Target row data. */
|
|
21
35
|
row: any;
|
|
36
|
+
/** 디테일 패널 host 요소(없으면 null). / Detail panel host element (null if none). */
|
|
22
37
|
host: HTMLElement | null;
|
|
23
38
|
}
|
|
39
|
+
/** DetailState 생성 옵션. / DetailState construction options. */
|
|
24
40
|
export interface DetailStateOptions {
|
|
25
|
-
/** masterDetail.maxDepth, 기본 2 (CON-4/FR-10). */
|
|
41
|
+
/** masterDetail.maxDepth, 기본 2 (CON-4/FR-10). / masterDetail.maxDepth, default 2 (CON-4/FR-10). */
|
|
26
42
|
maxDepth?: number;
|
|
27
|
-
/** masterDetail.expandMultiple, 기본 true. false=아코디언(펼침 1개만 허용). */
|
|
43
|
+
/** masterDetail.expandMultiple, 기본 true. false=아코디언(펼침 1개만 허용). / masterDetail.expandMultiple, default true. false = accordion (only one expansion allowed). */
|
|
28
44
|
expandMultiple?: boolean;
|
|
29
|
-
/** 이 그리드 인스턴스의 현재 중첩 깊이(부모가 자식 생성 시 depth+1 주입, CON-4). 기본 0(최상위). */
|
|
45
|
+
/** 이 그리드 인스턴스의 현재 중첩 깊이(부모가 자식 생성 시 depth+1 주입, CON-4). 기본 0(최상위). / Current nesting depth of this grid instance (parent injects depth+1 when creating a child, CON-4). Default 0 (top level). */
|
|
30
46
|
depth?: number;
|
|
31
47
|
}
|
|
48
|
+
/** toggle() 결과: 펼침/접힘/거부. / Result of toggle(): expanded / collapsed / rejected. */
|
|
32
49
|
export type DetailToggleResult = 'expanded' | 'collapsed' | 'rejected';
|
|
33
50
|
/**
|
|
34
51
|
* 펼침 상태 보관소. rowId 는 DataLayer stable id(`_ogRowId` 등) — 정렬/필터로 flat 인덱스가
|
|
35
52
|
* 바뀌어도 이 Set 의 멤버십은 그대로 보존된다(FR-4, C0.5).
|
|
53
|
+
* / Expansion-state store. rowId is a DataLayer stable id (`_ogRowId`, etc.) — even if the flat index changes due
|
|
54
|
+
* to sort/filter, this Set's membership is preserved (FR-4, C0.5).
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* const state = new DetailState({ expandMultiple: false });
|
|
58
|
+
* state.toggle('row-7'); // 'expanded'
|
|
59
|
+
* state.isExpanded('row-7'); // true
|
|
36
60
|
*/
|
|
37
61
|
export declare class DetailState {
|
|
38
62
|
private _expanded;
|
|
39
63
|
private _maxDepth;
|
|
40
64
|
private _expandMultiple;
|
|
41
65
|
private _depth;
|
|
66
|
+
/**
|
|
67
|
+
* @param opts - maxDepth/expandMultiple/depth 옵션(모두 기본값 있음) / maxDepth/expandMultiple/depth options (all defaulted)
|
|
68
|
+
*/
|
|
42
69
|
constructor(opts?: DetailStateOptions);
|
|
43
|
-
/** 읽기 전용 뷰. 소유권은 이 클래스가 유지(외부에서 mutate 금지). */
|
|
70
|
+
/** 읽기 전용 뷰. 소유권은 이 클래스가 유지(외부에서 mutate 금지). / Read-only view. Ownership stays with this class (do not mutate externally). */
|
|
44
71
|
get expandedRowIds(): ReadonlySet<string>;
|
|
72
|
+
/** 현재 펼쳐진 행 수. / Number of currently expanded rows. */
|
|
45
73
|
get size(): number;
|
|
74
|
+
/** 이 그리드 인스턴스의 중첩 깊이. / Nesting depth of this grid instance. */
|
|
46
75
|
get depth(): number;
|
|
76
|
+
/** 허용 최대 중첩 깊이. / Maximum allowed nesting depth. */
|
|
47
77
|
get maxDepth(): number;
|
|
78
|
+
/** 다중 펼침 허용 여부(false=아코디언). / Whether multiple expansions are allowed (false = accordion). */
|
|
48
79
|
get expandMultiple(): boolean;
|
|
80
|
+
/**
|
|
81
|
+
* rowId 가 펼쳐져 있는지 여부. / Whether the given rowId is expanded.
|
|
82
|
+
* @param rowId - stable rowId / stable rowId
|
|
83
|
+
* @returns 펼침 여부 / Whether expanded
|
|
84
|
+
*/
|
|
49
85
|
isExpanded(rowId: string): boolean;
|
|
50
|
-
/**
|
|
86
|
+
/**
|
|
87
|
+
* CON-4/FR-10: depth >= maxDepth 면 이 그리드에서는 더 이상 펼칠 수 없다(중첩 깊이 경계).
|
|
88
|
+
* / CON-4/FR-10: if depth >= maxDepth this grid can no longer expand (nesting-depth boundary).
|
|
89
|
+
* @returns 이 깊이에서 펼침 가능 여부 / Whether expansion is possible at this depth
|
|
90
|
+
*/
|
|
51
91
|
canExpand(): boolean;
|
|
52
92
|
/**
|
|
53
|
-
* rowId 를 펼침 상태로 표시.
|
|
93
|
+
* rowId 를 펼침 상태로 표시. / Mark a rowId as expanded.
|
|
54
94
|
* - depth 초과(EC-6/FR-10)면 false 반환(거부) — 호출자가 announce() 등 경고를 낸다.
|
|
55
95
|
* - 이미 펼쳐져 있으면 멱등(true, 재적용 없음 — EC-7 빠른 토글 연타 방어).
|
|
56
96
|
* - expandMultiple:false(아코디언)면 기존 펼침을 전부 접고 이 rowId 만 남긴다.
|
|
97
|
+
* / - Over depth (EC-6/FR-10) returns false (rejected) — the caller emits a warning such as announce().
|
|
98
|
+
* / - If already expanded it is idempotent (true, no re-application — EC-7 defends against rapid toggle spamming).
|
|
99
|
+
* / - When expandMultiple:false (accordion), collapses all existing expansions and keeps only this rowId.
|
|
100
|
+
*
|
|
101
|
+
* @param rowId - stable rowId / stable rowId
|
|
102
|
+
* @returns 펼침 성공 여부(거부 시 false) / Whether expansion succeeded (false when rejected)
|
|
57
103
|
*/
|
|
58
104
|
expand(rowId: string): boolean;
|
|
59
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* rowId 를 접음. 이미 접혀 있었으면 false(no-op 신호, 호출자가 이벤트 emit 여부 판단).
|
|
107
|
+
* / Collapse a rowId. Returns false if it was already collapsed (a no-op signal; the caller decides whether to emit).
|
|
108
|
+
* @param rowId - stable rowId / stable rowId
|
|
109
|
+
* @returns 실제로 접혔는지 여부 / Whether it was actually collapsed
|
|
110
|
+
*/
|
|
60
111
|
collapse(rowId: string): boolean;
|
|
61
|
-
/**
|
|
112
|
+
/**
|
|
113
|
+
* 토글 1회 = 정확히 하나의 결과(FR-6 "emit 정확히 1회"의 기반).
|
|
114
|
+
* / One toggle = exactly one result (the basis of FR-6 "emit exactly once").
|
|
115
|
+
* @param rowId - stable rowId / stable rowId
|
|
116
|
+
* @returns 'expanded' | 'collapsed' | 'rejected'
|
|
117
|
+
*/
|
|
62
118
|
toggle(rowId: string): DetailToggleResult;
|
|
63
|
-
/**
|
|
119
|
+
/**
|
|
120
|
+
* collapseAllDetails() 배선용. 접힌 rowId 목록을 반환(호출자가 각각 rowCollapse emit 판단).
|
|
121
|
+
* / For wiring collapseAllDetails(). Returns the list of collapsed rowIds (the caller decides whether to emit
|
|
122
|
+
* rowCollapse for each).
|
|
123
|
+
* @returns 접힌 rowId 배열 / Array of collapsed rowIds
|
|
124
|
+
*/
|
|
64
125
|
collapseAll(): string[];
|
|
65
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* FR-6 payload 조립 헬퍼(순수 데이터 조립, emit 자체는 배선 단계 EventEmitter 몫).
|
|
128
|
+
* / FR-6 payload assembly helper (pure data assembly; the emit itself belongs to the wiring-stage EventEmitter).
|
|
129
|
+
* @param rowId - stable rowId / stable rowId
|
|
130
|
+
* @param rowIndex - 대상 행 flat index / Target row flat index
|
|
131
|
+
* @param row - 대상 행 데이터 / Target row data
|
|
132
|
+
* @param host - 디테일 패널 host(없으면 null) / Detail panel host (null if none)
|
|
133
|
+
* @returns rowExpand/rowCollapse 이벤트 payload / rowExpand/rowCollapse event payload
|
|
134
|
+
*/
|
|
66
135
|
buildEventPayload(rowId: string, rowIndex: number, row: any, host: HTMLElement | null): RowExpandEventPayload;
|
|
67
136
|
}
|