@platforma-sdk/model 1.20.24 → 1.21.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/dist/components/PlDataTable.d.ts +27 -2
- package/dist/components/PlDataTable.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +628 -618
- package/dist/index.mjs.map +1 -1
- package/dist/render/api.d.ts +1 -1
- package/dist/render/api.d.ts.map +1 -1
- package/dist/render/internal.d.ts +1 -1
- package/dist/render/internal.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/PlDataTable.ts +67 -6
- package/src/render/api.ts +11 -9
- package/src/render/internal.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,381 +1,381 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var S = (
|
|
4
|
-
import { isPColumn as
|
|
1
|
+
var de = Object.defineProperty;
|
|
2
|
+
var pe = (t, e, n) => e in t ? de(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var S = (t, e, n) => pe(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
+
import { isPColumn as z, mapPObjectData as V, mapValueInVOE as fe, ensurePColumn as he, isPColumnSpec as X, extractAllColumns as ge, mapPTableDef as me, getAxisId as Q, matchAxisId as ye } from "@milaboratories/pl-model-common";
|
|
5
5
|
export * from "@milaboratories/pl-model-common";
|
|
6
|
-
import { z as
|
|
7
|
-
class
|
|
8
|
-
constructor(
|
|
9
|
-
super(`${
|
|
6
|
+
import { z as A } from "zod";
|
|
7
|
+
class be extends Error {
|
|
8
|
+
constructor(e, n) {
|
|
9
|
+
super(`${e.length}${n ? "+" : ""} errors, first error: ` + e[0]), this.errors = e, this.moreErrors = n;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
if (!
|
|
14
|
-
return
|
|
12
|
+
function ve(t) {
|
|
13
|
+
if (!t.ok) throw new be(t.errors, t.moreErrors);
|
|
14
|
+
return t.value;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return new Proxy(
|
|
18
|
-
get(
|
|
19
|
-
return
|
|
16
|
+
function Ne(t) {
|
|
17
|
+
return new Proxy(t, {
|
|
18
|
+
get(e, n) {
|
|
19
|
+
return ve(e[n]);
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
return typeof
|
|
23
|
+
function m(t) {
|
|
24
|
+
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null ? E(t) : t;
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return { type: "GetFromCtx", variable:
|
|
26
|
+
function O(t) {
|
|
27
|
+
return { type: "GetFromCtx", variable: t };
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function Me(t) {
|
|
30
30
|
return {
|
|
31
31
|
type: "Isolate",
|
|
32
|
-
cfg:
|
|
32
|
+
cfg: t
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
function
|
|
37
|
-
return { type: "Immediate", value:
|
|
35
|
+
const Ue = O("$args"), Je = O("$it"), $e = O("$prod"), Ke = O("$staging"), Ge = O("$ui");
|
|
36
|
+
function E(t) {
|
|
37
|
+
return { type: "Immediate", value: t };
|
|
38
38
|
}
|
|
39
|
-
function
|
|
40
|
-
const
|
|
41
|
-
for (const [n,
|
|
39
|
+
function re(t) {
|
|
40
|
+
const e = {};
|
|
41
|
+
for (const [n, r] of Object.entries(t)) e[n] = m(r);
|
|
42
42
|
return {
|
|
43
43
|
type: "MakeObject",
|
|
44
|
-
template:
|
|
44
|
+
template: e
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
const
|
|
49
|
-
for (const n of
|
|
47
|
+
function He(...t) {
|
|
48
|
+
const e = [];
|
|
49
|
+
for (const n of t) e.push(m(n));
|
|
50
50
|
return {
|
|
51
51
|
type: "MakeArray",
|
|
52
|
-
template:
|
|
52
|
+
template: e
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function j(t, e) {
|
|
56
56
|
return {
|
|
57
57
|
type: "GetJsonField",
|
|
58
|
-
source:
|
|
59
|
-
field:
|
|
58
|
+
source: m(t),
|
|
59
|
+
field: m(e)
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function We(t, e, n = "$it") {
|
|
63
63
|
return {
|
|
64
64
|
type: "MapRecordValues",
|
|
65
|
-
source:
|
|
66
|
-
mapping:
|
|
65
|
+
source: t,
|
|
66
|
+
mapping: e,
|
|
67
67
|
itVar: n
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function qe(t, e, n = "$it") {
|
|
71
71
|
return {
|
|
72
72
|
type: "MapArrayValues",
|
|
73
|
-
source:
|
|
74
|
-
mapping:
|
|
73
|
+
source: t,
|
|
74
|
+
mapping: e,
|
|
75
75
|
itVar: n
|
|
76
76
|
};
|
|
77
77
|
}
|
|
78
|
-
function
|
|
78
|
+
function ze(t) {
|
|
79
79
|
return {
|
|
80
80
|
type: "Flatten",
|
|
81
|
-
source:
|
|
81
|
+
source: t
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function Ye(t) {
|
|
85
85
|
return {
|
|
86
86
|
type: "IsEmpty",
|
|
87
|
-
arg:
|
|
87
|
+
arg: t
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
function
|
|
90
|
+
function Xe(t) {
|
|
91
91
|
return {
|
|
92
92
|
type: "Not",
|
|
93
|
-
operand:
|
|
93
|
+
operand: t
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function Qe(t, e) {
|
|
97
97
|
return {
|
|
98
98
|
type: "And",
|
|
99
|
-
operand1:
|
|
100
|
-
operand2:
|
|
99
|
+
operand1: t,
|
|
100
|
+
operand2: e
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
|
-
function
|
|
103
|
+
function Ze(t, e) {
|
|
104
104
|
return {
|
|
105
105
|
type: "Or",
|
|
106
|
-
operand1:
|
|
107
|
-
operand2:
|
|
106
|
+
operand1: t,
|
|
107
|
+
operand2: e
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function et(t, e) {
|
|
111
111
|
return {
|
|
112
112
|
type: "GetResourceField",
|
|
113
|
-
source:
|
|
114
|
-
field:
|
|
113
|
+
source: m(t),
|
|
114
|
+
field: m(e)
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
return function(
|
|
117
|
+
function tt() {
|
|
118
|
+
return function(t) {
|
|
119
119
|
return {
|
|
120
120
|
type: "GetResourceValueAsJson",
|
|
121
|
-
source:
|
|
121
|
+
source: m(t)
|
|
122
122
|
};
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function nt(t, e, n = "$it") {
|
|
126
126
|
return {
|
|
127
127
|
type: "MapResourceFields",
|
|
128
|
-
source:
|
|
129
|
-
mapping:
|
|
128
|
+
source: t,
|
|
129
|
+
mapping: e,
|
|
130
130
|
itVar: n
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function rt(t) {
|
|
134
134
|
return {
|
|
135
135
|
type: "GetBlobContent",
|
|
136
|
-
source:
|
|
136
|
+
source: m(t)
|
|
137
137
|
};
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function it(t) {
|
|
140
140
|
return {
|
|
141
141
|
type: "GetBlobContentAsString",
|
|
142
|
-
source:
|
|
142
|
+
source: m(t)
|
|
143
143
|
};
|
|
144
144
|
}
|
|
145
|
-
function
|
|
146
|
-
return function(
|
|
145
|
+
function st() {
|
|
146
|
+
return function(t) {
|
|
147
147
|
return {
|
|
148
148
|
type: "GetBlobContentAsJson",
|
|
149
|
-
source:
|
|
149
|
+
source: m(t)
|
|
150
150
|
};
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function ot(t) {
|
|
154
154
|
return {
|
|
155
155
|
type: "GetDownloadedBlobContent",
|
|
156
|
-
source:
|
|
156
|
+
source: m(t)
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function at(t) {
|
|
160
160
|
return {
|
|
161
161
|
type: "GetOnDemandBlobContent",
|
|
162
|
-
source:
|
|
162
|
+
source: m(t)
|
|
163
163
|
};
|
|
164
164
|
}
|
|
165
|
-
function
|
|
165
|
+
function lt(t) {
|
|
166
166
|
return {
|
|
167
167
|
type: "GetImportProgress",
|
|
168
|
-
source:
|
|
168
|
+
source: m(t)
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
|
-
function
|
|
171
|
+
function ut(t, e) {
|
|
172
172
|
return {
|
|
173
173
|
type: "GetLastLogs",
|
|
174
|
-
source:
|
|
175
|
-
lines:
|
|
174
|
+
source: m(t),
|
|
175
|
+
lines: e
|
|
176
176
|
};
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function ct(t, e) {
|
|
179
179
|
return {
|
|
180
180
|
type: "GetProgressLog",
|
|
181
|
-
source:
|
|
182
|
-
patternToSearch:
|
|
181
|
+
source: m(t),
|
|
182
|
+
patternToSearch: e
|
|
183
183
|
};
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function dt(t) {
|
|
186
186
|
return {
|
|
187
187
|
type: "GetLogHandle",
|
|
188
|
-
source:
|
|
188
|
+
source: m(t)
|
|
189
189
|
};
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function _e() {
|
|
192
192
|
return typeof globalThis.getPlatforma < "u" || typeof globalThis.platforma < "u";
|
|
193
193
|
}
|
|
194
|
-
function
|
|
195
|
-
if (
|
|
196
|
-
return globalThis.getPlatforma(
|
|
194
|
+
function ie(t) {
|
|
195
|
+
if (t && typeof globalThis.getPlatforma == "function")
|
|
196
|
+
return globalThis.getPlatforma(t);
|
|
197
197
|
if (typeof globalThis.platforma < "u") return globalThis.platforma;
|
|
198
198
|
throw new Error("Can't get platforma instance.");
|
|
199
199
|
}
|
|
200
|
-
function
|
|
200
|
+
function we() {
|
|
201
201
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
202
202
|
}
|
|
203
|
-
function
|
|
203
|
+
function l() {
|
|
204
204
|
if (typeof globalThis.cfgRenderCtx < "u") return globalThis.cfgRenderCtx;
|
|
205
205
|
throw new Error("Not in config rendering context");
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
const n =
|
|
207
|
+
function L(t, e) {
|
|
208
|
+
const n = we();
|
|
209
209
|
if (n === void 0) return !1;
|
|
210
|
-
if (
|
|
211
|
-
return n.callbackRegistry[
|
|
210
|
+
if (t in n.callbackRegistry) throw new Error(`Callback with key ${t} already registered.`);
|
|
211
|
+
return n.callbackRegistry[t] = e, !0;
|
|
212
212
|
}
|
|
213
|
-
const
|
|
214
|
-
function
|
|
215
|
-
|
|
216
|
-
for (const
|
|
217
|
-
|
|
218
|
-
},
|
|
213
|
+
const M = /* @__PURE__ */ new Map();
|
|
214
|
+
function Se(t, e) {
|
|
215
|
+
t in l().callbackRegistry || (l().callbackRegistry[t] = (n) => {
|
|
216
|
+
for (const r of M.get(t))
|
|
217
|
+
r(n);
|
|
218
|
+
}, M.set(t, [])), M.get(t).push(e);
|
|
219
219
|
}
|
|
220
220
|
class v {
|
|
221
|
-
constructor(
|
|
221
|
+
constructor(e, n = (r) => r) {
|
|
222
222
|
S(this, "isResolved", !1);
|
|
223
223
|
S(this, "resolvedValue");
|
|
224
|
-
this.handle =
|
|
225
|
-
this.resolvedValue = n(
|
|
224
|
+
this.handle = e, this.postProcess = n, Se(e, (r) => {
|
|
225
|
+
this.resolvedValue = n(r), this.isResolved = !0;
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
|
-
map(
|
|
229
|
-
return new v(this.handle, (n) =>
|
|
228
|
+
map(e) {
|
|
229
|
+
return new v(this.handle, (n) => e(this.postProcess(n)));
|
|
230
230
|
}
|
|
231
|
-
mapDefined(
|
|
231
|
+
mapDefined(e) {
|
|
232
232
|
return new v(this.handle, (n) => {
|
|
233
|
-
const
|
|
234
|
-
return
|
|
233
|
+
const r = this.postProcess(n);
|
|
234
|
+
return r ? e(r) : void 0;
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
toJSON() {
|
|
238
238
|
return this.isResolved ? this.resolvedValue : { __awaited_futures__: [this.handle] };
|
|
239
239
|
}
|
|
240
240
|
}
|
|
241
|
-
function
|
|
242
|
-
return
|
|
241
|
+
function K(t, e) {
|
|
242
|
+
return t === void 0 ? void 0 : e(t);
|
|
243
243
|
}
|
|
244
244
|
class _ {
|
|
245
|
-
constructor(
|
|
246
|
-
this.handle =
|
|
245
|
+
constructor(e, n) {
|
|
246
|
+
this.handle = e, this.resolvePath = n;
|
|
247
247
|
}
|
|
248
|
-
resolve(...
|
|
249
|
-
const n =
|
|
250
|
-
(
|
|
248
|
+
resolve(...e) {
|
|
249
|
+
const n = e.map(
|
|
250
|
+
(r) => ({
|
|
251
251
|
assertFieldType: "Input",
|
|
252
|
-
...typeof
|
|
252
|
+
...typeof r == "string" ? { field: r } : r
|
|
253
253
|
})
|
|
254
254
|
);
|
|
255
255
|
return this.resolveWithCommon({}, ...n);
|
|
256
256
|
}
|
|
257
|
-
resolveOutput(...
|
|
258
|
-
const n =
|
|
259
|
-
(
|
|
257
|
+
resolveOutput(...e) {
|
|
258
|
+
const n = e.map(
|
|
259
|
+
(r) => ({
|
|
260
260
|
assertFieldType: "Output",
|
|
261
|
-
...typeof
|
|
261
|
+
...typeof r == "string" ? { field: r } : r
|
|
262
262
|
})
|
|
263
263
|
);
|
|
264
264
|
return this.resolveWithCommon({}, ...n);
|
|
265
265
|
}
|
|
266
|
-
resolveInput(...
|
|
267
|
-
const n =
|
|
268
|
-
(
|
|
266
|
+
resolveInput(...e) {
|
|
267
|
+
const n = e.map(
|
|
268
|
+
(r) => ({
|
|
269
269
|
assertFieldType: "Input",
|
|
270
|
-
...typeof
|
|
270
|
+
...typeof r == "string" ? { field: r } : r
|
|
271
271
|
})
|
|
272
272
|
);
|
|
273
273
|
return this.resolveWithCommon({}, ...n);
|
|
274
274
|
}
|
|
275
|
-
resolveAny(...
|
|
276
|
-
return this.resolveWithCommon({}, ...
|
|
275
|
+
resolveAny(...e) {
|
|
276
|
+
return this.resolveWithCommon({}, ...e);
|
|
277
277
|
}
|
|
278
|
-
resolveWithCommon(
|
|
279
|
-
const
|
|
278
|
+
resolveWithCommon(e, ...n) {
|
|
279
|
+
const r = [
|
|
280
280
|
...this.resolvePath,
|
|
281
281
|
...n.map((i) => typeof i == "string" ? i : i.field)
|
|
282
282
|
];
|
|
283
|
-
return
|
|
284
|
-
|
|
285
|
-
(i) => new _(i,
|
|
283
|
+
return K(
|
|
284
|
+
l().resolveWithCommon(this.handle, e, ...n),
|
|
285
|
+
(i) => new _(i, r)
|
|
286
286
|
);
|
|
287
287
|
}
|
|
288
288
|
get resourceType() {
|
|
289
|
-
return
|
|
289
|
+
return l().getResourceType(this.handle);
|
|
290
290
|
}
|
|
291
291
|
getInputsLocked() {
|
|
292
|
-
return
|
|
292
|
+
return l().getInputsLocked(this.handle);
|
|
293
293
|
}
|
|
294
294
|
getOutputsLocked() {
|
|
295
|
-
return
|
|
295
|
+
return l().getOutputsLocked(this.handle);
|
|
296
296
|
}
|
|
297
297
|
getIsReadyOrError() {
|
|
298
|
-
return
|
|
298
|
+
return l().getIsReadyOrError(this.handle);
|
|
299
299
|
}
|
|
300
300
|
getIsFinal() {
|
|
301
|
-
return
|
|
301
|
+
return l().getIsFinal(this.handle);
|
|
302
302
|
}
|
|
303
303
|
getError() {
|
|
304
|
-
const
|
|
305
|
-
return
|
|
306
|
-
|
|
307
|
-
(n) => new _(n,
|
|
304
|
+
const e = [...this.resolvePath, "error"];
|
|
305
|
+
return K(
|
|
306
|
+
l().getError(this.handle),
|
|
307
|
+
(n) => new _(n, e)
|
|
308
308
|
);
|
|
309
309
|
}
|
|
310
310
|
listInputFields() {
|
|
311
|
-
return
|
|
311
|
+
return l().listInputFields(this.handle);
|
|
312
312
|
}
|
|
313
313
|
listOutputFields() {
|
|
314
|
-
return
|
|
314
|
+
return l().listOutputFields(this.handle);
|
|
315
315
|
}
|
|
316
316
|
listDynamicFields() {
|
|
317
|
-
return
|
|
317
|
+
return l().listDynamicFields(this.handle);
|
|
318
318
|
}
|
|
319
|
-
getKeyValueBase64(
|
|
320
|
-
return
|
|
319
|
+
getKeyValueBase64(e) {
|
|
320
|
+
return l().getKeyValueBase64(this.handle, e);
|
|
321
321
|
}
|
|
322
|
-
getKeyValueAsString(
|
|
323
|
-
return
|
|
322
|
+
getKeyValueAsString(e) {
|
|
323
|
+
return l().getKeyValueAsString(this.handle, e);
|
|
324
324
|
}
|
|
325
|
-
getKeyValueAsJson(
|
|
326
|
-
const n = this.getKeyValueAsString(
|
|
325
|
+
getKeyValueAsJson(e) {
|
|
326
|
+
const n = this.getKeyValueAsString(e);
|
|
327
327
|
if (n == null) throw new Error("Resource has no content.");
|
|
328
328
|
return JSON.parse(n);
|
|
329
329
|
}
|
|
330
330
|
getDataBase64() {
|
|
331
|
-
return
|
|
331
|
+
return l().getDataBase64(this.handle);
|
|
332
332
|
}
|
|
333
333
|
getDataAsString() {
|
|
334
|
-
return
|
|
334
|
+
return l().getDataAsString(this.handle);
|
|
335
335
|
}
|
|
336
336
|
getDataAsJson() {
|
|
337
|
-
const
|
|
338
|
-
if (
|
|
339
|
-
return JSON.parse(
|
|
337
|
+
const e = this.getDataAsString();
|
|
338
|
+
if (e == null) throw new Error("Resource has no content.");
|
|
339
|
+
return JSON.parse(e);
|
|
340
340
|
}
|
|
341
341
|
/**
|
|
342
342
|
*
|
|
343
343
|
*/
|
|
344
|
-
getPColumns(
|
|
345
|
-
const
|
|
346
|
-
return
|
|
347
|
-
if (!
|
|
348
|
-
return
|
|
344
|
+
getPColumns(e = !1, n = "") {
|
|
345
|
+
const r = this.parsePObjectCollection(e, n);
|
|
346
|
+
return r === void 0 ? void 0 : Object.entries(r).map(([, s]) => {
|
|
347
|
+
if (!z(s)) throw new Error(`not a PColumn (kind = ${s.spec.kind})`);
|
|
348
|
+
return s;
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
351
|
/**
|
|
352
352
|
*
|
|
353
353
|
*/
|
|
354
|
-
parsePObjectCollection(
|
|
355
|
-
const
|
|
354
|
+
parsePObjectCollection(e = !1, n = "") {
|
|
355
|
+
const r = l().parsePObjectCollection(
|
|
356
356
|
this.handle,
|
|
357
|
-
|
|
357
|
+
e,
|
|
358
358
|
n,
|
|
359
359
|
...this.resolvePath
|
|
360
360
|
);
|
|
361
|
-
if (
|
|
361
|
+
if (r === void 0) return;
|
|
362
362
|
const i = {};
|
|
363
|
-
for (const [
|
|
364
|
-
const
|
|
365
|
-
i[
|
|
363
|
+
for (const [s, o] of Object.entries(r)) {
|
|
364
|
+
const a = [...this.resolvePath, s];
|
|
365
|
+
i[s] = V(o, (c) => new _(c, a));
|
|
366
366
|
}
|
|
367
367
|
return i;
|
|
368
368
|
}
|
|
369
369
|
getFileContentAsBase64() {
|
|
370
|
-
return new v(
|
|
370
|
+
return new v(l().getBlobContentAsBase64(this.handle));
|
|
371
371
|
}
|
|
372
372
|
getFileContentAsString() {
|
|
373
|
-
return new v(
|
|
373
|
+
return new v(l().getBlobContentAsString(this.handle));
|
|
374
374
|
}
|
|
375
375
|
getFileContentAsJson() {
|
|
376
376
|
return new v(
|
|
377
|
-
|
|
378
|
-
).mapDefined((
|
|
377
|
+
l().getBlobContentAsString(this.handle)
|
|
378
|
+
).mapDefined((e) => JSON.parse(e));
|
|
379
379
|
}
|
|
380
380
|
/**
|
|
381
381
|
* @deprecated use getFileContentAsBase64
|
|
@@ -393,7 +393,7 @@ class _ {
|
|
|
393
393
|
* @returns downloaded file handle
|
|
394
394
|
*/
|
|
395
395
|
getFileHandle() {
|
|
396
|
-
return new v(
|
|
396
|
+
return new v(l().getDownloadedBlobContentHandle(this.handle));
|
|
397
397
|
}
|
|
398
398
|
/**
|
|
399
399
|
* @deprecated use getFileHandle
|
|
@@ -405,7 +405,7 @@ class _ {
|
|
|
405
405
|
* @returns downloaded file handle
|
|
406
406
|
*/
|
|
407
407
|
getRemoteFileHandle() {
|
|
408
|
-
return new v(
|
|
408
|
+
return new v(l().getOnDemandBlobContentHandle(this.handle));
|
|
409
409
|
}
|
|
410
410
|
/**
|
|
411
411
|
* @deprecated use getRemoteFileHandle
|
|
@@ -414,19 +414,19 @@ class _ {
|
|
|
414
414
|
return this.getRemoteFileHandle();
|
|
415
415
|
}
|
|
416
416
|
getImportProgress() {
|
|
417
|
-
return new v(
|
|
417
|
+
return new v(l().getImportProgress(this.handle));
|
|
418
418
|
}
|
|
419
|
-
getLastLogs(
|
|
420
|
-
return new v(
|
|
419
|
+
getLastLogs(e) {
|
|
420
|
+
return new v(l().getLastLogs(this.handle, e));
|
|
421
421
|
}
|
|
422
|
-
getProgressLog(
|
|
423
|
-
return new v(
|
|
422
|
+
getProgressLog(e) {
|
|
423
|
+
return new v(l().getProgressLog(this.handle, e));
|
|
424
424
|
}
|
|
425
425
|
getLogHandle() {
|
|
426
|
-
return new v(
|
|
426
|
+
return new v(l().getLogHandle(this.handle));
|
|
427
427
|
}
|
|
428
|
-
allFieldsResolved(
|
|
429
|
-
switch (
|
|
428
|
+
allFieldsResolved(e = "Input") {
|
|
429
|
+
switch (e) {
|
|
430
430
|
case "Input":
|
|
431
431
|
return this.getInputsLocked() && this.listInputFields().every(
|
|
432
432
|
(n) => this.resolve({ field: n, assertFieldType: "Input" }) !== void 0
|
|
@@ -437,128 +437,128 @@ class _ {
|
|
|
437
437
|
);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
|
-
mapFields(
|
|
441
|
-
const { fieldType:
|
|
440
|
+
mapFields(e, n) {
|
|
441
|
+
const { fieldType: r, requireLocked: i, skipUnresolved: s } = {
|
|
442
442
|
fieldType: "Input",
|
|
443
443
|
requireLocked: !0,
|
|
444
444
|
skipUnresolved: !1,
|
|
445
445
|
...n
|
|
446
|
-
}, o =
|
|
447
|
-
if (i && (
|
|
446
|
+
}, o = e;
|
|
447
|
+
if (i && (r === "Input" && !this.getInputsLocked() || r === "Output" && !this.getOutputsLocked()))
|
|
448
448
|
return;
|
|
449
|
-
let
|
|
450
|
-
(
|
|
449
|
+
let c = (r === "Input" ? this.listInputFields() : r === "Output" ? this.listOutputFields() : this.listDynamicFields()).map(
|
|
450
|
+
(u) => [u, this.resolve({ field: u, assertFieldType: r })]
|
|
451
451
|
);
|
|
452
|
-
return
|
|
452
|
+
return s && (c = c.filter((u) => u[1] !== void 0)), c.map(([u, g]) => o(u, g));
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
const
|
|
455
|
+
const se = "staging", oe = "main", Ce = {
|
|
456
456
|
inlineColumnsSupport: !0
|
|
457
457
|
};
|
|
458
|
-
function
|
|
459
|
-
return typeof
|
|
458
|
+
function ae(t) {
|
|
459
|
+
return typeof t == "object" && t !== null && "__awaited_futures__" in t;
|
|
460
460
|
}
|
|
461
|
-
function
|
|
462
|
-
if (
|
|
463
|
-
if (
|
|
464
|
-
if (
|
|
461
|
+
function G(t, e, n) {
|
|
462
|
+
if (e.has(n)) return;
|
|
463
|
+
if (e.add(n), typeof n === "object")
|
|
464
|
+
if (ae(n)) n.__awaited_futures__.forEach((i) => t.add(i));
|
|
465
465
|
else if (Array.isArray(n))
|
|
466
|
-
for (const i of n)
|
|
466
|
+
for (const i of n) G(t, e, i);
|
|
467
467
|
else
|
|
468
468
|
for (const [, i] of Object.entries(n))
|
|
469
|
-
i !== n &&
|
|
469
|
+
i !== n && G(t, e, i);
|
|
470
470
|
}
|
|
471
|
-
function
|
|
472
|
-
const
|
|
473
|
-
return
|
|
471
|
+
function Pe(t) {
|
|
472
|
+
const e = /* @__PURE__ */ new Set();
|
|
473
|
+
return G(e, /* @__PURE__ */ new Set(), t), e;
|
|
474
474
|
}
|
|
475
|
-
const
|
|
475
|
+
const pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
476
476
|
__proto__: null,
|
|
477
|
-
GlobalCfgRenderCtxFeatureFlags:
|
|
478
|
-
MainAccessorName:
|
|
479
|
-
StagingAccessorName:
|
|
480
|
-
getAllFutureAwaits:
|
|
481
|
-
isFutureAwait:
|
|
482
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
483
|
-
type:
|
|
484
|
-
importance:
|
|
485
|
-
id:
|
|
486
|
-
label:
|
|
487
|
-
}),
|
|
488
|
-
function
|
|
489
|
-
const
|
|
490
|
-
var
|
|
491
|
-
const
|
|
492
|
-
if (
|
|
493
|
-
const w = { label:
|
|
477
|
+
GlobalCfgRenderCtxFeatureFlags: Ce,
|
|
478
|
+
MainAccessorName: oe,
|
|
479
|
+
StagingAccessorName: se,
|
|
480
|
+
getAllFutureAwaits: Pe,
|
|
481
|
+
isFutureAwait: ae
|
|
482
|
+
}, Symbol.toStringTag, { value: "Module" })), Ae = "pl7.app/label", Ie = "pl7.app/trace", Re = A.object({
|
|
483
|
+
type: A.string(),
|
|
484
|
+
importance: A.number().optional(),
|
|
485
|
+
id: A.string().optional(),
|
|
486
|
+
label: A.string()
|
|
487
|
+
}), Fe = A.array(Re), Te = 1e-3, Oe = "__LABEL__", Z = "__LABEL__@1";
|
|
488
|
+
function ke(t, e, n = {}) {
|
|
489
|
+
const r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), s = t.map((p) => {
|
|
490
|
+
var R, Y;
|
|
491
|
+
const h = e(p), f = (R = h.annotations) == null ? void 0 : R[Ae], C = (Y = h.annotations) == null ? void 0 : Y[Ie], y = (C ? Fe.safeParse(JSON.parse(C)).data : void 0) ?? [];
|
|
492
|
+
if (f) {
|
|
493
|
+
const w = { label: f, type: Oe, importance: -2 };
|
|
494
494
|
n.addLabelAsSuffix ? y.push(w) : y.splice(0, 0, w);
|
|
495
495
|
}
|
|
496
|
-
const
|
|
496
|
+
const I = [], D = /* @__PURE__ */ new Map();
|
|
497
497
|
for (let w = y.length - 1; w >= 0; --w) {
|
|
498
|
-
const { type:
|
|
499
|
-
|
|
500
|
-
const
|
|
501
|
-
i.set(
|
|
502
|
-
|
|
498
|
+
const { type: B } = y[w], ce = y[w].importance ?? 0, N = (D.get(B) ?? 0) + 1;
|
|
499
|
+
D.set(B, N);
|
|
500
|
+
const F = `${B}@${N}`;
|
|
501
|
+
i.set(F, (i.get(F) ?? 0) + 1), r.set(
|
|
502
|
+
F,
|
|
503
503
|
Math.max(
|
|
504
|
-
|
|
505
|
-
|
|
504
|
+
r.get(F) ?? Number.NEGATIVE_INFINITY,
|
|
505
|
+
ce - (y.length - w) * Te
|
|
506
506
|
)
|
|
507
|
-
),
|
|
507
|
+
), I.push({ ...y[w], fullType: F, occurenceIndex: N });
|
|
508
508
|
}
|
|
509
|
-
return
|
|
510
|
-
value:
|
|
511
|
-
spec:
|
|
512
|
-
label:
|
|
513
|
-
fullTrace:
|
|
509
|
+
return I.reverse(), {
|
|
510
|
+
value: p,
|
|
511
|
+
spec: h,
|
|
512
|
+
label: f,
|
|
513
|
+
fullTrace: I
|
|
514
514
|
};
|
|
515
|
-
}), o = [],
|
|
516
|
-
|
|
517
|
-
for (const [
|
|
518
|
-
|
|
519
|
-
const
|
|
520
|
-
const
|
|
515
|
+
}), o = [], a = [], c = [...r];
|
|
516
|
+
c.sort(([, p], [, h]) => h - p);
|
|
517
|
+
for (const [p] of c)
|
|
518
|
+
p.endsWith("@1") || i.get(p) === t.length ? o.push(p) : a.push(p);
|
|
519
|
+
const u = (p) => s.map((h) => {
|
|
520
|
+
const f = h.fullTrace.filter((y) => p.has(y.fullType)).map((y) => y.label), C = n.separator ?? " / ";
|
|
521
521
|
return {
|
|
522
|
-
label:
|
|
523
|
-
value:
|
|
522
|
+
label: f.join(C),
|
|
523
|
+
value: h.value
|
|
524
524
|
};
|
|
525
525
|
});
|
|
526
526
|
if (o.length === 0) {
|
|
527
|
-
if (
|
|
528
|
-
return
|
|
529
|
-
}
|
|
530
|
-
let
|
|
531
|
-
for (;
|
|
532
|
-
const
|
|
533
|
-
n.includeNativeLabel &&
|
|
534
|
-
for (let
|
|
535
|
-
|
|
536
|
-
const
|
|
537
|
-
if (new Set(
|
|
538
|
-
|
|
539
|
-
}
|
|
540
|
-
return
|
|
527
|
+
if (a.length !== 0) throw new Error("Assertion error.");
|
|
528
|
+
return u(new Set(Z));
|
|
529
|
+
}
|
|
530
|
+
let g = 0, d = 0;
|
|
531
|
+
for (; g < o.length; ) {
|
|
532
|
+
const p = /* @__PURE__ */ new Set();
|
|
533
|
+
n.includeNativeLabel && p.add(Z);
|
|
534
|
+
for (let f = 0; f < g; ++f) p.add(o[f]);
|
|
535
|
+
p.add(o[d]);
|
|
536
|
+
const h = u(p);
|
|
537
|
+
if (new Set(h.map((f) => f.label)).size === t.length) return h;
|
|
538
|
+
d++, d == o.length && (g++, d = g);
|
|
539
|
+
}
|
|
540
|
+
return u(/* @__PURE__ */ new Set([...o, ...a]));
|
|
541
541
|
}
|
|
542
|
-
class
|
|
542
|
+
class De {
|
|
543
543
|
constructor() {
|
|
544
|
-
S(this, "ctx",
|
|
545
|
-
S(this, "defaultLabelFn", (
|
|
546
|
-
var
|
|
547
|
-
return ((
|
|
544
|
+
S(this, "ctx", l());
|
|
545
|
+
S(this, "defaultLabelFn", (e, n) => {
|
|
546
|
+
var r;
|
|
547
|
+
return ((r = e.annotations) == null ? void 0 : r["pl7.app/label"]) ?? "Unlabelled";
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
550
|
/**
|
|
551
551
|
* @deprecated use getOptions()
|
|
552
552
|
*/
|
|
553
|
-
calculateOptions(
|
|
554
|
-
return this.ctx.calculateOptions(
|
|
553
|
+
calculateOptions(e) {
|
|
554
|
+
return this.ctx.calculateOptions(e);
|
|
555
555
|
}
|
|
556
|
-
getOptions(
|
|
557
|
-
const
|
|
558
|
-
return typeof n == "object" || typeof n > "u" ?
|
|
556
|
+
getOptions(e, n) {
|
|
557
|
+
const r = this.getSpecs().entries.filter((i) => e(i.obj));
|
|
558
|
+
return typeof n == "object" || typeof n > "u" ? ke(r, (i) => i.obj, n ?? {}).map(({ value: { ref: i }, label: s }) => ({
|
|
559
559
|
ref: i,
|
|
560
|
-
label:
|
|
561
|
-
})) :
|
|
560
|
+
label: s
|
|
561
|
+
})) : r.map((i) => ({
|
|
562
562
|
ref: i.ref,
|
|
563
563
|
label: n(i.obj, i.ref)
|
|
564
564
|
}));
|
|
@@ -570,10 +570,10 @@ class Dt {
|
|
|
570
570
|
return this.getData();
|
|
571
571
|
}
|
|
572
572
|
getData() {
|
|
573
|
-
const
|
|
573
|
+
const e = this.ctx.getDataFromResultPool();
|
|
574
574
|
return {
|
|
575
|
-
isComplete:
|
|
576
|
-
entries:
|
|
575
|
+
isComplete: e.isComplete,
|
|
576
|
+
entries: e.entries.map((n) => ({
|
|
577
577
|
ref: n.ref,
|
|
578
578
|
obj: {
|
|
579
579
|
...n.obj,
|
|
@@ -589,16 +589,16 @@ class Dt {
|
|
|
589
589
|
return this.getDataWithErrors();
|
|
590
590
|
}
|
|
591
591
|
getDataWithErrors() {
|
|
592
|
-
const
|
|
592
|
+
const e = this.ctx.getDataWithErrorsFromResultPool();
|
|
593
593
|
return {
|
|
594
|
-
isComplete:
|
|
595
|
-
entries:
|
|
594
|
+
isComplete: e.isComplete,
|
|
595
|
+
entries: e.entries.map((n) => ({
|
|
596
596
|
ref: n.ref,
|
|
597
597
|
obj: {
|
|
598
598
|
...n.obj,
|
|
599
|
-
data:
|
|
599
|
+
data: fe(
|
|
600
600
|
n.obj.data,
|
|
601
|
-
(
|
|
601
|
+
(r) => new _(r, [n.ref.blockId, n.ref.name])
|
|
602
602
|
)
|
|
603
603
|
}
|
|
604
604
|
}))
|
|
@@ -617,13 +617,13 @@ class Dt {
|
|
|
617
617
|
* @param ref a Ref
|
|
618
618
|
* @returns data associated with the ref
|
|
619
619
|
*/
|
|
620
|
-
getDataByRef(
|
|
620
|
+
getDataByRef(e) {
|
|
621
621
|
var n;
|
|
622
622
|
return typeof this.ctx.getDataFromResultPoolByRef > "u" ? (n = this.getData().entries.find(
|
|
623
|
-
(
|
|
624
|
-
)) == null ? void 0 : n.obj :
|
|
625
|
-
this.ctx.getDataFromResultPoolByRef(
|
|
626
|
-
(
|
|
623
|
+
(r) => r.ref.blockId === e.blockId && r.ref.name === e.name
|
|
624
|
+
)) == null ? void 0 : n.obj : V(
|
|
625
|
+
this.ctx.getDataFromResultPoolByRef(e.blockId, e.name),
|
|
626
|
+
(r) => new _(r, [e.blockId, e.name])
|
|
627
627
|
);
|
|
628
628
|
}
|
|
629
629
|
/**
|
|
@@ -631,18 +631,18 @@ class Dt {
|
|
|
631
631
|
* @param ref a Ref
|
|
632
632
|
* @returns p-column associated with the ref
|
|
633
633
|
*/
|
|
634
|
-
getPColumnByRef(
|
|
635
|
-
const n = this.getDataByRef(
|
|
634
|
+
getPColumnByRef(e) {
|
|
635
|
+
const n = this.getDataByRef(e);
|
|
636
636
|
if (n)
|
|
637
|
-
return
|
|
637
|
+
return he(n);
|
|
638
638
|
}
|
|
639
639
|
/**
|
|
640
640
|
* Returns spec associated with the ref ensuring that it is a p-column spec.
|
|
641
641
|
* @param ref a Ref
|
|
642
642
|
* @returns p-column spec associated with the ref
|
|
643
643
|
*/
|
|
644
|
-
getPColumnSpecByRef(
|
|
645
|
-
const n = this.getSpecByRef(
|
|
644
|
+
getPColumnSpecByRef(e) {
|
|
645
|
+
const n = this.getSpecByRef(e);
|
|
646
646
|
if (n) {
|
|
647
647
|
if (!X(n)) throw new Error(`not a PColumn spec (kind = ${n.kind})`);
|
|
648
648
|
return n;
|
|
@@ -652,58 +652,58 @@ class Dt {
|
|
|
652
652
|
* @param ref a Ref
|
|
653
653
|
* @returns object spec associated with the ref
|
|
654
654
|
*/
|
|
655
|
-
getSpecByRef(
|
|
655
|
+
getSpecByRef(e) {
|
|
656
656
|
var n;
|
|
657
657
|
return typeof this.ctx.getSpecFromResultPoolByRef > "u" ? (n = this.getSpecs().entries.find(
|
|
658
|
-
(
|
|
659
|
-
)) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(
|
|
658
|
+
(r) => r.ref.blockId === e.blockId && r.ref.name === e.name
|
|
659
|
+
)) == null ? void 0 : n.obj : this.ctx.getSpecFromResultPoolByRef(e.blockId, e.name);
|
|
660
660
|
}
|
|
661
661
|
/**
|
|
662
662
|
* @param spec object specification
|
|
663
663
|
* @returns array of data objects with compatible specs
|
|
664
664
|
* @deprecated delete this method after Jan 1, 2025
|
|
665
665
|
*/
|
|
666
|
-
findDataWithCompatibleSpec(
|
|
666
|
+
findDataWithCompatibleSpec(e) {
|
|
667
667
|
const n = [];
|
|
668
|
-
|
|
669
|
-
if (!X(
|
|
668
|
+
e: for (const r of this.getData().entries) {
|
|
669
|
+
if (!X(r.obj.spec))
|
|
670
670
|
continue;
|
|
671
|
-
const i =
|
|
672
|
-
if (
|
|
673
|
-
for (let
|
|
674
|
-
const o =
|
|
675
|
-
if (o.name !==
|
|
676
|
-
continue
|
|
671
|
+
const i = r.obj.spec;
|
|
672
|
+
if (e.name === i.name && e.valueType === i.valueType && e.axesSpec.length === i.axesSpec.length && H(e.domain, i.domain)) {
|
|
673
|
+
for (let s = 0; s < e.axesSpec.length; ++s) {
|
|
674
|
+
const o = e.axesSpec[s], a = i.axesSpec[s];
|
|
675
|
+
if (o.name !== a.name || o.type !== a.type || !H(o.domain, a.domain))
|
|
676
|
+
continue e;
|
|
677
677
|
}
|
|
678
|
-
n.push(
|
|
678
|
+
n.push(r.obj);
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
681
|
return n;
|
|
682
682
|
}
|
|
683
683
|
}
|
|
684
|
-
function
|
|
685
|
-
if (
|
|
686
|
-
if (
|
|
687
|
-
for (const n in
|
|
688
|
-
if (
|
|
684
|
+
function H(t, e) {
|
|
685
|
+
if (t === void 0) return e === void 0;
|
|
686
|
+
if (e === void 0) return !0;
|
|
687
|
+
for (const n in e)
|
|
688
|
+
if (t[n] !== e[n]) return !1;
|
|
689
689
|
return !0;
|
|
690
690
|
}
|
|
691
|
-
class
|
|
691
|
+
class x {
|
|
692
692
|
constructor() {
|
|
693
693
|
S(this, "ctx");
|
|
694
694
|
S(this, "args");
|
|
695
695
|
S(this, "uiState");
|
|
696
|
-
S(this, "resultPool", new
|
|
697
|
-
this.ctx =
|
|
696
|
+
S(this, "resultPool", new De());
|
|
697
|
+
this.ctx = l(), this.args = JSON.parse(this.ctx.args), this.uiState = this.ctx.uiState !== void 0 ? JSON.parse(this.ctx.uiState) : {};
|
|
698
698
|
}
|
|
699
|
-
getNamedAccessor(
|
|
700
|
-
return
|
|
701
|
-
this.ctx.getAccessorHandleByName(
|
|
702
|
-
(n) => new _(n, [
|
|
699
|
+
getNamedAccessor(e) {
|
|
700
|
+
return K(
|
|
701
|
+
this.ctx.getAccessorHandleByName(e),
|
|
702
|
+
(n) => new _(n, [e])
|
|
703
703
|
);
|
|
704
704
|
}
|
|
705
705
|
get prerun() {
|
|
706
|
-
return this.getNamedAccessor(
|
|
706
|
+
return this.getNamedAccessor(se);
|
|
707
707
|
}
|
|
708
708
|
/**
|
|
709
709
|
* @deprecated use prerun
|
|
@@ -718,7 +718,7 @@ class D {
|
|
|
718
718
|
return this.precalc;
|
|
719
719
|
}
|
|
720
720
|
get outputs() {
|
|
721
|
-
return this.getNamedAccessor(
|
|
721
|
+
return this.getNamedAccessor(oe);
|
|
722
722
|
}
|
|
723
723
|
/**
|
|
724
724
|
* @deprecated use outputs
|
|
@@ -730,275 +730,276 @@ class D {
|
|
|
730
730
|
* Find labels data for a given axis id. It will search for a label column and return its data as a map.
|
|
731
731
|
* @returns a map of axis value => label
|
|
732
732
|
*/
|
|
733
|
-
findLabels(
|
|
733
|
+
findLabels(e) {
|
|
734
734
|
const n = this.resultPool.getData();
|
|
735
|
-
for (const
|
|
736
|
-
if (!
|
|
737
|
-
const i =
|
|
738
|
-
if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name ===
|
|
739
|
-
if (
|
|
740
|
-
throw Error(`Expected JSON column for labels, got: ${
|
|
735
|
+
for (const r of n.entries) {
|
|
736
|
+
if (!z(r.obj)) continue;
|
|
737
|
+
const i = r.obj.spec;
|
|
738
|
+
if (i.name === "pl7.app/label" && i.axesSpec.length === 1 && i.axesSpec[0].name === e.name && i.axesSpec[0].type === e.type && H(e.domain, i.axesSpec[0].domain)) {
|
|
739
|
+
if (r.obj.data.resourceType.name !== "PColumnData/Json")
|
|
740
|
+
throw Error(`Expected JSON column for labels, got: ${r.obj.data.resourceType.name}`);
|
|
741
741
|
return Object.fromEntries(
|
|
742
742
|
Object.entries(
|
|
743
|
-
|
|
743
|
+
r.obj.data.getDataAsJson().data
|
|
744
744
|
).map((o) => [JSON.parse(o[0])[0], o[1]])
|
|
745
745
|
);
|
|
746
746
|
}
|
|
747
747
|
}
|
|
748
748
|
}
|
|
749
|
-
verifyInlineColumnsSupport(
|
|
749
|
+
verifyInlineColumnsSupport(e) {
|
|
750
750
|
var i;
|
|
751
|
-
const n =
|
|
752
|
-
if (n && !
|
|
751
|
+
const n = e.some((s) => !(s.data instanceof _)), r = ((i = this.ctx.featureFlags) == null ? void 0 : i.inlineColumnsSupport) === !0;
|
|
752
|
+
if (n && !r) throw Error("inline columns not supported");
|
|
753
753
|
}
|
|
754
|
-
createPFrame(
|
|
755
|
-
return this.verifyInlineColumnsSupport(
|
|
756
|
-
n,
|
|
757
|
-
|
|
758
|
-
)));
|
|
754
|
+
createPFrame(e) {
|
|
755
|
+
return this.verifyInlineColumnsSupport(e), this.ctx.createPFrame(
|
|
756
|
+
e.map((n) => V(n, (r) => r instanceof _ ? r.handle : r))
|
|
757
|
+
);
|
|
759
758
|
}
|
|
760
|
-
createPTable(
|
|
759
|
+
createPTable(e) {
|
|
761
760
|
var n;
|
|
762
|
-
return "columns" in
|
|
761
|
+
return "columns" in e ? n = {
|
|
763
762
|
src: {
|
|
764
763
|
type: "full",
|
|
765
|
-
entries:
|
|
764
|
+
entries: e.columns.map((r) => ({ type: "column", column: r }))
|
|
766
765
|
},
|
|
767
|
-
filters:
|
|
768
|
-
sorting:
|
|
769
|
-
} : n =
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
766
|
+
filters: e.filters ?? [],
|
|
767
|
+
sorting: e.sorting ?? []
|
|
768
|
+
} : n = e, this.verifyInlineColumnsSupport(ge(n.src)), this.ctx.createPTable(
|
|
769
|
+
me(
|
|
770
|
+
n,
|
|
771
|
+
(r) => V(r, (i) => i instanceof _ ? i.handle : i)
|
|
772
|
+
)
|
|
773
|
+
);
|
|
773
774
|
}
|
|
774
775
|
/** @deprecated scheduled for removal from SDK */
|
|
775
|
-
getBlockLabel(
|
|
776
|
-
return this.ctx.getBlockLabel(
|
|
776
|
+
getBlockLabel(e) {
|
|
777
|
+
return this.ctx.getBlockLabel(e);
|
|
777
778
|
}
|
|
778
779
|
getCurrentUnstableMarker() {
|
|
779
780
|
if (!(typeof this.ctx.getCurrentUnstableMarker > "u"))
|
|
780
781
|
return this.ctx.getCurrentUnstableMarker();
|
|
781
782
|
}
|
|
782
783
|
}
|
|
783
|
-
const
|
|
784
|
-
function
|
|
785
|
-
if (
|
|
786
|
-
switch (
|
|
787
|
-
case
|
|
788
|
-
let
|
|
789
|
-
for (const o of
|
|
790
|
-
const
|
|
791
|
-
|
|
784
|
+
const k = "PColumnData/", W = k + "ResourceMap", q = k + "Partitioned/ResourceMap", ee = k + "JsonPartitioned", U = k + "BinaryPartitioned", le = k + "Partitioned/", te = le + "JsonPartitioned", J = le + "BinaryPartitioned";
|
|
785
|
+
function ue(t, e, n, r = [], i) {
|
|
786
|
+
if (t === void 0) return !1;
|
|
787
|
+
switch (t.resourceType.name) {
|
|
788
|
+
case W: {
|
|
789
|
+
let s = t.getInputsLocked();
|
|
790
|
+
for (const o of t.listInputFields()) {
|
|
791
|
+
const a = t.resolve({ field: o, assertFieldType: "Input" }), c = [...r, ...JSON.parse(o)], u = a === void 0 ? void 0 : e(a);
|
|
792
|
+
u === void 0 && (s = !1), (u !== void 0 || i) && n.push({ key: c, value: u });
|
|
792
793
|
}
|
|
793
|
-
return
|
|
794
|
+
return s;
|
|
794
795
|
}
|
|
795
|
-
case
|
|
796
|
-
let
|
|
797
|
-
for (const o of
|
|
798
|
-
const
|
|
799
|
-
if (
|
|
796
|
+
case q: {
|
|
797
|
+
let s = t.getInputsLocked();
|
|
798
|
+
for (const o of t.listInputFields()) {
|
|
799
|
+
const a = t.resolve({ field: o, assertFieldType: "Input" });
|
|
800
|
+
if (a === void 0) s = !1;
|
|
800
801
|
else {
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
|
|
802
|
+
const c = [...r, ...JSON.parse(o)], u = ue(
|
|
803
|
+
a,
|
|
804
|
+
e,
|
|
804
805
|
n,
|
|
805
|
-
|
|
806
|
+
c,
|
|
806
807
|
i
|
|
807
808
|
);
|
|
808
|
-
|
|
809
|
+
s = s && u;
|
|
809
810
|
}
|
|
810
811
|
}
|
|
811
|
-
return
|
|
812
|
+
return s;
|
|
812
813
|
}
|
|
813
814
|
default:
|
|
814
|
-
throw new Error(`Unknown resource type: ${
|
|
815
|
+
throw new Error(`Unknown resource type: ${t.resourceType.name}`);
|
|
815
816
|
}
|
|
816
817
|
}
|
|
817
|
-
function
|
|
818
|
-
const
|
|
819
|
-
return { isComplete:
|
|
818
|
+
function ft(t, e, n = !1) {
|
|
819
|
+
const r = [];
|
|
820
|
+
return { isComplete: ue(t, e, r, [], n), data: r };
|
|
820
821
|
}
|
|
821
|
-
const
|
|
822
|
-
if (!
|
|
823
|
-
if (
|
|
824
|
-
return
|
|
825
|
-
throw Error(`key must ends on .index/.values for binary p-column, got: ${
|
|
822
|
+
const ne = (t) => {
|
|
823
|
+
if (!t.endsWith(".index")) {
|
|
824
|
+
if (t.endsWith(".values"))
|
|
825
|
+
return t.substring(0, t.length - 7);
|
|
826
|
+
throw Error(`key must ends on .index/.values for binary p-column, got: ${t}`);
|
|
826
827
|
}
|
|
827
828
|
};
|
|
828
|
-
function
|
|
829
|
-
if (!
|
|
830
|
-
const
|
|
829
|
+
function Le(t) {
|
|
830
|
+
if (!t) return;
|
|
831
|
+
const e = t.resourceType.name, n = t.getDataAsJson(), r = [];
|
|
831
832
|
let i = 0;
|
|
832
|
-
switch (
|
|
833
|
-
case
|
|
833
|
+
switch (e) {
|
|
834
|
+
case W:
|
|
834
835
|
i = n.keyLength;
|
|
835
836
|
break;
|
|
836
|
-
case
|
|
837
|
+
case q:
|
|
837
838
|
i = n.partitionKeyLength + n.keyLength;
|
|
838
839
|
break;
|
|
839
|
-
case
|
|
840
|
-
case
|
|
840
|
+
case ee:
|
|
841
|
+
case U:
|
|
841
842
|
i = n.partitionKeyLength;
|
|
842
843
|
break;
|
|
843
|
-
case
|
|
844
|
-
case
|
|
844
|
+
case J:
|
|
845
|
+
case te:
|
|
845
846
|
i = n.superPartitionKeyLength + n.partitionKeyLength;
|
|
846
847
|
break;
|
|
847
848
|
}
|
|
848
|
-
switch (
|
|
849
|
-
case
|
|
850
|
-
case
|
|
851
|
-
case
|
|
852
|
-
for (let
|
|
853
|
-
if (
|
|
854
|
-
const
|
|
855
|
-
if (
|
|
849
|
+
switch (e) {
|
|
850
|
+
case W:
|
|
851
|
+
case ee:
|
|
852
|
+
case U:
|
|
853
|
+
for (let s of t.listInputFields()) {
|
|
854
|
+
if (e === U) {
|
|
855
|
+
const a = ne(s);
|
|
856
|
+
if (a) s = a;
|
|
856
857
|
else continue;
|
|
857
858
|
}
|
|
858
|
-
const o = [...JSON.parse(
|
|
859
|
-
|
|
859
|
+
const o = [...JSON.parse(s)];
|
|
860
|
+
r.push(o);
|
|
860
861
|
}
|
|
861
862
|
break;
|
|
862
|
-
case
|
|
863
|
-
case
|
|
864
|
-
case
|
|
865
|
-
for (const
|
|
866
|
-
const o = [...JSON.parse(
|
|
867
|
-
if (
|
|
868
|
-
for (let
|
|
869
|
-
if (
|
|
870
|
-
const
|
|
871
|
-
if (
|
|
863
|
+
case q:
|
|
864
|
+
case J:
|
|
865
|
+
case te:
|
|
866
|
+
for (const s of t.listInputFields()) {
|
|
867
|
+
const o = [...JSON.parse(s)], a = t.resolve({ field: s, assertFieldType: "Input" });
|
|
868
|
+
if (a !== void 0)
|
|
869
|
+
for (let c of a.listInputFields()) {
|
|
870
|
+
if (e === J) {
|
|
871
|
+
const g = ne(c);
|
|
872
|
+
if (g) c = g;
|
|
872
873
|
else continue;
|
|
873
874
|
}
|
|
874
|
-
const
|
|
875
|
-
|
|
875
|
+
const u = [...o, ...JSON.parse(c)];
|
|
876
|
+
r.push(u);
|
|
876
877
|
}
|
|
877
878
|
}
|
|
878
879
|
break;
|
|
879
880
|
}
|
|
880
|
-
return { data:
|
|
881
|
+
return { data: r, keyLength: i };
|
|
881
882
|
}
|
|
882
|
-
function
|
|
883
|
-
const
|
|
884
|
-
if (!
|
|
885
|
-
const { data: n, keyLength:
|
|
886
|
-
for (let
|
|
883
|
+
function ht(t) {
|
|
884
|
+
const e = Le(t);
|
|
885
|
+
if (!e) return;
|
|
886
|
+
const { data: n, keyLength: r } = e, i = [];
|
|
887
|
+
for (let s = 0; s < r; ++s)
|
|
887
888
|
i.push(/* @__PURE__ */ new Set());
|
|
888
|
-
for (const
|
|
889
|
-
if (
|
|
889
|
+
for (const s of n) {
|
|
890
|
+
if (s.length !== r)
|
|
890
891
|
throw new Error("key length does not match partition length");
|
|
891
|
-
for (let o = 0; o <
|
|
892
|
-
i[o].add(
|
|
892
|
+
for (let o = 0; o < r; ++o)
|
|
893
|
+
i[o].add(s[o]);
|
|
893
894
|
}
|
|
894
|
-
return i.map((
|
|
895
|
+
return i.map((s) => Array.from(s.values()));
|
|
895
896
|
}
|
|
896
|
-
const
|
|
897
|
-
function
|
|
898
|
-
return
|
|
897
|
+
const T = "1.21.0";
|
|
898
|
+
function xe(t) {
|
|
899
|
+
return t.__renderLambda === !0;
|
|
899
900
|
}
|
|
900
|
-
function
|
|
901
|
-
if (
|
|
902
|
-
return
|
|
901
|
+
function $(t) {
|
|
902
|
+
if (t !== void 0)
|
|
903
|
+
return xe(t) ? t.handle : t;
|
|
903
904
|
}
|
|
904
|
-
function
|
|
905
|
-
if (
|
|
906
|
-
return typeof
|
|
905
|
+
function P(t) {
|
|
906
|
+
if (t !== void 0)
|
|
907
|
+
return typeof t == "string" ? { __renderLambda: !0, handle: t, retentive: !1 } : t;
|
|
907
908
|
}
|
|
908
|
-
function
|
|
909
|
-
if (
|
|
909
|
+
function gt(t) {
|
|
910
|
+
if (t.v3 !== void 0) {
|
|
910
911
|
const {
|
|
911
|
-
initialArgs:
|
|
912
|
+
initialArgs: e,
|
|
912
913
|
initialUiState: n,
|
|
913
|
-
inputsValid:
|
|
914
|
+
inputsValid: r,
|
|
914
915
|
outputs: i,
|
|
915
|
-
renderingMode:
|
|
916
|
+
renderingMode: s,
|
|
916
917
|
sdkVersion: o,
|
|
917
|
-
sections:
|
|
918
|
-
title:
|
|
919
|
-
} =
|
|
918
|
+
sections: a,
|
|
919
|
+
title: c
|
|
920
|
+
} = t.v3, { code: u } = t;
|
|
920
921
|
return {
|
|
921
|
-
initialArgs:
|
|
922
|
+
initialArgs: e,
|
|
922
923
|
initialUiState: n,
|
|
923
|
-
inputsValid:
|
|
924
|
+
inputsValid: r,
|
|
924
925
|
outputs: i,
|
|
925
|
-
renderingMode:
|
|
926
|
+
renderingMode: s,
|
|
926
927
|
sdkVersion: o,
|
|
927
|
-
sections:
|
|
928
|
-
title:
|
|
929
|
-
code:
|
|
928
|
+
sections: a,
|
|
929
|
+
title: c,
|
|
930
|
+
code: u
|
|
930
931
|
};
|
|
931
|
-
} else if (
|
|
932
|
-
const { sdkVersion:
|
|
933
|
-
if (
|
|
932
|
+
} else if (t.inputsValid !== void 0) {
|
|
933
|
+
const { sdkVersion: e, renderingMode: n, outputs: r, inputsValid: i, sections: s, initialArgs: o, code: a } = t, c = Object.keys(t);
|
|
934
|
+
if (e === void 0 || n === void 0 || r === void 0 || i === void 0 || s === void 0 || o === void 0)
|
|
934
935
|
throw new Error(
|
|
935
|
-
`Malformed config v2. SDK version ${
|
|
936
|
+
`Malformed config v2. SDK version ${e}; Fields = ${c.join(", ")}`
|
|
936
937
|
);
|
|
937
938
|
return {
|
|
938
|
-
sdkVersion:
|
|
939
|
+
sdkVersion: e,
|
|
939
940
|
renderingMode: n,
|
|
940
941
|
initialArgs: o,
|
|
941
942
|
outputs: Object.fromEntries(
|
|
942
|
-
Object.entries(
|
|
943
|
+
Object.entries(r).map(([u, g]) => [u, P(g)])
|
|
943
944
|
),
|
|
944
|
-
inputsValid:
|
|
945
|
-
sections:
|
|
945
|
+
inputsValid: P(i),
|
|
946
|
+
sections: P(s),
|
|
946
947
|
initialUiState: void 0,
|
|
947
|
-
code:
|
|
948
|
+
code: a
|
|
948
949
|
};
|
|
949
|
-
} else if (
|
|
950
|
-
const { sdkVersion:
|
|
951
|
-
if (
|
|
950
|
+
} else if (t.renderingMode !== void 0) {
|
|
951
|
+
const { sdkVersion: e, canRun: n, renderingMode: r, outputs: i, sections: s, initialArgs: o, code: a } = t, c = Object.keys(t);
|
|
952
|
+
if (r === void 0 || i === void 0 || n === void 0 || s === void 0 || o === void 0)
|
|
952
953
|
throw new Error(
|
|
953
|
-
`Malformed config v1. SDK version ${
|
|
954
|
+
`Malformed config v1. SDK version ${e}; Fields = ${c.join(", ")}`
|
|
954
955
|
);
|
|
955
956
|
return {
|
|
956
|
-
sdkVersion:
|
|
957
|
-
renderingMode:
|
|
957
|
+
sdkVersion: e ?? "unknown",
|
|
958
|
+
renderingMode: r,
|
|
958
959
|
initialArgs: o,
|
|
959
960
|
outputs: Object.fromEntries(
|
|
960
|
-
Object.entries(i).map(([
|
|
961
|
+
Object.entries(i).map(([u, g]) => [u, P(g)])
|
|
961
962
|
),
|
|
962
|
-
inputsValid:
|
|
963
|
-
sections:
|
|
963
|
+
inputsValid: P(n),
|
|
964
|
+
sections: P(s),
|
|
964
965
|
initialUiState: void 0,
|
|
965
|
-
code:
|
|
966
|
+
code: a
|
|
966
967
|
};
|
|
967
968
|
} else {
|
|
968
|
-
const { sdkVersion:
|
|
969
|
+
const { sdkVersion: e } = t, n = Object.keys(t);
|
|
969
970
|
throw new Error(
|
|
970
|
-
`Config format not supported: SDK = ${
|
|
971
|
+
`Config format not supported: SDK = ${e}; Fields = ${n.join(", ")}`
|
|
971
972
|
);
|
|
972
973
|
}
|
|
973
974
|
}
|
|
974
975
|
class b {
|
|
975
|
-
constructor(
|
|
976
|
-
this._renderingMode =
|
|
976
|
+
constructor(e, n, r, i, s, o, a) {
|
|
977
|
+
this._renderingMode = e, this._initialArgs = n, this._initialUiState = r, this._outputs = i, this._inputsValid = s, this._sections = o, this._title = a;
|
|
977
978
|
}
|
|
978
|
-
static create(
|
|
979
|
+
static create(e = "Heavy") {
|
|
979
980
|
return new b(
|
|
980
|
-
|
|
981
|
+
e,
|
|
981
982
|
void 0,
|
|
982
983
|
{},
|
|
983
984
|
{},
|
|
984
|
-
|
|
985
|
-
|
|
985
|
+
E(!0),
|
|
986
|
+
E([]),
|
|
986
987
|
void 0
|
|
987
988
|
);
|
|
988
989
|
}
|
|
989
|
-
output(
|
|
990
|
+
output(e, n, r = {}) {
|
|
990
991
|
if (typeof n == "function") {
|
|
991
|
-
const i = `output#${
|
|
992
|
-
return
|
|
992
|
+
const i = `output#${e}`;
|
|
993
|
+
return L(i, () => n(new x())), new b(
|
|
993
994
|
this._renderingMode,
|
|
994
995
|
this._initialArgs,
|
|
995
996
|
this._initialUiState,
|
|
996
997
|
{
|
|
997
998
|
...this._outputs,
|
|
998
|
-
[
|
|
999
|
+
[e]: {
|
|
999
1000
|
__renderLambda: !0,
|
|
1000
1001
|
handle: i,
|
|
1001
|
-
...
|
|
1002
|
+
...r
|
|
1002
1003
|
}
|
|
1003
1004
|
},
|
|
1004
1005
|
this._inputsValid,
|
|
@@ -1012,7 +1013,7 @@ class b {
|
|
|
1012
1013
|
this._initialUiState,
|
|
1013
1014
|
{
|
|
1014
1015
|
...this._outputs,
|
|
1015
|
-
[
|
|
1016
|
+
[e]: n
|
|
1016
1017
|
},
|
|
1017
1018
|
this._inputsValid,
|
|
1018
1019
|
this._sections,
|
|
@@ -1020,15 +1021,15 @@ class b {
|
|
|
1020
1021
|
);
|
|
1021
1022
|
}
|
|
1022
1023
|
/** Shortcut for {@link output} with retentive flag set to true. */
|
|
1023
|
-
retentiveOutput(
|
|
1024
|
-
return this.output(
|
|
1024
|
+
retentiveOutput(e, n) {
|
|
1025
|
+
return this.output(e, n, { retentive: !0 });
|
|
1025
1026
|
}
|
|
1026
1027
|
/** @deprecated */
|
|
1027
|
-
canRun(
|
|
1028
|
-
return this.inputsValid(
|
|
1028
|
+
canRun(e) {
|
|
1029
|
+
return this.inputsValid(e);
|
|
1029
1030
|
}
|
|
1030
|
-
argsValid(
|
|
1031
|
-
return typeof
|
|
1031
|
+
argsValid(e) {
|
|
1032
|
+
return typeof e == "function" ? (L("inputsValid", () => e(new x())), new b(
|
|
1032
1033
|
this._renderingMode,
|
|
1033
1034
|
this._initialArgs,
|
|
1034
1035
|
this._initialUiState,
|
|
@@ -1044,16 +1045,16 @@ class b {
|
|
|
1044
1045
|
this._initialArgs,
|
|
1045
1046
|
this._initialUiState,
|
|
1046
1047
|
this._outputs,
|
|
1047
|
-
|
|
1048
|
+
e,
|
|
1048
1049
|
this._sections,
|
|
1049
1050
|
this._title
|
|
1050
1051
|
);
|
|
1051
1052
|
}
|
|
1052
|
-
inputsValid(
|
|
1053
|
-
return this.argsValid(
|
|
1053
|
+
inputsValid(e) {
|
|
1054
|
+
return this.argsValid(e);
|
|
1054
1055
|
}
|
|
1055
|
-
sections(
|
|
1056
|
-
return Array.isArray(
|
|
1056
|
+
sections(e) {
|
|
1057
|
+
return Array.isArray(e) ? this.sections(E(e)) : typeof e == "function" ? (L("sections", () => e(new x())), new b(
|
|
1057
1058
|
this._renderingMode,
|
|
1058
1059
|
this._initialArgs,
|
|
1059
1060
|
this._initialUiState,
|
|
@@ -1067,12 +1068,12 @@ class b {
|
|
|
1067
1068
|
this._initialUiState,
|
|
1068
1069
|
this._outputs,
|
|
1069
1070
|
this._inputsValid,
|
|
1070
|
-
|
|
1071
|
+
e,
|
|
1071
1072
|
this._title
|
|
1072
1073
|
);
|
|
1073
1074
|
}
|
|
1074
|
-
title(
|
|
1075
|
-
return
|
|
1075
|
+
title(e) {
|
|
1076
|
+
return L("title", () => e(new x())), new b(
|
|
1076
1077
|
this._renderingMode,
|
|
1077
1078
|
this._initialArgs,
|
|
1078
1079
|
this._initialUiState,
|
|
@@ -1086,10 +1087,10 @@ class b {
|
|
|
1086
1087
|
* Sets initial args for the block, this value must be specified.
|
|
1087
1088
|
* @deprecated use {@link withArgs}
|
|
1088
1089
|
* */
|
|
1089
|
-
initialArgs(
|
|
1090
|
+
initialArgs(e) {
|
|
1090
1091
|
return new b(
|
|
1091
1092
|
this._renderingMode,
|
|
1092
|
-
|
|
1093
|
+
e,
|
|
1093
1094
|
this._initialUiState,
|
|
1094
1095
|
this._outputs,
|
|
1095
1096
|
this._inputsValid,
|
|
@@ -1098,10 +1099,10 @@ class b {
|
|
|
1098
1099
|
);
|
|
1099
1100
|
}
|
|
1100
1101
|
/** Sets initial args for the block, this value must be specified. */
|
|
1101
|
-
withArgs(
|
|
1102
|
+
withArgs(e) {
|
|
1102
1103
|
return new b(
|
|
1103
1104
|
this._renderingMode,
|
|
1104
|
-
|
|
1105
|
+
e,
|
|
1105
1106
|
this._initialUiState,
|
|
1106
1107
|
this._outputs,
|
|
1107
1108
|
this._inputsValid,
|
|
@@ -1110,11 +1111,11 @@ class b {
|
|
|
1110
1111
|
);
|
|
1111
1112
|
}
|
|
1112
1113
|
/** Defines type and sets initial value for block UiState. */
|
|
1113
|
-
withUiState(
|
|
1114
|
+
withUiState(e) {
|
|
1114
1115
|
return new b(
|
|
1115
1116
|
this._renderingMode,
|
|
1116
1117
|
this._initialArgs,
|
|
1117
|
-
|
|
1118
|
+
e,
|
|
1118
1119
|
this._outputs,
|
|
1119
1120
|
this._inputsValid,
|
|
1120
1121
|
this._sections,
|
|
@@ -1126,9 +1127,9 @@ class b {
|
|
|
1126
1127
|
* other features provided by the platforma to the block. */
|
|
1127
1128
|
done() {
|
|
1128
1129
|
if (this._initialArgs === void 0) throw new Error("Initial arguments not set.");
|
|
1129
|
-
const
|
|
1130
|
+
const e = {
|
|
1130
1131
|
v3: {
|
|
1131
|
-
sdkVersion:
|
|
1132
|
+
sdkVersion: T,
|
|
1132
1133
|
renderingMode: this._renderingMode,
|
|
1133
1134
|
initialArgs: this._initialArgs,
|
|
1134
1135
|
initialUiState: this._initialUiState,
|
|
@@ -1138,184 +1139,193 @@ class b {
|
|
|
1138
1139
|
outputs: this._outputs
|
|
1139
1140
|
},
|
|
1140
1141
|
// fields below are added to allow previous desktop versions read generated configs
|
|
1141
|
-
sdkVersion:
|
|
1142
|
+
sdkVersion: T,
|
|
1142
1143
|
renderingMode: this._renderingMode,
|
|
1143
1144
|
initialArgs: this._initialArgs,
|
|
1144
|
-
inputsValid:
|
|
1145
|
-
sections:
|
|
1145
|
+
inputsValid: $(this._inputsValid),
|
|
1146
|
+
sections: $(this._sections),
|
|
1146
1147
|
outputs: Object.fromEntries(
|
|
1147
|
-
Object.entries(this._outputs).map(([n,
|
|
1148
|
+
Object.entries(this._outputs).map(([n, r]) => [n, $(r)])
|
|
1148
1149
|
)
|
|
1149
1150
|
};
|
|
1150
|
-
return
|
|
1151
|
+
return _e() ? ie({ sdkVersion: T }) : { config: e };
|
|
1151
1152
|
}
|
|
1152
1153
|
}
|
|
1153
|
-
function
|
|
1154
|
-
var
|
|
1155
|
-
|
|
1156
|
-
|
|
1154
|
+
function mt(t, e, n, r) {
|
|
1155
|
+
var u, g;
|
|
1156
|
+
Array.isArray(r) && (r = { filters: r });
|
|
1157
|
+
const i = t.resultPool.getData().entries.map((d) => d.obj).filter(z).filter((d) => d.spec.name === "pl7.app/label" && d.spec.axesSpec.length === 1), s = (d, p) => {
|
|
1158
|
+
let h = d.toString();
|
|
1157
1159
|
if (p)
|
|
1158
|
-
for (const
|
|
1159
|
-
|
|
1160
|
-
return
|
|
1160
|
+
for (const f in p)
|
|
1161
|
+
h += f, h += p[f];
|
|
1162
|
+
return h;
|
|
1161
1163
|
}, o = /* @__PURE__ */ new Map();
|
|
1162
|
-
for (const
|
|
1163
|
-
for (const p of
|
|
1164
|
-
const
|
|
1165
|
-
for (const
|
|
1166
|
-
const
|
|
1167
|
-
if (
|
|
1168
|
-
const
|
|
1169
|
-
if (
|
|
1170
|
-
const
|
|
1171
|
-
o.set(
|
|
1172
|
-
id:
|
|
1164
|
+
for (const d of e)
|
|
1165
|
+
for (const p of d.spec.axesSpec) {
|
|
1166
|
+
const h = Q(p);
|
|
1167
|
+
for (const f of i) {
|
|
1168
|
+
const C = f.spec.axesSpec[0], y = Q(f.spec.axesSpec[0]);
|
|
1169
|
+
if (ye(h, y)) {
|
|
1170
|
+
const I = Object.keys(h.domain ?? {}).length, D = Object.keys(y.domain ?? {}).length;
|
|
1171
|
+
if (I > D) {
|
|
1172
|
+
const R = s(f.id, h.domain);
|
|
1173
|
+
o.set(R, {
|
|
1174
|
+
id: R,
|
|
1173
1175
|
spec: {
|
|
1174
|
-
...
|
|
1175
|
-
axesSpec: [{ ...
|
|
1176
|
+
...f.spec,
|
|
1177
|
+
axesSpec: [{ ...h, annotations: C.annotations }]
|
|
1176
1178
|
},
|
|
1177
|
-
data:
|
|
1179
|
+
data: f.data
|
|
1178
1180
|
});
|
|
1179
1181
|
} else
|
|
1180
|
-
o.set(
|
|
1182
|
+
o.set(s(f.id), f);
|
|
1181
1183
|
}
|
|
1182
1184
|
}
|
|
1183
1185
|
}
|
|
1184
|
-
if (
|
|
1185
|
-
(
|
|
1186
|
+
if ([...e, ...o.values()].some(
|
|
1187
|
+
(d) => d.data instanceof _ && !d.data.getIsReadyOrError()
|
|
1186
1188
|
))
|
|
1187
|
-
return
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1189
|
+
return;
|
|
1190
|
+
let a = e;
|
|
1191
|
+
const c = [];
|
|
1192
|
+
if (r != null && r.coreColumnPredicate) {
|
|
1193
|
+
a = [];
|
|
1194
|
+
for (const d of e)
|
|
1195
|
+
r.coreColumnPredicate(d.spec) ? a.push(d) : c.push(d);
|
|
1196
|
+
}
|
|
1197
|
+
return c.push(...o.values()), t.createPTable({
|
|
1198
|
+
src: {
|
|
1199
|
+
type: "outer",
|
|
1200
|
+
primary: {
|
|
1201
|
+
type: (r == null ? void 0 : r.coreJoinType) ?? "full",
|
|
1202
|
+
entries: a.map((d) => ({ type: "column", column: d }))
|
|
1195
1203
|
},
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1204
|
+
secondary: c.map((d) => ({ type: "column", column: d }))
|
|
1205
|
+
},
|
|
1206
|
+
filters: [...(r == null ? void 0 : r.filters) ?? [], ...((u = n == null ? void 0 : n.pTableParams) == null ? void 0 : u.filters) ?? []],
|
|
1207
|
+
sorting: ((g = n == null ? void 0 : n.pTableParams) == null ? void 0 : g.sorting) ?? []
|
|
1208
|
+
});
|
|
1199
1209
|
}
|
|
1200
|
-
function
|
|
1201
|
-
const
|
|
1210
|
+
function yt(t, e, n) {
|
|
1211
|
+
const r = t.findLabels(e);
|
|
1202
1212
|
return {
|
|
1203
|
-
axis:
|
|
1213
|
+
axis: e,
|
|
1204
1214
|
options: n.map((i) => ({
|
|
1205
1215
|
value: i,
|
|
1206
|
-
label: (
|
|
1216
|
+
label: (r == null ? void 0 : r[i]) ?? i.toString()
|
|
1207
1217
|
})),
|
|
1208
1218
|
defaultValue: n[0]
|
|
1209
1219
|
};
|
|
1210
1220
|
}
|
|
1211
|
-
class
|
|
1212
|
-
constructor(
|
|
1213
|
-
this.handle =
|
|
1221
|
+
class bt {
|
|
1222
|
+
constructor(e) {
|
|
1223
|
+
this.handle = e;
|
|
1214
1224
|
}
|
|
1215
|
-
async findColumns(
|
|
1216
|
-
return await platforma.pFrameDriver.findColumns(this.handle,
|
|
1225
|
+
async findColumns(e) {
|
|
1226
|
+
return await platforma.pFrameDriver.findColumns(this.handle, e);
|
|
1217
1227
|
}
|
|
1218
|
-
async getColumnSpec(
|
|
1219
|
-
return await platforma.pFrameDriver.getColumnSpec(this.handle,
|
|
1228
|
+
async getColumnSpec(e) {
|
|
1229
|
+
return await platforma.pFrameDriver.getColumnSpec(this.handle, e);
|
|
1220
1230
|
}
|
|
1221
1231
|
async listColumns() {
|
|
1222
1232
|
return await platforma.pFrameDriver.listColumns(this.handle);
|
|
1223
1233
|
}
|
|
1224
|
-
async calculateTableData(
|
|
1225
|
-
return await platforma.pFrameDriver.calculateTableData(this.handle,
|
|
1234
|
+
async calculateTableData(e) {
|
|
1235
|
+
return await platforma.pFrameDriver.calculateTableData(this.handle, e);
|
|
1226
1236
|
}
|
|
1227
|
-
async getUniqueValues(
|
|
1228
|
-
return await platforma.pFrameDriver.getUniqueValues(this.handle,
|
|
1237
|
+
async getUniqueValues(e) {
|
|
1238
|
+
return await platforma.pFrameDriver.getUniqueValues(this.handle, e);
|
|
1229
1239
|
}
|
|
1230
1240
|
}
|
|
1231
|
-
function
|
|
1232
|
-
return
|
|
1241
|
+
function Ee(t) {
|
|
1242
|
+
return re({
|
|
1233
1243
|
__isRef: !0,
|
|
1234
|
-
blockId:
|
|
1235
|
-
name:
|
|
1244
|
+
blockId: j(t, "blockId"),
|
|
1245
|
+
name: j(t, "name")
|
|
1236
1246
|
});
|
|
1237
1247
|
}
|
|
1238
|
-
function
|
|
1239
|
-
return
|
|
1240
|
-
ref:
|
|
1241
|
-
label:
|
|
1248
|
+
function vt(t) {
|
|
1249
|
+
return re({
|
|
1250
|
+
ref: Ee(j(t, "ref")),
|
|
1251
|
+
label: j(t, "label")
|
|
1242
1252
|
});
|
|
1243
1253
|
}
|
|
1244
|
-
const
|
|
1245
|
-
sdkVersion:
|
|
1254
|
+
const _t = {
|
|
1255
|
+
sdkVersion: T
|
|
1246
1256
|
};
|
|
1247
|
-
function
|
|
1248
|
-
return
|
|
1257
|
+
function wt() {
|
|
1258
|
+
return ie({ sdkVersion: T });
|
|
1249
1259
|
}
|
|
1250
|
-
function
|
|
1260
|
+
function St(t) {
|
|
1251
1261
|
if (typeof globalThis.getEnvironmentValue == "function")
|
|
1252
|
-
return globalThis.getEnvironmentValue(
|
|
1262
|
+
return globalThis.getEnvironmentValue(t);
|
|
1253
1263
|
}
|
|
1254
1264
|
export {
|
|
1255
|
-
|
|
1265
|
+
Ue as Args,
|
|
1256
1266
|
b as BlockModel,
|
|
1257
|
-
|
|
1267
|
+
_t as CurrentSdkInfo,
|
|
1258
1268
|
v as FutureRef,
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
$
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1269
|
+
Je as It,
|
|
1270
|
+
pt as JsRenderInternal,
|
|
1271
|
+
$e as MainOutputs,
|
|
1272
|
+
be as OutputError,
|
|
1273
|
+
Ae as PAnnotationLabel,
|
|
1274
|
+
Ie as PAnnotationTrace,
|
|
1275
|
+
bt as PFrameImpl,
|
|
1276
|
+
U as RT_BINARY_PARTITIONED,
|
|
1277
|
+
J as RT_BINARY_SUPER_PARTITIONED,
|
|
1278
|
+
ee as RT_JSON_PARTITIONED,
|
|
1279
|
+
te as RT_JSON_SUPER_PARTITIONED,
|
|
1280
|
+
W as RT_RESOURCE_MAP,
|
|
1281
|
+
q as RT_RESOURCE_MAP_PARTITIONED,
|
|
1282
|
+
x as RenderCtx,
|
|
1283
|
+
De as ResultPool,
|
|
1284
|
+
Ke as StagingOutputs,
|
|
1285
|
+
Fe as Trace,
|
|
1286
|
+
Re as TraceEntry,
|
|
1277
1287
|
_ as TreeNodeAccessor,
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1288
|
+
Ge as UiState,
|
|
1289
|
+
Qe as and,
|
|
1290
|
+
mt as createPlDataTable,
|
|
1291
|
+
yt as createPlDataTableSheet,
|
|
1292
|
+
ke as deriveLabels,
|
|
1293
|
+
$ as downgradeCfgOrLambda,
|
|
1294
|
+
gt as extractConfig,
|
|
1295
|
+
ze as flatten,
|
|
1296
|
+
vt as fromPlOption,
|
|
1297
|
+
Ee as fromPlRef,
|
|
1298
|
+
rt as getBlobContent,
|
|
1299
|
+
st as getBlobContentAsJson,
|
|
1300
|
+
it as getBlobContentAsString,
|
|
1301
|
+
ot as getDownloadedBlobContent,
|
|
1302
|
+
St as getEnvironmentValue,
|
|
1303
|
+
O as getFromCfg,
|
|
1304
|
+
E as getImmediate,
|
|
1305
|
+
lt as getImportProgress,
|
|
1306
|
+
j as getJsonField,
|
|
1307
|
+
ut as getLastLogs,
|
|
1308
|
+
dt as getLogHandle,
|
|
1309
|
+
at as getOnDemandBlobContent,
|
|
1310
|
+
Le as getPartitionKeysList,
|
|
1311
|
+
ct as getProgressLog,
|
|
1312
|
+
wt as getRawPlatformaInstance,
|
|
1313
|
+
et as getResourceField,
|
|
1314
|
+
tt as getResourceValueAsJson,
|
|
1315
|
+
ht as getUniquePartitionKeys,
|
|
1316
|
+
K as ifDef,
|
|
1317
|
+
xe as isConfigLambda,
|
|
1318
|
+
Ye as isEmpty,
|
|
1319
|
+
Me as isolate,
|
|
1320
|
+
He as makeArray,
|
|
1321
|
+
re as makeObject,
|
|
1322
|
+
qe as mapArrayValues,
|
|
1323
|
+
We as mapRecordValues,
|
|
1324
|
+
nt as mapResourceFields,
|
|
1325
|
+
Xe as not,
|
|
1326
|
+
Ze as or,
|
|
1327
|
+
ft as parseResourceMap,
|
|
1328
|
+
ve as readOutput,
|
|
1329
|
+
Ne as wrapOutputs
|
|
1320
1330
|
};
|
|
1321
1331
|
//# sourceMappingURL=index.mjs.map
|