@platforma-sdk/model 1.20.6 → 1.20.11
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 +1 -1
- 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 +606 -584
- package/dist/index.mjs.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/PlDataTable.ts +40 -9
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PlatformaSDKVersion = "1.20.
|
|
1
|
+
export declare const PlatformaSDKVersion = "1.20.11";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,YAAY,CAAC"}
|
package/package.json
CHANGED
|
@@ -234,7 +234,7 @@ export type PlTableFilterStringContainsFuzzyMatch = {
|
|
|
234
234
|
*/
|
|
235
235
|
substitutionsOnly: boolean;
|
|
236
236
|
/**
|
|
237
|
-
* Single character in {@link reference} that will
|
|
237
|
+
* Single character in {@link reference} that will labelColumn any
|
|
238
238
|
* single character in searched text.
|
|
239
239
|
*/
|
|
240
240
|
wildcard?: string;
|
|
@@ -269,7 +269,7 @@ export type PlTableFiltersStateEntry = {
|
|
|
269
269
|
filter: PlTableFilter;
|
|
270
270
|
/** Flag to temporarily disable filter */
|
|
271
271
|
disabled: boolean;
|
|
272
|
-
}
|
|
272
|
+
};
|
|
273
273
|
|
|
274
274
|
/** PlTableFiltersModel state */
|
|
275
275
|
export type PlTableFiltersState = PlTableFiltersStateEntry[];
|
|
@@ -302,22 +302,53 @@ export function createPlDataTable<A, U>(
|
|
|
302
302
|
.filter(isPColumn)
|
|
303
303
|
.filter((p) => p.spec.name === 'pl7.app/label' && p.spec.axesSpec.length === 1);
|
|
304
304
|
|
|
305
|
-
const
|
|
305
|
+
const colId = (id: PObjectId, domain?: Record<string, string>) => {
|
|
306
|
+
let wid = id.toString();
|
|
307
|
+
if (domain) {
|
|
308
|
+
for (const k in domain) {
|
|
309
|
+
wid += k;
|
|
310
|
+
wid += domain[k];
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return wid;
|
|
314
|
+
};
|
|
315
|
+
|
|
316
|
+
const labelColumns = new Map<string, PColumn<TreeNodeAccessor>>();
|
|
317
|
+
|
|
306
318
|
for (const col of columns) {
|
|
307
319
|
for (const axis of col.spec.axesSpec) {
|
|
308
320
|
const axisId = getAxisId(axis);
|
|
309
|
-
for (const
|
|
310
|
-
|
|
311
|
-
|
|
321
|
+
for (const labelColumn of allLabelCols) {
|
|
322
|
+
const labelAxis = labelColumn.spec.axesSpec[0];
|
|
323
|
+
const labelAxisId = getAxisId(labelColumn.spec.axesSpec[0]);
|
|
324
|
+
if (matchAxisId(axisId, labelAxisId)) {
|
|
325
|
+
const dataDomainLen = Object.keys(axisId.domain ?? {}).length;
|
|
326
|
+
const labelDomainLen = Object.keys(labelAxisId.domain ?? {}).length;
|
|
327
|
+
if (dataDomainLen > labelDomainLen) {
|
|
328
|
+
const id = colId(labelColumn.id, axisId.domain);
|
|
329
|
+
|
|
330
|
+
labelColumns.set(id, {
|
|
331
|
+
id: id as PObjectId,
|
|
332
|
+
spec: {
|
|
333
|
+
...labelColumn.spec,
|
|
334
|
+
axesSpec: [{ ...axisId, annotations: labelAxis.annotations }]
|
|
335
|
+
},
|
|
336
|
+
data: labelColumn.data
|
|
337
|
+
});
|
|
338
|
+
} else {
|
|
339
|
+
labelColumns.set(colId(labelColumn.id), labelColumn);
|
|
340
|
+
}
|
|
312
341
|
}
|
|
313
342
|
}
|
|
314
343
|
}
|
|
315
344
|
}
|
|
316
345
|
|
|
317
346
|
// if at least one column is not yet ready, we can't show the table
|
|
318
|
-
if (
|
|
319
|
-
|
|
320
|
-
|
|
347
|
+
if (
|
|
348
|
+
[...columns, ...labelColumns.values()].some(
|
|
349
|
+
(a) => a.data instanceof TreeNodeAccessor && !a.data.getIsReadyOrError()
|
|
350
|
+
)
|
|
351
|
+
)
|
|
321
352
|
return undefined;
|
|
322
353
|
|
|
323
354
|
return ctx.createPTable({
|