@protobase/schema 0.12.12 → 0.12.14
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/dist/model.d.ts +4 -0
- package/dist/view-widgets.d.ts +7 -0
- package/dist/view-widgets.js +9 -0
- package/package.json +1 -1
package/dist/model.d.ts
CHANGED
|
@@ -190,6 +190,10 @@ export type FilterWidgetModel = {
|
|
|
190
190
|
} | {
|
|
191
191
|
kind: 'toggle';
|
|
192
192
|
field: string;
|
|
193
|
+
} | {
|
|
194
|
+
kind: 'flags';
|
|
195
|
+
fields: string[];
|
|
196
|
+
label: string;
|
|
193
197
|
};
|
|
194
198
|
/**
|
|
195
199
|
* Records of another resource on the record page: those whose `field` holds this record's key or, with `through`,
|
package/dist/view-widgets.d.ts
CHANGED
|
@@ -12,5 +12,12 @@ export declare const widgets: {
|
|
|
12
12
|
presets?: DatePreset[];
|
|
13
13
|
}) => FilterWidgetModel;
|
|
14
14
|
toggle: (ref: Ref) => FilterWidgetModel;
|
|
15
|
+
/**
|
|
16
|
+
* A menu of boolean fields under one `label`, such as "for sale" and "for rent": a record shows when any chosen field
|
|
17
|
+
* is true, so one that is both shows under each.
|
|
18
|
+
*/
|
|
19
|
+
flags: (refs: Ref<string, boolean | null>[], o: {
|
|
20
|
+
label: string;
|
|
21
|
+
}) => FilterWidgetModel;
|
|
15
22
|
};
|
|
16
23
|
//#endregion
|
package/dist/view-widgets.js
CHANGED
|
@@ -18,6 +18,15 @@ const widgets = {
|
|
|
18
18
|
toggle: (ref) => ({
|
|
19
19
|
kind: "toggle",
|
|
20
20
|
field: ref.name
|
|
21
|
+
}),
|
|
22
|
+
/**
|
|
23
|
+
* A menu of boolean fields under one `label`, such as "for sale" and "for rent": a record shows when any chosen field
|
|
24
|
+
* is true, so one that is both shows under each.
|
|
25
|
+
*/
|
|
26
|
+
flags: (refs, o) => ({
|
|
27
|
+
kind: "flags",
|
|
28
|
+
fields: refs.map((ref) => ref.name),
|
|
29
|
+
label: o.label
|
|
21
30
|
})
|
|
22
31
|
};
|
|
23
32
|
//#endregion
|