open-grid 1.3.0 → 1.4.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 +40 -0
- package/README.ja.md +462 -0
- package/README.md +52 -18
- package/README.zh.md +455 -0
- package/dist/{OpenGrid-B7m7ei7f.cjs → OpenGrid-BOtTt5aI.cjs} +2 -2
- package/dist/{OpenGrid-CeUdO_fM.js → OpenGrid-sI_vdHQw.js} +2 -2
- package/dist/Registry-CPJYOqCn.js +74 -0
- package/dist/Registry-D74ZmdDz.cjs +71 -0
- package/dist/index-B3fKi43v.js +481 -0
- package/dist/{index-JjfWY3Bt.cjs → index-D1l3XFCM.cjs} +92 -160
- package/dist/open-grid-react.cjs +1 -1
- package/dist/open-grid-react.js +1 -1
- package/dist/open-grid-vue.cjs +1 -1
- package/dist/open-grid-vue.js +1 -1
- package/dist/open-grid.cjs +31 -31
- package/dist/open-grid.js +86 -82
- package/dist/types/core/FilterSelect.d.ts +290 -33
- package/dist/types/core/GridShuttle.d.ts +177 -25
- package/dist/types/core/IconRegistry.d.ts +263 -37
- package/dist/types/core/OpenGrid.d.ts +2815 -373
- package/dist/types/core/OrgChart.d.ts +269 -31
- package/dist/types/core/SkinRegistry.d.ts +341 -43
- package/dist/types/core/XmlConverter.d.ts +424 -43
- package/dist/types/core/chart/types.d.ts +1076 -113
- package/dist/types/core/extension/Registry.d.ts +389 -51
- package/dist/types/core/extension/reserved.d.ts +34 -5
- package/dist/types/core/i18n/LocaleRegistry.d.ts +0 -0
- package/dist/types/core/i18n/types.d.ts +660 -78
- package/dist/types/core/types.d.ts +3791 -373
- package/dist/types/index.d.ts +226 -17
- package/package.json +3 -1
- package/dist/index-DrCPRuYi.js +0 -548
|
@@ -0,0 +1,481 @@
|
|
|
1
|
+
import { T as $ } from "./Registry-CPJYOqCn.js";
|
|
2
|
+
import { p as ne, c as I } from "./OpenGrid-sI_vdHQw.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-B3fKi43v.js.map
|