@affino/datagrid-vue-app 0.1.14 → 0.1.16
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 +34 -0
- package/dist/DataGrid.d.ts +60 -18
- package/dist/advanced-filter.js +1 -1
- package/dist/chunks/{DataGridAdvancedFilterPopover-Bak_CkaO.js → DataGridAdvancedFilterPopover-CabJ-Ztk.js} +1 -1
- package/dist/chunks/{DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-DixN56Qv.js → DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-x-cfVm5j.js} +92 -72
- package/dist/chunks/DataGridGanttStageEntry-CS2wpBnj.js +7815 -0
- package/dist/chunks/useDataGridAppRowModel-RrE_k6tK.js +3008 -0
- package/dist/config/dataGridSavedView.d.ts +2 -0
- package/dist/gantt.js +4 -4
- package/dist/host/DataGridDefaultRenderer.d.ts +9 -0
- package/dist/host/DataGridRuntimeHost.d.ts +19 -5
- package/dist/index.d.ts +1 -0
- package/dist/index.js +584 -483
- package/dist/internal.js +24 -25
- package/dist/overlays/DataGridAdvancedFilterPopover.vue.d.ts +4 -0
- package/dist/stage/useDataGridTableStageRowSelection.d.ts +4 -2
- package/dist/stage/useDataGridTableStageRuntime.d.ts +1 -0
- package/package.json +4 -4
- package/dist/chunks/DataGridColumnLayoutPopover-Qt56b3CA.js +0 -136
- package/dist/chunks/DataGridGanttStage.vue_vue_type_script_setup_true_lang-BY-MSNPc.js +0 -916
- package/dist/chunks/DataGridGanttStageEntry-DgXw3IJw.js +0 -40
- package/dist/chunks/DataGridTableStage.vue_vue_type_script_setup_true_lang-Cec3mpHC.js +0 -6850
- package/dist/chunks/useDataGridAppRowModel-DJYtqvD0.js +0 -2854
package/README.md
CHANGED
|
@@ -1019,6 +1019,8 @@ Supported preset names:
|
|
|
1019
1019
|
|
|
1020
1020
|
The public component exposes full grid state round-tripping.
|
|
1021
1021
|
|
|
1022
|
+
When `state` is the only controlled input, the built-in app toolbar and filter affordances derive their effective sort, filter, grouping, and pivot state from that unified snapshot. You do not need to mirror the same payload back into separate `sort-model`, `filter-model`, `group-by`, or `pivot-model` props just to keep the default renderer synchronized.
|
|
1023
|
+
|
|
1022
1024
|
Controlled state:
|
|
1023
1025
|
|
|
1024
1026
|
```vue
|
|
@@ -1050,6 +1052,38 @@ function importState(raw: unknown) {
|
|
|
1050
1052
|
}
|
|
1051
1053
|
}
|
|
1052
1054
|
|
|
1055
|
+
`applyState()` and `applySavedView()` also queue the restore until the runtime and declared columns are ready. Host pages can restore presets before async column definitions finish loading instead of maintaining a separate pending-saved-view scheduler.
|
|
1056
|
+
|
|
1057
|
+
Saved views sanitize transient transaction history before serialization and restore. The persisted envelope keeps layout, filters, grouping, pivoting, row selection, and `viewMode`, but drops undo/redo history.
|
|
1058
|
+
|
|
1059
|
+
### Controlled Row Selection
|
|
1060
|
+
|
|
1061
|
+
`rowSelection` still enables the built-in checkbox column and header select-all control. When a page wants to own the selected-row snapshot directly, use `rowSelectionState` with `update:rowSelectionState`.
|
|
1062
|
+
|
|
1063
|
+
```vue
|
|
1064
|
+
<script setup lang="ts">
|
|
1065
|
+
import { ref } from "vue"
|
|
1066
|
+
import { DataGrid } from "@affino/datagrid-vue-app"
|
|
1067
|
+
|
|
1068
|
+
const rowSelectionState = ref({
|
|
1069
|
+
focusedRow: null,
|
|
1070
|
+
selectedRows: ["r2"],
|
|
1071
|
+
})
|
|
1072
|
+
</script>
|
|
1073
|
+
|
|
1074
|
+
<template>
|
|
1075
|
+
<DataGrid
|
|
1076
|
+
:rows="rows"
|
|
1077
|
+
:columns="columns"
|
|
1078
|
+
row-selection
|
|
1079
|
+
:row-selection-state="rowSelectionState"
|
|
1080
|
+
@update:row-selection-state="rowSelectionState = $event"
|
|
1081
|
+
/>
|
|
1082
|
+
</template>
|
|
1083
|
+
```
|
|
1084
|
+
|
|
1085
|
+
The legacy `row-select` event still exists, but `rowSelectionState` is the stable controlled API when the page wants to bind selected row ids without diffing unified-state updates.
|
|
1086
|
+
|
|
1053
1087
|
function exportSavedView() {
|
|
1054
1088
|
return gridRef.value?.getSavedView()
|
|
1055
1089
|
}
|
package/dist/DataGrid.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type PropType, type VNode } from "vue";
|
|
2
|
-
import { type CreateDataGridCoreOptions, type DataGridApiPluginDefinition, type DataGridAggregationModel, type DataGridColumnPin, type DataGridComputedFieldDefinition, type DataGridCoreServiceRegistry, type DataGridFilterSnapshot, type DataGridFormulaFieldDefinition, type DataGridFormulaFunctionRegistry, type DataGridRowModel, type DataGridSetStateOptions, type DataGridSortState, type DataGridUnifiedColumnState, type DataGridUnifiedState, type DataGridPivotSpec } from "@affino/datagrid-vue";
|
|
2
|
+
import { type CreateDataGridCoreOptions, type DataGridApi, type DataGridApiRowSelectionChangedEvent, type DataGridApiSelectionChangedEvent, type DataGridApiPluginDefinition, type DataGridAggregationModel, type DataGridColumnPin, type DataGridComputedFieldDefinition, type DataGridCoreServiceRegistry, type DataGridFilterSnapshot, type DataGridFormulaFieldDefinition, type DataGridFormulaFunctionRegistry, type DataGridGroupBySpec, type DataGridRowSelectionSnapshot, type DataGridRowModel, type DataGridSetStateOptions, type DataGridSortState, type DataGridUnifiedColumnState, type DataGridUnifiedState, type DataGridPivotSpec } from "@affino/datagrid-vue";
|
|
3
|
+
import type { DataGridAppToolbarModule } from "./host/DataGridModuleHost";
|
|
3
4
|
import { type DataGridAppClientRowModelOptions, type DataGridAppColumnInput } from "./config/dataGridFormulaOptions";
|
|
4
5
|
import { type DataGridThemeProp } from "./theme/dataGridTheme";
|
|
5
6
|
import { type DataGridGroupByProp, type DataGridPaginationProp } from "./config/dataGridPublicProps";
|
|
@@ -96,6 +97,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
96
97
|
type: BooleanConstructor;
|
|
97
98
|
default: boolean;
|
|
98
99
|
};
|
|
100
|
+
rowSelectionState: {
|
|
101
|
+
type: PropType<DataGridRowSelectionSnapshot | null | undefined>;
|
|
102
|
+
default: undefined;
|
|
103
|
+
};
|
|
99
104
|
pageSize: {
|
|
100
105
|
type: PropType<number | undefined>;
|
|
101
106
|
default: undefined;
|
|
@@ -212,7 +217,29 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
212
217
|
type: PropType<DataGridGanttProp | undefined>;
|
|
213
218
|
default: undefined;
|
|
214
219
|
};
|
|
215
|
-
|
|
220
|
+
toolbarModules: {
|
|
221
|
+
type: PropType<readonly DataGridAppToolbarModule[]>;
|
|
222
|
+
default: () => never[];
|
|
223
|
+
};
|
|
224
|
+
}, () => VNode, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
225
|
+
"cell-change": (_payload: unknown) => true;
|
|
226
|
+
"selection-change": (_payload: DataGridApiSelectionChangedEvent) => true;
|
|
227
|
+
"row-selection-change": (_payload: DataGridApiRowSelectionChangedEvent) => true;
|
|
228
|
+
"row-select": (_payload: DataGridRowSelectionSnapshot | null) => true;
|
|
229
|
+
"update:rowSelectionState": (_payload: DataGridRowSelectionSnapshot | null) => true;
|
|
230
|
+
"update:columnState": (_payload: DataGridUnifiedColumnState | null) => true;
|
|
231
|
+
"update:columnOrder": (_payload: readonly string[] | null) => true;
|
|
232
|
+
"update:hiddenColumnKeys": (_payload: readonly string[] | null) => true;
|
|
233
|
+
"update:columnWidths": (_payload: Readonly<Record<string, number | null>> | null) => true;
|
|
234
|
+
"update:columnPins": (_payload: Readonly<Record<string, DataGridColumnPin>> | null) => true;
|
|
235
|
+
"update:groupBy": (_payload: DataGridGroupBySpec | null) => true;
|
|
236
|
+
"update:viewMode": (_payload: DataGridAppViewMode) => true;
|
|
237
|
+
"update:state": (_payload: DataGridUnifiedState<Record<string, unknown>> | null) => true;
|
|
238
|
+
ready: (_payload: {
|
|
239
|
+
api: DataGridApi<Record<string, unknown>>;
|
|
240
|
+
rowModel: DataGridRowModel<Record<string, unknown>> | null;
|
|
241
|
+
}) => true;
|
|
242
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
216
243
|
rows: {
|
|
217
244
|
type: PropType<readonly unknown[]>;
|
|
218
245
|
default: () => never[];
|
|
@@ -293,6 +320,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
293
320
|
type: BooleanConstructor;
|
|
294
321
|
default: boolean;
|
|
295
322
|
};
|
|
323
|
+
rowSelectionState: {
|
|
324
|
+
type: PropType<DataGridRowSelectionSnapshot | null | undefined>;
|
|
325
|
+
default: undefined;
|
|
326
|
+
};
|
|
296
327
|
pageSize: {
|
|
297
328
|
type: PropType<number | undefined>;
|
|
298
329
|
default: undefined;
|
|
@@ -409,19 +440,28 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
409
440
|
type: PropType<DataGridGanttProp | undefined>;
|
|
410
441
|
default: undefined;
|
|
411
442
|
};
|
|
443
|
+
toolbarModules: {
|
|
444
|
+
type: PropType<readonly DataGridAppToolbarModule[]>;
|
|
445
|
+
default: () => never[];
|
|
446
|
+
};
|
|
412
447
|
}>> & {
|
|
413
|
-
"onCell-change"?: ((
|
|
414
|
-
"onSelection-change"?: ((
|
|
415
|
-
"onRow-
|
|
416
|
-
"
|
|
417
|
-
"onUpdate:
|
|
418
|
-
"onUpdate:
|
|
419
|
-
"onUpdate:
|
|
420
|
-
"onUpdate:
|
|
421
|
-
"onUpdate:
|
|
422
|
-
"onUpdate:
|
|
423
|
-
"onUpdate:
|
|
424
|
-
|
|
448
|
+
"onCell-change"?: ((_payload: unknown) => any) | undefined;
|
|
449
|
+
"onSelection-change"?: ((_payload: DataGridApiSelectionChangedEvent) => any) | undefined;
|
|
450
|
+
"onRow-selection-change"?: ((_payload: DataGridApiRowSelectionChangedEvent) => any) | undefined;
|
|
451
|
+
"onRow-select"?: ((_payload: DataGridRowSelectionSnapshot | null) => any) | undefined;
|
|
452
|
+
"onUpdate:rowSelectionState"?: ((_payload: DataGridRowSelectionSnapshot | null) => any) | undefined;
|
|
453
|
+
"onUpdate:columnState"?: ((_payload: DataGridUnifiedColumnState | null) => any) | undefined;
|
|
454
|
+
"onUpdate:columnOrder"?: ((_payload: readonly string[] | null) => any) | undefined;
|
|
455
|
+
"onUpdate:hiddenColumnKeys"?: ((_payload: readonly string[] | null) => any) | undefined;
|
|
456
|
+
"onUpdate:columnWidths"?: ((_payload: Readonly<Record<string, number | null>> | null) => any) | undefined;
|
|
457
|
+
"onUpdate:columnPins"?: ((_payload: Readonly<Record<string, DataGridColumnPin>> | null) => any) | undefined;
|
|
458
|
+
"onUpdate:groupBy"?: ((_payload: DataGridGroupBySpec | null) => any) | undefined;
|
|
459
|
+
"onUpdate:viewMode"?: ((_payload: DataGridAppViewMode) => any) | undefined;
|
|
460
|
+
"onUpdate:state"?: ((_payload: DataGridUnifiedState<Record<string, unknown>> | null) => any) | undefined;
|
|
461
|
+
onReady?: ((_payload: {
|
|
462
|
+
api: DataGridApi<Record<string, unknown>>;
|
|
463
|
+
rowModel: DataGridRowModel<Record<string, unknown>> | null;
|
|
464
|
+
}) => any) | undefined;
|
|
425
465
|
}, {
|
|
426
466
|
rows: readonly unknown[];
|
|
427
467
|
columns: readonly DataGridAppColumnInput<unknown>[];
|
|
@@ -434,12 +474,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
434
474
|
isCellEditable: DataGridCellEditablePredicate<Record<string, unknown>> | undefined;
|
|
435
475
|
rowSelection: boolean;
|
|
436
476
|
gantt: DataGridGanttProp | undefined;
|
|
437
|
-
virtualization: DataGridVirtualizationProp | undefined;
|
|
438
|
-
pagination: DataGridPaginationProp | undefined;
|
|
439
477
|
rowModel: DataGridRowModel<unknown> | undefined;
|
|
440
|
-
aggregations: DataGridAggregationsProp | undefined;
|
|
441
478
|
baseRowHeight: number;
|
|
442
479
|
state: DataGridUnifiedState<Record<string, unknown>> | null | undefined;
|
|
480
|
+
virtualization: DataGridVirtualizationProp | undefined;
|
|
481
|
+
pagination: DataGridPaginationProp | undefined;
|
|
482
|
+
aggregations: DataGridAggregationsProp | undefined;
|
|
443
483
|
sortModel: readonly DataGridSortState[] | undefined;
|
|
444
484
|
filterModel: DataGridFilterSnapshot | null | undefined;
|
|
445
485
|
groupBy: DataGridGroupByProp | undefined;
|
|
@@ -455,6 +495,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
455
495
|
fillHandle: boolean;
|
|
456
496
|
rangeMove: boolean;
|
|
457
497
|
viewMode: DataGridAppViewMode | undefined;
|
|
498
|
+
toolbarModules: readonly DataGridAppToolbarModule[];
|
|
458
499
|
pageSize: number | undefined;
|
|
459
500
|
currentPage: number | undefined;
|
|
460
501
|
startupOrder: readonly import("@affino/datagrid-core").DataGridCoreServiceName[] | undefined;
|
|
@@ -462,11 +503,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
462
503
|
plugins: readonly DataGridApiPluginDefinition<unknown>[];
|
|
463
504
|
services: DataGridRuntimeOverrides | undefined;
|
|
464
505
|
autoStart: boolean;
|
|
506
|
+
columnState: DataGridUnifiedColumnState | null | undefined;
|
|
465
507
|
computedFields: readonly DataGridComputedFieldDefinition<unknown>[] | null | undefined;
|
|
466
508
|
formulas: readonly DataGridFormulaFieldDefinition[] | null | undefined;
|
|
467
509
|
formulaFunctions: Readonly<Record<string, import("@affino/datagrid-formula-engine").DataGridFormulaFunctionDefinition | ((args: readonly import("@affino/datagrid-formula-engine").DataGridFormulaValue[], context?: import("@affino/datagrid-formula-engine").DataGridComputedFieldComputeContext<unknown>) => unknown)>> | null | undefined;
|
|
468
510
|
aggregationModel: DataGridAggregationModel<Record<string, unknown>> | null | undefined;
|
|
469
|
-
|
|
511
|
+
rowSelectionState: DataGridRowSelectionSnapshot | null | undefined;
|
|
470
512
|
columnOrder: readonly string[] | null | undefined;
|
|
471
513
|
hiddenColumnKeys: readonly string[] | null | undefined;
|
|
472
514
|
columnWidths: Readonly<Record<string, number | null>> | null | undefined;
|
package/dist/advanced-filter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as e } from "./chunks/DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _ as e } from "./chunks/DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-x-cfVm5j.js";
|
|
2
2
|
export {
|
|
3
3
|
e as DataGridAdvancedFilterPopover
|
|
4
4
|
};
|
|
@@ -1,19 +1,34 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as q, inject as D, ref as k, computed as c, watch as m, nextTick as w, openBlock as d, createElementBlock as i, Fragment as b, createElementVNode as e, mergeProps as A, unref as _, createCommentVNode as P, createTextVNode as L, toDisplayString as y, createBlock as z, Teleport as G, renderList as I, createVNode as h } from "vue";
|
|
2
2
|
import { usePopoverController as J, useFloatingPopover as K } from "@affino/popover-vue";
|
|
3
|
-
import { d as
|
|
4
|
-
const
|
|
3
|
+
import { d as M, r as Z, _ as C } from "./DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-_1TDQseN.js";
|
|
4
|
+
const H = ["data-datagrid-advanced-filter-active"], Q = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "datagrid-app-toolbar__button-icon datagrid-app-toolbar__button-icon--advanced-filter",
|
|
7
|
+
"data-datagrid-advanced-filter-icon": "true",
|
|
8
|
+
"aria-hidden": "true"
|
|
9
|
+
}, U = /* @__PURE__ */ e("svg", {
|
|
10
|
+
viewBox: "0 0 16 16",
|
|
11
|
+
focusable: "false"
|
|
12
|
+
}, [
|
|
13
|
+
/* @__PURE__ */ e("path", {
|
|
14
|
+
d: "M2 3.5h12l-4.6 5.2v3.2l-2.8 1.6V8.7L2 3.5Z",
|
|
15
|
+
fill: "currentColor"
|
|
16
|
+
})
|
|
17
|
+
], -1), W = [
|
|
18
|
+
U
|
|
19
|
+
], X = { class: "datagrid-advanced-filter__header" }, Y = /* @__PURE__ */ e("div", null, [
|
|
5
20
|
/* @__PURE__ */ e("div", { class: "datagrid-advanced-filter__eyebrow" }, "Advanced filter"),
|
|
6
21
|
/* @__PURE__ */ e("h3", { class: "datagrid-advanced-filter__title" }, "Build clause-based filter")
|
|
7
|
-
], -1),
|
|
22
|
+
], -1), x = { class: "datagrid-advanced-filter__applied" }, ee = { class: "datagrid-advanced-filter__applied-head" }, ae = /* @__PURE__ */ e("div", null, [
|
|
8
23
|
/* @__PURE__ */ e("div", { class: "datagrid-advanced-filter__eyebrow" }, "Applied on table"),
|
|
9
24
|
/* @__PURE__ */ e("div", { class: "datagrid-advanced-filter__applied-title" }, "Current filters")
|
|
10
|
-
], -1),
|
|
25
|
+
], -1), te = ["disabled"], le = {
|
|
11
26
|
key: 0,
|
|
12
27
|
class: "datagrid-advanced-filter__applied-list"
|
|
13
|
-
},
|
|
28
|
+
}, oe = {
|
|
14
29
|
key: 1,
|
|
15
30
|
class: "datagrid-advanced-filter__applied-empty"
|
|
16
|
-
},
|
|
31
|
+
}, de = { class: "datagrid-advanced-filter__rows" }, ne = { class: "datagrid-advanced-filter__field datagrid-advanced-filter__field--join" }, ie = /* @__PURE__ */ e("span", { class: "datagrid-advanced-filter__label" }, "Join", -1), re = { class: "datagrid-advanced-filter__field" }, se = /* @__PURE__ */ e("span", { class: "datagrid-advanced-filter__label" }, "Column", -1), ce = { class: "datagrid-advanced-filter__field" }, ue = /* @__PURE__ */ e("span", { class: "datagrid-advanced-filter__label" }, "Operator", -1), pe = { class: "datagrid-advanced-filter__field datagrid-advanced-filter__field--value" }, ve = /* @__PURE__ */ e("span", { class: "datagrid-advanced-filter__label" }, "Value", -1), _e = ["value", "onInput"], fe = { class: "datagrid-advanced-filter__row-actions" }, ge = ["onClick"], me = { class: "datagrid-advanced-filter__footer" }, be = { class: "datagrid-advanced-filter__footer-actions" }, Oe = /* @__PURE__ */ q({
|
|
17
32
|
__name: "DataGridAdvancedFilterPopover",
|
|
18
33
|
props: {
|
|
19
34
|
isOpen: { type: Boolean },
|
|
@@ -22,14 +37,15 @@ const M = { class: "datagrid-advanced-filter__header" }, Q = /* @__PURE__ */ e("
|
|
|
22
37
|
appliedFilterSummaryItems: { default: () => [] },
|
|
23
38
|
hasAnyFilters: { type: Boolean, default: !1 },
|
|
24
39
|
buttonLabel: { default: "Advanced filter" },
|
|
25
|
-
active: { type: Boolean, default: !1 }
|
|
40
|
+
active: { type: Boolean, default: !1 },
|
|
41
|
+
showActiveIcon: { type: Boolean, default: !1 }
|
|
26
42
|
},
|
|
27
43
|
emits: ["open", "add", "remove", "apply", "cancel", "reset-all", "update-clause"],
|
|
28
|
-
setup(T, { emit:
|
|
44
|
+
setup(T, { emit: S }) {
|
|
29
45
|
const F = Object.freeze([
|
|
30
46
|
{ value: "and", label: "AND" },
|
|
31
47
|
{ value: "or", label: "OR" }
|
|
32
|
-
]),
|
|
48
|
+
]), N = Object.freeze([
|
|
33
49
|
{ value: "contains", label: "Contains" },
|
|
34
50
|
{ value: "equals", label: "Equals" },
|
|
35
51
|
{ value: "not-equals", label: "Not equals" },
|
|
@@ -39,7 +55,7 @@ const M = { class: "datagrid-advanced-filter__header" }, Q = /* @__PURE__ */ e("
|
|
|
39
55
|
{ value: "gte", label: ">=" },
|
|
40
56
|
{ value: "lt", label: "<" },
|
|
41
57
|
{ value: "lte", label: "<=" }
|
|
42
|
-
]), u = T,
|
|
58
|
+
]), u = T, n = S, O = D(M, k(null)), f = k({}), o = J(
|
|
43
59
|
{
|
|
44
60
|
id: "advanced-filter",
|
|
45
61
|
role: "dialog",
|
|
@@ -48,13 +64,13 @@ const M = { class: "datagrid-advanced-filter__header" }, Q = /* @__PURE__ */ e("
|
|
|
48
64
|
},
|
|
49
65
|
{
|
|
50
66
|
onOpen: () => {
|
|
51
|
-
u.isOpen ||
|
|
67
|
+
u.isOpen || n("open"), g();
|
|
52
68
|
},
|
|
53
69
|
onClose: () => {
|
|
54
|
-
u.isOpen &&
|
|
70
|
+
u.isOpen && n("cancel");
|
|
55
71
|
}
|
|
56
72
|
}
|
|
57
|
-
),
|
|
73
|
+
), s = K(o, {
|
|
58
74
|
placement: "bottom",
|
|
59
75
|
align: "start",
|
|
60
76
|
gutter: 10,
|
|
@@ -62,7 +78,7 @@ const M = { class: "datagrid-advanced-filter__header" }, Q = /* @__PURE__ */ e("
|
|
|
62
78
|
zIndex: 180,
|
|
63
79
|
lockScroll: !1,
|
|
64
80
|
returnFocus: !0
|
|
65
|
-
}), R = c(() => o.getTriggerProps({ role: "dialog" })),
|
|
81
|
+
}), R = c(() => o.getTriggerProps({ role: "dialog" })), V = c(() => o.getContentProps({ role: "dialog", tabIndex: -1 })), B = c(() => o.state.value.open), E = c(() => s.contentStyle.value), $ = c(() => s.teleportTarget.value), j = c(() => u.columns.map((t) => ({
|
|
66
82
|
value: t.key,
|
|
67
83
|
label: t.label
|
|
68
84
|
})));
|
|
@@ -70,75 +86,80 @@ const M = { class: "datagrid-advanced-filter__header" }, Q = /* @__PURE__ */ e("
|
|
|
70
86
|
() => u.isOpen,
|
|
71
87
|
async (t) => {
|
|
72
88
|
if (t) {
|
|
73
|
-
g(), o.state.value.open || o.open("programmatic"), await
|
|
89
|
+
g(), o.state.value.open || o.open("programmatic"), await w(), s.contentRef.value?.querySelector('[data-advanced-filter-autofocus="true"]')?.focus({ preventScroll: !0 }), await s.updatePosition();
|
|
74
90
|
return;
|
|
75
91
|
}
|
|
76
92
|
o.state.value.open && o.close("programmatic");
|
|
77
93
|
},
|
|
78
94
|
{ immediate: !0 }
|
|
79
|
-
), m(
|
|
95
|
+
), m(O, () => {
|
|
80
96
|
o.state.value.open && g();
|
|
81
97
|
}), m(
|
|
82
98
|
() => u.clauses.length,
|
|
83
99
|
async () => {
|
|
84
|
-
o.state.value.open && (await
|
|
100
|
+
o.state.value.open && (await w(), await s.updatePosition());
|
|
85
101
|
}
|
|
86
102
|
);
|
|
87
103
|
function g() {
|
|
88
|
-
f.value =
|
|
104
|
+
f.value = Z(O.value);
|
|
89
105
|
}
|
|
90
106
|
function p(t, l, a) {
|
|
91
|
-
|
|
107
|
+
n("update-clause", { clauseId: t, field: l, value: a });
|
|
92
108
|
}
|
|
93
|
-
return (t, l) => (
|
|
94
|
-
e("button",
|
|
95
|
-
ref: _(
|
|
109
|
+
return (t, l) => (d(), i(b, null, [
|
|
110
|
+
e("button", A({
|
|
111
|
+
ref: _(s).triggerRef,
|
|
96
112
|
type: "button",
|
|
97
113
|
class: ["datagrid-app-toolbar__button", { "datagrid-app-toolbar__button--active": t.active }],
|
|
114
|
+
"data-datagrid-toolbar-action": "advanced-filter",
|
|
115
|
+
"data-datagrid-advanced-filter-active": t.showActiveIcon ? "true" : "false",
|
|
98
116
|
style: f.value
|
|
99
|
-
}, R.value),
|
|
100
|
-
|
|
101
|
-
|
|
117
|
+
}, R.value), [
|
|
118
|
+
t.showActiveIcon ? (d(), i("span", Q, W)) : P("", !0),
|
|
119
|
+
L(" " + y(t.buttonLabel), 1)
|
|
120
|
+
], 16, H),
|
|
121
|
+
(d(), z(G, { to: $.value }, [
|
|
122
|
+
B.value ? (d(), i("section", A({
|
|
102
123
|
key: 0,
|
|
103
|
-
ref: _(
|
|
124
|
+
ref: _(s).contentRef,
|
|
104
125
|
class: "datagrid-advanced-filter",
|
|
105
126
|
"data-datagrid-overlay-surface": "true",
|
|
106
|
-
style: [
|
|
107
|
-
},
|
|
108
|
-
e("header",
|
|
109
|
-
|
|
127
|
+
style: [E.value, f.value]
|
|
128
|
+
}, V.value), [
|
|
129
|
+
e("header", X, [
|
|
130
|
+
Y,
|
|
110
131
|
e("button", {
|
|
111
132
|
type: "button",
|
|
112
133
|
class: "datagrid-advanced-filter__ghost",
|
|
113
|
-
onClick: l[0] || (l[0] = (a) =>
|
|
134
|
+
onClick: l[0] || (l[0] = (a) => n("cancel"))
|
|
114
135
|
}, " Close ")
|
|
115
136
|
]),
|
|
116
|
-
e("section",
|
|
117
|
-
e("div",
|
|
118
|
-
|
|
137
|
+
e("section", x, [
|
|
138
|
+
e("div", ee, [
|
|
139
|
+
ae,
|
|
119
140
|
e("button", {
|
|
120
141
|
type: "button",
|
|
121
142
|
class: "datagrid-advanced-filter__ghost",
|
|
122
143
|
disabled: !t.hasAnyFilters,
|
|
123
144
|
"data-datagrid-advanced-filter-action": "reset-all",
|
|
124
|
-
onClick: l[1] || (l[1] = (a) =>
|
|
125
|
-
}, " Reset all filters ", 8,
|
|
145
|
+
onClick: l[1] || (l[1] = (a) => n("reset-all"))
|
|
146
|
+
}, " Reset all filters ", 8, te)
|
|
126
147
|
]),
|
|
127
|
-
t.appliedFilterSummaryItems.length > 0 ? (
|
|
128
|
-
(
|
|
148
|
+
t.appliedFilterSummaryItems.length > 0 ? (d(), i("div", le, [
|
|
149
|
+
(d(!0), i(b, null, I(t.appliedFilterSummaryItems, (a, v) => (d(), i("span", {
|
|
129
150
|
key: `applied-filter-${v}`,
|
|
130
151
|
class: "datagrid-advanced-filter__applied-chip"
|
|
131
|
-
},
|
|
132
|
-
])) : (
|
|
152
|
+
}, y(a), 1))), 128))
|
|
153
|
+
])) : (d(), i("div", oe, " No filters applied "))
|
|
133
154
|
]),
|
|
134
|
-
e("div",
|
|
135
|
-
(
|
|
155
|
+
e("div", de, [
|
|
156
|
+
(d(!0), i(b, null, I(t.clauses, (a, v) => (d(), i("div", {
|
|
136
157
|
key: a.id,
|
|
137
158
|
class: "datagrid-advanced-filter__row"
|
|
138
159
|
}, [
|
|
139
|
-
e("label",
|
|
140
|
-
|
|
141
|
-
|
|
160
|
+
e("label", ne, [
|
|
161
|
+
ie,
|
|
162
|
+
h(C, {
|
|
142
163
|
class: "datagrid-advanced-filter__select",
|
|
143
164
|
value: a.join,
|
|
144
165
|
options: _(F),
|
|
@@ -147,80 +168,79 @@ const M = { class: "datagrid-advanced-filter__header" }, Q = /* @__PURE__ */ e("
|
|
|
147
168
|
"sticky-popover-id": "advanced-filter",
|
|
148
169
|
disabled: v === 0,
|
|
149
170
|
"aria-label": "Join operator",
|
|
150
|
-
onCommit: (
|
|
171
|
+
onCommit: (r) => p(a.id, "join", r)
|
|
151
172
|
}, null, 8, ["value", "options", "disabled", "onCommit"])
|
|
152
173
|
]),
|
|
153
|
-
e("label",
|
|
154
|
-
|
|
155
|
-
|
|
174
|
+
e("label", re, [
|
|
175
|
+
se,
|
|
176
|
+
h(C, {
|
|
156
177
|
class: "datagrid-advanced-filter__select",
|
|
157
178
|
value: a.columnKey,
|
|
158
|
-
options:
|
|
179
|
+
options: j.value,
|
|
159
180
|
"open-on-mount": !1,
|
|
160
181
|
"open-on-focus": !1,
|
|
161
182
|
"sticky-popover-id": "advanced-filter",
|
|
162
183
|
"data-advanced-filter-autofocus": v === 0 ? "true" : null,
|
|
163
184
|
"aria-label": "Column",
|
|
164
|
-
onCommit: (
|
|
185
|
+
onCommit: (r) => p(a.id, "columnKey", r)
|
|
165
186
|
}, null, 8, ["value", "options", "data-advanced-filter-autofocus", "onCommit"])
|
|
166
187
|
]),
|
|
167
|
-
e("label",
|
|
168
|
-
|
|
169
|
-
|
|
188
|
+
e("label", ce, [
|
|
189
|
+
ue,
|
|
190
|
+
h(C, {
|
|
170
191
|
class: "datagrid-advanced-filter__select",
|
|
171
192
|
value: a.operator,
|
|
172
|
-
options: _(
|
|
193
|
+
options: _(N),
|
|
173
194
|
"open-on-mount": !1,
|
|
174
195
|
"open-on-focus": !1,
|
|
175
196
|
"sticky-popover-id": "advanced-filter",
|
|
176
197
|
"aria-label": "Condition operator",
|
|
177
|
-
onCommit: (
|
|
198
|
+
onCommit: (r) => p(a.id, "operator", r)
|
|
178
199
|
}, null, 8, ["value", "options", "onCommit"])
|
|
179
200
|
]),
|
|
180
|
-
e("label",
|
|
181
|
-
|
|
201
|
+
e("label", pe, [
|
|
202
|
+
ve,
|
|
182
203
|
e("input", {
|
|
183
204
|
value: a.value,
|
|
184
205
|
type: "text",
|
|
185
206
|
placeholder: "Value",
|
|
186
207
|
"aria-label": "Condition value",
|
|
187
|
-
onInput: (
|
|
188
|
-
}, null, 40,
|
|
208
|
+
onInput: (r) => p(a.id, "value", r.target.value)
|
|
209
|
+
}, null, 40, _e)
|
|
189
210
|
]),
|
|
190
|
-
e("div",
|
|
211
|
+
e("div", fe, [
|
|
191
212
|
e("button", {
|
|
192
213
|
type: "button",
|
|
193
214
|
class: "datagrid-advanced-filter__ghost datagrid-advanced-filter__ghost--danger",
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}, " Remove ", 8, ue)
|
|
215
|
+
onClick: (r) => n("remove", a.id)
|
|
216
|
+
}, y(t.clauses.length <= 1 ? "Clear" : "Remove"), 9, ge)
|
|
197
217
|
])
|
|
198
218
|
]))), 128))
|
|
199
219
|
]),
|
|
200
|
-
e("footer",
|
|
220
|
+
e("footer", me, [
|
|
201
221
|
e("button", {
|
|
202
222
|
type: "button",
|
|
203
223
|
class: "datagrid-advanced-filter__secondary",
|
|
204
|
-
onClick: l[2] || (l[2] = (a) =>
|
|
224
|
+
onClick: l[2] || (l[2] = (a) => n("add"))
|
|
205
225
|
}, " Add clause "),
|
|
206
|
-
e("div",
|
|
226
|
+
e("div", be, [
|
|
207
227
|
e("button", {
|
|
208
228
|
type: "button",
|
|
209
229
|
class: "datagrid-advanced-filter__secondary",
|
|
210
|
-
onClick: l[3] || (l[3] = (a) =>
|
|
230
|
+
onClick: l[3] || (l[3] = (a) => n("cancel"))
|
|
211
231
|
}, " Cancel "),
|
|
212
232
|
e("button", {
|
|
213
233
|
type: "button",
|
|
214
234
|
class: "datagrid-advanced-filter__primary",
|
|
215
|
-
onClick: l[4] || (l[4] = (a) =>
|
|
235
|
+
onClick: l[4] || (l[4] = (a) => n("apply"))
|
|
216
236
|
}, " Apply ")
|
|
217
237
|
])
|
|
218
238
|
])
|
|
219
|
-
], 16)) :
|
|
239
|
+
], 16)) : P("", !0)
|
|
220
240
|
], 8, ["to"]))
|
|
221
241
|
], 64));
|
|
222
242
|
}
|
|
223
243
|
});
|
|
224
244
|
export {
|
|
225
|
-
|
|
245
|
+
Oe as _
|
|
226
246
|
};
|