@milaboratories/milaboratories.ui-examples.model 1.0.47 → 1.0.48
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/.turbo/turbo-build.log +12 -12
- package/CHANGELOG.md +7 -0
- package/dist/bundle.js +157 -40
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +19 -27
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -13
- package/dist/index.d.ts +30 -13
- package/dist/index.js +20 -28
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +2 -2
- package/src/index.ts +32 -50
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @milaboratories/milaboratories.ui-examples.model@1.0.
|
|
2
|
+
> @milaboratories/milaboratories.ui-examples.model@1.0.48 build /home/runner/work/platforma/platforma/etc/blocks/ui-examples/model
|
|
3
3
|
> tsup && vite build && block-tools build-model
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
[34mCLI[39m Cleaning output folder
|
|
11
11
|
[34mCJS[39m Build start
|
|
12
12
|
[34mESM[39m Build start
|
|
13
|
-
[
|
|
14
|
-
[
|
|
13
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m2.69 KB[39m
|
|
14
|
+
[32mCJS[39m [1mdist/index.cjs.map [22m[32m6.42 KB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 78ms
|
|
16
|
+
[32mESM[39m [1mdist/index.js [22m[32m2.70 KB[39m
|
|
17
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m6.29 KB[39m
|
|
15
18
|
[32mESM[39m ⚡️ Build success in 78ms
|
|
16
|
-
[32mCJS[39m [1mdist/index.cjs [22m[32m2.81 KB[39m
|
|
17
|
-
[32mCJS[39m [1mdist/index.cjs.map [22m[32m6.97 KB[39m
|
|
18
|
-
[32mCJS[39m ⚡️ Build success in 80ms
|
|
19
19
|
[34mDTS[39m Build start
|
|
20
|
-
[32mDTS[39m ⚡️ Build success in
|
|
21
|
-
[32mDTS[39m [1mdist/index.d.cts [22m[
|
|
22
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
20
|
+
[32mDTS[39m ⚡️ Build success in 857ms
|
|
21
|
+
[32mDTS[39m [1mdist/index.d.cts [22m[32m2.09 KB[39m
|
|
22
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m2.09 KB[39m
|
|
23
23
|
[36mvite v5.4.11 [32mbuilding for production...[36m[39m
|
|
24
24
|
transforming...
|
|
25
25
|
[32m✓[39m 4 modules transformed.
|
|
26
26
|
rendering chunks...
|
|
27
27
|
computing gzip size...
|
|
28
|
-
[2mdist/[22m[36mbundle.js [39m[1m[
|
|
29
|
-
[2mdist/[22m[36mbundle.js [39m[1m[
|
|
30
|
-
[32m✓ built in
|
|
28
|
+
[2mdist/[22m[36mbundle.js [39m[1m[2m144.01 kB[22m[1m[22m[2m │ gzip: 26.12 kB[22m[2m │ map: 308.82 kB[22m
|
|
29
|
+
[2mdist/[22m[36mbundle.js [39m[1m[2m154.17 kB[22m[1m[22m[2m │ gzip: 26.60 kB[22m[2m │ map: 309.95 kB[22m
|
|
30
|
+
[32m✓ built in 417ms[39m
|
package/CHANGELOG.md
CHANGED
package/dist/bundle.js
CHANGED
|
@@ -3917,6 +3917,20 @@
|
|
|
3917
3917
|
function c(t) {
|
|
3918
3918
|
throw new Error("Unexpected object: " + t);
|
|
3919
3919
|
}
|
|
3920
|
+
function A(t) {
|
|
3921
|
+
const { type: n, name: r, domain: e } = t;
|
|
3922
|
+
return { type: n, name: r, ...e && { domain: e } };
|
|
3923
|
+
}
|
|
3924
|
+
function F(t, n) {
|
|
3925
|
+
if (t === void 0) return n === void 0;
|
|
3926
|
+
if (n === void 0) return true;
|
|
3927
|
+
for (const r in n)
|
|
3928
|
+
if (t[r] !== n[r]) return false;
|
|
3929
|
+
return true;
|
|
3930
|
+
}
|
|
3931
|
+
function H(t, n) {
|
|
3932
|
+
return t.name === n.name && F(t.domain, n.domain);
|
|
3933
|
+
}
|
|
3920
3934
|
function J(t, n) {
|
|
3921
3935
|
return { ...t, src: s(t.src, n) };
|
|
3922
3936
|
}
|
|
@@ -4234,16 +4248,16 @@
|
|
|
4234
4248
|
}), Ce = z.array(Ie), Re = 1e-3, Te = "__LABEL__", Q = "__LABEL__@1";
|
|
4235
4249
|
function Fe(t, e, n = {}) {
|
|
4236
4250
|
const r = /* @__PURE__ */ new Map(), s2 = /* @__PURE__ */ new Map(), i = t.map((d) => {
|
|
4237
|
-
var
|
|
4238
|
-
const m = e(d), y = (
|
|
4251
|
+
var q, z2;
|
|
4252
|
+
const m = e(d), y = (q = m.annotations) == null ? void 0 : q[Ae], F2 = (z2 = m.annotations) == null ? void 0 : z2[Pe], b = (F2 ? Ce.safeParse(JSON.parse(F2)).data : void 0) ?? [];
|
|
4239
4253
|
if (y) {
|
|
4240
4254
|
const _ = { label: y, type: Te, importance: -2 };
|
|
4241
4255
|
n.addLabelAsSuffix ? b.push(_) : b.splice(0, 0, _);
|
|
4242
4256
|
}
|
|
4243
|
-
const E = [],
|
|
4257
|
+
const E = [], W = /* @__PURE__ */ new Map();
|
|
4244
4258
|
for (let _ = b.length - 1; _ >= 0; --_) {
|
|
4245
|
-
const { type: V } = b[_], ue = b[_].importance ?? 0, j = (
|
|
4246
|
-
|
|
4259
|
+
const { type: V } = b[_], ue = b[_].importance ?? 0, j = (W.get(V) ?? 0) + 1;
|
|
4260
|
+
W.set(V, j);
|
|
4247
4261
|
const I = `${V}@${j}`;
|
|
4248
4262
|
s2.set(I, (s2.get(I) ?? 0) + 1), r.set(
|
|
4249
4263
|
I,
|
|
@@ -4264,9 +4278,9 @@
|
|
|
4264
4278
|
for (const [d] of l)
|
|
4265
4279
|
d.endsWith("@1") || s2.get(d) === t.length ? o2.push(d) : a.push(d);
|
|
4266
4280
|
const c2 = (d) => i.map((m) => {
|
|
4267
|
-
const y = m.fullTrace.filter((b) => d.has(b.fullType)).map((b) => b.label),
|
|
4281
|
+
const y = m.fullTrace.filter((b) => d.has(b.fullType)).map((b) => b.label), F2 = n.separator ?? " / ";
|
|
4268
4282
|
return {
|
|
4269
|
-
label: y.join(
|
|
4283
|
+
label: y.join(F2),
|
|
4270
4284
|
value: m.value
|
|
4271
4285
|
};
|
|
4272
4286
|
});
|
|
@@ -4401,10 +4415,10 @@
|
|
|
4401
4415
|
if (!o(r.obj.spec))
|
|
4402
4416
|
continue;
|
|
4403
4417
|
const s2 = r.obj.spec;
|
|
4404
|
-
if (e.name === s2.name && e.valueType === s2.valueType && e.axesSpec.length === s2.axesSpec.length &&
|
|
4418
|
+
if (e.name === s2.name && e.valueType === s2.valueType && e.axesSpec.length === s2.axesSpec.length && $(e.domain, s2.domain)) {
|
|
4405
4419
|
for (let i = 0; i < e.axesSpec.length; ++i) {
|
|
4406
4420
|
const o2 = e.axesSpec[i], a = s2.axesSpec[i];
|
|
4407
|
-
if (o2.name !== a.name || o2.type !== a.type ||
|
|
4421
|
+
if (o2.name !== a.name || o2.type !== a.type || !$(o2.domain, a.domain))
|
|
4408
4422
|
continue e;
|
|
4409
4423
|
}
|
|
4410
4424
|
n.push(r.obj);
|
|
@@ -4413,7 +4427,7 @@
|
|
|
4413
4427
|
return n;
|
|
4414
4428
|
}
|
|
4415
4429
|
}
|
|
4416
|
-
function
|
|
4430
|
+
function $(t, e) {
|
|
4417
4431
|
if (t === void 0) return e === void 0;
|
|
4418
4432
|
if (e === void 0) return true;
|
|
4419
4433
|
for (const n in e)
|
|
@@ -4465,7 +4479,7 @@
|
|
|
4465
4479
|
for (const r of n.entries) {
|
|
4466
4480
|
if (!S$1(r.obj)) continue;
|
|
4467
4481
|
const s2 = r.obj.spec;
|
|
4468
|
-
if (s2.name === "pl7.app/label" && s2.axesSpec.length === 1 && s2.axesSpec[0].name === e.name && s2.axesSpec[0].type === e.type &&
|
|
4482
|
+
if (s2.name === "pl7.app/label" && s2.axesSpec.length === 1 && s2.axesSpec[0].name === e.name && s2.axesSpec[0].type === e.type && $(e.domain, s2.axesSpec[0].domain)) {
|
|
4469
4483
|
if (r.obj.data.resourceType.name !== "PColumnData/Json")
|
|
4470
4484
|
throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
|
|
4471
4485
|
return new Map(
|
|
@@ -4499,7 +4513,83 @@
|
|
|
4499
4513
|
return this.ctx.getCurrentUnstableMarker();
|
|
4500
4514
|
}
|
|
4501
4515
|
}
|
|
4502
|
-
const
|
|
4516
|
+
const T = "PColumnData/", K = T + "ResourceMap", G = T + "Partitioned/ResourceMap", Z = T + "JsonPartitioned", M = T + "BinaryPartitioned", ae = T + "Partitioned/", ee = ae + "JsonPartitioned", B = ae + "BinaryPartitioned";
|
|
4517
|
+
const te = (t) => {
|
|
4518
|
+
if (!t.endsWith(".index")) {
|
|
4519
|
+
if (t.endsWith(".values"))
|
|
4520
|
+
return t.substring(0, t.length - 7);
|
|
4521
|
+
throw Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
|
|
4522
|
+
}
|
|
4523
|
+
};
|
|
4524
|
+
function De(t) {
|
|
4525
|
+
if (!t) return;
|
|
4526
|
+
const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
|
|
4527
|
+
let s2 = 0;
|
|
4528
|
+
switch (e) {
|
|
4529
|
+
case K:
|
|
4530
|
+
s2 = n.keyLength;
|
|
4531
|
+
break;
|
|
4532
|
+
case G:
|
|
4533
|
+
s2 = n.partitionKeyLength + n.keyLength;
|
|
4534
|
+
break;
|
|
4535
|
+
case Z:
|
|
4536
|
+
case M:
|
|
4537
|
+
s2 = n.partitionKeyLength;
|
|
4538
|
+
break;
|
|
4539
|
+
case B:
|
|
4540
|
+
case ee:
|
|
4541
|
+
s2 = n.superPartitionKeyLength + n.partitionKeyLength;
|
|
4542
|
+
break;
|
|
4543
|
+
}
|
|
4544
|
+
switch (e) {
|
|
4545
|
+
case K:
|
|
4546
|
+
case Z:
|
|
4547
|
+
case M:
|
|
4548
|
+
for (let i of t.listInputFields()) {
|
|
4549
|
+
if (e === M) {
|
|
4550
|
+
const a = te(i);
|
|
4551
|
+
if (a) i = a;
|
|
4552
|
+
else continue;
|
|
4553
|
+
}
|
|
4554
|
+
const o2 = [...JSON.parse(i)];
|
|
4555
|
+
r.push(o2);
|
|
4556
|
+
}
|
|
4557
|
+
break;
|
|
4558
|
+
case G:
|
|
4559
|
+
case B:
|
|
4560
|
+
case ee:
|
|
4561
|
+
for (const i of t.listInputFields()) {
|
|
4562
|
+
const o2 = [...JSON.parse(i)], a = t.resolve({ field: i, assertFieldType: "Input" });
|
|
4563
|
+
if (a !== void 0)
|
|
4564
|
+
for (let l of a.listInputFields()) {
|
|
4565
|
+
if (e === B) {
|
|
4566
|
+
const f = te(l);
|
|
4567
|
+
if (f) l = f;
|
|
4568
|
+
else continue;
|
|
4569
|
+
}
|
|
4570
|
+
const c2 = [...o2, ...JSON.parse(l)];
|
|
4571
|
+
r.push(c2);
|
|
4572
|
+
}
|
|
4573
|
+
}
|
|
4574
|
+
break;
|
|
4575
|
+
}
|
|
4576
|
+
return { data: r, keyLength: s2 };
|
|
4577
|
+
}
|
|
4578
|
+
function pt(t) {
|
|
4579
|
+
const e = De(t);
|
|
4580
|
+
if (!e) return;
|
|
4581
|
+
const { data: n, keyLength: r } = e, s2 = [];
|
|
4582
|
+
for (let i = 0; i < r; ++i)
|
|
4583
|
+
s2.push(/* @__PURE__ */ new Set());
|
|
4584
|
+
for (const i of n) {
|
|
4585
|
+
if (i.length !== r)
|
|
4586
|
+
throw new Error("key length does not match partition length");
|
|
4587
|
+
for (let o2 = 0; o2 < r; ++o2)
|
|
4588
|
+
s2[o2].add(i[o2]);
|
|
4589
|
+
}
|
|
4590
|
+
return s2.map((i) => Array.from(i.values()));
|
|
4591
|
+
}
|
|
4592
|
+
const C = "1.17.0";
|
|
4503
4593
|
function ke(t) {
|
|
4504
4594
|
return t.__renderLambda === true;
|
|
4505
4595
|
}
|
|
@@ -4686,42 +4776,69 @@
|
|
|
4686
4776
|
return _e() ? re({ sdkVersion: C }) : { config: e };
|
|
4687
4777
|
}
|
|
4688
4778
|
}
|
|
4779
|
+
function ht(t, e, n, r) {
|
|
4780
|
+
var o2, a;
|
|
4781
|
+
const s2 = t.resultPool.getData().entries.map((l) => l.obj).filter(S$1).filter((l) => l.spec.name === "pl7.app/label" && l.spec.axesSpec.length === 1), i = /* @__PURE__ */ new Map();
|
|
4782
|
+
for (const l of e)
|
|
4783
|
+
for (const c2 of l.spec.axesSpec) {
|
|
4784
|
+
const f = A(c2);
|
|
4785
|
+
for (const w of s2)
|
|
4786
|
+
H(f, A(w.spec.axesSpec[0])) && i.set(w.id, w);
|
|
4787
|
+
}
|
|
4788
|
+
if (![...e, ...i.values()].find((l) => !l.data.getIsReadyOrError()))
|
|
4789
|
+
return t.createPTable({
|
|
4790
|
+
src: {
|
|
4791
|
+
type: "outer",
|
|
4792
|
+
primary: {
|
|
4793
|
+
type: "full",
|
|
4794
|
+
entries: e.map((l) => ({ type: "column", column: l }))
|
|
4795
|
+
},
|
|
4796
|
+
secondary: Array.from(i.values()).map((l) => ({ type: "column", column: l }))
|
|
4797
|
+
},
|
|
4798
|
+
filters: [...((o2 = n == null ? void 0 : n.pTableParams) == null ? void 0 : o2.filters) ?? [], ...r ?? []],
|
|
4799
|
+
sorting: ((a = n == null ? void 0 : n.pTableParams) == null ? void 0 : a.sorting) ?? []
|
|
4800
|
+
});
|
|
4801
|
+
}
|
|
4802
|
+
function gt(t, e, n) {
|
|
4803
|
+
const r = t.findLabels(e);
|
|
4804
|
+
return {
|
|
4805
|
+
axis: e,
|
|
4806
|
+
options: n.map((s2) => ({
|
|
4807
|
+
value: s2,
|
|
4808
|
+
label: (r == null ? void 0 : r.get(s2)) ?? s2.toString()
|
|
4809
|
+
})),
|
|
4810
|
+
defaultValue: n[0]
|
|
4811
|
+
};
|
|
4812
|
+
}
|
|
4689
4813
|
const $BlockArgs = z.object({
|
|
4690
4814
|
numbers: z.array(z.coerce.number())
|
|
4691
4815
|
});
|
|
4692
4816
|
const platforma = h.create("Heavy").withArgs({ numbers: [1, 2, 3] }).withUiState({ dataTableState: void 0 }).output("numbers", (ctx) => {
|
|
4693
4817
|
var _a, _b;
|
|
4694
4818
|
return (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("numbers")) == null ? void 0 : _b.getDataAsJson();
|
|
4695
|
-
}).
|
|
4696
|
-
|
|
4697
|
-
|
|
4698
|
-
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4819
|
+
}).retentiveOutput("inputOptions", (ctx) => {
|
|
4820
|
+
return ctx.resultPool.getOptions((spec) => o(spec));
|
|
4821
|
+
}).output("sheets", (ctx) => {
|
|
4822
|
+
var _a, _b;
|
|
4823
|
+
if (!((_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.anchorColumn)) return void 0;
|
|
4824
|
+
const anchor = ctx.resultPool.getPColumnByRef(ctx.uiState.dataTableState.anchorColumn);
|
|
4825
|
+
if (!anchor) return void 0;
|
|
4826
|
+
const r = pt(anchor.data);
|
|
4827
|
+
if (!r) return void 0;
|
|
4828
|
+
return r.map((values, i) => gt(ctx, anchor.spec.axesSpec[i], values));
|
|
4829
|
+
}).output("pt", (ctx) => {
|
|
4830
|
+
var _a, _b, _c, _d, _e2;
|
|
4831
|
+
if (((_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.anchorColumn) === void 0) return void 0;
|
|
4832
|
+
const anchorColumn = ctx.resultPool.getDataByRef(ctx.uiState.dataTableState.anchorColumn);
|
|
4833
|
+
if (!anchorColumn || !S$1(anchorColumn)) {
|
|
4834
|
+
console.error("Anchor column is undefined or is not PColumn", anchorColumn);
|
|
4703
4835
|
return void 0;
|
|
4704
4836
|
}
|
|
4705
|
-
|
|
4706
|
-
|
|
4707
|
-
|
|
4708
|
-
|
|
4709
|
-
|
|
4710
|
-
if (!collection || !collection.isComplete) return void 0;
|
|
4711
|
-
const columns = collection.entries.map(({ obj }) => obj).filter(S$1);
|
|
4712
|
-
if (columns.length === 0) return void 0;
|
|
4713
|
-
let columnMissing = false;
|
|
4714
|
-
const src = s(join, (idAndSpec) => {
|
|
4715
|
-
const column = columns.find((it) => it.id === idAndSpec.columnId);
|
|
4716
|
-
if (!column) columnMissing = true;
|
|
4717
|
-
return column;
|
|
4718
|
-
});
|
|
4719
|
-
if (columnMissing) return void 0;
|
|
4720
|
-
return ctx.createPTable({
|
|
4721
|
-
src,
|
|
4722
|
-
filters: ((_e2 = (_d = ctx.uiState.dataTableState) == null ? void 0 : _d.tableState.pTableParams) == null ? void 0 : _e2.filters) ?? [],
|
|
4723
|
-
sorting: ((_g = (_f = ctx.uiState.dataTableState) == null ? void 0 : _f.tableState.pTableParams) == null ? void 0 : _g.sorting) ?? []
|
|
4724
|
-
});
|
|
4837
|
+
if (((_c = ctx.uiState.dataTableState.tableState.pTableParams) == null ? void 0 : _c.filters) === void 0) return void 0;
|
|
4838
|
+
return ht(ctx, [anchorColumn], ctx.uiState.dataTableState.tableState, [
|
|
4839
|
+
...(_d = ctx.uiState.dataTableState.tableState.pTableParams) == null ? void 0 : _d.filters,
|
|
4840
|
+
...((_e2 = ctx.uiState.dataTableState.filterModel) == null ? void 0 : _e2.filters) ?? []
|
|
4841
|
+
]);
|
|
4725
4842
|
}).sections((ctx) => {
|
|
4726
4843
|
return [
|
|
4727
4844
|
{ type: "link", href: "/", label: "Icons/Masks" },
|