@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 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
  }
@@ -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
- }, () => VNode, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("cell-change" | "selection-change" | "row-select" | "update:columnState" | "update:columnOrder" | "update:hiddenColumnKeys" | "update:columnWidths" | "update:columnPins" | "update:groupBy" | "update:viewMode" | "update:state" | "ready")[], "cell-change" | "selection-change" | "row-select" | "update:columnState" | "update:columnOrder" | "update:hiddenColumnKeys" | "update:columnWidths" | "update:columnPins" | "update:groupBy" | "update:viewMode" | "update:state" | "ready", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
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"?: ((...args: any[]) => any) | undefined;
414
- "onSelection-change"?: ((...args: any[]) => any) | undefined;
415
- "onRow-select"?: ((...args: any[]) => any) | undefined;
416
- "onUpdate:columnState"?: ((...args: any[]) => any) | undefined;
417
- "onUpdate:columnOrder"?: ((...args: any[]) => any) | undefined;
418
- "onUpdate:hiddenColumnKeys"?: ((...args: any[]) => any) | undefined;
419
- "onUpdate:columnWidths"?: ((...args: any[]) => any) | undefined;
420
- "onUpdate:columnPins"?: ((...args: any[]) => any) | undefined;
421
- "onUpdate:groupBy"?: ((...args: any[]) => any) | undefined;
422
- "onUpdate:viewMode"?: ((...args: any[]) => any) | undefined;
423
- "onUpdate:state"?: ((...args: any[]) => any) | undefined;
424
- onReady?: ((...args: any[]) => any) | undefined;
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
- columnState: DataGridUnifiedColumnState | null | undefined;
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;
@@ -1,4 +1,4 @@
1
- import { _ as e } from "./chunks/DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-DixN56Qv.js";
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,4 +1,4 @@
1
- import { _ as f } from "./DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-DixN56Qv.js";
1
+ import { _ as f } from "./DataGridAdvancedFilterPopover.vue_vue_type_script_setup_true_lang-x-cfVm5j.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,19 +1,34 @@
1
- import { defineComponent as j, inject as q, ref as O, computed as c, watch as m, nextTick as k, openBlock as n, createElementBlock as s, Fragment as b, createElementVNode as e, mergeProps as w, unref as _, toDisplayString as P, createBlock as D, Teleport as z, renderList as S, createVNode as y, createCommentVNode as G } from "vue";
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 L, r as H, _ as h } from "./DataGridFilterableCombobox.vue_vue_type_script_setup_true_lang-_1TDQseN.js";
4
- const M = { class: "datagrid-advanced-filter__header" }, Q = /* @__PURE__ */ e("div", null, [
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), U = { class: "datagrid-advanced-filter__applied" }, W = { class: "datagrid-advanced-filter__applied-head" }, X = /* @__PURE__ */ e("div", null, [
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), Y = ["disabled"], Z = {
25
+ ], -1), te = ["disabled"], le = {
11
26
  key: 0,
12
27
  class: "datagrid-advanced-filter__applied-list"
13
- }, x = {
28
+ }, oe = {
14
29
  key: 1,
15
30
  class: "datagrid-advanced-filter__applied-empty"
16
- }, ee = { class: "datagrid-advanced-filter__rows" }, ae = { class: "datagrid-advanced-filter__field datagrid-advanced-filter__field--join" }, te = /* @__PURE__ */ e("span", { class: "datagrid-advanced-filter__label" }, "Join", -1), le = { class: "datagrid-advanced-filter__field" }, oe = /* @__PURE__ */ e("span", { class: "datagrid-advanced-filter__label" }, "Column", -1), de = { class: "datagrid-advanced-filter__field" }, ne = /* @__PURE__ */ e("span", { class: "datagrid-advanced-filter__label" }, "Operator", -1), ie = { class: "datagrid-advanced-filter__field datagrid-advanced-filter__field--value" }, se = /* @__PURE__ */ e("span", { class: "datagrid-advanced-filter__label" }, "Value", -1), re = ["value", "onInput"], ce = { class: "datagrid-advanced-filter__row-actions" }, ue = ["disabled", "onClick"], pe = { class: "datagrid-advanced-filter__footer" }, ve = { class: "datagrid-advanced-filter__footer-actions" }, me = /* @__PURE__ */ j({
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: A }) {
44
+ setup(T, { emit: S }) {
29
45
  const F = Object.freeze([
30
46
  { value: "and", label: "AND" },
31
47
  { value: "or", label: "OR" }
32
- ]), I = Object.freeze([
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, d = A, C = q(L, O(null)), f = O({}), o = J(
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 || d("open"), g();
67
+ u.isOpen || n("open"), g();
52
68
  },
53
69
  onClose: () => {
54
- u.isOpen && d("cancel");
70
+ u.isOpen && n("cancel");
55
71
  }
56
72
  }
57
- ), r = K(o, {
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" })), N = c(() => o.getContentProps({ role: "dialog", tabIndex: -1 })), E = c(() => o.state.value.open), V = c(() => r.contentStyle.value), $ = c(() => r.teleportTarget.value), B = c(() => u.columns.map((t) => ({
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 k(), r.contentRef.value?.querySelector('[data-advanced-filter-autofocus="true"]')?.focus({ preventScroll: !0 }), await r.updatePosition();
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(C, () => {
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 k(), await r.updatePosition());
100
+ o.state.value.open && (await w(), await s.updatePosition());
85
101
  }
86
102
  );
87
103
  function g() {
88
- f.value = H(C.value);
104
+ f.value = Z(O.value);
89
105
  }
90
106
  function p(t, l, a) {
91
- d("update-clause", { clauseId: t, field: l, value: a });
107
+ n("update-clause", { clauseId: t, field: l, value: a });
92
108
  }
93
- return (t, l) => (n(), s(b, null, [
94
- e("button", w({
95
- ref: _(r).triggerRef,
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), P(t.buttonLabel), 17),
100
- (n(), D(z, { to: $.value }, [
101
- E.value ? (n(), s("section", w({
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: _(r).contentRef,
124
+ ref: _(s).contentRef,
104
125
  class: "datagrid-advanced-filter",
105
126
  "data-datagrid-overlay-surface": "true",
106
- style: [V.value, f.value]
107
- }, N.value), [
108
- e("header", M, [
109
- Q,
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) => d("cancel"))
134
+ onClick: l[0] || (l[0] = (a) => n("cancel"))
114
135
  }, " Close ")
115
136
  ]),
116
- e("section", U, [
117
- e("div", W, [
118
- X,
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) => d("reset-all"))
125
- }, " Reset all filters ", 8, Y)
145
+ onClick: l[1] || (l[1] = (a) => n("reset-all"))
146
+ }, " Reset all filters ", 8, te)
126
147
  ]),
127
- t.appliedFilterSummaryItems.length > 0 ? (n(), s("div", Z, [
128
- (n(!0), s(b, null, S(t.appliedFilterSummaryItems, (a, v) => (n(), s("span", {
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
- }, P(a), 1))), 128))
132
- ])) : (n(), s("div", x, " No filters applied "))
152
+ }, y(a), 1))), 128))
153
+ ])) : (d(), i("div", oe, " No filters applied "))
133
154
  ]),
