@milaboratories/milaboratories.ui-examples.ui 1.3.35 → 1.3.36
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/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +6 -0
- package/dist/assets/{index-D8b88Naq.js → index-D4XHswrN.js} +164 -164
- package/dist/assets/{index-D8b88Naq.js.map → index-D4XHswrN.js.map} +1 -1
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/src/pages/AgGridVuePage/AgGridVuePage.vue +139 -176
package/dist/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta http-equiv="Content-Security-Policy" content="script-src 'self' blob:">
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<script type="module" crossorigin src="./assets/index-
|
|
7
|
+
<script type="module" crossorigin src="./assets/index-D4XHswrN.js"></script>
|
|
8
8
|
<link rel="stylesheet" crossorigin href="./assets/index-DBOmIoaJ.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@milaboratories/milaboratories.ui-examples.ui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.36",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"vue": "^3.5.13",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"ag-grid-enterprise": "^33.0.4",
|
|
18
18
|
"ag-grid-vue3": "^33.0.4",
|
|
19
19
|
"rollup-plugin-sourcemaps2": "^0.4.3",
|
|
20
|
-
"@platforma-sdk/ui-vue": "^1.22.
|
|
20
|
+
"@platforma-sdk/ui-vue": "^1.22.55",
|
|
21
21
|
"@milaboratories/helpers": "^1.6.11"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
@@ -1,30 +1,22 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { Component } from 'vue';
|
|
3
|
-
import {
|
|
3
|
+
import { h, ref } from 'vue';
|
|
4
4
|
import {
|
|
5
5
|
PlBlockPage,
|
|
6
6
|
PlAgDataTableToolsPanel,
|
|
7
7
|
PlAgGridColumnManager,
|
|
8
|
-
makeRowNumberColDef,
|
|
9
|
-
PlAgCellFile,
|
|
10
|
-
PlAgTextAndButtonCell,
|
|
11
|
-
PlAgColumnHeader,
|
|
12
|
-
type PlAgHeaderComponentParams,
|
|
13
8
|
PlAgCsvExporter,
|
|
14
|
-
PlAgCellProgress,
|
|
15
9
|
defaultMainMenuItems,
|
|
16
10
|
PlAgChartStackedBarCell,
|
|
17
11
|
PlAgChartHistogramCell,
|
|
18
12
|
PlCheckbox,
|
|
19
13
|
PlRow,
|
|
20
|
-
|
|
14
|
+
useAgGridOptions,
|
|
21
15
|
makeEaseOut,
|
|
22
16
|
animate,
|
|
23
17
|
PlBtnPrimary,
|
|
24
|
-
createAgGridColDef,
|
|
25
18
|
} from '@platforma-sdk/ui-vue';
|
|
26
19
|
import { AgGridVue } from 'ag-grid-vue3';
|
|
27
|
-
import type { ColDef } from 'ag-grid-enterprise';
|
|
28
20
|
import { times } from '@milaboratories/helpers';
|
|
29
21
|
import { faker } from '@faker-js/faker';
|
|
30
22
|
import { stackedSettings } from './stackedSettings';
|
|
@@ -79,190 +71,161 @@ const BlankComponent: Component = {
|
|
|
79
71
|
},
|
|
80
72
|
};
|
|
81
73
|
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
cellRenderer: 'PlAgTextAndButtonCell',
|
|
101
|
-
headerComponent: PlAgColumnHeader,
|
|
102
|
-
headerComponentParams: { type: 'Text' } satisfies PlAgHeaderComponentParams,
|
|
103
|
-
cellRendererParams: {
|
|
104
|
-
onClick: onClickHandler,
|
|
105
|
-
invokeRowsOnDoubleClick: true,
|
|
74
|
+
const isOverlayTransparent = ref(false);
|
|
75
|
+
|
|
76
|
+
const rowNumbers = ref(true);
|
|
77
|
+
|
|
78
|
+
const loading = ref(false);
|
|
79
|
+
|
|
80
|
+
const notReady = ref(true);
|
|
81
|
+
|
|
82
|
+
const hasRows = ref(true);
|
|
83
|
+
|
|
84
|
+
const { gridOptions, gridApi } = useAgGridOptions<Row>(({ column }) => {
|
|
85
|
+
return {
|
|
86
|
+
columnDefs: [
|
|
87
|
+
{
|
|
88
|
+
field: 'id',
|
|
89
|
+
headerName: 'ID',
|
|
90
|
+
mainMenuItems: defaultMainMenuItems,
|
|
91
|
+
headerComponentParams: { type: 'Number' },
|
|
106
92
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
93
|
+
{
|
|
94
|
+
field: 'label',
|
|
95
|
+
pinned: 'left',
|
|
96
|
+
lockPinned: true,
|
|
97
|
+
lockPosition: true,
|
|
98
|
+
headerName: 'Sample label long text for overflow label long text for overflow',
|
|
99
|
+
headerComponentParams: { type: 'Text' },
|
|
100
|
+
textWithButton: true,
|
|
101
|
+
},
|
|
102
|
+
column<number | undefined>({
|
|
103
|
+
field: 'progress',
|
|
104
|
+
headerName: 'Progress',
|
|
105
|
+
progress(value, cellData) {
|
|
106
|
+
const percent = value as number ?? 0;
|
|
107
|
+
|
|
108
|
+
if (cellData.data?.id === 2) {
|
|
109
|
+
return {
|
|
110
|
+
status: 'not_started',
|
|
111
|
+
error: 'Test Error',
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (cellData.data?.id === 3) {
|
|
116
|
+
return {
|
|
117
|
+
status: 'running',
|
|
118
|
+
text: 'Infinite progress',
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
if (percent < 10) {
|
|
123
|
+
return {
|
|
124
|
+
status: 'not_started',
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (percent >= 100) {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (percent > 90) {
|
|
133
|
+
return {
|
|
134
|
+
status: 'done',
|
|
135
|
+
};
|
|
136
|
+
}
|
|
114
137
|
|
|
115
|
-
if (cellData.data?.id === 2) {
|
|
116
138
|
return {
|
|
117
|
-
status: '
|
|
118
|
-
|
|
139
|
+
status: 'running',
|
|
140
|
+
percent,
|
|
141
|
+
text: `Progress`,
|
|
142
|
+
suffix: `${percent.toFixed(1)}%`,
|
|
119
143
|
};
|
|
120
|
-
}
|
|
144
|
+
},
|
|
145
|
+
cellRendererSelector: (cellData) => {
|
|
146
|
+
return {
|
|
147
|
+
component: BlankComponent,
|
|
148
|
+
params: { value: cellData.value },
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
headerComponentParams: { type: 'Text' },
|
|
152
|
+
}), // But you could use builder
|
|
153
|
+
{
|
|
154
|
+
field: 'stacked_bar',
|
|
155
|
+
headerName: 'StackedBar',
|
|
156
|
+
progress: (value) => {
|
|
157
|
+
if (value) {
|
|
158
|
+
return undefined; // If no progress show main component
|
|
159
|
+
}
|
|
121
160
|
|
|
122
|
-
if (cellData.data?.id === 3) {
|
|
123
161
|
return {
|
|
124
162
|
status: 'running',
|
|
125
|
-
text: '
|
|
163
|
+
text: 'Loading data...',
|
|
126
164
|
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (percent < 10) {
|
|
165
|
+
},
|
|
166
|
+
cellRendererSelector: (cellData) => {
|
|
130
167
|
return {
|
|
131
|
-
|
|
168
|
+
component: PlAgChartStackedBarCell,
|
|
169
|
+
params: { value: cellData.value },
|
|
132
170
|
};
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
colId: 'histogram',
|
|
175
|
+
headerName: 'Histogram',
|
|
176
|
+
cellRendererSelector: (cellData) => {
|
|
177
|
+
const value = (cellData.data?.id ?? 0 % 2 === 0)
|
|
178
|
+
? histogramSettings.value
|
|
179
|
+
: undefined;
|
|
140
180
|
return {
|
|
141
|
-
|
|
181
|
+
component: PlAgChartHistogramCell,
|
|
182
|
+
params: { value },
|
|
142
183
|
};
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return {
|
|
146
|
-
status: 'running',
|
|
147
|
-
percent,
|
|
148
|
-
text: `Progress`,
|
|
149
|
-
suffix: `${percent.toFixed(1)}%`,
|
|
150
|
-
};
|
|
184
|
+
},
|
|
151
185
|
},
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
};
|
|
186
|
+
{
|
|
187
|
+
field: 'date',
|
|
188
|
+
headerName: 'Date',
|
|
189
|
+
headerComponentParams: { type: 'Date' },
|
|
157
190
|
},
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
headerName: 'StackedBar',
|
|
165
|
-
progress: (cellData) => {
|
|
166
|
-
if (cellData.value) {
|
|
167
|
-
return undefined;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
return {
|
|
171
|
-
status: 'running',
|
|
172
|
-
text: 'Loading data...',
|
|
173
|
-
};
|
|
191
|
+
{
|
|
192
|
+
field: 'file',
|
|
193
|
+
headerName: 'File input',
|
|
194
|
+
cellRenderer: 'PlAgCellFile',
|
|
195
|
+
headerComponentParams: { type: 'File' },
|
|
196
|
+
cellStyle: { padding: 0 },
|
|
174
197
|
},
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
};
|
|
198
|
+
{
|
|
199
|
+
field: 'link',
|
|
200
|
+
headerName: 'Link',
|
|
201
|
+
headerComponentParams: { type: 'Text' },
|
|
202
|
+
cellRenderer: 'LinkComponent',
|
|
181
203
|
},
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
const value = (cellData.data?.id ?? 0 % 2 === 0)
|
|
188
|
-
? histogramSettings.value
|
|
189
|
-
: undefined;
|
|
190
|
-
return {
|
|
191
|
-
component: PlAgChartHistogramCell,
|
|
192
|
-
params: { value },
|
|
193
|
-
};
|
|
204
|
+
{
|
|
205
|
+
colId: 'time',
|
|
206
|
+
field: 'time',
|
|
207
|
+
headerName: 'Duration',
|
|
208
|
+
headerComponentParams: { type: 'Duration' },
|
|
194
209
|
},
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
field: 'date',
|
|
199
|
-
headerName: 'Date',
|
|
200
|
-
headerComponent: PlAgColumnHeader,
|
|
201
|
-
headerComponentParams: { type: 'Date' } satisfies PlAgHeaderComponentParams,
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
colId: 'file',
|
|
205
|
-
field: 'file',
|
|
206
|
-
headerName: 'File input',
|
|
207
|
-
cellRenderer: 'PlAgCellFile',
|
|
208
|
-
|
|
209
|
-
headerComponent: PlAgColumnHeader,
|
|
210
|
-
headerComponentParams: { type: 'File' } satisfies PlAgHeaderComponentParams,
|
|
211
|
-
cellStyle: { padding: 0 },
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
colId: 'link',
|
|
215
|
-
field: 'link',
|
|
216
|
-
headerName: 'Link',
|
|
217
|
-
headerComponent: PlAgColumnHeader,
|
|
218
|
-
headerComponentParams: { type: 'Text' } satisfies PlAgHeaderComponentParams,
|
|
219
|
-
cellRenderer: 'LinkComponent',
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
colId: 'time',
|
|
223
|
-
field: 'time',
|
|
224
|
-
headerName: 'Duration',
|
|
225
|
-
headerComponent: PlAgColumnHeader,
|
|
226
|
-
headerComponentParams: { type: 'Duration' } satisfies PlAgHeaderComponentParams,
|
|
227
|
-
},
|
|
228
|
-
];
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
function onClickHandler() {
|
|
232
|
-
// will be invoked when invokeRowsOnDoubleClick: false
|
|
233
|
-
console.log('onClickHandler');
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
const isOverlayTransparent = ref(false);
|
|
237
|
-
|
|
238
|
-
const loading = ref(false);
|
|
239
|
-
|
|
240
|
-
const notReady = ref(false);
|
|
241
|
-
|
|
242
|
-
const hasRows = ref(true);
|
|
243
|
-
|
|
244
|
-
const { gridOptions, gridApi } = useAgGridOptionsSimple<Row>(() => {
|
|
245
|
-
return {
|
|
246
|
-
columnDefs: columnDefs.value,
|
|
210
|
+
],
|
|
211
|
+
rowNumbersColumn: rowNumbers.value,
|
|
212
|
+
// @TODO (Now rowNumbersColumn && rowSelection enables rows selection with checkboxes)
|
|
247
213
|
rowSelection: {
|
|
248
|
-
mode: 'multiRow'
|
|
214
|
+
mode: 'multiRow',
|
|
249
215
|
checkboxes: false,
|
|
250
216
|
headerCheckbox: false,
|
|
251
217
|
},
|
|
252
218
|
loading: loading.value,
|
|
219
|
+
loadingOverlayType: isOverlayTransparent.value ? 'transparent' : undefined,
|
|
220
|
+
notReady: notReady.value,
|
|
221
|
+
notReadyText: 'I am not ready(',
|
|
222
|
+
// noRowsText: 'No rows(',
|
|
253
223
|
rowData: hasRows.value ? result.value : [],
|
|
254
|
-
onRowDoubleClicked: (
|
|
255
|
-
|
|
256
|
-
},
|
|
257
|
-
loadingOverlayComponentParams: {
|
|
258
|
-
notReady: notReady.value,
|
|
259
|
-
overlayType: isOverlayTransparent.value ? 'transparent' : undefined,
|
|
224
|
+
onRowDoubleClicked: (_e) => {
|
|
225
|
+
alert('Example "Open" button was clicked');
|
|
260
226
|
},
|
|
261
227
|
components: {
|
|
262
|
-
PlAgCellProgress,
|
|
263
228
|
LinkComponent,
|
|
264
|
-
PlAgCellFile,
|
|
265
|
-
PlAgTextAndButtonCell,
|
|
266
229
|
},
|
|
267
230
|
};
|
|
268
231
|
});
|
|
@@ -272,20 +235,20 @@ const { gridOptions, gridApi } = useAgGridOptionsSimple<Row>(() => {
|
|
|
272
235
|
<PlBlockPage style="max-width: 100%">
|
|
273
236
|
<template #title>AgGridVue</template>
|
|
274
237
|
<template #append>
|
|
275
|
-
<
|
|
276
|
-
<PlCheckbox v-model="isOverlayTransparent">Use transparent overlay</PlCheckbox>
|
|
277
|
-
<PlCheckbox v-model="loading">Loading</PlCheckbox>
|
|
278
|
-
<PlCheckbox v-model="notReady">Not Ready</PlCheckbox>
|
|
279
|
-
<PlCheckbox v-model="hasRows">Has rows</PlCheckbox>
|
|
280
|
-
<PlBtnPrimary @click="showProgress">Show progress</PlBtnPrimary>
|
|
281
|
-
</PlRow>
|
|
238
|
+
<PlBtnPrimary @click="showProgress">Show progress</PlBtnPrimary>
|
|
282
239
|
<PlAgDataTableToolsPanel>
|
|
283
240
|
<PlAgGridColumnManager v-if="gridApi" :api="gridApi" />
|
|
284
241
|
<PlAgCsvExporter v-if="gridApi" :api="gridApi" />
|
|
285
242
|
</PlAgDataTableToolsPanel>
|
|
286
243
|
</template>
|
|
287
244
|
|
|
288
|
-
<
|
|
245
|
+
<PlRow wrap>
|
|
246
|
+
<PlCheckbox v-model="rowNumbers">Show row numbers</PlCheckbox>
|
|
247
|
+
<PlCheckbox v-model="isOverlayTransparent">Use transparent overlay</PlCheckbox>
|
|
248
|
+
<PlCheckbox v-model="loading">Loading</PlCheckbox>
|
|
249
|
+
<PlCheckbox v-model="notReady">Not Ready</PlCheckbox>
|
|
250
|
+
<PlCheckbox v-model="hasRows">Has rows</PlCheckbox>
|
|
251
|
+
</PlRow>
|
|
289
252
|
|
|
290
253
|
<AgGridVue
|
|
291
254
|
:style="{ height: '100%' }"
|