@platforma-sdk/ui-vue 1.45.42 → 1.46.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.
Files changed (79) hide show
  1. package/.turbo/turbo-build.log +23 -39
  2. package/.turbo/turbo-type-check.log +1 -1
  3. package/CHANGELOG.md +22 -0
  4. package/dist/components/PlAdvancedFilter/FilterEditor.vue.d.ts +27 -0
  5. package/dist/components/PlAdvancedFilter/FilterEditor.vue.js +10 -0
  6. package/dist/components/PlAdvancedFilter/FilterEditor.vue.js.map +1 -0
  7. package/dist/components/PlAdvancedFilter/FilterEditor.vue2.js +302 -0
  8. package/dist/components/PlAdvancedFilter/FilterEditor.vue2.js.map +1 -0
  9. package/dist/components/PlAdvancedFilter/FilterEditor.vue3.js +33 -0
  10. package/dist/components/PlAdvancedFilter/FilterEditor.vue3.js.map +1 -0
  11. package/dist/components/PlAdvancedFilter/OperandButton.vue2.js.map +1 -1
  12. package/dist/components/PlAdvancedFilter/OperandButton.vue3.js +9 -9
  13. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue.d.ts +29 -20
  14. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js +184 -146
  15. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js.map +1 -1
  16. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue3.js +13 -9
  17. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue3.js.map +1 -1
  18. package/dist/components/PlAdvancedFilter/constants.d.ts +4 -4
  19. package/dist/components/PlAdvancedFilter/constants.js +26 -22
  20. package/dist/components/PlAdvancedFilter/constants.js.map +1 -1
  21. package/dist/components/PlAdvancedFilter/index.d.ts +4 -0
  22. package/dist/components/PlAdvancedFilter/index.js +9 -0
  23. package/dist/components/PlAdvancedFilter/index.js.map +1 -0
  24. package/dist/components/PlAdvancedFilter/types.d.ts +30 -34
  25. package/dist/components/PlAdvancedFilter/utils.d.ts +26 -0
  26. package/dist/components/PlAdvancedFilter/utils.js +32 -131
  27. package/dist/components/PlAdvancedFilter/utils.js.map +1 -1
  28. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js +43 -41
  29. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js.map +1 -1
  30. package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue3.js +2 -2
  31. package/dist/components/PlAnnotations/components/FilterSidebar.vue.d.ts +10 -2
  32. package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js +98 -91
  33. package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js.map +1 -1
  34. package/dist/components/PlAnnotations/components/FilterSidebar.vue3.js +5 -5
  35. package/dist/components/PlAnnotations/components/PlAnnotations.vue2.js +23 -23
  36. package/dist/components/PlAnnotations/components/PlAnnotations.vue2.js.map +1 -1
  37. package/dist/components/PlAnnotations/components/PlAnnotations.vue3.js +5 -7
  38. package/dist/components/PlAnnotations/components/PlAnnotations.vue3.js.map +1 -1
  39. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue2.js +19 -17
  40. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue2.js.map +1 -1
  41. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue3.js +7 -9
  42. package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue3.js.map +1 -1
  43. package/dist/components/PlAnnotations/components/style.module.css.js +13 -0
  44. package/dist/components/PlAnnotations/components/style.module.css.js.map +1 -0
  45. package/dist/components/PlAnnotations/index.d.ts +1 -0
  46. package/dist/index.js +35 -33
  47. package/dist/index.js.map +1 -1
  48. package/package.json +9 -8
  49. package/src/components/PlAdvancedFilter/{SingleFilter.vue → FilterEditor.vue} +58 -62
  50. package/src/components/PlAdvancedFilter/OperandButton.vue +1 -1
  51. package/src/components/PlAdvancedFilter/PlAdvancedFilter.vue +152 -60
  52. package/src/components/PlAdvancedFilter/constants.ts +17 -11
  53. package/src/components/PlAdvancedFilter/index.ts +6 -0
  54. package/src/components/PlAdvancedFilter/types.ts +23 -54
  55. package/src/components/PlAdvancedFilter/utils.ts +51 -163
  56. package/src/components/PlAnnotations/components/AnnotationsSidebar.vue +8 -8
  57. package/src/components/PlAnnotations/components/FilterSidebar.vue +60 -69
  58. package/src/components/PlAnnotations/components/PlAnnotations.vue +3 -7
  59. package/src/components/PlAnnotations/components/PlAnnotationsModal.vue +4 -8
  60. package/src/components/PlAnnotations/components/style.module.css +16 -0
  61. package/src/components/PlAnnotations/index.ts +2 -0
  62. package/dist/components/PlAdvancedFilter/SingleFilter.vue.d.ts +0 -37
  63. package/dist/components/PlAdvancedFilter/SingleFilter.vue.js +0 -10
  64. package/dist/components/PlAdvancedFilter/SingleFilter.vue.js.map +0 -1
  65. package/dist/components/PlAdvancedFilter/SingleFilter.vue2.js +0 -306
  66. package/dist/components/PlAdvancedFilter/SingleFilter.vue2.js.map +0 -1
  67. package/dist/components/PlAdvancedFilter/SingleFilter.vue3.js +0 -35
  68. package/dist/components/PlAdvancedFilter/SingleFilter.vue3.js.map +0 -1
  69. package/dist/components/PlAdvancedFilter/types.js +0 -8
  70. package/dist/components/PlAdvancedFilter/types.js.map +0 -1
  71. package/dist/components/PlAnnotations/components/DynamicForm.vue.d.ts +0 -24
  72. package/dist/components/PlAnnotations/components/DynamicForm.vue.js +0 -10
  73. package/dist/components/PlAnnotations/components/DynamicForm.vue.js.map +0 -1
  74. package/dist/components/PlAnnotations/components/DynamicForm.vue2.js +0 -109
  75. package/dist/components/PlAnnotations/components/DynamicForm.vue2.js.map +0 -1
  76. package/dist/components/PlAnnotations/components/DynamicForm.vue3.js +0 -9
  77. package/dist/components/PlAnnotations/components/DynamicForm.vue3.js.map +0 -1
  78. package/dist/components/PlAnnotations/utils.js +0 -20
  79. package/dist/components/PlAnnotations/utils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"PlAnnotations.vue2.js","sources":["../../../../src/components/PlAnnotations/components/PlAnnotations.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Props as BaseProps } from './FilterSidebar.vue';\nexport type Props = BaseProps & {\n onDeleteSchema?: () => void;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, effect, shallowRef } from 'vue';\n\nimport { isNil } from '@milaboratories/helpers';\nimport { PlSidebarGroup, useConfirm } from '@milaboratories/uikit';\n\nimport type { Annotation } from '../types';\nimport AnnotationsSidebar from './AnnotationsSidebar.vue';\nimport FilterSidebar from './FilterSidebar.vue';\n\n// Models\nconst annotation = defineModel<Annotation>('annotation', { required: true });\n// Props\nconst props = defineProps<Props>();\n// State\nconst selectedStepId = shallowRef<number | undefined>(undefined);\nconst selectedStep = computed(() => {\n return isNil(selectedStepId.value) || isNil(annotation.value)\n ? undefined\n : annotation.value.steps.find((step) => step.id === selectedStepId.value);\n});\n\n// Watchers\neffect(function setDefaultStepId() {\n if (selectedStepId.value === undefined && annotation.value.steps.length > 0) {\n selectedStepId.value = annotation.value.steps[0].id;\n }\n});\n// Hooks\nconst confirmResetSchema = useConfirm({\n title: 'Reset Schema',\n message: 'Are you sure you want to reset the schema? This action cannot be undone.',\n confirmLabel: 'Yes, reset',\n cancelLabel: 'No, cancel',\n});\n// Actions\nasync function handleDeleteSchema() {\n if (await confirmResetSchema()) {\n selectedStepId.value = undefined;\n props.onDeleteSchema?.();\n }\n}\n\n</script>\n\n<template>\n <PlSidebarGroup :class=\"$style.sidebarGroup\">\n <template #item-0>\n <AnnotationsSidebar\n v-model:annotation=\"annotation\"\n v-model:selectedStepId=\"selectedStepId\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n @delete-schema=\"handleDeleteSchema\"\n />\n </template>\n <template #item-1>\n <FilterSidebar\n v-if=\"selectedStep\"\n v-model:step=\"selectedStep\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n :selectedStepId=\"selectedStepId\"\n :hasSelectedColumns=\"props.hasSelectedColumns\"\n :getValuesForSelectedColumns=\"props.getValuesForSelectedColumns\"\n />\n </template>\n </PlSidebarGroup>\n</template>\n\n<style lang=\"scss\" module>\n.sidebarGroup {\n width: 100%;\n height: 100%;\n}\n\n.sidebarItem {\n width: 100%;\n height: 100%;\n}\n</style>\n"],"names":["annotation","_useModel","props","__props","selectedStepId","shallowRef","selectedStep","computed","isNil","step","effect","confirmResetSchema","useConfirm","handleDeleteSchema","_a","_createBlock","_unref","PlSidebarGroup","_normalizeClass","$style","_createVNode","AnnotationsSidebar","$event","FilterSidebar"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,UAAMA,IAAaC,KAAwB,YAAgC,GAErEC,IAAQC,GAERC,IAAiBC,EAA+B,MAAS,GACzDC,IAAeC,EAAS,MACrBC,EAAMJ,EAAe,KAAK,KAAKI,EAAMR,EAAW,KAAK,IACxD,SACAA,EAAW,MAAM,MAAM,KAAK,CAACS,MAASA,EAAK,OAAOL,EAAe,KAAK,CAC3E;AAGD,IAAAM,EAAO,WAA4B;AACjC,MAAIN,EAAe,UAAU,UAAaJ,EAAW,MAAM,MAAM,SAAS,MACxEI,EAAe,QAAQJ,EAAW,MAAM,MAAM,CAAC,EAAE;AAAA,IAErD,CAAC;AAED,UAAMW,IAAqBC,EAAW;AAAA,MACpC,OAAO;AAAA,MACP,SAAS;AAAA,MACT,cAAc;AAAA,MACd,aAAa;AAAA,IAAA,CACd;AAED,mBAAeC,IAAqB;;AAClC,MAAI,MAAMF,QACRP,EAAe,QAAQ,SACvBU,IAAAZ,EAAM,mBAAN,QAAAY,EAAA,KAAAZ;AAAA,IAEJ;2BAKEa,EAqBiBC,EAAAC,CAAA,GAAA;AAAA,MArBA,OAAKC,EAAEC,EAAAA,OAAO,YAAY;AAAA,IAAA;MAC9B,YACT,MAME;AAAA,QANFC,EAMEC,GAAA;AAAA,UALQ,YAAYrB,EAAA;AAAA,wDAAAA,EAAU,QAAAsB;AAAA,UACtB,gBAAgBlB,EAAA;AAAA,4DAAAA,EAAc,QAAAkB;AAAA,UACrC,OAAKJ,EAAEC,EAAAA,OAAO,WAAW;AAAA,UACzB,SAASjB,EAAM;AAAA,UACf,gBAAeW;AAAA,QAAA;;MAGT,YALb,MAYW;AAAA,QALCP,EAAA,cADRS,EAQEQ,GAAA;AAAA;UANQ,MAAMjB,EAAA;AAAA,kDAAAA,EAAY,QAAAgB;AAAA,UACzB,OAAKJ,EAAEC,EAAAA,OAAO,WAAW;AAAA,UACzB,SAASjB,EAAM;AAAA,UACf,gBAAgBE,EAAA;AAAA,UAChB,oBAAoBF,EAAM;AAAA,UAC1B,6BAA6BA,EAAM;AAAA,QAAA;;;;;;"}
1
+ {"version":3,"file":"PlAnnotations.vue2.js","sources":["../../../../src/components/PlAnnotations/components/PlAnnotations.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { Props as BaseProps } from './FilterSidebar.vue';\nexport type Props = BaseProps & {\n onDeleteSchema?: () => void;\n};\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, effect, shallowRef } from 'vue';\n\nimport { isNil } from '@milaboratories/helpers';\nimport { PlSidebarGroup, useConfirm } from '@milaboratories/uikit';\n\nimport type { Annotation } from '../types';\nimport AnnotationsSidebar from './AnnotationsSidebar.vue';\nimport FilterSidebar from './FilterSidebar.vue';\n\n// Models\nconst annotation = defineModel<Annotation>('annotation', { required: true });\n// Props\nconst props = defineProps<Props>();\n// State\nconst selectedStepId = shallowRef<number | undefined>(undefined);\nconst selectedStep = computed(() => {\n return isNil(selectedStepId.value) || isNil(annotation.value)\n ? undefined\n : annotation.value.steps.find((step) => step.id === selectedStepId.value);\n});\n\n// Watchers\neffect(function setDefaultStepId() {\n if (selectedStepId.value === undefined && annotation.value.steps.length > 0) {\n selectedStepId.value = annotation.value.steps[0].id;\n }\n});\n// Hooks\nconst confirmResetSchema = useConfirm({\n title: 'Reset Schema',\n message: 'Are you sure you want to reset the schema? This action cannot be undone.',\n confirmLabel: 'Yes, reset',\n cancelLabel: 'No, cancel',\n});\n// Actions\nasync function handleDeleteSchema() {\n if (await confirmResetSchema()) {\n selectedStepId.value = undefined;\n props.onDeleteSchema?.();\n }\n}\n\n</script>\n\n<template>\n <PlSidebarGroup>\n <template #item-0>\n <AnnotationsSidebar\n v-model:annotation=\"annotation\"\n v-model:selectedStepId=\"selectedStepId\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n @delete-schema=\"handleDeleteSchema\"\n />\n </template>\n <template #item-1>\n <FilterSidebar\n v-if=\"selectedStep\"\n v-model:step=\"selectedStep\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n :get-suggest-options=\"props.getSuggestOptions\"\n :selectedStepId=\"selectedStepId\"\n :hasSelectedColumns=\"props.hasSelectedColumns\"\n :getValuesForSelectedColumns=\"props.getValuesForSelectedColumns\"\n />\n </template>\n </PlSidebarGroup>\n</template>\n\n<style module>\n.sidebarItem {\n width: 100%;\n height: 100%;\n}\n</style>\n"],"names":["annotation","_useModel","props","__props","selectedStepId","shallowRef","selectedStep","computed","isNil","step","effect","confirmResetSchema","useConfirm","handleDeleteSchema","_a","_createBlock","_unref","PlSidebarGroup","_createVNode","AnnotationsSidebar","$event","_normalizeClass","$style","FilterSidebar"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,UAAMA,IAAaC,KAAwB,YAAgC,GAErEC,IAAQC,GAERC,IAAiBC,EAA+B,MAAS,GACzDC,IAAeC,EAAS,MACrBC,EAAMJ,EAAe,KAAK,KAAKI,EAAMR,EAAW,KAAK,IACxD,SACAA,EAAW,MAAM,MAAM,KAAK,CAACS,MAASA,EAAK,OAAOL,EAAe,KAAK,CAC3E;AAGD,IAAAM,EAAO,WAA4B;AACjC,MAAIN,EAAe,UAAU,UAAaJ,EAAW,MAAM,MAAM,SAAS,MACxEI,EAAe,QAAQJ,EAAW,MAAM,MAAM,CAAC,EAAE;AAAA,IAErD,CAAC;AAED,UAAMW,IAAqBC,EAAW;AAAA,MACpC,OAAO;AAAA,MACP,SAAS;AAAA,MACT,cAAc;AAAA,MACd,aAAa;AAAA,IAAA,CACd;AAED,mBAAeC,IAAqB;;AAClC,MAAI,MAAMF,QACRP,EAAe,QAAQ,SACvBU,IAAAZ,EAAM,mBAAN,QAAAY,EAAA,KAAAZ;AAAA,IAEJ;2BAKEa,EAsBiBC,EAAAC,CAAA,GAAA,MAAA;AAAA,MArBJ,YACT,MAME;AAAA,QANFC,EAMEC,GAAA;AAAA,UALQ,YAAYnB,EAAA;AAAA,wDAAAA,EAAU,QAAAoB;AAAA,UACtB,gBAAgBhB,EAAA;AAAA,4DAAAA,EAAc,QAAAgB;AAAA,UACrC,OAAKC,EAAEC,EAAAA,OAAO,WAAW;AAAA,UACzB,SAASpB,EAAM;AAAA,UACf,gBAAeW;AAAA,QAAA;;MAGT,YATW,MAWxB;AAAA,QAAYP,EAAA,cADRS,EASEQ,GAAA;AAAA;UAPQ,MAAMjB,EAAA;AAAA,kDAAAA,EAAY,QAAAc;AAAA,UACzB,OAAKC,EAAEC,EAAAA,OAAO,WAAW;AAAA,UACzB,SAASpB,EAAM;AAAA,UACf,uBAAqBA,EAAM;AAAA,UAC3B,gBAAgBE,EAAA;AAAA,UAChB,oBAAoBF,EAAM;AAAA,UAC1B,6BAA6BA,EAAM;AAAA,QAAA;;;;;;"}
@@ -1,11 +1,9 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sidebarGroup_1imam_1,._sidebarItem_1imam_6{width:100%;height:100%}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
- const e = "_sidebarGroup_1imam_1", s = "_sidebarItem_1imam_6", a = {
3
- sidebarGroup: e,
4
- sidebarItem: s
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._sidebarItem_ealy4_2{width:100%;height:100%}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ const e = "_sidebarItem_ealy4_2", t = {
3
+ sidebarItem: e
5
4
  };
6
5
  export {
7
- a as default,
8
- e as sidebarGroup,
9
- s as sidebarItem
6
+ t as default,
7
+ e as sidebarItem
10
8
  };
11
9
  //# sourceMappingURL=PlAnnotations.vue3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlAnnotations.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
1
+ {"version":3,"file":"PlAnnotations.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -1,10 +1,11 @@
1
- import { defineComponent as c, mergeModels as r, useModel as d, shallowRef as p, effect as f, createBlock as S, openBlock as v, unref as h, normalizeClass as i, withCtx as C, createVNode as V } from "vue";
1
+ import { defineComponent as m, mergeModels as r, useModel as d, shallowRef as p, effect as f, createBlock as g, openBlock as S, unref as v, normalizeClass as i, withCtx as h, createVNode as C } from "vue";
2
2
  import { PlPureSlideModal as y } from "@milaboratories/uikit";
3
- import g from "./PlAnnotations.vue.js";
4
- const B = /* @__PURE__ */ c({
3
+ import V from "./PlAnnotations.vue.js";
4
+ const B = /* @__PURE__ */ m({
5
5
  __name: "PlAnnotationsModal",
6
6
  props: /* @__PURE__ */ r({
7
7
  columns: {},
8
+ getSuggestOptions: { type: Function },
8
9
  hasSelectedColumns: { type: Boolean },
9
10
  getValuesForSelectedColumns: { type: Function },
10
11
  onDeleteSchema: { type: Function }
@@ -16,30 +17,31 @@ const B = /* @__PURE__ */ c({
16
17
  }),
17
18
  emits: ["update:annotation", "update:opened"],
18
19
  setup(l) {
19
- const t = d(l, "annotation"), a = d(l, "opened"), e = l, u = p(void 0);
20
+ const o = d(l, "annotation"), a = d(l, "opened"), e = l, u = p(void 0);
20
21
  f(function() {
21
- u.value === void 0 && t.value.steps.length > 0 && (u.value = t.value.steps[0].id);
22
+ u.value === void 0 && o.value.steps.length > 0 && (u.value = o.value.steps[0].id);
22
23
  });
23
- async function m() {
24
- var o;
25
- a.value = !1, (o = e.onDeleteSchema) == null || o.call(e);
24
+ async function c() {
25
+ var t;
26
+ a.value = !1, (t = e.onDeleteSchema) == null || t.call(e);
26
27
  }
27
- return (o, n) => (v(), S(h(y), {
28
+ return (t, n) => (S(), g(v(y), {
28
29
  modelValue: a.value,
29
30
  "onUpdate:modelValue": n[1] || (n[1] = (s) => a.value = s),
30
- class: i(o.$style.modal),
31
+ class: i(t.$style.modal),
31
32
  width: "768px"
32
33
  }, {
33
- default: C(() => [
34
- V(g, {
35
- annotation: t.value,
36
- "onUpdate:annotation": n[0] || (n[0] = (s) => t.value = s),
37
- class: i(o.$style.sidebarItem),
34
+ default: h(() => [
35
+ C(V, {
36
+ annotation: o.value,
37
+ "onUpdate:annotation": n[0] || (n[0] = (s) => o.value = s),
38
+ class: i(t.$style.content),
38
39
  columns: e.columns,
40
+ "get-suggest-options": e.getSuggestOptions,
39
41
  "has-selected-columns": e.hasSelectedColumns,
40
42
  getValuesForSelectedColumns: e.getValuesForSelectedColumns,
41
- onDeleteSchema: m
42
- }, null, 8, ["annotation", "class", "columns", "has-selected-columns", "getValuesForSelectedColumns"])
43
+ onDeleteSchema: c
44
+ }, null, 8, ["annotation", "class", "columns", "get-suggest-options", "has-selected-columns", "getValuesForSelectedColumns"])
43
45
  ]),
44
46
  _: 1
45
47
  }, 8, ["modelValue", "class"]));
@@ -1 +1 @@
1
- {"version":3,"file":"PlAnnotationsModal.vue2.js","sources":["../../../../src/components/PlAnnotations/components/PlAnnotationsModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { PlPureSlideModal } from '@milaboratories/uikit';\nimport { effect, shallowRef } from 'vue';\n\nimport type { Annotation } from '../types';\nimport type { Props } from './PlAnnotations.vue';\nimport PlAnnotations from './PlAnnotations.vue';\n\n// Models\nconst annotation = defineModel<Annotation>('annotation', { required: true });\nconst opened = defineModel<boolean>('opened', { required: true });\n// Props\nconst props = defineProps<Props>();\n// State\nconst selectedStepId = shallowRef<number | undefined>(undefined);\n// Watchers\neffect(function setDefaultStepId() {\n if (selectedStepId.value === undefined && annotation.value.steps.length > 0) {\n selectedStepId.value = annotation.value.steps[0].id;\n }\n});\n// Actions\nasync function handleDeleteSchema() {\n opened.value = false;\n props.onDeleteSchema?.();\n}\n</script>\n\n<template>\n <PlPureSlideModal v-model=\"opened\" :class=\"$style.modal\" width=\"768px\">\n <PlAnnotations\n v-model:annotation=\"annotation\"\n :class=\"$style.sidebarItem\"\n :columns=\"props.columns\"\n :has-selected-columns=\"props.hasSelectedColumns\"\n :getValuesForSelectedColumns=\"props.getValuesForSelectedColumns\"\n @delete-schema=\"handleDeleteSchema\"\n />\n </PlPureSlideModal>\n</template>\n\n<style lang=\"scss\" module>\n.modal {\n display: flex;\n}\n\n.sidebarGroup {\n width: 100%;\n height: 100%;\n}\n\n.sidebarItem {\n width: 100%;\n height: 100%;\n}\n</style>\n"],"names":["annotation","_useModel","opened","__props","props","selectedStepId","shallowRef","effect","handleDeleteSchema","_a","_createBlock","_unref","PlPureSlideModal","$event","_normalizeClass","$style","_createVNode","PlAnnotations"],"mappings":";;;;;;;;;;;;;;;;;;AASA,UAAMA,IAAaC,KAAwB,YAAgC,GACrEC,IAASD,EAAoBE,GAAC,QAA4B,GAE1DC,IAAQD,GAERE,IAAiBC,EAA+B,MAAS;AAE/D,IAAAC,EAAO,WAA4B;AACjC,MAAIF,EAAe,UAAU,UAAaL,EAAW,MAAM,MAAM,SAAS,MACxEK,EAAe,QAAQL,EAAW,MAAM,MAAM,CAAC,EAAE;AAAA,IAErD,CAAC;AAED,mBAAeQ,IAAqB;;AAClC,MAAAN,EAAO,QAAQ,KACfO,IAAAL,EAAM,mBAAN,QAAAK,EAAA,KAAAL;AAAA,IACF;2BAIEM,EASmBC,EAAAC,CAAA,GAAA;AAAA,kBATQV,EAAA;AAAA,oDAAAA,EAAM,QAAAW;AAAA,MAAG,OAAKC,EAAEC,EAAAA,OAAO,KAAK;AAAA,MAAE,OAAM;AAAA,IAAA;iBAC7D,MAOE;AAAA,QAPFC,EAOEC,GAAA;AAAA,UANQ,YAAYjB,EAAA;AAAA,wDAAAA,EAAU,QAAAa;AAAA,UAC7B,OAAKC,EAAEC,EAAAA,OAAO,WAAW;AAAA,UACzB,SAASX,EAAM;AAAA,UACf,wBAAsBA,EAAM;AAAA,UAC5B,6BAA6BA,EAAM;AAAA,UACnC,gBAAeI;AAAA,QAAA;;;;;;"}
1
+ {"version":3,"file":"PlAnnotationsModal.vue2.js","sources":["../../../../src/components/PlAnnotations/components/PlAnnotationsModal.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { PlPureSlideModal } from '@milaboratories/uikit';\nimport { effect, shallowRef } from 'vue';\n\nimport type { Annotation } from '../types';\nimport type { Props } from './PlAnnotations.vue';\nimport PlAnnotations from './PlAnnotations.vue';\n\n// Models\nconst annotation = defineModel<Annotation>('annotation', { required: true });\nconst opened = defineModel<boolean>('opened', { required: true });\n// Props\nconst props = defineProps<Props>();\n// State\nconst selectedStepId = shallowRef<number | undefined>(undefined);\n// Watchers\neffect(function setDefaultStepId() {\n if (selectedStepId.value === undefined && annotation.value.steps.length > 0) {\n selectedStepId.value = annotation.value.steps[0].id;\n }\n});\n// Actions\nasync function handleDeleteSchema() {\n opened.value = false;\n props.onDeleteSchema?.();\n}\n</script>\n\n<template>\n <PlPureSlideModal v-model=\"opened\" :class=\"$style.modal\" width=\"768px\">\n <PlAnnotations\n v-model:annotation=\"annotation\"\n :class=\"$style.content\"\n :columns=\"props.columns\"\n :get-suggest-options=\"props.getSuggestOptions\"\n :has-selected-columns=\"props.hasSelectedColumns\"\n :getValuesForSelectedColumns=\"props.getValuesForSelectedColumns\"\n @delete-schema=\"handleDeleteSchema\"\n />\n </PlPureSlideModal>\n</template>\n\n<style module>\n.modal {\n display: flex;\n}\n\n.content {\n width: 100%;\n height: 100%;\n}\n</style>\n"],"names":["annotation","_useModel","opened","__props","props","selectedStepId","shallowRef","effect","handleDeleteSchema","_a","_createBlock","_unref","PlPureSlideModal","$event","_normalizeClass","$style","_createVNode","PlAnnotations"],"mappings":";;;;;;;;;;;;;;;;;;;AASA,UAAMA,IAAaC,KAAwB,YAAgC,GACrEC,IAASD,EAAoBE,GAAC,QAA4B,GAE1DC,IAAQD,GAERE,IAAiBC,EAA+B,MAAS;AAE/D,IAAAC,EAAO,WAA4B;AACjC,MAAIF,EAAe,UAAU,UAAaL,EAAW,MAAM,MAAM,SAAS,MACxEK,EAAe,QAAQL,EAAW,MAAM,MAAM,CAAC,EAAE;AAAA,IAErD,CAAC;AAED,mBAAeQ,IAAqB;;AAClC,MAAAN,EAAO,QAAQ,KACfO,IAAAL,EAAM,mBAAN,QAAAK,EAAA,KAAAL;AAAA,IACF;2BAIEM,EAUmBC,EAAAC,CAAA,GAAA;AAAA,kBAVQV,EAAA;AAAA,oDAAAA,EAAM,QAAAW;AAAA,MAAG,OAAKC,EAAEC,EAAAA,OAAO,KAAK;AAAA,MAAE,OAAM;AAAA,IAAA;iBAC7D,MAQE;AAAA,QARFC,EAQEC,GAAA;AAAA,UAPQ,YAAYjB,EAAA;AAAA,wDAAAA,EAAU,QAAAa;AAAA,UAC7B,OAAKC,EAAEC,EAAAA,OAAO,OAAO;AAAA,UACrB,SAASX,EAAM;AAAA,UACf,uBAAqBA,EAAM;AAAA,UAC3B,wBAAsBA,EAAM;AAAA,UAC5B,6BAA6BA,EAAM;AAAA,UACnC,gBAAeI;AAAA,QAAA;;;;;;"}
@@ -1,13 +1,11 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._modal_1634u_1{display:flex}._sidebarGroup_1634u_5,._sidebarItem_1634u_10{width:100%;height:100%}")),document.head.appendChild(e)}}catch(d){console.error("vite-plugin-css-injected-by-js",d)}})();
2
- const e = "_modal_1634u_1", s = "_sidebarGroup_1634u_5", a = "_sidebarItem_1634u_10", o = {
3
- modal: e,
4
- sidebarGroup: s,
5
- sidebarItem: a
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._modal_bftih_2{display:flex}._content_bftih_6{width:100%;height:100%}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
+ const t = "_modal_bftih_2", o = "_content_bftih_6", n = {
3
+ modal: t,
4
+ content: o
6
5
  };
7
6
  export {
8
- o as default,
9
- e as modal,
10
- s as sidebarGroup,
11
- a as sidebarItem
7
+ o as content,
8
+ n as default,
9
+ t as modal
12
10
  };
13
11
  //# sourceMappingURL=PlAnnotationsModal.vue3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"PlAnnotationsModal.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
1
+ {"version":3,"file":"PlAnnotationsModal.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
@@ -0,0 +1,13 @@
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._flashing_1daus_1{animation:_flash_1daus_1 1s ease-in-out infinite alternate}@keyframes _flash_1daus_1{0%{box-shadow:0 0 6px 4px var(--border-color-focus)}to{box-shadow:0 0 2px 2px var(--border-color-focus)}}._disabled_1daus_13{pointer-events:none;opacity:.5}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
+ const s = "_flashing_1daus_1", a = "_flash_1daus_1", l = "_disabled_1daus_13", d = {
3
+ flashing: s,
4
+ flash: a,
5
+ disabled: l
6
+ };
7
+ export {
8
+ d as default,
9
+ l as disabled,
10
+ a as flash,
11
+ s as flashing
12
+ };
13
+ //# sourceMappingURL=style.module.css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
@@ -1,2 +1,3 @@
1
1
  export { default as PlAnnotations } from './components/PlAnnotations.vue';
2
2
  export { default as PlAnnotationsModal } from './components/PlAnnotationsModal.vue';
3
+ export type { Annotation, Filter, FilterSpec } from './types';
package/dist/index.js CHANGED
@@ -5,20 +5,20 @@
5
5
  .pl-ag-chart-stacked-bar-cell{height:100%;display:flex;flex-direction:row;align-items:center}.pl-ag-chart-stacked-bar-cell__not-ready{color:var(--txt-03)!important}`)),document.head.appendChild(r)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
6
6
 
7
7
  import { default as m } from "./components/BlockLayout.vue.js";
8
- import { default as p, default as d } from "./components/PlAgDataTable/PlAgDataTableV2.vue.js";
8
+ import { default as s, default as d } from "./components/PlAgDataTable/PlAgDataTableV2.vue.js";
9
9
  import { default as i } from "./components/PlAgDataTable/PlAgOverlayLoading.vue.js";
10
10
  import { default as n } from "./components/PlAgDataTable/PlAgOverlayNoRows.vue.js";
11
11
 
12
12
  import { default as A } from "./components/ValueOrErrorsComponent.vue.js";
13
13
  import { useAgGridOptions as C } from "./AgGridVue/useAgGridOptions.js";
14
14
  import { createAgGridColDef as b } from "./AgGridVue/createAgGridColDef.js";
15
- import { deselectAll as w, getSelectedRowsCount as R, getTotalRowsCount as T, isSelectionEnabled as v, selectAll as D } from "./AgGridVue/selection.js";
15
+ import { deselectAll as v, getSelectedRowsCount as w, getTotalRowsCount as R, isSelectionEnabled as S, selectAll as T } from "./AgGridVue/selection.js";
16
16
  import { default as V } from "./components/PlAgColumnHeader/PlAgColumnHeader.vue.js";
17
- import { default as M } from "./components/PlAgCellFile/PlAgCellFile.vue.js";
18
- import { default as G } from "./components/PlAgCellProgress/PlAgCellProgress.vue.js";
19
- import { default as k } from "./components/PlAgCellStatusTag/PlAgCellStatusTag.vue.js";
17
+ import { default as F } from "./components/PlAgCellFile/PlAgCellFile.vue.js";
18
+ import { default as h } from "./components/PlAgCellProgress/PlAgCellProgress.vue.js";
19
+ import { default as N } from "./components/PlAgCellStatusTag/PlAgCellStatusTag.vue.js";
20
20
 
21
- import { default as B } from "./components/PlAgChartHistogramCell/PlAgChartHistogramCell.vue.js";
21
+ import { default as y } from "./components/PlAgChartHistogramCell/PlAgChartHistogramCell.vue.js";
22
22
 
23
23
  import { default as H } from "./components/PlAgChartStackedBarCell/PlAgChartStackedBarCell.vue.js";
24
24
 
@@ -32,70 +32,72 @@ import { default as re } from "./components/PlAgGridColumnManager/PlAgGridColumn
32
32
  import { default as te } from "./components/PlTableFilters/PlTableFiltersV2.vue.js";
33
33
  import { default as ae } from "./components/PlAnnotations/components/PlAnnotations.vue.js";
34
34
  import { default as me } from "./components/PlAnnotations/components/PlAnnotationsModal.vue.js";
35
- import { default as pe } from "./components/PlBtnExportArchive/PlBtnExportArchive.vue.js";
36
- import { default as ue } from "./components/PlAdvancedFilter/PlAdvancedFilter.vue.js";
35
+ import { default as se } from "./components/PlBtnExportArchive/PlBtnExportArchive.vue.js";
36
+ import { PlAdvancedFilterSupportedFilters as ue } from "./components/PlAdvancedFilter/index.js";
37
37
  import { defineApp as xe, useSdkPlugin as ne } from "./defineApp.js";
38
38
  import { createModel as Ae } from "./createModel.js";
39
39
  import { defineStore as Ce } from "./defineStore.js";
40
40
  import { AgGridTheme as be, activateAgGrid as Ee } from "./aggrid.js";
41
- import { MultiError as Re, UnresolvedError as Te, ensureError as ve, formatZodError as De, identity as Se, isDefined as Ve, isZodError as Oe, unwrapValueOrErrors as Me, wrapOptionalResult as he, wrapValueOrErrors as Ge } from "./utils.js";
42
- import { objectHash as ke } from "./objectHash.js";
43
- import { computedResult as Be } from "./computedResult.js";
41
+ import { MultiError as we, UnresolvedError as Re, ensureError as Se, formatZodError as Te, identity as De, isDefined as Ve, isZodError as Oe, unwrapValueOrErrors as Fe, wrapOptionalResult as Me, wrapValueOrErrors as he } from "./utils.js";
42
+ import { objectHash as Ne } from "./objectHash.js";
43
+ import { computedResult as ye } from "./computedResult.js";
44
44
  import { ReactiveFileContent as He } from "./composition/fileContent.js";
45
45
  export * from "@milaboratories/uikit";
46
+ import { default as Ze } from "./components/PlAdvancedFilter/PlAdvancedFilter.vue.js";
46
47
  export {
47
48
  be as AgGridTheme,
48
49
  m as BlockLayout,
49
50
  J as DeferredCircular,
50
- Re as MultiError,
51
- ue as PlAdvancedFilter,
52
- M as PlAgCellFile,
53
- G as PlAgCellProgress,
54
- k as PlAgCellStatusTag,
55
- B as PlAgChartHistogramCell,
51
+ we as MultiError,
52
+ Ze as PlAdvancedFilter,
53
+ ue as PlAdvancedFilterSupportedFilters,
54
+ F as PlAgCellFile,
55
+ h as PlAgCellProgress,
56
+ N as PlAgCellStatusTag,
57
+ y as PlAgChartHistogramCell,
56
58
  H as PlAgChartStackedBarCell,
57
59
  V as PlAgColumnHeader,
58
60
  Y as PlAgCsvExporter,
59
61
  j as PlAgDataTableRowNumberColId,
60
- p as PlAgDataTableV2,
62
+ s as PlAgDataTableV2,
61
63
  re as PlAgGridColumnManager,
62
64
  i as PlAgOverlayLoading,
63
65
  n as PlAgOverlayNoRows,
64
66
  $ as PlAgTextAndButtonCell,
65
67
  ae as PlAnnotations,
66
68
  me as PlAnnotationsModal,
67
- pe as PlBtnExportArchive,
69
+ se as PlBtnExportArchive,
68
70
  d as PlDataTableV2,
69
71
  te as PlTableFiltersV2,
70
72
  He as ReactiveFileContent,
71
- Te as UnresolvedError,
73
+ Re as UnresolvedError,
72
74
  A as ValueOrErrorsComponent,
73
75
  Ee as activateAgGrid,
74
76
  z as autoSizeRowNumberColumn,
75
- Be as computedResult,
77
+ ye as computedResult,
76
78
  b as createAgGridColDef,
77
79
  Ae as createModel,
78
80
  W as defaultMainMenuItems,
79
81
  xe as defineApp,
80
82
  Ce as defineStore,
81
- w as deselectAll,
82
- ve as ensureError,
83
+ v as deselectAll,
84
+ Se as ensureError,
83
85
  K as ensureNodeVisible,
84
- De as formatZodError,
85
- R as getSelectedRowsCount,
86
- T as getTotalRowsCount,
87
- Se as identity,
86
+ Te as formatZodError,
87
+ w as getSelectedRowsCount,
88
+ R as getTotalRowsCount,
89
+ De as identity,
88
90
  Ve as isDefined,
89
- v as isSelectionEnabled,
91
+ S as isSelectionEnabled,
90
92
  Oe as isZodError,
91
93
  U as makeRowNumberColDef,
92
- ke as objectHash,
93
- D as selectAll,
94
- Me as unwrapValueOrErrors,
94
+ Ne as objectHash,
95
+ T as selectAll,
96
+ Fe as unwrapValueOrErrors,
95
97
  C as useAgGridOptions,
96
98
  L as usePlDataTableSettingsV2,
97
99
  ne as useSdkPlugin,
98
- he as wrapOptionalResult,
99
- Ge as wrapValueOrErrors
100
+ Me as wrapOptionalResult,
101
+ he as wrapValueOrErrors
100
102
  };
101
103
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platforma-sdk/ui-vue",
3
- "version": "1.45.42",
3
+ "version": "1.46.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "styles": "dist/index.js",
@@ -25,10 +25,11 @@
25
25
  "d3-format": "^3.1.0",
26
26
  "zod": "~3.23.8",
27
27
  "@zip.js/zip.js": "^2.8.2",
28
- "@milaboratories/biowasm-tools": "2.0.0",
29
- "@milaboratories/ptabler-expression-js": "1.1.4",
30
- "@milaboratories/uikit": "2.6.4",
31
- "@platforma-sdk/model": "1.45.42"
28
+ "es-toolkit": "^1.39.10",
29
+ "@milaboratories/ptabler-expression-js": "1.1.5",
30
+ "@platforma-sdk/model": "1.46.0",
31
+ "@milaboratories/uikit": "2.7.0",
32
+ "@milaboratories/biowasm-tools": "2.0.0"
32
33
  },
33
34
  "devDependencies": {
34
35
  "happy-dom": "^15.11.7",
@@ -44,10 +45,10 @@
44
45
  "fast-json-patch": "^3.1.1",
45
46
  "@faker-js/faker": "^9.2.0",
46
47
  "@milaboratories/ts-configs": "1.0.6",
47
- "@milaboratories/eslint-config": "1.0.5",
48
- "@milaboratories/helpers": "1.12.0",
48
+ "@milaboratories/build-configs": "1.0.8",
49
49
  "@milaboratories/ts-builder": "1.0.5",
50
- "@milaboratories/build-configs": "1.0.8"
50
+ "@milaboratories/helpers": "1.12.0",
51
+ "@milaboratories/eslint-config": "1.0.5"
51
52
  },
52
53
  "scripts": {
53
54
  "test": "vitest run --passWithNoTests",
@@ -1,56 +1,51 @@
1
1
  <script lang="ts" setup>
2
- import type { PlAdvancedFilterColumnId, Filter, Operand, SourceOptionInfo } from './types';
3
- import { PlIcon16, PlDropdown, PlAutocomplete, PlAutocompleteMulti, PlTextField, PlNumberField, Slider, PlToggleSwitch } from '@milaboratories/uikit';
4
- import { computed } from 'vue';
5
- import { SUPPORTED_FILTER_TYPES, DEFAULT_FILTER_TYPE, DEFAULT_FILTERS } from './constants';
2
+ import { PlAutocomplete, PlAutocompleteMulti, PlDropdown, PlIcon16, PlNumberField, PlTextField, PlToggleSwitch, Slider } from '@milaboratories/uikit';
6
3
  import type { AnchoredPColumnId, AxisFilterByIdx, AxisFilterValue, SUniversalPColumnId } from '@platforma-sdk/model';
7
4
  import { isFilteredPColumn, parseColumnId, stringifyColumnId, type ListOptionBase } from '@platforma-sdk/model';
5
+ import { computed } from 'vue';
6
+ import type { SUPPORTED_FILTER_TYPES } from './constants';
7
+ import { DEFAULT_FILTER_TYPE, DEFAULT_FILTERS } from './constants';
8
8
  import OperandButton from './OperandButton.vue';
9
- import { getFilterInfo, getNormalizedSpec, isNumericFilter, isStringFilter } from './utils';
9
+ import type { EditableFilter, Operand, PlAdvancedFilterColumnId, SourceOptionInfo } from './types';
10
+ import { getFilterInfo, getNormalizedSpec, isNumericFilter, isPositionFilter } from './utils';
11
+
12
+ const filter = defineModel<EditableFilter>('filter', { required: true });
10
13
 
11
14
  const props = defineProps<{
15
+ isLast: boolean;
12
16
  operand: Operand;
13
- columnOptions: SourceOptionInfo[];
14
17
  enableDnd: boolean;
15
- isLast: boolean;
16
- getSuggestOptions: (params: { columnId: PlAdvancedFilterColumnId; searchStr: string; axisIdx?: number }) => (Promise<ListOptionBase<string | number>[]>) |
17
- ((params: { columnId: SUniversalPColumnId; searchStr: string; axisIdx?: number }) => ListOptionBase<string | number>[]);
18
- getSuggestModel: (params: { columnId: PlAdvancedFilterColumnId; searchStr: string; axisIdx?: number }) => (Promise<ListOptionBase<string | number>>) |
19
- ((params: { columnId: PlAdvancedFilterColumnId; searchStr: string; axisIdx?: number }) => ListOptionBase<string | number>);
18
+ columnOptions: SourceOptionInfo[];
19
+ supportedFilters: typeof SUPPORTED_FILTER_TYPES;
20
+ getSuggestOptions: (params: { columnId: PlAdvancedFilterColumnId; axisIdx?: number; searchType: 'value' | 'label'; searchStr: string }) =>
21
+ ListOptionBase<string | number>[] | Promise<ListOptionBase<string | number>[]>;
20
22
  onDelete: (columnId: PlAdvancedFilterColumnId) => void;
21
23
  onChangeOperand: (op: Operand) => void;
22
24
  }>();
23
25
 
24
- const filter = defineModel<Filter>({ required: true });
25
-
26
- async function getSuggestModelMultiFn(id: PlAdvancedFilterColumnId, v: string[], axisIdx?: number): Promise<ListOptionBase<string>[]> {
27
- return Promise.all(v.map((v) => props.getSuggestModel({ columnId: id, searchStr: v, axisIdx }) as Promise<ListOptionBase<string>>));
28
- }
29
- async function getSuggestModelSingleFn(id: PlAdvancedFilterColumnId, v: string, axisIdx?: number): Promise<ListOptionBase<string>> {
30
- return props.getSuggestModel({ columnId: id, searchStr: v, axisIdx }) as Promise<ListOptionBase<string>>;
26
+ async function getSuggestOptionsFn(id: PlAdvancedFilterColumnId, type: 'value' | 'label', str: string, axisIdx?: number): Promise<ListOptionBase<string>[]> {
27
+ return props.getSuggestOptions({ columnId: id, axisIdx, searchType: type, searchStr: str }) as Promise<ListOptionBase<string>[]>;
31
28
  }
32
- async function getSuggestOptionsFn(id: PlAdvancedFilterColumnId, str: string, axisIdx?: number): Promise<ListOptionBase<string>[]> {
33
- return props.getSuggestOptions({ columnId: id, searchStr: str, axisIdx }) as Promise<ListOptionBase<string>[]>;
29
+
30
+ async function getMultiSuggestOptionsFn(id: PlAdvancedFilterColumnId, type: 'value' | 'label', str: string | string[], axisIdx?: number): Promise<ListOptionBase<string>[]> {
31
+ if (type === 'label' && typeof str === 'string') {
32
+ return getSuggestOptionsFn(id, type, str, axisIdx);
33
+ }
34
+ if (type === 'value' && Array.isArray(str)) {
35
+ const results = await Promise.all(str.map((s) => getSuggestOptionsFn(id, type, s, axisIdx)));
36
+ return results.map((x) => x[0]);
37
+ }
38
+ throw new Error('Invalid arguments combination');
34
39
  }
35
40
 
41
+ type Entries<T> = { [K in keyof T]: [K, T[K]] }[keyof T][];
36
42
  function changeFilterType() {
37
- const nextFilterInfo = getFilterInfo(filter.value.type);
38
- if (currentSpec.value && nextFilterInfo.supportedFor(currentSpec.value) && isNumericFilter(filter.value)) {
39
- // no extra changes, previous filter is compatible with new filter type
40
- return;
41
- } else if (currentSpec.value && nextFilterInfo.supportedFor(currentSpec.value) && isStringFilter(filter.value)) {
42
- // erase extra settings for string filter types, save only value and column (for example regex)
43
- filter.value = {
44
- ...DEFAULT_FILTERS[filter.value.type],
45
- value: filter.value.value,
46
- column: filter.value.column,
47
- } as Filter;
48
- } else {
49
- filter.value = {
50
- ...DEFAULT_FILTERS[filter.value.type],
51
- column: filter.value.column,
52
- };
53
- }
43
+ const defaultFilter = DEFAULT_FILTERS[filter.value.type];
44
+
45
+ filter.value = (Object.entries(defaultFilter) as Entries<EditableFilter>).reduce((res, [key, val]) => {
46
+ res[key] = filter.value[key] ?? val;
47
+ return res;
48
+ }, {} as Record<keyof EditableFilter, EditableFilter[keyof EditableFilter]>) as EditableFilter;
54
49
  }
55
50
 
56
51
  function changeSourceId(newSourceId?: PlAdvancedFilterColumnId) {
@@ -151,24 +146,28 @@ function updateAxisFilterValue(idx: number, value: AxisFilterValue | undefined)
151
146
  const currentOption = computed(() => props.columnOptions.find((op) => op.id === columnAsSourceAndFixedAxes.value.source));
152
147
  const currentSpec = computed(() => currentOption.value?.spec ? getNormalizedSpec(currentOption.value.spec) : null);
153
148
  const currentType = computed(() => currentSpec.value?.valueType);
154
- const currentError = computed(() => currentOption.value?.error || inconsistentSourceSelected.value);
155
-
156
- const filterTypesOptions = computed(() => [...SUPPORTED_FILTER_TYPES].filter((v) =>
157
- filter.value.type === v || (currentSpec.value ? getFilterInfo(v).supportedFor(currentSpec.value) : true),
158
- ).map((v) => ({ value: v, label: getFilterInfo(v).label })),
149
+ const currentError = computed(() => Boolean(currentOption.value?.error) || inconsistentSourceSelected.value);
150
+
151
+ const filterTypesOptions = computed(() => props.supportedFilters
152
+ .filter((v) => filter.value.type === v
153
+ || (currentSpec.value
154
+ ? getFilterInfo(v).supportedFor(currentSpec.value)
155
+ : true),
156
+ )
157
+ .map((v) => ({ value: v, label: getFilterInfo(v).label })),
159
158
  );
160
159
 
161
160
  const wildcardOptions = computed(() => {
162
- if (filter.value.type === 'patternFuzzyContainSubsequence') {
163
- if (currentOption.value?.alphabet === 'nucleotide') {
164
- return [{ label: 'N', value: 'N' }];
165
- }
166
- if (currentOption.value?.alphabet === 'aminoacid') {
167
- return [{ label: 'X', value: 'X' }];
168
- }
169
- return [...new Set(filter.value.value.split(''))].sort().map((v) => ({ value: v, label: v }));
161
+ if (filter.value.type !== 'patternFuzzyContainSubsequence') {
162
+ return [];
163
+ }
164
+ if (currentOption.value?.alphabet === 'nucleotide') {
165
+ return [{ label: 'N', value: 'N' }];
170
166
  }
171
- return [];
167
+ if (currentOption.value?.alphabet === 'aminoacid') {
168
+ return [{ label: 'X', value: 'X' }];
169
+ }
170
+ return [...new Set(filter.value.value.split(''))].sort().map((v) => ({ value: v, label: v }));
172
171
  });
173
172
 
174
173
  const stringMatchesError = computed(() => {
@@ -220,8 +219,7 @@ const stringMatchesError = computed(() => {
220
219
  <PlAutocomplete
221
220
  v-model="columnAsSourceAndFixedAxes.axisFiltersByIndex[value.idx]"
222
221
  :label="value.label"
223
- :options-search="(str) => getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, str, value.idx)"
224
- :model-search="(v) => getSuggestModelSingleFn(columnAsSourceAndFixedAxes.source, v as string, value.idx)"
222
+ :options-search="(str, type) => getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str, value.idx)"
225
223
  :disabled="inconsistentSourceSelected"
226
224
  :clearable="true"
227
225
  @update:model-value="(v) => updateAxisFilterValue(value.idx, v)"
@@ -266,8 +264,7 @@ const stringMatchesError = computed(() => {
266
264
  <template v-if="filter.type === 'patternEquals' || filter.type === 'patternNotEquals'" >
267
265
  <PlAutocomplete
268
266
  v-model="filter.value"
269
- :options-search="(str) => getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, str)"
270
- :model-search="(v) => getSuggestModelSingleFn(columnAsSourceAndFixedAxes.source, v as string)"
267
+ :options-search="(str, type) => getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str)"
271
268
  :disabled="inconsistentSourceSelected"
272
269
  :clearable="true"
273
270
  group-position="bottom"
@@ -276,8 +273,7 @@ const stringMatchesError = computed(() => {
276
273
  <template v-if="filter.type === 'inSet' || filter.type === 'notInSet'" >
277
274
  <PlAutocompleteMulti
278
275
  v-model="filter.value"
279
- :options-search="(str) => getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, str)"
280
- :model-search="(v) => getSuggestModelMultiFn(columnAsSourceAndFixedAxes.source, v as string[])"
276
+ :options-search="(str, type) => getMultiSuggestOptionsFn(columnAsSourceAndFixedAxes.source, type, str)"
281
277
  :disabled="inconsistentSourceSelected"
282
278
  group-position="bottom"
283
279
  />
@@ -287,6 +283,11 @@ const stringMatchesError = computed(() => {
287
283
  v-model="filter.x"
288
284
  group-position="bottom"
289
285
  />
286
+ <PlNumberField
287
+ v-if="isPositionFilter(filter)"
288
+ v-model="filter.n"
289
+ group-position="bottom"
290
+ />
290
291
  <PlTextField
291
292
  v-if="filter.type === 'patternContainSubsequence' || filter.type === 'patternNotContainSubsequence'"
292
293
  v-model="filter.value"
@@ -311,7 +312,6 @@ const stringMatchesError = computed(() => {
311
312
  </div>
312
313
  </div>
313
314
  <OperandButton
314
- :class="$style.buttonWrapper"
315
315
  :active="operand"
316
316
  :disabled="isLast"
317
317
  :on-select="onChangeOperand"
@@ -323,7 +323,6 @@ const stringMatchesError = computed(() => {
323
323
  position: relative;
324
324
  display: flex;
325
325
  flex-direction: column;
326
- margin-bottom: 8px;
327
326
  width: 100%;
328
327
  cursor: default;
329
328
  }
@@ -419,7 +418,4 @@ const stringMatchesError = computed(() => {
419
418
  background: #fff;
420
419
  }
421
420
 
422
- .buttonWrapper {
423
- margin-bottom: 8px;
424
- }
425
421
  </style>
@@ -27,7 +27,7 @@ const OPTIONS: Operand[] = ['and', 'or'];
27
27
  display: flex;
28
28
  gap: 4px;
29
29
  justify-content: center;
30
- height: 72px;
30
+ height: 30px;
31
31
  align-items: center;
32
32
  }
33
33
  .operand {