@platforma-sdk/ui-vue 1.66.2 → 1.68.0
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 +25 -21
- package/.turbo/turbo-formatter$colon$check.log +2 -2
- package/.turbo/turbo-linter$colon$check.log +2 -2
- package/.turbo/turbo-types$colon$check.log +1 -1
- package/CHANGELOG.md +37 -0
- package/dist/__tests__/setup.d.ts +2 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/components/PlAgCsvExporter/PlAgCsvExporter.js.map +1 -1
- package/dist/components/PlAgCsvExporter/PlAgCsvExporter.vue.d.ts +2 -0
- package/dist/components/PlAgCsvExporter/PlAgCsvExporter.vue.d.ts.map +1 -1
- package/dist/components/PlAgCsvExporter/PlAgCsvExporter.vue2.js +25 -17
- package/dist/components/PlAgCsvExporter/PlAgCsvExporter.vue2.js.map +1 -1
- package/dist/components/PlAgCsvExporter/export-csv.d.ts +27 -1
- package/dist/components/PlAgCsvExporter/export-csv.d.ts.map +1 -1
- package/dist/components/PlAgCsvExporter/export-csv.js +31 -33
- package/dist/components/PlAgCsvExporter/export-csv.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.style.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js +68 -64
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js.map +1 -1
- package/dist/components/PlAgDataTable/compositions/useGrid.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/compositions/useGrid.js +1 -1
- package/dist/components/PlAgDataTable/compositions/useGrid.js.map +1 -1
- package/dist/components/PlAgDataTable/sources/table-source-v2.js +2 -2
- package/dist/components/PlAgDataTable/sources/table-source-v2.js.map +1 -1
- package/dist/components/PlDatasetSelector/PlDatasetSelector.js +9 -0
- package/dist/components/PlDatasetSelector/PlDatasetSelector.js.map +1 -0
- package/dist/components/PlDatasetSelector/PlDatasetSelector.style.css +1 -0
- package/dist/components/PlDatasetSelector/PlDatasetSelector.vue.d.ts +105 -0
- package/dist/components/PlDatasetSelector/PlDatasetSelector.vue.d.ts.map +1 -0
- package/dist/components/PlDatasetSelector/PlDatasetSelector.vue2.js +111 -0
- package/dist/components/PlDatasetSelector/PlDatasetSelector.vue2.js.map +1 -0
- package/dist/components/PlDatasetSelector/__tests__/PlDatasetSelector.jsdomtest.d.ts +2 -0
- package/dist/components/PlDatasetSelector/__tests__/PlDatasetSelector.jsdomtest.d.ts.map +1 -0
- package/dist/components/PlDatasetSelector/index.d.ts +2 -0
- package/dist/components/PlDatasetSelector/index.d.ts.map +1 -0
- package/dist/components/PlDatasetSelector/index.js +1 -0
- package/dist/composition/usePlugin.d.ts.map +1 -0
- package/dist/{usePlugin.js → composition/usePlugin.js} +2 -2
- package/dist/composition/usePlugin.js.map +1 -0
- package/dist/composition/useServices.d.ts +2 -0
- package/dist/composition/useServices.d.ts.map +1 -0
- package/dist/index.js +15 -14
- package/dist/index.js.map +1 -1
- package/dist/internal/createAppV3.d.ts +2 -3
- package/dist/internal/createAppV3.d.ts.map +1 -1
- package/dist/internal/createAppV3.js +1 -1
- package/dist/internal/createAppV3.js.map +1 -1
- package/dist/internal/service_factories.d.ts +1 -0
- package/dist/internal/service_factories.d.ts.map +1 -1
- package/dist/internal/service_factories.js +2 -1
- package/dist/internal/service_factories.js.map +1 -1
- package/dist/lib.d.ts +3 -2
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +3 -1
- package/package.json +9 -7
- package/src/__tests__/setup.ts +10 -0
- package/src/components/PlAgCsvExporter/PlAgCsvExporter.vue +16 -3
- package/src/components/PlAgCsvExporter/export-csv.ts +101 -64
- package/src/components/PlAgDataTable/PlAgDataTableV2.vue +6 -1
- package/src/components/PlAgDataTable/compositions/useGrid.ts +4 -1
- package/src/components/PlAgDataTable/sources/table-source-v2.ts +2 -2
- package/src/components/PlDatasetSelector/PlDatasetSelector.vue +164 -0
- package/src/components/PlDatasetSelector/__tests__/PlDatasetSelector.jsdomtest.ts +257 -0
- package/src/components/PlDatasetSelector/index.ts +1 -0
- package/src/{usePlugin.ts → composition/usePlugin.ts} +1 -1
- package/src/composition/useServices.ts +5 -0
- package/src/internal/createAppV3.ts +4 -4
- package/src/internal/service_factories.ts +1 -0
- package/src/lib.ts +4 -2
- package/vitest.config.mts +22 -0
- package/dist/usePlugin.d.ts.map +0 -1
- package/dist/usePlugin.js.map +0 -1
- /package/dist/{usePlugin.d.ts → composition/usePlugin.d.ts} +0 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @platforma-sdk/ui-vue@1.
|
|
3
|
+
> @platforma-sdk/ui-vue@1.68.0 build /home/runner/_work/platforma/platforma/sdk/ui-vue
|
|
4
4
|
> ts-builder build --target browser-lib
|
|
5
5
|
|
|
6
6
|
Building browser-lib project...
|
|
@@ -12,11 +12,11 @@ Building browser-lib project...
|
|
|
12
12
|
[7m4[0m export function useGridColumns(props: { api: GridApi }) {
|
|
13
13
|
[7m [0m [91m ~~~~~~~~~~~~~~[0m
|
|
14
14
|
|
|
15
|
-
[2K
|
|
15
|
+
[2K
|
|
16
16
|
rendering chunks...
|
|
17
17
|
|
|
18
18
|
[vite:dts] Start generate declaration files...
|
|
19
|
-
[vite:dts] Declaration files built in
|
|
19
|
+
[vite:dts] Declaration files built in 4637ms.
|
|
20
20
|
|
|
21
21
|
computing gzip size...
|
|
22
22
|
dist/components/PlAnnotations/components/PlAnnotations.vue?vue&type=style&index=0&lang.css 0.04 kB │ gzip: 0.06 kB
|
|
@@ -25,6 +25,7 @@ dist/components/BlockLayout.vue?vue&type=style&index=0&lang.css
|
|
|
25
25
|
dist/components/PlAgDataTable/PlAgDataTableSheets.vue?vue&type=style&index=0&lang.css 0.06 kB │ gzip: 0.08 kB
|
|
26
26
|
dist/components/PlAnnotations/components/PlAnnotationsModal.vue?vue&type=style&index=0&lang.css 0.07 kB │ gzip: 0.08 kB
|
|
27
27
|
dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue?vue&type=style&index=0&lang.css 0.07 kB │ gzip: 0.09 kB
|
|
28
|
+
dist/components/PlDatasetSelector/PlDatasetSelector.vue_vue_type_style_index_0_scoped_b52c3499_lang.css 0.08 kB │ gzip: 0.09 kB
|
|
28
29
|
dist/components/PlAgDataTable/PlAgDataTableV2.vue?vue&type=style&index=0&lang.css 0.09 kB │ gzip: 0.10 kB
|
|
29
30
|
dist/components/PlAnnotations/components/FilterSidebar.vue?vue&type=style&index=0&lang.css 0.11 kB │ gzip: 0.09 kB
|
|
30
31
|
dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.vue_vue_type_style_index_0_lang.css 0.16 kB │ gzip: 0.13 kB
|
|
@@ -57,6 +58,7 @@ dist/components/PlAgCellProgress/index.js
|
|
|
57
58
|
dist/components/PlAgColumnHeader/index.js 0.03 kB │ gzip: 0.05 kB
|
|
58
59
|
dist/components/PlTableFilters/index.js 0.03 kB │ gzip: 0.05 kB
|
|
59
60
|
dist/components/PlAgCellStatusTag/index.js 0.03 kB │ gzip: 0.05 kB
|
|
61
|
+
dist/components/PlDatasetSelector/index.js 0.03 kB │ gzip: 0.05 kB
|
|
60
62
|
dist/components/PlTableFastSearch/index.js 0.03 kB │ gzip: 0.05 kB
|
|
61
63
|
dist/components/PlAgRowNumCheckbox/index.js 0.03 kB │ gzip: 0.05 kB
|
|
62
64
|
dist/components/PlBtnExportArchive/index.js 0.03 kB │ gzip: 0.05 kB
|
|
@@ -82,7 +84,7 @@ dist/components/PlAgRowNumHeader.js
|
|
|
82
84
|
dist/components/PlAgCellFile/PlAgCellFile.js 0.21 kB │ gzip: 0.16 kB │ map: 2.49 kB
|
|
83
85
|
dist/components/PlAgDataTable/PlAgRowCount.js 0.21 kB │ gzip: 0.17 kB │ map: 1.72 kB
|
|
84
86
|
dist/plugins/Monetization/EndOfPeriod.vue_vue_type_style_index_0_lang.module.js 0.22 kB │ gzip: 0.18 kB │ map: 0.42 kB
|
|
85
|
-
dist/components/PlAgCsvExporter/PlAgCsvExporter.js 0.22 kB │ gzip: 0.16 kB │ map: 1.
|
|
87
|
+
dist/components/PlAgCsvExporter/PlAgCsvExporter.js 0.22 kB │ gzip: 0.16 kB │ map: 1.51 kB
|
|
86
88
|
dist/components/PlAnnotations/components/PlAnnotations.vue_vue_type_style_index_0_lang.module.js 0.22 kB │ gzip: 0.18 kB │ map: 0.42 kB
|
|
87
89
|
dist/components/PlAgCellProgress/PlAgCellProgress.js 0.23 kB │ gzip: 0.16 kB │ map: 0.55 kB
|
|
88
90
|
dist/components/PlAgColumnHeader/PlAgColumnHeader.js 0.23 kB │ gzip: 0.17 kB │ map: 3.22 kB
|
|
@@ -119,7 +121,7 @@ dist/components/PlAdvancedFilter/FilterEditor.js
|
|
|
119
121
|
dist/components/PlAdvancedFilter/OperandButton.js 0.35 kB │ gzip: 0.24 kB │ map: 1.31 kB
|
|
120
122
|
dist/components/PlAnnotations/components/FilterSidebar.js 0.35 kB │ gzip: 0.24 kB │ map: 5.40 kB
|
|
121
123
|
dist/components/PlAnnotations/components/PlAnnotations.js 0.35 kB │ gzip: 0.24 kB │ map: 3.11 kB
|
|
122
|
-
dist/components/PlAgDataTable/PlAgDataTableV2.js 0.35 kB │ gzip: 0.25 kB │ map: 21.
|
|
124
|
+
dist/components/PlAgDataTable/PlAgDataTableV2.js 0.35 kB │ gzip: 0.25 kB │ map: 21.77 kB
|
|
123
125
|
dist/plugins/Monetization/UserCabinetCard.js 0.35 kB │ gzip: 0.24 kB │ map: 3.00 kB
|
|
124
126
|
dist/components/PlAdvancedFilter/PlAdvancedFilter.js 0.36 kB │ gzip: 0.24 kB │ map: 13.36 kB
|
|
125
127
|
dist/components/PlAgDataTable/PlAgOverlayNoRows.js 0.36 kB │ gzip: 0.21 kB │ map: 0.74 kB
|
|
@@ -132,18 +134,19 @@ dist/components/PlAnnotations/components/PlAnnotationsModal.js
|
|
|
132
134
|
dist/components/PlAgGridColumnManager/PlAgGridColumnManager.js 0.37 kB │ gzip: 0.25 kB │ map: 3.46 kB
|
|
133
135
|
dist/lib/util/helpers/dist/strings.js 0.39 kB │ gzip: 0.27 kB │ map: 4.11 kB
|
|
134
136
|
dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.js 0.39 kB │ gzip: 0.21 kB │ map: 0.77 kB
|
|
135
|
-
dist/usePlugin.js 0.40 kB │ gzip: 0.28 kB │ map: 2.74 kB
|
|
136
137
|
dist/components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.js 0.40 kB │ gzip: 0.21 kB │ map: 0.77 kB
|
|
137
|
-
dist/internal/service_factories.js 0.40 kB │ gzip: 0.26 kB │ map: 1.06 kB
|
|
138
138
|
dist/components/PlAnnotations/components/AnnotationsSidebar.vue_vue_type_style_index_0_lang.module.js 0.40 kB │ gzip: 0.25 kB │ map: 0.63 kB
|
|
139
|
+
dist/composition/usePlugin.js 0.41 kB │ gzip: 0.29 kB │ map: 2.76 kB
|
|
139
140
|
dist/computedResult.js 0.41 kB │ gzip: 0.27 kB │ map: 2.29 kB
|
|
140
141
|
dist/components/PlAgDataTable/index.js 0.41 kB │ gzip: 0.22 kB │ map: 0.60 kB
|
|
141
142
|
dist/plugins/Monetization/UserCabinetCard.vue_vue_type_style_index_0_lang.module.js 0.42 kB │ gzip: 0.27 kB │ map: 0.67 kB
|
|
142
143
|
dist/plugins/Monetization/RunStatus.vue_vue_type_style_index_0_lang.module.js 0.43 kB │ gzip: 0.27 kB │ map: 0.76 kB
|
|
144
|
+
dist/internal/service_factories.js 0.43 kB │ gzip: 0.26 kB │ map: 1.14 kB
|
|
143
145
|
dist/objectHash.js 0.45 kB │ gzip: 0.33 kB │ map: 1.14 kB
|
|
144
146
|
dist/composition/AgGrid/index.js 0.46 kB │ gzip: 0.32 kB │ map: 0.79 kB
|
|
145
147
|
dist/defineStore.js 0.49 kB │ gzip: 0.32 kB │ map: 1.20 kB
|
|
146
148
|
dist/internal/utils.js 0.50 kB │ gzip: 0.29 kB │ map: 1.08 kB
|
|
149
|
+
dist/components/PlDatasetSelector/PlDatasetSelector.js 0.51 kB │ gzip: 0.29 kB │ map: 1.10 kB
|
|
147
150
|
dist/components/LoaderPage.js 0.52 kB │ gzip: 0.35 kB │ map: 0.48 kB
|
|
148
151
|
dist/components/PlAdvancedFilter/PlAdvancedFilter.vue_vue_type_style_index_0_lang.module.js 0.54 kB │ gzip: 0.29 kB │ map: 0.72 kB
|
|
149
152
|
dist/plugins/Monetization/useButtonTarget.js 0.54 kB │ gzip: 0.35 kB │ map: 1.10 kB
|
|
@@ -167,7 +170,6 @@ dist/components/PlAgDataTable/sources/focus-row.js
|
|
|
167
170
|
dist/plugins/Monetization/validation.js 0.99 kB │ gzip: 0.49 kB │ map: 2.58 kB
|
|
168
171
|
dist/AgGridVue/selection.js 1.00 kB │ gzip: 0.42 kB │ map: 3.18 kB
|
|
169
172
|
dist/components/PlAgDataTable/sources/value-rendering.js 1.06 kB │ gzip: 0.52 kB │ map: 2.99 kB
|
|
170
|
-
dist/components/PlAgCsvExporter/PlAgCsvExporter.vue_vue_type_script_setup_true_lang.js 1.08 kB │ gzip: 0.63 kB │ map: 1.41 kB
|
|
171
173
|
dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.vue_vue_type_script_setup_true_lang.js 1.10 kB │ gzip: 0.61 kB │ map: 1.88 kB
|
|
172
174
|
dist/components/PlAgCellFile/PlAgCellFile.vue_vue_type_script_setup_true_lang.js 1.14 kB │ gzip: 0.64 kB │ map: 2.93 kB
|
|
173
175
|
dist/plugins/Monetization/RunStatus.vue_vue_type_script_setup_true_lang.js 1.16 kB │ gzip: 0.62 kB │ map: 3.04 kB
|
|
@@ -177,6 +179,7 @@ dist/createModel.js
|
|
|
177
179
|
dist/utils.js 1.26 kB │ gzip: 0.62 kB │ map: 3.40 kB
|
|
178
180
|
dist/lib/util/helpers/dist/prettyBytes.js 1.29 kB │ gzip: 0.67 kB │ map: 3.79 kB
|
|
179
181
|
dist/AgGridVue/AgGridTheme.js 1.30 kB │ gzip: 0.59 kB │ map: 2.07 kB
|
|
182
|
+
dist/components/PlAgCsvExporter/PlAgCsvExporter.vue_vue_type_script_setup_true_lang.js 1.31 kB │ gzip: 0.74 kB │ map: 2.08 kB
|
|
180
183
|
dist/components/PlBtnExportArchive/Summary.vue_vue_type_script_setup_true_lang.js 1.31 kB │ gzip: 0.65 kB │ map: 2.35 kB
|
|
181
184
|
dist/components/PlAgDataTable/PlAgRowCount.vue_vue_type_script_setup_true_lang.js 1.32 kB │ gzip: 0.62 kB │ map: 2.50 kB
|
|
182
185
|
dist/internal/UpdateSerializer.js 1.33 kB │ gzip: 0.61 kB │ map: 4.28 kB
|
|
@@ -185,7 +188,7 @@ dist/components/PlAgDataTable/types.js
|
|
|
185
188
|
dist/components/PlBtnExportArchive/Item.vue_vue_type_script_setup_true_lang.js 1.36 kB │ gzip: 0.63 kB │ map: 2.58 kB
|
|
186
189
|
dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue_vue_type_script_setup_true_lang.js 1.46 kB │ gzip: 0.77 kB │ map: 3.56 kB
|
|
187
190
|
dist/internal/createAppModel.js 1.48 kB │ gzip: 0.75 kB │ map: 3.89 kB
|
|
188
|
-
dist/components/PlAgCsvExporter/export-csv.js 1.51 kB │ gzip: 0.
|
|
191
|
+
dist/components/PlAgCsvExporter/export-csv.js 1.51 kB │ gzip: 0.78 kB │ map: 4.87 kB
|
|
189
192
|
dist/plugins/Monetization/useInfo.js 1.51 kB │ gzip: 0.77 kB │ map: 3.85 kB
|
|
190
193
|
dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue_vue_type_script_setup_true_lang.js 1.67 kB │ gzip: 0.84 kB │ map: 2.62 kB
|
|
191
194
|
dist/components/PlAnnotations/components/PlAnnotationsModal.vue_vue_type_script_setup_true_lang.js 1.75 kB │ gzip: 0.75 kB │ map: 1.78 kB
|
|
@@ -198,12 +201,13 @@ dist/plugins/Monetization/UserCabinetCard.vue_vue_type_script_setup_true_lang.js
|
|
|
198
201
|
dist/components/BlockLayout.vue_vue_type_script_setup_true_lang.js 2.18 kB │ gzip: 1.03 kB │ map: 5.92 kB
|
|
199
202
|
dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.vue_vue_type_script_setup_true_lang.js 2.40 kB │ gzip: 1.12 kB │ map: 6.67 kB
|
|
200
203
|
dist/components/PlAgDataTable/PlAgDataTableSheets.vue_vue_type_script_setup_true_lang.js 2.45 kB │ gzip: 1.17 kB │ map: 5.01 kB
|
|
201
|
-
dist/lib.js 2.60 kB │ gzip: 0.56 kB │ map: 3.82 kB
|
|
202
204
|
dist/components/PlAnnotations/components/PlAnnotations.vue_vue_type_script_setup_true_lang.js 2.69 kB │ gzip: 1.12 kB │ map: 4.16 kB
|
|
203
|
-
dist/
|
|
205
|
+
dist/lib.js 2.73 kB │ gzip: 0.57 kB │ map: 3.98 kB
|
|
206
|
+
dist/components/PlAgDataTable/compositions/useGrid.js 2.91 kB │ gzip: 1.29 kB │ map: 6.51 kB
|
|
204
207
|
dist/components/PlAgColumnHeader/PlAgColumnHeader.vue_vue_type_script_setup_true_lang.js 2.93 kB │ gzip: 1.26 kB │ map: 7.97 kB
|
|
205
208
|
dist/components/PlAgDataTable/sources/row-number.js 2.99 kB │ gzip: 1.31 kB │ map: 7.42 kB
|
|
206
209
|
dist/defineApp.js 3.01 kB │ gzip: 1.05 kB │ map: 14.38 kB
|
|
210
|
+
dist/components/PlDatasetSelector/PlDatasetSelector.vue_vue_type_script_setup_true_lang.js 3.09 kB │ gzip: 1.21 kB │ map: 6.90 kB
|
|
207
211
|
dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue_vue_type_script_setup_true_lang.js 3.14 kB │ gzip: 1.42 kB │ map: 5.04 kB
|
|
208
212
|
dist/plugins/Monetization/LimitCard.vue_vue_type_script_setup_true_lang.js 3.31 kB │ gzip: 1.15 kB │ map: 9.08 kB
|
|
209
213
|
dist/composition/fileContent.js 3.78 kB │ gzip: 1.45 kB │ map: 12.95 kB
|
|
@@ -212,24 +216,24 @@ dist/plugins/Monetization/MonetizationSidebar.vue_vue_type_script_setup_true_lan
|
|
|
212
216
|
dist/components/PlAnnotations/components/FilterSidebar.vue_vue_type_script_setup_true_lang.js 3.97 kB │ gzip: 1.56 kB │ map: 7.42 kB
|
|
213
217
|
dist/internal/createAppV1.js 4.01 kB │ gzip: 1.42 kB │ map: 14.21 kB
|
|
214
218
|
dist/AgGridVue/useAgGridOptions.js 4.23 kB │ gzip: 1.33 kB │ map: 14.12 kB
|
|
215
|
-
dist/index.js 4.
|
|
219
|
+
dist/index.js 4.53 kB │ gzip: 1.38 kB │ map: 0.25 kB
|
|
216
220
|
dist/components/PlTableFilters/PlTableFiltersV2.vue_vue_type_script_setup_true_lang.js 4.63 kB │ gzip: 1.91 kB │ map: 9.02 kB
|
|
217
221
|
dist/components/PlBtnExportArchive/PlBtnExportArchive.vue_vue_type_script_setup_true_lang.js 5.19 kB │ gzip: 2.16 kB │ map: 10.36 kB
|
|
218
222
|
dist/internal/createAppV2.js 5.26 kB │ gzip: 1.98 kB │ map: 17.78 kB
|
|
219
223
|
dist/components/PlAgDataTable/sources/table-state-v2.js 5.73 kB │ gzip: 1.85 kB │ map: 19.41 kB
|
|
220
|
-
dist/internal/createAppV3.js 5.
|
|
221
|
-
dist/components/PlAgDataTable/sources/table-source-v2.js 6.
|
|
224
|
+
dist/internal/createAppV3.js 5.77 kB │ gzip: 2.21 kB │ map: 20.16 kB
|
|
225
|
+
dist/components/PlAgDataTable/sources/table-source-v2.js 6.94 kB │ gzip: 2.69 kB │ map: 23.99 kB
|
|
222
226
|
dist/components/PlAdvancedFilter/PlAdvancedFilter.vue_vue_type_script_setup_true_lang.js 8.54 kB │ gzip: 2.59 kB │ map: 18.44 kB
|
|
223
227
|
dist/components/PlAdvancedFilter/FilterEditor.vue_vue_type_script_setup_true_lang.js 10.24 kB │ gzip: 3.04 kB │ map: 23.20 kB
|
|
224
|
-
dist/components/PlAgDataTable/PlAgDataTableV2.vue_vue_type_script_setup_true_lang.js 12.
|
|
228
|
+
dist/components/PlAgDataTable/PlAgDataTableV2.vue_vue_type_script_setup_true_lang.js 12.31 kB │ gzip: 3.89 kB │ map: 29.22 kB
|
|
225
229
|
|
|
226
230
|
[33m[33m[PLUGIN_TIMINGS] Warning:[0m Your build spent significant time in plugins. Here is a breakdown:
|
|
227
|
-
- sourcemaps (
|
|
228
|
-
- vite:dts (
|
|
229
|
-
- vite:
|
|
230
|
-
- vite:
|
|
231
|
-
- vite:
|
|
231
|
+
- sourcemaps (39%)
|
|
232
|
+
- vite:dts (24%)
|
|
233
|
+
- vite:vue (11%)
|
|
234
|
+
- vite:css-post (10%)
|
|
235
|
+
- vite:css (7%)
|
|
232
236
|
See https://rolldown.rs/options/checks#plugintimings for more details.
|
|
233
237
|
[39m
|
|
234
|
-
[32m✓ built in 5.
|
|
238
|
+
[32m✓ built in 5.48s[39m
|
|
235
239
|
Build completed successfully
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @platforma-sdk/ui-vue@1.
|
|
3
|
+
> @platforma-sdk/ui-vue@1.68.0 formatter:check /home/runner/_work/platforma/platforma/sdk/ui-vue
|
|
4
4
|
> ts-builder formatter --check
|
|
5
5
|
|
|
6
6
|
Checking formatting...
|
|
@@ -8,5 +8,5 @@ Checking formatting...
|
|
|
8
8
|
Checking formatting...
|
|
9
9
|
|
|
10
10
|
All matched files use the correct format.
|
|
11
|
-
Finished in
|
|
11
|
+
Finished in 5259ms on 137 files using 8 threads.
|
|
12
12
|
Format check completed successfully
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @platforma-sdk/ui-vue@1.
|
|
3
|
+
> @platforma-sdk/ui-vue@1.68.0 linter:check /home/runner/_work/platforma/platforma/sdk/ui-vue
|
|
4
4
|
> ts-builder linter --check
|
|
5
5
|
|
|
6
6
|
Linting project...
|
|
7
7
|
↳ oxlint --config /home/runner/_work/platforma/platforma/sdk/ui-vue/.oxlintrc.json --deny-warnings
|
|
8
8
|
Found 0 warnings and 0 errors.
|
|
9
|
-
Finished in 33ms on
|
|
9
|
+
Finished in 33ms on 120 files with 98 rules using 8 threads.
|
|
10
10
|
Linting completed successfully
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @platforma-sdk/ui-vue@1.
|
|
3
|
+
> @platforma-sdk/ui-vue@1.68.0 types:check /home/runner/_work/platforma/platforma/sdk/ui-vue
|
|
4
4
|
> ts-builder type-check --target browser-lib
|
|
5
5
|
|
|
6
6
|
↳ vue-tsc.js --noEmit --project ./tsconfig.json --customConditions ,
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @platforma-sdk/ui-vue
|
|
2
2
|
|
|
3
|
+
## 1.68.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5420fea: Replace legacy `PFrameDriver.writePTableToFs?` with two modern services:
|
|
8
|
+
`Dialog.showSaveDialog` (new `main`-kind service for native save dialogs)
|
|
9
|
+
and `PFrame.writePTableToFs` (now a required method on the UI-facing
|
|
10
|
+
driver, accepting a caller-provided `path`). `exportCsv` in `ui-vue`
|
|
11
|
+
now opens the save dialog and invokes the write as two separate
|
|
12
|
+
service calls.
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 5420fea: Add native CSV/TSV export path in PlAgCsvExporter that delegates to downloadPTableCsv when available in desktop runtime, with automatic fallback to browser-based export
|
|
17
|
+
- Updated dependencies [5420fea]
|
|
18
|
+
- Updated dependencies [5420fea]
|
|
19
|
+
- Updated dependencies [5420fea]
|
|
20
|
+
- @milaboratories/pl-model-common@1.36.0
|
|
21
|
+
- @platforma-sdk/model@1.68.0
|
|
22
|
+
- @milaboratories/pf-spec-driver@1.3.4
|
|
23
|
+
- @milaboratories/uikit@2.12.10
|
|
24
|
+
|
|
25
|
+
## 1.67.0
|
|
26
|
+
|
|
27
|
+
### Minor Changes
|
|
28
|
+
|
|
29
|
+
- 10eec21: Add `PlDatasetSelector` component for dataset + optional filter selection. Emits `PrimaryRef`; filter dropdown appears only when the selected dataset has compatible filters (progressive disclosure). Accepts both `PrimaryRef` and plain `PlRef` as input for backward compatibility.
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- Updated dependencies [10eec21]
|
|
34
|
+
- Updated dependencies [10eec21]
|
|
35
|
+
- @platforma-sdk/model@1.67.0
|
|
36
|
+
- @milaboratories/pl-model-common@1.35.0
|
|
37
|
+
- @milaboratories/uikit@2.12.9
|
|
38
|
+
- @milaboratories/pf-spec-driver@1.3.3
|
|
39
|
+
|
|
3
40
|
## 1.66.2
|
|
4
41
|
|
|
5
42
|
### Patch Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../src/__tests__/setup.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgCsvExporter.js","names":[],"sources":["../../../src/components/PlAgCsvExporter/PlAgCsvExporter.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { GridApi } from \"ag-grid-enterprise\";\nimport { PlBtnGhost, usePlBlockPageTitleTeleportTarget } from \"@milaboratories/uikit\";\nimport { shallowRef, toRefs } from \"vue\";\nimport { exportCsv } from \"./export-csv\";\n\nconst props = defineProps<{\n api: GridApi;\n}>();\nconst { api: gridApi } = toRefs(props);\n\nconst exporting = shallowRef(false);\nconst initiateExport = () => {\n exporting.value = true;\n exportCsv(gridApi.value, () => (exporting.value = false));\n};\n\nconst teleportTarget = usePlBlockPageTitleTeleportTarget(\"PlAgCsvExporter\");\n</script>\n\n<template>\n <Teleport v-if=\"teleportTarget\" :to=\"teleportTarget\">\n <PlBtnGhost :loading=\"exporting\" icon=\"export\" @click.stop=\"initiateExport\">\n Export\n </PlBtnGhost>\n </Teleport>\n</template>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlAgCsvExporter.js","names":[],"sources":["../../../src/components/PlAgCsvExporter/PlAgCsvExporter.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { GridApi } from \"ag-grid-enterprise\";\nimport type { PTableHandle } from \"@platforma-sdk/model\";\nimport { PlBtnGhost, usePlBlockPageTitleTeleportTarget } from \"@milaboratories/uikit\";\nimport { shallowRef, toRefs } from \"vue\";\nimport { isNil } from \"es-toolkit\";\nimport { exportCsv, isCsvExportAvailable } from \"./export-csv\";\nimport type { ExportOptions } from \"./export-csv\";\n\nconst props = defineProps<{\n api: GridApi;\n tableHandle?: PTableHandle;\n}>();\nconst { api: gridApi } = toRefs(props);\nconst csvExportAvailable = isCsvExportAvailable();\n\nconst exporting = shallowRef(false);\nconst initiateExport = () => {\n const nativeOptions: ExportOptions | undefined = !isNil(props.tableHandle)\n ? { tableHandle: props.tableHandle, format: \"csv\" }\n : undefined;\n\n if (isNil(nativeOptions)) {\n return;\n }\n\n exporting.value = true;\n exportCsv(gridApi.value, nativeOptions).finally(() => (exporting.value = false));\n};\n\nconst teleportTarget = usePlBlockPageTitleTeleportTarget(\"PlAgCsvExporter\");\n</script>\n\n<template>\n <Teleport v-if=\"teleportTarget && csvExportAvailable\" :to=\"teleportTarget\">\n <PlBtnGhost :loading=\"exporting\" icon=\"export\" @click.stop=\"initiateExport\">\n Export\n </PlBtnGhost>\n </Teleport>\n</template>\n"],"mappings":""}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { GridApi } from 'ag-grid-enterprise';
|
|
2
|
+
import { PTableHandle } from '@platforma-sdk/model';
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
api: GridApi;
|
|
5
|
+
tableHandle?: PTableHandle;
|
|
4
6
|
};
|
|
5
7
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
6
8
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgCsvExporter.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlAgCsvExporter/PlAgCsvExporter.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlAgCsvExporter.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlAgCsvExporter/PlAgCsvExporter.vue"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAOzD,KAAK,WAAW,GAAG;IACjB,GAAG,EAAE,OAAO,CAAC;IACb,WAAW,CAAC,EAAE,YAAY,CAAC;CAC5B,CAAC;;AA4FF,wBAMG"}
|
|
@@ -1,28 +1,36 @@
|
|
|
1
|
-
import { exportCsv as e } from "./export-csv.js";
|
|
2
|
-
import { Teleport as
|
|
3
|
-
import {
|
|
1
|
+
import { exportCsv as e, isCsvExportAvailable as t } from "./export-csv.js";
|
|
2
|
+
import { Teleport as n, createBlock as r, createCommentVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, openBlock as c, shallowRef as l, toRefs as u, unref as d, withCtx as f, withModifiers as p } from "vue";
|
|
3
|
+
import { isNil as m } from "es-toolkit";
|
|
4
|
+
import { PlBtnGhost as h, usePlBlockPageTitleTeleportTarget as g } from "@milaboratories/uikit";
|
|
4
5
|
//#region src/components/PlAgCsvExporter/PlAgCsvExporter.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
-
var
|
|
6
|
+
var _ = /* @__PURE__ */ s({
|
|
6
7
|
__name: "PlAgCsvExporter",
|
|
7
|
-
props: {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
props: {
|
|
9
|
+
api: {},
|
|
10
|
+
tableHandle: {}
|
|
11
|
+
},
|
|
12
|
+
setup(s) {
|
|
13
|
+
let _ = s, { api: v } = u(_), y = t(), b = l(!1), x = () => {
|
|
14
|
+
let t = m(_.tableHandle) ? void 0 : {
|
|
15
|
+
tableHandle: _.tableHandle,
|
|
16
|
+
format: "csv"
|
|
17
|
+
};
|
|
18
|
+
m(t) || (b.value = !0, e(v.value, t).finally(() => b.value = !1));
|
|
19
|
+
}, S = g("PlAgCsvExporter");
|
|
20
|
+
return (e, t) => d(S) && d(y) ? (c(), r(n, {
|
|
13
21
|
key: 0,
|
|
14
|
-
to:
|
|
15
|
-
}, [
|
|
16
|
-
loading:
|
|
22
|
+
to: d(S)
|
|
23
|
+
}, [o(d(h), {
|
|
24
|
+
loading: b.value,
|
|
17
25
|
icon: "export",
|
|
18
|
-
onClick:
|
|
26
|
+
onClick: p(x, ["stop"])
|
|
19
27
|
}, {
|
|
20
|
-
default:
|
|
28
|
+
default: f(() => [...t[0] ||= [a(" Export ", -1)]]),
|
|
21
29
|
_: 1
|
|
22
|
-
}, 8, ["loading"])], 8, ["to"])) :
|
|
30
|
+
}, 8, ["loading"])], 8, ["to"])) : i("", !0);
|
|
23
31
|
}
|
|
24
32
|
});
|
|
25
33
|
//#endregion
|
|
26
|
-
export {
|
|
34
|
+
export { _ as default };
|
|
27
35
|
|
|
28
36
|
//# sourceMappingURL=PlAgCsvExporter.vue2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgCsvExporter.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlAgCsvExporter/PlAgCsvExporter.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { GridApi } from \"ag-grid-enterprise\";\nimport { PlBtnGhost, usePlBlockPageTitleTeleportTarget } from \"@milaboratories/uikit\";\nimport { shallowRef, toRefs } from \"vue\";\nimport { exportCsv } from \"./export-csv\";\n\nconst props = defineProps<{\n api: GridApi;\n}>();\nconst { api: gridApi } = toRefs(props);\n\nconst exporting = shallowRef(false);\nconst initiateExport = () => {\n exporting.value = true;\n exportCsv(gridApi.value, () => (exporting.value = false));\n};\n\nconst teleportTarget = usePlBlockPageTitleTeleportTarget(\"PlAgCsvExporter\");\n</script>\n\n<template>\n <Teleport v-if=\"teleportTarget\" :to=\"teleportTarget\">\n <PlBtnGhost :loading=\"exporting\" icon=\"export\" @click.stop=\"initiateExport\">\n Export\n </PlBtnGhost>\n </Teleport>\n</template>\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlAgCsvExporter.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/PlAgCsvExporter/PlAgCsvExporter.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport type { GridApi } from \"ag-grid-enterprise\";\nimport type { PTableHandle } from \"@platforma-sdk/model\";\nimport { PlBtnGhost, usePlBlockPageTitleTeleportTarget } from \"@milaboratories/uikit\";\nimport { shallowRef, toRefs } from \"vue\";\nimport { isNil } from \"es-toolkit\";\nimport { exportCsv, isCsvExportAvailable } from \"./export-csv\";\nimport type { ExportOptions } from \"./export-csv\";\n\nconst props = defineProps<{\n api: GridApi;\n tableHandle?: PTableHandle;\n}>();\nconst { api: gridApi } = toRefs(props);\nconst csvExportAvailable = isCsvExportAvailable();\n\nconst exporting = shallowRef(false);\nconst initiateExport = () => {\n const nativeOptions: ExportOptions | undefined = !isNil(props.tableHandle)\n ? { tableHandle: props.tableHandle, format: \"csv\" }\n : undefined;\n\n if (isNil(nativeOptions)) {\n return;\n }\n\n exporting.value = true;\n exportCsv(gridApi.value, nativeOptions).finally(() => (exporting.value = false));\n};\n\nconst teleportTarget = usePlBlockPageTitleTeleportTarget(\"PlAgCsvExporter\");\n</script>\n\n<template>\n <Teleport v-if=\"teleportTarget && csvExportAvailable\" :to=\"teleportTarget\">\n <PlBtnGhost :loading=\"exporting\" icon=\"export\" @click.stop=\"initiateExport\">\n Export\n </PlBtnGhost>\n </Teleport>\n</template>\n"],"mappings":";;;;;;;;;;;;EASA,IAAM,IAAQ,GAIR,EAAE,KAAK,MAAY,EAAO,EAAM,EAChC,IAAqB,GAAsB,EAE3C,IAAY,EAAW,GAAM,EAC7B,UAAuB;GAC3B,IAAM,IAA4C,EAAM,EAAM,YAAW,GAErE,KAAA,IADA;IAAE,aAAa,EAAM;IAAa,QAAQ;IAAM;AAGhD,KAAM,EAAc,KAIxB,EAAU,QAAQ,IAClB,EAAU,EAAQ,OAAO,EAAc,CAAC,cAAe,EAAU,QAAQ,GAAO;KAG5E,IAAiB,EAAkC,kBAAkB;mBAIzD,EAAA,EAAc,IAAI,EAAA,EAAkB,IAAA,GAAA,EAApD,EAIW,GAAA;;GAJ4C,IAAI,EAAA,EAAc;MACvE,EAEa,EAAA,EAAA,EAAA;GAFA,SAAS,EAAA;GAAW,MAAK;GAAU,SAAK,EAAO,GAAc,CAAA,OAAA,CAAA;;oBAE1E,CAAA,GAAA,AAAA,EAAA,OAAA,CAAA,EAF4E,YAE5E,GAAA,CAAA,CAAA,CAAA"}
|
|
@@ -1,3 +1,29 @@
|
|
|
1
1
|
import { GridApi } from 'ag-grid-enterprise';
|
|
2
|
-
|
|
2
|
+
import { PTableHandle, PTableDownloadFormat, PTableColumnSpec, PFrameSpecDriver, WritePTableToFsResult } from '@platforma-sdk/model';
|
|
3
|
+
import { Nil } from '@milaboratories/helpers';
|
|
4
|
+
/** Options for the native CSV export path. */
|
|
5
|
+
export interface ExportOptions {
|
|
6
|
+
tableHandle: PTableHandle;
|
|
7
|
+
format: PTableDownloadFormat;
|
|
8
|
+
defaultFileName?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* CSV export via the platforma desktop runtime. Prompts for a save
|
|
12
|
+
* destination via the `Dialog` service, then streams the PTable to the
|
|
13
|
+
* chosen path via `PFrame.writePTableToFs`.
|
|
14
|
+
*/
|
|
15
|
+
export declare function exportCsv(gridApi: GridApi, nativeOptions: ExportOptions): Promise<undefined | WritePTableToFsResult>;
|
|
16
|
+
/**
|
|
17
|
+
* Checks whether the native CSV export capability is available in the
|
|
18
|
+
* current platforma runtime environment. Both `Dialog` and `PFrame`
|
|
19
|
+
* services must be present — desktop-app wires them, web/preview do not.
|
|
20
|
+
*/
|
|
21
|
+
export declare function isCsvExportAvailable(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Collect unified column indices for visible (non-hidden) columns from the
|
|
24
|
+
* ag-grid column defs, remapped onto the provided PTable spec array so the
|
|
25
|
+
* indices match the current table handle (ColDef.field indices may be stale
|
|
26
|
+
* or diverge from the spec order).
|
|
27
|
+
*/
|
|
28
|
+
export declare function collectVisibleColumnIndices(gridApi: GridApi, specs: PTableColumnSpec[], pframeSpec: PFrameSpecDriver): Nil | number[];
|
|
3
29
|
//# sourceMappingURL=export-csv.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-csv.d.ts","sourceRoot":"","sources":["../../../src/components/PlAgCsvExporter/export-csv.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"export-csv.d.ts","sourceRoot":"","sources":["../../../src/components/PlAgCsvExporter/export-csv.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,KAAK,EACV,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,qBAAqB,EACtB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,GAAG,EAAE,MAAM,yBAAyB,CAAC;AAG9C,8CAA8C;AAC9C,MAAM,WAAW,aAAa;IAC5B,WAAW,EAAE,YAAY,CAAC;IAC1B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAC7B,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,SAAS,GAAG,qBAAqB,CAAC,CAiC5C;AAUD;;;;GAIG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAO9C;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,gBAAgB,EAAE,EACzB,UAAU,EAAE,gBAAgB,GAC3B,GAAG,GAAG,MAAM,EAAE,CAehB"}
|
|
@@ -1,41 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getServices as e } from "../../internal/getServices.js";
|
|
2
|
+
import { getPTableColumnId as t } from "@platforma-sdk/model";
|
|
3
|
+
import { isNil as n } from "es-toolkit";
|
|
2
4
|
//#region src/components/PlAgCsvExporter/export-csv.ts
|
|
3
|
-
function
|
|
4
|
-
let
|
|
5
|
-
|
|
5
|
+
async function r(t, r) {
|
|
6
|
+
let { dialog: a, pframe: s, pframeSpec: c } = e();
|
|
7
|
+
if (n(a)) throw Error("dialog service is not available in the current environment");
|
|
8
|
+
if (n(s)) throw Error("pframe service is not available");
|
|
9
|
+
if (n(c)) throw Error("pframeSpec service is not available");
|
|
10
|
+
let l = o(t, await s.getSpec(r.tableHandle), c);
|
|
11
|
+
if (n(l)) return;
|
|
12
|
+
let { canceled: u, path: d } = await a.showSaveDialog({ defaultFileName: (r.defaultFileName ?? `table_${i(/* @__PURE__ */ new Date())}`) + `.${r.format}.gz` });
|
|
13
|
+
if (!(u || n(d))) return s.writePTableToFs(r.tableHandle, {
|
|
14
|
+
path: d,
|
|
15
|
+
format: r.format,
|
|
16
|
+
columnIndices: l,
|
|
17
|
+
compression: { type: "gzip" }
|
|
18
|
+
});
|
|
6
19
|
}
|
|
7
|
-
function
|
|
8
|
-
|
|
20
|
+
function i(e) {
|
|
21
|
+
let t = (e) => String(e).padStart(2, "0");
|
|
22
|
+
return `${t(e.getDate())}-${t(e.getMonth() + 1)}-${e.getFullYear()}_${t(e.getHours())}-${t(e.getMinutes())}-${t(e.getSeconds())}`;
|
|
9
23
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (o.length === 0 || o[0].rowCount <= o[0].cacheBlockSize) return i.exportDataAsCsv(), a();
|
|
17
|
-
let s = !1, c = n();
|
|
18
|
-
return t(c, {
|
|
19
|
-
rowModelType: "serverSide",
|
|
20
|
-
columnDefs: i.getColumnDefs()?.filter((e) => !("children" in e)).map((e) => ({
|
|
21
|
-
headerName: e.headerName,
|
|
22
|
-
field: e.field,
|
|
23
|
-
valueFormatter: e.valueFormatter,
|
|
24
|
-
valueGetter: e.valueGetter
|
|
25
|
-
})) ?? [],
|
|
26
|
-
serverSideDatasource: i.getGridOption("serverSideDatasource"),
|
|
27
|
-
cacheBlockSize: o[0].rowCount,
|
|
28
|
-
onModelUpdated: (e) => {
|
|
29
|
-
let t = e.api.getServerSideGroupLevelState();
|
|
30
|
-
if (!s && t.length > 0 && t[0].rowCount === t[0].cacheBlockSize) return s = !0, e.api.exportDataAsCsv(), r(c), a();
|
|
31
|
-
},
|
|
32
|
-
defaultCsvExportParams: i.getGridOption("defaultCsvExportParams")
|
|
33
|
-
}, { modules: [e] });
|
|
34
|
-
}
|
|
35
|
-
default: throw a(), Error(`exportCsv unsupported for rowModelType = ${o}`);
|
|
24
|
+
function a() {
|
|
25
|
+
try {
|
|
26
|
+
let t = e();
|
|
27
|
+
return !n(t?.dialog) && !n(t?.pframe);
|
|
28
|
+
} catch {
|
|
29
|
+
return !1;
|
|
36
30
|
}
|
|
37
31
|
}
|
|
32
|
+
function o(e, r, i) {
|
|
33
|
+
let a = e.getColumnDefs();
|
|
34
|
+
if (!n(a)) return a.filter((e) => !("children" in e) && e.hide !== !0 && !n(e.context)).map((e) => i.findTableColumn(r, t(e.context))).filter((e) => e !== -1);
|
|
35
|
+
}
|
|
38
36
|
//#endregion
|
|
39
|
-
export {
|
|
37
|
+
export { r as exportCsv, a as isCsvExportAvailable };
|
|
40
38
|
|
|
41
39
|
//# sourceMappingURL=export-csv.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"export-csv.js","names":[],"sources":["../../../src/components/PlAgCsvExporter/export-csv.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"export-csv.js","names":[],"sources":["../../../src/components/PlAgCsvExporter/export-csv.ts"],"sourcesContent":["import { type ColDef, type ColGroupDef, type GridApi } from \"ag-grid-enterprise\";\nimport type {\n PTableHandle,\n PTableDownloadFormat,\n PTableColumnSpec,\n PFrameSpecDriver,\n WritePTableToFsResult,\n} from \"@platforma-sdk/model\";\nimport { getPTableColumnId } from \"@platforma-sdk/model\";\nimport { isNil } from \"es-toolkit\";\nimport { Nil } from \"@milaboratories/helpers\";\nimport { getServices } from \"../../internal/getServices\";\n\n/** Options for the native CSV export path. */\nexport interface ExportOptions {\n tableHandle: PTableHandle;\n format: PTableDownloadFormat;\n defaultFileName?: string;\n}\n\n/**\n * CSV export via the platforma desktop runtime. Prompts for a save\n * destination via the `Dialog` service, then streams the PTable to the\n * chosen path via `PFrame.writePTableToFs`.\n */\nexport async function exportCsv(\n gridApi: GridApi,\n nativeOptions: ExportOptions,\n): Promise<undefined | WritePTableToFsResult> {\n const { dialog, pframe, pframeSpec } = getServices();\n if (isNil(dialog)) {\n throw new Error(\"dialog service is not available in the current environment\");\n }\n if (isNil(pframe)) {\n throw new Error(\"pframe service is not available\");\n }\n if (isNil(pframeSpec)) {\n throw new Error(\"pframeSpec service is not available\");\n }\n\n const specs = await pframe.getSpec(nativeOptions.tableHandle);\n const columnIndices = collectVisibleColumnIndices(gridApi, specs, pframeSpec);\n if (isNil(columnIndices)) {\n return undefined;\n }\n\n const { canceled, path } = await dialog.showSaveDialog({\n defaultFileName:\n (nativeOptions.defaultFileName ?? `table_${formatTimestamp(new Date())}`) +\n `.${nativeOptions.format}.gz`,\n });\n if (canceled || isNil(path)) {\n return undefined;\n }\n\n return pframe.writePTableToFs(nativeOptions.tableHandle, {\n path,\n format: nativeOptions.format,\n columnIndices,\n compression: { type: \"gzip\" },\n });\n}\n\nfunction formatTimestamp(d: Date): string {\n const pad = (n: number) => String(n).padStart(2, \"0\");\n return (\n `${pad(d.getDate())}-${pad(d.getMonth() + 1)}-${d.getFullYear()}` +\n `_${pad(d.getHours())}-${pad(d.getMinutes())}-${pad(d.getSeconds())}`\n );\n}\n\n/**\n * Checks whether the native CSV export capability is available in the\n * current platforma runtime environment. Both `Dialog` and `PFrame`\n * services must be present — desktop-app wires them, web/preview do not.\n */\nexport function isCsvExportAvailable(): boolean {\n try {\n const services = getServices();\n return !isNil(services?.dialog) && !isNil(services?.pframe);\n } catch {\n return false;\n }\n}\n\n/**\n * Collect unified column indices for visible (non-hidden) columns from the\n * ag-grid column defs, remapped onto the provided PTable spec array so the\n * indices match the current table handle (ColDef.field indices may be stale\n * or diverge from the spec order).\n */\nexport function collectVisibleColumnIndices(\n gridApi: GridApi,\n specs: PTableColumnSpec[],\n pframeSpec: PFrameSpecDriver,\n): Nil | number[] {\n const columnDefs = gridApi.getColumnDefs();\n if (isNil(columnDefs)) {\n return;\n }\n\n return columnDefs\n .filter(\n (def: ColDef | ColGroupDef): def is ColDef =>\n !(\"children\" in def) && def.hide !== true && !isNil(def.context),\n )\n .map((def) =>\n pframeSpec.findTableColumn(specs, getPTableColumnId(def.context as PTableColumnSpec)),\n )\n .filter((index): index is number => index !== -1);\n}\n"],"mappings":";;;;AAyBA,eAAsB,EACpB,GACA,GAC4C;CAC5C,IAAM,EAAE,WAAQ,WAAQ,kBAAe,GAAa;AACpD,KAAI,EAAM,EAAO,CACf,OAAU,MAAM,6DAA6D;AAE/E,KAAI,EAAM,EAAO,CACf,OAAU,MAAM,kCAAkC;AAEpD,KAAI,EAAM,EAAW,CACnB,OAAU,MAAM,sCAAsC;CAIxD,IAAM,IAAgB,EAA4B,GADpC,MAAM,EAAO,QAAQ,EAAc,YAAY,EACK,EAAW;AAC7E,KAAI,EAAM,EAAc,CACtB;CAGF,IAAM,EAAE,aAAU,YAAS,MAAM,EAAO,eAAe,EACrD,kBACG,EAAc,mBAAmB,SAAS,kBAAgB,IAAI,MAAM,CAAC,MACtE,IAAI,EAAc,OAAO,MAC5B,CAAC;AACE,YAAY,EAAM,EAAK,EAI3B,QAAO,EAAO,gBAAgB,EAAc,aAAa;EACvD;EACA,QAAQ,EAAc;EACtB;EACA,aAAa,EAAE,MAAM,QAAQ;EAC9B,CAAC;;AAGJ,SAAS,EAAgB,GAAiB;CACxC,IAAM,KAAO,MAAc,OAAO,EAAE,CAAC,SAAS,GAAG,IAAI;AACrD,QACE,GAAG,EAAI,EAAE,SAAS,CAAC,CAAC,GAAG,EAAI,EAAE,UAAU,GAAG,EAAE,CAAC,GAAG,EAAE,aAAa,CAAA,GAC3D,EAAI,EAAE,UAAU,CAAC,CAAC,GAAG,EAAI,EAAE,YAAY,CAAC,CAAC,GAAG,EAAI,EAAE,YAAY,CAAC;;AASvE,SAAgB,IAAgC;AAC9C,KAAI;EACF,IAAM,IAAW,GAAa;AAC9B,SAAO,CAAC,EAAM,GAAU,OAAO,IAAI,CAAC,EAAM,GAAU,OAAO;SACrD;AACN,SAAO;;;AAUX,SAAgB,EACd,GACA,GACA,GACgB;CAChB,IAAM,IAAa,EAAQ,eAAe;AACtC,QAAM,EAAW,CAIrB,QAAO,EACJ,QACE,MACC,EAAE,cAAc,MAAQ,EAAI,SAAS,MAAQ,CAAC,EAAM,EAAI,QAAQ,CACnE,CACA,KAAK,MACJ,EAAW,gBAAgB,GAAO,EAAkB,EAAI,QAA4B,CAAC,CACtF,CACA,QAAQ,MAA2B,MAAU,GAAG"}
|