@wallarm-org/design-system 0.80.0 → 0.81.0
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.
|
@@ -10,5 +10,9 @@ export interface FieldMenuSection {
|
|
|
10
10
|
* render under group headers in group/listed order, unclaimed fields fall into
|
|
11
11
|
* a trailing headerless section, each section is filtered by `filterText`, and
|
|
12
12
|
* sections with no surviving fields are dropped.
|
|
13
|
+
*
|
|
14
|
+
* Fields flagged `hidden` are excluded from every section — they stay usable in
|
|
15
|
+
* existing chips (resolved elsewhere by `name`) but are never offered for
|
|
16
|
+
* selection here.
|
|
13
17
|
*/
|
|
14
18
|
export declare function buildFieldMenuSections(fields: FieldMetadata[], fieldGroups: FieldGroup[] | undefined, filterText: string): FieldMenuSection[];
|
|
@@ -4,15 +4,16 @@ const getText = (field)=>[
|
|
|
4
4
|
field.name
|
|
5
5
|
];
|
|
6
6
|
function buildFieldMenuSections(fields, fieldGroups, filterText) {
|
|
7
|
+
const selectableFields = fields.filter((field)=>!field.hidden);
|
|
7
8
|
if (!fieldGroups || 0 === fieldGroups.length) {
|
|
8
|
-
const flat = filterAndSort(
|
|
9
|
+
const flat = filterAndSort(selectableFields, filterText, getText);
|
|
9
10
|
return flat.length > 0 ? [
|
|
10
11
|
{
|
|
11
12
|
fields: flat
|
|
12
13
|
}
|
|
13
14
|
] : [];
|
|
14
15
|
}
|
|
15
|
-
const byName = new Map(
|
|
16
|
+
const byName = new Map(selectableFields.map((field)=>[
|
|
16
17
|
field.name,
|
|
17
18
|
field
|
|
18
19
|
]));
|
|
@@ -34,7 +35,7 @@ function buildFieldMenuSections(fields, fieldGroups, filterText) {
|
|
|
34
35
|
fields: filtered
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
|
-
const ungrouped =
|
|
38
|
+
const ungrouped = selectableFields.filter((field)=>!claimed.has(field.name));
|
|
38
39
|
const filteredUngrouped = filterAndSort(ungrouped, filterText, getText);
|
|
39
40
|
if (filteredUngrouped.length > 0) sections.push({
|
|
40
41
|
fields: filteredUngrouped
|
|
@@ -174,6 +174,14 @@ export interface FieldMetadata {
|
|
|
174
174
|
* level only — a pairedField's own `pairedField` is ignored.
|
|
175
175
|
*/
|
|
176
176
|
pairedField?: FieldMetadata;
|
|
177
|
+
/**
|
|
178
|
+
* When `true`, this field is omitted from the field-selection menu but stays
|
|
179
|
+
* fully functional everywhere else: an existing chip referencing it still
|
|
180
|
+
* resolves its label, operators, and value options. Use for fields that a
|
|
181
|
+
* consumer applies programmatically (e.g. a deep-link redirect) yet does not
|
|
182
|
+
* want users to pick manually.
|
|
183
|
+
*/
|
|
184
|
+
hidden?: boolean;
|
|
177
185
|
}
|
|
178
186
|
/**
|
|
179
187
|
* A labeled group of filter fields for the field-selection menu, referenced by
|