@platforma-sdk/ui-vue 1.48.10 → 1.48.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +13 -12
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-type-check.log +1 -1
- package/CHANGELOG.md +9 -0
- package/dist/AgGridVue/useAgGridOptions.js +36 -35
- package/dist/AgGridVue/useAgGridOptions.js.map +1 -1
- package/dist/components/PlAgDataTable/PlAgRowCount.vue.js +8 -7
- package/dist/components/PlAgDataTable/PlAgRowCount.vue.js.map +1 -1
- package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.js +10 -9
- package/dist/components/PlAgRowNumCheckbox/PlAgRowNumCheckbox.vue.js.map +1 -1
- package/dist/components/PlAgRowNumHeader.vue.js +9 -8
- package/dist/components/PlAgRowNumHeader.vue.js.map +1 -1
- package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue.d.ts.map +1 -1
- package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js +47 -42
- package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue2.js.map +1 -1
- package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue3.js +13 -9
- package/dist/components/PlAnnotations/components/AnnotationsSidebar.vue3.js.map +1 -1
- package/dist/components/PlAnnotations/components/FilterSidebar.vue.d.ts.map +1 -1
- package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js +27 -25
- package/dist/components/PlAnnotations/components/FilterSidebar.vue2.js.map +1 -1
- package/dist/components/PlAnnotations/components/PlAnnotations.vue2.js.map +1 -1
- package/dist/components/PlAnnotations/utils.d.ts +1 -0
- package/dist/components/PlAnnotations/utils.d.ts.map +1 -1
- package/dist/components/PlAnnotations/utils.js +9 -0
- package/dist/components/PlAnnotations/utils.js.map +1 -0
- package/package.json +6 -6
- package/src/components/PlAnnotations/components/AnnotationsSidebar.vue +21 -4
- package/src/components/PlAnnotations/components/FilterSidebar.vue +2 -0
- package/src/components/PlAnnotations/utils.ts +7 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlAgRowNumHeader.vue.js","sources":["../../src/components/PlAgRowNumHeader.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { PlCheckbox } from '@milaboratories/uikit';\nimport type { IHeaderParams } from 'ag-grid-enterprise';\nimport { computed, onBeforeMount, onBeforeUnmount, ref } from 'vue';\nimport { deselectAll, getSelectedRowsCount, getTotalRowsCount, isSelectionEnabled, selectAll } from '../lib';\n\nconst { params } = defineProps<{\n params: IHeaderParams;\n}>();\n\nconst selectedRowCount = ref(getSelectedRowsCount(params.api));\nconst totalRowCount = ref(getTotalRowsCount(params.api));\nconst isSelectable = ref(isSelectionEnabled(params.api));\n\nconst someRowsSelected = computed(() =>\n selectedRowCount.value > 0,\n);\n\nconst allRowsSelected = computed(() =>\n someRowsSelected.value\n && selectedRowCount.value === totalRowCount.value,\n);\n\nfunction toggleSelectAll() {\n if (someRowsSelected.value) {\n deselectAll(params.api);\n } else {\n selectAll(params.api);\n }\n}\n\nfunction updateRowCounts() {\n selectedRowCount.value = getSelectedRowsCount(params.api);\n totalRowCount.value = getTotalRowsCount(params.api);\n}\n\nfunction updateIsSelectable() {\n isSelectable.value = isSelectionEnabled(params.api);\n}\n\nonBeforeMount(() => {\n params.api.addEventListener('selectionChanged', updateRowCounts);\n params.api.addEventListener('rowDataUpdated', updateRowCounts);\n params.api.addEventListener('modelUpdated', updateRowCounts);\n params.api.addEventListener('stateUpdated', updateIsSelectable);\n});\n\nonBeforeUnmount(() => {\n params.api.removeEventListener('selectionChanged', updateRowCounts);\n params.api.removeEventListener('rowDataUpdated', updateRowCounts);\n params.api.removeEventListener('modelUpdated', updateRowCounts);\n params.api.removeEventListener('stateUpdated', updateIsSelectable);\n});\n</script>\n\n<template>\n <div\n style=\"\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n \"\n >\n <PlCheckbox\n v-if=\"isSelectable\"\n :model-value=\"someRowsSelected\"\n :indeterminate=\"someRowsSelected && !allRowsSelected\"\n @update:model-value=\"toggleSelectAll\"\n />\n <span v-else>\n {{ params.displayName }}\n </span>\n </div>\n</template>\n"],"names":["selectedRowCount","ref","getSelectedRowsCount","__props","totalRowCount","getTotalRowsCount","isSelectable","isSelectionEnabled","someRowsSelected","computed","allRowsSelected","toggleSelectAll","deselectAll","selectAll","updateRowCounts","updateIsSelectable","onBeforeMount","onBeforeUnmount","_openBlock","_createElementBlock","_hoisted_1","_createBlock","_unref","PlCheckbox","_hoisted_2","_toDisplayString"],"mappings":"
|
|
1
|
+
{"version":3,"file":"PlAgRowNumHeader.vue.js","sources":["../../src/components/PlAgRowNumHeader.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport { PlCheckbox } from '@milaboratories/uikit';\nimport type { IHeaderParams } from 'ag-grid-enterprise';\nimport { computed, onBeforeMount, onBeforeUnmount, ref } from 'vue';\nimport { deselectAll, getSelectedRowsCount, getTotalRowsCount, isSelectionEnabled, selectAll } from '../lib';\n\nconst { params } = defineProps<{\n params: IHeaderParams;\n}>();\n\nconst selectedRowCount = ref(getSelectedRowsCount(params.api));\nconst totalRowCount = ref(getTotalRowsCount(params.api));\nconst isSelectable = ref(isSelectionEnabled(params.api));\n\nconst someRowsSelected = computed(() =>\n selectedRowCount.value > 0,\n);\n\nconst allRowsSelected = computed(() =>\n someRowsSelected.value\n && selectedRowCount.value === totalRowCount.value,\n);\n\nfunction toggleSelectAll() {\n if (someRowsSelected.value) {\n deselectAll(params.api);\n } else {\n selectAll(params.api);\n }\n}\n\nfunction updateRowCounts() {\n selectedRowCount.value = getSelectedRowsCount(params.api);\n totalRowCount.value = getTotalRowsCount(params.api);\n}\n\nfunction updateIsSelectable() {\n isSelectable.value = isSelectionEnabled(params.api);\n}\n\nonBeforeMount(() => {\n params.api.addEventListener('selectionChanged', updateRowCounts);\n params.api.addEventListener('rowDataUpdated', updateRowCounts);\n params.api.addEventListener('modelUpdated', updateRowCounts);\n params.api.addEventListener('stateUpdated', updateIsSelectable);\n});\n\nonBeforeUnmount(() => {\n params.api.removeEventListener('selectionChanged', updateRowCounts);\n params.api.removeEventListener('rowDataUpdated', updateRowCounts);\n params.api.removeEventListener('modelUpdated', updateRowCounts);\n params.api.removeEventListener('stateUpdated', updateIsSelectable);\n});\n</script>\n\n<template>\n <div\n style=\"\n position: absolute;\n inset: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n \"\n >\n <PlCheckbox\n v-if=\"isSelectable\"\n :model-value=\"someRowsSelected\"\n :indeterminate=\"someRowsSelected && !allRowsSelected\"\n @update:model-value=\"toggleSelectAll\"\n />\n <span v-else>\n {{ params.displayName }}\n </span>\n </div>\n</template>\n"],"names":["selectedRowCount","ref","getSelectedRowsCount","__props","totalRowCount","getTotalRowsCount","isSelectable","isSelectionEnabled","someRowsSelected","computed","allRowsSelected","toggleSelectAll","deselectAll","selectAll","updateRowCounts","updateIsSelectable","onBeforeMount","onBeforeUnmount","_openBlock","_createElementBlock","_hoisted_1","_createBlock","_unref","PlCheckbox","_hoisted_2","_toDisplayString"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAmBC,EAAIC,EAAqBC,EAAA,OAAO,GAAG,CAAC,GACvDC,IAAgBH,EAAII,EAAkBF,EAAA,OAAO,GAAG,CAAC,GACjDG,IAAeL,EAAIM,EAAmBJ,EAAA,OAAO,GAAG,CAAC,GAEjDK,IAAmBC;AAAA,MAAS,MAChCT,EAAiB,QAAQ;AAAA,IAAA,GAGrBU,IAAkBD;AAAA,MAAS,MAC/BD,EAAiB,SACdR,EAAiB,UAAUI,EAAc;AAAA,IAAA;AAG9C,aAASO,IAAkB;AACzB,MAAIH,EAAiB,QACnBI,EAAYT,EAAA,OAAO,GAAG,IAEtBU,EAAUV,EAAA,OAAO,GAAG;AAAA,IAExB;AAEA,aAASW,IAAkB;AACzB,MAAAd,EAAiB,QAAQE,EAAqBC,SAAO,GAAG,GACxDC,EAAc,QAAQC,EAAkBF,SAAO,GAAG;AAAA,IACpD;AAEA,aAASY,IAAqB;AAC5B,MAAAT,EAAa,QAAQC,EAAmBJ,SAAO,GAAG;AAAA,IACpD;AAEA,WAAAa,EAAc,MAAM;AAClB,MAAAb,EAAA,OAAO,IAAI,iBAAiB,oBAAoBW,CAAe,GAC/DX,EAAA,OAAO,IAAI,iBAAiB,kBAAkBW,CAAe,GAC7DX,EAAA,OAAO,IAAI,iBAAiB,gBAAgBW,CAAe,GAC3DX,EAAA,OAAO,IAAI,iBAAiB,gBAAgBY,CAAkB;AAAA,IAChE,CAAC,GAEDE,EAAgB,MAAM;AACpB,MAAAd,EAAA,OAAO,IAAI,oBAAoB,oBAAoBW,CAAe,GAClEX,EAAA,OAAO,IAAI,oBAAoB,kBAAkBW,CAAe,GAChEX,EAAA,OAAO,IAAI,oBAAoB,gBAAgBW,CAAe,GAC9DX,EAAA,OAAO,IAAI,oBAAoB,gBAAgBY,CAAkB;AAAA,IACnE,CAAC,cAICG,EAAA,GAAAC,EAkBM,OAlBNC,GAkBM;AAAA,MARId,EAAA,cADRe,EAKEC,EAAAC,CAAA,GAAA;AAAA;QAHC,eAAaf,EAAA;AAAA,QACb,eAAeA,EAAA,SAAgB,CAAKE,EAAA;AAAA,QACpC,uBAAoBC;AAAA,MAAA,uDAEvBQ,EAEO,QAAAK,GAAAC,EADFtB,EAAA,OAAO,WAAW,GAAA,CAAA;AAAA,IAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnnotationsSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/PlAnnotations/components/AnnotationsSidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnnotationsSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/PlAnnotations/components/AnnotationsSidebar.vue"],"names":[],"mappings":"AAkJA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AA8B3C,KAAK,iBAAiB,GAAG;IACzB,YAAY,EAAE,UAAU,CAAC;IACzB,gBAAgB,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CACrC,CAAC;;;;;;;;;;;AAyNF,wBAQG"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { defineComponent as S, mergeModels as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as S, mergeModels as V, useModel as u, createBlock as h, openBlock as k, unref as a, createSlots as I, withCtx as o, createVNode as s, withModifiers as p, createTextVNode as r, normalizeClass as n, createElementVNode as f, toDisplayString as w } from "vue";
|
|
2
|
+
import v from "./style.module.css.js";
|
|
3
3
|
import { randomInt as b } from "../../../lib/util/helpers/dist/random.js";
|
|
4
|
-
import { PlSidebarItem as
|
|
5
|
-
|
|
4
|
+
import { PlSidebarItem as C, PlBtnGhost as $, PlEditableTitle as P, PlElementList as T, PlBtnSecondary as A, PlTextField as M } from "@milaboratories/uikit";
|
|
5
|
+
import { validateTitle as B } from "../utils.js";
|
|
6
|
+
import { isEmpty as E } from "es-toolkit/compat";
|
|
7
|
+
const z = /* @__PURE__ */ S({
|
|
6
8
|
__name: "AnnotationsSidebar",
|
|
7
9
|
props: {
|
|
8
10
|
annotation: { required: !0 },
|
|
@@ -10,41 +12,42 @@ const U = /* @__PURE__ */ S({
|
|
|
10
12
|
selectedStepId: {},
|
|
11
13
|
selectedStepIdModifiers: {}
|
|
12
14
|
},
|
|
13
|
-
emits: /* @__PURE__ */
|
|
14
|
-
setup(m, { emit:
|
|
15
|
-
const l = u(m, "annotation"), d = u(m, "selectedStepId"), g =
|
|
16
|
-
function
|
|
17
|
-
const
|
|
15
|
+
emits: /* @__PURE__ */ V(["delete-schema"], ["update:annotation", "update:selectedStepId"]),
|
|
16
|
+
setup(m, { emit: y }) {
|
|
17
|
+
const l = u(m, "annotation"), d = u(m, "selectedStepId"), g = y;
|
|
18
|
+
function c() {
|
|
19
|
+
const i = b();
|
|
18
20
|
l.value.steps.push({
|
|
19
|
-
id:
|
|
21
|
+
id: i,
|
|
20
22
|
label: "",
|
|
21
23
|
filter: {
|
|
22
24
|
id: b(),
|
|
23
25
|
type: "and",
|
|
24
26
|
filters: []
|
|
25
27
|
}
|
|
26
|
-
}), d.value =
|
|
28
|
+
}), d.value = i;
|
|
27
29
|
}
|
|
28
|
-
return (
|
|
29
|
-
"header-content":
|
|
30
|
-
|
|
30
|
+
return (i, e) => (k(), h(a(C), null, I({
|
|
31
|
+
"header-content": o(() => [
|
|
32
|
+
s(a(P), {
|
|
31
33
|
modelValue: l.value.title,
|
|
32
34
|
"onUpdate:modelValue": e[0] || (e[0] = (t) => l.value.title = t),
|
|
33
|
-
class:
|
|
35
|
+
class: n({ [a(v).flashing]: l.value.title.length === 0 }),
|
|
34
36
|
"max-length": 40,
|
|
35
37
|
"max-width": "600px",
|
|
36
38
|
placeholder: "Annotation Title",
|
|
37
|
-
autofocus: l.value.title.length === 0
|
|
38
|
-
|
|
39
|
+
autofocus: l.value.title.length === 0,
|
|
40
|
+
validate: a(B)
|
|
41
|
+
}, null, 8, ["modelValue", "class", "autofocus", "validate"])
|
|
39
42
|
]),
|
|
40
|
-
"footer-content":
|
|
41
|
-
|
|
43
|
+
"footer-content": o(() => [
|
|
44
|
+
s(a($), {
|
|
42
45
|
icon: "delete-bin",
|
|
43
46
|
reverse: "",
|
|
44
47
|
disabled: l.value.steps.length === 0,
|
|
45
48
|
onClick: e[5] || (e[5] = p((t) => g("delete-schema"), ["stop"]))
|
|
46
49
|
}, {
|
|
47
|
-
default:
|
|
50
|
+
default: o(() => [...e[7] || (e[7] = [
|
|
48
51
|
r(" Delete Schema ", -1)
|
|
49
52
|
])]),
|
|
50
53
|
_: 1
|
|
@@ -54,45 +57,47 @@ const U = /* @__PURE__ */ S({
|
|
|
54
57
|
}, [
|
|
55
58
|
l.value ? {
|
|
56
59
|
name: "body-content",
|
|
57
|
-
fn:
|
|
58
|
-
|
|
59
|
-
class:
|
|
60
|
+
fn: o(() => [
|
|
61
|
+
f("div", {
|
|
62
|
+
class: n([i.$style.root, { [a(v).disabled]: l.value.title.length === 0 }])
|
|
60
63
|
}, [
|
|
61
|
-
|
|
62
|
-
class:
|
|
64
|
+
f("span", {
|
|
65
|
+
class: n(i.$style.tip)
|
|
63
66
|
}, "Above annotations override the ones below. Rearrange them by dragging.", 2),
|
|
64
|
-
|
|
67
|
+
s(a(T), {
|
|
65
68
|
items: l.value.steps,
|
|
66
69
|
"onUpdate:items": e[1] || (e[1] = (t) => l.value.steps = t),
|
|
67
70
|
"get-item-key": (t) => t.id,
|
|
68
71
|
"is-active": (t) => t.id === d.value,
|
|
69
|
-
"item-class":
|
|
70
|
-
class:
|
|
72
|
+
"item-class": i.$style.stepItem,
|
|
73
|
+
class: n(i.$style.steps),
|
|
71
74
|
onItemClick: e[2] || (e[2] = (t) => d.value = t.id)
|
|
72
75
|
}, {
|
|
73
|
-
"item-title":
|
|
74
|
-
r(
|
|
76
|
+
"item-title": o(({ item: t }) => [
|
|
77
|
+
r(w(t.label), 1)
|
|
75
78
|
]),
|
|
76
79
|
_: 1
|
|
77
80
|
}, 8, ["items", "get-item-key", "is-active", "item-class", "class"]),
|
|
78
|
-
|
|
81
|
+
s(a(A), {
|
|
82
|
+
icon: "add",
|
|
83
|
+
onClick: c
|
|
84
|
+
}, {
|
|
85
|
+
default: o(() => [...e[6] || (e[6] = [
|
|
86
|
+
r(" Add label ", -1)
|
|
87
|
+
])]),
|
|
88
|
+
_: 1
|
|
89
|
+
}),
|
|
90
|
+
s(a(M), {
|
|
91
|
+
class: n([i.$style.defaultValue, { [i.$style.emptyDefaultValue]: a(E)(l.value.defaultValue) }]),
|
|
79
92
|
"model-value": l.value.defaultValue ?? "",
|
|
80
93
|
label: "Label remaining with",
|
|
81
94
|
placeholder: "No label",
|
|
82
95
|
clearable: "",
|
|
96
|
+
helper: "This label will be applied to the remaining rows, after all other filters are applied.",
|
|
83
97
|
onClick: e[3] || (e[3] = p(() => {
|
|
84
98
|
}, ["stop"])),
|
|
85
99
|
"onUpdate:modelValue": e[4] || (e[4] = (t) => l.value.defaultValue = t === "" ? void 0 : t)
|
|
86
|
-
}, null, 8, ["model-value"])
|
|
87
|
-
i(o(x), {
|
|
88
|
-
icon: "add",
|
|
89
|
-
onClick: y
|
|
90
|
-
}, {
|
|
91
|
-
default: n(() => [...e[6] || (e[6] = [
|
|
92
|
-
r(" Add label ", -1)
|
|
93
|
-
])]),
|
|
94
|
-
_: 1
|
|
95
|
-
})
|
|
100
|
+
}, null, 8, ["class", "model-value"])
|
|
96
101
|
], 2)
|
|
97
102
|
]),
|
|
98
103
|
key: "0"
|
|
@@ -101,6 +106,6 @@ const U = /* @__PURE__ */ S({
|
|
|
101
106
|
}
|
|
102
107
|
});
|
|
103
108
|
export {
|
|
104
|
-
|
|
109
|
+
z as default
|
|
105
110
|
};
|
|
106
111
|
//# 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 $commonStyle from './style.module.css';\n\nimport { randomInt } from '@milaboratories/helpers';\nimport {\n PlBtnGhost,\n PlBtnSecondary,\n PlEditableTitle,\n PlElementList,\n PlSidebarItem,\n PlTextField,\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: '',\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\">Above annotations override the ones below. 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\n <PlTextField\n :model-value=\"annotation.defaultValue ?? ''\"\n label=\"Label remaining with\"\n placeholder=\"No label\"\n clearable\n @click.stop\n @update:model-value=\"annotation.defaultValue = $event === '' ? undefined : $event\"\n />\n
|
|
1
|
+
{"version":3,"file":"AnnotationsSidebar.vue2.js","sources":["../../../../src/components/PlAnnotations/components/AnnotationsSidebar.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport $commonStyle from './style.module.css';\n\nimport { randomInt } from '@milaboratories/helpers';\nimport {\n PlBtnGhost,\n PlBtnSecondary,\n PlEditableTitle,\n PlElementList,\n PlSidebarItem,\n PlTextField,\n} from '@milaboratories/uikit';\nimport type { Annotation } from '../types';\nimport { validateTitle } from '../utils';\nimport { isEmpty } from 'es-toolkit/compat';\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 :validate=\"validateTitle\"\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\">Above annotations override the ones below. 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\n <PlBtnSecondary icon=\"add\" @click=\"handleAddStep\">\n Add label\n </PlBtnSecondary>\n\n <PlTextField\n :class=\"[$style.defaultValue, { [$style.emptyDefaultValue]: isEmpty(annotation.defaultValue) }]\"\n :model-value=\"annotation.defaultValue ?? ''\"\n label=\"Label remaining with\"\n placeholder=\"No label\"\n clearable\n helper=\"This label will be applied to the remaining rows, after all other filters are applied.\"\n @click.stop\n @update:model-value=\"annotation.defaultValue = $event === '' ? undefined : $event\"\n />\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\n.defaultValue {\n margin-top: 8px;\n}\n.emptyDefaultValue {\n opacity: 0.5;\n transition: opacity 0.2s ease-in-out;\n\n &:hover {\n opacity: 1;\n }\n}\n</style>\n"],"names":["annotation","_useModel","selectedStepId","__props","emits","__emit","handleAddStep","id","randomInt","_createBlock","_unref","PlSidebarItem","_createSlots","_createVNode","PlEditableTitle","_cache","$event","_normalizeClass","validateTitle","PlBtnGhost","_createElementVNode","$style","$commonStyle","PlElementList","item","_withCtx","_createTextVNode","_toDisplayString","PlBtnSecondary","PlTextField","isEmpty"],"mappings":"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"}
|
|
@@ -1,15 +1,19 @@
|
|
|
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_ire08_131{display:flex;flex-direction:column;gap:12px}._tip_ire08_137{color:var(--txt-03)}._steps_ire08_141{display:flex;flex-direction:column;gap:6px}._stepItem_ire08_147{cursor:pointer}._defaultValue_ire08_151{margin-top:8px}._emptyDefaultValue_ire08_155{opacity:.5;transition:opacity .2s ease-in-out}._emptyDefaultValue_ire08_155:hover{opacity:1}")),document.head.appendChild(e)}}catch(r){console.error("vite-plugin-css-injected-by-js",r)}})();
|
|
2
|
+
const t = "_root_ire08_131", e = "_tip_ire08_137", s = "_steps_ire08_141", _ = "_stepItem_ire08_147", a = "_defaultValue_ire08_151", l = "_emptyDefaultValue_ire08_155", o = {
|
|
3
3
|
root: t,
|
|
4
|
-
tip:
|
|
5
|
-
steps:
|
|
6
|
-
stepItem:
|
|
4
|
+
tip: e,
|
|
5
|
+
steps: s,
|
|
6
|
+
stepItem: _,
|
|
7
|
+
defaultValue: a,
|
|
8
|
+
emptyDefaultValue: l
|
|
7
9
|
};
|
|
8
10
|
export {
|
|
9
|
-
|
|
11
|
+
o as default,
|
|
12
|
+
a as defaultValue,
|
|
13
|
+
l as emptyDefaultValue,
|
|
10
14
|
t as root,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
15
|
+
_ as stepItem,
|
|
16
|
+
s as steps,
|
|
17
|
+
e as tip
|
|
14
18
|
};
|
|
15
19
|
//# sourceMappingURL=AnnotationsSidebar.vue3.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnnotationsSidebar.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AnnotationsSidebar.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/PlAnnotations/components/FilterSidebar.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterSidebar.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/PlAnnotations/components/FilterSidebar.vue"],"names":[],"mappings":"AAyJA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAuB,MAAM,sBAAsB,CAAC;AAG3F,OAAO,EAAoB,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAMvC,MAAM,MAAM,KAAK,GAAG;IAClB,OAAO,EAAE,oBAAoB,EAAE,CAAC;IAEhC,iBAAiB,EAAE,CAAC,MAAM,EAAE;QAAE,QAAQ,EAAE,wBAAwB,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAAA;KAAE,KACpI,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GAAG,OAAO,CAAC,cAAc,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC;IAEjF,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,2BAA2B,CAAC,EAAE,MAAM,OAAO,CAAC,SAAS,GAAG;QAAE,QAAQ,EAAE,SAAS,CAAC;QAAC,MAAM,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CACpG,CAAC;;UAwEM,MAAM;;;;UAAN,MAAM;;;;AAtEd,wBAqPK"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineComponent as V, mergeModels as q, useModel as E, computed as k, createBlock as r, createCommentVNode as p, openBlock as
|
|
2
|
-
import { randomInt as
|
|
1
|
+
import { defineComponent as V, mergeModels as q, useModel as E, computed as k, createBlock as r, createCommentVNode as p, openBlock as d, unref as s, withCtx as n, createVNode as c, normalizeClass as i, createElementVNode as x, createTextVNode as f } from "vue";
|
|
2
|
+
import { randomInt as u } from "../../../lib/util/helpers/dist/random.js";
|
|
3
3
|
import { PlSidebarItem as T, PlBtnSecondary as g, PlEditableTitle as A } from "@milaboratories/uikit";
|
|
4
4
|
import P from "../../PlAdvancedFilter/PlAdvancedFilter.vue.js";
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import v from "./style.module.css.js";
|
|
6
|
+
import { validateTitle as $ } from "../utils.js";
|
|
7
|
+
const j = /* @__PURE__ */ V({
|
|
7
8
|
__name: "FilterSidebar",
|
|
8
9
|
props: /* @__PURE__ */ q({
|
|
9
10
|
columns: {},
|
|
@@ -16,14 +17,14 @@ const M = /* @__PURE__ */ V({
|
|
|
16
17
|
}),
|
|
17
18
|
emits: ["update:step"],
|
|
18
19
|
setup(m) {
|
|
19
|
-
const e = E(m, "step"), l = m,
|
|
20
|
+
const e = E(m, "step"), l = m, b = k(() => l.hasSelectedColumns !== void 0 && l.getValuesForSelectedColumns !== void 0), S = () => {
|
|
20
21
|
e.value.filter.filters.push({
|
|
21
|
-
id:
|
|
22
|
+
id: u(),
|
|
22
23
|
isExpanded: !0,
|
|
23
24
|
type: "or",
|
|
24
25
|
filters: [
|
|
25
26
|
{
|
|
26
|
-
id:
|
|
27
|
+
id: u(),
|
|
27
28
|
type: "isNA",
|
|
28
29
|
column: l.columns[0].id
|
|
29
30
|
}
|
|
@@ -32,11 +33,11 @@ const M = /* @__PURE__ */ V({
|
|
|
32
33
|
};
|
|
33
34
|
async function h() {
|
|
34
35
|
if (l.hasSelectedColumns === void 0 || l.getValuesForSelectedColumns === void 0) return;
|
|
35
|
-
const
|
|
36
|
-
if (!
|
|
37
|
-
const { columnId: t, values: o } =
|
|
36
|
+
const a = await l.getValuesForSelectedColumns();
|
|
37
|
+
if (!a || a.values.length === 0) return;
|
|
38
|
+
const { columnId: t, values: o } = a, C = o.slice(0, 3).join(", ") + (o.length > 3 ? ` and ${o.length - 3} more` : "");
|
|
38
39
|
e.value.filter.filters.push({
|
|
39
|
-
id:
|
|
40
|
+
id: u(),
|
|
40
41
|
name: `Selected list (${C})`,
|
|
41
42
|
isExpanded: !1,
|
|
42
43
|
type: "or",
|
|
@@ -64,50 +65,51 @@ const M = /* @__PURE__ */ V({
|
|
|
64
65
|
"topN",
|
|
65
66
|
"bottomN"
|
|
66
67
|
];
|
|
67
|
-
return (
|
|
68
|
-
"header-content":
|
|
69
|
-
(
|
|
68
|
+
return (a, t) => e.value ? (d(), r(s(T), { key: 0 }, {
|
|
69
|
+
"header-content": n(() => [
|
|
70
|
+
(d(), r(s(A), {
|
|
70
71
|
key: e.value.id,
|
|
71
72
|
modelValue: e.value.label,
|
|
72
73
|
"onUpdate:modelValue": t[0] || (t[0] = (o) => e.value.label = o),
|
|
73
|
-
class:
|
|
74
|
+
class: i({ [s(v).flashing]: e.value.label.length === 0 }),
|
|
74
75
|
"max-length": 40,
|
|
75
76
|
"max-width": "600px",
|
|
76
77
|
placeholder: "Label",
|
|
77
|
-
autofocus: e.value.label.length === 0
|
|
78
|
-
|
|
78
|
+
autofocus: e.value.label.length === 0,
|
|
79
|
+
validate: s($)
|
|
80
|
+
}, null, 8, ["modelValue", "class", "autofocus", "validate"]))
|
|
79
81
|
]),
|
|
80
|
-
"body-content":
|
|
82
|
+
"body-content": n(() => [
|
|
81
83
|
c(s(P), {
|
|
82
84
|
filters: e.value.filter,
|
|
83
85
|
"onUpdate:filters": t[1] || (t[1] = (o) => e.value.filter = o),
|
|
84
|
-
class:
|
|
86
|
+
class: i([a.$style.root, { [s(v).disabled]: e.value.label.length === 0 }]),
|
|
85
87
|
items: l.columns,
|
|
86
88
|
"supported-filters": y,
|
|
87
89
|
"get-suggest-options": l.getSuggestOptions,
|
|
88
90
|
"enable-dnd": !1,
|
|
89
91
|
"enable-add-group-button": !0
|
|
90
92
|
}, {
|
|
91
|
-
"add-group-buttons":
|
|
93
|
+
"add-group-buttons": n(() => [
|
|
92
94
|
x("div", {
|
|
93
|
-
class:
|
|
95
|
+
class: i(a.$style.actions)
|
|
94
96
|
}, [
|
|
95
97
|
c(s(g), {
|
|
96
98
|
icon: "add",
|
|
97
99
|
onClick: S
|
|
98
100
|
}, {
|
|
99
|
-
default:
|
|
101
|
+
default: n(() => [...t[2] || (t[2] = [
|
|
100
102
|
f(" Add Filter ", -1)
|
|
101
103
|
])]),
|
|
102
104
|
_: 1
|
|
103
105
|
}),
|
|
104
|
-
|
|
106
|
+
b.value ? (d(), r(s(g), {
|
|
105
107
|
key: 0,
|
|
106
108
|
icon: "add",
|
|
107
109
|
disabled: !l.hasSelectedColumns,
|
|
108
110
|
onClick: h
|
|
109
111
|
}, {
|
|
110
|
-
default:
|
|
112
|
+
default: n(() => [...t[3] || (t[3] = [
|
|
111
113
|
f(" From selection ", -1)
|
|
112
114
|
])]),
|
|
113
115
|
_: 1
|
|
@@ -122,6 +124,6 @@ const M = /* @__PURE__ */ V({
|
|
|
122
124
|
}
|
|
123
125
|
});
|
|
124
126
|
export {
|
|
125
|
-
|
|
127
|
+
j as default
|
|
126
128
|
};
|
|
127
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: PlAdvancedFilterItem[];\n\n getSuggestOptions: (params: { columnId: PlAdvancedFilterColumnId; axisIdx?: number; searchStr: string; searchType: 'value' | 'label' }) =>\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=\"Label\"\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-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":"
|
|
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; axisIdx?: number; searchStr: string; searchType: 'value' | 'label' }) =>\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';\nimport { validateTitle } from '../utils';\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=\"Label\"\n :autofocus=\"step.label.length === 0\"\n :validate=\"validateTitle\"\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-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","validateTitle","_createVNode","PlAdvancedFilter","$style","$commonStyle","_createElementVNode","PlBtnSecondary"],"mappings":"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"}
|
|
@@ -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>\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,
|
|
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,YACT,MASE;AAAA,QARMP,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,4 +1,5 @@
|
|
|
1
1
|
import { FilterSpecTypeFieldRecord } from '@milaboratories/uikit';
|
|
2
2
|
import { FilterSpecLeaf } from '@platforma-sdk/model';
|
|
3
3
|
export declare function createDefaultFilterMetadata<T extends FilterSpecLeaf>(): FilterSpecTypeFieldRecord<T>;
|
|
4
|
+
export declare function validateTitle(v: string): void;
|
|
4
5
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/PlAnnotations/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,cAAc,KAAK,yBAAyB,CAAC,CAAC,CAAC,CAapG"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/PlAnnotations/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,wBAAgB,2BAA2B,CAAC,CAAC,SAAS,cAAc,KAAK,yBAAyB,CAAC,CAAC,CAAC,CAapG;AAGD,wBAAgB,aAAa,CAAC,CAAC,EAAE,MAAM,QAItC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/components/PlAnnotations/utils.ts"],"sourcesContent":["import type { FilterSpecTypeFieldRecord } from '@milaboratories/uikit';\nimport type { FilterSpecLeaf } from '@platforma-sdk/model';\n\nexport function createDefaultFilterMetadata<T extends FilterSpecLeaf>(): FilterSpecTypeFieldRecord<T> {\n return {\n column: {\n label: 'Column',\n fieldType: 'SUniversalPColumnId',\n defaultValue: () => undefined,\n },\n type: {\n label: 'Predicate',\n fieldType: 'FilterType',\n defaultValue: () => undefined,\n },\n } as FilterSpecTypeFieldRecord<T>;\n};\n\nconst allowedSymbolsPattern = /^[a-zA-Z0-9\\s!@#$%^*()_+\\-=[\\]{}|;:'\",.?]*$/;\nexport function validateTitle(v: string) {\n if (!allowedSymbolsPattern.test(v)) {\n throw Error(`Title contains forbidden symbols`);\n }\n}\n"],"names":["allowedSymbolsPattern","validateTitle","v"],"mappings":"AAkBA,MAAMA,IAAwB;AACvB,SAASC,EAAcC,GAAW;AACvC,MAAI,CAACF,EAAsB,KAAKE,CAAC;AAC/B,UAAM,MAAM,kCAAkC;AAElD;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platforma-sdk/ui-vue",
|
|
3
|
-
"version": "1.48.
|
|
3
|
+
"version": "1.48.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"styles": "dist/index.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"@zip.js/zip.js": "^2.8.2",
|
|
28
28
|
"es-toolkit": "^1.39.10",
|
|
29
29
|
"@milaboratories/biowasm-tools": "2.0.0",
|
|
30
|
-
"@
|
|
31
|
-
"@
|
|
32
|
-
"@milaboratories/
|
|
30
|
+
"@milaboratories/ptabler-expression-js": "1.1.7",
|
|
31
|
+
"@platforma-sdk/model": "1.48.12",
|
|
32
|
+
"@milaboratories/uikit": "2.8.4"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"happy-dom": "^15.11.7",
|
|
@@ -44,10 +44,10 @@
|
|
|
44
44
|
"yarpm": "^1.2.0",
|
|
45
45
|
"fast-json-patch": "^3.1.1",
|
|
46
46
|
"@faker-js/faker": "^9.2.0",
|
|
47
|
-
"@milaboratories/ts-configs": "1.2.0",
|
|
48
|
-
"@milaboratories/build-configs": "1.2.1",
|
|
49
47
|
"@milaboratories/eslint-config": "1.0.5",
|
|
48
|
+
"@milaboratories/build-configs": "1.2.1",
|
|
50
49
|
"@milaboratories/helpers": "1.12.1",
|
|
50
|
+
"@milaboratories/ts-configs": "1.2.0",
|
|
51
51
|
"@milaboratories/ts-builder": "1.2.1"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
@@ -11,6 +11,8 @@ import {
|
|
|
11
11
|
PlTextField,
|
|
12
12
|
} from '@milaboratories/uikit';
|
|
13
13
|
import type { Annotation } from '../types';
|
|
14
|
+
import { validateTitle } from '../utils';
|
|
15
|
+
import { isEmpty } from 'es-toolkit/compat';
|
|
14
16
|
|
|
15
17
|
// Models
|
|
16
18
|
const annotation = defineModel<Annotation>('annotation', { required: true });
|
|
@@ -45,6 +47,7 @@ function handleAddStep() {
|
|
|
45
47
|
max-width="600px"
|
|
46
48
|
placeholder="Annotation Title"
|
|
47
49
|
:autofocus="annotation.title.length === 0"
|
|
50
|
+
:validate="validateTitle"
|
|
48
51
|
/>
|
|
49
52
|
</template>
|
|
50
53
|
<template v-if="annotation" #body-content>
|
|
@@ -64,18 +67,20 @@ function handleAddStep() {
|
|
|
64
67
|
</template>
|
|
65
68
|
</PlElementList>
|
|
66
69
|
|
|
70
|
+
<PlBtnSecondary icon="add" @click="handleAddStep">
|
|
71
|
+
Add label
|
|
72
|
+
</PlBtnSecondary>
|
|
73
|
+
|
|
67
74
|
<PlTextField
|
|
75
|
+
:class="[$style.defaultValue, { [$style.emptyDefaultValue]: isEmpty(annotation.defaultValue) }]"
|
|
68
76
|
:model-value="annotation.defaultValue ?? ''"
|
|
69
77
|
label="Label remaining with"
|
|
70
78
|
placeholder="No label"
|
|
71
79
|
clearable
|
|
80
|
+
helper="This label will be applied to the remaining rows, after all other filters are applied."
|
|
72
81
|
@click.stop
|
|
73
82
|
@update:model-value="annotation.defaultValue = $event === '' ? undefined : $event"
|
|
74
83
|
/>
|
|
75
|
-
|
|
76
|
-
<PlBtnSecondary icon="add" @click="handleAddStep">
|
|
77
|
-
Add label
|
|
78
|
-
</PlBtnSecondary>
|
|
79
84
|
</div>
|
|
80
85
|
</template>
|
|
81
86
|
<template #footer-content>
|
|
@@ -113,4 +118,16 @@ function handleAddStep() {
|
|
|
113
118
|
.stepItem {
|
|
114
119
|
cursor: pointer;
|
|
115
120
|
}
|
|
121
|
+
|
|
122
|
+
.defaultValue {
|
|
123
|
+
margin-top: 8px;
|
|
124
|
+
}
|
|
125
|
+
.emptyDefaultValue {
|
|
126
|
+
opacity: 0.5;
|
|
127
|
+
transition: opacity 0.2s ease-in-out;
|
|
128
|
+
|
|
129
|
+
&:hover {
|
|
130
|
+
opacity: 1;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
116
133
|
</style>
|
|
@@ -24,6 +24,7 @@ import type { PlAdvancedFilterColumnId } from '../../PlAdvancedFilter/types';
|
|
|
24
24
|
import type { Filter } from '../types';
|
|
25
25
|
|
|
26
26
|
import $commonStyle from './style.module.css';
|
|
27
|
+
import { validateTitle } from '../utils';
|
|
27
28
|
|
|
28
29
|
// Models
|
|
29
30
|
const step = defineModel<Filter>('step', { required: true });
|
|
@@ -101,6 +102,7 @@ const supportedFilters = [
|
|
|
101
102
|
max-width="600px"
|
|
102
103
|
placeholder="Label"
|
|
103
104
|
:autofocus="step.label.length === 0"
|
|
105
|
+
:validate="validateTitle"
|
|
104
106
|
/>
|
|
105
107
|
</template>
|
|
106
108
|
<template #body-content>
|