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.
Files changed (294) hide show
  1. package/CHANGELOG.md +376 -353
  2. package/README.md +1 -1
  3. package/dist/OpenGrid-B7m7ei7f.cjs +7385 -0
  4. package/dist/OpenGrid-CeUdO_fM.js +7398 -0
  5. package/dist/index-CeJ-0-80.cjs +260 -0
  6. package/dist/index-DnarQ4eR.js +266 -0
  7. package/dist/index-DrCPRuYi.js +548 -0
  8. package/dist/index-JjfWY3Bt.cjs +520 -0
  9. package/dist/open-grid-base.css +12 -1
  10. package/dist/open-grid-react.cjs +27 -1
  11. package/dist/open-grid-react.js +22 -82
  12. package/dist/open-grid-vue.cjs +31 -1
  13. package/dist/open-grid-vue.js +29 -79
  14. package/dist/open-grid.cjs +272 -6
  15. package/dist/open-grid.js +177 -266
  16. package/dist/types/bench/perf.d.ts +14 -8
  17. package/dist/types/core/AppearanceResolver.d.ts +98 -11
  18. package/dist/types/core/CFRenderBridge.d.ts +13 -0
  19. package/dist/types/core/CellEditManager.d.ts +73 -0
  20. package/dist/types/core/CellEventHandler.d.ts +99 -2
  21. package/dist/types/core/CellTypeRegistry.d.ts +24 -0
  22. package/dist/types/core/ChartManager.d.ts +51 -3
  23. package/dist/types/core/ColumnLayout.d.ts +100 -2
  24. package/dist/types/core/ContextMenu.d.ts +43 -2
  25. package/dist/types/core/CrossGridController.d.ts +86 -15
  26. package/dist/types/core/CrossGridMapper.d.ts +43 -5
  27. package/dist/types/core/CrossGridRegistry.d.ts +36 -2
  28. package/dist/types/core/DataLayer.d.ts +210 -15
  29. package/dist/types/core/DetailManager.d.ts +106 -15
  30. package/dist/types/core/DragVisuals.d.ts +33 -4
  31. package/dist/types/core/EventEmitter.d.ts +54 -0
  32. package/dist/types/core/ExportManager.d.ts +66 -1
  33. package/dist/types/core/ExtensionPointRegistry.d.ts +160 -14
  34. package/dist/types/core/FilterPanel.d.ts +17 -2
  35. package/dist/types/core/FilterSelect.d.ts +37 -13
  36. package/dist/types/core/FindBarManager.d.ts +26 -0
  37. package/dist/types/core/FlatRowModel.d.ts +54 -11
  38. package/dist/types/core/FooterManager.d.ts +53 -1
  39. package/dist/types/core/FormulaController.d.ts +139 -10
  40. package/dist/types/core/FormulaEngine.d.ts +15 -4
  41. package/dist/types/core/GridComposer.d.ts +54 -6
  42. package/dist/types/core/GridRenderer.d.ts +143 -10
  43. package/dist/types/core/GridShuttle.d.ts +44 -4
  44. package/dist/types/core/GroupEngine.d.ts +68 -10
  45. package/dist/types/core/GroupTreeManager.d.ts +86 -2
  46. package/dist/types/core/IconRegistry.d.ts +56 -9
  47. package/dist/types/core/KeyboardManager.d.ts +88 -4
  48. package/dist/types/core/MaskingEngine.d.ts +10 -9
  49. package/dist/types/core/MathUtils.d.ts +58 -5
  50. package/dist/types/core/MergeEngine.d.ts +45 -10
  51. package/dist/types/core/MutationService.d.ts +113 -10
  52. package/dist/types/core/OGDecimal.d.ts +144 -13
  53. package/dist/types/core/OpenGrid.d.ts +99 -0
  54. package/dist/types/core/OrgChart.d.ts +56 -1
  55. package/dist/types/core/OverrideKernel.d.ts +59 -15
  56. package/dist/types/core/Pagination.d.ts +38 -4
  57. package/dist/types/core/PivotEngine.d.ts +37 -0
  58. package/dist/types/core/RangeSelectionManager.d.ts +121 -7
  59. package/dist/types/core/RenderController.d.ts +56 -0
  60. package/dist/types/core/RowDragDrop.d.ts +52 -6
  61. package/dist/types/core/RowManager.d.ts +55 -0
  62. package/dist/types/core/SkinRegistry.d.ts +55 -15
  63. package/dist/types/core/SortFilterManager.d.ts +80 -1
  64. package/dist/types/core/TreeEngine.d.ts +60 -6
  65. package/dist/types/core/TriggerManager.d.ts +46 -0
  66. package/dist/types/core/VirtualScroll.d.ts +64 -0
  67. package/dist/types/core/WorksheetManager.d.ts +61 -2
  68. package/dist/types/core/XmlConverter.d.ts +56 -23
  69. package/dist/types/core/a11y/AccessibilityAdapter.d.ts +103 -0
  70. package/dist/types/core/a11y/AriaIntent.d.ts +34 -0
  71. package/dist/types/core/a11y/KeyboardInteractionModel.d.ts +64 -0
  72. package/dist/types/core/a11y/LiveRegionController.d.ts +89 -0
  73. package/dist/types/core/a11y/OverlayStack.d.ts +36 -0
  74. package/dist/types/core/a11y/VisualEquivRegistry.d.ts +37 -0
  75. package/dist/types/core/a11y/index.d.ts +13 -0
  76. package/dist/types/core/a11y/ports.d.ts +24 -0
  77. package/dist/types/core/appearance/Appearance.d.ts +68 -0
  78. package/dist/types/core/appearance/AppearanceAxis.d.ts +94 -0
  79. package/dist/types/core/appearance/AppearanceComposer.d.ts +45 -0
  80. package/dist/types/core/appearance/AppearanceProvider.d.ts +50 -0
  81. package/dist/types/core/appearance/AppearanceView.d.ts +51 -0
  82. package/dist/types/core/appearance/DensityRegistry.d.ts +36 -0
  83. package/dist/types/core/appearance/ResolvedAppearanceSnapshot.d.ts +84 -0
  84. package/dist/types/core/appearance/TextureRegistry.d.ts +32 -0
  85. package/dist/types/core/appearance/ThemeMetaRegistry.d.ts +67 -0
  86. package/dist/types/core/appearance/axisAdapters.d.ts +37 -0
  87. package/dist/types/core/appearance/defaults.d.ts +10 -0
  88. package/dist/types/core/appearance/index.d.ts +20 -0
  89. package/dist/types/core/appearance/tokenCatalog.d.ts +30 -0
  90. package/dist/types/core/cf/CFEngine.d.ts +56 -0
  91. package/dist/types/core/cf/CFEvaluator.d.ts +24 -0
  92. package/dist/types/core/cf/CFRule.d.ts +127 -0
  93. package/dist/types/core/cf/ColorScale.d.ts +49 -0
  94. package/dist/types/core/cf/InkResolver.d.ts +33 -0
  95. package/dist/types/core/cf/appearance.d.ts +20 -0
  96. package/dist/types/core/cf/encoders.d.ts +61 -0
  97. package/dist/types/core/cf/eval-types.d.ts +93 -0
  98. package/dist/types/core/cf/index.d.ts +21 -0
  99. package/dist/types/core/cf/lineage.d.ts +32 -0
  100. package/dist/types/core/cf/predicates.d.ts +27 -0
  101. package/dist/types/core/cf/serialize.d.ts +46 -0
  102. package/dist/types/core/chart/CanvasAdapter.d.ts +50 -1
  103. package/dist/types/core/chart/DataExtractor.d.ts +53 -12
  104. package/dist/types/core/chart/a11y.d.ts +22 -0
  105. package/dist/types/core/chart/chart-type-registry.d.ts +53 -0
  106. package/dist/types/core/chart/downsample-report.d.ts +36 -0
  107. package/dist/types/core/chart/downsample.d.ts +26 -1
  108. package/dist/types/core/chart/engine/ChartEngineRegistry.d.ts +52 -0
  109. package/dist/types/core/chart/geometry.d.ts +96 -0
  110. package/dist/types/core/chart/hittest.d.ts +21 -3
  111. package/dist/types/core/chart/palette.d.ts +96 -12
  112. package/dist/types/core/chart/parity.d.ts +12 -0
  113. package/dist/types/core/chart/provenance.d.ts +47 -0
  114. package/dist/types/core/chart/scales.d.ts +28 -1
  115. package/dist/types/core/chart/scene.d.ts +102 -0
  116. package/dist/types/core/chart/server.d.ts +36 -0
  117. package/dist/types/core/chart/surfaces/CanvasSurface.d.ts +48 -0
  118. package/dist/types/core/chart/surfaces/ServerRasterSurface.d.ts +26 -0
  119. package/dist/types/core/chart/surfaces/SvgSurface.d.ts +24 -0
  120. package/dist/types/core/chart/surfaces/pattern-overlay.d.ts +24 -0
  121. package/dist/types/core/chart/types.d.ts +107 -10
  122. package/dist/types/core/command/CommandBus.d.ts +51 -0
  123. package/dist/types/core/command/CommandRegistry.d.ts +43 -0
  124. package/dist/types/core/command/CommandStack.d.ts +38 -0
  125. package/dist/types/core/command/ICommand.d.ts +110 -0
  126. package/dist/types/core/command/commands/CellWriteCommand.d.ts +32 -0
  127. package/dist/types/core/command/commands/CompositeCommand.d.ts +17 -0
  128. package/dist/types/core/command/commands/RowCommands.d.ts +39 -0
  129. package/dist/types/core/command/index.d.ts +9 -0
  130. package/dist/types/core/command/support.d.ts +51 -0
  131. package/dist/types/core/coordinate/ColumnMetrics.d.ts +30 -0
  132. package/dist/types/core/coordinate/CoordinateKernel.d.ts +88 -0
  133. package/dist/types/core/coordinate/FrozenPanes.d.ts +29 -0
  134. package/dist/types/core/coordinate/MergeSourceAdapter.d.ts +18 -0
  135. package/dist/types/core/coordinate/NodeBudget.d.ts +33 -0
  136. package/dist/types/core/coordinate/ResizeGovernor.d.ts +50 -0
  137. package/dist/types/core/coordinate/RowMetrics.d.ts +37 -0
  138. package/dist/types/core/coordinate/ViewPermutation.d.ts +23 -0
  139. package/dist/types/core/coordinate/index.d.ts +10 -0
  140. package/dist/types/core/coordinate/ports.d.ts +45 -0
  141. package/dist/types/core/coordinate/types.d.ts +76 -0
  142. package/dist/types/core/detail/DetailGlyph.d.ts +42 -7
  143. package/dist/types/core/detail/DetailSplice.d.ts +42 -11
  144. package/dist/types/core/detail/DetailState.d.ts +80 -11
  145. package/dist/types/core/detail/SubgridCache.d.ts +72 -10
  146. package/dist/types/core/detail/index.d.ts +8 -0
  147. package/dist/types/core/domain/AggregateResult.d.ts +54 -0
  148. package/dist/types/core/domain/CellAddress.d.ts +61 -0
  149. package/dist/types/core/domain/CellValueAccess.d.ts +29 -0
  150. package/dist/types/core/domain/Delta.d.ts +37 -0
  151. package/dist/types/core/domain/DomainValue.d.ts +80 -0
  152. package/dist/types/core/domain/Missing.d.ts +65 -0
  153. package/dist/types/core/domain/Money.d.ts +42 -0
  154. package/dist/types/core/domain/NormalizationBasis.d.ts +47 -0
  155. package/dist/types/core/domain/Plain.d.ts +45 -0
  156. package/dist/types/core/domain/Quantity.d.ts +32 -0
  157. package/dist/types/core/domain/Ratios.d.ts +100 -0
  158. package/dist/types/core/domain/ThresholdSet.d.ts +46 -0
  159. package/dist/types/core/domain/ValueType.d.ts +71 -0
  160. package/dist/types/core/domain/rounding.d.ts +25 -0
  161. package/dist/types/core/domain/strategies.d.ts +38 -0
  162. package/dist/types/core/editors/CellEditor.d.ts +29 -2
  163. package/dist/types/core/editors/DateEditor.d.ts +18 -0
  164. package/dist/types/core/editors/SelectEditor.d.ts +29 -0
  165. package/dist/types/core/export/ChannelRegistry.d.ts +18 -0
  166. package/dist/types/core/export/ExportManifest.d.ts +13 -0
  167. package/dist/types/core/export/GridArtifactSource.d.ts +62 -0
  168. package/dist/types/core/export/Provenance.d.ts +34 -0
  169. package/dist/types/core/export/StreamPump.d.ts +28 -0
  170. package/dist/types/core/export/channels/CsvChannel.d.ts +20 -0
  171. package/dist/types/core/export/channels/JsonChannel.d.ts +18 -0
  172. package/dist/types/core/export/channels/XlsxChannel.d.ts +53 -0
  173. package/dist/types/core/export/channels/XmlChannel.d.ts +21 -0
  174. package/dist/types/core/export/channels/capabilities.d.ts +13 -0
  175. package/dist/types/core/export/index.d.ts +24 -0
  176. package/dist/types/core/export/print/OutputChannelAdapter.d.ts +61 -0
  177. package/dist/types/core/export/print/Paginator.d.ts +48 -0
  178. package/dist/types/core/export/print/PrintRenderTarget.d.ts +36 -0
  179. package/dist/types/core/export/sinks.d.ts +40 -0
  180. package/dist/types/core/export/types.d.ts +211 -0
  181. package/dist/types/core/extension/DeprecationManager.d.ts +42 -0
  182. package/dist/types/core/extension/IExtension.d.ts +90 -0
  183. package/dist/types/core/extension/Registry.d.ts +142 -0
  184. package/dist/types/core/extension/SlotRegistry.d.ts +46 -0
  185. package/dist/types/core/extension/adapters.d.ts +44 -0
  186. package/dist/types/core/extension/conformance.d.ts +47 -0
  187. package/dist/types/core/extension/index.d.ts +16 -0
  188. package/dist/types/core/extension/registries.d.ts +31 -0
  189. package/dist/types/core/extension/reserved.d.ts +10 -0
  190. package/dist/types/core/format/DisplayFormatter.d.ts +47 -0
  191. package/dist/types/core/format/FormatCache.d.ts +20 -0
  192. package/dist/types/core/format/FormatterRegistry.d.ts +22 -0
  193. package/dist/types/core/format/grammar/AstRenderer.d.ts +10 -0
  194. package/dist/types/core/format/grammar/FormatCompiler.d.ts +16 -0
  195. package/dist/types/core/format/index.d.ts +55 -0
  196. package/dist/types/core/format/pipeline/DomainTypeResolver.d.ts +8 -0
  197. package/dist/types/core/format/pipeline/LocaleFormat.d.ts +11 -0
  198. package/dist/types/core/format/pipeline/ValueInterpreter.d.ts +8 -0
  199. package/dist/types/core/format/policy/MaskPolicy.d.ts +8 -0
  200. package/dist/types/core/format/policy/NegativePolicy.d.ts +12 -0
  201. package/dist/types/core/format/policy/NullPolicy.d.ts +10 -0
  202. package/dist/types/core/format/policy/TruncatePolicy.d.ts +11 -0
  203. package/dist/types/core/format/types.d.ts +292 -0
  204. package/dist/types/core/formula/CalcCacheStore.d.ts +89 -0
  205. package/dist/types/core/formula/CalcProvenance.d.ts +44 -0
  206. package/dist/types/core/formula/CalcService.d.ts +137 -0
  207. package/dist/types/core/formula/CyclePathReporter.d.ts +28 -0
  208. package/dist/types/core/formula/FormulaEvaluator.d.ts +35 -1
  209. package/dist/types/core/formula/FormulaGraph.d.ts +84 -7
  210. package/dist/types/core/formula/FormulaParser.d.ts +9 -0
  211. package/dist/types/core/formula/FormulaStore.d.ts +63 -1
  212. package/dist/types/core/formula/FunctionRegistry.d.ts +138 -0
  213. package/dist/types/core/formula/Generation.d.ts +86 -0
  214. package/dist/types/core/formula/RecalcCoordinator.d.ts +151 -9
  215. package/dist/types/core/formula/ReferenceRewriter.d.ts +81 -0
  216. package/dist/types/core/formula/functions/essential.d.ts +3 -0
  217. package/dist/types/core/formula/functions/extended/index.d.ts +10 -0
  218. package/dist/types/core/formula/normalizeRefs.d.ts +34 -3
  219. package/dist/types/core/formula/numericLiteral.d.ts +11 -1
  220. package/dist/types/core/formula/serializeFormula.d.ts +10 -1
  221. package/dist/types/core/formula/types.d.ts +71 -8
  222. package/dist/types/core/host/CapabilityRegistry.d.ts +61 -0
  223. package/dist/types/core/host/GridHostDriver.d.ts +27 -0
  224. package/dist/types/core/host/GridHostPort.d.ts +37 -0
  225. package/dist/types/core/host/SliceOwnershipGuard.d.ts +27 -0
  226. package/dist/types/core/host/archCheck.d.ts +26 -0
  227. package/dist/types/core/host/index.d.ts +6 -0
  228. package/dist/types/core/host/reconcile.d.ts +22 -0
  229. package/dist/types/core/i18n/LocaleContext.d.ts +40 -0
  230. package/dist/types/core/i18n/types.d.ts +26 -1
  231. package/dist/types/core/icons/bootstrap-icons.d.ts +4 -2
  232. package/dist/types/core/quality/ContrastAuditor.d.ts +64 -0
  233. package/dist/types/core/quality/DeterminismKernel.d.ts +68 -0
  234. package/dist/types/core/quality/PerfBaseline.d.ts +23 -0
  235. package/dist/types/core/quality/PerfSpec.d.ts +95 -0
  236. package/dist/types/core/quality/RealBrowserGate.d.ts +69 -0
  237. package/dist/types/core/quality/RegressionJudge.d.ts +35 -0
  238. package/dist/types/core/quality/ReleaseGate.d.ts +94 -0
  239. package/dist/types/core/quality/VisualRegression.d.ts +74 -0
  240. package/dist/types/core/quality/hooks.d.ts +53 -0
  241. package/dist/types/core/quality/index.d.ts +20 -0
  242. package/dist/types/core/quality/pixelMetrics.d.ts +24 -0
  243. package/dist/types/core/range/ClipboardCodec.d.ts +46 -4
  244. package/dist/types/core/range/FillEngine.d.ts +69 -9
  245. package/dist/types/core/range/RangeModel.d.ts +100 -13
  246. package/dist/types/core/range/RangeQuery.d.ts +24 -2
  247. package/dist/types/core/range/types.d.ts +27 -11
  248. package/dist/types/core/realtime/BackpressureScheduler.d.ts +0 -0
  249. package/dist/types/core/realtime/FreshnessClock.d.ts +34 -0
  250. package/dist/types/core/realtime/IRealtimeSource.d.ts +82 -0
  251. package/dist/types/core/realtime/LiveStateGuard.d.ts +23 -0
  252. package/dist/types/core/realtime/PollingSource.d.ts +42 -0
  253. package/dist/types/core/realtime/RealtimeController.d.ts +54 -0
  254. package/dist/types/core/realtime/RtAnnouncePolicy.d.ts +53 -0
  255. package/dist/types/core/realtime/RtApplyCommand.d.ts +29 -0
  256. package/dist/types/core/realtime/RtChartTargetTrigger.d.ts +26 -0
  257. package/dist/types/core/realtime/StreamingSource.d.ts +47 -0
  258. package/dist/types/core/realtime/backoff.d.ts +12 -0
  259. package/dist/types/core/realtime/index.d.ts +13 -0
  260. package/dist/types/core/realtime/ports.d.ts +80 -0
  261. package/dist/types/core/render/CellApplier.d.ts +18 -0
  262. package/dist/types/core/render/CellErrorBoundary.d.ts +65 -0
  263. package/dist/types/core/render/CellPipeline.d.ts +39 -0
  264. package/dist/types/core/render/CellRenderRequest.d.ts +209 -0
  265. package/dist/types/core/render/CellStageRegistry.d.ts +53 -0
  266. package/dist/types/core/render/OverlayCompositor.d.ts +38 -0
  267. package/dist/types/core/render/RenderBudget.d.ts +67 -0
  268. package/dist/types/core/render/contrast.d.ts +33 -0
  269. package/dist/types/core/render/index.d.ts +35 -0
  270. package/dist/types/core/render/stages/BackgroundStage.d.ts +14 -0
  271. package/dist/types/core/render/stages/DecoratorStage.d.ts +12 -0
  272. package/dist/types/core/render/stages/OverlayStage.d.ts +12 -0
  273. package/dist/types/core/render/stages/ValueRendererStage.d.ts +15 -0
  274. package/dist/types/core/render/stages/index.d.ts +14 -0
  275. package/dist/types/core/renderers/CellRenderer.d.ts +100 -8
  276. package/dist/types/core/state/AutosaveController.d.ts +63 -0
  277. package/dist/types/core/state/IStatePersistence.d.ts +59 -0
  278. package/dist/types/core/state/MultiTabGuard.d.ts +33 -0
  279. package/dist/types/core/state/SchemaMigrator.d.ts +33 -0
  280. package/dist/types/core/state/SemVerPolicy.d.ts +39 -0
  281. package/dist/types/core/state/StateCodec.d.ts +75 -0
  282. package/dist/types/core/state/index.d.ts +6 -0
  283. package/dist/types/core/types.d.ts +17 -0
  284. package/dist/types/react/OpenGrid.d.ts +54 -0
  285. package/dist/types/react/index.d.ts +5 -0
  286. package/dist/types/realtime/index.d.ts +1 -0
  287. package/dist/types/vue/index.d.ts +5 -0
  288. package/dist/types/vue/types.d.ts +35 -0
  289. package/dist/xlsx.min-BQ1o3sB6.cjs +11793 -0
  290. package/dist/{xlsx.min-Wavxcamn.js → xlsx.min-Bbz2ZypC.js} +453 -566
  291. package/package.json +112 -110
  292. package/dist/OpenGrid-B0Spm0rU.js +0 -10404
  293. package/dist/OpenGrid-CuXj0isp.cjs +0 -97
  294. package/dist/xlsx.min-Bx-LxWOf.cjs +0 -138
