@platforma-sdk/ui-vue 1.45.31 → 1.45.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/.turbo/turbo-build.log +32 -7
  2. package/.turbo/turbo-type-check.log +1 -1
  3. package/CHANGELOG.md +17 -0
  4. package/dist/components/PlAdvancedFilter/OperandButton.vue.d.ts +8 -0
  5. package/dist/components/PlAdvancedFilter/OperandButton.vue.js +10 -0
  6. package/dist/components/PlAdvancedFilter/OperandButton.vue.js.map +1 -0
  7. package/dist/components/PlAdvancedFilter/OperandButton.vue2.js +25 -0
  8. package/dist/components/PlAdvancedFilter/OperandButton.vue2.js.map +1 -0
  9. package/dist/components/PlAdvancedFilter/OperandButton.vue3.js +13 -0
  10. package/dist/components/PlAdvancedFilter/OperandButton.vue3.js.map +1 -0
  11. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue.d.ts +39 -0
  12. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue.js +10 -0
  13. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue.js.map +1 -0
  14. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js +199 -0
  15. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue2.js.map +1 -0
  16. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue3.js +17 -0
  17. package/dist/components/PlAdvancedFilter/PlAdvancedFilter.vue3.js.map +1 -0
  18. package/dist/components/PlAdvancedFilter/SingleFilter.vue.d.ts +37 -0
  19. package/dist/components/PlAdvancedFilter/SingleFilter.vue.js +10 -0
  20. package/dist/components/PlAdvancedFilter/SingleFilter.vue.js.map +1 -0
  21. package/dist/components/PlAdvancedFilter/SingleFilter.vue2.js +306 -0
  22. package/dist/components/PlAdvancedFilter/SingleFilter.vue2.js.map +1 -0
  23. package/dist/components/PlAdvancedFilter/SingleFilter.vue3.js +35 -0
  24. package/dist/components/PlAdvancedFilter/SingleFilter.vue3.js.map +1 -0
  25. package/dist/components/PlAdvancedFilter/constants.d.ts +4 -0
  26. package/dist/components/PlAdvancedFilter/constants.js +41 -0
  27. package/dist/components/PlAdvancedFilter/constants.js.map +1 -0
  28. package/dist/components/PlAdvancedFilter/index.d.ts +1 -0
  29. package/dist/components/PlAdvancedFilter/types.d.ts +57 -0
  30. package/dist/components/PlAdvancedFilter/types.js +8 -0
  31. package/dist/components/PlAdvancedFilter/types.js.map +1 -0
  32. package/dist/components/PlAdvancedFilter/utils.js +150 -0
  33. package/dist/components/PlAdvancedFilter/utils.js.map +1 -0
  34. package/dist/index.js +33 -31
  35. package/dist/index.js.map +1 -1
  36. package/dist/lib.d.ts +1 -0
  37. package/package.json +6 -6
  38. package/src/components/PlAdvancedFilter/OperandButton.vue +53 -0
  39. package/src/components/PlAdvancedFilter/PlAdvancedFilter.vue +209 -0
  40. package/src/components/PlAdvancedFilter/SingleFilter.vue +425 -0
  41. package/src/components/PlAdvancedFilter/constants.ts +42 -0
  42. package/src/components/PlAdvancedFilter/index.ts +1 -0
  43. package/src/components/PlAdvancedFilter/types.ts +77 -0
  44. package/src/components/PlAdvancedFilter/utils.ts +215 -0
  45. package/src/lib.ts +2 -0
