@platforma-sdk/ui-vue 1.58.22 → 1.59.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 +16 -16
- 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 +24 -0
- package/dist/{components/PlAgDataTable/compositions/useTheme.d.ts → AgGridVue/AgGridTheme.d.ts} +1 -1
- package/dist/AgGridVue/AgGridTheme.d.ts.map +1 -0
- package/dist/{components/PlAgDataTable/compositions/useTheme.js → AgGridVue/AgGridTheme.js} +2 -2
- package/dist/AgGridVue/AgGridTheme.js.map +1 -0
- package/dist/AgGridVue/ag-override.js.map +1 -0
- package/dist/AgGridVue/index.d.ts +1 -0
- package/dist/AgGridVue/index.d.ts.map +1 -1
- package/dist/AgGridVue/index.js +1 -0
- package/dist/AgGridVue/useAgGridOptions.js +1 -1
- package/dist/AgGridVue/useAgGridOptions.js.map +1 -1
- package/dist/components/PlAdvancedFilter/utils.d.ts +1 -0
- package/dist/components/PlAdvancedFilter/utils.d.ts.map +1 -1
- package/dist/components/PlAdvancedFilter/utils.js +2 -1
- package/dist/components/PlAdvancedFilter/utils.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.vue2.js +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js.map +1 -1
- package/dist/components/PlAgDataTable/compositions/useFilterableColumns.d.ts +16 -0
- package/dist/components/PlAgDataTable/compositions/useFilterableColumns.d.ts.map +1 -1
- package/dist/components/PlAnnotations/components/PlAnnotations.vue2.js.map +1 -1
- package/dist/index.js +21 -20
- package/dist/lib.js +1 -0
- package/package.json +6 -6
- package/src/{components/PlAgDataTable/compositions/useTheme.ts → AgGridVue/AgGridTheme.ts} +1 -1
- package/src/AgGridVue/index.ts +1 -0
- package/src/AgGridVue/useAgGridOptions.ts +1 -1
- package/src/components/PlAdvancedFilter/utils.ts +2 -0
- package/src/components/PlAgDataTable/PlAgDataTableV2.vue +1 -1
- package/dist/components/PlAgDataTable/ag-override.js.map +0 -1
- package/dist/components/PlAgDataTable/compositions/useTheme.d.ts.map +0 -1
- package/dist/components/PlAgDataTable/compositions/useTheme.js.map +0 -1
- /package/dist/{components/PlAgDataTable → AgGridVue}/ag-override.js +0 -0
- /package/src/{components/PlAgDataTable → AgGridVue}/ag-override.css +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.59.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...
|
|
@@ -11,7 +11,7 @@ Building browser-lib project...
|
|
|
11
11
|
rendering chunks...
|
|
12
12
|
|
|
13
13
|
[vite:dts] Start generate declaration files...
|
|
14
|
-
[vite:dts] Declaration files built in
|
|
14
|
+
[vite:dts] Declaration files built in 5027ms.
|
|
15
15
|
|
|
16
16
|
computing gzip size...
|
|
17
17
|
dist/components/PlAnnotations/components/PlAnnotations.vue?vue&type=style&index=0&lang.css 0.04 kB │ gzip: 0.06 kB
|
|
@@ -62,7 +62,7 @@ dist/components/PlAgChartHistogramCell/index.js
|
|
|
62
62
|
dist/components/PlAgChartStackedBarCell/index.js 0.03 kB │ gzip: 0.05 kB
|
|
63
63
|
dist/components/PlAppErrorNotificationAlert/index.js 0.04 kB │ gzip: 0.06 kB
|
|
64
64
|
dist/components/PlAnnotations/index.js 0.08 kB │ gzip: 0.07 kB
|
|
65
|
-
dist/AgGridVue/index.js 0.
|
|
65
|
+
dist/AgGridVue/index.js 0.11 kB │ gzip: 0.08 kB
|
|
66
66
|
dist/lib/util/helpers/dist/hash.js 0.11 kB │ gzip: 0.12 kB │ map: 1.43 kB
|
|
67
67
|
dist/_virtual/_plugin-vue_export-helper.js 0.11 kB │ gzip: 0.12 kB
|
|
68
68
|
dist/lib/util/helpers/dist/uniqId.js 0.12 kB │ gzip: 0.13 kB │ map: 0.27 kB
|
|
@@ -140,7 +140,7 @@ dist/components/PlAdvancedFilter/PlAdvancedFilter.vue_vue_type_style_index_0_lan
|
|
|
140
140
|
dist/plugins/Monetization/useButtonTarget.js 0.48 kB │ gzip: 0.32 kB │ map: 1.10 kB
|
|
141
141
|
dist/components/PlAgCellStatusTag/PlAgCellStatusTag.vue_vue_type_script_setup_true_lang.js 0.53 kB │ gzip: 0.38 kB │ map: 0.87 kB
|
|
142
142
|
dist/objectHash.js 0.53 kB │ gzip: 0.37 kB │ map: 1.14 kB
|
|
143
|
-
dist/
|
|
143
|
+
dist/AgGridVue/ag-override.js 0.61 kB │ gzip: 0.30 kB │ map: 0.73 kB
|
|
144
144
|
dist/components/PlAdvancedFilter/FilterEditor.vue_vue_type_style_index_0_lang.module.js 0.62 kB │ gzip: 0.33 kB │ map: 0.92 kB
|
|
145
145
|
dist/components/PlAgDataTable/PlAgOverlayNoRows.vue_vue_type_script_setup_true_lang.js 0.65 kB │ gzip: 0.44 kB │ map: 1.56 kB
|
|
146
146
|
dist/plugins/Monetization/LimitCard.vue_vue_type_style_index_0_lang.module.js 0.68 kB │ gzip: 0.34 kB │ map: 0.93 kB
|
|
@@ -166,7 +166,7 @@ dist/components/PlAgDataTable/PlAgRowCount.vue_vue_type_script_setup_true_lang.j
|
|
|
166
166
|
dist/components/PlAgDataTable/PlAgOverlayLoading.vue_vue_type_script_setup_true_lang.js 1.22 kB │ gzip: 0.71 kB │ map: 2.49 kB
|
|
167
167
|
dist/utils.js 1.23 kB │ gzip: 0.60 kB │ map: 3.40 kB
|
|
168
168
|
dist/lib/util/helpers/dist/prettyBytes.js 1.23 kB │ gzip: 0.63 kB │ map: 3.79 kB
|
|
169
|
-
dist/
|
|
169
|
+
dist/AgGridVue/AgGridTheme.js 1.25 kB │ gzip: 0.57 kB │ map: 2.06 kB
|
|
170
170
|
dist/components/PlBtnExportArchive/Item.vue_vue_type_script_setup_true_lang.js 1.26 kB │ gzip: 0.57 kB │ map: 2.58 kB
|
|
171
171
|
dist/components/PlAgDataTable/types.js 1.27 kB │ gzip: 0.50 kB │ map: 7.63 kB
|
|
172
172
|
dist/usePlugin.js 1.29 kB │ gzip: 0.70 kB │ map: 2.63 kB
|
|
@@ -174,8 +174,8 @@ dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue_vue_type_script_
|
|
|
174
174
|
dist/internal/createAppModel.js 1.42 kB │ gzip: 0.72 kB │ map: 3.89 kB
|
|
175
175
|
dist/components/PlAgCsvExporter/export-csv.js 1.44 kB │ gzip: 0.70 kB │ map: 3.50 kB
|
|
176
176
|
dist/plugins/Monetization/useInfo.js 1.45 kB │ gzip: 0.74 kB │ map: 3.85 kB
|
|
177
|
-
dist/components/PlAdvancedFilter/utils.js 1.45 kB │ gzip: 0.66 kB │ map: 5.11 kB
|
|
178
177
|
dist/internal/UpdateSerializer.js 1.48 kB │ gzip: 0.65 kB │ map: 4.28 kB
|
|
178
|
+
dist/components/PlAdvancedFilter/utils.js 1.49 kB │ gzip: 0.67 kB │ map: 5.22 kB
|
|
179
179
|
dist/AgGridVue/selection.js 1.49 kB │ gzip: 0.51 kB │ map: 3.20 kB
|
|
180
180
|
dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue_vue_type_script_setup_true_lang.js 1.55 kB │ gzip: 0.80 kB │ map: 2.62 kB
|
|
181
181
|
dist/components/PlTableFastSearch/PlTableFastSearch.vue_vue_type_script_setup_true_lang.js 1.71 kB │ gzip: 0.86 kB │ map: 2.10 kB
|
|
@@ -190,7 +190,7 @@ dist/components/PlAgDataTable/PlAgDataTableSheets.vue_vue_type_script_setup_true
|
|
|
190
190
|
dist/components/PlAgColumnHeader/PlAgColumnHeader.vue_vue_type_script_setup_true_lang.js 2.51 kB │ gzip: 1.11 kB │ map: 6.76 kB
|
|
191
191
|
dist/components/PlAnnotations/components/PlAnnotations.vue_vue_type_script_setup_true_lang.js 2.53 kB │ gzip: 1.08 kB │ map: 3.54 kB
|
|
192
192
|
dist/lib/util/helpers/dist/objects.js 2.54 kB │ gzip: 1.04 kB │ map: 8.90 kB
|
|
193
|
-
dist/lib.js 2.
|
|
193
|
+
dist/lib.js 2.60 kB │ gzip: 0.56 kB │ map: 3.84 kB
|
|
194
194
|
dist/components/PlAgDataTable/compositions/useGrid.js 2.69 kB │ gzip: 1.20 kB │ map: 6.18 kB
|
|
195
195
|
dist/components/PlAgDataTable/sources/row-number.js 2.92 kB │ gzip: 1.28 kB │ map: 7.42 kB
|
|
196
196
|
dist/defineApp.js 2.98 kB │ gzip: 1.04 kB │ map: 13.94 kB
|
|
@@ -202,25 +202,25 @@ dist/components/PlAnnotations/components/AnnotationsSidebar.vue_vue_type_script_
|
|
|
202
202
|
dist/components/PlAnnotations/components/FilterSidebar.vue_vue_type_script_setup_true_lang.js 3.72 kB │ gzip: 1.52 kB │ map: 6.52 kB
|
|
203
203
|
dist/plugins/Monetization/MonetizationSidebar.vue_vue_type_script_setup_true_lang.js 3.85 kB │ gzip: 1.66 kB │ map: 5.71 kB
|
|
204
204
|
dist/components/PlAgDataTable/sources/table-state-v2.js 3.96 kB │ gzip: 1.48 kB │ map: 11.85 kB
|
|
205
|
-
dist/index.js 4.
|
|
205
|
+
dist/index.js 4.36 kB │ gzip: 1.31 kB │ map: 0.13 kB
|
|
206
206
|
dist/internal/createAppV1.js 4.69 kB │ gzip: 1.69 kB │ map: 14.22 kB
|
|
207
207
|
dist/composition/fileContent.js 4.85 kB │ gzip: 1.75 kB │ map: 12.99 kB
|
|
208
208
|
dist/components/PlBtnExportArchive/PlBtnExportArchive.vue_vue_type_script_setup_true_lang.js 5.08 kB │ gzip: 2.11 kB │ map: 10.36 kB
|
|
209
|
-
dist/AgGridVue/useAgGridOptions.js 5.
|
|
209
|
+
dist/AgGridVue/useAgGridOptions.js 5.74 kB │ gzip: 1.79 kB │ map: 14.21 kB
|
|
210
210
|
dist/internal/createAppV2.js 6.00 kB │ gzip: 2.27 kB │ map: 17.80 kB
|
|
211
211
|
dist/components/PlAgDataTable/sources/table-source-v2.js 6.44 kB │ gzip: 2.56 kB │ map: 19.12 kB
|
|
212
212
|
dist/internal/createAppV3.js 6.54 kB │ gzip: 2.51 kB │ map: 19.87 kB
|
|
213
213
|
dist/components/PlAdvancedFilter/PlAdvancedFilter.vue_vue_type_script_setup_true_lang.js 7.06 kB │ gzip: 2.28 kB │ map: 14.91 kB
|
|
214
214
|
dist/components/PlAdvancedFilter/FilterEditor.vue_vue_type_script_setup_true_lang.js 10.14 kB │ gzip: 3.05 kB │ map: 21.57 kB
|
|
215
|
-
dist/components/PlAgDataTable/PlAgDataTableV2.vue_vue_type_script_setup_true_lang.js 11.
|
|
215
|
+
dist/components/PlAgDataTable/PlAgDataTableV2.vue_vue_type_script_setup_true_lang.js 11.52 kB │ gzip: 3.69 kB │ map: 27.97 kB
|
|
216
216
|
|
|
217
217
|
[33m[33m[PLUGIN_TIMINGS] Warning:[0m Your build spent significant time in plugins. Here is a breakdown:
|
|
218
|
-
- sourcemaps (
|
|
219
|
-
- vite:dts (
|
|
220
|
-
- vite:
|
|
221
|
-
- vite:
|
|
222
|
-
- vite:css (
|
|
218
|
+
- sourcemaps (29%)
|
|
219
|
+
- vite:dts (28%)
|
|
220
|
+
- vite:vue (12%)
|
|
221
|
+
- vite:css (8%)
|
|
222
|
+
- vite:css-post (8%)
|
|
223
223
|
See https://rolldown.rs/options/checks#plugintimings for more details.
|
|
224
224
|
[39m
|
|
225
|
-
[32m✓ built in
|
|
225
|
+
[32m✓ built in 5.82s[39m
|
|
226
226
|
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.59.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 1451ms on 127 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.59.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
|
|
9
|
+
Finished in 30ms on 110 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.59.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,29 @@
|
|
|
1
1
|
# @platforma-sdk/ui-vue
|
|
2
2
|
|
|
3
|
+
## 1.59.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- b4036fb: Add contextDomain support across the platform
|
|
8
|
+
|
|
9
|
+
- Add `contextDomain` field to AxisId, AxisSpec, PColumnSpec and related types
|
|
10
|
+
- Add `contextDomainAnchor` to AnchoredPColumnSelector with full pack-based optimization in AnchoredIdDeriver
|
|
11
|
+
- Extend spec distiller, matchers, xsv-builder, and query resolution to handle contextDomain
|
|
12
|
+
- Add contextDomain to discoverColumns API types (MultiColumnSelector, MultiAxisSelector)
|
|
13
|
+
- Add feature-flag-gated ContextDomain query predicate in query-anchored template
|
|
14
|
+
- Add client-side contextDomain post-filter template for old backends without ContextDomain query support
|
|
15
|
+
- Rename `additionalDomains` to `contextDomain` in SpecQueryJoinEntry and AxisQualification
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [b4036fb]
|
|
18
|
+
- @platforma-sdk/model@1.59.0
|
|
19
|
+
- @milaboratories/uikit@2.10.44
|
|
20
|
+
|
|
21
|
+
## 1.58.25
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- 5e769e4: reexport aggridtheme
|
|
26
|
+
|
|
3
27
|
## 1.58.22
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgGridTheme.d.ts","sourceRoot":"","sources":["../../src/AgGridVue/AgGridTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAA2B,MAAM,oBAAoB,CAAC;AAGzE,eAAO,MAAM,WAAW,EAAE,KAmCkD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import e from "
|
|
1
|
+
import e from "./ag-override.js";
|
|
2
2
|
import { createPart as t, themeQuartz as n } from "ag-grid-enterprise";
|
|
3
3
|
const r = n.withParams({
|
|
4
4
|
headerColumnResizeHandleColor: "transparent",
|
|
@@ -39,4 +39,4 @@ const r = n.withParams({
|
|
|
39
39
|
}));
|
|
40
40
|
export { r as AgGridTheme };
|
|
41
41
|
|
|
42
|
-
//# sourceMappingURL=
|
|
42
|
+
//# sourceMappingURL=AgGridTheme.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgGridTheme.js","names":[],"sources":["../../src/AgGridVue/AgGridTheme.ts"],"sourcesContent":["import { type Theme, themeQuartz, createPart } from \"ag-grid-enterprise\";\nimport OverrideCss from \"./ag-override.css?raw\";\n\nexport const AgGridTheme: Theme = themeQuartz\n .withParams({\n headerColumnResizeHandleColor: \"transparent\",\n accentColor: \"#49cc49\",\n borderColor: \"#E1E3EB\",\n cellHorizontalPaddingScale: 1,\n checkboxBorderRadius: \"3px\",\n checkboxCheckedBackgroundColor: \"#110529\",\n checkboxCheckedBorderColor: \"#110529\",\n checkboxIndeterminateBackgroundColor: \"#110529\",\n checkboxIndeterminateBorderColor: \"#110529\",\n checkboxUncheckedBorderColor: \"#CFD1DB\",\n columnBorder: true,\n columnHoverColor: \"#9BABCC16\",\n fontFamily: \"inherit\",\n foregroundColor: \"#110529\",\n headerBackgroundColor: \"#F7F8FA\",\n headerColumnBorder: true,\n headerFontWeight: 600,\n headerRowBorder: true,\n headerVerticalPaddingScale: 0.8,\n iconButtonHoverColor: \"#9BABCC32\",\n iconSize: \"16px\",\n menuBackgroundColor: \"#FFFFFF\",\n menuBorder: true,\n menuTextColor: \"#110529\",\n rowHoverColor: \"#9BABCC16\",\n rowVerticalPaddingScale: 1,\n selectedRowBackgroundColor: \"#63E02424\",\n sidePanelBorder: false,\n spacing: \"8px\",\n tooltipBackgroundColor: \"#110529\",\n tooltipTextColor: \"#FFFFFF\",\n wrapperBorderRadius: \"6px\",\n })\n .withPart(createPart({ feature: \"headerBottomBorder\", css: OverrideCss }));\n"],"mappings":";;AAGA,MAAa,IAAqB,EAC/B,WAAW;CACV,+BAA+B;CAC/B,aAAa;CACb,aAAa;CACb,4BAA4B;CAC5B,sBAAsB;CACtB,gCAAgC;CAChC,4BAA4B;CAC5B,sCAAsC;CACtC,kCAAkC;CAClC,8BAA8B;CAC9B,cAAc;CACd,kBAAkB;CAClB,YAAY;CACZ,iBAAiB;CACjB,uBAAuB;CACvB,oBAAoB;CACpB,kBAAkB;CAClB,iBAAiB;CACjB,4BAA4B;CAC5B,sBAAsB;CACtB,UAAU;CACV,qBAAqB;CACrB,YAAY;CACZ,eAAe;CACf,eAAe;CACf,yBAAyB;CACzB,4BAA4B;CAC5B,iBAAiB;CACjB,SAAS;CACT,wBAAwB;CACxB,kBAAkB;CAClB,qBAAqB;CACtB,CAAC,CACD,SAAS,EAAW;CAAE,SAAS;CAAsB,KAAK;CAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ag-override.js","names":[],"sources":["../../src/AgGridVue/ag-override.css?raw"],"sourcesContent":["export default \".ag-header {\\n border-bottom: 1px solid var(--border-color-default);\\n}\\n\\n.ag-column-menu,\\n.ag-menu.ag-ltr.ag-popup-child {\\n border-radius: 12px;\\n border: none;\\n background: var(--bg-elevated-01);\\n box-shadow: none;\\n background: var(--bg-base-dark);\\n}\\n\\n.ag-column-menu *,\\n.ag-menu.ag-ltr.ag-popup-child * {\\n color: var(--txt-00);\\n}\\n\\n.ag-column-menu .ag-icon,\\n.ag-menu.ag-ltr.ag-popup-child .ag-icon {\\n color: var(--ic-00);\\n}\\n\\n.ag-menu-separator-part:after {\\n border-color: var(--btn-sec-hover-grey);\\n}\\n\""],"mappings":"AAAA,IAAA,IAAe"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/AgGridVue/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/AgGridVue/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,aAAa,CAAC"}
|
package/dist/AgGridVue/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { autoSizeRowNumberColumn as e, makeRowNumberColDef as t } from "../components/PlAgDataTable/sources/row-number.js";
|
|
2
2
|
import n from "../components/PlAgDataTable/PlAgOverlayLoading.js";
|
|
3
3
|
import r from "../components/PlAgDataTable/PlAgOverlayNoRows.js";
|
|
4
|
-
import { AgGridTheme as i } from "
|
|
4
|
+
import { AgGridTheme as i } from "./AgGridTheme.js";
|
|
5
5
|
import "../components/PlAgDataTable/index.js";
|
|
6
6
|
import { createAgGridColDef as a } from "./createAgGridColDef.js";
|
|
7
7
|
import o from "../components/PlAgCellFile/PlAgCellFile.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAgGridOptions.js","names":["#options"],"sources":["../../src/AgGridVue/useAgGridOptions.ts"],"sourcesContent":["/**/\nimport type {\n ColGroupDef,\n GridApi,\n GridOptions,\n GridReadyEvent,\n ICellRendererParams,\n RowSelectionOptions,\n ValueSetterParams,\n} from \"ag-grid-enterprise\";\nimport type { Component } from \"vue\";\nimport { computed, shallowRef, watch } from \"vue\";\nimport {\n autoSizeRowNumberColumn,\n makeRowNumberColDef,\n PlAgOverlayLoading,\n type PlAgOverlayLoadingParams,\n} from \"../components/PlAgDataTable\";\nimport { PlAgOverlayNoRows } from \"../components/PlAgDataTable\";\nimport { createAgGridColDef, type ColDefExtended } from \"./createAgGridColDef\";\nimport { whenever } from \"@vueuse/core\";\nimport { PlAgCellFile } from \"../components/PlAgCellFile\";\nimport { PlAgChartStackedBarCell } from \"../components/PlAgChartStackedBarCell\";\nimport { PlAgChartHistogramCell } from \"../components/PlAgChartHistogramCell\";\nimport type { ImportFileHandle } from \"@platforma-sdk/model\";\nimport type { ImportProgress } from \"@platforma-sdk/model\";\nimport { PlAgCellStatusTag } from \"../components/PlAgCellStatusTag\";\nimport { AgGridTheme } from \"../components/PlAgDataTable/compositions/useTheme\";\ninterface GridOptionsExtended<TData = any> extends Omit<\n GridOptions<TData>,\n \"columnDefs\" | \"loadingOverlayComponentParams\"\n> {\n /**\n * Array of Column / Column Group definitions.\n */\n columnDefs?: (ColDefExtended<TData> | ColGroupDef<TData>)[] | null;\n /**\n * Show row numbers column\n */\n rowNumbersColumn?: boolean;\n /**\n * Loading overlay text\n */\n loadingText?: string;\n /**\n * Not ready overlay (Data is not computed). Takes priority over \"loading\"\n */\n notReady?: boolean;\n /**\n * \"Data is not computed\" by default\n */\n notReadyText?: string;\n /**\n * Override standard 'Empty' text for the \"no rows\" overlay\n */\n noRowsText?: string;\n /**\n * @deprecated Use loading, notReady, loadingText instead\n */\n loadingOverlayComponentParams?: never;\n}\n\n// @TODO (super simple builder for now)\nclass Builder<TData> {\n #options: GridOptionsExtended<TData> = {};\n\n public options(options: GridOptionsExtended<TData>) {\n this.#options = Object.assign({}, this.#options, options);\n return this;\n }\n\n private get columnDefs() {\n return this.#options.columnDefs ?? [];\n }\n\n /**\n * Set default column definition\n * @param def - column definition\n * @returns this\n */\n public setDefaultColDef(def: ColDefExtended<TData>) {\n this.#options.defaultColDef = def;\n return this;\n }\n\n /**\n * Show loading overlay\n * @param loading\n * @returns this\n */\n public setLoading(loading?: boolean) {\n this.#options.loading = loading;\n return this;\n }\n\n /**\n * Set loading overlay custom text (default is \"Loading\")\n * @param loadingText\n * @returns this\n */\n public setLoadingText(loadingText?: string) {\n this.#options.loadingText = loadingText;\n return this;\n }\n\n /**\n * Show \"not ready overlay\n * @param notReady\n * @returns this\n */\n public setNotReady(notReady?: boolean) {\n this.#options.notReady = notReady;\n return this;\n }\n\n /**\n * Set \"not ready\" text\n * @param notReadyText\n * @returns this\n */\n public setNotReadyText(notReadyText?: string) {\n this.#options.notReadyText = notReadyText;\n return this;\n }\n\n /**\n * Set \"no rows\" text when there are no rows (default is \"Empty\")\n * @param noRowsText\n * @returns this\n */\n public setNoRowsText(noRowsText?: string) {\n this.#options.noRowsText = noRowsText;\n return this;\n }\n\n /**\n * Set row selection options\n * @param rowSelection\n * @returns this\n */\n public setRowSelection(rowSelection?: RowSelectionOptions) {\n this.#options.rowSelection = rowSelection;\n return this;\n }\n\n /**\n * Set row data\n * @param rowData\n * @returns this\n */\n public setRowData(rowData?: TData[]) {\n this.#options.rowData = rowData;\n return this;\n }\n\n /**\n * Set components\n * @param components\n * @returns this\n */\n public setComponents(components?: Record<string, Component>) {\n this.#options.components = components;\n return this;\n }\n\n /**\n * Set an option\n * @param key - option key\n * @param value - option value\n * @returns this\n */\n public setOption<K extends keyof GridOptionsExtended<TData>>(\n key: K,\n value: GridOptionsExtended<TData>[K],\n ) {\n this.#options[key] = value;\n return this;\n }\n\n /**\n * Add an extended column definition\n * @param def - column definition\n * @returns this\n */\n public column<TValue = any>(def: ColDefExtended<TData, TValue>) {\n this.#options.columnDefs = [...this.columnDefs, def];\n return this;\n }\n\n /**\n * Show row numbers column\n * @param show - show or hide row numbers column\n * @returns this\n */\n public columnRowNumbers(show: boolean = true) {\n this.#options.rowNumbersColumn = show;\n return this;\n }\n\n /**\n * Add a file input column\n * @param def - column definition\n * @param cb - callback to set params for the file input cell renderer\n * @returns this\n */\n public columnFileInput<TValue = any>(\n def: ColDefExtended<TData, TValue> & {\n /**\n * Allowed file extensions (like ['fastq.gz'])\n */\n extensions?: string[];\n /**\n * The resolveProgress function is an optional input parameter for the component\n * that allows tracking the file upload progress in real-time.\n * By passing resolveProgress, you can ensure that the component\n * displays accurate progress values for each file as they upload.\n * How to use it in AgGrid\n * cellRendererParams: {\n * resolveProgress: (cellData) => {\n * const progresses = app.progresses;\n * if (!cellData.value.importFileHandle) return undefined;\n * else return progresses[cellData.value.importFileHandle];\n * }\n * }\n */\n resolveImportProgress?: (\n cellData: ICellRendererParams<TData, TValue>,\n ) => ImportProgress | undefined;\n\n /**\n * The resolveFileHandle function is an optional input parameter for the component\n * that allows tracking the file upload progress in real-time.\n * By passing resolveFileHandle, you can ensure that the component\n * displays accurate progress values for each file as they upload.\n * How to use it in AgGrid\n * cellRendererParams: {\n * resolveFileHandle: (cellData) => {\n * return cellData.value.importFileHandle;\n * }\n * }\n */\n resolveImportFileHandle?: (\n cellData: ICellRendererParams<TData, TValue>,\n ) => ImportFileHandle | undefined;\n\n setImportFileHandle?: (d: ValueSetterParams<TData, ImportFileHandle | undefined>) => void;\n },\n ) {\n return this.column(\n Object.assign(\n {\n cellRenderer: \"PlAgCellFile\",\n headerComponentParams: { type: \"File\" },\n cellStyle: { padding: 0 },\n valueSetter: (d: ValueSetterParams<TData, ImportFileHandle | undefined>) => {\n def.setImportFileHandle?.(d);\n return true;\n },\n cellRendererSelector: (cellData: ICellRendererParams<TData, TValue>) => {\n return {\n component: \"PlAgCellFile\",\n params: {\n extensions: def.extensions,\n value: def.resolveImportFileHandle?.(cellData),\n resolveProgress: () => {\n return def.resolveImportProgress?.(cellData);\n },\n },\n };\n },\n },\n def,\n ),\n );\n }\n\n public build() {\n return this.#options;\n }\n}\n\n// Simple helper to use like column<string> in grid options literal\ntype ColumnFunc<TData> = <TValue>(\n def: ColDefExtended<TData, TValue>,\n) => ColDefExtended<TData, TValue>;\n\n/**\n * Returns a set of Ag Grid options along with a reference to the Ag Grid API.\n * (This is a fast prototype)\n *\n * @example\n * ```ts\n * const { gridOptions, gridApi } = useAgGridOptions(() => ({\n * // custom grid options here\n * }));\n *\n * // Usage in a template (v-bind is required!)\n * <template>\n * <AgGridVue :style=\"{ height: '100%' }\" v-bind=\"gridOptions\" />\n * </template>\n * ```\n */\nexport function useAgGridOptions<TData>(\n factory: (context: {\n builder: Builder<TData>;\n column: ColumnFunc<TData>;\n }) => Builder<TData> | GridOptionsExtended<TData>,\n) {\n const gridApi = shallowRef<GridApi>();\n\n const extOptions = computed<GridOptionsExtended>(() => {\n const def: GridOptionsExtended<TData> = {\n theme: AgGridTheme,\n loadingOverlayComponent: PlAgOverlayLoading,\n noRowsOverlayComponent: PlAgOverlayNoRows,\n onGridReady: (e: GridReadyEvent) => {\n gridApi.value = e.api;\n autoSizeRowNumberColumn(e.api); // @TODO\n },\n };\n\n const column = <TValue>(def: ColDefExtended<TData, TValue>) => {\n return def;\n };\n\n const result = factory({ builder: new Builder(), column });\n\n const options = Object.assign({}, def, result instanceof Builder ? result.build() : result);\n\n if (options.rowNumbersColumn) {\n options.columnDefs = [makeRowNumberColDef(), ...(options.columnDefs ?? [])];\n }\n\n if (options.noRowsText) {\n options.noRowsOverlayComponentParams = {\n text: options.noRowsText,\n };\n }\n\n if (\"loadingOverlayComponentParams\" in options) {\n console.warn(\n \"useAgGridOptions: remove loadingOverlayComponentParams from options, use loading, notReady, loadingText instead\",\n );\n }\n\n options.loading = options.notReady || options.loading;\n\n options.columnDefs = options.columnDefs?.map((it) => createAgGridColDef(it));\n\n // Register all special components\n options.components = Object.assign({}, options.components ?? {}, {\n PlAgCellFile,\n PlAgChartStackedBarCell,\n PlAgChartHistogramCell,\n PlAgCellStatusTag,\n });\n\n return options;\n });\n\n const gridOptions = computed<GridOptions>(() => {\n const options = extOptions.value;\n\n return {\n ...options,\n loadingOverlayComponentParams: {\n variant: options.notReady ? \"not-ready\" : \"loading\",\n notReadyText: options.notReadyText,\n loadingText: options.loadingText,\n } satisfies PlAgOverlayLoadingParams,\n };\n });\n\n whenever(\n () => extOptions.value.rowNumbersColumn,\n () => {\n if (gridApi.value) {\n autoSizeRowNumberColumn(gridApi.value);\n }\n },\n );\n\n watch(\n [() => extOptions.value.notReady, () => extOptions.value.loading],\n ([notReady, loading]) => {\n const loadingOverlayComponentParams = {\n variant: notReady ? \"not-ready\" : \"loading\",\n // we probably don't need to update the parameters below\n notReadyText: extOptions.value.notReadyText,\n loadingText: extOptions.value.loadingText,\n } satisfies PlAgOverlayLoadingParams;\n\n // Hack to apply loadingOverlayComponentParams\n gridApi.value?.updateGridOptions({\n loading: !loading,\n loadingOverlayComponentParams,\n });\n\n gridApi.value?.updateGridOptions({\n loading,\n loadingOverlayComponentParams,\n });\n },\n { deep: true, immediate: true },\n );\n\n return { gridOptions, gridApi };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+DA,IAAM,IAAN,MAAqB;CACnB,KAAuC,EAAE;CAEzC,QAAe,GAAqC;AAElD,SADA,MAAA,IAAgB,OAAO,OAAO,EAAE,EAAE,MAAA,GAAe,EAAQ,EAClD;;CAGT,IAAY,aAAa;AACvB,SAAO,MAAA,EAAc,cAAc,EAAE;;;;;;;CAQvC,iBAAwB,GAA4B;AAElD,SADA,MAAA,EAAc,gBAAgB,GACvB;;;;;;;CAQT,WAAkB,GAAmB;AAEnC,SADA,MAAA,EAAc,UAAU,GACjB;;;;;;;CAQT,eAAsB,GAAsB;AAE1C,SADA,MAAA,EAAc,cAAc,GACrB;;;;;;;CAQT,YAAmB,GAAoB;AAErC,SADA,MAAA,EAAc,WAAW,GAClB;;;;;;;CAQT,gBAAuB,GAAuB;AAE5C,SADA,MAAA,EAAc,eAAe,GACtB;;;;;;;CAQT,cAAqB,GAAqB;AAExC,SADA,MAAA,EAAc,aAAa,GACpB;;;;;;;CAQT,gBAAuB,GAAoC;AAEzD,SADA,MAAA,EAAc,eAAe,GACtB;;;;;;;CAQT,WAAkB,GAAmB;AAEnC,SADA,MAAA,EAAc,UAAU,GACjB;;;;;;;CAQT,cAAqB,GAAwC;AAE3D,SADA,MAAA,EAAc,aAAa,GACpB;;;;;;;;CAST,UACE,GACA,GACA;AAEA,SADA,MAAA,EAAc,KAAO,GACd;;;;;;;CAQT,OAA4B,GAAoC;AAE9D,SADA,MAAA,EAAc,aAAa,CAAC,GAAG,KAAK,YAAY,EAAI,EAC7C;;;;;;;CAQT,i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,CAAC,EAEK;GACP,EAEI,IAAc,QAA4B;EAC9C,IAAM,IAAU,EAAW;AAE3B,SAAO;GACL,GAAG;GACH,+BAA+B;IAC7B,SAAS,EAAQ,WAAW,cAAc;IAC1C,cAAc,EAAQ;IACtB,aAAa,EAAQ;IACtB;GACF;GACD;AAmCF,QAjCA,QACQ,EAAW,MAAM,wBACjB;AACJ,EAAI,EAAQ,SACV,EAAwB,EAAQ,MAAM;GAG3C,EAED,EACE,OAAO,EAAW,MAAM,gBAAgB,EAAW,MAAM,QAAQ,GAChE,CAAC,GAAU,OAAa;EACvB,IAAM,IAAgC;GACpC,SAAS,IAAW,cAAc;GAElC,cAAc,EAAW,MAAM;GAC/B,aAAa,EAAW,MAAM;GAC/B;AAQD,EALA,EAAQ,OAAO,kBAAkB;GAC/B,SAAS,CAAC;GACV;GACD,CAAC,EAEF,EAAQ,OAAO,kBAAkB;GAC/B;GACA;GACD,CAAC;IAEJ;EAAE,MAAM;EAAM,WAAW;EAAM,CAChC,EAEM;EAAE;EAAa;EAAS"}
|
|
1
|
+
{"version":3,"file":"useAgGridOptions.js","names":["#options"],"sources":["../../src/AgGridVue/useAgGridOptions.ts"],"sourcesContent":["/**/\nimport type {\n ColGroupDef,\n GridApi,\n GridOptions,\n GridReadyEvent,\n ICellRendererParams,\n RowSelectionOptions,\n ValueSetterParams,\n} from \"ag-grid-enterprise\";\nimport type { Component } from \"vue\";\nimport { computed, shallowRef, watch } from \"vue\";\nimport {\n autoSizeRowNumberColumn,\n makeRowNumberColDef,\n PlAgOverlayLoading,\n type PlAgOverlayLoadingParams,\n} from \"../components/PlAgDataTable\";\nimport { PlAgOverlayNoRows } from \"../components/PlAgDataTable\";\nimport { createAgGridColDef, type ColDefExtended } from \"./createAgGridColDef\";\nimport { whenever } from \"@vueuse/core\";\nimport { PlAgCellFile } from \"../components/PlAgCellFile\";\nimport { PlAgChartStackedBarCell } from \"../components/PlAgChartStackedBarCell\";\nimport { PlAgChartHistogramCell } from \"../components/PlAgChartHistogramCell\";\nimport type { ImportFileHandle } from \"@platforma-sdk/model\";\nimport type { ImportProgress } from \"@platforma-sdk/model\";\nimport { PlAgCellStatusTag } from \"../components/PlAgCellStatusTag\";\nimport { AgGridTheme } from \"./AgGridTheme\";\ninterface GridOptionsExtended<TData = any> extends Omit<\n GridOptions<TData>,\n \"columnDefs\" | \"loadingOverlayComponentParams\"\n> {\n /**\n * Array of Column / Column Group definitions.\n */\n columnDefs?: (ColDefExtended<TData> | ColGroupDef<TData>)[] | null;\n /**\n * Show row numbers column\n */\n rowNumbersColumn?: boolean;\n /**\n * Loading overlay text\n */\n loadingText?: string;\n /**\n * Not ready overlay (Data is not computed). Takes priority over \"loading\"\n */\n notReady?: boolean;\n /**\n * \"Data is not computed\" by default\n */\n notReadyText?: string;\n /**\n * Override standard 'Empty' text for the \"no rows\" overlay\n */\n noRowsText?: string;\n /**\n * @deprecated Use loading, notReady, loadingText instead\n */\n loadingOverlayComponentParams?: never;\n}\n\n// @TODO (super simple builder for now)\nclass Builder<TData> {\n #options: GridOptionsExtended<TData> = {};\n\n public options(options: GridOptionsExtended<TData>) {\n this.#options = Object.assign({}, this.#options, options);\n return this;\n }\n\n private get columnDefs() {\n return this.#options.columnDefs ?? [];\n }\n\n /**\n * Set default column definition\n * @param def - column definition\n * @returns this\n */\n public setDefaultColDef(def: ColDefExtended<TData>) {\n this.#options.defaultColDef = def;\n return this;\n }\n\n /**\n * Show loading overlay\n * @param loading\n * @returns this\n */\n public setLoading(loading?: boolean) {\n this.#options.loading = loading;\n return this;\n }\n\n /**\n * Set loading overlay custom text (default is \"Loading\")\n * @param loadingText\n * @returns this\n */\n public setLoadingText(loadingText?: string) {\n this.#options.loadingText = loadingText;\n return this;\n }\n\n /**\n * Show \"not ready overlay\n * @param notReady\n * @returns this\n */\n public setNotReady(notReady?: boolean) {\n this.#options.notReady = notReady;\n return this;\n }\n\n /**\n * Set \"not ready\" text\n * @param notReadyText\n * @returns this\n */\n public setNotReadyText(notReadyText?: string) {\n this.#options.notReadyText = notReadyText;\n return this;\n }\n\n /**\n * Set \"no rows\" text when there are no rows (default is \"Empty\")\n * @param noRowsText\n * @returns this\n */\n public setNoRowsText(noRowsText?: string) {\n this.#options.noRowsText = noRowsText;\n return this;\n }\n\n /**\n * Set row selection options\n * @param rowSelection\n * @returns this\n */\n public setRowSelection(rowSelection?: RowSelectionOptions) {\n this.#options.rowSelection = rowSelection;\n return this;\n }\n\n /**\n * Set row data\n * @param rowData\n * @returns this\n */\n public setRowData(rowData?: TData[]) {\n this.#options.rowData = rowData;\n return this;\n }\n\n /**\n * Set components\n * @param components\n * @returns this\n */\n public setComponents(components?: Record<string, Component>) {\n this.#options.components = components;\n return this;\n }\n\n /**\n * Set an option\n * @param key - option key\n * @param value - option value\n * @returns this\n */\n public setOption<K extends keyof GridOptionsExtended<TData>>(\n key: K,\n value: GridOptionsExtended<TData>[K],\n ) {\n this.#options[key] = value;\n return this;\n }\n\n /**\n * Add an extended column definition\n * @param def - column definition\n * @returns this\n */\n public column<TValue = any>(def: ColDefExtended<TData, TValue>) {\n this.#options.columnDefs = [...this.columnDefs, def];\n return this;\n }\n\n /**\n * Show row numbers column\n * @param show - show or hide row numbers column\n * @returns this\n */\n public columnRowNumbers(show: boolean = true) {\n this.#options.rowNumbersColumn = show;\n return this;\n }\n\n /**\n * Add a file input column\n * @param def - column definition\n * @param cb - callback to set params for the file input cell renderer\n * @returns this\n */\n public columnFileInput<TValue = any>(\n def: ColDefExtended<TData, TValue> & {\n /**\n * Allowed file extensions (like ['fastq.gz'])\n */\n extensions?: string[];\n /**\n * The resolveProgress function is an optional input parameter for the component\n * that allows tracking the file upload progress in real-time.\n * By passing resolveProgress, you can ensure that the component\n * displays accurate progress values for each file as they upload.\n * How to use it in AgGrid\n * cellRendererParams: {\n * resolveProgress: (cellData) => {\n * const progresses = app.progresses;\n * if (!cellData.value.importFileHandle) return undefined;\n * else return progresses[cellData.value.importFileHandle];\n * }\n * }\n */\n resolveImportProgress?: (\n cellData: ICellRendererParams<TData, TValue>,\n ) => ImportProgress | undefined;\n\n /**\n * The resolveFileHandle function is an optional input parameter for the component\n * that allows tracking the file upload progress in real-time.\n * By passing resolveFileHandle, you can ensure that the component\n * displays accurate progress values for each file as they upload.\n * How to use it in AgGrid\n * cellRendererParams: {\n * resolveFileHandle: (cellData) => {\n * return cellData.value.importFileHandle;\n * }\n * }\n */\n resolveImportFileHandle?: (\n cellData: ICellRendererParams<TData, TValue>,\n ) => ImportFileHandle | undefined;\n\n setImportFileHandle?: (d: ValueSetterParams<TData, ImportFileHandle | undefined>) => void;\n },\n ) {\n return this.column(\n Object.assign(\n {\n cellRenderer: \"PlAgCellFile\",\n headerComponentParams: { type: \"File\" },\n cellStyle: { padding: 0 },\n valueSetter: (d: ValueSetterParams<TData, ImportFileHandle | undefined>) => {\n def.setImportFileHandle?.(d);\n return true;\n },\n cellRendererSelector: (cellData: ICellRendererParams<TData, TValue>) => {\n return {\n component: \"PlAgCellFile\",\n params: {\n extensions: def.extensions,\n value: def.resolveImportFileHandle?.(cellData),\n resolveProgress: () => {\n return def.resolveImportProgress?.(cellData);\n },\n },\n };\n },\n },\n def,\n ),\n );\n }\n\n public build() {\n return this.#options;\n }\n}\n\n// Simple helper to use like column<string> in grid options literal\ntype ColumnFunc<TData> = <TValue>(\n def: ColDefExtended<TData, TValue>,\n) => ColDefExtended<TData, TValue>;\n\n/**\n * Returns a set of Ag Grid options along with a reference to the Ag Grid API.\n * (This is a fast prototype)\n *\n * @example\n * ```ts\n * const { gridOptions, gridApi } = useAgGridOptions(() => ({\n * // custom grid options here\n * }));\n *\n * // Usage in a template (v-bind is required!)\n * <template>\n * <AgGridVue :style=\"{ height: '100%' }\" v-bind=\"gridOptions\" />\n * </template>\n * ```\n */\nexport function useAgGridOptions<TData>(\n factory: (context: {\n builder: Builder<TData>;\n column: ColumnFunc<TData>;\n }) => Builder<TData> | GridOptionsExtended<TData>,\n) {\n const gridApi = shallowRef<GridApi>();\n\n const extOptions = computed<GridOptionsExtended>(() => {\n const def: GridOptionsExtended<TData> = {\n theme: AgGridTheme,\n loadingOverlayComponent: PlAgOverlayLoading,\n noRowsOverlayComponent: PlAgOverlayNoRows,\n onGridReady: (e: GridReadyEvent) => {\n gridApi.value = e.api;\n autoSizeRowNumberColumn(e.api); // @TODO\n },\n };\n\n const column = <TValue>(def: ColDefExtended<TData, TValue>) => {\n return def;\n };\n\n const result = factory({ builder: new Builder(), column });\n\n const options = Object.assign({}, def, result instanceof Builder ? result.build() : result);\n\n if (options.rowNumbersColumn) {\n options.columnDefs = [makeRowNumberColDef(), ...(options.columnDefs ?? [])];\n }\n\n if (options.noRowsText) {\n options.noRowsOverlayComponentParams = {\n text: options.noRowsText,\n };\n }\n\n if (\"loadingOverlayComponentParams\" in options) {\n console.warn(\n \"useAgGridOptions: remove loadingOverlayComponentParams from options, use loading, notReady, loadingText instead\",\n );\n }\n\n options.loading = options.notReady || options.loading;\n\n options.columnDefs = options.columnDefs?.map((it) => createAgGridColDef(it));\n\n // Register all special components\n options.components = Object.assign({}, options.components ?? {}, {\n PlAgCellFile,\n PlAgChartStackedBarCell,\n PlAgChartHistogramCell,\n PlAgCellStatusTag,\n });\n\n return options;\n });\n\n const gridOptions = computed<GridOptions>(() => {\n const options = extOptions.value;\n\n return {\n ...options,\n loadingOverlayComponentParams: {\n variant: options.notReady ? \"not-ready\" : \"loading\",\n notReadyText: options.notReadyText,\n loadingText: options.loadingText,\n } satisfies PlAgOverlayLoadingParams,\n };\n });\n\n whenever(\n () => extOptions.value.rowNumbersColumn,\n () => {\n if (gridApi.value) {\n autoSizeRowNumberColumn(gridApi.value);\n }\n },\n );\n\n watch(\n [() => extOptions.value.notReady, () => extOptions.value.loading],\n ([notReady, loading]) => {\n const loadingOverlayComponentParams = {\n variant: notReady ? \"not-ready\" : \"loading\",\n // we probably don't need to update the parameters below\n notReadyText: extOptions.value.notReadyText,\n loadingText: extOptions.value.loadingText,\n } satisfies PlAgOverlayLoadingParams;\n\n // Hack to apply loadingOverlayComponentParams\n gridApi.value?.updateGridOptions({\n loading: !loading,\n loadingOverlayComponentParams,\n });\n\n gridApi.value?.updateGridOptions({\n loading,\n loadingOverlayComponentParams,\n });\n },\n { deep: true, immediate: true },\n );\n\n return { gridOptions, gridApi };\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+DA,IAAM,IAAN,MAAqB;CACnB,KAAuC,EAAE;CAEzC,QAAe,GAAqC;AAElD,SADA,MAAA,IAAgB,OAAO,OAAO,EAAE,EAAE,MAAA,GAAe,EAAQ,EAClD;;CAGT,IAAY,aAAa;AACvB,SAAO,MAAA,EAAc,cAAc,EAAE;;;;;;;CAQvC,iBAAwB,GAA4B;AAElD,SADA,MAAA,EAAc,gBAAgB,GACvB;;;;;;;CAQT,WAAkB,GAAmB;AAEnC,SADA,MAAA,EAAc,UAAU,GACjB;;;;;;;CAQT,eAAsB,GAAsB;AAE1C,SADA,MAAA,EAAc,cAAc,GACrB;;;;;;;CAQT,YAAmB,GAAoB;AAErC,SADA,MAAA,EAAc,WAAW,GAClB;;;;;;;CAQT,gBAAuB,GAAuB;AAE5C,SADA,MAAA,EAAc,eAAe,GACtB;;;;;;;CAQT,cAAqB,GAAqB;AAExC,SADA,MAAA,EAAc,aAAa,GACpB;;;;;;;CAQT,gBAAuB,GAAoC;AAEzD,SADA,MAAA,EAAc,eAAe,GACtB;;;;;;;CAQT,WAAkB,GAAmB;AAEnC,SADA,MAAA,EAAc,UAAU,GACjB;;;;;;;CAQT,cAAqB,GAAwC;AAE3D,SADA,MAAA,EAAc,aAAa,GACpB;;;;;;;;CAST,UACE,GACA,GACA;AAEA,SADA,MAAA,EAAc,KAAO,GACd;;;;;;;CAQT,OAA4B,GAAoC;AAE9D,SADA,MAAA,EAAc,aAAa,CAAC,GAAG,KAAK,YAAY,EAAI,EAC7C;;;;;;;CAQT,iBAAwB,IAAgB,IAAM;AAE5C,SADA,MAAA,EAAc,mBAAmB,GAC1B;;;;;;;;CAST,gBACE,GAyC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G;GACH,+BAA+B;IAC7B,SAAS,EAAQ,WAAW,cAAc;IAC1C,cAAc,EAAQ;IACtB,aAAa,EAAQ;IACtB;GACF;GACD;AAmCF,QAjCA,QACQ,EAAW,MAAM,wBACjB;AACJ,EAAI,EAAQ,SACV,EAAwB,EAAQ,MAAM;GAG3C,EAED,EACE,OAAO,EAAW,MAAM,gBAAgB,EAAW,MAAM,QAAQ,GAChE,CAAC,GAAU,OAAa;EACvB,IAAM,IAAgC;GACpC,SAAS,IAAW,cAAc;GAElC,cAAc,EAAW,MAAM;GAC/B,aAAa,EAAW,MAAM;GAC/B;AAQD,EALA,EAAQ,OAAO,kBAAkB;GAC/B,SAAS,CAAC;GACV;GACD,CAAC,EAEF,EAAQ,OAAO,kBAAkB;GAC/B;GACA;GACD,CAAC;IAEJ;EAAE,MAAM;EAAM,WAAW;EAAM,CAChC,EAEM;EAAE;EAAa;EAAS"}
|
|
@@ -6,6 +6,7 @@ export type NormalizedSpecData = {
|
|
|
6
6
|
valueType: ValueType;
|
|
7
7
|
annotations: PColumnSpec["annotations"];
|
|
8
8
|
domain: PColumnSpec["domain"];
|
|
9
|
+
contextDomain: PColumnSpec["contextDomain"];
|
|
9
10
|
};
|
|
10
11
|
export declare function getNormalizedSpec(spec: PColumnSpec | AxisSpec): NormalizedSpecData;
|
|
11
12
|
export declare function isNumericValueType(spec?: PColumnSpec | AxisSpec): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/PlAdvancedFilter/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAKV,SAAS,EACV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAML,KAAK,QAAQ,EACb,KAAK,WAAW,EAEjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC1C,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,o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AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,IAAI,OAAO,CACxE,cAAc,EACd;IACE,IAAI,EACA,OAAO,GACP,UAAU,GACV,UAAU,GACV,iBAAiB,GACjB,aAAa,GACb,oBAAoB,CAAC;CAC1B,CACF,CASA;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,cAAc,GACrB,MAAM,IAAI,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC,CAEjE;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,IAAI,OAAO,CACvE,cAAc,EACd;IACE,IAAI,EACA,eAAe,GACf,kBAAkB,GAClB,2BAA2B,GAC3B,8BAA8B,GAC9B,iCAAiC,GACjC,gCAAgC,CAAC;CACtC,CACF,CASA;AAED,wBAAgB,aAAa,CAAC,UAAU,EAAE,oBAAoB,GAAG;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,OAAO,CAAC;CACrD,CAEA;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,wBAAwB,CAY3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":[],"sources":["../../../src/components/PlAdvancedFilter/utils.ts"],"sourcesContent":["import { filterUiMetadata } from \"@milaboratories/uikit\";\nimport type {\n AnchoredPColumnId,\n AxisId,\n CanonicalizedJson,\n FilteredPColumnId,\n ValueType,\n} from \"@platforma-sdk/model\";\nimport {\n getTypeFromPColumnOrAxisSpec,\n isAnchoredPColumnId,\n isAxisId,\n isFilteredPColumn,\n parseJson,\n type AxisSpec,\n type PColumnSpec,\n type SUniversalPColumnId,\n} from \"@platforma-sdk/model\";\nimport { DEFAULT_FILTER_TYPE, DEFAULT_FILTERS } from \"./constants\";\nimport type { NodeFilter } from \"./types\";\nimport {\n type CommonFilter,\n type EditableFilter,\n type PlAdvancedFilterColumnId,\n type SupportedFilterTypes,\n} from \"./types\";\n\nexport function getNewId() {\n return Date.now();\n}\n\nexport function createNewGroup(selectedSourceId: string): NodeFilter {\n return {\n id: getNewId(),\n isExpanded: true,\n type: \"and\",\n filters: [\n {\n id: getNewId(),\n isExpanded: true,\n ...DEFAULT_FILTERS[DEFAULT_FILTER_TYPE],\n column: selectedSourceId as SUniversalPColumnId,\n } as CommonFilter,\n ],\n };\n}\n\nexport type NormalizedSpecData = {\n valueType: ValueType;\n annotations: PColumnSpec[\"annotations\"];\n domain: PColumnSpec[\"domain\"];\n};\nexport function getNormalizedSpec(spec: PColumnSpec | AxisSpec): NormalizedSpecData {\n return {\n valueType: getTypeFromPColumnOrAxisSpec(spec),\n annotations: spec.annotations,\n domain: spec.domain,\n };\n}\n\nexport function isNumericValueType(spec?: PColumnSpec | AxisSpec): boolean {\n if (!spec) {\n return false;\n }\n const valueType = getNormalizedSpec(spec).valueType;\n return (\n valueType === \"Int\" || valueType === \"Long\" || valueType === \"Float\" || valueType === \"Double\"\n );\n}\n\nexport function isStringValueType(spec?: PColumnSpec | AxisSpec): boolean {\n if (!spec) {\n return false;\n }\n const valueType = getNormalizedSpec(spec).valueType;\n return valueType === \"String\";\n}\n\nexport function isNumericFilter(filter: EditableFilter): filter is Extract<\n EditableFilter,\n {\n type:\n | \"equal\"\n | \"notEqual\"\n | \"lessThan\"\n | \"lessThanOrEqual\"\n | \"greaterThan\"\n | \"greaterThanOrEqual\";\n }\n> {\n return (\n filter.type === \"equal\" ||\n filter.type === \"notEqual\" ||\n filter.type === \"lessThan\" ||\n filter.type === \"lessThanOrEqual\" ||\n filter.type === \"greaterThan\" ||\n filter.type === \"greaterThanOrEqual\"\n );\n}\n\nexport function isPositionFilter(\n filter: EditableFilter,\n): filter is Extract<EditableFilter, { type: \"topN\" | \"bottomN\" }> {\n return filter.type === \"topN\" || filter.type === \"bottomN\";\n}\n\nexport function isStringFilter(filter: EditableFilter): filter is Extract<\n EditableFilter,\n {\n type:\n | \"patternEquals\"\n | \"patternNotEquals\"\n | \"patternContainSubsequence\"\n | \"patternNotContainSubsequence\"\n | \"patternMatchesRegularExpression\"\n | \"patternFuzzyContainSubsequence\";\n }\n> {\n return (\n filter.type === \"patternEquals\" ||\n filter.type === \"patternNotEquals\" ||\n filter.type === \"patternContainSubsequence\" ||\n filter.type === \"patternNotContainSubsequence\" ||\n filter.type === \"patternMatchesRegularExpression\" ||\n filter.type === \"patternFuzzyContainSubsequence\"\n );\n}\n\nexport function getFilterInfo(filterType: SupportedFilterTypes): {\n label: string;\n supportedFor: (spec: NormalizedSpecData) => boolean;\n} {\n return filterUiMetadata[filterType as keyof typeof filterUiMetadata];\n}\n\nexport function isValidColumnId(id: unknown): id is PlAdvancedFilterColumnId {\n if (typeof id !== \"string\") {\n return false;\n }\n try {\n const parsedId = parseJson<FilteredPColumnId | AnchoredPColumnId | AxisId>(\n id as CanonicalizedJson<FilteredPColumnId | AnchoredPColumnId | AxisId>,\n );\n return isFilteredPColumn(parsedId) || isAnchoredPColumnId(parsedId) || isAxisId(parsedId);\n } catch {\n return false;\n }\n}\n"],"mappings":";;;AA2BA,SAAgB,IAAW;AACzB,QAAO,KAAK,KAAK;;AAGnB,SAAgB,EAAe,GAAsC;AACnE,QAAO;EACL,IAAI,GAAU;EACd,YAAY;EACZ,MAAM;EACN,SAAS,CACP;GACE,IAAI,GAAU;GACd,YAAY;GACZ,GAAG,EAAgB;GACnB,QAAQ;GACT,CACF;EACF;;
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../../src/components/PlAdvancedFilter/utils.ts"],"sourcesContent":["import { filterUiMetadata } from \"@milaboratories/uikit\";\nimport type {\n AnchoredPColumnId,\n AxisId,\n CanonicalizedJson,\n FilteredPColumnId,\n ValueType,\n} from \"@platforma-sdk/model\";\nimport {\n getTypeFromPColumnOrAxisSpec,\n isAnchoredPColumnId,\n isAxisId,\n isFilteredPColumn,\n parseJson,\n type AxisSpec,\n type PColumnSpec,\n type SUniversalPColumnId,\n} from \"@platforma-sdk/model\";\nimport { DEFAULT_FILTER_TYPE, DEFAULT_FILTERS } from \"./constants\";\nimport type { NodeFilter } from \"./types\";\nimport {\n type CommonFilter,\n type EditableFilter,\n type PlAdvancedFilterColumnId,\n type SupportedFilterTypes,\n} from \"./types\";\n\nexport function getNewId() {\n return Date.now();\n}\n\nexport function createNewGroup(selectedSourceId: string): NodeFilter {\n return {\n id: getNewId(),\n isExpanded: true,\n type: \"and\",\n filters: [\n {\n id: getNewId(),\n isExpanded: true,\n ...DEFAULT_FILTERS[DEFAULT_FILTER_TYPE],\n column: selectedSourceId as SUniversalPColumnId,\n } as CommonFilter,\n ],\n };\n}\n\nexport type NormalizedSpecData = {\n valueType: ValueType;\n annotations: PColumnSpec[\"annotations\"];\n domain: PColumnSpec[\"domain\"];\n contextDomain: PColumnSpec[\"contextDomain\"];\n};\nexport function getNormalizedSpec(spec: PColumnSpec | AxisSpec): NormalizedSpecData {\n return {\n valueType: getTypeFromPColumnOrAxisSpec(spec),\n annotations: spec.annotations,\n domain: spec.domain,\n contextDomain: spec.contextDomain,\n };\n}\n\nexport function isNumericValueType(spec?: PColumnSpec | AxisSpec): boolean {\n if (!spec) {\n return false;\n }\n const valueType = getNormalizedSpec(spec).valueType;\n return (\n valueType === \"Int\" || valueType === \"Long\" || valueType === \"Float\" || valueType === \"Double\"\n );\n}\n\nexport function isStringValueType(spec?: PColumnSpec | AxisSpec): boolean {\n if (!spec) {\n return false;\n }\n const valueType = getNormalizedSpec(spec).valueType;\n return valueType === \"String\";\n}\n\nexport function isNumericFilter(filter: EditableFilter): filter is Extract<\n EditableFilter,\n {\n type:\n | \"equal\"\n | \"notEqual\"\n | \"lessThan\"\n | \"lessThanOrEqual\"\n | \"greaterThan\"\n | \"greaterThanOrEqual\";\n }\n> {\n return (\n filter.type === \"equal\" ||\n filter.type === \"notEqual\" ||\n filter.type === \"lessThan\" ||\n filter.type === \"lessThanOrEqual\" ||\n filter.type === \"greaterThan\" ||\n filter.type === \"greaterThanOrEqual\"\n );\n}\n\nexport function isPositionFilter(\n filter: EditableFilter,\n): filter is Extract<EditableFilter, { type: \"topN\" | \"bottomN\" }> {\n return filter.type === \"topN\" || filter.type === \"bottomN\";\n}\n\nexport function isStringFilter(filter: EditableFilter): filter is Extract<\n EditableFilter,\n {\n type:\n | \"patternEquals\"\n | \"patternNotEquals\"\n | \"patternContainSubsequence\"\n | \"patternNotContainSubsequence\"\n | \"patternMatchesRegularExpression\"\n | \"patternFuzzyContainSubsequence\";\n }\n> {\n return (\n filter.type === \"patternEquals\" ||\n filter.type === \"patternNotEquals\" ||\n filter.type === \"patternContainSubsequence\" ||\n filter.type === \"patternNotContainSubsequence\" ||\n filter.type === \"patternMatchesRegularExpression\" ||\n filter.type === \"patternFuzzyContainSubsequence\"\n );\n}\n\nexport function getFilterInfo(filterType: SupportedFilterTypes): {\n label: string;\n supportedFor: (spec: NormalizedSpecData) => boolean;\n} {\n return filterUiMetadata[filterType as keyof typeof filterUiMetadata];\n}\n\nexport function isValidColumnId(id: unknown): id is PlAdvancedFilterColumnId {\n if (typeof id !== \"string\") {\n return false;\n }\n try {\n const parsedId = parseJson<FilteredPColumnId | AnchoredPColumnId | AxisId>(\n id as CanonicalizedJson<FilteredPColumnId | AnchoredPColumnId | AxisId>,\n );\n return isFilteredPColumn(parsedId) || isAnchoredPColumnId(parsedId) || isAxisId(parsedId);\n } catch {\n return false;\n }\n}\n"],"mappings":";;;AA2BA,SAAgB,IAAW;AACzB,QAAO,KAAK,KAAK;;AAGnB,SAAgB,EAAe,GAAsC;AACnE,QAAO;EACL,IAAI,GAAU;EACd,YAAY;EACZ,MAAM;EACN,SAAS,CACP;GACE,IAAI,GAAU;GACd,YAAY;GACZ,GAAG,EAAgB;GACnB,QAAQ;GACT,CACF;EACF;;AASH,SAAgB,EAAkB,GAAkD;AAClF,QAAO;EACL,WAAW,EAA6B,EAAK;EAC7C,aAAa,EAAK;EAClB,QAAQ,EAAK;EACb,eAAe,EAAK;EACrB;;AAGH,SAAgB,EAAmB,GAAwC;AACzE,KAAI,CAAC,EACH,QAAO;CAET,IAAM,IAAY,EAAkB,EAAK,CAAC;AAC1C,QACE,MAAc,SAAS,MAAc,UAAU,MAAc,WAAW,MAAc;;AAI1F,SAAgB,EAAkB,GAAwC;AAKxE,QAJK,IAGa,EAAkB,EAAK,CAAC,cACrB,WAHZ;;AAMX,SAAgB,EAAgB,GAW9B;AACA,QACE,EAAO,SAAS,WAChB,EAAO,SAAS,cAChB,EAAO,SAAS,cAChB,EAAO,SAAS,qBAChB,EAAO,SAAS,iBAChB,EAAO,SAAS;;AAIpB,SAAgB,EACd,GACiE;AACjE,QAAO,EAAO,SAAS,UAAU,EAAO,SAAS;;AAyBnD,SAAgB,EAAc,GAG5B;AACA,QAAO,EAAiB;;AAG1B,SAAgB,EAAgB,GAA6C;AAC3E,KAAI,OAAO,KAAO,SAChB,QAAO;AAET,KAAI;EACF,IAAM,IAAW,EACf,EACD;AACD,SAAO,EAAkB,EAAS,IAAI,EAAoB,EAAS,IAAI,EAAS,EAAS;SACnF;AACN,SAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgDataTableV2.js","names":[],"sources":["../../../src/components/PlAgDataTable/PlAgDataTableV2.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { promiseTimeout, isJsonEqual } from \"@milaboratories/helpers\";\nimport type {\n AxisId,\n PlDataTableGridStateCore,\n PlDataTableStateV2,\n PlSelectionModel,\n PlTableColumnIdJson,\n PTableColumnSpec,\n PTableKey,\n} from \"@platforma-sdk/model\";\nimport {\n getRawPlatformaInstance,\n createPlSelectionModel,\n matchAxisId,\n getAxisId,\n canonicalizeJson,\n isAbortError,\n isColumnOptional,\n} from \"@platforma-sdk/model\";\nimport type { CellRendererSelectorFunc, GridApi, GridState } from \"ag-grid-enterprise\";\nimport { AgGridVue } from \"ag-grid-vue3\";\nimport { computed, effectScope, nextTick, ref, toRefs, watch, watchEffect } from \"vue\";\nimport PlAgCsvExporter from \"../PlAgCsvExporter/PlAgCsvExporter.vue\";\nimport { PlAgGridColumnManager } from \"../PlAgGridColumnManager\";\nimport PlTableFiltersV2 from \"../PlTableFilters/PlTableFiltersV2.vue\";\nimport { PlTableFastSearch } from \"../PlTableFastSearch\";\nimport PlAgDataTableSheets from \"./PlAgDataTableSheets.vue\";\nimport PlAgRowCount from \"./PlAgRowCount.vue\";\nimport { DeferredCircular, ensureNodeVisible } from \"./sources/focus-row\";\nimport { PlAgDataTableRowNumberColId } from \"./sources/row-number\";\nimport type { PlAgCellButtonAxisParams } from \"./sources/table-source-v2\";\nimport { calculateGridOptions } from \"./sources/table-source-v2\";\nimport { useTableState } from \"./sources/table-state-v2\";\nimport type {\n PlAgDataTableV2Controller,\n PlAgDataTableV2Row,\n PlAgOverlayLoadingParams,\n PlAgOverlayNoRowsParams,\n PlDataTableSettingsV2,\n PlDataTableSheetsSettings,\n PlTableRowId,\n} from \"./types\";\nimport { useFilterableColumns } from \"./compositions/useFilterableColumns\";\nimport { useGrid } from \"./compositions/useGrid\";\nimport { AgGridTheme } from \"./compositions/useTheme\";\n\nconst tableState = defineModel<PlDataTableStateV2>({\n required: true,\n});\n/** Warning: selection model value updates are ignored, use updateSelection instead */\nconst selection = defineModel<PlSelectionModel>(\"selection\");\nconst props = defineProps<{\n /** Required component settings */\n settings: Readonly<PlDataTableSettingsV2>;\n\n /**\n * The disableColumnsPanel prop controls the display of a button that activates\n * the columns management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableColumnsPanel?: boolean;\n\n /**\n * The disableFiltersPanel prop controls the display of a button that activates\n * the filters management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableFiltersPanel?: boolean;\n\n /**\n * The showExportButton prop controls the display of a button that allows\n * to export table data in CSV format. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n showExportButton?: boolean;\n\n /**\n * The AxisId property is used to configure and display the PlAgTextAndButtonCell component\n */\n showCellButtonForAxisId?: AxisId;\n\n /**\n * If cellButtonInvokeRowsOnDoubleClick = true, clicking a button inside the row\n * triggers the doubleClick event for the entire row.\n *\n * If cellButtonInvokeRowsOnDoubleClick = false, the doubleClick event for the row\n * is not triggered, but will triggered cellButtonClicked event with (key: PTableRowKey) argument.\n */\n cellButtonInvokeRowsOnDoubleClick?: boolean;\n\n /** @see {@link PlAgOverlayLoadingParams.loadingText} */\n loadingText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.runningText} */\n runningText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.notReadyText} */\n notReadyText?: string;\n\n /** @see {@link PlAgOverlayNoRowsParams.text} */\n noRowsText?: string;\n\n /**\n * Callback to override the default renderer for a given cell.\n * @see https://www.ag-grid.com/vue-data-grid/component-cell-renderer/#dynamic-component-selection\n */\n cellRendererSelector?: CellRendererSelectorFunc<PlAgDataTableV2Row>;\n}>();\nconst { settings } = toRefs(props);\nconst emit = defineEmits<{\n rowDoubleClicked: [key?: PTableKey];\n cellButtonClicked: [key?: PTableKey];\n newDataRendered: [];\n}>();\n\nconst dataRenderedTracker = new DeferredCircular<GridApi<PlAgDataTableV2Row>>();\nconst { gridApi, gridOptions } = useGrid({\n selection: selection.value,\n noRowsText: props.noRowsText,\n runningText: props.runningText,\n loadingText: props.loadingText,\n notReadyText: props.notReadyText,\n cellRendererSelector: props.cellRendererSelector,\n});\nlet isReloading = false;\ngridOptions.value.onGridPreDestroyed = (event) => {\n if (!isReloading) {\n gridOptions.value.initialState = gridState.value = normalizeColumnVisibility(\n makePartialState(event.api.getState()),\n gridState.value,\n event.api,\n );\n }\n gridApi.value = null;\n};\ngridOptions.value.onRowDoubleClicked = (event) => {\n if (event.data && event.data.axesKey) emit(\"rowDoubleClicked\", event.data.axesKey);\n};\ngridOptions.value.onStateUpdated = (event) => {\n const partialState = normalizeColumnVisibility(\n makePartialState(event.state),\n gridState.value,\n event.api,\n );\n // We have to keep initialState synchronized with gridState for gridState recovery after key updating.\n gridOptions.value.initialState = gridState.value = partialState;\n\n if (!isJsonEqual(event.sources, [\"columnSizing\"])) {\n event.api.autoSizeColumns(\n event.api\n .getAllDisplayedColumns()\n .filter((column) => column.getColId() !== PlAgDataTableRowNumberColId),\n );\n }\n};\n\nconst [filterableColumns, visibleFilterableColumns] = useFilterableColumns(\n () => settings.value.sourceId,\n () => gridOptions.value.columnDefs ?? null,\n);\nconst { gridState, sheetsState, filtersState, searchString } = useTableState(\n tableState,\n settings,\n visibleFilterableColumns,\n);\nconst sheetsSettings = computed<PlDataTableSheetsSettings>(() => {\n const settingsCopy = { ...settings.value };\n return settingsCopy.sourceId !== null\n ? {\n sheets: settingsCopy.sheets ?? [],\n cachedState: [...sheetsState.value],\n }\n : {\n sheets: [],\n cachedState: [],\n };\n});\ngridOptions.value.initialState = gridState.value;\n\n// Restore proper types erased by AgGrid\nfunction makePartialState(state: GridState): PlDataTableGridStateCore {\n return {\n columnOrder: state.columnOrder as\n | {\n orderedColIds: PlTableColumnIdJson[];\n }\n | undefined,\n sort: state.sort as\n | {\n sortModel: {\n colId: PlTableColumnIdJson;\n sort: \"asc\" | \"desc\";\n }[];\n }\n | undefined,\n columnVisibility: state.columnVisibility as\n | {\n hiddenColIds: PlTableColumnIdJson[];\n }\n | undefined,\n };\n}\n\n// AG Grid returns columnVisibility: undefined when all columns are visible.\n// We need to distinguish \"no state yet\" (use isColumnOptional defaults) from\n// \"user explicitly showed all columns\" (store []). This function normalizes\n// the undefined from AG Grid based on the previous state.\nfunction normalizeColumnVisibility(\n partialState: PlDataTableGridStateCore,\n prevState: PlDataTableGridStateCore,\n api: GridApi<PlAgDataTableV2Row>,\n): PlDataTableGridStateCore {\n if (partialState.columnVisibility !== undefined) return partialState;\n\n if (prevState.columnVisibility !== undefined) {\n // Had explicit visibility state before → user made all columns visible → store [].\n return { ...partialState, columnVisibility: { hiddenColIds: [] } };\n }\n\n // No previous explicit state → compute defaults from current columns\n // to replicate: hide: hiddenColIds?.includes(colId) ?? isColumnOptional(spec.spec)\n const defaultHidden = getDefaultHiddenColIds(api);\n if (defaultHidden.length > 0) {\n return { ...partialState, columnVisibility: { hiddenColIds: defaultHidden } };\n }\n\n return partialState;\n}\n\nfunction getDefaultHiddenColIds(api: GridApi<PlAgDataTableV2Row>): PlTableColumnIdJson[] {\n const cols = api.getAllGridColumns();\n if (!cols) return [];\n return cols\n .filter((col) => {\n const spec = col.getColDef().context as PTableColumnSpec | undefined;\n return spec && isColumnOptional(spec.spec);\n })\n .map((col) => col.getColId() as PlTableColumnIdJson);\n}\n\n// Normalize columnVisibility for comparison: undefined and { hiddenColIds: [] } are equivalent.\nfunction stateForReloadCompare(state: PlDataTableGridStateCore): PlDataTableGridStateCore {\n const cv = state.columnVisibility;\n const normalizedCv = !cv || cv.hiddenColIds.length === 0 ? undefined : state.columnVisibility;\n return { ...state, columnVisibility: normalizedCv };\n}\n\n// Reload AgGrid when new state arrives from server\nconst reloadKey = ref(0);\nwatch(\n () => [gridApi.value, gridState.value] as const,\n ([gridApi, gridState]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n const selfState = makePartialState(gridApi.getState());\n if (\n !isJsonEqual(gridState, {}) &&\n !isJsonEqual(stateForReloadCompare(gridState), stateForReloadCompare(selfState))\n ) {\n isReloading = true;\n gridOptions.value.initialState = gridState;\n ++reloadKey.value;\n nextTick(() => {\n isReloading = false;\n });\n }\n },\n);\n\n// Make cellRendererSelector reactive\nconst cellRendererSelector = computed(() => props.cellRendererSelector ?? null);\nwatch(\n () => [gridApi.value, cellRendererSelector.value] as const,\n ([gridApi, cellRendererSelector]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.setGridOption(\"defaultColDef\", {\n ...gridOptions.value.defaultColDef,\n cellRendererSelector: cellRendererSelector ?? undefined,\n });\n },\n);\n\ndefineExpose<PlAgDataTableV2Controller>({\n focusRow: async (rowKey) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n return ensureNodeVisible(gridApi, (row) => isJsonEqual(row.data?.axesKey, rowKey));\n },\n updateSelection: async ({ axesSpec, selectedKeys }) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n const axes = selection.value?.axesSpec;\n if (!axes || axes.length !== axesSpec.length) return false;\n\n const mapping = axesSpec.map((spec) => {\n const id = getAxisId(spec);\n return axes.findIndex((axis) => matchAxisId(axis, id));\n });\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) return false;\n\n const selectedNodes = selectedKeys.map((key) =>\n canonicalizeJson<PlTableRowId>(mapping.map((index) => key[index])),\n );\n const oldSelectedKeys = gridApi.getServerSideSelectionState()?.toggledNodes ?? [];\n if (!isJsonEqual(oldSelectedKeys, selectedNodes)) {\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes,\n });\n\n // wait for `onSelectionChanged` to update `selection` model\n const scope = effectScope();\n const { resolve, promise } = Promise.withResolvers();\n scope.run(() => watch(selection, resolve, { once: true }));\n try {\n await promiseTimeout(promise, 500);\n } catch {\n return false;\n } finally {\n scope.stop();\n }\n }\n return true;\n },\n});\n\n// Update AgGrid when settings change\nconst defaultSelection = createPlSelectionModel();\nlet oldSettings: PlDataTableSettingsV2 | null = null;\nconst generation = ref(0);\nwatch(\n () => [gridApi.value, settings.value] as const,\n ([gridApi, settings]) => {\n // Wait for AgGrid reinitialization, gridApi will eventually become initialized\n if (!gridApi || gridApi.isDestroyed()) return;\n // Verify that this is not a false watch trigger\n if (isJsonEqual(settings, oldSettings)) return;\n ++generation.value;\n try {\n // Hide no rows overlay if it is shown, or else loading overlay will not be shown\n gridApi.hideOverlay();\n dataRenderedTracker.reset();\n\n // No data source selected -> reset state to default\n if (settings.sourceId === null) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: settings.pending ? \"running\" : \"not-ready\",\n } satisfies PlAgOverlayLoadingParams,\n columnDefs: undefined,\n serverSideDatasource: undefined,\n });\n if (selection.value) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n return;\n }\n\n // Data source changed -> show full page loader, clear selection\n if (settings.sourceId !== oldSettings?.sourceId) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: \"loading\",\n } satisfies PlAgOverlayLoadingParams,\n });\n if (selection.value && oldSettings?.sourceId) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n }\n\n // Model updated -> show skeletons instead of data\n const sourceChanged =\n settings.model?.sourceId && settings.model.sourceId !== settings.sourceId;\n if (!settings.model || sourceChanged) {\n const state = gridApi.getServerSideGroupLevelState();\n const rowCount = !sourceChanged && state.length > 0 ? state[0].rowCount : 1;\n return gridApi.updateGridOptions({\n serverSideDatasource: {\n getRows: (params) => {\n params.success({ rowData: [], rowCount });\n },\n },\n });\n }\n\n // Model ready -> calculate new state\n const stateGeneration = generation.value;\n calculateGridOptions({\n generation,\n pfDriver: getRawPlatformaInstance().pFrameDriver,\n model: settings.model,\n sheets: settings.sheets ?? [],\n dataRenderedTracker,\n hiddenColIds: gridState.value.columnVisibility?.hiddenColIds,\n cellButtonAxisParams: {\n showCellButtonForAxisId: props.showCellButtonForAxisId,\n cellButtonInvokeRowsOnDoubleClick: props.cellButtonInvokeRowsOnDoubleClick,\n trigger: (key?: PTableKey) => emit(\"cellButtonClicked\", key),\n } satisfies PlAgCellButtonAxisParams,\n })\n .then((result) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n const { axesSpec, ...options } = result;\n gridApi.updateGridOptions({\n ...options,\n });\n if (selection.value) {\n // Update selection if axesSpec changed, as order of axes may have changed and so we need to remap selected keys\n const { axesSpec: oldAxesSpec, selectedKeys: oldSelectedKeys } = selection.value;\n if (!isJsonEqual(oldAxesSpec, axesSpec)) {\n if (!oldAxesSpec || axesSpec.length !== oldAxesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const mapping = oldAxesSpec\n .map(getAxisId)\n .map((id) => axesSpec.findIndex((axis) => matchAxisId(axis, id)));\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const selectedNodes = oldSelectedKeys.map((key) =>\n mapping.map((index) => key[index]),\n );\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: selectedNodes };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes.map((key) => canonicalizeJson<PlTableRowId>(key)),\n });\n }\n }\n })\n .catch((error: unknown) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n if (isAbortError(error)) return;\n console.trace(error);\n })\n .finally(() => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n gridApi.updateGridOptions({\n loading: false,\n });\n });\n dataRenderedTracker.promise.then(() => emit(\"newDataRendered\"));\n } catch (error: unknown) {\n console.trace(error);\n } finally {\n oldSettings = settings;\n }\n },\n);\n\nwatch(\n () => ({\n gridApi: gridApi.value,\n loadingText: props.loadingText,\n runningText: props.runningText,\n notReadyText: props.notReadyText,\n noRowsText: props.noRowsText,\n }),\n ({ gridApi, loadingText, runningText, notReadyText, noRowsText }) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.updateGridOptions({\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n loadingText,\n runningText,\n notReadyText,\n },\n noRowsOverlayComponentParams: {\n ...gridOptions.value.noRowsOverlayComponentParams,\n text: noRowsText,\n },\n });\n },\n);\n\nwatchEffect(() => {\n if (!gridApi.value || gridApi.value?.isDestroyed()) return;\n gridApi.value.updateGridOptions({\n statusBar: gridOptions.value.loading\n ? undefined\n : {\n statusPanels: [{ statusPanel: PlAgRowCount, align: \"left\" }],\n },\n });\n});\n</script>\n\n<template>\n <div :class=\"$style.container\">\n <PlAgGridColumnManager v-if=\"gridApi && !disableColumnsPanel\" :api=\"gridApi\" />\n <PlTableFiltersV2\n v-if=\"!disableFiltersPanel\"\n v-model=\"filtersState\"\n :pframe-handle=\"'model' in settings ? settings?.model?.fullPframeHandle : undefined\"\n :columns=\"filterableColumns\"\n />\n <PlAgCsvExporter v-if=\"gridApi && showExportButton\" :api=\"gridApi\" />\n <PlAgDataTableSheets v-model=\"sheetsState\" :settings=\"sheetsSettings\">\n <template v-if=\"$slots['before-sheets']\" #before>\n <slot name=\"before-sheets\" />\n </template>\n <template v-if=\"$slots['after-sheets']\" #after>\n <slot name=\"after-sheets\" />\n </template>\n </PlAgDataTableSheets>\n <PlTableFastSearch v-model=\"searchString\" />\n <AgGridVue\n :key=\"reloadKey\"\n :theme=\"AgGridTheme\"\n :class=\"$style.grid\"\n :grid-options=\"gridOptions\"\n />\n </div>\n</template>\n\n<style lang=\"css\" module>\n.container {\n display: flex;\n flex-direction: column;\n height: 100%;\n gap: 12px;\n}\n\n.grid {\n flex: 1;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlAgDataTableV2.js","names":[],"sources":["../../../src/components/PlAgDataTable/PlAgDataTableV2.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { promiseTimeout, isJsonEqual } from \"@milaboratories/helpers\";\nimport type {\n AxisId,\n PlDataTableGridStateCore,\n PlDataTableStateV2,\n PlSelectionModel,\n PlTableColumnIdJson,\n PTableColumnSpec,\n PTableKey,\n} from \"@platforma-sdk/model\";\nimport {\n getRawPlatformaInstance,\n createPlSelectionModel,\n matchAxisId,\n getAxisId,\n canonicalizeJson,\n isAbortError,\n isColumnOptional,\n} from \"@platforma-sdk/model\";\nimport type { CellRendererSelectorFunc, GridApi, GridState } from \"ag-grid-enterprise\";\nimport { AgGridVue } from \"ag-grid-vue3\";\nimport { computed, effectScope, nextTick, ref, toRefs, watch, watchEffect } from \"vue\";\nimport PlAgCsvExporter from \"../PlAgCsvExporter/PlAgCsvExporter.vue\";\nimport { PlAgGridColumnManager } from \"../PlAgGridColumnManager\";\nimport PlTableFiltersV2 from \"../PlTableFilters/PlTableFiltersV2.vue\";\nimport { PlTableFastSearch } from \"../PlTableFastSearch\";\nimport PlAgDataTableSheets from \"./PlAgDataTableSheets.vue\";\nimport PlAgRowCount from \"./PlAgRowCount.vue\";\nimport { DeferredCircular, ensureNodeVisible } from \"./sources/focus-row\";\nimport { PlAgDataTableRowNumberColId } from \"./sources/row-number\";\nimport type { PlAgCellButtonAxisParams } from \"./sources/table-source-v2\";\nimport { calculateGridOptions } from \"./sources/table-source-v2\";\nimport { useTableState } from \"./sources/table-state-v2\";\nimport type {\n PlAgDataTableV2Controller,\n PlAgDataTableV2Row,\n PlAgOverlayLoadingParams,\n PlAgOverlayNoRowsParams,\n PlDataTableSettingsV2,\n PlDataTableSheetsSettings,\n PlTableRowId,\n} from \"./types\";\nimport { useFilterableColumns } from \"./compositions/useFilterableColumns\";\nimport { useGrid } from \"./compositions/useGrid\";\nimport { AgGridTheme } from \"../../AgGridVue/AgGridTheme\";\n\nconst tableState = defineModel<PlDataTableStateV2>({\n required: true,\n});\n/** Warning: selection model value updates are ignored, use updateSelection instead */\nconst selection = defineModel<PlSelectionModel>(\"selection\");\nconst props = defineProps<{\n /** Required component settings */\n settings: Readonly<PlDataTableSettingsV2>;\n\n /**\n * The disableColumnsPanel prop controls the display of a button that activates\n * the columns management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableColumnsPanel?: boolean;\n\n /**\n * The disableFiltersPanel prop controls the display of a button that activates\n * the filters management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableFiltersPanel?: boolean;\n\n /**\n * The showExportButton prop controls the display of a button that allows\n * to export table data in CSV format. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n showExportButton?: boolean;\n\n /**\n * The AxisId property is used to configure and display the PlAgTextAndButtonCell component\n */\n showCellButtonForAxisId?: AxisId;\n\n /**\n * If cellButtonInvokeRowsOnDoubleClick = true, clicking a button inside the row\n * triggers the doubleClick event for the entire row.\n *\n * If cellButtonInvokeRowsOnDoubleClick = false, the doubleClick event for the row\n * is not triggered, but will triggered cellButtonClicked event with (key: PTableRowKey) argument.\n */\n cellButtonInvokeRowsOnDoubleClick?: boolean;\n\n /** @see {@link PlAgOverlayLoadingParams.loadingText} */\n loadingText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.runningText} */\n runningText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.notReadyText} */\n notReadyText?: string;\n\n /** @see {@link PlAgOverlayNoRowsParams.text} */\n noRowsText?: string;\n\n /**\n * Callback to override the default renderer for a given cell.\n * @see https://www.ag-grid.com/vue-data-grid/component-cell-renderer/#dynamic-component-selection\n */\n cellRendererSelector?: CellRendererSelectorFunc<PlAgDataTableV2Row>;\n}>();\nconst { settings } = toRefs(props);\nconst emit = defineEmits<{\n rowDoubleClicked: [key?: PTableKey];\n cellButtonClicked: [key?: PTableKey];\n newDataRendered: [];\n}>();\n\nconst dataRenderedTracker = new DeferredCircular<GridApi<PlAgDataTableV2Row>>();\nconst { gridApi, gridOptions } = useGrid({\n selection: selection.value,\n noRowsText: props.noRowsText,\n runningText: props.runningText,\n loadingText: props.loadingText,\n notReadyText: props.notReadyText,\n cellRendererSelector: props.cellRendererSelector,\n});\nlet isReloading = false;\ngridOptions.value.onGridPreDestroyed = (event) => {\n if (!isReloading) {\n gridOptions.value.initialState = gridState.value = normalizeColumnVisibility(\n makePartialState(event.api.getState()),\n gridState.value,\n event.api,\n );\n }\n gridApi.value = null;\n};\ngridOptions.value.onRowDoubleClicked = (event) => {\n if (event.data && event.data.axesKey) emit(\"rowDoubleClicked\", event.data.axesKey);\n};\ngridOptions.value.onStateUpdated = (event) => {\n const partialState = normalizeColumnVisibility(\n makePartialState(event.state),\n gridState.value,\n event.api,\n );\n // We have to keep initialState synchronized with gridState for gridState recovery after key updating.\n gridOptions.value.initialState = gridState.value = partialState;\n\n if (!isJsonEqual(event.sources, [\"columnSizing\"])) {\n event.api.autoSizeColumns(\n event.api\n .getAllDisplayedColumns()\n .filter((column) => column.getColId() !== PlAgDataTableRowNumberColId),\n );\n }\n};\n\nconst [filterableColumns, visibleFilterableColumns] = useFilterableColumns(\n () => settings.value.sourceId,\n () => gridOptions.value.columnDefs ?? null,\n);\nconst { gridState, sheetsState, filtersState, searchString } = useTableState(\n tableState,\n settings,\n visibleFilterableColumns,\n);\nconst sheetsSettings = computed<PlDataTableSheetsSettings>(() => {\n const settingsCopy = { ...settings.value };\n return settingsCopy.sourceId !== null\n ? {\n sheets: settingsCopy.sheets ?? [],\n cachedState: [...sheetsState.value],\n }\n : {\n sheets: [],\n cachedState: [],\n };\n});\ngridOptions.value.initialState = gridState.value;\n\n// Restore proper types erased by AgGrid\nfunction makePartialState(state: GridState): PlDataTableGridStateCore {\n return {\n columnOrder: state.columnOrder as\n | {\n orderedColIds: PlTableColumnIdJson[];\n }\n | undefined,\n sort: state.sort as\n | {\n sortModel: {\n colId: PlTableColumnIdJson;\n sort: \"asc\" | \"desc\";\n }[];\n }\n | undefined,\n columnVisibility: state.columnVisibility as\n | {\n hiddenColIds: PlTableColumnIdJson[];\n }\n | undefined,\n };\n}\n\n// AG Grid returns columnVisibility: undefined when all columns are visible.\n// We need to distinguish \"no state yet\" (use isColumnOptional defaults) from\n// \"user explicitly showed all columns\" (store []). This function normalizes\n// the undefined from AG Grid based on the previous state.\nfunction normalizeColumnVisibility(\n partialState: PlDataTableGridStateCore,\n prevState: PlDataTableGridStateCore,\n api: GridApi<PlAgDataTableV2Row>,\n): PlDataTableGridStateCore {\n if (partialState.columnVisibility !== undefined) return partialState;\n\n if (prevState.columnVisibility !== undefined) {\n // Had explicit visibility state before → user made all columns visible → store [].\n return { ...partialState, columnVisibility: { hiddenColIds: [] } };\n }\n\n // No previous explicit state → compute defaults from current columns\n // to replicate: hide: hiddenColIds?.includes(colId) ?? isColumnOptional(spec.spec)\n const defaultHidden = getDefaultHiddenColIds(api);\n if (defaultHidden.length > 0) {\n return { ...partialState, columnVisibility: { hiddenColIds: defaultHidden } };\n }\n\n return partialState;\n}\n\nfunction getDefaultHiddenColIds(api: GridApi<PlAgDataTableV2Row>): PlTableColumnIdJson[] {\n const cols = api.getAllGridColumns();\n if (!cols) return [];\n return cols\n .filter((col) => {\n const spec = col.getColDef().context as PTableColumnSpec | undefined;\n return spec && isColumnOptional(spec.spec);\n })\n .map((col) => col.getColId() as PlTableColumnIdJson);\n}\n\n// Normalize columnVisibility for comparison: undefined and { hiddenColIds: [] } are equivalent.\nfunction stateForReloadCompare(state: PlDataTableGridStateCore): PlDataTableGridStateCore {\n const cv = state.columnVisibility;\n const normalizedCv = !cv || cv.hiddenColIds.length === 0 ? undefined : state.columnVisibility;\n return { ...state, columnVisibility: normalizedCv };\n}\n\n// Reload AgGrid when new state arrives from server\nconst reloadKey = ref(0);\nwatch(\n () => [gridApi.value, gridState.value] as const,\n ([gridApi, gridState]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n const selfState = makePartialState(gridApi.getState());\n if (\n !isJsonEqual(gridState, {}) &&\n !isJsonEqual(stateForReloadCompare(gridState), stateForReloadCompare(selfState))\n ) {\n isReloading = true;\n gridOptions.value.initialState = gridState;\n ++reloadKey.value;\n nextTick(() => {\n isReloading = false;\n });\n }\n },\n);\n\n// Make cellRendererSelector reactive\nconst cellRendererSelector = computed(() => props.cellRendererSelector ?? null);\nwatch(\n () => [gridApi.value, cellRendererSelector.value] as const,\n ([gridApi, cellRendererSelector]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.setGridOption(\"defaultColDef\", {\n ...gridOptions.value.defaultColDef,\n cellRendererSelector: cellRendererSelector ?? undefined,\n });\n },\n);\n\ndefineExpose<PlAgDataTableV2Controller>({\n focusRow: async (rowKey) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n return ensureNodeVisible(gridApi, (row) => isJsonEqual(row.data?.axesKey, rowKey));\n },\n updateSelection: async ({ axesSpec, selectedKeys }) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n const axes = selection.value?.axesSpec;\n if (!axes || axes.length !== axesSpec.length) return false;\n\n const mapping = axesSpec.map((spec) => {\n const id = getAxisId(spec);\n return axes.findIndex((axis) => matchAxisId(axis, id));\n });\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) return false;\n\n const selectedNodes = selectedKeys.map((key) =>\n canonicalizeJson<PlTableRowId>(mapping.map((index) => key[index])),\n );\n const oldSelectedKeys = gridApi.getServerSideSelectionState()?.toggledNodes ?? [];\n if (!isJsonEqual(oldSelectedKeys, selectedNodes)) {\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes,\n });\n\n // wait for `onSelectionChanged` to update `selection` model\n const scope = effectScope();\n const { resolve, promise } = Promise.withResolvers();\n scope.run(() => watch(selection, resolve, { once: true }));\n try {\n await promiseTimeout(promise, 500);\n } catch {\n return false;\n } finally {\n scope.stop();\n }\n }\n return true;\n },\n});\n\n// Update AgGrid when settings change\nconst defaultSelection = createPlSelectionModel();\nlet oldSettings: PlDataTableSettingsV2 | null = null;\nconst generation = ref(0);\nwatch(\n () => [gridApi.value, settings.value] as const,\n ([gridApi, settings]) => {\n // Wait for AgGrid reinitialization, gridApi will eventually become initialized\n if (!gridApi || gridApi.isDestroyed()) return;\n // Verify that this is not a false watch trigger\n if (isJsonEqual(settings, oldSettings)) return;\n ++generation.value;\n try {\n // Hide no rows overlay if it is shown, or else loading overlay will not be shown\n gridApi.hideOverlay();\n dataRenderedTracker.reset();\n\n // No data source selected -> reset state to default\n if (settings.sourceId === null) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: settings.pending ? \"running\" : \"not-ready\",\n } satisfies PlAgOverlayLoadingParams,\n columnDefs: undefined,\n serverSideDatasource: undefined,\n });\n if (selection.value) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n return;\n }\n\n // Data source changed -> show full page loader, clear selection\n if (settings.sourceId !== oldSettings?.sourceId) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: \"loading\",\n } satisfies PlAgOverlayLoadingParams,\n });\n if (selection.value && oldSettings?.sourceId) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n }\n\n // Model updated -> show skeletons instead of data\n const sourceChanged =\n settings.model?.sourceId && settings.model.sourceId !== settings.sourceId;\n if (!settings.model || sourceChanged) {\n const state = gridApi.getServerSideGroupLevelState();\n const rowCount = !sourceChanged && state.length > 0 ? state[0].rowCount : 1;\n return gridApi.updateGridOptions({\n serverSideDatasource: {\n getRows: (params) => {\n params.success({ rowData: [], rowCount });\n },\n },\n });\n }\n\n // Model ready -> calculate new state\n const stateGeneration = generation.value;\n calculateGridOptions({\n generation,\n pfDriver: getRawPlatformaInstance().pFrameDriver,\n model: settings.model,\n sheets: settings.sheets ?? [],\n dataRenderedTracker,\n hiddenColIds: gridState.value.columnVisibility?.hiddenColIds,\n cellButtonAxisParams: {\n showCellButtonForAxisId: props.showCellButtonForAxisId,\n cellButtonInvokeRowsOnDoubleClick: props.cellButtonInvokeRowsOnDoubleClick,\n trigger: (key?: PTableKey) => emit(\"cellButtonClicked\", key),\n } satisfies PlAgCellButtonAxisParams,\n })\n .then((result) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n const { axesSpec, ...options } = result;\n gridApi.updateGridOptions({\n ...options,\n });\n if (selection.value) {\n // Update selection if axesSpec changed, as order of axes may have changed and so we need to remap selected keys\n const { axesSpec: oldAxesSpec, selectedKeys: oldSelectedKeys } = selection.value;\n if (!isJsonEqual(oldAxesSpec, axesSpec)) {\n if (!oldAxesSpec || axesSpec.length !== oldAxesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const mapping = oldAxesSpec\n .map(getAxisId)\n .map((id) => axesSpec.findIndex((axis) => matchAxisId(axis, id)));\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const selectedNodes = oldSelectedKeys.map((key) =>\n mapping.map((index) => key[index]),\n );\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: selectedNodes };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes.map((key) => canonicalizeJson<PlTableRowId>(key)),\n });\n }\n }\n })\n .catch((error: unknown) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n if (isAbortError(error)) return;\n console.trace(error);\n })\n .finally(() => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n gridApi.updateGridOptions({\n loading: false,\n });\n });\n dataRenderedTracker.promise.then(() => emit(\"newDataRendered\"));\n } catch (error: unknown) {\n console.trace(error);\n } finally {\n oldSettings = settings;\n }\n },\n);\n\nwatch(\n () => ({\n gridApi: gridApi.value,\n loadingText: props.loadingText,\n runningText: props.runningText,\n notReadyText: props.notReadyText,\n noRowsText: props.noRowsText,\n }),\n ({ gridApi, loadingText, runningText, notReadyText, noRowsText }) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.updateGridOptions({\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n loadingText,\n runningText,\n notReadyText,\n },\n noRowsOverlayComponentParams: {\n ...gridOptions.value.noRowsOverlayComponentParams,\n text: noRowsText,\n },\n });\n },\n);\n\nwatchEffect(() => {\n if (!gridApi.value || gridApi.value?.isDestroyed()) return;\n gridApi.value.updateGridOptions({\n statusBar: gridOptions.value.loading\n ? undefined\n : {\n statusPanels: [{ statusPanel: PlAgRowCount, align: \"left\" }],\n },\n });\n});\n</script>\n\n<template>\n <div :class=\"$style.container\">\n <PlAgGridColumnManager v-if=\"gridApi && !disableColumnsPanel\" :api=\"gridApi\" />\n <PlTableFiltersV2\n v-if=\"!disableFiltersPanel\"\n v-model=\"filtersState\"\n :pframe-handle=\"'model' in settings ? settings?.model?.fullPframeHandle : undefined\"\n :columns=\"filterableColumns\"\n />\n <PlAgCsvExporter v-if=\"gridApi && showExportButton\" :api=\"gridApi\" />\n <PlAgDataTableSheets v-model=\"sheetsState\" :settings=\"sheetsSettings\">\n <template v-if=\"$slots['before-sheets']\" #before>\n <slot name=\"before-sheets\" />\n </template>\n <template v-if=\"$slots['after-sheets']\" #after>\n <slot name=\"after-sheets\" />\n </template>\n </PlAgDataTableSheets>\n <PlTableFastSearch v-model=\"searchString\" />\n <AgGridVue\n :key=\"reloadKey\"\n :theme=\"AgGridTheme\"\n :class=\"$style.grid\"\n :grid-options=\"gridOptions\"\n />\n </div>\n</template>\n\n<style lang=\"css\" module>\n.container {\n display: flex;\n flex-direction: column;\n height: 100%;\n gap: 12px;\n}\n\n.grid {\n flex: 1;\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgDataTableV2.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlAgDataTable/PlAgDataTableV2.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { promiseTimeout, isJsonEqual } from \"@milaboratories/helpers\";\nimport type {\n AxisId,\n PlDataTableGridStateCore,\n PlDataTableStateV2,\n PlSelectionModel,\n PlTableColumnIdJson,\n PTableColumnSpec,\n PTableKey,\n} from \"@platforma-sdk/model\";\nimport {\n getRawPlatformaInstance,\n createPlSelectionModel,\n matchAxisId,\n getAxisId,\n canonicalizeJson,\n isAbortError,\n isColumnOptional,\n} from \"@platforma-sdk/model\";\nimport type { CellRendererSelectorFunc, GridApi, GridState } from \"ag-grid-enterprise\";\nimport { AgGridVue } from \"ag-grid-vue3\";\nimport { computed, effectScope, nextTick, ref, toRefs, watch, watchEffect } from \"vue\";\nimport PlAgCsvExporter from \"../PlAgCsvExporter/PlAgCsvExporter.vue\";\nimport { PlAgGridColumnManager } from \"../PlAgGridColumnManager\";\nimport PlTableFiltersV2 from \"../PlTableFilters/PlTableFiltersV2.vue\";\nimport { PlTableFastSearch } from \"../PlTableFastSearch\";\nimport PlAgDataTableSheets from \"./PlAgDataTableSheets.vue\";\nimport PlAgRowCount from \"./PlAgRowCount.vue\";\nimport { DeferredCircular, ensureNodeVisible } from \"./sources/focus-row\";\nimport { PlAgDataTableRowNumberColId } from \"./sources/row-number\";\nimport type { PlAgCellButtonAxisParams } from \"./sources/table-source-v2\";\nimport { calculateGridOptions } from \"./sources/table-source-v2\";\nimport { useTableState } from \"./sources/table-state-v2\";\nimport type {\n PlAgDataTableV2Controller,\n PlAgDataTableV2Row,\n PlAgOverlayLoadingParams,\n PlAgOverlayNoRowsParams,\n PlDataTableSettingsV2,\n PlDataTableSheetsSettings,\n PlTableRowId,\n} from \"./types\";\nimport { useFilterableColumns } from \"./compositions/useFilterableColumns\";\nimport { useGrid } from \"./compositions/useGrid\";\nimport { AgGridTheme } from \"./compositions/useTheme\";\n\nconst tableState = defineModel<PlDataTableStateV2>({\n required: true,\n});\n/** Warning: selection model value updates are ignored, use updateSelection instead */\nconst selection = defineModel<PlSelectionModel>(\"selection\");\nconst props = defineProps<{\n /** Required component settings */\n settings: Readonly<PlDataTableSettingsV2>;\n\n /**\n * The disableColumnsPanel prop controls the display of a button that activates\n * the columns management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableColumnsPanel?: boolean;\n\n /**\n * The disableFiltersPanel prop controls the display of a button that activates\n * the filters management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableFiltersPanel?: boolean;\n\n /**\n * The showExportButton prop controls the display of a button that allows\n * to export table data in CSV format. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n showExportButton?: boolean;\n\n /**\n * The AxisId property is used to configure and display the PlAgTextAndButtonCell component\n */\n showCellButtonForAxisId?: AxisId;\n\n /**\n * If cellButtonInvokeRowsOnDoubleClick = true, clicking a button inside the row\n * triggers the doubleClick event for the entire row.\n *\n * If cellButtonInvokeRowsOnDoubleClick = false, the doubleClick event for the row\n * is not triggered, but will triggered cellButtonClicked event with (key: PTableRowKey) argument.\n */\n cellButtonInvokeRowsOnDoubleClick?: boolean;\n\n /** @see {@link PlAgOverlayLoadingParams.loadingText} */\n loadingText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.runningText} */\n runningText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.notReadyText} */\n notReadyText?: string;\n\n /** @see {@link PlAgOverlayNoRowsParams.text} */\n noRowsText?: string;\n\n /**\n * Callback to override the default renderer for a given cell.\n * @see https://www.ag-grid.com/vue-data-grid/component-cell-renderer/#dynamic-component-selection\n */\n cellRendererSelector?: CellRendererSelectorFunc<PlAgDataTableV2Row>;\n}>();\nconst { settings } = toRefs(props);\nconst emit = defineEmits<{\n rowDoubleClicked: [key?: PTableKey];\n cellButtonClicked: [key?: PTableKey];\n newDataRendered: [];\n}>();\n\nconst dataRenderedTracker = new DeferredCircular<GridApi<PlAgDataTableV2Row>>();\nconst { gridApi, gridOptions } = useGrid({\n selection: selection.value,\n noRowsText: props.noRowsText,\n runningText: props.runningText,\n loadingText: props.loadingText,\n notReadyText: props.notReadyText,\n cellRendererSelector: props.cellRendererSelector,\n});\nlet isReloading = false;\ngridOptions.value.onGridPreDestroyed = (event) => {\n if (!isReloading) {\n gridOptions.value.initialState = gridState.value = normalizeColumnVisibility(\n makePartialState(event.api.getState()),\n gridState.value,\n event.api,\n );\n }\n gridApi.value = null;\n};\ngridOptions.value.onRowDoubleClicked = (event) => {\n if (event.data && event.data.axesKey) emit(\"rowDoubleClicked\", event.data.axesKey);\n};\ngridOptions.value.onStateUpdated = (event) => {\n const partialState = normalizeColumnVisibility(\n makePartialState(event.state),\n gridState.value,\n event.api,\n );\n // We have to keep initialState synchronized with gridState for gridState recovery after key updating.\n gridOptions.value.initialState = gridState.value = partialState;\n\n if (!isJsonEqual(event.sources, [\"columnSizing\"])) {\n event.api.autoSizeColumns(\n event.api\n .getAllDisplayedColumns()\n .filter((column) => column.getColId() !== PlAgDataTableRowNumberColId),\n );\n }\n};\n\nconst [filterableColumns, visibleFilterableColumns] = useFilterableColumns(\n () => settings.value.sourceId,\n () => gridOptions.value.columnDefs ?? null,\n);\nconst { gridState, sheetsState, filtersState, searchString } = useTableState(\n tableState,\n settings,\n visibleFilterableColumns,\n);\nconst sheetsSettings = computed<PlDataTableSheetsSettings>(() => {\n const settingsCopy = { ...settings.value };\n return settingsCopy.sourceId !== null\n ? {\n sheets: settingsCopy.sheets ?? [],\n cachedState: [...sheetsState.value],\n }\n : {\n sheets: [],\n cachedState: [],\n };\n});\ngridOptions.value.initialState = gridState.value;\n\n// Restore proper types erased by AgGrid\nfunction makePartialState(state: GridState): PlDataTableGridStateCore {\n return {\n columnOrder: state.columnOrder as\n | {\n orderedColIds: PlTableColumnIdJson[];\n }\n | undefined,\n sort: state.sort as\n | {\n sortModel: {\n colId: PlTableColumnIdJson;\n sort: \"asc\" | \"desc\";\n }[];\n }\n | undefined,\n columnVisibility: state.columnVisibility as\n | {\n hiddenColIds: PlTableColumnIdJson[];\n }\n | undefined,\n };\n}\n\n// AG Grid returns columnVisibility: undefined when all columns are visible.\n// We need to distinguish \"no state yet\" (use isColumnOptional defaults) from\n// \"user explicitly showed all columns\" (store []). This function normalizes\n// the undefined from AG Grid based on the previous state.\nfunction normalizeColumnVisibility(\n partialState: PlDataTableGridStateCore,\n prevState: PlDataTableGridStateCore,\n api: GridApi<PlAgDataTableV2Row>,\n): PlDataTableGridStateCore {\n if (partialState.columnVisibility !== undefined) return partialState;\n\n if (prevState.columnVisibility !== undefined) {\n // Had explicit visibility state before → user made all columns visible → store [].\n return { ...partialState, columnVisibility: { hiddenColIds: [] } };\n }\n\n // No previous explicit state → compute defaults from current columns\n // to replicate: hide: hiddenColIds?.includes(colId) ?? isColumnOptional(spec.spec)\n const defaultHidden = getDefaultHiddenColIds(api);\n if (defaultHidden.length > 0) {\n return { ...partialState, columnVisibility: { hiddenColIds: defaultHidden } };\n }\n\n return partialState;\n}\n\nfunction getDefaultHiddenColIds(api: GridApi<PlAgDataTableV2Row>): PlTableColumnIdJson[] {\n const cols = api.getAllGridColumns();\n if (!cols) return [];\n return cols\n .filter((col) => {\n const spec = col.getColDef().context as PTableColumnSpec | undefined;\n return spec && isColumnOptional(spec.spec);\n })\n .map((col) => col.getColId() as PlTableColumnIdJson);\n}\n\n// Normalize columnVisibility for comparison: undefined and { hiddenColIds: [] } are equivalent.\nfunction stateForReloadCompare(state: PlDataTableGridStateCore): PlDataTableGridStateCore {\n const cv = state.columnVisibility;\n const normalizedCv = !cv || cv.hiddenColIds.length === 0 ? undefined : state.columnVisibility;\n return { ...state, columnVisibility: normalizedCv };\n}\n\n// Reload AgGrid when new state arrives from server\nconst reloadKey = ref(0);\nwatch(\n () => [gridApi.value, gridState.value] as const,\n ([gridApi, gridState]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n const selfState = makePartialState(gridApi.getState());\n if (\n !isJsonEqual(gridState, {}) &&\n !isJsonEqual(stateForReloadCompare(gridState), stateForReloadCompare(selfState))\n ) {\n isReloading = true;\n gridOptions.value.initialState = gridState;\n ++reloadKey.value;\n nextTick(() => {\n isReloading = false;\n });\n }\n },\n);\n\n// Make cellRendererSelector reactive\nconst cellRendererSelector = computed(() => props.cellRendererSelector ?? null);\nwatch(\n () => [gridApi.value, cellRendererSelector.value] as const,\n ([gridApi, cellRendererSelector]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.setGridOption(\"defaultColDef\", {\n ...gridOptions.value.defaultColDef,\n cellRendererSelector: cellRendererSelector ?? undefined,\n });\n },\n);\n\ndefineExpose<PlAgDataTableV2Controller>({\n focusRow: async (rowKey) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n return ensureNodeVisible(gridApi, (row) => isJsonEqual(row.data?.axesKey, rowKey));\n },\n updateSelection: async ({ axesSpec, selectedKeys }) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n const axes = selection.value?.axesSpec;\n if (!axes || axes.length !== axesSpec.length) return false;\n\n const mapping = axesSpec.map((spec) => {\n const id = getAxisId(spec);\n return axes.findIndex((axis) => matchAxisId(axis, id));\n });\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) return false;\n\n const selectedNodes = selectedKeys.map((key) =>\n canonicalizeJson<PlTableRowId>(mapping.map((index) => key[index])),\n );\n const oldSelectedKeys = gridApi.getServerSideSelectionState()?.toggledNodes ?? [];\n if (!isJsonEqual(oldSelectedKeys, selectedNodes)) {\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes,\n });\n\n // wait for `onSelectionChanged` to update `selection` model\n const scope = effectScope();\n const { resolve, promise } = Promise.withResolvers();\n scope.run(() => watch(selection, resolve, { once: true }));\n try {\n await promiseTimeout(promise, 500);\n } catch {\n return false;\n } finally {\n scope.stop();\n }\n }\n return true;\n },\n});\n\n// Update AgGrid when settings change\nconst defaultSelection = createPlSelectionModel();\nlet oldSettings: PlDataTableSettingsV2 | null = null;\nconst generation = ref(0);\nwatch(\n () => [gridApi.value, settings.value] as const,\n ([gridApi, settings]) => {\n // Wait for AgGrid reinitialization, gridApi will eventually become initialized\n if (!gridApi || gridApi.isDestroyed()) return;\n // Verify that this is not a false watch trigger\n if (isJsonEqual(settings, oldSettings)) return;\n ++generation.value;\n try {\n // Hide no rows overlay if it is shown, or else loading overlay will not be shown\n gridApi.hideOverlay();\n dataRenderedTracker.reset();\n\n // No data source selected -> reset state to default\n if (settings.sourceId === null) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: settings.pending ? \"running\" : \"not-ready\",\n } satisfies PlAgOverlayLoadingParams,\n columnDefs: undefined,\n serverSideDatasource: undefined,\n });\n if (selection.value) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n return;\n }\n\n // Data source changed -> show full page loader, clear selection\n if (settings.sourceId !== oldSettings?.sourceId) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: \"loading\",\n } satisfies PlAgOverlayLoadingParams,\n });\n if (selection.value && oldSettings?.sourceId) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n }\n\n // Model updated -> show skeletons instead of data\n const sourceChanged =\n settings.model?.sourceId && settings.model.sourceId !== settings.sourceId;\n if (!settings.model || sourceChanged) {\n const state = gridApi.getServerSideGroupLevelState();\n const rowCount = !sourceChanged && state.length > 0 ? state[0].rowCount : 1;\n return gridApi.updateGridOptions({\n serverSideDatasource: {\n getRows: (params) => {\n params.success({ rowData: [], rowCount });\n },\n },\n });\n }\n\n // Model ready -> calculate new state\n const stateGeneration = generation.value;\n calculateGridOptions({\n generation,\n pfDriver: getRawPlatformaInstance().pFrameDriver,\n model: settings.model,\n sheets: settings.sheets ?? [],\n dataRenderedTracker,\n hiddenColIds: gridState.value.columnVisibility?.hiddenColIds,\n cellButtonAxisParams: {\n showCellButtonForAxisId: props.showCellButtonForAxisId,\n cellButtonInvokeRowsOnDoubleClick: props.cellButtonInvokeRowsOnDoubleClick,\n trigger: (key?: PTableKey) => emit(\"cellButtonClicked\", key),\n } satisfies PlAgCellButtonAxisParams,\n })\n .then((result) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n const { axesSpec, ...options } = result;\n gridApi.updateGridOptions({\n ...options,\n });\n if (selection.value) {\n // Update selection if axesSpec changed, as order of axes may have changed and so we need to remap selected keys\n const { axesSpec: oldAxesSpec, selectedKeys: oldSelectedKeys } = selection.value;\n if (!isJsonEqual(oldAxesSpec, axesSpec)) {\n if (!oldAxesSpec || axesSpec.length !== oldAxesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const mapping = oldAxesSpec\n .map(getAxisId)\n .map((id) => axesSpec.findIndex((axis) => matchAxisId(axis, id)));\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const selectedNodes = oldSelectedKeys.map((key) =>\n mapping.map((index) => key[index]),\n );\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: selectedNodes };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes.map((key) => canonicalizeJson<PlTableRowId>(key)),\n });\n }\n }\n })\n .catch((error: unknown) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n if (isAbortError(error)) return;\n console.trace(error);\n })\n .finally(() => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n gridApi.updateGridOptions({\n loading: false,\n });\n });\n dataRenderedTracker.promise.then(() => emit(\"newDataRendered\"));\n } catch (error: unknown) {\n console.trace(error);\n } finally {\n oldSettings = settings;\n }\n },\n);\n\nwatch(\n () => ({\n gridApi: gridApi.value,\n loadingText: props.loadingText,\n runningText: props.runningText,\n notReadyText: props.notReadyText,\n noRowsText: props.noRowsText,\n }),\n ({ gridApi, loadingText, runningText, notReadyText, noRowsText }) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.updateGridOptions({\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n loadingText,\n runningText,\n notReadyText,\n },\n noRowsOverlayComponentParams: {\n ...gridOptions.value.noRowsOverlayComponentParams,\n text: noRowsText,\n },\n });\n },\n);\n\nwatchEffect(() => {\n if (!gridApi.value || gridApi.value?.isDestroyed()) return;\n gridApi.value.updateGridOptions({\n statusBar: gridOptions.value.loading\n ? undefined\n : {\n statusPanels: [{ statusPanel: PlAgRowCount, align: \"left\" }],\n },\n });\n});\n</script>\n\n<template>\n <div :class=\"$style.container\">\n <PlAgGridColumnManager v-if=\"gridApi && !disableColumnsPanel\" :api=\"gridApi\" />\n <PlTableFiltersV2\n v-if=\"!disableFiltersPanel\"\n v-model=\"filtersState\"\n :pframe-handle=\"'model' in settings ? settings?.model?.fullPframeHandle : undefined\"\n :columns=\"filterableColumns\"\n />\n <PlAgCsvExporter v-if=\"gridApi && showExportButton\" :api=\"gridApi\" />\n <PlAgDataTableSheets v-model=\"sheetsState\" :settings=\"sheetsSettings\">\n <template v-if=\"$slots['before-sheets']\" #before>\n <slot name=\"before-sheets\" />\n </template>\n <template v-if=\"$slots['after-sheets']\" #after>\n <slot name=\"after-sheets\" />\n </template>\n </PlAgDataTableSheets>\n <PlTableFastSearch v-model=\"searchString\" />\n <AgGridVue\n :key=\"reloadKey\"\n :theme=\"AgGridTheme\"\n :class=\"$style.grid\"\n :grid-options=\"gridOptions\"\n />\n </div>\n</template>\n\n<style lang=\"css\" module>\n.container {\n display: flex;\n flex-direction: column;\n height: 100%;\n gap: 12px;\n}\n\n.grid {\n flex: 1;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlAgDataTableV2.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlAgDataTable/PlAgDataTableV2.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { promiseTimeout, isJsonEqual } from \"@milaboratories/helpers\";\nimport type {\n AxisId,\n PlDataTableGridStateCore,\n PlDataTableStateV2,\n PlSelectionModel,\n PlTableColumnIdJson,\n PTableColumnSpec,\n PTableKey,\n} from \"@platforma-sdk/model\";\nimport {\n getRawPlatformaInstance,\n createPlSelectionModel,\n matchAxisId,\n getAxisId,\n canonicalizeJson,\n isAbortError,\n isColumnOptional,\n} from \"@platforma-sdk/model\";\nimport type { CellRendererSelectorFunc, GridApi, GridState } from \"ag-grid-enterprise\";\nimport { AgGridVue } from \"ag-grid-vue3\";\nimport { computed, effectScope, nextTick, ref, toRefs, watch, watchEffect } from \"vue\";\nimport PlAgCsvExporter from \"../PlAgCsvExporter/PlAgCsvExporter.vue\";\nimport { PlAgGridColumnManager } from \"../PlAgGridColumnManager\";\nimport PlTableFiltersV2 from \"../PlTableFilters/PlTableFiltersV2.vue\";\nimport { PlTableFastSearch } from \"../PlTableFastSearch\";\nimport PlAgDataTableSheets from \"./PlAgDataTableSheets.vue\";\nimport PlAgRowCount from \"./PlAgRowCount.vue\";\nimport { DeferredCircular, ensureNodeVisible } from \"./sources/focus-row\";\nimport { PlAgDataTableRowNumberColId } from \"./sources/row-number\";\nimport type { PlAgCellButtonAxisParams } from \"./sources/table-source-v2\";\nimport { calculateGridOptions } from \"./sources/table-source-v2\";\nimport { useTableState } from \"./sources/table-state-v2\";\nimport type {\n PlAgDataTableV2Controller,\n PlAgDataTableV2Row,\n PlAgOverlayLoadingParams,\n PlAgOverlayNoRowsParams,\n PlDataTableSettingsV2,\n PlDataTableSheetsSettings,\n PlTableRowId,\n} from \"./types\";\nimport { useFilterableColumns } from \"./compositions/useFilterableColumns\";\nimport { useGrid } from \"./compositions/useGrid\";\nimport { AgGridTheme } from \"../../AgGridVue/AgGridTheme\";\n\nconst tableState = defineModel<PlDataTableStateV2>({\n required: true,\n});\n/** Warning: selection model value updates are ignored, use updateSelection instead */\nconst selection = defineModel<PlSelectionModel>(\"selection\");\nconst props = defineProps<{\n /** Required component settings */\n settings: Readonly<PlDataTableSettingsV2>;\n\n /**\n * The disableColumnsPanel prop controls the display of a button that activates\n * the columns management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableColumnsPanel?: boolean;\n\n /**\n * The disableFiltersPanel prop controls the display of a button that activates\n * the filters management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableFiltersPanel?: boolean;\n\n /**\n * The showExportButton prop controls the display of a button that allows\n * to export table data in CSV format. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n showExportButton?: boolean;\n\n /**\n * The AxisId property is used to configure and display the PlAgTextAndButtonCell component\n */\n showCellButtonForAxisId?: AxisId;\n\n /**\n * If cellButtonInvokeRowsOnDoubleClick = true, clicking a button inside the row\n * triggers the doubleClick event for the entire row.\n *\n * If cellButtonInvokeRowsOnDoubleClick = false, the doubleClick event for the row\n * is not triggered, but will triggered cellButtonClicked event with (key: PTableRowKey) argument.\n */\n cellButtonInvokeRowsOnDoubleClick?: boolean;\n\n /** @see {@link PlAgOverlayLoadingParams.loadingText} */\n loadingText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.runningText} */\n runningText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.notReadyText} */\n notReadyText?: string;\n\n /** @see {@link PlAgOverlayNoRowsParams.text} */\n noRowsText?: string;\n\n /**\n * Callback to override the default renderer for a given cell.\n * @see https://www.ag-grid.com/vue-data-grid/component-cell-renderer/#dynamic-component-selection\n */\n cellRendererSelector?: CellRendererSelectorFunc<PlAgDataTableV2Row>;\n}>();\nconst { settings } = toRefs(props);\nconst emit = defineEmits<{\n rowDoubleClicked: [key?: PTableKey];\n cellButtonClicked: [key?: PTableKey];\n newDataRendered: [];\n}>();\n\nconst dataRenderedTracker = new DeferredCircular<GridApi<PlAgDataTableV2Row>>();\nconst { gridApi, gridOptions } = useGrid({\n selection: selection.value,\n noRowsText: props.noRowsText,\n runningText: props.runningText,\n loadingText: props.loadingText,\n notReadyText: props.notReadyText,\n cellRendererSelector: props.cellRendererSelector,\n});\nlet isReloading = false;\ngridOptions.value.onGridPreDestroyed = (event) => {\n if (!isReloading) {\n gridOptions.value.initialState = gridState.value = normalizeColumnVisibility(\n makePartialState(event.api.getState()),\n gridState.value,\n event.api,\n );\n }\n gridApi.value = null;\n};\ngridOptions.value.onRowDoubleClicked = (event) => {\n if (event.data && event.data.axesKey) emit(\"rowDoubleClicked\", event.data.axesKey);\n};\ngridOptions.value.onStateUpdated = (event) => {\n const partialState = normalizeColumnVisibility(\n makePartialState(event.state),\n gridState.value,\n event.api,\n );\n // We have to keep initialState synchronized with gridState for gridState recovery after key updating.\n gridOptions.value.initialState = gridState.value = partialState;\n\n if (!isJsonEqual(event.sources, [\"columnSizing\"])) {\n event.api.autoSizeColumns(\n event.api\n .getAllDisplayedColumns()\n .filter((column) => column.getColId() !== PlAgDataTableRowNumberColId),\n );\n }\n};\n\nconst [filterableColumns, visibleFilterableColumns] = useFilterableColumns(\n () => settings.value.sourceId,\n () => gridOptions.value.columnDefs ?? null,\n);\nconst { gridState, sheetsState, filtersState, searchString } = useTableState(\n tableState,\n settings,\n visibleFilterableColumns,\n);\nconst sheetsSettings = computed<PlDataTableSheetsSettings>(() => {\n const settingsCopy = { ...settings.value };\n return settingsCopy.sourceId !== null\n ? {\n sheets: settingsCopy.sheets ?? [],\n cachedState: [...sheetsState.value],\n }\n : {\n sheets: [],\n cachedState: [],\n };\n});\ngridOptions.value.initialState = gridState.value;\n\n// Restore proper types erased by AgGrid\nfunction makePartialState(state: GridState): PlDataTableGridStateCore {\n return {\n columnOrder: state.columnOrder as\n | {\n orderedColIds: PlTableColumnIdJson[];\n }\n | undefined,\n sort: state.sort as\n | {\n sortModel: {\n colId: PlTableColumnIdJson;\n sort: \"asc\" | \"desc\";\n }[];\n }\n | undefined,\n columnVisibility: state.columnVisibility as\n | {\n hiddenColIds: PlTableColumnIdJson[];\n }\n | undefined,\n };\n}\n\n// AG Grid returns columnVisibility: undefined when all columns are visible.\n// We need to distinguish \"no state yet\" (use isColumnOptional defaults) from\n// \"user explicitly showed all columns\" (store []). This function normalizes\n// the undefined from AG Grid based on the previous state.\nfunction normalizeColumnVisibility(\n partialState: PlDataTableGridStateCore,\n prevState: PlDataTableGridStateCore,\n api: GridApi<PlAgDataTableV2Row>,\n): PlDataTableGridStateCore {\n if (partialState.columnVisibility !== undefined) return partialState;\n\n if (prevState.columnVisibility !== undefined) {\n // Had explicit visibility state before → user made all columns visible → store [].\n return { ...partialState, columnVisibility: { hiddenColIds: [] } };\n }\n\n // No previous explicit state → compute defaults from current columns\n // to replicate: hide: hiddenColIds?.includes(colId) ?? isColumnOptional(spec.spec)\n const defaultHidden = getDefaultHiddenColIds(api);\n if (defaultHidden.length > 0) {\n return { ...partialState, columnVisibility: { hiddenColIds: defaultHidden } };\n }\n\n return partialState;\n}\n\nfunction getDefaultHiddenColIds(api: GridApi<PlAgDataTableV2Row>): PlTableColumnIdJson[] {\n const cols = api.getAllGridColumns();\n if (!cols) return [];\n return cols\n .filter((col) => {\n const spec = col.getColDef().context as PTableColumnSpec | undefined;\n return spec && isColumnOptional(spec.spec);\n })\n .map((col) => col.getColId() as PlTableColumnIdJson);\n}\n\n// Normalize columnVisibility for comparison: undefined and { hiddenColIds: [] } are equivalent.\nfunction stateForReloadCompare(state: PlDataTableGridStateCore): PlDataTableGridStateCore {\n const cv = state.columnVisibility;\n const normalizedCv = !cv || cv.hiddenColIds.length === 0 ? undefined : state.columnVisibility;\n return { ...state, columnVisibility: normalizedCv };\n}\n\n// Reload AgGrid when new state arrives from server\nconst reloadKey = ref(0);\nwatch(\n () => [gridApi.value, gridState.value] as const,\n ([gridApi, gridState]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n const selfState = makePartialState(gridApi.getState());\n if (\n !isJsonEqual(gridState, {}) &&\n !isJsonEqual(stateForReloadCompare(gridState), stateForReloadCompare(selfState))\n ) {\n isReloading = true;\n gridOptions.value.initialState = gridState;\n ++reloadKey.value;\n nextTick(() => {\n isReloading = false;\n });\n }\n },\n);\n\n// Make cellRendererSelector reactive\nconst cellRendererSelector = computed(() => props.cellRendererSelector ?? null);\nwatch(\n () => [gridApi.value, cellRendererSelector.value] as const,\n ([gridApi, cellRendererSelector]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.setGridOption(\"defaultColDef\", {\n ...gridOptions.value.defaultColDef,\n cellRendererSelector: cellRendererSelector ?? undefined,\n });\n },\n);\n\ndefineExpose<PlAgDataTableV2Controller>({\n focusRow: async (rowKey) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n return ensureNodeVisible(gridApi, (row) => isJsonEqual(row.data?.axesKey, rowKey));\n },\n updateSelection: async ({ axesSpec, selectedKeys }) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n const axes = selection.value?.axesSpec;\n if (!axes || axes.length !== axesSpec.length) return false;\n\n const mapping = axesSpec.map((spec) => {\n const id = getAxisId(spec);\n return axes.findIndex((axis) => matchAxisId(axis, id));\n });\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) return false;\n\n const selectedNodes = selectedKeys.map((key) =>\n canonicalizeJson<PlTableRowId>(mapping.map((index) => key[index])),\n );\n const oldSelectedKeys = gridApi.getServerSideSelectionState()?.toggledNodes ?? [];\n if (!isJsonEqual(oldSelectedKeys, selectedNodes)) {\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes,\n });\n\n // wait for `onSelectionChanged` to update `selection` model\n const scope = effectScope();\n const { resolve, promise } = Promise.withResolvers();\n scope.run(() => watch(selection, resolve, { once: true }));\n try {\n await promiseTimeout(promise, 500);\n } catch {\n return false;\n } finally {\n scope.stop();\n }\n }\n return true;\n },\n});\n\n// Update AgGrid when settings change\nconst defaultSelection = createPlSelectionModel();\nlet oldSettings: PlDataTableSettingsV2 | null = null;\nconst generation = ref(0);\nwatch(\n () => [gridApi.value, settings.value] as const,\n ([gridApi, settings]) => {\n // Wait for AgGrid reinitialization, gridApi will eventually become initialized\n if (!gridApi || gridApi.isDestroyed()) return;\n // Verify that this is not a false watch trigger\n if (isJsonEqual(settings, oldSettings)) return;\n ++generation.value;\n try {\n // Hide no rows overlay if it is shown, or else loading overlay will not be shown\n gridApi.hideOverlay();\n dataRenderedTracker.reset();\n\n // No data source selected -> reset state to default\n if (settings.sourceId === null) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: settings.pending ? \"running\" : \"not-ready\",\n } satisfies PlAgOverlayLoadingParams,\n columnDefs: undefined,\n serverSideDatasource: undefined,\n });\n if (selection.value) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n return;\n }\n\n // Data source changed -> show full page loader, clear selection\n if (settings.sourceId !== oldSettings?.sourceId) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: \"loading\",\n } satisfies PlAgOverlayLoadingParams,\n });\n if (selection.value && oldSettings?.sourceId) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n }\n\n // Model updated -> show skeletons instead of data\n const sourceChanged =\n settings.model?.sourceId && settings.model.sourceId !== settings.sourceId;\n if (!settings.model || sourceChanged) {\n const state = gridApi.getServerSideGroupLevelState();\n const rowCount = !sourceChanged && state.length > 0 ? state[0].rowCount : 1;\n return gridApi.updateGridOptions({\n serverSideDatasource: {\n getRows: (params) => {\n params.success({ rowData: [], rowCount });\n },\n },\n });\n }\n\n // Model ready -> calculate new state\n const stateGeneration = generation.value;\n calculateGridOptions({\n generation,\n pfDriver: getRawPlatformaInstance().pFrameDriver,\n model: settings.model,\n sheets: settings.sheets ?? [],\n dataRenderedTracker,\n hiddenColIds: gridState.value.columnVisibility?.hiddenColIds,\n cellButtonAxisParams: {\n showCellButtonForAxisId: props.showCellButtonForAxisId,\n cellButtonInvokeRowsOnDoubleClick: props.cellButtonInvokeRowsOnDoubleClick,\n trigger: (key?: PTableKey) => emit(\"cellButtonClicked\", key),\n } satisfies PlAgCellButtonAxisParams,\n })\n .then((result) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n const { axesSpec, ...options } = result;\n gridApi.updateGridOptions({\n ...options,\n });\n if (selection.value) {\n // Update selection if axesSpec changed, as order of axes may have changed and so we need to remap selected keys\n const { axesSpec: oldAxesSpec, selectedKeys: oldSelectedKeys } = selection.value;\n if (!isJsonEqual(oldAxesSpec, axesSpec)) {\n if (!oldAxesSpec || axesSpec.length !== oldAxesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const mapping = oldAxesSpec\n .map(getAxisId)\n .map((id) => axesSpec.findIndex((axis) => matchAxisId(axis, id)));\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const selectedNodes = oldSelectedKeys.map((key) =>\n mapping.map((index) => key[index]),\n );\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: selectedNodes };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes.map((key) => canonicalizeJson<PlTableRowId>(key)),\n });\n }\n }\n })\n .catch((error: unknown) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n if (isAbortError(error)) return;\n console.trace(error);\n })\n .finally(() => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n gridApi.updateGridOptions({\n loading: false,\n });\n });\n dataRenderedTracker.promise.then(() => emit(\"newDataRendered\"));\n } catch (error: unknown) {\n console.trace(error);\n } finally {\n oldSettings = settings;\n }\n },\n);\n\nwatch(\n () => ({\n gridApi: gridApi.value,\n loadingText: props.loadingText,\n runningText: props.runningText,\n notReadyText: props.notReadyText,\n noRowsText: props.noRowsText,\n }),\n ({ gridApi, loadingText, runningText, notReadyText, noRowsText }) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.updateGridOptions({\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n loadingText,\n runningText,\n notReadyText,\n },\n noRowsOverlayComponentParams: {\n ...gridOptions.value.noRowsOverlayComponentParams,\n text: noRowsText,\n },\n });\n },\n);\n\nwatchEffect(() => {\n if (!gridApi.value || gridApi.value?.isDestroyed()) return;\n gridApi.value.updateGridOptions({\n statusBar: gridOptions.value.loading\n ? undefined\n : {\n statusPanels: [{ statusPanel: PlAgRowCount, align: \"left\" }],\n },\n });\n});\n</script>\n\n<template>\n <div :class=\"$style.container\">\n <PlAgGridColumnManager v-if=\"gridApi && !disableColumnsPanel\" :api=\"gridApi\" />\n <PlTableFiltersV2\n v-if=\"!disableFiltersPanel\"\n v-model=\"filtersState\"\n :pframe-handle=\"'model' in settings ? settings?.model?.fullPframeHandle : undefined\"\n :columns=\"filterableColumns\"\n />\n <PlAgCsvExporter v-if=\"gridApi && showExportButton\" :api=\"gridApi\" />\n <PlAgDataTableSheets v-model=\"sheetsState\" :settings=\"sheetsSettings\">\n <template v-if=\"$slots['before-sheets']\" #before>\n <slot name=\"before-sheets\" />\n </template>\n <template v-if=\"$slots['after-sheets']\" #after>\n <slot name=\"after-sheets\" />\n </template>\n </PlAgDataTableSheets>\n <PlTableFastSearch v-model=\"searchString\" />\n <AgGridVue\n :key=\"reloadKey\"\n :theme=\"AgGridTheme\"\n :class=\"$style.grid\"\n :grid-options=\"gridOptions\"\n />\n </div>\n</template>\n\n<style lang=\"css\" module>\n.container {\n display: flex;\n flex-direction: column;\n height: 100%;\n gap: 12px;\n}\n\n.grid {\n flex: 1;\n}\n</style>\n"],"mappings":""}
|
|
@@ -15,7 +15,7 @@ import { calculateGridOptions as l } from "./sources/table-source-v2.js";
|
|
|
15
15
|
import { useTableState as u } from "./sources/table-state-v2.js";
|
|
16
16
|
import { useFilterableColumns as ne } from "./compositions/useFilterableColumns.js";
|
|
17
17
|
import { useGrid as re } from "./compositions/useGrid.js";
|
|
18
|
-
import { AgGridTheme as ie } from "
|
|
18
|
+
import { AgGridTheme as ie } from "../../AgGridVue/AgGridTheme.js";
|
|
19
19
|
import { computed as d, createBlock as f, createCommentVNode as p, createElementBlock as ae, createSlots as m, createVNode as h, defineComponent as g, effectScope as _, isRef as v, mergeModels as y, nextTick as oe, normalizeClass as b, openBlock as x, ref as S, renderSlot as C, toRefs as se, unref as w, useModel as T, watch as E, watchEffect as D, withCtx as O } from "vue";
|
|
20
20
|
import { canonicalizeJson as k, createPlSelectionModel as A, getAxisId as j, getRawPlatformaInstance as ce, isAbortError as M, isColumnOptional as le, matchAxisId as N } from "@platforma-sdk/model";
|
|
21
21
|
import { AgGridVue as ue } from "ag-grid-vue3";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgDataTableV2.vue_vue_type_script_setup_true_lang.js","names":["$style","$slots"],"sources":["../../../src/components/PlAgDataTable/PlAgDataTableV2.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { promiseTimeout, isJsonEqual } from \"@milaboratories/helpers\";\nimport type {\n AxisId,\n PlDataTableGridStateCore,\n PlDataTableStateV2,\n PlSelectionModel,\n PlTableColumnIdJson,\n PTableColumnSpec,\n PTableKey,\n} from \"@platforma-sdk/model\";\nimport {\n getRawPlatformaInstance,\n createPlSelectionModel,\n matchAxisId,\n getAxisId,\n canonicalizeJson,\n isAbortError,\n isColumnOptional,\n} from \"@platforma-sdk/model\";\nimport type { CellRendererSelectorFunc, GridApi, GridState } from \"ag-grid-enterprise\";\nimport { AgGridVue } from \"ag-grid-vue3\";\nimport { computed, effectScope, nextTick, ref, toRefs, watch, watchEffect } from \"vue\";\nimport PlAgCsvExporter from \"../PlAgCsvExporter/PlAgCsvExporter.vue\";\nimport { PlAgGridColumnManager } from \"../PlAgGridColumnManager\";\nimport PlTableFiltersV2 from \"../PlTableFilters/PlTableFiltersV2.vue\";\nimport { PlTableFastSearch } from \"../PlTableFastSearch\";\nimport PlAgDataTableSheets from \"./PlAgDataTableSheets.vue\";\nimport PlAgRowCount from \"./PlAgRowCount.vue\";\nimport { DeferredCircular, ensureNodeVisible } from \"./sources/focus-row\";\nimport { PlAgDataTableRowNumberColId } from \"./sources/row-number\";\nimport type { PlAgCellButtonAxisParams } from \"./sources/table-source-v2\";\nimport { calculateGridOptions } from \"./sources/table-source-v2\";\nimport { useTableState } from \"./sources/table-state-v2\";\nimport type {\n PlAgDataTableV2Controller,\n PlAgDataTableV2Row,\n PlAgOverlayLoadingParams,\n PlAgOverlayNoRowsParams,\n PlDataTableSettingsV2,\n PlDataTableSheetsSettings,\n PlTableRowId,\n} from \"./types\";\nimport { useFilterableColumns } from \"./compositions/useFilterableColumns\";\nimport { useGrid } from \"./compositions/useGrid\";\nimport { AgGridTheme } from \"./compositions/useTheme\";\n\nconst tableState = defineModel<PlDataTableStateV2>({\n required: true,\n});\n/** Warning: selection model value updates are ignored, use updateSelection instead */\nconst selection = defineModel<PlSelectionModel>(\"selection\");\nconst props = defineProps<{\n /** Required component settings */\n settings: Readonly<PlDataTableSettingsV2>;\n\n /**\n * The disableColumnsPanel prop controls the display of a button that activates\n * the columns management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableColumnsPanel?: boolean;\n\n /**\n * The disableFiltersPanel prop controls the display of a button that activates\n * the filters management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableFiltersPanel?: boolean;\n\n /**\n * The showExportButton prop controls the display of a button that allows\n * to export table data in CSV format. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n showExportButton?: boolean;\n\n /**\n * The AxisId property is used to configure and display the PlAgTextAndButtonCell component\n */\n showCellButtonForAxisId?: AxisId;\n\n /**\n * If cellButtonInvokeRowsOnDoubleClick = true, clicking a button inside the row\n * triggers the doubleClick event for the entire row.\n *\n * If cellButtonInvokeRowsOnDoubleClick = false, the doubleClick event for the row\n * is not triggered, but will triggered cellButtonClicked event with (key: PTableRowKey) argument.\n */\n cellButtonInvokeRowsOnDoubleClick?: boolean;\n\n /** @see {@link PlAgOverlayLoadingParams.loadingText} */\n loadingText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.runningText} */\n runningText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.notReadyText} */\n notReadyText?: string;\n\n /** @see {@link PlAgOverlayNoRowsParams.text} */\n noRowsText?: string;\n\n /**\n * Callback to override the default renderer for a given cell.\n * @see https://www.ag-grid.com/vue-data-grid/component-cell-renderer/#dynamic-component-selection\n */\n cellRendererSelector?: CellRendererSelectorFunc<PlAgDataTableV2Row>;\n}>();\nconst { settings } = toRefs(props);\nconst emit = defineEmits<{\n rowDoubleClicked: [key?: PTableKey];\n cellButtonClicked: [key?: PTableKey];\n newDataRendered: [];\n}>();\n\nconst dataRenderedTracker = new DeferredCircular<GridApi<PlAgDataTableV2Row>>();\nconst { gridApi, gridOptions } = useGrid({\n selection: selection.value,\n noRowsText: props.noRowsText,\n runningText: props.runningText,\n loadingText: props.loadingText,\n notReadyText: props.notReadyText,\n cellRendererSelector: props.cellRendererSelector,\n});\nlet isReloading = false;\ngridOptions.value.onGridPreDestroyed = (event) => {\n if (!isReloading) {\n gridOptions.value.initialState = gridState.value = normalizeColumnVisibility(\n makePartialState(event.api.getState()),\n gridState.value,\n event.api,\n );\n }\n gridApi.value = null;\n};\ngridOptions.value.onRowDoubleClicked = (event) => {\n if (event.data && event.data.axesKey) emit(\"rowDoubleClicked\", event.data.axesKey);\n};\ngridOptions.value.onStateUpdated = (event) => {\n const partialState = normalizeColumnVisibility(\n makePartialState(event.state),\n gridState.value,\n event.api,\n );\n // We have to keep initialState synchronized with gridState for gridState recovery after key updating.\n gridOptions.value.initialState = gridState.value = partialState;\n\n if (!isJsonEqual(event.sources, [\"columnSizing\"])) {\n event.api.autoSizeColumns(\n event.api\n .getAllDisplayedColumns()\n .filter((column) => column.getColId() !== PlAgDataTableRowNumberColId),\n );\n }\n};\n\nconst [filterableColumns, visibleFilterableColumns] = useFilterableColumns(\n () => settings.value.sourceId,\n () => gridOptions.value.columnDefs ?? null,\n);\nconst { gridState, sheetsState, filtersState, searchString } = useTableState(\n tableState,\n settings,\n visibleFilterableColumns,\n);\nconst sheetsSettings = computed<PlDataTableSheetsSettings>(() => {\n const settingsCopy = { ...settings.value };\n return settingsCopy.sourceId !== null\n ? {\n sheets: settingsCopy.sheets ?? [],\n cachedState: [...sheetsState.value],\n }\n : {\n sheets: [],\n cachedState: [],\n };\n});\ngridOptions.value.initialState = gridState.value;\n\n// Restore proper types erased by AgGrid\nfunction makePartialState(state: GridState): PlDataTableGridStateCore {\n return {\n columnOrder: state.columnOrder as\n | {\n orderedColIds: PlTableColumnIdJson[];\n }\n | undefined,\n sort: state.sort as\n | {\n sortModel: {\n colId: PlTableColumnIdJson;\n sort: \"asc\" | \"desc\";\n }[];\n }\n | undefined,\n columnVisibility: state.columnVisibility as\n | {\n hiddenColIds: PlTableColumnIdJson[];\n }\n | undefined,\n };\n}\n\n// AG Grid returns columnVisibility: undefined when all columns are visible.\n// We need to distinguish \"no state yet\" (use isColumnOptional defaults) from\n// \"user explicitly showed all columns\" (store []). This function normalizes\n// the undefined from AG Grid based on the previous state.\nfunction normalizeColumnVisibility(\n partialState: PlDataTableGridStateCore,\n prevState: PlDataTableGridStateCore,\n api: GridApi<PlAgDataTableV2Row>,\n): PlDataTableGridStateCore {\n if (partialState.columnVisibility !== undefined) return partialState;\n\n if (prevState.columnVisibility !== undefined) {\n // Had explicit visibility state before → user made all columns visible → store [].\n return { ...partialState, columnVisibility: { hiddenColIds: [] } };\n }\n\n // No previous explicit state → compute defaults from current columns\n // to replicate: hide: hiddenColIds?.includes(colId) ?? isColumnOptional(spec.spec)\n const defaultHidden = getDefaultHiddenColIds(api);\n if (defaultHidden.length > 0) {\n return { ...partialState, columnVisibility: { hiddenColIds: defaultHidden } };\n }\n\n return partialState;\n}\n\nfunction getDefaultHiddenColIds(api: GridApi<PlAgDataTableV2Row>): PlTableColumnIdJson[] {\n const cols = api.getAllGridColumns();\n if (!cols) return [];\n return cols\n .filter((col) => {\n const spec = col.getColDef().context as PTableColumnSpec | undefined;\n return spec && isColumnOptional(spec.spec);\n })\n .map((col) => col.getColId() as PlTableColumnIdJson);\n}\n\n// Normalize columnVisibility for comparison: undefined and { hiddenColIds: [] } are equivalent.\nfunction stateForReloadCompare(state: PlDataTableGridStateCore): PlDataTableGridStateCore {\n const cv = state.columnVisibility;\n const normalizedCv = !cv || cv.hiddenColIds.length === 0 ? undefined : state.columnVisibility;\n return { ...state, columnVisibility: normalizedCv };\n}\n\n// Reload AgGrid when new state arrives from server\nconst reloadKey = ref(0);\nwatch(\n () => [gridApi.value, gridState.value] as const,\n ([gridApi, gridState]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n const selfState = makePartialState(gridApi.getState());\n if (\n !isJsonEqual(gridState, {}) &&\n !isJsonEqual(stateForReloadCompare(gridState), stateForReloadCompare(selfState))\n ) {\n isReloading = true;\n gridOptions.value.initialState = gridState;\n ++reloadKey.value;\n nextTick(() => {\n isReloading = false;\n });\n }\n },\n);\n\n// Make cellRendererSelector reactive\nconst cellRendererSelector = computed(() => props.cellRendererSelector ?? null);\nwatch(\n () => [gridApi.value, cellRendererSelector.value] as const,\n ([gridApi, cellRendererSelector]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.setGridOption(\"defaultColDef\", {\n ...gridOptions.value.defaultColDef,\n cellRendererSelector: cellRendererSelector ?? undefined,\n });\n },\n);\n\ndefineExpose<PlAgDataTableV2Controller>({\n focusRow: async (rowKey) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n return ensureNodeVisible(gridApi, (row) => isJsonEqual(row.data?.axesKey, rowKey));\n },\n updateSelection: async ({ axesSpec, selectedKeys }) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n const axes = selection.value?.axesSpec;\n if (!axes || axes.length !== axesSpec.length) return false;\n\n const mapping = axesSpec.map((spec) => {\n const id = getAxisId(spec);\n return axes.findIndex((axis) => matchAxisId(axis, id));\n });\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) return false;\n\n const selectedNodes = selectedKeys.map((key) =>\n canonicalizeJson<PlTableRowId>(mapping.map((index) => key[index])),\n );\n const oldSelectedKeys = gridApi.getServerSideSelectionState()?.toggledNodes ?? [];\n if (!isJsonEqual(oldSelectedKeys, selectedNodes)) {\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes,\n });\n\n // wait for `onSelectionChanged` to update `selection` model\n const scope = effectScope();\n const { resolve, promise } = Promise.withResolvers();\n scope.run(() => watch(selection, resolve, { once: true }));\n try {\n await promiseTimeout(promise, 500);\n } catch {\n return false;\n } finally {\n scope.stop();\n }\n }\n return true;\n },\n});\n\n// Update AgGrid when settings change\nconst defaultSelection = createPlSelectionModel();\nlet oldSettings: PlDataTableSettingsV2 | null = null;\nconst generation = ref(0);\nwatch(\n () => [gridApi.value, settings.value] as const,\n ([gridApi, settings]) => {\n // Wait for AgGrid reinitialization, gridApi will eventually become initialized\n if (!gridApi || gridApi.isDestroyed()) return;\n // Verify that this is not a false watch trigger\n if (isJsonEqual(settings, oldSettings)) return;\n ++generation.value;\n try {\n // Hide no rows overlay if it is shown, or else loading overlay will not be shown\n gridApi.hideOverlay();\n dataRenderedTracker.reset();\n\n // No data source selected -> reset state to default\n if (settings.sourceId === null) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: settings.pending ? \"running\" : \"not-ready\",\n } satisfies PlAgOverlayLoadingParams,\n columnDefs: undefined,\n serverSideDatasource: undefined,\n });\n if (selection.value) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n return;\n }\n\n // Data source changed -> show full page loader, clear selection\n if (settings.sourceId !== oldSettings?.sourceId) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: \"loading\",\n } satisfies PlAgOverlayLoadingParams,\n });\n if (selection.value && oldSettings?.sourceId) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n }\n\n // Model updated -> show skeletons instead of data\n const sourceChanged =\n settings.model?.sourceId && settings.model.sourceId !== settings.sourceId;\n if (!settings.model || sourceChanged) {\n const state = gridApi.getServerSideGroupLevelState();\n const rowCount = !sourceChanged && state.length > 0 ? state[0].rowCount : 1;\n return gridApi.updateGridOptions({\n serverSideDatasource: {\n getRows: (params) => {\n params.success({ rowData: [], rowCount });\n },\n },\n });\n }\n\n // Model ready -> calculate new state\n const stateGeneration = generation.value;\n calculateGridOptions({\n generation,\n pfDriver: getRawPlatformaInstance().pFrameDriver,\n model: settings.model,\n sheets: settings.sheets ?? [],\n dataRenderedTracker,\n hiddenColIds: gridState.value.columnVisibility?.hiddenColIds,\n cellButtonAxisParams: {\n showCellButtonForAxisId: props.showCellButtonForAxisId,\n cellButtonInvokeRowsOnDoubleClick: props.cellButtonInvokeRowsOnDoubleClick,\n trigger: (key?: PTableKey) => emit(\"cellButtonClicked\", key),\n } satisfies PlAgCellButtonAxisParams,\n })\n .then((result) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n const { axesSpec, ...options } = result;\n gridApi.updateGridOptions({\n ...options,\n });\n if (selection.value) {\n // Update selection if axesSpec changed, as order of axes may have changed and so we need to remap selected keys\n const { axesSpec: oldAxesSpec, selectedKeys: oldSelectedKeys } = selection.value;\n if (!isJsonEqual(oldAxesSpec, axesSpec)) {\n if (!oldAxesSpec || axesSpec.length !== oldAxesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const mapping = oldAxesSpec\n .map(getAxisId)\n .map((id) => axesSpec.findIndex((axis) => matchAxisId(axis, id)));\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const selectedNodes = oldSelectedKeys.map((key) =>\n mapping.map((index) => key[index]),\n );\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: selectedNodes };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes.map((key) => canonicalizeJson<PlTableRowId>(key)),\n });\n }\n }\n })\n .catch((error: unknown) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n if (isAbortError(error)) return;\n console.trace(error);\n })\n .finally(() => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n gridApi.updateGridOptions({\n loading: false,\n });\n });\n dataRenderedTracker.promise.then(() => emit(\"newDataRendered\"));\n } catch (error: unknown) {\n console.trace(error);\n } finally {\n oldSettings = settings;\n }\n },\n);\n\nwatch(\n () => ({\n gridApi: gridApi.value,\n loadingText: props.loadingText,\n runningText: props.runningText,\n notReadyText: props.notReadyText,\n noRowsText: props.noRowsText,\n }),\n ({ gridApi, loadingText, runningText, notReadyText, noRowsText }) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.updateGridOptions({\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n loadingText,\n runningText,\n notReadyText,\n },\n noRowsOverlayComponentParams: {\n ...gridOptions.value.noRowsOverlayComponentParams,\n text: noRowsText,\n },\n });\n },\n);\n\nwatchEffect(() => {\n if (!gridApi.value || gridApi.value?.isDestroyed()) return;\n gridApi.value.updateGridOptions({\n statusBar: gridOptions.value.loading\n ? undefined\n : {\n statusPanels: [{ statusPanel: PlAgRowCount, align: \"left\" }],\n },\n });\n});\n</script>\n\n<template>\n <div :class=\"$style.container\">\n <PlAgGridColumnManager v-if=\"gridApi && !disableColumnsPanel\" :api=\"gridApi\" />\n <PlTableFiltersV2\n v-if=\"!disableFiltersPanel\"\n v-model=\"filtersState\"\n :pframe-handle=\"'model' in settings ? settings?.model?.fullPframeHandle : undefined\"\n :columns=\"filterableColumns\"\n />\n <PlAgCsvExporter v-if=\"gridApi && showExportButton\" :api=\"gridApi\" />\n <PlAgDataTableSheets v-model=\"sheetsState\" :settings=\"sheetsSettings\">\n <template v-if=\"$slots['before-sheets']\" #before>\n <slot name=\"before-sheets\" />\n </template>\n <template v-if=\"$slots['after-sheets']\" #after>\n <slot name=\"after-sheets\" />\n </template>\n </PlAgDataTableSheets>\n <PlTableFastSearch v-model=\"searchString\" />\n <AgGridVue\n :key=\"reloadKey\"\n :theme=\"AgGridTheme\"\n :class=\"$style.grid\"\n :grid-options=\"gridOptions\"\n />\n </div>\n</template>\n\n<style lang=\"css\" module>\n.container {\n display: flex;\n flex-direction: column;\n height: 100%;\n gap: 12px;\n}\n\n.grid {\n flex: 1;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CA,IAAM,KAAa,EAA+B,GAAA,aAEhD,EAEI,IAAY,EAA6B,GAAC,YAAY,EACtD,IAAQ,GA4DR,EAAE,gBAAa,GAAO,EAAM,EAC5B,IAAO,GAMP,IAAsB,IAAI,IAA+C,EACzE,EAAE,YAAS,mBAAgB,GAAQ;GACvC,WAAW,EAAU;GACrB,YAAY,EAAM;GAClB,aAAa,EAAM;GACnB,aAAa,EAAM;GACnB,cAAc,EAAM;GACpB,sBAAsB,EAAM;GAC7B,CAAC,EACE,IAAc;AAclB,EAbA,EAAY,MAAM,sBAAsB,MAAU;AAQhD,GAPK,MACH,EAAY,MAAM,eAAe,EAAU,QAAQ,EACjD,EAAiB,EAAM,IAAI,UAAU,CAAC,EACtC,EAAU,OACV,EAAM,IACP,GAEH,EAAQ,QAAQ;KAElB,EAAY,MAAM,sBAAsB,MAAU;AAChD,GAAI,EAAM,QAAQ,EAAM,KAAK,WAAS,EAAK,oBAAoB,EAAM,KAAK,QAAQ;KAEpF,EAAY,MAAM,kBAAkB,MAAU;GAC5C,IAAM,IAAe,EACnB,EAAiB,EAAM,MAAM,EAC7B,EAAU,OACV,EAAM,IACP;AAID,GAFA,EAAY,MAAM,eAAe,EAAU,QAAQ,GAE9C,EAAY,EAAM,SAAS,CAAC,eAAe,CAAC,IAC/C,EAAM,IAAI,gBACR,EAAM,IACH,wBAAuB,CACvB,QAAQ,MAAW,EAAO,UAAU,KAAK,EAA4B,CACzE;;EAIL,IAAM,CAAC,IAAmB,MAA4B,SAC9C,EAAS,MAAM,gBACf,EAAY,MAAM,cAAc,KACvC,EACK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,EAAQ,MAAM,kBAAkB,EAC9B,WAAW,EAAY,MAAM,UACzB,KAAA,IACA,EACE,cAAc,CAAC;IAAE,aAAa;IAAc,OAAO;IAAQ,CAAC,EAC7D,EACN,CAAC;IACF,kBAIA,GAwBM,OAAA,EAxBA,OAAK,EAAEA,EAAAA,OAAO,UAAS,EAAA,EAAA;GACE,EAAA,EAAO,IAAA,CAAK,EAAA,uBAAA,GAAA,EAAzC,EAA+E,EAAA,EAAA,EAAA;;IAAhB,KAAK,EAAA,EAAO;;GAElE,EAAA,mCAAA,GAAA,EADT,EAKE,GAAA;;gBAHS,EAAA,EAAY;oDAAA,QAAA,IAAA;IACpB,iBAAa,WAAa,EAAA,EAAQ,GAAG,EAAA,EAAQ,EAAE,OAAO,mBAAmB,KAAA;IACzE,SAAS,EAAA,GAAiB;;;;;;GAEN,EAAA,EAAO,IAAI,EAAA,oBAAA,GAAA,EAAlC,EAAqE,GAAA;;IAAhB,KAAK,EAAA,EAAO;;GACjE,EAOsB,GAAA;gBAPQ,EAAA,EAAW;oDAAA,QAAA,IAAA;IAAG,UAAU,GAAA;mBACpCC,EAAAA,OAAM,mBAAA;UAAoB;gBACX,CAA7B,EAA6B,EAAA,QAAA,gBAAA,CAAA,CAAA;;eAEfA,EAAAA,OAAM,kBAAA;UAAmB;gBACX,CAA5B,EAA4B,EAAA,QAAA,eAAA,CAAA,CAAA;;;GAGhC,EAA4C,EAAA,EAAA,EAAA;gBAAhB,EAAA,EAAY;oDAAA,QAAA,IAAA;;SACxC,EAKE,EAAA,GAAA,EAAA;IAJC,KAAK,EAAA;IACL,OAAO,EAAA,GAAW;IAClB,OAAK,EAAED,EAAAA,OAAO,KAAI;IAClB,gBAAc,EAAA,EAAW"}
|
|
1
|
+
{"version":3,"file":"PlAgDataTableV2.vue_vue_type_script_setup_true_lang.js","names":["$style","$slots"],"sources":["../../../src/components/PlAgDataTable/PlAgDataTableV2.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { promiseTimeout, isJsonEqual } from \"@milaboratories/helpers\";\nimport type {\n AxisId,\n PlDataTableGridStateCore,\n PlDataTableStateV2,\n PlSelectionModel,\n PlTableColumnIdJson,\n PTableColumnSpec,\n PTableKey,\n} from \"@platforma-sdk/model\";\nimport {\n getRawPlatformaInstance,\n createPlSelectionModel,\n matchAxisId,\n getAxisId,\n canonicalizeJson,\n isAbortError,\n isColumnOptional,\n} from \"@platforma-sdk/model\";\nimport type { CellRendererSelectorFunc, GridApi, GridState } from \"ag-grid-enterprise\";\nimport { AgGridVue } from \"ag-grid-vue3\";\nimport { computed, effectScope, nextTick, ref, toRefs, watch, watchEffect } from \"vue\";\nimport PlAgCsvExporter from \"../PlAgCsvExporter/PlAgCsvExporter.vue\";\nimport { PlAgGridColumnManager } from \"../PlAgGridColumnManager\";\nimport PlTableFiltersV2 from \"../PlTableFilters/PlTableFiltersV2.vue\";\nimport { PlTableFastSearch } from \"../PlTableFastSearch\";\nimport PlAgDataTableSheets from \"./PlAgDataTableSheets.vue\";\nimport PlAgRowCount from \"./PlAgRowCount.vue\";\nimport { DeferredCircular, ensureNodeVisible } from \"./sources/focus-row\";\nimport { PlAgDataTableRowNumberColId } from \"./sources/row-number\";\nimport type { PlAgCellButtonAxisParams } from \"./sources/table-source-v2\";\nimport { calculateGridOptions } from \"./sources/table-source-v2\";\nimport { useTableState } from \"./sources/table-state-v2\";\nimport type {\n PlAgDataTableV2Controller,\n PlAgDataTableV2Row,\n PlAgOverlayLoadingParams,\n PlAgOverlayNoRowsParams,\n PlDataTableSettingsV2,\n PlDataTableSheetsSettings,\n PlTableRowId,\n} from \"./types\";\nimport { useFilterableColumns } from \"./compositions/useFilterableColumns\";\nimport { useGrid } from \"./compositions/useGrid\";\nimport { AgGridTheme } from \"../../AgGridVue/AgGridTheme\";\n\nconst tableState = defineModel<PlDataTableStateV2>({\n required: true,\n});\n/** Warning: selection model value updates are ignored, use updateSelection instead */\nconst selection = defineModel<PlSelectionModel>(\"selection\");\nconst props = defineProps<{\n /** Required component settings */\n settings: Readonly<PlDataTableSettingsV2>;\n\n /**\n * The disableColumnsPanel prop controls the display of a button that activates\n * the columns management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableColumnsPanel?: boolean;\n\n /**\n * The disableFiltersPanel prop controls the display of a button that activates\n * the filters management panel in the table. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n disableFiltersPanel?: boolean;\n\n /**\n * The showExportButton prop controls the display of a button that allows\n * to export table data in CSV format. To make the button functional\n * and visible, you must also include the PlAgDataTableToolsPanel component in your layout.\n * This component serves as the target for teleporting the button.\n */\n showExportButton?: boolean;\n\n /**\n * The AxisId property is used to configure and display the PlAgTextAndButtonCell component\n */\n showCellButtonForAxisId?: AxisId;\n\n /**\n * If cellButtonInvokeRowsOnDoubleClick = true, clicking a button inside the row\n * triggers the doubleClick event for the entire row.\n *\n * If cellButtonInvokeRowsOnDoubleClick = false, the doubleClick event for the row\n * is not triggered, but will triggered cellButtonClicked event with (key: PTableRowKey) argument.\n */\n cellButtonInvokeRowsOnDoubleClick?: boolean;\n\n /** @see {@link PlAgOverlayLoadingParams.loadingText} */\n loadingText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.runningText} */\n runningText?: string;\n\n /** @see {@link PlAgOverlayLoadingParams.notReadyText} */\n notReadyText?: string;\n\n /** @see {@link PlAgOverlayNoRowsParams.text} */\n noRowsText?: string;\n\n /**\n * Callback to override the default renderer for a given cell.\n * @see https://www.ag-grid.com/vue-data-grid/component-cell-renderer/#dynamic-component-selection\n */\n cellRendererSelector?: CellRendererSelectorFunc<PlAgDataTableV2Row>;\n}>();\nconst { settings } = toRefs(props);\nconst emit = defineEmits<{\n rowDoubleClicked: [key?: PTableKey];\n cellButtonClicked: [key?: PTableKey];\n newDataRendered: [];\n}>();\n\nconst dataRenderedTracker = new DeferredCircular<GridApi<PlAgDataTableV2Row>>();\nconst { gridApi, gridOptions } = useGrid({\n selection: selection.value,\n noRowsText: props.noRowsText,\n runningText: props.runningText,\n loadingText: props.loadingText,\n notReadyText: props.notReadyText,\n cellRendererSelector: props.cellRendererSelector,\n});\nlet isReloading = false;\ngridOptions.value.onGridPreDestroyed = (event) => {\n if (!isReloading) {\n gridOptions.value.initialState = gridState.value = normalizeColumnVisibility(\n makePartialState(event.api.getState()),\n gridState.value,\n event.api,\n );\n }\n gridApi.value = null;\n};\ngridOptions.value.onRowDoubleClicked = (event) => {\n if (event.data && event.data.axesKey) emit(\"rowDoubleClicked\", event.data.axesKey);\n};\ngridOptions.value.onStateUpdated = (event) => {\n const partialState = normalizeColumnVisibility(\n makePartialState(event.state),\n gridState.value,\n event.api,\n );\n // We have to keep initialState synchronized with gridState for gridState recovery after key updating.\n gridOptions.value.initialState = gridState.value = partialState;\n\n if (!isJsonEqual(event.sources, [\"columnSizing\"])) {\n event.api.autoSizeColumns(\n event.api\n .getAllDisplayedColumns()\n .filter((column) => column.getColId() !== PlAgDataTableRowNumberColId),\n );\n }\n};\n\nconst [filterableColumns, visibleFilterableColumns] = useFilterableColumns(\n () => settings.value.sourceId,\n () => gridOptions.value.columnDefs ?? null,\n);\nconst { gridState, sheetsState, filtersState, searchString } = useTableState(\n tableState,\n settings,\n visibleFilterableColumns,\n);\nconst sheetsSettings = computed<PlDataTableSheetsSettings>(() => {\n const settingsCopy = { ...settings.value };\n return settingsCopy.sourceId !== null\n ? {\n sheets: settingsCopy.sheets ?? [],\n cachedState: [...sheetsState.value],\n }\n : {\n sheets: [],\n cachedState: [],\n };\n});\ngridOptions.value.initialState = gridState.value;\n\n// Restore proper types erased by AgGrid\nfunction makePartialState(state: GridState): PlDataTableGridStateCore {\n return {\n columnOrder: state.columnOrder as\n | {\n orderedColIds: PlTableColumnIdJson[];\n }\n | undefined,\n sort: state.sort as\n | {\n sortModel: {\n colId: PlTableColumnIdJson;\n sort: \"asc\" | \"desc\";\n }[];\n }\n | undefined,\n columnVisibility: state.columnVisibility as\n | {\n hiddenColIds: PlTableColumnIdJson[];\n }\n | undefined,\n };\n}\n\n// AG Grid returns columnVisibility: undefined when all columns are visible.\n// We need to distinguish \"no state yet\" (use isColumnOptional defaults) from\n// \"user explicitly showed all columns\" (store []). This function normalizes\n// the undefined from AG Grid based on the previous state.\nfunction normalizeColumnVisibility(\n partialState: PlDataTableGridStateCore,\n prevState: PlDataTableGridStateCore,\n api: GridApi<PlAgDataTableV2Row>,\n): PlDataTableGridStateCore {\n if (partialState.columnVisibility !== undefined) return partialState;\n\n if (prevState.columnVisibility !== undefined) {\n // Had explicit visibility state before → user made all columns visible → store [].\n return { ...partialState, columnVisibility: { hiddenColIds: [] } };\n }\n\n // No previous explicit state → compute defaults from current columns\n // to replicate: hide: hiddenColIds?.includes(colId) ?? isColumnOptional(spec.spec)\n const defaultHidden = getDefaultHiddenColIds(api);\n if (defaultHidden.length > 0) {\n return { ...partialState, columnVisibility: { hiddenColIds: defaultHidden } };\n }\n\n return partialState;\n}\n\nfunction getDefaultHiddenColIds(api: GridApi<PlAgDataTableV2Row>): PlTableColumnIdJson[] {\n const cols = api.getAllGridColumns();\n if (!cols) return [];\n return cols\n .filter((col) => {\n const spec = col.getColDef().context as PTableColumnSpec | undefined;\n return spec && isColumnOptional(spec.spec);\n })\n .map((col) => col.getColId() as PlTableColumnIdJson);\n}\n\n// Normalize columnVisibility for comparison: undefined and { hiddenColIds: [] } are equivalent.\nfunction stateForReloadCompare(state: PlDataTableGridStateCore): PlDataTableGridStateCore {\n const cv = state.columnVisibility;\n const normalizedCv = !cv || cv.hiddenColIds.length === 0 ? undefined : state.columnVisibility;\n return { ...state, columnVisibility: normalizedCv };\n}\n\n// Reload AgGrid when new state arrives from server\nconst reloadKey = ref(0);\nwatch(\n () => [gridApi.value, gridState.value] as const,\n ([gridApi, gridState]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n const selfState = makePartialState(gridApi.getState());\n if (\n !isJsonEqual(gridState, {}) &&\n !isJsonEqual(stateForReloadCompare(gridState), stateForReloadCompare(selfState))\n ) {\n isReloading = true;\n gridOptions.value.initialState = gridState;\n ++reloadKey.value;\n nextTick(() => {\n isReloading = false;\n });\n }\n },\n);\n\n// Make cellRendererSelector reactive\nconst cellRendererSelector = computed(() => props.cellRendererSelector ?? null);\nwatch(\n () => [gridApi.value, cellRendererSelector.value] as const,\n ([gridApi, cellRendererSelector]) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.setGridOption(\"defaultColDef\", {\n ...gridOptions.value.defaultColDef,\n cellRendererSelector: cellRendererSelector ?? undefined,\n });\n },\n);\n\ndefineExpose<PlAgDataTableV2Controller>({\n focusRow: async (rowKey) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n return ensureNodeVisible(gridApi, (row) => isJsonEqual(row.data?.axesKey, rowKey));\n },\n updateSelection: async ({ axesSpec, selectedKeys }) => {\n const gridApi = await dataRenderedTracker.promise;\n if (gridApi.isDestroyed()) return false;\n\n const axes = selection.value?.axesSpec;\n if (!axes || axes.length !== axesSpec.length) return false;\n\n const mapping = axesSpec.map((spec) => {\n const id = getAxisId(spec);\n return axes.findIndex((axis) => matchAxisId(axis, id));\n });\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) return false;\n\n const selectedNodes = selectedKeys.map((key) =>\n canonicalizeJson<PlTableRowId>(mapping.map((index) => key[index])),\n );\n const oldSelectedKeys = gridApi.getServerSideSelectionState()?.toggledNodes ?? [];\n if (!isJsonEqual(oldSelectedKeys, selectedNodes)) {\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes,\n });\n\n // wait for `onSelectionChanged` to update `selection` model\n const scope = effectScope();\n const { resolve, promise } = Promise.withResolvers();\n scope.run(() => watch(selection, resolve, { once: true }));\n try {\n await promiseTimeout(promise, 500);\n } catch {\n return false;\n } finally {\n scope.stop();\n }\n }\n return true;\n },\n});\n\n// Update AgGrid when settings change\nconst defaultSelection = createPlSelectionModel();\nlet oldSettings: PlDataTableSettingsV2 | null = null;\nconst generation = ref(0);\nwatch(\n () => [gridApi.value, settings.value] as const,\n ([gridApi, settings]) => {\n // Wait for AgGrid reinitialization, gridApi will eventually become initialized\n if (!gridApi || gridApi.isDestroyed()) return;\n // Verify that this is not a false watch trigger\n if (isJsonEqual(settings, oldSettings)) return;\n ++generation.value;\n try {\n // Hide no rows overlay if it is shown, or else loading overlay will not be shown\n gridApi.hideOverlay();\n dataRenderedTracker.reset();\n\n // No data source selected -> reset state to default\n if (settings.sourceId === null) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: settings.pending ? \"running\" : \"not-ready\",\n } satisfies PlAgOverlayLoadingParams,\n columnDefs: undefined,\n serverSideDatasource: undefined,\n });\n if (selection.value) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n return;\n }\n\n // Data source changed -> show full page loader, clear selection\n if (settings.sourceId !== oldSettings?.sourceId) {\n gridApi.updateGridOptions({\n loading: true,\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n variant: \"loading\",\n } satisfies PlAgOverlayLoadingParams,\n });\n if (selection.value && oldSettings?.sourceId) {\n if (selection.value && !isJsonEqual(selection.value, defaultSelection)) {\n selection.value = createPlSelectionModel();\n }\n gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n }\n\n // Model updated -> show skeletons instead of data\n const sourceChanged =\n settings.model?.sourceId && settings.model.sourceId !== settings.sourceId;\n if (!settings.model || sourceChanged) {\n const state = gridApi.getServerSideGroupLevelState();\n const rowCount = !sourceChanged && state.length > 0 ? state[0].rowCount : 1;\n return gridApi.updateGridOptions({\n serverSideDatasource: {\n getRows: (params) => {\n params.success({ rowData: [], rowCount });\n },\n },\n });\n }\n\n // Model ready -> calculate new state\n const stateGeneration = generation.value;\n calculateGridOptions({\n generation,\n pfDriver: getRawPlatformaInstance().pFrameDriver,\n model: settings.model,\n sheets: settings.sheets ?? [],\n dataRenderedTracker,\n hiddenColIds: gridState.value.columnVisibility?.hiddenColIds,\n cellButtonAxisParams: {\n showCellButtonForAxisId: props.showCellButtonForAxisId,\n cellButtonInvokeRowsOnDoubleClick: props.cellButtonInvokeRowsOnDoubleClick,\n trigger: (key?: PTableKey) => emit(\"cellButtonClicked\", key),\n } satisfies PlAgCellButtonAxisParams,\n })\n .then((result) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n const { axesSpec, ...options } = result;\n gridApi.updateGridOptions({\n ...options,\n });\n if (selection.value) {\n // Update selection if axesSpec changed, as order of axes may have changed and so we need to remap selected keys\n const { axesSpec: oldAxesSpec, selectedKeys: oldSelectedKeys } = selection.value;\n if (!isJsonEqual(oldAxesSpec, axesSpec)) {\n if (!oldAxesSpec || axesSpec.length !== oldAxesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const mapping = oldAxesSpec\n .map(getAxisId)\n .map((id) => axesSpec.findIndex((axis) => matchAxisId(axis, id)));\n const mappingSet = new Set(mapping);\n if (mappingSet.has(-1) || mappingSet.size !== axesSpec.length) {\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: [] };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: [],\n });\n }\n\n const selectedNodes = oldSelectedKeys.map((key) =>\n mapping.map((index) => key[index]),\n );\n const newSelection: PlSelectionModel = { axesSpec, selectedKeys: selectedNodes };\n if (!isJsonEqual(selection.value, newSelection)) {\n selection.value = newSelection;\n }\n return gridApi.setServerSideSelectionState({\n selectAll: false,\n toggledNodes: selectedNodes.map((key) => canonicalizeJson<PlTableRowId>(key)),\n });\n }\n }\n })\n .catch((error: unknown) => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n if (isAbortError(error)) return;\n console.trace(error);\n })\n .finally(() => {\n if (gridApi.isDestroyed() || stateGeneration !== generation.value) return;\n gridApi.updateGridOptions({\n loading: false,\n });\n });\n dataRenderedTracker.promise.then(() => emit(\"newDataRendered\"));\n } catch (error: unknown) {\n console.trace(error);\n } finally {\n oldSettings = settings;\n }\n },\n);\n\nwatch(\n () => ({\n gridApi: gridApi.value,\n loadingText: props.loadingText,\n runningText: props.runningText,\n notReadyText: props.notReadyText,\n noRowsText: props.noRowsText,\n }),\n ({ gridApi, loadingText, runningText, notReadyText, noRowsText }) => {\n if (!gridApi || gridApi.isDestroyed()) return;\n gridApi.updateGridOptions({\n loadingOverlayComponentParams: {\n ...gridOptions.value.loadingOverlayComponentParams,\n loadingText,\n runningText,\n notReadyText,\n },\n noRowsOverlayComponentParams: {\n ...gridOptions.value.noRowsOverlayComponentParams,\n text: noRowsText,\n },\n });\n },\n);\n\nwatchEffect(() => {\n if (!gridApi.value || gridApi.value?.isDestroyed()) return;\n gridApi.value.updateGridOptions({\n statusBar: gridOptions.value.loading\n ? undefined\n : {\n statusPanels: [{ statusPanel: PlAgRowCount, align: \"left\" }],\n },\n });\n});\n</script>\n\n<template>\n <div :class=\"$style.container\">\n <PlAgGridColumnManager v-if=\"gridApi && !disableColumnsPanel\" :api=\"gridApi\" />\n <PlTableFiltersV2\n v-if=\"!disableFiltersPanel\"\n v-model=\"filtersState\"\n :pframe-handle=\"'model' in settings ? settings?.model?.fullPframeHandle : undefined\"\n :columns=\"filterableColumns\"\n />\n <PlAgCsvExporter v-if=\"gridApi && showExportButton\" :api=\"gridApi\" />\n <PlAgDataTableSheets v-model=\"sheetsState\" :settings=\"sheetsSettings\">\n <template v-if=\"$slots['before-sheets']\" #before>\n <slot name=\"before-sheets\" />\n </template>\n <template v-if=\"$slots['after-sheets']\" #after>\n <slot name=\"after-sheets\" />\n </template>\n </PlAgDataTableSheets>\n <PlTableFastSearch v-model=\"searchString\" />\n <AgGridVue\n :key=\"reloadKey\"\n :theme=\"AgGridTheme\"\n :class=\"$style.grid\"\n :grid-options=\"gridOptions\"\n />\n </div>\n</template>\n\n<style lang=\"css\" module>\n.container {\n display: flex;\n flex-direction: column;\n height: 100%;\n gap: 12px;\n}\n\n.grid {\n flex: 1;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA+CA,IAAM,KAAa,EAA+B,GAAA,aAEhD,EAEI,IAAY,EAA6B,GAAC,YAAY,EACtD,IAAQ,GA4DR,EAAE,gBAAa,GAAO,EAAM,EAC5B,IAAO,GAMP,IAAsB,IAAI,IAA+C,EACzE,EAAE,YAAS,mBAAgB,GAAQ;GACvC,WAAW,EAAU;GACrB,YAAY,EAAM;GAClB,aAAa,EAAM;GACnB,aAAa,EAAM;GACnB,cAAc,EAAM;GACpB,sBAAsB,EAAM;GAC7B,CAAC,EACE,IAAc;AAclB,EAbA,EAAY,MAAM,sBAAsB,MAAU;AAQhD,GAPK,MACH,EAAY,MAAM,eAAe,EAAU,QAAQ,EACjD,EAAiB,EAAM,IAAI,UAAU,CAAC,EACtC,EAAU,OACV,EAAM,IACP,GAEH,EAAQ,QAAQ;KAElB,EAAY,MAAM,sBAAsB,MAAU;AAChD,GAAI,EAAM,QAAQ,EAAM,KAAK,WAAS,EAAK,oBAAoB,EAAM,KAAK,QAAQ;KAEpF,EAAY,MAAM,kBAAkB,MAAU;GAC5C,IAAM,IAAe,EACnB,EAAiB,EAAM,MAAM,EAC7B,EAAU,OACV,EAAM,IACP;AAID,GAFA,EAAY,MAAM,eAAe,EAAU,QAAQ,GAE9C,EAAY,EAAM,SAAS,CAAC,eAAe,CAAC,IAC/C,EAAM,IAAI,gBACR,EAAM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11 +8,13 @@ export declare function useFilterableColumns(getSourceId: () => string | null, g
|
|
|
8
8
|
readonly type: import('@platforma-sdk/model').ValueType;
|
|
9
9
|
readonly name: string;
|
|
10
10
|
readonly domain?: Record<string, string> | undefined;
|
|
11
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
11
12
|
};
|
|
12
13
|
spec: {
|
|
13
14
|
readonly type: import('@platforma-sdk/model').ValueType;
|
|
14
15
|
readonly name: string;
|
|
15
16
|
readonly domain?: Record<string, string> | undefined;
|
|
17
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
16
18
|
readonly annotations?: Record<string, string> | undefined;
|
|
17
19
|
readonly parentAxes?: number[] | undefined;
|
|
18
20
|
};
|
|
@@ -23,6 +25,7 @@ export declare function useFilterableColumns(getSourceId: () => string | null, g
|
|
|
23
25
|
readonly kind: "PColumn";
|
|
24
26
|
readonly name: string;
|
|
25
27
|
readonly domain?: Record<string, string> | undefined;
|
|
28
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
26
29
|
readonly annotations?: Record<string, string> | undefined;
|
|
27
30
|
readonly valueType: "Int" | "Long" | "Float" | "Double" | "String" | "Bytes";
|
|
28
31
|
readonly parentAxes?: number[] | undefined;
|
|
@@ -30,6 +33,7 @@ export declare function useFilterableColumns(getSourceId: () => string | null, g
|
|
|
30
33
|
readonly type: import('@platforma-sdk/model').ValueType;
|
|
31
34
|
readonly name: string;
|
|
32
35
|
readonly domain?: Record<string, string> | undefined;
|
|
36
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
33
37
|
readonly annotations?: Record<string, string> | undefined;
|
|
34
38
|
readonly parentAxes?: number[] | undefined;
|
|
35
39
|
}[];
|
|
@@ -40,11 +44,13 @@ export declare function useFilterableColumns(getSourceId: () => string | null, g
|
|
|
40
44
|
readonly type: import('@platforma-sdk/model').ValueType;
|
|
41
45
|
readonly name: string;
|
|
42
46
|
readonly domain?: Record<string, string> | undefined;
|
|
47
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
43
48
|
};
|
|
44
49
|
spec: {
|
|
45
50
|
readonly type: import('@platforma-sdk/model').ValueType;
|
|
46
51
|
readonly name: string;
|
|
47
52
|
readonly domain?: Record<string, string> | undefined;
|
|
53
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
48
54
|
readonly annotations?: Record<string, string> | undefined;
|
|
49
55
|
readonly parentAxes?: number[] | undefined;
|
|
50
56
|
};
|
|
@@ -55,6 +61,7 @@ export declare function useFilterableColumns(getSourceId: () => string | null, g
|
|
|
55
61
|
readonly kind: "PColumn";
|
|
56
62
|
readonly name: string;
|
|
57
63
|
readonly domain?: Record<string, string> | undefined;
|
|
64
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
58
65
|
readonly annotations?: Record<string, string> | undefined;
|
|
59
66
|
readonly valueType: "Int" | "Long" | "Float" | "Double" | "String" | "Bytes";
|
|
60
67
|
readonly parentAxes?: number[] | undefined;
|
|
@@ -62,6 +69,7 @@ export declare function useFilterableColumns(getSourceId: () => string | null, g
|
|
|
62
69
|
readonly type: import('@platforma-sdk/model').ValueType;
|
|
63
70
|
readonly name: string;
|
|
64
71
|
readonly domain?: Record<string, string> | undefined;
|
|
72
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
65
73
|
readonly annotations?: Record<string, string> | undefined;
|
|
66
74
|
readonly parentAxes?: number[] | undefined;
|
|
67
75
|
}[];
|
|
@@ -72,11 +80,13 @@ export declare function useFilterableColumns(getSourceId: () => string | null, g
|
|
|
72
80
|
readonly type: import('@platforma-sdk/model').ValueType;
|
|
73
81
|
readonly name: string;
|
|
74
82
|
readonly domain?: Record<string, string> | undefined;
|
|
83
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
75
84
|
};
|
|
76
85
|
spec: {
|
|
77
86
|
readonly type: import('@platforma-sdk/model').ValueType;
|
|
78
87
|
readonly name: string;
|
|
79
88
|
readonly domain?: Record<string, string> | undefined;
|
|
89
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
80
90
|
readonly annotations?: Record<string, string> | undefined;
|
|
81
91
|
readonly parentAxes?: number[] | undefined;
|
|
82
92
|
};
|
|
@@ -87,6 +97,7 @@ export declare function useFilterableColumns(getSourceId: () => string | null, g
|
|
|
87
97
|
readonly kind: "PColumn";
|
|
88
98
|
readonly name: string;
|
|
89
99
|
readonly domain?: Record<string, string> | undefined;
|
|
100
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
90
101
|
readonly annotations?: Record<string, string> | undefined;
|
|
91
102
|
readonly valueType: "Int" | "Long" | "Float" | "Double" | "String" | "Bytes";
|
|
92
103
|
readonly parentAxes?: number[] | undefined;
|
|
@@ -94,6 +105,7 @@ export declare function useFilterableColumns(getSourceId: () => string | null, g
|
|
|
94
105
|
readonly type: import('@platforma-sdk/model').ValueType;
|
|
95
106
|
readonly name: string;
|
|
96
107
|
readonly domain?: Record<string, string> | undefined;
|
|
108
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
97
109
|
readonly annotations?: Record<string, string> | undefined;
|
|
98
110
|
readonly parentAxes?: number[] | undefined;
|
|
99
111
|
}[];
|
|
@@ -104,11 +116,13 @@ export declare function useFilterableColumns(getSourceId: () => string | null, g
|
|
|
104
116
|
readonly type: import('@platforma-sdk/model').ValueType;
|
|
105
117
|
readonly name: string;
|
|
106
118
|
readonly domain?: Record<string, string> | undefined;
|
|
119
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
107
120
|
};
|
|
108
121
|
spec: {
|
|
109
122
|
readonly type: import('@platforma-sdk/model').ValueType;
|
|
110
123
|
readonly name: string;
|
|
111
124
|
readonly domain?: Record<string, string> | undefined;
|
|
125
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
112
126
|
readonly annotations?: Record<string, string> | undefined;
|
|
113
127
|
readonly parentAxes?: number[] | undefined;
|
|
114
128
|
};
|
|
@@ -119,6 +133,7 @@ export declare function useFilterableColumns(getSourceId: () => string | null, g
|
|
|
119
133
|
readonly kind: "PColumn";
|
|
120
134
|
readonly name: string;
|
|
121
135
|
readonly domain?: Record<string, string> | undefined;
|
|
136
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
122
137
|
readonly annotations?: Record<string, string> | undefined;
|
|
123
138
|
readonly valueType: "Int" | "Long" | "Float" | "Double" | "String" | "Bytes";
|
|
124
139
|
readonly parentAxes?: number[] | undefined;
|
|
@@ -126,6 +141,7 @@ export declare function useFilterableColumns(getSourceId: () => string | null, g
|
|
|
126
141
|
readonly type: import('@platforma-sdk/model').ValueType;
|
|
127
142
|
readonly name: string;
|
|
128
143
|
readonly domain?: Record<string, string> | undefined;
|
|
144
|
+
readonly contextDomain?: Record<string, string> | undefined;
|
|
129
145
|
readonly annotations?: Record<string, string> | undefined;
|
|
130
146
|
readonly parentAxes?: number[] | undefined;
|
|
131
147
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFilterableColumns.d.ts","sourceRoot":"","sources":["../../../../src/components/PlAgDataTable/compositions/useFilterableColumns.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,gBAAgB,EAChB,WAAW,EACZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAe,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,MAAM,GAAG,IAAI,EAChC,aAAa,EAAE,MAAM,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,kBAAkB,EAAE,WAAW,GAAG,YAAY,CAAC,EAAE
|
|
1
|
+
{"version":3,"file":"useFilterableColumns.d.ts","sourceRoot":"","sources":["../../../../src/components/PlAgDataTable/compositions/useFilterableColumns.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,gBAAgB,EAChB,WAAW,EACZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAE,MAAM,EAAe,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,MAAM,GAAG,IAAI,EAChC,aAAa,EAAE,MAAM,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,kBAAkB,EAAE,WAAW,GAAG,YAAY,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BjG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAnnotations.vue_vue_type_script_setup_true_lang.js","names":["$style"],"sources":["../../../../src/components/PlAnnotations/components/PlAnnotations.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Props as BaseProps } from \"./FilterSidebar.vue\";\nexport type Props = BaseProps & {\n onDeleteSchema?: () => void;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, effect, shallowRef } from \"vue\";\n\nimport { isNil } from \"@milaboratories/helpers\";\nimport { PlSidebarGroup, useConfirm } from \"@milaboratories/uikit\";\n\nimport type { Annotation } from \"../types\";\nimport AnnotationsSidebar from \"./AnnotationsSidebar.vue\";\nimport FilterSidebar from \"./FilterSidebar.vue\";\n\n// Models\nconst annotation = defineModel<Annotation>(\"annotation\", { required: true });\n// Props\nconst props = defineProps<Props>();\n// State\nconst selectedStepId = shallowRef<number | undefined>(undefined);\nconst selectedStep = computed(() => {\n return isNil(selectedStepId.value) || isNil(annotation.value)\n ? undefined\n : annotation.value.steps.find((step) => step.id === selectedStepId.value);\n});\n\n// Watchers\neffect(function setDefaultStepId() {\n if (selectedStepId.value === undefined && annotation.value.steps.length > 0) {\n selectedStepId.value = annotation.value.steps[0].id;\n }\n});\n// Hooks\nconst confirmResetSchema = useConfirm({\n title: \"Reset Schema\",\n message: \"Are you sure you want to reset the schema? This action cannot be undone.\",\n confirmLabel: \"Yes, reset\",\n cancelLabel: \"No, cancel\",\n});\n// Actions\nasync function handleDeleteSchema() {\n if (await confirmResetSchema()) {\n selectedStepId.value = undefined;\n props.onDeleteSchema?.();\n }\n}\n</script>\n\n<template>\n <PlSidebarGroup>\n <template #item-0>\n <AnnotationsSidebar\n v-model:annotation=\"annotation\"\n v-model:selectedStepId=\"selectedStepId\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n @delete-schema=\"handleDeleteSchema\"\n />\n </template>\n <template #item-1>\n <FilterSidebar\n v-if=\"selectedStep\"\n v-model:step=\"selectedStep\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n :get-suggest-options=\"props.getSuggestOptions\"\n :selectedStepId=\"selectedStepId\"\n :hasSelectedColumns=\"props.hasSelectedColumns\"\n :getValuesForSelectedColumns=\"props.getValuesForSelectedColumns\"\n />\n </template>\n </PlSidebarGroup>\n</template>\n\n<style module>\n.sidebarItem {\n width: 100%;\n height: 100%;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAkBA,IAAM,IAAa,EAAuB,GAAC,aAAiC,EAEtE,IAAQ,GAER,IAAiB,EAA+B,KAAA,EAAU,EAC1D,IAAe,QACZ,EAAM,EAAe,MAAM,IAAI,EAAM,EAAW,MAAK,GACxD,KAAA,IACA,EAAW,MAAM,MAAM,MAAM,MAAS,EAAK,OAAO,EAAe,MAAM,CAC3E;AAGF,IAAO,WAA4B;AACjC,GAAI,EAAe,UAAU,KAAA,KAAa,EAAW,MAAM,MAAM,SAAS,MACxE,EAAe,QAAQ,EAAW,MAAM,MAAM,GAAG;IAEnD;EAEF,IAAM,IAAqB,EAAW;GACpC,OAAO;GACP,SAAS;GACT,cAAc;GACd,aAAa;GACd,CAAC;EAEF,eAAe,IAAqB;AAClC,GAAI,MAAM,GAAoB,KAC5B,EAAe,QAAQ,KAAA,GACvB,EAAM,kBAAkB;;yBAM1B,EAsBiB,EAAA,EAAA,EAAA,MAAA;GArBJ,UAAM,QAOb,CANF,EAME,GAAA;IALQ,YAAY,EAAA;6CAAU,QAAA;IACtB,gBAAgB,EAAA;iDAAc,QAAA;IACrC,OAAK,EAAEA,EAAAA,OAAO,YAAW;IACzB,SAAS,EAAM;IACf,gBAAe;;;;;;;GAGT,UAAM,
|
|
1
|
+
{"version":3,"file":"PlAnnotations.vue_vue_type_script_setup_true_lang.js","names":["$style"],"sources":["../../../../src/components/PlAnnotations/components/PlAnnotations.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Props as BaseProps } from \"./FilterSidebar.vue\";\nexport type Props = BaseProps & {\n onDeleteSchema?: () => void;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, effect, shallowRef } from \"vue\";\n\nimport { isNil } from \"@milaboratories/helpers\";\nimport { PlSidebarGroup, useConfirm } from \"@milaboratories/uikit\";\n\nimport type { Annotation } from \"../types\";\nimport AnnotationsSidebar from \"./AnnotationsSidebar.vue\";\nimport FilterSidebar from \"./FilterSidebar.vue\";\n\n// Models\nconst annotation = defineModel<Annotation>(\"annotation\", { required: true });\n// Props\nconst props = defineProps<Props>();\n// State\nconst selectedStepId = shallowRef<number | undefined>(undefined);\nconst selectedStep = computed(() => {\n return isNil(selectedStepId.value) || isNil(annotation.value)\n ? undefined\n : annotation.value.steps.find((step) => step.id === selectedStepId.value);\n});\n\n// Watchers\neffect(function setDefaultStepId() {\n if (selectedStepId.value === undefined && annotation.value.steps.length > 0) {\n selectedStepId.value = annotation.value.steps[0].id;\n }\n});\n// Hooks\nconst confirmResetSchema = useConfirm({\n title: \"Reset Schema\",\n message: \"Are you sure you want to reset the schema? This action cannot be undone.\",\n confirmLabel: \"Yes, reset\",\n cancelLabel: \"No, cancel\",\n});\n// Actions\nasync function handleDeleteSchema() {\n if (await confirmResetSchema()) {\n selectedStepId.value = undefined;\n props.onDeleteSchema?.();\n }\n}\n</script>\n\n<template>\n <PlSidebarGroup>\n <template #item-0>\n <AnnotationsSidebar\n v-model:annotation=\"annotation\"\n v-model:selectedStepId=\"selectedStepId\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n @delete-schema=\"handleDeleteSchema\"\n />\n </template>\n <template #item-1>\n <FilterSidebar\n v-if=\"selectedStep\"\n v-model:step=\"selectedStep\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n :get-suggest-options=\"props.getSuggestOptions\"\n :selectedStepId=\"selectedStepId\"\n :hasSelectedColumns=\"props.hasSelectedColumns\"\n :getValuesForSelectedColumns=\"props.getValuesForSelectedColumns\"\n />\n </template>\n </PlSidebarGroup>\n</template>\n\n<style module>\n.sidebarItem {\n width: 100%;\n height: 100%;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;EAkBA,IAAM,IAAa,EAAuB,GAAC,aAAiC,EAEtE,IAAQ,GAER,IAAiB,EAA+B,KAAA,EAAU,EAC1D,IAAe,QACZ,EAAM,EAAe,MAAM,IAAI,EAAM,EAAW,MAAK,GACxD,KAAA,IACA,EAAW,MAAM,MAAM,MAAM,MAAS,EAAK,OAAO,EAAe,MAAM,CAC3E;AAGF,IAAO,WAA4B;AACjC,GAAI,EAAe,UAAU,KAAA,KAAa,EAAW,MAAM,MAAM,SAAS,MACxE,EAAe,QAAQ,EAAW,MAAM,MAAM,GAAG;IAEnD;EAEF,IAAM,IAAqB,EAAW;GACpC,OAAO;GACP,SAAS;GACT,cAAc;GACd,aAAa;GACd,CAAC;EAEF,eAAe,IAAqB;AAClC,GAAI,MAAM,GAAoB,KAC5B,EAAe,QAAQ,KAAA,GACvB,EAAM,kBAAkB;;yBAM1B,EAsBiB,EAAA,EAAA,EAAA,MAAA;GArBJ,UAAM,QAOb,CANF,EAME,GAAA;IALQ,YAAY,EAAA;6CAAU,QAAA;IACtB,gBAAgB,EAAA;iDAAc,QAAA;IACrC,OAAK,EAAEA,EAAAA,OAAO,YAAW;IACzB,SAAS,EAAM;IACf,gBAAe;;;;;;;GAGT,UAAM,QAUb,CARM,EAAA,SAAA,GAAA,EADR,EASE,GAAA;;IAPQ,MAAM,EAAA;uCAAY,QAAA;IACzB,OAAK,EAAEA,EAAAA,OAAO,YAAW;IACzB,SAAS,EAAM;IACf,uBAAqB,EAAM;IAC3B,gBAAgB,EAAA;IAChB,oBAAoB,EAAM;IAC1B,6BAA6B,EAAM"}
|
package/dist/index.js
CHANGED
|
@@ -15,27 +15,28 @@ import D from "./components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.js";
|
|
|
15
15
|
import { defaultMainMenuItems as O } from "./components/PlAgDataTable/sources/menu-items.js";
|
|
16
16
|
import k from "./components/PlAgDataTable/PlAgOverlayLoading.js";
|
|
17
17
|
import A from "./components/PlAgDataTable/PlAgOverlayNoRows.js";
|
|
18
|
-
import j from "./
|
|
19
|
-
import
|
|
20
|
-
import N from "./components/
|
|
21
|
-
import
|
|
22
|
-
import F from "./
|
|
23
|
-
import I from "./components/
|
|
24
|
-
import L from "./components/
|
|
25
|
-
import R from "./components/
|
|
26
|
-
import
|
|
27
|
-
import {
|
|
28
|
-
import G from "./
|
|
29
|
-
import K from "./components/PlAnnotations/components/
|
|
30
|
-
import q from "./components/
|
|
31
|
-
import
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
18
|
+
import { AgGridTheme as j } from "./AgGridVue/AgGridTheme.js";
|
|
19
|
+
import M from "./components/PlAgDataTable/PlAgDataTableV2.js";
|
|
20
|
+
import { usePlDataTableSettingsV2 as N } from "./components/PlAgDataTable/types.js";
|
|
21
|
+
import P from "./components/PlAgCellProgress/PlAgCellProgress.js";
|
|
22
|
+
import { createAgGridColDef as F } from "./AgGridVue/createAgGridColDef.js";
|
|
23
|
+
import I from "./components/PlAgCellFile/PlAgCellFile.js";
|
|
24
|
+
import L from "./components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.js";
|
|
25
|
+
import R from "./components/PlAgChartHistogramCell/PlAgChartHistogramCell.js";
|
|
26
|
+
import z from "./components/PlAgCellStatusTag/PlAgCellStatusTag.js";
|
|
27
|
+
import { useAgGridOptions as B } from "./AgGridVue/useAgGridOptions.js";
|
|
28
|
+
import { deselectAll as V, getSelectedRowsCount as H, getTotalRowsCount as U, isSelectionEnabled as W, selectAll as G } from "./AgGridVue/selection.js";
|
|
29
|
+
import K from "./components/PlAnnotations/components/PlAnnotations.js";
|
|
30
|
+
import q from "./components/PlAnnotations/components/PlAnnotationsModal.js";
|
|
31
|
+
import J from "./components/PlBtnExportArchive/PlBtnExportArchive.js";
|
|
32
|
+
import { usePlugin as Y } from "./usePlugin.js";
|
|
33
|
+
import { defineStore as X } from "./defineStore.js";
|
|
34
|
+
import { activateAgGrid as Z } from "./composition/AgGrid/index.js";
|
|
35
|
+
import { objectHash as Q } from "./objectHash.js";
|
|
36
|
+
import { computedResult as $ } from "./computedResult.js";
|
|
37
|
+
import { ReactiveFileContent as te } from "./composition/fileContent.js";
|
|
37
38
|
import "./lib.js";
|
|
38
39
|
export * from "@milaboratories/uikit";
|
|
39
|
-
export { g as BlockLayout, T as DeferredCircular, e as MultiError, S as PlAdvancedFilterComponent, C as PlAdvancedFilterSupportedFilters,
|
|
40
|
+
export { j as AgGridTheme, g as BlockLayout, T as DeferredCircular, e as MultiError, S as PlAdvancedFilterComponent, C as PlAdvancedFilterSupportedFilters, I as PlAgCellFile, P as PlAgCellProgress, z as PlAgCellStatusTag, R as PlAgChartHistogramCell, L as PlAgChartStackedBarCell, E as PlAgColumnHeader, _ as PlAgCsvExporter, v as PlAgDataTableRowNumberColId, M as PlAgDataTableV2, x as PlAgGridColumnManager, k as PlAgOverlayLoading, A as PlAgOverlayNoRows, D as PlAgTextAndButtonCell, K as PlAnnotations, q as PlAnnotationsModal, J as PlBtnExportArchive, M as PlDataTableV2, w as PlTableFiltersV2, te as ReactiveFileContent, t as UnresolvedError, Z as activateAgGrid, y as autoSizeRowNumberColumn, $ as computedResult, F as createAgGridColDef, u as createModel, O as defaultMainMenuItems, d as defineApp, f as defineAppV3, X as defineStore, V as deselectAll, n as ensureError, ee as ensureNodeVisible, r as ensureOutputHasStableFlag, i as formatZodError, H as getSelectedRowsCount, U as getTotalRowsCount, a as identity, o as isDefined, W as isSelectionEnabled, s as isZodError, b as makeRowNumberColDef, Q as objectHash, p as pluginDataKey, G as selectAll, c as unwrapOutput, B as useAgGridOptions, m as useFeatureFlags, N as usePlDataTableSettingsV2, Y as usePlugin, h as useSdkPlugin, l as wrapOptionalResult };
|
|
40
41
|
|
|
41
42
|
//# sourceMappingURL=index.js.map
|
package/dist/lib.js
CHANGED
|
@@ -19,6 +19,7 @@ import "./components/PlAgTextAndButtonCell/index.js";
|
|
|
19
19
|
import "./components/PlAgDataTable/sources/menu-items.js";
|
|
20
20
|
import "./components/PlAgDataTable/PlAgOverlayLoading.js";
|
|
21
21
|
import "./components/PlAgDataTable/PlAgOverlayNoRows.js";
|
|
22
|
+
import "./AgGridVue/AgGridTheme.js";
|
|
22
23
|
import "./components/PlAgDataTable/PlAgDataTableV2.js";
|
|
23
24
|
import "./components/PlAgDataTable/types.js";
|
|
24
25
|
import "./components/PlAgDataTable/index.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/ui-vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.59.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"lru-cache": "^11.2.2",
|
|
26
26
|
"vue": "^3.5.24",
|
|
27
27
|
"zod": "~3.23.8",
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
28
|
+
"@milaboratories/uikit": "2.10.44",
|
|
29
|
+
"@platforma-sdk/model": "1.59.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@faker-js/faker": "^9.2.0",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"typescript": "~5.9.3",
|
|
41
41
|
"vite": "8.0.0-beta.15",
|
|
42
42
|
"vitest": "^4.0.18",
|
|
43
|
-
"@milaboratories/
|
|
44
|
-
"@milaboratories/build-configs": "1.5.2",
|
|
43
|
+
"@milaboratories/ts-builder": "1.3.0",
|
|
45
44
|
"@milaboratories/ts-configs": "1.2.2",
|
|
46
|
-
"@milaboratories/
|
|
45
|
+
"@milaboratories/build-configs": "1.5.2",
|
|
46
|
+
"@milaboratories/helpers": "1.13.7"
|
|
47
47
|
},
|
|
48
48
|
"scripts": {
|
|
49
49
|
"dev": "ts-builder serve --target browser-lib",
|
package/src/AgGridVue/index.ts
CHANGED
|
@@ -25,7 +25,7 @@ import { PlAgChartHistogramCell } from "../components/PlAgChartHistogramCell";
|
|
|
25
25
|
import type { ImportFileHandle } from "@platforma-sdk/model";
|
|
26
26
|
import type { ImportProgress } from "@platforma-sdk/model";
|
|
27
27
|
import { PlAgCellStatusTag } from "../components/PlAgCellStatusTag";
|
|
28
|
-
import { AgGridTheme } from "
|
|
28
|
+
import { AgGridTheme } from "./AgGridTheme";
|
|
29
29
|
interface GridOptionsExtended<TData = any> extends Omit<
|
|
30
30
|
GridOptions<TData>,
|
|
31
31
|
"columnDefs" | "loadingOverlayComponentParams"
|
|
@@ -49,12 +49,14 @@ export type NormalizedSpecData = {
|
|
|
49
49
|
valueType: ValueType;
|
|
50
50
|
annotations: PColumnSpec["annotations"];
|
|
51
51
|
domain: PColumnSpec["domain"];
|
|
52
|
+
contextDomain: PColumnSpec["contextDomain"];
|
|
52
53
|
};
|
|
53
54
|
export function getNormalizedSpec(spec: PColumnSpec | AxisSpec): NormalizedSpecData {
|
|
54
55
|
return {
|
|
55
56
|
valueType: getTypeFromPColumnOrAxisSpec(spec),
|
|
56
57
|
annotations: spec.annotations,
|
|
57
58
|
domain: spec.domain,
|
|
59
|
+
contextDomain: spec.contextDomain,
|
|
58
60
|
};
|
|
59
61
|
}
|
|
60
62
|
|
|
@@ -43,7 +43,7 @@ import type {
|
|
|
43
43
|
} from "./types";
|
|
44
44
|
import { useFilterableColumns } from "./compositions/useFilterableColumns";
|
|
45
45
|
import { useGrid } from "./compositions/useGrid";
|
|
46
|
-
import { AgGridTheme } from "
|
|
46
|
+
import { AgGridTheme } from "../../AgGridVue/AgGridTheme";
|
|
47
47
|
|
|
48
48
|
const tableState = defineModel<PlDataTableStateV2>({
|
|
49
49
|
required: true,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ag-override.js","names":[],"sources":["../../../src/components/PlAgDataTable/ag-override.css?raw"],"sourcesContent":["export default \".ag-header {\\n border-bottom: 1px solid var(--border-color-default);\\n}\\n\\n.ag-column-menu,\\n.ag-menu.ag-ltr.ag-popup-child {\\n border-radius: 12px;\\n border: none;\\n background: var(--bg-elevated-01);\\n box-shadow: none;\\n background: var(--bg-base-dark);\\n}\\n\\n.ag-column-menu *,\\n.ag-menu.ag-ltr.ag-popup-child * {\\n color: var(--txt-00);\\n}\\n\\n.ag-column-menu .ag-icon,\\n.ag-menu.ag-ltr.ag-popup-child .ag-icon {\\n color: var(--ic-00);\\n}\\n\\n.ag-menu-separator-part:after {\\n border-color: var(--btn-sec-hover-grey);\\n}\\n\""],"mappings":"AAAA,IAAA,IAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.d.ts","sourceRoot":"","sources":["../../../../src/components/PlAgDataTable/compositions/useTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAA2B,MAAM,oBAAoB,CAAC;AAGzE,eAAO,MAAM,WAAW,EAAE,KAmCkD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useTheme.js","names":[],"sources":["../../../../src/components/PlAgDataTable/compositions/useTheme.ts"],"sourcesContent":["import { type Theme, themeQuartz, createPart } from \"ag-grid-enterprise\";\nimport OverrideCss from \"../ag-override.css?raw\";\n\nexport const AgGridTheme: Theme = themeQuartz\n .withParams({\n headerColumnResizeHandleColor: \"transparent\",\n accentColor: \"#49cc49\",\n borderColor: \"#E1E3EB\",\n cellHorizontalPaddingScale: 1,\n checkboxBorderRadius: \"3px\",\n checkboxCheckedBackgroundColor: \"#110529\",\n checkboxCheckedBorderColor: \"#110529\",\n checkboxIndeterminateBackgroundColor: \"#110529\",\n checkboxIndeterminateBorderColor: \"#110529\",\n checkboxUncheckedBorderColor: \"#CFD1DB\",\n columnBorder: true,\n columnHoverColor: \"#9BABCC16\",\n fontFamily: \"inherit\",\n foregroundColor: \"#110529\",\n headerBackgroundColor: \"#F7F8FA\",\n headerColumnBorder: true,\n headerFontWeight: 600,\n headerRowBorder: true,\n headerVerticalPaddingScale: 0.8,\n iconButtonHoverColor: \"#9BABCC32\",\n iconSize: \"16px\",\n menuBackgroundColor: \"#FFFFFF\",\n menuBorder: true,\n menuTextColor: \"#110529\",\n rowHoverColor: \"#9BABCC16\",\n rowVerticalPaddingScale: 1,\n selectedRowBackgroundColor: \"#63E02424\",\n sidePanelBorder: false,\n spacing: \"8px\",\n tooltipBackgroundColor: \"#110529\",\n tooltipTextColor: \"#FFFFFF\",\n wrapperBorderRadius: \"6px\",\n })\n .withPart(createPart({ feature: \"headerBottomBorder\", css: OverrideCss }));\n"],"mappings":";;AAGA,MAAa,IAAqB,EAC/B,WAAW;CACV,+BAA+B;CAC/B,aAAa;CACb,aAAa;CACb,4BAA4B;CAC5B,sBAAsB;CACtB,gCAAgC;CAChC,4BAA4B;CAC5B,sCAAsC;CACtC,kCAAkC;CAClC,8BAA8B;CAC9B,cAAc;CACd,kBAAkB;CAClB,YAAY;CACZ,iBAAiB;CACjB,uBAAuB;CACvB,oBAAoB;CACpB,kBAAkB;CAClB,iBAAiB;CACjB,4BAA4B;CAC5B,sBAAsB;CACtB,UAAU;CACV,qBAAqB;CACrB,YAAY;CACZ,eAAe;CACf,eAAe;CACf,yBAAyB;CACzB,4BAA4B;CAC5B,iBAAiB;CACjB,SAAS;CACT,wBAAwB;CACxB,kBAAkB;CAClB,qBAAqB;CACtB,CAAC,CACD,SAAS,EAAW;CAAE,SAAS;CAAsB,KAAK;CAAa,CAAC,CAAC"}
|
|
File without changes
|
|
File without changes
|