@erxes/ui 4.0.0-v2.13 → 4.0.0-v2.15
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/CATALOG.md +15 -8
- package/README.md +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.js +4 -3
- package/dist/modules/conditions/ConditionsEditor.d.ts +5 -3
- package/dist/modules/conditions/ConditionsEditor.js +139 -177
- package/dist/modules/conditions/DateEditors.d.ts +8 -0
- package/dist/modules/conditions/DateEditors.js +188 -0
- package/dist/modules/conditions/FieldPicker.d.ts +17 -0
- package/dist/modules/conditions/FieldPicker.js +99 -0
- package/dist/modules/conditions/RuleParts.d.ts +30 -0
- package/dist/modules/conditions/RuleParts.js +78 -0
- package/dist/modules/conditions/RuleRow.d.ts +27 -0
- package/dist/modules/conditions/RuleRow.js +156 -0
- package/dist/modules/conditions/TypedInput.d.ts +13 -0
- package/dist/modules/conditions/TypedInput.js +36 -0
- package/dist/modules/conditions/ValueEditor.d.ts +18 -0
- package/dist/modules/conditions/ValueEditor.js +169 -0
- package/dist/modules/conditions/conditions.d.ts +21 -12
- package/dist/modules/conditions/conditions.js +8 -75
- package/dist/modules/conditions/fieldIcons.d.ts +6 -0
- package/dist/modules/conditions/fieldIcons.js +21 -0
- package/dist/modules/conditions/fieldOptions.d.ts +15 -0
- package/dist/modules/conditions/fieldOptions.js +38 -0
- package/dist/modules/conditions/filterRule.d.ts +45 -0
- package/dist/modules/conditions/filterRule.js +171 -0
- package/dist/modules/conditions/filterText.d.ts +16 -0
- package/dist/modules/conditions/filterText.js +156 -0
- package/dist/modules/filter/components/Filter.d.ts +1 -1
- package/dist/modules/filter/components/Filter.js +1 -1
- package/dist/modules/list/ListFilter.d.ts +22 -10
- package/dist/modules/list/ListFilter.js +53 -20
- package/dist/modules/list/ViewBar.d.ts +2 -0
- package/dist/modules/list/ViewBar.js +21 -10
- package/dist/modules/list/filter/AddFilter.d.ts +10 -0
- package/dist/modules/list/filter/AddFilter.js +140 -0
- package/dist/modules/list/filter/AdvancedPopover.d.ts +8 -0
- package/dist/modules/list/filter/AdvancedPopover.js +103 -0
- package/dist/modules/list/filter/ListFilterBar.d.ts +3 -3
- package/dist/modules/list/filter/ListFilterBar.js +109 -205
- package/dist/modules/list/filter/RuleChips.d.ts +12 -2
- package/dist/modules/list/filter/RuleChips.js +132 -134
- package/dist/modules/list/filter/SearchChip.d.ts +6 -0
- package/dist/modules/list/filter/SearchChip.js +69 -0
- package/dist/modules/list/filter/filterRules.d.ts +15 -40
- package/dist/modules/list/filter/filterRules.js +27 -156
- package/dist/modules/list/filter/listFilterContext.d.ts +25 -18
- package/dist/modules/list/filter/listFilterContext.js +8 -24
- package/dist/modules/list/filter/listFilterQuery.d.ts +4 -0
- package/dist/modules/list/filter/listFilterQuery.js +10 -2
- package/dist/modules/pickers/LookupPicker.d.ts +6 -0
- package/dist/modules/pickers/LookupPicker.js +32 -1
- package/dist/modules/record-list/RecordList.d.ts +2 -1
- package/dist/modules/record-list/RecordList.js +2 -1
- package/dist/modules/record-list/RecordListRoot.d.ts +3 -1
- package/dist/modules/record-list/RecordListRoot.js +53 -37
- package/dist/modules/record-table/components/RecordTableHead.d.ts +7 -2
- package/dist/modules/record-table/components/RecordTableHead.js +73 -6
- package/dist/modules/record-table/components/RecordTableProvider.d.ts +22 -1
- package/dist/modules/record-table/components/RecordTableProvider.js +12 -1
- package/dist/modules/records/contacts.d.ts +18 -0
- package/dist/modules/records/openRecord.d.ts +35 -1
- package/dist/modules/records/openRecord.js +27 -4
- package/dist/theme.css +3 -2
- package/dist/types/UIConfig.d.ts +47 -100
- package/dist/types/UIConfig.js +14 -0
- package/exports.txt +10 -3
- package/package.json +1 -1
- package/dist/modules/conditions/ConditionValueInput.d.ts +0 -10
- package/dist/modules/conditions/ConditionValueInput.js +0 -166
- package/dist/modules/conditions/PathPicker.d.ts +0 -8
- package/dist/modules/conditions/PathPicker.js +0 -56
- package/dist/modules/list/filter/AdvancedFilterDialog.d.ts +0 -5
- package/dist/modules/list/filter/AdvancedFilterDialog.js +0 -52
- package/dist/modules/list/filter/FieldMenus.d.ts +0 -5
- package/dist/modules/list/filter/FieldMenus.js +0 -184
- package/dist/modules/list/filter/fieldIcons.d.ts +0 -7
- package/dist/modules/list/filter/fieldIcons.js +0 -16
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TListFilterProps } from "../ListFilter.js";
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* In the view bar: the count, the list's own controls and the filter button (`F`). Under it,
|
|
4
|
+
* while the list is filtered, the filter row: in the view bar's slot, else right after the bar.
|
|
5
5
|
*/
|
|
6
|
-
export declare const ListFilterBar: (
|
|
6
|
+
export declare const ListFilterBar: (props: TListFilterProps) => import("react").JSX.Element;
|
|
@@ -1,217 +1,145 @@
|
|
|
1
1
|
import { Button } from "../../../components/button.js";
|
|
2
|
-
import { Combobox } from "../../../components/combobox.js";
|
|
3
|
-
import { Command } from "../../../components/command.js";
|
|
4
2
|
import { IconTip } from "../../../components/icon-tip.js";
|
|
5
|
-
import { Popover } from "../../../components/popover.js";
|
|
6
3
|
import { usePageHotkey } from "../../../hooks/use-page-hotkey.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { groupOf, inMenu, partsOf, withPart } from "./filterRules.js";
|
|
14
|
-
import { ListFilterContext, useListFilter } from "./listFilterContext.js";
|
|
4
|
+
import { ruleCount } from "../../conditions/filterRule.js";
|
|
5
|
+
import { useFilterRowSlot } from "../ViewBar.js";
|
|
6
|
+
import { AddFilter } from "./AddFilter.js";
|
|
7
|
+
import { AdvancedPopover } from "./AdvancedPopover.js";
|
|
8
|
+
import { chipsOf, groupOf, partsOf, withPart } from "./filterRules.js";
|
|
9
|
+
import { ListFilterContext } from "./listFilterContext.js";
|
|
15
10
|
import { useListConditions } from "./listFilterQuery.js";
|
|
16
11
|
import { RecordCount } from "./RecordCount.js";
|
|
17
12
|
import { RuleChips } from "./RuleChips.js";
|
|
18
|
-
import {
|
|
13
|
+
import { SearchChip } from "./SearchChip.js";
|
|
14
|
+
import { IconFilter2, IconPlus } from "@tabler/icons-react";
|
|
19
15
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
|
-
import {
|
|
16
|
+
import { useMemo, useRef, useState } from "react";
|
|
21
17
|
import { useTranslation } from "react-i18next";
|
|
22
|
-
import {
|
|
18
|
+
import { createPortal } from "react-dom";
|
|
23
19
|
import { useAutoAnimate } from "@formkit/auto-animate/react";
|
|
24
20
|
// src/modules/list/filter/ListFilterBar.tsx
|
|
25
|
-
/**
|
|
26
|
-
const
|
|
27
|
-
{
|
|
28
|
-
group: "fields",
|
|
29
|
-
label: "Fields"
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
group: "lead",
|
|
33
|
-
label: "Lead"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
group: "company",
|
|
37
|
-
label: "Company"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
group: "activity",
|
|
41
|
-
label: "Activity"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
group: "custom",
|
|
45
|
-
label: "Properties"
|
|
46
|
-
}
|
|
47
|
-
];
|
|
48
|
-
/** Every field, grouped; each opens its submenu. The search box filters them by name. */
|
|
49
|
-
const FieldItems = () => {
|
|
50
|
-
const { t } = useTranslation("views", { keyPrefix: "filter" });
|
|
51
|
-
const { fields } = useListFilter();
|
|
52
|
-
return [...GROUPS.map(({ group, label }) => ({
|
|
53
|
-
key: group,
|
|
54
|
-
heading: t(`group.${group}`, label),
|
|
55
|
-
fields: fields.filter((field) => !field.groupLabel && (field.group ?? "fields") === group)
|
|
56
|
-
})), ...[...new Set(fields.flatMap((field) => field.groupLabel ?? []))].map((heading) => ({
|
|
57
|
-
key: `label:${heading}`,
|
|
58
|
-
heading,
|
|
59
|
-
fields: fields.filter((field) => field.groupLabel === heading)
|
|
60
|
-
}))].map(({ key, heading, fields: inGroup }) => {
|
|
61
|
-
if (!inGroup.length) return null;
|
|
62
|
-
return /* @__PURE__ */ jsx(Command.Group, {
|
|
63
|
-
heading,
|
|
64
|
-
children: inGroup.map((field) => {
|
|
65
|
-
const Icon = field.icon ?? FIELD_ICONS[field.type];
|
|
66
|
-
return /* @__PURE__ */ jsxs(Filter.Item, {
|
|
67
|
-
value: field.path,
|
|
68
|
-
keywords: [field.label],
|
|
69
|
-
children: [/* @__PURE__ */ jsx(Icon, {}), /* @__PURE__ */ jsx("span", {
|
|
70
|
-
className: "truncate",
|
|
71
|
-
children: field.label
|
|
72
|
-
})]
|
|
73
|
-
}, field.path);
|
|
74
|
-
})
|
|
75
|
-
}, key);
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
/** The menu's first page: "Add filter…", search, the advanced filter, then the fields. */
|
|
79
|
-
const RootMenu = ({ loading, error }) => {
|
|
80
|
-
const { t } = useTranslation("views", { keyPrefix: "filter" });
|
|
81
|
-
const { openAdvanced } = useListFilter();
|
|
82
|
-
const search = t("search", "Search");
|
|
83
|
-
const advanced = t("advanced", "Advanced filter");
|
|
84
|
-
return /* @__PURE__ */ jsxs(Command, { children: [/* @__PURE__ */ jsx(Filter.CommandInput, {
|
|
85
|
-
placeholder: t("add", "Add filter…"),
|
|
86
|
-
variant: "secondary",
|
|
87
|
-
focusOnMount: true
|
|
88
|
-
}), /* @__PURE__ */ jsxs(Command.List, {
|
|
89
|
-
className: "max-h-popup",
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ jsx(Command.Empty, { children: t("no-match", "No field matches") }),
|
|
92
|
-
/* @__PURE__ */ jsxs(Filter.Item, {
|
|
93
|
-
value: "searchValue",
|
|
94
|
-
keywords: [search],
|
|
95
|
-
inDialog: true,
|
|
96
|
-
children: [/* @__PURE__ */ jsx(IconSearch, {}), search]
|
|
97
|
-
}),
|
|
98
|
-
/* @__PURE__ */ jsxs(Filter.CommandItem, {
|
|
99
|
-
value: "advanced",
|
|
100
|
-
keywords: [advanced],
|
|
101
|
-
onSelect: openAdvanced,
|
|
102
|
-
children: [/* @__PURE__ */ jsx(IconAdjustmentsHorizontal, {}), advanced]
|
|
103
|
-
}),
|
|
104
|
-
loading && /* @__PURE__ */ jsx("p", {
|
|
105
|
-
className: "px-2 py-1.5 text-xs text-muted-foreground",
|
|
106
|
-
children: t("loading", "Loading fields…")
|
|
107
|
-
}),
|
|
108
|
-
error && /* @__PURE__ */ jsx("p", {
|
|
109
|
-
role: "alert",
|
|
110
|
-
className: "px-2 py-1.5 text-xs text-destructive",
|
|
111
|
-
children: error.message
|
|
112
|
-
}),
|
|
113
|
-
/* @__PURE__ */ jsx(FieldItems, {})
|
|
114
|
-
]
|
|
115
|
-
})] });
|
|
116
|
-
};
|
|
117
|
-
/** The search, as a chip (it opens the search box). */
|
|
118
|
-
const SearchChip = () => {
|
|
119
|
-
const { t } = useTranslation("views", { keyPrefix: "filter" });
|
|
120
|
-
const [searchValue] = useQueryState("searchValue");
|
|
121
|
-
return /* @__PURE__ */ jsxs(Filter.BarItem, {
|
|
122
|
-
queryKey: "searchValue",
|
|
123
|
-
children: [/* @__PURE__ */ jsxs(Filter.BarName, { children: [/* @__PURE__ */ jsx(IconSearch, {}), t("search", "Search")] }), /* @__PURE__ */ jsx(Filter.BarButton, {
|
|
124
|
-
filterKey: "searchValue",
|
|
125
|
-
inDialog: true,
|
|
126
|
-
children: searchValue
|
|
127
|
-
})]
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
/** Opens the filter menu; it shows how many conditions apply. */
|
|
131
|
-
const FilterButton = ({ count, onClick }) => {
|
|
21
|
+
/** The view bar's filter button: it opens the field picker and shows how many conditions apply. */
|
|
22
|
+
const FilterButton = ({ count }) => {
|
|
132
23
|
const { t } = useTranslation("views", { keyPrefix: "filter" });
|
|
133
24
|
const label = t("label", "Filter");
|
|
134
25
|
return /* @__PURE__ */ jsx(IconTip, {
|
|
135
26
|
label,
|
|
136
27
|
hotkey: "F",
|
|
137
|
-
children: /* @__PURE__ */
|
|
138
|
-
|
|
28
|
+
children: /* @__PURE__ */ jsx(AddFilter, {
|
|
29
|
+
from: "bar",
|
|
30
|
+
trigger: /* @__PURE__ */ jsxs(Button, {
|
|
139
31
|
size: "sm",
|
|
140
|
-
"aria-label": label,
|
|
32
|
+
"aria-label": count > 0 ? `${label} ${count}` : label,
|
|
141
33
|
"aria-keyshortcuts": "F",
|
|
142
34
|
variant: count > 0 ? "secondary" : "ghost",
|
|
143
35
|
tone: count > 0 ? "default" : "muted",
|
|
144
36
|
className: "h-7 min-w-7",
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
})]
|
|
37
|
+
children: [/* @__PURE__ */ jsx(IconFilter2, { className: "size-4" }), count > 0 && /* @__PURE__ */ jsx("span", {
|
|
38
|
+
className: "text-xs tabular-nums",
|
|
39
|
+
children: count
|
|
40
|
+
})]
|
|
41
|
+
})
|
|
151
42
|
})
|
|
152
43
|
});
|
|
153
44
|
};
|
|
154
|
-
/**
|
|
155
|
-
|
|
45
|
+
/**
|
|
46
|
+
* Under the view bar while the list is filtered: the conditions as chips that wrap, "+ Filter",
|
|
47
|
+
* Clear, and what the open view changed. The advanced filter opens anchored to it.
|
|
48
|
+
*/
|
|
49
|
+
const FilterRow = ({ status }) => {
|
|
50
|
+
const { t } = useTranslation("views", { keyPrefix: "filter" });
|
|
51
|
+
const { clear } = useListConditions();
|
|
52
|
+
const [chipsRef] = useAutoAnimate({ duration: 150 });
|
|
53
|
+
const rowRef = useRef(null);
|
|
54
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
55
|
+
ref: rowRef,
|
|
56
|
+
role: "toolbar",
|
|
57
|
+
"aria-label": t("row", "Filters"),
|
|
58
|
+
className: "flex min-h-10 shrink-0 items-start gap-2 border-b bg-background px-3 py-1.5",
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ jsxs("div", {
|
|
61
|
+
ref: chipsRef,
|
|
62
|
+
className: "flex min-w-0 flex-1 flex-wrap items-center gap-1.5",
|
|
63
|
+
children: [
|
|
64
|
+
/* @__PURE__ */ jsx(SearchChip, {}),
|
|
65
|
+
/* @__PURE__ */ jsx(RuleChips, {}),
|
|
66
|
+
/* @__PURE__ */ jsx(AddFilter, {
|
|
67
|
+
from: "row",
|
|
68
|
+
trigger: /* @__PURE__ */ jsxs(Button, {
|
|
69
|
+
size: "sm",
|
|
70
|
+
variant: "ghost",
|
|
71
|
+
tone: "muted",
|
|
72
|
+
className: "h-7",
|
|
73
|
+
children: [/* @__PURE__ */ jsx(IconPlus, {}), t("label", "Filter")]
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ jsxs("div", {
|
|
79
|
+
className: "flex h-7 shrink-0 items-center gap-1",
|
|
80
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
81
|
+
size: "sm",
|
|
82
|
+
variant: "ghost",
|
|
83
|
+
tone: "muted",
|
|
84
|
+
className: "h-7",
|
|
85
|
+
onClick: clear,
|
|
86
|
+
children: t("clear", "Clear")
|
|
87
|
+
}), status]
|
|
88
|
+
}),
|
|
89
|
+
/* @__PURE__ */ jsx(AdvancedPopover, { anchor: rowRef })
|
|
90
|
+
]
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
/** The filter's shared state: the conditions from the address, the open pickers. */
|
|
94
|
+
const useListFilterState = ({ fields, members, tags, contacts, totalCount, totalCapped, loading, error }) => {
|
|
156
95
|
const { advanced, setAdvanced } = useListConditions();
|
|
157
|
-
const
|
|
158
|
-
const [editing, setEditing] = useState(null);
|
|
96
|
+
const [adding, setAdding] = useState(null);
|
|
159
97
|
const [advancedOpen, setAdvancedOpen] = useState(false);
|
|
98
|
+
const lookups = useMemo(() => ({
|
|
99
|
+
members,
|
|
100
|
+
tags,
|
|
101
|
+
contacts
|
|
102
|
+
}), [
|
|
103
|
+
members,
|
|
104
|
+
tags,
|
|
105
|
+
contacts
|
|
106
|
+
]);
|
|
160
107
|
const parts = useMemo(() => partsOf(advanced), [advanced]);
|
|
161
|
-
const openMenu = useCallback((view, part) => {
|
|
162
|
-
setEditing(part);
|
|
163
|
-
setView(view);
|
|
164
|
-
setOpen(true);
|
|
165
|
-
}, [setOpen, setView]);
|
|
166
|
-
usePageHotkey("f", () => openMenu("root", null));
|
|
167
108
|
return {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (part && isRule(part) && field && inMenu(part, field)) openMenu(field.path, index);
|
|
178
|
-
else setAdvancedOpen(true);
|
|
179
|
-
},
|
|
180
|
-
openAdvanced: () => setAdvancedOpen(true)
|
|
181
|
-
}), [
|
|
182
|
-
fields,
|
|
183
|
-
lookups,
|
|
184
|
-
parts,
|
|
185
|
-
editing,
|
|
186
|
-
setAdvanced,
|
|
187
|
-
openMenu
|
|
188
|
-
]),
|
|
189
|
-
setEditing,
|
|
109
|
+
fields,
|
|
110
|
+
lookups,
|
|
111
|
+
advanced,
|
|
112
|
+
chips: chipsOf(advanced),
|
|
113
|
+
parts,
|
|
114
|
+
setPart: (index, next) => setAdvanced(groupOf(withPart(parts, index, next))),
|
|
115
|
+
setAdvanced,
|
|
116
|
+
adding,
|
|
117
|
+
setAdding,
|
|
190
118
|
advancedOpen,
|
|
191
|
-
setAdvancedOpen
|
|
119
|
+
setAdvancedOpen,
|
|
120
|
+
totalCount,
|
|
121
|
+
totalCapped,
|
|
122
|
+
loading,
|
|
123
|
+
error
|
|
192
124
|
};
|
|
193
125
|
};
|
|
194
126
|
/**
|
|
195
|
-
*
|
|
196
|
-
*
|
|
127
|
+
* In the view bar: the count, the list's own controls and the filter button (`F`). Under it,
|
|
128
|
+
* while the list is filtered, the filter row: in the view bar's slot, else right after the bar.
|
|
197
129
|
*/
|
|
198
|
-
const ListFilterBar = (
|
|
199
|
-
const
|
|
200
|
-
const
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
130
|
+
const ListFilterBar = (props) => {
|
|
131
|
+
const { status, totalCount, totalCapped, children } = props;
|
|
132
|
+
const state = useListFilterState(props);
|
|
133
|
+
const { advanced, search, active } = useListConditions();
|
|
134
|
+
const slot = useFilterRowSlot();
|
|
135
|
+
const count = (advanced ? ruleCount(advanced) : 0) + (search ? 1 : 0);
|
|
136
|
+
const rowShown = active || state.advancedOpen;
|
|
137
|
+
usePageHotkey("f", () => state.setAdding(rowShown ? "row" : "bar"));
|
|
138
|
+
const row = rowShown && /* @__PURE__ */ jsx(FilterRow, { status });
|
|
206
139
|
return /* @__PURE__ */ jsxs(ListFilterContext.Provider, {
|
|
207
140
|
value: state,
|
|
208
141
|
children: [
|
|
209
|
-
|
|
210
|
-
ref: chipsRef,
|
|
211
|
-
className: "flex min-w-0 items-center gap-1 overflow-x-auto py-1 hide-scroll",
|
|
212
|
-
children: [/* @__PURE__ */ jsx(SearchChip, {}), /* @__PURE__ */ jsx(RuleChips, {})]
|
|
213
|
-
}),
|
|
214
|
-
status,
|
|
142
|
+
!rowShown && status,
|
|
215
143
|
/* @__PURE__ */ jsx(RecordCount, {
|
|
216
144
|
totalCount,
|
|
217
145
|
totalCapped
|
|
@@ -221,32 +149,8 @@ const ListFilterBar = ({ id, fields, loading, error, status, totalCount, totalCa
|
|
|
221
149
|
className: "mx-1 h-4 w-px shrink-0 bg-border"
|
|
222
150
|
}),
|
|
223
151
|
children,
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
|
|
226
|
-
children: [/* @__PURE__ */ jsx(FilterButton, {
|
|
227
|
-
count: state.parts.length + (search ? 1 : 0),
|
|
228
|
-
onClick: () => setEditing(null)
|
|
229
|
-
}), /* @__PURE__ */ jsxs(Combobox.Content, {
|
|
230
|
-
align: "end",
|
|
231
|
-
className: "w-80",
|
|
232
|
-
children: [/* @__PURE__ */ jsx(Filter.View, { children: /* @__PURE__ */ jsx(RootMenu, {
|
|
233
|
-
loading,
|
|
234
|
-
error
|
|
235
|
-
}) }), fields.map((field) => /* @__PURE__ */ jsx(Filter.View, {
|
|
236
|
-
filterKey: field.path,
|
|
237
|
-
children: /* @__PURE__ */ jsx(FieldMenu, { field }, `${state.editing}`)
|
|
238
|
-
}, field.path))]
|
|
239
|
-
})]
|
|
240
|
-
}),
|
|
241
|
-
/* @__PURE__ */ jsx(Filter.Dialog, { children: /* @__PURE__ */ jsx(Filter.View, {
|
|
242
|
-
filterKey: "searchValue",
|
|
243
|
-
inDialog: true,
|
|
244
|
-
children: /* @__PURE__ */ jsx(Filter.DialogStringView, { filterKey: "searchValue" })
|
|
245
|
-
}) }),
|
|
246
|
-
/* @__PURE__ */ jsx(AdvancedFilterDialog, {
|
|
247
|
-
open: advancedOpen,
|
|
248
|
-
onOpenChange: setAdvancedOpen
|
|
249
|
-
})
|
|
152
|
+
/* @__PURE__ */ jsx(FilterButton, { count }),
|
|
153
|
+
row && (slot ? createPortal(row, slot) : row)
|
|
250
154
|
]
|
|
251
155
|
});
|
|
252
156
|
};
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
/** A chip: joined segments on a muted ground, the last one a remove button. */
|
|
3
|
+
export declare const Chip: ({ children, removeLabel, onRemove }: {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
removeLabel: string;
|
|
6
|
+
onRemove: () => void;
|
|
7
|
+
}) => import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* The list's conditions as chips, one per rule (keyed by place, so an open editor stays open as
|
|
10
|
+
* its rule changes), or the advanced filter's chip.
|
|
11
|
+
*/
|
|
12
|
+
export declare const RuleChips: () => import("react").JSX.Element[] | import("react").JSX.Element;
|