@milaboratories/milaboratories.ui-examples.model 1.1.3 → 1.1.5
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 +13 -13
- package/CHANGELOG.md +14 -0
- package/dist/bundle.js +381 -358
- package/dist/bundle.js.map +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/model.json +1 -1
- package/package.json +3 -3
- package/src/index.ts +1 -0
package/dist/bundle.js
CHANGED
|
@@ -194,10 +194,10 @@
|
|
|
194
194
|
fieldErrors._errors.push(mapper(issue));
|
|
195
195
|
} else {
|
|
196
196
|
let curr = fieldErrors;
|
|
197
|
-
let
|
|
198
|
-
while (
|
|
199
|
-
const el = issue.path[
|
|
200
|
-
const terminal =
|
|
197
|
+
let i2 = 0;
|
|
198
|
+
while (i2 < issue.path.length) {
|
|
199
|
+
const el = issue.path[i2];
|
|
200
|
+
const terminal = i2 === issue.path.length - 1;
|
|
201
201
|
if (!terminal) {
|
|
202
202
|
curr[el] = curr[el] || { _errors: [] };
|
|
203
203
|
} else {
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
curr[el]._errors.push(mapper(issue));
|
|
206
206
|
}
|
|
207
207
|
curr = curr[el];
|
|
208
|
-
|
|
208
|
+
i2++;
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
}
|
|
@@ -2051,14 +2051,14 @@
|
|
|
2051
2051
|
}
|
|
2052
2052
|
}
|
|
2053
2053
|
if (ctx.common.async) {
|
|
2054
|
-
return Promise.all([...ctx.data].map((item,
|
|
2055
|
-
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path,
|
|
2054
|
+
return Promise.all([...ctx.data].map((item, i2) => {
|
|
2055
|
+
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
|
|
2056
2056
|
})).then((result2) => {
|
|
2057
2057
|
return ParseStatus.mergeArray(status, result2);
|
|
2058
2058
|
});
|
|
2059
2059
|
}
|
|
2060
|
-
const result = [...ctx.data].map((item,
|
|
2061
|
-
return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path,
|
|
2060
|
+
const result = [...ctx.data].map((item, i2) => {
|
|
2061
|
+
return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
|
|
2062
2062
|
});
|
|
2063
2063
|
return ParseStatus.mergeArray(status, result);
|
|
2064
2064
|
}
|
|
@@ -2659,17 +2659,17 @@
|
|
|
2659
2659
|
});
|
|
2660
2660
|
}
|
|
2661
2661
|
}
|
|
2662
|
-
function mergeValues(a,
|
|
2662
|
+
function mergeValues(a, b2) {
|
|
2663
2663
|
const aType = getParsedType(a);
|
|
2664
|
-
const bType = getParsedType(
|
|
2665
|
-
if (a ===
|
|
2664
|
+
const bType = getParsedType(b2);
|
|
2665
|
+
if (a === b2) {
|
|
2666
2666
|
return { valid: true, data: a };
|
|
2667
2667
|
} else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
|
|
2668
|
-
const bKeys = util.objectKeys(
|
|
2668
|
+
const bKeys = util.objectKeys(b2);
|
|
2669
2669
|
const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
|
2670
|
-
const newObj = { ...a, ...
|
|
2670
|
+
const newObj = { ...a, ...b2 };
|
|
2671
2671
|
for (const key of sharedKeys) {
|
|
2672
|
-
const sharedValue = mergeValues(a[key],
|
|
2672
|
+
const sharedValue = mergeValues(a[key], b2[key]);
|
|
2673
2673
|
if (!sharedValue.valid) {
|
|
2674
2674
|
return { valid: false };
|
|
2675
2675
|
}
|
|
@@ -2677,13 +2677,13 @@
|
|
|
2677
2677
|
}
|
|
2678
2678
|
return { valid: true, data: newObj };
|
|
2679
2679
|
} else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
|
|
2680
|
-
if (a.length !==
|
|
2680
|
+
if (a.length !== b2.length) {
|
|
2681
2681
|
return { valid: false };
|
|
2682
2682
|
}
|
|
2683
2683
|
const newArray = [];
|
|
2684
2684
|
for (let index = 0; index < a.length; index++) {
|
|
2685
2685
|
const itemA = a[index];
|
|
2686
|
-
const itemB =
|
|
2686
|
+
const itemB = b2[index];
|
|
2687
2687
|
const sharedValue = mergeValues(itemA, itemB);
|
|
2688
2688
|
if (!sharedValue.valid) {
|
|
2689
2689
|
return { valid: false };
|
|
@@ -2691,7 +2691,7 @@
|
|
|
2691
2691
|
newArray.push(sharedValue.data);
|
|
2692
2692
|
}
|
|
2693
2693
|
return { valid: true, data: newArray };
|
|
2694
|
-
} else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +
|
|
2694
|
+
} else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b2) {
|
|
2695
2695
|
return { valid: true, data: a };
|
|
2696
2696
|
} else {
|
|
2697
2697
|
return { valid: false };
|
|
@@ -2986,7 +2986,7 @@
|
|
|
2986
2986
|
}
|
|
2987
2987
|
return { status: status.value, value: parsedSet };
|
|
2988
2988
|
}
|
|
2989
|
-
const elements = [...ctx.data.values()].map((item,
|
|
2989
|
+
const elements = [...ctx.data.values()].map((item, i2) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i2)));
|
|
2990
2990
|
if (ctx.common.async) {
|
|
2991
2991
|
return Promise.all(elements).then((elements2) => finalizeSet(elements2));
|
|
2992
2992
|
} else {
|
|
@@ -3071,29 +3071,29 @@
|
|
|
3071
3071
|
const params = { errorMap: ctx.common.contextualErrorMap };
|
|
3072
3072
|
const fn = ctx.data;
|
|
3073
3073
|
if (this._def.returns instanceof ZodPromise) {
|
|
3074
|
-
const
|
|
3074
|
+
const me = this;
|
|
3075
3075
|
return OK(async function(...args) {
|
|
3076
3076
|
const error = new ZodError([]);
|
|
3077
|
-
const parsedArgs = await
|
|
3077
|
+
const parsedArgs = await me._def.args.parseAsync(args, params).catch((e) => {
|
|
3078
3078
|
error.addIssue(makeArgsIssue(args, e));
|
|
3079
3079
|
throw error;
|
|
3080
3080
|
});
|
|
3081
3081
|
const result = await Reflect.apply(fn, this, parsedArgs);
|
|
3082
|
-
const parsedReturns = await
|
|
3082
|
+
const parsedReturns = await me._def.returns._def.type.parseAsync(result, params).catch((e) => {
|
|
3083
3083
|
error.addIssue(makeReturnsIssue(result, e));
|
|
3084
3084
|
throw error;
|
|
3085
3085
|
});
|
|
3086
3086
|
return parsedReturns;
|
|
3087
3087
|
});
|
|
3088
3088
|
} else {
|
|
3089
|
-
const
|
|
3089
|
+
const me = this;
|
|
3090
3090
|
return OK(function(...args) {
|
|
3091
|
-
const parsedArgs =
|
|
3091
|
+
const parsedArgs = me._def.args.safeParse(args, params);
|
|
3092
3092
|
if (!parsedArgs.success) {
|
|
3093
3093
|
throw new ZodError([makeArgsIssue(args, parsedArgs.error)]);
|
|
3094
3094
|
}
|
|
3095
3095
|
const result = Reflect.apply(fn, this, parsedArgs.data);
|
|
3096
|
-
const parsedReturns =
|
|
3096
|
+
const parsedReturns = me._def.returns.safeParse(result, params);
|
|
3097
3097
|
if (!parsedReturns.success) {
|
|
3098
3098
|
throw new ZodError([makeReturnsIssue(result, parsedReturns.error)]);
|
|
3099
3099
|
}
|
|
@@ -3662,10 +3662,10 @@
|
|
|
3662
3662
|
}
|
|
3663
3663
|
}
|
|
3664
3664
|
}
|
|
3665
|
-
static create(a,
|
|
3665
|
+
static create(a, b2) {
|
|
3666
3666
|
return new ZodPipeline({
|
|
3667
3667
|
in: a,
|
|
3668
|
-
out:
|
|
3668
|
+
out: b2,
|
|
3669
3669
|
typeName: ZodFirstPartyTypeKind.ZodPipeline
|
|
3670
3670
|
});
|
|
3671
3671
|
}
|
|
@@ -3798,7 +3798,7 @@
|
|
|
3798
3798
|
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
3799
3799
|
};
|
|
3800
3800
|
const NEVER = INVALID;
|
|
3801
|
-
var z
|
|
3801
|
+
var z = /* @__PURE__ */ Object.freeze({
|
|
3802
3802
|
__proto__: null,
|
|
3803
3803
|
defaultErrorMap: errorMap,
|
|
3804
3804
|
setErrorMap,
|
|
@@ -3917,21 +3917,21 @@
|
|
|
3917
3917
|
function f(t) {
|
|
3918
3918
|
throw new Error("Unexpected object: " + t);
|
|
3919
3919
|
}
|
|
3920
|
-
function S(t) {
|
|
3921
|
-
const { type: n, name:
|
|
3922
|
-
return { type: n, name:
|
|
3920
|
+
function S$1(t) {
|
|
3921
|
+
const { type: n, name: e, domain: r } = t;
|
|
3922
|
+
return { type: n, name: e, ...r && { domain: r } };
|
|
3923
3923
|
}
|
|
3924
3924
|
function B(t, n) {
|
|
3925
3925
|
if (t === void 0) return n === void 0;
|
|
3926
3926
|
if (n === void 0) return true;
|
|
3927
|
-
for (const
|
|
3928
|
-
if (t[
|
|
3927
|
+
for (const e in n)
|
|
3928
|
+
if (t[e] !== n[e]) return false;
|
|
3929
3929
|
return true;
|
|
3930
3930
|
}
|
|
3931
|
-
function
|
|
3931
|
+
function M(t, n) {
|
|
3932
3932
|
return t.name === n.name && B(t.domain, n.domain);
|
|
3933
3933
|
}
|
|
3934
|
-
function
|
|
3934
|
+
function q(t, n) {
|
|
3935
3935
|
return { ...t, src: u$1(t.src, n) };
|
|
3936
3936
|
}
|
|
3937
3937
|
function u$1(t, n) {
|
|
@@ -3945,159 +3945,159 @@
|
|
|
3945
3945
|
case "full":
|
|
3946
3946
|
return {
|
|
3947
3947
|
type: t.type,
|
|
3948
|
-
entries: t.entries.map((
|
|
3948
|
+
entries: t.entries.map((e) => u$1(e, n))
|
|
3949
3949
|
};
|
|
3950
3950
|
case "outer":
|
|
3951
3951
|
return {
|
|
3952
3952
|
type: "outer",
|
|
3953
3953
|
primary: u$1(t.primary, n),
|
|
3954
|
-
secondary: t.secondary.map((
|
|
3954
|
+
secondary: t.secondary.map((e) => u$1(e, n))
|
|
3955
3955
|
};
|
|
3956
3956
|
default:
|
|
3957
3957
|
f(t);
|
|
3958
3958
|
}
|
|
3959
3959
|
}
|
|
3960
|
-
z
|
|
3961
|
-
__isRef: z
|
|
3962
|
-
blockId: z
|
|
3963
|
-
name: z
|
|
3960
|
+
z.object({
|
|
3961
|
+
__isRef: z.literal(true).describe("Crucial marker for the block dependency tree reconstruction"),
|
|
3962
|
+
blockId: z.string().describe("Upstream block id"),
|
|
3963
|
+
name: z.string().describe("Name of the output provided to the upstream block's output context")
|
|
3964
3964
|
}).describe(
|
|
3965
3965
|
"Universal reference type, allowing to set block connections. It is crucial that {@link __isRef} is present and equal to true, internal logic relies on this marker to build block dependency trees."
|
|
3966
3966
|
).strict().readonly();
|
|
3967
|
-
function
|
|
3967
|
+
function i(t) {
|
|
3968
3968
|
return t.kind === "PColumn";
|
|
3969
3969
|
}
|
|
3970
3970
|
function U$1(t) {
|
|
3971
|
-
return
|
|
3971
|
+
return i(t.spec);
|
|
3972
3972
|
}
|
|
3973
|
-
function
|
|
3973
|
+
function Z$1(t) {
|
|
3974
3974
|
if (!U$1(t)) throw new Error(`not a PColumn (kind = ${t.spec.kind})`);
|
|
3975
3975
|
return t;
|
|
3976
3976
|
}
|
|
3977
|
-
function
|
|
3977
|
+
function T(t, n) {
|
|
3978
3978
|
return t === void 0 ? void 0 : {
|
|
3979
3979
|
...t,
|
|
3980
3980
|
data: n(t.data)
|
|
3981
3981
|
};
|
|
3982
3982
|
}
|
|
3983
|
-
function
|
|
3984
|
-
const n = /* @__PURE__ */ new Map(),
|
|
3985
|
-
switch (
|
|
3983
|
+
function v$1(t) {
|
|
3984
|
+
const n = /* @__PURE__ */ new Map(), e = (r) => {
|
|
3985
|
+
switch (r.type) {
|
|
3986
3986
|
case "column":
|
|
3987
|
-
n.set(
|
|
3987
|
+
n.set(r.column.id, r.column);
|
|
3988
3988
|
return;
|
|
3989
3989
|
case "full":
|
|
3990
3990
|
case "inner":
|
|
3991
|
-
for (const
|
|
3991
|
+
for (const o of r.entries) e(o);
|
|
3992
3992
|
return;
|
|
3993
3993
|
case "outer":
|
|
3994
|
-
r
|
|
3995
|
-
for (const
|
|
3994
|
+
e(r.primary);
|
|
3995
|
+
for (const o of r.secondary) e(o);
|
|
3996
3996
|
return;
|
|
3997
3997
|
default:
|
|
3998
|
-
f(
|
|
3998
|
+
f(r);
|
|
3999
3999
|
}
|
|
4000
4000
|
};
|
|
4001
|
-
return
|
|
4001
|
+
return e(t), [...n.values()];
|
|
4002
4002
|
}
|
|
4003
|
-
function
|
|
4003
|
+
function tt(t, n) {
|
|
4004
4004
|
return t.ok ? { ok: true, value: n(t.value) } : t;
|
|
4005
4005
|
}
|
|
4006
|
-
var
|
|
4007
|
-
var
|
|
4008
|
-
var
|
|
4009
|
-
function
|
|
4010
|
-
return { type: "Immediate", value:
|
|
4006
|
+
var de = Object.defineProperty;
|
|
4007
|
+
var pe = (t, e, n) => e in t ? de(t, e, { enumerable: true, configurable: true, writable: true, value: n }) : t[e] = n;
|
|
4008
|
+
var S = (t, e, n) => pe(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4009
|
+
function L(t) {
|
|
4010
|
+
return { type: "Immediate", value: t };
|
|
4011
4011
|
}
|
|
4012
|
-
function
|
|
4012
|
+
function ve() {
|
|
4013
4013
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
4014
4014
|
}
|
|
4015
|
-
function
|
|
4016
|
-
if (
|
|
4017
|
-
return globalThis.getPlatforma(
|
|
4015
|
+
function ie(t) {
|
|
4016
|
+
if (t && typeof globalThis.getPlatforma == "function")
|
|
4017
|
+
return globalThis.getPlatforma(t);
|
|
4018
4018
|
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
4019
4019
|
throw new Error("Can't get platforma instance.");
|
|
4020
4020
|
}
|
|
4021
|
-
function
|
|
4021
|
+
function we() {
|
|
4022
4022
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
4023
4023
|
}
|
|
4024
4024
|
function u() {
|
|
4025
4025
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
4026
4026
|
throw new Error("Not in config rendering context");
|
|
4027
4027
|
}
|
|
4028
|
-
function
|
|
4029
|
-
const n =
|
|
4028
|
+
function k(t, e) {
|
|
4029
|
+
const n = we();
|
|
4030
4030
|
if (n === void 0) return false;
|
|
4031
|
-
if (
|
|
4032
|
-
return n.callbackRegistry[
|
|
4031
|
+
if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
|
|
4032
|
+
return n.callbackRegistry[t] = e, true;
|
|
4033
4033
|
}
|
|
4034
4034
|
const N = /* @__PURE__ */ new Map();
|
|
4035
|
-
function
|
|
4036
|
-
|
|
4037
|
-
for (const
|
|
4038
|
-
|
|
4039
|
-
}, N.set(
|
|
4035
|
+
function Se(t, e) {
|
|
4036
|
+
t in u().callbackRegistry || (u().callbackRegistry[t] = (n) => {
|
|
4037
|
+
for (const s of N.get(t))
|
|
4038
|
+
s(n);
|
|
4039
|
+
}, N.set(t, [])), N.get(t).push(e);
|
|
4040
4040
|
}
|
|
4041
|
-
class
|
|
4042
|
-
constructor(
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
this.handle =
|
|
4046
|
-
this.resolvedValue = n(
|
|
4041
|
+
class _ {
|
|
4042
|
+
constructor(e, n = (s) => s) {
|
|
4043
|
+
S(this, "isResolved", false);
|
|
4044
|
+
S(this, "resolvedValue");
|
|
4045
|
+
this.handle = e, this.postProcess = n, Se(e, (s) => {
|
|
4046
|
+
this.resolvedValue = n(s), this.isResolved = true;
|
|
4047
4047
|
});
|
|
4048
4048
|
}
|
|
4049
|
-
map(
|
|
4050
|
-
return new
|
|
4049
|
+
map(e) {
|
|
4050
|
+
return new _(this.handle, (n) => e(this.postProcess(n)));
|
|
4051
4051
|
}
|
|
4052
|
-
mapDefined(
|
|
4053
|
-
return new
|
|
4054
|
-
const
|
|
4055
|
-
return
|
|
4052
|
+
mapDefined(e) {
|
|
4053
|
+
return new _(this.handle, (n) => {
|
|
4054
|
+
const s = this.postProcess(n);
|
|
4055
|
+
return s ? e(s) : void 0;
|
|
4056
4056
|
});
|
|
4057
4057
|
}
|
|
4058
4058
|
toJSON() {
|
|
4059
4059
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
4060
4060
|
}
|
|
4061
4061
|
}
|
|
4062
|
-
function Q(
|
|
4063
|
-
return
|
|
4062
|
+
function Q(t) {
|
|
4063
|
+
return t === void 0 ? void 0 : new v(t);
|
|
4064
4064
|
}
|
|
4065
|
-
class
|
|
4066
|
-
constructor(
|
|
4067
|
-
this.handle =
|
|
4065
|
+
class v {
|
|
4066
|
+
constructor(e) {
|
|
4067
|
+
this.handle = e;
|
|
4068
4068
|
}
|
|
4069
|
-
resolve(...
|
|
4070
|
-
const n =
|
|
4071
|
-
(
|
|
4069
|
+
resolve(...e) {
|
|
4070
|
+
const n = e.map(
|
|
4071
|
+
(s) => ({
|
|
4072
4072
|
assertFieldType: "Input",
|
|
4073
|
-
...typeof
|
|
4073
|
+
...typeof s == "string" ? { field: s } : s
|
|
4074
4074
|
})
|
|
4075
4075
|
);
|
|
4076
4076
|
return this.resolveWithCommon({}, ...n);
|
|
4077
4077
|
}
|
|
4078
|
-
resolveOutput(...
|
|
4079
|
-
const n =
|
|
4080
|
-
(
|
|
4078
|
+
resolveOutput(...e) {
|
|
4079
|
+
const n = e.map(
|
|
4080
|
+
(s) => ({
|
|
4081
4081
|
assertFieldType: "Output",
|
|
4082
|
-
...typeof
|
|
4082
|
+
...typeof s == "string" ? { field: s } : s
|
|
4083
4083
|
})
|
|
4084
4084
|
);
|
|
4085
4085
|
return this.resolveWithCommon({}, ...n);
|
|
4086
4086
|
}
|
|
4087
|
-
resolveInput(...
|
|
4088
|
-
const n =
|
|
4089
|
-
(
|
|
4087
|
+
resolveInput(...e) {
|
|
4088
|
+
const n = e.map(
|
|
4089
|
+
(s) => ({
|
|
4090
4090
|
assertFieldType: "Input",
|
|
4091
|
-
...typeof
|
|
4091
|
+
...typeof s == "string" ? { field: s } : s
|
|
4092
4092
|
})
|
|
4093
4093
|
);
|
|
4094
4094
|
return this.resolveWithCommon({}, ...n);
|
|
4095
4095
|
}
|
|
4096
|
-
resolveAny(...
|
|
4097
|
-
return this.resolveWithCommon({}, ...
|
|
4096
|
+
resolveAny(...e) {
|
|
4097
|
+
return this.resolveWithCommon({}, ...e);
|
|
4098
4098
|
}
|
|
4099
|
-
resolveWithCommon(
|
|
4100
|
-
return Q(u().resolveWithCommon(this.handle,
|
|
4099
|
+
resolveWithCommon(e, ...n) {
|
|
4100
|
+
return Q(u().resolveWithCommon(this.handle, e, ...n));
|
|
4101
4101
|
}
|
|
4102
4102
|
get resourceType() {
|
|
4103
4103
|
return u().getResourceType(this.handle);
|
|
@@ -4126,14 +4126,14 @@
|
|
|
4126
4126
|
listDynamicFields() {
|
|
4127
4127
|
return u().listDynamicFields(this.handle);
|
|
4128
4128
|
}
|
|
4129
|
-
getKeyValueBase64(
|
|
4130
|
-
return u().getKeyValueBase64(this.handle,
|
|
4129
|
+
getKeyValueBase64(e) {
|
|
4130
|
+
return u().getKeyValueBase64(this.handle, e);
|
|
4131
4131
|
}
|
|
4132
|
-
getKeyValueAsString(
|
|
4133
|
-
return u().getKeyValueAsString(this.handle,
|
|
4132
|
+
getKeyValueAsString(e) {
|
|
4133
|
+
return u().getKeyValueAsString(this.handle, e);
|
|
4134
4134
|
}
|
|
4135
|
-
getKeyValueAsJson(
|
|
4136
|
-
const n = this.getKeyValueAsString(
|
|
4135
|
+
getKeyValueAsJson(e) {
|
|
4136
|
+
const n = this.getKeyValueAsString(e);
|
|
4137
4137
|
if (n == null) throw new Error("Resource has no content.");
|
|
4138
4138
|
return JSON.parse(n);
|
|
4139
4139
|
}
|
|
@@ -4144,45 +4144,45 @@
|
|
|
4144
4144
|
return u().getDataAsString(this.handle);
|
|
4145
4145
|
}
|
|
4146
4146
|
getDataAsJson() {
|
|
4147
|
-
const
|
|
4148
|
-
if (
|
|
4149
|
-
return JSON.parse(
|
|
4147
|
+
const e = this.getDataAsString();
|
|
4148
|
+
if (e == null) throw new Error("Resource has no content.");
|
|
4149
|
+
return JSON.parse(e);
|
|
4150
4150
|
}
|
|
4151
4151
|
/**
|
|
4152
4152
|
*
|
|
4153
4153
|
*/
|
|
4154
|
-
getPColumns(
|
|
4155
|
-
const
|
|
4156
|
-
return
|
|
4157
|
-
if (!U$1(
|
|
4158
|
-
return
|
|
4154
|
+
getPColumns(e = false, n = "") {
|
|
4155
|
+
const s = this.parsePObjectCollection(e, n);
|
|
4156
|
+
return s === void 0 ? void 0 : Object.entries(s).map(([, r]) => {
|
|
4157
|
+
if (!U$1(r)) throw new Error(`not a PColumn (kind = ${r.spec.kind})`);
|
|
4158
|
+
return r;
|
|
4159
4159
|
});
|
|
4160
4160
|
}
|
|
4161
4161
|
/**
|
|
4162
4162
|
*
|
|
4163
4163
|
*/
|
|
4164
|
-
parsePObjectCollection(
|
|
4165
|
-
const
|
|
4164
|
+
parsePObjectCollection(e = false, n = "") {
|
|
4165
|
+
const s = u().parsePObjectCollection(
|
|
4166
4166
|
this.handle,
|
|
4167
|
-
|
|
4167
|
+
e,
|
|
4168
4168
|
n
|
|
4169
4169
|
);
|
|
4170
|
-
if (
|
|
4171
|
-
const
|
|
4172
|
-
for (const [
|
|
4173
|
-
|
|
4174
|
-
return
|
|
4170
|
+
if (s === void 0) return;
|
|
4171
|
+
const i2 = {};
|
|
4172
|
+
for (const [r, o] of Object.entries(s))
|
|
4173
|
+
i2[r] = T(o, (l) => new v(l));
|
|
4174
|
+
return i2;
|
|
4175
4175
|
}
|
|
4176
4176
|
getFileContentAsBase64() {
|
|
4177
|
-
return new
|
|
4177
|
+
return new _(u().getBlobContentAsBase64(this.handle));
|
|
4178
4178
|
}
|
|
4179
4179
|
getFileContentAsString() {
|
|
4180
|
-
return new
|
|
4180
|
+
return new _(u().getBlobContentAsString(this.handle));
|
|
4181
4181
|
}
|
|
4182
4182
|
getFileContentAsJson() {
|
|
4183
|
-
return new
|
|
4183
|
+
return new _(
|
|
4184
4184
|
u().getBlobContentAsString(this.handle)
|
|
4185
|
-
).mapDefined((
|
|
4185
|
+
).mapDefined((e) => JSON.parse(e));
|
|
4186
4186
|
}
|
|
4187
4187
|
/**
|
|
4188
4188
|
* @deprecated use getFileContentAsBase64
|
|
@@ -4200,7 +4200,7 @@
|
|
|
4200
4200
|
* @returns downloaded file handle
|
|
4201
4201
|
*/
|
|
4202
4202
|
getFileHandle() {
|
|
4203
|
-
return new
|
|
4203
|
+
return new _(u().getDownloadedBlobContentHandle(this.handle));
|
|
4204
4204
|
}
|
|
4205
4205
|
/**
|
|
4206
4206
|
* @deprecated use getFileHandle
|
|
@@ -4212,7 +4212,7 @@
|
|
|
4212
4212
|
* @returns downloaded file handle
|
|
4213
4213
|
*/
|
|
4214
4214
|
getRemoteFileHandle() {
|
|
4215
|
-
return new
|
|
4215
|
+
return new _(u().getOnDemandBlobContentHandle(this.handle));
|
|
4216
4216
|
}
|
|
4217
4217
|
/**
|
|
4218
4218
|
* @deprecated use getRemoteFileHandle
|
|
@@ -4221,19 +4221,19 @@
|
|
|
4221
4221
|
return this.getRemoteFileHandle();
|
|
4222
4222
|
}
|
|
4223
4223
|
getImportProgress() {
|
|
4224
|
-
return new
|
|
4224
|
+
return new _(u().getImportProgress(this.handle));
|
|
4225
4225
|
}
|
|
4226
|
-
getLastLogs(
|
|
4227
|
-
return new
|
|
4226
|
+
getLastLogs(e) {
|
|
4227
|
+
return new _(u().getLastLogs(this.handle, e));
|
|
4228
4228
|
}
|
|
4229
|
-
getProgressLog(
|
|
4230
|
-
return new
|
|
4229
|
+
getProgressLog(e) {
|
|
4230
|
+
return new _(u().getProgressLog(this.handle, e));
|
|
4231
4231
|
}
|
|
4232
4232
|
getLogHandle() {
|
|
4233
|
-
return new
|
|
4233
|
+
return new _(u().getLogHandle(this.handle));
|
|
4234
4234
|
}
|
|
4235
|
-
allFieldsResolved(
|
|
4236
|
-
switch (
|
|
4235
|
+
allFieldsResolved(e = "Input") {
|
|
4236
|
+
switch (e) {
|
|
4237
4237
|
case "Input":
|
|
4238
4238
|
return this.getInputsLocked() && this.listInputFields().every(
|
|
4239
4239
|
(n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
|
|
@@ -4244,104 +4244,104 @@
|
|
|
4244
4244
|
);
|
|
4245
4245
|
}
|
|
4246
4246
|
}
|
|
4247
|
-
mapFields(
|
|
4248
|
-
const { fieldType:
|
|
4247
|
+
mapFields(e, n) {
|
|
4248
|
+
const { fieldType: s, requireLocked: i2, skipUnresolved: r } = {
|
|
4249
4249
|
fieldType: "Input",
|
|
4250
4250
|
requireLocked: true,
|
|
4251
4251
|
skipUnresolved: false,
|
|
4252
4252
|
...n
|
|
4253
|
-
},
|
|
4254
|
-
if (
|
|
4253
|
+
}, o = e;
|
|
4254
|
+
if (i2 && (s === "Input" && !this.getInputsLocked() || s === "Output" && !this.getOutputsLocked()))
|
|
4255
4255
|
return;
|
|
4256
|
-
let
|
|
4257
|
-
(
|
|
4256
|
+
let d = (s === "Input" ? this.listInputFields() : s === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
4257
|
+
(a) => [a, this.resolve({ field: a, assertFieldType: s })]
|
|
4258
4258
|
);
|
|
4259
|
-
return
|
|
4259
|
+
return r && (d = d.filter((a) => a[1] !== void 0)), d.map(([a, p]) => o(a, p));
|
|
4260
4260
|
}
|
|
4261
4261
|
}
|
|
4262
|
-
const
|
|
4263
|
-
const
|
|
4264
|
-
type: z
|
|
4265
|
-
importance: z
|
|
4266
|
-
id: z
|
|
4267
|
-
label: z
|
|
4268
|
-
}),
|
|
4269
|
-
function
|
|
4270
|
-
const
|
|
4271
|
-
var
|
|
4272
|
-
const m =
|
|
4273
|
-
if (
|
|
4274
|
-
const
|
|
4275
|
-
n.addLabelAsSuffix ?
|
|
4262
|
+
const re = "staging", oe = "main";
|
|
4263
|
+
const Ie = "pl7.app/label", Pe = "pl7.app/trace", Re = z.object({
|
|
4264
|
+
type: z.string(),
|
|
4265
|
+
importance: z.number().optional(),
|
|
4266
|
+
id: z.string().optional(),
|
|
4267
|
+
label: z.string()
|
|
4268
|
+
}), Fe = z.array(Re), Te = 1e-3, Oe = "__LABEL__", Z = "__LABEL__@1";
|
|
4269
|
+
function ke(t, e, n = {}) {
|
|
4270
|
+
const s = /* @__PURE__ */ new Map(), i2 = /* @__PURE__ */ new Map(), r = t.map((c) => {
|
|
4271
|
+
var q2, z2;
|
|
4272
|
+
const m = e(c), h = (q2 = m.annotations) == null ? void 0 : q2[Ie], A = (z2 = m.annotations) == null ? void 0 : z2[Pe], y = (A ? Fe.safeParse(JSON.parse(A)).data : void 0) ?? [];
|
|
4273
|
+
if (h) {
|
|
4274
|
+
const w = { label: h, type: Oe, importance: -2 };
|
|
4275
|
+
n.addLabelAsSuffix ? y.push(w) : y.splice(0, 0, w);
|
|
4276
4276
|
}
|
|
4277
|
-
const
|
|
4278
|
-
for (let
|
|
4279
|
-
const { type: V } =
|
|
4277
|
+
const C = [], W = /* @__PURE__ */ new Map();
|
|
4278
|
+
for (let w = y.length - 1; w >= 0; --w) {
|
|
4279
|
+
const { type: V } = y[w], ce = y[w].importance ?? 0, j = (W.get(V) ?? 0) + 1;
|
|
4280
4280
|
W.set(V, j);
|
|
4281
|
-
const
|
|
4282
|
-
|
|
4283
|
-
|
|
4281
|
+
const R = `${V}@${j}`;
|
|
4282
|
+
i2.set(R, (i2.get(R) ?? 0) + 1), s.set(
|
|
4283
|
+
R,
|
|
4284
4284
|
Math.max(
|
|
4285
|
-
|
|
4286
|
-
|
|
4285
|
+
s.get(R) ?? Number.NEGATIVE_INFINITY,
|
|
4286
|
+
ce - (y.length - w) * Te
|
|
4287
4287
|
)
|
|
4288
|
-
),
|
|
4288
|
+
), C.push({ ...y[w], fullType: R, occurenceIndex: j });
|
|
4289
4289
|
}
|
|
4290
|
-
return
|
|
4291
|
-
value:
|
|
4290
|
+
return C.reverse(), {
|
|
4291
|
+
value: c,
|
|
4292
4292
|
spec: m,
|
|
4293
|
-
label:
|
|
4294
|
-
fullTrace:
|
|
4293
|
+
label: h,
|
|
4294
|
+
fullTrace: C
|
|
4295
4295
|
};
|
|
4296
|
-
}),
|
|
4297
|
-
|
|
4298
|
-
for (const [
|
|
4299
|
-
|
|
4300
|
-
const
|
|
4301
|
-
const
|
|
4296
|
+
}), o = [], l = [], d = [...s];
|
|
4297
|
+
d.sort(([, c], [, m]) => m - c);
|
|
4298
|
+
for (const [c] of d)
|
|
4299
|
+
c.endsWith("@1") || i2.get(c) === t.length ? o.push(c) : l.push(c);
|
|
4300
|
+
const a = (c) => r.map((m) => {
|
|
4301
|
+
const h = m.fullTrace.filter((y) => c.has(y.fullType)).map((y) => y.label), A = n.separator ?? " / ";
|
|
4302
4302
|
return {
|
|
4303
|
-
label:
|
|
4303
|
+
label: h.join(A),
|
|
4304
4304
|
value: m.value
|
|
4305
4305
|
};
|
|
4306
4306
|
});
|
|
4307
|
-
if (
|
|
4307
|
+
if (o.length === 0) {
|
|
4308
4308
|
if (l.length !== 0) throw new Error("Assertion error.");
|
|
4309
|
-
return
|
|
4310
|
-
}
|
|
4311
|
-
let
|
|
4312
|
-
for (;
|
|
4313
|
-
const
|
|
4314
|
-
n.includeNativeLabel &&
|
|
4315
|
-
for (let
|
|
4316
|
-
|
|
4317
|
-
const m = c
|
|
4318
|
-
if (new Set(m.map((
|
|
4319
|
-
|
|
4320
|
-
}
|
|
4321
|
-
return
|
|
4309
|
+
return a(new Set(Z));
|
|
4310
|
+
}
|
|
4311
|
+
let p = 0, g = 0;
|
|
4312
|
+
for (; p < o.length; ) {
|
|
4313
|
+
const c = /* @__PURE__ */ new Set();
|
|
4314
|
+
n.includeNativeLabel && c.add(Z);
|
|
4315
|
+
for (let h = 0; h < p; ++h) c.add(o[h]);
|
|
4316
|
+
c.add(o[g]);
|
|
4317
|
+
const m = a(c);
|
|
4318
|
+
if (new Set(m.map((h) => h.label)).size === t.length) return m;
|
|
4319
|
+
g++, g == o.length && (p++, g = p);
|
|
4320
|
+
}
|
|
4321
|
+
return a(/* @__PURE__ */ new Set([...o, ...l]));
|
|
4322
4322
|
}
|
|
4323
|
-
class
|
|
4323
|
+
class De {
|
|
4324
4324
|
constructor() {
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
var
|
|
4328
|
-
return ((
|
|
4325
|
+
S(this, "ctx", u());
|
|
4326
|
+
S(this, "defaultLabelFn", (e, n) => {
|
|
4327
|
+
var s;
|
|
4328
|
+
return ((s = e.annotations) == null ? void 0 : s["pl7.app/label"]) ?? "Unlabelled";
|
|
4329
4329
|
});
|
|
4330
4330
|
}
|
|
4331
4331
|
/**
|
|
4332
4332
|
* @deprecated use getOptions()
|
|
4333
4333
|
*/
|
|
4334
|
-
calculateOptions(
|
|
4335
|
-
return this.ctx.calculateOptions(
|
|
4336
|
-
}
|
|
4337
|
-
getOptions(
|
|
4338
|
-
const
|
|
4339
|
-
return typeof n == "object" || typeof n > "u" ?
|
|
4340
|
-
ref:
|
|
4341
|
-
label:
|
|
4342
|
-
})) :
|
|
4343
|
-
ref:
|
|
4344
|
-
label: n(
|
|
4334
|
+
calculateOptions(e) {
|
|
4335
|
+
return this.ctx.calculateOptions(e);
|
|
4336
|
+
}
|
|
4337
|
+
getOptions(e, n) {
|
|
4338
|
+
const s = this.getSpecs().entries.filter((i2) => e(i2.obj));
|
|
4339
|
+
return typeof n == "object" || typeof n > "u" ? ke(s, (i2) => i2.obj, n ?? {}).map(({ value: { ref: i2 }, label: r }) => ({
|
|
4340
|
+
ref: i2,
|
|
4341
|
+
label: r
|
|
4342
|
+
})) : s.map((i2) => ({
|
|
4343
|
+
ref: i2.ref,
|
|
4344
|
+
label: n(i2.obj, i2.ref)
|
|
4345
4345
|
}));
|
|
4346
4346
|
}
|
|
4347
4347
|
/**
|
|
@@ -4351,14 +4351,14 @@
|
|
|
4351
4351
|
return this.getData();
|
|
4352
4352
|
}
|
|
4353
4353
|
getData() {
|
|
4354
|
-
const
|
|
4354
|
+
const e = this.ctx.getDataFromResultPool();
|
|
4355
4355
|
return {
|
|
4356
|
-
isComplete:
|
|
4357
|
-
entries:
|
|
4356
|
+
isComplete: e.isComplete,
|
|
4357
|
+
entries: e.entries.map((n) => ({
|
|
4358
4358
|
ref: n.ref,
|
|
4359
4359
|
obj: {
|
|
4360
4360
|
...n.obj,
|
|
4361
|
-
data: new
|
|
4361
|
+
data: new v(n.obj.data)
|
|
4362
4362
|
}
|
|
4363
4363
|
}))
|
|
4364
4364
|
};
|
|
@@ -4370,14 +4370,14 @@
|
|
|
4370
4370
|
return this.getDataWithErrors();
|
|
4371
4371
|
}
|
|
4372
4372
|
getDataWithErrors() {
|
|
4373
|
-
const
|
|
4373
|
+
const e = this.ctx.getDataWithErrorsFromResultPool();
|
|
4374
4374
|
return {
|
|
4375
|
-
isComplete:
|
|
4376
|
-
entries:
|
|
4375
|
+
isComplete: e.isComplete,
|
|
4376
|
+
entries: e.entries.map((n) => ({
|
|
4377
4377
|
ref: n.ref,
|
|
4378
4378
|
obj: {
|
|
4379
4379
|
...n.obj,
|
|
4380
|
-
data:
|
|
4380
|
+
data: tt(n.obj.data, (s) => new v(s))
|
|
4381
4381
|
}
|
|
4382
4382
|
}))
|
|
4383
4383
|
};
|
|
@@ -4395,13 +4395,13 @@
|
|
|
4395
4395
|
* @param ref a Ref
|
|
4396
4396
|
* @returns data associated with the ref
|
|
4397
4397
|
*/
|
|
4398
|
-
getDataByRef(
|
|
4398
|
+
getDataByRef(e) {
|
|
4399
4399
|
var n;
|
|
4400
4400
|
return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
|
|
4401
|
-
(
|
|
4402
|
-
)) == null ? void 0 : n.obj :
|
|
4403
|
-
this.ctx.getDataFromResultPoolByRef(
|
|
4404
|
-
(
|
|
4401
|
+
(s) => s.ref.blockId === e.blockId && s.ref.name === e.name
|
|
4402
|
+
)) == null ? void 0 : n.obj : T(
|
|
4403
|
+
this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
|
|
4404
|
+
(s) => new v(s)
|
|
4405
4405
|
);
|
|
4406
4406
|
}
|
|
4407
4407
|
/**
|
|
@@ -4409,20 +4409,20 @@
|
|
|
4409
4409
|
* @param ref a Ref
|
|
4410
4410
|
* @returns p-column associated with the ref
|
|
4411
4411
|
*/
|
|
4412
|
-
getPColumnByRef(
|
|
4413
|
-
const n = this.getDataByRef(
|
|
4412
|
+
getPColumnByRef(e) {
|
|
4413
|
+
const n = this.getDataByRef(e);
|
|
4414
4414
|
if (n)
|
|
4415
|
-
return
|
|
4415
|
+
return Z$1(n);
|
|
4416
4416
|
}
|
|
4417
4417
|
/**
|
|
4418
4418
|
* Returns spec associated with the ref ensuring that it is a p-column spec.
|
|
4419
4419
|
* @param ref a Ref
|
|
4420
4420
|
* @returns p-column spec associated with the ref
|
|
4421
4421
|
*/
|
|
4422
|
-
getPColumnSpecByRef(
|
|
4423
|
-
const n = this.getSpecByRef(
|
|
4422
|
+
getPColumnSpecByRef(e) {
|
|
4423
|
+
const n = this.getSpecByRef(e);
|
|
4424
4424
|
if (n) {
|
|
4425
|
-
if (!
|
|
4425
|
+
if (!i(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
|
|
4426
4426
|
return n;
|
|
4427
4427
|
}
|
|
4428
4428
|
}
|
|
@@ -4430,56 +4430,56 @@
|
|
|
4430
4430
|
* @param ref a Ref
|
|
4431
4431
|
* @returns object spec associated with the ref
|
|
4432
4432
|
*/
|
|
4433
|
-
getSpecByRef(
|
|
4433
|
+
getSpecByRef(e) {
|
|
4434
4434
|
var n;
|
|
4435
4435
|
return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
|
|
4436
|
-
(
|
|
4437
|
-
)) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(
|
|
4436
|
+
(s) => s.ref.blockId === e.blockId && s.ref.name === e.name
|
|
4437
|
+
)) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
|
|
4438
4438
|
}
|
|
4439
4439
|
/**
|
|
4440
4440
|
* @param spec object specification
|
|
4441
4441
|
* @returns array of data objects with compatible specs
|
|
4442
4442
|
* @deprecated delete this method after Jan 1, 2025
|
|
4443
4443
|
*/
|
|
4444
|
-
findDataWithCompatibleSpec(
|
|
4444
|
+
findDataWithCompatibleSpec(e) {
|
|
4445
4445
|
const n = [];
|
|
4446
|
-
|
|
4447
|
-
if (!
|
|
4446
|
+
e: for (const s of this.getData().entries) {
|
|
4447
|
+
if (!i(s.obj.spec))
|
|
4448
4448
|
continue;
|
|
4449
|
-
const
|
|
4450
|
-
if (
|
|
4451
|
-
for (let
|
|
4452
|
-
const
|
|
4453
|
-
if (
|
|
4454
|
-
continue
|
|
4449
|
+
const i$1 = s.obj.spec;
|
|
4450
|
+
if (e.name === i$1.name && e.valueType === i$1.valueType && e.axesSpec.length === i$1.axesSpec.length && $(e.domain, i$1.domain)) {
|
|
4451
|
+
for (let r = 0; r < e.axesSpec.length; ++r) {
|
|
4452
|
+
const o = e.axesSpec[r], l = i$1.axesSpec[r];
|
|
4453
|
+
if (o.name !== l.name || o.type !== l.type || !$(o.domain, l.domain))
|
|
4454
|
+
continue e;
|
|
4455
4455
|
}
|
|
4456
|
-
n.push(
|
|
4456
|
+
n.push(s.obj);
|
|
4457
4457
|
}
|
|
4458
4458
|
}
|
|
4459
4459
|
return n;
|
|
4460
4460
|
}
|
|
4461
4461
|
}
|
|
4462
|
-
function $(
|
|
4463
|
-
if (
|
|
4464
|
-
if (
|
|
4465
|
-
for (const n in
|
|
4466
|
-
if (
|
|
4462
|
+
function $(t, e) {
|
|
4463
|
+
if (t === void 0) return e === void 0;
|
|
4464
|
+
if (e === void 0) return true;
|
|
4465
|
+
for (const n in e)
|
|
4466
|
+
if (t[n] !== e[n]) return false;
|
|
4467
4467
|
return true;
|
|
4468
4468
|
}
|
|
4469
|
-
class
|
|
4469
|
+
class D {
|
|
4470
4470
|
constructor() {
|
|
4471
|
-
|
|
4472
|
-
|
|
4473
|
-
|
|
4474
|
-
|
|
4471
|
+
S(this, "ctx");
|
|
4472
|
+
S(this, "args");
|
|
4473
|
+
S(this, "uiState");
|
|
4474
|
+
S(this, "resultPool", new De());
|
|
4475
4475
|
this.ctx = u(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : void 0;
|
|
4476
4476
|
}
|
|
4477
|
-
getNamedAccessor(
|
|
4478
|
-
const n = this.ctx.getAccessorHandleByName(
|
|
4479
|
-
return n ? new
|
|
4477
|
+
getNamedAccessor(e) {
|
|
4478
|
+
const n = this.ctx.getAccessorHandleByName(e);
|
|
4479
|
+
return n ? new v(n) : void 0;
|
|
4480
4480
|
}
|
|
4481
4481
|
get prerun() {
|
|
4482
|
-
return this.getNamedAccessor(
|
|
4482
|
+
return this.getNamedAccessor(re);
|
|
4483
4483
|
}
|
|
4484
4484
|
/**
|
|
4485
4485
|
* @deprecated use prerun
|
|
@@ -4494,7 +4494,7 @@
|
|
|
4494
4494
|
return this.precalc;
|
|
4495
4495
|
}
|
|
4496
4496
|
get outputs() {
|
|
4497
|
-
return this.getNamedAccessor(
|
|
4497
|
+
return this.getNamedAccessor(oe);
|
|
4498
4498
|
}
|
|
4499
4499
|
/**
|
|
4500
4500
|
* @deprecated use outputs
|
|
@@ -4506,92 +4506,92 @@
|
|
|
4506
4506
|
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
4507
4507
|
* @returns a map of axis value => label
|
|
4508
4508
|
*/
|
|
4509
|
-
findLabels(
|
|
4509
|
+
findLabels(e) {
|
|
4510
4510
|
const n = this.resultPool.getData();
|
|
4511
|
-
for (const
|
|
4512
|
-
if (!U$1(
|
|
4513
|
-
const
|
|
4514
|
-
if (
|
|
4515
|
-
if (
|
|
4516
|
-
throw Error(`Expected JSON column for labels, got: ${
|
|
4511
|
+
for (const s of n.entries) {
|
|
4512
|
+
if (!U$1(s.obj)) continue;
|
|
4513
|
+
const i2 = s.obj.spec;
|
|
4514
|
+
if (i2.name === "pl7.app/label" && i2.axesSpec.length === 1 && i2.axesSpec[0].name === e.name && i2.axesSpec[0].type === e.type && $(e.domain, i2.axesSpec[0].domain)) {
|
|
4515
|
+
if (s.obj.data.resourceType.name !== "PColumnData/Json")
|
|
4516
|
+
throw Error(`Expected JSON column for labels, got: ${s.obj.data.resourceType.name}`);
|
|
4517
4517
|
return Object.fromEntries(
|
|
4518
4518
|
Object.entries(
|
|
4519
|
-
|
|
4520
|
-
).map((
|
|
4519
|
+
s.obj.data.getDataAsJson().data
|
|
4520
|
+
).map((o) => [JSON.parse(o[0])[0], o[1]])
|
|
4521
4521
|
);
|
|
4522
4522
|
}
|
|
4523
4523
|
}
|
|
4524
4524
|
}
|
|
4525
|
-
verifyInlineColumnsSupport(
|
|
4526
|
-
var
|
|
4527
|
-
const n =
|
|
4528
|
-
if (n && !
|
|
4525
|
+
verifyInlineColumnsSupport(e) {
|
|
4526
|
+
var i2;
|
|
4527
|
+
const n = e.some((r) => !(r.data instanceof v)), s = ((i2 = this.ctx.featureFlags) == null ? void 0 : i2.inlineColumnsSupport) === true;
|
|
4528
|
+
if (n && !s) throw Error("inline columns not supported");
|
|
4529
4529
|
}
|
|
4530
|
-
createPFrame(
|
|
4531
|
-
return this.verifyInlineColumnsSupport(
|
|
4530
|
+
createPFrame(e) {
|
|
4531
|
+
return this.verifyInlineColumnsSupport(e), this.ctx.createPFrame(e.map((n) => T(
|
|
4532
4532
|
n,
|
|
4533
|
-
(
|
|
4533
|
+
(s) => s instanceof v ? s.handle : s
|
|
4534
4534
|
)));
|
|
4535
4535
|
}
|
|
4536
|
-
createPTable(
|
|
4536
|
+
createPTable(e) {
|
|
4537
4537
|
var n;
|
|
4538
|
-
return "columns" in
|
|
4538
|
+
return "columns" in e ? n = {
|
|
4539
4539
|
src: {
|
|
4540
4540
|
type: "full",
|
|
4541
|
-
entries:
|
|
4541
|
+
entries: e.columns.map((s) => ({ type: "column", column: s }))
|
|
4542
4542
|
},
|
|
4543
|
-
filters:
|
|
4544
|
-
sorting:
|
|
4545
|
-
} : n =
|
|
4546
|
-
|
|
4547
|
-
(
|
|
4543
|
+
filters: e.filters ?? [],
|
|
4544
|
+
sorting: e.sorting ?? []
|
|
4545
|
+
} : n = e, this.verifyInlineColumnsSupport(v$1(n.src)), this.ctx.createPTable(q(n, (s) => T(
|
|
4546
|
+
s,
|
|
4547
|
+
(i2) => i2 instanceof v ? i2.handle : i2
|
|
4548
4548
|
)));
|
|
4549
4549
|
}
|
|
4550
4550
|
/** @deprecated scheduled for removal from SDK */
|
|
4551
|
-
getBlockLabel(
|
|
4552
|
-
return this.ctx.getBlockLabel(
|
|
4551
|
+
getBlockLabel(e) {
|
|
4552
|
+
return this.ctx.getBlockLabel(e);
|
|
4553
4553
|
}
|
|
4554
4554
|
getCurrentUnstableMarker() {
|
|
4555
4555
|
if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
|
|
4556
4556
|
return this.ctx.getCurrentUnstableMarker();
|
|
4557
4557
|
}
|
|
4558
4558
|
}
|
|
4559
|
-
const
|
|
4560
|
-
function
|
|
4561
|
-
return
|
|
4559
|
+
const F = "1.20.11";
|
|
4560
|
+
function xe(t) {
|
|
4561
|
+
return t.__renderLambda === true;
|
|
4562
4562
|
}
|
|
4563
|
-
function U(
|
|
4564
|
-
if (
|
|
4565
|
-
return
|
|
4563
|
+
function U(t) {
|
|
4564
|
+
if (t !== void 0)
|
|
4565
|
+
return xe(t) ? t.handle : t;
|
|
4566
4566
|
}
|
|
4567
|
-
class
|
|
4568
|
-
constructor(
|
|
4569
|
-
this._renderingMode =
|
|
4567
|
+
class b {
|
|
4568
|
+
constructor(e, n, s, i2, r, o, l) {
|
|
4569
|
+
this._renderingMode = e, this._initialArgs = n, this._initialUiState = s, this._outputs = i2, this._inputsValid = r, this._sections = o, this._title = l;
|
|
4570
4570
|
}
|
|
4571
|
-
static create(
|
|
4572
|
-
return new
|
|
4573
|
-
|
|
4571
|
+
static create(e = "Heavy") {
|
|
4572
|
+
return new b(
|
|
4573
|
+
e,
|
|
4574
4574
|
void 0,
|
|
4575
4575
|
{},
|
|
4576
4576
|
{},
|
|
4577
|
-
|
|
4578
|
-
|
|
4577
|
+
L(true),
|
|
4578
|
+
L([]),
|
|
4579
4579
|
void 0
|
|
4580
4580
|
);
|
|
4581
4581
|
}
|
|
4582
|
-
output(
|
|
4582
|
+
output(e, n, s = {}) {
|
|
4583
4583
|
if (typeof n == "function") {
|
|
4584
|
-
const
|
|
4585
|
-
return
|
|
4584
|
+
const i2 = `output#${e}`;
|
|
4585
|
+
return k(i2, () => n(new D())), new b(
|
|
4586
4586
|
this._renderingMode,
|
|
4587
4587
|
this._initialArgs,
|
|
4588
4588
|
this._initialUiState,
|
|
4589
4589
|
{
|
|
4590
4590
|
...this._outputs,
|
|
4591
|
-
[
|
|
4591
|
+
[e]: {
|
|
4592
4592
|
__renderLambda: true,
|
|
4593
|
-
handle:
|
|
4594
|
-
...
|
|
4593
|
+
handle: i2,
|
|
4594
|
+
...s
|
|
4595
4595
|
}
|
|
4596
4596
|
},
|
|
4597
4597
|
this._inputsValid,
|
|
@@ -4599,13 +4599,13 @@
|
|
|
4599
4599
|
this._title
|
|
4600
4600
|
);
|
|
4601
4601
|
} else
|
|
4602
|
-
return new
|
|
4602
|
+
return new b(
|
|
4603
4603
|
this._renderingMode,
|
|
4604
4604
|
this._initialArgs,
|
|
4605
4605
|
this._initialUiState,
|
|
4606
4606
|
{
|
|
4607
4607
|
...this._outputs,
|
|
4608
|
-
[
|
|
4608
|
+
[e]: n
|
|
4609
4609
|
},
|
|
4610
4610
|
this._inputsValid,
|
|
4611
4611
|
this._sections,
|
|
@@ -4613,15 +4613,15 @@
|
|
|
4613
4613
|
);
|
|
4614
4614
|
}
|
|
4615
4615
|
/** Shortcut for {@link output} with retentive flag set to true. */
|
|
4616
|
-
retentiveOutput(
|
|
4617
|
-
return this.output(
|
|
4616
|
+
retentiveOutput(e, n) {
|
|
4617
|
+
return this.output(e, n, { retentive: true });
|
|
4618
4618
|
}
|
|
4619
4619
|
/** @deprecated */
|
|
4620
|
-
canRun(
|
|
4621
|
-
return this.inputsValid(
|
|
4620
|
+
canRun(e) {
|
|
4621
|
+
return this.inputsValid(e);
|
|
4622
4622
|
}
|
|
4623
|
-
argsValid(
|
|
4624
|
-
return typeof
|
|
4623
|
+
argsValid(e) {
|
|
4624
|
+
return typeof e == "function" ? (k("inputsValid", () => e(new D())), new b(
|
|
4625
4625
|
this._renderingMode,
|
|
4626
4626
|
this._initialArgs,
|
|
4627
4627
|
this._initialUiState,
|
|
@@ -4632,21 +4632,21 @@
|
|
|
4632
4632
|
},
|
|
4633
4633
|
this._sections,
|
|
4634
4634
|
this._title
|
|
4635
|
-
)) : new
|
|
4635
|
+
)) : new b(
|
|
4636
4636
|
this._renderingMode,
|
|
4637
4637
|
this._initialArgs,
|
|
4638
4638
|
this._initialUiState,
|
|
4639
4639
|
this._outputs,
|
|
4640
|
-
|
|
4640
|
+
e,
|
|
4641
4641
|
this._sections,
|
|
4642
4642
|
this._title
|
|
4643
4643
|
);
|
|
4644
4644
|
}
|
|
4645
|
-
inputsValid(
|
|
4646
|
-
return this.argsValid(
|
|
4645
|
+
inputsValid(e) {
|
|
4646
|
+
return this.argsValid(e);
|
|
4647
4647
|
}
|
|
4648
|
-
sections(
|
|
4649
|
-
return Array.isArray(
|
|
4648
|
+
sections(e) {
|
|
4649
|
+
return Array.isArray(e) ? this.sections(L(e)) : typeof e == "function" ? (k("sections", () => e(new D())), new b(
|
|
4650
4650
|
this._renderingMode,
|
|
4651
4651
|
this._initialArgs,
|
|
4652
4652
|
this._initialUiState,
|
|
@@ -4654,18 +4654,18 @@
|
|
|
4654
4654
|
this._inputsValid,
|
|
4655
4655
|
{ __renderLambda: true, handle: "sections" },
|
|
4656
4656
|
this._title
|
|
4657
|
-
)) : new
|
|
4657
|
+
)) : new b(
|
|
4658
4658
|
this._renderingMode,
|
|
4659
4659
|
this._initialArgs,
|
|
4660
4660
|
this._initialUiState,
|
|
4661
4661
|
this._outputs,
|
|
4662
4662
|
this._inputsValid,
|
|
4663
|
-
|
|
4663
|
+
e,
|
|
4664
4664
|
this._title
|
|
4665
4665
|
);
|
|
4666
4666
|
}
|
|
4667
|
-
title(
|
|
4668
|
-
return
|
|
4667
|
+
title(e) {
|
|
4668
|
+
return k("title", () => e(new D())), new b(
|
|
4669
4669
|
this._renderingMode,
|
|
4670
4670
|
this._initialArgs,
|
|
4671
4671
|
this._initialUiState,
|
|
@@ -4679,10 +4679,10 @@
|
|
|
4679
4679
|
* Sets initial args for the block, this value must be specified.
|
|
4680
4680
|
* @deprecated use {@link withArgs}
|
|
4681
4681
|
* */
|
|
4682
|
-
initialArgs(
|
|
4683
|
-
return new
|
|
4682
|
+
initialArgs(e) {
|
|
4683
|
+
return new b(
|
|
4684
4684
|
this._renderingMode,
|
|
4685
|
-
|
|
4685
|
+
e,
|
|
4686
4686
|
this._initialUiState,
|
|
4687
4687
|
this._outputs,
|
|
4688
4688
|
this._inputsValid,
|
|
@@ -4691,10 +4691,10 @@
|
|
|
4691
4691
|
);
|
|
4692
4692
|
}
|
|
4693
4693
|
/** Sets initial args for the block, this value must be specified. */
|
|
4694
|
-
withArgs(
|
|
4695
|
-
return new
|
|
4694
|
+
withArgs(e) {
|
|
4695
|
+
return new b(
|
|
4696
4696
|
this._renderingMode,
|
|
4697
|
-
|
|
4697
|
+
e,
|
|
4698
4698
|
this._initialUiState,
|
|
4699
4699
|
this._outputs,
|
|
4700
4700
|
this._inputsValid,
|
|
@@ -4703,11 +4703,11 @@
|
|
|
4703
4703
|
);
|
|
4704
4704
|
}
|
|
4705
4705
|
/** Defines type and sets initial value for block UiState. */
|
|
4706
|
-
withUiState(
|
|
4707
|
-
return new
|
|
4706
|
+
withUiState(e) {
|
|
4707
|
+
return new b(
|
|
4708
4708
|
this._renderingMode,
|
|
4709
4709
|
this._initialArgs,
|
|
4710
|
-
|
|
4710
|
+
e,
|
|
4711
4711
|
this._outputs,
|
|
4712
4712
|
this._inputsValid,
|
|
4713
4713
|
this._sections,
|
|
@@ -4719,9 +4719,9 @@
|
|
|
4719
4719
|
* other features provided by the platforma to the block. */
|
|
4720
4720
|
done() {
|
|
4721
4721
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
4722
|
-
const
|
|
4722
|
+
const e = {
|
|
4723
4723
|
v3: {
|
|
4724
|
-
sdkVersion:
|
|
4724
|
+
sdkVersion: F,
|
|
4725
4725
|
renderingMode: this._renderingMode,
|
|
4726
4726
|
initialArgs: this._initialArgs,
|
|
4727
4727
|
initialUiState: this._initialUiState,
|
|
@@ -4731,53 +4731,75 @@
|
|
|
4731
4731
|
outputs: this._outputs
|
|
4732
4732
|
},
|
|
4733
4733
|
// fields below are added to allow previous desktop versions read generated configs
|
|
4734
|
-
sdkVersion:
|
|
4734
|
+
sdkVersion: F,
|
|
4735
4735
|
renderingMode: this._renderingMode,
|
|
4736
4736
|
initialArgs: this._initialArgs,
|
|
4737
4737
|
inputsValid: U(this._inputsValid),
|
|
4738
4738
|
sections: U(this._sections),
|
|
4739
4739
|
outputs: Object.fromEntries(
|
|
4740
|
-
Object.entries(this._outputs).map(([n,
|
|
4740
|
+
Object.entries(this._outputs).map(([n, s]) => [n, U(s)])
|
|
4741
4741
|
)
|
|
4742
4742
|
};
|
|
4743
|
-
return
|
|
4743
|
+
return ve() ? ie({ sdkVersion: F }) : { config: e };
|
|
4744
4744
|
}
|
|
4745
4745
|
}
|
|
4746
|
-
function
|
|
4747
|
-
var
|
|
4748
|
-
const
|
|
4749
|
-
|
|
4750
|
-
|
|
4751
|
-
const
|
|
4752
|
-
|
|
4753
|
-
|
|
4746
|
+
function mt(t, e, n, s) {
|
|
4747
|
+
var l, d;
|
|
4748
|
+
const i2 = t.resultPool.getData().entries.map((a) => a.obj).filter(U$1).filter((a) => a.spec.name === "pl7.app/label" && a.spec.axesSpec.length === 1), r = (a, p) => {
|
|
4749
|
+
let g = a.toString();
|
|
4750
|
+
if (p)
|
|
4751
|
+
for (const c in p)
|
|
4752
|
+
g += c, g += p[c];
|
|
4753
|
+
return g;
|
|
4754
|
+
}, o = /* @__PURE__ */ new Map();
|
|
4755
|
+
for (const a of e)
|
|
4756
|
+
for (const p of a.spec.axesSpec) {
|
|
4757
|
+
const g = S$1(p);
|
|
4758
|
+
for (const c of i2) {
|
|
4759
|
+
const m = c.spec.axesSpec[0], h = S$1(c.spec.axesSpec[0]);
|
|
4760
|
+
if (M(g, h)) {
|
|
4761
|
+
const A = Object.keys(g.domain ?? {}).length, y = Object.keys(h.domain ?? {}).length;
|
|
4762
|
+
if (A > y) {
|
|
4763
|
+
const C = r(c.id, g.domain);
|
|
4764
|
+
o.set(C, {
|
|
4765
|
+
id: C,
|
|
4766
|
+
spec: {
|
|
4767
|
+
...c.spec,
|
|
4768
|
+
axesSpec: [{ ...g, annotations: m.annotations }]
|
|
4769
|
+
},
|
|
4770
|
+
data: c.data
|
|
4771
|
+
});
|
|
4772
|
+
} else
|
|
4773
|
+
o.set(r(c.id), c);
|
|
4774
|
+
}
|
|
4775
|
+
}
|
|
4754
4776
|
}
|
|
4755
|
-
if (![...
|
|
4756
|
-
(a) => a.data instanceof
|
|
4777
|
+
if (![...e, ...o.values()].some(
|
|
4778
|
+
(a) => a.data instanceof v && !a.data.getIsReadyOrError()
|
|
4757
4779
|
))
|
|
4758
|
-
return
|
|
4780
|
+
return t.createPTable({
|
|
4759
4781
|
src: {
|
|
4760
4782
|
type: "outer",
|
|
4761
4783
|
primary: {
|
|
4762
4784
|
type: "full",
|
|
4763
|
-
entries:
|
|
4785
|
+
entries: e.map((a) => ({ type: "column", column: a }))
|
|
4764
4786
|
},
|
|
4765
|
-
secondary: [...
|
|
4787
|
+
secondary: [...o.values()].map((a) => ({ type: "column", column: a }))
|
|
4766
4788
|
},
|
|
4767
|
-
filters: [...((
|
|
4768
|
-
sorting: ((
|
|
4789
|
+
filters: [...((l = n == null ? void 0 : n.pTableParams) == null ? void 0 : l.filters) ?? [], ...s ?? []],
|
|
4790
|
+
sorting: ((d = n == null ? void 0 : n.pTableParams) == null ? void 0 : d.sorting) ?? []
|
|
4769
4791
|
});
|
|
4770
4792
|
}
|
|
4771
|
-
const $BlockArgs = z
|
|
4772
|
-
numbers: z
|
|
4793
|
+
const $BlockArgs = z.object({
|
|
4794
|
+
numbers: z.array(z.coerce.number())
|
|
4773
4795
|
});
|
|
4774
|
-
const platforma =
|
|
4796
|
+
const platforma = b.create("Heavy").withArgs({ numbers: [1, 2, 3] }).withUiState({ dataTableState: void 0 }).output("numbers", (ctx) => {
|
|
4775
4797
|
var _a, _b;
|
|
4776
4798
|
return (_b = (_a = ctx.outputs) == null ? void 0 : _a.resolve("numbers")) == null ? void 0 : _b.getDataAsJson();
|
|
4777
4799
|
}).output("pt", (ctx) => {
|
|
4778
4800
|
var _a, _b, _c, _d, _e;
|
|
4779
4801
|
if (!((_c = (_b = (_a = ctx.uiState) == null ? void 0 : _a.dataTableState) == null ? void 0 : _b.tableState.pTableParams) == null ? void 0 : _c.filters)) return void 0;
|
|
4780
|
-
return
|
|
4802
|
+
return mt(ctx, [
|
|
4781
4803
|
{
|
|
4782
4804
|
id: "example",
|
|
4783
4805
|
spec: {
|
|
@@ -4824,6 +4846,7 @@
|
|
|
4824
4846
|
{ type: "link", href: "/text-fields", label: "PlTextField" },
|
|
4825
4847
|
{ type: "link", href: "/tabs", label: "PlTabs" },
|
|
4826
4848
|
{ type: "link", href: "/drafts", label: "Drafts" },
|
|
4849
|
+
{ type: "link", href: "/stacked-bar", label: "PlChartStackedBar" },
|
|
4827
4850
|
{ type: "link", href: "/buttons", label: "ButtonsPage" },
|
|
4828
4851
|
{ type: "link", href: "/notifications", label: "Notifications" }
|
|
4829
4852
|
];
|