@platforma-sdk/ui-vue 1.30.0 → 1.30.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/ui-vue",
3
- "version": "1.30.0",
3
+ "version": "1.30.1",
4
4
  "type": "module",
5
5
  "main": "dist/lib.umd.cjs",
6
6
  "module": "dist/lib.js",
@@ -40,7 +40,15 @@ import PlOverlayLoading from './PlAgOverlayLoading.vue';
40
40
  import PlOverlayNoRows from './PlAgOverlayNoRows.vue';
41
41
  import { type PlAgCellButtonAxisParams, makeRowId } from './sources/common';
42
42
  import { updatePFrameGridOptions } from './sources/table-source-v2';
43
- import type { PlAgDataTableController, PlAgDataTableSettings, PlAgDataTableRow, PTableRowKey, PlAgDataTableSettingsPTable } from './types';
43
+ import type {
44
+ PlAgDataTableController,
45
+ PlAgDataTableSettings,
46
+ PlAgDataTableRow,
47
+ PTableRowKey,
48
+ PlAgDataTableSettingsPTable,
49
+ PlAgOverlayLoadingParams,
50
+ PlAgOverlayNoRowsParams,
51
+ } from './types';
44
52
  import { PlAgGridColumnManager } from '../PlAgGridColumnManager';
45
53
  import { autoSizeRowNumberColumn, PlAgDataTableRowNumberColId } from './sources/row-number';
46
54
  import { focusRow, makeOnceTracker, trackFirstDataRendered } from './sources/focus-row';
@@ -89,13 +97,22 @@ const props = defineProps<{
89
97
  showCellButtonForAxisId?: AxisId;
90
98
 
91
99
  /**
92
- * If cellButtonInvokeRowsOnDoubleClick = true, clicking a button inside the row
93
- * triggers the doubleClick event for the entire row.
94
- *
95
- * If cellButtonInvokeRowsOnDoubleClick = false, the doubleClick event for the row
96
- * is not triggered, but will triggered cellButtonClicked event with (key: PTableRowKey) argument.
97
- */
100
+ * If cellButtonInvokeRowsOnDoubleClick = true, clicking a button inside the row
101
+ * triggers the doubleClick event for the entire row.
102
+ *
103
+ * If cellButtonInvokeRowsOnDoubleClick = false, the doubleClick event for the row
104
+ * is not triggered, but will triggered cellButtonClicked event with (key: PTableRowKey) argument.
105
+ */
98
106
  cellButtonInvokeRowsOnDoubleClick?: boolean;
107
+
108
+ /** @see {@link PlAgOverlayLoadingParams.loadingText} */
109
+ loadingText?: string;
110
+
111
+ /** @see {@link PlAgOverlayLoadingParams.notReadyText} */
112
+ notReadyText?: string;
113
+
114
+ /** @see {@link PlAgOverlayNoRowsParams.text} */
115
+ noRowsText?: string;
99
116
  }>();
100
117
  const { settings } = toRefs(props);
