@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 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`,
@@ -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
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/schema",
3
- "version": "0.12.12",
3
+ "version": "0.12.14",
4
4
  "description": "Resource, field, view and access definitions for Protobase configs.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {