open-grid 1.2.1 → 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 -365
- package/dist/{OpenGrid-0r_543Kj.cjs → OpenGrid-B7m7ei7f.cjs} +1222 -1029
- package/dist/{OpenGrid-HmhGVC2V.js → OpenGrid-CeUdO_fM.js} +1613 -1418
- package/dist/index-CeJ-0-80.cjs +260 -0
- package/dist/index-DnarQ4eR.js +266 -0
- package/dist/index-DrCPRuYi.js +548 -0
- package/dist/index-JjfWY3Bt.cjs +520 -0
- package/dist/open-grid-base.css +12 -1
- package/dist/open-grid-react.cjs +1 -1
- package/dist/open-grid-react.js +1 -1
- package/dist/open-grid-vue.cjs +7 -7
- package/dist/open-grid-vue.js +2 -2
- package/dist/open-grid.cjs +1 -1
- package/dist/open-grid.js +2 -2
- package/dist/types/bench/perf.d.ts +14 -8
- package/dist/types/core/AppearanceResolver.d.ts +98 -11
- package/dist/types/core/CFRenderBridge.d.ts +13 -0
- package/dist/types/core/CellTypeRegistry.d.ts +24 -0
- package/dist/types/core/ColumnLayout.d.ts +100 -2
- package/dist/types/core/CrossGridMapper.d.ts +43 -5
- package/dist/types/core/DataLayer.d.ts +210 -15
- package/dist/types/core/DragVisuals.d.ts +33 -4
- package/dist/types/core/EventEmitter.d.ts +54 -0
- package/dist/types/core/FormulaEngine.d.ts +15 -4
- package/dist/types/core/GridRenderer.d.ts +143 -10
- package/dist/types/core/GroupEngine.d.ts +68 -10
- package/dist/types/core/MathUtils.d.ts +58 -5
- package/dist/types/core/MergeEngine.d.ts +45 -10
- package/dist/types/core/OGDecimal.d.ts +144 -13
- package/dist/types/core/OpenGrid.d.ts +99 -0
- package/dist/types/core/PivotEngine.d.ts +37 -0
- package/dist/types/core/RowDragDrop.d.ts +52 -6
- package/dist/types/core/SkinRegistry.d.ts +4 -0
- package/dist/types/core/TreeEngine.d.ts +60 -6
- package/dist/types/core/VirtualScroll.d.ts +64 -0
- package/dist/types/core/a11y/AccessibilityAdapter.d.ts +103 -0
- package/dist/types/core/a11y/AriaIntent.d.ts +34 -0
- package/dist/types/core/a11y/KeyboardInteractionModel.d.ts +64 -0
- package/dist/types/core/a11y/LiveRegionController.d.ts +89 -0
- package/dist/types/core/a11y/OverlayStack.d.ts +36 -0
- package/dist/types/core/a11y/VisualEquivRegistry.d.ts +37 -0
- package/dist/types/core/a11y/index.d.ts +13 -0
- package/dist/types/core/a11y/ports.d.ts +24 -0
- package/dist/types/core/appearance/Appearance.d.ts +68 -0
- package/dist/types/core/appearance/AppearanceAxis.d.ts +94 -0
- package/dist/types/core/appearance/AppearanceComposer.d.ts +45 -0
- package/dist/types/core/appearance/AppearanceProvider.d.ts +50 -0
- package/dist/types/core/appearance/AppearanceView.d.ts +51 -0
- package/dist/types/core/appearance/DensityRegistry.d.ts +36 -0
- package/dist/types/core/appearance/ResolvedAppearanceSnapshot.d.ts +84 -0
- package/dist/types/core/appearance/TextureRegistry.d.ts +32 -0
- package/dist/types/core/appearance/ThemeMetaRegistry.d.ts +67 -0
- package/dist/types/core/appearance/axisAdapters.d.ts +37 -0
- package/dist/types/core/appearance/defaults.d.ts +10 -0
- package/dist/types/core/appearance/index.d.ts +20 -0
- package/dist/types/core/appearance/tokenCatalog.d.ts +30 -0
- package/dist/types/core/cf/CFEngine.d.ts +56 -0
- package/dist/types/core/cf/CFEvaluator.d.ts +24 -0
- package/dist/types/core/cf/CFRule.d.ts +127 -0
- package/dist/types/core/cf/ColorScale.d.ts +49 -0
- package/dist/types/core/cf/InkResolver.d.ts +33 -0
- package/dist/types/core/cf/appearance.d.ts +20 -0
- package/dist/types/core/cf/encoders.d.ts +61 -0
- package/dist/types/core/cf/eval-types.d.ts +93 -0
- package/dist/types/core/cf/index.d.ts +21 -0
- package/dist/types/core/cf/lineage.d.ts +32 -0
- package/dist/types/core/cf/predicates.d.ts +27 -0
- package/dist/types/core/cf/serialize.d.ts +46 -0
- package/dist/types/core/chart/CanvasAdapter.d.ts +50 -1
- package/dist/types/core/chart/DataExtractor.d.ts +53 -12
- package/dist/types/core/chart/a11y.d.ts +22 -0
- package/dist/types/core/chart/chart-type-registry.d.ts +53 -0
- package/dist/types/core/chart/downsample-report.d.ts +36 -0
- package/dist/types/core/chart/downsample.d.ts +26 -1
- package/dist/types/core/chart/engine/ChartEngineRegistry.d.ts +52 -0
- package/dist/types/core/chart/geometry.d.ts +96 -0
- package/dist/types/core/chart/hittest.d.ts +21 -3
- package/dist/types/core/chart/palette.d.ts +96 -12
- package/dist/types/core/chart/parity.d.ts +12 -0
- package/dist/types/core/chart/provenance.d.ts +47 -0
- package/dist/types/core/chart/scales.d.ts +28 -1
- package/dist/types/core/chart/scene.d.ts +102 -0
- package/dist/types/core/chart/server.d.ts +36 -0
- package/dist/types/core/chart/surfaces/CanvasSurface.d.ts +48 -0
- package/dist/types/core/chart/surfaces/ServerRasterSurface.d.ts +26 -0
- package/dist/types/core/chart/surfaces/SvgSurface.d.ts +24 -0
- package/dist/types/core/chart/surfaces/pattern-overlay.d.ts +24 -0
- package/dist/types/core/command/CommandBus.d.ts +51 -0
- package/dist/types/core/command/CommandRegistry.d.ts +43 -0
- package/dist/types/core/command/CommandStack.d.ts +38 -0
- package/dist/types/core/command/ICommand.d.ts +110 -0
- package/dist/types/core/command/commands/CellWriteCommand.d.ts +32 -0
- package/dist/types/core/command/commands/CompositeCommand.d.ts +17 -0
- package/dist/types/core/command/commands/RowCommands.d.ts +39 -0
- package/dist/types/core/command/index.d.ts +9 -0
- package/dist/types/core/command/support.d.ts +51 -0
- package/dist/types/core/coordinate/ColumnMetrics.d.ts +30 -0
- package/dist/types/core/coordinate/CoordinateKernel.d.ts +88 -0
- package/dist/types/core/coordinate/FrozenPanes.d.ts +29 -0
- package/dist/types/core/coordinate/MergeSourceAdapter.d.ts +18 -0
- package/dist/types/core/coordinate/NodeBudget.d.ts +33 -0
- package/dist/types/core/coordinate/ResizeGovernor.d.ts +50 -0
- package/dist/types/core/coordinate/RowMetrics.d.ts +37 -0
- package/dist/types/core/coordinate/ViewPermutation.d.ts +23 -0
- package/dist/types/core/coordinate/index.d.ts +10 -0
- package/dist/types/core/coordinate/ports.d.ts +45 -0
- package/dist/types/core/coordinate/types.d.ts +76 -0
- package/dist/types/core/detail/DetailGlyph.d.ts +42 -7
- package/dist/types/core/detail/DetailSplice.d.ts +42 -11
- package/dist/types/core/detail/DetailState.d.ts +80 -11
- package/dist/types/core/detail/SubgridCache.d.ts +72 -10
- package/dist/types/core/detail/index.d.ts +8 -0
- package/dist/types/core/domain/AggregateResult.d.ts +54 -0
- package/dist/types/core/domain/CellAddress.d.ts +61 -0
- package/dist/types/core/domain/CellValueAccess.d.ts +29 -0
- package/dist/types/core/domain/Delta.d.ts +37 -0
- package/dist/types/core/domain/DomainValue.d.ts +80 -0
- package/dist/types/core/domain/Missing.d.ts +65 -0
- package/dist/types/core/domain/Money.d.ts +42 -0
- package/dist/types/core/domain/NormalizationBasis.d.ts +47 -0
- package/dist/types/core/domain/Plain.d.ts +45 -0
- package/dist/types/core/domain/Quantity.d.ts +32 -0
- package/dist/types/core/domain/Ratios.d.ts +100 -0
- package/dist/types/core/domain/ThresholdSet.d.ts +46 -0
- package/dist/types/core/domain/ValueType.d.ts +71 -0
- package/dist/types/core/domain/rounding.d.ts +25 -0
- package/dist/types/core/domain/strategies.d.ts +38 -0
- package/dist/types/core/editors/DateEditor.d.ts +18 -0
- package/dist/types/core/editors/SelectEditor.d.ts +29 -0
- package/dist/types/core/export/ChannelRegistry.d.ts +18 -0
- package/dist/types/core/export/ExportManifest.d.ts +13 -0
- package/dist/types/core/export/GridArtifactSource.d.ts +62 -0
- package/dist/types/core/export/Provenance.d.ts +34 -0
- package/dist/types/core/export/StreamPump.d.ts +28 -0
- package/dist/types/core/export/channels/CsvChannel.d.ts +20 -0
- package/dist/types/core/export/channels/JsonChannel.d.ts +18 -0
- package/dist/types/core/export/channels/XlsxChannel.d.ts +53 -0
- package/dist/types/core/export/channels/XmlChannel.d.ts +21 -0
- package/dist/types/core/export/channels/capabilities.d.ts +13 -0
- package/dist/types/core/export/index.d.ts +24 -0
- package/dist/types/core/export/print/OutputChannelAdapter.d.ts +61 -0
- package/dist/types/core/export/print/Paginator.d.ts +48 -0
- package/dist/types/core/export/print/PrintRenderTarget.d.ts +36 -0
- package/dist/types/core/export/sinks.d.ts +40 -0
- package/dist/types/core/export/types.d.ts +211 -0
- package/dist/types/core/extension/DeprecationManager.d.ts +42 -0
- package/dist/types/core/extension/IExtension.d.ts +90 -0
- package/dist/types/core/extension/Registry.d.ts +142 -0
- package/dist/types/core/extension/SlotRegistry.d.ts +46 -0
- package/dist/types/core/extension/adapters.d.ts +44 -0
- package/dist/types/core/extension/conformance.d.ts +47 -0
- package/dist/types/core/extension/index.d.ts +16 -0
- package/dist/types/core/extension/registries.d.ts +31 -0
- package/dist/types/core/extension/reserved.d.ts +10 -0
- package/dist/types/core/format/DisplayFormatter.d.ts +47 -0
- package/dist/types/core/format/FormatCache.d.ts +20 -0
- package/dist/types/core/format/FormatterRegistry.d.ts +22 -0
- package/dist/types/core/format/grammar/AstRenderer.d.ts +10 -0
- package/dist/types/core/format/grammar/FormatCompiler.d.ts +16 -0
- package/dist/types/core/format/index.d.ts +55 -0
- package/dist/types/core/format/pipeline/DomainTypeResolver.d.ts +8 -0
- package/dist/types/core/format/pipeline/LocaleFormat.d.ts +11 -0
- package/dist/types/core/format/pipeline/ValueInterpreter.d.ts +8 -0
- package/dist/types/core/format/policy/MaskPolicy.d.ts +8 -0
- package/dist/types/core/format/policy/NegativePolicy.d.ts +12 -0
- package/dist/types/core/format/policy/NullPolicy.d.ts +10 -0
- package/dist/types/core/format/policy/TruncatePolicy.d.ts +11 -0
- package/dist/types/core/format/types.d.ts +292 -0
- package/dist/types/core/formula/CalcCacheStore.d.ts +89 -0
- package/dist/types/core/formula/CalcProvenance.d.ts +44 -0
- package/dist/types/core/formula/CalcService.d.ts +137 -0
- package/dist/types/core/formula/CyclePathReporter.d.ts +28 -0
- package/dist/types/core/formula/FormulaEvaluator.d.ts +35 -1
- package/dist/types/core/formula/FormulaGraph.d.ts +84 -7
- package/dist/types/core/formula/FormulaParser.d.ts +9 -0
- package/dist/types/core/formula/FormulaStore.d.ts +63 -1
- package/dist/types/core/formula/FunctionRegistry.d.ts +138 -0
- package/dist/types/core/formula/Generation.d.ts +86 -0
- package/dist/types/core/formula/RecalcCoordinator.d.ts +151 -9
- package/dist/types/core/formula/ReferenceRewriter.d.ts +81 -0
- package/dist/types/core/formula/functions/essential.d.ts +3 -0
- package/dist/types/core/formula/functions/extended/index.d.ts +10 -0
- package/dist/types/core/formula/normalizeRefs.d.ts +34 -3
- package/dist/types/core/formula/numericLiteral.d.ts +11 -1
- package/dist/types/core/formula/serializeFormula.d.ts +10 -1
- package/dist/types/core/host/CapabilityRegistry.d.ts +61 -0
- package/dist/types/core/host/GridHostDriver.d.ts +27 -0
- package/dist/types/core/host/GridHostPort.d.ts +37 -0
- package/dist/types/core/host/SliceOwnershipGuard.d.ts +27 -0
- package/dist/types/core/host/archCheck.d.ts +26 -0
- package/dist/types/core/host/index.d.ts +6 -0
- package/dist/types/core/host/reconcile.d.ts +22 -0
- package/dist/types/core/i18n/LocaleContext.d.ts +40 -0
- package/dist/types/core/i18n/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/types.d.ts +27 -11
- package/dist/types/core/realtime/BackpressureScheduler.d.ts +0 -0
- package/dist/types/core/realtime/FreshnessClock.d.ts +34 -0
- package/dist/types/core/realtime/IRealtimeSource.d.ts +82 -0
- package/dist/types/core/realtime/LiveStateGuard.d.ts +23 -0
- package/dist/types/core/realtime/PollingSource.d.ts +42 -0
- package/dist/types/core/realtime/RealtimeController.d.ts +54 -0
- package/dist/types/core/realtime/RtAnnouncePolicy.d.ts +53 -0
- package/dist/types/core/realtime/RtApplyCommand.d.ts +29 -0
- package/dist/types/core/realtime/RtChartTargetTrigger.d.ts +26 -0
- package/dist/types/core/realtime/StreamingSource.d.ts +47 -0
- package/dist/types/core/realtime/backoff.d.ts +12 -0
- package/dist/types/core/realtime/index.d.ts +13 -0
- package/dist/types/core/realtime/ports.d.ts +80 -0
- package/dist/types/core/render/CellApplier.d.ts +18 -0
- package/dist/types/core/render/CellErrorBoundary.d.ts +65 -0
- package/dist/types/core/render/CellPipeline.d.ts +39 -0
- package/dist/types/core/render/CellRenderRequest.d.ts +209 -0
- package/dist/types/core/render/CellStageRegistry.d.ts +53 -0
- package/dist/types/core/render/OverlayCompositor.d.ts +38 -0
- package/dist/types/core/render/RenderBudget.d.ts +67 -0
- package/dist/types/core/render/contrast.d.ts +33 -0
- package/dist/types/core/render/index.d.ts +35 -0
- package/dist/types/core/render/stages/BackgroundStage.d.ts +14 -0
- package/dist/types/core/render/stages/DecoratorStage.d.ts +12 -0
- package/dist/types/core/render/stages/OverlayStage.d.ts +12 -0
- package/dist/types/core/render/stages/ValueRendererStage.d.ts +15 -0
- package/dist/types/core/render/stages/index.d.ts +14 -0
- package/dist/types/core/state/AutosaveController.d.ts +63 -0
- package/dist/types/core/state/IStatePersistence.d.ts +59 -0
- package/dist/types/core/state/MultiTabGuard.d.ts +33 -0
- package/dist/types/core/state/SchemaMigrator.d.ts +33 -0
- package/dist/types/core/state/SemVerPolicy.d.ts +39 -0
- package/dist/types/core/state/StateCodec.d.ts +75 -0
- package/dist/types/core/state/index.d.ts +6 -0
- package/dist/types/core/types.d.ts +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/package.json +112 -111
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { OGDecimal } from '../OGDecimal.js';
|
|
2
|
+
/** 반올림 모드. / Rounding mode. */
|
|
3
|
+
export type RoundingMode = 'half-up' | 'half-even' | 'down';
|
|
4
|
+
/**
|
|
5
|
+
* 반올림 규칙(Strategy). ValueType·포맷터·집계가 공유(REQ-T2-804).
|
|
6
|
+
* / Rounding rule strategy shared by value types, formatters and aggregation.
|
|
7
|
+
*/
|
|
8
|
+
export interface RoundingRule {
|
|
9
|
+
readonly mode: RoundingMode;
|
|
10
|
+
/** value 를 dp 소수자리로 반올림한 새 OGDecimal. / Round `value` to `dp` places (new OGDecimal). */
|
|
11
|
+
round(value: OGDecimal, dp: number): OGDecimal;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* 문자열(정확 표현) 기반 반올림 — OGDecimal 정밀 손실 없이 HALF_EVEN/HALF_UP/DOWN.
|
|
15
|
+
* / Exact string-based rounding — no precision loss on OGDecimal.
|
|
16
|
+
*/
|
|
17
|
+
export declare function roundDecimal(value: OGDecimal, dp: number, mode: RoundingMode): OGDecimal;
|
|
18
|
+
/** RoundingRule 팩토리. / Build a RoundingRule for a mode. */
|
|
19
|
+
export declare function makeRoundingRule(mode: RoundingMode): RoundingRule;
|
|
20
|
+
/** 반올림(HALF_UP). / Round half up. */
|
|
21
|
+
export declare const HALF_UP: RoundingRule;
|
|
22
|
+
/** 은행가 반올림(HALF_EVEN) — 회계 SSOT. / Banker's rounding. */
|
|
23
|
+
export declare const HALF_EVEN: RoundingRule;
|
|
24
|
+
/** 버림(DOWN, 0 방향). / Truncate toward zero. */
|
|
25
|
+
export declare const DOWN: RoundingRule;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 부호·기저 규칙(REQ-T2-803). 회계부호/무변화 ε 등 의미 규칙(표현은 밖).
|
|
3
|
+
* / Sign/base semantics rule (presentation lives outside).
|
|
4
|
+
*/
|
|
5
|
+
export interface SignRule {
|
|
6
|
+
/** 음수 허용 여부. / Whether negatives are allowed. */
|
|
7
|
+
readonly allowNegative: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* 결측 처우 정책(REQ-TX-832). 표식은 밖, 여기선 정책 값만.
|
|
11
|
+
* / Missing-value handling policy (visual marks live outside).
|
|
12
|
+
*/
|
|
13
|
+
export interface MissingPolicy {
|
|
14
|
+
/** 집계에서 제외/포함. / Excluded or included from aggregation. */
|
|
15
|
+
readonly aggregation: 'excluded' | 'included';
|
|
16
|
+
/** 정규화 스케일에서 제외 여부. / Excluded from normalization scale. */
|
|
17
|
+
readonly scaleExcluded: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 집계 적법성(REQ-T2-805). 타입별 허용 집계 선언(비율=가중평균, 통화=합, 코드=비집계).
|
|
21
|
+
* / Aggregation legality: which aggregations are meaningful for a value type.
|
|
22
|
+
*/
|
|
23
|
+
export interface AggregationLegality {
|
|
24
|
+
readonly legalFns: readonly string[];
|
|
25
|
+
/** fn 이 이 타입에 적법한가. / Whether `fn` is legal for this type. */
|
|
26
|
+
allows(fn: string): boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare const SIGN_ALLOW_NEGATIVE: SignRule;
|
|
29
|
+
export declare const SIGN_NON_NEGATIVE: SignRule;
|
|
30
|
+
export declare const MISSING_EXCLUDE: MissingPolicy;
|
|
31
|
+
/** 통화·수치: 합·평균·최소·최대·개수. / Money & numbers: sum/avg/min/max/count. */
|
|
32
|
+
export declare const AGG_NUMERIC: AggregationLegality;
|
|
33
|
+
/** 비율: 가중평균만(단순평균 금지). / Ratios: weighted mean only. */
|
|
34
|
+
export declare const AGG_WEIGHTED_MEAN: AggregationLegality;
|
|
35
|
+
/** 통화: 합·최소·최대·개수(평균은 가중 문맥). / Money: sum/min/max/count. */
|
|
36
|
+
export declare const AGG_MONEY: AggregationLegality;
|
|
37
|
+
/** 코드·텍스트: 비집계(개수만). / Codes & text: count only. */
|
|
38
|
+
export declare const AGG_NONE: AggregationLegality;
|
|
@@ -1,14 +1,32 @@
|
|
|
1
1
|
import { CellEditor } from './CellEditor.js';
|
|
2
2
|
import { RenderContext } from '../renderers/CellRenderer.js';
|
|
3
|
+
/**
|
|
4
|
+
* 날짜 셀 편집기. 네이티브 `<input type="date">` 로 편집하며 `yyyy-MM-dd` 문자열을 커밋한다.
|
|
5
|
+
* / Date cell editor. Edits via a native `<input type="date">` and commits a `yyyy-MM-dd` string.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* const col = { field: 'due', header: '마감일', editor: () => new DateEditor() };
|
|
9
|
+
*/
|
|
3
10
|
export declare class DateEditor implements CellEditor {
|
|
4
11
|
private input;
|
|
5
12
|
private _container;
|
|
6
13
|
private _onCommit;
|
|
7
14
|
private _onCancel;
|
|
15
|
+
/**
|
|
16
|
+
* 편집기를 컨테이너에 마운트한다. / Mount the editor into a container.
|
|
17
|
+
*
|
|
18
|
+
* @param container - 편집기를 붙일 셀 요소 / Cell element to attach the editor to
|
|
19
|
+
* @param ctx - 렌더 컨텍스트(값·컬럼·행 등) / Render context (value, column, row, …)
|
|
20
|
+
* @param onCommit - 값 확정 콜백 / Callback to commit a value
|
|
21
|
+
* @param onCancel - 편집 취소 콜백 / Callback to cancel editing
|
|
22
|
+
*/
|
|
8
23
|
mount(container: HTMLElement, ctx: RenderContext, onCommit: (v: any) => void, onCancel: () => void): void;
|
|
9
24
|
private _onKeyDown;
|
|
10
25
|
private _onBlur;
|
|
26
|
+
/** 현재 입력 값(`yyyy-MM-dd` 문자열)을 반환. / Return the current input value (`yyyy-MM-dd` string). */
|
|
11
27
|
getValue(): any;
|
|
28
|
+
/** 입력 요소에 포커스. / Focus the input element. */
|
|
12
29
|
focus(): void;
|
|
30
|
+
/** 리스너 해제 + aria 상태 원복. / Detach listeners + reset aria state. */
|
|
13
31
|
destroy(): void;
|
|
14
32
|
}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
1
|
import { CellEditor } from './CellEditor.js';
|
|
2
2
|
import { RenderContext } from '../renderers/CellRenderer.js';
|
|
3
|
+
/**
|
|
4
|
+
* 셀렉트 옵션. 문자열(라벨=값) 또는 `{ label|text, value }` 객체 형식.
|
|
5
|
+
* / A select option: a string (label = value) or a `{ label|text, value }` object.
|
|
6
|
+
*/
|
|
3
7
|
export type SelectOption = string | {
|
|
4
8
|
label?: string;
|
|
5
9
|
text?: string;
|
|
6
10
|
value: any;
|
|
7
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* 드롭다운 셀 편집기. 고정 옵션 배열 또는 행별 동적 옵션 함수로 `<select>` 를 구성한다.
|
|
14
|
+
* / Dropdown cell editor. Builds a `<select>` from a fixed option array or a per-row dynamic options function.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* // 고정 옵션 / fixed options
|
|
18
|
+
* new SelectEditor(['대기', '진행', '완료']);
|
|
19
|
+
* // 행별 동적 옵션 / per-row dynamic options
|
|
20
|
+
* new SelectEditor([], (row) => row.type === 'A' ? ['a1', 'a2'] : ['b1']);
|
|
21
|
+
*/
|
|
8
22
|
export declare class SelectEditor implements CellEditor {
|
|
9
23
|
private select;
|
|
10
24
|
private _container;
|
|
@@ -12,9 +26,24 @@ export declare class SelectEditor implements CellEditor {
|
|
|
12
26
|
private _onCancel;
|
|
13
27
|
private _options;
|
|
14
28
|
private _optionsFn;
|
|
29
|
+
/**
|
|
30
|
+
* @param options - 고정 옵션 배열 / Fixed option array
|
|
31
|
+
* @param optionsFn - 행별 동적 옵션 함수(있으면 options 대신 사용) / Per-row dynamic options function (used instead of options when present)
|
|
32
|
+
*/
|
|
15
33
|
constructor(options?: SelectOption[], optionsFn?: (row: any, rowIndex: number) => SelectOption[]);
|
|
34
|
+
/**
|
|
35
|
+
* 편집기를 컨테이너에 마운트한다. / Mount the editor into a container.
|
|
36
|
+
*
|
|
37
|
+
* @param container - 편집기를 붙일 셀 요소 / Cell element to attach the editor to
|
|
38
|
+
* @param ctx - 렌더 컨텍스트(값·컬럼·행 등) / Render context (value, column, row, …)
|
|
39
|
+
* @param onCommit - 값 확정 콜백 / Callback to commit a value
|
|
40
|
+
* @param onCancel - 편집 취소 콜백 / Callback to cancel editing
|
|
41
|
+
*/
|
|
16
42
|
mount(container: HTMLElement, ctx: RenderContext, onCommit: (v: any) => void, onCancel: () => void): void;
|
|
43
|
+
/** 현재 선택된 값(문자열)을 반환. / Return the currently selected value (string). */
|
|
17
44
|
getValue(): any;
|
|
45
|
+
/** 셀렉트 요소에 포커스. / Focus the select element. */
|
|
18
46
|
focus(): void;
|
|
47
|
+
/** aria 상태 원복(리스너는 요소 제거 시 함께 정리됨). / Reset aria state (listeners are cleaned up when the element is removed). */
|
|
19
48
|
destroy(): void;
|
|
20
49
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ChannelId, IExportChannel } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* export 채널 레지스트리 — DD-10 TypedRegistry 위의 채널 특화 별칭.
|
|
4
|
+
* register(channel) 는 IRegistry.register(channel.id, channel) 의 별칭.
|
|
5
|
+
* / Channel registry — a channel-typed alias over DD-10 TypedRegistry.
|
|
6
|
+
*/
|
|
7
|
+
export declare class ChannelRegistry {
|
|
8
|
+
private readonly _reg;
|
|
9
|
+
constructor();
|
|
10
|
+
/** 채널 등록(id 재등록 시 last-wins user override). / Register a channel (last-wins for user overrides). */
|
|
11
|
+
register(channel: IExportChannel): void;
|
|
12
|
+
/** 사용자 채널 교체(동일 id last-wins, 내장 보호 우회). / User channel override (replaces builtin). */
|
|
13
|
+
override(channel: IExportChannel): void;
|
|
14
|
+
/** 미등록 → undefined(never-throw). / Unregistered ⇒ undefined. */
|
|
15
|
+
get(id: ChannelId): IExportChannel | undefined;
|
|
16
|
+
has(id: ChannelId): boolean;
|
|
17
|
+
list(): ChannelId[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ActiveStateFlags, ChannelCapabilities, ChannelId, ChannelStateMatrix, StateLoss } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* 채널별 포함/제외 매트릭스 + 이번 export 의 실제 손실 항목 고지(§2.7).
|
|
4
|
+
* / Channel capability matrix + this run's actual losses.
|
|
5
|
+
*/
|
|
6
|
+
export declare class ExportManifest {
|
|
7
|
+
private readonly caps;
|
|
8
|
+
constructor(caps: Readonly<Record<ChannelId, ChannelCapabilities>>);
|
|
9
|
+
/** 현 그리드 상태(활성 병합·CF·필터…) 대비 이 채널이 잃는 항목 목록. / Losses for a channel vs active state. */
|
|
10
|
+
losses(channel: ChannelId, activeState: ActiveStateFlags): ReadonlyArray<StateLoss>;
|
|
11
|
+
/** UI/문서용 채널×항목 매트릭스. / Channel×item matrix for UI/docs. */
|
|
12
|
+
matrix(): ChannelStateMatrix;
|
|
13
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { ColumnFormatSpec, FormatContext, FormatInput, FormatResult } from '../format/types.js';
|
|
2
|
+
import { VisualSpec } from '../cf/encoders.js';
|
|
3
|
+
import { CellAlign, DataState, HeaderArtifact, IArtifactSource, ProjectOptions, RowChunk, RowRange } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* export 가 실제로 필요로 하는 좁은 포맷 포트 — 전체 FormatResult 접근(text 뿐 아니라 rawText/aria/
|
|
6
|
+
* sign/applied). DD-04 DisplayFormatter 가 구조적으로 만족(화면과 동일 인스턴스 주입).
|
|
7
|
+
* / The narrow format port export needs — full FormatResult access; DisplayFormatter satisfies it.
|
|
8
|
+
*/
|
|
9
|
+
export interface IArtifactFormatter {
|
|
10
|
+
format(input: FormatInput, spec: ColumnFormatSpec, ctx: FormatContext): FormatResult;
|
|
11
|
+
}
|
|
12
|
+
/** 투영 대상 컬럼 서술(가시 리프 1개). / One visible-leaf column descriptor. */
|
|
13
|
+
export interface ArtifactColumn<T> {
|
|
14
|
+
readonly field: string;
|
|
15
|
+
readonly header: string;
|
|
16
|
+
readonly spec: ColumnFormatSpec;
|
|
17
|
+
readonly align: CellAlign;
|
|
18
|
+
readonly widthPx?: number;
|
|
19
|
+
/** raw 접근자(미주입 시 row[field]). / Raw accessor (defaults to row[field]). */
|
|
20
|
+
readonly get?: (row: T) => unknown;
|
|
21
|
+
}
|
|
22
|
+
/** 병합 배치 조회(DD-02 CoordinateKernel.placeCell 위임 지점). / Placement lookup (delegates to DD-02). */
|
|
23
|
+
export type PlacementFn = (modelIndex: number, colIndex: number) => {
|
|
24
|
+
rowSpan: number;
|
|
25
|
+
colSpan: number;
|
|
26
|
+
hidden: boolean;
|
|
27
|
+
} | undefined;
|
|
28
|
+
/** CF 시각 스펙 조회(DD-05 evaluate+encode 위임 지점). / CF visual lookup (delegates to DD-05). */
|
|
29
|
+
export type CfFn<T> = (row: T, col: ArtifactColumn<T>, modelIndex: number) => VisualSpec | undefined;
|
|
30
|
+
/** GridArtifactSource 협력자(생성자 주입). / Collaborators injected into the source. */
|
|
31
|
+
export interface GridArtifactSourceDeps<T extends Record<string, any>> {
|
|
32
|
+
/** 논리 순서(정렬/필터 후) 전체 행. / All rows in logical order. */
|
|
33
|
+
readonly rows: () => ReadonlyArray<T>;
|
|
34
|
+
/** 가시 리프 컬럼. / Visible-leaf columns. */
|
|
35
|
+
readonly columns: () => ReadonlyArray<ArtifactColumn<T>>;
|
|
36
|
+
/** DD-04 표시값 파사드(화면과 동일 인스턴스). / DD-04 display formatter (same instance as screen). */
|
|
37
|
+
readonly formatter: IArtifactFormatter;
|
|
38
|
+
/** 포맷 컨텍스트(로케일/테마/consumer). / Format context. */
|
|
39
|
+
readonly ctx: () => FormatContext;
|
|
40
|
+
/** 선택: DD-05 CF 시각 스펙. / Optional: DD-05 CF visual spec. */
|
|
41
|
+
readonly cfFor?: CfFn<T>;
|
|
42
|
+
/** 선택: DD-02 병합 배치. / Optional: DD-02 merge placement. */
|
|
43
|
+
readonly placeFor?: PlacementFn;
|
|
44
|
+
/** 선택: 데이터 상태(기본 ready). / Optional: data state (defaults to ready). */
|
|
45
|
+
readonly state?: () => DataState;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 화면과 동일 파이프라인에서 아티팩트를 접는 소스 구현(§2.2).
|
|
49
|
+
* export 채널은 이 포트만 알고 상류 셋(DD-04/05/02)을 직접 모른다(의존 역전).
|
|
50
|
+
* / Folds artifacts from the same pipeline as the screen; channels know only this port.
|
|
51
|
+
*/
|
|
52
|
+
export declare class GridArtifactSource<T extends Record<string, any> = any> implements IArtifactSource {
|
|
53
|
+
private readonly d;
|
|
54
|
+
constructor(d: GridArtifactSourceDeps<T>);
|
|
55
|
+
projectHeader(opts?: ProjectOptions): ReadonlyArray<ReadonlyArray<HeaderArtifact>>;
|
|
56
|
+
projectRows(opts?: ProjectOptions): AsyncIterable<RowChunk>;
|
|
57
|
+
totalRows(range?: RowRange): number;
|
|
58
|
+
dataState(): DataState;
|
|
59
|
+
private _foldRow;
|
|
60
|
+
private _cols;
|
|
61
|
+
private _resolveRange;
|
|
62
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ChannelId, IArtifactProvenance, ProvenanceBadge, ProvenanceBlock, TransformProvenance } from './types.js';
|
|
2
|
+
/** ArtifactProvenance 구성 인자. / Construction options. */
|
|
3
|
+
export interface ArtifactProvenanceOptions {
|
|
4
|
+
readonly transforms?: ReadonlyArray<TransformProvenance>;
|
|
5
|
+
/** 전체 행수 등 범위 고지("인쇄 범위: 전체 12,300행"). / Range note. */
|
|
6
|
+
readonly rangeNote?: string;
|
|
7
|
+
/** 산출 시각(테스트 결정론 위해 주입 가능). / Generated-at (injectable for determinism). */
|
|
8
|
+
readonly generatedAt?: number;
|
|
9
|
+
/** 로케일 라벨 해석(미주입 시 ko 폴백). / Locale label resolver (ko fallback). */
|
|
10
|
+
readonly t?: (key: string, params?: Record<string, string | number>) => string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 산출물 단위 provenance 집계 — 아티팩트가 '어디에 놓이든 자신의 변환을 고지'(§2.3).
|
|
14
|
+
* / Per-artifact provenance aggregate — discloses its own transforms wherever it lands.
|
|
15
|
+
*/
|
|
16
|
+
export declare class ArtifactProvenance implements IArtifactProvenance {
|
|
17
|
+
readonly transforms: ReadonlyArray<TransformProvenance>;
|
|
18
|
+
readonly badges: ReadonlyArray<ProvenanceBadge>;
|
|
19
|
+
readonly generatedAt: number;
|
|
20
|
+
readonly rangeNote: string;
|
|
21
|
+
private readonly _t?;
|
|
22
|
+
constructor(opts?: ArtifactProvenanceOptions);
|
|
23
|
+
/** 변환 집합 → 무결성 배지(중복 kind 는 1배지). / Transforms → integrity badges (dedup by kind). */
|
|
24
|
+
private _buildBadges;
|
|
25
|
+
private _label;
|
|
26
|
+
/**
|
|
27
|
+
* 배지/캡션을 채널 표현으로 렌더(§2.3). PDF=꼬리말, xlsx=시트 메모, CSV=주석행, print=페이지 푸터.
|
|
28
|
+
* 어느 채널이든 동일 transforms/badges 를 표현 → 고지 누락 0.
|
|
29
|
+
* / Render badges/caption to the channel's representation; no channel drops a disclosure.
|
|
30
|
+
*/
|
|
31
|
+
render(channel: ChannelId): ProvenanceBlock;
|
|
32
|
+
}
|
|
33
|
+
/** 편의 팩토리 — transforms 로부터 provenance 생성. / Convenience factory. */
|
|
34
|
+
export declare function buildProvenance(opts?: ArtifactProvenanceOptions): ArtifactProvenance;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ExportResult, ExportRunCtx, IByteSink, RowArtifact, RowChunk } from './types.js';
|
|
2
|
+
/** 스트리밍 수치 예산(§7). / Streaming numeric budget. */
|
|
3
|
+
export declare const STREAM_DEFAULTS: {
|
|
4
|
+
/** 스트리밍 강제 임계(행수). / Row-count threshold for forced streaming. */
|
|
5
|
+
readonly streamRowThreshold: 50000;
|
|
6
|
+
/** 스트리밍 강제 임계(추정 바이트). / Byte threshold for forced streaming. */
|
|
7
|
+
readonly streamByteThreshold: number;
|
|
8
|
+
/** 청크 기본(행/청크). / Default rows per chunk. */
|
|
9
|
+
readonly chunkRows: 2000;
|
|
10
|
+
/** 소비 버퍼 상한(바이트). / Consumer high-water-mark bytes. */
|
|
11
|
+
readonly highWaterMarkBytes: number;
|
|
12
|
+
/** 힙 상한 힌트(바이트). / Heap hint bytes. */
|
|
13
|
+
readonly maxHeapHintBytes: number;
|
|
14
|
+
};
|
|
15
|
+
/** 규모가 스트리밍 sink 를 강제하는가(§7 전환 임계). / Whether scale forces a streaming sink. */
|
|
16
|
+
export declare function shouldStream(rowCount: number, estBytes?: number): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* 생산-소비 흐름 제어기(§2.5). 채널 write 내부에서 사용.
|
|
19
|
+
* / Producer–consumer flow controller used inside a channel's write.
|
|
20
|
+
*/
|
|
21
|
+
export declare class StreamPump {
|
|
22
|
+
/**
|
|
23
|
+
* 스트림을 청크로 흘리며 진행/취소/백프레셔 처리.
|
|
24
|
+
* 루프: for await(chunk) → encode → if(desiredSize<=0) await write(drain) → onProgress → 취소 검사.
|
|
25
|
+
* / Flows the stream chunk-by-chunk with progress, cancellation and backpressure.
|
|
26
|
+
*/
|
|
27
|
+
pump(source: AsyncIterable<RowChunk>, encodeChunk: (rows: ReadonlyArray<RowArtifact>) => Uint8Array | string, sink: IByteSink, ctx?: ExportRunCtx, total?: number): Promise<ExportResult>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ExportResult, ExportRunCtx, IArtifactSource, IByteSink } from '../types.js';
|
|
2
|
+
/** CSV 채널 옵션. / CSV channel options. */
|
|
3
|
+
export interface CsvChannelOptions {
|
|
4
|
+
/** 헤더 행 포함(기본 true). / Include header row (default true). */
|
|
5
|
+
readonly includeHeader?: boolean;
|
|
6
|
+
/** UTF-8 BOM 프리픽스(기본 true, Excel 한글). / Prefix UTF-8 BOM (default true). */
|
|
7
|
+
readonly bom?: boolean;
|
|
8
|
+
/** provenance 주석행 포함(기본 true). / Include provenance comment rows (default true). */
|
|
9
|
+
readonly includeProvenance?: boolean;
|
|
10
|
+
/** 값 대신 원값(rawText) 우선(값 보존 export). / Prefer rawText over display text. */
|
|
11
|
+
readonly preserveRaw?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** CSV 직렬화 전략. / CSV serialization strategy. */
|
|
14
|
+
export declare class CsvChannel {
|
|
15
|
+
private readonly opts;
|
|
16
|
+
readonly id: "csv";
|
|
17
|
+
readonly capabilities: import('../types.js').ChannelCapabilities;
|
|
18
|
+
constructor(opts?: CsvChannelOptions);
|
|
19
|
+
write(source: IArtifactSource, sink: IByteSink, ctx?: ExportRunCtx): Promise<ExportResult>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ExportResult, ExportRunCtx, IArtifactSource, IByteSink } from '../types.js';
|
|
2
|
+
/** JSON 채널 옵션. / JSON channel options. */
|
|
3
|
+
export interface JsonChannelOptions {
|
|
4
|
+
/** field 키 사용(false면 헤더 텍스트 키). / Use field keys (false ⇒ header text keys). */
|
|
5
|
+
readonly useFieldKeys?: boolean;
|
|
6
|
+
/** provenance 를 `_provenance` 로 래핑(기본 true). / Wrap provenance under `_provenance`. */
|
|
7
|
+
readonly includeProvenance?: boolean;
|
|
8
|
+
/** 원값(rawText) 우선. / Prefer rawText. */
|
|
9
|
+
readonly preserveRaw?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** JSON 직렬화 전략. / JSON serialization strategy. */
|
|
12
|
+
export declare class JsonChannel {
|
|
13
|
+
private readonly opts;
|
|
14
|
+
readonly id: "json";
|
|
15
|
+
readonly capabilities: import('../types.js').ChannelCapabilities;
|
|
16
|
+
constructor(opts?: JsonChannelOptions);
|
|
17
|
+
write(source: IArtifactSource, sink: IByteSink, ctx?: ExportRunCtx): Promise<ExportResult>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ChannelCapabilities, ExportResult, ExportRunCtx, IArtifactSource, IByteSink } from '../types.js';
|
|
2
|
+
/** 순수 셀 모델(값 + 상류 확정 스타일). / Pure cell model (value + upstream-confirmed style). */
|
|
3
|
+
export interface SheetCell {
|
|
4
|
+
/** 표시값(= CellArtifact.text). / Display value. */
|
|
5
|
+
readonly value: string;
|
|
6
|
+
/** number 타입일 때 수치(xlsx 셀 타입 매핑). / Numeric magnitude for number cells. */
|
|
7
|
+
readonly num?: number;
|
|
8
|
+
/** 채움색(= cf.fill.color, 상류 AA 보증). / Fill color from cf.fill. */
|
|
9
|
+
readonly fill?: string;
|
|
10
|
+
/** 채움 위 잉크색(= cf.inkColor). / Ink color from cf.inkColor. */
|
|
11
|
+
readonly ink?: string;
|
|
12
|
+
readonly align: 'left' | 'right' | 'center';
|
|
13
|
+
readonly rowSpan: number;
|
|
14
|
+
readonly colSpan: number;
|
|
15
|
+
}
|
|
16
|
+
/** 병합 영역(0-based). / Merge region (0-based). */
|
|
17
|
+
export interface MergeRegion {
|
|
18
|
+
readonly r: number;
|
|
19
|
+
readonly c: number;
|
|
20
|
+
readonly rs: number;
|
|
21
|
+
readonly cs: number;
|
|
22
|
+
}
|
|
23
|
+
/** 순수 시트 모델 — 바이너리 없이 파리티 검증 가능. / Pure sheet model (parity-checkable without binary). */
|
|
24
|
+
export interface SheetModel {
|
|
25
|
+
readonly sheetName: string;
|
|
26
|
+
readonly header: ReadonlyArray<string>;
|
|
27
|
+
readonly colWidthsPx: ReadonlyArray<number>;
|
|
28
|
+
readonly rows: ReadonlyArray<ReadonlyArray<SheetCell>>;
|
|
29
|
+
readonly merges: ReadonlyArray<MergeRegion>;
|
|
30
|
+
/** provenance 시트 메모(있으면). / Provenance sheet note. */
|
|
31
|
+
readonly provenanceNote?: string;
|
|
32
|
+
}
|
|
33
|
+
/** 바이너리 인코더 SPI(동적 import 어댑터 주입). / Binary-writer SPI (inject a dynamic-import adapter). */
|
|
34
|
+
export interface IWorkbookWriter {
|
|
35
|
+
/** SheetModel → 바이트(sink 로 기록). / SheetModel → bytes (written to sink). */
|
|
36
|
+
write(model: SheetModel, sink: IByteSink): Promise<number>;
|
|
37
|
+
}
|
|
38
|
+
/** xlsx 채널 옵션. / xlsx channel options. */
|
|
39
|
+
export interface XlsxChannelOptions {
|
|
40
|
+
readonly sheetName?: string;
|
|
41
|
+
readonly includeProvenance?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/** xlsx 직렬화 전략(순수 접기 + 주입 인코더). / xlsx serialization strategy (pure fold + injected writer). */
|
|
44
|
+
export declare class XlsxChannel {
|
|
45
|
+
private readonly writer;
|
|
46
|
+
private readonly opts;
|
|
47
|
+
readonly id: "xlsx";
|
|
48
|
+
readonly capabilities: ChannelCapabilities;
|
|
49
|
+
constructor(writer: IWorkbookWriter, opts?: XlsxChannelOptions);
|
|
50
|
+
/** 순수: 소스 → SheetModel(파리티 골든 대상). / Pure: source → SheetModel (parity golden target). */
|
|
51
|
+
buildModel(source: IArtifactSource, ctx?: ExportRunCtx): Promise<SheetModel>;
|
|
52
|
+
write(source: IArtifactSource, sink: IByteSink, ctx?: ExportRunCtx): Promise<ExportResult>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ExportResult, ExportRunCtx, IArtifactSource, IByteSink } from '../types.js';
|
|
2
|
+
/** XML 채널 옵션. / XML channel options. */
|
|
3
|
+
export interface XmlChannelOptions {
|
|
4
|
+
/** 루트 요소명(기본 rows). / Root element name. */
|
|
5
|
+
readonly rootTag?: string;
|
|
6
|
+
/** 행 요소명(기본 row). / Row element name. */
|
|
7
|
+
readonly rowTag?: string;
|
|
8
|
+
/** field 를 요소명으로(false면 <cell name="field">). / Use field as element name. */
|
|
9
|
+
readonly fieldAsTag?: boolean;
|
|
10
|
+
/** provenance 주석 포함. / Include provenance comment. */
|
|
11
|
+
readonly includeProvenance?: boolean;
|
|
12
|
+
readonly preserveRaw?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/** XML 직렬화 전략. / XML serialization strategy. */
|
|
15
|
+
export declare class XmlChannel {
|
|
16
|
+
private readonly opts;
|
|
17
|
+
readonly id: "xml";
|
|
18
|
+
readonly capabilities: import('../types.js').ChannelCapabilities;
|
|
19
|
+
constructor(opts?: XmlChannelOptions);
|
|
20
|
+
write(source: IArtifactSource, sink: IByteSink, ctx?: ExportRunCtx): Promise<ExportResult>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ChannelCapabilities, ChannelId } from '../types.js';
|
|
2
|
+
/** CSV — 값 + provenance 주석행만. 색/병합/스타일 불가. / CSV: values + comment-row provenance only. */
|
|
3
|
+
export declare const CSV_CAPS: ChannelCapabilities;
|
|
4
|
+
/** JSON — 값 + provenance 사이드카. / JSON: values + provenance sidecar. */
|
|
5
|
+
export declare const JSON_CAPS: ChannelCapabilities;
|
|
6
|
+
/** XML — 값 + provenance 주석. / XML: values + comment provenance. */
|
|
7
|
+
export declare const XML_CAPS: ChannelCapabilities;
|
|
8
|
+
/** xlsx — 병합·컬럼폭·CF 색·스타일·provenance(시트메모). / xlsx: merges/widths/cf/styling/provenance. */
|
|
9
|
+
export declare const XLSX_CAPS: ChannelCapabilities;
|
|
10
|
+
/** print — 병합·CF(흑백 강등)·스타일·차트·provenance(페이지 푸터). / print: merges/cf/styling/charts/provenance. */
|
|
11
|
+
export declare const PRINT_CAPS: ChannelCapabilities;
|
|
12
|
+
/** 기본 능력 매트릭스(매니페스트 조립용). / Default capability matrix for the manifest. */
|
|
13
|
+
export declare const DEFAULT_CAPS: Readonly<Record<ChannelId, ChannelCapabilities>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type { ChannelId, DataState, CellAlign, CellArtifact, RowArtifact, HeaderArtifact, RowRange, RowChunk, ProjectOptions, IArtifactSource, IByteSink, ChannelCapabilities, ActiveStateFlags, StateLoss, ChannelStateMatrix, ExportRunCtx, ExportResult, IExportChannel, TransformProvenance, ProvenanceBadge, ProvenanceBlock, IArtifactProvenance, } from './types.js';
|
|
2
|
+
export { ArtifactProvenance, buildProvenance } from './Provenance.js';
|
|
3
|
+
export type { ArtifactProvenanceOptions } from './Provenance.js';
|
|
4
|
+
export { ExportManifest } from './ExportManifest.js';
|
|
5
|
+
export { StreamPump, STREAM_DEFAULTS, shouldStream } from './StreamPump.js';
|
|
6
|
+
export { MemoryByteSink, DownloadByteSink } from './sinks.js';
|
|
7
|
+
export { GridArtifactSource } from './GridArtifactSource.js';
|
|
8
|
+
export type { GridArtifactSourceDeps, ArtifactColumn, PlacementFn, CfFn, } from './GridArtifactSource.js';
|
|
9
|
+
export { ChannelRegistry } from './ChannelRegistry.js';
|
|
10
|
+
export { CsvChannel } from './channels/CsvChannel.js';
|
|
11
|
+
export type { CsvChannelOptions } from './channels/CsvChannel.js';
|
|
12
|
+
export { JsonChannel } from './channels/JsonChannel.js';
|
|
13
|
+
export type { JsonChannelOptions } from './channels/JsonChannel.js';
|
|
14
|
+
export { XmlChannel } from './channels/XmlChannel.js';
|
|
15
|
+
export type { XmlChannelOptions } from './channels/XmlChannel.js';
|
|
16
|
+
export { XlsxChannel } from './channels/XlsxChannel.js';
|
|
17
|
+
export type { XlsxChannelOptions, SheetModel, SheetCell, MergeRegion, IWorkbookWriter, } from './channels/XlsxChannel.js';
|
|
18
|
+
export { CSV_CAPS, JSON_CAPS, XML_CAPS, XLSX_CAPS, PRINT_CAPS, DEFAULT_CAPS, } from './channels/capabilities.js';
|
|
19
|
+
export { ScreenAdapter, GrayscaleAdapter, createOutputAdapter, } from './print/OutputChannelAdapter.js';
|
|
20
|
+
export type { IOutputChannelAdapter, InkDecision, BorderSpec, } from './print/OutputChannelAdapter.js';
|
|
21
|
+
export { Paginator } from './print/Paginator.js';
|
|
22
|
+
export type { IPaginator, PrintPage, PaginatorOptions } from './print/Paginator.js';
|
|
23
|
+
export { PrintRenderTarget } from './print/PrintRenderTarget.js';
|
|
24
|
+
export type { PrintRenderDeps, PrintRenderOptions } from './print/PrintRenderTarget.js';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { VisualSpec } from '../../cf/encoders.js';
|
|
2
|
+
import { CellArtifact } from '../types.js';
|
|
3
|
+
import { Sign } from '../../format/types.js';
|
|
4
|
+
/** 색+형태 이중부호화 결과 — 흑백에서도 의미 생존(§2.6). / Color+shape dual-encoding result. */
|
|
5
|
+
export interface InkDecision {
|
|
6
|
+
/** 흑백=명도 그레이 또는 해치 패턴 색. / Mono grey (or hatch fill). */
|
|
7
|
+
readonly fill: string;
|
|
8
|
+
/** 색 상실 시 형태로 부호. / Shape-encode when color is lost. */
|
|
9
|
+
readonly pattern?: 'solid' | 'hatch-up' | 'hatch-down' | 'dots';
|
|
10
|
+
/** ▲▼ 등 부호 픽토(색 단독 금지 가드). / Sign glyph guard. */
|
|
11
|
+
readonly glyph?: string;
|
|
12
|
+
/** AA 대비 보증 텍스트색. / AA-guaranteed text color. */
|
|
13
|
+
readonly textColor: string;
|
|
14
|
+
}
|
|
15
|
+
/** 테두리/구분선 지정. / Border spec. */
|
|
16
|
+
export interface BorderSpec {
|
|
17
|
+
readonly color: string;
|
|
18
|
+
readonly widthPx: number;
|
|
19
|
+
readonly style: 'solid';
|
|
20
|
+
}
|
|
21
|
+
/** 출력 채널 어댑터 계약(§2.6). / Output-channel adapter contract. */
|
|
22
|
+
export interface IOutputChannelAdapter {
|
|
23
|
+
readonly channel: 'screen' | 'print' | 'grayscale' | 'forced-colors';
|
|
24
|
+
/** CF 채움색 → 이 채널의 잉크. / CF fill color → this channel's ink. */
|
|
25
|
+
ink(cf: VisualSpec | undefined, text: {
|
|
26
|
+
sign?: Sign;
|
|
27
|
+
colorHint?: string;
|
|
28
|
+
}): InkDecision;
|
|
29
|
+
/** 말줄임 텍스트를 지면에서 전개(화면 생략 → 인쇄 전체값). / Expand truncated text for print. */
|
|
30
|
+
expandTruncation(cell: CellArtifact): string;
|
|
31
|
+
/** 테두리를 솔리드 강제(반투명·헤어라인 소실 방지). / Force solid borders. */
|
|
32
|
+
borderStyle(): BorderSpec;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* screen — 상류 확정 cf.inkColor 를 그대로 통과(재계산 금지). / Passes upstream cf.inkColor as-is.
|
|
36
|
+
*/
|
|
37
|
+
export declare class ScreenAdapter implements IOutputChannelAdapter {
|
|
38
|
+
readonly channel: "screen";
|
|
39
|
+
ink(cf: VisualSpec | undefined, text: {
|
|
40
|
+
sign?: Sign;
|
|
41
|
+
colorHint?: string;
|
|
42
|
+
}): InkDecision;
|
|
43
|
+
expandTruncation(cell: CellArtifact): string;
|
|
44
|
+
borderStyle(): BorderSpec;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* print/grayscale — 채움을 명도 그레이 + 해치 패턴으로 강등, 잉크는 palette 대비 커널로 산정.
|
|
48
|
+
* / Degrades fills to grey + hatch; ink computed via the palette contrast kernel.
|
|
49
|
+
*/
|
|
50
|
+
export declare class GrayscaleAdapter implements IOutputChannelAdapter {
|
|
51
|
+
readonly channel: 'print' | 'grayscale' | 'forced-colors';
|
|
52
|
+
constructor(channel?: 'print' | 'grayscale' | 'forced-colors');
|
|
53
|
+
ink(cf: VisualSpec | undefined, text: {
|
|
54
|
+
sign?: Sign;
|
|
55
|
+
colorHint?: string;
|
|
56
|
+
}): InkDecision;
|
|
57
|
+
expandTruncation(cell: CellArtifact): string;
|
|
58
|
+
borderStyle(): BorderSpec;
|
|
59
|
+
}
|
|
60
|
+
/** 채널명 → 기본 어댑터. / Channel name → default adapter. */
|
|
61
|
+
export declare function createOutputAdapter(channel: IOutputChannelAdapter['channel']): IOutputChannelAdapter;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { HeaderArtifact, RowArtifact } from '../types.js';
|
|
2
|
+
import { IOutputChannelAdapter } from './OutputChannelAdapter.js';
|
|
3
|
+
/** 인쇄 페이지 산출(어댑터 잉크 적용 완료). / A rendered print page. */
|
|
4
|
+
export interface PrintPage {
|
|
5
|
+
readonly pageNo: number;
|
|
6
|
+
readonly totalPagesHint?: number;
|
|
7
|
+
/** 이 페이지의 인쇄 HTML(문자열). / This page's print HTML. */
|
|
8
|
+
readonly html: string;
|
|
9
|
+
/** "3–58행 / 전체 12,300". / Row-range label. */
|
|
10
|
+
readonly rangeLabel: string;
|
|
11
|
+
}
|
|
12
|
+
/** 페이지 배분 계약(SPI). / Page distribution contract (SPI). */
|
|
13
|
+
export interface IPaginator {
|
|
14
|
+
paginate(rows: AsyncIterable<RowArtifact>, header: ReadonlyArray<ReadonlyArray<HeaderArtifact>>): AsyncIterable<PrintPage>;
|
|
15
|
+
}
|
|
16
|
+
/** Paginator 구성. / Paginator options. */
|
|
17
|
+
export interface PaginatorOptions {
|
|
18
|
+
/** 페이지 박스(px). / Page box in px. */
|
|
19
|
+
readonly pageBox: {
|
|
20
|
+
readonly w: number;
|
|
21
|
+
readonly h: number;
|
|
22
|
+
};
|
|
23
|
+
/** 행 높이(px). / Row height in px. */
|
|
24
|
+
readonly rowHeight: number;
|
|
25
|
+
/** 헤더 반복(기본 true). / Repeat header per page (default true). */
|
|
26
|
+
readonly repeatHeader?: boolean;
|
|
27
|
+
/** 헤더 높이(px, 페이지당 rows 산정에서 차감). / Header height (px). */
|
|
28
|
+
readonly headerHeight?: number;
|
|
29
|
+
/** 전체 행수(범위 라벨 분모, 없으면 누적치). / Total rows (denominator). */
|
|
30
|
+
readonly totalRows?: number;
|
|
31
|
+
/** 색→흑백 잉크 어댑터(선택; 미주입 시 원문 표시값). / Ink adapter (optional). */
|
|
32
|
+
readonly adapter?: IOutputChannelAdapter;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 기본 페이지 분할 — 반복 헤더·행 경계 비분할·페이지 번호(§2.6).
|
|
36
|
+
* 페이지당 행수 = floor((pageH − headerH) / rowHeight), 최소 1(행 비분할 보장).
|
|
37
|
+
* / Default paginator; rows-per-page = floor((pageH − headerH)/rowHeight), min 1.
|
|
38
|
+
*/
|
|
39
|
+
export declare class Paginator implements IPaginator {
|
|
40
|
+
private readonly opts;
|
|
41
|
+
constructor(opts: PaginatorOptions);
|
|
42
|
+
/** 페이지당 데이터 행수(최소 1 — 한 행이 페이지보다 커도 절단 안 함). / Rows per page (min 1). */
|
|
43
|
+
rowsPerPage(): number;
|
|
44
|
+
paginate(rows: AsyncIterable<RowArtifact>, header: ReadonlyArray<ReadonlyArray<HeaderArtifact>>): AsyncIterable<PrintPage>;
|
|
45
|
+
private _emit;
|
|
46
|
+
private _headerHtml;
|
|
47
|
+
private _rowHtml;
|
|
48
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { IArtifactProvenance, IArtifactSource, RowRange } from '../types.js';
|
|
2
|
+
import { IOutputChannelAdapter } from './OutputChannelAdapter.js';
|
|
3
|
+
import { IPaginator, PrintPage } from './Paginator.js';
|
|
4
|
+
/** PrintRenderTarget 협력자. / Print render target collaborators. */
|
|
5
|
+
export interface PrintRenderDeps {
|
|
6
|
+
/** 전 모델행 투영(가시행 아님). / Full-row projection source. */
|
|
7
|
+
readonly source: IArtifactSource;
|
|
8
|
+
/** 흑백/이중부호 출력 어댑터. / Mono/dual-encoding output adapter. */
|
|
9
|
+
readonly adapter: IOutputChannelAdapter;
|
|
10
|
+
/** 페이지 배분 SPI(교체 가능). / Page distribution SPI (replaceable). */
|
|
11
|
+
readonly paginator: IPaginator;
|
|
12
|
+
/** 변환 provenance(페이지 푸터 동행). / Transform provenance (page footer). */
|
|
13
|
+
readonly provenance?: IArtifactProvenance;
|
|
14
|
+
}
|
|
15
|
+
/** render 옵션. / render options. */
|
|
16
|
+
export interface PrintRenderOptions {
|
|
17
|
+
/** 인쇄 범위(미지정 = 전체). / Print range (undefined = all). */
|
|
18
|
+
readonly range?: RowRange;
|
|
19
|
+
/** 문서 제목. / Document title. */
|
|
20
|
+
readonly title?: string;
|
|
21
|
+
/** 진행률(대용량). / Progress (large data). */
|
|
22
|
+
readonly onProgress?: (done: number, total: number) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 전 논리행을 실체화해 페이지네이션된 인쇄 페이지를 스트림 생성(§2.6).
|
|
26
|
+
* / Materializes all logical rows into a stream of paginated print pages.
|
|
27
|
+
*/
|
|
28
|
+
export declare class PrintRenderTarget {
|
|
29
|
+
private readonly deps;
|
|
30
|
+
constructor(deps: PrintRenderDeps);
|
|
31
|
+
/** 인쇄 페이지 async 스트림. / Async stream of print pages. */
|
|
32
|
+
render(opts?: PrintRenderOptions): AsyncIterable<PrintPage>;
|
|
33
|
+
/** 전체 인쇄 문서 조립(모든 페이지 결합). shell 이 print window 에 write. / Assemble the full print doc. */
|
|
34
|
+
renderDocument(opts?: PrintRenderOptions): Promise<string>;
|
|
35
|
+
private _rowStream;
|
|
36
|
+
}
|