@object-ui/plugin-list 17.6.0 → 18.0.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/CHANGELOG.md +5149 -0
- package/README.md +398 -60
- package/dist/ListEmptyState.d.ts +72 -0
- package/dist/ListEmptyState.d.ts.map +1 -0
- package/dist/ListView.d.ts +220 -29
- package/dist/ListView.d.ts.map +1 -1
- package/dist/ListViewBlock.d.ts +1 -1
- package/dist/ListViewBlock.d.ts.map +1 -1
- package/dist/ListViewCompact.d.ts +77 -0
- package/dist/ListViewCompact.d.ts.map +1 -0
- package/dist/ObjectGallery.d.ts +35 -23
- package/dist/ObjectGallery.d.ts.map +1 -1
- package/dist/UserFilters.d.ts +14 -1
- package/dist/UserFilters.d.ts.map +1 -1
- package/dist/ViewSwitcher.d.ts +37 -7
- package/dist/ViewSwitcher.d.ts.map +1 -1
- package/dist/calendarWindow.d.ts +102 -0
- package/dist/calendarWindow.d.ts.map +1 -0
- package/dist/components/TabBar.d.ts.map +1 -1
- package/dist/components/ViewSettingsPopover.d.ts +53 -16
- package/dist/components/ViewSettingsPopover.d.ts.map +1 -1
- package/dist/index.d.ts +14 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2491 -1529
- package/dist/index.umd.cjs +2 -2
- package/package.json +23 -22
package/dist/ListView.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { SortItem,
|
|
2
|
-
import { ViewType } from './ViewSwitcher';
|
|
1
|
+
import { SortItem, FilterBuilderRowGroup } from '@object-ui/components';
|
|
3
2
|
import { ListViewSchema } from '@object-ui/types';
|
|
3
|
+
import { ListViewVisualization } from '@object-ui/core';
|
|
4
|
+
import { GroupingConfig } from '@objectstack/spec/ui';
|
|
4
5
|
/**
|
|
5
6
|
* ObjectUI
|
|
6
7
|
* Copyright (c) 2024-present ObjectStack Inc.
|
|
@@ -11,11 +12,22 @@ import { ListViewSchema } from '@object-ui/types';
|
|
|
11
12
|
import * as React from 'react';
|
|
12
13
|
/**
|
|
13
14
|
* The `case 'map'` branch below builds an `object-map` schema by flattening
|
|
14
|
-
* `schema.options.map`'s CONTENTS to the top level
|
|
15
|
-
* `ObjectMapConfigSchema`
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* (objectui#5177).
|
|
15
|
+
* `schema.options.map`'s CONTENTS to the top level — one entry per key
|
|
16
|
+
* `ObjectMapConfigSchema` declares, written under the name the FLAT form uses
|
|
17
|
+
* for that key. Whitelisted rather than a whole-bag spread: `style` is ALSO
|
|
18
|
+
* `BaseSchema.style` (inline CSS, legal on every node), and spreading the raw
|
|
19
|
+
* `map` block collapsed the two namespaces onto one key (objectui#5177). That
|
|
20
|
+
* reason is unchanged, and so is its consequence: a key the declaration does
|
|
21
|
+
* NOT carry never reaches the product.
|
|
22
|
+
*
|
|
23
|
+
* `style` IS delivered (objectui#9950) — under its flat spelling `mapStyle`,
|
|
24
|
+
* NOT by widening the whitelist to let `style` through unrenamed.
|
|
25
|
+
* `getMapConfig` in `ObjectMap.tsx` reads `schema.mapStyle || schema.map?.style`
|
|
26
|
+
* and deliberately does NOT read a top-level `style`, because that key is the
|
|
27
|
+
* base face's inline CSS (objectui#5017). `mapStyle` is itself a declared
|
|
28
|
+
* member of `ObjectMapSchema`, so the flat product stays inside the declaration
|
|
29
|
+
* at both ends. Before this, a view authoring `map: { style: '<url>' }` parsed
|
|
30
|
+
* green, was dropped here, and the map painted the PUBLIC DEMO TILES.
|
|
19
31
|
*
|
|
20
32
|
* HAND-LISTED, not derived at runtime — deliberately, and only here (`plugin-
|
|
21
33
|
* map`'s own `FLAT_MAP_CONFIG_KEYS` in `ObjectMap.tsx` DOES derive from
|
|
@@ -32,14 +44,30 @@ import * as React from 'react';
|
|
|
32
44
|
* gets away with the runtime import only because nothing in
|
|
33
45
|
* console-starter's graph reaches `@object-ui/plugin-map` today.
|
|
34
46
|
*
|
|
35
|
-
* Anti-drift is
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
47
|
+
* Anti-drift is TWO mechanisms, neither of them this comment:
|
|
48
|
+
* - the type below is TOTAL — a `Record` over EVERY `keyof ObjectMapConfig`,
|
|
49
|
+
* not a list of some of them — so a key added to the declaration fails
|
|
50
|
+
* `tsc` here until it is given a flat spelling. A key can no longer be
|
|
51
|
+
* left out by simply not being written down, which is how `style` was.
|
|
52
|
+
* - `ListView.mapFlatten.test.tsx` pins this object's key set against
|
|
53
|
+
* `ObjectMapConfigSchema.shape` — imported only from that TEST file, which
|
|
54
|
+
* the alias-closure walker explicitly excludes from traversal — and asserts
|
|
55
|
+
* the RELATION (every declared key is delivered under its flat spelling).
|
|
56
|
+
* The pre-#9950 pin could not see the omission because it compared the hand
|
|
57
|
+
* list against `shape` MINUS `style`: the set it measured against was
|
|
58
|
+
* narrowed by the same subtraction the defect was made of, so it stayed
|
|
59
|
+
* green while an authored style was being discarded.
|
|
41
60
|
*/
|
|
42
|
-
export declare const
|
|
61
|
+
export declare const FLAT_MAP_CONFIG_SPELLING: {
|
|
62
|
+
readonly latitudeField: "latitudeField";
|
|
63
|
+
readonly longitudeField: "longitudeField";
|
|
64
|
+
readonly locationField: "locationField";
|
|
65
|
+
readonly titleField: "titleField";
|
|
66
|
+
readonly descriptionField: "descriptionField";
|
|
67
|
+
readonly zoom: "zoom";
|
|
68
|
+
readonly center: "center";
|
|
69
|
+
readonly style: "mapStyle";
|
|
70
|
+
};
|
|
43
71
|
/**
|
|
44
72
|
* The list view's props.
|
|
45
73
|
*
|
|
@@ -80,21 +108,76 @@ export interface ListViewProps {
|
|
|
80
108
|
* is a separate change with its own consumer sweep.
|
|
81
109
|
*/
|
|
82
110
|
dataSource?: any;
|
|
83
|
-
onViewChange?: (view:
|
|
84
|
-
|
|
85
|
-
|
|
111
|
+
onViewChange?: (view: ListViewVisualization) => void;
|
|
112
|
+
/**
|
|
113
|
+
* Fires with the advanced-filter group the toolbar's `FilterBuilder` emitted.
|
|
114
|
+
*
|
|
115
|
+
* `FilterBuilderRowGroup` because that is what the one call site actually passes: the
|
|
116
|
+
* builder's own `onChange` value, handed straight through beside
|
|
117
|
+
* `setCurrentFilters` — itself `React.useState<FilterBuilderRowGroup>`. Deliberately NOT
|
|
118
|
+
* the filter AST `normalizeFilters` / `buildEffectiveFilter` speak: those run
|
|
119
|
+
* later, on the query-building path, and nothing they produce reaches this
|
|
120
|
+
* callback. A host receives the BUILDER's group verbatim, which is what lets
|
|
121
|
+
* it round-trip back in through `initialFilters`.
|
|
122
|
+
*/
|
|
123
|
+
onFilterChange?: (filters: FilterBuilderRowGroup) => void;
|
|
124
|
+
/**
|
|
125
|
+
* Fires with the view's sort after a builder edit, a header click or a
|
|
126
|
+
* "reset to the view's default".
|
|
127
|
+
*
|
|
128
|
+
* `SortItem[]` because every emit crosses exactly one boundary —
|
|
129
|
+
* `emitSortChange` — and both of its legs carry that element type: the array
|
|
130
|
+
* passed in, and `filterPlatformSortableSort`'s return, which is generic in
|
|
131
|
+
* the element (readonly T[] in, T[] out) and so preserves whatever it is
|
|
132
|
+
* given. Normalized-vs-raw therefore does not move the TYPE here; it only
|
|
133
|
+
* decides whether platform-unsortable entries are still present (#6455).
|
|
134
|
+
*/
|
|
135
|
+
onSortChange?: (sort: SortItem[]) => void;
|
|
136
|
+
/**
|
|
137
|
+
* Fires with the grouping after a user edit in either grouping editor: the
|
|
138
|
+
* toolbar's Group panel (a level added, changed or removed, or Clear) and the
|
|
139
|
+
* compact toolbar's settings popover. `undefined` when the grouping is
|
|
140
|
+
* cleared.
|
|
141
|
+
*
|
|
142
|
+
* The value is the spec's `GroupingConfig`, the shape `schema.grouping`
|
|
143
|
+
* takes, so a host hands it back through `schema.grouping` unchanged
|
|
144
|
+
* (objectui#11860). Not fired when the list re-reads a changed
|
|
145
|
+
* `schema.grouping` or `groupBy`: that value came from the host.
|
|
146
|
+
*/
|
|
147
|
+
onGroupingChange?: (grouping: GroupingConfig | undefined) => void;
|
|
86
148
|
onSearchChange?: (search: string) => void;
|
|
87
149
|
/** Called when the user toggles fields via the Hide Fields popover. */
|
|
88
150
|
onHiddenFieldsChange?: (hidden: string[]) => void;
|
|
89
|
-
/**
|
|
151
|
+
/**
|
|
152
|
+
* Called when the user toggles inline record editing. Wiring it is also what
|
|
153
|
+
* offers the wide toolbar's toggle. The toggle switches the grid's edit MODE,
|
|
154
|
+
* which `ListView` keeps in its own state. A host should not persist it into
|
|
155
|
+
* the view's `inlineEdit`: that key is the author's permission, and it folds
|
|
156
|
+
* into `userActions.editInline` (objectui#5144).
|
|
157
|
+
*/
|
|
90
158
|
onInlineEditChange?: (next: boolean) => void;
|
|
91
159
|
/** Called when the user resizes/reorders columns in the underlying grid. */
|
|
92
160
|
onColumnStateChange?: (state: {
|
|
93
161
|
order?: string[];
|
|
94
162
|
widths?: Record<string, number>;
|
|
95
163
|
}) => void;
|
|
96
|
-
/**
|
|
97
|
-
|
|
164
|
+
/**
|
|
165
|
+
* Callback when a row/item is clicked (overrides NavigationConfig).
|
|
166
|
+
*
|
|
167
|
+
* TWO parameters since objectui#9357, and the second is not decoration: this
|
|
168
|
+
* prop reaches `useNavigationOverlay` as its `onRowClick`, and `handleClick`
|
|
169
|
+
* invokes it as `onRowClick(record, event)` — the modifier payload a host
|
|
170
|
+
* needs to implement Cmd/Ctrl/middle-click for itself. Declaring one
|
|
171
|
+
* parameter hid the second on the ONE line a host reads. Spelled `any` and
|
|
172
|
+
* not `HandleClickModifiers` for the reason objectui#9341 measured on
|
|
173
|
+
* `ObjectKanbanSchema.onCardClick`: that interface lives in
|
|
174
|
+
* `@object-ui/react`, the published twins in `@object-ui/types` may not name
|
|
175
|
+
* it, and a host that discovered the payload from the implementation
|
|
176
|
+
* annotated it `React.MouseEvent` — which a narrower declaration refuses
|
|
177
|
+
* contravariantly. `BaseSchema`'s own `onClick` / `onChange` / `onSubmit`
|
|
178
|
+
* already use this spelling for exactly this situation.
|
|
179
|
+
*/
|
|
180
|
+
onRowClick?: (record: Record<string, unknown>, event?: any) => void;
|
|
98
181
|
/** Show view type switcher (Grid/Kanban/etc). Default: false (view type is fixed) */
|
|
99
182
|
showViewSwitcher?: boolean;
|
|
100
183
|
/** Initial user-filter selections to restore (field → values; `_tab` for the active preset). */
|
|
@@ -107,7 +190,7 @@ export interface ListViewProps {
|
|
|
107
190
|
* later prop changes don't override in-flight user edits, so hosts remount
|
|
108
191
|
* (via `key`) when they need to swap the restored value (view switch).
|
|
109
192
|
*/
|
|
110
|
-
initialFilters?:
|
|
193
|
+
initialFilters?: FilterBuilderRowGroup;
|
|
111
194
|
/** Initial search term to restore at mount (same one-shot semantics as `initialFilters`). */
|
|
112
195
|
initialSearchTerm?: string;
|
|
113
196
|
/** Called when the user asks for a new record (toolbar "+ New" and the empty-state CTA). */
|
|
@@ -125,6 +208,65 @@ export interface ListViewProps {
|
|
|
125
208
|
onEdit?: (record: any) => void;
|
|
126
209
|
onDelete?: (record: any) => void;
|
|
127
210
|
onBulkDelete?: (records: any[]) => void;
|
|
211
|
+
/**
|
|
212
|
+
* A host-drawn node rendered FIRST in the toolbar row's left group, before
|
|
213
|
+
* the user filters, in a `min-w-0 flex-1` wrapper: it takes the width the
|
|
214
|
+
* right-hand tool cluster leaves (objectui#12440). The console passes its
|
|
215
|
+
* saved-view `ViewTabBar` here, so the view tabs and Filter · Sort ·
|
|
216
|
+
* Display · Search share one row.
|
|
217
|
+
*
|
|
218
|
+
* A HOST prop on the React component, never a schema key: it is a React
|
|
219
|
+
* node a host composes, nothing an author writes, and the list view's own
|
|
220
|
+
* `tabs` key is retired from the protocol (objectui#11073). It is
|
|
221
|
+
* destructured by name so it never rides the `{...props}` forward into the
|
|
222
|
+
* active view component. Absent ⇒ the toolbar row is exactly what it was.
|
|
223
|
+
*
|
|
224
|
+
* A host that passes it carries the view's DESCRIPTION too (objectui#12528):
|
|
225
|
+
* the console's `ViewTabBar` draws it as the active tab's tooltip and ▾ menu
|
|
226
|
+
* header, so the list draws none. Without it the list draws the description
|
|
227
|
+
* itself, as an info control at the start of the toolbar row — never as a
|
|
228
|
+
* row of its own, so the toolbar sits at one height with or without one.
|
|
229
|
+
*/
|
|
230
|
+
toolbarLeading?: React.ReactNode;
|
|
231
|
+
/**
|
|
232
|
+
* Whether the grid opens with row numbers in its leading cell — the opening
|
|
233
|
+
* state of the Display control's session-only switch, and what its "Reset to
|
|
234
|
+
* view default" returns to. Default `true`. A HOST prop, never a schema key:
|
|
235
|
+
* the console's Setup app opens its lists without them (objectui#12606), a
|
|
236
|
+
* posture of the console, not of the view.
|
|
237
|
+
*/
|
|
238
|
+
defaultRowNumbers?: boolean;
|
|
239
|
+
/**
|
|
240
|
+
* The VIEW'S OWN hidden fields and row height, for a host that lays the
|
|
241
|
+
* user's own preference over them in `schema` (objectui#12949). The Display
|
|
242
|
+
* control's trigger count and its "Reset to view default" compare these two
|
|
243
|
+
* settings against this value rather than against `schema`, and the reset
|
|
244
|
+
* hands it back through the same doors the controls write through
|
|
245
|
+
* (`onHiddenFieldsChange`, `schema.onDensityChange`), so the user's
|
|
246
|
+
* preference follows.
|
|
247
|
+
*
|
|
248
|
+
* When it is passed, its members are the whole baseline: an absent
|
|
249
|
+
* `hiddenFields` means the view hides nothing, an absent `rowHeight` means
|
|
250
|
+
* the view's default density. Absent ⇒ `schema` is the view's own, exactly
|
|
251
|
+
* as before. A HOST prop, never a schema key: it is the host's split of one
|
|
252
|
+
* composed value into its two sources, nothing an author writes.
|
|
253
|
+
*/
|
|
254
|
+
viewDefaults?: Pick<ListViewSchema, 'hiddenFields' | 'rowHeight'>;
|
|
255
|
+
/**
|
|
256
|
+
* Draw the COMPACT posture (objectui#12703): a header with the list's title
|
|
257
|
+
* and record count over two-line rows (the view's first visible column, its
|
|
258
|
+
* second muted below), and none of the toolbar, view tabs, row-number column,
|
|
259
|
+
* pager or record-count bar. The `list-view` page block passes it when the
|
|
260
|
+
* page region it sits in is narrower than half the page
|
|
261
|
+
* (`usePageRegionPosture` from `@object-ui/components`).
|
|
262
|
+
*
|
|
263
|
+
* A HOST prop, never a schema key: the posture is measured by the page
|
|
264
|
+
* renderer, never authored, and `@objectstack/spec` declares no key for it.
|
|
265
|
+
* It applies to a paged grid, the view that draws the rows this component
|
|
266
|
+
* fetches a page of; any other kind (a board, a calendar, a grouped grid)
|
|
267
|
+
* keeps its full rendering. Absent ⇒ the full list, exactly as before.
|
|
268
|
+
*/
|
|
269
|
+
compact?: boolean;
|
|
128
270
|
}
|
|
129
271
|
/**
|
|
130
272
|
* Filter-builder / view operator → filter-AST operator.
|
|
@@ -211,10 +353,13 @@ export declare function resolveAddRecordPlacement(position: unknown): {
|
|
|
211
353
|
* `defaultCalendarFromObject` helper it uses for calendars. What was missing is
|
|
212
354
|
* that one of the two read-sites never honoured the promise the other made.
|
|
213
355
|
*
|
|
214
|
-
* Both nestings are read at each level
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
356
|
+
* Both nestings are read at each level: the spec-authored `schema.timeline` /
|
|
357
|
+
* `schema.calendar` and the legacy `schema.options.*` twin that app-shell's
|
|
358
|
+
* object pages still emit. Each by its spec key only. The pre-#2231 `dateField`
|
|
359
|
+
* alias for `startDateField` had a rung here until objectui#6152 round 14
|
|
360
|
+
* retired it: every list-view door refuses it by name on all four blocks, and
|
|
361
|
+
* the calendar branch already ignored it (objectui#8355), so one stored row
|
|
362
|
+
* could draw a Timeline on a key its Calendar dropped.
|
|
218
363
|
*
|
|
219
364
|
* Exported for the regression suite, which pins each authoring shape.
|
|
220
365
|
*/
|
|
@@ -247,11 +392,12 @@ export declare function normalizeFilters(filters: any[]): any[];
|
|
|
247
392
|
* record. An earlier version of this comment called that unreachable, on the
|
|
248
393
|
* grounds that nothing in the repo hands a list view an object filter. That was
|
|
249
394
|
* wrong: `ObjectView` passes `mergedFilters` straight into this schema's
|
|
250
|
-
* `filter`, and its last fallback
|
|
251
|
-
* `Record<string, any
|
|
395
|
+
* `filter`, and its last fallback was `table.defaultFilters`, declared
|
|
396
|
+
* `Record<string, any>` (retired since objectui#12030; `table.filter` takes
|
|
397
|
+
* the same object). `toFilterNode` now converts it instead.
|
|
252
398
|
*/
|
|
253
|
-
export declare function buildEffectiveFilter(baseFilter: unknown, currentFilters:
|
|
254
|
-
export declare function convertFilterGroupToAST(group:
|
|
399
|
+
export declare function buildEffectiveFilter(baseFilter: unknown, currentFilters: FilterBuilderRowGroup, userFilterConditions: any[]): any[] | Record<string, any> | undefined;
|
|
400
|
+
export declare function convertFilterGroupToAST(group: FilterBuilderRowGroup): any[];
|
|
255
401
|
/**
|
|
256
402
|
* Evaluate conditional formatting rules against a record.
|
|
257
403
|
* Returns a CSSProperties object for the first matching rule, or empty object.
|
|
@@ -273,6 +419,51 @@ export declare function convertFilterGroupToAST(group: FilterGroup): any[];
|
|
|
273
419
|
*/
|
|
274
420
|
export declare function evaluateConditionalFormatting(record: Record<string, unknown>, rules?: ListViewSchema['conditionalFormatting'], scope?: Record<string, unknown>, fields?: unknown): React.CSSProperties;
|
|
275
421
|
export declare const LIST_DEFAULT_TRANSLATIONS: Record<string, string>;
|
|
422
|
+
/**
|
|
423
|
+
* Safe wrapper for useObjectTranslation that falls back to English defaults
|
|
424
|
+
* when I18nProvider is not available (e.g., standalone usage outside console).
|
|
425
|
+
*
|
|
426
|
+
* Delegates to `@object-ui/i18n`'s `createSafeTranslation`. The local copy
|
|
427
|
+
* this replaced wrapped the hook in try/catch — the very thing the comment on
|
|
428
|
+
* `useListViewObjectLabel` below warns against (objectui#2879).
|
|
429
|
+
*
|
|
430
|
+
* Exported for this package's `ObjectGallery` only (objectui#12217), which
|
|
431
|
+
* draws `ListEmptyState`'s `list.*` copy when no `ListView` is around it; the
|
|
432
|
+
* package barrel does not re-export it.
|
|
433
|
+
*/
|
|
434
|
+
export declare const useListViewTranslation: () => {
|
|
435
|
+
t: (key: string, options?: Record<string, unknown>) => string;
|
|
436
|
+
language: string;
|
|
437
|
+
} | {
|
|
438
|
+
t: import('i18next').TFunction<string, undefined>;
|
|
439
|
+
language: string;
|
|
440
|
+
};
|
|
441
|
+
/**
|
|
442
|
+
* The `$top` of the ONE unpaged fetch a list view makes when no usable page
|
|
443
|
+
* size is declared: every view this component does not page on the server
|
|
444
|
+
* (`paginate` is false), which is every kind but the flat grid, plus a grouped
|
|
445
|
+
* grid's window. Those views have no pager, so rows past this number are not
|
|
446
|
+
* reachable at all (`dataLimitReached` says so).
|
|
447
|
+
*
|
|
448
|
+
* A fetch batch, ⛔ not a page size (objectui#9853, ruling 5824040487,
|
|
449
|
+
* structure B): its value is kept, and it does not follow the display default,
|
|
450
|
+
* so no view silently loses reachable records when the protocol's page size
|
|
451
|
+
* moves. A DECLARED `pagination.pageSize` still sizes this fetch on every
|
|
452
|
+
* view but a windowed calendar; only the undeclared fallback is split by kind.
|
|
453
|
+
* A calendar with a start date bound walks its visible days in steps of this
|
|
454
|
+
* batch whatever page size is declared, so a declared size no longer sizes its
|
|
455
|
+
* fetch (`calendarWindowed`, objectui#12081).
|
|
456
|
+
*
|
|
457
|
+
* Exported for pins that assert "the fetch batch" rather than its value
|
|
458
|
+
* (objectui#9853, ruling record 5909000462); the package index does not
|
|
459
|
+
* re-export it.
|
|
460
|
+
*/
|
|
461
|
+
export declare const DEFAULT_LIST_FETCH_BATCH_SIZE = 100;
|
|
462
|
+
/**
|
|
463
|
+
* How many of the view's columns a card carries when the kanban block names
|
|
464
|
+
* no card fields of its own (objectui#12619).
|
|
465
|
+
*/
|
|
466
|
+
export declare const KANBAN_VIEW_CARD_FIELD_COUNT = 2;
|
|
276
467
|
/**
|
|
277
468
|
* Imperative handle exposed by ListView via React.forwardRef.
|
|
278
469
|
* Allows parent components to trigger a data refresh programmatically.
|
package/dist/ListView.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListView.d.ts","sourceRoot":"","sources":["../src/ListView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,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ViewBlock.d.ts","sourceRoot":"","sources":["../src/ListViewBlock.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ListViewBlock.d.ts","sourceRoot":"","sources":["../src/ListViewBlock.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAqB,MAAM,OAAO,CAAC;AAc1C,OAAO,EAAY,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,YAAY,CAAC;AAyN/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AACH,QAAA,MAAM,aAAa,sFA0GhB,CAAC;AAGJ,OAAO,EAAE,aAAa,EAAE,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ObjectUI
|
|
3
|
+
* Copyright (c) 2024-present ObjectStack Inc.
|
|
4
|
+
*
|
|
5
|
+
* This source code is licensed under the MIT license found in the
|
|
6
|
+
* LICENSE file in the root directory of this source tree.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The compact posture of a list block (objectui#12703): what `ListView` draws
|
|
10
|
+
* in place of its toolbar, its grid and its record-count bar when the page
|
|
11
|
+
* region it sits in is narrower than half the page.
|
|
12
|
+
*
|
|
13
|
+
* A short list, not a small grid: a header with the list's title and its
|
|
14
|
+
* record count, then one row per record whose first line is the view's first
|
|
15
|
+
* visible column and whose muted second line is its second. No toolbar, no
|
|
16
|
+
* view tabs, no row-number column, no pager — those belong to the object
|
|
17
|
+
* list, and a rail beside `main` has no room for them.
|
|
18
|
+
*
|
|
19
|
+
* Values render through the shared cell renderers (`getCellRenderer`), so a
|
|
20
|
+
* date, a picklist label or a related record reads the way the grid and the
|
|
21
|
+
* gallery draw it. ⛔ No second formatter lives here.
|
|
22
|
+
*
|
|
23
|
+
* Under the rows, a "View all" link to the rest (objectui#12703 part 2): drawn
|
|
24
|
+
* only when the block hands a destination through
|
|
25
|
+
* {@link CompactListDestinationContext}, which it builds from the host's
|
|
26
|
+
* `listHref` / `openList`. A host without that seam draws no link.
|
|
27
|
+
*/
|
|
28
|
+
import * as React from 'react';
|
|
29
|
+
/**
|
|
30
|
+
* Where the compact list's "View all" link goes: a document href and the SPA
|
|
31
|
+
* open that reaches the same place. The page block builds it from the host's
|
|
32
|
+
* `listHref` / `openList` (`RelatedRecordActionsValue`) and the object and saved
|
|
33
|
+
* view it is bound to; `null` (the default) draws no link.
|
|
34
|
+
*
|
|
35
|
+
* A context rather than a `ListView` prop because the destination is the
|
|
36
|
+
* block's, not the list's: only the page block knows its binding, and the
|
|
37
|
+
* object list page, which never draws the compact posture, has none.
|
|
38
|
+
* Package-internal, like this module.
|
|
39
|
+
*/
|
|
40
|
+
export interface CompactListDestination {
|
|
41
|
+
href: string;
|
|
42
|
+
/** SPA navigation to `href`; absent, the anchor navigates on its own. */
|
|
43
|
+
open?: () => void;
|
|
44
|
+
}
|
|
45
|
+
export declare const CompactListDestinationContext: React.Context<CompactListDestination | null>;
|
|
46
|
+
/** The compact list's footer: a real link to the rest of the list. */
|
|
47
|
+
export declare function ListViewCompactFooter({ destination }: {
|
|
48
|
+
destination: CompactListDestination;
|
|
49
|
+
}): React.JSX.Element;
|
|
50
|
+
/** The two columns a compact row draws: the view's first two visible ones. */
|
|
51
|
+
export declare function compactRowColumns(fields: readonly unknown[]): {
|
|
52
|
+
primary?: string;
|
|
53
|
+
secondary?: string;
|
|
54
|
+
};
|
|
55
|
+
export interface ListViewCompactHeaderProps {
|
|
56
|
+
title?: string;
|
|
57
|
+
/** The record count to show, or `null` while it is not known. */
|
|
58
|
+
count: number | null;
|
|
59
|
+
/** The count as a sentence, the badge's accessible name (`list.recordCount`). */
|
|
60
|
+
countLabel?: string;
|
|
61
|
+
}
|
|
62
|
+
/** The compact list's header: its title and its record count. */
|
|
63
|
+
export declare function ListViewCompactHeader({ title, count, countLabel }: ListViewCompactHeaderProps): React.JSX.Element | null;
|
|
64
|
+
export interface ListViewCompactRowsProps {
|
|
65
|
+
rows: readonly Record<string, unknown>[];
|
|
66
|
+
/** The view's visible columns, in order (`ListView`'s `effectiveFields`). */
|
|
67
|
+
fields: readonly unknown[];
|
|
68
|
+
objectName?: string;
|
|
69
|
+
/** The object's metadata, for the field types the cells format by. */
|
|
70
|
+
objectDef?: {
|
|
71
|
+
fields?: Record<string, Record<string, unknown>>;
|
|
72
|
+
} | null;
|
|
73
|
+
onRowClick?: (record: Record<string, unknown>) => void;
|
|
74
|
+
}
|
|
75
|
+
/** The compact list's rows: the first visible column over the second, muted. */
|
|
76
|
+
export declare function ListViewCompactRows({ rows, fields, objectName, objectDef, onRowClick }: ListViewCompactRowsProps): React.JSX.Element;
|
|
77
|
+
//# sourceMappingURL=ListViewCompact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ListViewCompact.d.ts","sourceRoot":"","sources":["../src/ListViewCompact.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAO/B;;;;;;;;;;GAUG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,yEAAyE;IACzE,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,eAAO,MAAM,6BAA6B,8CAA2D,CAAC;AAEtG,sEAAsE;AACtE,wBAAgB,qBAAqB,CAAC,EAAE,WAAW,EAAE,EAAE;IAAE,WAAW,EAAE,sBAAsB,CAAA;CAAE,qBAyB7F;AAED,8EAA8E;AAC9E,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAKtG;AAED,MAAM,WAAW,0BAA0B;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iEAAiE;IACjE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,iFAAiF;IACjF,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,iEAAiE;AACjE,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,0BAA0B,4BAsB7F;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACzC,6EAA6E;IAC7E,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sEAAsE;IACtE,SAAS,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC;IACxE,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACxD;AAED,gFAAgF;AAChF,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,wBAAwB,qBA6EhH"}
|
package/dist/ObjectGallery.d.ts
CHANGED
|
@@ -1,29 +1,41 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { DataSource, ObjectGallerySchema } from '@object-ui/types';
|
|
3
3
|
export interface ObjectGalleryProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
gallery?: GalleryConfig;
|
|
11
|
-
/** Navigation config for item click behavior */
|
|
12
|
-
navigation?: ViewNavigationConfig;
|
|
13
|
-
/** Grouping configuration for sectioned display */
|
|
14
|
-
grouping?: GroupingConfig;
|
|
15
|
-
/** @deprecated Use gallery.coverField instead */
|
|
16
|
-
imageField?: string;
|
|
17
|
-
/** @deprecated Use gallery.titleField instead */
|
|
18
|
-
titleField?: string;
|
|
19
|
-
};
|
|
4
|
+
/**
|
|
5
|
+
* The `object-gallery` node — anchored to the exported schema type
|
|
6
|
+
* (objectui#6576). Every `BaseSchema` member is writable, `bind` and
|
|
7
|
+
* `className` included; the widget's own keys are declared there.
|
|
8
|
+
*/
|
|
9
|
+
schema: ObjectGallerySchema;
|
|
20
10
|
data?: Record<string, unknown>[];
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The host's adapter. Declared as the published `DataSource` contract
|
|
13
|
+
* (objectui#7912) — this used to be a hand-rolled `{ find(name, query:
|
|
14
|
+
* unknown): Promise<unknown> }` stand-in, which is a second, weaker
|
|
15
|
+
* spelling of a type this repo already publishes: it accepted any object
|
|
16
|
+
* with a `find`, and it erased `find`'s real parameter and return types at
|
|
17
|
+
* every call below.
|
|
18
|
+
*/
|
|
19
|
+
dataSource?: DataSource;
|
|
20
|
+
/** The other arm of the same `??` that feeds the hook — see `onRowClick` below (objectui#9357). */
|
|
21
|
+
onCardClick?: (record: Record<string, unknown>, event?: any) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Callback when a row/item is clicked (overrides NavigationConfig).
|
|
24
|
+
*
|
|
25
|
+
* TWO parameters since objectui#9357, and the second is not decoration: this
|
|
26
|
+
* prop reaches `useNavigationOverlay` as its `onRowClick`, and `handleClick`
|
|
27
|
+
* invokes it as `onRowClick(record, event)` — the modifier payload a host
|
|
28
|
+
* needs to implement Cmd/Ctrl/middle-click for itself. Declaring one
|
|
29
|
+
* parameter hid the second on the ONE line a host reads. Spelled `any` and
|
|
30
|
+
* not `HandleClickModifiers` for the reason objectui#9341 measured on
|
|
31
|
+
* `ObjectKanbanSchema.onCardClick`: that interface lives in
|
|
32
|
+
* `@object-ui/react`, the published twins in `@object-ui/types` may not name
|
|
33
|
+
* it, and a host that discovered the payload from the implementation
|
|
34
|
+
* annotated it `React.MouseEvent` — which a narrower declaration refuses
|
|
35
|
+
* contravariantly. `BaseSchema`'s own `onClick` / `onChange` / `onSubmit`
|
|
36
|
+
* already use this spelling for exactly this situation.
|
|
37
|
+
*/
|
|
38
|
+
onRowClick?: (record: Record<string, unknown>, event?: any) => void;
|
|
27
39
|
}
|
|
28
40
|
export declare const ObjectGallery: React.FC<ObjectGalleryProps>;
|
|
29
41
|
//# sourceMappingURL=ObjectGallery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectGallery.d.ts","sourceRoot":"","sources":["../src/ObjectGallery.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAgE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ObjectGallery.d.ts","sourceRoot":"","sources":["../src/ObjectGallery.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAgE,MAAM,OAAO,CAAC;AAKrF,OAAO,KAAK,EAAE,UAAU,EAAiB,mBAAmB,EAAe,MAAM,kBAAkB,CAAC;AAOpG,MAAM,WAAW,kBAAkB;IAC/B;;;;OAIG;IACH,MAAM,EAAE,mBAAmB,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACjC;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,mGAAmG;IACnG,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;IACrE;;;;;;;;;;;;;;;OAeG;IACH,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CACvE;AA2LD,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAkpBtD,CAAC"}
|
package/dist/UserFilters.d.ts
CHANGED
|
@@ -28,6 +28,19 @@ export interface UserFiltersProps {
|
|
|
28
28
|
config: NonNullable<ListViewSchema['userFilters']>;
|
|
29
29
|
/** Object definition for auto-deriving field options */
|
|
30
30
|
objectDef?: any;
|
|
31
|
+
/**
|
|
32
|
+
* True while the host is still fetching `objectDef` (objectui#12890).
|
|
33
|
+
*
|
|
34
|
+
* An unlabelled chip takes its label from the definition, so until it
|
|
35
|
+
* arrives the only name the chip has is the machine key (`category`), which
|
|
36
|
+
* a viewer reads as the field's name and then sees replaced by the real one
|
|
37
|
+
* (`分类`). While pending, such a chip draws a skeleton instead of the key.
|
|
38
|
+
* An authored `label` is drawn either way. Once the host settles the fetch
|
|
39
|
+
* this is false, and a field the settled definition does not name falls back
|
|
40
|
+
* to the key exactly as before. Omitted means settled: a host that passes no
|
|
41
|
+
* definition at all keeps drawing the key.
|
|
42
|
+
*/
|
|
43
|
+
objectDefPending?: boolean;
|
|
31
44
|
/** Current data for computing counts */
|
|
32
45
|
data?: any[];
|
|
33
46
|
/** Callback when filter state changes */
|
|
@@ -56,5 +69,5 @@ export interface UserFiltersProps {
|
|
|
56
69
|
* - **tabs**: named filter preset tab bar
|
|
57
70
|
* - **toggle**: on/off toggle buttons per field
|
|
58
71
|
*/
|
|
59
|
-
export declare function UserFilters({ config, objectDef, data, onFilterChange, maxVisible, className, initialSelections, onSelectionsChange, }: UserFiltersProps): React.JSX.Element | null;
|
|
72
|
+
export declare function UserFilters({ config, objectDef, objectDefPending, data, onFilterChange, maxVisible, className, initialSelections, onSelectionsChange, }: UserFiltersProps): React.JSX.Element | null;
|
|
60
73
|
//# sourceMappingURL=UserFilters.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserFilters.d.ts","sourceRoot":"","sources":["../src/UserFilters.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"UserFilters.d.ts","sourceRoot":"","sources":["../src/UserFilters.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAmIvD;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,GAAG,cAAc,GAAG,OAAO,GAAG,MAAM,CAMpG,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,WAAW,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IACnD,wDAAwD;IACxD,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,wCAAwC;IACxC,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb,yCAAyC;IACzC,cAAc,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,IAAI,CAAC;IACzC,gGAAgG;IAChG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IACrE;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC;CAC7F;AA6ED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,EAC1B,MAAM,EACN,SAAS,EACT,gBAAwB,EACxB,IAAS,EACT,cAAc,EACd,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,kBAAkB,GACnB,EAAE,gBAAgB,4BAiDlB"}
|
package/dist/ViewSwitcher.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ListViewVisualization } from '@object-ui/core';
|
|
1
2
|
/**
|
|
2
3
|
* ObjectUI
|
|
3
4
|
* Copyright (c) 2024-present ObjectStack Inc.
|
|
@@ -6,11 +7,40 @@
|
|
|
6
7
|
* LICENSE file in the root directory of this source tree.
|
|
7
8
|
*/
|
|
8
9
|
import * as React from 'react';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
/**
|
|
11
|
+
* The visualizations this switcher offers are `@object-ui/core`'s
|
|
12
|
+
* {@link ListViewVisualization} (`ca3942729`), which derives from
|
|
13
|
+
* `@objectstack/spec/ui` through `@object-ui/types`' `ViewType`.
|
|
14
|
+
*
|
|
15
|
+
* A nine-arm union was once written out by hand here, and that was a THIRD
|
|
16
|
+
* re-declaration of one vocabulary — the card behind `ca3942729` was filed against the two in
|
|
17
|
+
* `@object-ui/types`, and the maps below were described there as total over the
|
|
18
|
+
* shared union when they were in fact total over this private copy. A map that
|
|
19
|
+
* is total over a copy is exactly as incomplete as the copy, so the two
|
|
20
|
+
* `Record<ListViewVisualization, …>` below are honest guards only because they
|
|
21
|
+
* key on the derived union: the next visualization the spec adds fails the
|
|
22
|
+
* build in both of them.
|
|
23
|
+
*
|
|
24
|
+
* Spelled by that name, not re-exported as `ViewType`. This module used to
|
|
25
|
+
* publish an alias `ViewType = ListViewVisualization`, a second meaning behind
|
|
26
|
+
* the name `@object-ui/types` gives the whole view-type vocabulary — the alias
|
|
27
|
+
* lacked its `list` and `detail` arms (objectui#6349, batch 7). `page` is
|
|
28
|
+
* deliberately NOT a visualization: the spec models it as a list view that
|
|
29
|
+
* mounts a published page rather than one a user switches into, and
|
|
30
|
+
* `AppearanceConfig.allowedVisualizations` excludes it for the same reason.
|
|
31
|
+
*
|
|
32
|
+
* The props are named `ListViewSwitcherProps`, not `ViewSwitcherProps`, for the
|
|
33
|
+
* same reason. `@object-ui/plugin-view` publishes `ViewSwitcherProps` for a
|
|
34
|
+
* different switcher: the `view-switcher` renderer, which takes a
|
|
35
|
+
* `ViewSwitcherSchema` and the host callbacks and is keyed on the whole
|
|
36
|
+
* `ViewType`. Neither package depends on the other, so the two could not share
|
|
37
|
+
* one declaration. The general name stays with the schema-driven renderer, and
|
|
38
|
+
* this list view's switcher has the specific one (objectui#6349, batch 8).
|
|
39
|
+
*/
|
|
40
|
+
export interface ListViewSwitcherProps {
|
|
41
|
+
currentView: ListViewVisualization;
|
|
42
|
+
availableViews?: ListViewVisualization[];
|
|
43
|
+
onViewChange: (view: ListViewVisualization) => void;
|
|
14
44
|
className?: string;
|
|
15
45
|
/** Enable animated transitions between views (default: true) */
|
|
16
46
|
animated?: boolean;
|
|
@@ -21,6 +51,6 @@ export interface ViewSwitcherProps {
|
|
|
21
51
|
* menu of the available visualizations. Replaces the full button row so
|
|
22
52
|
* the toolbar stays one line tall.
|
|
23
53
|
*/
|
|
24
|
-
export declare const ViewSwitcherDropdown: React.FC<
|
|
25
|
-
export declare const ViewSwitcher: React.FC<
|
|
54
|
+
export declare const ViewSwitcherDropdown: React.FC<ListViewSwitcherProps>;
|
|
55
|
+
export declare const ViewSwitcher: React.FC<ListViewSwitcherProps>;
|
|
26
56
|
//# sourceMappingURL=ViewSwitcher.d.ts.map
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"ViewSwitcher.d.ts","sourceRoot":"","sources":["../src/ViewSwitcher.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAe7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,qBAAqB,CAAC;IACnC,cAAc,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACzC,YAAY,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AA0GD;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CA0GhE,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAwDxD,CAAC"}
|