@platforma-sdk/ui-vue 1.7.30 → 1.7.31
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 +12 -0
- package/dist/lib.js +1519 -1318
- package/dist/lib.umd.cjs +10 -10
- package/dist/src/components/PlAgCellFile/PlAgCellFile.vue.d.ts +45 -0
- package/dist/src/components/PlAgCellFile/PlAgCellFile.vue.d.ts.map +1 -0
- package/dist/src/components/PlAgCellFile/index.d.ts +2 -0
- package/dist/src/components/PlAgCellFile/index.d.ts.map +1 -0
- package/dist/src/lib.d.ts +1 -0
- 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 +3 -3
- package/src/components/PlAgCellFile/PlAgCellFile.vue +63 -0
- package/src/components/PlAgCellFile/index.ts +1 -0
- package/src/components/PlAgDataTable/PlAgDataTable.vue +1 -1
- package/src/lib.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/ui-vue",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.31",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/lib.umd.cjs",
|
|
6
6
|
"module": "dist/lib.js",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@ag-grid-enterprise/rich-select": "^32.3.0",
|
|
35
35
|
"@ag-grid-enterprise/menu": "^32.3.0",
|
|
36
36
|
"@ag-grid-enterprise/excel-export": "^32.3.0",
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
37
|
+
"@platforma-sdk/model": "^1.7.20",
|
|
38
|
+
"@milaboratories/uikit": "^2.0.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@faker-js/faker": "^8.4.1",
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { PlFileInput } from '@milaboratories/uikit';
|
|
3
|
+
import type { ICellRendererParams } from '@ag-grid-community/core';
|
|
4
|
+
import type { ImportFileHandle, ImportProgress } from '@platforma-sdk/model';
|
|
5
|
+
import { computed } from 'vue';
|
|
6
|
+
|
|
7
|
+
const props = defineProps<{
|
|
8
|
+
// this component is intended to be used in ag-grid, params are the main object
|
|
9
|
+
// to communicate with the corresponding cell data
|
|
10
|
+
params: ICellRendererParams<unknown, ImportFileHandle> & {
|
|
11
|
+
extensions?: string[];
|
|
12
|
+
progress?: ImportProgress;
|
|
13
|
+
/**
|
|
14
|
+
* The resolveProgress function is an optional input parameter for the component
|
|
15
|
+
* that allows tracking the file upload progress in real-time.
|
|
16
|
+
* By passing resolveProgress, you can ensure that the component
|
|
17
|
+
* displays accurate progress values for each file as they upload.
|
|
18
|
+
* How to use it in AgGrid
|
|
19
|
+
* cellRendererParams: {
|
|
20
|
+
* resolveProgress: (fileHandle: ImportFileHandle | undefined) => {
|
|
21
|
+
* const progresses = app.progresses;
|
|
22
|
+
* if (!fileHandle) return undefined;
|
|
23
|
+
* else return progresses[fileHandle];
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
*/
|
|
27
|
+
resolveProgress?: (v: ImportFileHandle | undefined) => ImportProgress | undefined;
|
|
28
|
+
};
|
|
29
|
+
}>();
|
|
30
|
+
|
|
31
|
+
const extensions = computed(() => props.params.extensions);
|
|
32
|
+
|
|
33
|
+
// extracting cell value and casting it to the type we expect
|
|
34
|
+
const handle = computed(() => props.params.value as ImportFileHandle | undefined);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* When value changes in the file input this method forward the value to the ag-grid,
|
|
38
|
+
* which in tern forwards in to the valueSetter in corresponding column.
|
|
39
|
+
* */
|
|
40
|
+
function onHandleUpdate(newHandle: ImportFileHandle | undefined) {
|
|
41
|
+
props.params.setValue!(newHandle);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const currentProgress = computed(() => {
|
|
45
|
+
return props.params.resolveProgress ? props.params.resolveProgress(handle.value) : undefined;
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
48
|
+
|
|
49
|
+
<template>
|
|
50
|
+
<div style="height: 100%">
|
|
51
|
+
<PlFileInput
|
|
52
|
+
show-filename-only
|
|
53
|
+
clearable
|
|
54
|
+
cell-style
|
|
55
|
+
file-dialog-title="Select any file"
|
|
56
|
+
:placeholder="`Choose file ${extensions ? extensions[0] : ''}`"
|
|
57
|
+
:extensions="extensions"
|
|
58
|
+
:model-value="handle"
|
|
59
|
+
:progress="currentProgress"
|
|
60
|
+
@update:model-value="onHandleUpdate"
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
</template>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PlAgCellFile } from './PlAgCellFile.vue';
|
|
@@ -411,9 +411,9 @@ watch(
|
|
|
411
411
|
</div>
|
|
412
412
|
</Transition>
|
|
413
413
|
<AgGridVue
|
|
414
|
+
:key="reloadKey"
|
|
414
415
|
class="ap-ag-data-table-grid"
|
|
415
416
|
:grid-options="gridOptions"
|
|
416
|
-
:key="reloadKey"
|
|
417
417
|
@grid-ready="onGridReady"
|
|
418
418
|
@state-updated="onStateUpdated"
|
|
419
419
|
@grid-pre-destroyed="onGridPreDestroyed"
|
package/src/lib.ts
CHANGED
|
@@ -7,6 +7,8 @@ import ValueOrErrorsComponent from './components/ValueOrErrorsComponent.vue';
|
|
|
7
7
|
|
|
8
8
|
export { BlockLayout, PlAgDataTable, PlAgOverlayLoading, PlAgOverlayNoRows, ValueOrErrorsComponent };
|
|
9
9
|
|
|
10
|
+
export * from './components/PlAgCellFile';
|
|
11
|
+
|
|
10
12
|
export * from './components/PlAgDataTable/types';
|
|
11
13
|
|
|
12
14
|
export * from './defineApp';
|