101
118
  const emit = defineEmits<{
@@ -219,6 +236,7 @@ const gridApi = shallowRef<GridApi>();
219
236
  const gridApiDef = shallowRef(new Deferred<GridApi>());
220
237
 
221
238
  const firstDataRenderedTracker = makeOnceTracker<GridApi<PlAgDataTableRow>>();
239
+
222
240
  const gridOptions = shallowRef<GridOptions<PlAgDataTableRow>>({
223
241
  animateRows: false,
224
242
  suppressColumnMoveAnimation: true,
@@ -278,9 +296,16 @@ const gridOptions = shallowRef<GridOptions<PlAgDataTableRow>>({
278
296
  suppressServerSideFullWidthLoadingRow: true,
279
297
  getRowId: (params) => params.data.id,
280
298
  loading: true,
281
- loadingOverlayComponentParams: { notReady: true },
299
+ loadingOverlayComponentParams: {
300
+ notReady: true,
301
+ loadingText: props.loadingText,
302
+ notReadyText: props.notReadyText,
303
+ } satisfies PlAgOverlayLoadingParams,
282
304
  loadingOverlayComponent: PlOverlayLoading,
283
305
  noRowsOverlayComponent: PlOverlayNoRows,
306
+ noRowsOverlayComponentParams: {
307
+ text: props.noRowsText,
308
+ } satisfies PlAgOverlayNoRowsParams,
284
309
  defaultCsvExportParams: {
285
310
  allColumns: true,
286
311
  suppressQuotes: true,
@@ -391,7 +416,10 @@ const onSheetChanged = (sheetId: string, newValue: string | number) => {
391
416
  sheetsState.value = state;
392
417
  return gridApi.value?.updateGridOptions({
393
418
  loading: true,
394
- loadingOverlayComponentParams: { notReady: false },
419
+ loadingOverlayComponentParams: {
420
+ ...gridOptions.value.loadingOverlayComponentParams,
421
+ notReady: false,
422
+ } satisfies PlAgOverlayLoadingParams,
395
423
  });
396
424
  };
397
425
 
@@ -422,7 +450,10 @@ watch(
422
450
  case undefined:
423
451
  return gridApi.updateGridOptions({
424
452
  loading: true,
425
- loadingOverlayComponentParams: { notReady: true },
453
+ loadingOverlayComponentParams: {
454
+ ...gridOptions.value.loadingOverlayComponentParams,
455
+ notReady: true,
456
+ } satisfies PlAgOverlayLoadingParams,
426
457
  columnDefs: [],
427
458
  rowData: undefined,
428
459
  datasource: undefined,
@@ -432,7 +463,10 @@ watch(
432
463
  if (!settings?.model) {
433
464
  return gridApi.updateGridOptions({
434
465
  loading: true,
435
- loadingOverlayComponentParams: { notReady: false },
466
+ loadingOverlayComponentParams: {
467
+ ...gridOptions.value.loadingOverlayComponentParams,
468
+ notReady: false,
469
+ } satisfies PlAgOverlayLoadingParams,
436
470
  columnDefs: [],
437
471
  rowData: undefined,
438
472
  datasource: undefined,
@@ -441,7 +475,10 @@ watch(
441
475
 
442
476
  gridApi.updateGridOptions({
443
477
  loading: true,
444
- loadingOverlayComponentParams: { notReady: false },
478
+ loadingOverlayComponentParams: {
479
+ ...gridOptions.value.loadingOverlayComponentParams,
480
+ notReady: false,
481
+ } satisfies PlAgOverlayLoadingParams,
445
482
  });
446
483
 
447
484
  const options = await updatePFrameGridOptions(
@@ -458,14 +495,20 @@ watch(
458
495
  ).catch((err) => {
459
496
  gridApi.updateGridOptions({
460
497
  loading: false,
461
- loadingOverlayComponentParams: { notReady: false },
498
+ loadingOverlayComponentParams: {
499
+ ...gridOptions.value.loadingOverlayComponentParams,
500
+ notReady: false,
501
+ } satisfies PlAgOverlayLoadingParams,
462
502
  });
463
503
  throw err;
464
504
  });
465
505
 
466
506
  return gridApi.updateGridOptions({
467
507
  loading: false,
468
- loadingOverlayComponentParams: { notReady: false },
508
+ loadingOverlayComponentParams: {
509
+ ...gridOptions.value.loadingOverlayComponentParams,
510
+ notReady: false,
511
+ } satisfies PlAgOverlayLoadingParams,
469
512
  ...options,
470
513
  });
471
514
  }
@@ -1,8 +1,8 @@
1
1
  <script lang="ts" setup>
2
+ import type { PlAgOverlayNoRowsParams } from './types';
3
+
2
4
  defineProps<{
3
- params: {
4
- text?: string;
5
- };
5
+ params: PlAgOverlayNoRowsParams;
6
6
  }>();
7
7
  </script>
8
8
 
@@ -28,6 +28,7 @@ export type PlDataTableSettingsXsv = {
28
28
 
29
29
  /** Data table settings */
30
30
  export type PlDataTableSettings =
31
+ | undefined
31
32
  | PlDataTableSettingsPTable
32
33
  | PlDataTableSettingsXsv;
33
34
 
@@ -35,13 +36,14 @@ export type PlAgDataTableSettingsPTable = {
35
36
  /** The type of the source to feed the data into the table */
36
37
  sourceType: 'ptable';
37
38
  /** PTable handle output */
38
- model?: PlDataTableModel;
39
+ model: PlDataTableModel | undefined;
39
40
  /** Sheets that we want to show in our table */
40
41
  sheets?: PlDataTableSheet[];
41
42
  };
42
43
 
43
44
  /** Data table settings */
44
45
  export type PlAgDataTableSettings =
46
+ | undefined
45
47
  | PlAgDataTableSettingsPTable;
46
48
 
47
49
  /** PlTableFilters restriction entry */
@@ -103,3 +105,10 @@ export type PlAgOverlayLoadingParams = {
103
105
  */
104
106
  overlayType?: 'transparent';
105
107
  };
108
+
109
+ export type PlAgOverlayNoRowsParams = {
110
+ /**
111
+ * Prop to override default "Empty" text
112
+ */
113
+ text?: string;
114
+ };