@platforma-sdk/ui-vue 1.45.42 → 1.45.45
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 +22 -38
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +10 -0
- package/dist/components/PlAdvancedFilter/{SingleFilter.vue.d.ts → FilterEditor.vue.d.ts} +12 -18
- package/dist/components/PlAdvancedFilter/FilterEditor.vue.js +10 -0
- package/dist/components/PlAdvancedFilter/FilterEditor.vue.js.map +1 -0
- package/dist/components/PlAdvancedFilter/FilterEditor.vue2.js +305 -0
- package/dist/components/PlAdvancedFilter/FilterEditor.vue2.js.map +1 -0
- package/dist/components/PlAdvancedFilter/FilterEditor.vue3.js +33 -0
- package/dist/components/PlAdvancedFilter/FilterEditor.vue3.js.map +1 -0
- package/dist/components/PlAdvancedFilter/OperandButton.vue2.js.map +1 -1
- package/dist/components/PlAdvancedFilter/OperandButton.vue3.js +9 -9
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue.d.ts +35 -16
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js +185 -145
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js.map +1 -1
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue3.js +13 -9
- package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue3.js.map +1 -1
- package/dist/components/PlAdvancedFilter/constants.d.ts +4 -4
- package/dist/components/PlAdvancedFilter/constants.js +26 -22
- package/dist/components/PlAdvancedFilter/constants.js.map +1 -1
- package/dist/components/PlAdvancedFilter/index.d.ts +4 -0
- package/dist/components/PlAdvancedFilter/index.js +9 -0
- package/dist/components/PlAdvancedFilter/index.js.map +1 -0
- package/dist/components/PlAdvancedFilter/types.d.ts +30 -34
- package/dist/components/PlAdvancedFilter/utils.d.ts +26 -0
- package/dist/components/PlAdvancedFilter/utils.js +32 -131
- package/dist/components/PlAdvancedFilter/utils.js.map +1 -1
- package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js +43 -41
- package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js.map +1 -1
- package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue3.js +2 -2
- package/dist/components/PlAnnotations/components/FilterSidebar.vue.d.ts +14 -2
- package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js +99 -90
- package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js.map +1 -1
- package/dist/components/PlAnnotations/components/FilterSidebar.vue3.js +5 -5
- package/dist/components/PlAnnotations/components/PlAnnotations.vue2.js +32 -30
- package/dist/components/PlAnnotations/components/PlAnnotations.vue2.js.map +1 -1
- package/dist/components/PlAnnotations/components/PlAnnotations.vue3.js +5 -7
- package/dist/components/PlAnnotations/components/PlAnnotations.vue3.js.map +1 -1
- package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue2.js +26 -22
- package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue2.js.map +1 -1
- package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue3.js +7 -9
- package/dist/components/PlAnnotations/components/PlAnnotationsModal.vue3.js.map +1 -1
- package/dist/components/PlAnnotations/components/style.module.css.js +13 -0
- package/dist/components/PlAnnotations/components/style.module.css.js.map +1 -0
- package/dist/components/PlAnnotations/index.d.ts +1 -0
- package/dist/index.js +35 -33
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
- package/src/components/PlAdvancedFilter/{SingleFilter.vue → FilterEditor.vue} +53 -53
- package/src/components/PlAdvancedFilter/OperandButton.vue +1 -1
- package/src/components/PlAdvancedFilter/PlAdvancedFilter.vue +155 -59
- package/src/components/PlAdvancedFilter/constants.ts +17 -11
- package/src/components/PlAdvancedFilter/index.ts +6 -0
- package/src/components/PlAdvancedFilter/types.ts +23 -54
- package/src/components/PlAdvancedFilter/utils.ts +51 -163
- package/src/components/PlAnnotations/components/AnnotationsSidebar.vue +8 -8
- package/src/components/PlAnnotations/components/FilterSidebar.vue +64 -69
- package/src/components/PlAnnotations/components/PlAnnotations.vue +4 -7
- package/src/components/PlAnnotations/components/PlAnnotationsModal.vue +5 -8
- package/src/components/PlAnnotations/components/style.module.css +16 -0
- package/src/components/PlAnnotations/index.ts +2 -0
- package/dist/components/PlAdvancedFilter/SingleFilter.vue.js +0 -10
- package/dist/components/PlAdvancedFilter/SingleFilter.vue.js.map +0 -1
- package/dist/components/PlAdvancedFilter/SingleFilter.vue2.js +0 -306
- package/dist/components/PlAdvancedFilter/SingleFilter.vue2.js.map +0 -1
- package/dist/components/PlAdvancedFilter/SingleFilter.vue3.js +0 -35
- package/dist/components/PlAdvancedFilter/SingleFilter.vue3.js.map +0 -1
- package/dist/components/PlAdvancedFilter/types.js +0 -8
- package/dist/components/PlAdvancedFilter/types.js.map +0 -1
- package/dist/components/PlAnnotations/components/DynamicForm.vue.d.ts +0 -24
- package/dist/components/PlAnnotations/components/DynamicForm.vue.js +0 -10
- package/dist/components/PlAnnotations/components/DynamicForm.vue.js.map +0 -1
- package/dist/components/PlAnnotations/components/DynamicForm.vue2.js +0 -109
- package/dist/components/PlAnnotations/components/DynamicForm.vue2.js.map +0 -1
- package/dist/components/PlAnnotations/components/DynamicForm.vue3.js +0 -9
- package/dist/components/PlAnnotations/components/DynamicForm.vue3.js.map +0 -1
- package/dist/components/PlAnnotations/utils.js +0 -20
- package/dist/components/PlAnnotations/utils.js.map +0 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineComponent as y, mergeModels as S, useModel as u, createBlock as
|
|
2
|
-
import { randomInt as
|
|
3
|
-
import { PlSidebarItem as
|
|
4
|
-
|
|
1
|
+
import { defineComponent as y, mergeModels as S, useModel as u, createBlock as I, openBlock as h, unref as o, createSlots as k, withCtx as s, createVNode as a, withModifiers as C, createTextVNode as r, normalizeClass as i, createElementVNode as p, toDisplayString as V } from "vue";
|
|
2
|
+
import { randomInt as f } from "../../../lib/util/helpers/dist/random.js";
|
|
3
|
+
import { PlSidebarItem as $, PlBtnGhost as M, PlEditableTitle as P, PlElementList as w, PlBtnSecondary as A } from "@milaboratories/uikit";
|
|
4
|
+
import v from "./style.module.css.js";
|
|
5
|
+
const T = /* @__PURE__ */ y({
|
|
5
6
|
__name: "AnnotationsSidebar",
|
|
6
7
|
props: {
|
|
7
8
|
annotation: { required: !0 },
|
|
@@ -10,40 +11,41 @@ const x = /* @__PURE__ */ y({
|
|
|
10
11
|
selectedStepIdModifiers: {}
|
|
11
12
|
},
|
|
12
13
|
emits: /* @__PURE__ */ S(["delete-schema"], ["update:annotation", "update:selectedStepId"]),
|
|
13
|
-
setup(m, { emit:
|
|
14
|
-
const l = u(m, "annotation"),
|
|
15
|
-
function
|
|
16
|
-
const n =
|
|
14
|
+
setup(m, { emit: c }) {
|
|
15
|
+
const l = u(m, "annotation"), d = u(m, "selectedStepId"), g = c;
|
|
16
|
+
function b() {
|
|
17
|
+
const n = f();
|
|
17
18
|
l.value.steps.push({
|
|
18
19
|
id: n,
|
|
19
|
-
label:
|
|
20
|
+
label: "",
|
|
20
21
|
filter: {
|
|
21
|
-
id:
|
|
22
|
+
id: f(),
|
|
22
23
|
type: "and",
|
|
23
24
|
filters: []
|
|
24
25
|
}
|
|
25
|
-
}),
|
|
26
|
+
}), d.value = n;
|
|
26
27
|
}
|
|
27
|
-
return (n, e) => (
|
|
28
|
-
"header-content":
|
|
29
|
-
|
|
28
|
+
return (n, e) => (h(), I(o($), null, k({
|
|
29
|
+
"header-content": s(() => [
|
|
30
|
+
a(o(P), {
|
|
30
31
|
modelValue: l.value.title,
|
|
31
32
|
"onUpdate:modelValue": e[0] || (e[0] = (t) => l.value.title = t),
|
|
33
|
+
class: i({ [o(v).flashing]: l.value.title.length === 0 }),
|
|
32
34
|
"max-length": 40,
|
|
33
35
|
"max-width": "600px",
|
|
34
|
-
placeholder: "Annotation
|
|
36
|
+
placeholder: "Annotation Title",
|
|
35
37
|
autofocus: l.value.title.length === 0
|
|
36
|
-
}, null, 8, ["modelValue", "autofocus"])
|
|
38
|
+
}, null, 8, ["modelValue", "class", "autofocus"])
|
|
37
39
|
]),
|
|
38
|
-
"footer-content":
|
|
39
|
-
|
|
40
|
+
"footer-content": s(() => [
|
|
41
|
+
a(o(M), {
|
|
40
42
|
icon: "delete-bin",
|
|
41
43
|
reverse: "",
|
|
42
44
|
disabled: l.value.steps.length === 0,
|
|
43
|
-
onClick: e[3] || (e[3] =
|
|
45
|
+
onClick: e[3] || (e[3] = C((t) => g("delete-schema"), ["stop"]))
|
|
44
46
|
}, {
|
|
45
|
-
default:
|
|
46
|
-
|
|
47
|
+
default: s(() => [...e[5] || (e[5] = [
|
|
48
|
+
r(" Delete Schema ", -1)
|
|
47
49
|
])]),
|
|
48
50
|
_: 1
|
|
49
51
|
}, 8, ["disabled"])
|
|
@@ -52,36 +54,36 @@ const x = /* @__PURE__ */ y({
|
|
|
52
54
|
}, [
|
|
53
55
|
l.value ? {
|
|
54
56
|
name: "body-content",
|
|
55
|
-
fn:
|
|
57
|
+
fn: s(() => [
|
|
56
58
|
p("div", {
|
|
57
|
-
class:
|
|
59
|
+
class: i([n.$style.root, { [o(v).disabled]: l.value.title.length === 0 }])
|
|
58
60
|
}, [
|
|
59
|
-
s(a(P), {
|
|
60
|
-
icon: "add",
|
|
61
|
-
onClick: g
|
|
62
|
-
}, {
|
|
63
|
-
default: o(() => [...e[4] || (e[4] = [
|
|
64
|
-
d(" Add annotation ", -1)
|
|
65
|
-
])]),
|
|
66
|
-
_: 1
|
|
67
|
-
}),
|
|
68
61
|
p("span", {
|
|
69
|
-
class:
|
|
62
|
+
class: i(n.$style.tip)
|
|
70
63
|
}, "Lower annotations override the ones above. Rearrange them by dragging.", 2),
|
|
71
|
-
|
|
64
|
+
a(o(w), {
|
|
72
65
|
items: l.value.steps,
|
|
73
66
|
"onUpdate:items": e[1] || (e[1] = (t) => l.value.steps = t),
|
|
74
67
|
"get-item-key": (t) => t.id,
|
|
75
|
-
"is-active": (t) => t.id ===
|
|
68
|
+
"is-active": (t) => t.id === d.value,
|
|
76
69
|
"item-class": n.$style.stepItem,
|
|
77
|
-
class:
|
|
78
|
-
onItemClick: e[2] || (e[2] = (t) =>
|
|
70
|
+
class: i(n.$style.steps),
|
|
71
|
+
onItemClick: e[2] || (e[2] = (t) => d.value = t.id)
|
|
79
72
|
}, {
|
|
80
|
-
"item-title":
|
|
81
|
-
|
|
73
|
+
"item-title": s(({ item: t }) => [
|
|
74
|
+
r(V(t.label), 1)
|
|
82
75
|
]),
|
|
83
76
|
_: 1
|
|
84
|
-
}, 8, ["items", "get-item-key", "is-active", "item-class", "class"])
|
|
77
|
+
}, 8, ["items", "get-item-key", "is-active", "item-class", "class"]),
|
|
78
|
+
a(o(A), {
|
|
79
|
+
icon: "add",
|
|
80
|
+
onClick: b
|
|
81
|
+
}, {
|
|
82
|
+
default: s(() => [...e[4] || (e[4] = [
|
|
83
|
+
r(" Add label ", -1)
|
|
84
|
+
])]),
|
|
85
|
+
_: 1
|
|
86
|
+
})
|
|
85
87
|
], 2)
|
|
86
88
|
]),
|
|
87
89
|
key: "0"
|
|
@@ -90,6 +92,6 @@ const x = /* @__PURE__ */ y({
|
|
|
90
92
|
}
|
|
91
93
|
});
|
|
92
94
|
export {
|
|
93
|
-
|
|
95
|
+
T as default
|
|
94
96
|
};
|
|
95
97
|
//# sourceMappingURL=AnnotationsSidebar.vue2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnnotationsSidebar.vue2.js","sources":["../../../../src/components/PlAnnotations/components/AnnotationsSidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { randomInt } from '@milaboratories/helpers';\nimport {\n PlBtnGhost,\n PlBtnSecondary,\n PlEditableTitle,\n PlElementList,\n PlSidebarItem,\n} from '@milaboratories/uikit';\nimport type { Annotation } from '../types';\n\n// Models\nconst annotation = defineModel<Annotation>('annotation', { required: true });\nconst selectedStepId = defineModel<undefined | number>('selectedStepId');\n// Emits\nconst emits = defineEmits<{\n (e: 'delete-schema'): void;\n}>();\n// Actions\nfunction handleAddStep() {\n const id = randomInt();\n annotation.value.steps.push({\n id,\n label:
|
|
1
|
+
{"version":3,"file":"AnnotationsSidebar.vue2.js","sources":["../../../../src/components/PlAnnotations/components/AnnotationsSidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { randomInt } from '@milaboratories/helpers';\nimport {\n PlBtnGhost,\n PlBtnSecondary,\n PlEditableTitle,\n PlElementList,\n PlSidebarItem,\n} from '@milaboratories/uikit';\nimport type { Annotation } from '../types';\nimport $commonStyle from './style.module.css';\n\n// Models\nconst annotation = defineModel<Annotation>('annotation', { required: true });\nconst selectedStepId = defineModel<undefined | number>('selectedStepId');\n// Emits\nconst emits = defineEmits<{\n (e: 'delete-schema'): void;\n}>();\n// Actions\nfunction handleAddStep() {\n const id = randomInt();\n annotation.value.steps.push({\n id,\n label: '',\n filter: {\n id: randomInt(),\n type: 'and',\n filters: [],\n },\n });\n selectedStepId.value = id;\n};\n</script>\n\n<template>\n <PlSidebarItem>\n <template #header-content>\n <PlEditableTitle\n v-model=\"annotation.title\"\n :class=\"{ [$commonStyle.flashing]: annotation.title.length === 0 }\"\n :max-length=\"40\"\n max-width=\"600px\"\n placeholder=\"Annotation Title\"\n :autofocus=\"annotation.title.length === 0\"\n />\n </template>\n <template v-if=\"annotation\" #body-content>\n <div :class=\"[$style.root, { [$commonStyle.disabled]: annotation.title.length === 0 }]\">\n <span :class=\"$style.tip\">Lower annotations override the ones above. Rearrange them by dragging.</span>\n\n <PlElementList\n v-model:items=\"annotation.steps\"\n :get-item-key=\"(item) => item.id\"\n :is-active=\"(item) => item.id === selectedStepId\"\n :item-class=\"$style.stepItem\"\n :class=\"$style.steps\"\n @item-click=\"(item) => selectedStepId = item.id\"\n >\n <template #item-title=\"{ item }\">\n {{ item.label }}\n </template>\n </PlElementList>\n <PlBtnSecondary icon=\"add\" @click=\"handleAddStep\">\n Add label\n </PlBtnSecondary>\n </div>\n </template>\n <template #footer-content>\n <PlBtnGhost\n icon=\"delete-bin\"\n reverse\n :disabled=\"annotation.steps.length === 0\"\n @click.stop=\"emits('delete-schema')\"\n >\n Delete Schema\n </PlBtnGhost>\n </template>\n </PlSidebarItem>\n</template>\n\n<style lang=\"scss\" module>\n@use '@milaboratories/uikit/styles/variables' as *;\n\n.root {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.tip {\n color: var(--txt-03);\n}\n\n.steps {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n\n.stepItem {\n cursor: pointer;\n}\n</style>\n"],"names":["annotation","_useModel","selectedStepId","__props","emits","__emit","handleAddStep","id","randomInt","_createBlock","_unref","PlSidebarItem","_createSlots","_createVNode","PlEditableTitle","_cache","$event","_normalizeClass","PlBtnGhost","_createElementVNode","$style","$commonStyle","PlElementList","item","_withCtx","_createTextVNode","_toDisplayString","PlBtnSecondary"],"mappings":";;;;;;;;;;;;;;AAaA,UAAMA,IAAaC,KAAwB,YAAgC,GACrEC,IAAiBD,EAA+BE,GAAC,gBAAgB,GAEjEC,IAAQC;AAId,aAASC,IAAgB;AACvB,YAAMC,IAAKC,EAAA;AACX,MAAAR,EAAW,MAAM,MAAM,KAAK;AAAA,QAC1B,IAAAO;AAAA,QACA,OAAO;AAAA,QACP,QAAQ;AAAA,UACN,IAAIC,EAAA;AAAA,UACJ,MAAM;AAAA,UACN,SAAS,CAAA;AAAA,QAAC;AAAA,MACZ,CACD,GACDN,EAAe,QAAQK;AAAA,IACzB;2BAIEE,EA0CgBC,EAAAC,CAAA,GAAA,MAAAC,EAAA;AAAA,MAzCH,oBACT,MAOE;AAAA,QAPFC,EAOEH,EAAAI,CAAA,GAAA;AAAA,UANS,YAAAd,EAAA,MAAW;AAAA,UAAX,uBAAAe,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAAhB,EAAA,MAAW,QAAKgB;AAAA,UACxB,OAAKC,EAAA,EAAA,CAAKP,KAAa,QAAQ,GAAGV,EAAA,MAAW,MAAM,WAAM,GAAA;AAAA,UACzD,cAAY;AAAA,UACb,aAAU;AAAA,UACV,aAAY;AAAA,UACX,WAAWA,EAAA,MAAW,MAAM,WAAM;AAAA,QAAA;;MAwB5B,oBACT,MAOa;AAAA,QAPba,EAOaH,EAAAQ,CAAA,GAAA;AAAA,UANX,MAAK;AAAA,UACL,SAAA;AAAA,UACC,UAAUlB,EAAA,MAAW,MAAM,WAAM;AAAA,UACjC,kCAAYI,EAAK,eAAA,GAAA,CAAA,MAAA,CAAA;AAAA,QAAA;qBACnB,MAED,CAAA,GAAAW,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA;AAAA,cAFC,mBAED,EAAA;AAAA,UAAA;;;;;;MA7Bcf,EAAA;cAAa;AAAA,cAC3B,MAkBM;AAAA,UAlBNmB,EAkBM,OAAA;AAAA,YAlBA,OAAKF,EAAA,CAAGG,EAAAA,OAAO,MAAI,EAAA,CAAKV,EAAAW,CAAA,EAAa,QAAQ,GAAGrB,EAAA,MAAW,MAAM,WAAM,GAAA,CAAA;AAAA,UAAA;YAC3EmB,EAAuG,QAAA;AAAA,cAAhG,OAAKF,EAAEG,EAAAA,OAAO,GAAG;AAAA,YAAA,GAAE,0EAAsE,CAAA;AAAA,YAEhGP,EAWgBH,EAAAY,CAAA,GAAA;AAAA,cAVN,OAAOtB,EAAA,MAAW;AAAA,cAAX,kBAAAe,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA,CAAAC,MAAAhB,EAAA,MAAW,QAAKgB;AAAA,cAC9B,gBAAY,CAAGO,MAASA,EAAK;AAAA,cAC7B,cAAYA,MAASA,EAAK,OAAOrB,EAAA;AAAA,cACjC,cAAYkB,EAAAA,OAAO;AAAA,cACnB,OAAKH,EAAEG,EAAAA,OAAO,KAAK;AAAA,cACnB,8BAAaG,MAASrB,UAAiBqB,EAAK;AAAA,YAAA;cAElC,cAAUC,EACnB,CAAgB,EADO,MAAAD,QAAI;AAAA,gBACxBE,EAAAC,EAAAH,EAAK,KAAK,GAAA,CAAA;AAAA,cAAA;;;YAGjBV,EAEiBH,EAAAiB,CAAA,GAAA;AAAA,cAFD,MAAK;AAAA,cAAO,SAAOrB;AAAA,YAAA;yBAAe,MAElD,CAAA,GAAAS,EAAA,CAAA,MAAAA,EAAA,CAAA,IAAA;AAAA,kBAFkD,eAElD,EAAA;AAAA,cAAA;;;;;;;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--txt-00: #ffffff;--txt-01: light-dark(#110529, #ffffff);--txt-02: #231842;--txt-03: #9d9eae;--txt-mask: #cfd1db;--txt-focus: #07ad3e;--txt-error: #f1222f;--txt-link: #5f31cc;--ic-00: #ffffff;--ic-01: #110529;--ic-02: #cfd1db;--ic-accent: #07ad3e;--border-color-default: #110529;--border-color-hover: #231842;--border-color-focus: #49cc49;--border-color-error: #ff5c5c;--border-color-div-grey: #e1e3eb;--border-color-div-bw: #ffffff;--btn-accent-default: #845cff;--btn-accent-hover: #9470ff;--btn-accent-press: #6f4dd6;--btn-primary-default: #110529;--btn-primary-hover: #231842;--btn-primary-press: #080214;--btn-sec-hover-white: rgba(255, 255, 255, .5);--btn-sec-hover-grey: light-dark(rgba(155, 171, 204, .16), rgba(131, 131, 163, .16));--btn-sec-press-grey: rgba(155, 171, 204, .24);--btn-active-select: rgba(99, 224, 36, .24);--btn-switcher: linear-gradient(180deg, #a1e59c 0%, #d0f5b0 100%);--btn-accent-positive-500: #ECFBE5;--dis-00: #ffffff;--dis-01: light-dark(#cfd1db, #3d3d42);--bg-base-dark: #110529;--bg-base-light: #f7f8fa;--bg-elevated-01: #ffffff;--bg-elevated-02: #e1e3eb;--bg-error: #FFF5F5;--filled-V-BG: #d0f0c0;--filled-D-BG: #ffcecc;--filled-N-BG: #faf5aa;--filled-J-BG: #dedbff;--notification-neutral: linear-gradient(90deg, #d6d9ff 0%, #fff 100%);--notification-success: linear-gradient(90deg, #c9f0b6 0%, #fff 100%);--notification-warning: linear-gradient(90deg, #fee0a3 0%, #fff 100%);--notification-error: linear-gradient(90deg, #ffb8b8 0%, #fff 100%);--gradient-blue-green: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-green-lime: linear-gradient(180deg, #a1e59c 0%, #d0f5b0 100%);--gradient-blue-violet: linear-gradient(180deg, #adb8ff 0%, #d6e9ff 100%);--gradient-blue-clear: linear-gradient(180deg, #85beff 0%, #cef 100%);--gradient-orange: linear-gradient(180deg, #ffb766 0%, #ffeaa3 100%);--gradient-mint: linear-gradient(180deg, #7dd1d1 0%, #c8fae9 100%);--gradient-lime: linear-gradient(180deg, #bfe062 0%, #e4ffad 100%);--gradient-rose: linear-gradient(0deg, #ffddd6 0%, #ff99c9 100%);--gradient-red: linear-gradient(0deg, #ffd5cc 0%, #ff9494 100%);--gradient-violet: linear-gradient(180deg, #bca3ff 0%, #e5e5ff 100%);--TT-gradient-violet: linear-gradient(180deg, #bca3ff 0%, #e5e5ff 100%);--gradient-light-lime: linear-gradient(180deg, #EBFFEB 0%, transparent 100%);--shadow-l: 0px 8px 16px -4px rgba(15, 36, 77, .16), 0px 12px 32px -4px rgba(15, 36, 77, .16);--main-spacing: 24px;--gap-v: 24px;--gap-h: 12px;--border-radius: 6px;--z-splash: 50;--z-slide-shadow: 80;--z-slide-dialog: 81;--z-dialog: 100;--z-dropdown-options: 110;--z-tooltip: 120;--z-context-menu: 1001;--scrollbar-width: 6px}[data-theme=dark]{--txt-00: #ffffff;--txt-01: #FFFFFF;--txt-02: #adaeb8;--txt-03: #60616b;--txt-mask: #3D3D42;--txt-focus: #87e087;--txt-error: #ff5c5c;--txt-link: #9470ff;--ic-00: #ffffff;--ic-01: #FFFFFF;--ic-02: #60616b;--ic-accent: #87e087;--border-color-default: #60616b;--border-color-hover: #adaeb8;--border-color-focus: #49cc49;--border-color-error: #ff5c5c;--border-color-div-grey: #232329;--border-color-div-bw: #000000;--btn-accent-default: #5f31cc;--btn-accent-hover: #5f31cc;--btn-accent-press: #5f31cc;--btn-primary-default: #5f31cc;--btn-primary-hover: #6d3ddb;--btn-primary-press: #5328b8;--btn-sec-hover-white: rgba(131, 131, 163, .16);--btn-sec-hover-grey: rgba(131, 131, 163, .16);--btn-sec-press-grey: rgba(131, 131, 163, .24);--btn-active-select: rgba(99, 224, 36, .24);--btn-switcher: #5e5e70;--dis-00: #65656b;--dis-01: #3D3D42;--bg-base-dark: #0d0d0f;--bg-base-light: #0d0d0f;--bg-elevated-01: #1b1b1f;--bg-elevated-02: #2d2d33;--bg-error: #FFF5F5;--filled-V-BG: rgba(66, 184, 66, .4);--filled-D-BG: rgba(229, 83, 229, .4);--filled-N-BG: rgba(83, 82, 102, .4);--filled-J-BG: rgba(132, 92, 255, .4);--notification-neutral: linear-gradient(90deg, #4d4d8f 0%, #292933 100%);--notification-success: linear-gradient(90deg, #305c3e 0%, #292933 100%);--notification-warning: linear-gradient(90deg, #754f2d 0%, #292933 100%);--notification-error: linear-gradient(90deg, #8f3343 0%, #292933 100%);--gradient-blue-green: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-green-lime: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-blue-violet: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-blue-clear: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-orange: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-mint: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-lime: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-rose: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-red: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-violet: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%)}.
|
|
2
|
-
const t = "
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(":root{--txt-00: #ffffff;--txt-01: light-dark(#110529, #ffffff);--txt-02: #231842;--txt-03: #9d9eae;--txt-mask: #cfd1db;--txt-focus: #07ad3e;--txt-error: #f1222f;--txt-link: #5f31cc;--ic-00: #ffffff;--ic-01: #110529;--ic-02: #cfd1db;--ic-accent: #07ad3e;--border-color-default: #110529;--border-color-hover: #231842;--border-color-focus: #49cc49;--border-color-error: #ff5c5c;--border-color-div-grey: #e1e3eb;--border-color-div-bw: #ffffff;--btn-accent-default: #845cff;--btn-accent-hover: #9470ff;--btn-accent-press: #6f4dd6;--btn-primary-default: #110529;--btn-primary-hover: #231842;--btn-primary-press: #080214;--btn-sec-hover-white: rgba(255, 255, 255, .5);--btn-sec-hover-grey: light-dark(rgba(155, 171, 204, .16), rgba(131, 131, 163, .16));--btn-sec-press-grey: rgba(155, 171, 204, .24);--btn-active-select: rgba(99, 224, 36, .24);--btn-switcher: linear-gradient(180deg, #a1e59c 0%, #d0f5b0 100%);--btn-accent-positive-500: #ECFBE5;--dis-00: #ffffff;--dis-01: light-dark(#cfd1db, #3d3d42);--bg-base-dark: #110529;--bg-base-light: #f7f8fa;--bg-elevated-01: #ffffff;--bg-elevated-02: #e1e3eb;--bg-error: #FFF5F5;--filled-V-BG: #d0f0c0;--filled-D-BG: #ffcecc;--filled-N-BG: #faf5aa;--filled-J-BG: #dedbff;--notification-neutral: linear-gradient(90deg, #d6d9ff 0%, #fff 100%);--notification-success: linear-gradient(90deg, #c9f0b6 0%, #fff 100%);--notification-warning: linear-gradient(90deg, #fee0a3 0%, #fff 100%);--notification-error: linear-gradient(90deg, #ffb8b8 0%, #fff 100%);--gradient-blue-green: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-green-lime: linear-gradient(180deg, #a1e59c 0%, #d0f5b0 100%);--gradient-blue-violet: linear-gradient(180deg, #adb8ff 0%, #d6e9ff 100%);--gradient-blue-clear: linear-gradient(180deg, #85beff 0%, #cef 100%);--gradient-orange: linear-gradient(180deg, #ffb766 0%, #ffeaa3 100%);--gradient-mint: linear-gradient(180deg, #7dd1d1 0%, #c8fae9 100%);--gradient-lime: linear-gradient(180deg, #bfe062 0%, #e4ffad 100%);--gradient-rose: linear-gradient(0deg, #ffddd6 0%, #ff99c9 100%);--gradient-red: linear-gradient(0deg, #ffd5cc 0%, #ff9494 100%);--gradient-violet: linear-gradient(180deg, #bca3ff 0%, #e5e5ff 100%);--TT-gradient-violet: linear-gradient(180deg, #bca3ff 0%, #e5e5ff 100%);--gradient-light-lime: linear-gradient(180deg, #EBFFEB 0%, transparent 100%);--shadow-l: 0px 8px 16px -4px rgba(15, 36, 77, .16), 0px 12px 32px -4px rgba(15, 36, 77, .16);--main-spacing: 24px;--gap-v: 24px;--gap-h: 12px;--border-radius: 6px;--z-splash: 50;--z-slide-shadow: 80;--z-slide-dialog: 81;--z-dialog: 100;--z-dropdown-options: 110;--z-tooltip: 120;--z-context-menu: 1001;--scrollbar-width: 6px}[data-theme=dark]{--txt-00: #ffffff;--txt-01: #FFFFFF;--txt-02: #adaeb8;--txt-03: #60616b;--txt-mask: #3D3D42;--txt-focus: #87e087;--txt-error: #ff5c5c;--txt-link: #9470ff;--ic-00: #ffffff;--ic-01: #FFFFFF;--ic-02: #60616b;--ic-accent: #87e087;--border-color-default: #60616b;--border-color-hover: #adaeb8;--border-color-focus: #49cc49;--border-color-error: #ff5c5c;--border-color-div-grey: #232329;--border-color-div-bw: #000000;--btn-accent-default: #5f31cc;--btn-accent-hover: #5f31cc;--btn-accent-press: #5f31cc;--btn-primary-default: #5f31cc;--btn-primary-hover: #6d3ddb;--btn-primary-press: #5328b8;--btn-sec-hover-white: rgba(131, 131, 163, .16);--btn-sec-hover-grey: rgba(131, 131, 163, .16);--btn-sec-press-grey: rgba(131, 131, 163, .24);--btn-active-select: rgba(99, 224, 36, .24);--btn-switcher: #5e5e70;--dis-00: #65656b;--dis-01: #3D3D42;--bg-base-dark: #0d0d0f;--bg-base-light: #0d0d0f;--bg-elevated-01: #1b1b1f;--bg-elevated-02: #2d2d33;--bg-error: #FFF5F5;--filled-V-BG: rgba(66, 184, 66, .4);--filled-D-BG: rgba(229, 83, 229, .4);--filled-N-BG: rgba(83, 82, 102, .4);--filled-J-BG: rgba(132, 92, 255, .4);--notification-neutral: linear-gradient(90deg, #4d4d8f 0%, #292933 100%);--notification-success: linear-gradient(90deg, #305c3e 0%, #292933 100%);--notification-warning: linear-gradient(90deg, #754f2d 0%, #292933 100%);--notification-error: linear-gradient(90deg, #8f3343 0%, #292933 100%);--gradient-blue-green: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-green-lime: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-blue-violet: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-blue-clear: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-orange: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-mint: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-lime: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-rose: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-red: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%);--gradient-violet: linear-gradient(0deg, #478063 0%, #2e4652 45.93%, #24223d 91.63%)}._root_126m8_131{display:flex;flex-direction:column;gap:12px}._tip_126m8_137{color:var(--txt-03)}._steps_126m8_141{display:flex;flex-direction:column;gap:6px}._stepItem_126m8_147{cursor:pointer}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
const t = "_root_126m8_131", s = "_tip_126m8_137", e = "_steps_126m8_141", o = "_stepItem_126m8_147", _ = {
|
|
3
3
|
root: t,
|
|
4
4
|
tip: s,
|
|
5
5
|
steps: e,
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ListOptionBase, PObjectId } from '@platforma-sdk/model';
|
|
2
|
+
import { PlAdvancedFilterItem } from '../../PlAdvancedFilter';
|
|
3
|
+
import { PlAdvancedFilterColumnId } from '../../PlAdvancedFilter/types';
|
|
2
4
|
import { Filter } from '../types';
|
|
3
5
|
export type Props = {
|
|
4
|
-
columns:
|
|
6
|
+
columns: PlAdvancedFilterItem[];
|
|
7
|
+
getSuggestOptions: (params: {
|
|
8
|
+
columnId: PlAdvancedFilterColumnId;
|
|
9
|
+
searchStr: string;
|
|
10
|
+
axisIdx?: number;
|
|
11
|
+
}) => ListOptionBase<string | number>[] | Promise<ListOptionBase<string | number>[]>;
|
|
12
|
+
getSuggestModel?: (params: {
|
|
13
|
+
columnId: PlAdvancedFilterColumnId;
|
|
14
|
+
searchStr: string;
|
|
15
|
+
axisIdx?: number;
|
|
16
|
+
}) => ListOptionBase<string | number> | Promise<ListOptionBase<string | number>>;
|
|
5
17
|
hasSelectedColumns?: boolean;
|
|
6
18
|
getValuesForSelectedColumns?: () => Promise<undefined | {
|
|
7
19
|
columnId: PObjectId;
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
const T = { key: 1 }, K = /* @__PURE__ */ w({
|
|
1
|
+
import { defineComponent as V, mergeModels as q, useModel as E, computed as k, createBlock as r, createCommentVNode as p, openBlock as u, unref as s, withCtx as a, createVNode as c, normalizeClass as d, createElementVNode as x, createTextVNode as g } from "vue";
|
|
2
|
+
import { randomInt as i } from "../../../lib/util/helpers/dist/random.js";
|
|
3
|
+
import { PlSidebarItem as T, PlBtnSecondary as f, PlEditableTitle as A } from "@milaboratories/uikit";
|
|
4
|
+
import M from "../../PlAdvancedFilter/PlAdvancedFilter.vue.js";
|
|
5
|
+
import S from "./style.module.css.js";
|
|
6
|
+
const I = /* @__PURE__ */ V({
|
|
8
7
|
__name: "FilterSidebar",
|
|
9
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ q({
|
|
10
9
|
columns: {},
|
|
10
|
+
getSuggestOptions: { type: Function },
|
|
11
|
+
getSuggestModel: { type: Function },
|
|
11
12
|
hasSelectedColumns: { type: Boolean },
|
|
12
13
|
getValuesForSelectedColumns: { type: Function }
|
|
13
14
|
}, {
|
|
@@ -15,106 +16,114 @@ const T = { key: 1 }, K = /* @__PURE__ */ w({
|
|
|
15
16
|
stepModifiers: {}
|
|
16
17
|
}),
|
|
17
18
|
emits: ["update:step"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
id:
|
|
19
|
+
setup(m) {
|
|
20
|
+
const e = E(m, "step"), t = m, v = k(() => t.hasSelectedColumns !== void 0 && t.getValuesForSelectedColumns !== void 0), b = () => {
|
|
21
|
+
e.value.filter.filters.push({
|
|
22
|
+
id: i(),
|
|
22
23
|
isExpanded: !0,
|
|
23
|
-
type:
|
|
24
|
+
type: "or",
|
|
25
|
+
filters: [
|
|
26
|
+
{
|
|
27
|
+
id: i(),
|
|
28
|
+
type: "isNA",
|
|
29
|
+
column: t.columns[0].id
|
|
30
|
+
}
|
|
31
|
+
]
|
|
24
32
|
});
|
|
25
33
|
};
|
|
26
|
-
async function
|
|
27
|
-
if (
|
|
28
|
-
const
|
|
29
|
-
if (!
|
|
30
|
-
const { columnId: l, values:
|
|
31
|
-
|
|
32
|
-
id:
|
|
33
|
-
name: `Selected list (${
|
|
34
|
+
async function h() {
|
|
35
|
+
if (t.hasSelectedColumns === void 0 || t.getValuesForSelectedColumns === void 0) return;
|
|
36
|
+
const n = await t.getValuesForSelectedColumns();
|
|
37
|
+
if (!n || n.values.length === 0) return;
|
|
38
|
+
const { columnId: l, values: o } = n, C = o.slice(0, 3).join(", ") + (o.length > 3 ? ` and ${o.length - 3} more` : "");
|
|
39
|
+
e.value.filter.filters.push({
|
|
40
|
+
id: i(),
|
|
41
|
+
name: `Selected list (${C})`,
|
|
34
42
|
isExpanded: !1,
|
|
35
43
|
type: "or",
|
|
36
|
-
filters:
|
|
37
|
-
id:
|
|
44
|
+
filters: o.map((F, N) => ({
|
|
45
|
+
id: N,
|
|
38
46
|
type: "patternEquals",
|
|
39
47
|
column: l,
|
|
40
|
-
value:
|
|
48
|
+
value: F
|
|
41
49
|
}))
|
|
42
50
|
});
|
|
43
51
|
}
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const y = [
|
|
53
|
+
"isNA",
|
|
54
|
+
"isNotNA",
|
|
55
|
+
"greaterThan",
|
|
56
|
+
"greaterThanOrEqual",
|
|
57
|
+
"lessThan",
|
|
58
|
+
"lessThanOrEqual",
|
|
59
|
+
"patternEquals",
|
|
60
|
+
"patternNotEquals",
|
|
61
|
+
"patternContainSubsequence",
|
|
62
|
+
"patternNotContainSubsequence",
|
|
63
|
+
"equal",
|
|
64
|
+
"notEqual",
|
|
65
|
+
"topN",
|
|
66
|
+
"bottomN"
|
|
67
|
+
];
|
|
68
|
+
return (n, l) => e.value ? (u(), r(s(T), { key: 0 }, {
|
|
69
|
+
"header-content": a(() => [
|
|
70
|
+
(u(), r(s(A), {
|
|
71
|
+
key: e.value.id,
|
|
72
|
+
modelValue: e.value.label,
|
|
73
|
+
"onUpdate:modelValue": l[0] || (l[0] = (o) => e.value.label = o),
|
|
74
|
+
class: d({ [s(S).flashing]: e.value.label.length === 0 }),
|
|
54
75
|
"max-length": 40,
|
|
55
76
|
"max-width": "600px",
|
|
56
|
-
placeholder: "
|
|
57
|
-
autofocus:
|
|
58
|
-
}, null, 8, ["modelValue", "autofocus"]))
|
|
77
|
+
placeholder: "Filter Name",
|
|
78
|
+
autofocus: e.value.label.length === 0
|
|
79
|
+
}, null, 8, ["modelValue", "class", "autofocus"]))
|
|
59
80
|
]),
|
|
60
|
-
"body-content":
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
])]),
|
|
87
|
-
_: 1
|
|
88
|
-
}, 8, ["disabled"])) : f("", !0)
|
|
89
|
-
], 2),
|
|
90
|
-
g(s(D), {
|
|
91
|
-
items: o.value.filter.filters,
|
|
92
|
-
"onUpdate:items": l[1] || (l[1] = (e) => o.value.filter.filters = e),
|
|
93
|
-
"get-item-key": (e) => e.id,
|
|
94
|
-
"is-expanded": (e) => !!e.isExpanded,
|
|
95
|
-
"on-expand": (e) => e.isExpanded = !e.isExpanded
|
|
96
|
-
}, {
|
|
97
|
-
"item-title": n(({ item: e }) => [
|
|
98
|
-
p(F(k(e)), 1)
|
|
99
|
-
]),
|
|
100
|
-
"item-content": n(({ item: e, index: i }) => [
|
|
101
|
-
e.type !== "or" && e.type !== "and" ? (d(), r(L, {
|
|
81
|
+
"body-content": a(() => [
|
|
82
|
+
c(s(M), {
|
|
83
|
+
filters: e.value.filter,
|
|
84
|
+
"onUpdate:filters": l[1] || (l[1] = (o) => e.value.filter = o),
|
|
85
|
+
class: d([n.$style.root, { [s(S).disabled]: e.value.label.length === 0 }]),
|
|
86
|
+
items: t.columns,
|
|
87
|
+
"supported-filters": y,
|
|
88
|
+
"get-suggest-model": t.getSuggestModel,
|
|
89
|
+
"get-suggest-options": t.getSuggestOptions,
|
|
90
|
+
"enable-dnd": !1,
|
|
91
|
+
"enable-add-group-button": !0
|
|
92
|
+
}, {
|
|
93
|
+
"add-group-buttons": a(() => [
|
|
94
|
+
x("div", {
|
|
95
|
+
class: d(n.$style.actions)
|
|
96
|
+
}, [
|
|
97
|
+
c(s(f), {
|
|
98
|
+
icon: "add",
|
|
99
|
+
onClick: b
|
|
100
|
+
}, {
|
|
101
|
+
default: a(() => [...l[2] || (l[2] = [
|
|
102
|
+
g(" Add Filter ", -1)
|
|
103
|
+
])]),
|
|
104
|
+
_: 1
|
|
105
|
+
}),
|
|
106
|
+
v.value ? (u(), r(s(f), {
|
|
102
107
|
key: 0,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
icon: "add",
|
|
109
|
+
disabled: !t.hasSelectedColumns,
|
|
110
|
+
onClick: h
|
|
111
|
+
}, {
|
|
112
|
+
default: a(() => [...l[3] || (l[3] = [
|
|
113
|
+
g(" From selection ", -1)
|
|
114
|
+
])]),
|
|
115
|
+
_: 1
|
|
116
|
+
}, 8, ["disabled"])) : p("", !0)
|
|
117
|
+
], 2)
|
|
118
|
+
]),
|
|
119
|
+
_: 1
|
|
120
|
+
}, 8, ["filters", "class", "items", "get-suggest-model", "get-suggest-options"])
|
|
112
121
|
]),
|
|
113
122
|
_: 1
|
|
114
|
-
})) :
|
|
123
|
+
})) : p("", !0);
|
|
115
124
|
}
|
|
116
125
|
});
|
|
117
126
|
export {
|
|
118
|
-
|
|
127
|
+
I as default
|
|
119
128
|
};
|
|
120
129
|
//# sourceMappingURL=FilterSidebar.vue2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterSidebar.vue2.js","sources":["../../../../src/components/PlAnnotations/components/FilterSidebar.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type Props = {\n columns:
|
|
1
|
+
{"version":3,"file":"FilterSidebar.vue2.js","sources":["../../../../src/components/PlAnnotations/components/FilterSidebar.vue"],"sourcesContent":["<script lang=\"ts\">\nexport type Props = {\n columns: PlAdvancedFilterItem[];\n\n getSuggestOptions: (params: { columnId: PlAdvancedFilterColumnId; searchStr: string; axisIdx?: number }) =>\n ListOptionBase<string | number>[] | Promise<ListOptionBase<string | number>[]>;\n // @todo: can be optional\n getSuggestModel?: (params: { columnId: PlAdvancedFilterColumnId; searchStr: string; axisIdx?: number }) =>\n ListOptionBase<string | number> | Promise<ListOptionBase<string | number>>;\n\n hasSelectedColumns?: boolean;\n getValuesForSelectedColumns?: () => Promise<undefined | { columnId: PObjectId; values: string[] }>;\n};\n</script>\n<script setup lang=\"ts\">\nimport { randomInt } from '@milaboratories/helpers';\nimport {\n PlBtnSecondary,\n PlEditableTitle,\n PlSidebarItem,\n} from '@milaboratories/uikit';\nimport type { ListOptionBase, PObjectId, SUniversalPColumnId } from '@platforma-sdk/model';\nimport { computed } from 'vue';\nimport type { PlAdvancedFilterFilter, PlAdvancedFilterSupportedFilters } from '../../PlAdvancedFilter';\nimport { PlAdvancedFilter, type PlAdvancedFilterItem } from '../../PlAdvancedFilter';\nimport type { PlAdvancedFilterColumnId } from '../../PlAdvancedFilter/types';\nimport type { Filter } from '../types';\n\nimport $commonStyle from './style.module.css';\n\n// Models\nconst step = defineModel<Filter>('step', { required: true });\n// Props\nconst props = defineProps<Props>();\n// State\nconst withSelection = computed(() => {\n return props.hasSelectedColumns !== undefined && props.getValuesForSelectedColumns !== undefined;\n});\n// Actions\nconst addFilterPlaceholder = () => {\n step.value.filter.filters.push({\n id: randomInt(),\n isExpanded: true,\n type: 'or',\n filters: [\n {\n id: randomInt(),\n type: 'isNA',\n column: props.columns[0].id as SUniversalPColumnId,\n },\n ],\n });\n};\n\nasync function addFilterFromSelected() {\n if (props.hasSelectedColumns === undefined || props.getValuesForSelectedColumns === undefined) return;\n\n const data = await props.getValuesForSelectedColumns();\n if (!data || data.values.length === 0) return;\n\n const { columnId, values } = data;\n const shortReminder = values.slice(0, 3).join(', ') + (values.length > 3 ? ` and ${values.length - 3} more` : '');\n\n step.value.filter.filters.push({\n id: randomInt(),\n name: `Selected list (${shortReminder})`,\n isExpanded: false,\n type: 'or',\n filters: values.map((value, i) => ({\n id: i,\n type: 'patternEquals',\n column: columnId as SUniversalPColumnId,\n value,\n })),\n });\n}\n\nconst supportedFilters = [\n 'isNA',\n 'isNotNA',\n 'greaterThan',\n 'greaterThanOrEqual',\n 'lessThan',\n 'lessThanOrEqual',\n 'patternEquals',\n 'patternNotEquals',\n 'patternContainSubsequence',\n 'patternNotContainSubsequence',\n 'equal',\n 'notEqual',\n 'topN',\n 'bottomN',\n] as typeof PlAdvancedFilterSupportedFilters[number][];\n</script>\n\n<template>\n <PlSidebarItem v-if=\"step\">\n <template #header-content>\n <PlEditableTitle\n :key=\"step.id\"\n v-model=\"step.label\"\n :class=\"{ [$commonStyle.flashing]: step.label.length === 0 }\"\n :max-length=\"40\"\n max-width=\"600px\"\n placeholder=\"Filter Name\"\n :autofocus=\"step.label.length === 0\"\n />\n </template>\n <template #body-content>\n <PlAdvancedFilter\n v-model:filters=\"(step.filter as PlAdvancedFilterFilter)\"\n :class=\"[$style.root, { [$commonStyle.disabled]: step.label.length === 0 }]\"\n :items=\"props.columns\"\n :supported-filters=\"supportedFilters\"\n :get-suggest-model=\"props.getSuggestModel\"\n :get-suggest-options=\"props.getSuggestOptions\"\n :enable-dnd=\"false\"\n :enable-add-group-button=\"true\"\n >\n <template #add-group-buttons>\n <div :class=\"$style.actions\">\n <PlBtnSecondary icon=\"add\" @click=\"addFilterPlaceholder\">\n Add Filter\n </PlBtnSecondary>\n <PlBtnSecondary v-if=\"withSelection\" icon=\"add\" :disabled=\"!props.hasSelectedColumns\" @click=\"addFilterFromSelected\">\n From selection\n </PlBtnSecondary>\n </div>\n </template>\n </PlAdvancedFilter>\n </template>\n </PlSidebarItem>\n</template>\n\n<style module>\n.root {\n display: flex;\n flex-direction: column;\n gap: 12px;\n}\n\n.actions {\n display: flex;\n flex-direction: row;\n gap: 12px;\n}\n</style>\n"],"names":["step","_useModel","__props","props","withSelection","computed","addFilterPlaceholder","randomInt","addFilterFromSelected","data","columnId","values","shortReminder","value","i","supportedFilters","_createBlock","_unref","PlSidebarItem","PlEditableTitle","_cache","$event","_normalizeClass","_createVNode","PlAdvancedFilter","$style","$commonStyle","_createElementVNode","PlBtnSecondary"],"mappings":"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"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("
|
|
2
|
-
const o = "
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode("._root_ynuss_2{display:flex;flex-direction:column;gap:12px}._actions_ynuss_8{display:flex;flex-direction:row;gap:12px}")),document.head.appendChild(e)}}catch(n){console.error("vite-plugin-css-injected-by-js",n)}})();
|
|
2
|
+
const o = "_root_ynuss_2", s = "_actions_ynuss_8", t = {
|
|
3
3
|
root: o,
|
|
4
|
-
actions:
|
|
4
|
+
actions: s
|
|
5
5
|
};
|
|
6
6
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
s as actions,
|
|
8
|
+
t as default,
|
|
9
9
|
o as root
|
|
10
10
|
};
|
|
11
11
|
//# sourceMappingURL=FilterSidebar.vue3.js.map
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as S, mergeModels as f, useModel as v, shallowRef as C, computed as h, effect as y, createBlock as i, openBlock as d, unref as F, withCtx as c, createCommentVNode as I, normalizeClass as m, createVNode as b } from "vue";
|
|
2
2
|
import { isNil as r } from "../../../lib/util/helpers/dist/utils.js";
|
|
3
3
|
import { useConfirm as V, PlSidebarGroup as D } from "@milaboratories/uikit";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const U = /* @__PURE__ */
|
|
4
|
+
import M from "./AnnotationsSidebar.vue.js";
|
|
5
|
+
import w from "./FilterSidebar.vue.js";
|
|
6
|
+
const U = /* @__PURE__ */ S({
|
|
7
7
|
__name: "PlAnnotations",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ f({
|
|
9
9
|
columns: {},
|
|
10
|
+
getSuggestOptions: { type: Function },
|
|
11
|
+
getSuggestModel: { type: Function },
|
|
10
12
|
hasSelectedColumns: { type: Boolean },
|
|
11
13
|
getValuesForSelectedColumns: { type: Function },
|
|
12
14
|
onDeleteSchema: { type: Function }
|
|
@@ -15,9 +17,9 @@ const U = /* @__PURE__ */ f({
|
|
|
15
17
|
annotationModifiers: {}
|
|
16
18
|
}),
|
|
17
19
|
emits: ["update:annotation"],
|
|
18
|
-
setup(
|
|
19
|
-
const n =
|
|
20
|
-
|
|
20
|
+
setup(u) {
|
|
21
|
+
const n = v(u, "annotation"), e = u, t = C(void 0), a = h(() => r(t.value) || r(n.value) ? void 0 : n.value.steps.find((o) => o.id === t.value));
|
|
22
|
+
y(function() {
|
|
21
23
|
t.value === void 0 && n.value.steps.length > 0 && (t.value = n.value.steps[0].id);
|
|
22
24
|
});
|
|
23
25
|
const p = V({
|
|
@@ -26,38 +28,38 @@ const U = /* @__PURE__ */ f({
|
|
|
26
28
|
confirmLabel: "Yes, reset",
|
|
27
29
|
cancelLabel: "No, cancel"
|
|
28
30
|
});
|
|
29
|
-
async function
|
|
30
|
-
var
|
|
31
|
-
await p() && (t.value = void 0, (
|
|
31
|
+
async function g() {
|
|
32
|
+
var o;
|
|
33
|
+
await p() && (t.value = void 0, (o = e.onDeleteSchema) == null || o.call(e));
|
|
32
34
|
}
|
|
33
|
-
return (
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"item-0": m(() => [
|
|
37
|
-
F(w, {
|
|
35
|
+
return (o, s) => (d(), i(F(D), null, {
|
|
36
|
+
"item-0": c(() => [
|
|
37
|
+
b(M, {
|
|
38
38
|
annotation: n.value,
|
|
39
|
-
"onUpdate:annotation":
|
|
39
|
+
"onUpdate:annotation": s[0] || (s[0] = (l) => n.value = l),
|
|
40
40
|
selectedStepId: t.value,
|
|
41
|
-
"onUpdate:selectedStepId":
|
|
42
|
-
class:
|
|
43
|
-
columns:
|
|
44
|
-
onDeleteSchema:
|
|
41
|
+
"onUpdate:selectedStepId": s[1] || (s[1] = (l) => t.value = l),
|
|
42
|
+
class: m(o.$style.sidebarItem),
|
|
43
|
+
columns: e.columns,
|
|
44
|
+
onDeleteSchema: g
|
|
45
45
|
}, null, 8, ["annotation", "selectedStepId", "class", "columns"])
|
|
46
46
|
]),
|
|
47
|
-
"item-1":
|
|
48
|
-
a.value ? (d(),
|
|
47
|
+
"item-1": c(() => [
|
|
48
|
+
a.value ? (d(), i(w, {
|
|
49
49
|
key: 0,
|
|
50
50
|
step: a.value,
|
|
51
|
-
"onUpdate:step":
|
|
52
|
-
class:
|
|
53
|
-
columns:
|
|
51
|
+
"onUpdate:step": s[2] || (s[2] = (l) => a.value = l),
|
|
52
|
+
class: m(o.$style.sidebarItem),
|
|
53
|
+
columns: e.columns,
|
|
54
|
+
"get-suggest-model": e.getSuggestModel,
|
|
55
|
+
"get-suggest-options": e.getSuggestOptions,
|
|
54
56
|
selectedStepId: t.value,
|
|
55
|
-
hasSelectedColumns:
|
|
56
|
-
getValuesForSelectedColumns:
|
|
57
|
-
}, null, 8, ["step", "class", "columns", "selectedStepId", "hasSelectedColumns", "getValuesForSelectedColumns"])) :
|
|
57
|
+
hasSelectedColumns: e.hasSelectedColumns,
|
|
58
|
+
getValuesForSelectedColumns: e.getValuesForSelectedColumns
|
|
59
|
+
}, null, 8, ["step", "class", "columns", "get-suggest-model", "get-suggest-options", "selectedStepId", "hasSelectedColumns", "getValuesForSelectedColumns"])) : I("", !0)
|
|
58
60
|
]),
|
|
59
61
|
_: 1
|
|
60
|
-
}
|
|
62
|
+
}));
|
|
61
63
|
}
|
|
62
64
|
});
|
|
63
65
|
export {
|