@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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @milaboratories/milaboratories.ui-examples.model@1.0.47 build /home/runner/work/platforma/platforma/etc/blocks/ui-examples/model
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
  CLI Building entry: src/index.ts
@@ -10,21 +10,21 @@
10
10
  CLI Cleaning output folder
11
11
  CJS Build start
12
12
  ESM Build start
13
- ESM dist/index.js 2.76 KB
14
- ESM dist/index.js.map 6.91 KB
13
+ CJS dist/index.cjs 2.69 KB
14
+ CJS dist/index.cjs.map 6.42 KB
15
+ CJS ⚡️ Build success in 78ms
16
+ ESM dist/index.js 2.70 KB
17
+ ESM dist/index.js.map 6.29 KB
15
18
  ESM ⚡️ Build success in 78ms
16
- CJS dist/index.cjs 2.81 KB
17
- CJS dist/index.cjs.map 6.97 KB
18
- CJS ⚡️ Build success in 80ms
19
19
  DTS Build start
20
- DTS ⚡️ Build success in 851ms
21
- DTS dist/index.d.cts 1.70 KB
22
- DTS dist/index.d.ts 1.70 KB
20
+ DTS ⚡️ Build success in 857ms
21
+ DTS dist/index.d.cts 2.09 KB
22
+ DTS dist/index.d.ts 2.09 KB
23
23
  vite v5.4.11 building for production...
24
24
  transforming...
25
25
  ✓ 4 modules transformed.
26
26
  rendering chunks...
27
27
  computing gzip size...
28
- dist/bundle.js 140.55 kB │ gzip: 25.31 kB │ map: 305.86 kB
29
- dist/bundle.js 150.48 kB │ gzip: 25.77 kB │ map: 306.94 kB
30
- ✓ built in 380ms
28
+ dist/bundle.js 144.01 kB │ gzip: 26.12 kB │ map: 308.82 kB
29
+ dist/bundle.js 154.17 kB │ gzip: 26.60 kB │ map: 309.95 kB
30
+ ✓ built in 417ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @milaboratories/milaboratories.ui-examples.model
2
2
 
3
+ ## 1.0.48
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [b1a3abc]
8
+ - @platforma-sdk/model@1.17.0
9
+
3
10
  ## 1.0.47
4
11
 
5
12
  ### Patch Changes
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 z2, Y;
4238
- const m = e(d), y = (z2 = m.annotations) == null ? void 0 : z2[Ae], F = (Y = m.annotations) == null ? void 0 : Y[Pe], b = (F ? Ce.safeParse(JSON.parse(F)).data : void 0) ?? [];
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 = [], q = /* @__PURE__ */ new Map();
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 = (q.get(V) ?? 0) + 1;
4246
- q.set(V, j);
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), F = n.separator ?? " / ";
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(F),
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 && K(e.domain, s2.domain)) {
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 || !K(o2.domain, a.domain))
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 K(t, e) {
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 && K(e.domain, s2.axesSpec[0].domain)) {
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 C = "1.15.4";
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
- }).output("pFrame", (ctx) => {
4696
- const collection = ctx.resultPool.getData();
4697
- if (collection === void 0 || !collection.isComplete) return void 0;
4698
- const valueTypes = ["Int", "Long", "Float", "Double", "String", "Bytes"];
4699
- const columns = collection.entries.map(({ obj }) => obj).filter(S$1).filter((column) => valueTypes.find((valueType) => valueType === column.spec.valueType));
4700
- try {
4701
- return ctx.createPFrame(columns);
4702
- } catch (err) {
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
- }).output("pTable", (ctx) => {
4706
- var _a, _b, _c, _d, _e2, _f, _g;
4707
- const join = (_c = (_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.tableState.pTableParams) == null ? void 0 : _c.join;
4708
- if (!join) return void 0;
4709
- const collection = ctx.resultPool.getData();
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" },