@@ -1,10 +1,15 @@
1
1
  /**
2
2
  * SubgridCache — F2 임베드 서브그리드(디테일 인스턴스) 생명주기 관리 (헤드리스, DOM 비접촉).
3
+ * / SubgridCache — lifecycle management for F2 embedded subgrids (detail instances) (headless, no DOM contact).
3
4
  *
4
5
  * 계약 근거:
5
6
  * - docs/design/grid-features-2026-07/11_design_F2_v2.md §3.1(DetailEntry: host/instance/built),
6
7
  * §5(Mount-once + detached 캐시 + 편집중 skip-rebuild — MCCONNELL-04 해소),
7
8
  * §5(5)(collapse: cache!==true 면 destroy, cache:true 면 host 캐시 유지)
9
+ * / Contract basis:
10
+ * - 11_design_F2_v2.md §3.1 (DetailEntry: host/instance/built), §5 (mount-once + detached cache +
11
+ * skip-rebuild while editing — resolves review item MCCONNELL-04), §5(5) (collapse: destroy when cache!==true,
12
+ * keep host cached when cache:true)
8
13
  *
9
14
  * 핵심 의미론(§5 "핵심 통찰"): `_body.innerHTML=''`(GridRenderer 매 렌더 teardown, CON-2)는
10
15
  * "삭제"가 아니라 "분리"다. 이 클래스는 그 통찰을 **mount-once ≠ detach ≠ delete** 3단계로
@@ -12,62 +17,119 @@
12
17
  * 1) mount-once — rowId 당 `adapter.create` 는 정확히 1회만 호출(getOrCreate).
13
18
  * 2) detach/reattach — 매 렌더 teardown/재조립을 생존(파괴 아님, DOM 이동일 뿐).
14
19
  * 3) destroy — collapse(cache:false) 또는 그리드 destroy 시에만 실제 정리.
20
+ * / Core semantics (§5 "key insight"): `_body.innerHTML=''` (GridRenderer teardown every render, CON-2) is
21
+ * "detach", not "delete". This class models that insight as three stages **mount-once ≠ detach ≠ delete**:
22
+ * 1) mount-once — `adapter.create` is called exactly once per rowId (getOrCreate).
23
+ * 2) detach/reattach — survives every-render teardown/reassembly (not destruction, just DOM movement).
24
+ * 3) destroy — real cleanup only on collapse(cache:false) or grid destroy.
15
25
  *
16
26
  * 이 클래스는 DOM 을 직접 만들거나 조작하지 않는다 — 호스트 생성(`hostFactory`)과 실제 마운트/해제
17
27
  * 동작은 전부 `SubgridAdapter` 주입 인터페이스 뒤로 위임한다(렌더 배선 단계가 실 DOM/자식 OpenGrid를
18
28
  * 연결). §5(4) 편집중 skip-rebuild 훅 자리는 `isEditing()` 로 자리만 마련해 둔다(Phase1 배선 대상).
29
+ * / This class never creates or manipulates DOM directly — host creation (`hostFactory`) and the actual
30
+ * mount/unmount actions are all delegated behind the injected `SubgridAdapter` interface (the render-wiring stage
31
+ * connects real DOM / child OpenGrid). The §5(4) skip-rebuild-while-editing hook slot is only stubbed via
32
+ * `isEditing()` (a Phase-1 wiring target).
19
33
  */
