@object-ui/plugin-list 17.3.0 → 17.5.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.
package/README.md CHANGED
@@ -180,6 +180,42 @@ interface ListViewSchema {
180
180
  }
181
181
  ```
182
182
 
183
+ ## Page binding — `dataSource` (referencing a saved view by name)
184
+
185
+ On a metadata page, a `list-view` component can bind its data through the spec's
186
+ per-element data source (`PageComponentSchema.dataSource`,
187
+ `ElementDataSourceSchema`) instead of spelling `objectName` and inlining the
188
+ view's configuration:
189
+
190
+ ```json
191
+ {
192
+ "type": "list-view",
193
+ "dataSource": { "object": "account", "view": "hot", "limit": 10 }
194
+ }
195
+ ```
196
+
197
+ `view` names a **saved view** of that object — either one embedded in the object
198
+ definition (`listViews`) or one created in the UI (the metadata overlay an
199
+ adapter serves from `listViews()`). Its `columns`, `filter`, `sort`, page size
200
+ and view kind are applied to the render, so a page no longer has to keep a second
201
+ copy of a view's configuration in sync with the view itself. Both the short key
202
+ (`hot`) and the qualified id (`account.hot`) resolve.
203
+
204
+ **Precedence.** `dataSource.*` keys are authoritative — the author wrote them on
205
+ this placement, and they beat the component's own same-named key. Values that
206
+ come from the named view are a *baseline*: a key written on the component itself
207
+ is more specific than the view it points at, so the component's key wins
208
+ (an empty `columns: []` counts as "not authored"). `filter` is the exception —
209
+ the spec calls `dataSource.filter` "additional filter criteria", so the
210
+ component's filter, the view's filter and the binding's filter all AND together.
211
+ A binding can narrow what the view selects, never widen it.
212
+
213
+ **An unresolvable `view` is an error, not an empty table.** If the named view
214
+ does not exist, the block renders a configuration error listing the object's
215
+ actual views, and issues no query. It deliberately does not fall back to the
216
+ object's default view: that would turn a typo into a silently *wider* answer on a
217
+ page that still looks like it works.
218
+
183
219
  ## Sorting (and why relational columns are not offered)
184
220
 
185
221
  The toolbar sort becomes a server `$orderby` on the **flat field name**, so the
@@ -191,10 +227,22 @@ user's side). The server cannot order by the related name without a join, and
191
227
  `objectstack#4256` settled that it will not add one.
192
228
 
193
229
  So the sort picker withholds relational fields and says so. To sort by a related
194
- record's name, denormalize it onto this object with a **formula field** and sort
195
- that column like any other text column. A relational field that the view's
196
- CURRENT sort already uses stays listed, labelled `(by ID)`, so existing view
197
- metadata round-trips instead of silently losing its sort.
230
+ record's name, denormalize that name onto this object as a **stored field,
231
+ written when the source changes**, then sort by that field — the remedy the
232
+ server's own refusal prescribes, in the same words the sort panel's hint uses.
233
+
234
+ **Not a formula field.** A formula value is computed on read, so no driver
235
+ materializes a column behind it, and since `objectstack#6994` the server answers
236
+ a sort that names one with a hard `400 INVALID_SORT` (before that it degraded
237
+ silently: the rows came back in an arbitrary order under a `200`, `asc` and
238
+ `desc` identical). The picker withholds formula fields for the same reason
239
+ (`objectui#4243`), so there is no formula column here to sort "like any other
240
+ text column" — the column you sort is the stored one the denormalization writes.
241
+
242
+ A field the view's CURRENT sort already uses stays listed under both rules —
243
+ relational ones labelled `(by ID)` — so existing view metadata round-trips
244
+ instead of silently losing its sort, and a sort the server would refuse can
245
+ still be edited away in the picker that otherwise hides its field.
198
246
 
199
247
  Column-header sorting inside the grid is unaffected: it is client-side over the
200
248
  rows already loaded, where the label the cell shows IS available, so it orders by
@@ -204,17 +252,6 @@ that label (see `getSortValue` in `@object-ui/core`).
204
252
 
205
253
  The ListView automatically persists the user's view type preference in localStorage using the key `listview-{objectName}-view`.
206
254
 
