open-grid 1.6.1 → 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/ExportProgressView-BYPw8osg.cjs +2 -0
  3. package/dist/ExportProgressView-Bt5-z7rE.js +2 -0
  4. package/dist/LcpMergeOrderer-CeP6C6G1.cjs +2 -0
  5. package/dist/LcpMergeOrderer-Ebwuir-r.js +2 -0
  6. package/dist/OpenGrid-Bh1NMOcm.cjs +98 -0
  7. package/dist/OpenGrid-CeXt04ho.js +98 -0
  8. package/dist/Registry-CrT46EAO.js +2 -0
  9. package/dist/Registry-DpHOpU5V.cjs +2 -0
  10. package/dist/XlsxChannel-CuOZ3LQz.js +2 -0
  11. package/dist/XlsxChannel-DQHLGend.cjs +2 -0
  12. package/dist/XlsxWorkbookWriter-DixuNGtw.cjs +3 -0
  13. package/dist/XlsxWorkbookWriter-VgbibI0Z.js +3 -0
  14. package/dist/fflate-Cs3txMgg.js +2 -0
  15. package/dist/fflate-G9RAFEgF.cjs +2 -0
  16. package/dist/index-1OXjJmct.js +2 -0
  17. package/dist/index-B5V7e4Xc.js +2 -0
  18. package/dist/index-DbKDox8y.cjs +2 -0
  19. package/dist/index-HaDoF1HM.cjs +2 -0
  20. package/dist/open-grid-react.cjs +1 -27
  21. package/dist/open-grid-react.js +1 -30
  22. package/dist/open-grid-vue.cjs +1 -31
  23. package/dist/open-grid-vue.js +1 -33
  24. package/dist/open-grid.cjs +6 -275
  25. package/dist/open-grid.js +6 -293
  26. package/dist/sinks-BCZFMGQJ.cjs +2 -0
  27. package/dist/sinks-qkBJ5bKn.js +2 -0
  28. package/dist/types/core/CFRenderBridge.d.ts +5 -1
  29. package/dist/types/core/CellEditManager.d.ts +26 -2
  30. package/dist/types/core/CellEventHandler.d.ts +6 -2
  31. package/dist/types/core/ColumnLayout.d.ts +8 -0
  32. package/dist/types/core/DataLayer.d.ts +48 -1
  33. package/dist/types/core/DetailManager.d.ts +43 -2
  34. package/dist/types/core/ExportManager.d.ts +25 -0
  35. package/dist/types/core/FindBarManager.d.ts +6 -2
  36. package/dist/types/core/FlatRowModel.d.ts +61 -3
  37. package/dist/types/core/FooterManager.d.ts +43 -1
  38. package/dist/types/core/FormulaController.d.ts +4 -4
  39. package/dist/types/core/GridComposer.d.ts +11 -1
  40. package/dist/types/core/GridRenderer.d.ts +84 -19
  41. package/dist/types/core/GroupTreeManager.d.ts +6 -4
  42. package/dist/types/core/KeyboardManager.d.ts +3 -2
  43. package/dist/types/core/MutationService.d.ts +10 -8
  44. package/dist/types/core/OpenGrid.d.ts +7 -5
  45. package/dist/types/core/RangeSelectionManager.d.ts +23 -2
  46. package/dist/types/core/RenderController.d.ts +126 -8
  47. package/dist/types/core/SortFilterManager.d.ts +10 -2
  48. package/dist/types/core/VirtualScroll.d.ts +12 -0
  49. package/dist/types/core/coordinate/CellTextPolicy.d.ts +58 -0
  50. package/dist/types/core/coordinate/ColumnGeometry.d.ts +60 -0
  51. package/dist/types/core/coordinate/ColumnWindow.d.ts +40 -0
  52. package/dist/types/core/coordinate/ColumnWindowPolicy.d.ts +89 -0
  53. package/dist/types/core/coordinate/ExtraColumns.d.ts +39 -0
  54. package/dist/types/core/coordinate/RangeRectCalculator.d.ts +35 -0
  55. package/dist/types/core/coordinate/ViewportHeightJudge.d.ts +28 -0
  56. package/dist/types/core/coordinate/geometryPorts.d.ts +250 -0
  57. package/dist/types/core/coordinate/ports.d.ts +5 -0
  58. package/dist/types/core/domain/footer/FooterValues.d.ts +50 -0
  59. package/dist/types/core/domain/footer/ports.d.ts +31 -0
  60. package/dist/types/core/domain/render/RenderPlanner.d.ts +17 -0
  61. package/dist/types/core/domain/render/RenderRequest.d.ts +91 -0
  62. package/dist/types/core/domain/render/ports.d.ts +169 -0
  63. package/dist/types/core/domain/resize/ResizeGesture.d.ts +25 -0
  64. package/dist/types/core/domain/resize/ResizeHitZone.d.ts +23 -0
  65. package/dist/types/core/domain/resize/ports.d.ts +64 -0
  66. package/dist/types/core/domain/sort/ComparisonOrderer.d.ts +11 -0
  67. package/dist/types/core/domain/sort/LcpMergeOrderer.d.ts +15 -0
  68. package/dist/types/core/domain/sort/RankIndex.d.ts +74 -0
  69. package/dist/types/core/domain/sort/SortCostEstimate.d.ts +36 -0
  70. package/dist/types/core/domain/sort/SortKeyColumn.d.ts +89 -0
  71. package/dist/types/core/domain/sort/SortKeyStore.d.ts +34 -0
  72. package/dist/types/core/domain/sort/Sorter.d.ts +54 -0
  73. package/dist/types/core/domain/sort/SyncSortRunner.d.ts +9 -0
  74. package/dist/types/core/domain/sort/commonPrefix.d.ts +5 -0
  75. package/dist/types/core/domain/sort/ports.d.ts +140 -0
  76. package/dist/types/core/export/ExportProgressView.d.ts +28 -0
  77. package/dist/types/core/export/channels/XlsxChannel.d.ts +38 -1
  78. package/dist/types/core/export/channels/XlsxRichTextRun.d.ts +14 -0
  79. package/dist/types/core/export/channels/XlsxSheetXml.d.ts +19 -0
  80. package/dist/types/core/export/channels/XlsxStyleEntries.d.ts +80 -0
  81. package/dist/types/core/export/channels/XlsxStylesRegistry.d.ts +20 -0
  82. package/dist/types/core/export/channels/XlsxWorkbookWriter.d.ts +20 -0
  83. package/dist/types/core/export/channels/XlsxXml.d.ts +6 -0
  84. package/dist/types/core/export/index.d.ts +2 -0
  85. package/dist/types/core/export/sinks.d.ts +81 -0
  86. package/dist/types/core/export/types.d.ts +63 -0
  87. package/dist/types/core/host/archCheck.d.ts +16 -1
  88. package/dist/types/core/i18n/locales/en.d.ts +6 -0
  89. package/dist/types/core/i18n/locales/ko.d.ts +6 -0
  90. package/dist/types/core/i18n/types.d.ts +8 -0
  91. package/dist/types/core/render/FooterView.d.ts +121 -0
  92. package/dist/types/core/render/GeometryApplier.d.ts +55 -0
  93. package/dist/types/core/render/HorizontalReveal.d.ts +26 -0
  94. package/dist/types/core/render/RangeOverlayAdapter.d.ts +10 -0
  95. package/dist/types/core/render/RenderScheduler.d.ts +225 -0
  96. package/dist/types/core/render/ResizeSinkAdapter.d.ts +35 -0
  97. package/dist/types/core/render/ScrollFollower.d.ts +34 -0
  98. package/dist/types/core/render/ScrollObserver.d.ts +47 -0
  99. package/dist/types/core/render/ScrollbarGutter.d.ts +19 -0
  100. package/dist/types/core/render/body/BodyEventRouter.d.ts +58 -0
  101. package/dist/types/core/render/body/BodyRowSet.d.ts +28 -0
  102. package/dist/types/core/render/body/BodyView.d.ts +185 -0
  103. package/dist/types/core/render/body/CellLocator.d.ts +36 -0
  104. package/dist/types/core/render/body/CellRegistry.d.ts +24 -0
  105. package/dist/types/core/render/body/ColumnPaintPlan.d.ts +19 -0
  106. package/dist/types/core/render/body/ExtraCellPainters.d.ts +20 -0
  107. package/dist/types/core/render/body/rows/BodyRowContext.d.ts +138 -0
  108. package/dist/types/core/render/body/rows/DataRowPainter.d.ts +58 -0
  109. package/dist/types/core/render/body/rows/DetailRowPainter.d.ts +24 -0
  110. package/dist/types/core/render/body/rows/GroupRowPainter.d.ts +32 -0
  111. package/dist/types/core/render/body/rows/RowPainterTable.d.ts +24 -0
  112. package/dist/types/core/render/body/rows/WindowLayout.d.ts +38 -0
  113. package/dist/types/core/render/dom.d.ts +10 -0
  114. package/dist/types/core/render/header/HeaderSortIndicator.d.ts +39 -0
  115. package/dist/types/core/render/header/HeaderView.d.ts +84 -0
  116. package/dist/types/core/render/header/ResizeHandleBinder.d.ts +110 -0
  117. package/dist/types/core/render/ports.d.ts +218 -0
  118. package/dist/types/core/renderers/CellRenderer.d.ts +7 -0
  119. package/dist/types/core/types.d.ts +94 -0
  120. package/dist/types/index.d.ts +1 -0
  121. package/dist/types/vue/OpenGrid.vue.d.ts +1 -1
  122. package/dist/xlsx.min-CMvrM6b4.cjs +138 -0
  123. package/dist/xlsx.min-i_b-4PvU.js +138 -0
  124. package/package.json +3 -8
  125. package/dist/OpenGrid-CLk8Vt7j.cjs +0 -7459
  126. package/dist/OpenGrid-D6YxCsnV.js +0 -7472
  127. package/dist/Registry-CPJYOqCn.js +0 -74
  128. package/dist/Registry-D74ZmdDz.cjs +0 -71
  129. package/dist/index-CeJ-0-80.cjs +0 -260
  130. package/dist/index-D0DJtKYI.cjs +0 -452
  131. package/dist/index-DnarQ4eR.js +0 -266
  132. package/dist/index-VkKgQ506.js +0 -481
  133. package/dist/xlsx.min-BQ1o3sB6.cjs +0 -11793
  134. package/dist/xlsx.min-Bbz2ZypC.js +0 -11794
