@platforma-sdk/ui-vue 1.58.17 → 1.58.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +25 -24
- 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 +18 -0
- package/dist/AgGridVue/createAgGridColDef.d.ts.map +1 -1
- package/dist/AgGridVue/createAgGridColDef.js.map +1 -1
- package/dist/AgGridVue/useAgGridOptions.d.ts.map +1 -1
- package/dist/AgGridVue/useAgGridOptions.js +11 -11
- package/dist/AgGridVue/useAgGridOptions.js.map +1 -1
- package/dist/components/PlAdvancedFilter/FilterEditor.js.map +1 -1
- package/dist/components/PlAdvancedFilter/FilterEditor.style.js.map +1 -1
- package/dist/components/PlAdvancedFilter/FilterEditor.vue.d.ts.map +1 -1
- package/dist/components/PlAdvancedFilter/FilterEditor.vue2.js +1 -6
- package/dist/components/PlAdvancedFilter/FilterEditor.vue2.js.map +1 -1
- package/dist/components/PlAdvancedFilter/types.d.ts +2 -2
- package/dist/components/PlAdvancedFilter/types.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.style.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js +31 -26
- package/dist/components/PlAgDataTable/PlAgDataTableV2.vue2.js.map +1 -1
- package/dist/{aggrid.d.ts → components/PlAgDataTable/compositions/useTheme.d.ts} +1 -2
- package/dist/components/PlAgDataTable/compositions/useTheme.d.ts.map +1 -0
- package/dist/{aggrid.js → components/PlAgDataTable/compositions/useTheme.js} +9 -16
- package/dist/components/PlAgDataTable/compositions/useTheme.js.map +1 -0
- package/dist/components/PlAgDataTable/index.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/index.js +5 -0
- package/dist/components/PlAgDataTable/index.js.map +1 -0
- package/dist/components/PlAgDataTable/sources/table-state-v2.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/sources/table-state-v2.js +6 -4
- package/dist/components/PlAgDataTable/sources/table-state-v2.js.map +1 -1
- package/dist/components/PlAgDataTable/types.d.ts +2 -1
- package/dist/components/PlAgDataTable/types.d.ts.map +1 -1
- package/dist/components/PlAgDataTable/types.js +10 -5
- package/dist/components/PlAgDataTable/types.js.map +1 -1
- package/dist/components/PlTableFilters/PlTableFiltersV2.js.map +1 -1
- package/dist/components/PlTableFilters/PlTableFiltersV2.style.js.map +1 -1
- package/dist/components/PlTableFilters/PlTableFiltersV2.vue.d.ts +3 -1
- package/dist/components/PlTableFilters/PlTableFiltersV2.vue.d.ts.map +1 -1
- package/dist/components/PlTableFilters/PlTableFiltersV2.vue2.js +49 -50
- package/dist/components/PlTableFilters/PlTableFiltersV2.vue2.js.map +1 -1
- package/dist/composition/AgGrid/index.d.ts +2 -0
- package/dist/composition/AgGrid/index.d.ts.map +1 -0
- package/dist/composition/AgGrid/index.js +10 -0
- package/dist/composition/AgGrid/index.js.map +1 -0
- package/dist/defineApp.d.ts +5 -1
- package/dist/defineApp.d.ts.map +1 -1
- package/dist/defineApp.js +44 -44
- package/dist/defineApp.js.map +1 -1
- package/dist/index.js +31 -31
- package/dist/internal/createAppV1.d.ts.map +1 -1
- package/dist/internal/createAppV1.js.map +1 -1
- package/dist/lib.d.ts +1 -1
- package/dist/lib.d.ts.map +1 -1
- package/dist/lib.js +1 -1
- package/package.json +5 -5
- package/src/AgGridVue/createAgGridColDef.ts +0 -1
- package/src/AgGridVue/useAgGridOptions.ts +2 -2
- package/src/components/PlAdvancedFilter/FilterEditor.vue +18 -21
- package/src/components/PlAdvancedFilter/types.ts +6 -1
- package/src/components/PlAgDataTable/PlAgDataTableV2.vue +2 -1
- package/src/{aggrid.ts → components/PlAgDataTable/compositions/useTheme.ts} +3 -24
- package/src/components/PlAgDataTable/index.ts +4 -0
- package/src/components/PlAgDataTable/sources/table-state-v2.ts +11 -8
- package/src/components/PlAgDataTable/types.ts +7 -6
- package/src/components/PlTableFilters/PlTableFiltersV2.vue +30 -27
- package/src/composition/AgGrid/index.ts +13 -0
- package/src/defineApp.ts +13 -7
- package/src/internal/createAppV1.ts +21 -26
- package/src/internal/createAppV2.test.ts +3 -0
- package/src/internal/createAppV3.test.ts +4 -0
- package/src/lib.ts +1 -1
- package/dist/aggrid.d.ts.map +0 -1
- package/dist/aggrid.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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.58.
|
|
3
|
+
> @platforma-sdk/ui-vue@1.58.22 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...
|
|
7
7
|
↳ vite.js build --config /configs/vite.browser-lib.config.js --mode production
|
|
8
8
|
[36mvite v8.0.0-beta.15 [32mbuilding client environment for production...[36m[39m
|
|
9
9
|
[warn] `inlineDynamicImports` option is deprecated, please use `codeSplitting: false` instead.
|
|
10
|
-
[2K
|
|
10
|
+
[2K
|
|
11
11
|
rendering chunks...
|
|
12
12
|
|
|
13
13
|
[vite:dts] Start generate declaration files...
|
|
14
|
-
[vite:dts] Declaration files built in
|
|
14
|
+
[vite:dts] Declaration files built in 5675ms.
|
|
15
15
|
|
|
16
16
|
computing gzip size...
|
|
17
17
|
dist/components/PlAnnotations/components/PlAnnotations.vue?vue&type=style&index=0&lang.css 0.04 kB │ gzip: 0.06 kB
|
|
@@ -92,7 +92,6 @@ dist/lib/util/helpers/dist/index.js
|
|
|
92
92
|
dist/components/PlTableFilters/PlTableFiltersV2.vue_vue_type_style_index_0_lang.module.js 0.20 kB │ gzip: 0.17 kB │ map: 0.42 kB
|
|
93
93
|
dist/plugins/Monetization/EndOfPeriod.vue_vue_type_style_index_0_lang.module.js 0.20 kB │ gzip: 0.18 kB │ map: 0.42 kB
|
|
94
94
|
dist/components/PlAnnotations/components/PlAnnotations.vue_vue_type_style_index_0_lang.module.js 0.21 kB │ gzip: 0.18 kB │ map: 0.42 kB
|
|
95
|
-
dist/components/PlAgDataTable/index.js 0.22 kB │ gzip: 0.12 kB
|
|
96
95
|
dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue_vue_type_style_index_0_lang.module.js 0.22 kB │ gzip: 0.18 kB │ map: 0.42 kB
|
|
97
96
|
dist/components/PlAgDataTable/PlAgDataTableSheets.vue_vue_type_style_index_0_lang.module.js 0.22 kB │ gzip: 0.18 kB │ map: 0.42 kB
|
|
98
97
|
dist/components/PlAnnotations/components/FilterSidebar.vue_vue_type_style_index_0_lang.module.js 0.23 kB │ gzip: 0.19 kB │ map: 0.45 kB
|
|
@@ -116,14 +115,15 @@ dist/plugins/Monetization/RunStatus.js
|
|
|
116
115
|
dist/components/BlockLayout.js 0.33 kB │ gzip: 0.23 kB │ map: 2.10 kB
|
|
117
116
|
dist/lib/util/helpers/dist/strings.js 0.33 kB │ gzip: 0.23 kB │ map: 4.11 kB
|
|
118
117
|
dist/plugins/Monetization/EndOfPeriod.js 0.33 kB │ gzip: 0.23 kB │ map: 1.21 kB
|
|
119
|
-
dist/components/PlAdvancedFilter/FilterEditor.js 0.33 kB │ gzip: 0.23 kB │ map: 15.
|
|
118
|
+
dist/components/PlAdvancedFilter/FilterEditor.js 0.33 kB │ gzip: 0.23 kB │ map: 15.16 kB
|
|
120
119
|
dist/components/PlAdvancedFilter/OperandButton.js 0.34 kB │ gzip: 0.23 kB │ map: 1.31 kB
|
|
121
120
|
dist/components/PlAnnotations/components/FilterSidebar.js 0.34 kB │ gzip: 0.23 kB │ map: 4.72 kB
|
|
122
121
|
dist/components/PlAnnotations/components/PlAnnotations.js 0.34 kB │ gzip: 0.23 kB │ map: 2.65 kB
|
|
123
|
-
dist/components/PlAgDataTable/PlAgDataTableV2.js 0.34 kB │ gzip: 0.24 kB │ map: 20.
|
|
122
|
+
dist/components/PlAgDataTable/PlAgDataTableV2.js 0.34 kB │ gzip: 0.24 kB │ map: 20.92 kB
|
|
124
123
|
dist/plugins/Monetization/UserCabinetCard.js 0.34 kB │ gzip: 0.23 kB │ map: 3.00 kB
|
|
125
124
|
dist/components/PlAdvancedFilter/PlAdvancedFilter.js 0.34 kB │ gzip: 0.24 kB │ map: 10.70 kB
|
|
126
|
-
dist/components/PlTableFilters/PlTableFiltersV2.js 0.34 kB │ gzip: 0.24 kB │ map: 4.
|
|
125
|
+
dist/components/PlTableFilters/PlTableFiltersV2.js 0.34 kB │ gzip: 0.24 kB │ map: 4.68 kB
|
|
126
|
+
dist/components/PlAgDataTable/index.js 0.35 kB │ gzip: 0.20 kB │ map: 0.60 kB
|
|
127
127
|
dist/components/PlBtnExportArchive/PlBtnExportArchive.js 0.35 kB │ gzip: 0.24 kB │ map: 7.17 kB
|
|
128
128
|
dist/components/PlAgDataTable/PlAgDataTableSheets.js 0.35 kB │ gzip: 0.24 kB │ map: 3.61 kB
|
|
129
129
|
dist/components/PlAnnotations/components/AnnotationsSidebar.js 0.35 kB │ gzip: 0.24 kB │ map: 3.77 kB
|
|
@@ -131,6 +131,7 @@ dist/components/PlAnnotations/components/PlAnnotationsModal.js
|
|
|
131
131
|
dist/components/PlAgGridColumnManager/PlAgGridColumnManager.js 0.36 kB │ gzip: 0.24 kB │ map: 3.94 kB
|
|
132
132
|
dist/components/PlAnnotations/components/AnnotationsSidebar.vue_vue_type_style_index_0_lang.module.js 0.39 kB │ gzip: 0.25 kB │ map: 0.63 kB
|
|
133
133
|
dist/plugins/Monetization/UserCabinetCard.vue_vue_type_style_index_0_lang.module.js 0.41 kB │ gzip: 0.26 kB │ map: 0.67 kB
|
|
134
|
+
dist/composition/AgGrid/index.js 0.41 kB │ gzip: 0.29 kB │ map: 0.79 kB
|
|
134
135
|
dist/plugins/Monetization/RunStatus.vue_vue_type_style_index_0_lang.module.js 0.41 kB │ gzip: 0.27 kB │ map: 0.76 kB
|
|
135
136
|
dist/defineStore.js 0.45 kB │ gzip: 0.30 kB │ map: 1.19 kB
|
|
136
137
|
dist/components/LoaderPage.js 0.47 kB │ gzip: 0.32 kB │ map: 0.48 kB
|
|
@@ -159,14 +160,15 @@ dist/components/PlAgDataTable/sources/value-rendering.js
|
|
|
159
160
|
dist/plugins/Monetization/RunStatus.vue_vue_type_script_setup_true_lang.js 1.06 kB │ gzip: 0.57 kB │ map: 3.04 kB
|
|
160
161
|
dist/components/PlAgGridColumnManager/useFilteredItems.js 1.08 kB │ gzip: 0.56 kB │ map: 3.48 kB
|
|
161
162
|
dist/createModel.js 1.18 kB │ gzip: 0.59 kB │ map: 3.11 kB
|
|
162
|
-
dist/components/PlAgDataTable/types.js 1.18 kB │ gzip: 0.49 kB │ map: 7.45 kB
|
|
163
163
|
dist/components/PlBtnExportArchive/Summary.vue_vue_type_script_setup_true_lang.js 1.21 kB │ gzip: 0.59 kB │ map: 2.35 kB
|
|
164
164
|
dist/components/PlAgCellFile/PlAgCellFile.vue_vue_type_script_setup_true_lang.js 1.22 kB │ gzip: 0.69 kB │ map: 2.93 kB
|
|
165
165
|
dist/components/PlAgDataTable/PlAgRowCount.vue_vue_type_script_setup_true_lang.js 1.22 kB │ gzip: 0.57 kB │ map: 2.50 kB
|
|
166
166
|
dist/components/PlAgDataTable/PlAgOverlayLoading.vue_vue_type_script_setup_true_lang.js 1.22 kB │ gzip: 0.71 kB │ map: 2.49 kB
|
|
167
167
|
dist/utils.js 1.23 kB │ gzip: 0.60 kB │ map: 3.40 kB
|
|
168
168
|
dist/lib/util/helpers/dist/prettyBytes.js 1.23 kB │ gzip: 0.63 kB │ map: 3.79 kB
|
|
169
|
+
dist/components/PlAgDataTable/compositions/useTheme.js 1.24 kB │ gzip: 0.57 kB │ map: 2.09 kB
|
|
169
170
|
dist/components/PlBtnExportArchive/Item.vue_vue_type_script_setup_true_lang.js 1.26 kB │ gzip: 0.57 kB │ map: 2.58 kB
|
|
171
|
+
dist/components/PlAgDataTable/types.js 1.27 kB │ gzip: 0.50 kB │ map: 7.63 kB
|
|
170
172
|
dist/usePlugin.js 1.29 kB │ gzip: 0.70 kB │ map: 2.63 kB
|
|
171
173
|
dist/components/PlAgTextAndButtonCell/PlAgTextAndButtonCell.vue_vue_type_script_setup_true_lang.js 1.34 kB │ gzip: 0.73 kB │ map: 3.42 kB
|
|
172
174
|
dist/internal/createAppModel.js 1.42 kB │ gzip: 0.72 kB │ map: 3.89 kB
|
|
@@ -176,7 +178,6 @@ dist/components/PlAdvancedFilter/utils.js
|
|
|
176
178
|
dist/internal/UpdateSerializer.js 1.48 kB │ gzip: 0.65 kB │ map: 4.28 kB
|
|
177
179
|
dist/AgGridVue/selection.js 1.49 kB │ gzip: 0.51 kB │ map: 3.20 kB
|
|
178
180
|
dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue_vue_type_script_setup_true_lang.js 1.55 kB │ gzip: 0.80 kB │ map: 2.62 kB
|
|
179
|
-
dist/aggrid.js 1.61 kB │ gzip: 0.78 kB │ map: 2.78 kB
|
|
180
181
|
dist/components/PlTableFastSearch/PlTableFastSearch.vue_vue_type_script_setup_true_lang.js 1.71 kB │ gzip: 0.86 kB │ map: 2.10 kB
|
|
181
182
|
dist/components/PlAdvancedFilter/constants.js 1.75 kB │ gzip: 0.52 kB │ map: 3.67 kB
|
|
182
183
|
dist/computedResult.js 1.75 kB │ gzip: 0.74 kB │ map: 2.32 kB
|
|
@@ -189,37 +190,37 @@ dist/components/PlAgDataTable/PlAgDataTableSheets.vue_vue_type_script_setup_true
|
|
|
189
190
|
dist/components/PlAgColumnHeader/PlAgColumnHeader.vue_vue_type_script_setup_true_lang.js 2.51 kB │ gzip: 1.11 kB │ map: 6.76 kB
|
|
190
191
|
dist/components/PlAnnotations/components/PlAnnotations.vue_vue_type_script_setup_true_lang.js 2.53 kB │ gzip: 1.08 kB │ map: 3.54 kB
|
|
191
192
|
dist/lib/util/helpers/dist/objects.js 2.54 kB │ gzip: 1.04 kB │ map: 8.90 kB
|
|
192
|
-
dist/lib.js 2.
|
|
193
|
+
dist/lib.js 2.57 kB │ gzip: 0.54 kB │ map: 3.78 kB
|
|
193
194
|
dist/components/PlAgDataTable/compositions/useGrid.js 2.69 kB │ gzip: 1.20 kB │ map: 6.18 kB
|
|
194
|
-
dist/defineApp.js 2.89 kB │ gzip: 1.02 kB │ map: 13.63 kB
|
|
195
195
|
dist/components/PlAgDataTable/sources/row-number.js 2.92 kB │ gzip: 1.28 kB │ map: 7.42 kB
|
|
196
|
+
dist/defineApp.js 2.98 kB │ gzip: 1.04 kB │ map: 13.94 kB
|
|
196
197
|
dist/plugins/Monetization/LimitCard.vue_vue_type_script_setup_true_lang.js 3.21 kB │ gzip: 1.09 kB │ map: 9.08 kB
|
|
197
198
|
dist/components/PlAgGridColumnManager/PlAgGridColumnManager.vue_vue_type_script_setup_true_lang.js 3.26 kB │ gzip: 1.46 kB │ map: 5.77 kB
|
|
198
|
-
dist/AgGridVue/createAgGridColDef.js 3.26 kB │ gzip: 1.27 kB │ map: 9.
|
|
199
|
-
dist/components/PlTableFilters/PlTableFiltersV2.vue_vue_type_script_setup_true_lang.js 3.
|
|
199
|
+
dist/AgGridVue/createAgGridColDef.js 3.26 kB │ gzip: 1.27 kB │ map: 9.25 kB
|
|
200
|
+
dist/components/PlTableFilters/PlTableFiltersV2.vue_vue_type_script_setup_true_lang.js 3.45 kB │ gzip: 1.60 kB │ map: 6.38 kB
|
|
200
201
|
dist/components/PlAnnotations/components/AnnotationsSidebar.vue_vue_type_script_setup_true_lang.js 3.59 kB │ gzip: 1.55 kB │ map: 5.53 kB
|
|
201
202
|
dist/components/PlAnnotations/components/FilterSidebar.vue_vue_type_script_setup_true_lang.js 3.72 kB │ gzip: 1.52 kB │ map: 6.52 kB
|
|
202
|
-
dist/components/PlAgDataTable/sources/table-state-v2.js 3.83 kB │ gzip: 1.44 kB │ map: 11.44 kB
|
|
203
203
|
dist/plugins/Monetization/MonetizationSidebar.vue_vue_type_script_setup_true_lang.js 3.85 kB │ gzip: 1.66 kB │ map: 5.71 kB
|
|
204
|
-
dist/
|
|
205
|
-
dist/
|
|
204
|
+
dist/components/PlAgDataTable/sources/table-state-v2.js 3.96 kB │ gzip: 1.48 kB │ map: 11.85 kB
|
|
205
|
+
dist/index.js 4.27 kB │ gzip: 1.29 kB │ map: 0.13 kB
|
|
206
|
+
dist/internal/createAppV1.js 4.69 kB │ gzip: 1.69 kB │ map: 14.22 kB
|
|
206
207
|
dist/composition/fileContent.js 4.85 kB │ gzip: 1.75 kB │ map: 12.99 kB
|
|
207
208
|
dist/components/PlBtnExportArchive/PlBtnExportArchive.vue_vue_type_script_setup_true_lang.js 5.08 kB │ gzip: 2.11 kB │ map: 10.36 kB
|
|
208
|
-
dist/AgGridVue/useAgGridOptions.js 5.
|
|
209
|
+
dist/AgGridVue/useAgGridOptions.js 5.77 kB │ gzip: 1.80 kB │ map: 14.24 kB
|
|
209
210
|
dist/internal/createAppV2.js 6.00 kB │ gzip: 2.27 kB │ map: 17.80 kB
|
|
210
211
|
dist/components/PlAgDataTable/sources/table-source-v2.js 6.44 kB │ gzip: 2.56 kB │ map: 19.12 kB
|
|
211
212
|
dist/internal/createAppV3.js 6.54 kB │ gzip: 2.51 kB │ map: 19.87 kB
|
|
212
213
|
dist/components/PlAdvancedFilter/PlAdvancedFilter.vue_vue_type_script_setup_true_lang.js 7.06 kB │ gzip: 2.28 kB │ map: 14.91 kB
|
|
213
|
-
dist/components/PlAdvancedFilter/FilterEditor.vue_vue_type_script_setup_true_lang.js 10.
|
|
214
|
-
dist/components/PlAgDataTable/PlAgDataTableV2.vue_vue_type_script_setup_true_lang.js 11.
|
|
214
|
+
dist/components/PlAdvancedFilter/FilterEditor.vue_vue_type_script_setup_true_lang.js 10.14 kB │ gzip: 3.05 kB │ map: 21.57 kB
|
|
215
|
+
dist/components/PlAgDataTable/PlAgDataTableV2.vue_vue_type_script_setup_true_lang.js 11.51 kB │ gzip: 3.68 kB │ map: 27.96 kB
|
|
215
216
|
|
|
216
217
|
[33m[33m[PLUGIN_TIMINGS] Warning:[0m Your build spent significant time in plugins. Here is a breakdown:
|
|
217
|
-
- sourcemaps (
|
|
218
|
-
- vite:dts (
|
|
219
|
-
- vite:vue (12%)
|
|
218
|
+
- sourcemaps (36%)
|
|
219
|
+
- vite:dts (25%)
|
|
220
220
|
- vite:css-post (11%)
|
|
221
|
-
- vite:
|
|
221
|
+
- vite:vue (11%)
|
|
222
|
+
- vite:css (7%)
|
|
222
223
|
See https://rolldown.rs/options/checks#plugintimings for more details.
|
|
223
224
|
[39m
|
|
224
|
-
[32m✓ built in 6.
|
|
225
|
+
[32m✓ built in 6.49s[39m
|
|
225
226
|
Build completed successfully
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @platforma-sdk/ui-vue@1.58.
|
|
3
|
+
> @platforma-sdk/ui-vue@1.58.22 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 3494ms on 127 files using 8 threads.
|
|
12
12
|
Format check completed successfully
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @platforma-sdk/ui-vue@1.58.
|
|
3
|
+
> @platforma-sdk/ui-vue@1.58.22 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 32ms on 110 files with 98 rules using 8 threads.
|
|
10
10
|
Linting completed successfully
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
WARN Issue while reading "/home/runner/_work/platforma/platforma/.npmrc". Failed to replace env in config: ${NPMJS_TOKEN}
|
|
2
2
|
|
|
3
|
-
> @platforma-sdk/ui-vue@1.58.
|
|
3
|
+
> @platforma-sdk/ui-vue@1.58.22 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,23 @@
|
|
|
1
1
|
# @platforma-sdk/ui-vue
|
|
2
2
|
|
|
3
|
+
## 1.58.22
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 15959f8: Add support feature flags for UI
|
|
8
|
+
- Updated dependencies [15959f8]
|
|
9
|
+
- @platforma-sdk/model@1.58.22
|
|
10
|
+
- @milaboratories/uikit@2.10.43
|
|
11
|
+
|
|
12
|
+
## 1.58.19
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- a93de45: Fix table filters bugs
|
|
17
|
+
- Updated dependencies [a93de45]
|
|
18
|
+
- @milaboratories/uikit@2.10.42
|
|
19
|
+
- @platforma-sdk/model@1.58.19
|
|
20
|
+
|
|
3
21
|
## 1.58.17
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAgGridColDef.d.ts","sourceRoot":"","sources":["../../src/AgGridVue/createAgGridColDef.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"createAgGridColDef.d.ts","sourceRoot":"","sources":["../../src/AgGridVue/createAgGridColDef.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,uBAAuB,CAAC;AAEjF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAIhF;;GAEG;AACH,KAAK,cAAc,GAAG,aAAa,GAAG,SAAS,GAAG,MAAM,CAAC;AAWzD;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GACtB;IACE;;;;;OAKG;IACH,MAAM,EAAE,cAAc,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GACD,SAAS,CAAC;AAEd;;;;;;;;;;GAUG;AACH,MAAM,MAAM,sBAAsB,CAAC,KAAK,GAAG,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,CAC9D,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,mBAAmB,CAAC,KAAK,EAAE,MAAM,CAAC,KACzC,cAAc,CAAC;AAEpB;;;;;;;;;GASG;AACH,MAAM,WAAW,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,CAAE,SAAQ,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC;IAChF,QAAQ,CAAC,EAAE,sBAAsB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,qBAAqB,CAAC,EAAE,yBAAyB,CAAC;IAClD,cAAc,CAAC,EACX,IAAI,GACJ;QACE;;WAEG;QACH,IAAI,CAAC,EAAE,cAAc,CAAC;QACtB;;WAEG;QACH,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB;;;;;;;;WAQG;QACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;QAClC;;;WAGG;QACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;KACjD,CAAC;CACP;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,CACxB,KAAK,EACL,MAAM,EACN,CAAC,SAAS,MAAM,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,IAC3C,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAgErC;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,GAAG,EACpD,GAAG,EAAE,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,GACjC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CA6BvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAgGridColDef.js","names":[],"sources":["../../src/AgGridVue/createAgGridColDef.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"createAgGridColDef.js","names":[],"sources":["../../src/AgGridVue/createAgGridColDef.ts"],"sourcesContent":["import type { ColDef, ICellRendererParams } from \"ag-grid-enterprise\";\nimport { PlAgCellProgress } from \"../components/PlAgCellProgress\";\nimport type { MaskIconName16, PlProgressCellProps } from \"@milaboratories/uikit\";\nimport { tapIf } from \"@milaboratories/helpers\";\nimport type { PlAgHeaderComponentParams } from \"../components/PlAgColumnHeader\";\nimport { PlAgColumnHeader } from \"../components/PlAgColumnHeader\";\nimport { PlAgTextAndButtonCell } from \"../components/PlAgTextAndButtonCell\";\n\n/**\n * Represents the available progress statuses for a cell.\n */\ntype ProgressStatus = \"not_started\" | \"running\" | \"done\";\n\n/**\n * Human-readable labels for each {@link ProgressStatus}.\n */\nconst progressStatusLabels: Record<ProgressStatus, string> = {\n not_started: \"Not Started\",\n running: \"Running\",\n done: \"Done\",\n};\n\n/**\n * Defines the configuration for rendering a progress overlay in a grid cell.\n *\n * When provided, a progress overlay will be rendered. If the value is\n * `undefined`, no progress overlay is shown.\n */\nexport type ColDefProgress =\n | {\n /**\n * The progress status which influences default text and styling:\n * - `'not_started'`: Typically renders gray text without a progress bar.\n * - `'running'`: Indicates an active progress state.\n * - `'done'`: Implies completion (commonly rendered as 100%).\n */\n status: ProgressStatus;\n /**\n * A number (or numeric string) between 0 and 100 that indicates progress.\n * If omitted or invalid, it implies an infinite or indeterminate progress state\n */\n percent?: number | string;\n /**\n * The main label displayed on the left side of the cell.\n */\n text?: string;\n /**\n * Additional text, often used to display the percentage by default.\n */\n suffix?: string;\n /**\n * If provided, this message takes precedence over `text` to indicate an error.\n */\n error?: string;\n }\n | undefined;\n\n/**\n * Callback function type to dynamically generate a {@link ColDefProgress} configuration\n * for a cell based on its rendering parameters.\n *\n * @typeParam TData - The type of the row data.\n * @typeParam TValue - The type of the cell value.\n *\n * @param cellData - The parameters provided by AG Grid's cell renderer.\n * @returns A {@link ColDefProgress} object to configure the progress overlay,\n * or `undefined` if no progress overlay should be rendered.\n */\nexport type ColDefProgressCallback<TData = any, TValue = any> = (\n value: TValue,\n cellData: ICellRendererParams<TData, TValue>,\n) => ColDefProgress;\n\n/**\n * Extended AG Grid column definition that supports additional properties for\n * progress overlays and layout customization.\n *\n * @typeParam TData - The type of the row data.\n * @typeParam TValue - The type of the cell value.\n *\n * @property progress - An optional callback to provide progress overlay configuration.\n * @property noGutters - If `true`, removes padding from the cell.\n */\nexport interface ColDefExtended<TData, TValue = any> extends ColDef<TData, TValue> {\n progress?: ColDefProgressCallback<TData, TValue>;\n noGutters?: boolean;\n headerComponentParams?: PlAgHeaderComponentParams;\n textWithButton?:\n | true\n | {\n /**\n * Button icon MaskIconName16\n */\n icon?: MaskIconName16;\n /**\n * Button label\n */\n btnLabel?: string;\n /**\n * If invokeRowsOnDoubleClick = true, clicking a button inside the row\n * triggers the doubleClick event for the entire row. In this case,\n * the handler passed to the component is not called, even if it is defined.\n *\n * If invokeRowsOnDoubleClick = false, the doubleClick event for the row\n * is not triggered, but the provided handler will be called, receiving\n * the ICellRendererParams as an argument.\n */\n invokeRowsOnDoubleClick?: boolean;\n /**\n * plHandler parameter is a click handler that is invoked when\n * the invokeRowsOnDoubleClick property is set to false.\n */\n onClick?: (params: ICellRendererParams) => void;\n };\n}\n\n/**\n * Utility type to infer the type of a specific property key from a {@link ColDefExtended}. Maybe not useful\n */\nexport type InferColDefKey<\n TData,\n TValue,\n K extends keyof ColDefExtended<TData, TValue>,\n> = ColDefExtended<TData, TValue>[K];\n\n/**\n * Returns a style object that removes horizontal and vertical padding from an AG Grid cell.\n */\nfunction noGuttersStyle() {\n return {\n \"--ag-cell-horizontal-padding\": \"0px\",\n \"--ag-cell-vertical-padding\": \"0px\",\n };\n}\n\n/**\n * Creates the configuration object for a progress cell renderer component.\n *\n * @param params - The properties for the progress cell component, conforming to {@link PlProgressCellProps}.\n * @returns An object containing the progress component and its parameters.\n */\nfunction createProgressComponent(params: PlProgressCellProps) {\n return {\n component: PlAgCellProgress,\n params,\n };\n}\n\n/**\n * Enhances the given column definition to support a progress overlay if a progress callback is provided.\n *\n * This function modifies the column definition by:\n * - Merging no-gutters styles into the cell style.\n * - Overriding the `cellRendererSelector` to return a progress component when a valid progress configuration is present.\n *\n * @typeParam TData - The type of the row data.\n * @param def - The extended column definition to be augmented.\n */\nfunction handleProgress<TData>(def: ColDefExtended<TData>) {\n if (def.progress) {\n const progress = def.progress;\n\n const cellRendererSelector = def.cellRendererSelector;\n\n // Ensure no padding in the cell when a progress overlay is rendered.\n def.cellStyle = Object.assign({}, def.cellStyle ?? {}, noGuttersStyle());\n\n def.cellRendererSelector = (cellData) => {\n const pt = progress(cellData.value, cellData);\n\n if (!pt) {\n return cellRendererSelector?.(cellData);\n }\n\n return createProgressComponent({\n progress: tapIf(Number(pt.percent), (n) =>\n Number.isFinite(n) ? (n < 0 ? 0 : n) : undefined,\n ),\n progressString: pt.suffix ?? (pt.status === \"running\" ? `${pt.percent ?? 0}%` : \"\"),\n step: pt.text ?? progressStatusLabels[pt.status],\n stage: pt.status,\n error: pt.error,\n });\n };\n }\n}\n\n/**\n * Creates an AG Grid column definition with extended features such as progress overlays and gutter removal.\n *\n * This function processes an extended column definition by:\n * - Applying progress rendering logic via {@link handleProgress} if a progress callback is provided.\n * - Merging no-gutters styles if the `noGutters` flag is set.\n * - Removing the internal properties (`progress` and `noGutters`) from the final definition.\n *\n * @typeParam TData - The type of the row data.\n * @typeParam TValue - The type of the cell value.\n * @param def - The extended column definition containing custom properties.\n * @returns The processed column definition ready for use with AG Grid.\n */\nexport function createAgGridColDef<TData, TValue = any>(\n def: ColDefExtended<TData, TValue>,\n): ColDef<TData, TValue> {\n handleProgress(def);\n\n if (def.noGutters) {\n def.cellStyle = Object.assign({}, def.cellStyle ?? {}, noGuttersStyle());\n }\n\n if (def.headerComponentParams) {\n def.headerComponent = PlAgColumnHeader;\n }\n\n if (def.textWithButton) {\n def.cellRenderer = PlAgTextAndButtonCell;\n if (typeof def.textWithButton !== \"boolean\") {\n def.cellRendererParams = def.textWithButton;\n } else {\n def.cellRendererParams = {\n invokeRowsOnDoubleClick: true,\n };\n }\n }\n\n delete def.textWithButton;\n\n delete def.progress;\n\n delete def.noGutters;\n\n return def;\n}\n"],"mappings":";;;;;;;;;;;AAgBA,IAAM,IAAuD;CAC3D,aAAa;CACb,SAAS;CACT,MAAM;CACP;;;;AA4GD,SAAS,IAAiB;AACxB,QAAO;EACL,gCAAgC;EAChC,8BAA8B;EAC/B;;;;;;;;AASH,SAAS,EAAwB,GAA6B;AAC5D,QAAO;EACL,WAAW;EACX;EACD;;;;;;;;;;;;AAaH,SAAS,EAAsB,GAA4B;AACzD,KAAI,EAAI,UAAU;EAChB,IAAM,IAAW,EAAI,UAEf,IAAuB,EAAI;AAKjC,EAFA,EAAI,YAAY,OAAO,OAAO,EAAE,EAAE,EAAI,aAAa,EAAE,EAAE,GAAgB,CAAC,EAExE,EAAI,wBAAwB,MAAa;GACvC,IAAM,IAAK,EAAS,EAAS,OAAO,EAAS;AAM7C,UAJK,IAIE,EAAwB;IAC7B,UAAU,EAAM,OAAO,EAAG,QAAQ,GAAG,MACnC,OAAO,SAAS,EAAE,GAAI,IAAI,IAAI,IAAI,IAAK,KAAA,EACxC;IACD,gBAAgB,EAAG,WAAW,EAAG,WAAW,YAAY,GAAG,EAAG,WAAW,EAAE,KAAK;IAChF,MAAM,EAAG,QAAQ,EAAqB,EAAG;IACzC,OAAO,EAAG;IACV,OAAO,EAAG;IACX,CAAC,GAXO,IAAuB,EAAS;;;;;;;;;;;;;;;;;AA6B/C,SAAgB,EACd,GACuB;AA4BvB,QA3BA,EAAe,EAAI,EAEf,EAAI,cACN,EAAI,YAAY,OAAO,OAAO,EAAE,EAAE,EAAI,aAAa,EAAE,EAAE,GAAgB,CAAC,GAGtE,EAAI,0BACN,EAAI,kBAAkB,IAGpB,EAAI,mBACN,EAAI,eAAe,GACf,OAAO,EAAI,kBAAmB,YAGhC,EAAI,qBAAqB,EACvB,yBAAyB,IAC1B,GAJD,EAAI,qBAAqB,EAAI,iBAQjC,OAAO,EAAI,gBAEX,OAAO,EAAI,UAEX,OAAO,EAAI,WAEJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAgGridOptions.d.ts","sourceRoot":"","sources":["../../src/AgGridVue/useAgGridOptions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,WAAW,EACX,OAAO,EACP,WAAW,EAEX,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"useAgGridOptions.d.ts","sourceRoot":"","sources":["../../src/AgGridVue/useAgGridOptions.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import r from "../components/PlAgDataTable/
|
|
4
|
-
import i from "../components/PlAgDataTable/
|
|
1
|
+
import { autoSizeRowNumberColumn as e, makeRowNumberColDef as t } from "../components/PlAgDataTable/sources/row-number.js";
|
|
2
|
+
import n from "../components/PlAgDataTable/PlAgOverlayLoading.js";
|
|
3
|
+
import r from "../components/PlAgDataTable/PlAgOverlayNoRows.js";
|
|
4
|
+
import { AgGridTheme as i } from "../components/PlAgDataTable/compositions/useTheme.js";
|
|
5
5
|
import "../components/PlAgDataTable/index.js";
|
|
6
6
|
import { createAgGridColDef as a } from "./createAgGridColDef.js";
|
|
7
7
|
import o from "../components/PlAgCellFile/PlAgCellFile.js";
|
|
@@ -164,17 +164,17 @@ var m = class {
|
|
|
164
164
|
function h(h) {
|
|
165
165
|
let g = d(), _ = u(() => {
|
|
166
166
|
let u = {
|
|
167
|
-
theme:
|
|
168
|
-
loadingOverlayComponent:
|
|
169
|
-
noRowsOverlayComponent:
|
|
170
|
-
onGridReady: (
|
|
171
|
-
g.value =
|
|
167
|
+
theme: i,
|
|
168
|
+
loadingOverlayComponent: n,
|
|
169
|
+
noRowsOverlayComponent: r,
|
|
170
|
+
onGridReady: (t) => {
|
|
171
|
+
g.value = t.api, e(t.api);
|
|
172
172
|
}
|
|
173
173
|
}, d = h({
|
|
174
174
|
builder: new m(),
|
|
175
175
|
column: (e) => e
|
|
176
176
|
}), f = Object.assign({}, u, d instanceof m ? d.build() : d);
|
|
177
|
-
return f.rowNumbersColumn && (f.columnDefs = [
|
|
177
|
+
return f.rowNumbersColumn && (f.columnDefs = [t(), ...f.columnDefs ?? []]), f.noRowsText && (f.noRowsOverlayComponentParams = { text: f.noRowsText }), "loadingOverlayComponentParams" in f && console.warn("useAgGridOptions: remove loadingOverlayComponentParams from options, use loading, notReady, loadingText instead"), f.loading = f.notReady || f.loading, f.columnDefs = f.columnDefs?.map((e) => a(e)), f.components = Object.assign({}, f.components ?? {}, {
|
|
178
178
|
PlAgCellFile: o,
|
|
179
179
|
PlAgChartStackedBarCell: s,
|
|
180
180
|
PlAgChartHistogramCell: c,
|
|
@@ -192,7 +192,7 @@ function h(h) {
|
|
|
192
192
|
};
|
|
193
193
|
});
|
|
194
194
|
return p(() => _.value.rowNumbersColumn, () => {
|
|
195
|
-
g.value &&
|
|
195
|
+
g.value && e(g.value);
|
|
196
196
|
}), f([() => _.value.notReady, () => _.value.loading], ([e, t]) => {
|
|
197
197
|
let n = {
|
|
198
198
|
variant: e ? "not-ready" : "loading",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAgGridOptions.js","names":["#options"],"sources":["../../src/AgGridVue/useAgGridOptions.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\nimport type {\n ColGroupDef,\n GridApi,\n GridOptions,\n GridReadyEvent,\n ICellRendererParams,\n RowSelectionOptions,\n ValueSetterParams,\n} from \"ag-grid-enterprise\";\nimport type { Component } from \"vue\";\nimport { computed, shallowRef, watch } from \"vue\";\nimport { AgGridTheme } from \"../aggrid\";\nimport {\n autoSizeRowNumberColumn,\n makeRowNumberColDef,\n PlAgOverlayLoading,\n type PlAgOverlayLoadingParams,\n} from \"../components/PlAgDataTable\";\nimport { PlAgOverlayNoRows } from \"../components/PlAgDataTable\";\nimport { createAgGridColDef, type ColDefExtended } from \"./createAgGridColDef\";\nimport { whenever } from \"@vueuse/core\";\nimport { PlAgCellFile } from \"../components/PlAgCellFile\";\nimport { PlAgChartStackedBarCell } from \"../components/PlAgChartStackedBarCell\";\nimport { PlAgChartHistogramCell } from \"../components/PlAgChartHistogramCell\";\nimport type { ImportFileHandle } from \"@platforma-sdk/model\";\nimport type { ImportProgress } from \"@platforma-sdk/model\";\nimport { PlAgCellStatusTag } from \"../components/PlAgCellStatusTag\";\ninterface GridOptionsExtended<TData = any> extends Omit<\n GridOptions<TData>,\n \"columnDefs\" | \"loadingOverlayComponentParams\"\n> {\n /**\n * Array of Column / Column Group definitions.\n */\n columnDefs?: (ColDefExtended<TData> | ColGroupDef<TData>)[] | null;\n /**\n * Show row numbers column\n */\n rowNumbersColumn?: boolean;\n /**\n * Loading overlay text\n */\n loadingText?: string;\n /**\n * Not ready overlay (Data is not computed). Takes priority over \"loading\"\n */\n notReady?: boolean;\n /**\n * \"Data is not computed\" by default\n */\n notReadyText?: string;\n /**\n * Override standard 'Empty' text for the \"no rows\" overlay\n */\n noRowsText?: string;\n /**\n * @deprecated Use loading, notReady, loadingText instead\n */\n loadingOverlayComponentParams?: never;\n}\n\n// @TODO (super simple builder for now)\nclass Builder<TData> {\n #options: GridOptionsExtended<TData> = {};\n\n public options(options: GridOptionsExtended<TData>) {\n this.#options = Object.assign({}, this.#options, options);\n return this;\n }\n\n private get columnDefs() {\n return this.#options.columnDefs ?? [];\n }\n\n /**\n * Set default column definition\n * @param def - column definition\n * @returns this\n */\n public setDefaultColDef(def: ColDefExtended<TData>) {\n this.#options.defaultColDef = def;\n return this;\n }\n\n /**\n * Show loading overlay\n * @param loading\n * @returns this\n */\n public setLoading(loading?: boolean) {\n this.#options.loading = loading;\n return this;\n }\n\n /**\n * Set loading overlay custom text (default is \"Loading\")\n * @param loadingText\n * @returns this\n */\n public setLoadingText(loadingText?: string) {\n this.#options.loadingText = loadingText;\n return this;\n }\n\n /**\n * Show \"not ready overlay\n * @param notReady\n * @returns this\n */\n public setNotReady(notReady?: boolean) {\n this.#options.notReady = notReady;\n return this;\n }\n\n /**\n * Set \"not ready\" text\n * @param notReadyText\n * @returns this\n */\n public setNotReadyText(notReadyText?: string) {\n this.#options.notReadyText = notReadyText;\n return this;\n }\n\n /**\n * Set \"no rows\" text when there are no rows (default is \"Empty\")\n * @param noRowsText\n * @returns this\n */\n public setNoRowsText(noRowsText?: string) {\n this.#options.noRowsText = noRowsText;\n return this;\n }\n\n /**\n * Set row selection options\n * @param rowSelection\n * @returns this\n */\n public setRowSelection(rowSelection?: RowSelectionOptions) {\n this.#options.rowSelection = rowSelection;\n return this;\n }\n\n /**\n * Set row data\n * @param rowData\n * @returns this\n */\n public setRowData(rowData?: TData[]) {\n this.#options.rowData = rowData;\n return this;\n }\n\n /**\n * Set components\n * @param components\n * @returns this\n */\n public setComponents(components?: Record<string, Component>) {\n this.#options.components = components;\n return this;\n }\n\n /**\n * Set an option\n * @param key - option key\n * @param value - option value\n * @returns this\n */\n public setOption<K extends keyof GridOptionsExtended<TData>>(\n key: K,\n value: GridOptionsExtended<TData>[K],\n ) {\n this.#options[key] = value;\n return this;\n }\n\n /**\n * Add an extended column definition\n * @param def - column definition\n * @returns this\n */\n public column<TValue = any>(def: ColDefExtended<TData, TValue>) {\n this.#options.columnDefs = [...this.columnDefs, def];\n return this;\n }\n\n /**\n * Show row numbers column\n * @param show - show or hide row numbers column\n * @returns this\n */\n public columnRowNumbers(show: boolean = true) {\n this.#options.rowNumbersColumn = show;\n return this;\n }\n\n /**\n * Add a file input column\n * @param def - column definition\n * @param cb - callback to set params for the file input cell renderer\n * @returns this\n */\n public columnFileInput<TValue = any>(\n def: ColDefExtended<TData, TValue> & {\n /**\n * Allowed file extensions (like ['fastq.gz'])\n */\n extensions?: string[];\n /**\n * The resolveProgress function is an optional input parameter for the component\n * that allows tracking the file upload progress in real-time.\n * By passing resolveProgress, you can ensure that the component\n * displays accurate progress values for each file as they upload.\n * How to use it in AgGrid\n * cellRendererParams: {\n * resolveProgress: (cellData) => {\n * const progresses = app.progresses;\n * if (!cellData.value.importFileHandle) return undefined;\n * else return progresses[cellData.value.importFileHandle];\n * }\n * }\n */\n resolveImportProgress?: (\n cellData: ICellRendererParams<TData, TValue>,\n ) => ImportProgress | undefined;\n\n /**\n * The resolveFileHandle function is an optional input parameter for the component\n * that allows tracking the file upload progress in real-time.\n * By passing resolveFileHandle, you can ensure that the component\n * displays accurate progress values for each file as they upload.\n * How to use it in AgGrid\n * cellRendererParams: {\n * resolveFileHandle: (cellData) => {\n * return cellData.value.importFileHandle;\n * }\n * }\n */\n resolveImportFileHandle?: (\n cellData: ICellRendererParams<TData, TValue>,\n ) => ImportFileHandle | undefined;\n\n setImportFileHandle?: (d: ValueSetterParams<TData, ImportFileHandle | undefined>) => void;\n },\n ) {\n return this.column(\n Object.assign(\n {\n cellRenderer: \"PlAgCellFile\",\n headerComponentParams: { type: \"File\" },\n cellStyle: { padding: 0 },\n valueSetter: (d: ValueSetterParams<TData, ImportFileHandle | undefined>) => {\n def.setImportFileHandle?.(d);\n return true;\n },\n cellRendererSelector: (cellData: ICellRendererParams<TData, TValue>) => {\n return {\n component: \"PlAgCellFile\",\n params: {\n extensions: def.extensions,\n value: def.resolveImportFileHandle?.(cellData),\n resolveProgress: () => {\n return def.resolveImportProgress?.(cellData);\n },\n },\n };\n },\n },\n def,\n ),\n );\n }\n\n public build() {\n return this.#options;\n }\n}\n\n// Simple helper to use like column<string> in grid options literal\ntype ColumnFunc<TData> = <TValue>(\n def: ColDefExtended<TData, TValue>,\n) => ColDefExtended<TData, TValue>;\n\n/**\n * Returns a set of Ag Grid options along with a reference to the Ag Grid API.\n * (This is a fast prototype)\n *\n * @example\n * ```ts\n * const { gridOptions, gridApi } = useAgGridOptions(() => ({\n * // custom grid options here\n * }));\n *\n * // Usage in a template (v-bind is required!)\n * <template>\n * <AgGridVue :style=\"{ height: '100%' }\" v-bind=\"gridOptions\" />\n * </template>\n * ```\n */\nexport function useAgGridOptions<TData>(\n factory: (context: {\n builder: Builder<TData>;\n column: ColumnFunc<TData>;\n }) => Builder<TData> | GridOptionsExtended<TData>,\n) {\n const gridApi = shallowRef<GridApi>();\n\n const extOptions = computed<GridOptionsExtended>(() => {\n const def: GridOptionsExtended<TData> = {\n theme: AgGridTheme,\n loadingOverlayComponent: PlAgOverlayLoading,\n noRowsOverlayComponent: PlAgOverlayNoRows,\n onGridReady: (e: GridReadyEvent) => {\n gridApi.value = e.api;\n autoSizeRowNumberColumn(e.api); // @TODO\n },\n };\n\n const column = <TValue>(def: ColDefExtended<TData, TValue>) => {\n return def;\n };\n\n const result = factory({ builder: new Builder(), column });\n\n const options = Object.assign({}, def, result instanceof Builder ? result.build() : result);\n\n if (options.rowNumbersColumn) {\n options.columnDefs = [makeRowNumberColDef(), ...(options.columnDefs ?? [])];\n }\n\n if (options.noRowsText) {\n options.noRowsOverlayComponentParams = {\n text: options.noRowsText,\n };\n }\n\n if (\"loadingOverlayComponentParams\" in options) {\n console.warn(\n \"useAgGridOptions: remove loadingOverlayComponentParams from options, use loading, notReady, loadingText instead\",\n );\n }\n\n options.loading = options.notReady || options.loading;\n\n options.columnDefs = options.columnDefs?.map((it) => createAgGridColDef(it));\n\n // Register all special components\n options.components = Object.assign({}, options.components ?? {}, {\n PlAgCellFile,\n PlAgChartStackedBarCell,\n PlAgChartHistogramCell,\n PlAgCellStatusTag,\n });\n\n return options;\n });\n\n const gridOptions = computed<GridOptions>(() => {\n const options = extOptions.value;\n\n return {\n ...options,\n loadingOverlayComponentParams: {\n variant: options.notReady ? \"not-ready\" : \"loading\",\n notReadyText: options.notReadyText,\n loadingText: options.loadingText,\n } satisfies PlAgOverlayLoadingParams,\n };\n });\n\n whenever(\n () => extOptions.value.rowNumbersColumn,\n () => {\n if (gridApi.value) {\n autoSizeRowNumberColumn(gridApi.value);\n }\n },\n );\n\n watch(\n [() => extOptions.value.notReady, () => extOptions.value.loading],\n ([notReady, loading]) => {\n const loadingOverlayComponentParams = {\n variant: notReady ? \"not-ready\" : \"loading\",\n // we probably don't need to update the parameters below\n notReadyText: extOptions.value.notReadyText,\n loadingText: extOptions.value.loadingText,\n } satisfies PlAgOverlayLoadingParams;\n\n // Hack to apply loadingOverlayComponentParams\n gridApi.value?.updateGridOptions({\n loading: !loading,\n loadingOverlayComponentParams,\n });\n\n gridApi.value?.updateGridOptions({\n loading,\n loadingOverlayComponentParams,\n });\n },\n { deep: true, immediate: true },\n );\n\n return { gridOptions, gridApi };\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"useAgGridOptions.js","names":["#options"],"sources":["../../src/AgGridVue/useAgGridOptions.ts"],"sourcesContent":["/**/\nimport type {\n ColGroupDef,\n GridApi,\n GridOptions,\n GridReadyEvent,\n ICellRendererParams,\n RowSelectionOptions,\n ValueSetterParams,\n} from \"ag-grid-enterprise\";\nimport type { Component } from \"vue\";\nimport { computed, shallowRef, watch } from \"vue\";\nimport {\n autoSizeRowNumberColumn,\n makeRowNumberColDef,\n PlAgOverlayLoading,\n type PlAgOverlayLoadingParams,\n} from \"../components/PlAgDataTable\";\nimport { PlAgOverlayNoRows } from \"../components/PlAgDataTable\";\nimport { createAgGridColDef, type ColDefExtended } from \"./createAgGridColDef\";\nimport { whenever } from \"@vueuse/core\";\nimport { PlAgCellFile } from \"../components/PlAgCellFile\";\nimport { PlAgChartStackedBarCell } from \"../components/PlAgChartStackedBarCell\";\nimport { PlAgChartHistogramCell } from \"../components/PlAgChartHistogramCell\";\nimport type { ImportFileHandle } from \"@platforma-sdk/model\";\nimport type { ImportProgress } from \"@platforma-sdk/model\";\nimport { PlAgCellStatusTag } from \"../components/PlAgCellStatusTag\";\nimport { AgGridTheme } from \"../components/PlAgDataTable/compositions/useTheme\";\ninterface GridOptionsExtended<TData = any> extends Omit<\n GridOptions<TData>,\n \"columnDefs\" | \"loadingOverlayComponentParams\"\n> {\n /**\n * Array of Column / Column Group definitions.\n */\n columnDefs?: (ColDefExtended<TData> | ColGroupDef<TData>)[] | null;\n /**\n * Show row numbers column\n */\n rowNumbersColumn?: boolean;\n /**\n * Loading overlay text\n */\n loadingText?: string;\n /**\n * Not ready overlay (Data is not computed). Takes priority over \"loading\"\n */\n notReady?: boolean;\n /**\n * \"Data is not computed\" by default\n */\n notReadyText?: string;\n /**\n * Override standard 'Empty' text for the \"no rows\" overlay\n */\n noRowsText?: string;\n /**\n * @deprecated Use loading, notReady, loadingText instead\n */\n loadingOverlayComponentParams?: never;\n}\n\n// @TODO (super simple builder for now)\nclass Builder<TData> {\n #options: GridOptionsExtended<TData> = {};\n\n public options(options: GridOptionsExtended<TData>) {\n this.#options = Object.assign({}, this.#options, options);\n return this;\n }\n\n private get columnDefs() {\n return this.#options.columnDefs ?? [];\n }\n\n /**\n * Set default column definition\n * @param def - column definition\n * @returns this\n */\n public setDefaultColDef(def: ColDefExtended<TData>) {\n this.#options.defaultColDef = def;\n return this;\n }\n\n /**\n * Show loading overlay\n * @param loading\n * @returns this\n */\n public setLoading(loading?: boolean) {\n this.#options.loading = loading;\n return this;\n }\n\n /**\n * Set loading overlay custom text (default is \"Loading\")\n * @param loadingText\n * @returns this\n */\n public setLoadingText(loadingText?: string) {\n this.#options.loadingText = loadingText;\n return this;\n }\n\n /**\n * Show \"not ready overlay\n * @param notReady\n * @returns this\n */\n public setNotReady(notReady?: boolean) {\n this.#options.notReady = notReady;\n return this;\n }\n\n /**\n * Set \"not ready\" text\n * @param notReadyText\n * @returns this\n */\n public setNotReadyText(notReadyText?: string) {\n this.#options.notReadyText = notReadyText;\n return this;\n }\n\n /**\n * Set \"no rows\" text when there are no rows (default is \"Empty\")\n * @param noRowsText\n * @returns this\n */\n public setNoRowsText(noRowsText?: string) {\n this.#options.noRowsText = noRowsText;\n return this;\n }\n\n /**\n * Set row selection options\n * @param rowSelection\n * @returns this\n */\n public setRowSelection(rowSelection?: RowSelectionOptions) {\n this.#options.rowSelection = rowSelection;\n return this;\n }\n\n /**\n * Set row data\n * @param rowData\n * @returns this\n */\n public setRowData(rowData?: TData[]) {\n this.#options.rowData = rowData;\n return this;\n }\n\n /**\n * Set components\n * @param components\n * @returns this\n */\n public setComponents(components?: Record<string, Component>) {\n this.#options.components = components;\n return this;\n }\n\n /**\n * Set an option\n * @param key - option key\n * @param value - option value\n * @returns this\n */\n public setOption<K extends keyof GridOptionsExtended<TData>>(\n key: K,\n value: GridOptionsExtended<TData>[K],\n ) {\n this.#options[key] = value;\n return this;\n }\n\n /**\n * Add an extended column definition\n * @param def - column definition\n * @returns this\n */\n public column<TValue = any>(def: ColDefExtended<TData, TValue>) {\n this.#options.columnDefs = [...this.columnDefs, def];\n return this;\n }\n\n /**\n * Show row numbers column\n * @param show - show or hide row numbers column\n * @returns this\n */\n public columnRowNumbers(show: boolean = true) {\n this.#options.rowNumbersColumn = show;\n return this;\n }\n\n /**\n * Add a file input column\n * @param def - column definition\n * @param cb - callback to set params for the file input cell renderer\n * @returns this\n */\n public columnFileInput<TValue = any>(\n def: ColDefExtended<TData, TValue> & {\n /**\n * Allowed file extensions (like ['fastq.gz'])\n */\n extensions?: string[];\n /**\n * The resolveProgress function is an optional input parameter for the component\n * that allows tracking the file upload progress in real-time.\n * By passing resolveProgress, you can ensure that the component\n * displays accurate progress values for each file as they upload.\n * How to use it in AgGrid\n * cellRendererParams: {\n * resolveProgress: (cellData) => {\n * const progresses = app.progresses;\n * if (!cellData.value.importFileHandle) return undefined;\n * else return progresses[cellData.value.importFileHandle];\n * }\n * }\n */\n resolveImportProgress?: (\n cellData: ICellRendererParams<TData, TValue>,\n ) => ImportProgress | undefined;\n\n /**\n * The resolveFileHandle function is an optional input parameter for the component\n * that allows tracking the file upload progress in real-time.\n * By passing resolveFileHandle, you can ensure that the component\n * displays accurate progress values for each file as they upload.\n * How to use it in AgGrid\n * cellRendererParams: {\n * resolveFileHandle: (cellData) => {\n * return cellData.value.importFileHandle;\n * }\n * }\n */\n resolveImportFileHandle?: (\n cellData: ICellRendererParams<TData, TValue>,\n ) => ImportFileHandle | undefined;\n\n setImportFileHandle?: (d: ValueSetterParams<TData, ImportFileHandle | undefined>) => void;\n },\n ) {\n return this.column(\n Object.assign(\n {\n cellRenderer: \"PlAgCellFile\",\n headerComponentParams: { type: \"File\" },\n cellStyle: { padding: 0 },\n valueSetter: (d: ValueSetterParams<TData, ImportFileHandle | undefined>) => {\n def.setImportFileHandle?.(d);\n return true;\n },\n cellRendererSelector: (cellData: ICellRendererParams<TData, TValue>) => {\n return {\n component: \"PlAgCellFile\",\n params: {\n extensions: def.extensions,\n value: def.resolveImportFileHandle?.(cellData),\n resolveProgress: () => {\n return def.resolveImportProgress?.(cellData);\n },\n },\n };\n },\n },\n def,\n ),\n );\n }\n\n public build() {\n return this.#options;\n }\n}\n\n// Simple helper to use like column<string> in grid options literal\ntype ColumnFunc<TData> = <TValue>(\n def: ColDefExtended<TData, TValue>,\n) => ColDefExtended<TData, TValue>;\n\n/**\n * Returns a set of Ag Grid options along with a reference to the Ag Grid API.\n * (This is a fast prototype)\n *\n * @example\n * ```ts\n * const { gridOptions, gridApi } = useAgGridOptions(() => ({\n * // custom grid options here\n * }));\n *\n * // Usage in a template (v-bind is required!)\n * <template>\n * <AgGridVue :style=\"{ height: '100%' }\" v-bind=\"gridOptions\" />\n * </template>\n * ```\n */\nexport function useAgGridOptions<TData>(\n factory: (context: {\n builder: Builder<TData>;\n column: ColumnFunc<TData>;\n }) => Builder<TData> | GridOptionsExtended<TData>,\n) {\n const gridApi = shallowRef<GridApi>();\n\n const extOptions = computed<GridOptionsExtended>(() => {\n const def: GridOptionsExtended<TData> = {\n theme: AgGridTheme,\n loadingOverlayComponent: PlAgOverlayLoading,\n noRowsOverlayComponent: PlAgOverlayNoRows,\n onGridReady: (e: GridReadyEvent) => {\n gridApi.value = e.api;\n autoSizeRowNumberColumn(e.api); // @TODO\n },\n };\n\n const column = <TValue>(def: ColDefExtended<TData, TValue>) => {\n return def;\n };\n\n const result = factory({ builder: new Builder(), column });\n\n const options = Object.assign({}, def, result instanceof Builder ? result.build() : result);\n\n if (options.rowNumbersColumn) {\n options.columnDefs = [makeRowNumberColDef(), ...(options.columnDefs ?? [])];\n }\n\n if (options.noRowsText) {\n options.noRowsOverlayComponentParams = {\n text: options.noRowsText,\n };\n }\n\n if (\"loadingOverlayComponentParams\" in options) {\n console.warn(\n \"useAgGridOptions: remove loadingOverlayComponentParams from options, use loading, notReady, loadingText instead\",\n );\n }\n\n options.loading = options.notReady || options.loading;\n\n options.columnDefs = options.columnDefs?.map((it) => createAgGridColDef(it));\n\n // Register all special components\n options.components = Object.assign({}, options.components ?? {}, {\n PlAgCellFile,\n PlAgChartStackedBarCell,\n PlAgChartHistogramCell,\n PlAgCellStatusTag,\n });\n\n return options;\n });\n\n const gridOptions = computed<GridOptions>(() => {\n const options = extOptions.value;\n\n return {\n ...options,\n loadingOverlayComponentParams: {\n variant: options.notReady ? \"not-ready\" : \"loading\",\n notReadyText: options.notReadyText,\n loadingText: options.loadingText,\n } satisfies PlAgOverlayLoadingParams,\n };\n });\n\n whenever(\n () => extOptions.value.rowNumbersColumn,\n () => {\n if (gridApi.value) {\n autoSizeRowNumberColumn(gridApi.value);\n }\n },\n );\n\n watch(\n [() => extOptions.value.notReady, () => extOptions.value.loading],\n ([notReady, loading]) => {\n const loadingOverlayComponentParams = {\n variant: notReady ? \"not-ready\" : \"loading\",\n // we probably don't need to update the parameters below\n notReadyText: extOptions.value.notReadyText,\n loadingText: extOptions.value.loadingText,\n } satisfies PlAgOverlayLoadingParams;\n\n // Hack to apply loadingOverlayComponentParams\n gridApi.value?.updateGridOptions({\n loading: !loading,\n loadingOverlayComponentParams,\n });\n\n gridApi.value?.updateGridOptions({\n loading,\n loadingOverlayComponentParams,\n });\n },\n { deep: true, immediate: true },\n );\n\n return { gridOptions, gridApi };\n}\n"],"mappings":"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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterEditor.js","names":[],"sources":["../../../src/components/PlAdvancedFilter/FilterEditor.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n PlAutocomplete,\n PlAutocompleteMulti,\n PlDropdown,\n PlIcon16,\n PlNumberField,\n PlTextField,\n PlToggleSwitch,\n Slider,\n} from \"@milaboratories/uikit\";\nimport type {\n AnchoredPColumnId,\n AxisFilterByIdx,\n AxisFilterValue,\n SUniversalPColumnId,\n} from \"@platforma-sdk/model\";\nimport {\n isFilteredPColumn,\n parseColumnId,\n stringifyColumnId,\n type ListOptionBase,\n} from \"@platforma-sdk/model\";\nimport { computed } from \"vue\";\nimport type { SUPPORTED_FILTER_TYPES } from \"./constants\";\nimport { DEFAULT_FILTER_TYPE, DEFAULT_FILTERS } from \"./constants\";\nimport OperandButton from \"./OperandButton.vue\";\nimport type { EditableFilter, Operand, PlAdvancedFilterColumnId, SourceOptionInfo } from \"./types\";\nimport { getFilterInfo, getNormalizedSpec, isNumericFilter, isPositionFilter } from \"./utils\";\n\nconst filter = defineModel<EditableFilter>(\"filter\", { required: true });\n\nconst props = defineProps<{\n isLast: boolean;\n operand: Operand;\n enableDnd: boolean;\n columnOptions: SourceOptionInfo[];\n supportedFilters: typeof SUPPORTED_FILTER_TYPES;\n getSuggestOptions: (params: {\n columnId: PlAdvancedFilterColumnId;\n axisIdx?: number;\n searchType: \"value\" | \"label\";\n searchStr: string;\n }) => ListOptionBase<string | number>[] | Promise<ListOptionBase<string | number>[]>;\n onDelete: (columnId: PlAdvancedFilterColumnId) => void;\n onChangeOperand: (op: Operand) => void;\n}>();\n\nasync function getSuggestOptionsFn(\n id: PlAdvancedFilterColumnId,\n type: \"value\" | \"label\",\n str: string,\n axisIdx?: number,\n): Promise<ListOptionBase<string>[]> {\n return props.getSuggestOptions({\n columnId: id,\n axisIdx,\n searchType: type,\n searchStr: str,\n }) as Promise<ListOptionBase<string>[]>;\n}\n\nasync function getMultiSuggestOptionsFn(\n id: PlAdvancedFilterColumnId,\n type: \"value\" | \"label\",\n str: string | string[],\n axisIdx?: number,\n): Promise<ListOptionBase<string>[]> {\n if (type === \"label\" && typeof str === \"string\") {\n return getSuggestOptionsFn(id, type, str, axisIdx);\n }\n if (type === \"value\" && Array.isArray(str)) {\n const results = await Promise.all(str.map((s) => getSuggestOptionsFn(id, type, s, axisIdx)));\n return results.map((x) => x[0]);\n }\n throw new Error(\"Invalid arguments combination\");\n}\n\ntype Entries<T> = { [K in keyof T]: [K, T[K]] }[keyof T][];\nfunction changeFilterType() {\n const defaultFilter = DEFAULT_FILTERS[filter.value.type];\n\n filter.value = (Object.entries(defaultFilter) as Entries<EditableFilter>).reduce(\n (res, [key, val]) => {\n res[key] = filter.value[key] ?? val;\n return res;\n },\n {} as Record<keyof EditableFilter, EditableFilter[keyof EditableFilter]>,\n ) as EditableFilter;\n}\n\nfunction changeSourceId(newSourceId?: PlAdvancedFilterColumnId) {\n if (!newSourceId) {\n return;\n }\n const newSourceInfo = props.columnOptions.find((v) => v.id === getSourceId(newSourceId));\n if (!newSourceInfo) {\n return;\n }\n const filterInfo = getFilterInfo(filter.value.type);\n const newSourceSpec = getNormalizedSpec(newSourceInfo?.spec);\n if (filterInfo.supportedFor(newSourceSpec)) {\n // don't do anything except update source id\n filter.value.column = newSourceId;\n } else {\n // reset to default filter which fits to any column\n filter.value = {\n ...DEFAULT_FILTERS[DEFAULT_FILTER_TYPE],\n column: newSourceId,\n };\n }\n}\n\nconst inconsistentSourceSelected = computed(() => {\n const selectedOption = props.columnOptions.find(\n (op) => op.id === getSourceId(filter.value.column),\n );\n return selectedOption === undefined;\n});\nconst sourceOptions = computed(() => {\n const options = props.columnOptions.map((v) => ({ value: v.id, label: v.label ?? v }));\n if (inconsistentSourceSelected.value) {\n options.unshift({ value: filter.value.column, label: \"Inconsistent value\" });\n }\n return options;\n});\n\nfunction getSourceId(column: PlAdvancedFilterColumnId): PlAdvancedFilterColumnId {\n try {\n const parsedColumnId = parseColumnId(column as SUniversalPColumnId);\n if (isFilteredPColumn(parsedColumnId)) {\n return stringifyColumnId(parsedColumnId.source);\n } else {\n return column;\n }\n } catch {\n return column;\n }\n}\n\n// similar to FilteredPColumnId but source is stringified and axis filters can be undefined\ntype ColumnAsSourceAndFixedAxes = {\n source: PlAdvancedFilterColumnId;\n axisFiltersByIndex: Record<number, AxisFilterValue | undefined>;\n};\nfunction getColumnAsSourceAndFixedAxes(\n column: PlAdvancedFilterColumnId,\n): ColumnAsSourceAndFixedAxes {\n const sourceId = getSourceId(column);\n const option = props.columnOptions.find((op) => op.id === sourceId);\n const axesToBeFixed = (option?.axesToBeFixed ?? []).reduce(\n (res, item) => {\n res[item.idx] = undefined;\n return res;\n },\n {} as Record<number, AxisFilterValue | undefined>,\n );\n try {\n const parsedColumnId = parseColumnId(column as SUniversalPColumnId);\n if (isFilteredPColumn(parsedColumnId)) {\n return {\n source: sourceId,\n axisFiltersByIndex: parsedColumnId.axisFilters.reduce((res, item) => {\n res[item[0]] = item[1];\n return res;\n }, axesToBeFixed),\n };\n }\n } catch {\n return { source: column, axisFiltersByIndex: axesToBeFixed };\n }\n return { source: column, axisFiltersByIndex: axesToBeFixed };\n}\n\nfunction stringifyColumn(value: ColumnAsSourceAndFixedAxes): PlAdvancedFilterColumnId {\n if (Object.keys(value.axisFiltersByIndex).length === 0) {\n return value.source;\n }\n return stringifyColumnId({\n source: parseColumnId(value.source as SUniversalPColumnId) as AnchoredPColumnId,\n axisFilters: Object.entries(value.axisFiltersByIndex).map(\n ([idx, value]) => [Number(idx), value] as AxisFilterByIdx,\n ),\n });\n}\n\nconst columnAsSourceAndFixedAxes = computed({\n get: () => {\n return getColumnAsSourceAndFixedAxes(filter.value.column);\n },\n set: (value) => {\n filter.value.column = stringifyColumn(value);\n },\n});\nfunction updateAxisFilterValue(idx: number, value: AxisFilterValue | undefined) {\n columnAsSourceAndFixedAxes.value = {\n ...columnAsSourceAndFixedAxes.value,\n axisFiltersByIndex: { ...columnAsSourceAndFixedAxes.value.axisFiltersByIndex, [idx]: value },\n };\n}\n\nconst currentOption = computed(() =>\n props.columnOptions.find((op) => op.id === columnAsSourceAndFixedAxes.value.source),\n);\nconst currentSpec = computed(() =>\n currentOption.value?.spec ? getNormalizedSpec(currentOption.value.spec) : null,\n);\nconst currentType = computed(() => currentSpec.value?.valueType);\nconst currentError = computed(\n () => Boolean(currentOption.value?.error) || inconsistentSourceSelected.value,\n);\n\nconst filterTypesOptions = computed(() =>\n props.supportedFilters\n .filter(\n (v) =>\n filter.value.type === v ||\n (currentSpec.value ? getFilterInfo(v).supportedFor(currentSpec.value) : true),\n )\n .map((v) => ({ value: v, label: getFilterInfo(v).label })),\n);\n\nconst wildcardOptions = computed(() => {\n if (filter.value.type !== \"patternFuzzyContainSubsequence\") {\n return [];\n }\n if (currentOption.value?.alphabet === \"nucleotide\") {\n return [{ label: \"N\", value: \"N\" }];\n }\n if (currentOption.value?.alphabet === \"aminoacid\") {\n return [{ label: \"X\", value: \"X\" }];\n }\n return [...new Set(filter.value.value.split(\"\"))].sort().map((v) => ({ value: v, label: v }));\n});\n\nconst stringMatchesError = computed(() => {\n if (filter.value.type !== \"patternMatchesRegularExpression\") {\n return false;\n }\n try {\n new RegExp(filter.value.value);\n return false;\n } catch {\n return true;\n }\n});\n</script>\n<template>\n <div :class=\"$style.filterWrapper\">\n <!-- top element - column selector / column label - for all filter types-->\n <div\n v-if=\"enableDnd\"\n :class=\"[$style.top, $style.columnChip, { [$style.error]: currentError }]\"\n >\n <div :class=\"[$style.typeIcon, { [$style.error]: currentError }]\">\n <PlIcon16 v-if=\"currentError\" name=\"warning\" />\n <PlIcon16\n v-else\n :name=\"\n currentType === 'String' || currentType === undefined\n ? 'cell-type-txt'\n : 'cell-type-num'\n \"\n />\n </div>\n <div :class=\"$style.titleWrapper\" :title=\"currentOption?.label ?? ''\">\n <div :class=\"$style.title\">\n {{\n inconsistentSourceSelected\n ? \"Inconsistent value\"\n : (currentOption?.label ?? filter.column)\n }}\n </div>\n </div>\n <div :class=\"$style.closeIcon\" @click=\"onDelete(filter.column)\">\n <PlIcon16 name=\"close\" />\n </div>\n </div>\n <div v-else :class=\"$style.top\">\n <PlDropdown\n v-model=\"columnAsSourceAndFixedAxes.source\"\n :errorStatus=\"currentError\"\n :options=\"sourceOptions\"\n :style=\"{ width: '100%' }\"\n group-position=\"top-left\"\n @update:model-value=\"changeSourceId\"\n />\n <div :class=\"$style.closeButton\" @click=\"onDelete(filter.column)\">\n <PlIcon16 name=\"close\" />\n </div>\n </div>\n\n <div v-if=\"currentOption?.axesToBeFixed?.length\" :class=\"$style.fixedAxesBlock\">\n <template v-for=\"value in currentOption?.axesToBeFixed\" :key=\"value.idx\">\n <PlAutocomplete\n v-model=\"columnAsSourceAndFixedAxes.axisFiltersByIndex[value.idx]\"\n :label=\"value.label\"\n :options-search=\"\n (str, type) =>\n getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str, value.idx)\n \"\n :disabled=\"inconsistentSourceSelected\"\n :clearable=\"true\"\n @update:model-value=\"(v) => updateAxisFilterValue(value.idx, v)\"\n />\n </template>\n </div>\n\n <!-- middle - filter type selector - for all filter types -->\n <div\n :class=\"filter.type === 'isNA' || filter.type === 'isNotNA' ? $style.bottom : $style.middle\"\n >\n <PlDropdown\n v-model=\"filter.type\"\n :options=\"filterTypesOptions\"\n :group-position=\"filter.type === 'isNA' || filter.type === 'isNotNA' ? 'bottom' : 'middle'\"\n @update:model-value=\"changeFilterType\"\n />\n </div>\n\n <!-- middle - for fuzzy contains filter -->\n <template v-if=\"filter.type === 'patternFuzzyContainSubsequence'\">\n <div :class=\"$style.middle\">\n <PlTextField v-model=\"filter.value\" placeholder=\"Substring\" group-position=\"middle\" />\n </div>\n <div :class=\"$style.innerSection\">\n <Slider\n v-model=\"filter.maxEdits\"\n :max=\"5\"\n breakpoints\n label=\"Maximum number of substitutions and indels\"\n />\n <PlToggleSwitch v-model=\"filter.substitutionsOnly\" label=\"Substitutions only\" />\n </div>\n </template>\n\n <!-- bottom element - individual settings for every filter type -->\n <div :class=\"$style.bottom\">\n <template v-if=\"filter.type === 'patternEquals' || filter.type === 'patternNotEquals'\">\n <PlAutocomplete\n v-model=\"filter.value\"\n :options-search=\"\n (str, type) => getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str)\n \"\n :disabled=\"inconsistentSourceSelected\"\n :clearable=\"true\"\n group-position=\"bottom\"\n />\n </template>\n <template v-if=\"filter.type === 'inSet' || filter.type === 'notInSet'\">\n <PlAutocompleteMulti\n v-model=\"filter.value\"\n :options-search=\"\n (str, type) => getMultiSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str)\n \"\n :disabled=\"inconsistentSourceSelected\"\n group-position=\"bottom\"\n />\n </template>\n <PlNumberField v-if=\"isNumericFilter(filter)\" v-model=\"filter.x\" group-position=\"bottom\" />\n <PlNumberField v-if=\"isPositionFilter(filter)\" v-model=\"filter.n\" group-position=\"bottom\" />\n <PlTextField\n v-if=\"\n filter.type === 'patternContainSubsequence' ||\n filter.type === 'patternNotContainSubsequence'\n \"\n v-model=\"filter.value\"\n placeholder=\"Substring\"\n group-position=\"bottom\"\n />\n <PlTextField\n v-if=\"filter.type === 'patternMatchesRegularExpression'\"\n v-model=\"filter.value\"\n :error=\"stringMatchesError ? 'Regular expression is not valid' : undefined\"\n placeholder=\"Regular expression\"\n group-position=\"bottom\"\n />\n <PlDropdown\n v-if=\"filter.type === 'patternFuzzyContainSubsequence'\"\n v-model=\"filter.wildcard\"\n clearable\n placeholder=\"Wildcard value\"\n :options=\"wildcardOptions\"\n group-position=\"bottom\"\n />\n </div>\n </div>\n <OperandButton :active=\"operand\" :disabled=\"isLast\" :on-select=\"onChangeOperand\" />\n</template>\n\n<style module>\n.filterWrapper {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: default;\n}\n\n.typeIcon {\n display: inline-flex;\n margin-right: 8px;\n}\n\n.typeIcon.error {\n --icon-color: var(--txt-error);\n}\n\n.closeIcon {\n display: inline-flex;\n margin-left: 12px;\n cursor: pointer;\n}\n\n.titleWrapper {\n flex-grow: 1;\n overflow: hidden;\n}\n.title {\n overflow: hidden;\n color: var(--txt-01);\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n}\n\n.columnChip {\n width: 100%;\n display: flex;\n padding: 10px 12px;\n align-items: center;\n border-radius: 6px;\n border: 1px solid var(--txt-01);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n &.error {\n border-color: var(--txt-error);\n }\n}\n\n.innerSection {\n border: 1px solid var(--txt-01);\n border-top: none;\n padding: 16px 12px;\n}\n\n.closeButton {\n border: 1px solid var(--txt-01);\n border-top-right-radius: 6px;\n border-left: none;\n width: 40px;\n height: 40px;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n cursor: pointer;\n}\n\n.top {\n position: relative;\n display: flex;\n width: 100%;\n z-index: 1;\n background: #fff;\n}\n\n.fixedAxesBlock {\n position: relative;\n display: flex;\n flex-direction: column;\n padding: 12px 8px;\n gap: 12px;\n border-left: 1px solid var(--txt-01);\n border-right: 1px solid var(--txt-01);\n}\n\n.fixedAxesBlock > * {\n background: #fff;\n}\n\n.middle,\n.bottom {\n position: relative;\n margin-top: -1px;\n background: #fff;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"FilterEditor.js","names":[],"sources":["../../../src/components/PlAdvancedFilter/FilterEditor.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n PlAutocomplete,\n PlAutocompleteMulti,\n PlDropdown,\n PlIcon16,\n PlNumberField,\n PlTextField,\n PlToggleSwitch,\n Slider,\n} from \"@milaboratories/uikit\";\nimport type {\n AnchoredPColumnId,\n AxisFilterByIdx,\n AxisFilterValue,\n SUniversalPColumnId,\n} from \"@platforma-sdk/model\";\nimport {\n isFilteredPColumn,\n parseColumnId,\n stringifyColumnId,\n type ListOptionBase,\n} from \"@platforma-sdk/model\";\nimport { computed } from \"vue\";\nimport type { SUPPORTED_FILTER_TYPES } from \"./constants\";\nimport { DEFAULT_FILTER_TYPE, DEFAULT_FILTERS } from \"./constants\";\nimport OperandButton from \"./OperandButton.vue\";\nimport type { EditableFilter, Operand, PlAdvancedFilterColumnId, SourceOptionInfo } from \"./types\";\nimport { getFilterInfo, getNormalizedSpec, isNumericFilter, isPositionFilter } from \"./utils\";\n\nconst filter = defineModel<EditableFilter>(\"filter\", { required: true });\n\nconst props = defineProps<{\n isLast: boolean;\n operand: Operand;\n enableDnd: boolean;\n columnOptions: SourceOptionInfo[];\n supportedFilters: typeof SUPPORTED_FILTER_TYPES;\n getSuggestOptions: (params: {\n columnId: PlAdvancedFilterColumnId;\n axisIdx?: number;\n searchType: \"value\" | \"label\";\n searchStr: string;\n }) => ListOptionBase<string | number>[] | Promise<ListOptionBase<string | number>[]>;\n onDelete: (columnId: PlAdvancedFilterColumnId) => void;\n onChangeOperand: (op: Operand) => void;\n}>();\n\nasync function getSuggestOptionsFn(\n id: PlAdvancedFilterColumnId,\n type: \"value\" | \"label\",\n str: string,\n axisIdx?: number,\n): Promise<ListOptionBase<string>[]> {\n return props.getSuggestOptions({\n columnId: id,\n axisIdx,\n searchType: type,\n searchStr: str,\n }) as Promise<ListOptionBase<string>[]>;\n}\n\nasync function getMultiSuggestOptionsFn(\n id: PlAdvancedFilterColumnId,\n type: \"value\" | \"label\",\n str: string | string[],\n axisIdx?: number,\n): Promise<ListOptionBase<string>[]> {\n if (type === \"label\" && typeof str === \"string\") {\n return getSuggestOptionsFn(id, type, str, axisIdx);\n }\n if (type === \"value\" && Array.isArray(str)) {\n const results = await Promise.all(str.map((s) => getSuggestOptionsFn(id, type, s, axisIdx)));\n return results.map((x) => x[0]);\n }\n throw new Error(\"Invalid arguments combination\");\n}\n\ntype Entries<T> = { [K in keyof T]: [K, T[K]] }[keyof T][];\nfunction changeFilterType() {\n const defaultFilter = DEFAULT_FILTERS[filter.value.type];\n\n filter.value = (Object.entries(defaultFilter) as Entries<EditableFilter>).reduce(\n (res, [key, val]) => {\n res[key] = filter.value[key] ?? val;\n return res;\n },\n {} as Record<keyof EditableFilter, EditableFilter[keyof EditableFilter]>,\n ) as EditableFilter;\n}\n\nfunction changeSourceId(newSourceId?: PlAdvancedFilterColumnId) {\n if (!newSourceId) {\n return;\n }\n const newSourceInfo = props.columnOptions.find((v) => v.id === getSourceId(newSourceId));\n if (!newSourceInfo) {\n return;\n }\n const filterInfo = getFilterInfo(filter.value.type);\n const newSourceSpec = getNormalizedSpec(newSourceInfo?.spec);\n if (filterInfo.supportedFor(newSourceSpec)) {\n // don't do anything except update source id\n filter.value.column = newSourceId;\n } else {\n // reset to default filter which fits to any column\n filter.value = {\n ...DEFAULT_FILTERS[DEFAULT_FILTER_TYPE],\n column: newSourceId,\n };\n }\n}\n\nconst inconsistentSourceSelected = computed(() => {\n const selectedOption = props.columnOptions.find(\n (op) => op.id === getSourceId(filter.value.column),\n );\n return selectedOption === undefined;\n});\nconst sourceOptions = computed(() => {\n const options = props.columnOptions.map((v) => ({ value: v.id, label: v.label ?? v }));\n if (inconsistentSourceSelected.value) {\n options.unshift({ value: filter.value.column, label: \"Inconsistent value\" });\n }\n return options;\n});\n\nfunction getSourceId(column: PlAdvancedFilterColumnId): PlAdvancedFilterColumnId {\n try {\n const parsedColumnId = parseColumnId(column as SUniversalPColumnId);\n if (isFilteredPColumn(parsedColumnId)) {\n return stringifyColumnId(parsedColumnId.source);\n } else {\n return column;\n }\n } catch {\n return column;\n }\n}\n\n// similar to FilteredPColumnId but source is stringified and axis filters can be undefined\ntype ColumnAsSourceAndFixedAxes = {\n source: PlAdvancedFilterColumnId;\n axisFiltersByIndex: Record<number, AxisFilterValue | undefined>;\n};\nfunction getColumnAsSourceAndFixedAxes(\n column: PlAdvancedFilterColumnId,\n): ColumnAsSourceAndFixedAxes {\n const sourceId = getSourceId(column);\n const option = props.columnOptions.find((op) => op.id === sourceId);\n const axesToBeFixed = (option?.axesToBeFixed ?? []).reduce(\n (res, item) => {\n res[item.idx] = undefined;\n return res;\n },\n {} as Record<number, AxisFilterValue | undefined>,\n );\n try {\n const parsedColumnId = parseColumnId(column as SUniversalPColumnId);\n if (isFilteredPColumn(parsedColumnId)) {\n return {\n source: sourceId,\n axisFiltersByIndex: parsedColumnId.axisFilters.reduce((res, item) => {\n res[item[0]] = item[1];\n return res;\n }, axesToBeFixed),\n };\n }\n } catch {\n return { source: column, axisFiltersByIndex: axesToBeFixed };\n }\n return { source: column, axisFiltersByIndex: axesToBeFixed };\n}\n\nfunction stringifyColumn(value: ColumnAsSourceAndFixedAxes): PlAdvancedFilterColumnId {\n if (Object.keys(value.axisFiltersByIndex).length === 0) {\n return value.source;\n }\n return stringifyColumnId({\n source: parseColumnId(value.source as SUniversalPColumnId) as AnchoredPColumnId,\n axisFilters: Object.entries(value.axisFiltersByIndex).map(\n ([idx, value]) => [Number(idx), value] as AxisFilterByIdx,\n ),\n });\n}\n\nconst columnAsSourceAndFixedAxes = computed({\n get: () => {\n return getColumnAsSourceAndFixedAxes(filter.value.column);\n },\n set: (value) => {\n filter.value.column = stringifyColumn(value);\n },\n});\nfunction updateAxisFilterValue(idx: number, value: AxisFilterValue | undefined) {\n columnAsSourceAndFixedAxes.value = {\n ...columnAsSourceAndFixedAxes.value,\n axisFiltersByIndex: { ...columnAsSourceAndFixedAxes.value.axisFiltersByIndex, [idx]: value },\n };\n}\n\nconst currentOption = computed(() =>\n props.columnOptions.find((op) => op.id === columnAsSourceAndFixedAxes.value.source),\n);\nconst currentSpec = computed(() =>\n currentOption.value?.spec ? getNormalizedSpec(currentOption.value.spec) : null,\n);\nconst currentType = computed(() => currentSpec.value?.valueType);\nconst currentError = computed(\n () => Boolean(currentOption.value?.error) || inconsistentSourceSelected.value,\n);\n\nconst filterTypesOptions = computed(() =>\n props.supportedFilters\n .filter(\n (v) =>\n filter.value.type === v ||\n (currentSpec.value ? getFilterInfo(v).supportedFor(currentSpec.value) : true),\n )\n .map((v) => ({ value: v, label: getFilterInfo(v).label })),\n);\n\nconst wildcardOptions = computed(() => {\n if (filter.value.type !== \"patternFuzzyContainSubsequence\") {\n return [];\n }\n if (currentOption.value?.alphabet === \"nucleotide\") {\n return [{ label: \"N\", value: \"N\" }];\n }\n if (currentOption.value?.alphabet === \"aminoacid\") {\n return [{ label: \"X\", value: \"X\" }];\n }\n return [...new Set(filter.value.value.split(\"\"))].sort().map((v) => ({ value: v, label: v }));\n});\n\nconst stringMatchesError = computed(() => {\n if (filter.value.type !== \"patternMatchesRegularExpression\") {\n return false;\n }\n try {\n new RegExp(filter.value.value);\n return false;\n } catch {\n return true;\n }\n});\n</script>\n<template>\n <div :class=\"$style.filterWrapper\">\n <!-- top element - column selector / column label - for all filter types-->\n <div\n v-if=\"enableDnd\"\n :class=\"[$style.top, $style.columnChip, { [$style.error]: currentError }]\"\n >\n <div :class=\"[$style.typeIcon, { [$style.error]: currentError }]\">\n <PlIcon16 v-if=\"currentError\" name=\"warning\" />\n <PlIcon16\n v-else\n :name=\"\n currentType === 'String' || currentType === undefined\n ? 'cell-type-txt'\n : 'cell-type-num'\n \"\n />\n </div>\n <div :class=\"$style.titleWrapper\" :title=\"currentOption?.label ?? ''\">\n <div :class=\"$style.title\">\n {{\n inconsistentSourceSelected\n ? \"Inconsistent value\"\n : (currentOption?.label ?? filter.column)\n }}\n </div>\n </div>\n <div :class=\"$style.closeIcon\" @click=\"onDelete(filter.column)\">\n <PlIcon16 name=\"close\" />\n </div>\n </div>\n <div v-else :class=\"$style.top\">\n <PlDropdown\n v-model=\"columnAsSourceAndFixedAxes.source\"\n :errorStatus=\"currentError\"\n :options=\"sourceOptions\"\n :style=\"{ width: '100%' }\"\n group-position=\"top-left\"\n @update:model-value=\"changeSourceId\"\n />\n <div :class=\"$style.closeButton\" @click=\"onDelete(filter.column)\">\n <PlIcon16 name=\"close\" />\n </div>\n </div>\n\n <div v-if=\"currentOption?.axesToBeFixed?.length\" :class=\"$style.fixedAxesBlock\">\n <template v-for=\"value in currentOption?.axesToBeFixed\" :key=\"value.idx\">\n <PlAutocomplete\n v-model=\"columnAsSourceAndFixedAxes.axisFiltersByIndex[value.idx]\"\n :label=\"value.label\"\n :options-search=\"\n (str, type) =>\n getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str, value.idx)\n \"\n :disabled=\"inconsistentSourceSelected\"\n :clearable=\"true\"\n @update:model-value=\"(v) => updateAxisFilterValue(value.idx, v)\"\n />\n </template>\n </div>\n\n <!-- middle - filter type selector - for all filter types -->\n <div\n :class=\"filter.type === 'isNA' || filter.type === 'isNotNA' ? $style.bottom : $style.middle\"\n >\n <PlDropdown\n v-model=\"filter.type\"\n :options=\"filterTypesOptions\"\n :group-position=\"filter.type === 'isNA' || filter.type === 'isNotNA' ? 'bottom' : 'middle'\"\n @update:model-value=\"changeFilterType\"\n />\n </div>\n\n <!-- middle - for fuzzy contains filter -->\n <template v-if=\"filter.type === 'patternFuzzyContainSubsequence'\">\n <div :class=\"$style.middle\">\n <PlTextField v-model=\"filter.value\" placeholder=\"Substring\" group-position=\"middle\" />\n </div>\n <div :class=\"$style.innerSection\">\n <Slider\n v-model=\"filter.maxEdits\"\n :max=\"5\"\n breakpoints\n label=\"Maximum number of substitutions and indels\"\n />\n <PlToggleSwitch v-model=\"filter.substitutionsOnly\" label=\"Substitutions only\" />\n </div>\n </template>\n\n <!-- bottom element - individual settings for every filter type -->\n <div :class=\"$style.bottom\">\n <PlAutocomplete\n v-if=\"filter.type === 'patternEquals' || filter.type === 'patternNotEquals'\"\n v-model=\"filter.value\"\n :options-search=\"\n (str, type) => getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str)\n \"\n :clearable=\"true\"\n group-position=\"bottom\"\n />\n <PlAutocompleteMulti\n v-if=\"filter.type === 'inSet' || filter.type === 'notInSet'\"\n v-model=\"filter.value\"\n :options-search=\"\n (str, type) => getMultiSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str)\n \"\n :disabled=\"inconsistentSourceSelected\"\n group-position=\"bottom\"\n />\n <PlNumberField v-if=\"isNumericFilter(filter)\" v-model=\"filter.x\" group-position=\"bottom\" />\n <PlNumberField v-if=\"isPositionFilter(filter)\" v-model=\"filter.n\" group-position=\"bottom\" />\n <PlTextField\n v-if=\"\n filter.type === 'patternContainSubsequence' ||\n filter.type === 'patternNotContainSubsequence'\n \"\n v-model=\"filter.value\"\n placeholder=\"Substring\"\n group-position=\"bottom\"\n />\n <PlTextField\n v-if=\"filter.type === 'patternMatchesRegularExpression'\"\n v-model=\"filter.value\"\n :error=\"stringMatchesError ? 'Regular expression is not valid' : undefined\"\n placeholder=\"Regular expression\"\n group-position=\"bottom\"\n />\n <PlDropdown\n v-if=\"filter.type === 'patternFuzzyContainSubsequence'\"\n v-model=\"filter.wildcard\"\n clearable\n placeholder=\"Wildcard value\"\n :options=\"wildcardOptions\"\n group-position=\"bottom\"\n />\n </div>\n </div>\n <OperandButton :active=\"operand\" :disabled=\"isLast\" :on-select=\"onChangeOperand\" />\n</template>\n\n<style module>\n.filterWrapper {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: default;\n}\n\n.typeIcon {\n display: inline-flex;\n margin-right: 8px;\n}\n\n.typeIcon.error {\n --icon-color: var(--txt-error);\n}\n\n.closeIcon {\n display: inline-flex;\n margin-left: 12px;\n cursor: pointer;\n}\n\n.titleWrapper {\n flex-grow: 1;\n overflow: hidden;\n}\n.title {\n overflow: hidden;\n color: var(--txt-01);\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n}\n\n.columnChip {\n width: 100%;\n display: flex;\n padding: 10px 12px;\n align-items: center;\n border-radius: 6px;\n border: 1px solid var(--txt-01);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n &.error {\n border-color: var(--txt-error);\n }\n}\n\n.innerSection {\n border: 1px solid var(--txt-01);\n border-top: none;\n padding: 16px 12px;\n}\n\n.closeButton {\n border: 1px solid var(--txt-01);\n border-top-right-radius: 6px;\n border-left: none;\n width: 40px;\n height: 40px;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n cursor: pointer;\n}\n\n.top {\n position: relative;\n display: flex;\n width: 100%;\n z-index: 1;\n background: #fff;\n}\n\n.fixedAxesBlock {\n position: relative;\n display: flex;\n flex-direction: column;\n padding: 12px 8px;\n gap: 12px;\n border-left: 1px solid var(--txt-01);\n border-right: 1px solid var(--txt-01);\n}\n\n.fixedAxesBlock > * {\n background: #fff;\n}\n\n.middle,\n.bottom {\n position: relative;\n margin-top: -1px;\n background: #fff;\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterEditor.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlAdvancedFilter/FilterEditor.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n PlAutocomplete,\n PlAutocompleteMulti,\n PlDropdown,\n PlIcon16,\n PlNumberField,\n PlTextField,\n PlToggleSwitch,\n Slider,\n} from \"@milaboratories/uikit\";\nimport type {\n AnchoredPColumnId,\n AxisFilterByIdx,\n AxisFilterValue,\n SUniversalPColumnId,\n} from \"@platforma-sdk/model\";\nimport {\n isFilteredPColumn,\n parseColumnId,\n stringifyColumnId,\n type ListOptionBase,\n} from \"@platforma-sdk/model\";\nimport { computed } from \"vue\";\nimport type { SUPPORTED_FILTER_TYPES } from \"./constants\";\nimport { DEFAULT_FILTER_TYPE, DEFAULT_FILTERS } from \"./constants\";\nimport OperandButton from \"./OperandButton.vue\";\nimport type { EditableFilter, Operand, PlAdvancedFilterColumnId, SourceOptionInfo } from \"./types\";\nimport { getFilterInfo, getNormalizedSpec, isNumericFilter, isPositionFilter } from \"./utils\";\n\nconst filter = defineModel<EditableFilter>(\"filter\", { required: true });\n\nconst props = defineProps<{\n isLast: boolean;\n operand: Operand;\n enableDnd: boolean;\n columnOptions: SourceOptionInfo[];\n supportedFilters: typeof SUPPORTED_FILTER_TYPES;\n getSuggestOptions: (params: {\n columnId: PlAdvancedFilterColumnId;\n axisIdx?: number;\n searchType: \"value\" | \"label\";\n searchStr: string;\n }) => ListOptionBase<string | number>[] | Promise<ListOptionBase<string | number>[]>;\n onDelete: (columnId: PlAdvancedFilterColumnId) => void;\n onChangeOperand: (op: Operand) => void;\n}>();\n\nasync function getSuggestOptionsFn(\n id: PlAdvancedFilterColumnId,\n type: \"value\" | \"label\",\n str: string,\n axisIdx?: number,\n): Promise<ListOptionBase<string>[]> {\n return props.getSuggestOptions({\n columnId: id,\n axisIdx,\n searchType: type,\n searchStr: str,\n }) as Promise<ListOptionBase<string>[]>;\n}\n\nasync function getMultiSuggestOptionsFn(\n id: PlAdvancedFilterColumnId,\n type: \"value\" | \"label\",\n str: string | string[],\n axisIdx?: number,\n): Promise<ListOptionBase<string>[]> {\n if (type === \"label\" && typeof str === \"string\") {\n return getSuggestOptionsFn(id, type, str, axisIdx);\n }\n if (type === \"value\" && Array.isArray(str)) {\n const results = await Promise.all(str.map((s) => getSuggestOptionsFn(id, type, s, axisIdx)));\n return results.map((x) => x[0]);\n }\n throw new Error(\"Invalid arguments combination\");\n}\n\ntype Entries<T> = { [K in keyof T]: [K, T[K]] }[keyof T][];\nfunction changeFilterType() {\n const defaultFilter = DEFAULT_FILTERS[filter.value.type];\n\n filter.value = (Object.entries(defaultFilter) as Entries<EditableFilter>).reduce(\n (res, [key, val]) => {\n res[key] = filter.value[key] ?? val;\n return res;\n },\n {} as Record<keyof EditableFilter, EditableFilter[keyof EditableFilter]>,\n ) as EditableFilter;\n}\n\nfunction changeSourceId(newSourceId?: PlAdvancedFilterColumnId) {\n if (!newSourceId) {\n return;\n }\n const newSourceInfo = props.columnOptions.find((v) => v.id === getSourceId(newSourceId));\n if (!newSourceInfo) {\n return;\n }\n const filterInfo = getFilterInfo(filter.value.type);\n const newSourceSpec = getNormalizedSpec(newSourceInfo?.spec);\n if (filterInfo.supportedFor(newSourceSpec)) {\n // don't do anything except update source id\n filter.value.column = newSourceId;\n } else {\n // reset to default filter which fits to any column\n filter.value = {\n ...DEFAULT_FILTERS[DEFAULT_FILTER_TYPE],\n column: newSourceId,\n };\n }\n}\n\nconst inconsistentSourceSelected = computed(() => {\n const selectedOption = props.columnOptions.find(\n (op) => op.id === getSourceId(filter.value.column),\n );\n return selectedOption === undefined;\n});\nconst sourceOptions = computed(() => {\n const options = props.columnOptions.map((v) => ({ value: v.id, label: v.label ?? v }));\n if (inconsistentSourceSelected.value) {\n options.unshift({ value: filter.value.column, label: \"Inconsistent value\" });\n }\n return options;\n});\n\nfunction getSourceId(column: PlAdvancedFilterColumnId): PlAdvancedFilterColumnId {\n try {\n const parsedColumnId = parseColumnId(column as SUniversalPColumnId);\n if (isFilteredPColumn(parsedColumnId)) {\n return stringifyColumnId(parsedColumnId.source);\n } else {\n return column;\n }\n } catch {\n return column;\n }\n}\n\n// similar to FilteredPColumnId but source is stringified and axis filters can be undefined\ntype ColumnAsSourceAndFixedAxes = {\n source: PlAdvancedFilterColumnId;\n axisFiltersByIndex: Record<number, AxisFilterValue | undefined>;\n};\nfunction getColumnAsSourceAndFixedAxes(\n column: PlAdvancedFilterColumnId,\n): ColumnAsSourceAndFixedAxes {\n const sourceId = getSourceId(column);\n const option = props.columnOptions.find((op) => op.id === sourceId);\n const axesToBeFixed = (option?.axesToBeFixed ?? []).reduce(\n (res, item) => {\n res[item.idx] = undefined;\n return res;\n },\n {} as Record<number, AxisFilterValue | undefined>,\n );\n try {\n const parsedColumnId = parseColumnId(column as SUniversalPColumnId);\n if (isFilteredPColumn(parsedColumnId)) {\n return {\n source: sourceId,\n axisFiltersByIndex: parsedColumnId.axisFilters.reduce((res, item) => {\n res[item[0]] = item[1];\n return res;\n }, axesToBeFixed),\n };\n }\n } catch {\n return { source: column, axisFiltersByIndex: axesToBeFixed };\n }\n return { source: column, axisFiltersByIndex: axesToBeFixed };\n}\n\nfunction stringifyColumn(value: ColumnAsSourceAndFixedAxes): PlAdvancedFilterColumnId {\n if (Object.keys(value.axisFiltersByIndex).length === 0) {\n return value.source;\n }\n return stringifyColumnId({\n source: parseColumnId(value.source as SUniversalPColumnId) as AnchoredPColumnId,\n axisFilters: Object.entries(value.axisFiltersByIndex).map(\n ([idx, value]) => [Number(idx), value] as AxisFilterByIdx,\n ),\n });\n}\n\nconst columnAsSourceAndFixedAxes = computed({\n get: () => {\n return getColumnAsSourceAndFixedAxes(filter.value.column);\n },\n set: (value) => {\n filter.value.column = stringifyColumn(value);\n },\n});\nfunction updateAxisFilterValue(idx: number, value: AxisFilterValue | undefined) {\n columnAsSourceAndFixedAxes.value = {\n ...columnAsSourceAndFixedAxes.value,\n axisFiltersByIndex: { ...columnAsSourceAndFixedAxes.value.axisFiltersByIndex, [idx]: value },\n };\n}\n\nconst currentOption = computed(() =>\n props.columnOptions.find((op) => op.id === columnAsSourceAndFixedAxes.value.source),\n);\nconst currentSpec = computed(() =>\n currentOption.value?.spec ? getNormalizedSpec(currentOption.value.spec) : null,\n);\nconst currentType = computed(() => currentSpec.value?.valueType);\nconst currentError = computed(\n () => Boolean(currentOption.value?.error) || inconsistentSourceSelected.value,\n);\n\nconst filterTypesOptions = computed(() =>\n props.supportedFilters\n .filter(\n (v) =>\n filter.value.type === v ||\n (currentSpec.value ? getFilterInfo(v).supportedFor(currentSpec.value) : true),\n )\n .map((v) => ({ value: v, label: getFilterInfo(v).label })),\n);\n\nconst wildcardOptions = computed(() => {\n if (filter.value.type !== \"patternFuzzyContainSubsequence\") {\n return [];\n }\n if (currentOption.value?.alphabet === \"nucleotide\") {\n return [{ label: \"N\", value: \"N\" }];\n }\n if (currentOption.value?.alphabet === \"aminoacid\") {\n return [{ label: \"X\", value: \"X\" }];\n }\n return [...new Set(filter.value.value.split(\"\"))].sort().map((v) => ({ value: v, label: v }));\n});\n\nconst stringMatchesError = computed(() => {\n if (filter.value.type !== \"patternMatchesRegularExpression\") {\n return false;\n }\n try {\n new RegExp(filter.value.value);\n return false;\n } catch {\n return true;\n }\n});\n</script>\n<template>\n <div :class=\"$style.filterWrapper\">\n <!-- top element - column selector / column label - for all filter types-->\n <div\n v-if=\"enableDnd\"\n :class=\"[$style.top, $style.columnChip, { [$style.error]: currentError }]\"\n >\n <div :class=\"[$style.typeIcon, { [$style.error]: currentError }]\">\n <PlIcon16 v-if=\"currentError\" name=\"warning\" />\n <PlIcon16\n v-else\n :name=\"\n currentType === 'String' || currentType === undefined\n ? 'cell-type-txt'\n : 'cell-type-num'\n \"\n />\n </div>\n <div :class=\"$style.titleWrapper\" :title=\"currentOption?.label ?? ''\">\n <div :class=\"$style.title\">\n {{\n inconsistentSourceSelected\n ? \"Inconsistent value\"\n : (currentOption?.label ?? filter.column)\n }}\n </div>\n </div>\n <div :class=\"$style.closeIcon\" @click=\"onDelete(filter.column)\">\n <PlIcon16 name=\"close\" />\n </div>\n </div>\n <div v-else :class=\"$style.top\">\n <PlDropdown\n v-model=\"columnAsSourceAndFixedAxes.source\"\n :errorStatus=\"currentError\"\n :options=\"sourceOptions\"\n :style=\"{ width: '100%' }\"\n group-position=\"top-left\"\n @update:model-value=\"changeSourceId\"\n />\n <div :class=\"$style.closeButton\" @click=\"onDelete(filter.column)\">\n <PlIcon16 name=\"close\" />\n </div>\n </div>\n\n <div v-if=\"currentOption?.axesToBeFixed?.length\" :class=\"$style.fixedAxesBlock\">\n <template v-for=\"value in currentOption?.axesToBeFixed\" :key=\"value.idx\">\n <PlAutocomplete\n v-model=\"columnAsSourceAndFixedAxes.axisFiltersByIndex[value.idx]\"\n :label=\"value.label\"\n :options-search=\"\n (str, type) =>\n getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str, value.idx)\n \"\n :disabled=\"inconsistentSourceSelected\"\n :clearable=\"true\"\n @update:model-value=\"(v) => updateAxisFilterValue(value.idx, v)\"\n />\n </template>\n </div>\n\n <!-- middle - filter type selector - for all filter types -->\n <div\n :class=\"filter.type === 'isNA' || filter.type === 'isNotNA' ? $style.bottom : $style.middle\"\n >\n <PlDropdown\n v-model=\"filter.type\"\n :options=\"filterTypesOptions\"\n :group-position=\"filter.type === 'isNA' || filter.type === 'isNotNA' ? 'bottom' : 'middle'\"\n @update:model-value=\"changeFilterType\"\n />\n </div>\n\n <!-- middle - for fuzzy contains filter -->\n <template v-if=\"filter.type === 'patternFuzzyContainSubsequence'\">\n <div :class=\"$style.middle\">\n <PlTextField v-model=\"filter.value\" placeholder=\"Substring\" group-position=\"middle\" />\n </div>\n <div :class=\"$style.innerSection\">\n <Slider\n v-model=\"filter.maxEdits\"\n :max=\"5\"\n breakpoints\n label=\"Maximum number of substitutions and indels\"\n />\n <PlToggleSwitch v-model=\"filter.substitutionsOnly\" label=\"Substitutions only\" />\n </div>\n </template>\n\n <!-- bottom element - individual settings for every filter type -->\n <div :class=\"$style.bottom\">\n <template v-if=\"filter.type === 'patternEquals' || filter.type === 'patternNotEquals'\">\n <PlAutocomplete\n v-model=\"filter.value\"\n :options-search=\"\n (str, type) => getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str)\n \"\n :disabled=\"inconsistentSourceSelected\"\n :clearable=\"true\"\n group-position=\"bottom\"\n />\n </template>\n <template v-if=\"filter.type === 'inSet' || filter.type === 'notInSet'\">\n <PlAutocompleteMulti\n v-model=\"filter.value\"\n :options-search=\"\n (str, type) => getMultiSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str)\n \"\n :disabled=\"inconsistentSourceSelected\"\n group-position=\"bottom\"\n />\n </template>\n <PlNumberField v-if=\"isNumericFilter(filter)\" v-model=\"filter.x\" group-position=\"bottom\" />\n <PlNumberField v-if=\"isPositionFilter(filter)\" v-model=\"filter.n\" group-position=\"bottom\" />\n <PlTextField\n v-if=\"\n filter.type === 'patternContainSubsequence' ||\n filter.type === 'patternNotContainSubsequence'\n \"\n v-model=\"filter.value\"\n placeholder=\"Substring\"\n group-position=\"bottom\"\n />\n <PlTextField\n v-if=\"filter.type === 'patternMatchesRegularExpression'\"\n v-model=\"filter.value\"\n :error=\"stringMatchesError ? 'Regular expression is not valid' : undefined\"\n placeholder=\"Regular expression\"\n group-position=\"bottom\"\n />\n <PlDropdown\n v-if=\"filter.type === 'patternFuzzyContainSubsequence'\"\n v-model=\"filter.wildcard\"\n clearable\n placeholder=\"Wildcard value\"\n :options=\"wildcardOptions\"\n group-position=\"bottom\"\n />\n </div>\n </div>\n <OperandButton :active=\"operand\" :disabled=\"isLast\" :on-select=\"onChangeOperand\" />\n</template>\n\n<style module>\n.filterWrapper {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: default;\n}\n\n.typeIcon {\n display: inline-flex;\n margin-right: 8px;\n}\n\n.typeIcon.error {\n --icon-color: var(--txt-error);\n}\n\n.closeIcon {\n display: inline-flex;\n margin-left: 12px;\n cursor: pointer;\n}\n\n.titleWrapper {\n flex-grow: 1;\n overflow: hidden;\n}\n.title {\n overflow: hidden;\n color: var(--txt-01);\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n}\n\n.columnChip {\n width: 100%;\n display: flex;\n padding: 10px 12px;\n align-items: center;\n border-radius: 6px;\n border: 1px solid var(--txt-01);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n &.error {\n border-color: var(--txt-error);\n }\n}\n\n.innerSection {\n border: 1px solid var(--txt-01);\n border-top: none;\n padding: 16px 12px;\n}\n\n.closeButton {\n border: 1px solid var(--txt-01);\n border-top-right-radius: 6px;\n border-left: none;\n width: 40px;\n height: 40px;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n cursor: pointer;\n}\n\n.top {\n position: relative;\n display: flex;\n width: 100%;\n z-index: 1;\n background: #fff;\n}\n\n.fixedAxesBlock {\n position: relative;\n display: flex;\n flex-direction: column;\n padding: 12px 8px;\n gap: 12px;\n border-left: 1px solid var(--txt-01);\n border-right: 1px solid var(--txt-01);\n}\n\n.fixedAxesBlock > * {\n background: #fff;\n}\n\n.middle,\n.bottom {\n position: relative;\n margin-top: -1px;\n background: #fff;\n}\n</style>\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"FilterEditor.vue_vue_type_style_index_0_lang.module.js","names":[],"sources":["../../../src/components/PlAdvancedFilter/FilterEditor.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport {\n PlAutocomplete,\n PlAutocompleteMulti,\n PlDropdown,\n PlIcon16,\n PlNumberField,\n PlTextField,\n PlToggleSwitch,\n Slider,\n} from \"@milaboratories/uikit\";\nimport type {\n AnchoredPColumnId,\n AxisFilterByIdx,\n AxisFilterValue,\n SUniversalPColumnId,\n} from \"@platforma-sdk/model\";\nimport {\n isFilteredPColumn,\n parseColumnId,\n stringifyColumnId,\n type ListOptionBase,\n} from \"@platforma-sdk/model\";\nimport { computed } from \"vue\";\nimport type { SUPPORTED_FILTER_TYPES } from \"./constants\";\nimport { DEFAULT_FILTER_TYPE, DEFAULT_FILTERS } from \"./constants\";\nimport OperandButton from \"./OperandButton.vue\";\nimport type { EditableFilter, Operand, PlAdvancedFilterColumnId, SourceOptionInfo } from \"./types\";\nimport { getFilterInfo, getNormalizedSpec, isNumericFilter, isPositionFilter } from \"./utils\";\n\nconst filter = defineModel<EditableFilter>(\"filter\", { required: true });\n\nconst props = defineProps<{\n isLast: boolean;\n operand: Operand;\n enableDnd: boolean;\n columnOptions: SourceOptionInfo[];\n supportedFilters: typeof SUPPORTED_FILTER_TYPES;\n getSuggestOptions: (params: {\n columnId: PlAdvancedFilterColumnId;\n axisIdx?: number;\n searchType: \"value\" | \"label\";\n searchStr: string;\n }) => ListOptionBase<string | number>[] | Promise<ListOptionBase<string | number>[]>;\n onDelete: (columnId: PlAdvancedFilterColumnId) => void;\n onChangeOperand: (op: Operand) => void;\n}>();\n\nasync function getSuggestOptionsFn(\n id: PlAdvancedFilterColumnId,\n type: \"value\" | \"label\",\n str: string,\n axisIdx?: number,\n): Promise<ListOptionBase<string>[]> {\n return props.getSuggestOptions({\n columnId: id,\n axisIdx,\n searchType: type,\n searchStr: str,\n }) as Promise<ListOptionBase<string>[]>;\n}\n\nasync function getMultiSuggestOptionsFn(\n id: PlAdvancedFilterColumnId,\n type: \"value\" | \"label\",\n str: string | string[],\n axisIdx?: number,\n): Promise<ListOptionBase<string>[]> {\n if (type === \"label\" && typeof str === \"string\") {\n return getSuggestOptionsFn(id, type, str, axisIdx);\n }\n if (type === \"value\" && Array.isArray(str)) {\n const results = await Promise.all(str.map((s) => getSuggestOptionsFn(id, type, s, axisIdx)));\n return results.map((x) => x[0]);\n }\n throw new Error(\"Invalid arguments combination\");\n}\n\ntype Entries<T> = { [K in keyof T]: [K, T[K]] }[keyof T][];\nfunction changeFilterType() {\n const defaultFilter = DEFAULT_FILTERS[filter.value.type];\n\n filter.value = (Object.entries(defaultFilter) as Entries<EditableFilter>).reduce(\n (res, [key, val]) => {\n res[key] = filter.value[key] ?? val;\n return res;\n },\n {} as Record<keyof EditableFilter, EditableFilter[keyof EditableFilter]>,\n ) as EditableFilter;\n}\n\nfunction changeSourceId(newSourceId?: PlAdvancedFilterColumnId) {\n if (!newSourceId) {\n return;\n }\n const newSourceInfo = props.columnOptions.find((v) => v.id === getSourceId(newSourceId));\n if (!newSourceInfo) {\n return;\n }\n const filterInfo = getFilterInfo(filter.value.type);\n const newSourceSpec = getNormalizedSpec(newSourceInfo?.spec);\n if (filterInfo.supportedFor(newSourceSpec)) {\n // don't do anything except update source id\n filter.value.column = newSourceId;\n } else {\n // reset to default filter which fits to any column\n filter.value = {\n ...DEFAULT_FILTERS[DEFAULT_FILTER_TYPE],\n column: newSourceId,\n };\n }\n}\n\nconst inconsistentSourceSelected = computed(() => {\n const selectedOption = props.columnOptions.find(\n (op) => op.id === getSourceId(filter.value.column),\n );\n return selectedOption === undefined;\n});\nconst sourceOptions = computed(() => {\n const options = props.columnOptions.map((v) => ({ value: v.id, label: v.label ?? v }));\n if (inconsistentSourceSelected.value) {\n options.unshift({ value: filter.value.column, label: \"Inconsistent value\" });\n }\n return options;\n});\n\nfunction getSourceId(column: PlAdvancedFilterColumnId): PlAdvancedFilterColumnId {\n try {\n const parsedColumnId = parseColumnId(column as SUniversalPColumnId);\n if (isFilteredPColumn(parsedColumnId)) {\n return stringifyColumnId(parsedColumnId.source);\n } else {\n return column;\n }\n } catch {\n return column;\n }\n}\n\n// similar to FilteredPColumnId but source is stringified and axis filters can be undefined\ntype ColumnAsSourceAndFixedAxes = {\n source: PlAdvancedFilterColumnId;\n axisFiltersByIndex: Record<number, AxisFilterValue | undefined>;\n};\nfunction getColumnAsSourceAndFixedAxes(\n column: PlAdvancedFilterColumnId,\n): ColumnAsSourceAndFixedAxes {\n const sourceId = getSourceId(column);\n const option = props.columnOptions.find((op) => op.id === sourceId);\n const axesToBeFixed = (option?.axesToBeFixed ?? []).reduce(\n (res, item) => {\n res[item.idx] = undefined;\n return res;\n },\n {} as Record<number, AxisFilterValue | undefined>,\n );\n try {\n const parsedColumnId = parseColumnId(column as SUniversalPColumnId);\n if (isFilteredPColumn(parsedColumnId)) {\n return {\n source: sourceId,\n axisFiltersByIndex: parsedColumnId.axisFilters.reduce((res, item) => {\n res[item[0]] = item[1];\n return res;\n }, axesToBeFixed),\n };\n }\n } catch {\n return { source: column, axisFiltersByIndex: axesToBeFixed };\n }\n return { source: column, axisFiltersByIndex: axesToBeFixed };\n}\n\nfunction stringifyColumn(value: ColumnAsSourceAndFixedAxes): PlAdvancedFilterColumnId {\n if (Object.keys(value.axisFiltersByIndex).length === 0) {\n return value.source;\n }\n return stringifyColumnId({\n source: parseColumnId(value.source as SUniversalPColumnId) as AnchoredPColumnId,\n axisFilters: Object.entries(value.axisFiltersByIndex).map(\n ([idx, value]) => [Number(idx), value] as AxisFilterByIdx,\n ),\n });\n}\n\nconst columnAsSourceAndFixedAxes = computed({\n get: () => {\n return getColumnAsSourceAndFixedAxes(filter.value.column);\n },\n set: (value) => {\n filter.value.column = stringifyColumn(value);\n },\n});\nfunction updateAxisFilterValue(idx: number, value: AxisFilterValue | undefined) {\n columnAsSourceAndFixedAxes.value = {\n ...columnAsSourceAndFixedAxes.value,\n axisFiltersByIndex: { ...columnAsSourceAndFixedAxes.value.axisFiltersByIndex, [idx]: value },\n };\n}\n\nconst currentOption = computed(() =>\n props.columnOptions.find((op) => op.id === columnAsSourceAndFixedAxes.value.source),\n);\nconst currentSpec = computed(() =>\n currentOption.value?.spec ? getNormalizedSpec(currentOption.value.spec) : null,\n);\nconst currentType = computed(() => currentSpec.value?.valueType);\nconst currentError = computed(\n () => Boolean(currentOption.value?.error) || inconsistentSourceSelected.value,\n);\n\nconst filterTypesOptions = computed(() =>\n props.supportedFilters\n .filter(\n (v) =>\n filter.value.type === v ||\n (currentSpec.value ? getFilterInfo(v).supportedFor(currentSpec.value) : true),\n )\n .map((v) => ({ value: v, label: getFilterInfo(v).label })),\n);\n\nconst wildcardOptions = computed(() => {\n if (filter.value.type !== \"patternFuzzyContainSubsequence\") {\n return [];\n }\n if (currentOption.value?.alphabet === \"nucleotide\") {\n return [{ label: \"N\", value: \"N\" }];\n }\n if (currentOption.value?.alphabet === \"aminoacid\") {\n return [{ label: \"X\", value: \"X\" }];\n }\n return [...new Set(filter.value.value.split(\"\"))].sort().map((v) => ({ value: v, label: v }));\n});\n\nconst stringMatchesError = computed(() => {\n if (filter.value.type !== \"patternMatchesRegularExpression\") {\n return false;\n }\n try {\n new RegExp(filter.value.value);\n return false;\n } catch {\n return true;\n }\n});\n</script>\n<template>\n <div :class=\"$style.filterWrapper\">\n <!-- top element - column selector / column label - for all filter types-->\n <div\n v-if=\"enableDnd\"\n :class=\"[$style.top, $style.columnChip, { [$style.error]: currentError }]\"\n >\n <div :class=\"[$style.typeIcon, { [$style.error]: currentError }]\">\n <PlIcon16 v-if=\"currentError\" name=\"warning\" />\n <PlIcon16\n v-else\n :name=\"\n currentType === 'String' || currentType === undefined\n ? 'cell-type-txt'\n : 'cell-type-num'\n \"\n />\n </div>\n <div :class=\"$style.titleWrapper\" :title=\"currentOption?.label ?? ''\">\n <div :class=\"$style.title\">\n {{\n inconsistentSourceSelected\n ? \"Inconsistent value\"\n : (currentOption?.label ?? filter.column)\n }}\n </div>\n </div>\n <div :class=\"$style.closeIcon\" @click=\"onDelete(filter.column)\">\n <PlIcon16 name=\"close\" />\n </div>\n </div>\n <div v-else :class=\"$style.top\">\n <PlDropdown\n v-model=\"columnAsSourceAndFixedAxes.source\"\n :errorStatus=\"currentError\"\n :options=\"sourceOptions\"\n :style=\"{ width: '100%' }\"\n group-position=\"top-left\"\n @update:model-value=\"changeSourceId\"\n />\n <div :class=\"$style.closeButton\" @click=\"onDelete(filter.column)\">\n <PlIcon16 name=\"close\" />\n </div>\n </div>\n\n <div v-if=\"currentOption?.axesToBeFixed?.length\" :class=\"$style.fixedAxesBlock\">\n <template v-for=\"value in currentOption?.axesToBeFixed\" :key=\"value.idx\">\n <PlAutocomplete\n v-model=\"columnAsSourceAndFixedAxes.axisFiltersByIndex[value.idx]\"\n :label=\"value.label\"\n :options-search=\"\n (str, type) =>\n getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str, value.idx)\n \"\n :disabled=\"inconsistentSourceSelected\"\n :clearable=\"true\"\n @update:model-value=\"(v) => updateAxisFilterValue(value.idx, v)\"\n />\n </template>\n </div>\n\n <!-- middle - filter type selector - for all filter types -->\n <div\n :class=\"filter.type === 'isNA' || filter.type === 'isNotNA' ? $style.bottom : $style.middle\"\n >\n <PlDropdown\n v-model=\"filter.type\"\n :options=\"filterTypesOptions\"\n :group-position=\"filter.type === 'isNA' || filter.type === 'isNotNA' ? 'bottom' : 'middle'\"\n @update:model-value=\"changeFilterType\"\n />\n </div>\n\n <!-- middle - for fuzzy contains filter -->\n <template v-if=\"filter.type === 'patternFuzzyContainSubsequence'\">\n <div :class=\"$style.middle\">\n <PlTextField v-model=\"filter.value\" placeholder=\"Substring\" group-position=\"middle\" />\n </div>\n <div :class=\"$style.innerSection\">\n <Slider\n v-model=\"filter.maxEdits\"\n :max=\"5\"\n breakpoints\n label=\"Maximum number of substitutions and indels\"\n />\n <PlToggleSwitch v-model=\"filter.substitutionsOnly\" label=\"Substitutions only\" />\n </div>\n </template>\n\n <!-- bottom element - individual settings for every filter type -->\n <div :class=\"$style.bottom\">\n <PlAutocomplete\n v-if=\"filter.type === 'patternEquals' || filter.type === 'patternNotEquals'\"\n v-model=\"filter.value\"\n :options-search=\"\n (str, type) => getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str)\n \"\n :clearable=\"true\"\n group-position=\"bottom\"\n />\n <PlAutocompleteMulti\n v-if=\"filter.type === 'inSet' || filter.type === 'notInSet'\"\n v-model=\"filter.value\"\n :options-search=\"\n (str, type) => getMultiSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str)\n \"\n :disabled=\"inconsistentSourceSelected\"\n group-position=\"bottom\"\n />\n <PlNumberField v-if=\"isNumericFilter(filter)\" v-model=\"filter.x\" group-position=\"bottom\" />\n <PlNumberField v-if=\"isPositionFilter(filter)\" v-model=\"filter.n\" group-position=\"bottom\" />\n <PlTextField\n v-if=\"\n filter.type === 'patternContainSubsequence' ||\n filter.type === 'patternNotContainSubsequence'\n \"\n v-model=\"filter.value\"\n placeholder=\"Substring\"\n group-position=\"bottom\"\n />\n <PlTextField\n v-if=\"filter.type === 'patternMatchesRegularExpression'\"\n v-model=\"filter.value\"\n :error=\"stringMatchesError ? 'Regular expression is not valid' : undefined\"\n placeholder=\"Regular expression\"\n group-position=\"bottom\"\n />\n <PlDropdown\n v-if=\"filter.type === 'patternFuzzyContainSubsequence'\"\n v-model=\"filter.wildcard\"\n clearable\n placeholder=\"Wildcard value\"\n :options=\"wildcardOptions\"\n group-position=\"bottom\"\n />\n </div>\n </div>\n <OperandButton :active=\"operand\" :disabled=\"isLast\" :on-select=\"onChangeOperand\" />\n</template>\n\n<style module>\n.filterWrapper {\n position: relative;\n display: flex;\n flex-direction: column;\n width: 100%;\n cursor: default;\n}\n\n.typeIcon {\n display: inline-flex;\n margin-right: 8px;\n}\n\n.typeIcon.error {\n --icon-color: var(--txt-error);\n}\n\n.closeIcon {\n display: inline-flex;\n margin-left: 12px;\n cursor: pointer;\n}\n\n.titleWrapper {\n flex-grow: 1;\n overflow: hidden;\n}\n.title {\n overflow: hidden;\n color: var(--txt-01);\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n}\n\n.columnChip {\n width: 100%;\n display: flex;\n padding: 10px 12px;\n align-items: center;\n border-radius: 6px;\n border: 1px solid var(--txt-01);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n &.error {\n border-color: var(--txt-error);\n }\n}\n\n.innerSection {\n border: 1px solid var(--txt-01);\n border-top: none;\n padding: 16px 12px;\n}\n\n.closeButton {\n border: 1px solid var(--txt-01);\n border-top-right-radius: 6px;\n border-left: none;\n width: 40px;\n height: 40px;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n cursor: pointer;\n}\n\n.top {\n position: relative;\n display: flex;\n width: 100%;\n z-index: 1;\n background: #fff;\n}\n\n.fixedAxesBlock {\n position: relative;\n display: flex;\n flex-direction: column;\n padding: 12px 8px;\n gap: 12px;\n border-left: 1px solid var(--txt-01);\n border-right: 1px solid var(--txt-01);\n}\n\n.fixedAxesBlock > * {\n background: #fff;\n}\n\n.middle,\n.bottom {\n position: relative;\n margin-top: -1px;\n background: #fff;\n}\n</style>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterEditor.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlAdvancedFilter/FilterEditor.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterEditor.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlAdvancedFilter/FilterEditor.vue"],"names":[],"mappings":"AA0fA,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAG1D,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAKnG,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,gBAAgB,EAAE,CAAC;IAClC,gBAAgB,EAAE,OAAO,sBAAsB,CAAC;IAChD,iBAAiB,EAAE,CAAC,MAAM,EAAE;QAC1B,QAAQ,EAAE,wBAAwB,CAAC;QACnC,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC;QAC9B,SAAS,EAAE,MAAM,CAAC;KACnB,KAAK,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;IACrF,QAAQ,EAAE,CAAC,QAAQ,EAAE,wBAAwB,KAAK,IAAI,CAAC;IACvD,eAAe,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;CACxC,CAAC;AA6MF,KAAK,iBAAiB,GAAG;IACzB,QAAQ,EAAE,cAAc,CAAC;CACxB,GAAG,WAAW,CAAC;;;;;;AA8ahB,wBAOG"}
|
|
@@ -219,14 +219,9 @@ var N = ["title"], P = /* @__PURE__ */ m({
|
|
|
219
219
|
modelValue: h.value.value,
|
|
220
220
|
"onUpdate:modelValue": t[7] ||= (e) => h.value.value = e,
|
|
221
221
|
"options-search": (e, t) => F(W.value.source, t, e),
|
|
222
|
-
disabled: z.value,
|
|
223
222
|
clearable: !0,
|
|
224
223
|
"group-position": "bottom"
|
|
225
|
-
}, null, 8, [
|
|
226
|
-
"modelValue",
|
|
227
|
-
"options-search",
|
|
228
|
-
"disabled"
|
|
229
|
-
])) : u("", !0),
|
|
224
|
+
}, null, 8, ["modelValue", "options-search"])) : u("", !0),
|
|
230
225
|
h.value.type === "inSet" || h.value.type === "notInSet" ? (_(), l(b(E), {
|
|
231
226
|
key: 1,
|
|
232
227
|
modelValue: h.value.value,
|