20
- /** 서브그리드(또는 임의 렌더러 산출물) 생명주기 훅 — DOM 조작은 이 어댑터 구현체 책임. */
34
+ /** 서브그리드(또는 임의 렌더러 산출물) 생명주기 훅 — DOM 조작은 이 어댑터 구현체 책임. / Lifecycle hooks for a subgrid (or any renderer output) — DOM manipulation is this adapter implementation's responsibility. */
21
35
  export interface SubgridAdapter<T = any> {
22
- /** rowId 당 정확히 1회 호출(§5 mount-once). host 는 영속 div(재렌더 생존, DetailManager.getDetailHost 산출물). */
36
+ /** rowId 당 정확히 1회 호출(§5 mount-once). host 는 영속 div(재렌더 생존, DetailManager.getDetailHost 산출물). / Called exactly once per rowId (§5 mount-once). host is a persistent div (survives re-render, output of DetailManager.getDetailHost). */
23
37
  create(rowId: string, host: HTMLElement): T;
24
- /** teardown 직전: host 를 문서에서 분리하되 instance 는 파괴하지 않는다(§5 "분리≠삭제"). */
38
+ /** teardown 직전: host 를 문서에서 분리하되 instance 는 파괴하지 않는다(§5 "분리≠삭제"). / Just before teardown: detach the host from the document but do not destroy the instance (§5 "detach ≠ delete"). */
25
39
  detach(instance: T, host: HTMLElement): void;
26
- /** 재조립 시: 동일 host/instance 를 새 패널 wrapper 에 재부착. */
40
+ /** 재조립 시: 동일 host/instance 를 새 패널 wrapper 에 재부착. / On reassembly: reattach the same host/instance to the new panel wrapper. */
27
41
  reattach(instance: T, host: HTMLElement): void;
28
- /** collapse(cache:false) 또는 그리드 destroy 시에만 호출 — 실제 정리(EC-9). */
42
+ /** collapse(cache:false) 또는 그리드 destroy 시에만 호출 — 실제 정리(EC-9). / Called only on collapse(cache:false) or grid destroy — real cleanup (EC-9). */
29
43
  destroy(instance: T, host: HTMLElement): void;
30
44
  }