134
- e("div", ee, [
135
- (n(!0), s(b, null, S(t.clauses, (a, v) => (n(), s("div", {
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", ae, [
140
- te,
141
- y(h, {
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: (i) => p(a.id, "join", i)
171
+ onCommit: (r) => p(a.id, "join", r)
151
172
  }, null, 8, ["value", "options", "disabled", "onCommit"])
152
173
  ]),
153
- e("label", le, [
154
- oe,
155
- y(h, {
174
+ e("label", re, [
175
+ se,
176
+ h(C, {
156
177
  class: "datagrid-advanced-filter__select",
157
178
  value: a.columnKey,
158
- options: B.value,
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: (i) => p(a.id, "columnKey", i)
185
+ onCommit: (r) => p(a.id, "columnKey", r)
165
186
  }, null, 8, ["value", "options", "data-advanced-filter-autofocus", "onCommit"])
166
187
  ]),
167
- e("label", de, [
168
- ne,
169
- y(h, {
188
+ e("label", ce, [
189
+ ue,
190
+ h(C, {
170
191
  class: "datagrid-advanced-filter__select",
171
192
  value: a.operator,
172
- options: _(I),
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: (i) => p(a.id, "operator", i)
198
+ onCommit: (r) => p(a.id, "operator", r)
178
199
  }, null, 8, ["value", "options", "onCommit"])
179
200
  ]),
180
- e("label", ie, [
181
- se,
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: (i) => p(a.id, "value", i.target.value)
188
- }, null, 40, re)
208
+ onInput: (r) => p(a.id, "value", r.target.value)
209
+ }, null, 40, _e)
189
210
  ]),
190
- e("div", ce, [
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
- disabled: t.clauses.length <= 1,
195
- onClick: (i) => d("remove", a.id)
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", pe, [
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) => d("add"))
224
+ onClick: l[2] || (l[2] = (a) => n("add"))
205
225
  }, " Add clause "),
206
- e("div", ve, [
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) => d("cancel"))
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) => d("apply"))
235
+ onClick: l[4] || (l[4] = (a) => n("apply"))
216
236
  }, " Apply ")
217
237
  ])
218
238
  ])
219
- ], 16)) : G("", !0)
239
+ ], 16)) : P("", !0)
220
240
  ], 8, ["to"]))
221
241
  ], 64));
222
242
  }
223
243
  });
224
244
  export {
225
- me as _
245
+ Oe as _
226
246
  };