@@ -0,0 +1,306 @@
1
+ import { defineComponent as Z, mergeModels as _, useModel as ee, computed as p, createElementBlock as x, openBlock as n, Fragment as E, createElementVNode as v, createVNode as g, normalizeClass as r, createCommentVNode as b, createBlock as c, unref as a, toDisplayString as le, renderList as te } from "vue";
2
+ import { PlIcon16 as k, PlDropdown as T, PlAutocomplete as D, PlTextField as N, Slider as oe, PlToggleSwitch as ue, PlAutocompleteMulti as ae, PlNumberField as ne } from "@milaboratories/uikit";
3
+ import { SUPPORTED_FILTER_TYPES as se, DEFAULT_FILTERS as A, DEFAULT_FILTER_TYPE as re } from "./constants.js";
4
+ import { parseColumnId as U, isFilteredPColumn as R, stringifyColumnId as q } from "@platforma-sdk/model";
5
+ import ie from "./OperandButton.vue.js";
6
+ import { getNormalizedSpec as z, getFilterInfo as B, isNumericFilter as L, isStringFilter as de } from "./utils.js";
7
+ const pe = ["title"], fe = /* @__PURE__ */ Z({
8
+ __name: "SingleFilter",
9
+ props: /* @__PURE__ */ _({
10
+ operand: {},
11
+ columnOptions: {},
12
+ enableDnd: { type: Boolean },
13
+ isLast: { type: Boolean },
14
+ getSuggestOptions: { type: Function },
15
+ getSuggestModel: { type: Function },
16
+ onDelete: { type: Function },
17
+ onChangeOperand: { type: Function }
18
+ }, {
19
+ modelValue: { required: !0 },
20
+ modelModifiers: {}
21
+ }),
22
+ emits: ["update:modelValue"],
23
+ setup(M) {
24
+ const y = M, l = ee(M, "modelValue");
25
+ async function w(e, t, u) {
26
+ return Promise.all(t.map((d) => y.getSuggestModel({ columnId: e, searchStr: d, axisIdx: u })));
27
+ }
28
+ async function h(e, t, u) {
29
+ return y.getSuggestModel({ columnId: e, searchStr: t, axisIdx: u });
30
+ }
31
+ async function C(e, t, u) {
32
+ return y.getSuggestOptions({ columnId: e, searchStr: t, axisIdx: u });
33
+ }
34
+ function W() {
35
+ const e = B(l.value.type);
36
+ f.value && e.supportedFor(f.value) && L(l.value) || (f.value && e.supportedFor(f.value) && de(l.value) ? l.value = {
37
+ ...A[l.value.type],
38
+ value: l.value.value,
39
+ column: l.value.column
40
+ } : l.value = {
41
+ ...A[l.value.type],
42
+ column: l.value.column
43
+ });
44
+ }
45
+ function j(e) {
46
+ if (!e)
47
+ return;
48
+ const t = y.columnOptions.find((i) => i.id === $(e));
49
+ if (!t)
50
+ return;
51
+ const u = B(l.value.type), d = z(t == null ? void 0 : t.spec);
52
+ u.supportedFor(d) ? l.value.column = e : l.value = {
53
+ ...A[re],
54
+ column: e
55
+ };
56
+ }
57
+ const S = p(() => y.columnOptions.find((t) => t.id === $(l.value.column)) === void 0), X = p(() => {
58
+ const e = y.columnOptions.map((t) => ({ value: t.id, label: t.label ?? t }));
59
+ return S.value && e.unshift({ value: l.value.column, label: "Inconsistent value" }), e;
60
+ });
61
+ function $(e) {
62
+ try {
63
+ const t = U(e);
64
+ return R(t) ? q(t.source) : e;
65
+ } catch {
66
+ return e;
67
+ }
68
+ }
69
+ function Y(e) {
70
+ const t = $(e), u = y.columnOptions.find((i) => i.id === t), d = ((u == null ? void 0 : u.axesToBeFixed) ?? []).reduce((i, F) => (i[F.idx] = void 0, i), {});
71
+ try {
72
+ const i = U(e);
73
+ if (R(i))
74
+ return {
75
+ source: t,
76
+ axisFiltersByIndex: i.axisFilters.reduce((F, I) => (F[I[0]] = I[1], F), d)
77
+ };
78
+ } catch {
79
+ return { source: e, axisFiltersByIndex: d };
80
+ }
81
+ return { source: e, axisFiltersByIndex: d };
82
+ }
83
+ function G(e) {
84
+ return Object.keys(e.axisFiltersByIndex).length === 0 ? e.source : q({
85
+ source: U(e.source),
86
+ axisFilters: Object.entries(e.axisFiltersByIndex).map(([t, u]) => [Number(t), u])
87
+ });
88
+ }
89
+ const s = p({
90
+ get: () => Y(l.value.column),
91
+ set: (e) => {
92
+ l.value.column = G(e);
93
+ }
94
+ });
95
+ function H(e, t) {
96
+ s.value = {
97
+ ...s.value,
98
+ axisFiltersByIndex: { ...s.value.axisFiltersByIndex, [e]: t }
99
+ };
100
+ }
101
+ const m = p(() => y.columnOptions.find((e) => e.id === s.value.source)), f = p(() => {
102
+ var e;
103
+ return (e = m.value) != null && e.spec ? z(m.value.spec) : null;
104
+ }), P = p(() => {
105
+ var e;
106
+ return (e = f.value) == null ? void 0 : e.valueType;
107
+ }), O = p(() => {
108
+ var e;
109
+ return ((e = m.value) == null ? void 0 : e.error) || S.value;
110
+ }), J = p(
111
+ () => [...se].filter(
112
+ (e) => l.value.type === e || (f.value ? B(e).supportedFor(f.value) : !0)
113
+ ).map((e) => ({ value: e, label: B(e).label }))
114
+ ), K = p(() => {
115
+ var e, t;
116
+ return l.value.type === "patternFuzzyContainSubsequence" ? ((e = m.value) == null ? void 0 : e.alphabet) === "nucleotide" ? [{ label: "N", value: "N" }] : ((t = m.value) == null ? void 0 : t.alphabet) === "aminoacid" ? [{ label: "X", value: "X" }] : [...new Set(l.value.value.split(""))].sort().map((u) => ({ value: u, label: u })) : [];
117
+ }), Q = p(() => {
118
+ if (l.value.type !== "patternMatchesRegularExpression")
119
+ return !1;
120
+ try {
121
+ return new RegExp(l.value.value), !1;
122
+ } catch {
123
+ return !0;
124
+ }
125
+ });
126
+ return (e, t) => {
127
+ var u, d, i, F, I;
128
+ return n(), x(E, null, [
129
+ v("div", {
130
+ class: r(e.$style.filterWrapper)
131
+ }, [
132
+ e.enableDnd ? (n(), x("div", {
133
+ key: 0,
134
+ class: r([e.$style.top, e.$style.columnChip, { [e.$style.error]: O.value }])
135
+ }, [
136
+ v("div", {
137
+ class: r([e.$style.typeIcon, { [e.$style.error]: O.value }])
138
+ }, [
139
+ O.value ? (n(), c(a(k), {
140
+ key: 0,
141
+ name: "warning"
142
+ })) : (n(), c(a(k), {
143
+ key: 1,
144
+ name: P.value === "String" || P.value === void 0 ? "cell-type-txt" : "cell-type-num"
145
+ }, null, 8, ["name"]))
146
+ ], 2),
147
+ v("div", {
148
+ class: r(e.$style.titleWrapper),
149
+ title: ((u = m.value) == null ? void 0 : u.label) ?? ""
150
+ }, [
151
+ v("div", {
152
+ class: r(e.$style.title)
153
+ }, le(S.value ? "Inconsistent value" : ((d = m.value) == null ? void 0 : d.label) ?? l.value.column), 3)
154
+ ], 10, pe),
155
+ v("div", {
156
+ class: r(e.$style.closeIcon),
157
+ onClick: t[0] || (t[0] = (o) => e.onDelete(l.value.column))
158
+ }, [
159
+ g(a(k), { name: "close" })
160
+ ], 2)
161
+ ], 2)) : (n(), x("div", {
162
+ key: 1,
163
+ class: r(e.$style.top)
164
+ }, [
165
+ g(a(T), {
166
+ modelValue: s.value.source,
167
+ "onUpdate:modelValue": [
168
+ t[1] || (t[1] = (o) => s.value.source = o),
169
+ j
170
+ ],
171
+ errorStatus: O.value,
172
+ options: X.value,
173
+ style: { width: "100%" },
174
+ "group-position": "top-left"
175
+ }, null, 8, ["modelValue", "errorStatus", "options"]),
176
+ v("div", {
177
+ class: r(e.$style.closeButton),
178
+ onClick: t[2] || (t[2] = (o) => e.onDelete(l.value.column))
179
+ }, [
180
+ g(a(k), { name: "close" })
181
+ ], 2)
182
+ ], 2)),
183
+ (F = (i = m.value) == null ? void 0 : i.axesToBeFixed) != null && F.length ? (n(), x("div", {
184
+ key: 2,
185
+ class: r(e.$style.fixedAxesBlock)
186
+ }, [
187
+ (n(!0), x(E, null, te((I = m.value) == null ? void 0 : I.axesToBeFixed, (o) => (n(), c(a(D), {
188
+ key: o.idx,
189
+ modelValue: s.value.axisFiltersByIndex[o.idx],
190
+ "onUpdate:modelValue": [(V) => s.value.axisFiltersByIndex[o.idx] = V, (V) => H(o.idx, V)],
191
+ label: o.label,
192
+ "options-search": (V) => C(s.value.source, V, o.idx),
193
+ "model-search": (V) => h(s.value.source, V, o.idx),
194
+ disabled: S.value,
195
+ clearable: !0
196
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "label", "options-search", "model-search", "disabled"]))), 128))
197
+ ], 2)) : b("", !0),
198
+ v("div", {
199
+ class: r(l.value.type === "isNA" || l.value.type === "isNotNA" ? e.$style.bottom : e.$style.middle)
200
+ }, [
201
+ g(a(T), {
202
+ modelValue: l.value.type,
203
+ "onUpdate:modelValue": [
204
+ t[3] || (t[3] = (o) => l.value.type = o),
205
+ W
206
+ ],
207
+ options: J.value,
208
+ "group-position": l.value.type === "isNA" || l.value.type === "isNotNA" ? "bottom" : "middle"
209
+ }, null, 8, ["modelValue", "options", "group-position"])
210
+ ], 2),
211
+ l.value.type === "patternFuzzyContainSubsequence" ? (n(), x(E, { key: 3 }, [
212
+ v("div", {
213
+ class: r(e.$style.middle)
214
+ }, [
215
+ g(a(N), {
216
+ modelValue: l.value.value,
217
+ "onUpdate:modelValue": t[4] || (t[4] = (o) => l.value.value = o),
218
+ placeholder: "Substring",
219
+ "group-position": "middle"
220
+ }, null, 8, ["modelValue"])
221
+ ], 2),
222
+ v("div", {
223
+ class: r(e.$style.innerSection)
224
+ }, [
225
+ g(a(oe), {
226
+ modelValue: l.value.maxEdits,
227
+ "onUpdate:modelValue": t[5] || (t[5] = (o) => l.value.maxEdits = o),
228
+ max: 5,
229
+ breakpoints: "",
230
+ label: "Maximum number of substitutions and indels"
231
+ }, null, 8, ["modelValue"]),
232
+ g(a(ue), {
233
+ modelValue: l.value.substitutionsOnly,
234
+ "onUpdate:modelValue": t[6] || (t[6] = (o) => l.value.substitutionsOnly = o),
235
+ label: "Substitutions only"
236
+ }, null, 8, ["modelValue"])
237
+ ], 2)
238
+ ], 64)) : b("", !0),
239
+ v("div", {
240
+ class: r(e.$style.bottom)
241
+ }, [
242
+ l.value.type === "patternEquals" || l.value.type === "patternNotEquals" ? (n(), c(a(D), {
243
+ key: 0,
244
+ modelValue: l.value.value,
245
+ "onUpdate:modelValue": t[7] || (t[7] = (o) => l.value.value = o),
246
+ "options-search": (o) => C(s.value.source, o),
247
+ "model-search": (o) => h(s.value.source, o),
248
+ disabled: S.value,
249
+ clearable: !0,
250
+ "group-position": "bottom"
251
+ }, null, 8, ["modelValue", "options-search", "model-search", "disabled"])) : b("", !0),
252
+ l.value.type === "inSet" || l.value.type === "notInSet" ? (n(), c(a(ae), {
253
+ key: 1,
254
+ modelValue: l.value.value,
255
+ "onUpdate:modelValue": t[8] || (t[8] = (o) => l.value.value = o),
256
+ "options-search": (o) => C(s.value.source, o),
257
+ "model-search": (o) => w(s.value.source, o),
258
+ disabled: S.value,
259
+ "group-position": "bottom"
260
+ }, null, 8, ["modelValue", "options-search", "model-search", "disabled"])) : b("", !0),
261
+ a(L)(l.value) ? (n(), c(a(ne), {
262
+ key: 2,
263
+ modelValue: l.value.x,
264
+ "onUpdate:modelValue": t[9] || (t[9] = (o) => l.value.x = o),
265
+ "group-position": "bottom"
266
+ }, null, 8, ["modelValue"])) : b("", !0),
267
+ l.value.type === "patternContainSubsequence" || l.value.type === "patternNotContainSubsequence" ? (n(), c(a(N), {
268
+ key: 3,
269
+ modelValue: l.value.value,
270
+ "onUpdate:modelValue": t[10] || (t[10] = (o) => l.value.value = o),
271
+ placeholder: "Substring",
272
+ "group-position": "bottom"
273
+ }, null, 8, ["modelValue"])) : b("", !0),
274
+ l.value.type === "patternMatchesRegularExpression" ? (n(), c(a(N), {
275
+ key: 4,
276
+ modelValue: l.value.value,
277
+ "onUpdate:modelValue": t[11] || (t[11] = (o) => l.value.value = o),
278
+ error: Q.value ? "Regular expression is not valid" : void 0,
279
+ placeholder: "Regular expression",
280
+ "group-position": "bottom"
281
+ }, null, 8, ["modelValue", "error"])) : b("", !0),
282
+ l.value.type === "patternFuzzyContainSubsequence" ? (n(), c(a(T), {
283
+ key: 5,
284
+ modelValue: l.value.wildcard,
285
+ "onUpdate:modelValue": t[12] || (t[12] = (o) => l.value.wildcard = o),
286
+ clearable: "",
287
+ placeholder: "Wildcard value",
288
+ options: K.value,
289
+ "group-position": "bottom"
290
+ }, null, 8, ["modelValue", "options"])) : b("", !0)
291
+ ], 2)
292
+ ], 2),
293
+ g(ie, {
294
+ class: r(e.$style.buttonWrapper),
295
+ active: e.operand,
296
+ disabled: e.isLast,
297
+ "on-select": e.onChangeOperand
298
+ }, null, 8, ["class", "active", "disabled", "on-select"])
299
+ ], 64);
300
+ };
301
+ }
302
+ });
303
+ export {
304
+ fe as default
305
+ };
306
+ //# sourceMappingURL=SingleFilter.vue2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingleFilter.vue2.js","sources":["../../../src/components/PlAdvancedFilter/SingleFilter.vue"],"sourcesContent":["<script lang=\"ts\" setup>\nimport type { PlAdvancedFilterColumnId, Filter, Operand, SourceOptionInfo } from './types';\nimport { PlIcon16, PlDropdown, PlAutocomplete, PlAutocompleteMulti, PlTextField, PlNumberField, Slider, PlToggleSwitch } from '@milaboratories/uikit';\nimport { computed } from 'vue';\nimport { SUPPORTED_FILTER_TYPES, DEFAULT_FILTER_TYPE, DEFAULT_FILTERS } from './constants';\nimport type { AnchoredPColumnId, AxisFilterByIdx, AxisFilterValue, SUniversalPColumnId } from '@platforma-sdk/model';\nimport { isFilteredPColumn, parseColumnId, stringifyColumnId, type ListOptionBase } from '@platforma-sdk/model';\nimport OperandButton from './OperandButton.vue';\nimport { getFilterInfo, getNormalizedSpec, isNumericFilter, isStringFilter } from './utils';\n\nconst props = defineProps<{\n operand: Operand;\n columnOptions: SourceOptionInfo[];\n enableDnd: boolean;\n isLast: boolean;\n getSuggestOptions: (params: { columnId: PlAdvancedFilterColumnId; searchStr: string; axisIdx?: number }) => (Promise<ListOptionBase<string | number>[]>) |\n ((params: { columnId: SUniversalPColumnId; searchStr: string; axisIdx?: number }) => ListOptionBase<string | number>[]);\n getSuggestModel: (params: { columnId: PlAdvancedFilterColumnId; searchStr: string; axisIdx?: number }) => (Promise<ListOptionBase<string | number>>) |\n ((params: { columnId: PlAdvancedFilterColumnId; searchStr: string; axisIdx?: number }) => ListOptionBase<string | number>);\n onDelete: (columnId: PlAdvancedFilterColumnId) => void;\n onChangeOperand: (op: Operand) => void;\n}>();\n\nconst filter = defineModel<Filter>({ required: true });\n\nasync function getSuggestModelMultiFn(id: PlAdvancedFilterColumnId, v: string[], axisIdx?: number): Promise<ListOptionBase<string>[]> {\n return Promise.all(v.map((v) => props.getSuggestModel({ columnId: id, searchStr: v, axisIdx }) as Promise<ListOptionBase<string>>));\n}\nasync function getSuggestModelSingleFn(id: PlAdvancedFilterColumnId, v: string, axisIdx?: number): Promise<ListOptionBase<string>> {\n return props.getSuggestModel({ columnId: id, searchStr: v, axisIdx }) as Promise<ListOptionBase<string>>;\n}\nasync function getSuggestOptionsFn(id: PlAdvancedFilterColumnId, str: string, axisIdx?: number): Promise<ListOptionBase<string>[]> {\n return props.getSuggestOptions({ columnId: id, searchStr: str, axisIdx }) as Promise<ListOptionBase<string>[]>;\n}\n\nfunction changeFilterType() {\n const nextFilterInfo = getFilterInfo(filter.value.type);\n if (currentSpec.value && nextFilterInfo.supportedFor(currentSpec.value) && isNumericFilter(filter.value)) {\n // no extra changes, previous filter is compatible with new filter type\n return;\n } else if (currentSpec.value && nextFilterInfo.supportedFor(currentSpec.value) && isStringFilter(filter.value)) {\n // erase extra settings for string filter types, save only value and column (for example regex)\n filter.value = {\n ...DEFAULT_FILTERS[filter.value.type],\n value: filter.value.value,\n column: filter.value.column,\n } as Filter;\n } else {\n filter.value = {\n ...DEFAULT_FILTERS[filter.value.type],\n column: filter.value.column,\n };\n }\n}\n\nfunction changeSourceId(newSourceId?: PlAdvancedFilterColumnId) {\n if (!newSourceId) {\n return;\n }\n const newSourceInfo = props.columnOptions.find((v) => v.id === getSourceId(newSourceId));\n if (!newSourceInfo) {\n return;\n }\n const filterInfo = getFilterInfo(filter.value.type);\n const newSourceSpec = getNormalizedSpec(newSourceInfo?.spec);\n if (filterInfo.supportedFor(newSourceSpec)) { // don't do anything except update source id\n filter.value.column = newSourceId;\n } else { // reset to default filter which fits to any column\n filter.value = {\n ...DEFAULT_FILTERS[DEFAULT_FILTER_TYPE],\n column: newSourceId,\n };\n }\n}\n\nconst inconsistentSourceSelected = computed(() => {\n const selectedOption = props.columnOptions.find((op) => op.id === getSourceId(filter.value.column));\n return selectedOption === undefined;\n});\nconst sourceOptions = computed(() => {\n const options = props.columnOptions.map((v) => ({ value: v.id, label: v.label ?? v }));\n if (inconsistentSourceSelected.value) {\n options.unshift({ value: filter.value.column, label: 'Inconsistent value' });\n }\n return options;\n});\n\nfunction getSourceId(column: PlAdvancedFilterColumnId): PlAdvancedFilterColumnId {\n try {\n const parsedColumnId = parseColumnId(column as SUniversalPColumnId);\n if (isFilteredPColumn(parsedColumnId)) {\n return stringifyColumnId(parsedColumnId.source);\n } else {\n return column;\n }\n } catch {\n return column;\n }\n}\n\n// similar to FilteredPColumnId but source is stringified and axis filters can be undefined\ntype ColumnAsSourceAndFixedAxes = { source: PlAdvancedFilterColumnId; axisFiltersByIndex: Record<number, AxisFilterValue | undefined> };\nfunction getColumnAsSourceAndFixedAxes(column: PlAdvancedFilterColumnId): ColumnAsSourceAndFixedAxes {\n const sourceId = getSourceId(column);\n const option = props.columnOptions.find((op) => op.id === sourceId);\n const axesToBeFixed = (option?.axesToBeFixed ?? []).reduce((res, item) => {\n res[item.idx] = undefined;\n return res;\n }, {} as Record<number, AxisFilterValue | undefined>);\n try {\n const parsedColumnId = parseColumnId(column as SUniversalPColumnId);\n if (isFilteredPColumn(parsedColumnId)) {\n return {\n source: sourceId,\n axisFiltersByIndex: parsedColumnId.axisFilters.reduce((res, item) => {\n res[item[0]] = item[1];\n return res;\n }, axesToBeFixed),\n };\n }\n } catch {\n return { source: column, axisFiltersByIndex: axesToBeFixed };\n }\n return { source: column, axisFiltersByIndex: axesToBeFixed };\n}\n\nfunction stringifyColumn(value: ColumnAsSourceAndFixedAxes): PlAdvancedFilterColumnId {\n if (Object.keys(value.axisFiltersByIndex).length === 0) {\n return value.source;\n }\n return stringifyColumnId({\n source: parseColumnId(value.source as SUniversalPColumnId) as AnchoredPColumnId,\n axisFilters: Object.entries(value.axisFiltersByIndex).map(([idx, value]) => [Number(idx), value] as AxisFilterByIdx),\n });\n}\n\nconst columnAsSourceAndFixedAxes = computed({\n get: () => {\n return getColumnAsSourceAndFixedAxes(filter.value.column);\n },\n set: (value) => {\n filter.value.column = stringifyColumn(value);\n },\n});\nfunction updateAxisFilterValue(idx: number, value: AxisFilterValue | undefined) {\n columnAsSourceAndFixedAxes.value = {\n ...columnAsSourceAndFixedAxes.value,\n axisFiltersByIndex: { ...columnAsSourceAndFixedAxes.value.axisFiltersByIndex, [idx]: value } };\n}\n\nconst currentOption = computed(() => props.columnOptions.find((op) => op.id === columnAsSourceAndFixedAxes.value.source));\nconst currentSpec = computed(() => currentOption.value?.spec ? getNormalizedSpec(currentOption.value.spec) : null);\nconst currentType = computed(() => currentSpec.value?.valueType);\nconst currentError = computed(() => currentOption.value?.error || inconsistentSourceSelected.value);\n\nconst filterTypesOptions = computed(() => [...SUPPORTED_FILTER_TYPES].filter((v) =>\n filter.value.type === v || (currentSpec.value ? getFilterInfo(v).supportedFor(currentSpec.value) : true),\n).map((v) => ({ value: v, label: getFilterInfo(v).label })),\n);\n\nconst wildcardOptions = computed(() => {\n if (filter.value.type === 'patternFuzzyContainSubsequence') {\n if (currentOption.value?.alphabet === 'nucleotide') {\n return [{ label: 'N', value: 'N' }];\n }\n if (currentOption.value?.alphabet === 'aminoacid') {\n return [{ label: 'X', value: 'X' }];\n }\n return [...new Set(filter.value.value.split(''))].sort().map((v) => ({ value: v, label: v }));\n }\n return [];\n});\n\nconst stringMatchesError = computed(() => {\n if (filter.value.type !== 'patternMatchesRegularExpression') {\n return false;\n }\n try {\n new RegExp(filter.value.value);\n return false;\n } catch {\n return true;\n }\n});\n\n</script>\n<template>\n <div :class=\"$style.filterWrapper\">\n <!-- top element - column selector / column label - for all filter types-->\n <div v-if=\"enableDnd\" :class=\"[$style.top, $style.columnChip, {[$style.error]: currentError}]\">\n <div :class=\"[$style.typeIcon, {[$style.error]: currentError}]\">\n <PlIcon16 v-if=\"currentError\" name=\"warning\"/>\n <PlIcon16 v-else :name=\"currentType === 'String' || currentType === undefined ? 'cell-type-txt' : 'cell-type-num'\"/>\n </div>\n <div :class=\"$style.titleWrapper\" :title=\"currentOption?.label ?? ''\">\n <div :class=\"$style.title\">\n {{ inconsistentSourceSelected ? 'Inconsistent value' : currentOption?.label ?? filter.column }}\n </div>\n </div>\n <div :class=\"$style.closeIcon\" @click=\"onDelete(filter.column)\">\n <PlIcon16 name=\"close\"/>\n </div>\n </div>\n <div v-else :class=\"$style.top\" >\n <PlDropdown\n v-model=\"columnAsSourceAndFixedAxes.source\"\n :errorStatus=\"currentError\"\n :options=\"sourceOptions\"\n :style=\"{width: '100%'}\"\n group-position=\"top-left\"\n @update:model-value=\"changeSourceId\"\n />\n <div :class=\"$style.closeButton\" @click=\"onDelete(filter.column)\">\n <PlIcon16 name=\"close\"/>\n </div>\n </div>\n\n <div v-if=\"currentOption?.axesToBeFixed?.length\" :class=\"$style.fixedAxesBlock\">\n <template v-for=\"value in currentOption?.axesToBeFixed\" :key=\"value.idx\">\n <PlAutocomplete\n v-model=\"columnAsSourceAndFixedAxes.axisFiltersByIndex[value.idx]\"\n :label=\"value.label\"\n :options-search=\"(str) => getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, str, value.idx)\"\n :model-search=\"(v) => getSuggestModelSingleFn(columnAsSourceAndFixedAxes.source, v as string, value.idx)\"\n :disabled=\"inconsistentSourceSelected\"\n :clearable=\"true\"\n @update:model-value=\"(v) => updateAxisFilterValue(value.idx, v)\"\n />\n </template>\n </div>\n\n <!-- middle - filter type selector - for all filter types -->\n <div :class=\"filter.type === 'isNA' || filter.type === 'isNotNA' ? $style.bottom : $style.middle\">\n <PlDropdown\n v-model=\"filter.type\"\n :options=\"filterTypesOptions\"\n :group-position=\"filter.type === 'isNA' || filter.type === 'isNotNA' ? 'bottom' : 'middle'\"\n @update:model-value=\"changeFilterType\"\n />\n </div>\n\n <!-- middle - for fuzzy contains filter -->\n <template v-if=\"filter.type === 'patternFuzzyContainSubsequence'\">\n <div :class=\"$style.middle\">\n <PlTextField\n v-model=\"filter.value\"\n placeholder=\"Substring\"\n group-position=\"middle\"\n />\n </div>\n <div :class=\"$style.innerSection\">\n <Slider\n v-model=\"filter.maxEdits\"\n :max=\"5\"\n breakpoints label=\"Maximum number of substitutions and indels\"\n />\n <PlToggleSwitch\n v-model=\"filter.substitutionsOnly\"\n label=\"Substitutions only\"\n />\n </div>\n </template>\n\n <!-- bottom element - individual settings for every filter type -->\n <div :class=\"$style.bottom\">\n <template v-if=\"filter.type === 'patternEquals' || filter.type === 'patternNotEquals'\" >\n <PlAutocomplete\n v-model=\"filter.value\"\n :options-search=\"(str) => getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, str)\"\n :model-search=\"(v) => getSuggestModelSingleFn(columnAsSourceAndFixedAxes.source, v as string)\"\n :disabled=\"inconsistentSourceSelected\"\n :clearable=\"true\"\n group-position=\"bottom\"\n />\n </template>\n <template v-if=\"filter.type === 'inSet' || filter.type === 'notInSet'\" >\n <PlAutocompleteMulti\n v-model=\"filter.value\"\n :options-search=\"(str) => getSuggestOptionsFn(columnAsSourceAndFixedAxes.source, str)\"\n :model-search=\"(v) => getSuggestModelMultiFn(columnAsSourceAndFixedAxes.source, v as string[])\"\n :disabled=\"inconsistentSourceSelected\"\n group-position=\"bottom\"\n />\n </template>\n <PlNumberField\n v-if=\"isNumericFilter(filter)\"\n v-model=\"filter.x\"\n group-position=\"bottom\"\n />\n <PlTextField\n v-if=\"filter.type === 'patternContainSubsequence' || filter.type === 'patternNotContainSubsequence'\"\n v-model=\"filter.value\"\n placeholder=\"Substring\"\n group-position=\"bottom\"\n />\n <PlTextField\n v-if=\"filter.type === 'patternMatchesRegularExpression'\"\n v-model=\"filter.value\"\n :error=\"stringMatchesError ? 'Regular expression is not valid' : undefined\"\n placeholder=\"Regular expression\"\n group-position=\"bottom\"\n />\n <PlDropdown\n v-if=\"filter.type === 'patternFuzzyContainSubsequence'\"\n v-model=\"filter.wildcard\"\n clearable\n placeholder=\"Wildcard value\"\n :options=\"wildcardOptions\"\n group-position=\"bottom\"\n />\n </div>\n </div>\n <OperandButton\n :class=\"$style.buttonWrapper\"\n :active=\"operand\"\n :disabled=\"isLast\"\n :on-select=\"onChangeOperand\"\n />\n</template>\n\n<style module>\n.filterWrapper {\n position: relative;\n display: flex;\n flex-direction: column;\n margin-bottom: 8px;\n width: 100%;\n cursor: default;\n}\n\n.typeIcon {\n display: inline-flex;\n margin-right: 8px;\n}\n\n.typeIcon.error {\n --icon-color: var(--txt-error);\n}\n\n.closeIcon {\n display: inline-flex;\n margin-left: 12px;\n cursor: pointer;\n}\n\n.titleWrapper {\n flex-grow: 1;\n overflow: hidden;\n}\n.title {\n overflow: hidden;\n color: var(--txt-01);\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: 14px;\n font-weight: 500;\n line-height: 20px;\n}\n\n.columnChip {\n width: 100%;\n display: flex;\n padding: 10px 12px;\n align-items: center;\n border-radius: 6px;\n border: 1px solid var(--txt-01);\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n\n &.error {\n border-color: var(--txt-error);\n }\n}\n\n.innerSection {\n border: 1px solid var(--txt-01);\n border-top: none;\n padding: 16px 12px;\n}\n\n.closeButton {\n border: 1px solid var(--txt-01);\n border-top-right-radius: 6px;\n border-left: none;\n width: 40px;\n height: 40px;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-shrink: 0;\n cursor: pointer;\n}\n\n.top {\n position: relative;\n display: flex;\n width: 100%;\n z-index: 1;\n background: #fff;\n}\n\n.fixedAxesBlock {\n position: relative;\n display: flex;\n flex-direction: column;\n padding: 12px 8px;\n gap: 12px;\n border-left: 1px solid var(--txt-01);\n border-right: 1px solid var(--txt-01);\n}\n\n.fixedAxesBlock > * {\n background: #fff;\n}\n\n.middle, .bottom {\n position: relative;\n margin-top: -1px;\n background: #fff;\n}\n\n.buttonWrapper {\n margin-bottom: 8px;\n}\n</style>\n"],"names":["props","__props","filter","_useModel","getSuggestModelMultiFn","id","v","axisIdx","getSuggestModelSingleFn","getSuggestOptionsFn","str","changeFilterType","nextFilterInfo","getFilterInfo","currentSpec","isNumericFilter","isStringFilter","DEFAULT_FILTERS","changeSourceId","newSourceId","newSourceInfo","getSourceId","filterInfo","newSourceSpec","getNormalizedSpec","DEFAULT_FILTER_TYPE","inconsistentSourceSelected","computed","op","sourceOptions","options","column","parsedColumnId","parseColumnId","isFilteredPColumn","stringifyColumnId","getColumnAsSourceAndFixedAxes","sourceId","option","axesToBeFixed","res","item","stringifyColumn","value","idx","columnAsSourceAndFixedAxes","updateAxisFilterValue","currentOption","_a","currentType","currentError","filterTypesOptions","SUPPORTED_FILTER_TYPES","wildcardOptions","_b","stringMatchesError"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAUA,UAAMA,IAAQC,GAaRC,IAASC,GAAmBF,GAAA,YAAmB;AAErD,mBAAeG,EAAuBC,GAA8BC,GAAaC,GAAq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AAC,GAAGyB,EAAsB,EAAE;AAAA,QAAO,CAAC9C,MAC5EJ,EAAO,MAAM,SAASI,MAAMQ,EAAY,QAAQD,EAAcP,CAAC,EAAE,aAAaQ,EAAY,KAAK,IAAI;AAAA,MAAA,EACnG,IAAI,CAACR,OAAO,EAAE,OAAOA,GAAG,OAAOO,EAAcP,CAAC,EAAE,QAAQ;AAAA,IAAA,GAGpD+C,IAAkB1B,EAAS,MAAM;;AACrC,aAAIzB,EAAO,MAAM,SAAS,qCACpB8C,IAAAD,EAAc,UAAd,gBAAAC,EAAqB,cAAa,eAC7B,CAAC,EAAE,OAAO,KAAK,OAAO,KAAK,MAEhCM,IAAAP,EAAc,UAAd,gBAAAO,EAAqB,cAAa,cAC7B,CAAC,EAAE,OAAO,KAAK,OAAO,KAAK,IAE7B,CAAC,GAAG,IAAI,IAAIpD,EAAO,MAAM,MAAM,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,IAAI,CAACI,OAAO,EAAE,OAAOA,GAAG,OAAOA,EAAA,EAAI,IAEvF,CAAA;AAAA,IACT,CAAC,GAEKiD,IAAqB5B,EAAS,MAAM;AACxC,UAAIzB,EAAO,MAAM,SAAS;AACxB,eAAO;AAET,UAAI;AACF,mBAAI,OAAOA,EAAO,MAAM,KAAK,GACtB;AAAA,MACT,QAAQ;AACN,eAAO;AAAA,MACT;AAAA,IACF,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,35 @@
1
+ (function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode("._filterWrapper_mviuo_2{position:relative;display:flex;flex-direction:column;margin-bottom:8px;width:100%;cursor:default}._typeIcon_mviuo_11{display:inline-flex;margin-right:8px}._typeIcon_mviuo_11._error_mviuo_16{--icon-color: var(--txt-error)}._closeIcon_mviuo_20{display:inline-flex;margin-left:12px;cursor:pointer}._titleWrapper_mviuo_26{flex-grow:1;overflow:hidden}._title_mviuo_26{overflow:hidden;color:var(--txt-01);text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:500;line-height:20px}._columnChip_mviuo_40{width:100%;display:flex;padding:10px 12px;align-items:center;border:1px solid var(--txt-01);border-radius:6px 6px 0 0}._columnChip_mviuo_40._error_mviuo_16{border-color:var(--txt-error)}._innerSection_mviuo_55{border:1px solid var(--txt-01);border-top:none;padding:16px 12px}._closeButton_mviuo_61{border:1px solid var(--txt-01);border-top-right-radius:6px;border-left:none;width:40px;height:40px;display:flex;justify-content:center;align-items:center;flex-shrink:0;cursor:pointer}._top_mviuo_74{position:relative;display:flex;width:100%;z-index:1;background:#fff}._fixedAxesBlock_mviuo_82{position:relative;display:flex;flex-direction:column;padding:12px 8px;gap:12px;border-left:1px solid var(--txt-01);border-right:1px solid var(--txt-01)}._fixedAxesBlock_mviuo_82>*{background:#fff}._middle_mviuo_96,._bottom_mviuo_96{position:relative;margin-top:-1px;background:#fff}._buttonWrapper_mviuo_102{margin-bottom:8px}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
+ const o = "_filterWrapper_mviuo_2", t = "_typeIcon_mviuo_11", e = "_error_mviuo_16", _ = "_closeIcon_mviuo_20", n = "_titleWrapper_mviuo_26", i = "_title_mviuo_26", c = "_columnChip_mviuo_40", r = "_innerSection_mviuo_55", p = "_closeButton_mviuo_61", l = "_top_mviuo_74", s = "_fixedAxesBlock_mviuo_82", u = "_middle_mviuo_96", m = "_bottom_mviuo_96", v = "_buttonWrapper_mviuo_102", a = {
3
+ filterWrapper: o,
4
+ typeIcon: t,
5
+ error: e,
6
+ closeIcon: _,
7
+ titleWrapper: n,
8
+ title: i,
9
+ columnChip: c,
10
+ innerSection: r,
11
+ closeButton: p,
12
+ top: l,
13
+ fixedAxesBlock: s,
14
+ middle: u,
15
+ bottom: m,
16
+ buttonWrapper: v
17
+ };
18
+ export {
19
+ m as bottom,
20
+ v as buttonWrapper,
21
+ p as closeButton,
22
+ _ as closeIcon,
23
+ c as columnChip,
24
+ a as default,
25
+ e as error,
26
+ o as filterWrapper,
27
+ s as fixedAxesBlock,
28
+ r as innerSection,
29
+ u as middle,
30
+ i as title,
31
+ n as titleWrapper,
32
+ l as top,
33
+ t as typeIcon
34
+ };
35
+ //# sourceMappingURL=SingleFilter.vue3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SingleFilter.vue3.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
@@ -0,0 +1,4 @@
1
+ import { Filter, FilterType, SupportedFilterTypes } from './types';
2
+ export declare const SUPPORTED_FILTER_TYPES: Set<SupportedFilterTypes>;
3
+ export declare const DEFAULT_FILTER_TYPE: FilterType;
4
+ export declare const DEFAULT_FILTERS: Record<SupportedFilterTypes, Filter>;
@@ -0,0 +1,41 @@
1
+ const t = /* @__PURE__ */ new Set([
2
+ "isNA",
3
+ "isNotNA",
4
+ "greaterThan",
5
+ "greaterThanOrEqual",
6
+ "lessThan",
7
+ "lessThanOrEqual",
8
+ "patternEquals",
9
+ "patternNotEquals",
10
+ "patternContainSubsequence",
11
+ "patternNotContainSubsequence",
12
+ "equal",
13
+ "notEqual",
14
+ "patternFuzzyContainSubsequence",
15
+ "patternMatchesRegularExpression",
16
+ "inSet",
17
+ "notInSet"
18
+ ]), a = "isNA", e = { column: "" }, n = {
19
+ isNA: { type: "isNA", ...e },
20
+ isNotNA: { type: "isNotNA", ...e },
21
+ lessThan: { type: "lessThan", x: void 0, ...e },
22
+ lessThanOrEqual: { type: "lessThanOrEqual", x: void 0, ...e },
23
+ patternEquals: { type: "patternEquals", value: void 0, ...e },
24
+ patternNotEquals: { type: "patternNotEquals", value: void 0, ...e },
25
+ greaterThan: { type: "greaterThan", x: void 0, ...e },
26
+ greaterThanOrEqual: { type: "greaterThanOrEqual", x: void 0, ...e },
27
+ patternContainSubsequence: { type: "patternContainSubsequence", value: "", ...e },
28
+ patternNotContainSubsequence: { type: "patternNotContainSubsequence", value: "", ...e },
29
+ patternFuzzyContainSubsequence: { type: "patternFuzzyContainSubsequence", maxEdits: 2, substitutionsOnly: !1, wildcard: void 0, value: "", ...e },
30
+ patternMatchesRegularExpression: { type: "patternMatchesRegularExpression", value: "", ...e },
31
+ equal: { type: "equal", x: void 0, ...e },
32
+ notEqual: { type: "notEqual", x: void 0, ...e },
33
+ inSet: { type: "inSet", value: [], ...e },
34
+ notInSet: { type: "notInSet", value: [], ...e }
35
+ };
36
+ export {
37
+ n as DEFAULT_FILTERS,
38
+ a as DEFAULT_FILTER_TYPE,
39
+ t as SUPPORTED_FILTER_TYPES
40
+ };
41
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../src/components/PlAdvancedFilter/constants.ts"],"sourcesContent":["import type { PlAdvancedFilterColumnId, Filter, FilterType, SupportedFilterTypes } from './types';\n\nexport const SUPPORTED_FILTER_TYPES = new Set<SupportedFilterTypes>([\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 'patternFuzzyContainSubsequence',\n 'patternMatchesRegularExpression',\n 'inSet',\n 'notInSet',\n]);\n\nexport const DEFAULT_FILTER_TYPE: FilterType = 'isNA';\n\nconst emptyCommonPart = { column: '' as PlAdvancedFilterColumnId };\nexport const DEFAULT_FILTERS: Record<SupportedFilterTypes, Filter> = {\n isNA: { type: 'isNA', ...emptyCommonPart },\n isNotNA: { type: 'isNotNA', ...emptyCommonPart },\n lessThan: { type: 'lessThan', x: undefined, ...emptyCommonPart },\n lessThanOrEqual: { type: 'lessThanOrEqual', x: undefined, ...emptyCommonPart },\n patternEquals: { type: 'patternEquals', value: undefined, ...emptyCommonPart },\n patternNotEquals: { type: 'patternNotEquals', value: undefined, ...emptyCommonPart },\n greaterThan: { type: 'greaterThan', x: undefined, ...emptyCommonPart },\n greaterThanOrEqual: { type: 'greaterThanOrEqual', x: undefined, ...emptyCommonPart },\n patternContainSubsequence: { type: 'patternContainSubsequence', value: '', ...emptyCommonPart },\n patternNotContainSubsequence: { type: 'patternNotContainSubsequence', value: '', ...emptyCommonPart },\n patternFuzzyContainSubsequence: { type: 'patternFuzzyContainSubsequence', maxEdits: 2, substitutionsOnly: false, wildcard: undefined, value: '', ...emptyCommonPart },\n patternMatchesRegularExpression: { type: 'patternMatchesRegularExpression', value: '', ...emptyCommonPart },\n equal: { type: 'equal', x: undefined, ...emptyCommonPart },\n notEqual: { type: 'notEqual', x: undefined, ...emptyCommonPart },\n inSet: { type: 'inSet', value: [], ...emptyCommonPart },\n notInSet: { type: 'notInSet', value: [], ...emptyCommonPart },\n};\n"],"names":["SUPPORTED_FILTER_TYPES","DEFAULT_FILTER_TYPE","emptyCommonPart","DEFAULT_FILTERS"],"mappings":"AAEO,MAAMA,wBAA6B,IAA0B;AAAA,EAClE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAEYC,IAAkC,QAEzCC,IAAkB,EAAE,QAAQ,GAAA,GACrBC,IAAwD;AAAA,EACnE,MAAM,EAAE,MAAM,QAAQ,GAAGD,EAAA;AAAA,EACzB,SAAS,EAAE,MAAM,WAAW,GAAGA,EAAA;AAAA,EAC/B,UAAU,EAAE,MAAM,YAAY,GAAG,QAAW,GAAGA,EAAA;AAAA,EAC/C,iBAAiB,EAAE,MAAM,mBAAmB,GAAG,QAAW,GAAGA,EAAA;AAAA,EAC7D,eAAe,EAAE,MAAM,iBAAiB,OAAO,QAAW,GAAGA,EAAA;AAAA,EAC7D,kBAAkB,EAAE,MAAM,oBAAoB,OAAO,QAAW,GAAGA,EAAA;AAAA,EACnE,aAAa,EAAE,MAAM,eAAe,GAAG,QAAW,GAAGA,EAAA;AAAA,EACrD,oBAAoB,EAAE,MAAM,sBAAsB,GAAG,QAAW,GAAGA,EAAA;AAAA,EACnE,2BAA2B,EAAE,MAAM,6BAA6B,OAAO,IAAI,GAAGA,EAAA;AAAA,EAC9E,8BAA8B,EAAE,MAAM,gCAAgC,OAAO,IAAI,GAAGA,EAAA;AAAA,EACpF,gCAAgC,EAAE,MAAM,kCAAkC,UAAU,GAAG,mBAAmB,IAAO,UAAU,QAAW,OAAO,IAAI,GAAGA,EAAA;AAAA,EACpJ,iCAAiC,EAAE,MAAM,mCAAmC,OAAO,IAAI,GAAGA,EAAA;AAAA,EAC1F,OAAO,EAAE,MAAM,SAAS,GAAG,QAAW,GAAGA,EAAA;AAAA,EACzC,UAAU,EAAE,MAAM,YAAY,GAAG,QAAW,GAAGA,EAAA;AAAA,EAC/C,OAAO,EAAE,MAAM,SAAS,OAAO,CAAA,GAAI,GAAGA,EAAA;AAAA,EACtC,UAAU,EAAE,MAAM,YAAY,OAAO,CAAA,GAAI,GAAGA,EAAA;AAC9C;"}
@@ -0,0 +1 @@
1
+ export { default as PlAdvancedFilter } from './PlAdvancedFilter.vue';
@@ -0,0 +1,57 @@
1
+ import { AxisSpec, FilterSpec, FilterSpecLeaf, FilterSpecType, ListOptionBase, PColumnSpec, SUniversalPColumnId, CanonicalizedJson, AxisId } from '@platforma-sdk/model';
2
+ export type PlAdvancedFilterColumnId = SUniversalPColumnId | CanonicalizedJson<AxisId>;
3
+ export type CommonFilterSpec = FilterSpec<FilterSpecLeaf<PlAdvancedFilterColumnId>, {
4
+ expanded?: boolean;
5
+ }>;
6
+ export type SupportedFilterTypes = FilterSpecType & 'isNA' | 'isNotNA' | 'patternEquals' | 'patternNotEquals' | 'patternContainSubsequence' | 'patternNotContainSubsequence' | 'patternMatchesRegularExpression' | 'patternFuzzyContainSubsequence' | 'inSet' | 'notInSet' | 'equal' | 'notEqual' | 'lessThan' | 'lessThanOrEqual' | 'greaterThan' | 'greaterThanOrEqual';
7
+ export type FilterType = SupportedFilterTypes;
8
+ export declare function isSupportedFilterType(type: FilterSpecType | undefined): type is SupportedFilterTypes;
9
+ export type Operand = 'or' | 'and';
10
+ type FilterUiBase = FilterSpecLeaf<PlAdvancedFilterColumnId> & {
11
+ type: SupportedFilterTypes;
12
+ column: PlAdvancedFilterColumnId;
13
+ };
14
+ type RequireFields<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
15
+ type OptionalFields<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
16
+ type NumericalWithOptionalX = 'lessThan' | 'lessThanOrEqual' | 'greaterThan' | 'greaterThanOrEqual' | 'equal' | 'notEqual';
17
+ type StringWithOptionalValue = 'patternEquals' | 'patternNotEquals';
18
+ type EditedTypes = SupportedFilterTypes & ('patternFuzzyContainSubsequence' | NumericalWithOptionalX | StringWithOptionalValue);
19
+ export type Filter = Exclude<FilterUiBase, {
20
+ type: EditedTypes;
21
+ }> | RequireFields<Extract<FilterUiBase, {
22
+ type: 'patternFuzzyContainSubsequence';
23
+ }>, 'maxEdits' | 'substitutionsOnly'> | OptionalFields<Extract<FilterUiBase, {
24
+ type: NumericalWithOptionalX;
25
+ }>, 'x'> | OptionalFields<Extract<FilterUiBase, {
26
+ type: StringWithOptionalValue;
27
+ }>, 'value'>;
28
+ export type Group = {
29
+ id: string;
30
+ not: boolean;
31
+ filters: Filter[];
32
+ operand: Operand;
33
+ expanded: boolean;
34
+ };
35
+ export type PlAdvancedFilterUI = {
36
+ groups: Group[];
37
+ operand: Operand;
38
+ };
39
+ export type UniqueValuesList = ListOptionBase<string | number>[];
40
+ export type OptionInfo = {
41
+ error: boolean;
42
+ label: string;
43
+ spec: PColumnSpec | AxisSpec;
44
+ };
45
+ export type FixedAxisInfo = {
46
+ idx: number;
47
+ label: string;
48
+ };
49
+ export type SourceOptionInfo = {
50
+ id: PlAdvancedFilterColumnId;
51
+ label: string;
52
+ error: boolean;
53
+ spec: PColumnSpec | AxisSpec;
54
+ axesToBeFixed?: FixedAxisInfo[];
55
+ alphabet?: 'nucleotide' | 'aminoacid' | string;
56
+ };
57
+ export {};
@@ -0,0 +1,8 @@
1
+ import { SUPPORTED_FILTER_TYPES as e } from "./constants.js";
2
+ function i(r) {
3
+ return r ? e.has(r) : !1;
4
+ }
5
+ export {
6
+ i as isSupportedFilterType
7
+ };
8
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":["../../../src/components/PlAdvancedFilter/types.ts"],"sourcesContent":["import type { AxisSpec, FilterSpec, FilterSpecLeaf, FilterSpecType, ListOptionBase, PColumnSpec, SUniversalPColumnId } from '@platforma-sdk/model';\nimport { SUPPORTED_FILTER_TYPES } from './constants';\nimport type { CanonicalizedJson } from '@platforma-sdk/model';\nimport type { AxisId } from '@platforma-sdk/model';\n\nexport type PlAdvancedFilterColumnId = SUniversalPColumnId | CanonicalizedJson<AxisId>;\nexport type CommonFilterSpec = FilterSpec<FilterSpecLeaf<PlAdvancedFilterColumnId>, { expanded?: boolean }>;\n\n// Not supported: topN, bottomN, lessThanColumn, lessThanColumnOrEqual\n// or, and, not - in groups\nexport type SupportedFilterTypes = FilterSpecType &\n 'isNA' | 'isNotNA' |\n 'patternEquals' | 'patternNotEquals' |\n 'patternContainSubsequence' | 'patternNotContainSubsequence' |\n 'patternMatchesRegularExpression' |\n 'patternFuzzyContainSubsequence' |\n 'inSet' | 'notInSet' |\n 'equal' | 'notEqual' |\n 'lessThan' | 'lessThanOrEqual' |\n 'greaterThan' | 'greaterThanOrEqual';\n\nexport type FilterType = SupportedFilterTypes;\n\nexport function isSupportedFilterType(type: FilterSpecType | undefined): type is SupportedFilterTypes {\n if (!type) {\n return false;\n }\n return SUPPORTED_FILTER_TYPES.has(type as SupportedFilterTypes);\n}\n\nexport type Operand = 'or' | 'and';\n\ntype FilterUiBase = FilterSpecLeaf<PlAdvancedFilterColumnId> & {\n type: SupportedFilterTypes;\n column: PlAdvancedFilterColumnId;\n};\n\ntype RequireFields<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;\ntype OptionalFields<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\ntype NumericalWithOptionalX = 'lessThan' | 'lessThanOrEqual' | 'greaterThan' | 'greaterThanOrEqual' | 'equal' | 'notEqual';\ntype StringWithOptionalValue = 'patternEquals' | 'patternNotEquals';\ntype EditedTypes = SupportedFilterTypes & ('patternFuzzyContainSubsequence' | NumericalWithOptionalX | StringWithOptionalValue); // types from ui with some changed by optionality fields\nexport type Filter = Exclude<FilterUiBase, { type: EditedTypes }> |\n RequireFields<Extract<FilterUiBase, { type: 'patternFuzzyContainSubsequence' }>, 'maxEdits' | 'substitutionsOnly'> |\n OptionalFields<Extract<FilterUiBase, { type: NumericalWithOptionalX }>, 'x'> |\n OptionalFields<Extract<FilterUiBase, { type: StringWithOptionalValue }>, 'value'>\n;\n\nexport type Group = {\n id: string;\n not: boolean;\n filters: Filter[];\n operand: Operand;\n expanded: boolean;\n};\n\nexport type PlAdvancedFilterUI = {\n groups: Group[];\n operand: Operand;\n};\n\nexport type UniqueValuesList = ListOptionBase<string | number>[];\nexport type OptionInfo = { error: boolean; label: string; spec: PColumnSpec | AxisSpec };\nexport type FixedAxisInfo = {\n idx: number;\n label: string;\n};\n\nexport type SourceOptionInfo = {\n id: PlAdvancedFilterColumnId;\n label: string;\n error: boolean;\n spec: PColumnSpec | AxisSpec;\n axesToBeFixed?: FixedAxisInfo[];\n alphabet?: 'nucleotide' | 'aminoacid' | string;\n};\n"],"names":["isSupportedFilterType","type","SUPPORTED_FILTER_TYPES"],"mappings":";AAuBO,SAASA,EAAsBC,GAAgE;AACpG,SAAKA,IAGEC,EAAuB,IAAID,CAA4B,IAFrD;AAGX;"}