207
- <!-- release-metadata:v3.3.0 -->
208
-
209
- ## Compatibility
210
-
211
- - **React:** 18.x or 19.x
212
- - **Node.js:** ≥ 18
213
- - **TypeScript:** ≥ 5.0 (strict mode)
214
- - **`@objectstack/spec`:** ^3.3.0
215
- - **`@objectstack/client`:** ^3.3.0
216
- - **Tailwind CSS:** ≥ 3.4 (for packages with UI)
217
-
218
255
  ## Links
219
256
 
220
257
  - 📚 [Documentation](https://www.objectui.org/docs/plugins/plugin-list)
@@ -9,9 +9,46 @@ import { ListViewSchema } from '@object-ui/types';
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  */
11
11
  import * as React from 'react';
12
+ /**
13
+ * The list view's props.
14
+ *
15
+ * ## Why there is no `[key: string]: any` here (objectui#4528)
16
+ *
17
+ * There used to be one, and it erased this entire interface. A string index
18
+ * signature puts `string` into `keyof Props`, so `'ref' extends keyof Props` is
19
+ * always true and React's `PropsWithoutRef` takes its `Omit` branch — and
20
+ * `Omit` over a type carrying a string index signature keeps ONLY the index
21
+ * signature. Every declared property below was dropped from the resolved type.
22
+ * Measured on the pre-fix source:
23
+ * `keyof React.ComponentProps< typeof ListView >` was `string | number`, and
24
+ * `React.ComponentProps< typeof ListView >['onRowClick']` was `any`, while this
25
+ * interface went on declaring `(record: Record< string, unknown >) => void`.
26
+ *
27
+ * The same trap, in `packages/components`, is objectui#4422 / PR #4438; this is
28
+ * the sweep of the two packages that issue left unswept.
29
+ *
30
+ * ## The props that were only ever reachable through it
31
+ *
32
+ * `ListView` reads several props it never declared, because the index signature
33
+ * was answering for them — `dataSource`, `onAddRecord`, `onBulkAction`,
34
+ * `onPageSizeChange` are read directly, and `onEdit` / `onDelete` /
35
+ * `onBulkDelete` ride the `{...props}` forward into the active view component
36
+ * (`ObjectGrid` declares all three). They are declared by name below, at the
37
+ * type each one actually lands on, rather than left to an index signature that
38
+ * types them `any` and erases everything around them.
39
+ */
12
40
  export interface ListViewProps {
13
41
  schema: ListViewSchema;
14
42
  className?: string;
43
+ /**
44
+ * Data-source adapter. Read directly (`dataSource.find`,
45
+ * `dataSource.getObjectSchema`, `dataSource.onMutation`) and forwarded to the
46
+ * active view component. Typed `any` deliberately: that is what it resolved
47
+ * to before objectui#4528, so declaring it changes what is DECLARED without
48
+ * changing what any call site is held to. Narrowing it to a real adapter type
49
+ * is a separate change with its own consumer sweep.
50
+ */
51
+ dataSource?: any;
15
52
  onViewChange?: (view: ViewType) => void;
16
53
  onFilterChange?: (filters: any) => void;
17
54
  onSortChange?: (sort: any) => void;
@@ -42,7 +79,21 @@ export interface ListViewProps {
42
79
  initialFilters?: FilterGroup;
43
80
  /** Initial search term to restore at mount (same one-shot semantics as `initialFilters`). */
44
81
  initialSearchTerm?: string;
45
- [key: string]: any;
82
+ /** Called when the user asks for a new record (toolbar "+ New" and the empty-state CTA). */
83
+ onAddRecord?: () => void;
84
+ /** Called with a non-delete bulk action key and the currently selected rows. */
85
+ onBulkAction?: (action: string, records: any[]) => void;
86
+ /** Called when the user picks a different page size in the pager. */
87
+ onPageSizeChange?: (pageSize: number) => void;
88
+ /**
89
+ * Row-level affordances forwarded to the active view component. `ObjectGrid`
90
+ * declares all three with exactly these signatures; they are named here so the
91
+ * hosts that pass them (`ObjectView`, `StudioDesignSurface`) are held to a
92
+ * contract instead of to an index signature.
93
+ */
94
+ onEdit?: (record: any) => void;
95
+ onDelete?: (record: any) => void;
96
+ onBulkDelete?: (records: any[]) => void;
46
97
  }
47
98
  /**
48
99
  * Filter-builder / view operator → filter-AST operator.
@@ -62,10 +113,6 @@ export declare function mapOperator(op: string): string;
62
113
  * E.g., ['status', 'in', ['a','b']] → ['or', ['status','=','a'], ['status','=','b']]
63
114
  */
64
115
  export declare function normalizeFilterCondition(condition: any[]): any[];
65
- /**
66
- * Format an action identifier string into a human-readable label.
67
- * e.g., 'send_email' → 'Send Email'
68
- */
69
116
  /**
70
117
  * Normalize a view's `sort` declaration to SortItem[]. @objectstack/spec
71
118
  * ListViewSchema.sort is `string | Array<{ field, order }>` — the TOP-LEVEL
@@ -92,6 +139,37 @@ export declare function resolveAddRecordPlacement(position: unknown): {
92
139
  top: boolean;
93
140
  bottom: boolean;
94
141
  };
142
+ /**
143
+ * The date axis a timeline view renders on.
144
+ *
145
+ * ONE resolution, consumed by both read-sites that decide the timeline's fate:
146
+ * the capability gate (may this view offer the Timeline visualization?) and the
147
+ * timeline render branch (which field does it bucket by?). Those two used to
148
+ * carry separate, unequal source lists, and the gate was the wider of the pair —
149
+ * it accepted `options.calendar.startDateField` as a timeline-resolvable axis
150
+ * while the render branch never read calendar config at all. A view that binds
151
+ * its dates under `calendar` therefore got the Timeline option offered and then
152
+ * bucketed every record into "No date" (objectui#3129), which is exactly the
153
+ * shape the report isolated: the same fields render fine in Calendar and Gantt.
154
+ *
155
+ * A calendar binding IS a legitimate timeline axis in this product, not a
156
+ * lenient fallback bolted on here: the capability gate has always said so, and
157
+ * `InterfaceListPage` derives a timeline's default binding from the very same
158
+ * `defaultCalendarFromObject` helper it uses for calendars. What was missing is
159
+ * that one of the two read-sites never honoured the promise the other made.
160
+ *
161
+ * Both nestings are read at each level, spec-canonical key first: the
162
+ * spec-authored `schema.timeline` / `schema.calendar` and the legacy
163
+ * `schema.options.*` twin that app-shell's object pages still emit. `dateField`
164
+ * is the pre-#2231 alias for `startDateField`.
165
+ *
166
+ * Exported for the regression suite, which pins each authoring shape.
167
+ */
168
+ export declare function resolveTimelineDateBinding(schema: any): {
169
+ startDateField?: string;
170
+ endDateField?: string;
171
+ titleField?: string;
172
+ };
95
173
  /**
96
174
  * Normalize an array of filter conditions, expanding `in`/`not in` operators
97
175
  * and ensuring consistent AST structure.
@@ -141,6 +219,7 @@ export declare function convertFilterGroupToAST(group: FilterGroup): any[];
141
219
  * `$expand` substituted for it (see `toPredicateRecord`).
142
220
  */
143
221
  export declare function evaluateConditionalFormatting(record: Record<string, unknown>, rules?: ListViewSchema['conditionalFormatting'], scope?: Record<string, unknown>, fields?: unknown): React.CSSProperties;
222
+ export declare const LIST_DEFAULT_TRANSLATIONS: Record<string, string>;
144
223
  /**
145
224
  * Imperative handle exposed by ListView via React.forwardRef.
146
225
  * Allows parent components to trigger a data refresh programmatically.
@@ -157,5 +236,5 @@ export interface ListViewHandle {
157
236
  /** Force the ListView to re-fetch data from the DataSource */
158
237
  refresh(): void;
159
238
  }
160
- export declare const ListView: React.ForwardRefExoticComponent<Omit<ListViewProps, "ref"> & React.RefAttributes<ListViewHandle>>;
239
+ export declare const ListView: React.ForwardRefExoticComponent<ListViewProps & React.RefAttributes<ListViewHandle>>;
161
240
  //# sourceMappingURL=ListView.d.ts.map
@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E;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,KAAK,CAAC,EAAE,cAAc,CAAC,uBAAuB,CAAC,EAC/C,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,MAAM,CAAC,EAAE,OAAO,GACf,KAAK,CAAC,aAAa,CAErB;AA+ED,eAAO,MAAM,yBAAyB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA2H5D,CAAC;AA2BF;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,cAAc;IAC7B,8DAA8D;IAC9D,OAAO,IAAI,IAAI,CAAC;CACjB;AAED,eAAO,MAAM,QAAQ,sFA8nFnB,CAAC"}
@@ -0,0 +1,69 @@
1
+ import { default as React } from 'react';
2
+ import { ListViewHandle, ListViewProps } from './ListView';
3
+ /**
4
+ * Registry entry point for `<ListView>` — two bridges in one component.
5
+ *
6
+ * ## 1. The data-source ADAPTER (#3144)
7
+ *
8
+ * `ListView` reads `props.dataSource` (the injected adapter), and
9
+ * `SchemaRenderer` never passes it — it only puts the data source on
10
+ * `SchemaRendererContext`. Registering the component bare meant that on the
11
+ * registry/SDUI path (a metadata page, a `kind:'react'` page, the designer
12
+ * preview) it received no data source at all: its `getObjectSchema` effect
13
+ * returned immediately, nothing was ever fetched, and it rendered the "Nothing
14
+ * here" empty state — while its registry `inputs` declared `objectName`
15
+ * **required**. The app never showed this because the console reaches ListView
16
+ * through `ObjectView`'s `renderListView` render-prop, which passes a data
17
+ * source itself. That is the objectstack#4413 shape (a declared binding nothing
18
+ * can consume), caught by
19
+ * `apps/console/src/__tests__/public-block-binding-reach.test.tsx` rather than by
20
+ * hand. `object-form`, `object-kanban` and `object-calendar` carry the same
21
+ * one-line bridge.
22
+ *
23
+ * An explicit `dataSource` prop still wins — hosts that pass their own (as
24
+ * `ObjectView` does) are unaffected. `useContext` rather than
25
+ * `useSchemaContext()` because the latter throws outside a provider, and a bare
26
+ * `<ListView>` with a host-supplied data source must keep working.
27
+ *
28
+ * ## 2. The spec's per-element data BINDING (objectstack#5576)
29
+ *
30
+ * `PageComponentSchema.dataSource` — `{ object, view?, filter?, sort?, limit? }` —
31
+ * is how a page component declares what to query. It was published and unread:
32
+ * `resolveElementDataSource` dropped `view`, had no caller outside its own test,
33
+ * and nothing mapped `object` onto `objectName`. Worse, the binding and the
34
+ * adapter above collide by NAME, so a page that wrote the binding the spec
35
+ * documents got the plain `{ object, view }` object where the adapter belongs:
36
+ * the first `dataSource.find(…)` threw `dataSource.find is not a function` and
37
+ * the list rendered **"Couldn't load records"**. Three `list-view` components on
38
+ * one home page, the two without `dataSource` fine and the spec-compliant one
39
+ * broken, is the single-variable reproduction in the issue.
40
+ *
41
+ * `SchemaRenderer` no longer spreads the schema's `dataSource` as a prop, which
42
+ * removes the collision at its source. This component completes the other half:
43
+ * it maps the binding onto the props `ListView` actually reads, resolving a named
44
+ * saved view through `ElementDataSourceGate`.
45
+ *
46
+ * ### Where the precedence table lives (objectui#4038)
47
+ *
48
+ * It is NOT here. objectstack#5576 landed this block's own ~45-line copy of
49
+ * "binding overrides the component key / a view is only a baseline / `filter`
50
+ * AND-combines / an empty `columns` counts as unauthored / the row cap lands on
51
+ * `pagination.pageSize` / `viewType` only when undeclared", and objectstack#6953
52
+ * then lifted that same table into `@object-ui/react` when the other eight
53
+ * object-bound blocks needed it. Two copies of one table is how the spec's
54
+ * "*additional* filter criteria" quietly becomes two dialects — the next person
55
+ * to change the rules changes one side. So the table now lives ONCE, in
56
+ * {@link ElementDataSourceGate}, and this block contributes only the part that is
57
+ * genuinely its own: {@link LIST_VIEW_DATA_SOURCE}, the names of the keys it
58
+ * reads. The behaviour is unchanged in both directions — that objectstack#5576's
59
+ * whole suite passes here untouched is the acceptance criterion of the
60
+ * convergence, not a happy accident.
61
+ *
62
+ * An unresolvable `view` still fails loudly (the gate renders the configuration
63
+ * error rather than falling back to the object's default view): silently widening
64
+ * a named view to "all records" is the failure class the binding exists to
65
+ * remove, and the one an AI-authored page hides best.
66
+ */
67
+ declare const ListViewBlock: React.ForwardRefExoticComponent<ListViewProps & React.RefAttributes<ListViewHandle>>;
68
+ export { ListViewBlock };
69
+ //# sourceMappingURL=ListViewBlock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListViewBlock.d.ts","sourceRoot":"","sources":["../src/ListViewBlock.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAqB,MAAM,OAAO,CAAC;AAO1C,OAAO,EAAY,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAqB/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,QAAA,MAAM,aAAa,sFAwBjB,CAAC;AAGH,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ViewSwitcher.d.ts","sourceRoot":"","sources":["../src/ViewSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAgB/B,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,QAAQ,GACR,SAAS,GACT,UAAU,GACV,UAAU,GACV,OAAO,GACP,KAAK,GACL,OAAO,GACP,MAAM,CAAC;AAEX,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,QAAQ,CAAC;IACtB,cAAc,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC5B,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA0BD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAyG5D,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAsDpD,CAAC"}
1
+ {"version":3,"file":"ViewSwitcher.d.ts","sourceRoot":"","sources":["../src/ViewSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,MAAM,MAAM,QAAQ,GAChB,MAAM,GACN,QAAQ,GACR,SAAS,GACT,UAAU,GACV,UAAU,GACV,OAAO,GACP,KAAK,GACL,OAAO,GACP,MAAM,CAAC;AAEX,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,QAAQ,CAAC;IACtB,cAAc,CAAC,EAAE,QAAQ,EAAE,CAAC;IAC5B,YAAY,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,IAAI,CAAC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAuFD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA0G5D,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAwDpD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../src/components/TabBar.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;AAE9D,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA+BD;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA4DxC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAqE9C,CAAC"}
1
+ {"version":3,"file":"TabBar.d.ts","sourceRoot":"","sources":["../../src/components/TabBar.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC;AAE9D,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAkED;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA6DxC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAsE9C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ViewSettingsPopover.d.ts","sourceRoot":"","sources":["../../src/components/ViewSettingsPopover.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoB/B,MAAM,WAAW,iBA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OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC3B,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;IAEjD,uFAAuF;IACvF,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AA8CD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,qBAwNlE"}
package/dist/index.d.ts CHANGED
@@ -1,13 +1,15 @@
1
1
  import { ListView } from './ListView';
2
+ import { ListViewBlock } from './ListViewBlock';
2
3
  import { ViewSwitcher } from './ViewSwitcher';
3
4
  import { ObjectGallery } from './ObjectGallery';
4
- export { ListView, ViewSwitcher, ObjectGallery };
5
+ export { ListView, ListViewBlock, ViewSwitcher, ObjectGallery };
5
6
  export { ViewSwitcherDropdown } from './ViewSwitcher';
6
7
  export { TabBar, TabBarSelect } from './components/TabBar';
7
8
  export type { TabBarProps, ViewTab } from './components/TabBar';
8
9
  export { UserFilters } from './UserFilters';
9
10
  export type { UserFiltersProps } from './UserFilters';
10
11
  export { evaluateConditionalFormatting, normalizeFilterCondition, normalizeFilters } from './ListView';
12
+ export { LIST_DEFAULT_TRANSLATIONS } from './ListView';
11
13
  export type { ListViewProps, ListViewHandle } from './ListView';
12
14
  export type { ObjectGalleryProps } from './ObjectGallery';
13
15
  export type { ViewSwitcherProps, ViewType } from './ViewSwitcher';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAE,QAAQ,EAA2C,MAAM,YAAY,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAA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