@platforma-sdk/ui-vue 1.68.8 → 1.70.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 +13 -13
- 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 +22 -0
- package/dist/components/PlAgDataTable/sources/table-source-v2.js +3 -3
- package/dist/components/PlAgDataTable/sources/table-source-v2.js.map +1 -1
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.js.map +1 -1
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.style.js +5 -1
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.style.js.map +1 -1
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue.css +1 -1
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue.d.ts.map +1 -1
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue2.js +40 -23
- package/dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue2.js.map +1 -1
- package/dist/components/PlAnnotations/components/PlAnnotations.vue2.js.map +1 -1
- package/dist/components/PlDatasetSelector/PlDatasetSelector.js +1 -1
- package/dist/components/PlDatasetSelector/PlDatasetSelector.js.map +1 -1
- package/dist/components/PlDatasetSelector/PlDatasetSelector.style.css +1 -1
- package/dist/components/PlDatasetSelector/PlDatasetSelector.vue.d.ts +9 -19
- package/dist/components/PlDatasetSelector/PlDatasetSelector.vue.d.ts.map +1 -1
- package/dist/components/PlDatasetSelector/PlDatasetSelector.vue2.js +22 -23
- package/dist/components/PlDatasetSelector/PlDatasetSelector.vue2.js.map +1 -1
- package/package.json +6 -6
- package/src/components/PlAgDataTable/sources/table-source-v2.ts +10 -6
- package/src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue +51 -1
- package/src/components/PlDatasetSelector/PlDatasetSelector.vue +24 -23
- package/src/components/PlDatasetSelector/__tests__/PlDatasetSelector.jsdomtest.ts +70 -72
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.70.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...
|
|
@@ -16,7 +16,7 @@ Building browser-lib project...
|
|
|
16
16
|
rendering chunks...
|
|
17
17
|
|
|
18
18
|
[vite:dts] Start generate declaration files...
|
|
19
|
-
[vite:dts] Declaration files built in
|
|
19
|
+
[vite:dts] Declaration files built in 4673ms.
|
|
20
20
|
|
|
21
21
|
computing gzip size...
|
|
22
22
|
dist/components/PlAnnotations/components/PlAnnotations.vue?vue&type=style&index=0&lang.css 0.04 kB │ gzip: 0.06 kB
|
|
@@ -24,14 +24,14 @@ dist/components/PlAgCellStatusTag/PlAgCellStatusTag.vue_vue_type_style_index_0_l
|
|
|
24
24
|
dist/components/BlockLayout.vue?vue&type=style&index=0&lang.css 0.05 kB │ gzip: 0.07 kB
|
|
25
25
|
dist/components/PlAgDataTable/PlAgDataTableSheets.vue?vue&type=style&index=0&lang.css 0.06 kB │ gzip: 0.08 kB
|
|
26
26
|
dist/components/PlAnnotations/components/PlAnnotationsModal.vue?vue&type=style&index=0&lang.css 0.07 kB │ gzip: 0.08 kB
|
|
27
|
-
dist/components/
|
|
28
|
-
dist/components/PlDatasetSelector/PlDatasetSelector.vue_vue_type_style_index_0_scoped_b52c3499_lang.css 0.08 kB │ gzip: 0.09 kB
|
|
27
|
+
dist/components/PlDatasetSelector/PlDatasetSelector.vue_vue_type_style_index_0_scoped_95f2adf4_lang.css 0.08 kB │ gzip: 0.09 kB
|
|
29
28
|
dist/components/PlAgDataTable/PlAgDataTableV2.vue?vue&type=style&index=0&lang.css 0.09 kB │ gzip: 0.10 kB
|
|
30
29
|
dist/components/PlAnnotations/components/FilterSidebar.vue?vue&type=style&index=0&lang.css 0.11 kB │ gzip: 0.09 kB
|
|
31
30
|
dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.vue_vue_type_style_index_0_lang.css 0.16 kB │ gzip: 0.13 kB
|
|
32
31
|
dist/components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.vue_vue_type_style_index_0_lang.css 0.16 kB │ gzip: 0.14 kB
|
|
33
32
|
dist/components/PlAnnotations/components/style.css 0.26 kB │ gzip: 0.18 kB
|
|
34
33
|
dist/components/PlTableFilters/PlTableFiltersV2.vue?vue&type=style&index=0&lang.css 0.26 kB │ gzip: 0.17 kB
|
|
34
|
+
dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue?vue&type=style&index=0&lang.css 0.27 kB │ gzip: 0.21 kB
|
|
35
35
|
dist/plugins/Monetization/EndOfPeriod.vue?vue&type=style&index=0&lang.css 0.33 kB │ gzip: 0.25 kB
|
|
36
36
|
dist/components/PlBtnExportArchive/PlBtnExportArchive.vue?vue&type=style&index=0&lang.css 0.36 kB │ gzip: 0.25 kB
|
|
37
37
|
dist/components/PlBtnExportArchive/Summary.vue?vue&type=style&index=0&lang.css 0.37 kB │ gzip: 0.23 kB
|
|
@@ -88,7 +88,6 @@ dist/components/PlAgCsvExporter/PlAgCsvExporter.js
|
|
|
88
88
|
dist/components/PlAnnotations/components/PlAnnotations.vue_vue_type_style_index_0_lang.module.js 0.22 kB │ gzip: 0.18 kB │ map: 0.42 kB
|
|
89
89
|
dist/components/PlAgCellProgress/PlAgCellProgress.js 0.23 kB │ gzip: 0.16 kB │ map: 0.55 kB
|
|
90
90
|
dist/components/PlAgColumnHeader/PlAgColumnHeader.js 0.23 kB │ gzip: 0.17 kB │ map: 3.22 kB
|
|
91
|
-
dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue_vue_type_style_index_0_lang.module.js 0.23 kB │ gzip: 0.18 kB │ map: 0.42 kB
|
|
92
91
|
dist/plugins/Monetization/MonetizationSidebar.js 0.23 kB │ gzip: 0.17 kB │ map: 3.72 kB
|
|
93
92
|
dist/components/PlAgDataTable/PlAgOverlayLoading.js 0.23 kB │ gzip: 0.17 kB │ map: 1.74 kB
|
|
94
93
|
dist/components/PlTableFastSearch/PlTableFastSearch.js 0.23 kB │ gzip: 0.17 kB │ map: 1.37 kB
|
|
@@ -108,6 +107,7 @@ dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.js
|
|
|
108
107
|
dist/components/PlAdvancedFilter/OperandButton.vue_vue_type_style_index_0_lang.module.js 0.27 kB │ gzip: 0.21 kB │ map: 0.50 kB
|
|
109
108
|
dist/components/PlBtnExportArchive/Item.vue_vue_type_style_index_0_lang.module.js 0.28 kB │ gzip: 0.21 kB │ map: 0.54 kB
|
|
110
109
|
dist/components/PlAgDataTable/pl-ag-overlay-loading.module.js 0.29 kB │ gzip: 0.20 kB │ map: 0.52 kB
|
|
110
|
+
dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue_vue_type_style_index_0_lang.module.js 0.30 kB │ gzip: 0.23 kB │ map: 0.50 kB
|
|
111
111
|
dist/components/PlTableFilters/PlTableFiltersV2.vue_vue_type_style_index_0_lang.module.js 0.30 kB │ gzip: 0.23 kB │ map: 0.50 kB
|
|
112
112
|
dist/components/PlBtnExportArchive/PlBtnExportArchive.vue_vue_type_style_index_0_lang.module.js 0.31 kB │ gzip: 0.22 kB │ map: 0.50 kB
|
|
113
113
|
dist/components/PlAgRowNumCheckbox/pl-ag-row-num-checkbox.module.js 0.32 kB │ gzip: 0.21 kB │ map: 0.61 kB
|
|
@@ -131,7 +131,7 @@ dist/components/PlBtnExportArchive/PlBtnExportArchive.js
|
|
|
131
131
|
dist/components/PlAgDataTable/PlAgDataTableSheets.js 0.37 kB │ gzip: 0.25 kB │ map: 3.61 kB
|
|
132
132
|
dist/components/PlAnnotations/components/AnnotationsSidebar.js 0.37 kB │ gzip: 0.24 kB │ map: 4.56 kB
|
|
133
133
|
dist/components/PlAnnotations/components/PlAnnotationsModal.js 0.37 kB │ gzip: 0.24 kB │ map: 1.36 kB
|
|
134
|
-
dist/components/PlAgGridColumnManager/PlAgGridColumnManager.js 0.37 kB │ gzip: 0.25 kB │ map:
|
|
134
|
+
dist/components/PlAgGridColumnManager/PlAgGridColumnManager.js 0.37 kB │ gzip: 0.25 kB │ map: 4.71 kB
|
|
135
135
|
dist/lib/util/helpers/dist/strings.js 0.39 kB │ gzip: 0.27 kB │ map: 4.11 kB
|
|
136
136
|
dist/components/PlAgChartHistogramCell/PlAgChartHistogramCell.js 0.39 kB │ gzip: 0.21 kB │ map: 0.77 kB
|
|
137
137
|
dist/components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.js 0.40 kB │ gzip: 0.21 kB │ map: 0.77 kB
|
|
@@ -207,10 +207,10 @@ dist/components/PlAgDataTable/compositions/useGrid.js
|
|
|
207
207
|
dist/components/PlAgColumnHeader/PlAgColumnHeader.vue_vue_type_script_setup_true_lang.js 2.93 kB │ gzip: 1.26 kB │ map: 7.97 kB
|
|
208
208
|
dist/components/PlAgDataTable/sources/row-number.js 2.99 kB │ gzip: 1.31 kB │ map: 7.42 kB
|
|
209
209
|
dist/defineApp.js 3.01 kB │ gzip: 1.05 kB │ map: 14.38 kB
|
|
210
|
-
dist/components/PlDatasetSelector/PlDatasetSelector.vue_vue_type_script_setup_true_lang.js 3.
|
|
211
|
-
dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue_vue_type_script_setup_true_lang.js 3.14 kB │ gzip: 1.42 kB │ map: 5.04 kB
|
|
210
|
+
dist/components/PlDatasetSelector/PlDatasetSelector.vue_vue_type_script_setup_true_lang.js 3.18 kB │ gzip: 1.24 kB │ map: 7.33 kB
|
|
212
211
|
dist/plugins/Monetization/LimitCard.vue_vue_type_script_setup_true_lang.js 3.31 kB │ gzip: 1.15 kB │ map: 9.08 kB
|
|
213
212
|
dist/composition/fileContent.js 3.78 kB │ gzip: 1.45 kB │ map: 12.95 kB
|
|
213
|
+
dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue_vue_type_script_setup_true_lang.js 3.83 kB │ gzip: 1.64 kB │ map: 6.89 kB
|
|
214
214
|
dist/components/PlAnnotations/components/AnnotationsSidebar.vue_vue_type_script_setup_true_lang.js 3.89 kB │ gzip: 1.61 kB │ map: 6.51 kB
|
|
215
215
|
dist/plugins/Monetization/MonetizationSidebar.vue_vue_type_script_setup_true_lang.js 3.96 kB │ gzip: 1.71 kB │ map: 5.71 kB
|
|
216
216
|
dist/components/PlAnnotations/components/FilterSidebar.vue_vue_type_script_setup_true_lang.js 3.97 kB │ gzip: 1.56 kB │ map: 7.42 kB
|
|
@@ -222,18 +222,18 @@ dist/components/PlBtnExportArchive/PlBtnExportArchive.vue_vue_type_script_setup_
|
|
|
222
222
|
dist/internal/createAppV2.js 5.26 kB │ gzip: 1.98 kB │ map: 17.78 kB
|
|
223
223
|
dist/components/PlAgDataTable/sources/table-state-v2.js 5.73 kB │ gzip: 1.85 kB │ map: 19.41 kB
|
|
224
224
|
dist/internal/createAppV3.js 5.77 kB │ gzip: 2.21 kB │ map: 20.16 kB
|
|
225
|
-
dist/components/PlAgDataTable/sources/table-source-v2.js 6.
|
|
225
|
+
dist/components/PlAgDataTable/sources/table-source-v2.js 6.97 kB │ gzip: 2.70 kB │ map: 24.29 kB
|
|
226
226
|
dist/components/PlAdvancedFilter/PlAdvancedFilter.vue_vue_type_script_setup_true_lang.js 8.54 kB │ gzip: 2.59 kB │ map: 18.44 kB
|
|
227
227
|
dist/components/PlAdvancedFilter/FilterEditor.vue_vue_type_script_setup_true_lang.js 10.24 kB │ gzip: 3.04 kB │ map: 23.20 kB
|
|
228
228
|
dist/components/PlAgDataTable/PlAgDataTableV2.vue_vue_type_script_setup_true_lang.js 12.31 kB │ gzip: 3.90 kB │ map: 29.22 kB
|
|
229
229
|
|
|
230
230
|
[33m[33m[PLUGIN_TIMINGS] Warning:[0m Your build spent significant time in plugins. Here is a breakdown:
|
|
231
|
-
- sourcemaps (
|
|
232
|
-
- vite:dts (
|
|
231
|
+
- sourcemaps (37%)
|
|
232
|
+
- vite:dts (24%)
|
|
233
233
|
- vite:vue (11%)
|
|
234
234
|
- vite:css-post (7%)
|
|
235
|
-
- vite:css (
|
|
235
|
+
- vite:css (7%)
|
|
236
236
|
See https://rolldown.rs/options/checks#plugintimings for more details.
|
|
237
237
|
[39m
|
|
238
|
-
[32m✓ built in
|
|
238
|
+
[32m✓ built in 5.46s[39m
|
|
239
239
|
Build completed successfully
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @platforma-sdk/ui-vue@1.
|
|
3
|
+
> @platforma-sdk/ui-vue@1.70.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 3335ms on 137 files using 8 threads.
|
|
12
12
|
Format check completed successfully
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @platforma-sdk/ui-vue@1.
|
|
3
|
+
> @platforma-sdk/ui-vue@1.70.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 44ms on 120 files with 98 rules using 8 threads.
|
|
10
10
|
Linting completed successfully
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @platforma-sdk/ui-vue@1.
|
|
3
|
+
> @platforma-sdk/ui-vue@1.70.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,27 @@
|
|
|
1
1
|
# @platforma-sdk/ui-vue
|
|
2
2
|
|
|
3
|
+
## 1.70.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [a40505e]
|
|
8
|
+
- @milaboratories/pl-model-common@1.37.0
|
|
9
|
+
- @platforma-sdk/model@1.70.0
|
|
10
|
+
- @milaboratories/pf-spec-driver@1.3.7
|
|
11
|
+
- @milaboratories/uikit@2.13.1
|
|
12
|
+
|
|
13
|
+
## 1.69.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- d8f985a: Correct show label columns and simplify join for big projects
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [d8f985a]
|
|
22
|
+
- @milaboratories/uikit@2.13.0
|
|
23
|
+
- @platforma-sdk/model@1.69.0
|
|
24
|
+
|
|
3
25
|
## 1.68.8
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -25,7 +25,7 @@ function C(e, t, n, r) {
|
|
|
25
25
|
async function w({ generation: r, pfDriver: i, sheets: a, fullTableHandle: o, visibleTableHandle: s, dataRenderedTracker: c, hiddenColIds: l, cellButtonAxisParams: u }) {
|
|
26
26
|
let d = r.value, [f, p] = await Promise.all([i.getSpec(o), i.getSpec(s)]);
|
|
27
27
|
if (d !== r.value) throw Error("table state generation changed");
|
|
28
|
-
let m = E(f, p), h = D(a), g = O(f, h), _ = A(k(f, h), f), v = j(_, f, g), y = l ?? M(_, v, f), b = [n(), ..._.map((e, t) => T(e, f[e], f[v[t]], y, u))], x = N(p), { requestIndices: S, axesResultIndices: w, fieldResultMapping: F } = P(v, x.map(([e]) => e), m), I = -1, L;
|
|
28
|
+
let m = E(f, p), h = D(a), g = O(f, h), _ = A(k(f, h, g), f), v = j(_, f, g), y = l ?? M(_, v, f), b = [n(), ..._.map((e, t) => T(e, f[e], f[v[t]], y, u))], x = N(p), { requestIndices: S, axesResultIndices: w, fieldResultMapping: F } = P(v, x.map(([e]) => e), m), I = -1, L;
|
|
29
29
|
return {
|
|
30
30
|
axesSpec: x.map(([, { spec: e }]) => e),
|
|
31
31
|
columnDefs: b,
|
|
@@ -157,10 +157,10 @@ function O(e, t) {
|
|
|
157
157
|
}
|
|
158
158
|
return (e) => n.find((t) => _(t.axisId, e))?.labelColumnIdx ?? -1;
|
|
159
159
|
}
|
|
160
|
-
function k(e, t) {
|
|
160
|
+
function k(e, t, n) {
|
|
161
161
|
return e.entries().filter(([, e]) => {
|
|
162
162
|
switch (e.type) {
|
|
163
|
-
case "axis": return
|
|
163
|
+
case "axis": return (p(e.spec) ? n(e.id) > -1 : !0) && !t(e.id);
|
|
164
164
|
case "column": return !p(e.spec) && !h(e.spec) && !g(e.spec);
|
|
165
165
|
}
|
|
166
166
|
}).map(([e]) => e).toArray();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table-source-v2.js","names":[],"sources":["../../../../src/components/PlAgDataTable/sources/table-source-v2.ts"],"sourcesContent":["import type {\n AxesSpec,\n PTableColumnId,\n PTableColumnSpecAxis,\n PTableColumnSpecColumn,\n PTableHandle,\n PTableValue,\n} from \"@platforma-sdk/model\";\nimport {\n canonicalizeJson,\n getAxisId,\n pTableValue,\n type PFrameDriver,\n type PlDataTableSheet,\n type PTableVector,\n type AxisId,\n type PTableColumnSpec,\n type PTableKey,\n type PlTableColumnId,\n type PlTableColumnIdJson,\n isLabelColumn as isLabelColumnSpec,\n isLinkerColumn as isLinkerColumnSpec,\n isColumnHidden,\n isColumnOptional,\n matchAxisId,\n readAnnotation,\n readAnnotationJson,\n Annotation,\n ValueType,\n getPTableColumnId,\n} from \"@platforma-sdk/model\";\nimport type {\n CellStyle,\n ColDef,\n GridApi,\n ICellRendererParams,\n IServerSideDatasource,\n IServerSideGetRowsParams,\n ManagedGridOptions,\n} from \"ag-grid-enterprise\";\nimport type { PlAgHeaderComponentParams, PlAgHeaderComponentType } from \"../../PlAgColumnHeader\";\nimport { PlAgColumnHeader } from \"../../PlAgColumnHeader\";\nimport { PlAgTextAndButtonCell } from \"../../PlAgTextAndButtonCell\";\nimport type { PlAgDataTableV2Row, PlTableRowId } from \"../types\";\nimport { PTableHidden } from \"./common\";\nimport { defaultMainMenuItems } from \"./menu-items\";\nimport { makeRowNumberColDef, PlAgDataTableRowNumberColId } from \"./row-number\";\nimport { getColumnRenderingSpec } from \"./value-rendering\";\nimport type { Ref } from \"vue\";\nimport { isJsonEqual } from \"@milaboratories/helpers\";\nimport type { DeferredCircular } from \"./focus-row\";\nimport { isNil, uniq } from \"es-toolkit\";\n\nexport function isLabelColumn(column: PTableColumnSpec): column is PTableColumnSpecColumn {\n return column.type === \"column\" && isLabelColumnSpec(column.spec);\n}\n\n/** Convert columnar data from the driver to rows, used by ag-grid */\nfunction columns2rows(\n fields: number[],\n columns: PTableVector[],\n fieldResultMapping: number[],\n axesResultIndices: number[],\n): PlAgDataTableV2Row[] {\n const rowData: PlAgDataTableV2Row[] = [];\n for (let rowIdx = 0; rowIdx < columns[0].data.length; ++rowIdx) {\n const axesKey: PTableKey = axesResultIndices.map((ri) => pTableValue(columns[ri], rowIdx));\n const id = canonicalizeJson<PlTableRowId>(axesKey);\n const row = fields.reduce<PlAgDataTableV2Row>(\n (acc, field, colIdx) => {\n acc[field.toString() as `${number}`] =\n fieldResultMapping[colIdx] === -1\n ? PTableHidden\n : pTableValue(columns[fieldResultMapping[colIdx]], rowIdx);\n return acc;\n },\n { id, axesKey },\n );\n\n rowData.push(row);\n }\n return rowData;\n}\n\n/** Calculate GridOptions for selected p-table data source */\nexport async function calculateGridOptions({\n generation,\n pfDriver,\n sheets,\n fullTableHandle,\n visibleTableHandle,\n dataRenderedTracker,\n hiddenColIds,\n cellButtonAxisParams,\n}: {\n sheets: PlDataTableSheet[];\n pfDriver: PFrameDriver;\n generation: Ref<number>;\n fullTableHandle: PTableHandle;\n visibleTableHandle: PTableHandle;\n dataRenderedTracker: DeferredCircular<GridApi<PlAgDataTableV2Row>>;\n hiddenColIds?: PlTableColumnIdJson[];\n cellButtonAxisParams?: PlAgCellButtonAxisParams;\n}): Promise<\n Pick<ManagedGridOptions<PlAgDataTableV2Row>, \"columnDefs\" | \"serverSideDatasource\"> & {\n axesSpec: AxesSpec;\n }\n> {\n const stateGeneration = generation.value;\n\n // get specs of the full table\n const [tableSpecs, visibleTableSpecs] = await Promise.all([\n pfDriver.getSpec(fullTableHandle),\n pfDriver.getSpec(visibleTableHandle),\n ]);\n\n if (stateGeneration !== generation.value) throw new Error(\"table state generation changed\");\n\n // index mapping from full specs to visible subset (hidden columns → -1)\n const specsToVisibleSpecsMapping = buildSpecsToVisibleSpecsMapping(tableSpecs, visibleTableSpecs);\n\n const isPartitionedAxis = createPartitionedAxisPredicate(sheets);\n\n // label columns indexed by labeled axis (for axis→label replacement later)\n const getLabelColumnIndex = collectLabelColumnsByAxis(tableSpecs, isPartitionedAxis);\n\n // displayable column indices ordered: axes first, then columns by OrderPriority\n const fields = sortIndicesByTypeAndPriority(\n selectDisplayableIndices(tableSpecs, isPartitionedAxis),\n tableSpecs,\n );\n\n // same as fields, but each axis replaced by its label column index when available\n const indices = replaceAxesWithLabelColumns(fields, tableSpecs, getLabelColumnIndex);\n\n // default hidden columns derived from Optional annotation when no saved state\n const resolvedHiddenColIds =\n hiddenColIds ?? computeDefaultHiddenColIds(fields, indices, tableSpecs);\n\n const columnDefs: ColDef<PlAgDataTableV2Row, PTableValue | PTableHidden>[] = [\n makeRowNumberColDef(),\n ...fields.map((field, index) =>\n makeColDef(\n field,\n tableSpecs[field],\n tableSpecs[indices[index]],\n resolvedHiddenColIds,\n cellButtonAxisParams,\n ),\n ),\n ];\n\n // axes — taken directly from visible table (always present as part of join)\n const visibleAxes = collectVisibleAxes(visibleTableSpecs);\n\n // request indices: non-hidden display fields + visible axes for row selection keys.\n // Axes replaced by label columns request label data (display); original axis values\n // are fetched via visibleAxes (row keys).\n const { requestIndices, axesResultIndices, fieldResultMapping } = buildRequestIndices(\n indices,\n visibleAxes.map(([idx]) => idx),\n specsToVisibleSpecsMapping,\n );\n\n let rowCount = -1;\n let lastParams: IServerSideGetRowsParams | undefined = undefined;\n const serverSideDatasource: IServerSideDatasource<PlAgDataTableV2Row> = {\n getRows: async (params: IServerSideGetRowsParams) => {\n if (stateGeneration !== generation.value) return params.fail();\n try {\n if (rowCount === -1) {\n const ptShape = await pfDriver.getShape(visibleTableHandle);\n if (stateGeneration !== generation.value || params.api.isDestroyed())\n return params.fail();\n rowCount = ptShape.rows;\n }\n\n if (rowCount == 0) {\n params.success({ rowData: [], rowCount });\n // Warning: AgGrid cannot show two overlays at once,\n // so first hide loading overlay, then show no rows overlay\n params.api.setGridOption(\"loading\", false);\n params.api.showNoRowsOverlay();\n return;\n }\n\n // If sort has changed - show skeletons instead of data\n if (lastParams && !isJsonEqual(lastParams.request.sortModel, params.request.sortModel)) {\n return params.success({ rowData: [], rowCount });\n }\n lastParams = params;\n\n let length = 0;\n let rowData: PlAgDataTableV2Row[] = [];\n if (\n rowCount > 0 &&\n params.request.startRow !== undefined &&\n params.request.endRow !== undefined\n ) {\n length = Math.min(rowCount, params.request.endRow) - params.request.startRow;\n if (length > 0) {\n const data = await pfDriver.getData(visibleTableHandle, requestIndices, {\n offset: params.request.startRow,\n length,\n });\n if (stateGeneration !== generation.value || params.api.isDestroyed())\n return params.fail();\n rowData = columns2rows(fields, data, fieldResultMapping, axesResultIndices);\n }\n }\n\n params.success({ rowData, rowCount });\n params.api.autoSizeColumns(\n params.api\n .getAllDisplayedColumns()\n .filter((column) => column.getColId() !== PlAgDataTableRowNumberColId),\n );\n params.api.setGridOption(\"loading\", false);\n dataRenderedTracker.resolve(params.api);\n } catch (error: unknown) {\n if (stateGeneration !== generation.value || params.api.isDestroyed()) return params.fail();\n params.api.setGridOption(\"loading\", true);\n params.fail();\n console.trace(error);\n }\n },\n };\n\n return {\n axesSpec: visibleAxes.map(([, { spec }]) => spec),\n columnDefs,\n serverSideDatasource,\n };\n}\n\nexport type PlAgCellButtonAxisParams = {\n showCellButtonForAxisId?: AxisId;\n cellButtonInvokeRowsOnDoubleClick?: boolean;\n trigger: (key?: PTableKey) => void;\n};\n\n/**\n * Calculates column definition for a given p-table column\n */\nexport function makeColDef(\n iCol: number,\n spec: PTableColumnSpec,\n labeledSpec: PTableColumnSpec,\n hiddenColIds: PlTableColumnIdJson[] | undefined,\n cellButtonAxisParams?: PlAgCellButtonAxisParams,\n): ColDef<PlAgDataTableV2Row, PTableValue | PTableHidden> {\n const colId = canonicalizeJson<PlTableColumnId>({\n source: spec,\n labeled: labeledSpec,\n });\n const valueType = spec.type === \"axis\" ? spec.spec.type : spec.spec.valueType;\n const columnRenderingSpec = getColumnRenderingSpec(spec);\n const cellStyle: CellStyle = {};\n if (columnRenderingSpec.fontFamily) {\n if (columnRenderingSpec.fontFamily === \"monospace\") {\n cellStyle.fontFamily = \"Spline Sans Mono\";\n cellStyle.fontWeight = 300;\n } else {\n cellStyle.fontFamily = columnRenderingSpec.fontFamily;\n }\n }\n const headerName =\n readAnnotation(labeledSpec.spec, Annotation.Label)?.trim() ??\n readAnnotation(spec.spec, Annotation.Label)?.trim() ??\n `Unlabeled ${spec.type} ${iCol}`;\n\n return {\n colId,\n mainMenuItems: defaultMainMenuItems,\n context: spec,\n field: `${iCol}`,\n headerName,\n lockPosition: spec.type === \"axis\",\n hide: hiddenColIds !== undefined && hiddenColIds.includes(colId),\n valueFormatter: columnRenderingSpec.valueFormatter,\n headerComponent: PlAgColumnHeader,\n cellRendererSelector: cellButtonAxisParams?.showCellButtonForAxisId\n ? (params: ICellRendererParams) => {\n if (spec.type !== \"axis\") return;\n\n const axisId = (params.colDef?.context as PTableColumnSpec)?.id as AxisId;\n if (isJsonEqual(axisId, cellButtonAxisParams.showCellButtonForAxisId)) {\n return {\n component: PlAgTextAndButtonCell,\n params: {\n invokeRowsOnDoubleClick: cellButtonAxisParams.cellButtonInvokeRowsOnDoubleClick,\n onClick: (params: ICellRendererParams<PlAgDataTableV2Row>) => {\n cellButtonAxisParams.trigger(params.data?.axesKey);\n },\n },\n };\n }\n }\n : undefined,\n cellStyle,\n headerComponentParams: {\n type: ((): PlAgHeaderComponentType => {\n switch (valueType) {\n case ValueType.Int:\n case ValueType.Long:\n case ValueType.Float:\n case ValueType.Double:\n return \"Number\";\n case ValueType.String:\n case ValueType.Bytes:\n return \"Text\";\n default:\n throw Error(`unsupported data type: ${valueType}`);\n }\n })(),\n tooltip:\n readAnnotation(spec.spec, Annotation.Description)?.trim() ??\n readAnnotation(labeledSpec.spec, Annotation.Description)?.trim(),\n info:\n readAnnotation(spec.spec, Annotation.Table.Info)?.trim() ??\n readAnnotation(labeledSpec.spec, Annotation.Table.Info)?.trim(),\n } satisfies PlAgHeaderComponentParams,\n cellDataType: (() => {\n switch (valueType) {\n case ValueType.Int:\n case ValueType.Long:\n case ValueType.Float:\n case ValueType.Double:\n return \"number\";\n case ValueType.String:\n case ValueType.Bytes:\n return \"text\";\n default:\n throw Error(`unsupported data type: ${valueType}`);\n }\n })(),\n };\n}\n\ntype LabelColumnLookup = (axisId: AxisId) => number;\n\n/** Build index mapping from full tableSpecs to their position in visibleTableSpecs (missing → -1). */\nfunction buildSpecsToVisibleSpecsMapping(\n tableSpecs: PTableColumnSpec[],\n visibleTableSpecs: PTableColumnSpec[],\n): Map<number, number> {\n const specId = (spec: PTableColumnSpec) =>\n canonicalizeJson<PTableColumnId>(getPTableColumnId(spec));\n const visibleSpecsMap = new Map(\n visibleTableSpecs.entries().map(([i, spec]) => [specId(spec), i] as const),\n );\n return new Map(\n tableSpecs.entries().map(([i, spec]) => {\n const visibleSpecIdx = visibleSpecsMap.get(specId(spec));\n return [i, isNil(visibleSpecIdx) ? -1 : visibleSpecIdx];\n }),\n );\n}\n\n/** Predicate that returns true when an axis is one of the sheet partition axes. */\nfunction createPartitionedAxisPredicate(sheets: PlDataTableSheet[]): (axisId: AxisId) => boolean {\n const sheetAxesIds = sheets.map((sheet) => getAxisId(sheet.axis));\n return (axisId) => sheetAxesIds.some((id) => matchAxisId(id, axisId));\n}\n\n/**\n * Collect label columns (skipping partitioned axes and duplicates) and return a\n * lookup function that resolves labeled axisId → label column index (or -1).\n */\nfunction collectLabelColumnsByAxis(\n tableSpecs: PTableColumnSpec[],\n isPartitionedAxis: (axisId: AxisId) => boolean,\n): LabelColumnLookup {\n const labelColumns: { axisId: AxisId; labelColumnIdx: number }[] = [];\n for (const [i, spec] of tableSpecs.entries()) {\n if (spec.type !== \"column\" || !isLabelColumnSpec(spec.spec)) continue;\n const labeledAxisId = getAxisId(spec.spec.axesSpec[0]);\n if (isPartitionedAxis(labeledAxisId)) continue;\n if (labelColumns.some((info) => matchAxisId(info.axisId, labeledAxisId))) {\n console.warn(`multiple label columns match axisId: ${JSON.stringify(labeledAxisId)}`);\n continue;\n }\n labelColumns.push({ axisId: labeledAxisId, labelColumnIdx: i });\n }\n return (axisId) =>\n labelColumns.find((info) => matchAxisId(info.axisId, axisId))?.labelColumnIdx ?? -1;\n}\n\n/** Indices of columns to display: drop partitioned axes, label/linker columns, hidden columns. */\nfunction selectDisplayableIndices(\n tableSpecs: PTableColumnSpec[],\n isPartitionedAxis: (axisId: AxisId) => boolean,\n): number[] {\n return tableSpecs\n .entries()\n .filter(([, spec]) => {\n switch (spec.type) {\n case \"axis\":\n return !isColumnHidden(spec.spec) && !isPartitionedAxis(spec.id);\n case \"column\":\n return (\n !isColumnHidden(spec.spec) &&\n !isLabelColumnSpec(spec.spec) &&\n !isLinkerColumnSpec(spec.spec)\n );\n }\n })\n .map(([i]) => i)\n .toArray();\n}\n\n/** Sort: axes first, then columns by OrderPriority annotation (higher priority = further left). */\nfunction sortIndicesByTypeAndPriority(indices: number[], tableSpecs: PTableColumnSpec[]): number[] {\n const priorityOf = (i: number): number => {\n const spec = tableSpecs[i];\n return spec.type === \"column\"\n ? (readAnnotationJson(spec.spec, Annotation.Table.OrderPriority) ?? 0)\n : 0;\n };\n return [...indices].sort((a, b) => {\n if (tableSpecs[a].type !== tableSpecs[b].type) {\n return tableSpecs[a].type === \"axis\" ? -1 : 1;\n }\n return priorityOf(b) - priorityOf(a);\n });\n}\n\n/** For each axis entry substitute the index of its matching label column when one exists. */\nfunction replaceAxesWithLabelColumns(\n fields: number[],\n tableSpecs: PTableColumnSpec[],\n getLabelColumnIndex: LabelColumnLookup,\n): number[] {\n return fields.map((i) => {\n const spec = tableSpecs[i];\n const labelIdx = spec.type === \"axis\" ? getLabelColumnIndex(spec.id) : -1;\n return labelIdx === -1 ? i : labelIdx;\n });\n}\n\n/** Default hidden col ids built from columns marked with the Optional annotation. */\nfunction computeDefaultHiddenColIds(\n fields: number[],\n indices: number[],\n tableSpecs: PTableColumnSpec[],\n): PlTableColumnIdJson[] {\n return fields.reduce<PlTableColumnIdJson[]>((acc, field, i) => {\n const spec = tableSpecs[field];\n if (spec.type !== \"column\" || !isColumnOptional(spec.spec)) return acc;\n const labeledSpec = tableSpecs[indices[i]];\n return [...acc, canonicalizeJson<PlTableColumnId>({ source: spec, labeled: labeledSpec })];\n }, []);\n}\n\n/** Extract axis indices and specs from the visible table (always present as part of join). */\nfunction collectVisibleAxes(\n visibleTableSpecs: PTableColumnSpec[],\n): [number, PTableColumnSpecAxis][] {\n return visibleTableSpecs\n .entries()\n .filter((entry): entry is [number, PTableColumnSpecAxis] => entry[1].type === \"axis\")\n .toArray();\n}\n\n/**\n * Compose request indices for the visible table:\n * non-hidden display fields first, then visible axes (deduplicated).\n * Returns fieldResultMapping (display field → position in requestIndices, -1 if not requested)\n * and axesResultIndices (visible axis → position in requestIndices).\n */\nfunction buildRequestIndices(\n indices: number[],\n visibleAxesIndices: number[],\n specsToVisibleSpecsMapping: Map<number, number>,\n): {\n requestIndices: number[];\n axesResultIndices: number[];\n fieldResultMapping: number[];\n} {\n const resolved = indices.map((displayField) => {\n const idx = specsToVisibleSpecsMapping.get(displayField);\n return isNil(idx) || idx === -1 ? null : idx;\n });\n const requestIndices = uniq([\n ...resolved.filter((v): v is number => v !== null),\n ...visibleAxesIndices,\n ]);\n const fieldResultMapping = resolved.map((v) => (v === null ? -1 : requestIndices.indexOf(v)));\n const axesResultIndices = visibleAxesIndices.map((vi) => requestIndices.indexOf(vi));\n\n return { requestIndices, axesResultIndices, fieldResultMapping };\n}\n"],"mappings":";;;;;;;;;;;;;AA0DA,SAAS,EACP,GACA,GACA,GACA,GACsB;CACtB,IAAM,IAAgC,EAAE;AACxC,MAAK,IAAI,IAAS,GAAG,IAAS,EAAQ,GAAG,KAAK,QAAQ,EAAE,GAAQ;EAC9D,IAAM,IAAqB,EAAkB,KAAK,MAAO,EAAY,EAAQ,IAAK,EAAO,CAAC,EACpF,IAAK,EAA+B,EAAQ,EAC5C,IAAM,EAAO,QAChB,GAAK,GAAO,OACX,EAAI,EAAM,UAAU,IAClB,EAAmB,OAAY,KAC3B,IACA,EAAY,EAAQ,EAAmB,KAAU,EAAO,EACvD,IAET;GAAE;GAAI;GAAS,CAChB;AAED,IAAQ,KAAK,EAAI;;AAEnB,QAAO;;AAIT,eAAsB,EAAqB,EACzC,eACA,aACA,WACA,oBACA,uBACA,wBACA,iBACA,2BAcA;CACA,IAAM,IAAkB,EAAW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QAAQ,MAAmB,MAAM,KAAK,EAClD,GAAG,EACJ,CAAC,EACI,IAAqB,EAAS,KAAK,MAAO,MAAM,OAAO,KAAK,EAAe,QAAQ,EAAE,CAAE;AAG7F,QAAO;EAAE;EAAgB,mBAFC,EAAmB,KAAK,MAAO,EAAe,QAAQ,EAAG,CAAC;EAExC;EAAoB"}
|
|
1
|
+
{"version":3,"file":"table-source-v2.js","names":[],"sources":["../../../../src/components/PlAgDataTable/sources/table-source-v2.ts"],"sourcesContent":["import type {\n AxesSpec,\n PTableColumnId,\n PTableColumnSpecAxis,\n PTableColumnSpecColumn,\n PTableHandle,\n PTableValue,\n} from \"@platforma-sdk/model\";\nimport {\n canonicalizeJson,\n getAxisId,\n pTableValue,\n type PFrameDriver,\n type PlDataTableSheet,\n type PTableVector,\n type AxisId,\n type PTableColumnSpec,\n type PTableKey,\n type PlTableColumnId,\n type PlTableColumnIdJson,\n isLabelColumn as isLabelColumnSpec,\n isLinkerColumn as isLinkerColumnSpec,\n isColumnHidden,\n isColumnOptional,\n matchAxisId,\n readAnnotation,\n readAnnotationJson,\n Annotation,\n ValueType,\n getPTableColumnId,\n} from \"@platforma-sdk/model\";\nimport type {\n CellStyle,\n ColDef,\n GridApi,\n ICellRendererParams,\n IServerSideDatasource,\n IServerSideGetRowsParams,\n ManagedGridOptions,\n} from \"ag-grid-enterprise\";\nimport type { PlAgHeaderComponentParams, PlAgHeaderComponentType } from \"../../PlAgColumnHeader\";\nimport { PlAgColumnHeader } from \"../../PlAgColumnHeader\";\nimport { PlAgTextAndButtonCell } from \"../../PlAgTextAndButtonCell\";\nimport type { PlAgDataTableV2Row, PlTableRowId } from \"../types\";\nimport { PTableHidden } from \"./common\";\nimport { defaultMainMenuItems } from \"./menu-items\";\nimport { makeRowNumberColDef, PlAgDataTableRowNumberColId } from \"./row-number\";\nimport { getColumnRenderingSpec } from \"./value-rendering\";\nimport type { Ref } from \"vue\";\nimport { isJsonEqual } from \"@milaboratories/helpers\";\nimport type { DeferredCircular } from \"./focus-row\";\nimport { isNil, uniq } from \"es-toolkit\";\n\nexport function isLabelColumn(column: PTableColumnSpec): column is PTableColumnSpecColumn {\n return column.type === \"column\" && isLabelColumnSpec(column.spec);\n}\n\n/** Convert columnar data from the driver to rows, used by ag-grid */\nfunction columns2rows(\n fields: number[],\n columns: PTableVector[],\n fieldResultMapping: number[],\n axesResultIndices: number[],\n): PlAgDataTableV2Row[] {\n const rowData: PlAgDataTableV2Row[] = [];\n for (let rowIdx = 0; rowIdx < columns[0].data.length; ++rowIdx) {\n const axesKey: PTableKey = axesResultIndices.map((ri) => pTableValue(columns[ri], rowIdx));\n const id = canonicalizeJson<PlTableRowId>(axesKey);\n const row = fields.reduce<PlAgDataTableV2Row>(\n (acc, field, colIdx) => {\n acc[field.toString() as `${number}`] =\n fieldResultMapping[colIdx] === -1\n ? PTableHidden\n : pTableValue(columns[fieldResultMapping[colIdx]], rowIdx);\n return acc;\n },\n { id, axesKey },\n );\n\n rowData.push(row);\n }\n return rowData;\n}\n\n/** Calculate GridOptions for selected p-table data source */\nexport async function calculateGridOptions({\n generation,\n pfDriver,\n sheets,\n fullTableHandle,\n visibleTableHandle,\n dataRenderedTracker,\n hiddenColIds,\n cellButtonAxisParams,\n}: {\n sheets: PlDataTableSheet[];\n pfDriver: PFrameDriver;\n generation: Ref<number>;\n fullTableHandle: PTableHandle;\n visibleTableHandle: PTableHandle;\n dataRenderedTracker: DeferredCircular<GridApi<PlAgDataTableV2Row>>;\n hiddenColIds?: PlTableColumnIdJson[];\n cellButtonAxisParams?: PlAgCellButtonAxisParams;\n}): Promise<\n Pick<ManagedGridOptions<PlAgDataTableV2Row>, \"columnDefs\" | \"serverSideDatasource\"> & {\n axesSpec: AxesSpec;\n }\n> {\n const stateGeneration = generation.value;\n\n // get specs of the full table\n const [tableSpecs, visibleTableSpecs] = await Promise.all([\n pfDriver.getSpec(fullTableHandle),\n pfDriver.getSpec(visibleTableHandle),\n ]);\n\n if (stateGeneration !== generation.value) throw new Error(\"table state generation changed\");\n\n // index mapping from full specs to visible subset (hidden columns → -1)\n const specsToVisibleSpecsMapping = buildSpecsToVisibleSpecsMapping(tableSpecs, visibleTableSpecs);\n\n const isPartitionedAxis = createPartitionedAxisPredicate(sheets);\n\n // label columns indexed by labeled axis (for axis→label replacement later)\n const getLabelColumnIndex = collectLabelColumnsByAxis(tableSpecs, isPartitionedAxis);\n\n // displayable column indices ordered: axes first, then columns by OrderPriority\n const fields = sortIndicesByTypeAndPriority(\n selectDisplayableIndices(tableSpecs, isPartitionedAxis, getLabelColumnIndex),\n tableSpecs,\n );\n\n // same as fields, but each axis replaced by its label column index when available\n const indices = replaceAxesWithLabelColumns(fields, tableSpecs, getLabelColumnIndex);\n\n // default hidden columns derived from Optional annotation when no saved state\n const resolvedHiddenColIds =\n hiddenColIds ?? computeDefaultHiddenColIds(fields, indices, tableSpecs);\n\n const columnDefs: ColDef<PlAgDataTableV2Row, PTableValue | PTableHidden>[] = [\n makeRowNumberColDef(),\n ...fields.map((field, index) =>\n makeColDef(\n field,\n tableSpecs[field],\n tableSpecs[indices[index]],\n resolvedHiddenColIds,\n cellButtonAxisParams,\n ),\n ),\n ];\n\n // axes — taken directly from visible table (always present as part of join)\n const visibleAxes = collectVisibleAxes(visibleTableSpecs);\n\n // request indices: non-hidden display fields + visible axes for row selection keys.\n // Axes replaced by label columns request label data (display); original axis values\n // are fetched via visibleAxes (row keys).\n const { requestIndices, axesResultIndices, fieldResultMapping } = buildRequestIndices(\n indices,\n visibleAxes.map(([idx]) => idx),\n specsToVisibleSpecsMapping,\n );\n\n let rowCount = -1;\n let lastParams: IServerSideGetRowsParams | undefined = undefined;\n const serverSideDatasource: IServerSideDatasource<PlAgDataTableV2Row> = {\n getRows: async (params: IServerSideGetRowsParams) => {\n if (stateGeneration !== generation.value) return params.fail();\n try {\n if (rowCount === -1) {\n const ptShape = await pfDriver.getShape(visibleTableHandle);\n if (stateGeneration !== generation.value || params.api.isDestroyed())\n return params.fail();\n rowCount = ptShape.rows;\n }\n\n if (rowCount == 0) {\n params.success({ rowData: [], rowCount });\n // Warning: AgGrid cannot show two overlays at once,\n // so first hide loading overlay, then show no rows overlay\n params.api.setGridOption(\"loading\", false);\n params.api.showNoRowsOverlay();\n return;\n }\n\n // If sort has changed - show skeletons instead of data\n if (lastParams && !isJsonEqual(lastParams.request.sortModel, params.request.sortModel)) {\n return params.success({ rowData: [], rowCount });\n }\n lastParams = params;\n\n let length = 0;\n let rowData: PlAgDataTableV2Row[] = [];\n if (\n rowCount > 0 &&\n params.request.startRow !== undefined &&\n params.request.endRow !== undefined\n ) {\n length = Math.min(rowCount, params.request.endRow) - params.request.startRow;\n if (length > 0) {\n const data = await pfDriver.getData(visibleTableHandle, requestIndices, {\n offset: params.request.startRow,\n length,\n });\n if (stateGeneration !== generation.value || params.api.isDestroyed())\n return params.fail();\n rowData = columns2rows(fields, data, fieldResultMapping, axesResultIndices);\n }\n }\n\n params.success({ rowData, rowCount });\n params.api.autoSizeColumns(\n params.api\n .getAllDisplayedColumns()\n .filter((column) => column.getColId() !== PlAgDataTableRowNumberColId),\n );\n params.api.setGridOption(\"loading\", false);\n dataRenderedTracker.resolve(params.api);\n } catch (error: unknown) {\n if (stateGeneration !== generation.value || params.api.isDestroyed()) return params.fail();\n params.api.setGridOption(\"loading\", true);\n params.fail();\n console.trace(error);\n }\n },\n };\n\n return {\n axesSpec: visibleAxes.map(([, { spec }]) => spec),\n columnDefs,\n serverSideDatasource,\n };\n}\n\nexport type PlAgCellButtonAxisParams = {\n showCellButtonForAxisId?: AxisId;\n cellButtonInvokeRowsOnDoubleClick?: boolean;\n trigger: (key?: PTableKey) => void;\n};\n\n/**\n * Calculates column definition for a given p-table column\n */\nexport function makeColDef(\n iCol: number,\n spec: PTableColumnSpec,\n labeledSpec: PTableColumnSpec,\n hiddenColIds: PlTableColumnIdJson[] | undefined,\n cellButtonAxisParams?: PlAgCellButtonAxisParams,\n): ColDef<PlAgDataTableV2Row, PTableValue | PTableHidden> {\n const colId = canonicalizeJson<PlTableColumnId>({\n source: spec,\n labeled: labeledSpec,\n });\n const valueType = spec.type === \"axis\" ? spec.spec.type : spec.spec.valueType;\n const columnRenderingSpec = getColumnRenderingSpec(spec);\n const cellStyle: CellStyle = {};\n if (columnRenderingSpec.fontFamily) {\n if (columnRenderingSpec.fontFamily === \"monospace\") {\n cellStyle.fontFamily = \"Spline Sans Mono\";\n cellStyle.fontWeight = 300;\n } else {\n cellStyle.fontFamily = columnRenderingSpec.fontFamily;\n }\n }\n const headerName =\n readAnnotation(labeledSpec.spec, Annotation.Label)?.trim() ??\n readAnnotation(spec.spec, Annotation.Label)?.trim() ??\n `Unlabeled ${spec.type} ${iCol}`;\n\n return {\n colId,\n mainMenuItems: defaultMainMenuItems,\n context: spec,\n field: `${iCol}`,\n headerName,\n lockPosition: spec.type === \"axis\",\n hide: hiddenColIds !== undefined && hiddenColIds.includes(colId),\n valueFormatter: columnRenderingSpec.valueFormatter,\n headerComponent: PlAgColumnHeader,\n cellRendererSelector: cellButtonAxisParams?.showCellButtonForAxisId\n ? (params: ICellRendererParams) => {\n if (spec.type !== \"axis\") return;\n\n const axisId = (params.colDef?.context as PTableColumnSpec)?.id as AxisId;\n if (isJsonEqual(axisId, cellButtonAxisParams.showCellButtonForAxisId)) {\n return {\n component: PlAgTextAndButtonCell,\n params: {\n invokeRowsOnDoubleClick: cellButtonAxisParams.cellButtonInvokeRowsOnDoubleClick,\n onClick: (params: ICellRendererParams<PlAgDataTableV2Row>) => {\n cellButtonAxisParams.trigger(params.data?.axesKey);\n },\n },\n };\n }\n }\n : undefined,\n cellStyle,\n headerComponentParams: {\n type: ((): PlAgHeaderComponentType => {\n switch (valueType) {\n case ValueType.Int:\n case ValueType.Long:\n case ValueType.Float:\n case ValueType.Double:\n return \"Number\";\n case ValueType.String:\n case ValueType.Bytes:\n return \"Text\";\n default:\n throw Error(`unsupported data type: ${valueType}`);\n }\n })(),\n tooltip:\n readAnnotation(spec.spec, Annotation.Description)?.trim() ??\n readAnnotation(labeledSpec.spec, Annotation.Description)?.trim(),\n info:\n readAnnotation(spec.spec, Annotation.Table.Info)?.trim() ??\n readAnnotation(labeledSpec.spec, Annotation.Table.Info)?.trim(),\n } satisfies PlAgHeaderComponentParams,\n cellDataType: (() => {\n switch (valueType) {\n case ValueType.Int:\n case ValueType.Long:\n case ValueType.Float:\n case ValueType.Double:\n return \"number\";\n case ValueType.String:\n case ValueType.Bytes:\n return \"text\";\n default:\n throw Error(`unsupported data type: ${valueType}`);\n }\n })(),\n };\n}\n\n/** Build index mapping from full tableSpecs to their position in visibleTableSpecs (missing → -1). */\nfunction buildSpecsToVisibleSpecsMapping(\n tableSpecs: PTableColumnSpec[],\n visibleTableSpecs: PTableColumnSpec[],\n): Map<number, number> {\n const specId = (spec: PTableColumnSpec) =>\n canonicalizeJson<PTableColumnId>(getPTableColumnId(spec));\n const visibleSpecsMap = new Map(\n visibleTableSpecs.entries().map(([i, spec]) => [specId(spec), i] as const),\n );\n return new Map(\n tableSpecs.entries().map(([i, spec]) => {\n const visibleSpecIdx = visibleSpecsMap.get(specId(spec));\n return [i, isNil(visibleSpecIdx) ? -1 : visibleSpecIdx];\n }),\n );\n}\n\n/** Predicate that returns true when an axis is one of the sheet partition axes. */\nfunction createPartitionedAxisPredicate(sheets: PlDataTableSheet[]): (axisId: AxisId) => boolean {\n const sheetAxesIds = sheets.map((sheet) => getAxisId(sheet.axis));\n return (axisId) => sheetAxesIds.some((id) => matchAxisId(id, axisId));\n}\n\n/**\n * Collect label columns (skipping partitioned axes and duplicates) and return a\n * lookup function that resolves labeled axisId → label column index (or -1).\n */\nfunction collectLabelColumnsByAxis(\n tableSpecs: PTableColumnSpec[],\n isPartitionedAxis: (axisId: AxisId) => boolean,\n): (axisId: AxisId) => number {\n const labelColumns: { axisId: AxisId; labelColumnIdx: number }[] = [];\n for (const [i, spec] of tableSpecs.entries()) {\n if (spec.type !== \"column\" || !isLabelColumnSpec(spec.spec)) continue;\n const labeledAxisId = getAxisId(spec.spec.axesSpec[0]);\n if (isPartitionedAxis(labeledAxisId)) continue;\n if (labelColumns.some((info) => matchAxisId(info.axisId, labeledAxisId))) {\n console.warn(`multiple label columns match axisId: ${JSON.stringify(labeledAxisId)}`);\n continue;\n }\n labelColumns.push({ axisId: labeledAxisId, labelColumnIdx: i });\n }\n return (axisId) =>\n labelColumns.find((info) => matchAxisId(info.axisId, axisId))?.labelColumnIdx ?? -1;\n}\n\n/** Indices of columns to display: drop partitioned axes, label/linker columns, hidden columns. */\nfunction selectDisplayableIndices(\n tableSpecs: PTableColumnSpec[],\n isPartitionedAxis: (axisId: AxisId) => boolean,\n getLabelColumnIndex: (axisId: AxisId) => number,\n): number[] {\n return tableSpecs\n .entries()\n .filter(([, spec]) => {\n switch (spec.type) {\n case \"axis\":\n return (\n // show axis if not hidden or if it has a label column\n (!isColumnHidden(spec.spec) ? true : getLabelColumnIndex(spec.id) > -1) &&\n !isPartitionedAxis(spec.id)\n );\n case \"column\":\n return (\n !isColumnHidden(spec.spec) &&\n // hide label columns (their labeled axes are shown instead)\n !isLabelColumnSpec(spec.spec) &&\n !isLinkerColumnSpec(spec.spec)\n );\n }\n })\n .map(([i]) => i)\n .toArray();\n}\n\n/** Sort: axes first, then columns by OrderPriority annotation (higher priority = further left). */\nfunction sortIndicesByTypeAndPriority(indices: number[], tableSpecs: PTableColumnSpec[]): number[] {\n const priorityOf = (i: number): number => {\n const spec = tableSpecs[i];\n return spec.type === \"column\"\n ? (readAnnotationJson(spec.spec, Annotation.Table.OrderPriority) ?? 0)\n : 0;\n };\n return [...indices].sort((a, b) => {\n if (tableSpecs[a].type !== tableSpecs[b].type) {\n return tableSpecs[a].type === \"axis\" ? -1 : 1;\n }\n return priorityOf(b) - priorityOf(a);\n });\n}\n\n/** For each axis entry substitute the index of its matching label column when one exists. */\nfunction replaceAxesWithLabelColumns(\n fields: number[],\n tableSpecs: PTableColumnSpec[],\n getLabelColumnIndex: (axisId: AxisId) => number,\n): number[] {\n return fields.map((i) => {\n const spec = tableSpecs[i];\n const labelIdx = spec.type === \"axis\" ? getLabelColumnIndex(spec.id) : -1;\n return labelIdx === -1 ? i : labelIdx;\n });\n}\n\n/** Default hidden col ids built from columns marked with the Optional annotation. */\nfunction computeDefaultHiddenColIds(\n fields: number[],\n indices: number[],\n tableSpecs: PTableColumnSpec[],\n): PlTableColumnIdJson[] {\n return fields.reduce<PlTableColumnIdJson[]>((acc, field, i) => {\n const spec = tableSpecs[field];\n if (spec.type !== \"column\" || !isColumnOptional(spec.spec)) return acc;\n const labeledSpec = tableSpecs[indices[i]];\n return [...acc, canonicalizeJson<PlTableColumnId>({ source: spec, labeled: labeledSpec })];\n }, []);\n}\n\n/** Extract axis indices and specs from the visible table (always present as part of join). */\nfunction collectVisibleAxes(\n visibleTableSpecs: PTableColumnSpec[],\n): [number, PTableColumnSpecAxis][] {\n return visibleTableSpecs\n .entries()\n .filter((entry): entry is [number, PTableColumnSpecAxis] => entry[1].type === \"axis\")\n .toArray();\n}\n\n/**\n * Compose request indices for the visible table:\n * non-hidden display fields first, then visible axes (deduplicated).\n * Returns fieldResultMapping (display field → position in requestIndices, -1 if not requested)\n * and axesResultIndices (visible axis → position in requestIndices).\n */\nfunction buildRequestIndices(\n indices: number[],\n visibleAxesIndices: number[],\n specsToVisibleSpecsMapping: Map<number, number>,\n): {\n requestIndices: number[];\n axesResultIndices: number[];\n fieldResultMapping: number[];\n} {\n const resolved = indices.map((displayField) => {\n const idx = specsToVisibleSpecsMapping.get(displayField);\n return isNil(idx) || idx === -1 ? null : idx;\n });\n const requestIndices = uniq([\n ...resolved.filter((v): v is number => v !== null),\n ...visibleAxesIndices,\n ]);\n const fieldResultMapping = resolved.map((v) => (v === null ? -1 : requestIndices.indexOf(v)));\n const axesResultIndices = visibleAxesIndices.map((vi) => requestIndices.indexOf(vi));\n\n return { requestIndices, axesResultIndices, fieldResultMapping };\n}\n"],"mappings":";;;;;;;;;;;;;AA0DA,SAAS,EACP,GACA,GACA,GACA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A+B,GAAK,GAAO,MAAM;EAC7D,IAAM,IAAO,EAAW;AACxB,MAAI,EAAK,SAAS,YAAY,CAAC,EAAiB,EAAK,KAAK,CAAE,QAAO;EACnE,IAAM,IAAc,EAAW,EAAQ;AACvC,SAAO,CAAC,GAAG,GAAK,EAAkC;GAAE,QAAQ;GAAM,SAAS;GAAa,CAAC,CAAC;IACzF,EAAE,CAAC;;AAIR,SAAS,EACP,GACkC;AAClC,QAAO,EACJ,SAAS,CACT,QAAQ,MAAmD,EAAM,GAAG,SAAS,OAAO,CACpF,SAAS;;AASd,SAAS,EACP,GACA,GACA,GAKA;CACA,IAAM,IAAW,EAAQ,KAAK,MAAiB;EAC7C,IAAM,IAAM,EAA2B,IAAI,EAAa;AACxD,SAAO,EAAM,EAAI,IAAI,MAAQ,KAAK,OAAO;GACzC,EACI,IAAiB,EAAK,CAC1B,GAAG,EAAS,QAAQ,MAAmB,MAAM,KAAK,EAClD,GAAG,EACJ,CAAC,EACI,IAAqB,EAAS,KAAK,MAAO,MAAM,OAAO,KAAK,EAAe,QAAQ,EAAE,CAAE;AAG7F,QAAO;EAAE;EAAgB,mBAFC,EAAmB,KAAK,MAAO,EAAe,QAAQ,EAAG,CAAC;EAExC;EAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgGridColumnManager.js","names":[],"sources":["../../../src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n PlBtnGhost,\n PlElementList,\n PlSearchField,\n PlSlideModal,\n usePlBlockPageTitleTeleportTarget,\n} from \"@milaboratories/uikit\";\nimport { type GridApi } from \"ag-grid-enterprise\";\nimport { computed, ref } from \"vue\";\nimport { PlAgDataTableRowNumberColId } from \"../PlAgDataTable/sources/row-number\";\nimport { useFilteredItems } from \"./useFilteredItems\";\nimport { useGridColumns } from \"./useGridColumns\";\n\nconst props = defineProps<{\n /**\n * The GridApi is an API interface provided by the table/grid component\n * for interacting programmatically with the grid's features and functionality.\n * It allows you to control and manipulate grid behavior, access data, and\n * trigger specific actions.\n */\n api: GridApi;\n /**\n * Css Column Manager (Panel) modal width (default value is `368px`)\n */\n width?: string;\n}>();\n\nconst query = ref(\"\");\nconst slideModal = ref(false);\nconst teleportTarget = usePlBlockPageTitleTeleportTarget(\"PlAgGridColumnManager\");\n\nconst columns = useGridColumns(props);\n\nconst items = computed(() => {\n return columns.value.map((col, i) => ({\n column: col,\n id: col.getId(),\n label: col.getColDef().headerName ?? `Unnamed Column (${i + 1})`,\n }));\n});\n\nconst { filteredItems, segments } = useFilteredItems({\n items,\n query,\n getStrings: (item) => [item.label],\n});\n</script>\n\n<template>\n <Teleport v-if=\"teleportTarget\" :to=\"teleportTarget\">\n <PlBtnGhost icon=\"columns\" @click.stop=\"slideModal = !slideModal\"> Columns </PlBtnGhost>\n </Teleport>\n\n <PlSlideModal v-model=\"slideModal\" :width=\"width\" close-on-outside-click>\n <template #title>Manage Columns</template>\n <PlSearchField v-model=\"query\" clearable />\n <PlElementList\n :items=\"filteredItems\"\n :get-item-key=\"(item) => item.id\"\n :is-draggable=\"(item) => !item.column.getColDef().lockPosition\"\n :on-sort=\"\n (fromIndex, toIndex) => {\n if (!props.api.isDestroyed()) {\n const columnToMove = columns[fromIndex];\n props.api.moveColumns([columnToMove], toIndex);\n }\n return true; // Let PlElementList handle the visual update\n }\n \"\n :on-toggle=\"\n (item) => {\n if (!props.api.isDestroyed()) {\n props.api.setColumnsVisible([item.column], !item.column.isVisible());\n }\n }\n \"\n :is-toggled=\"(item) => !item.column.isVisible()\"\n :is-toggable=\"(item) => item.id !== PlAgDataTableRowNumberColId\"\n :is-pinned=\"(item) => !!item.column.getColDef().lockPosition\"\n :is-pinnable=\"() => false\"\n :disable-dragging=\"query.length > 0\"\n disable-removing\n >\n <template #item-title=\"{ item }\">\n <span>\n <span\n v-for=\"(segment, i) of segments.get(item.label)\"\n :key=\"i\"\n :class=\"{ [$style.match]: segment.match }\"\n >{{ segment.value }}</span\n >\n </span>\n </template>\n </PlElementList>\n </PlSlideModal>\n</template>\n\n<style module>\n.match {\n background-color: var(--color-active-select);\n border-radius: 2px;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlAgGridColumnManager.js","names":[],"sources":["../../../src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n PlBtnGhost,\n PlBtnSecondary,\n PlElementList,\n PlIcon24,\n PlSearchField,\n PlSlideModal,\n usePlBlockPageTitleTeleportTarget,\n} from \"@milaboratories/uikit\";\nimport { type GridApi } from \"ag-grid-enterprise\";\nimport { computed, ref } from \"vue\";\nimport { PlAgDataTableRowNumberColId } from \"../PlAgDataTable/sources/row-number\";\nimport { useFilteredItems } from \"./useFilteredItems\";\nimport { useGridColumns } from \"./useGridColumns\";\n\nconst props = defineProps<{\n /**\n * The GridApi is an API interface provided by the table/grid component\n * for interacting programmatically with the grid's features and functionality.\n * It allows you to control and manipulate grid behavior, access data, and\n * trigger specific actions.\n */\n api: GridApi;\n /**\n * Css Column Manager (Panel) modal width (default value is `368px`)\n */\n width?: string;\n}>();\n\nconst query = ref(\"\");\nconst slideModal = ref(false);\nconst teleportTarget = usePlBlockPageTitleTeleportTarget(\"PlAgGridColumnManager\");\n\nconst columns = useGridColumns(props);\n\nconst items = computed(() => {\n return columns.value.map((col, i) => ({\n column: col,\n id: col.getId(),\n label: col.getColDef().headerName ?? `Unnamed Column (${i + 1})`,\n }));\n});\n\nconst { filteredItems, segments } = useFilteredItems({\n items,\n query,\n getStrings: (item) => [item.label],\n});\n\nconst toggleableFilteredItems = computed(() =>\n filteredItems.value.filter((item) => item.id !== PlAgDataTableRowNumberColId),\n);\n\nconst allFilteredHidden = computed(\n () =>\n toggleableFilteredItems.value.length > 0 &&\n toggleableFilteredItems.value.every((item) => !item.column.isVisible()),\n);\n\nconst toggleAllFiltered = () => {\n if (props.api.isDestroyed()) return;\n const nextVisible = allFilteredHidden.value;\n const cols = toggleableFilteredItems.value.map((item) => item.column);\n if (cols.length === 0) return;\n props.api.setColumnsVisible(cols, nextVisible);\n};\n</script>\n\n<template>\n <Teleport v-if=\"teleportTarget\" :to=\"teleportTarget\">\n <PlBtnGhost icon=\"columns\" @click.stop=\"slideModal = !slideModal\"> Columns </PlBtnGhost>\n </Teleport>\n\n <PlSlideModal v-model=\"slideModal\" :width=\"width\" close-on-outside-click>\n <template #title>Manage Columns</template>\n <div :class=\"$style.searchRow\">\n <PlSearchField v-model=\"query\" clearable />\n <PlBtnSecondary\n :class=\"$style.toggleAllBtn\"\n :disabled=\"toggleableFilteredItems.length === 0\"\n @click.stop=\"toggleAllFiltered\"\n >\n <PlIcon24 v-if=\"allFilteredHidden\" name=\"view-show\" />\n <PlIcon24 v-else name=\"view-hide\" />\n </PlBtnSecondary>\n </div>\n <PlElementList\n :items=\"filteredItems\"\n :get-item-key=\"(item) => item.id\"\n :is-draggable=\"(item) => !item.column.getColDef().lockPosition\"\n :on-sort=\"\n (fromIndex, toIndex) => {\n if (!props.api.isDestroyed()) {\n const columnToMove = columns[fromIndex];\n props.api.moveColumns([columnToMove], toIndex);\n }\n return true; // Let PlElementList handle the visual update\n }\n \"\n :on-toggle=\"\n (item) => {\n if (!props.api.isDestroyed()) {\n props.api.setColumnsVisible([item.column], !item.column.isVisible());\n }\n }\n \"\n :is-toggled=\"(item) => !item.column.isVisible()\"\n :is-toggable=\"(item) => item.id !== PlAgDataTableRowNumberColId\"\n :is-pinned=\"(item) => !!item.column.getColDef().lockPosition\"\n :is-pinnable=\"() => false\"\n :disable-dragging=\"query.length > 0\"\n disable-removing\n >\n <template #item-title=\"{ item }\">\n <span>\n <span\n v-for=\"(segment, i) of segments.get(item.label)\"\n :key=\"i\"\n :class=\"{ [$style.match]: segment.match }\"\n >{{ segment.value }}</span\n >\n </span>\n </template>\n </PlElementList>\n </PlSlideModal>\n</template>\n\n<style module>\n.match {\n background-color: var(--color-active-select);\n border-radius: 2px;\n}\n\n.searchRow {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.searchRow > :first-child {\n flex: 1;\n}\n\n.toggleAllBtn {\n min-width: unset;\n opacity: 0.2;\n transition: opacity 0.3s;\n\n &:hover {\n opacity: 1;\n }\n}\n</style>\n"],"mappings":""}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import './PlAgGridColumnManager.vue.css';var e = {
|
|
1
|
+
import './PlAgGridColumnManager.vue.css';var e = {
|
|
2
|
+
match: "_match_1cg4g_2",
|
|
3
|
+
searchRow: "_searchRow_1cg4g_7",
|
|
4
|
+
toggleAllBtn: "_toggleAllBtn_1cg4g_17"
|
|
5
|
+
};
|
|
2
6
|
//#endregion
|
|
3
7
|
export { e as default };
|
|
4
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgGridColumnManager.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n PlBtnGhost,\n PlElementList,\n PlSearchField,\n PlSlideModal,\n usePlBlockPageTitleTeleportTarget,\n} from \"@milaboratories/uikit\";\nimport { type GridApi } from \"ag-grid-enterprise\";\nimport { computed, ref } from \"vue\";\nimport { PlAgDataTableRowNumberColId } from \"../PlAgDataTable/sources/row-number\";\nimport { useFilteredItems } from \"./useFilteredItems\";\nimport { useGridColumns } from \"./useGridColumns\";\n\nconst props = defineProps<{\n /**\n * The GridApi is an API interface provided by the table/grid component\n * for interacting programmatically with the grid's features and functionality.\n * It allows you to control and manipulate grid behavior, access data, and\n * trigger specific actions.\n */\n api: GridApi;\n /**\n * Css Column Manager (Panel) modal width (default value is `368px`)\n */\n width?: string;\n}>();\n\nconst query = ref(\"\");\nconst slideModal = ref(false);\nconst teleportTarget = usePlBlockPageTitleTeleportTarget(\"PlAgGridColumnManager\");\n\nconst columns = useGridColumns(props);\n\nconst items = computed(() => {\n return columns.value.map((col, i) => ({\n column: col,\n id: col.getId(),\n label: col.getColDef().headerName ?? `Unnamed Column (${i + 1})`,\n }));\n});\n\nconst { filteredItems, segments } = useFilteredItems({\n items,\n query,\n getStrings: (item) => [item.label],\n});\n</script>\n\n<template>\n <Teleport v-if=\"teleportTarget\" :to=\"teleportTarget\">\n <PlBtnGhost icon=\"columns\" @click.stop=\"slideModal = !slideModal\"> Columns </PlBtnGhost>\n </Teleport>\n\n <PlSlideModal v-model=\"slideModal\" :width=\"width\" close-on-outside-click>\n <template #title>Manage Columns</template>\n <PlSearchField v-model=\"query\" clearable />\n <PlElementList\n :items=\"filteredItems\"\n :get-item-key=\"(item) => item.id\"\n :is-draggable=\"(item) => !item.column.getColDef().lockPosition\"\n :on-sort=\"\n (fromIndex, toIndex) => {\n if (!props.api.isDestroyed()) {\n const columnToMove = columns[fromIndex];\n props.api.moveColumns([columnToMove], toIndex);\n }\n return true; // Let PlElementList handle the visual update\n }\n \"\n :on-toggle=\"\n (item) => {\n if (!props.api.isDestroyed()) {\n props.api.setColumnsVisible([item.column], !item.column.isVisible());\n }\n }\n \"\n :is-toggled=\"(item) => !item.column.isVisible()\"\n :is-toggable=\"(item) => item.id !== PlAgDataTableRowNumberColId\"\n :is-pinned=\"(item) => !!item.column.getColDef().lockPosition\"\n :is-pinnable=\"() => false\"\n :disable-dragging=\"query.length > 0\"\n disable-removing\n >\n <template #item-title=\"{ item }\">\n <span>\n <span\n v-for=\"(segment, i) of segments.get(item.label)\"\n :key=\"i\"\n :class=\"{ [$style.match]: segment.match }\"\n >{{ segment.value }}</span\n >\n </span>\n </template>\n </PlElementList>\n </PlSlideModal>\n</template>\n\n<style module>\n.match {\n background-color: var(--color-active-select);\n border-radius: 2px;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PlAgGridColumnManager.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n PlBtnGhost,\n PlBtnSecondary,\n PlElementList,\n PlIcon24,\n PlSearchField,\n PlSlideModal,\n usePlBlockPageTitleTeleportTarget,\n} from \"@milaboratories/uikit\";\nimport { type GridApi } from \"ag-grid-enterprise\";\nimport { computed, ref } from \"vue\";\nimport { PlAgDataTableRowNumberColId } from \"../PlAgDataTable/sources/row-number\";\nimport { useFilteredItems } from \"./useFilteredItems\";\nimport { useGridColumns } from \"./useGridColumns\";\n\nconst props = defineProps<{\n /**\n * The GridApi is an API interface provided by the table/grid component\n * for interacting programmatically with the grid's features and functionality.\n * It allows you to control and manipulate grid behavior, access data, and\n * trigger specific actions.\n */\n api: GridApi;\n /**\n * Css Column Manager (Panel) modal width (default value is `368px`)\n */\n width?: string;\n}>();\n\nconst query = ref(\"\");\nconst slideModal = ref(false);\nconst teleportTarget = usePlBlockPageTitleTeleportTarget(\"PlAgGridColumnManager\");\n\nconst columns = useGridColumns(props);\n\nconst items = computed(() => {\n return columns.value.map((col, i) => ({\n column: col,\n id: col.getId(),\n label: col.getColDef().headerName ?? `Unnamed Column (${i + 1})`,\n }));\n});\n\nconst { filteredItems, segments } = useFilteredItems({\n items,\n query,\n getStrings: (item) => [item.label],\n});\n\nconst toggleableFilteredItems = computed(() =>\n filteredItems.value.filter((item) => item.id !== PlAgDataTableRowNumberColId),\n);\n\nconst allFilteredHidden = computed(\n () =>\n toggleableFilteredItems.value.length > 0 &&\n toggleableFilteredItems.value.every((item) => !item.column.isVisible()),\n);\n\nconst toggleAllFiltered = () => {\n if (props.api.isDestroyed()) return;\n const nextVisible = allFilteredHidden.value;\n const cols = toggleableFilteredItems.value.map((item) => item.column);\n if (cols.length === 0) return;\n props.api.setColumnsVisible(cols, nextVisible);\n};\n</script>\n\n<template>\n <Teleport v-if=\"teleportTarget\" :to=\"teleportTarget\">\n <PlBtnGhost icon=\"columns\" @click.stop=\"slideModal = !slideModal\"> Columns </PlBtnGhost>\n </Teleport>\n\n <PlSlideModal v-model=\"slideModal\" :width=\"width\" close-on-outside-click>\n <template #title>Manage Columns</template>\n <div :class=\"$style.searchRow\">\n <PlSearchField v-model=\"query\" clearable />\n <PlBtnSecondary\n :class=\"$style.toggleAllBtn\"\n :disabled=\"toggleableFilteredItems.length === 0\"\n @click.stop=\"toggleAllFiltered\"\n >\n <PlIcon24 v-if=\"allFilteredHidden\" name=\"view-show\" />\n <PlIcon24 v-else name=\"view-hide\" />\n </PlBtnSecondary>\n </div>\n <PlElementList\n :items=\"filteredItems\"\n :get-item-key=\"(item) => item.id\"\n :is-draggable=\"(item) => !item.column.getColDef().lockPosition\"\n :on-sort=\"\n (fromIndex, toIndex) => {\n if (!props.api.isDestroyed()) {\n const columnToMove = columns[fromIndex];\n props.api.moveColumns([columnToMove], toIndex);\n }\n return true; // Let PlElementList handle the visual update\n }\n \"\n :on-toggle=\"\n (item) => {\n if (!props.api.isDestroyed()) {\n props.api.setColumnsVisible([item.column], !item.column.isVisible());\n }\n }\n \"\n :is-toggled=\"(item) => !item.column.isVisible()\"\n :is-toggable=\"(item) => item.id !== PlAgDataTableRowNumberColId\"\n :is-pinned=\"(item) => !!item.column.getColDef().lockPosition\"\n :is-pinnable=\"() => false\"\n :disable-dragging=\"query.length > 0\"\n disable-removing\n >\n <template #item-title=\"{ item }\">\n <span>\n <span\n v-for=\"(segment, i) of segments.get(item.label)\"\n :key=\"i\"\n :class=\"{ [$style.match]: segment.match }\"\n >{{ segment.value }}</span\n >\n </span>\n </template>\n </PlElementList>\n </PlSlideModal>\n</template>\n\n<style module>\n.match {\n background-color: var(--color-active-select);\n border-radius: 2px;\n}\n\n.searchRow {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.searchRow > :first-child {\n flex: 1;\n}\n\n.toggleAllBtn {\n min-width: unset;\n opacity: 0.2;\n transition: opacity 0.3s;\n\n &:hover {\n opacity: 1;\n }\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._match_1cg4g_2{background-color:var(--color-active-select);border-radius:2px}._searchRow_1cg4g_7{align-items:center;gap:8px;display:flex}._searchRow_1cg4g_7>:first-child{flex:1}._toggleAllBtn_1cg4g_17{min-width:unset;opacity:.2;transition:opacity .3s;&:hover{opacity:1}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgGridColumnManager.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlAgGridColumnManager.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue"],"names":[],"mappings":"AAqKA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAMlD,KAAK,WAAW,GAAG;IACjB;;;;;OAKG;IACH,GAAG,EAAE,OAAO,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;;AAqRF,wBAMG"}
|
|
@@ -2,66 +2,83 @@ import { PlAgDataTableRowNumberColId as e } from "../PlAgDataTable/sources/row-n
|
|
|
2
2
|
import { useFilteredItems as t } from "./useFilteredItems.js";
|
|
3
3
|
import { useGridColumns as n } from "./useGridColumns.js";
|
|
4
4
|
import { Fragment as r, Teleport as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, normalizeClass as p, openBlock as m, ref as h, renderList as g, toDisplayString as _, unref as v, withCtx as y, withModifiers as b } from "vue";
|
|
5
|
-
import { PlBtnGhost as x,
|
|
5
|
+
import { PlBtnGhost as x, PlBtnSecondary as S, PlElementList as C, PlIcon24 as w, PlSearchField as T, PlSlideModal as E, usePlBlockPageTitleTeleportTarget as D } from "@milaboratories/uikit";
|
|
6
6
|
//#region src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue?vue&type=script&setup=true&lang.ts
|
|
7
|
-
var
|
|
7
|
+
var O = /* @__PURE__ */ f({
|
|
8
8
|
__name: "PlAgGridColumnManager",
|
|
9
9
|
props: {
|
|
10
10
|
api: {},
|
|
11
11
|
width: {}
|
|
12
12
|
},
|
|
13
13
|
setup(f) {
|
|
14
|
-
let
|
|
15
|
-
items: a(() =>
|
|
14
|
+
let O = f, k = h(""), A = h(!1), j = D("PlAgGridColumnManager"), M = n(O), { filteredItems: N, segments: P } = t({
|
|
15
|
+
items: a(() => M.value.map((e, t) => ({
|
|
16
16
|
column: e,
|
|
17
17
|
id: e.getId(),
|
|
18
18
|
label: e.getColDef().headerName ?? `Unnamed Column (${t + 1})`
|
|
19
19
|
}))),
|
|
20
|
-
query:
|
|
20
|
+
query: k,
|
|
21
21
|
getStrings: (e) => [e.label]
|
|
22
|
-
})
|
|
23
|
-
|
|
22
|
+
}), F = a(() => N.value.filter((t) => t.id !== e)), I = a(() => F.value.length > 0 && F.value.every((e) => !e.column.isVisible())), L = () => {
|
|
23
|
+
if (O.api.isDestroyed()) return;
|
|
24
|
+
let e = I.value, t = F.value.map((e) => e.column);
|
|
25
|
+
t.length !== 0 && O.api.setColumnsVisible(t, e);
|
|
26
|
+
};
|
|
27
|
+
return (t, n) => (m(), c(r, null, [v(j) ? (m(), o(i, {
|
|
24
28
|
key: 0,
|
|
25
|
-
to: v(
|
|
29
|
+
to: v(j)
|
|
26
30
|
}, [d(v(x), {
|
|
27
31
|
icon: "columns",
|
|
28
|
-
onClick: n[0] ||= b((e) =>
|
|
32
|
+
onClick: n[0] ||= b((e) => A.value = !A.value, ["stop"])
|
|
29
33
|
}, {
|
|
30
34
|
default: y(() => [...n[3] ||= [u(" Columns ", -1)]]),
|
|
31
35
|
_: 1
|
|
32
|
-
})], 8, ["to"])) : s("", !0), d(v(
|
|
33
|
-
modelValue:
|
|
34
|
-
"onUpdate:modelValue": n[2] ||= (e) =>
|
|
36
|
+
})], 8, ["to"])) : s("", !0), d(v(E), {
|
|
37
|
+
modelValue: A.value,
|
|
38
|
+
"onUpdate:modelValue": n[2] ||= (e) => A.value = e,
|
|
35
39
|
width: f.width,
|
|
36
40
|
"close-on-outside-click": ""
|
|
37
41
|
}, {
|
|
38
42
|
title: y(() => [...n[4] ||= [u("Manage Columns", -1)]]),
|
|
39
|
-
default: y(() => [d(v(
|
|
40
|
-
modelValue:
|
|
41
|
-
"onUpdate:modelValue": n[1] ||= (e) =>
|
|
43
|
+
default: y(() => [l("div", { class: p(t.$style.searchRow) }, [d(v(T), {
|
|
44
|
+
modelValue: k.value,
|
|
45
|
+
"onUpdate:modelValue": n[1] ||= (e) => k.value = e,
|
|
42
46
|
clearable: ""
|
|
43
47
|
}, null, 8, ["modelValue"]), d(v(S), {
|
|
44
|
-
|
|
48
|
+
class: p(t.$style.toggleAllBtn),
|
|
49
|
+
disabled: F.value.length === 0,
|
|
50
|
+
onClick: b(L, ["stop"])
|
|
51
|
+
}, {
|
|
52
|
+
default: y(() => [I.value ? (m(), o(v(w), {
|
|
53
|
+
key: 0,
|
|
54
|
+
name: "view-show"
|
|
55
|
+
})) : (m(), o(v(w), {
|
|
56
|
+
key: 1,
|
|
57
|
+
name: "view-hide"
|
|
58
|
+
}))]),
|
|
59
|
+
_: 1
|
|
60
|
+
}, 8, ["class", "disabled"])], 2), d(v(C), {
|
|
61
|
+
items: v(N),
|
|
45
62
|
"get-item-key": (e) => e.id,
|
|
46
63
|
"is-draggable": (e) => !e.column.getColDef().lockPosition,
|
|
47
64
|
"on-sort": (e, t) => {
|
|
48
|
-
if (!
|
|
49
|
-
let n = v(
|
|
50
|
-
|
|
65
|
+
if (!O.api.isDestroyed()) {
|
|
66
|
+
let n = v(M)[e];
|
|
67
|
+
O.api.moveColumns([n], t);
|
|
51
68
|
}
|
|
52
69
|
return !0;
|
|
53
70
|
},
|
|
54
71
|
"on-toggle": (e) => {
|
|
55
|
-
|
|
72
|
+
O.api.isDestroyed() || O.api.setColumnsVisible([e.column], !e.column.isVisible());
|
|
56
73
|
},
|
|
57
74
|
"is-toggled": (e) => !e.column.isVisible(),
|
|
58
75
|
"is-toggable": (t) => t.id !== v(e),
|
|
59
76
|
"is-pinned": (e) => !!e.column.getColDef().lockPosition,
|
|
60
77
|
"is-pinnable": () => !1,
|
|
61
|
-
"disable-dragging":
|
|
78
|
+
"disable-dragging": k.value.length > 0,
|
|
62
79
|
"disable-removing": ""
|
|
63
80
|
}, {
|
|
64
|
-
"item-title": y(({ item: e }) => [l("span", null, [(m(!0), c(r, null, g(v(
|
|
81
|
+
"item-title": y(({ item: e }) => [l("span", null, [(m(!0), c(r, null, g(v(P).get(e.label), (e, n) => (m(), c("span", {
|
|
65
82
|
key: n,
|
|
66
83
|
class: p({ [t.$style.match]: e.match })
|
|
67
84
|
}, _(e.value), 3))), 128))])]),
|
|
@@ -82,6 +99,6 @@ var E = /* @__PURE__ */ f({
|
|
|
82
99
|
}
|
|
83
100
|
});
|
|
84
101
|
//#endregion
|
|
85
|
-
export {
|
|
102
|
+
export { O as default };
|
|
86
103
|
|
|
87
104
|
//# sourceMappingURL=PlAgGridColumnManager.vue2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgGridColumnManager.vue_vue_type_script_setup_true_lang.js","names":["$style"],"sources":["../../../src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n PlBtnGhost,\n PlElementList,\n PlSearchField,\n PlSlideModal,\n usePlBlockPageTitleTeleportTarget,\n} from \"@milaboratories/uikit\";\nimport { type GridApi } from \"ag-grid-enterprise\";\nimport { computed, ref } from \"vue\";\nimport { PlAgDataTableRowNumberColId } from \"../PlAgDataTable/sources/row-number\";\nimport { useFilteredItems } from \"./useFilteredItems\";\nimport { useGridColumns } from \"./useGridColumns\";\n\nconst props = defineProps<{\n /**\n * The GridApi is an API interface provided by the table/grid component\n * for interacting programmatically with the grid's features and functionality.\n * It allows you to control and manipulate grid behavior, access data, and\n * trigger specific actions.\n */\n api: GridApi;\n /**\n * Css Column Manager (Panel) modal width (default value is `368px`)\n */\n width?: string;\n}>();\n\nconst query = ref(\"\");\nconst slideModal = ref(false);\nconst teleportTarget = usePlBlockPageTitleTeleportTarget(\"PlAgGridColumnManager\");\n\nconst columns = useGridColumns(props);\n\nconst items = computed(() => {\n return columns.value.map((col, i) => ({\n column: col,\n id: col.getId(),\n label: col.getColDef().headerName ?? `Unnamed Column (${i + 1})`,\n }));\n});\n\nconst { filteredItems, segments } = useFilteredItems({\n items,\n query,\n getStrings: (item) => [item.label],\n});\n</script>\n\n<template>\n <Teleport v-if=\"teleportTarget\" :to=\"teleportTarget\">\n <PlBtnGhost icon=\"columns\" @click.stop=\"slideModal = !slideModal\"> Columns </PlBtnGhost>\n </Teleport>\n\n <PlSlideModal v-model=\"slideModal\" :width=\"width\" close-on-outside-click>\n <template #title>Manage Columns</template>\n <PlSearchField v-model=\"query\" clearable />\n <PlElementList\n :items=\"filteredItems\"\n :get-item-key=\"(item) => item.id\"\n :is-draggable=\"(item) => !item.column.getColDef().lockPosition\"\n :on-sort=\"\n (fromIndex, toIndex) => {\n if (!props.api.isDestroyed()) {\n const columnToMove = columns[fromIndex];\n props.api.moveColumns([columnToMove], toIndex);\n }\n return true; // Let PlElementList handle the visual update\n }\n \"\n :on-toggle=\"\n (item) => {\n if (!props.api.isDestroyed()) {\n props.api.setColumnsVisible([item.column], !item.column.isVisible());\n }\n }\n \"\n :is-toggled=\"(item) => !item.column.isVisible()\"\n :is-toggable=\"(item) => item.id !== PlAgDataTableRowNumberColId\"\n :is-pinned=\"(item) => !!item.column.getColDef().lockPosition\"\n :is-pinnable=\"() => false\"\n :disable-dragging=\"query.length > 0\"\n disable-removing\n >\n <template #item-title=\"{ item }\">\n <span>\n <span\n v-for=\"(segment, i) of segments.get(item.label)\"\n :key=\"i\"\n :class=\"{ [$style.match]: segment.match }\"\n >{{ segment.value }}</span\n >\n </span>\n </template>\n </PlElementList>\n </PlSlideModal>\n</template>\n\n<style module>\n.match {\n background-color: var(--color-active-select);\n border-radius: 2px;\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"PlAgGridColumnManager.vue_vue_type_script_setup_true_lang.js","names":["$style"],"sources":["../../../src/components/PlAgGridColumnManager/PlAgGridColumnManager.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport {\n PlBtnGhost,\n PlBtnSecondary,\n PlElementList,\n PlIcon24,\n PlSearchField,\n PlSlideModal,\n usePlBlockPageTitleTeleportTarget,\n} from \"@milaboratories/uikit\";\nimport { type GridApi } from \"ag-grid-enterprise\";\nimport { computed, ref } from \"vue\";\nimport { PlAgDataTableRowNumberColId } from \"../PlAgDataTable/sources/row-number\";\nimport { useFilteredItems } from \"./useFilteredItems\";\nimport { useGridColumns } from \"./useGridColumns\";\n\nconst props = defineProps<{\n /**\n * The GridApi is an API interface provided by the table/grid component\n * for interacting programmatically with the grid's features and functionality.\n * It allows you to control and manipulate grid behavior, access data, and\n * trigger specific actions.\n */\n api: GridApi;\n /**\n * Css Column Manager (Panel) modal width (default value is `368px`)\n */\n width?: string;\n}>();\n\nconst query = ref(\"\");\nconst slideModal = ref(false);\nconst teleportTarget = usePlBlockPageTitleTeleportTarget(\"PlAgGridColumnManager\");\n\nconst columns = useGridColumns(props);\n\nconst items = computed(() => {\n return columns.value.map((col, i) => ({\n column: col,\n id: col.getId(),\n label: col.getColDef().headerName ?? `Unnamed Column (${i + 1})`,\n }));\n});\n\nconst { filteredItems, segments } = useFilteredItems({\n items,\n query,\n getStrings: (item) => [item.label],\n});\n\nconst toggleableFilteredItems = computed(() =>\n filteredItems.value.filter((item) => item.id !== PlAgDataTableRowNumberColId),\n);\n\nconst allFilteredHidden = computed(\n () =>\n toggleableFilteredItems.value.length > 0 &&\n toggleableFilteredItems.value.every((item) => !item.column.isVisible()),\n);\n\nconst toggleAllFiltered = () => {\n if (props.api.isDestroyed()) return;\n const nextVisible = allFilteredHidden.value;\n const cols = toggleableFilteredItems.value.map((item) => item.column);\n if (cols.length === 0) return;\n props.api.setColumnsVisible(cols, nextVisible);\n};\n</script>\n\n<template>\n <Teleport v-if=\"teleportTarget\" :to=\"teleportTarget\">\n <PlBtnGhost icon=\"columns\" @click.stop=\"slideModal = !slideModal\"> Columns </PlBtnGhost>\n </Teleport>\n\n <PlSlideModal v-model=\"slideModal\" :width=\"width\" close-on-outside-click>\n <template #title>Manage Columns</template>\n <div :class=\"$style.searchRow\">\n <PlSearchField v-model=\"query\" clearable />\n <PlBtnSecondary\n :class=\"$style.toggleAllBtn\"\n :disabled=\"toggleableFilteredItems.length === 0\"\n @click.stop=\"toggleAllFiltered\"\n >\n <PlIcon24 v-if=\"allFilteredHidden\" name=\"view-show\" />\n <PlIcon24 v-else name=\"view-hide\" />\n </PlBtnSecondary>\n </div>\n <PlElementList\n :items=\"filteredItems\"\n :get-item-key=\"(item) => item.id\"\n :is-draggable=\"(item) => !item.column.getColDef().lockPosition\"\n :on-sort=\"\n (fromIndex, toIndex) => {\n if (!props.api.isDestroyed()) {\n const columnToMove = columns[fromIndex];\n props.api.moveColumns([columnToMove], toIndex);\n }\n return true; // Let PlElementList handle the visual update\n }\n \"\n :on-toggle=\"\n (item) => {\n if (!props.api.isDestroyed()) {\n props.api.setColumnsVisible([item.column], !item.column.isVisible());\n }\n }\n \"\n :is-toggled=\"(item) => !item.column.isVisible()\"\n :is-toggable=\"(item) => item.id !== PlAgDataTableRowNumberColId\"\n :is-pinned=\"(item) => !!item.column.getColDef().lockPosition\"\n :is-pinnable=\"() => false\"\n :disable-dragging=\"query.length > 0\"\n disable-removing\n >\n <template #item-title=\"{ item }\">\n <span>\n <span\n v-for=\"(segment, i) of segments.get(item.label)\"\n :key=\"i\"\n :class=\"{ [$style.match]: segment.match }\"\n >{{ segment.value }}</span\n >\n </span>\n </template>\n </PlElementList>\n </PlSlideModal>\n</template>\n\n<style module>\n.match {\n background-color: var(--color-active-select);\n border-radius: 2px;\n}\n\n.searchRow {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.searchRow > :first-child {\n flex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AA,MAAA,EAJwB,EAAA,EAAQ,CAAC,IAAI,EAAK,MAAK,GAAtC,GAAS,YADnB,EAKC,QAAA;KAHE,KAAK;KACL,OAAK,EAAA,GAAKA,EAAAA,OAAO,QAAQ,EAAQ,OAAK,CAAA;SACnC,EAAQ,MAAK,EAAA,EAAA"}
|
|
@@ -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 = Omit<BaseProps, \"step\" | \"onUpdateStep\"> & {\n annotation: Annotation;\n onUpdateAnnotation: (annotation: Annotation) => void;\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 { produce } from \"immer\";\nimport { PlSidebarGroup, useConfirm } from \"@milaboratories/uikit\";\n\nimport type { Annotation, Filter } from \"../types\";\nimport AnnotationsSidebar from \"./AnnotationsSidebar.vue\";\nimport FilterSidebar from \"./FilterSidebar.vue\";\n\nconst props = defineProps<Props>();\n\nconst selectedStepId = shallowRef<undefined | number>(undefined);\n\nconst selectedStep = computed(() => {\n return isNil(selectedStepId.value) || isNil(props.annotation)\n ? undefined\n : props.annotation.steps.find((step) => step.id === selectedStepId.value);\n});\n\neffect(function setDefaultStepId() {\n if (selectedStepId.value === undefined && props.annotation.steps.length > 0) {\n selectedStepId.value = props.annotation.steps[0].id;\n }\n});\n\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\nasync function handleDeleteSchema() {\n if (await confirmResetSchema()) {\n selectedStepId.value = undefined;\n props.onDeleteSchema?.();\n }\n}\n\nfunction updateSelectedStepId(id: undefined | number) {\n selectedStepId.value = id;\n}\n\nfunction updateSelectedStep(step: Filter) {\n props.onUpdateAnnotation(\n produce(props.annotation, (draft) => {\n const idx = draft.steps.findIndex((s) => s.id === step.id);\n if (idx !== -1) {\n draft.steps[idx] = step;\n }\n }),\n );\n}\n</script>\n\n<template>\n <PlSidebarGroup>\n <template #item-0>\n <AnnotationsSidebar\n :annotation=\"props.annotation\"\n :selected-step-id=\"selectedStepId\"\n :on-update-annotation=\"props.onUpdateAnnotation\"\n :on-update-selected-step-id=\"updateSelectedStepId\"\n :class=\"$style.sidebarItem\"\n @delete-schema=\"handleDeleteSchema\"\n />\n </template>\n <template #item-1>\n <FilterSidebar\n v-if=\"selectedStep\"\n :step=\"selectedStep\"\n :on-update-step=\"updateSelectedStep\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n :get-suggest-options=\"props.getSuggestOptions\"\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":";;;;;;;;;;;;;;;;;;;;EAoBA,IAAM,IAAQ,GAER,IAAiB,EAA+B,KAAA,EAAU,EAE1D,IAAe,QACZ,EAAM,EAAe,MAAM,IAAI,EAAM,EAAM,WAAU,GACxD,KAAA,IACA,EAAM,WAAW,MAAM,MAAM,MAAS,EAAK,OAAO,EAAe,MAAM,CAC3E;AAEF,IAAO,WAA4B;AACjC,GAAI,EAAe,UAAU,KAAA,KAAa,EAAM,WAAW,MAAM,SAAS,MACxE,EAAe,QAAQ,EAAM,WAAW,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;;EAI5B,SAAS,EAAqB,GAAwB;AACpD,KAAe,QAAQ;;EAGzB,SAAS,EAAmB,GAAc;AACxC,KAAM,mBACJ,EAAQ,EAAM,aAAa,MAAU;IACnC,IAAM,IAAM,EAAM,MAAM,WAAW,MAAM,EAAE,OAAO,EAAK,GAAG;AAC1D,IAAI,MAAQ,OACV,EAAM,MAAM,KAAO;KAErB,CACH;;yBAKD,EAuBiB,EAAA,EAAA,EAAA,MAAA;GAtBJ,UAAM,QAQb,CAPF,EAOE,GAAA;IANC,YAAY,EAAM;IAClB,oBAAkB,EAAA;IAClB,wBAAsB,EAAM;IAC5B,8BAA4B;IAC5B,OAAK,EAAEA,EAAAA,OAAO,YAAW;IACzB,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 = Omit<BaseProps, \"step\" | \"onUpdateStep\"> & {\n annotation: Annotation;\n onUpdateAnnotation: (annotation: Annotation) => void;\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 { produce } from \"immer\";\nimport { PlSidebarGroup, useConfirm } from \"@milaboratories/uikit\";\n\nimport type { Annotation, Filter } from \"../types\";\nimport AnnotationsSidebar from \"./AnnotationsSidebar.vue\";\nimport FilterSidebar from \"./FilterSidebar.vue\";\n\nconst props = defineProps<Props>();\n\nconst selectedStepId = shallowRef<undefined | number>(undefined);\n\nconst selectedStep = computed(() => {\n return isNil(selectedStepId.value) || isNil(props.annotation)\n ? undefined\n : props.annotation.steps.find((step) => step.id === selectedStepId.value);\n});\n\neffect(function setDefaultStepId() {\n if (selectedStepId.value === undefined && props.annotation.steps.length > 0) {\n selectedStepId.value = props.annotation.steps[0].id;\n }\n});\n\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\nasync function handleDeleteSchema() {\n if (await confirmResetSchema()) {\n selectedStepId.value = undefined;\n props.onDeleteSchema?.();\n }\n}\n\nfunction updateSelectedStepId(id: undefined | number) {\n selectedStepId.value = id;\n}\n\nfunction updateSelectedStep(step: Filter) {\n props.onUpdateAnnotation(\n produce(props.annotation, (draft) => {\n const idx = draft.steps.findIndex((s) => s.id === step.id);\n if (idx !== -1) {\n draft.steps[idx] = step;\n }\n }),\n );\n}\n</script>\n\n<template>\n <PlSidebarGroup>\n <template #item-0>\n <AnnotationsSidebar\n :annotation=\"props.annotation\"\n :selected-step-id=\"selectedStepId\"\n :on-update-annotation=\"props.onUpdateAnnotation\"\n :on-update-selected-step-id=\"updateSelectedStepId\"\n :class=\"$style.sidebarItem\"\n @delete-schema=\"handleDeleteSchema\"\n />\n </template>\n <template #item-1>\n <FilterSidebar\n v-if=\"selectedStep\"\n :step=\"selectedStep\"\n :on-update-step=\"updateSelectedStep\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n :get-suggest-options=\"props.getSuggestOptions\"\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":";;;;;;;;;;;;;;;;;;;;EAoBA,IAAM,IAAQ,GAER,IAAiB,EAA+B,KAAA,EAAU,EAE1D,IAAe,QACZ,EAAM,EAAe,MAAM,IAAI,EAAM,EAAM,WAAU,GACxD,KAAA,IACA,EAAM,WAAW,MAAM,MAAM,MAAS,EAAK,OAAO,EAAe,MAAM,CAC3E;AAEF,IAAO,WAA4B;AACjC,GAAI,EAAe,UAAU,KAAA,KAAa,EAAM,WAAW,MAAM,SAAS,MACxE,EAAe,QAAQ,EAAM,WAAW,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;;EAI5B,SAAS,EAAqB,GAAwB;AACpD,KAAe,QAAQ;;EAGzB,SAAS,EAAmB,GAAc;AACxC,KAAM,mBACJ,EAAQ,EAAM,aAAa,MAAU;IACnC,IAAM,IAAM,EAAM,MAAM,WAAW,MAAM,EAAE,OAAO,EAAK,GAAG;AAC1D,IAAI,MAAQ,OACV,EAAM,MAAM,KAAO;KAErB,CACH;;yBAKD,EAuBiB,EAAA,EAAA,EAAA,MAAA;GAtBJ,UAAM,QAQb,CAPF,EAOE,GAAA;IANC,YAAY,EAAM;IAClB,oBAAkB,EAAA;IAClB,wBAAsB,EAAM;IAC5B,8BAA4B;IAC5B,OAAK,EAAEA,EAAAA,OAAO,YAAW;IACzB,gBAAe;;;;;;;GAGT,UAAM,QAUb,CARM,EAAA,SAAA,GAAA,EADR,EASE,GAAA;;IAPC,MAAM,EAAA;IACN,kBAAgB;IAChB,OAAK,EAAEA,EAAAA,OAAO,YAAW;IACzB,SAAS,EAAM;IACf,uBAAqB,EAAM;IAC3B,oBAAoB,EAAM;IAC1B,6BAA6B,EAAM"}
|
|
@@ -2,7 +2,7 @@ import e from "../../_virtual/_plugin-vue_export-helper.js";
|
|
|
2
2
|
import t from "./PlDatasetSelector.vue2.js";
|
|
3
3
|
import './PlDatasetSelector.style.css';/* empty css */
|
|
4
4
|
//#region src/components/PlDatasetSelector/PlDatasetSelector.vue
|
|
5
|
-
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-
|
|
5
|
+
var n = /* @__PURE__ */ e(t, [["__scopeId", "data-v-95f2adf4"]]);
|
|
6
6
|
//#endregion
|
|
7
7
|
export { n as default };
|
|
8
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlDatasetSelector.js","names":[],"sources":["../../../src/components/PlDatasetSelector/PlDatasetSelector.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Select a dataset and (optionally) a filter column, emitting a
|
|
1
|
+
{"version":3,"file":"PlDatasetSelector.js","names":[],"sources":["../../../src/components/PlDatasetSelector/PlDatasetSelector.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Select a dataset and (optionally) a filter column, emitting a {@link DatasetSelection}.\n *\n * Behaves like {@link PlDropdownRef} when none of the offered datasets carry\n * filter options. When the selected dataset has compatible filters, a second\n * dropdown appears with the filters plus a \"No filter\" entry.\n *\n * The emitted value bundles the user's pick (`primary`) with the auto-attached\n * `enrichments` payload from the matching `DatasetOption`. Enrichments are\n * opaque to the UI — block authors unbundle them inside their args resolver.\n */\nexport default {\n name: \"PlDatasetSelector\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport type { DatasetOption, DatasetSelection, PlRef } from \"@platforma-sdk/model\";\nimport { createDatasetSelection, createPrimaryRef, plRefsEqual } from \"@platforma-sdk/model\";\nimport type { ListOption } from \"@milaboratories/uikit\";\nimport { PlDropdown, PlDropdownRef } from \"@milaboratories/uikit\";\nimport { computed } from \"vue\";\n\nconst slots = defineSlots<{\n tooltip?: () => unknown;\n}>();\n\nconst model = defineModel<DatasetSelection | undefined>();\n\nconst props = withDefaults(\n defineProps<{\n /** Available datasets, each optionally carrying compatible filter choices. */\n options?: Readonly<DatasetOption[]>;\n /** Label above the dataset dropdown. */\n label?: string;\n /** Helper text below the dataset dropdown (shown when there is no error). */\n helper?: string;\n /** Helper text shown while `options` is undefined (loading). */\n loadingOptionsHelper?: string;\n /** Error message displayed below the dataset dropdown. */\n error?: unknown;\n /** Placeholder when no dataset is selected. */\n placeholder?: string;\n /** Label above the filter dropdown. */\n filterLabel?: string;\n /** Placeholder for the filter dropdown. */\n filterPlaceholder?: string;\n /** Label of the \"no filter\" entry prepended to the filter options. */\n noFilterLabel?: string;\n /** Show a clear button on the dataset dropdown. */\n clearable?: boolean;\n /** Mark the dataset dropdown as required. */\n required?: boolean;\n /** Disable all interaction. */\n disabled?: boolean;\n }>(),\n {\n options: undefined,\n label: undefined,\n helper: undefined,\n loadingOptionsHelper: undefined,\n error: undefined,\n placeholder: \"...\",\n filterLabel: \"\",\n filterPlaceholder: \"...\",\n noFilterLabel: \"No filter\",\n clearable: false,\n required: false,\n disabled: false,\n },\n);\n\nconst selectedDataset = computed<PlRef | undefined>(() => model.value?.primary.column);\n\nconst selectedFilter = computed<PlRef | undefined>(() => model.value?.primary.filter);\n\nconst currentDatasetOption = computed<DatasetOption | undefined>(() => {\n const dataset = selectedDataset.value;\n if (!dataset) return undefined;\n return props.options?.find((o) => plRefsEqual(o.primary.ref, dataset, true));\n});\n\n// PlDropdownRef expects `Option[]`; project the primary out of each entry.\nconst primaryOptions = computed<readonly { ref: PlRef; label: string }[] | undefined>(() =>\n props.options?.map((o) => o.primary),\n);\n\nconst hasFilters = computed(() => (currentDatasetOption.value?.filters?.length ?? 0) > 0);\n\n/**\n * Filter dropdown options. The first entry (`null`) is the \"No filter\" choice —\n * null distinguishes it from `undefined` (dropdown clear button, disabled here).\n */\nconst filterOptions = computed<ListOption<PlRef | null>[]>(() => {\n const filters = currentDatasetOption.value?.filters;\n if (!filters) return [];\n return [\n { label: props.noFilterLabel, value: null } as ListOption<PlRef | null>,\n ...filters.map((f) => ({ label: f.label, value: f.ref }) as ListOption<PlRef | null>),\n ];\n});\n\nconst filterValue = computed<PlRef | null>(() => selectedFilter.value ?? null);\n\nfunction emitValue(dataset: PlRef | undefined, filter: PlRef | undefined) {\n if (dataset === undefined) {\n model.value = undefined;\n return;\n }\n // Resolve from `props.options` directly — `currentDatasetOption` may not\n // have recomputed yet when this runs synchronously inside a change handler.\n const option = props.options?.find((o) => plRefsEqual(o.primary.ref, dataset, true));\n model.value = createDatasetSelection(createPrimaryRef(dataset, filter), option?.enrichments);\n}\n\nfunction onDatasetChange(dataset: PlRef | undefined) {\n emitValue(dataset, undefined);\n}\n\nfunction onFilterChange(value: PlRef | null | undefined) {\n const dataset = selectedDataset.value;\n if (!dataset) return;\n emitValue(dataset, value ?? undefined);\n}\n</script>\n\n<template>\n <div class=\"pl-dataset-selector\">\n <PlDropdownRef\n :model-value=\"selectedDataset\"\n :options=\"primaryOptions\"\n :label=\"label\"\n :helper=\"helper\"\n :loading-options-helper=\"loadingOptionsHelper\"\n :error=\"error\"\n :placeholder=\"placeholder\"\n :clearable=\"clearable\"\n :required=\"required\"\n :disabled=\"disabled\"\n @update:model-value=\"onDatasetChange\"\n >\n <template v-if=\"slots.tooltip\" #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlDropdownRef>\n <PlDropdown\n v-if=\"hasFilters\"\n :model-value=\"filterValue\"\n :options=\"filterOptions\"\n :label=\"filterLabel\"\n :placeholder=\"filterPlaceholder\"\n :disabled=\"disabled\"\n @update:model-value=\"onFilterChange\"\n />\n </div>\n</template>\n\n<style scoped>\n.pl-dataset-selector {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n</style>\n"],"mappings":""}
|