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
|
@@ -1,40 +1,138 @@
|
|
|
1
1
|
import { ColumnDef } from './types.js';
|
|
2
|
+
/** 리프(말단) 컬럼 — 배치 계산에 필요한 인덱스·깊이 메타를 얹은 컬럼 정의. / A leaf column — a column def augmented with index/depth metadata for layout. */
|
|
2
3
|
export interface FlatColumn<T = any> extends ColumnDef<T> {
|
|
4
|
+
/** 좌→우 리프 컬럼 순번(0-base). / Left-to-right leaf column index (0-based). */
|
|
3
5
|
_colIndex: number;
|
|
6
|
+
/** 헤더 트리 깊이(1-base). / Header tree depth (1-based). */
|
|
4
7
|
_depth: number;
|
|
8
|
+
/** 리프 여부(항상 true). / Whether this is a leaf (always true here). */
|
|
5
9
|
_leaf: boolean;
|
|
10
|
+
/** 계산된 가로 병합 수(선택). / Computed horizontal span (optional). */
|
|
6
11
|
_colSpanCount?: number;
|
|
12
|
+
/** 계산된 세로 병합 수(선택). / Computed vertical span (optional). */
|
|
7
13
|
_rowSpanCount?: number;
|
|
8
14
|
}
|
|
15
|
+
/** 헤더 렌더링용 셀 하나의 배치 정보. / Layout info for a single header cell to render. */
|
|
9
16
|
export interface HeaderCell {
|
|
17
|
+
/** 대상 컬럼 정의. / The column definition. */
|
|
10
18
|
column: FlatColumn;
|
|
19
|
+
/** 리프 컬럼 인덱스. / Leaf column index. */
|
|
11
20
|
colIndex: number;
|
|
21
|
+
/** 헤더 깊이(1-base). / Header depth (1-based). */
|
|
12
22
|
depth: number;
|
|
23
|
+
/** 가로 병합 칸 수. / Horizontal span count. */
|
|
13
24
|
colSpan: number;
|
|
25
|
+
/** 세로 병합 칸 수. / Vertical span count. */
|
|
14
26
|
rowSpan: number;
|
|
15
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* 컬럼 트리(그룹 헤더 포함)를 리프 배열·헤더 셀·너비로 평탄화하는 배치 엔진.
|
|
30
|
+
* / Layout engine that flattens the column tree (including group headers) into leaf arrays,
|
|
31
|
+
* header cells, and computed widths.
|
|
32
|
+
*
|
|
33
|
+
* @typeParam T - 행 데이터 타입 / Row data type
|
|
34
|
+
* @example
|
|
35
|
+
* const layout = new ColumnLayout([{ field: 'name', header: '이름' }], 1);
|
|
36
|
+
* layout.visibleLeaves; // 표시 리프 컬럼 / visible leaf columns
|
|
37
|
+
* layout.computeWidths(800); // 리프 너비 배열 / per-leaf widths
|
|
38
|
+
*/
|
|
16
39
|
export declare class ColumnLayout<T = any> {
|
|
17
40
|
private _columns;
|
|
18
41
|
private _flatLeaves;
|
|
19
42
|
private _maxDepth;
|
|
20
43
|
private _frozenCount;
|
|
44
|
+
/**
|
|
45
|
+
* 컬럼 정의로 배치 엔진 생성 후 즉시 리프·깊이를 계산. / Create the layout engine and immediately compute leaves/depth.
|
|
46
|
+
*
|
|
47
|
+
* @param columns - 컬럼 정의 배열(그룹 헤더는 children 사용) / Column definitions (group headers use `children`)
|
|
48
|
+
* @param frozenCount - 좌측 고정 컬럼 수(기본 0) / Number of left-frozen columns (default 0)
|
|
49
|
+
*/
|
|
21
50
|
constructor(columns: ColumnDef<T>[], frozenCount?: number);
|
|
22
51
|
private _process;
|
|
52
|
+
/** 전체 리프 컬럼(숨김 포함). / All leaf columns (including hidden ones). */
|
|
23
53
|
get leaves(): FlatColumn<T>[];
|
|
54
|
+
/** 표시 리프 컬럼(hidden 제외). / Visible leaf columns (excluding hidden). */
|
|
24
55
|
get visibleLeaves(): FlatColumn<T>[];
|
|
56
|
+
/** 헤더 트리 최대 깊이(=헤더 행 수). / Maximum header tree depth (= header row count). */
|
|
25
57
|
get headerDepth(): number;
|
|
58
|
+
/** 좌측 고정 컬럼 수. / Number of left-frozen columns. */
|
|
26
59
|
get frozenCount(): number;
|
|
60
|
+
/**
|
|
61
|
+
* 좌측 고정 컬럼 수 변경. / Change the number of left-frozen columns.
|
|
62
|
+
*
|
|
63
|
+
* @param count - 고정할 컬럼 수 / Column count to freeze
|
|
64
|
+
*/
|
|
27
65
|
setFrozen(count: number): void;
|
|
66
|
+
/**
|
|
67
|
+
* 컬럼 정의 전체 교체 후 배치 재계산. / Replace all column definitions and re-run layout.
|
|
68
|
+
*
|
|
69
|
+
* @param columns - 새 컬럼 정의 배열 / New column definitions
|
|
70
|
+
*/
|
|
28
71
|
setColumns(columns: ColumnDef<T>[]): void;
|
|
72
|
+
/**
|
|
73
|
+
* 지정 field(들)의 리프 컬럼을 숨김 처리. / Hide the leaf column(s) for the given field(s).
|
|
74
|
+
*
|
|
75
|
+
* @param field - 숨길 field 또는 field 배열 / Field or fields to hide
|
|
76
|
+
*/
|
|
29
77
|
hideColumn(field: string | string[]): void;
|
|
78
|
+
/**
|
|
79
|
+
* 지정 field(들)의 리프 컬럼을 다시 표시. / Show the leaf column(s) for the given field(s).
|
|
80
|
+
*
|
|
81
|
+
* @param field - 표시할 field 또는 field 배열 / Field or fields to show
|
|
82
|
+
*/
|
|
30
83
|
showColumn(field: string | string[]): void;
|
|
84
|
+
/**
|
|
85
|
+
* 컬럼 추가 후 배치 재계산. / Add a column and re-run layout.
|
|
86
|
+
*
|
|
87
|
+
* @param colDef - 추가할 컬럼 정의 / Column definition to add
|
|
88
|
+
* @param position - 삽입 위치: 'first' | 'last' | 인덱스(기본 'last') / Insert position: 'first' | 'last' | index (default 'last')
|
|
89
|
+
*/
|
|
31
90
|
addColumn(colDef: ColumnDef<T>, position?: 'first' | 'last' | number): void;
|
|
91
|
+
/**
|
|
92
|
+
* 지정 field 컬럼을 트리에서 제거(중첩 그룹 포함) 후 배치 재계산.
|
|
93
|
+
* / Remove the column with the given field from the tree (including nested groups) and re-run layout.
|
|
94
|
+
*
|
|
95
|
+
* @param field - 제거할 컬럼 field / Field of the column to remove
|
|
96
|
+
*/
|
|
32
97
|
removeColumn(field: string): void;
|
|
98
|
+
/**
|
|
99
|
+
* field 로 리프 컬럼 조회. / Look up a leaf column by field.
|
|
100
|
+
*
|
|
101
|
+
* @param field - 컬럼 field / Column field
|
|
102
|
+
* @returns 리프 컬럼, 없으면 undefined / The leaf column, or undefined
|
|
103
|
+
*/
|
|
33
104
|
getColumnByField(field: string): FlatColumn<T> | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* 인덱스로 리프 컬럼 조회. / Look up a leaf column by index.
|
|
107
|
+
*
|
|
108
|
+
* @param index - 리프 컬럼 인덱스 / Leaf column index
|
|
109
|
+
* @returns 리프 컬럼, 없으면 undefined / The leaf column, or undefined
|
|
110
|
+
*/
|
|
34
111
|
getColumnByIndex(index: number): FlatColumn<T> | undefined;
|
|
112
|
+
/**
|
|
113
|
+
* field 의 리프 컬럼 인덱스 조회. / Get the leaf column index for a field.
|
|
114
|
+
*
|
|
115
|
+
* @param field - 컬럼 field / Column field
|
|
116
|
+
* @returns 리프 인덱스, 없으면 -1 / Leaf index, or -1 if not found
|
|
117
|
+
*/
|
|
35
118
|
getColumnIndex(field: string): number;
|
|
36
|
-
/**
|
|
119
|
+
/**
|
|
120
|
+
* 헤더 렌더링용 셀 계산 — 깊이별 행 배열(그룹 헤더 colSpan/rowSpan 포함).
|
|
121
|
+
* / Compute header cells for rendering — rows by depth (with group-header colSpan/rowSpan).
|
|
122
|
+
*
|
|
123
|
+
* @returns 깊이(행) × 셀 2차원 배열 / A 2D array of cells indexed by depth (row)
|
|
124
|
+
*/
|
|
37
125
|
buildHeaderCells(): HeaderCell[][];
|
|
38
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* 각 표시 리프 컬럼의 계산된 너비 배열 반환. / Return computed widths for each visible leaf column.
|
|
128
|
+
*
|
|
129
|
+
* flex 컬럼은 잔여 폭을 flex 비율로 분배받고, 고정 컬럼은 자기 width(없으면 기본값)를 쓴다.
|
|
130
|
+
* / Flex columns share the remaining width by their flex ratio; fixed columns use their own
|
|
131
|
+
* width (or the default when unset).
|
|
132
|
+
*
|
|
133
|
+
* @param totalWidth - 전체 사용 가능 폭(px) / Total available width in px
|
|
134
|
+
* @param defaultWidth - width 미지정 고정 컬럼의 기본 폭(기본 100) / Default width for fixed columns without a width (default 100)
|
|
135
|
+
* @returns 표시 리프 순서의 너비 배열(px) / Widths in visible-leaf order (px)
|
|
136
|
+
*/
|
|
39
137
|
computeWidths(totalWidth: number, defaultWidth?: number): number[];
|
|
40
138
|
}
|
|
@@ -1,17 +1,41 @@
|
|
|
1
1
|
import { ContextMenuItem } from './types.js';
|
|
2
2
|
export type { ContextMenuItem };
|
|
3
|
+
/**
|
|
4
|
+
* 기본 컨텍스트 메뉴 항목이 위임하는 액션 핸들러 모음. / Action handlers that the default context-menu items delegate to.
|
|
5
|
+
*
|
|
6
|
+
* `OpenGrid` 가 생성 시 주입하며, 커스텀 메뉴 항목이 `action: 'sortAsc'` 등
|
|
7
|
+
* 문자열 액션을 쓸 때 실제 동작을 제공한다. / Injected by `OpenGrid` at construction time;
|
|
8
|
+
* provides the real behavior when a custom menu item uses a string `action` like `'sortAsc'`.
|
|
9
|
+
*/
|
|
3
10
|
export interface ContextMenuActions {
|
|
11
|
+
/** 오름차순 정렬 실행. / Runs ascending sort. */
|
|
4
12
|
onSortAsc: () => void;
|
|
13
|
+
/** 내림차순 정렬 실행. / Runs descending sort. */
|
|
5
14
|
onSortDesc: () => void;
|
|
15
|
+
/** 찾기 바 열기. / Opens the find bar. */
|
|
6
16
|
onFind: () => void;
|
|
17
|
+
/** Excel 내보내기 실행. / Runs the Excel export. */
|
|
7
18
|
onExcel: () => void;
|
|
19
|
+
/** CSV 내보내기 실행. / Runs the CSV export. */
|
|
8
20
|
onCsv: () => void;
|
|
21
|
+
/** 인쇄 실행. / Runs print. */
|
|
9
22
|
onPrint: () => void;
|
|
10
23
|
}
|
|
11
24
|
/** i18n: 메시지 해석기 시그니처. / i18n: message resolver signature. */
|
|
12
25
|
export type ContextMenuT = (key: string, params?: Record<string, string | number>) => string;
|
|
13
26
|
/** 기본 메뉴 항목(ko 라벨) — i18n 미주입 폴백 + 구조 계약(테스트/공개 표면). / Default items (ko labels) — i18n fallback + structural contract. */
|
|
14
27
|
export declare const DEFAULT_CONTEXT_ITEMS: ContextMenuItem[];
|
|
28
|
+
/**
|
|
29
|
+
* 우클릭 팝업 컨텍스트 메뉴 관리자. / Manages the right-click popup context menu.
|
|
30
|
+
*
|
|
31
|
+
* 메뉴는 `document.body` 자식으로 추가한다(그리드 컨테이너의 조상에 transform/filter
|
|
32
|
+
* 가 있어도 `position:fixed` 기준점이 뷰포트에 고정되도록). 테마(`data-og-theme`)와
|
|
33
|
+
* 스킨(`data-og-skin`) 속성은 앵커 엘리먼트에서 복사해 CSS 변수 상속을 보존한다.
|
|
34
|
+
* / The menu is appended as a child of `document.body` (so its `position:fixed`
|
|
35
|
+
* reference stays the viewport even when an ancestor of the grid container has a
|
|
36
|
+
* transform/filter). The theme (`data-og-theme`) and skin (`data-og-skin`) attributes
|
|
37
|
+
* are copied from the anchor element to preserve CSS-variable inheritance.
|
|
38
|
+
*/
|
|
15
39
|
export declare class ContextMenuManager {
|
|
16
40
|
private readonly _anchor;
|
|
17
41
|
private readonly _actions;
|
|
@@ -23,14 +47,31 @@ export declare class ContextMenuManager {
|
|
|
23
47
|
private _docMouseMove;
|
|
24
48
|
private _focusIdx;
|
|
25
49
|
/**
|
|
26
|
-
* @param _anchor
|
|
27
|
-
* @param _actions 기본 액션 핸들러
|
|
50
|
+
* @param _anchor - 그리드 컨테이너 엘리먼트 — CSS 변수 상속 기준점 / Grid container element — the reference point for CSS-variable inheritance
|
|
51
|
+
* @param _actions - 기본 액션 핸들러(OpenGrid에서 주입) / Default action handlers (injected by OpenGrid)
|
|
52
|
+
* @param _t - i18n 메시지 해석기(미주입 시 ko 기본 라벨) / i18n message resolver (falls back to ko default labels when absent)
|
|
28
53
|
*/
|
|
29
54
|
constructor(_anchor: HTMLElement, _actions: ContextMenuActions, _t?: ContextMenuT | undefined);
|
|
55
|
+
/**
|
|
56
|
+
* 지정 좌표에 컨텍스트 메뉴를 연다. / Open the context menu at the given coordinates.
|
|
57
|
+
*
|
|
58
|
+
* 이전 메뉴가 열려 있으면 먼저 닫는다. 항목을 지정하지 않으면 활성 로케일로
|
|
59
|
+
* 만든 기본 항목({@link DEFAULT_CONTEXT_ITEMS})을 사용한다.
|
|
60
|
+
* / Closes any previously open menu first. When no items are given, uses the
|
|
61
|
+
* default items ({@link DEFAULT_CONTEXT_ITEMS}) built in the active locale.
|
|
62
|
+
*
|
|
63
|
+
* @param e - 메뉴를 연 마우스 이벤트(좌표 기준) / Mouse event that opened the menu (used for positioning)
|
|
64
|
+
* @param customItems - 커스텀 메뉴 항목(생략 시 기본 항목) / Custom menu items (defaults when omitted)
|
|
65
|
+
*/
|
|
30
66
|
open(e: MouseEvent, customItems?: ContextMenuItem[]): void;
|
|
67
|
+
/** 열려 있는 메뉴를 닫고 관련 리스너를 모두 해제한다. / Close the open menu and detach all related listeners. */
|
|
31
68
|
close(): void;
|
|
69
|
+
/** 메뉴를 닫고 정리한다. / Close the menu and clean up. */
|
|
32
70
|
destroy(): void;
|
|
71
|
+
/** @internal 뷰포트 경계를 벗어나지 않도록 메뉴 위치를 계산해 배치한다. / Computes and applies the menu position, keeping it within viewport bounds. */
|
|
33
72
|
private _position;
|
|
73
|
+
/** @internal 활성 항목 사이에서 키보드 포커스를 이동한다. / Moves keyboard focus between enabled items. */
|
|
34
74
|
private _moveFocus;
|
|
75
|
+
/** @internal 항목의 함수 액션 또는 문자열 액션(→ ContextMenuActions)을 실행한다. / Runs an item's function action, or its string action (dispatched to ContextMenuActions). */
|
|
35
76
|
private _runAction;
|
|
36
77
|
}
|
|
@@ -14,57 +14,128 @@ import { GridOptions, OpenGridInstance, Position, GridDropEvent } from './types.
|
|
|
14
14
|
* `getPeerController(target)` 로 얻은 상대 컨트롤러의 동명 메서드로 수행한다 — `this`(source) 와
|
|
15
15
|
* peer(target) 로 갈라 원본의 `this._x` / `targetGrid._x` 접근을 1:1 재현한다(회귀 0).
|
|
16
16
|
* **3단계 drop emit 순서(before→후 이동→after→complete, 각 source→target)는 정확히 보존한다.**
|
|
17
|
+
* / Dependency contract that moves the cross-grid move/mapping/drop surface (`moveRowsTo`/
|
|
18
|
+
* `moveCheckedTo`/cross-transform resolution/the 3-phase drop event firing) out of the
|
|
19
|
+
* `OpenGrid` God object with **behavior unchanged** (R7, §3.1 C8, §6-R7). `OpenGrid` retains
|
|
20
|
+
* only thin delegating public methods (public API unchanged — the R0 `public_api_surface.txt`
|
|
21
|
+
* is frozen).
|
|
22
|
+
*
|
|
23
|
+
* Strangler principle (A2): `crossGridRegistry` (a process-scoped singleton in
|
|
24
|
+
* `CrossGridRegistry.ts`) is kept **AS-IS** for now — promoting it to an injected
|
|
25
|
+
* `GridRegistry` (C8, R-6c) is deferred to the R8 composition root.
|
|
26
|
+
*
|
|
27
|
+
* A cross-grid move involves **two grids** (source = `this`, target) at once. Since each
|
|
28
|
+
* `OpenGrid` owns its own `CrossGridController`, target-side operations (insert/rowCount/
|
|
29
|
+
* columns/3-phase firing) are carried out via the same-named methods on the peer controller
|
|
30
|
+
* obtained through `getPeerController(target)` — splitting into `this` (source) and `peer`
|
|
31
|
+
* (target) reproduces the original's `this._x` / `targetGrid._x` access 1:1 (zero regression).
|
|
32
|
+
* **The 3-phase drop emit order (before → move → after → complete, each source → target) is
|
|
33
|
+
* preserved exactly.**
|
|
17
34
|
*/
|
|
18
35
|
export interface CrossGridControllerDeps<T extends Record<string, any> = any> {
|
|
19
|
-
/** GridDropEvent 의 sourceGrid/targetGrid 식별자 + 자기동일성 비교에 쓰는 소유 그리드.
|
|
36
|
+
/** GridDropEvent 의 sourceGrid/targetGrid 식별자 + 자기동일성 비교에 쓰는 소유 그리드.
|
|
37
|
+
* / The owning grid, used both as the GridDropEvent's sourceGrid/targetGrid identifier and
|
|
38
|
+
* for self-identity comparison. */
|
|
20
39
|
getSelf: () => OpenGridInstance<T>;
|
|
21
40
|
getData: () => DataLayer<T>;
|
|
22
41
|
getColLayout: () => ColumnLayout<T>;
|
|
23
42
|
getOptions: () => Required<GridOptions<T>>;
|
|
24
|
-
/** EventEmitter fan(this.emit) — 'gridDropBefore/After/Complete'/'gridDropMapping'.
|
|
43
|
+
/** EventEmitter fan(this.emit) — 'gridDropBefore/After/Complete'/'gridDropMapping'.
|
|
44
|
+
* / EventEmitter fan-out (this.emit) for 'gridDropBefore/After/Complete'/'gridDropMapping'. */
|
|
25
45
|
emit: (event: string, payload?: any) => void;
|
|
26
|
-
/** 공개 insertRow 위임(MutationService 경유) — target 삽입에 쓰인다.
|
|
46
|
+
/** 공개 insertRow 위임(MutationService 경유) — target 삽입에 쓰인다.
|
|
47
|
+
* / Delegates to the public insertRow (via MutationService) — used for target-side insertion. */
|
|
27
48
|
insertRow: (item: Partial<T>, position?: Position) => void;
|
|
28
|
-
/** 공개 deleteRow 위임(MutationService 경유) — source 제거에 쓰인다.
|
|
49
|
+
/** 공개 deleteRow 위임(MutationService 경유) — source 제거에 쓰인다.
|
|
50
|
+
* / Delegates to the public deleteRow (via MutationService) — used for source-side removal. */
|
|
29
51
|
deleteRow: (rowIndex: number | number[]) => void;
|
|
30
|
-
/** rowMgr.getChecked() — moveCheckedTo. */
|
|
52
|
+
/** rowMgr.getChecked() — moveCheckedTo. / rowMgr.getChecked() — used by moveCheckedTo. */
|
|
31
53
|
getChecked: () => Array<{
|
|
32
54
|
rowIndex: number;
|
|
33
55
|
}>;
|
|
34
|
-
/** rowMgr.uncheckAll()(+재렌더) 공개 위임 — moveCheckedTo.
|
|
56
|
+
/** rowMgr.uncheckAll()(+재렌더) 공개 위임 — moveCheckedTo.
|
|
57
|
+
* / Delegates to the public rowMgr.uncheckAll() (+ re-render) — used by moveCheckedTo. */
|
|
35
58
|
uncheckAll: () => void;
|
|
36
|
-
/** 드래그 선택 집합 해석(_dragRowSet). OpenGrid 가 소유(RowDragDrop 배선과 공유).
|
|
59
|
+
/** 드래그 선택 집합 해석(_dragRowSet). OpenGrid 가 소유(RowDragDrop 배선과 공유).
|
|
60
|
+
* / Resolves the drag selection set (_dragRowSet). Owned by OpenGrid (shared with the
|
|
61
|
+
* RowDragDrop wiring). */
|
|
37
62
|
dragRowSet: (fromIndex: number) => number[];
|
|
38
|
-
/** 상대 그리드의 CrossGridController 획득(피어 연산 위임). 비 OpenGrid 대상은 undefined.
|
|
63
|
+
/** 상대 그리드의 CrossGridController 획득(피어 연산 위임). 비 OpenGrid 대상은 undefined.
|
|
64
|
+
* / Obtains the peer grid's CrossGridController for delegated peer operations. `undefined`
|
|
65
|
+
* for non-OpenGrid targets. */
|
|
39
66
|
getPeerController: (grid: OpenGridInstance<T>) => CrossGridController<T> | undefined;
|
|
40
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* 그리드↔그리드 이동·매핑·드롭 조정자. / Grid-to-grid move/mapping/drop coordinator.
|
|
70
|
+
*
|
|
71
|
+
* 드래그 또는 화살표 셔틀로 촉발되는 행 이동, 스키마가 다른 그리드 간 필드 매핑, 3단계
|
|
72
|
+
* drop 이벤트(before→after→complete) 발화를 담당한다(R7).
|
|
73
|
+
* / Handles row moves triggered by drag or the arrow-key shuttle, field mapping between
|
|
74
|
+
* grids with different schemas, and firing the 3-phase drop event (before→after→complete) (R7).
|
|
75
|
+
*/
|
|
41
76
|
export declare class CrossGridController<T extends Record<string, any> = any> {
|
|
42
77
|
private _deps;
|
|
43
78
|
constructor(deps: CrossGridControllerDeps<T>);
|
|
44
|
-
/** 이 그리드의 소유 인스턴스(GridDropEvent 식별자). */
|
|
79
|
+
/** 이 그리드의 소유 인스턴스(GridDropEvent 식별자). / This grid's owning instance (the GridDropEvent identifier). */
|
|
45
80
|
getSelf(): OpenGridInstance<T>;
|
|
46
81
|
private _rowCount;
|
|
47
82
|
private _insertRow;
|
|
48
83
|
private _visibleLeafInfos;
|
|
49
|
-
/**
|
|
84
|
+
/**
|
|
85
|
+
* 드래그 드롭 어댑터 → 공개 moveRowsTo 로 위임. / Drag-drop adapter that delegates to the
|
|
86
|
+
* public moveRowsTo.
|
|
87
|
+
*
|
|
88
|
+
* @param fromIndex - 드래그 원본 행 인덱스 / Source row index of the drag
|
|
89
|
+
* @param targetBodyEl - 드롭 대상 그리드의 바디 엘리먼트(crossGridRegistry 조회 키) / Target grid's body element (lookup key into crossGridRegistry)
|
|
90
|
+
* @param targetIndex - 대상 그리드에서 삽입할 인덱스 / Insert index in the target grid
|
|
91
|
+
*/
|
|
50
92
|
handleCrossGridDrop(fromIndex: number, targetBodyEl: HTMLElement, targetIndex: number): void;
|
|
51
93
|
/**
|
|
52
94
|
* 이 그리드의 행들을 다른 그리드로 이동(move)한다. 드래그·화살표 셔틀 공통 경로.
|
|
53
95
|
* 3단계 이벤트(before→after→complete)와 crossGridMapping(필드 매핑)을 적용한다.
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
96
|
+
* / Move this grid's rows into another grid. The shared path for drag and the arrow-key
|
|
97
|
+
* shuttle. Applies the 3-phase event (before→after→complete) and crossGridMapping
|
|
98
|
+
* (field mapping).
|
|
99
|
+
*
|
|
100
|
+
* @param target - 대상 그리드 / The target grid
|
|
101
|
+
* @param sourceIndexes - 이동할 (표시)행 인덱스들 / (Displayed) row indexes to move
|
|
102
|
+
* @param targetIndex - 대상에서 삽입 위치 (생략 시 맨 끝에 추가) / Insert position in the target (omit to append at the end)
|
|
103
|
+
* @returns 이동 성공 true, 취소/무효 false / `true` if the move succeeded, `false` if cancelled/invalid
|
|
58
104
|
*/
|
|
59
105
|
moveRowsTo(target: OpenGridInstance<T>, sourceIndexes: number[], targetIndex?: number): Promise<boolean>;
|
|
60
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* 체크된 행을 다른 그리드로 이동 (화살표 셔틀용). 체크 없으면 무시.
|
|
108
|
+
* / Move checked rows into another grid (for the arrow-key shuttle). No-op if none are checked.
|
|
109
|
+
*
|
|
110
|
+
* @param target - 대상 그리드 / The target grid
|
|
111
|
+
* @returns 이동 성공 true, 취소/무효(체크 없음 포함) false / `true` if the move succeeded, `false` if cancelled/invalid (including no checked rows)
|
|
112
|
+
*/
|
|
61
113
|
moveCheckedTo(target: OpenGridInstance<T>): Promise<boolean>;
|
|
62
114
|
/**
|
|
63
115
|
* 크로스그리드 이동의 행 변환 함수를 결정한다.
|
|
64
116
|
* 반환: null=변환 불필요(그대로) / 함수=변환 적용 / false=매핑 모달 취소(이동 중단)
|
|
65
117
|
*/
|
|
66
118
|
private _resolveCrossTransform;
|
|
119
|
+
/**
|
|
120
|
+
* 이동 전 이벤트를 발화한다. 핸들러가 `false` 를 반환하거나 `e.cancel` 을 세우면 이동이 중단된다.
|
|
121
|
+
* / Fire the pre-move event. If a handler returns `false` or sets `e.cancel`, the move is aborted.
|
|
122
|
+
*
|
|
123
|
+
* @param e - drop 이벤트 페이로드 / The drop event payload
|
|
124
|
+
* @returns 핸들러의 반환값(취소 판단에 쓰임) / The handler's return value (used to decide cancellation)
|
|
125
|
+
*/
|
|
67
126
|
fireGridDropBefore(e: GridDropEvent<T>): boolean | void;
|
|
127
|
+
/**
|
|
128
|
+
* 이동 후(삽입/삭제 반영 후) 이벤트를 발화한다. / Fire the post-move event (after insert/delete
|
|
129
|
+
* have taken effect).
|
|
130
|
+
*
|
|
131
|
+
* @param e - drop 이벤트 페이로드 / The drop event payload
|
|
132
|
+
*/
|
|
68
133
|
fireGridDropAfter(e: GridDropEvent<T>): void;
|
|
134
|
+
/**
|
|
135
|
+
* 이동 완료(양쪽 재렌더까지 반영) 이벤트를 발화한다. / Fire the completion event (after both
|
|
136
|
+
* grids have re-rendered).
|
|
137
|
+
*
|
|
138
|
+
* @param e - drop 이벤트 페이로드 / The drop event payload
|
|
139
|
+
*/
|
|
69
140
|
fireGridDropComplete(e: GridDropEvent<T>): void;
|
|
70
141
|
}
|
|
@@ -1,21 +1,59 @@
|
|
|
1
|
+
/** 한 컬럼의 매핑용 최소 필드 정보. / Minimal field info of a single column, used for mapping. */
|
|
1
2
|
export interface FieldInfo {
|
|
3
|
+
/** 컬럼 field 키. / Column field key. */
|
|
2
4
|
field: string;
|
|
5
|
+
/** 컬럼 헤더 라벨(표시용). / Column header label (for display). */
|
|
3
6
|
header: string;
|
|
4
7
|
}
|
|
8
|
+
/** 매핑 모달 확정 결과. / Result of confirming the mapping modal. */
|
|
5
9
|
export interface MappingResult {
|
|
6
|
-
/** 타깃필드 → 소스필드 (빈 문자열이면 미매핑) */
|
|
10
|
+
/** 타깃필드 → 소스필드 (빈 문자열이면 미매핑). / Target field → source field (empty string = unmapped). */
|
|
7
11
|
mapping: Record<string, string>;
|
|
8
|
-
/** crossGridMapping 에 그대로 쓸 수 있는 변환 함수
|
|
12
|
+
/** crossGridMapping 에 그대로 쓸 수 있는 변환 함수 소스. / Transform-function source usable as-is in crossGridMapping. */
|
|
9
13
|
script: string;
|
|
10
14
|
}
|
|
11
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* mapping → 변환 함수 스크립트 문자열 생성.
|
|
17
|
+
* / Build a transform-function script string from a mapping.
|
|
18
|
+
*
|
|
19
|
+
* @param mapping - 타깃필드 → 소스필드 매핑(빈 값은 제외) / Target-to-source field mapping (empty entries skipped)
|
|
20
|
+
* @returns 코드에 붙여넣을 수 있는 `mapRow(src)` 함수 소스 / `mapRow(src)` function source ready to paste into code
|
|
21
|
+
* @example
|
|
22
|
+
* const script = buildMappingScript({ name: 'userName', age: '' });
|
|
23
|
+
* // → "function mapRow(src) { return { \"name\": src[\"userName\"], }; }"
|
|
24
|
+
*/
|
|
12
25
|
export declare function buildMappingScript(mapping: Record<string, string>): string;
|
|
13
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* mapping → 실제 행 변환 함수.
|
|
28
|
+
* / Build the actual row transform function from a mapping.
|
|
29
|
+
*
|
|
30
|
+
* @param mapping - 타깃필드 → 소스필드 매핑 / Target-to-source field mapping
|
|
31
|
+
* @returns 소스 행을 타깃 스키마로 변환하는 함수 / A function converting a source row into the target schema
|
|
32
|
+
* @example
|
|
33
|
+
* const toTarget = buildTransform({ name: 'userName' });
|
|
34
|
+
* toTarget({ userName: 'Kim' }); // → { name: 'Kim' }
|
|
35
|
+
*/
|
|
14
36
|
export declare function buildTransform(mapping: Record<string, string>): (src: any) => any;
|
|
15
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* 같은 필드 집합인지 (순서 무관).
|
|
39
|
+
* / Whether two field sets are equal (order-independent).
|
|
40
|
+
*
|
|
41
|
+
* @param a - 필드명 배열 A / Field-name array A
|
|
42
|
+
* @param b - 필드명 배열 B / Field-name array B
|
|
43
|
+
* @returns 두 집합이 동일하면 true / true when the two sets are identical
|
|
44
|
+
*/
|
|
16
45
|
export declare function sameSchema(a: string[], b: string[]): boolean;
|
|
17
46
|
/**
|
|
18
47
|
* 매핑 모달을 띄우고 사용자가 확정한 매핑을 Promise 로 반환한다. (취소 시 null)
|
|
19
48
|
* 모달은 document.body 에 오버레이로 붙는다(디자인타임 헬퍼).
|
|
49
|
+
* / Open the mapping modal and return the user-confirmed mapping as a Promise (null on cancel).
|
|
50
|
+
* The modal attaches to document.body as an overlay (design-time helper).
|
|
51
|
+
*
|
|
52
|
+
* @param sourceFields - 소스 그리드의 필드 목록 / Field list of the source grid
|
|
53
|
+
* @param targetFields - 타깃 그리드의 필드 목록 / Field list of the target grid
|
|
54
|
+
* @returns 확정된 매핑 결과, 취소 시 null / The confirmed mapping result, or null on cancel
|
|
55
|
+
* @example
|
|
56
|
+
* const result = await openCrossGridMapper(srcCols, tgtCols);
|
|
57
|
+
* if (result) console.log(result.script); // 변환 스크립트 / transform script
|
|
20
58
|
*/
|
|
21
59
|
export declare function openCrossGridMapper(sourceFields: FieldInfo[], targetFields: FieldInfo[]): Promise<MappingResult | null>;
|
|
@@ -1,12 +1,46 @@
|
|
|
1
1
|
import { OpenGrid } from './OpenGrid.js';
|
|
2
|
+
/**
|
|
3
|
+
* 크로스그리드 레지스트리. / Cross-grid registry.
|
|
4
|
+
*
|
|
5
|
+
* 그리드 바디(`.og-body-wrapper`) 엘리먼트를 그리드 인스턴스에 매핑한다.
|
|
6
|
+
* 그리드↔그리드 드래그(좌표 → 타깃 그리드)와 화살표 셔틀이 공유하는 전역 조회처다.
|
|
7
|
+
* / Maps each grid body (`.og-body-wrapper`) element to its grid instance. Shared by
|
|
8
|
+
* grid-to-grid drag (coordinate → target grid) and the arrow-key shuttle as the
|
|
9
|
+
* global lookup point.
|
|
10
|
+
*/
|
|
2
11
|
export declare class CrossGridRegistry {
|
|
3
12
|
private _map;
|
|
13
|
+
/**
|
|
14
|
+
* 바디 엘리먼트 → 그리드 매핑을 등록한다. / Register a body element → grid mapping.
|
|
15
|
+
*
|
|
16
|
+
* @param bodyEl - 그리드 바디 래퍼 엘리먼트 / The grid body wrapper element
|
|
17
|
+
* @param grid - 대응 그리드 인스턴스 / The corresponding grid instance
|
|
18
|
+
*/
|
|
4
19
|
register(bodyEl: HTMLElement, grid: OpenGrid<any>): void;
|
|
20
|
+
/**
|
|
21
|
+
* 등록을 해제한다. / Remove a registration.
|
|
22
|
+
*
|
|
23
|
+
* @param bodyEl - 해제할 바디 엘리먼트 / The body element to unregister
|
|
24
|
+
*/
|
|
5
25
|
unregister(bodyEl: HTMLElement): void;
|
|
26
|
+
/**
|
|
27
|
+
* 바디 엘리먼트로 그리드를 조회한다. / Look up a grid by its body element.
|
|
28
|
+
*
|
|
29
|
+
* @param bodyEl - 그리드 바디 래퍼 엘리먼트 / The grid body wrapper element
|
|
30
|
+
* @returns 매핑된 그리드, 없으면 `undefined` / The mapped grid, or `undefined`
|
|
31
|
+
*/
|
|
6
32
|
get(bodyEl: HTMLElement): OpenGrid<any> | undefined;
|
|
33
|
+
/** 등록된 그리드 수. / Number of registered grids. */
|
|
7
34
|
get size(): number;
|
|
8
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* 커서 좌표 아래의 다른(crossGrid 허용) 그리드를 반환한다. / Resolve another (crossGrid-enabled) grid under the cursor.
|
|
37
|
+
*
|
|
38
|
+
* @param clientX - 커서 X 좌표(뷰포트 기준) / Cursor X in viewport coordinates
|
|
39
|
+
* @param clientY - 커서 Y 좌표(뷰포트 기준) / Cursor Y in viewport coordinates
|
|
40
|
+
* @param exclude - 제외할 그리드(보통 드래그 원본) / Grid to exclude (usually the drag source)
|
|
41
|
+
* @returns 좌표 아래의 대상 그리드, 없으면 `null` / The target grid under the point, or `null`
|
|
42
|
+
*/
|
|
9
43
|
resolveAt(clientX: number, clientY: number, exclude: OpenGrid<any>): OpenGrid<any> | null;
|
|
10
44
|
}
|
|
11
|
-
/** 전역 단일
|
|
45
|
+
/** 전역 단일 레지스트리. / Global singleton registry. */
|
|
12
46
|
export declare const crossGridRegistry: CrossGridRegistry;
|