@affino/datagrid-vue-app 0.1.39 → 0.1.41
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/README.md +48 -2
- package/dist/DataGrid.d.ts +3 -1
- package/dist/advanced-filter.js +1 -1
- package/dist/chunks/{DataGridAdvancedFilterPopover-BBLSw7c4.js → DataGridAdvancedFilterPopover-C_MjEKFo.js} +1 -1
- package/dist/chunks/DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-DxZakgyj.js +263 -0
- package/dist/chunks/{DataGridGanttStageEntry-o99nyV0i.js → DataGridGanttStageEntry-BhNAeUxC.js} +2968 -2919
- package/dist/chunks/dataGridAdvancedFilter-xnME5bRa.js +150 -0
- package/dist/chunks/useDataGridAppRowModel-C-OPUq4R.js +4458 -0
- package/dist/config/dataGridAdvancedFilter.d.ts +69 -0
- package/dist/config/dataGridColumnLayout.d.ts +23 -0
- package/dist/gantt.js +1 -1
- package/dist/host/DataGridDefaultRenderer.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +238 -263
- package/dist/internal.js +3 -3
- package/dist/overlays/DataGridAdvancedFilterPopover.vue.d.ts +6 -4
- package/dist/overlays/DataGridColumnLayoutPopover.vue.d.ts +6 -4
- package/dist/overlays/DataGridColumnMenu.vue.d.ts +2 -1
- package/dist/stage/dataGridTableStage.types.d.ts +2 -1
- package/dist/stage/useDataGridTableStageRuntime.d.ts +3 -3
- package/package.json +4 -4
- package/dist/chunks/DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-BUkG_Bz7.js +0 -261
- package/dist/chunks/useDataGridAppRowModel-Dy5CF0h4.js +0 -4424
package/dist/internal.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { d as t, r } from "./chunks/dataGridOverlayThemeVars-vzY74EIz.js";
|
|
2
2
|
import { buildDataGridChromePaneModel as i, buildDataGridChromeRenderModel as d } from "@affino/datagrid-chrome";
|
|
3
|
-
import { D as l, a as n, r as G, b as D, c as S, d as u, u as g, e as b, f as T } from "./chunks/useDataGridAppRowModel-
|
|
4
|
-
import { _ as p, a as c, c as R, b as x, d as C, p as f, u as v, e as M, f as h, g as w, h as y, i as F, j as P, k as A, l as O, m as _, n as E, o as H } from "./chunks/DataGridGanttStageEntry-
|
|
5
|
-
import { _ as V } from "./chunks/DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { D as l, a as n, r as G, b as D, c as S, d as u, u as g, e as b, f as T } from "./chunks/useDataGridAppRowModel-C-OPUq4R.js";
|
|
4
|
+
import { _ as p, a as c, c as R, b as x, d as C, p as f, u as v, e as M, f as h, g as w, h as y, i as F, j as P, k as A, l as O, m as _, n as E, o as H } from "./chunks/DataGridGanttStageEntry-BhNAeUxC.js";
|
|
5
|
+
import { _ as V } from "./chunks/DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-DxZakgyj.js";
|
|
6
6
|
import { _ as k } from "./chunks/DataGridFindReplacePopover.vue_vue_type_script_setup_true_lang-BEVRKG31.js";
|
|
7
7
|
import { buildDataGridTimelineRenderModels as B, normalizeDataGridGanttOptions as I, resolveDataGridTimelineRange as L } from "@affino/datagrid-gantt";
|
|
8
8
|
export {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DataGridAppAdvancedFilterClauseDraft, DataGridAppAdvancedFilterClausePatch, DataGridAppAdvancedFilterColumnOption } from "@affino/datagrid-vue/app";
|
|
2
|
+
import { type DataGridResolvedAdvancedFilterLabels } from "../config/dataGridAdvancedFilter";
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
isOpen: boolean;
|
|
4
5
|
clauses: readonly DataGridAppAdvancedFilterClauseDraft[];
|
|
@@ -6,13 +7,14 @@ type __VLS_Props = {
|
|
|
6
7
|
appliedFilterSummaryItems?: readonly string[];
|
|
7
8
|
hasAnyFilters?: boolean;
|
|
8
9
|
buttonLabel?: string;
|
|
10
|
+
labels?: DataGridResolvedAdvancedFilterLabels;
|
|
9
11
|
active?: boolean;
|
|
10
12
|
showActiveIcon?: boolean;
|
|
11
13
|
};
|
|
12
14
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
13
15
|
appliedFilterSummaryItems: () => never[];
|
|
14
16
|
hasAnyFilters: boolean;
|
|
15
|
-
|
|
17
|
+
labels: () => DataGridResolvedAdvancedFilterLabels;
|
|
16
18
|
active: boolean;
|
|
17
19
|
showActiveIcon: boolean;
|
|
18
20
|
}>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -26,20 +28,20 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_WithDefaults<__V
|
|
|
26
28
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
27
29
|
appliedFilterSummaryItems: () => never[];
|
|
28
30
|
hasAnyFilters: boolean;
|
|
29
|
-
|
|
31
|
+
labels: () => DataGridResolvedAdvancedFilterLabels;
|
|
30
32
|
active: boolean;
|
|
31
33
|
showActiveIcon: boolean;
|
|
32
34
|
}>>> & {
|
|
33
35
|
onCancel?: (() => any) | undefined;
|
|
34
36
|
onOpen?: (() => any) | undefined;
|
|
35
37
|
onApply?: (() => any) | undefined;
|
|
36
|
-
onAdd?: (() => any) | undefined;
|
|
37
38
|
onRemove?: ((clauseId: number) => any) | undefined;
|
|
39
|
+
onAdd?: (() => any) | undefined;
|
|
38
40
|
"onReset-all"?: (() => any) | undefined;
|
|
39
41
|
"onUpdate-clause"?: ((payload: DataGridAppAdvancedFilterClausePatch) => any) | undefined;
|
|
40
42
|
}, {
|
|
43
|
+
labels: DataGridResolvedAdvancedFilterLabels;
|
|
41
44
|
active: boolean;
|
|
42
|
-
buttonLabel: string;
|
|
43
45
|
appliedFilterSummaryItems: readonly string[];
|
|
44
46
|
hasAnyFilters: boolean;
|
|
45
47
|
showActiveIcon: boolean;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import type { DataGridAppColumnLayoutPanelItem, DataGridAppColumnLayoutVisibilityPatch } from "@affino/datagrid-vue/app";
|
|
2
|
+
import { type DataGridResolvedColumnLayoutLabels } from "../config/dataGridColumnLayout";
|
|
2
3
|
type __VLS_Props = {
|
|
3
4
|
isOpen: boolean;
|
|
4
5
|
items: readonly DataGridAppColumnLayoutPanelItem[];
|
|
5
6
|
buttonLabel?: string;
|
|
7
|
+
labels?: DataGridResolvedColumnLayoutLabels;
|
|
6
8
|
active?: boolean;
|
|
7
9
|
};
|
|
8
10
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
9
|
-
|
|
11
|
+
labels: () => DataGridResolvedColumnLayoutLabels;
|
|
10
12
|
active: boolean;
|
|
11
13
|
}>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
14
|
cancel: () => void;
|
|
13
15
|
open: () => void;
|
|
16
|
+
apply: () => void;
|
|
14
17
|
"toggle-visibility": (payload: DataGridAppColumnLayoutVisibilityPatch) => void;
|
|
15
18
|
"move-up": (key: string) => void;
|
|
16
19
|
"move-down": (key: string) => void;
|
|
@@ -19,9 +22,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_WithDefaults<__V
|
|
|
19
22
|
targetKey: string;
|
|
20
23
|
placement: "before" | "after";
|
|
21
24
|
}) => void;
|
|
22
|
-
apply: () => void;
|
|
23
25
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToOption<__VLS_Props>, {
|
|
24
|
-
|
|
26
|
+
labels: () => DataGridResolvedColumnLayoutLabels;
|
|
25
27
|
active: boolean;
|
|
26
28
|
}>>> & {
|
|
27
29
|
onCancel?: (() => any) | undefined;
|
|
@@ -36,8 +38,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_WithDefaults<__V
|
|
|
36
38
|
placement: "before" | "after";
|
|
37
39
|
}) => any) | undefined;
|
|
38
40
|
}, {
|
|
41
|
+
labels: DataGridResolvedColumnLayoutLabels;
|
|
39
42
|
active: boolean;
|
|
40
|
-
buttonLabel: string;
|
|
41
43
|
}, {}>;
|
|
42
44
|
declare const _default: typeof __VLS_export;
|
|
43
45
|
export default _default;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { DataGridColumnHistogramEntry } from "@affino/datagrid-vue";
|
|
2
2
|
import type { DataGridColumnMenuActionOptions, DataGridColumnMenuCustomItem, DataGridColumnMenuDisabledReasons, DataGridColumnMenuItemKey, DataGridColumnMenuItemLabels, DataGridColumnMenuTriggerMode } from "./dataGridColumnMenu";
|
|
3
3
|
type DataGridColumnPin = "left" | "right" | "none";
|
|
4
|
+
type DataGridColumnMenuValueEntriesResult = readonly DataGridColumnHistogramEntry[] | Promise<readonly DataGridColumnHistogramEntry[]>;
|
|
4
5
|
type __VLS_Props = {
|
|
5
6
|
rowCount: number;
|
|
6
|
-
resolveValueEntries?: (() =>
|
|
7
|
+
resolveValueEntries?: ((search?: string) => DataGridColumnMenuValueEntriesResult) | undefined;
|
|
7
8
|
items: readonly DataGridColumnMenuItemKey[];
|
|
8
9
|
disabledItems: readonly DataGridColumnMenuItemKey[];
|
|
9
10
|
disabledReasons: DataGridColumnMenuDisabledReasons;
|
|
@@ -4,6 +4,7 @@ import type { DataGridFillBehavior } from "@affino/datagrid-vue/advanced";
|
|
|
4
4
|
import type { DataGridLayoutMode } from "../config/dataGridLayout";
|
|
5
5
|
import type { DataGridColumnMenuActionOptions, DataGridColumnMenuCustomItem, DataGridColumnMenuDisabledReasons, DataGridColumnMenuItemKey, DataGridColumnMenuItemLabels, DataGridColumnMenuTriggerMode } from "../overlays/dataGridColumnMenu";
|
|
6
6
|
export type DataGridTableMode = "base" | "tree" | "pivot" | "worker";
|
|
7
|
+
export type DataGridColumnMenuValueEntriesResult = readonly DataGridColumnHistogramEntry[] | Promise<readonly DataGridColumnHistogramEntry[]>;
|
|
7
8
|
export type DataGridPendingEdge = "top" | "right" | "bottom" | "left";
|
|
8
9
|
export type DataGridTableRow<TRow extends Record<string, unknown>> = DataGridRowNode<TRow>;
|
|
9
10
|
export type DataGridElementRefHandler = (value: Element | ComponentPublicInstance | null) => void;
|
|
@@ -78,7 +79,7 @@ export interface DataGridTableStageColumnsSection {
|
|
|
78
79
|
resolveColumnGroupOrder?: (columnKey: string) => number | null;
|
|
79
80
|
resolveColumnMenuSortDirection?: (columnKey: string) => "asc" | "desc" | null;
|
|
80
81
|
resolveColumnMenuSelectedTokens?: (columnKey: string) => readonly string[];
|
|
81
|
-
resolveColumnMenuValueEntries?: (columnKey: string) =>
|
|
82
|
+
resolveColumnMenuValueEntries?: (columnKey: string, search?: string) => DataGridColumnMenuValueEntriesResult;
|
|
82
83
|
applyColumnMenuSort?: (columnKey: string, direction: "asc" | "desc" | null) => void;
|
|
83
84
|
applyColumnMenuPin?: (columnKey: string, pin: DataGridColumnPin) => void;
|
|
84
85
|
applyColumnMenuGroupBy?: (columnKey: string, grouped: boolean) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComputedRef, type CSSProperties, type Ref } from "vue";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DataGridRowNode, DataGridColumnSnapshot, DataGridRowSelectionSnapshot, DataGridSelectionSnapshot, UseDataGridRuntimeResult } from "@affino/datagrid-vue";
|
|
3
3
|
import type { DataGridCopyRange } from "@affino/datagrid-vue/advanced";
|
|
4
4
|
import { type DataGridAppPasteOptions } from "@affino/datagrid-vue/app";
|
|
5
5
|
import type { DataGridCellEditablePredicate } from "../dataGridEditability";
|
|
@@ -10,7 +10,7 @@ import type { DataGridPlaceholderRowsOptions } from "../config/dataGridPlacehold
|
|
|
10
10
|
import type { DataGridVirtualizationOptions } from "../config/dataGridVirtualization";
|
|
11
11
|
import type { DataGridTableStageContext } from "./dataGridTableStageContext";
|
|
12
12
|
import type { DataGridTableStageHistoryAdapter } from "./useDataGridTableStageHistory";
|
|
13
|
-
import type { DataGridTableRow, DataGridTableStageCellClass, DataGridTableStageProps } from "./dataGridTableStage.types";
|
|
13
|
+
import type { DataGridColumnMenuValueEntriesResult, DataGridTableRow, DataGridTableStageCellClass, DataGridTableStageProps } from "./dataGridTableStage.types";
|
|
14
14
|
export type { DataGridTableStageHistoryAdapter } from "./useDataGridTableStageHistory";
|
|
15
15
|
type DataGridTableStageBodyRuntime<TRow extends Record<string, unknown>> = {
|
|
16
16
|
api: UseDataGridRuntimeResult<TRow>["api"];
|
|
@@ -88,7 +88,7 @@ export interface UseDataGridTableStageRuntimeOptions<TRow extends Record<string,
|
|
|
88
88
|
resolveColumnGroupOrder?: (columnKey: string) => number | null;
|
|
89
89
|
resolveColumnMenuSortDirection?: (columnKey: string) => "asc" | "desc" | null;
|
|
90
90
|
resolveColumnMenuSelectedTokens?: (columnKey: string) => readonly string[];
|
|
91
|
-
resolveColumnMenuValueEntries?: (columnKey: string) =>
|
|
91
|
+
resolveColumnMenuValueEntries?: (columnKey: string, search?: string) => DataGridColumnMenuValueEntriesResult;
|
|
92
92
|
applyColumnMenuSort?: (columnKey: string, direction: "asc" | "desc" | null) => void;
|
|
93
93
|
applyColumnMenuPin?: (columnKey: string, pin: import("@affino/datagrid-vue").DataGridColumnPin) => void;
|
|
94
94
|
applyColumnMenuGroupBy?: (columnKey: string, grouped: boolean) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@affino/datagrid-vue-app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.41",
|
|
4
4
|
"description": "Declarative Vue DataGrid component for Affino",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@affino/menu-vue": "^2.1.1",
|
|
43
43
|
"@affino/popover-vue": "^1.1.0",
|
|
44
|
-
"@affino/datagrid-chrome": "0.1.1",
|
|
45
44
|
"@affino/datagrid-gantt": "0.1.2",
|
|
46
|
-
"@affino/datagrid-
|
|
47
|
-
"@affino/datagrid-vue": "0.3.
|
|
45
|
+
"@affino/datagrid-chrome": "0.1.1",
|
|
46
|
+
"@affino/datagrid-vue": "0.3.28",
|
|
47
|
+
"@affino/datagrid-theme": "0.2.2"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"vue": "^3.3.0"
|
package/dist/chunks/DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-BUkG_Bz7.js
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import { defineComponent as j, inject as q, ref as w, computed as v, watch as y, nextTick as P, openBlock as o, createElementBlock as n, Fragment as h, createElementVNode as e, mergeProps as I, unref as s, createCommentVNode as A, createTextVNode as G, toDisplayString as C, createBlock as L, Teleport as z, renderList as T, createVNode as O } from "vue";
|
|
2
|
-
import { usePopoverController as J, useFloatingPopover as K } from "@affino/popover-vue";
|
|
3
|
-
import { _ as k } from "./DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-xry4J3Lx.js";
|
|
4
|
-
import { d as M, r as Z } from "./dataGridOverlayThemeVars-vzY74EIz.js";
|
|
5
|
-
import { u as H } from "./useDataGridDraggableOverlaySurface-BgkSR_nl.js";
|
|
6
|
-
const Q = ["data-datagrid-advanced-filter-active"], U = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "datagrid-app-toolbar__button-icon datagrid-app-toolbar__button-icon--advanced-filter",
|
|
9
|
-
"data-datagrid-advanced-filter-icon": "true",
|
|
10
|
-
"aria-hidden": "true"
|
|
11
|
-
}, W = /* @__PURE__ */ e("svg", {
|
|
12
|
-
viewBox: "0 0 16 16",
|
|
13
|
-
focusable: "false"
|
|
14
|
-
}, [
|
|
15
|
-
/* @__PURE__ */ e("path", {
|
|
16
|
-
d: "M2 3.5h12l-4.6 5.2v3.2l-2.8 1.6V8.7L2 3.5Z",
|
|
17
|
-
fill: "currentColor"
|
|
18
|
-
})
|
|
19
|
-
], -1), X = [
|
|
20
|
-
W
|
|
21
|
-
], Y = ["data-datagrid-overlay-dragging"], x = { class: "datagrid-advanced-filter__header" }, ee = /* @__PURE__ */ e("div", { class: "datagrid-advanced-filter__eyebrow" }, "Advanced filter", -1), ae = /* @__PURE__ */ e("h3", { class: "datagrid-advanced-filter__title" }, "Build clause-based filter", -1), te = [
|
|
22
|
-
ee,
|
|
23
|
-
ae
|
|
24
|
-
], le = { class: "datagrid-advanced-filter__applied" }, de = { class: "datagrid-advanced-filter__applied-head" }, oe = /* @__PURE__ */ e("div", null, [
|
|
25
|
-
/* @__PURE__ */ e("div", { class: "datagrid-advanced-filter__eyebrow" }, "Applied on table"),
|
|
26
|
-
/* @__PURE__ */ e("div", { class: "datagrid-advanced-filter__applied-title" }, "Current filters")
|
|
27
|
-
], -1), ie = ["disabled"], ne = {
|
|
28
|
-
key: 0,
|
|
29
|
-
class: "datagrid-advanced-filter__applied-list"
|
|
30
|
-
}, re = {
|
|
31
|
-
key: 1,
|
|
32
|
-
class: "datagrid-advanced-filter__applied-empty"
|
|
33
|
-
}, se = { class: "datagrid-advanced-filter__rows" }, ce = { class: "datagrid-advanced-filter__field datagrid-advanced-filter__field--join" }, ue = /* @__PURE__ */ e("span", { class: "datagrid-advanced-filter__label" }, "Join", -1), ve = { class: "datagrid-advanced-filter__field" }, pe = /* @__PURE__ */ e("span", { class: "datagrid-advanced-filter__label" }, "Column", -1), fe = { class: "datagrid-advanced-filter__field" }, _e = /* @__PURE__ */ e("span", { class: "datagrid-advanced-filter__label" }, "Operator", -1), ge = { class: "datagrid-advanced-filter__field datagrid-advanced-filter__field--value" }, me = /* @__PURE__ */ e("span", { class: "datagrid-advanced-filter__label" }, "Value", -1), be = ["name", "value", "onInput"], ye = { class: "datagrid-advanced-filter__row-actions" }, he = ["onClick"], Ce = { class: "datagrid-advanced-filter__footer" }, Oe = { class: "datagrid-advanced-filter__footer-actions" }, Te = /* @__PURE__ */ j({
|
|
34
|
-
__name: "DataGridAdvancedFilterPopover",
|
|
35
|
-
props: {
|
|
36
|
-
isOpen: { type: Boolean },
|
|
37
|
-
clauses: {},
|
|
38
|
-
columns: {},
|
|
39
|
-
appliedFilterSummaryItems: { default: () => [] },
|
|
40
|
-
hasAnyFilters: { type: Boolean, default: !1 },
|
|
41
|
-
buttonLabel: { default: "Advanced filter" },
|
|
42
|
-
active: { type: Boolean, default: !1 },
|
|
43
|
-
showActiveIcon: { type: Boolean, default: !1 }
|
|
44
|
-
},
|
|
45
|
-
emits: ["open", "add", "remove", "apply", "cancel", "reset-all", "update-clause"],
|
|
46
|
-
setup(S, { emit: F }) {
|
|
47
|
-
const N = Object.freeze([
|
|
48
|
-
{ value: "and", label: "AND" },
|
|
49
|
-
{ value: "or", label: "OR" }
|
|
50
|
-
]), R = Object.freeze([
|
|
51
|
-
{ value: "contains", label: "Contains" },
|
|
52
|
-
{ value: "in", label: "In" },
|
|
53
|
-
{ value: "equals", label: "Equals" },
|
|
54
|
-
{ value: "not-equals", label: "Not equals" },
|
|
55
|
-
{ value: "starts-with", label: "Starts with" },
|
|
56
|
-
{ value: "ends-with", label: "Ends with" },
|
|
57
|
-
{ value: "gt", label: ">" },
|
|
58
|
-
{ value: "gte", label: ">=" },
|
|
59
|
-
{ value: "lt", label: "<" },
|
|
60
|
-
{ value: "lte", label: "<=" }
|
|
61
|
-
]), u = S, i = F, g = q(M, w(null)), m = w({}), d = J(
|
|
62
|
-
{
|
|
63
|
-
id: "advanced-filter",
|
|
64
|
-
role: "dialog",
|
|
65
|
-
closeOnEscape: !0,
|
|
66
|
-
closeOnInteractOutside: !0
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
onOpen: () => {
|
|
70
|
-
u.isOpen || i("open"), b();
|
|
71
|
-
},
|
|
72
|
-
onClose: () => {
|
|
73
|
-
u.isOpen && i("cancel");
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
), c = K(d, {
|
|
77
|
-
placement: "bottom",
|
|
78
|
-
align: "start",
|
|
79
|
-
gutter: 10,
|
|
80
|
-
viewportPadding: 12,
|
|
81
|
-
zIndex: 180,
|
|
82
|
-
lockScroll: !1,
|
|
83
|
-
returnFocus: !0
|
|
84
|
-
}), p = H({
|
|
85
|
-
surfaceId: "advanced-filter",
|
|
86
|
-
rootElementRef: g,
|
|
87
|
-
floating: c
|
|
88
|
-
}), V = v(() => d.getTriggerProps({ role: "dialog" })), B = v(() => d.getContentProps({ role: "dialog", tabIndex: -1 })), $ = v(() => d.state.value.open), D = v(() => c.teleportTarget.value), E = v(() => u.columns.map((t) => ({
|
|
89
|
-
value: t.key,
|
|
90
|
-
label: t.label
|
|
91
|
-
})));
|
|
92
|
-
y(
|
|
93
|
-
() => u.isOpen,
|
|
94
|
-
async (t) => {
|
|
95
|
-
if (t) {
|
|
96
|
-
b(), d.state.value.open || d.open("programmatic"), await P(), c.contentRef.value?.querySelector('[data-advanced-filter-autofocus="true"]')?.focus({ preventScroll: !0 }), await c.updatePosition();
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
d.state.value.open && d.close("programmatic");
|
|
100
|
-
},
|
|
101
|
-
{ immediate: !0 }
|
|
102
|
-
), y(g, () => {
|
|
103
|
-
d.state.value.open && b();
|
|
104
|
-
}), y(
|
|
105
|
-
() => u.clauses.length,
|
|
106
|
-
async () => {
|
|
107
|
-
d.state.value.open && (await P(), await c.updatePosition());
|
|
108
|
-
}
|
|
109
|
-
);
|
|
110
|
-
function b() {
|
|
111
|
-
m.value = Z(g.value);
|
|
112
|
-
}
|
|
113
|
-
function f(t, l, a) {
|
|
114
|
-
i("update-clause", { clauseId: t, field: l, value: a });
|
|
115
|
-
}
|
|
116
|
-
return (t, l) => (o(), n(h, null, [
|
|
117
|
-
e("button", I({
|
|
118
|
-
ref: s(c).triggerRef,
|
|
119
|
-
type: "button",
|
|
120
|
-
class: ["datagrid-app-toolbar__button", { "datagrid-app-toolbar__button--active": t.active }],
|
|
121
|
-
"data-datagrid-toolbar-action": "advanced-filter",
|
|
122
|
-
"data-datagrid-advanced-filter-active": t.showActiveIcon ? "true" : "false",
|
|
123
|
-
style: m.value
|
|
124
|
-
}, V.value), [
|
|
125
|
-
t.showActiveIcon ? (o(), n("span", U, X)) : A("", !0),
|
|
126
|
-
G(" " + C(t.buttonLabel), 1)
|
|
127
|
-
], 16, Q),
|
|
128
|
-
(o(), L(z, { to: D.value }, [
|
|
129
|
-
$.value ? (o(), n("section", I({
|
|
130
|
-
key: 0,
|
|
131
|
-
ref: s(c).contentRef,
|
|
132
|
-
class: "datagrid-advanced-filter",
|
|
133
|
-
"data-datagrid-overlay-surface": "true",
|
|
134
|
-
"data-datagrid-overlay-surface-id": "advanced-filter",
|
|
135
|
-
"data-datagrid-overlay-dragging": s(p).dragging.value ? "true" : "false",
|
|
136
|
-
style: [s(p).surfaceStyle.value, m.value]
|
|
137
|
-
}, B.value), [
|
|
138
|
-
e("header", x, [
|
|
139
|
-
e("div", {
|
|
140
|
-
class: "datagrid-overlay-drag-handle",
|
|
141
|
-
"data-datagrid-overlay-drag-handle": "true",
|
|
142
|
-
onPointerdown: l[0] || (l[0] = //@ts-ignore
|
|
143
|
-
(...a) => s(p).handlePointerDown && s(p).handlePointerDown(...a))
|
|
144
|
-
}, te, 32),
|
|
145
|
-
e("button", {
|
|
146
|
-
type: "button",
|
|
147
|
-
class: "datagrid-advanced-filter__ghost",
|
|
148
|
-
onClick: l[1] || (l[1] = (a) => i("cancel"))
|
|
149
|
-
}, " Close ")
|
|
150
|
-
]),
|
|
151
|
-
e("section", le, [
|
|
152
|
-
e("div", de, [
|
|
153
|
-
oe,
|
|
154
|
-
e("button", {
|
|
155
|
-
type: "button",
|
|
156
|
-
class: "datagrid-advanced-filter__ghost",
|
|
157
|
-
disabled: !t.hasAnyFilters,
|
|
158
|
-
"data-datagrid-advanced-filter-action": "reset-all",
|
|
159
|
-
onClick: l[2] || (l[2] = (a) => i("reset-all"))
|
|
160
|
-
}, " Reset all filters ", 8, ie)
|
|
161
|
-
]),
|
|
162
|
-
t.appliedFilterSummaryItems.length > 0 ? (o(), n("div", ne, [
|
|
163
|
-
(o(!0), n(h, null, T(t.appliedFilterSummaryItems, (a, _) => (o(), n("span", {
|
|
164
|
-
key: `applied-filter-${_}`,
|
|
165
|
-
class: "datagrid-advanced-filter__applied-chip"
|
|
166
|
-
}, C(a), 1))), 128))
|
|
167
|
-
])) : (o(), n("div", re, " No filters applied "))
|
|
168
|
-
]),
|
|
169
|
-
e("div", se, [
|
|
170
|
-
(o(!0), n(h, null, T(t.clauses, (a, _) => (o(), n("div", {
|
|
171
|
-
key: a.id,
|
|
172
|
-
class: "datagrid-advanced-filter__row"
|
|
173
|
-
}, [
|
|
174
|
-
e("label", ce, [
|
|
175
|
-
ue,
|
|
176
|
-
O(k, {
|
|
177
|
-
class: "datagrid-advanced-filter__select",
|
|
178
|
-
value: a.join,
|
|
179
|
-
options: s(N),
|
|
180
|
-
"open-on-mount": !1,
|
|
181
|
-
"open-on-focus": !1,
|
|
182
|
-
"sticky-popover-id": "advanced-filter",
|
|
183
|
-
disabled: _ === 0,
|
|
184
|
-
"aria-label": "Join operator",
|
|
185
|
-
onCommit: (r) => f(a.id, "join", r)
|
|
186
|
-
}, null, 8, ["value", "options", "disabled", "onCommit"])
|
|
187
|
-
]),
|
|
188
|
-
e("label", ve, [
|
|
189
|
-
pe,
|
|
190
|
-
O(k, {
|
|
191
|
-
class: "datagrid-advanced-filter__select",
|
|
192
|
-
value: a.columnKey,
|
|
193
|
-
options: E.value,
|
|
194
|
-
"open-on-mount": !1,
|
|
195
|
-
"open-on-focus": !1,
|
|
196
|
-
"sticky-popover-id": "advanced-filter",
|
|
197
|
-
"data-advanced-filter-autofocus": _ === 0 ? "true" : null,
|
|
198
|
-
"aria-label": "Column",
|
|
199
|
-
onCommit: (r) => f(a.id, "columnKey", r)
|
|
200
|
-
}, null, 8, ["value", "options", "data-advanced-filter-autofocus", "onCommit"])
|
|
201
|
-
]),
|
|
202
|
-
e("label", fe, [
|
|
203
|
-
_e,
|
|
204
|
-
O(k, {
|
|
205
|
-
class: "datagrid-advanced-filter__select",
|
|
206
|
-
value: a.operator,
|
|
207
|
-
options: s(R),
|
|
208
|
-
"open-on-mount": !1,
|
|
209
|
-
"open-on-focus": !1,
|
|
210
|
-
"sticky-popover-id": "advanced-filter",
|
|
211
|
-
"aria-label": "Condition operator",
|
|
212
|
-
onCommit: (r) => f(a.id, "operator", r)
|
|
213
|
-
}, null, 8, ["value", "options", "onCommit"])
|
|
214
|
-
]),
|
|
215
|
-
e("label", ge, [
|
|
216
|
-
me,
|
|
217
|
-
e("input", {
|
|
218
|
-
name: `datagrid-advanced-filter-value-${a.id}`,
|
|
219
|
-
value: a.value,
|
|
220
|
-
type: "text",
|
|
221
|
-
placeholder: "Value",
|
|
222
|
-
"aria-label": "Condition value",
|
|
223
|
-
onInput: (r) => f(a.id, "value", r.target.value)
|
|
224
|
-
}, null, 40, be)
|
|
225
|
-
]),
|
|
226
|
-
e("div", ye, [
|
|
227
|
-
e("button", {
|
|
228
|
-
type: "button",
|
|
229
|
-
class: "datagrid-advanced-filter__ghost datagrid-advanced-filter__ghost--danger",
|
|
230
|
-
onClick: (r) => i("remove", a.id)
|
|
231
|
-
}, C(t.clauses.length <= 1 ? "Clear" : "Remove"), 9, he)
|
|
232
|
-
])
|
|
233
|
-
]))), 128))
|
|
234
|
-
]),
|
|
235
|
-
e("footer", Ce, [
|
|
236
|
-
e("button", {
|
|
237
|
-
type: "button",
|
|
238
|
-
class: "datagrid-advanced-filter__secondary",
|
|
239
|
-
onClick: l[3] || (l[3] = (a) => i("add"))
|
|
240
|
-
}, " Add clause "),
|
|
241
|
-
e("div", Oe, [
|
|
242
|
-
e("button", {
|
|
243
|
-
type: "button",
|
|
244
|
-
class: "datagrid-advanced-filter__secondary",
|
|
245
|
-
onClick: l[4] || (l[4] = (a) => i("cancel"))
|
|
246
|
-
}, " Cancel "),
|
|
247
|
-
e("button", {
|
|
248
|
-
type: "button",
|
|
249
|
-
class: "datagrid-advanced-filter__primary",
|
|
250
|
-
onClick: l[5] || (l[5] = (a) => i("apply"))
|
|
251
|
-
}, " Apply ")
|
|
252
|
-
])
|
|
253
|
-
])
|
|
254
|
-
], 16, Y)) : A("", !0)
|
|
255
|
-
], 8, ["to"]))
|
|
256
|
-
], 64));
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
export {
|
|
260
|
-
Te as _
|
|
261
|
-
};
|