@platforma-sdk/ui-vue 1.22.24 → 1.22.29
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/CHANGELOG.md +8 -0
- package/dist/lib.js +5757 -5704
- package/dist/lib.js.map +1 -1
- package/dist/lib.umd.cjs +14 -14
- package/dist/lib.umd.cjs.map +1 -1
- package/dist/src/components/PlAgDataTable/PlAgOverlayLoading.vue.d.ts +16 -3
- package/dist/src/components/PlAgDataTable/PlAgOverlayLoading.vue.d.ts.map +1 -1
- package/dist/src/components/PlAgDataTable/PlAgOverlayNoRows.vue.d.ts.map +1 -1
- package/dist/src/components/PlAgDataTable/index.d.ts +1 -0
- package/dist/src/components/PlAgDataTable/index.d.ts.map +1 -1
- package/dist/src/components/PlAgDataTable/useAgDataTableOptionsSimple.d.ts +22 -0
- package/dist/src/components/PlAgDataTable/useAgDataTableOptionsSimple.d.ts.map +1 -0
- package/dist/src/lib.d.ts +1 -4
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/PlAgDataTable/PlAgOverlayLoading.vue +25 -8
- package/src/components/PlAgDataTable/PlAgOverlayNoRows.vue +1 -0
- package/src/components/PlAgDataTable/index.ts +1 -0
- package/src/components/PlAgDataTable/pl-ag-overlay-loading.module.scss +30 -27
- package/src/components/PlAgDataTable/useAgDataTableOptionsSimple.ts +56 -0
- package/src/lib.ts +1 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/ui-vue",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.29",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/lib.umd.cjs",
|
|
6
6
|
"module": "dist/lib.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"canonicalize": "^2.0.0",
|
|
24
24
|
"ag-grid-enterprise": "^33.0.4",
|
|
25
25
|
"ag-grid-vue3": "^33.0.4",
|
|
26
|
-
"@milaboratories/uikit": "^2.2.
|
|
26
|
+
"@milaboratories/uikit": "^2.2.57",
|
|
27
27
|
"@platforma-sdk/model": "^1.22.18"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"semver": "^7.6.3",
|
|
46
46
|
"@types/semver": "^7.5.8",
|
|
47
47
|
"rollup-plugin-sourcemaps2": "^0.4.3",
|
|
48
|
-
"@milaboratories/
|
|
49
|
-
"@milaboratories/
|
|
48
|
+
"@milaboratories/eslint-config": "^1.0.1",
|
|
49
|
+
"@milaboratories/helpers": "^1.6.11"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"test": "vitest run --passWithNoTests",
|
|
@@ -10,21 +10,38 @@ defineProps<{
|
|
|
10
10
|
/**
|
|
11
11
|
* Required flag, that shows catInBag icon with message if `true`, shows PlSplash component if `false`.
|
|
12
12
|
*/
|
|
13
|
-
notReady:
|
|
13
|
+
notReady: boolean;
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
15
|
+
* Prop to override default "Loading" text
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
loadingText?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Prop to override default "No datasource" text (So why props name is notReady? Good question)
|
|
20
|
+
*/
|
|
21
|
+
notReadyText?: string;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated
|
|
24
|
+
* Use notReadyText
|
|
25
|
+
*/
|
|
26
|
+
message?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Use "transparent" to make table headers visible below the loading layer
|
|
29
|
+
*/
|
|
30
|
+
overlayType?: 'transparent';
|
|
18
31
|
};
|
|
19
32
|
}>();
|
|
20
33
|
</script>
|
|
21
34
|
|
|
22
35
|
<template>
|
|
23
|
-
<
|
|
24
|
-
|
|
36
|
+
<PlSplash
|
|
37
|
+
:loading="!params.notReady"
|
|
38
|
+
:type="params.overlayType ?? 'table'"
|
|
39
|
+
:loading-text="params.loadingText ?? 'Loading'"
|
|
40
|
+
:class="style.container"
|
|
41
|
+
>
|
|
42
|
+
<div v-if="params.notReady" :class="style.notReadyWrapper">
|
|
25
43
|
<div :class="style.iconCatInBag" />
|
|
26
|
-
<h3 :class="style.text">{{ params.message || 'No datasource' }}</h3>
|
|
44
|
+
<h3 :class="style.text">{{ params.notReadyText || params.message || 'No datasource' }}</h3>
|
|
27
45
|
</div>
|
|
28
|
-
|
|
29
|
-
</div>
|
|
46
|
+
</PlSplash>
|
|
30
47
|
</template>
|
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
.container {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
2
|
+
height: 100%;
|
|
3
|
+
margin-top: 1px;
|
|
4
|
+
width: 100%;
|
|
5
|
+
display: flex;
|
|
6
|
+
align-items: center;
|
|
7
|
+
justify-content: center;
|
|
8
|
+
color: var(--txt-mask);
|
|
9
|
+
}
|
|
11
10
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
.notReadyWrapper {
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 100%;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
background-color: var(--bg-base-light);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.iconCatInBag {
|
|
22
|
+
background-image: url(./assets/loading-cat.png);
|
|
23
|
+
background-repeat: no-repeat;
|
|
24
|
+
height: 212px;
|
|
25
|
+
width: 400px;
|
|
26
|
+
background-size: contain;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.text {
|
|
30
|
+
margin-top: 24px;
|
|
31
|
+
white-space: pre;
|
|
32
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { GridApi, GridOptions, GridReadyEvent } from 'ag-grid-enterprise';
|
|
2
|
+
import { computed, shallowRef, watch } from 'vue';
|
|
3
|
+
import { AgGridTheme } from '../../aggrid';
|
|
4
|
+
import PlAgOverlayLoading from './PlAgOverlayLoading.vue';
|
|
5
|
+
import PlAgOverlayNoRows from './PlAgOverlayNoRows.vue';
|
|
6
|
+
import { autoSizeRowNumberColumn } from './sources/row-number';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Returns a set of Ag Grid options along with a reference to the Ag Grid API.
|
|
10
|
+
* (This is a fast prototype)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const { gridOptions, gridApi } = useAgDataTableOptionsSimple(() => ({
|
|
15
|
+
* // custom grid options here
|
|
16
|
+
* }));
|
|
17
|
+
*
|
|
18
|
+
* // Usage in a template (v-bind is required!)
|
|
19
|
+
* <template>
|
|
20
|
+
* <AgGridVue :style="{ height: '100%' }" v-bind="gridOptions" />
|
|
21
|
+
* </template>
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function useAgDataTableOptionsSimple<TData>(
|
|
25
|
+
factory: () => GridOptions<TData>,
|
|
26
|
+
) {
|
|
27
|
+
const gridApi = shallowRef<GridApi>();
|
|
28
|
+
|
|
29
|
+
const gridOptions = computed<GridOptions>(() => {
|
|
30
|
+
const def: GridOptions<TData> = {
|
|
31
|
+
theme: AgGridTheme,
|
|
32
|
+
loadingOverlayComponent: PlAgOverlayLoading,
|
|
33
|
+
noRowsOverlayComponent: PlAgOverlayNoRows,
|
|
34
|
+
onGridReady: (e: GridReadyEvent) => {
|
|
35
|
+
gridApi.value = e.api;
|
|
36
|
+
autoSizeRowNumberColumn(e.api);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return Object.assign({}, def, factory());
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
watch(() => gridOptions.value.loadingOverlayComponentParams, (newParams) => {
|
|
44
|
+
// Hack to apply loadingOverlayComponentParams
|
|
45
|
+
gridApi.value?.updateGridOptions({
|
|
46
|
+
loading: !gridOptions.value.loading,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
gridApi.value?.updateGridOptions({
|
|
50
|
+
loading: gridOptions.value.loading,
|
|
51
|
+
loadingOverlayComponentParams: newParams,
|
|
52
|
+
});
|
|
53
|
+
}, { deep: true });
|
|
54
|
+
|
|
55
|
+
return { gridOptions, gridApi };
|
|
56
|
+
};
|
package/src/lib.ts
CHANGED
|
@@ -15,10 +15,7 @@ export * from './components/PlAgCellStatusTag';
|
|
|
15
15
|
export * from './components/PlAgChartStackedBarCell';
|
|
16
16
|
export * from './components/PlAgChartHistogramCell';
|
|
17
17
|
|
|
18
|
-
export * from './components/PlAgDataTable
|
|
19
|
-
export * from './components/PlAgDataTable/sources/row-number';
|
|
20
|
-
export * from './components/PlAgDataTable/sources/focus-row';
|
|
21
|
-
export * from './components/PlAgDataTable/sources/menu-items';
|
|
18
|
+
export * from './components/PlAgDataTable';
|
|
22
19
|
|
|
23
20
|
export * from './components/PlAgCsvExporter';
|
|
24
21
|
|