45
+ /** remove() 정책 옵션. / Policy options for remove(). */
31
46
  export interface RemoveOptions {
32
- /** masterDetail.cache. true 면 destroy 대신 detach 만 하고 entry 를 유지(재펼침 시 재사용, §5(5)). */
47
+ /** masterDetail.cache. true 면 destroy 대신 detach 만 하고 entry 를 유지(재펼침 시 재사용, §5(5)). / masterDetail.cache. When true, only detaches (no destroy) and keeps the entry for reuse on re-expand (§5(5)). */
33
48
  cache?: boolean;
34
49
  }
50
+ /**
51
+ * rowId → 디테일 인스턴스/host 캐시. mount-once/detach/destroy 3단계 생명주기를 강제한다.
52
+ * / rowId → detail instance/host cache. Enforces the three-stage mount-once/detach/destroy lifecycle.
53
+ *
54
+ * @typeParam T - 서브그리드 인스턴스 타입 / Subgrid instance type
55
+ */
35
56
  export declare class SubgridCache<T = any> {
36
57
  private adapter;
37
58
  private _entries;
59
+ /**
60
+ * @param adapter - 실제 DOM 마운트/해제를 담당하는 어댑터 / Adapter responsible for the actual DOM mount/unmount
61
+ */
38
62
  constructor(adapter: SubgridAdapter<T>);
63
+ /** 캐시된 entry 수. / Number of cached entries. */
39
64
  get size(): number;
65
+ /**
66
+ * rowId 에 대한 entry 존재 여부. / Whether an entry exists for the rowId.
67
+ * @param rowId - stable rowId / stable rowId
68
+ * @returns entry 존재 여부 / Whether an entry exists
69
+ */
40
70
  has(rowId: string): boolean;
41
71
  /**
42
72
  * 최초 펼침: `hostFactory()` 로 영속 host 를 만들고 `adapter.create` 를 **정확히 1회** 호출한다.
43
73
  * 이미 캐시돼 있으면(재펼침, cache:true 로 남아있던 entry) 기존 entry 를 그대로 반환 — create
44
74
  * 재호출 없음(mount-once 보장의 핵심 단언 지점).
75
+ * / First expand: creates a persistent host via `hostFactory()` and calls `adapter.create` **exactly once**.
76
+ * If already cached (re-expand, an entry kept via cache:true) returns the existing entry as-is — no create
77
+ * re-call (the key assertion point of the mount-once guarantee).
78
+ *
79
+ * @param rowId - stable rowId / stable rowId
80
+ * @param hostFactory - 영속 host 요소 생성 팩토리 / Factory that creates the persistent host element
81
+ * @returns { host, instance } 쌍 / The { host, instance } pair
45
82
  */
46
83
  getOrCreate(rowId: string, hostFactory: () => HTMLElement): {
47
84
  host: HTMLElement;
48
85
  instance: T;
49
86
  };
50
- /** 매 renderBody 재조립 시: 이미 분리돼 있던 entry 만 재부착(파괴됐던 적 없음, §5 핵심 통찰). */
87
+ /**
88
+ * 매 renderBody 재조립 시: 이미 분리돼 있던 entry 만 재부착(파괴됐던 적 없음, §5 핵심 통찰).
89
+ * / On each renderBody reassembly: reattach only entries that were detached (never destroyed, §5 key insight).
90
+ * @param rowId - stable rowId / stable rowId
91
+ * @returns 재부착이 실제로 일어났는지 여부 / Whether a reattach actually occurred
92
+ */
51
93
  reattach(rowId: string): boolean;
52
- /** teardown 직전 분리 표시. entry 는 Map 에 남아 GC 되지 않는다(참조 유지 = 생존, §5 핵심 통찰). */
94
+ /**
95
+ * teardown 직전 분리 표시. entry 는 Map 에 남아 GC 되지 않는다(참조 유지 = 생존, §5 핵심 통찰).
96
+ * / Mark as detached just before teardown. The entry remains in the Map and is not GC'd (keeping the reference = survival, §5 key insight).
97
+ * @param rowId - stable rowId / stable rowId
98
+ * @returns 분리가 실제로 일어났는지 여부 / Whether a detach actually occurred
99
+ */
53
100
  detach(rowId: string): boolean;
54
- /** 부모 renderBody 진입 시 전체 teardown 흉내(호출자가 skip-rebuild 대상은 미리 걸러 호출). */
101
+ /** 부모 renderBody 진입 시 전체 teardown 흉내(호출자가 skip-rebuild 대상은 미리 걸러 호출). / Mimic a full teardown on parent renderBody entry (the caller pre-filters skip-rebuild targets before calling). */
55
102
  detachAll(): void;
56
103
  /**
57
104
  * collapse 시 정책 분기(§5(5)): `cache:true` 면 destroy 없이 detach 만(재펼침 시 getOrCreate 가
58
105
  * 재사용). 기본(`cache` 미지정/false)이면 `adapter.destroy` 후 entry 제거(EC-9 누수 차단).
106
+ * / Policy branch on collapse (§5(5)): with `cache:true`, only detaches without destroy (getOrCreate reuses it on
107
+ * re-expand). By default (`cache` unset/false), calls `adapter.destroy` then removes the entry (EC-9 leak prevention).
108
+ * @param rowId - stable rowId / stable rowId
109
+ * @param opts - cache 유지 여부 옵션 / Option for whether to keep the cache
59
110
  */
60
111
  remove(rowId: string, opts?: RemoveOptions): void;
112
+ /** rowId 의 인스턴스 반환(없으면 undefined). / Return the instance for rowId (undefined if none). */
61
113
  getInstance(rowId: string): T | undefined;
114
+ /** rowId 의 host 요소 반환(없으면 undefined). / Return the host element for rowId (undefined if none). */
62
115
  getHost(rowId: string): HTMLElement | undefined;
116
+ /** rowId 가 현재 부착 상태인지 여부. / Whether rowId is currently attached. */
63
117
  isAttached(rowId: string): boolean;
64
118
  /**
65
119
  * §5(4) 편집중 skip-rebuild 훅 자리(Phase1, FR-8/NFR-2). 렌더 배선 단계에서 자식 인스턴스가
66
120
  * `isEditing()` 같은 판정을 노출하면 `isEditingFn` 으로 주입해 teardown 대상에서 제외(hoist)할지
67
121
  * 판단하는 데 쓴다. 헤드리스 단계에서는 판정 위임만 제공하고 실제 hoist/원복 로직은 GridRenderer
68
122
  * 배선이 담당한다.
123
+ * / §5(4) skip-rebuild-while-editing hook slot (Phase 1, FR-8/NFR-2). At the render-wiring stage, if the child
124
+ * instance exposes a predicate like `isEditing()`, inject it via `isEditingFn` to decide whether to exclude
125
+ * (hoist) it from teardown. In the headless stage this only provides predicate delegation; the actual
126
+ * hoist/restore logic belongs to the GridRenderer wiring.
127
+ *
128
+ * @param rowId - stable rowId / stable rowId
129
+ * @param isEditingFn - 인스턴스 편집중 판정 콜백(미주입 시 항상 false) / Callback deciding whether the instance is editing (always false if not injected)
130
+ * @returns 편집중 여부 / Whether it is editing
69
131
  */
70
132
  isEditing(rowId: string, isEditingFn?: (instance: T) => boolean): boolean;
71
- /** 부모 destroy(EC-9) 또는 collapseAllDetails 시: 남은 전 인스턴스 정리, 누수 차단. */
133
+ /** 부모 destroy(EC-9) 또는 collapseAllDetails 시: 남은 전 인스턴스 정리, 누수 차단. / On parent destroy (EC-9) or collapseAllDetails: clean up all remaining instances, prevent leaks. */
72
134
  destroyAll(): void;
73
135
  }
