@platforma-sdk/ui-vue 1.91.0 → 1.93.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +6 -6
- package/.turbo/turbo-formatter$colon$check.log +1 -1
- package/.turbo/turbo-linter$colon$check.log +1 -1
- package/CHANGELOG.md +27 -0
- package/dist/components/PlDatasetSelector/PlDatasetSelector.js.map +1 -1
- package/dist/components/PlDatasetSelector/PlDatasetSelector.vue.d.ts.map +1 -1
- package/dist/components/PlDatasetSelector/PlDatasetSelector.vue2.js.map +1 -1
- package/package.json +6 -6
- package/src/components/PlDatasetSelector/PlDatasetSelector.vue +3 -3
- package/src/components/PlDatasetSelector/__tests__/PlDatasetSelector.jsdomtest.ts +16 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -36,7 +36,7 @@ transforming...
|
|
|
36
36
|
rendering chunks...
|
|
37
37
|
[32m
|
|
38
38
|
[36m[unplugin:dts][32m Start generate declaration files...[39m
|
|
39
|
-
[32m[36m[unplugin:dts][32m Declaration files built in
|
|
39
|
+
[32m[36m[unplugin:dts][32m Declaration files built in 4981ms.
|
|
40
40
|
[39m
|
|
41
41
|
computing gzip size...
|
|
42
42
|
dist/components/PlAnnotations/components/PlAnnotations.vue_vue_type_style_index_0_lang.css 0.04 kB │ gzip: 0.06 kB
|
|
@@ -108,7 +108,7 @@ dist/components/PlAgCellProgress/PlAgCellProgress.js
|
|
|
108
108
|
dist/components/PlAgColumnHeader/PlAgColumnHeader.js 0.21 kB │ gzip: 0.16 kB │ map: 3.89 kB
|
|
109
109
|
dist/plugins/Monetization/MonetizationSidebar.js 0.21 kB │ gzip: 0.16 kB │ map: 3.83 kB
|
|
110
110
|
dist/components/PlAgDataTable/PlAgOverlayLoading.js 0.21 kB │ gzip: 0.16 kB │ map: 2.08 kB
|
|
111
|
-
dist/components/PlDatasetSelector/PlDatasetSelector.js 0.21 kB │ gzip: 0.15 kB │ map: 6.
|
|
111
|
+
dist/components/PlDatasetSelector/PlDatasetSelector.js 0.21 kB │ gzip: 0.15 kB │ map: 6.53 kB
|
|
112
112
|
dist/components/PlTableFastSearch/PlTableFastSearch.js 0.21 kB │ gzip: 0.16 kB │ map: 1.54 kB
|
|
113
113
|
dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.js 0.22 kB │ gzip: 0.16 kB │ map: 2.05 kB
|
|
114
114
|
dist/components/PlAgDataTable/sources/menu-items.js 0.23 kB │ gzip: 0.19 kB │ map: 0.48 kB
|
|
@@ -244,7 +244,7 @@ dist/components/PlAppErrorNotificationAlert/PlAppErrorNotificationAlert.vue_vue_
|
|
|
244
244
|
dist/components/PlAgDataTable/compositions/useGrid.js 2.89 kB │ gzip: 1.28 kB │ map: 6.96 kB
|
|
245
245
|
dist/components/PlAgDataTable/sources/row-number.js 2.99 kB │ gzip: 1.30 kB │ map: 8.15 kB
|
|
246
246
|
dist/components/PlAgCsvExporter/export-csv.js 3.14 kB │ gzip: 1.40 kB │ map: 11.61 kB
|
|
247
|
-
dist/components/PlDatasetSelector/PlDatasetSelector.vue_vue_type_script_setup_true_lang.js 3.18 kB │ gzip: 1.26 kB │ map:
|
|
247
|
+
dist/components/PlDatasetSelector/PlDatasetSelector.vue_vue_type_script_setup_true_lang.js 3.18 kB │ gzip: 1.26 kB │ map: 9.00 kB
|
|
248
248
|
dist/plugins/Monetization/LimitCard.vue_vue_type_script_setup_true_lang.js 3.28 kB │ gzip: 1.14 kB │ map: 9.80 kB
|
|
249
249
|
dist/components/PlAgDataTable/PlAgDataTableSheets.vue_vue_type_script_setup_true_lang.js 3.30 kB │ gzip: 1.35 kB │ map: 7.89 kB
|
|
250
250
|
dist/components/PlBlockDependencies/PlBlockDependencies.vue_vue_type_script_setup_true_lang.js 3.35 kB │ gzip: 1.42 kB │ map: 7.27 kB
|
|
@@ -267,10 +267,10 @@ dist/components/PlAdvancedFilter/PlAdvancedFilter.vue_vue_type_script_setup_true
|
|
|
267
267
|
dist/components/PlAdvancedFilter/FilterEditor.vue_vue_type_script_setup_true_lang.js 11.71 kB │ gzip: 3.31 kB │ map: 28.56 kB
|
|
268
268
|
dist/components/PlAgDataTable/PlAgDataTableV2.vue_vue_type_script_setup_true_lang.js 12.75 kB │ gzip: 4.05 kB │ map: 35.01 kB
|
|
269
269
|
|
|
270
|
-
[32m✓ built in 5.
|
|
271
|
-
[33m[33m[PLUGIN_TIMINGS] [0mJavaScript callbacks ran for 5.
|
|
270
|
+
[32m✓ built in 5.75s[39m
|
|
271
|
+
[33m[33m[PLUGIN_TIMINGS] [0mJavaScript callbacks ran for 5.7s of this 5.7s build (99%).
|
|
272
272
|
The slowest callbacks, timed inside each callback (the wait before a callback starts is excluded, the time it awaits is included):
|
|
273
|
-
- plugin unplugin-dts buildStart (
|
|
273
|
+
- plugin unplugin-dts buildStart (83%, 4.8s, 1 call)
|
|
274
274
|
Additional callback time came from the callbacks below and from callbacks under 1s.
|
|
275
275
|
2 callbacks are listed without a time. Their calls overlapped, so the time inside one call includes work from other calls. To find their cost, profile the build with `node --cpu-prof`:
|
|
276
276
|
- plugin sourcemaps load (144 calls)
|
|
@@ -4,5 +4,5 @@ $ ts-builder linter --check
|
|
|
4
4
|
Linting project...
|
|
5
5
|
↳ oxlint --config /home/runner/_work/platforma/platforma/sdk/ui-vue/.oxlintrc.json --deny-warnings
|
|
6
6
|
Found 0 warnings and 0 errors.
|
|
7
|
-
Finished in
|
|
7
|
+
Finished in 29ms on 143 files with 108 rules using 16 threads.
|
|
8
8
|
Linting completed successfully
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @platforma-sdk/ui-vue
|
|
2
2
|
|
|
3
|
+
## 1.93.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1eb87ab: PlFileDialog: new `allowFolders` prop (off by default) lets a multi-file dialog import whole folders. On the "My Computer" tab they are dropped, the same way as files. Folders are walked recursively; hidden files, system entries (`__MACOSX`, `$RECYCLE.BIN`, `System Volume Information`, `lost+found`, `Thumbs.db`, `desktop.ini`, Office `~$` lock files) and files outside the allowed extensions are skipped, on both tabs. On the "Remote" tab in multi-file mode, folders can be selected like files (click, Cmd/Shift-click, Cmd+A); the folder name, its arrow or a double-click opens it. A selected folder is counted in the background, and the selection label shows the number of files, not folders; Import reuses the counts, waiting for unfinished ones with cancel. A selected folder that holds nothing to import, or cannot be read, is named and blocks Import until deselected. Without `allowFolders`, or in single-file mode (and so PlFileInput), folders are not imported on either tab, as before. PlFileDialog reports through callback props instead of emitted events; `v-model` and `@import:files` keep working unchanged. The ls driver now refuses to create an import handle for a folder instead of failing later during import.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [1eb87ab]
|
|
12
|
+
- @milaboratories/uikit@2.18.0
|
|
13
|
+
|
|
14
|
+
## 1.92.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- 067b04b: A dataset's enrichment is named by its column id. `DatasetOption.enrichments` and `DatasetSelection.enrichments` hold `{ id, label }` entries (`DatasetEnrichment`), where `id` is the id of the discovered column. `tableBuilder.addColumn` / `addColumns` take a column id — a block output or a discovered column — and `{ id, label }` entries. `EnrichmentRef`, `EnrichmentStep`, `LabeledEnrichmentRef`, `createEnrichmentRef` and `isEnrichmentRef` are removed; `tableBuilder` no longer takes `{ __isEnrichment: "v1" }` maps. A dataset selection saved with enrichments in the old format has to be picked again.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [de76be5]
|
|
23
|
+
- Updated dependencies [067b04b]
|
|
24
|
+
- @platforma-sdk/model@1.92.0
|
|
25
|
+
- @milaboratories/pl-model-common@1.57.0
|
|
26
|
+
- @milaboratories/uikit@2.17.14
|
|
27
|
+
- @milaboratories/columns-collection-driver@0.3.1
|
|
28
|
+
- @milaboratories/pf-spec-driver@1.6.3
|
|
29
|
+
|
|
3
30
|
## 1.91.0
|
|
4
31
|
|
|
5
32
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlDatasetSelector.js","names":["_sfc_main","PlDatasetSelector_vue_vue_type_script_setup_true_lang_default","PlDatasetSelector_default"],"sources":["../../../src/components/PlDatasetSelector/PlDatasetSelector.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Select a dataset or one of its filters in a single dropdown, emitting a\n * {@link DatasetSelection}. Filter labels carry the dataset name as a\n * prefix (e.g. \"Bulk / Top 10\"), so no separate subtitle is rendered.\n * Enrichments from the matching `DatasetOption` are bundled into the\n * emitted value opaquely — block authors unbundle them in their args\n * resolver.\n */\nexport default {\n name: \"PlDatasetSelector\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport type {\n
|
|
1
|
+
{"version":3,"file":"PlDatasetSelector.js","names":["_sfc_main","PlDatasetSelector_vue_vue_type_script_setup_true_lang_default","PlDatasetSelector_default"],"sources":["../../../src/components/PlDatasetSelector/PlDatasetSelector.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Select a dataset or one of its filters in a single dropdown, emitting a\n * {@link DatasetSelection}. Filter labels carry the dataset name as a\n * prefix (e.g. \"Bulk / Top 10\"), so no separate subtitle is rendered.\n * Enrichments from the matching `DatasetOption` are bundled into the\n * emitted value opaquely — block authors unbundle them in their args\n * resolver.\n */\nexport default {\n name: \"PlDatasetSelector\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport type {\n DatasetEnrichment,\n DatasetOption,\n DatasetSelection,\n PObjectId,\n PlRef,\n} from \"@platforma-sdk/model\";\nimport {\n createDatasetSelection,\n createGlobalPObjectId,\n createPrimaryRef,\n plRefsEqual,\n} from \"@platforma-sdk/model\";\nimport type { ListOption } from \"@milaboratories/uikit\";\nimport { PlDropdown } from \"@milaboratories/uikit\";\nimport { computed } from \"vue\";\nimport { useColumnLinksMissingValue } from \"../ValuePickers/columnLinksMissingValue\";\n\nconst slots = defineSlots<{\n tooltip?: () => unknown;\n}>();\n\nconst model = defineModel<DatasetSelection | undefined>();\n\nconst props = withDefaults(\n defineProps<{\n /** Available datasets, each optionally carrying compatible filter choices. */\n options?: Readonly<DatasetOption[]>;\n /** Label above the dropdown. */\n label?: string;\n /** Helper text below the dropdown (shown when there is no error). */\n helper?: string;\n /** Helper text shown while `options` is undefined (loading). */\n loadingOptionsHelper?: string;\n /** Error message displayed below the dropdown. */\n error?: unknown;\n /** Placeholder when nothing is selected. */\n placeholder?: string;\n /** Show a clear button. */\n clearable?: boolean;\n /** Mark the dropdown as required. */\n required?: boolean;\n /** Disable interaction. */\n disabled?: boolean;\n }>(),\n {\n options: undefined,\n label: undefined,\n helper: undefined,\n loadingOptionsHelper: undefined,\n error: undefined,\n placeholder: \"...\",\n clearable: false,\n required: false,\n disabled: false,\n },\n);\n\ntype Selection = { primary: PlRef; filter?: PlRef; enrichments?: readonly DatasetEnrichment[] };\n\n// `deepEqual` (used by PlDropdown for matching) treats `{a, b: undefined}` and\n// `{a}` as different shapes, so the option list and the selection value must\n// agree on optional-key presence.\nfunction makeSelection(\n primary: PlRef,\n filter: PlRef | undefined,\n enrichments: readonly DatasetEnrichment[] | undefined,\n): Selection {\n return {\n primary,\n ...(filter !== undefined && { filter }),\n ...(enrichments !== undefined && enrichments.length > 0 && { enrichments }),\n };\n}\n\nconst selectionValue = computed<Selection | undefined>(() => {\n const primary = model.value?.primary;\n if (primary === undefined) return undefined;\n // Read enrichments from the current option, not from `model.value`: the\n // stored enrichments are a snapshot at selection time and won't match\n // `dropdownOptions` after `props.options` recomputes (e.g. when the\n // result pool gains or loses an enrichment column).\n // The option's ref, not the stored one, for the same reason: a ref stored with\n // a different `requireEnrichments` flag than the options carry (e.g. saved\n // before a block changed its `buildDatasetOptions` mode) would not match any\n // option and the selection would show empty.\n const option = props.options?.find((o) => plRefsEqual(o.primary.ref, primary.column, true));\n return makeSelection(option?.primary.ref ?? primary.column, primary.filter, option?.enrichments);\n});\n\nconst dropdownOptions = computed<ListOption<Selection>[] | undefined>(() => {\n if (props.options === undefined) return undefined;\n const out: ListOption<Selection>[] = [];\n for (const o of props.options) {\n out.push({\n label: o.primary.label,\n value: makeSelection(o.primary.ref, undefined, o.enrichments),\n });\n for (const filter of o.filters ?? []) {\n out.push({\n label: filter.label,\n description: o.primary.label,\n value: makeSelection(o.primary.ref, filter.ref, o.enrichments),\n });\n }\n }\n return out;\n});\n\nconst columnLinks = useColumnLinksMissingValue();\n\n/**\n * The column a selection the options lack is shown and explained by: the dataset first, as the\n * filter of a missing dataset is missing with it, then the filter; `undefined` when the column\n * links tell nothing about either.\n */\nfunction explainedColumn(): PObjectId | undefined {\n const primary = model.value?.primary;\n if (columnLinks === undefined || primary === undefined) return undefined;\n const refs = primary.filter === undefined ? [primary.column] : [primary.column, primary.filter];\n return refs\n .map((ref) => createGlobalPObjectId(ref.blockId, ref.name))\n .find((column) => columnLinks.tooltip(column) !== undefined);\n}\n\nconst missingValueLabel = () => {\n const column = explainedColumn();\n return column === undefined ? undefined : columnLinks?.label(column);\n};\n\nconst missingValueTooltip = () => {\n const column = explainedColumn();\n return column === undefined ? undefined : columnLinks?.tooltip(column);\n};\n\nfunction onChange(selection: Selection | undefined) {\n if (selection === undefined) {\n model.value = undefined;\n return;\n }\n model.value = createDatasetSelection(\n createPrimaryRef(selection.primary, selection.filter),\n selection.enrichments,\n );\n}\n</script>\n\n<template>\n <PlDropdown\n data-testid=\"pl-dataset-selector\"\n :model-value=\"selectionValue\"\n :options=\"dropdownOptions\"\n :label=\"label\"\n :helper=\"helper\"\n :loading-options-helper=\"loadingOptionsHelper\"\n :error=\"error\"\n :placeholder=\"placeholder\"\n :clearable=\"clearable\"\n :required=\"required\"\n :disabled=\"disabled\"\n :missing-value-label=\"missingValueLabel\"\n :missing-value-tooltip=\"missingValueTooltip\"\n @update:model-value=\"onChange\"\n >\n <template v-if=\"slots.tooltip\" #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlDropdown>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlDatasetSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlDatasetSelector/PlDatasetSelector.vue"],"names":[],"mappings":"AA2LA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"PlDatasetSelector.vue.d.ts","sourceRoot":"","sources":["../../../src/components/PlDatasetSelector/PlDatasetSelector.vue"],"names":[],"mappings":"AA2LA,OAAO,KAAK,EAEV,aAAa,EACb,gBAAgB,EAGjB,MAAM,sBAAsB,CAAC;AAa9B;;;;;;;GAOG;wBACkB,OAAO,YAAY;AAAxC,wBAAyC;AAKzC,QAAA,MAAM,YAAY;IASd,8EAA8E;cACpE,QAAQ,CAAC,aAAa,EAAE,CAAC;IACnC,gCAAgC;YACxB,MAAM;IACd,qEAAqE;aAC5D,MAAM;IACf,gEAAgE;2BACzC,MAAM;IAC7B,kDAAkD;YAC1C,OAAO;IACf,4CAA4C;kBAC9B,MAAM;IACpB,2BAA2B;gBACf,OAAO;IACnB,qCAAqC;eAC1B,OAAO;IAClB,2BAA2B;eAChB,OAAO;;iBA2GT,gBAAgB,GAAG,SAAS;;;;IA5HrC,8EAA8E;cACpE,QAAQ,CAAC,aAAa,EAAE,CAAC;IACnC,gCAAgC;YACxB,MAAM;IACd,qEAAqE;aAC5D,MAAM;IACf,gEAAgE;2BACzC,MAAM;IAC7B,kDAAkD;YAC1C,OAAO;IACf,4CAA4C;kBAC9B,MAAM;IACpB,2BAA2B;gBACf,OAAO;IACnB,qCAAqC;eAC1B,OAAO;IAClB,2BAA2B;eAChB,OAAO;;iBA2GT,gBAAgB,GAAG,SAAS;;;;;WAzH7B,MAAM;aAFJ,QAAQ,CAAC,aAAa,EAAE,CAAC;YAI1B,MAAM;0BAEQ,MAAM;iBAIf,MAAM;eAER,OAAO;cAER,OAAO;cAEP,OAAO;;cAxBV,MAAM,OAAO;EA6OrB,CAAC;AAWL,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlDatasetSelector.vue_vue_type_script_setup_true_lang.js","names":["_useSlots","_useModel","_openBlock","_createBlock","_unref","_createSlots","_withCtx","_renderSlot","PlDatasetSelector_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","slots","useSlots","model","useModel","__props","props","makeSelection","filter","enrichments","selectionValue","computed","primary","option","plRefsEqual","o","dropdownOptions","out","columnLinks","useColumnLinksMissingValue","explainedColumn","createGlobalPObjectId","ref","column","missingValueLabel","missingValueTooltip","onChange","selection","createDatasetSelection","createPrimaryRef","openBlock","createBlock","unref","PlDropdown","createSlots","withCtx","renderSlot","_ctx"],"sources":["../../../src/components/PlDatasetSelector/PlDatasetSelector.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Select a dataset or one of its filters in a single dropdown, emitting a\n * {@link DatasetSelection}. Filter labels carry the dataset name as a\n * prefix (e.g. \"Bulk / Top 10\"), so no separate subtitle is rendered.\n * Enrichments from the matching `DatasetOption` are bundled into the\n * emitted value opaquely — block authors unbundle them in their args\n * resolver.\n */\nexport default {\n name: \"PlDatasetSelector\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport type {\n
|
|
1
|
+
{"version":3,"file":"PlDatasetSelector.vue_vue_type_script_setup_true_lang.js","names":["_useSlots","_useModel","_openBlock","_createBlock","_unref","_createSlots","_withCtx","_renderSlot","PlDatasetSelector_vue_vue_type_script_setup_true_lang_default","\"modelValue\"","\"modelModifiers\"","slots","useSlots","model","useModel","__props","props","makeSelection","filter","enrichments","selectionValue","computed","primary","option","plRefsEqual","o","dropdownOptions","out","columnLinks","useColumnLinksMissingValue","explainedColumn","createGlobalPObjectId","ref","column","missingValueLabel","missingValueTooltip","onChange","selection","createDatasetSelection","createPrimaryRef","openBlock","createBlock","unref","PlDropdown","createSlots","withCtx","renderSlot","_ctx"],"sources":["../../../src/components/PlDatasetSelector/PlDatasetSelector.vue"],"sourcesContent":["<script lang=\"ts\">\n/**\n * Select a dataset or one of its filters in a single dropdown, emitting a\n * {@link DatasetSelection}. Filter labels carry the dataset name as a\n * prefix (e.g. \"Bulk / Top 10\"), so no separate subtitle is rendered.\n * Enrichments from the matching `DatasetOption` are bundled into the\n * emitted value opaquely — block authors unbundle them in their args\n * resolver.\n */\nexport default {\n name: \"PlDatasetSelector\",\n};\n</script>\n\n<script lang=\"ts\" setup>\nimport type {\n DatasetEnrichment,\n DatasetOption,\n DatasetSelection,\n PObjectId,\n PlRef,\n} from \"@platforma-sdk/model\";\nimport {\n createDatasetSelection,\n createGlobalPObjectId,\n createPrimaryRef,\n plRefsEqual,\n} from \"@platforma-sdk/model\";\nimport type { ListOption } from \"@milaboratories/uikit\";\nimport { PlDropdown } from \"@milaboratories/uikit\";\nimport { computed } from \"vue\";\nimport { useColumnLinksMissingValue } from \"../ValuePickers/columnLinksMissingValue\";\n\nconst slots = defineSlots<{\n tooltip?: () => unknown;\n}>();\n\nconst model = defineModel<DatasetSelection | undefined>();\n\nconst props = withDefaults(\n defineProps<{\n /** Available datasets, each optionally carrying compatible filter choices. */\n options?: Readonly<DatasetOption[]>;\n /** Label above the dropdown. */\n label?: string;\n /** Helper text below the dropdown (shown when there is no error). */\n helper?: string;\n /** Helper text shown while `options` is undefined (loading). */\n loadingOptionsHelper?: string;\n /** Error message displayed below the dropdown. */\n error?: unknown;\n /** Placeholder when nothing is selected. */\n placeholder?: string;\n /** Show a clear button. */\n clearable?: boolean;\n /** Mark the dropdown as required. */\n required?: boolean;\n /** Disable interaction. */\n disabled?: boolean;\n }>(),\n {\n options: undefined,\n label: undefined,\n helper: undefined,\n loadingOptionsHelper: undefined,\n error: undefined,\n placeholder: \"...\",\n clearable: false,\n required: false,\n disabled: false,\n },\n);\n\ntype Selection = { primary: PlRef; filter?: PlRef; enrichments?: readonly DatasetEnrichment[] };\n\n// `deepEqual` (used by PlDropdown for matching) treats `{a, b: undefined}` and\n// `{a}` as different shapes, so the option list and the selection value must\n// agree on optional-key presence.\nfunction makeSelection(\n primary: PlRef,\n filter: PlRef | undefined,\n enrichments: readonly DatasetEnrichment[] | undefined,\n): Selection {\n return {\n primary,\n ...(filter !== undefined && { filter }),\n ...(enrichments !== undefined && enrichments.length > 0 && { enrichments }),\n };\n}\n\nconst selectionValue = computed<Selection | undefined>(() => {\n const primary = model.value?.primary;\n if (primary === undefined) return undefined;\n // Read enrichments from the current option, not from `model.value`: the\n // stored enrichments are a snapshot at selection time and won't match\n // `dropdownOptions` after `props.options` recomputes (e.g. when the\n // result pool gains or loses an enrichment column).\n // The option's ref, not the stored one, for the same reason: a ref stored with\n // a different `requireEnrichments` flag than the options carry (e.g. saved\n // before a block changed its `buildDatasetOptions` mode) would not match any\n // option and the selection would show empty.\n const option = props.options?.find((o) => plRefsEqual(o.primary.ref, primary.column, true));\n return makeSelection(option?.primary.ref ?? primary.column, primary.filter, option?.enrichments);\n});\n\nconst dropdownOptions = computed<ListOption<Selection>[] | undefined>(() => {\n if (props.options === undefined) return undefined;\n const out: ListOption<Selection>[] = [];\n for (const o of props.options) {\n out.push({\n label: o.primary.label,\n value: makeSelection(o.primary.ref, undefined, o.enrichments),\n });\n for (const filter of o.filters ?? []) {\n out.push({\n label: filter.label,\n description: o.primary.label,\n value: makeSelection(o.primary.ref, filter.ref, o.enrichments),\n });\n }\n }\n return out;\n});\n\nconst columnLinks = useColumnLinksMissingValue();\n\n/**\n * The column a selection the options lack is shown and explained by: the dataset first, as the\n * filter of a missing dataset is missing with it, then the filter; `undefined` when the column\n * links tell nothing about either.\n */\nfunction explainedColumn(): PObjectId | undefined {\n const primary = model.value?.primary;\n if (columnLinks === undefined || primary === undefined) return undefined;\n const refs = primary.filter === undefined ? [primary.column] : [primary.column, primary.filter];\n return refs\n .map((ref) => createGlobalPObjectId(ref.blockId, ref.name))\n .find((column) => columnLinks.tooltip(column) !== undefined);\n}\n\nconst missingValueLabel = () => {\n const column = explainedColumn();\n return column === undefined ? undefined : columnLinks?.label(column);\n};\n\nconst missingValueTooltip = () => {\n const column = explainedColumn();\n return column === undefined ? undefined : columnLinks?.tooltip(column);\n};\n\nfunction onChange(selection: Selection | undefined) {\n if (selection === undefined) {\n model.value = undefined;\n return;\n }\n model.value = createDatasetSelection(\n createPrimaryRef(selection.primary, selection.filter),\n selection.enrichments,\n );\n}\n</script>\n\n<template>\n <PlDropdown\n data-testid=\"pl-dataset-selector\"\n :model-value=\"selectionValue\"\n :options=\"dropdownOptions\"\n :label=\"label\"\n :helper=\"helper\"\n :loading-options-helper=\"loadingOptionsHelper\"\n :error=\"error\"\n :placeholder=\"placeholder\"\n :clearable=\"clearable\"\n :required=\"required\"\n :disabled=\"disabled\"\n :missing-value-label=\"missingValueLabel\"\n :missing-value-tooltip=\"missingValueTooltip\"\n @update:model-value=\"onChange\"\n >\n <template v-if=\"slots.tooltip\" #tooltip>\n <slot name=\"tooltip\" />\n </template>\n </PlDropdown>\n</template>\n"],"mappings":";;;;;CAUE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;EAuBR,IAAMW,IAAQX,EAAA,GAIRa,IAAQZ,EAAyCc,GAAA,YAAC,GAElDC,IAAQD;EAuCd,SAASE,EACP,GACA,GACA,GACW;GACX,OAAO;IACL;IACA,GAAIC,MAAW,KAAA,KAAa,EAAE,UAAO;IACrC,GAAIC,MAAgB,KAAA,KAAaA,EAAY,SAAS,KAAK,EAAE,eAAY;GAC3E;EACF;EAEA,IAAMC,IAAiBC,QAAsC;GAC3D,IAAMC,IAAUT,EAAM,OAAO;GAC7B,IAAIS,MAAY,KAAA,GAAW;GAS3B,IAAMC,IAASP,EAAM,SAAS,MAAM,MAAMQ,EAAYC,EAAE,QAAQ,KAAKH,EAAQ,QAAQ,EAAI,CAAC;GAC1F,OAAOL,EAAcM,GAAQ,QAAQ,OAAOD,EAAQ,QAAQA,EAAQ,QAAQC,GAAQ,WAAW;EACjG,CAAC,GAEKG,IAAkBL,QAAoD;GAC1E,IAAIL,EAAM,YAAY,KAAA,GAAW;GACjC,IAAMW,IAA+B,CAAC;GACtC,KAAK,IAAMF,KAAKT,EAAM,SAAS;IAC7B,EAAI,KAAK;KACP,OAAOS,EAAE,QAAQ;KACjB,OAAOR,EAAcQ,EAAE,QAAQ,KAAK,KAAA,GAAWA,EAAE,WAAW;IAC9D,CAAC;IACD,KAAK,IAAMP,KAAUO,EAAE,WAAW,CAAC,GACjC,EAAI,KAAK;KACP,OAAOP,EAAO;KACd,aAAaO,EAAE,QAAQ;KACvB,OAAOR,EAAcQ,EAAE,QAAQ,KAAKP,EAAO,KAAKO,EAAE,WAAW;IAC/D,CAAC;GAEL;GACA,OAAOE;EACT,CAAC,GAEKC,IAAcC,EAA2B;EAO/C,SAASC,IAAyC;GAChD,IAAMR,IAAUT,EAAM,OAAO;GAC7B,IAAIe,MAAgB,KAAA,KAAaN,MAAY,KAAA,GAE7C,QADaA,EAAQ,WAAW,KAAA,IAAY,CAACA,EAAQ,MAAM,IAAI,CAACA,EAAQ,QAAQA,EAAQ,MAAM,EAAA,CAE3F,KAAK,MAAQS,EAAsBC,EAAI,SAASA,EAAI,IAAI,CAAC,CAAA,CACzD,MAAM,MAAWJ,EAAY,QAAQK,CAAM,MAAM,KAAA,CAAS;EAC/D;EAEA,IAAMC,UAA0B;GAC9B,IAAMD,IAASH,EAAgB;GAC/B,OAAOG,MAAW,KAAA,IAAY,KAAA,IAAYL,GAAa,MAAMK,CAAM;EACrE,GAEME,UAA4B;GAChC,IAAMF,IAASH,EAAgB;GAC/B,OAAOG,MAAW,KAAA,IAAY,KAAA,IAAYL,GAAa,QAAQK,CAAM;EACvE;EAEA,SAASG,EAAS,GAAkC;GAClD,AAAIC,MAAc,KAAA,IAChB,EAAM,QAAQ,KAAA,IAGhB,EAAM,QAAQC,EACZC,EAAiBF,EAAU,SAASA,EAAU,MAAM,GACpDA,EAAU,WACZ;EACF;E,kBAIEnC,EAAA,GAAAC,EAmBaC,EAAAuC,CAAA,GAAA;GAlBX,eAAY;GACX,eAAavB,EAAA;GACb,SAASM,EAAA;GACT,OAAOX,EAAA;GACP,QAAQA,EAAA;GACR,0BAAwBA,EAAA;GACxB,OAAOA,EAAA;GACP,aAAaA,EAAA;GACb,WAAWA,EAAA;GACX,UAAUA,EAAA;GACV,UAAUA,EAAA;GACV,uBAAqBmB;GACrB,yBAAuBC;GACvB,uBAAoBC;E,gBAELzB,EAAM,U;GAAU,MAAA;GAC9B,IAAAL,QAAuB,CAAvBC,EAAuBwC,EAAA,QAAA,SAAA,C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/ui-vue",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.93.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
}
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@milaboratories/columns-collection-driver": "0.3.
|
|
15
|
-
"@milaboratories/pf-spec-driver": "1.6.
|
|
16
|
-
"@milaboratories/pl-model-common": "1.
|
|
17
|
-
"@milaboratories/uikit": "2.
|
|
18
|
-
"@platforma-sdk/model": "1.
|
|
14
|
+
"@milaboratories/columns-collection-driver": "0.3.1",
|
|
15
|
+
"@milaboratories/pf-spec-driver": "1.6.3",
|
|
16
|
+
"@milaboratories/pl-model-common": "1.57.0",
|
|
17
|
+
"@milaboratories/uikit": "2.18.0",
|
|
18
|
+
"@platforma-sdk/model": "1.92.0",
|
|
19
19
|
"@types/d3-format": "^3.0.4",
|
|
20
20
|
"@types/node": "~24.19.2",
|
|
21
21
|
"@types/semver": "^7.7.0",
|
|
@@ -14,9 +14,9 @@ export default {
|
|
|
14
14
|
|
|
15
15
|
<script lang="ts" setup>
|
|
16
16
|
import type {
|
|
17
|
+
DatasetEnrichment,
|
|
17
18
|
DatasetOption,
|
|
18
19
|
DatasetSelection,
|
|
19
|
-
LabeledEnrichmentRefs,
|
|
20
20
|
PObjectId,
|
|
21
21
|
PlRef,
|
|
22
22
|
} from "@platforma-sdk/model";
|
|
@@ -71,7 +71,7 @@ const props = withDefaults(
|
|
|
71
71
|
},
|
|
72
72
|
);
|
|
73
73
|
|
|
74
|
-
type Selection = { primary: PlRef; filter?: PlRef; enrichments?:
|
|
74
|
+
type Selection = { primary: PlRef; filter?: PlRef; enrichments?: readonly DatasetEnrichment[] };
|
|
75
75
|
|
|
76
76
|
// `deepEqual` (used by PlDropdown for matching) treats `{a, b: undefined}` and
|
|
77
77
|
// `{a}` as different shapes, so the option list and the selection value must
|
|
@@ -79,7 +79,7 @@ type Selection = { primary: PlRef; filter?: PlRef; enrichments?: LabeledEnrichme
|
|
|
79
79
|
function makeSelection(
|
|
80
80
|
primary: PlRef,
|
|
81
81
|
filter: PlRef | undefined,
|
|
82
|
-
enrichments:
|
|
82
|
+
enrichments: readonly DatasetEnrichment[] | undefined,
|
|
83
83
|
): Selection {
|
|
84
84
|
return {
|
|
85
85
|
primary,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { flushPromises, mount } from "@vue/test-utils";
|
|
2
|
-
import type { DatasetOption, DatasetSelection } from "@platforma-sdk/model";
|
|
3
|
-
import {
|
|
2
|
+
import type { DatasetEnrichment, DatasetOption, DatasetSelection } from "@platforma-sdk/model";
|
|
3
|
+
import {
|
|
4
|
+
createColumnDiscoveredId,
|
|
5
|
+
createDatasetSelection,
|
|
6
|
+
createGlobalPObjectId,
|
|
7
|
+
createPlRef,
|
|
8
|
+
createPrimaryRef,
|
|
9
|
+
} from "@platforma-sdk/model";
|
|
4
10
|
import { describe, expect, it } from "vitest";
|
|
5
11
|
import PlDatasetSelector from "../PlDatasetSelector.vue";
|
|
6
12
|
|
|
@@ -9,10 +15,14 @@ const datasetB = createPlRef("2", "out-b", true);
|
|
|
9
15
|
const filterA1 = createPlRef("1", "filter-a1");
|
|
10
16
|
const filterA2 = createPlRef("1", "filter-a2");
|
|
11
17
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
const enrichmentsA: DatasetEnrichment[] = [
|
|
19
|
+
{
|
|
20
|
+
id: createColumnDiscoveredId({
|
|
21
|
+
column: createGlobalPObjectId("3", "enrichment-a"),
|
|
22
|
+
path: [{ type: "linker", column: createGlobalPObjectId("3", "linker-a") }],
|
|
23
|
+
}),
|
|
24
|
+
label: "Enrichment A",
|
|
25
|
+
},
|
|
16
26
|
];
|
|
17
27
|
|
|
18
28
|
const optionsWithFilters: DatasetOption[] = [
|