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
|
@@ -12,23 +12,52 @@ import { GridOptions, Position } from './types.js';
|
|
|
12
12
|
* `commit(spec)` 로 수렴시키기 위한 명시 데이터계약(CommitSpec DTO). 각 mutator 의
|
|
13
13
|
* **관측 가능한 발화 순서 차이는 정규화 대상이 아니라 이 필드들로 인코딩**한다
|
|
14
14
|
* (R-9c 회귀0: R0 골든 `mutation-event-sequence.test.ts` 순서 보존).
|
|
15
|
+
* / Explicit data contract (CommitSpec DTO) that converges every mutator's mutate→render→emit
|
|
16
|
+
* tail into the single choke point `commit(spec)` (R4, §3.4, R-9a/R-9b). Each mutator's
|
|
17
|
+
* **observable firing-order differences are not normalized away but encoded into these
|
|
18
|
+
* fields** (R-9c, zero regression: order preserved by the R0 golden test
|
|
19
|
+
* `mutation-event-sequence.test.ts`).
|
|
15
20
|
*
|
|
16
21
|
* - `totals` : VS/Pagination 행수 갱신. 'count'=현재 행수(insert/delete/push/unshift),
|
|
17
22
|
* 'zero'=0(clearData). 생략=미갱신(writeCell/setData — 행수 불변 or 인라인 처리).
|
|
23
|
+
* / Updates the VS/Pagination row count. `'count'` = current row count
|
|
24
|
+
* (insert/delete/push/unshift), `'zero'` = 0 (clearData). Omitted = no update
|
|
25
|
+
* (writeCell/setData — row count unchanged, or handled inline).
|
|
18
26
|
* - `renderMode` : 'sync-window'=`_doRender(...visRange)`(insert/delete/write/endBatch),
|
|
19
27
|
* 'full'=`_doRender(0,-1)`(clearData),
|
|
20
28
|
* 'async-vs'=명령형 렌더 없음. setData 는 setTotalRows/rebuild 로 VS 가
|
|
21
29
|
* rAF 스케줄(비동기)하므로 `commit` 은 동기 `_doRender` 를 **하지 않는다**.
|
|
30
|
+
* / `'sync-window'` = `_doRender(...visRange)` (insert/delete/write/endBatch),
|
|
31
|
+
* `'full'` = `_doRender(0,-1)` (clearData), `'async-vs'` = no imperative render.
|
|
32
|
+
* For setData, VS schedules via rAF through setTotalRows/rebuild, so `commit`
|
|
33
|
+
* **does not** invoke a synchronous `_doRender`.
|
|
22
34
|
* - `emitBeforeRender` : true=emit 을 render 앞에(writeCell/endBatch — 현행 순서), 기본 false=render 먼저(insert/delete).
|
|
35
|
+
* / `true` = emit before render (writeCell/endBatch — current order); default
|
|
36
|
+
* `false` = render first (insert/delete).
|
|
23
37
|
* - `emitPayload` : `emit('dataChange', …)` 페이로드 지연 평가(thunk). getData() 시점을
|
|
24
38
|
* 현행과 동일(render 뒤 or 앞)하게 유지 + 명시 onDataChange 재호출 시 2회 평가 보존.
|
|
39
|
+
* / Lazily-evaluated (thunk) payload for `emit('dataChange', …)`. Keeps the
|
|
40
|
+
* `getData()` evaluation point identical to current behavior (before or after
|
|
41
|
+
* render) and preserves double evaluation when `onDataChange` is explicitly
|
|
42
|
+
* re-invoked.
|
|
25
43
|
* - `fireOnDataChangeExplicitly` : true=`_options.onDataChange?.()` 를 **명시 재호출**(bound listener 와 합쳐 DOUBLE-fire).
|
|
26
44
|
* row mutator=true, setData/clearData=false(bound listener 로 ONCE).
|
|
45
|
+
* / `true` = **explicitly re-invokes** `_options.onDataChange?.()` (combined with
|
|
46
|
+
* the bound listener, this DOUBLE-fires). Row mutators = `true`;
|
|
47
|
+
* setData/clearData = `false` (bound listener fires ONCE).
|
|
27
48
|
* - `flushFormula` : true=emit 전에 `_flushFormulaRecalc()`(writeCell/endBatch).
|
|
49
|
+
* / `true` = calls `_flushFormulaRecalc()` right before emit (writeCell/endBatch).
|
|
28
50
|
* - `preRender` : render 직전 훅(deleteRow 의 removedRowId invalidate 루프).
|
|
51
|
+
* / Hook that runs immediately before render (deleteRow's removedRowId
|
|
52
|
+
* invalidation loop).
|
|
29
53
|
* - `coalescable` : true 인 커밋만 배치 개구 중 render/emit 을 no-op 하고 `_batchDirty` 를 세운다.
|
|
30
54
|
* **writeCell 만 원래 배치를 감지**했으므로 나머지 mutator(coalescable 생략)는
|
|
31
55
|
* 배치 안에서도 즉시 렌더(현행 보존 — 배치 게이트를 전 mutator 로 확대하지 않는다).
|
|
56
|
+
* / Only commits with `true` no-op render/emit while a batch is open and instead
|
|
57
|
+
* set `_batchDirty`. **Only writeCell originally detected batches**, so the
|
|
58
|
+
* remaining mutators (which omit `coalescable`) still render immediately even
|
|
59
|
+
* inside a batch (current behavior preserved — the batch gate is not widened to
|
|
60
|
+
* every mutator).
|
|
32
61
|
*/
|
|
33
62
|
export interface CommitSpec {
|
|
34
63
|
totals?: 'count' | 'zero';
|
|
@@ -50,6 +79,18 @@ export interface CommitSpec {
|
|
|
50
79
|
* render 는 주입된 `doRenderWindow`/`doRenderFull` 콜백으로만 유발한다. 값(vs/pagination/recalc
|
|
51
80
|
* 등)은 늦은-null / 재할당(worksheet 전환)을 견디도록 전부 getter 클로저로 읽는다.
|
|
52
81
|
* 배치 코얼레싱(`_batchDepth`/`_batchDirty`) 시맨틱은 R4 와 1:1 동일하다(회귀 0).
|
|
82
|
+
* / Dependency contract that moves the data-mutation surface (setData/insert/push/delete/
|
|
83
|
+
* writeCell/writeCells + batch API) and the single commit choke point `commit(CommitSpec)`
|
|
84
|
+
* introduced by R4 out of the `OpenGrid` God object with **behavior unchanged** (R6, §3.1 C5,
|
|
85
|
+
* §6-R6). `OpenGrid` retains only thin delegating public methods (public API unchanged).
|
|
86
|
+
*
|
|
87
|
+
* Strangler principle (A2): `DataLayer` is still owned by `OpenGrid`; it is only **injected**
|
|
88
|
+
* here via the `*Deps` closure-inversion pattern. **The service has no direct knowledge of
|
|
89
|
+
* rendering** (Yourdon I/O separation): render is only triggered through the injected
|
|
90
|
+
* `doRenderWindow`/`doRenderFull` callbacks. Values (vs/pagination/recalc, etc.) are all read
|
|
91
|
+
* through getter closures so they tolerate late-null / reassignment (worksheet switching).
|
|
92
|
+
* Batch coalescing semantics (`_batchDepth`/`_batchDirty`) are 1:1 identical to R4 (zero
|
|
93
|
+
* regression).
|
|
53
94
|
*/
|
|
54
95
|
export interface MutationServiceDeps<T extends Record<string, any> = any> {
|
|
55
96
|
getData: () => DataLayer<T>;
|
|
@@ -62,29 +103,38 @@ export interface MutationServiceDeps<T extends Record<string, any> = any> {
|
|
|
62
103
|
getRowMgr: () => RowManager<T>;
|
|
63
104
|
getGrpMgr: () => GroupTreeManager<T>;
|
|
64
105
|
getOptions: () => Required<GridOptions<T>>;
|
|
65
|
-
/** EventEmitter fan
|
|
106
|
+
/** EventEmitter fan(this.emit) — 'dataChange'/'editEnd'/'writeCellsSkip'. / EventEmitter fan-out (this.emit) for 'dataChange'/'editEnd'/'writeCellsSkip'. */
|
|
66
107
|
emit: (event: string, payload?: any) => void;
|
|
67
|
-
/** aria-live announce
|
|
108
|
+
/** aria-live announce(C8.1 공용 인프라). / aria-live announce (C8.1 shared infrastructure). */
|
|
68
109
|
announce: (msg: string) => void;
|
|
69
110
|
/** i18n: 데이터 로드/스킵 announce 해석. / i18n: resolve data load/skip announces. */
|
|
70
111
|
t: (key: string, params?: Record<string, string | number>) => string;
|
|
71
|
-
/** sort/filter 재적용(setData). */
|
|
112
|
+
/** sort/filter 재적용(setData). / Re-apply sort/filter (setData). */
|
|
72
113
|
applyFilters: () => void;
|
|
73
|
-
/** writeCell/endBatch 커밋 emit 직전 수식 dirty seed 소비. */
|
|
114
|
+
/** writeCell/endBatch 커밋 emit 직전 수식 dirty seed 소비. / Consume formula dirty seeds right before the writeCell/endBatch commit emit. */
|
|
74
115
|
flushFormula: () => void;
|
|
75
|
-
/** 현재 가시 범위 렌더(this._doRender(...this._visRange())). 서비스는 렌더 내부를 모른다. */
|
|
116
|
+
/** 현재 가시 범위 렌더(this._doRender(...this._visRange())). 서비스는 렌더 내부를 모른다. / Render the current visible range (this._doRender(...this._visRange())). The service has no knowledge of render internals. */
|
|
76
117
|
doRenderWindow: () => void;
|
|
77
|
-
/** 전체 렌더(this._doRender(0, -1)) — clearData full 모드. */
|
|
118
|
+
/** 전체 렌더(this._doRender(0, -1)) — clearData full 모드. / Full render (this._doRender(0, -1)) — clearData's full mode. */
|
|
78
119
|
doRenderFull: () => void;
|
|
79
|
-
/** setData: 수식 dirty seed clear + RecalcCoordinator 재생성(rowId 재발급 대응). */
|
|
120
|
+
/** setData: 수식 dirty seed clear + RecalcCoordinator 재생성(rowId 재발급 대응). / setData: clears formula dirty seeds and recreates the RecalcCoordinator (to cope with rowId reissuance). */
|
|
80
121
|
resetFormulaState: () => void;
|
|
81
|
-
/** writeCell: 값이 바뀐 셀을 수식 dirty seed 로 적립(kind==='data' 일 때만). */
|
|
122
|
+
/** writeCell: 값이 바뀐 셀을 수식 dirty seed 로 적립(kind==='data' 일 때만). / writeCell: accumulates a changed cell as a formula dirty seed (only when kind === 'data'). */
|
|
82
123
|
seedFormulaDirty: (rowIndex: number, field: string) => void;
|
|
83
|
-
/** deleteRow: 제거된 rowId 를 deps 로 갖는 수식들을 #REF 로 무효화(preRender). */
|
|
124
|
+
/** deleteRow: 제거된 rowId 를 deps 로 갖는 수식들을 #REF 로 무효화(preRender). / deleteRow: invalidates formulas that depend on a removed rowId to #REF (preRender). */
|
|
84
125
|
invalidateRemovedRows: (rowIds: string[]) => void;
|
|
85
|
-
/** deleteRow: 제거 전 flat index 의 안정 rowId 확보. */
|
|
126
|
+
/** deleteRow: 제거 전 flat index 의 안정 rowId 확보. / deleteRow: captures the stable rowId at a flat index before removal. */
|
|
86
127
|
getRowIdAt: (rowIndex: number) => string | undefined;
|
|
87
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* 모든 데이터 변경(mutation)의 단일 초크포인트. / Single chokepoint for all data mutations.
|
|
131
|
+
*
|
|
132
|
+
* setData/insertRow/pushRow/deleteRow/writeCell/writeCells + 배치 API를 소유하며, 각 연산의
|
|
133
|
+
* mutate→render→emit 꼬리를 {@link CommitSpec} 을 통해 `commit()` 하나로 수렴시킨다(R4/R6).
|
|
134
|
+
* / Owns setData/insertRow/pushRow/deleteRow/writeCell/writeCells plus the batch API, and
|
|
135
|
+
* converges every operation's mutate→render→emit tail into a single `commit()` call driven
|
|
136
|
+
* by a {@link CommitSpec} (R4/R6).
|
|
137
|
+
*/
|
|
88
138
|
export declare class MutationService<T extends Record<string, any> = any> {
|
|
89
139
|
private _deps;
|
|
90
140
|
/** reentrant 카운터. 0 초과면 배치 중(writeCell 이 render/dataChange 를 지연). */
|
|
@@ -97,21 +147,66 @@ export declare class MutationService<T extends Record<string, any> = any> {
|
|
|
97
147
|
* 꼬리를 여기로 수렴. **관측 순서는 spec 필드로 인코딩**(정규화 아님 — R0 골든 diff=0).
|
|
98
148
|
* 배치 코얼레싱을 내재화: `coalescable` 커밋은 배치 개구 중 render/emit 을 지연하고
|
|
99
149
|
* `_batchDirty` 만 세운다(가장 바깥 endBatch 에서 1회 flush).
|
|
150
|
+
* / Single commit chokepoint (R4, §3.4, R-9a). Converges the post-mutate
|
|
151
|
+
* totals→(preRender)→flush→render/emit tail here. **Observable order is encoded via the
|
|
152
|
+
* spec fields** (not normalized — R0 golden diff = 0). Internalizes batch coalescing:
|
|
153
|
+
* commits marked `coalescable` defer render/emit while a batch is open and only set
|
|
154
|
+
* `_batchDirty` (flushed once by the outermost endBatch).
|
|
155
|
+
*
|
|
156
|
+
* @param spec - 커밋 데이터계약 / The commit data contract
|
|
100
157
|
*/
|
|
101
158
|
commit(spec: CommitSpec): void;
|
|
159
|
+
/**
|
|
160
|
+
* 전체 데이터를 교체한다. rowId 를 재발급하므로 기존 stable-id 앵커 수식은 전량 무효화된다.
|
|
161
|
+
* / Replace the entire dataset. Reissues rowIds, so any existing stable-id-anchored formulas
|
|
162
|
+
* are fully invalidated.
|
|
163
|
+
*
|
|
164
|
+
* @param data - 새 행 데이터 배열 / New array of row data
|
|
165
|
+
*/
|
|
102
166
|
setData(data: T[]): void;
|
|
167
|
+
/**
|
|
168
|
+
* 행 하나를 삽입한다. / Insert a single row.
|
|
169
|
+
*
|
|
170
|
+
* @param item - 삽입할 행 데이터(부분) / Row data to insert (partial)
|
|
171
|
+
* @param position - 삽입 위치. 기본 'last' / Insert position. Default `'last'`
|
|
172
|
+
*/
|
|
103
173
|
insertRow(item: Partial<T>, position?: Position): void;
|
|
174
|
+
/**
|
|
175
|
+
* 하나 이상의 행을 끝에 추가한다(트리거 브래킷 없음). / Append one or more rows to the end (no trigger bracket).
|
|
176
|
+
*
|
|
177
|
+
* @param items - 추가할 행(단일 또는 배열) / Row(s) to append (single or array)
|
|
178
|
+
*/
|
|
104
179
|
pushRow(items: Partial<T> | Partial<T>[]): void;
|
|
180
|
+
/**
|
|
181
|
+
* 하나 이상의 행을 제거한다. 제거된 rowId 에 의존하던 수식은 #REF 로 무효화된다.
|
|
182
|
+
* / Remove one or more rows. Formulas depending on a removed rowId are invalidated to #REF.
|
|
183
|
+
*
|
|
184
|
+
* @param rowIndex - 제거할 행의 (표시) 인덱스, 단일 또는 배열 / (Displayed) index of the row(s) to remove, single or array
|
|
185
|
+
*/
|
|
105
186
|
deleteRow(rowIndex: number | number[]): void;
|
|
187
|
+
/**
|
|
188
|
+
* 셀 하나에 값을 쓴다. 배치 개구 중이면 render/emit 을 coalesce 한다.
|
|
189
|
+
* / Write a value to a single cell. Coalesces render/emit while a batch is open.
|
|
190
|
+
*
|
|
191
|
+
* @param rowIndex - 대상 행의 flat index / Flat index of the target row
|
|
192
|
+
* @param field - 컬럼 field 명 / Column field name
|
|
193
|
+
* @param value - 기록할 값 / Value to write
|
|
194
|
+
*/
|
|
106
195
|
writeCell(rowIndex: number, field: string, value: any): void;
|
|
107
196
|
/**
|
|
108
197
|
* 배치 쓰기 시작(C2.1). 이후 writeCell 호출들은 render/dataChange 를 지연·coalesce 한다.
|
|
109
198
|
* 중첩 호출은 카운팅(reentrant) — 가장 바깥 endBatch 에서만 실제로 flush 된다.
|
|
199
|
+
* / Begin batched writes (C2.1). Subsequent writeCell calls defer and coalesce
|
|
200
|
+
* render/dataChange. Nested calls are counted (reentrant) — only the outermost endBatch
|
|
201
|
+
* actually flushes.
|
|
110
202
|
*/
|
|
111
203
|
beginBatch(): void;
|
|
112
204
|
/**
|
|
113
205
|
* 배치 종료(C2.1). 카운터가 0 이 되는 시점에 한해 배치 중 발생한 쓰기가 있으면
|
|
114
206
|
* _doRender 1회 + dataChange 1회를 발생시킨다(둘 다 0회 또는 1회 — 폭주 차단).
|
|
207
|
+
* / End the batch (C2.1). Only when the counter reaches 0 and a write occurred during the
|
|
208
|
+
* batch does this fire one `_doRender` and one `dataChange` (each either 0 or 1 times — no
|
|
209
|
+
* runaway firing).
|
|
115
210
|
*/
|
|
116
211
|
endBatch(): void;
|
|
117
212
|
/**
|
|
@@ -119,6 +214,14 @@ export declare class MutationService<T extends Record<string, any> = any> {
|
|
|
119
214
|
* FlatRowModel.resolveFlatRow 로 해소해 kind!=='data' (group/tree/detail 의사행)이면
|
|
120
215
|
* 쓰기 전에 skip 한다(C0.3 쓰기 안전, filler 에 writeCell 절대 금지).
|
|
121
216
|
* 건너뛴 셀 수를 반환하고, 1건이라도 있으면 announce + 'writeCellsSkip' 이벤트로 표면화한다.
|
|
217
|
+
* / A beginBatch+loop+endBatch wrapper (C2.1). `rowIndex` in each patch is a flat index —
|
|
218
|
+
* if resolving it via `FlatRowModel.resolveFlatRow` yields `kind !== 'data'` (a group/tree/
|
|
219
|
+
* detail pseudo-row), the write is skipped (C0.3 write safety — writeCell is never allowed
|
|
220
|
+
* on fillers). Returns the number of skipped cells and, if any were skipped, surfaces it via
|
|
221
|
+
* announce + a `'writeCellsSkip'` event.
|
|
222
|
+
*
|
|
223
|
+
* @param patches - 적용할 셀 패치 배열 / Array of cell patches to apply
|
|
224
|
+
* @returns 건너뛴 셀 수 / Number of cells skipped
|
|
122
225
|
*/
|
|
123
226
|
writeCells(patches: Array<{
|
|
124
227
|
rowIndex: number;
|
|
@@ -1,49 +1,180 @@
|
|
|
1
|
+
/** OGDecimal 로 변환 가능한 입력 타입. / Input types convertible to an OGDecimal. */
|
|
1
2
|
export type OGDecimalLike = string | number | bigint | OGDecimal;
|
|
3
|
+
/**
|
|
4
|
+
* BigInt 기반 임의정밀도 소수. / BigInt-based arbitrary-precision decimal.
|
|
5
|
+
*
|
|
6
|
+
* 값은 `coefficient / 10^scale` 로 표현되며, IEEE 754 오차 없이 정확한 사칙연산·집계를 제공한다.
|
|
7
|
+
* 음원 수익 배분처럼 수백 자리 정밀도가 필요한 계산을 외부 라이브러리 없이(ES2020+ BigInt) 지원한다.
|
|
8
|
+
* 인스턴스는 불변(immutable)이며, 모든 연산은 새 인스턴스를 반환한다.
|
|
9
|
+
* / A value is represented as `coefficient / 10^scale`, giving exact arithmetic and aggregation with
|
|
10
|
+
* no IEEE 754 error. Supports hundreds-of-digits precision (e.g. royalty splits) with no external
|
|
11
|
+
* library (ES2020+ BigInt). Instances are immutable; every operation returns a new instance.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const total = OGDecimal.from('0.1').add('0.2'); // 정확히 0.3 / exactly 0.3
|
|
15
|
+
* total.toFixed(2); // '0.30'
|
|
16
|
+
*/
|
|
2
17
|
export declare class OGDecimal {
|
|
3
18
|
private readonly _c;
|
|
4
19
|
private readonly _s;
|
|
20
|
+
/**
|
|
21
|
+
* coefficient/scale 로 직접 생성(보통 {@link OGDecimal.from} 사용 권장).
|
|
22
|
+
* / Construct directly from coefficient/scale (prefer {@link OGDecimal.from} in most cases).
|
|
23
|
+
*
|
|
24
|
+
* @param coefficient - 부호 포함 정수 계수 / Signed integer coefficient
|
|
25
|
+
* @param scale - 소수점 아래 자릿수(음수는 0으로 클램프) / Number of fractional digits (negatives clamp to 0)
|
|
26
|
+
*/
|
|
5
27
|
constructor(coefficient: bigint, scale: number);
|
|
28
|
+
/**
|
|
29
|
+
* 문자열·숫자·bigint·OGDecimal 을 OGDecimal 로 변환. / Convert a string/number/bigint/OGDecimal into an OGDecimal.
|
|
30
|
+
*
|
|
31
|
+
* 빈 값/'null'/'undefined'/'NaN' 은 0 으로 처리한다. / Empty/'null'/'undefined'/'NaN' inputs map to 0.
|
|
32
|
+
* ⚠️ number 입력은 이미 부동소수 오차를 담을 수 있으니 정밀 계산은 문자열 입력 권장.
|
|
33
|
+
* / ⚠️ A number input may already carry float error; prefer string input for exact math.
|
|
34
|
+
*
|
|
35
|
+
* @param value - 변환할 값 / Value to convert
|
|
36
|
+
* @returns 대응하는 OGDecimal / The corresponding OGDecimal
|
|
37
|
+
*/
|
|
6
38
|
static from(value: OGDecimalLike): OGDecimal;
|
|
39
|
+
/** 0 값 생성. / Create a zero value. */
|
|
7
40
|
static zero(): OGDecimal;
|
|
41
|
+
/** 1 값 생성. / Create a one value. */
|
|
8
42
|
static one(): OGDecimal;
|
|
9
43
|
private static _align;
|
|
44
|
+
/**
|
|
45
|
+
* 덧셈(정확). / Exact addition.
|
|
46
|
+
*
|
|
47
|
+
* @param other - 더할 값 / Value to add
|
|
48
|
+
* @returns 합을 담은 새 OGDecimal / A new OGDecimal holding the sum
|
|
49
|
+
*/
|
|
10
50
|
add(other: OGDecimalLike): OGDecimal;
|
|
51
|
+
/**
|
|
52
|
+
* 뺄셈(정확). / Exact subtraction.
|
|
53
|
+
*
|
|
54
|
+
* @param other - 뺄 값 / Value to subtract
|
|
55
|
+
* @returns 차를 담은 새 OGDecimal / A new OGDecimal holding the difference
|
|
56
|
+
*/
|
|
11
57
|
sub(other: OGDecimalLike): OGDecimal;
|
|
58
|
+
/**
|
|
59
|
+
* 곱셈(정확). / Exact multiplication.
|
|
60
|
+
*
|
|
61
|
+
* @param other - 곱할 값 / Value to multiply by
|
|
62
|
+
* @returns 곱을 담은 새 OGDecimal / A new OGDecimal holding the product
|
|
63
|
+
*/
|
|
12
64
|
mul(other: OGDecimalLike): OGDecimal;
|
|
13
65
|
/**
|
|
14
|
-
* 나눗셈.
|
|
15
|
-
*
|
|
66
|
+
* 나눗셈. / Division.
|
|
67
|
+
*
|
|
68
|
+
* precision = 결과 소수점 자리수(기본 20). 수익 배분처럼 소수 수백 자리가 필요하면 precision 을 높인다.
|
|
69
|
+
* / `precision` is the number of result decimal places (default 20). Raise it when hundreds of
|
|
70
|
+
* fractional digits are required (e.g. royalty splits).
|
|
71
|
+
*
|
|
72
|
+
* @param other - 제수(0 금지) / Divisor (must be non-zero)
|
|
73
|
+
* @param precision - 결과 소수점 자리수(기본 20) / Result decimal places (default 20)
|
|
74
|
+
* @returns 몫을 담은 새 OGDecimal / A new OGDecimal holding the quotient
|
|
75
|
+
* @throws 제수가 0 이면 Error / Error when the divisor is 0
|
|
16
76
|
*/
|
|
17
77
|
div(other: OGDecimalLike, precision?: number): OGDecimal;
|
|
18
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* 나머지(정수 나머지 개념을 소수에 적용). / Remainder (integer-remainder concept applied to decimals).
|
|
80
|
+
*
|
|
81
|
+
* @param other - 제수 / Divisor
|
|
82
|
+
* @returns 나머지를 담은 새 OGDecimal / A new OGDecimal holding the remainder
|
|
83
|
+
*/
|
|
19
84
|
mod(other: OGDecimalLike): OGDecimal;
|
|
20
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* 부호 반전. / Negation.
|
|
87
|
+
*
|
|
88
|
+
* @returns 부호를 뒤집은 새 OGDecimal / A new OGDecimal with the sign flipped
|
|
89
|
+
*/
|
|
21
90
|
neg(): OGDecimal;
|
|
22
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* 절댓값. / Absolute value.
|
|
93
|
+
*
|
|
94
|
+
* @returns 절댓값을 담은 새 OGDecimal / A new OGDecimal holding the absolute value
|
|
95
|
+
*/
|
|
23
96
|
abs(): OGDecimal;
|
|
97
|
+
/**
|
|
98
|
+
* 같음 비교. / Equality comparison.
|
|
99
|
+
* @param other - 비교 대상 / Value to compare
|
|
100
|
+
* @returns 값이 같으면 true / true if equal
|
|
101
|
+
*/
|
|
24
102
|
eq(other: OGDecimalLike): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* 초과 비교. / Greater-than comparison.
|
|
105
|
+
* @param other - 비교 대상 / Value to compare
|
|
106
|
+
* @returns this > other 이면 true / true if this > other
|
|
107
|
+
*/
|
|
25
108
|
gt(other: OGDecimalLike): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* 미만 비교. / Less-than comparison.
|
|
111
|
+
* @param other - 비교 대상 / Value to compare
|
|
112
|
+
* @returns this < other 이면 true / true if this < other
|
|
113
|
+
*/
|
|
26
114
|
lt(other: OGDecimalLike): boolean;
|
|
115
|
+
/** 이상(>=) 비교. / Greater-than-or-equal comparison. @param other 비교 대상 / Value to compare @returns this >= other 이면 true / true if this >= other */
|
|
27
116
|
gte(other: OGDecimalLike): boolean;
|
|
117
|
+
/** 이하(<=) 비교. / Less-than-or-equal comparison. @param other 비교 대상 / Value to compare @returns this <= other 이면 true / true if this <= other */
|
|
28
118
|
lte(other: OGDecimalLike): boolean;
|
|
119
|
+
/** 0 인지 여부. / Whether the value is zero. @returns 0 이면 true / true if zero */
|
|
29
120
|
isZero(): boolean;
|
|
121
|
+
/** 음수인지 여부. / Whether the value is negative. @returns 음수이면 true / true if negative */
|
|
30
122
|
isNeg(): boolean;
|
|
123
|
+
/** 양수인지 여부. / Whether the value is positive. @returns 양수이면 true / true if positive */
|
|
31
124
|
isPos(): boolean;
|
|
32
125
|
/**
|
|
33
|
-
* 지정 소수점 자리수로 반올림(Half-up) 후 문자열 반환.
|
|
34
|
-
*
|
|
126
|
+
* 지정 소수점 자리수로 반올림(Half-up) 후 문자열 반환. / Round Half-up to `dp` places and return a string.
|
|
127
|
+
*
|
|
128
|
+
* 음원 배분 등 정확한 자리수 표시에 사용. / Used for exact fixed-place display (e.g. royalty splits).
|
|
129
|
+
*
|
|
130
|
+
* @param dp - 소수점 자리수 / Number of decimal places
|
|
131
|
+
* @returns 반올림된 고정소수 문자열 / The rounded fixed-point string
|
|
35
132
|
*/
|
|
36
133
|
toFixed(dp: number): string;
|
|
37
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* 정규화(후행 0 제거) 후 최소 표현 문자열 반환. / Return the minimal string after normalization (trailing zeros removed).
|
|
136
|
+
*
|
|
137
|
+
* @returns 최소 표현 문자열 / The minimal string representation
|
|
138
|
+
*/
|
|
38
139
|
toString(): string;
|
|
39
|
-
/**
|
|
140
|
+
/**
|
|
141
|
+
* number 로 변환. / Convert to a number.
|
|
142
|
+
*
|
|
143
|
+
* ⚠️ 정밀도 손실 주의 — 표시/차트 등 근사 용도 전용, 정확 계산엔 쓰지 말 것.
|
|
144
|
+
* / ⚠️ Lossy — for display/chart approximations only; do not use for exact math.
|
|
145
|
+
*
|
|
146
|
+
* @returns 근사 number 값 / The approximate number value
|
|
147
|
+
*/
|
|
40
148
|
toNumber(): number;
|
|
41
|
-
/**
|
|
149
|
+
/**
|
|
150
|
+
* 정확한 합산(내부적으로 BigInt 정수 연산). / Exact summation (BigInt integer arithmetic internally).
|
|
151
|
+
*
|
|
152
|
+
* @param arr - 합산할 값 배열 / Values to sum
|
|
153
|
+
* @returns 합계 OGDecimal(빈 배열 → 0) / The sum (empty array → 0)
|
|
154
|
+
*/
|
|
42
155
|
static sum(arr: OGDecimalLike[]): OGDecimal;
|
|
43
|
-
/**
|
|
156
|
+
/**
|
|
157
|
+
* 정확한 평균. / Exact average.
|
|
158
|
+
*
|
|
159
|
+
* @param arr - 평균 낼 값 배열 / Values to average
|
|
160
|
+
* @param precision - 나눗셈 소수점 자리수(기본 20) / Division decimal places (default 20)
|
|
161
|
+
* @returns 평균 OGDecimal(빈 배열 → 0) / The average (empty array → 0)
|
|
162
|
+
*/
|
|
44
163
|
static avg(arr: OGDecimalLike[], precision?: number): OGDecimal;
|
|
45
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* 배열 최솟값. / Minimum of an array.
|
|
166
|
+
*
|
|
167
|
+
* @param arr - 값 배열(비어 있으면 예외) / Values (throws if empty)
|
|
168
|
+
* @returns 최솟값 OGDecimal / The minimum value
|
|
169
|
+
* @throws 빈 배열이면 Error / Error when the array is empty
|
|
170
|
+
*/
|
|
46
171
|
static min(arr: OGDecimalLike[]): OGDecimal;
|
|
47
|
-
/**
|
|
172
|
+
/**
|
|
173
|
+
* 배열 최댓값. / Maximum of an array.
|
|
174
|
+
*
|
|
175
|
+
* @param arr - 값 배열(비어 있으면 예외) / Values (throws if empty)
|
|
176
|
+
* @returns 최댓값 OGDecimal / The maximum value
|
|
177
|
+
* @throws 빈 배열이면 Error / Error when the array is empty
|
|
178
|
+
*/
|
|
48
179
|
static max(arr: OGDecimalLike[]): OGDecimal;
|
|
49
180
|
}
|
|
@@ -11,6 +11,23 @@ import { ChartConfig } from './chart/types.js';
|
|
|
11
11
|
import { OverrideLayer } from './OverrideKernel.js';
|
|
12
12
|
import { ExtensionPointRegistry } from './ExtensionPointRegistry.js';
|
|
13
13
|
import { FormulaErrorCode } from './formula/types.js';
|
|
14
|
+
import { CFRule } from './cf/CFRule.js';
|
|
15
|
+
import { IRealtimeSource, RealtimeController, RtAnnounceSummary, FrameScheduler } from './realtime/index.js';
|
|
16
|
+
/**
|
|
17
|
+
* `setRealtimeSource` 옵션(DD-07). 전부 옵션 — 미지정 시 안전 기본값. / Options for `setRealtimeSource`; all optional.
|
|
18
|
+
*/
|
|
19
|
+
export interface RealtimeWireOptions {
|
|
20
|
+
/** 프레임당 최대 적용 셀 수(백프레셔). / Max cells applied per frame (backpressure). */
|
|
21
|
+
maxBatchPerFrame?: number;
|
|
22
|
+
/** 프레임 스케줄러 주입(헤드리스/테스트 결정론). 기본=rAF/폴백. / Injected frame scheduler; default rAF/fallback. */
|
|
23
|
+
scheduleFrame?: FrameScheduler;
|
|
24
|
+
/** stale 판정 임계(ms). 기본 5000. / Stale threshold(ms); default 5000. */
|
|
25
|
+
staleAfterMs?: number;
|
|
26
|
+
/** SR 규모요약 핸드오프(DD-12 aria-live). 미지정=no-op(경계 준수). / SR summary handoff; default no-op. */
|
|
27
|
+
announce?: (summary: RtAnnounceSummary) => void;
|
|
28
|
+
/** SR 디바운스 윈도우(ms). 기본 500. / SR debounce window(ms); default 500. */
|
|
29
|
+
debounceMs?: number;
|
|
30
|
+
}
|
|
14
31
|
/**
|
|
15
32
|
* OPEN_GRID 코어 그리드 클래스. / The OPEN_GRID core grid class.
|
|
16
33
|
*
|
|
@@ -90,6 +107,18 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
90
107
|
private _recalc;
|
|
91
108
|
/** F3(C2): writeCell 단건 쓰기가 쌓아두는 dirty seed. endBatch/즉시 flush 시 onValuesChanged 1회로 소비. */
|
|
92
109
|
private _formulaDirtySeeds;
|
|
110
|
+
/** CF 엔진(동적 import 로 조립). 미설정=null → applyCF 콜백 즉시 return(byte-identical). / CF engine (lazily assembled). */
|
|
111
|
+
private _cf;
|
|
112
|
+
/** 컬럼별 통계 캐시(per-render 재계산 금지 — setConditionalFormat/데이터변경 시에만 갱신). / Per-column stats cache. */
|
|
113
|
+
private _cfStats;
|
|
114
|
+
/** 현재 적용된 CF 규칙(데이터 변경 시 통계 재계산에 재사용). / Currently applied CF rules. */
|
|
115
|
+
private _cfRules;
|
|
116
|
+
/** CF 색 시드 읽기 포트(동적 import 후 보관 — cf/ 정적 참조 회피로 별 청크 유지). / CF appearance read port. */
|
|
117
|
+
private _cfAppearance;
|
|
118
|
+
/** CF 통계 계산기(cf/ 동적 청크에서 보관 — 동기 재계산용, cf/ 정적 참조 회피). / CF stats computer captured from the dynamic chunk. */
|
|
119
|
+
private _cfComputeStats;
|
|
120
|
+
/** RT 컨트롤러(동적 import 로 조립). 미설정=null → 실시간 미배선(byte-identical). / Realtime controller (lazily assembled). */
|
|
121
|
+
private _rt;
|
|
93
122
|
private _ovk;
|
|
94
123
|
/** 공개 override API (호출가능 + .strategy). 생성자 말미에 부착. / Public override API (callable + .strategy). Attached at the end of the constructor. */
|
|
95
124
|
override: OverrideApi<T>;
|
|
@@ -335,6 +364,51 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
335
364
|
pushData(data: T[]): void;
|
|
336
365
|
/** 데이터 앞에 행들을 추가한다. / Prepend rows before the existing data. */
|
|
337
366
|
prefixData(data: T[]): void;
|
|
367
|
+
/**
|
|
368
|
+
* 조건부서식(CF) 규칙을 설정한다 — 데이터바·히트맵·아이콘셋을 렌더 경로에 배선한다.
|
|
369
|
+
* CF 는 opt-in 이라 첫 호출 때 CF 엔진(cf/**)을 **동적 import** 로 조립한다(베이스 번들 무증가, 별 청크).
|
|
370
|
+
* 규칙이 걸린 컬럼마다 컬럼 통계를 1회 캐시 계산(per-render 재계산 금지)한 뒤 재렌더한다.
|
|
371
|
+
* `rules=[]` 를 넘기면 CF 를 해제한다(엔진·통계 캐시 clear + 잔재 제거 재렌더).
|
|
372
|
+
* / Set conditional-formatting rules — wires data-bars/heatmaps/icon-sets into the render path.
|
|
373
|
+
* CF is opt-in; the CF engine (cf/**) is assembled via **dynamic import** on first call (no base-bundle
|
|
374
|
+
* growth, separate chunk). Column stats are cached once per rule-bearing column (never re-computed
|
|
375
|
+
* per render), then a re-render paints them. Passing `rules=[]` clears CF (engine/cache reset + residue-stripping re-render).
|
|
376
|
+
*
|
|
377
|
+
* @param rules - CF 규칙 배열(빈 배열이면 해제) / CF rule array (empty array clears CF)
|
|
378
|
+
* @example
|
|
379
|
+
* await grid.setConditionalFormat([
|
|
380
|
+
* { id: 'bar', when: { type: 'compare', op: '>=', a: 0 }, encode: { kind: 'bar', axis: 'zero' }, scope: { columnId: 'amount' }, priority: 0 },
|
|
381
|
+
* ]);
|
|
382
|
+
*/
|
|
383
|
+
setConditionalFormat(rules: CFRule[]): Promise<void>;
|
|
384
|
+
/**
|
|
385
|
+
* CF 규칙이 걸린 컬럼마다 현재 데이터로 컬럼 통계를 계산해 캐시한다(per-render 재계산 금지의 근거).
|
|
386
|
+
* 통계 계산기는 setConditionalFormat 에서 cf/ 동적 청크로부터 보관한 참조를 동기 사용한다.
|
|
387
|
+
* / Recompute & cache per-column CF stats using the computer captured from the cf/ dynamic chunk.
|
|
388
|
+
*/
|
|
389
|
+
private _recomputeCFStats;
|
|
390
|
+
/**
|
|
391
|
+
* 실시간 데이터 소스를 그리드에 배선한다(폴링/스트리밍/커스텀 — `IRealtimeSource` 구현 아무거나 DI).
|
|
392
|
+
* CF 와 동일하게 첫 호출 시에만 realtime/ 를 동적 import(별 청크·베이스 번들 무증가). 델타는 기존
|
|
393
|
+
* 단일 쓰기 경로(MutationService)를 재사용해 적용되므로 증분=전체 불변식·수식 재계산·차트 라이브
|
|
394
|
+
* 갱신(dataChange 구독)을 자연 상속한다. 재호출 시 이전 소스는 detach 후 교체.
|
|
395
|
+
* / Wire a realtime source (polling/streaming/custom — any `IRealtimeSource` via DI). Like CF, the
|
|
396
|
+
* realtime/ chunk is dynamically imported only on first call (separate chunk; base bundle unchanged).
|
|
397
|
+
* Deltas reuse the existing single write path (MutationService), inheriting the incremental=full
|
|
398
|
+
* invariant, formula recompute, and live chart refresh (dataChange subscription). Re-calling
|
|
399
|
+
* detaches and replaces the previous source.
|
|
400
|
+
*
|
|
401
|
+
* @param source - 실시간 소스(예: `new PollingSource({...})`) / Realtime source (e.g. `new PollingSource({...})`)
|
|
402
|
+
* @param opts - 백프레셔·신선도·SR 옵션(전부 옵션) / Backpressure/freshness/SR options (all optional)
|
|
403
|
+
* @returns 배선된 컨트롤러(`.connection`·`.backpressureStats`·`.onConnection`·`.detach()`) / The wired controller
|
|
404
|
+
* @example
|
|
405
|
+
* const src = new PollingSource({ intervalMs: 1000, fetcher: async () => ({ kind: 'delta', seq, cells }) });
|
|
406
|
+
* const rt = await grid.setRealtimeSource(src);
|
|
407
|
+
* rt.onConnection((s) => console.log(s.status));
|
|
408
|
+
*/
|
|
409
|
+
setRealtimeSource(source: IRealtimeSource<T>, opts?: RealtimeWireOptions): Promise<RealtimeController<T>>;
|
|
410
|
+
/** 실시간 소스 배선을 해제한다(구독·타이머·소켓 정리, 멱등). / Disconnect the realtime source (teardown; idempotent). */
|
|
411
|
+
disconnectRealtime(): void;
|
|
338
412
|
/** 모든 행을 제거한다(컬럼·옵션 유지). / Remove all rows (columns & options kept). */
|
|
339
413
|
clearData(): void;
|
|
340
414
|
/**
|
|
@@ -744,6 +818,31 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
744
818
|
* color⊥form orthogonality (throws).
|
|
745
819
|
*/
|
|
746
820
|
setSkinVar(k: string, v: string): void;
|
|
821
|
+
/**
|
|
822
|
+
* DD-11 S2b: 밀도(DENSITY 축, 제4 외관축) 전환 — data-og-density + `--og-density-*` 토큰(순수 additive).
|
|
823
|
+
* `densityRegistry.resolve(name)` 로 델타를 얻어 ①attr(named=설정, default/미등록=속성 제거로 byte-identical)
|
|
824
|
+
* ②밀도 이름공간 토큰을 컨테이너 인라인 CSS 변수로 ③행높이 브리지(`--og-density-row-height` → base.css 가
|
|
825
|
+
* 소비하는 `--og-row-height` 로 미러) ④`requiresRelayout` 이면 **리사이즈와 동일 경로**(`_onResize`)로 좌표
|
|
826
|
+
* 재파생(신규 relayout 로직 없음). 색⊥형태⊥밀도⊥질감 직교라 theme/skin attr·토큰을 건드리지 않는다.
|
|
827
|
+
* 미등록 name 은 never-throw(빈 델타 폴백 = default 취급). ⚠️ 밀도 10만행 relayout 실측은 S3 도커 이연.
|
|
828
|
+
* / DD-11 S2b: switch the density axis (4th appearance axis) — additive `data-og-density` + `--og-density-*`
|
|
829
|
+
* tokens. Named → set attr/tokens (+ mirror row-height, + relayout via the resize path); default/unknown →
|
|
830
|
+
* remove attr and reset the density namespace (byte-identical). Orthogonal to theme/skin. Never throws.
|
|
831
|
+
*
|
|
832
|
+
* @param name - 밀도 값 id(예 'compact', 'comfortable') / Density value id (e.g. 'compact')
|
|
833
|
+
*/
|
|
834
|
+
setDensity(name: string): void;
|
|
835
|
+
/**
|
|
836
|
+
* DD-11 S2b: 질감(TEXTURE 축, 제3 외관축) 전환 — data-og-texture + `--og-texture-*` 토큰(순수 additive).
|
|
837
|
+
* `textureRegistry.resolve(name)` 로 델타를 얻어 attr(named=설정, default/미등록=제거) + 질감 이름공간
|
|
838
|
+
* CSS 변수만 적용한다. 질감은 배경 페인트만이라 relayout 없음(좌표 불변). 색·형태·밀도 축과 직교.
|
|
839
|
+
* 미등록 name 은 never-throw(빈 델타 폴백). ⚠️ 질감 실렌더 육안 확인은 S3 도커 이연.
|
|
840
|
+
* / DD-11 S2b: switch the texture axis (3rd appearance axis) — additive `data-og-texture` + `--og-texture-*`
|
|
841
|
+
* tokens only. Background paint only → no relayout. Orthogonal to color/form/density. Never throws.
|
|
842
|
+
*
|
|
843
|
+
* @param name - 질감 값 id(예 'linen', 'paper-grain', 'graph') / Texture value id (e.g. 'linen')
|
|
844
|
+
*/
|
|
845
|
+
setTexture(name: string): void;
|
|
747
846
|
/**
|
|
748
847
|
* 트리거 등록('before:{op}' 취소 가능, 'after:{op}' 결과 수신). / Register a trigger
|
|
749
848
|
* ('before:{op}' can cancel, 'after:{op}' receives the result).
|
|
@@ -1,20 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 조직도 노드 카드의 컬럼(필드) 정의. / Column (field) definition for an org-chart node card.
|
|
3
|
+
*/
|
|
1
4
|
export interface OrgChartColumnDef {
|
|
5
|
+
/** 표시할 데이터 필드명. / Data field name to display. */
|
|
2
6
|
field: string;
|
|
7
|
+
/** 셀 래퍼에 추가할 CSS 클래스명. / Extra CSS class name for the cell wrapper. */
|
|
3
8
|
className?: string;
|
|
9
|
+
/** 인라인 스타일 문자열 또는 (값, 행)→스타일 함수. / Inline style string or (value, row)→style function. */
|
|
4
10
|
style?: string | ((value: any, row: Record<string, any>) => string);
|
|
11
|
+
/** 커스텀 렌더러. 문자열 반환 시 innerHTML, 엘리먼트 반환 시 append. / Custom renderer; a string is set as innerHTML, an element is appended. */
|
|
5
12
|
renderer?: (value: any, row: Record<string, any>) => HTMLElement | string;
|
|
6
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* 조직도 생성 옵션. / Org-chart construction options.
|
|
16
|
+
*/
|
|
7
17
|
export interface OrgChartOptions {
|
|
18
|
+
/** 각 행의 고유 id 필드명. / Field name holding each row's unique id. */
|
|
8
19
|
idField: string;
|
|
20
|
+
/** 부모 id 를 담은 필드명(트리 구성 기준). / Field name holding the parent id (tree structure key). */
|
|
9
21
|
parentIdField: string;
|
|
22
|
+
/** 노드 카드에 렌더할 컬럼 정의 배열. / Column definitions rendered inside each node card. */
|
|
10
23
|
columns: OrgChartColumnDef[];
|
|
24
|
+
/** 노드 카드 너비(px). 기본 160. / Node card width in px. Default 160. @defaultValue 160 */
|
|
11
25
|
nodeWidth?: number;
|
|
26
|
+
/** 노드 카드 높이(px). 기본 72. / Node card height in px. Default 72. @defaultValue 72 */
|
|
12
27
|
nodeHeight?: number;
|
|
28
|
+
/** 레벨(세대) 간 세로 간격(px). 기본 52. / Vertical gap between levels in px. Default 52. @defaultValue 52 */
|
|
13
29
|
levelGap?: number;
|
|
30
|
+
/** 형제 노드 간 가로 간격(px). 기본 20. / Horizontal gap between siblings in px. Default 20. @defaultValue 20 */
|
|
14
31
|
siblingGap?: number;
|
|
32
|
+
/** 최초 로드 시 전체 펼침 여부. 기본 true. / Whether to expand all on first load. Default true. @defaultValue true */
|
|
15
33
|
expandOnLoad?: boolean;
|
|
34
|
+
/** 노드 클릭 콜백 (id, 행데이터). / Node click callback (id, row data). */
|
|
16
35
|
onNodeClick?: (id: any, data: Record<string, any>) => void;
|
|
17
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* 조직도 컴포넌트. / Org-chart component.
|
|
39
|
+
*
|
|
40
|
+
* 부모/자식 관계(idField/parentIdField)를 가진 평면 데이터를 트리로 구성해
|
|
41
|
+
* SVG 연결선 + 노드 카드로 렌더한다. 그리드와 독립된 standalone 컴포넌트다.
|
|
42
|
+
* / Builds a tree from flat parent/child data (idField/parentIdField) and renders it as
|
|
43
|
+
* SVG connectors plus node cards. A standalone component independent of the grid.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* const chart = new OrgChart('#org', {
|
|
47
|
+
* idField: 'id', parentIdField: 'managerId',
|
|
48
|
+
* columns: [{ field: 'name' }, { field: 'title' }],
|
|
49
|
+
* });
|
|
50
|
+
* chart.setData([{ id: 1, managerId: null, name: 'CEO', title: '대표' }]);
|
|
51
|
+
*/
|
|
18
52
|
export declare class OrgChart {
|
|
19
53
|
private _container;
|
|
20
54
|
private _opts;
|
|
@@ -22,12 +56,33 @@ export declare class OrgChart {
|
|
|
22
56
|
private _roots;
|
|
23
57
|
private _expandedKeys;
|
|
24
58
|
private _selectedId;
|
|
59
|
+
/**
|
|
60
|
+
* @param selector - 마운트할 컨테이너 셀렉터 문자열 또는 엘리먼트 / Container selector string or element to mount into
|
|
61
|
+
* @param opts - 조직도 옵션 / Org-chart options
|
|
62
|
+
*/
|
|
25
63
|
constructor(selector: string | HTMLElement, opts: OrgChartOptions);
|
|
64
|
+
/**
|
|
65
|
+
* 조직도 데이터를 설정하고 렌더한다. / Set org-chart data and render.
|
|
66
|
+
*
|
|
67
|
+
* @param data - 부모/자식 관계를 가진 평면 행 배열 / Flat array of rows with parent/child relations
|
|
68
|
+
*/
|
|
26
69
|
setData(data: Record<string, any>[]): void;
|
|
70
|
+
/**
|
|
71
|
+
* COLOR 축 테마를 컨테이너에 설정한다. / Set the COLOR-axis theme on the container.
|
|
72
|
+
*
|
|
73
|
+
* @param theme - data-og-theme 값 / data-og-theme value
|
|
74
|
+
*/
|
|
27
75
|
setTheme(theme: string): void;
|
|
28
|
-
/**
|
|
76
|
+
/**
|
|
77
|
+
* R12b: FORM(스킨) 축 — data-og-skin 을 자기 컨테이너에 설정(setTheme 과 동형, 색과 직교).
|
|
78
|
+
* / R12b: FORM (skin) axis — set data-og-skin on the container (symmetric to setTheme, orthogonal to color).
|
|
79
|
+
*
|
|
80
|
+
* @param skin - data-og-skin 값 / data-og-skin value
|
|
81
|
+
*/
|
|
29
82
|
setSkin(skin: string): void;
|
|
83
|
+
/** 모든 노드를 펼친다. / Expand all nodes. */
|
|
30
84
|
expandAll(): void;
|
|
85
|
+
/** 모든 노드를 접는다(루트만 표시). / Collapse all nodes (roots only). */
|
|
31
86
|
collapseAll(): void;
|
|
32
87
|
private _toggle;
|
|
33
88
|
private _rebuild;
|