@@ -1,12 +1,20 @@
1
1
  /**
2
2
  * src/core/detail — F2 마스터/디테일 헤드리스 코어 배럴.
3
+ * / src/core/detail — barrel for the F2 master/detail headless core.
4
+ *
3
5
  * 계약: docs/design/grid-features-2026-07/11_design_F2_v2.md, 15_cross_contracts.md
6
+ * / Contracts: 11_design_F2_v2.md, 15_cross_contracts.md
4
7
  *
5
8
  * 후속 배선(미포함, 이 디렉터리 범위 밖):
6
9
  * - GridRenderer.renderBody 의 `_isDetailHead`/`_isDetailFiller` 분기 + full-width 패널 절대배치
7
10
  * - VirtualScroll.setTotalRows 에 detail 슬롯 반영(spliceDetails 결과 길이)
8
11
  * - FlatRowModel.registerSplice(spliceDetails 어댑터) 연결
9
12
  * - OpenGrid 의 expander 셀 렌더(DetailGlyph 소비) + expandRow/collapseRow/toggleRow API 배선
13
+ * / Downstream wiring (not included, outside this directory's scope):
14
+ * - GridRenderer.renderBody `_isDetailHead`/`_isDetailFiller` branching + absolute-positioned full-width panels
15
+ * - Reflecting detail slots into VirtualScroll.setTotalRows (length of the spliceDetails result)
16
+ * - Connecting FlatRowModel.registerSplice (the spliceDetails adapter)
17
+ * - OpenGrid expander-cell rendering (consuming DetailGlyph) + expandRow/collapseRow/toggleRow API wiring
10
18
  */
11
19
  export * from './DetailState.js';
12
20
  export * from './DetailSplice.js';
