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
|
@@ -1,49 +1,180 @@
|
|
|
1
|
+
/** OGDecimal 로 변환 가능한 입력 타입. / Input types convertible to an OGDecimal. */
|
|
1
2
|
export type OGDecimalLike = string | number | bigint | OGDecimal;
|
|
3
|
+
/**
|
|
4
|
+
* BigInt 기반 임의정밀도 소수. / BigInt-based arbitrary-precision decimal.
|
|
5
|
+
*
|
|
6
|
+
* 값은 `coefficient / 10^scale` 로 표현되며, IEEE 754 오차 없이 정확한 사칙연산·집계를 제공한다.
|
|
7
|
+
* 음원 수익 배분처럼 수백 자리 정밀도가 필요한 계산을 외부 라이브러리 없이(ES2020+ BigInt) 지원한다.
|
|
8
|
+
* 인스턴스는 불변(immutable)이며, 모든 연산은 새 인스턴스를 반환한다.
|
|
9
|
+
* / A value is represented as `coefficient / 10^scale`, giving exact arithmetic and aggregation with
|
|
10
|
+
* no IEEE 754 error. Supports hundreds-of-digits precision (e.g. royalty splits) with no external
|
|
11
|
+
* library (ES2020+ BigInt). Instances are immutable; every operation returns a new instance.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* const total = OGDecimal.from('0.1').add('0.2'); // 정확히 0.3 / exactly 0.3
|
|
15
|
+
* total.toFixed(2); // '0.30'
|
|
16
|
+
*/
|
|
2
17
|
export declare class OGDecimal {
|
|
3
18
|
private readonly _c;
|
|
4
19
|
private readonly _s;
|
|
20
|
+
/**
|
|
21
|
+
* coefficient/scale 로 직접 생성(보통 {@link OGDecimal.from} 사용 권장).
|
|
22
|
+
* / Construct directly from coefficient/scale (prefer {@link OGDecimal.from} in most cases).
|
|
23
|
+
*
|
|
24
|
+
* @param coefficient - 부호 포함 정수 계수 / Signed integer coefficient
|
|
25
|
+
* @param scale - 소수점 아래 자릿수(음수는 0으로 클램프) / Number of fractional digits (negatives clamp to 0)
|
|
26
|
+
*/
|
|
5
27
|
constructor(coefficient: bigint, scale: number);
|
|
28
|
+
/**
|
|
29
|
+
* 문자열·숫자·bigint·OGDecimal 을 OGDecimal 로 변환. / Convert a string/number/bigint/OGDecimal into an OGDecimal.
|
|
30
|
+
*
|
|
31
|
+
* 빈 값/'null'/'undefined'/'NaN' 은 0 으로 처리한다. / Empty/'null'/'undefined'/'NaN' inputs map to 0.
|
|
32
|
+
* ⚠️ number 입력은 이미 부동소수 오차를 담을 수 있으니 정밀 계산은 문자열 입력 권장.
|
|
33
|
+
* / ⚠️ A number input may already carry float error; prefer string input for exact math.
|
|
34
|
+
*
|
|
35
|
+
* @param value - 변환할 값 / Value to convert
|
|
36
|
+
* @returns 대응하는 OGDecimal / The corresponding OGDecimal
|
|
37
|
+
*/
|
|
6
38
|
static from(value: OGDecimalLike): OGDecimal;
|
|
39
|
+
/** 0 값 생성. / Create a zero value. */
|
|
7
40
|
static zero(): OGDecimal;
|
|
41
|
+
/** 1 값 생성. / Create a one value. */
|
|
8
42
|
static one(): OGDecimal;
|
|
9
43
|
private static _align;
|
|
44
|
+
/**
|
|
45
|
+
* 덧셈(정확). / Exact addition.
|
|
46
|
+
*
|
|
47
|
+
* @param other - 더할 값 / Value to add
|
|
48
|
+
* @returns 합을 담은 새 OGDecimal / A new OGDecimal holding the sum
|
|
49
|
+
*/
|
|
10
50
|
add(other: OGDecimalLike): OGDecimal;
|
|
51
|
+
/**
|
|
52
|
+
* 뺄셈(정확). / Exact subtraction.
|
|
53
|
+
*
|
|
54
|
+
* @param other - 뺄 값 / Value to subtract
|
|
55
|
+
* @returns 차를 담은 새 OGDecimal / A new OGDecimal holding the difference
|
|
56
|
+
*/
|
|
11
57
|
sub(other: OGDecimalLike): OGDecimal;
|
|
58
|
+
/**
|
|
59
|
+
* 곱셈(정확). / Exact multiplication.
|
|
60
|
+
*
|
|
61
|
+
* @param other - 곱할 값 / Value to multiply by
|
|
62
|
+
* @returns 곱을 담은 새 OGDecimal / A new OGDecimal holding the product
|
|
63
|
+
*/
|
|
12
64
|
mul(other: OGDecimalLike): OGDecimal;
|
|
13
65
|
/**
|
|
14
|
-
* 나눗셈.
|
|
15
|
-
*
|
|
66
|
+
* 나눗셈. / Division.
|
|
67
|
+
*
|
|
68
|
+
* precision = 결과 소수점 자리수(기본 20). 수익 배분처럼 소수 수백 자리가 필요하면 precision 을 높인다.
|
|
69
|
+
* / `precision` is the number of result decimal places (default 20). Raise it when hundreds of
|
|
70
|
+
* fractional digits are required (e.g. royalty splits).
|
|
71
|
+
*
|
|
72
|
+
* @param other - 제수(0 금지) / Divisor (must be non-zero)
|
|
73
|
+
* @param precision - 결과 소수점 자리수(기본 20) / Result decimal places (default 20)
|
|
74
|
+
* @returns 몫을 담은 새 OGDecimal / A new OGDecimal holding the quotient
|
|
75
|
+
* @throws 제수가 0 이면 Error / Error when the divisor is 0
|
|
16
76
|
*/
|
|
17
77
|
div(other: OGDecimalLike, precision?: number): OGDecimal;
|
|
18
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* 나머지(정수 나머지 개념을 소수에 적용). / Remainder (integer-remainder concept applied to decimals).
|
|
80
|
+
*
|
|
81
|
+
* @param other - 제수 / Divisor
|
|
82
|
+
* @returns 나머지를 담은 새 OGDecimal / A new OGDecimal holding the remainder
|
|
83
|
+
*/
|
|
19
84
|
mod(other: OGDecimalLike): OGDecimal;
|
|
20
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* 부호 반전. / Negation.
|
|
87
|
+
*
|
|
88
|
+
* @returns 부호를 뒤집은 새 OGDecimal / A new OGDecimal with the sign flipped
|
|
89
|
+
*/
|
|
21
90
|
neg(): OGDecimal;
|
|
22
|
-
/**
|
|
91
|
+
/**
|
|
92
|
+
* 절댓값. / Absolute value.
|
|
93
|
+
*
|
|
94
|
+
* @returns 절댓값을 담은 새 OGDecimal / A new OGDecimal holding the absolute value
|
|
95
|
+
*/
|
|
23
96
|
abs(): OGDecimal;
|
|
97
|
+
/**
|
|
98
|
+
* 같음 비교. / Equality comparison.
|
|
99
|
+
* @param other - 비교 대상 / Value to compare
|
|
100
|
+
* @returns 값이 같으면 true / true if equal
|
|
101
|
+
*/
|
|
24
102
|
eq(other: OGDecimalLike): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* 초과 비교. / Greater-than comparison.
|
|
105
|
+
* @param other - 비교 대상 / Value to compare
|
|
106
|
+
* @returns this > other 이면 true / true if this > other
|
|
107
|
+
*/
|
|
25
108
|
gt(other: OGDecimalLike): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* 미만 비교. / Less-than comparison.
|
|
111
|
+
* @param other - 비교 대상 / Value to compare
|
|
112
|
+
* @returns this < other 이면 true / true if this < other
|
|
113
|
+
*/
|
|
26
114
|
lt(other: OGDecimalLike): boolean;
|
|
115
|
+
/** 이상(>=) 비교. / Greater-than-or-equal comparison. @param other 비교 대상 / Value to compare @returns this >= other 이면 true / true if this >= other */
|
|
27
116
|
gte(other: OGDecimalLike): boolean;
|
|
117
|
+
/** 이하(<=) 비교. / Less-than-or-equal comparison. @param other 비교 대상 / Value to compare @returns this <= other 이면 true / true if this <= other */
|
|
28
118
|
lte(other: OGDecimalLike): boolean;
|
|
119
|
+
/** 0 인지 여부. / Whether the value is zero. @returns 0 이면 true / true if zero */
|
|
29
120
|
isZero(): boolean;
|
|
121
|
+
/** 음수인지 여부. / Whether the value is negative. @returns 음수이면 true / true if negative */
|
|
30
122
|
isNeg(): boolean;
|
|
123
|
+
/** 양수인지 여부. / Whether the value is positive. @returns 양수이면 true / true if positive */
|
|
31
124
|
isPos(): boolean;
|
|
32
125
|
/**
|
|
33
|
-
* 지정 소수점 자리수로 반올림(Half-up) 후 문자열 반환.
|
|
34
|
-
*
|
|
126
|
+
* 지정 소수점 자리수로 반올림(Half-up) 후 문자열 반환. / Round Half-up to `dp` places and return a string.
|
|
127
|
+
*
|
|
128
|
+
* 음원 배분 등 정확한 자리수 표시에 사용. / Used for exact fixed-place display (e.g. royalty splits).
|
|
129
|
+
*
|
|
130
|
+
* @param dp - 소수점 자리수 / Number of decimal places
|
|
131
|
+
* @returns 반올림된 고정소수 문자열 / The rounded fixed-point string
|
|
35
132
|
*/
|
|
36
133
|
toFixed(dp: number): string;
|
|
37
|
-
/**
|
|
134
|
+
/**
|
|
135
|
+
* 정규화(후행 0 제거) 후 최소 표현 문자열 반환. / Return the minimal string after normalization (trailing zeros removed).
|
|
136
|
+
*
|
|
137
|
+
* @returns 최소 표현 문자열 / The minimal string representation
|
|
138
|
+
*/
|
|
38
139
|
toString(): string;
|
|
39
|
-
/**
|
|
140
|
+
/**
|
|
141
|
+
* number 로 변환. / Convert to a number.
|
|
142
|
+
*
|
|
143
|
+
* ⚠️ 정밀도 손실 주의 — 표시/차트 등 근사 용도 전용, 정확 계산엔 쓰지 말 것.
|
|
144
|
+
* / ⚠️ Lossy — for display/chart approximations only; do not use for exact math.
|
|
145
|
+
*
|
|
146
|
+
* @returns 근사 number 값 / The approximate number value
|
|
147
|
+
*/
|
|
40
148
|
toNumber(): number;
|
|
41
|
-
/**
|
|
149
|
+
/**
|
|
150
|
+
* 정확한 합산(내부적으로 BigInt 정수 연산). / Exact summation (BigInt integer arithmetic internally).
|
|
151
|
+
*
|
|
152
|
+
* @param arr - 합산할 값 배열 / Values to sum
|
|
153
|
+
* @returns 합계 OGDecimal(빈 배열 → 0) / The sum (empty array → 0)
|
|
154
|
+
*/
|
|
42
155
|
static sum(arr: OGDecimalLike[]): OGDecimal;
|
|
43
|
-
/**
|
|
156
|
+
/**
|
|
157
|
+
* 정확한 평균. / Exact average.
|
|
158
|
+
*
|
|
159
|
+
* @param arr - 평균 낼 값 배열 / Values to average
|
|
160
|
+
* @param precision - 나눗셈 소수점 자리수(기본 20) / Division decimal places (default 20)
|
|
161
|
+
* @returns 평균 OGDecimal(빈 배열 → 0) / The average (empty array → 0)
|
|
162
|
+
*/
|
|
44
163
|
static avg(arr: OGDecimalLike[], precision?: number): OGDecimal;
|
|
45
|
-
/**
|
|
164
|
+
/**
|
|
165
|
+
* 배열 최솟값. / Minimum of an array.
|
|
166
|
+
*
|
|
167
|
+
* @param arr - 값 배열(비어 있으면 예외) / Values (throws if empty)
|
|
168
|
+
* @returns 최솟값 OGDecimal / The minimum value
|
|
169
|
+
* @throws 빈 배열이면 Error / Error when the array is empty
|
|
170
|
+
*/
|
|
46
171
|
static min(arr: OGDecimalLike[]): OGDecimal;
|
|
47
|
-
/**
|
|
172
|
+
/**
|
|
173
|
+
* 배열 최댓값. / Maximum of an array.
|
|
174
|
+
*
|
|
175
|
+
* @param arr - 값 배열(비어 있으면 예외) / Values (throws if empty)
|
|
176
|
+
* @returns 최댓값 OGDecimal / The maximum value
|
|
177
|
+
* @throws 빈 배열이면 Error / Error when the array is empty
|
|
178
|
+
*/
|
|
48
179
|
static max(arr: OGDecimalLike[]): OGDecimal;
|
|
49
180
|
}
|
|
@@ -11,6 +11,23 @@ import { ChartConfig } from './chart/types.js';
|
|
|
11
11
|
import { OverrideLayer } from './OverrideKernel.js';
|
|
12
12
|
import { ExtensionPointRegistry } from './ExtensionPointRegistry.js';
|
|
13
13
|
import { FormulaErrorCode } from './formula/types.js';
|
|
14
|
+
import { CFRule } from './cf/CFRule.js';
|
|
15
|
+
import { IRealtimeSource, RealtimeController, RtAnnounceSummary, FrameScheduler } from './realtime/index.js';
|
|
16
|
+
/**
|
|
17
|
+
* `setRealtimeSource` 옵션(DD-07). 전부 옵션 — 미지정 시 안전 기본값. / Options for `setRealtimeSource`; all optional.
|
|
18
|
+
*/
|
|
19
|
+
export interface RealtimeWireOptions {
|
|
20
|
+
/** 프레임당 최대 적용 셀 수(백프레셔). / Max cells applied per frame (backpressure). */
|
|
21
|
+
maxBatchPerFrame?: number;
|
|
22
|
+
/** 프레임 스케줄러 주입(헤드리스/테스트 결정론). 기본=rAF/폴백. / Injected frame scheduler; default rAF/fallback. */
|
|
23
|
+
scheduleFrame?: FrameScheduler;
|
|
24
|
+
/** stale 판정 임계(ms). 기본 5000. / Stale threshold(ms); default 5000. */
|
|
25
|
+
staleAfterMs?: number;
|
|
26
|
+
/** SR 규모요약 핸드오프(DD-12 aria-live). 미지정=no-op(경계 준수). / SR summary handoff; default no-op. */
|
|
27
|
+
announce?: (summary: RtAnnounceSummary) => void;
|
|
28
|
+
/** SR 디바운스 윈도우(ms). 기본 500. / SR debounce window(ms); default 500. */
|
|
29
|
+
debounceMs?: number;
|
|
30
|
+
}
|
|
14
31
|
/**
|
|
15
32
|
* OPEN_GRID 코어 그리드 클래스. / The OPEN_GRID core grid class.
|
|
16
33
|
*
|
|
@@ -90,6 +107,18 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
90
107
|
private _recalc;
|
|
91
108
|
/** F3(C2): writeCell 단건 쓰기가 쌓아두는 dirty seed. endBatch/즉시 flush 시 onValuesChanged 1회로 소비. */
|
|
92
109
|
private _formulaDirtySeeds;
|
|
110
|
+
/** CF 엔진(동적 import 로 조립). 미설정=null → applyCF 콜백 즉시 return(byte-identical). / CF engine (lazily assembled). */
|
|
111
|
+
private _cf;
|
|
112
|
+
/** 컬럼별 통계 캐시(per-render 재계산 금지 — setConditionalFormat/데이터변경 시에만 갱신). / Per-column stats cache. */
|
|
113
|
+
private _cfStats;
|
|
114
|
+
/** 현재 적용된 CF 규칙(데이터 변경 시 통계 재계산에 재사용). / Currently applied CF rules. */
|
|
115
|
+
private _cfRules;
|
|
116
|
+
/** CF 색 시드 읽기 포트(동적 import 후 보관 — cf/ 정적 참조 회피로 별 청크 유지). / CF appearance read port. */
|
|
117
|
+
private _cfAppearance;
|
|
118
|
+
/** CF 통계 계산기(cf/ 동적 청크에서 보관 — 동기 재계산용, cf/ 정적 참조 회피). / CF stats computer captured from the dynamic chunk. */
|
|
119
|
+
private _cfComputeStats;
|
|
120
|
+
/** RT 컨트롤러(동적 import 로 조립). 미설정=null → 실시간 미배선(byte-identical). / Realtime controller (lazily assembled). */
|
|
121
|
+
private _rt;
|
|
93
122
|
private _ovk;
|
|
94
123
|
/** 공개 override API (호출가능 + .strategy). 생성자 말미에 부착. / Public override API (callable + .strategy). Attached at the end of the constructor. */
|
|
95
124
|
override: OverrideApi<T>;
|
|
@@ -335,6 +364,51 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
335
364
|
pushData(data: T[]): void;
|
|
336
365
|
/** 데이터 앞에 행들을 추가한다. / Prepend rows before the existing data. */
|
|
337
366
|
prefixData(data: T[]): void;
|
|
367
|
+
/**
|
|
368
|
+
* 조건부서식(CF) 규칙을 설정한다 — 데이터바·히트맵·아이콘셋을 렌더 경로에 배선한다.
|
|
369
|
+
* CF 는 opt-in 이라 첫 호출 때 CF 엔진(cf/**)을 **동적 import** 로 조립한다(베이스 번들 무증가, 별 청크).
|
|
370
|
+
* 규칙이 걸린 컬럼마다 컬럼 통계를 1회 캐시 계산(per-render 재계산 금지)한 뒤 재렌더한다.
|
|
371
|
+
* `rules=[]` 를 넘기면 CF 를 해제한다(엔진·통계 캐시 clear + 잔재 제거 재렌더).
|
|
372
|
+
* / Set conditional-formatting rules — wires data-bars/heatmaps/icon-sets into the render path.
|
|
373
|
+
* CF is opt-in; the CF engine (cf/**) is assembled via **dynamic import** on first call (no base-bundle
|
|
374
|
+
* growth, separate chunk). Column stats are cached once per rule-bearing column (never re-computed
|
|
375
|
+
* per render), then a re-render paints them. Passing `rules=[]` clears CF (engine/cache reset + residue-stripping re-render).
|
|
376
|
+
*
|
|
377
|
+
* @param rules - CF 규칙 배열(빈 배열이면 해제) / CF rule array (empty array clears CF)
|
|
378
|
+
* @example
|
|
379
|
+
* await grid.setConditionalFormat([
|
|
380
|
+
* { id: 'bar', when: { type: 'compare', op: '>=', a: 0 }, encode: { kind: 'bar', axis: 'zero' }, scope: { columnId: 'amount' }, priority: 0 },
|
|
381
|
+
* ]);
|
|
382
|
+
*/
|
|
383
|
+
setConditionalFormat(rules: CFRule[]): Promise<void>;
|
|
384
|
+
/**
|
|
385
|
+
* CF 규칙이 걸린 컬럼마다 현재 데이터로 컬럼 통계를 계산해 캐시한다(per-render 재계산 금지의 근거).
|
|
386
|
+
* 통계 계산기는 setConditionalFormat 에서 cf/ 동적 청크로부터 보관한 참조를 동기 사용한다.
|
|
387
|
+
* / Recompute & cache per-column CF stats using the computer captured from the cf/ dynamic chunk.
|
|
388
|
+
*/
|
|
389
|
+
private _recomputeCFStats;
|
|
390
|
+
/**
|
|
391
|
+
* 실시간 데이터 소스를 그리드에 배선한다(폴링/스트리밍/커스텀 — `IRealtimeSource` 구현 아무거나 DI).
|
|
392
|
+
* CF 와 동일하게 첫 호출 시에만 realtime/ 를 동적 import(별 청크·베이스 번들 무증가). 델타는 기존
|
|
393
|
+
* 단일 쓰기 경로(MutationService)를 재사용해 적용되므로 증분=전체 불변식·수식 재계산·차트 라이브
|
|
394
|
+
* 갱신(dataChange 구독)을 자연 상속한다. 재호출 시 이전 소스는 detach 후 교체.
|
|
395
|
+
* / Wire a realtime source (polling/streaming/custom — any `IRealtimeSource` via DI). Like CF, the
|
|
396
|
+
* realtime/ chunk is dynamically imported only on first call (separate chunk; base bundle unchanged).
|
|
397
|
+
* Deltas reuse the existing single write path (MutationService), inheriting the incremental=full
|
|
398
|
+
* invariant, formula recompute, and live chart refresh (dataChange subscription). Re-calling
|
|
399
|
+
* detaches and replaces the previous source.
|
|
400
|
+
*
|
|
401
|
+
* @param source - 실시간 소스(예: `new PollingSource({...})`) / Realtime source (e.g. `new PollingSource({...})`)
|
|
402
|
+
* @param opts - 백프레셔·신선도·SR 옵션(전부 옵션) / Backpressure/freshness/SR options (all optional)
|
|
403
|
+
* @returns 배선된 컨트롤러(`.connection`·`.backpressureStats`·`.onConnection`·`.detach()`) / The wired controller
|
|
404
|
+
* @example
|
|
405
|
+
* const src = new PollingSource({ intervalMs: 1000, fetcher: async () => ({ kind: 'delta', seq, cells }) });
|
|
406
|
+
* const rt = await grid.setRealtimeSource(src);
|
|
407
|
+
* rt.onConnection((s) => console.log(s.status));
|
|
408
|
+
*/
|
|
409
|
+
setRealtimeSource(source: IRealtimeSource<T>, opts?: RealtimeWireOptions): Promise<RealtimeController<T>>;
|
|
410
|
+
/** 실시간 소스 배선을 해제한다(구독·타이머·소켓 정리, 멱등). / Disconnect the realtime source (teardown; idempotent). */
|
|
411
|
+
disconnectRealtime(): void;
|
|
338
412
|
/** 모든 행을 제거한다(컬럼·옵션 유지). / Remove all rows (columns & options kept). */
|
|
339
413
|
clearData(): void;
|
|
340
414
|
/**
|
|
@@ -744,6 +818,31 @@ export declare class OpenGrid<T extends Record<string, any> = any> extends Event
|
|
|
744
818
|
* color⊥form orthogonality (throws).
|
|
745
819
|
*/
|
|
746
820
|
setSkinVar(k: string, v: string): void;
|
|
821
|
+
/**
|
|
822
|
+
* DD-11 S2b: 밀도(DENSITY 축, 제4 외관축) 전환 — data-og-density + `--og-density-*` 토큰(순수 additive).
|
|
823
|
+
* `densityRegistry.resolve(name)` 로 델타를 얻어 ①attr(named=설정, default/미등록=속성 제거로 byte-identical)
|
|
824
|
+
* ②밀도 이름공간 토큰을 컨테이너 인라인 CSS 변수로 ③행높이 브리지(`--og-density-row-height` → base.css 가
|
|
825
|
+
* 소비하는 `--og-row-height` 로 미러) ④`requiresRelayout` 이면 **리사이즈와 동일 경로**(`_onResize`)로 좌표
|
|
826
|
+
* 재파생(신규 relayout 로직 없음). 색⊥형태⊥밀도⊥질감 직교라 theme/skin attr·토큰을 건드리지 않는다.
|
|
827
|
+
* 미등록 name 은 never-throw(빈 델타 폴백 = default 취급). ⚠️ 밀도 10만행 relayout 실측은 S3 도커 이연.
|
|
828
|
+
* / DD-11 S2b: switch the density axis (4th appearance axis) — additive `data-og-density` + `--og-density-*`
|
|
829
|
+
* tokens. Named → set attr/tokens (+ mirror row-height, + relayout via the resize path); default/unknown →
|
|
830
|
+
* remove attr and reset the density namespace (byte-identical). Orthogonal to theme/skin. Never throws.
|
|
831
|
+
*
|
|
832
|
+
* @param name - 밀도 값 id(예 'compact', 'comfortable') / Density value id (e.g. 'compact')
|
|
833
|
+
*/
|
|
834
|
+
setDensity(name: string): void;
|
|
835
|
+
/**
|
|
836
|
+
* DD-11 S2b: 질감(TEXTURE 축, 제3 외관축) 전환 — data-og-texture + `--og-texture-*` 토큰(순수 additive).
|
|
837
|
+
* `textureRegistry.resolve(name)` 로 델타를 얻어 attr(named=설정, default/미등록=제거) + 질감 이름공간
|
|
838
|
+
* CSS 변수만 적용한다. 질감은 배경 페인트만이라 relayout 없음(좌표 불변). 색·형태·밀도 축과 직교.
|
|
839
|
+
* 미등록 name 은 never-throw(빈 델타 폴백). ⚠️ 질감 실렌더 육안 확인은 S3 도커 이연.
|
|
840
|
+
* / DD-11 S2b: switch the texture axis (3rd appearance axis) — additive `data-og-texture` + `--og-texture-*`
|
|
841
|
+
* tokens only. Background paint only → no relayout. Orthogonal to color/form/density. Never throws.
|
|
842
|
+
*
|
|
843
|
+
* @param name - 질감 값 id(예 'linen', 'paper-grain', 'graph') / Texture value id (e.g. 'linen')
|
|
844
|
+
*/
|
|
845
|
+
setTexture(name: string): void;
|
|
747
846
|
/**
|
|
748
847
|
* 트리거 등록('before:{op}' 취소 가능, 'after:{op}' 결과 수신). / Register a trigger
|
|
749
848
|
* ('before:{op}' can cancel, 'after:{op}' receives the result).
|
|
@@ -1,18 +1,55 @@
|
|
|
1
1
|
import { ColumnDef } from './types.js';
|
|
2
|
+
/** 피벗 집계 방식. / Pivot aggregation method. */
|
|
2
3
|
export type PivotAgg = 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX';
|
|
4
|
+
/** 피벗 연산 설정. / Pivot computation configuration. */
|
|
3
5
|
export interface PivotConfig {
|
|
6
|
+
/** 행 축 필드명 목록. / Row-axis field names. */
|
|
4
7
|
rowFields: string[];
|
|
8
|
+
/** 열 축 필드명 목록. / Column-axis field names. */
|
|
5
9
|
colFields: string[];
|
|
10
|
+
/** 집계 대상 값 필드 목록. / Value fields to aggregate. */
|
|
6
11
|
valueFields: string[];
|
|
12
|
+
/** 집계 방식(기본 SUM). / Aggregation method (default SUM). */
|
|
7
13
|
agg?: PivotAgg;
|
|
14
|
+
/** 숫자 포맷 패턴. / Number format pattern. */
|
|
8
15
|
format?: string;
|
|
9
16
|
}
|
|
17
|
+
/** 피벗 연산 결과 — OpenGrid 에 바로 바인딩 가능. / Pivot result — directly bindable to OpenGrid. */
|
|
10
18
|
export interface PivotResult {
|
|
19
|
+
/** 생성된 컬럼 정의(행 축 + 동적 값 컬럼). / Generated column defs (row axis + dynamic value columns). */
|
|
11
20
|
columns: ColumnDef[];
|
|
21
|
+
/** 피벗 데이터 행(합계 행 포함 가능). / Pivot data rows (may include a totals row). */
|
|
12
22
|
data: any[];
|
|
23
|
+
/** 동적 컬럼 키 조합 목록(UI 참조용). / Dynamic column key combinations (for UI reference). */
|
|
13
24
|
colKeys: string[][];
|
|
14
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* 피벗 테이블 연산 엔진(레이어: Algorithm, 순수 함수). / Pivot-table computation engine (layer: Algorithm, pure function).
|
|
28
|
+
*
|
|
29
|
+
* 행/열/값 필드를 지정하면 데이터를 교차 집계하여 OpenGrid 에 바로 바인딩 가능한 columns+data 를 반환한다.
|
|
30
|
+
* / Given row/column/value fields, cross-aggregates the data and returns columns+data that bind
|
|
31
|
+
* directly to OpenGrid.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* const result = new PivotEngine().compute(rows, {
|
|
35
|
+
* rowFields: ['region'], colFields: ['quarter'], valueFields: ['amount'], agg: 'SUM',
|
|
36
|
+
* });
|
|
37
|
+
* grid.setColumns(result.columns); grid.setData(result.data);
|
|
38
|
+
*/
|
|
15
39
|
export declare class PivotEngine {
|
|
40
|
+
/**
|
|
41
|
+
* 피벗 연산 실행 — 교차 집계 columns+data 생성. / Run the pivot — produces cross-aggregated columns+data.
|
|
42
|
+
*
|
|
43
|
+
* 열 축 유니크 값의 카르테시안 곱으로 동적 컬럼을 만들고, 행 축으로 그룹화해 집계한다.
|
|
44
|
+
* 결과 행이 2개 이상이면 총계 행을 덧붙인다(총계 라벨은 전역 로케일로 해석).
|
|
45
|
+
* / Builds dynamic columns from the Cartesian product of column-axis unique values, groups by the
|
|
46
|
+
* row axis, and aggregates. Appends a totals row when more than one result row exists (the
|
|
47
|
+
* totals label is resolved via the global locale).
|
|
48
|
+
*
|
|
49
|
+
* @param data - 원본 행 배열 / Source rows
|
|
50
|
+
* @param config - 행/열/값 필드 및 집계 설정 / Row/column/value fields and aggregation settings
|
|
51
|
+
* @returns 컬럼·데이터·컬럼키 조합 / Columns, data, and column-key combinations
|
|
52
|
+
*/
|
|
16
53
|
compute(data: any[], config: PivotConfig): PivotResult;
|
|
17
54
|
private _cartesian;
|
|
18
55
|
private _aggregate;
|
|
@@ -1,38 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 행 재정렬이 확정됐을 때 호출되는 콜백. / Callback fired when a row reorder is committed.
|
|
3
|
+
*
|
|
4
|
+
* @param fromIndex - 이동 전 행의 flat index / Flat index of the row before the move
|
|
5
|
+
* @param toIndex - 이동 후 삽입 위치 flat index / Flat index of the insertion position after the move
|
|
6
|
+
*/
|
|
1
7
|
export type RowDropCallback = (fromIndex: number, toIndex: number) => void;
|
|
2
|
-
/** 커서 좌표로 다른 그리드의 바디를 찾는
|
|
8
|
+
/** 커서 좌표로 다른 그리드의 바디를 찾는 해석기의 결과. / Result of resolving another grid's body from cursor coordinates. */
|
|
3
9
|
export interface CrossGridResolveResult {
|
|
10
|
+
/** 대상 그리드의 바디 요소. / Body element of the target grid. */
|
|
4
11
|
bodyEl: HTMLElement;
|
|
12
|
+
/** 대상 그리드의 행 높이(px). / Row height of the target grid (px). */
|
|
5
13
|
rowHeight: number;
|
|
14
|
+
/** 대상 그리드의 전체 행 수. / Total number of rows in the target grid. */
|
|
6
15
|
totalRows: number;
|
|
7
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* 그리드 간 드래그(crossGrid) 판정을 주입하는 설정.
|
|
19
|
+
* / Configuration that injects cross-grid drag resolution.
|
|
20
|
+
*/
|
|
8
21
|
export interface CrossGridConfig {
|
|
9
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* 커서 위치(x,y)에 있는 다른(crossGrid 허용) 그리드 바디 정보 반환. 없으면 null.
|
|
24
|
+
* / Return the body info of another (crossGrid-enabled) grid at cursor position (x,y); null if none.
|
|
25
|
+
*
|
|
26
|
+
* @param clientX - 커서 X(clientX) / Cursor X (clientX)
|
|
27
|
+
* @param clientY - 커서 Y(clientY) / Cursor Y (clientY)
|
|
28
|
+
* @returns 대상 그리드 정보 또는 null / Target grid info, or null
|
|
29
|
+
*/
|
|
10
30
|
resolveTarget: (clientX: number, clientY: number) => CrossGridResolveResult | null;
|
|
11
|
-
/**
|
|
31
|
+
/**
|
|
32
|
+
* 다른 그리드로 드롭됐을 때 호출 (소스 fromIndex, 타깃 바디, 타깃 삽입 인덱스).
|
|
33
|
+
* / Called when dropped onto another grid (source fromIndex, target body, target insertion index).
|
|
34
|
+
*
|
|
35
|
+
* @param fromIndex - 소스 그리드에서의 행 flat index / Row flat index in the source grid
|
|
36
|
+
* @param targetBodyEl - 드롭 대상 그리드의 바디 / Body of the drop target grid
|
|
37
|
+
* @param targetIndex - 대상 그리드의 삽입 인덱스 / Insertion index in the target grid
|
|
38
|
+
*/
|
|
12
39
|
onCrossDrop: (fromIndex: number, targetBodyEl: HTMLElement, targetIndex: number) => void;
|
|
13
40
|
}
|
|
14
41
|
/**
|
|
15
42
|
* 행 드래그앤드롭 관리자 (순수 DnD).
|
|
16
43
|
* 행 DOM에 드래그 핸들을 심고, 고스트/인디케이터로 위치를 표시한 뒤 콜백으로 알림.
|
|
17
44
|
* 그리드 간 이동 판정(타깃 그리드 해석)은 주입된 CrossGridConfig 에 위임한다.
|
|
45
|
+
* / Row drag-and-drop manager (pure DnD).
|
|
46
|
+
* Plants a drag handle into row DOM, shows position via ghost/indicator, then notifies through
|
|
47
|
+
* callbacks. Cross-grid move resolution (target grid lookup) is delegated to the injected
|
|
48
|
+
* CrossGridConfig.
|
|
49
|
+
*
|
|
50
|
+
* @param _bodyEl - 이 관리자가 담당하는 그리드 바디 / Grid body this manager owns
|
|
51
|
+
* @param _rowHeight - 행 높이(px) / Row height (px)
|
|
52
|
+
* @param _onDrop - 자기 그리드 내 재정렬 확정 콜백 / Callback for a committed in-grid reorder
|
|
53
|
+
* @param _cross - 그리드 간 드래그 설정(없으면 자기 그리드 내로 제한) / Cross-grid config (null limits to in-grid)
|
|
54
|
+
* @param _getDragCount - fromIndex 기준 함께 드래그할 행 수 계산기(멀티행 배지용) / Computes rows dragged together from fromIndex (for the multi-row badge)
|
|
18
55
|
*/
|
|
19
56
|
export declare class RowDragDrop {
|
|
20
57
|
private _bodyEl;
|
|
21
58
|
private _rowHeight;
|
|
22
59
|
private _onDrop;
|
|
23
60
|
private _cross;
|
|
24
|
-
/** fromIndex 기준 함께 드래그할 행 수(멀티행 배지용). 기본 1 */
|
|
61
|
+
/** fromIndex 기준 함께 드래그할 행 수(멀티행 배지용). 기본 1 / Rows dragged together from fromIndex (multi-row badge). Default 1 */
|
|
25
62
|
private _getDragCount;
|
|
26
63
|
private _drag;
|
|
27
64
|
private readonly _selfIndicator;
|
|
28
65
|
private readonly _crossIndicator;
|
|
29
66
|
constructor(_bodyEl: HTMLElement, _rowHeight: number, _onDrop: RowDropCallback, _cross?: CrossGridConfig | null,
|
|
30
|
-
/** fromIndex 기준 함께 드래그할 행 수(멀티행 배지용). 기본 1 */
|
|
67
|
+
/** fromIndex 기준 함께 드래그할 행 수(멀티행 배지용). 기본 1 / Rows dragged together from fromIndex (multi-row badge). Default 1 */
|
|
31
68
|
_getDragCount?: (fromIndex: number) => number);
|
|
32
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* 행 엘리먼트에 드래그 핸들 삽입.
|
|
71
|
+
* / Insert a drag handle into a row element.
|
|
72
|
+
*
|
|
73
|
+
* @param rowEl - 핸들을 붙일 행 요소 / Row element to attach the handle to
|
|
74
|
+
* @param rowIndex - 해당 행의 flat index / Flat index of that row
|
|
75
|
+
* @param totalRows - 현재 전체 행 수(경계 클램프용) / Current total row count (for boundary clamping)
|
|
76
|
+
* @returns 생성된 드래그 핸들 요소 / The created drag handle element
|
|
77
|
+
*/
|
|
33
78
|
attachHandle(rowEl: HTMLElement, rowIndex: number, totalRows: number): HTMLElement;
|
|
34
79
|
private _startDrag;
|
|
35
80
|
private _onMouseMove;
|
|
36
81
|
private _onMouseUp;
|
|
82
|
+
/** 전역 리스너 해제 + 진행 중 드래그/인디케이터 정리. / Detach global listeners + clean up any in-progress drag/indicators. */
|
|
37
83
|
destroy(): void;
|
|
38
84
|
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { SkinTokenDelta } from './types.js';
|
|
2
|
+
/** 허용되는 FORM 토큰 이름(SkinTokenName 과 동일 집합의 런타임 가드).
|
|
3
|
+
* export 이유(DD-11): 테마 델타의 대칭 검증 `assertColorOnly` 가 이 집합을 denylist 로 재사용해
|
|
4
|
+
* 색축⊥형태축을 양방향으로 기계강제한다(형태/밀도/질감 shape 토큰이 테마 델타에 오면 거부). */
|
|
5
|
+
export declare const FORM_TOKENS: ReadonlySet<string>;
|
|
2
6
|
/** 스킨 정의 결과. / Result of a skin definition. */
|
|
3
7
|
export interface SkinDefineResult {
|
|
4
8
|
/** 실제 등록된(가드레일 클램프가 반영된) 델타. / The actually registered delta (with guardrail clamps applied). */
|
|
@@ -1,34 +1,88 @@
|
|
|
1
|
+
/** 트리 노드 — 원본 행 데이터에 계층·펼침·라인 렌더 메타를 얹은 래퍼. / A tree node — wraps a row with hierarchy, expansion, and line-render metadata. */
|
|
1
2
|
export interface TreeNode<T = any> {
|
|
3
|
+
/** 트리 노드 판별 플래그(항상 true). / Tree-node discriminant flag (always true). */
|
|
2
4
|
_isTree: true;
|
|
5
|
+
/** 노드 id(idField 값). / Node id (value of `idField`). */
|
|
3
6
|
_treeId: any;
|
|
7
|
+
/** 부모 노드 id(parentIdField 값). / Parent node id (value of `parentIdField`). */
|
|
4
8
|
_treeParentId: any;
|
|
9
|
+
/** 트리 깊이(루트 0). / Tree depth (root is 0). */
|
|
5
10
|
_depth: number;
|
|
11
|
+
/** 펼침 여부. / Whether the node is expanded. */
|
|
6
12
|
_expanded: boolean;
|
|
13
|
+
/** 자식 보유 여부. / Whether the node has children. */
|
|
7
14
|
_hasChildren: boolean;
|
|
15
|
+
/** 하위 전체(후손) 노드 수. / Total descendant node count. */
|
|
8
16
|
_childCount: number;
|
|
17
|
+
/** true → └─ / false → ├─. / true → └─, false → ├─. */
|
|
9
18
|
_isLastChild: boolean;
|
|
19
|
+
/** [d]=true → 깊이 d 조상에 형제가 더 있어 │ 라인 표시. / `[d]=true` → an ancestor at depth d has more siblings, so draw a │ line. */
|
|
10
20
|
_ancestorHasMore: boolean[];
|
|
21
|
+
/** 원본 행 데이터. / The original row data. */
|
|
11
22
|
data: T;
|
|
23
|
+
/** 자식 노드 배열. / Child nodes. */
|
|
12
24
|
children: TreeNode<T>[];
|
|
13
25
|
}
|
|
26
|
+
/** 트리 항목 별칭(=TreeNode). / Tree item alias (= TreeNode). */
|
|
14
27
|
export type TreeItem<T> = TreeNode<T>;
|
|
28
|
+
/**
|
|
29
|
+
* 값이 트리 노드인지 판별하는 타입 가드. / Type guard: whether a value is a tree node.
|
|
30
|
+
*
|
|
31
|
+
* @typeParam T - 행 데이터 타입 / Row data type
|
|
32
|
+
* @param item - 검사할 값 / Value to test
|
|
33
|
+
* @returns 트리 노드이면 true / true if the value is a tree node
|
|
34
|
+
*/
|
|
15
35
|
export declare function isTreeNode<T>(item: any): item is TreeNode<T>;
|
|
36
|
+
/** 트리 빌드 옵션. / Options for building a tree. */
|
|
16
37
|
export interface TreeBuildOptions {
|
|
38
|
+
/** 노드 id 필드명. / Field name holding the node id. */
|
|
17
39
|
idField: string;
|
|
40
|
+
/** 부모 id 필드명. / Field name holding the parent id. */
|
|
18
41
|
parentIdField: string;
|
|
42
|
+
/** 로드 시 전체 펼침 여부(기본 false). / Whether to expand all on load (default false). */
|
|
19
43
|
expandOnLoad?: boolean;
|
|
20
44
|
}
|
|
21
45
|
/**
|
|
22
|
-
* flat 데이터를 트리 구조로 변환.
|
|
23
|
-
*
|
|
46
|
+
* flat 데이터를 트리 구조로 변환. / Convert flat data into a tree structure.
|
|
47
|
+
*
|
|
48
|
+
* parentId가 null/undefined/'' 또는 미존재인 행이 루트 노드가 된다. 깊이·후손 수·
|
|
49
|
+
* 탐색기 라인 메타(_isLastChild, _ancestorHasMore)를 함께 계산한다.
|
|
50
|
+
* / Rows whose parentId is null/undefined/'' or missing become root nodes. Also computes depth,
|
|
51
|
+
* descendant counts, and explorer line metadata (_isLastChild, _ancestorHasMore).
|
|
52
|
+
*
|
|
53
|
+
* @typeParam T - 행 데이터 타입 / Row data type
|
|
54
|
+
* @param data - flat 행 배열 / Flat rows
|
|
55
|
+
* @param opts - id/parentId 필드 및 펼침 옵션 / id/parentId fields and expand option
|
|
56
|
+
* @param expandedKeys - 펼침 상태 노드 id 집합 / Set of expanded node ids
|
|
57
|
+
* @returns 루트 노드 배열 / Array of root nodes
|
|
58
|
+
* @example
|
|
59
|
+
* const roots = buildTree(rows, { idField: 'id', parentIdField: 'pid' });
|
|
60
|
+
* const flat = flattenTree(roots); // 화면 표시용 / for on-screen display
|
|
24
61
|
*/
|
|
25
62
|
export declare function buildTree<T extends Record<string, any>>(data: T[], opts: TreeBuildOptions, expandedKeys?: Set<any>): TreeNode<T>[];
|
|
26
63
|
/**
|
|
27
|
-
* 트리를 화면에 표시할 flat 배열로 변환.
|
|
28
|
-
*
|
|
64
|
+
* 트리를 화면에 표시할 flat 배열로 변환. / Flatten a tree into a display array.
|
|
65
|
+
*
|
|
66
|
+
* 접힌 노드(_expanded=false)의 자식은 제외. / Children of collapsed nodes (_expanded=false) are excluded.
|
|
67
|
+
*
|
|
68
|
+
* @typeParam T - 행 데이터 타입 / Row data type
|
|
69
|
+
* @param nodes - 루트 노드 배열 / Root nodes
|
|
70
|
+
* @returns 펼침 상태에 따른 표시 노드 배열 / Visible nodes according to expansion state
|
|
29
71
|
*/
|
|
30
72
|
export declare function flattenTree<T>(nodes: TreeNode<T>[]): TreeNode<T>[];
|
|
31
|
-
/**
|
|
73
|
+
/**
|
|
74
|
+
* 특정 id 노드의 펼침 상태 토글. / Toggle the expansion state of a node id.
|
|
75
|
+
*
|
|
76
|
+
* @typeParam T - 행 데이터 타입 / Row data type
|
|
77
|
+
* @param expandedKeys - 펼침 상태 집합(제자리 변경) / Set of expanded ids (mutated in place)
|
|
78
|
+
* @param nodeId - 토글할 노드 id / Node id to toggle
|
|
79
|
+
*/
|
|
32
80
|
export declare function toggleTreeNode<T>(expandedKeys: Set<any>, nodeId: any): void;
|
|
33
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* 모든 노드 id 수집(전체 펼침/접기 등에 사용). / Collect every node id (used for expand-all/collapse-all).
|
|
83
|
+
*
|
|
84
|
+
* @typeParam T - 행 데이터 타입 / Row data type
|
|
85
|
+
* @param nodes - 루트 노드 배열 / Root nodes
|
|
86
|
+
* @returns 후손 포함 전체 노드 id 배열 / All node ids including descendants
|
|
87
|
+
*/
|
|
34
88
|
export declare function collectAllTreeIds<T>(nodes: TreeNode<T>[]): any[];
|