@@ -1,481 +0,0 @@
1
- import { T as $ } from "./Registry-CPJYOqCn.js";
2
- import { p as ne, c as I } from "./OpenGrid-D6YxCsnV.js";
3
- function z(e) {
4
- return !!e && typeof e.ref == "string";
5
- }
6
- const N = 1;
7
- function re(e, t) {
8
- return JSON.stringify(e) === JSON.stringify(t);
9
- }
10
- function oe(e) {
11
- const t = (e == null ? void 0 : e.primary) ?? "#1976d2", n = (e == null ? void 0 : e.graphite) ?? "#3a3f45";
12
- return { rampFrom: (r) => r === "primary" ? t : n };
13
- }
14
- function se(e) {
15
- const t = [];
16
- for (const n of e) {
17
- const r = typeof n == "number" ? n : typeof n == "string" && n.trim() !== "" ? Number(n) : NaN;
18
- Number.isFinite(r) && t.push(r);
19
- }
20
- return t;
21
- }
22
- function ie(e) {
23
- const t = se(e), n = t.length;
24
- if (n === 0) return { count: 0, distinct: 0 };
25
- const r = [...t].sort((p, g) => p - g), s = r[0], o = r[n - 1], a = t.reduce((p, g) => p + g, 0) / n, c = t.reduce((p, g) => p + (g - a) ** 2, 0) / n, l = Math.sqrt(c), f = /* @__PURE__ */ new Map();
26
- for (const p of t) f.set(p, (f.get(p) ?? 0) + 1);
27
- const d = f.size;
28
- return { min: s, max: o, avg: a, stddev: l, count: n, distinct: d, rankOf: (p) => {
29
- let g = 0;
30
- for (const k of t) k > p && g++;
31
- return g + 1;
32
- }, rankAscOf: (p) => {
33
- let g = 0;
34
- for (const k of t) k < p && g++;
35
- return g + 1;
36
- }, percentileOf: (p) => {
37
- let g = 0;
38
- for (const k of t) k <= p && g++;
39
- return g / n;
40
- }, countOf: (p) => f.get(p) ?? 0 };
41
- }
42
- function Y(e) {
43
- const t = {};
44
- return e.min !== void 0 && (t.min = e.min), e.max !== void 0 && (t.max = e.max), e.avg !== void 0 && (t.avg = e.avg), e.stddev !== void 0 && (t.stddev = e.stddev), e.count !== void 0 && (t.count = e.count), e.distinct !== void 0 && (t.distinct = e.distinct), t;
45
- }
46
- function b(e) {
47
- return typeof e == "number" ? e : typeof e == "string" && e.trim() !== "" ? Number(e) : NaN;
48
- }
49
- const h = 864e5;
50
- function w(e) {
51
- const t = new Date(e);
52
- return new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime();
53
- }
54
- function L(e) {
55
- const t = w(e), n = new Date(t).getDay();
56
- return t - n * h;
57
- }
58
- const ae = { needs: [], test(e, t) {
59
- const n = b(t.value);
60
- if (!Number.isFinite(n)) return false;
61
- switch (e.op) {
62
- case ">":
63
- return n > e.a;
64
- case ">=":
65
- return n >= e.a;
66
- case "<":
67
- return n < e.a;
68
- case "<=":
69
- return n <= e.a;
70
- case "=":
71
- return n === e.a;
72
- case "!=":
73
- return n !== e.a;
74
- case "between":
75
- return e.b !== void 0 && n >= Math.min(e.a, e.b) && n <= Math.max(e.a, e.b);
76
- default:
77
- return false;
78
- }
79
- } }, ce = { needs: [], test(e, t) {
80
- const n = t.value == null ? "" : String(t.value);
81
- return e.ci === false ? n.includes(e.text) : n.toLowerCase().includes(e.text.toLowerCase());
82
- } }, ue = { needs: [], test(e, t, n, r) {
83
- const s = t.value, o = s instanceof Date ? s.getTime() : typeof s == "number" ? s : Date.parse(String(s));
84
- if (!Number.isFinite(o)) return false;
85
- const i = r.now, a = w(i);
86
- switch (e.rel) {
87
- case "today":
88
- return w(o) === a;
89
- case "yesterday":
90
- return w(o) === a - h;
91
- case "tomorrow":
92
- return w(o) === a + h;
93
- case "thisWeek": {
94
- const c = L(i);
95
- return o >= c && o < c + 7 * h;
96
- }
97
- case "lastWeek": {
98
- const c = L(i) - 7 * h;
99
- return o >= c && o < c + 7 * h;
100
- }
101
- case "thisMonth": {
102
- const c = new Date(i);
103
- return new Date(o).getFullYear() === c.getFullYear() && new Date(o).getMonth() === c.getMonth();
104
- }
105
- case "lastMonth": {
106
- const c = new Date(i.valueOf()), l = new Date(c.getFullYear(), c.getMonth() - 1, 1);
107
- return new Date(o).getFullYear() === l.getFullYear() && new Date(o).getMonth() === l.getMonth();
108
- }
109
- case "next7d":
110
- return o >= a && o < a + 7 * h;
111
- case "last7d":
112
- return o < a + h && o >= a - 6 * h;
113
- default:
114
- return false;
115
- }
116
- } }, le = { needs: ["rank"], test(e, t, n) {
117
- const r = b(t.value);
118
- return Number.isFinite(r) ? e.bottom ? n.rankAscOf ? n.rankAscOf(r) <= e.n : false : n.rankOf ? n.rankOf(r) <= e.n : false : false;
119
- } }, de = { needs: ["percentile"], test(e, t, n) {
120
- const r = b(t.value);
121
- if (!Number.isFinite(r) || !n.percentileOf) return false;
122
- const s = n.percentileOf(r);
123
- return e.bottom ? s <= e.pct / 100 : s >= 1 - e.pct / 100;
124
- } }, fe = { needs: ["avg"], test(e, t, n) {
125
- const r = b(t.value);
126
- return !Number.isFinite(r) || n.avg === void 0 ? false : e.below ? r < n.avg : r > n.avg;
127
- } }, me = { needs: ["avg", "stddev"], test(e, t, n) {
128
- const r = b(t.value);
129
- if (!Number.isFinite(r) || n.avg === void 0 || n.stddev === void 0) return false;
130
- const s = Math.abs(r - n.avg), o = e.k * n.stddev;
131
- return e.outside === false ? s <= o : s >= o;
132
- } }, pe = { needs: ["cardinality"], test(e, t, n) {
133
- const r = b(t.value);
134
- if (!Number.isFinite(r) || !n.countOf) return false;
135
- const s = n.countOf(r);
136
- return e.unique ? s === 1 : s > 1;
137
- } }, ge = { needs: [], test() {
138
- return false;
139
- } }, W = Object.freeze({ compare: ae, textContains: ce, dateOccurring: ue, topN: le, topNpct: de, aboveAvg: fe, stdBand: me, duplicate: pe, custom: ge });
140
- function q() {
141
- const e = new $({ spi: { name: "CFPredicate", version: "1" } });
142
- for (const [t, n] of Object.entries(W)) e.register(t, n, { origin: "builtin" });
143
- return e;
144
- }
145
- function U(e, t) {
146
- const n = e.scope;
147
- return !(n.columnId !== t.columnId || n.range && (t.rowIndex < n.range.startRow || t.rowIndex >= n.range.endRow) || n.rowState && n.rowState !== t.rowState);
148
- }
149
- function he(e) {
150
- return [...e].sort((t, n) => t.priority - n.priority || (t.id < n.id ? -1 : t.id > n.id ? 1 : 0));
151
- }
152
- function ye(e) {
153
- return typeof e == "number" ? e : typeof e == "string" && e.trim() !== "" ? Number(e) : NaN;
154
- }
155
- function v(e) {
156
- return e < 0 ? 0 : e > 1 ? 1 : e;
157
- }
158
- function V(e, t, n) {
159
- const r = ye(t), s = Number.isFinite(r), o = !s || r === 0 ? 0 : r > 0 ? 1 : -1, i = n.min ?? 0, a = n.max ?? 0;
160
- if (e.kind === "bar") {
161
- if (!s) return { sign: 0 };
162
- const c = e.axis ?? "zero";
163
- let l, f = false;
164
- if (c === "zero") {
165
- const d = Math.max(Math.abs(i), Math.abs(a)) || 1, u = Math.abs(r) / d;
166
- l = v(u), e.clamp && u > 1 && (f = true);
167
- } else {
168
- const d = a - i || 1, u = (r - i) / d;
169
- l = v(u), e.clamp && (u < 0 || u > 1) && (f = true);
170
- }
171
- return { ratio: l, sign: o, value: r, clamped: f };
172
- }
173
- if (e.kind === "scale") {
174
- if (!s) return { sign: 0 };
175
- const c = e.mode ?? "discrete";
176
- let l;
177
- if (e.diverging) {
178
- const u = e.midpoint === "zero" ? 0 : e.midpoint === "mean" ? n.avg ?? (i + a) / 2 : typeof e.midpoint == "number" ? e.midpoint : 0;
179
- if (r <= u) {
180
- const m = u - i || 1;
181
- l = 0.5 * v((r - i) / m);
182
- } else {
183
- const m = a - u || 1;
184
- l = 0.5 + 0.5 * v((r - u) / m);
185
- }
186
- } else {
187
- const u = a - i || 1;
188
- l = v((r - i) / u);
189
- }
190
- if (c === "continuous") return { ratio: l, sign: o, value: r };
191
- const f = e.diverging ? Math.max(3, Math.min(5, e.bands ?? 3)) : Math.max(2, Math.min(5, e.bands ?? 3)), d = Math.min(f - 1, Math.floor(l * f));
192
- return { ratio: l, bandIndex: d, bandCount: f, sign: o, value: r };
193
- }
194
- if (e.kind === "icon") {
195
- if (!s) return { sign: 0 };
196
- const c = e.steps ?? 3, l = a - i || 1, f = v((r - i) / l);
197
- let d = Math.min(c - 1, Math.floor(f * c));
198
- return e.reverse && (d = c - 1 - d), { bandIndex: d, bandCount: c, ratio: f, sign: o, value: r };
199
- }
200
- return s ? { sign: o, value: r } : { sign: o };
201
- }
202
- function be(e, t) {
203
- return e.get(t);
204
- }
205
- class H {
206
- constructor(t) {
207
- this.ruleTypes = t;
208
- }
209
- evaluate(t, n, r, s) {
210
- const o = he(t.filter((u) => U(u, n)));
211
- let i;
212
- const a = [], c = [];
213
- let l;
214
- for (const u of o) {
215
- const m = be(this.ruleTypes, u.when.type);
216
- if (!m) continue;
217
- let y = false;
218
- try {
219
- y = m.test(u.when, n, r, s);
220
- } catch {
221
- y = false;
222
- }
223
- if (!y) continue;
224
- const B = V(u.encode, n.value, r), p = { ruleId: u.id, conditionType: u.when.type, threshold: ve(u), inputValue: n.value, statsUsed: Y(r), priority: u.priority, wonOver: [] }, g = { ruleId: u.id, fired: true, encode: u.encode, datum: B, ...u.style !== void 0 ? { styleRef: u.style } : {}, lineage: p };
225
- if (u.encode.kind === "bar" || u.encode.kind === "scale" ? (i && c.push(i.ruleId), i = g) : a.push(g), u.stopIfTrue) {
226
- l = u.id;
227
- break;
228
- }
229
- }
230
- i && c.length && (i = { ...i, lineage: { ...i.lineage, wonOver: [...c] } });
231
- const f = i ?? a[0], d = { decorators: a };
232
- return i && (d.background = i), f && (d.winner = f), l !== void 0 && (d.stoppedAt = l), d;
233
- }
234
- }
235
- function ve(e) {
236
- const { type: t, ...n } = e.when;
237
- return n;
238
- }
239
- const D = "#f4f5f6";
240
- function A(e) {
241
- const t = (n) => Math.max(0, Math.min(255, Math.round(n))).toString(16).padStart(2, "0");
242
- return `#${t(e.r)}${t(e.g)}${t(e.b)}`;
243
- }
244
- function x(e, t, n) {
245
- const r = n < 0 ? 0 : n > 1 ? 1 : n;
246
- return { r: e.r + (t.r - e.r) * r, g: e.g + (t.g - e.g) * r, b: e.b + (t.b - e.b) * r };
247
- }
248
- function F(e) {
249
- return ne(e) ?? { r: 58, g: 63, b: 69 };
250
- }
251
- function ke(e) {
252
- return x({ r: 255, g: 255, b: 255 }, e, 0.08);
253
- }
254
- function R(e, t) {
255
- const n = F(e);
256
- return A(x(ke(n), n, t));
257
- }
258
- function E(e, t) {
259
- const n = Math.max(2, Math.min(5, Math.floor(t))), r = [];
260
- for (let s = 0; s < n; s++) r.push(R(e, n === 1 ? 0 : s / (n - 1)));
261
- return r;
262
- }
263
- function T(e, t, n, r = D) {
264
- const s = F(r);
265
- return n <= 0.5 ? A(x(F(e), s, n / 0.5)) : A(x(s, F(t), (n - 0.5) / 0.5));
266
- }
267
- function J(e, t, n, r = D) {
268
- const s = Math.max(3, Math.min(5, Math.floor(n))), o = [];
269
- for (let i = 0; i < s; i++) o.push(T(e, t, s === 1 ? 0.5 : i / (s - 1), r));
270
- return o;
271
- }
272
- const P = 4.5, O = "#111111", C = "#ffffff";
273
- class G {
274
- pickInk(t) {
275
- const n = I(O, t), r = I(C, t), s = r >= n, o = s ? C : O, i = s ? r : n;
276
- return i >= P ? { color: o, ratio: i } : { color: o, outline: true, outlineColor: s ? O : C, ratio: i };
277
- }
278
- }
279
- function we(e) {
280
- return Math.max(I(O, e), I(C, e)) >= P;
281
- }
282
- const K = new G(), _ = "#111111";
283
- function S(e) {
284
- return e === void 0 || !Number.isFinite(e) ? "—" : Number.isInteger(e) ? String(e) : String(Math.round(e * 1e3) / 1e3);
285
- }
286
- function j(e) {
287
- return e === void 0 ? "—" : `${Math.round(e * 100)}%`;
288
- }
289
- class Q {
290
- constructor() {
291
- this.kind = "bar";
292
- }
293
- encode(t, n, r) {
294
- const s = t.encode, o = t.datum;
295
- if (o.value === void 0) return { layer: "background", inkColor: _, ariaSummary: "값 없음" };
296
- const i = s.seed ?? (o.sign === -1 ? "graphite" : "primary"), a = n.rampFrom(i), l = (s.axis ?? "zero") === "zero" && o.sign === -1 ? "right" : "left", f = K.pickInk(a), d = o.ratio ?? 0, u = o.clamped ? " (범위 초과·클램프)" : "", m = s.log ? " (log)" : "", y = `값 ${S(o.value)}, 막대 ${j(d)}${o.sign === -1 ? " 음수" : ""}${u}${m}`;
297
- return { layer: "background", fill: { color: a, from: l, ratio: d }, inkColor: f.color, ...f.outline ? { inkOutline: true } : {}, ...o.clamped ? { clamped: true } : {}, ariaSummary: y };
298
- }
299
- }
300
- class X {
301
- constructor() {
302
- this.kind = "scale";
303
- }
304
- encode(t, n, r) {
305
- const s = t.encode, o = t.datum;
306
- if (o.value === void 0) return { layer: "background", inkColor: _, ariaSummary: "값 없음" };
307
- const i = s.mode ?? "discrete";
308
- let a, c = "";
309
- if (s.diverging) {
310
- const d = n.rampFrom("graphite"), u = n.rampFrom("primary");
311
- if (i === "continuous") a = T(d, u, o.ratio ?? 0.5);
312
- else {
313
- const m = J(d, u, o.bandCount ?? 3);
314
- a = m[o.bandIndex ?? 0] ?? m[0], c = ` (구간 ${(o.bandIndex ?? 0) + 1}/${o.bandCount ?? m.length})`;
315
- }
316
- } else {
317
- const d = s.seed ?? "graphite", u = n.rampFrom(d);
318
- if (i === "continuous") a = R(u, o.ratio ?? 0);
319
- else {
320
- const m = E(u, o.bandCount ?? 3);
321
- a = m[o.bandIndex ?? 0] ?? m[0], c = ` (구간 ${(o.bandIndex ?? 0) + 1}/${o.bandCount ?? m.length})`;
322
- }
323
- }
324
- const l = K.pickInk(a), f = `값 ${S(o.value)}, 히트맵 ${j(o.ratio)}${c}`;
325
- return { layer: "background", fill: { color: a, ratio: o.ratio ?? 0 }, inkColor: l.color, ...l.outline ? { inkOutline: true } : {}, ariaSummary: f };
326
- }
327
- }
328
- function Me(e, t) {
329
- return t <= 1 ? "circle" : e <= 0 ? "triangleDown" : e >= t - 1 ? "triangleUp" : "circle";
330
- }
331
- class Z {
332
- constructor() {
333
- this.kind = "icon";
334
- }
335
- encode(t, n, r) {
336
- const s = t.encode, o = t.datum;
337
- if (o.value === void 0) return { layer: "decorator", inkColor: _, ariaSummary: "값 없음" };
338
- const i = o.bandCount ?? s.steps ?? 3, a = o.bandIndex ?? 0, c = Me(a, i), l = E(n.rampFrom("graphite"), Math.max(2, i)), f = l[Math.min(l.length - 1, a)] ?? l[0], d = `cf-icon-${a}-of-${i}`, u = a <= 0 ? "하위" : a >= i - 1 ? "상위" : "중간", m = `값 ${S(o.value)}, ${u} 구간 ${a + 1}/${i} (${c})`;
339
- return { layer: "decorator", glyph: { role: d, tint: f, shape: c }, inkColor: f, ariaSummary: m };
340
- }
341
- }
342
- class ee {
343
- constructor() {
344
- this.kind = "sparkline";
345
- }
346
- encode(t, n, r) {
347
- const s = t.encode, o = t.datum;
348
- return { layer: "decorator", inkColor: "#111111", ariaSummary: `인셀 ${s.chart ?? "line"} 스파크, 값 ${S(o.value)}` };
349
- }
350
- }
351
- function te() {
352
- const e = new $({ spi: { name: "CFEncoder", version: "1" } });
353
- return e.register("bar", new Q(), { origin: "builtin" }), e.register("scale", new X(), { origin: "builtin" }), e.register("icon", new Z(), { origin: "builtin" }), e.register("sparkline", new ee(), { origin: "builtin" }), e;
354
- }
355
- function Ie() {
356
- return new $({ spi: { name: "CFNamedStyle", version: "1" } });
357
- }
358
- function M(e) {
359
- return typeof e == "object" && e !== null;
360
- }
361
- class Ne {
362
- load(t, n) {
363
- const r = [], s = [], o = Array.isArray(t) ? t : M(t) && Array.isArray(t.rules) ? t.rules : [];
364
- for (const i of o) {
365
- if (!M(i)) {
366
- s.push({ ruleId: "?", reason: "malformed", detail: "not an object" });
367
- continue;
368
- }
369
- const a = typeof i.id == "string" ? i.id : "?", c = i.when, l = i.encode, f = i.scope;
370
- if (typeof i.v == "number" && i.v > N) {
371
- s.push({ ruleId: a, reason: "future-version", detail: `v${i.v} > ${N}` });
372
- continue;
373
- }
374
- if (!M(c) || typeof c.type != "string" || !M(l) || typeof l.kind != "string" || !M(f) || typeof f.columnId != "string") {
375
- s.push({ ruleId: a, reason: "malformed", detail: "missing when/encode/scope" });
376
- continue;
377
- }
378
- if (!n.types.has(c.type)) {
379
- s.push({ ruleId: a, reason: "unknown-condition", detail: String(c.type) });
380
- continue;
381
- }
382
- if (!n.encoders.has(l.kind)) {
383
- s.push({ ruleId: a, reason: "unknown-encoder", detail: String(l.kind) });
384
- continue;
385
- }
386
- const d = i.style;
387
- if (z(d) && !n.styles.has(d.ref)) {
388
- s.push({ ruleId: a, reason: "unknown-style", detail: d.ref });
389
- continue;
390
- }
391
- r.push(i);
392
- }
393
- return { rules: r, skipped: s };
394
- }
395
- }
396
- function xe(e) {
397
- return JSON.stringify({ v: N, rules: e });
398
- }
399
- class Fe {
400
- constructor(t = []) {
401
- this.byColumn = /* @__PURE__ */ new Map(), this.all = [];
402
- for (const n of t) this.add(n);
403
- }
404
- add(t) {
405
- this.all.push(t);
406
- const n = this.byColumn.get(t.scope.columnId) ?? [];
407
- n.push(t), this.byColumn.set(t.scope.columnId, n);
408
- }
409
- rulesFor(t) {
410
- return this.byColumn.get(t) ?? [];
411
- }
412
- list() {
413
- return this.all;
414
- }
415
- }
416
- class Oe {
417
- constructor(t, n = te(), r = q(), s) {
418
- this.rules = t, this.encoders = n, this.ruleTypes = r, this.evaluator = s ?? new H(r);
419
- }
420
- get lineage() {
421
- return this;
422
- }
423
- paintFor(t, n, r, s, o) {
424
- const i = this.evaluator.evaluate(this.rules.rulesFor(t.columnId), t, n, o), a = [];
425
- if (i.background) {
426
- const c = this.encoders.get(i.background.encode.kind);
427
- c && a.push(c.encode(i.background, r, s));
428
- }
429
- for (const c of i.decorators) {
430
- const l = this.encoders.get(c.encode.kind);
431
- l && a.push(l.encode(c, r, s));
432
- }
433
- return a;
434
- }
435
- statsNeedsFor(t) {
436
- const n = /* @__PURE__ */ new Set();
437
- for (const r of this.rules.rulesFor(t)) {
438
- const s = this.ruleTypes.get(r.when.type);
439
- if (s) for (const o of s.needs) n.add(o);
440
- }
441
- return [...n].sort();
442
- }
443
- explain(t, n, r, s) {
444
- const o = this.evaluator.evaluate(n, t, r, s), i = [];
445
- o.background && i.push(o.background.lineage);
446
- for (const a of o.decorators) i.push(a.lineage);
447
- return i.sort((a, c) => a.priority - c.priority);
448
- }
449
- }
450
- export {
451
- P as AA_BODY,
452
- W as BUILTIN_PREDICATES,
453
- Q as BarEncoder,
454
- Oe as CFEngine,
455
- Fe as CFRuleStore,
456
- N as CF_SCHEMA_VERSION,
457
- H as DefaultCFEvaluator,
458
- Ne as DefaultCFRuleLoader,
459
- G as DefaultInkResolver,
460
- Z as IconEncoder,
461
- D as NEUTRAL_MIDPOINT,
462
- X as ScaleEncoder,
463
- ee as SparklineEncoder,
464
- re as cfRuleEquals,
465
- ie as computeColumnStats,
466
- V as computeDatum,
467
- te as createEncoderRegistry,
468
- Ie as createNamedStyleRegistry,
469
- q as createRuleTypeRegistry,
470
- J as divergingBands,
471
- T as divergingColor,
472
- z as isStyleRef,
473
- we as passesInkGate,
474
- U as scopeMatches,
475
- E as sequentialBands,
476
- R as sequentialColor,
477
- xe as serializeRules,
478
- Y as snapshotStats,
479
- oe as staticAppearanceView
480
- };
481
- //# sourceMappingURL=index-VkKgQ506.js.map