@@ -0,0 +1,54 @@
1
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
2
+ import { ValueType } from './ValueType.js';
3
+ /** 집계 함수 이름. / Aggregation function name. */
4
+ export type AggregateFn = 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'COUNT' | 'WMEAN' | (string & {});
5
+ /** 결측 처리 방식. / Missing-handling mode. */
6
+ export type MissingHandling = 'excluded' | 'included';
7
+ /** 모집단 스코프. / Population scope. */
8
+ export type Population = 'all' | 'filtered' | 'visible' | 'selection';
9
+ /**
10
+ * 집계 결과(REQ-T2-806) — 문맥(함수·표본수·단위·결측처리·모집단)을 함께 고지.
11
+ * / Aggregate result carrying its computation context.
12
+ */
13
+ export interface AggregateResult extends DomainValue {
14
+ readonly fn: AggregateFn;
15
+ readonly value: DomainValue;
16
+ readonly n: number;
17
+ readonly unit: string;
18
+ readonly missingHandling: MissingHandling;
19
+ readonly population: Population;
20
+ }
21
+ /** AggregateResult 구성 인자. / Fields to construct an aggregate result. */
22
+ export interface AggregateResultInit {
23
+ fn: AggregateFn;
24
+ value: DomainValue;
25
+ n: number;
26
+ unit: string;
27
+ missingHandling: MissingHandling;
28
+ population: Population;
29
+ }
30
+ /**
31
+ * 기본 집계 결과 구현. / Concrete aggregate-result value object.
32
+ */
33
+ export declare class BasicAggregateResult implements AggregateResult {
34
+ readonly kind = "aggregate";
35
+ readonly fn: AggregateFn;
36
+ readonly value: DomainValue;
37
+ readonly n: number;
38
+ readonly unit: string;
39
+ readonly missingHandling: MissingHandling;
40
+ readonly population: Population;
41
+ private constructor();
42
+ static of(init: AggregateResultInit): BasicAggregateResult;
43
+ get type(): ValueType;
44
+ isMissing(): boolean;
45
+ isError(): boolean;
46
+ isBlank(): boolean;
47
+ equals(other: DomainValue): boolean;
48
+ hashKey(): string;
49
+ compareTo(other: DomainValue): number;
50
+ textEquivalent(locale?: string): string;
51
+ toJSON(): DomainValueDTO;
52
+ }
53
+ /** AggregateResult 값 타입. / ValueType for aggregate. */
54
+ export declare const aggregateType: ValueType;
@@ -0,0 +1,61 @@
1
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
2
+ import { ValueType } from './ValueType.js';
3
+ /**
4
+ * 셀 주소 값 객체(REQ-T8-808). / Cell address value object.
5
+ */
6
+ export declare class CellAddress implements DomainValue {
7
+ readonly row: number;
8
+ readonly col: number;
9
+ readonly kind = "cellAddress";
10
+ private constructor();
11
+ /** 논리 주소 생성(음수 → 0 클램프). / Construct a logical address (negatives clamp to 0). */
12
+ static of(row: number, col: number): CellAddress;
13
+ /** "B3" → (row=2, col=1). / Parse an A1 reference. */
14
+ static parseA1(a1: string): CellAddress;
15
+ /** A1 표기(예: "B3"). / A1 notation. */
16
+ toA1(): string;
17
+ /** R1C1 표기(예: "R3C2"). / R1C1 notation. */
18
+ toR1C1(): string;
19
+ get type(): ValueType;
20
+ isMissing(): boolean;
21
+ isError(): boolean;
22
+ isBlank(): boolean;
23
+ equals(other: DomainValue): boolean;
24
+ hashKey(): string;
25
+ /** 행 우선, 그다음 열. / Row-major then column. */
26
+ compareTo(other: DomainValue): number;
27
+ textEquivalent(_locale?: string): string;
28
+ toJSON(): DomainValueDTO;
29
+ }
30
+ /**
31
+ * 셀 범위 값 객체(REQ-T8-808) — 정규화 불변식 보증(항상 start≤end).
32
+ * / Cell range value object; always normalized so start ≤ end.
33
+ */
34
+ export declare class CellRange implements DomainValue {
35
+ readonly start: CellAddress;
36
+ readonly end: CellAddress;
37
+ readonly kind = "cellRange";
38
+ private constructor();
39
+ /** 역방향 드래그를 (min→max)로 자동 정규화. / Normalize a reversed drag to (min→max). */
40
+ static of(a: CellAddress, b: CellAddress): CellRange;
41
+ get type(): ValueType;
42
+ isMissing(): boolean;
43
+ isError(): boolean;
44
+ isBlank(): boolean;
45
+ /** 주소 포함 여부. / Whether an address lies within the range. */
46
+ contains(addr: CellAddress): boolean;
47
+ /** 범위 교차 여부(병합 비중첩 검사용). / Whether two ranges intersect. */
48
+ intersects(other: CellRange): boolean;
49
+ /** 중첩/인접 범위 집합을 정규형(정렬된 비중첩 집합)으로 환원(REQ-T3-826). / Reduce to a sorted, non-overlapping set. */
50
+ static normalizeSet(ranges: CellRange[]): CellRange[];
51
+ private static _touching;
52
+ equals(other: DomainValue): boolean;
53
+ hashKey(): string;
54
+ compareTo(other: DomainValue): number;
55
+ textEquivalent(_locale?: string): string;
56
+ toJSON(): DomainValueDTO;
57
+ }
58
+ /** CellAddress 값 타입. / ValueType for cellAddress. */
59
+ export declare const cellAddressType: ValueType;
60
+ /** CellRange 값 타입. / ValueType for cellRange. */
61
+ export declare const cellRangeType: ValueType;
@@ -0,0 +1,29 @@
1
+ import { DomainValue } from './DomainValue.js';
2
+ /** 행 참조(안정 rowId 또는 flat 인덱스). / Row reference (stable rowId or flat index). */
3
+ export type RowRef = string | number;
4
+ /** 편집기 진입 시드(raw 로부터 파생). / Editor seed derived from raw. */
5
+ export interface EditorSeed {
6
+ /** 편집기 초기 문자열. / Initial editor string. */
7
+ readonly text: string;
8
+ /** 선택 힌트(select 등). / Optional choice hints. */
9
+ readonly choices?: readonly string[];
10
+ }
11
+ /**
12
+ * 셀 값 3계층 계약(REQ-T6-803). / Cell value 3-layer access contract.
13
+ *
14
+ * @invariant raw 는 항상 DomainValue. display/editor 는 raw 에서 단방향 파생(역참조 금지).
15
+ *
16
+ * ★역참조 금지 불변식:
17
+ * - getDisplay/getEditorSeed 의 반환(문자열/시드)을 다시 계산·집계로 흘리는 API 가 존재하지 않는다.
18
+ * - 계산/집계/차트/정렬/검증은 오직 getRawValue(값 객체)만 소비한다.
19
+ */
20
+ export interface CellValueAccess {
21
+ /** ── 정본(계산·차트·집계·정렬·검증이 소비) ── / Canonical raw value. */
22
+ getRawValue(row: RowRef, field: string): DomainValue;
23
+ /** ── 표시 파생(뷰 전용, DD-04 포맷터가 raw 로부터 산출) ── / Derived display string. */
24
+ getDisplay(row: RowRef, field: string): string;
25
+ /** ── 편집 시드(편집기 진입 값) ── / Editor seed. */
26
+ getEditorSeed(row: RowRef, field: string): EditorSeed;
27
+ /** 편집 커밋 — 원시 입력을 값 객체로 되돌리는 유일 경로(단방향 닫힘). / Commit an edit back into a value object. */
28
+ commitEdit(row: RowRef, field: string, rawInput: unknown): DomainValue;
29
+ }
@@ -0,0 +1,37 @@
1
+ import { OGDecimal, OGDecimalLike } from '../OGDecimal.js';
2
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
3
+ import { ValueType } from './ValueType.js';
4
+ import { GrowthRate, BaseValidity } from './Ratios.js';
5
+ /** 증감 방향. / Change direction. */
6
+ export type DeltaDirection = 'up' | 'down' | 'flat';
7
+ /**
8
+ * 증감 값 객체(REQ-T5-813). / Delta value object.
9
+ */
10
+ export declare class Delta implements DomainValue {
11
+ readonly current: OGDecimal;
12
+ readonly base: OGDecimal;
13
+ readonly direction: DeltaDirection;
14
+ readonly magnitude: OGDecimal;
15
+ readonly baseValidity: BaseValidity;
16
+ readonly kind = "delta";
17
+ private constructor();
18
+ /**
19
+ * 현재·기저·무변화 임계(eps)로 증감 생성. 방향/절대델타/기저적법을 한 곳에서 판정.
20
+ * / Build a delta; direction, magnitude and base validity are decided in one place.
21
+ */
22
+ static from(current: OGDecimalLike, base: OGDecimalLike, eps?: OGDecimalLike): Delta;
23
+ get type(): ValueType;
24
+ isMissing(): boolean;
25
+ isError(): boolean;
26
+ isBlank(): boolean;
27
+ /** 파생 증감률(같은 기저 규칙 재사용). / Derived growth rate (reuses the same base rules). */
28
+ growthRate(): GrowthRate;
29
+ equals(other: DomainValue): boolean;
30
+ hashKey(): string;
31
+ /** 절대델타(magnitude) 순. / Ordered by magnitude. */
32
+ compareTo(other: DomainValue): number;
33
+ textEquivalent(locale?: string): string;
34
+ toJSON(): DomainValueDTO;
35
+ }
36
+ /** Delta 값 타입(레지스트리 등록용). / ValueType for delta. */
37
+ export declare const deltaType: ValueType;
@@ -0,0 +1,80 @@
1
+ import { OGDecimal } from '../OGDecimal.js';
2
+ import { ValueType } from './ValueType.js';
3
+ /**
4
+ * 값 종류 판별자(개방형). 미지 kind 는 원시값 폴백(REQ-TX-831).
5
+ * / Open value-kind discriminant. Unknown kinds fall back to plain values.
6
+ */
7
+ export type ValueKind = 'number' | 'text' | 'money' | 'ratio' | 'percent' | 'percentagePoint' | 'growthRate' | 'delta' | 'quantity' | 'missing' | 'error' | 'normBasis' | 'thresholdSet' | 'aggregate' | 'cellAddress' | 'cellRange' | (string & {});
8
+ /**
9
+ * 값 객체 직렬화 슬라이스(개방형 태그드 유니온). / Serialization slice for a value object.
10
+ * 왕복 스키마·envelope 조립은 DD-09/TX-833 소유. 여기선 최소 형상만 정의.
11
+ */
12
+ export interface DomainValueDTO {
13
+ /** 역직렬화 시 registry.get(kind).parse 로 복원. / Kind used to restore via the registry. */
14
+ readonly kind: ValueKind;
15
+ /** 원시 원값(OGDecimal → 문자열로 정밀 보존). / Raw value (OGDecimal serialized as string). */
16
+ readonly v?: string | number | null;
17
+ /** 값종별 부속(currency·reason·code·unit 등). / Per-kind payload. */
18
+ readonly meta?: Readonly<Record<string, unknown>>;
19
+ }
20
+ /**
21
+ * 값 객체 루트. 불변·자기 도메인 인지·표현 무지(SRP).
22
+ * / Value-object root. Immutable, domain-aware, presentation-agnostic.
23
+ */
24
+ export interface DomainValue {
25
+ /** 개방형 종류 판별자. / Open discriminant. */
26
+ readonly kind: ValueKind;
27
+ /** 소속 ValueType(메타 보유). / The owning ValueType (carries domain meta). */
28
+ readonly type: ValueType;
29
+ /** Missing 인스턴스일 때 true. / true when this is a Missing value. */
30
+ isMissing(): boolean;
31
+ /** ErrorValue 인스턴스일 때 true. / true when this is an ErrorValue. */
32
+ isError(): boolean;
33
+ /** null/none 계열일 때 true(실제 0 은 false). / true for null/none (real 0 is false). */
34
+ isBlank(): boolean;
35
+ /**
36
+ * 구조적 동등성(REQ-T8-843) — 값 동등(참조 아님). / Structural (by-value) equality.
37
+ * a.equals(b) ⟺ a.hashKey()===b.hashKey().
38
+ */
39
+ equals(other: DomainValue): boolean;
40
+ /** 동등성/맵 키용 안정 해시 문자열. / Stable hash string for equality/map keys. */
41
+ hashKey(): string;
42
+ /**
43
+ * 도메인 비교 규칙(REQ-T3-802) — 항상 전순서. / Total-order domain comparison.
44
+ * 3단 층위: kindRank(정상<오류<결측) → kind 그룹키 → 동일 kind 도메인 순서.
45
+ * @returns 음수/0/양수 (this </=/> other).
46
+ */
47
+ compareTo(other: DomainValue): number;
48
+ /**
49
+ * 로케일 인지 텍스트 등가물(REQ-T5-817) — aria 접근성 쌍둥이의 데이터 원천.
50
+ * / Locale-aware text equivalent — data source for the accessible twin (aria).
51
+ */
52
+ textEquivalent(locale?: string): string;
53
+ /** 직렬화 슬라이스. / Serialization slice. */
54
+ toJSON(): DomainValueDTO;
55
+ }
56
+ /** 4-state 값 상태(REQ-TX-832) — 실제 0 을 blank 와 구분. / Four-state value state. */
57
+ export type ValueState = 'value' | 'zero' | 'blank' | 'error';
58
+ /**
59
+ * 값 상태 분류(REQ-TX-832) — 실제 0 을 blank(없음)와 명확히 구분.
60
+ * / Classify a value's state, distinguishing a real zero from a blank/missing value.
61
+ */
62
+ export declare function classifyState(v: DomainValue): ValueState;
63
+ /**
64
+ * 값 객체에서 정밀 수치 원값을 추출(없으면 null). / Extract the precise numeric backing value (or null).
65
+ * NormalizationBasis·ThresholdSet·classifyState 공유. 결측/오류/텍스트는 null.
66
+ */
67
+ export declare function numericOf(v: DomainValue): OGDecimal | null;
68
+ /**
69
+ * kindRank — 전순서 최상위 층(정상<오류<결측). / Top total-order layer: normal < error < missing.
70
+ */
71
+ export declare function kindRank(v: DomainValue): number;
72
+ /**
73
+ * 전순서 사전식 스캐폴드. kindRank → kind 그룹키까지 판정하고,
74
+ * 동일 kind(비교 적합)면 null 을 반환해 호출자가 도메인 순서를 적용한다.
75
+ * / Total-order scaffold. Resolves rank & cross-kind grouping; returns null when
76
+ * the two share a comparable kind so the caller applies the domain ordering.
77
+ */
78
+ export declare function compareByRankAndKind(a: DomainValue, b: DomainValue): number | null;
79
+ /** OGDecimal 3항 비교(-1/0/1). / OGDecimal three-way comparison. */
80
+ export declare function cmpDecimal(a: OGDecimal, b: OGDecimal): number;
@@ -0,0 +1,65 @@
1
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
2
+ import { ValueType } from './ValueType.js';
3
+ /** 결측 사유 5종(REQ-TX-832) — 실제 0 과 구분. / Five missing reasons, distinct from a real zero. */
4
+ export declare enum MissingReason {
5
+ NotApplicable = "na",// 미해당(구조적으로 값이 없음) / structurally not applicable
6
+ NoData = "no-data",// 미수집(있어야 하나 아직 없음) / expected but not yet collected
7
+ Suppressed = "suppressed",// 억제(권한·프라이버시로 가림) / suppressed for privacy/permission
8
+ Calculating = "pending",// 계산 중/미확정 / calculating / not finalized
9
+ Error = "error"
10
+ }
11
+ /** 표준 오류 토큰 셋 — 문자열 아닌 값 객체. / Standard error tokens as a value object, not a string. */
12
+ export declare enum ErrorCode {
13
+ DivZero = "#DIV/0!",
14
+ Ref = "#REF!",
15
+ Value = "#VALUE!",
16
+ Name = "#NAME?",
17
+ NA = "#N/A",
18
+ Num = "#NUM!",
19
+ Cycle = "#CYCLE!"
20
+ }
21
+ /**
22
+ * 결측 값 객체(REQ-TX-832). 사유별 캐시 싱글턴. / Missing value object; cached per reason.
23
+ */
24
+ export declare class Missing implements DomainValue {
25
+ readonly reason: MissingReason;
26
+ readonly kind = "missing";
27
+ private static _cache;
28
+ private constructor();
29
+ /** 사유별 캐시된 싱글턴. / Cached singleton per reason. */
30
+ static of(reason: MissingReason): Missing;
31
+ get type(): ValueType;
32
+ isMissing(): boolean;
33
+ isError(): boolean;
34
+ isBlank(): boolean;
35
+ equals(other: DomainValue): boolean;
36
+ hashKey(): string;
37
+ compareTo(other: DomainValue): number;
38
+ textEquivalent(locale?: string): string;
39
+ toJSON(): DomainValueDTO;
40
+ }
41
+ /**
42
+ * 오류 값 객체 — 표준 오류 토큰(결측·0 과 구분). / Error value object; distinct from missing/zero.
43
+ */
44
+ export declare class ErrorValue implements DomainValue {
45
+ readonly code: ErrorCode;
46
+ readonly detail?: string | undefined;
47
+ readonly kind = "error";
48
+ private constructor();
49
+ static of(code: ErrorCode, detail?: string): ErrorValue;
50
+ get type(): ValueType;
51
+ isMissing(): boolean;
52
+ isError(): boolean;
53
+ isBlank(): boolean;
54
+ /** 오류 전파(산술·집계에서 우선 전파). / Errors propagate through arithmetic/aggregation. */
55
+ propagate(): ErrorValue;
56
+ equals(other: DomainValue): boolean;
57
+ hashKey(): string;
58
+ compareTo(other: DomainValue): number;
59
+ textEquivalent(_locale?: string): string;
60
+ toJSON(): DomainValueDTO;
61
+ }
62
+ /** Missing 값 타입(레지스트리 등록용). / ValueType for missing. */
63
+ export declare const missingType: ValueType;
64
+ /** Error 값 타입(레지스트리 등록용). / ValueType for error. */
65
+ export declare const errorType: ValueType;
@@ -0,0 +1,42 @@
1
+ import { OGDecimal, OGDecimalLike } from '../OGDecimal.js';
2
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
3
+ import { ValueType } from './ValueType.js';
4
+ /** 통화 불일치 산술 오류. / Raised when arithmetic mixes different currencies. */
5
+ export declare class MoneyMismatchError extends Error {
6
+ constructor(a: string, b: string);
7
+ }
8
+ /** 통화별 최소단위 소수자리. / Minor-unit digits for a currency. */
9
+ export declare function minorUnitsOf(currency: string): number;
10
+ /**
11
+ * 통화 값 객체(REQ-T9-838). / Money value object.
12
+ */
13
+ export declare class Money implements DomainValue {
14
+ readonly amount: OGDecimal;
15
+ readonly currency: string;
16
+ readonly minorUnits: number;
17
+ readonly kind = "money";
18
+ private constructor();
19
+ /** 금액+통화로 생성. / Construct from amount and currency. */
20
+ static of(amount: OGDecimalLike, currency: string): Money;
21
+ get type(): ValueType;
22
+ isMissing(): boolean;
23
+ isError(): boolean;
24
+ isBlank(): boolean;
25
+ private _same;
26
+ /** 같은 통화 덧셈(불일치 시 throw). / Add same-currency money (throws on mismatch). */
27
+ add(other: Money): Money;
28
+ /** 같은 통화 뺄셈(불일치 시 throw). / Subtract same-currency money (throws on mismatch). */
29
+ sub(other: Money): Money;
30
+ /** 명시적 환산(레이트 주입) — 통화 교차 산술의 유일 경로. / Explicit conversion via injected rate. */
31
+ convertTo(currency: string, rate: OGDecimalLike): Money;
32
+ /** penny-rounding: 최소단위로 HALF_EVEN 반올림. / Round to the currency's minor unit (banker's). */
33
+ roundToMinorUnit(): Money;
34
+ equals(other: DomainValue): boolean;
35
+ hashKey(): string;
36
+ /** 동일 통화=amount, 다통화=currency 콜레이션 그룹분리 후 amount. / Same currency: by amount; else by currency code then amount. */
37
+ compareTo(other: DomainValue): number;
38
+ textEquivalent(_locale?: string): string;
39
+ toJSON(): DomainValueDTO;
40
+ }
41
+ /** Money 값 타입(레지스트리 등록용). / ValueType for money. */
42
+ export declare const moneyType: ValueType;
@@ -0,0 +1,47 @@
1
+ import { OGDecimal, OGDecimalLike } from '../OGDecimal.js';
2
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
3
+ import { ValueType } from './ValueType.js';
4
+ /** 정규화 스코프. / Normalization scope. */
5
+ export type NormScope = 'row' | 'column' | 'global' | 'selection';
6
+ /** 정규화 앵커. / Normalization anchor. */
7
+ export type NormAnchor = 'zero' | 'min';
8
+ /** 정규화 스케일. / Normalization scale. */
9
+ export type NormScale = 'linear' | 'log';
10
+ /**
11
+ * 정규화 기준 값 객체(REQ-TX-836). / Shared normalization basis for micro-visuals.
12
+ */
13
+ export declare class NormalizationBasis implements DomainValue {
14
+ readonly scope: NormScope;
15
+ readonly min: OGDecimal;
16
+ readonly max: OGDecimal;
17
+ readonly anchor: NormAnchor;
18
+ readonly clamp: boolean;
19
+ readonly scale: NormScale;
20
+ readonly kind = "normBasis";
21
+ private constructor();
22
+ static of(opts: {
23
+ scope: NormScope;
24
+ min: OGDecimalLike;
25
+ max: OGDecimalLike;
26
+ anchor?: NormAnchor;
27
+ clamp?: boolean;
28
+ scale?: NormScale;
29
+ }): NormalizationBasis;
30
+ get type(): ValueType;
31
+ isMissing(): boolean;
32
+ isError(): boolean;
33
+ isBlank(): boolean;
34
+ /**
35
+ * 값 → 0~1 사상(클램프/로그 규칙 내장). 결측/오류는 null(gap).
36
+ * / Project a value to [0,1]; missing/error → null (gap).
37
+ */
38
+ project(v: DomainValue): number | null;
39
+ private _clampT;
40
+ equals(other: DomainValue): boolean;
41
+ hashKey(): string;
42
+ compareTo(other: DomainValue): number;
43
+ textEquivalent(_locale?: string): string;
44
+ toJSON(): DomainValueDTO;
45
+ }
46
+ /** NormalizationBasis 값 타입. / ValueType for normBasis. */
47
+ export declare const normBasisType: ValueType;
@@ -0,0 +1,45 @@
1
+ import { OGDecimal, OGDecimalLike } from '../OGDecimal.js';
2
+ import { DomainValue, DomainValueDTO } from './DomainValue.js';
3
+ import { ValueType } from './ValueType.js';
4
+ /** 일반 숫자 값 객체. / Plain number value object. */
5
+ export declare class PlainNumber implements DomainValue {
6
+ readonly value: OGDecimal;
7
+ readonly kind = "number";
8
+ private constructor();
9
+ static of(value: OGDecimalLike): PlainNumber;
10
+ get type(): ValueType;
11
+ isMissing(): boolean;
12
+ isError(): boolean;
13
+ isBlank(): boolean;
14
+ equals(other: DomainValue): boolean;
15
+ hashKey(): string;
16
+ compareTo(other: DomainValue): number;
17
+ textEquivalent(_locale?: string): string;
18
+ toJSON(): DomainValueDTO;
19
+ }
20
+ /** 일반 텍스트 값 객체. / Plain text value object. */
21
+ export declare class PlainText implements DomainValue {
22
+ readonly value: string;
23
+ readonly kind = "text";
24
+ private constructor();
25
+ static of(value: string): PlainText;
26
+ get type(): ValueType;
27
+ isMissing(): boolean;
28
+ isError(): boolean;
29
+ isBlank(): boolean;
30
+ equals(other: DomainValue): boolean;
31
+ hashKey(): string;
32
+ compareTo(other: DomainValue): number;
33
+ textEquivalent(_locale?: string): string;
34
+ toJSON(): DomainValueDTO;
35
+ }
36
+ /** PlainNumber 값 타입. / ValueType for plain number. */
37
+ export declare const plainNumberType: ValueType;
38
+ /** PlainText 값 타입. / ValueType for plain text. */
39
+ export declare const plainTextType: ValueType;
40
+ /**
41
+ * PLAIN 폴백 값 타입(REQ-TX-831) — 미등록 kind 소비 시 반환.
42
+ * 수치면 PlainNumber, 아니면 PlainText 로 안전 처리.
43
+ * / PLAIN fallback type for unregistered kinds; numeric → PlainNumber, else PlainText.
44
+ */
45
+ export declare const plainType: ValueType;