@object-ui/plugin-detail 17.3.0 → 17.6.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 +1115 -0
- package/README.md +61 -17
- package/dist/DetailSection.d.ts.map +1 -1
- package/dist/DetailView.d.ts.map +1 -1
- package/dist/HeaderHighlight.d.ts.map +1 -1
- package/dist/HistoryTimeline.d.ts.map +1 -1
- package/dist/InlineFieldInput.d.ts +78 -5
- package/dist/InlineFieldInput.d.ts.map +1 -1
- package/dist/RelatedList.d.ts +42 -1
- package/dist/RelatedList.d.ts.map +1 -1
- package/dist/autoLayout.d.ts.map +1 -1
- package/dist/fieldEnrichment.d.ts +61 -0
- package/dist/fieldEnrichment.d.ts.map +1 -1
- package/dist/index.d.ts +88 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2676 -2503
- package/dist/index.umd.cjs +3 -3
- package/dist/renderers/record-alert.d.ts +61 -11
- package/dist/renderers/record-alert.d.ts.map +1 -1
- package/dist/renderers/record-details.d.ts.map +1 -1
- package/dist/renderers/record-path.d.ts.map +1 -1
- package/dist/renderers/record-quick-actions.d.ts +7 -0
- package/dist/renderers/record-quick-actions.d.ts.map +1 -1
- package/dist/renderers/record-reference-rail.d.ts +2 -17
- package/dist/renderers/record-reference-rail.d.ts.map +1 -1
- package/dist/renderers/record-related-list.d.ts +29 -1
- package/dist/renderers/record-related-list.d.ts.map +1 -1
- package/dist/renderers/recordActivityFeed.d.ts +95 -8
- package/dist/renderers/recordActivityFeed.d.ts.map +1 -1
- package/dist/synth/buildDefaultPageSchema.d.ts +21 -9
- package/dist/synth/buildDefaultPageSchema.d.ts.map +1 -1
- package/dist/useDetailTranslation.d.ts +7 -0
- package/dist/useDetailTranslation.d.ts.map +1 -1
- package/dist/useRecordEditable.d.ts.map +1 -1
- package/package.json +20 -18
package/README.md
CHANGED
|
@@ -22,6 +22,36 @@ pnpm add @object-ui/plugin-detail
|
|
|
22
22
|
|
|
23
23
|
## Usage
|
|
24
24
|
|
|
25
|
+
### Two ways to reach a data source
|
|
26
|
+
|
|
27
|
+
`detail-view` needs a data source to load a record, and there are two ways to
|
|
28
|
+
give it one. They are equivalent, and an explicit prop wins when both are
|
|
29
|
+
present:
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { SchemaRenderer, SchemaRendererProvider } from '@object-ui/react';
|
|
33
|
+
|
|
34
|
+
// 1. Injected by an ancestor — the pattern the rest of the family uses, and the
|
|
35
|
+
// one to reach for when a page renders several data-bound blocks.
|
|
36
|
+
<SchemaRendererProvider dataSource={dataSource}>
|
|
37
|
+
<SchemaRenderer schema={{ type: 'detail-view', objectName: 'account', resourceId: '42' }} />
|
|
38
|
+
</SchemaRendererProvider>
|
|
39
|
+
|
|
40
|
+
// 2. Handed to one placement — what `<DetailView dataSource={…} />` has always
|
|
41
|
+
// taken, and what the examples below use.
|
|
42
|
+
<DetailView schema={{ type: 'detail-view', objectName: 'account', resourceId: '42' }} dataSource={dataSource} />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Route 1 is new as of objectui#5378: this block used to read the adapter from its
|
|
46
|
+
prop ONLY, while its siblings `object-grid` and `object-form` read it from
|
|
47
|
+
context only, so a page could satisfy one of them or the other and never both.
|
|
48
|
+
Nothing that worked before changed — route 2 is unaffected — and a block that
|
|
49
|
+
resolves neither now renders a **No data source resolved** panel naming itself
|
|
50
|
+
and the object it was about to read, instead of an empty shell.
|
|
51
|
+
|
|
52
|
+
Note the record id is `resourceId` here. `object-form`'s is `recordId`; the two
|
|
53
|
+
blocks do not share that key.
|
|
54
|
+
|
|
25
55
|
### Basic Example
|
|
26
56
|
|
|
27
57
|
```tsx
|
|
@@ -202,17 +232,42 @@ reads the collection size from `QueryResult.total` (falling back to a
|
|
|
202
232
|
`hasMore` estimate), so large child tables never ship wholesale to the
|
|
203
233
|
browser. A user column sort becomes a server `$orderby` (ordering stays
|
|
204
234
|
global across pages), and the node's `sort` prop seeds the initial order.
|
|
205
|
-
Because that `$orderby` names a flat field,
|
|
206
|
-
(`lookup` / `master_detail` / `user` / `tree`)
|
|
207
|
-
stored foreign-key id while its cells show
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
235
|
+
Because that `$orderby` names a flat field, two kinds of column cannot survive
|
|
236
|
+
the trip. A **relational column** (`lookup` / `master_detail` / `user` / `tree`)
|
|
237
|
+
would order the collection by the stored foreign-key id while its cells show
|
|
238
|
+
related-record names (`objectui#3096`); a **`formula` column** has no
|
|
239
|
+
materialized column to order by at all — silently unordered rows under a `200`
|
|
240
|
+
before `objectstack#6994`, a `400 INVALID_SORT` after it (`objectui#3950`). So on
|
|
241
|
+
the windowed path neither offers a sort affordance, at either of this card's two
|
|
242
|
+
sort entry points: the embedded table's column headers, and the button row a
|
|
243
|
+
`list` card keeps because it has no headers. In client mode the sort key is the
|
|
244
|
+
value the cell shows — the label this list already resolved, the formula result
|
|
245
|
+
the server hydrated — so the affordance stays and orders by that.
|
|
211
246
|
Passing `data` directly keeps the historical client-side slicing, and typing
|
|
212
247
|
in the opt-in filter box temporarily falls back to the full-fetch client
|
|
213
248
|
pipeline (the contains-filter sweeps every field, which no generic server
|
|
214
249
|
filter can express).
|
|
215
250
|
|
|
251
|
+
The node's `filter` (spec `RecordRelatedListProps.filter`, "additional filter
|
|
252
|
+
criteria") narrows the list beyond the parent relationship: it is
|
|
253
|
+
**AND-combined** with `{ [relationshipField]: parentId }`, never substituted for
|
|
254
|
+
it, so a related list stays scoped to the record it appears on and an additional
|
|
255
|
+
criterion can only ever narrow that set. Authors write it in the spec's own
|
|
256
|
+
vocabulary (`[{ field, operator, value }]`); a `dataSource` binding's composed
|
|
257
|
+
filter (component AND saved view AND binding) lands on the same key. Both are
|
|
258
|
+
lowered to ObjectQL through the repo's single filter sink, so no second dialect
|
|
259
|
+
appears. On the legacy raw-URL fallback path (no `dataSource` adapter, where the
|
|
260
|
+
query language is `filter[<field>]=<value>` and cannot carry an operator) a
|
|
261
|
+
declared filter is refused with a console explanation rather than dropped —
|
|
262
|
+
answering with more rows than the metadata asked for is the failure this key's
|
|
263
|
+
wiring exists to remove.
|
|
264
|
+
|
|
265
|
+
The **Add** affordance renders only where every link in its chain is available:
|
|
266
|
+
a spec-valid `add.picker.object` *and* a `dataSource`. The picker dialog and the
|
|
267
|
+
add callback both required the adapter already, so without it the button used to
|
|
268
|
+
render and do nothing at all when clicked — visible in hosts that supply no
|
|
269
|
+
`RecordContext` (Studio designer previews, context-free embeds).
|
|
270
|
+
|
|
216
271
|
The `record:related_list` renderer is automatically gated on the current
|
|
217
272
|
user's object-level `read` permission for the child object: when the
|
|
218
273
|
permission system (`@object-ui/permissions`) is loaded and denies read,
|
|
@@ -240,17 +295,6 @@ shared draft (`InlineEditProvider` from `@object-ui/react`), committed by
|
|
|
240
295
|
gate `InlineEditProvider.canEdit` when the record is approval-locked, so a
|
|
241
296
|
locked record hides its edit affordances instead of rejecting at Save.
|
|
242
297
|
|
|
243
|
-
<!-- release-metadata:v3.3.0 -->
|
|
244
|
-
|
|
245
|
-
## Compatibility
|
|
246
|
-
|
|
247
|
-
- **React:** 18.x or 19.x
|
|
248
|
-
- **Node.js:** ≥ 18
|
|
249
|
-
- **TypeScript:** ≥ 5.0 (strict mode)
|
|
250
|
-
- **`@objectstack/spec`:** ^3.3.0
|
|
251
|
-
- **`@objectstack/client`:** ^3.3.0
|
|
252
|
-
- **Tailwind CSS:** ≥ 3.4 (for packages with UI)
|
|
253
|
-
|
|
254
298
|
## Links
|
|
255
299
|
|
|
256
300
|
- 📚 [Documentation](https://www.objectui.org/docs/plugins/plugin-detail)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailSection.d.ts","sourceRoot":"","sources":["../src/DetailSection.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAqB/B,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAkC,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K,CAAC,EAAE,CAAC,kBAAkB,CA4btD,CAAC"}
|
package/dist/DetailView.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DetailView.d.ts","sourceRoot":"","sources":["../src/DetailView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA0C/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAA4B,MAAM,kBAAkB,CAAC;AAwF/F,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"DetailView.d.ts","sourceRoot":"","sources":["../src/DetailView.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA0C/B,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAA4B,MAAM,kBAAkB,CAAC;AAwF/F,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,gBAAgB,CAAC;IACzB,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,cAAc,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACjC;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACrC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,gBAAgB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAq/ChD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderHighlight.d.ts","sourceRoot":"","sources":["../src/HeaderHighlight.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"HeaderHighlight.d.ts","sourceRoot":"","sources":["../src/HeaderHighlight.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B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,EAAE,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,8FAA8F;IAC9F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAkFD,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,OAAO,EACP,SAAS,EACT,eAAe,EACf,SAAS,EACT,MAAM,GACP,EAAE,oBAAoB,qBAsHtB"}
|
|
@@ -18,6 +18,77 @@ import * as React from 'react';
|
|
|
18
18
|
* the package's public name unchanged.
|
|
19
19
|
*/
|
|
20
20
|
export { TEXTUAL_REF_FALLBACK_TYPES };
|
|
21
|
+
/**
|
|
22
|
+
* Test id on the terminal raw text input at the end of this component.
|
|
23
|
+
*
|
|
24
|
+
* The one editor in here that is lossy by construction — it displays through
|
|
25
|
+
* `coerceToSafeValue` and emits a STRING — so "did this type reach the terminal
|
|
26
|
+
* input?" is the question the drift guard has to answer EXACTLY, in both
|
|
27
|
+
* directions. Sniffing `input[type="text"]` cannot: `TextField`, `ColorField`
|
|
28
|
+
* and `QRCodeField` render one too, so the heuristic reads a benign type's
|
|
29
|
+
* correct fallback and a delegated type's correct widget as the same thing.
|
|
30
|
+
*/
|
|
31
|
+
export declare const INLINE_PLAIN_TEXT_INPUT_TESTID = "inline-plain-text-input";
|
|
32
|
+
/**
|
|
33
|
+
* **Class D** — field types whose stored value is ALREADY a string, so the
|
|
34
|
+
* terminal input's stringification is the identity and nothing is lost
|
|
35
|
+
* (objectui#4220). These, and only these, keep that input.
|
|
36
|
+
*
|
|
37
|
+
* Enumerated rather than expressed as "everything the switch didn't match":
|
|
38
|
+
* an open tail is what let `tags`, `checkboxes`, `toggle`, `slider`, `radio`
|
|
39
|
+
* and friends land on a value-destroying editor in silence for six cards
|
|
40
|
+
* running. A new field type is now a RED drift guard until someone decides
|
|
41
|
+
* which of the four buckets it belongs in — see
|
|
42
|
+
* `__tests__/inlineEditTypeCoverage.test.tsx`.
|
|
43
|
+
*
|
|
44
|
+
* `select` is deliberately absent: it has a routed branch (the picklist), and
|
|
45
|
+
* only its degenerate options-less SINGLE-value form reaches the terminal
|
|
46
|
+
* input — see {@link usesInlinePlainTextInput}. `markdown` / `html` /
|
|
47
|
+
* `richtext` are absent because the hosts never open an editor for them at all
|
|
48
|
+
* (they are in the fields package's shared exclusion, consulted since #4228).
|
|
49
|
+
*/
|
|
50
|
+
export declare const INLINE_PLAIN_TEXT_FIELD_TYPES: Set<string>;
|
|
51
|
+
/**
|
|
52
|
+
* The type switch's own manifest: every type this component routes to a
|
|
53
|
+
* dedicated editor before the delegation below is reached.
|
|
54
|
+
*
|
|
55
|
+
* Declared next to the switch so the four-way classification is readable in
|
|
56
|
+
* ONE place, and pinned by rendering — the drift guard asserts each member
|
|
57
|
+
* really produces something other than the terminal input, so an entry that
|
|
58
|
+
* outlives its branch fails rather than quietly re-opening the plain-text path
|
|
59
|
+
* (the discipline #4228 established for `DETAIL_ROUTED_INLINE_TYPES`).
|
|
60
|
+
*
|
|
61
|
+
* `select` / `multiselect` are routed only WITH options; the options-less
|
|
62
|
+
* spellings are covered by {@link usesInlinePlainTextInput} (single, a bare
|
|
63
|
+
* string) and by the delegation (multi-value, an array). Both are pinned by
|
|
64
|
+
* name in the guard.
|
|
65
|
+
*/
|
|
66
|
+
export declare const INLINE_ROUTED_FIELD_TYPES: Set<string>;
|
|
67
|
+
/**
|
|
68
|
+
* Is this a field type the form actually knows, rather than an unrecognized
|
|
69
|
+
* string?
|
|
70
|
+
*
|
|
71
|
+
* `mapFieldTypeToFormType` FALLS BACK to `field:text` for anything it has no
|
|
72
|
+
* entry for, which makes `hasFieldEditWidget()` answer `true` for every string
|
|
73
|
+
* on earth. Delegating on that answer alone would quietly hand a typo'd or
|
|
74
|
+
* private type (`decimal`, `integer` — deliberately not aliased, see the
|
|
75
|
+
* numeric branch) to `TextField` instead of leaving it on the documented
|
|
76
|
+
* fallback, and would let the drift guard's "delegated" bucket swallow a NEW
|
|
77
|
+
* spec type that nobody has decided about. Both are the recurrence this card
|
|
78
|
+
* exists to stop, so the alias fallback is not treated as a decision.
|
|
79
|
+
*/
|
|
80
|
+
export declare function isKnownFieldType(type: string | undefined): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Does this field edit in the terminal raw text input (class D)?
|
|
83
|
+
*
|
|
84
|
+
* The options-less SINGLE `select` is the one conditional member. Its stored
|
|
85
|
+
* value is a bare string, so the text input is lossless — while the fields
|
|
86
|
+
* package's own widget would render its "no options to offer" state, leaving
|
|
87
|
+
* the user unable to enter anything at all. The `multiple` spelling of the same
|
|
88
|
+
* degenerate field is NOT benign: its value is an array, so it delegates and
|
|
89
|
+
* keeps that array (class A).
|
|
90
|
+
*/
|
|
91
|
+
export declare function usesInlinePlainTextInput(field: Record<string, any>): boolean;
|
|
21
92
|
/**
|
|
22
93
|
* Extract the id a reference widget expects from a value that may already be
|
|
23
94
|
* an `$expand`-ed record object (`{ id, name, ... }`), an array of those, or a
|
|
@@ -48,11 +119,13 @@ export interface InlineFieldInputProps {
|
|
|
48
119
|
* `DetailSection` so any record-level surface — the details body AND the
|
|
49
120
|
* highlights strip (objectui#2407) — renders an identical editor. Covers every
|
|
50
121
|
* widget the detail body handles: `SelectField`, `BooleanField`, `LookupField`,
|
|
51
|
-
* `UserField`, `
|
|
52
|
-
*
|
|
53
|
-
* `
|
|
54
|
-
*
|
|
55
|
-
*
|
|
122
|
+
* `UserField`, the `permission-facet-link` read-only facet (#2403), the numeric
|
|
123
|
+
* widgets (`NumberField` / `CurrencyField` / `PercentField`, objectui#2572), the
|
|
124
|
+
* structured composites (`AddressField` / `LocationField` / `GeolocationField`,
|
|
125
|
+
* objectui#4216 — their value is an OBJECT, so the text fallback both displayed
|
|
126
|
+
* and WROTE it wrong), and the plain date/text input (with ISO date coercion +
|
|
127
|
+
* object-value guarding so an unexpanded reference never leaks
|
|
128
|
+
* "[object Object]").
|
|
56
129
|
*
|
|
57
130
|
* Editability GATING (computed types, `readonly`, system fields, object
|
|
58
131
|
* lifecycle) stays with the host — this component only renders the editor once
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InlineFieldInput.d.ts","sourceRoot":"","sources":["../src/InlineFieldInput.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"InlineFieldInput.d.ts","sourceRoot":"","sources":["../src/InlineFieldInput.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAyB/B,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAE/D;;;;;;;;;GASG;AACH,OAAO,EAAE,0BAA0B,EAAE,CAAC;AAEtC;;;;;;;;;GASG;AACH,eAAO,MAAM,8BAA8B,4BAA4B,CAAC;AAExE;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,6BAA6B,aAMxC,CAAC;AAEH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,yBAAyB,aAgCpC,CAAC;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAKlE;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAK5E;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQvD;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC3B,iFAAiF;IACjF,KAAK,EAAE,GAAG,CAAC;IACX,oEAAoE;IACpE,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,4EAA4E;IAC5E,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAmQ5D,CAAC"}
|
package/dist/RelatedList.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { RelatedRowActionDef } from '@object-ui/react';
|
|
2
2
|
import { DataSource } from '@object-ui/types';
|
|
3
|
+
import { ViewFilterRule } from '@objectstack/spec/ui';
|
|
4
|
+
import { FilterNode } from '@object-ui/core';
|
|
3
5
|
/**
|
|
4
6
|
* ObjectUI
|
|
5
7
|
* Copyright (c) 2024-present ObjectStack Inc.
|
|
@@ -21,6 +23,17 @@ export interface RelatedListProps {
|
|
|
21
23
|
objectName?: string;
|
|
22
24
|
/** Callback when "New" button is clicked */
|
|
23
25
|
onNew?: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* [#4646] Render "New" GREYED rather than clickable. Supplied by the host
|
|
28
|
+
* alongside `onNew` when the create affordance exists for this list but its
|
|
29
|
+
* `userActions.create.disabledWhen` predicate answers true for the record in
|
|
30
|
+
* scope (the parent record, on a record page's related list).
|
|
31
|
+
*
|
|
32
|
+
* Deliberately distinct from omitting `onNew` — which HIDES the button. Same
|
|
33
|
+
* hidden-vs-disabled split the row Edit/Delete predicates have had since
|
|
34
|
+
* objectui#2614.
|
|
35
|
+
*/
|
|
36
|
+
newDisabled?: boolean;
|
|
24
37
|
/** Callback when "View All" button is clicked */
|
|
25
38
|
onViewAll?: () => void;
|
|
26
39
|
/** Callback when a row Edit action is clicked */
|
|
@@ -35,13 +48,18 @@ export interface RelatedListProps {
|
|
|
35
48
|
* case), or — when `linkField` is omitted — re-parents the picked child by
|
|
36
49
|
* setting its `referenceField` to `parentId` (1:m case). Server-side rules on
|
|
37
50
|
* insert (e.g. the AI-seat cap) surface as an inline error.
|
|
51
|
+
*
|
|
52
|
+
* `picker.filter` restricts which records the dialog offers, and is typed as
|
|
53
|
+
* the spec's own `ViewFilterRule[]` rather than `any` (#3831): it goes to
|
|
54
|
+
* `RecordPickerDialog`'s `baseFilter` VERBATIM, so the authored vocabulary is
|
|
55
|
+
* the one enforced — a looser type here is where a wrong shape would hide.
|
|
38
56
|
*/
|
|
39
57
|
add?: {
|
|
40
58
|
picker: {
|
|
41
59
|
object: string;
|
|
42
60
|
valueField?: string;
|
|
43
61
|
labelField?: string;
|
|
44
|
-
filter?:
|
|
62
|
+
filter?: ViewFilterRule[];
|
|
45
63
|
};
|
|
46
64
|
linkField?: string;
|
|
47
65
|
label?: string;
|
|
@@ -89,6 +107,29 @@ export interface RelatedListProps {
|
|
|
89
107
|
* @default false
|
|
90
108
|
*/
|
|
91
109
|
sortable?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* The list's OWN scope filter — spec `RecordRelatedListProps.filter`
|
|
112
|
+
* ("Additional filter criteria for related records"), which had no read site
|
|
113
|
+
* on this component at all until objectstack#7118: the query was built from
|
|
114
|
+
* `{ [referenceField]: parentId }` alone, so an authored `filter` (and the
|
|
115
|
+
* FILTER half of a `dataSource` binding's saved view) was accepted by every
|
|
116
|
+
* gate and silently dropped — the list answered wider than the metadata asked.
|
|
117
|
+
*
|
|
118
|
+
* ANDed with the parent-relationship condition, never substituted for it:
|
|
119
|
+
* "additional" means it may only narrow this parent's children. That is also
|
|
120
|
+
* why it is not routed through `data-table`'s `lookupFilters` — those render
|
|
121
|
+
* as filter-bar rows the user can edit, which demotes the author's constraint
|
|
122
|
+
* to a suggestion (#3831 argued this for `add.picker.filter`; it holds harder
|
|
123
|
+
* for the list's own scope).
|
|
124
|
+
*
|
|
125
|
+
* Two shapes arrive, both produced by our own layers: the spec vocabulary
|
|
126
|
+
* (`ViewFilterRule[]`) as authored, and an ObjectQL AST node as composed by
|
|
127
|
+
* `ElementDataSourceGate` (which ANDs component/view/binding filters through
|
|
128
|
+
* `mergeFilterNodes` before this component ever sees them). Both are lowered
|
|
129
|
+
* here through that same single sink — the repo's one filter→wire exit — so no
|
|
130
|
+
* second conversion dialect appears.
|
|
131
|
+
*/
|
|
132
|
+
filter?: ViewFilterRule[] | FilterNode;
|
|
92
133
|
/** Enable text filtering */
|
|
93
134
|
filterable?: boolean;
|
|
94
135
|
/** Whether the card is collapsible */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelatedList.d.ts","sourceRoot":"","sources":["../src/RelatedList.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoB/B,OAAO,EAAkD,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAY5G,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"RelatedList.d.ts","sourceRoot":"","sources":["../src/RelatedList.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAoB/B,OAAO,EAAkD,KAAK,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAY5G,OAAO,KAAK,EAAE,UAAU,EAAiB,MAAM,kBAAkB,CAAC;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAWL,KAAK,UAAU,EAChB,MAAM,iBAAiB,CAAC;AAKzB,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;IAChC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;IAChB,SAA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EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"autoLayout.d.ts","sourceRoot":"","sources":["../src/autoLayout.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAoCxD;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAErD;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAmBtF;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,eAAe,EAAE,EACzB,OAAO,EAAE,MAAM,GACd,eAAe,EAAE,CAcnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,eAAe,EAAE,EACzB,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,cAAc,CAAC,EAAE,MAAM,GACtB;IAAE,MAAM,EAAE,eAAe,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAchD"}
|
|
@@ -17,6 +17,22 @@
|
|
|
17
17
|
* machine-computed is part of resolving a detail field's shape out of the view
|
|
18
18
|
* entry plus the object schema, not the private business of any one component.
|
|
19
19
|
* Re-exported from `InlineFieldInput` under its historical name.
|
|
20
|
+
*
|
|
21
|
+
* **Both spellings of the auto-number type are members** (objectui#4219).
|
|
22
|
+
* `@objectstack/spec` — and the designer, and the importer — spell it
|
|
23
|
+
* `autonumber`; `auto_number` is the widget map's key, and the alias table
|
|
24
|
+
* (`fields/src/field-type-alias.ts`) maps both onto `field:auto_number`. This
|
|
25
|
+
* set is matched by RAW spelling, so carrying one of them is carrying half the
|
|
26
|
+
* type: `plugin-form` lists both in each of its non-input sets, and this is the
|
|
27
|
+
* shape that was missing here. The gap was not academic — the reader that has
|
|
28
|
+
* no host gate in front of it is `InlineFieldInput`'s reference fallback
|
|
29
|
+
* (`!!field.reference_to && !TEXTUAL_REF_FALLBACK_TYPES.has(type)`), on
|
|
30
|
+
* exported public API, so a spec-spelled auto-number carrying a `reference_to`
|
|
31
|
+
* resolved into the RECORD PICKER — a list of records offered as replacements
|
|
32
|
+
* for a machine-generated identity. The editability half of the same report is
|
|
33
|
+
* held by the alias-aware shared exclusion since #4228; the two gates are a
|
|
34
|
+
* union, and matching spellings is what stops that union's survivability from
|
|
35
|
+
* depending on which spelling the metadata happens to use.
|
|
20
36
|
*/
|
|
21
37
|
export declare const TEXTUAL_REF_FALLBACK_TYPES: Set<string>;
|
|
22
38
|
/**
|
|
@@ -44,6 +60,51 @@ export declare const TEXTUAL_REF_FALLBACK_TYPES: Set<string>;
|
|
|
44
60
|
* how a view declares "this column is computed elsewhere".
|
|
45
61
|
*/
|
|
46
62
|
export declare function isComputedFieldType(viewFieldType: unknown, objectFieldType: unknown): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Members of the fields package's `INLINE_EXCLUDED_FIELD_TYPES` that the DETAIL
|
|
65
|
+
* editor nevertheless routes to a dedicated widget, and therefore keeps.
|
|
66
|
+
*
|
|
67
|
+
* The shared set is one list carrying several arguments, and only some of them
|
|
68
|
+
* are about the value. The binary/attachment family is excluded there for a
|
|
69
|
+
* GRID-cell reason — its own comment reads "edited from the record form, shown
|
|
70
|
+
* read-only **in the grid**" — because a cell cannot host an upload dropzone.
|
|
71
|
+
* A detail row can, and does: `InlineFieldInput` routes `image`/`avatar`/
|
|
72
|
+
* `signature`/`file` (and the `video`/`audio` spellings of `file`) to the very
|
|
73
|
+
* widgets the record form uses, added deliberately so inline edit could preview,
|
|
74
|
+
* replace and remove files instead of showing a bare storage URL.
|
|
75
|
+
*
|
|
76
|
+
* The credential and container members are excluded for a VALUE reason — masked
|
|
77
|
+
* on read, or object-shaped — and that argument transfers to the detail page
|
|
78
|
+
* verbatim, because the detail fallback is the same plain text input the grid's
|
|
79
|
+
* is. Those stay excluded here.
|
|
80
|
+
*
|
|
81
|
+
* Every entry is pinned twice by `__tests__/inlineCredentialGate.test.tsx`: it
|
|
82
|
+
* must be a real member of the shared set, and `InlineFieldInput` must really
|
|
83
|
+
* render something other than the terminal text input for it. An exemption that
|
|
84
|
+
* outlives its routing therefore fails, rather than silently re-opening the
|
|
85
|
+
* plain-text path this gate exists to close.
|
|
86
|
+
*/
|
|
87
|
+
export declare const DETAIL_ROUTED_INLINE_TYPES: Set<string>;
|
|
88
|
+
/**
|
|
89
|
+
* Is this field one the fields package excludes from inline editing, given the
|
|
90
|
+
* type authored on the view entry and the type declared on the object schema?
|
|
91
|
+
*
|
|
92
|
+
* The rule itself is NOT restated here — it is `isInlineExcludedFieldType()`
|
|
93
|
+
* from `@object-ui/fields`, the same alias-aware contract the grid consults
|
|
94
|
+
* (`plugin-grid/src/inline-edit-options.ts`). The detail hosts used to gate on
|
|
95
|
+
* readonly / computed / system only, so `password` and `secret` — masked on
|
|
96
|
+
* read, with no real value to seed an editor from — reached the terminal plain
|
|
97
|
+
* text input, which rendered the mask as if it were the value and wrote it
|
|
98
|
+
* straight back over the credential (objectui#4221). The container family
|
|
99
|
+
* (`object`/`composite`/`record`/`grid`/`repeater`/`vector`) rode the same
|
|
100
|
+
* fallback with an object-shaped value.
|
|
101
|
+
*
|
|
102
|
+
* **Narrow-only, like {@link isComputedFieldType}** — the answer is the UNION of
|
|
103
|
+
* the two types, so an authored display `type` can lock a field but never
|
|
104
|
+
* unlock one (objectui#3355). An `image` authored over an object `secret` stays
|
|
105
|
+
* locked: the exemption is consulted per type, before the union.
|
|
106
|
+
*/
|
|
107
|
+
export declare function isInlineExcludedDetailFieldType(viewFieldType: unknown, objectFieldType: unknown): boolean;
|
|
47
108
|
/**
|
|
48
109
|
* Object-metadata keys carried onto a detail-view field so the read cell and
|
|
49
110
|
* the inline editor see the SAME resolved field shape the object form does.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fieldEnrichment.d.ts","sourceRoot":"","sources":["../src/fieldEnrichment.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"fieldEnrichment.d.ts","sourceRoot":"","sources":["../src/fieldEnrichment.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,0BAA0B,aAMrC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,mBAAmB,CACjC,aAAa,EAAE,OAAO,EACtB,eAAe,EAAE,OAAO,GACvB,OAAO,CAKT;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,0BAA0B,aAOrC,CAAC;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,+BAA+B,CAC7C,aAAa,EAAE,OAAO,EACtB,eAAe,EAAE,OAAO,GACvB,OAAO,CAET;AAQD;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,4BAA4B,+cA+C/B,CAAC;AAEX;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC9B,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,GAAG,IAAI,GACrD,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAiBrB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,8 +12,38 @@ import { RecordQuickActionsRenderer } from './renderers/record-quick-actions';
|
|
|
12
12
|
import { RecordHistoryRenderer } from './renderers/record-history';
|
|
13
13
|
import { RecordReferenceRailRenderer } from './renderers/record-reference-rail';
|
|
14
14
|
import { RecordAlertRenderer } from './renderers/record-alert';
|
|
15
|
+
/**
|
|
16
|
+
* ObjectUI
|
|
17
|
+
* Copyright (c) 2024-present ObjectStack Inc.
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the MIT license found in the
|
|
20
|
+
* LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/
|
|
22
|
+
import * as React from 'react';
|
|
15
23
|
export { DetailView, DetailSection, DetailTabs, RelatedList };
|
|
16
24
|
export { RecordDetailsRenderer, RecordRelatedListRenderer, RecordHighlightsRenderer, RecordActivityRenderer, RecordChatterRenderer, RecordPathRenderer, RecordQuickActionsRenderer, RecordHistoryRenderer, RecordReferenceRailRenderer, RecordAlertRenderer, };
|
|
25
|
+
/**
|
|
26
|
+
* The `sys_activity.type` -> `FeedItem.type` reading, made importable
|
|
27
|
+
* (objectui#5878).
|
|
28
|
+
*
|
|
29
|
+
* It was already exported from `renderers/recordActivityFeed`, but not from
|
|
30
|
+
* this barrel — so `app-shell`'s `RecordDetailView`, which merges the SAME
|
|
31
|
+
* `sys_activity` rows into the console record page's feed, carried a
|
|
32
|
+
* hand-written copy of the table instead. Nothing failed when the two
|
|
33
|
+
* disagreed, and objectui#5840 made them disagree: `scheduled` -> `event`
|
|
34
|
+
* landed here and not there, so one row rendered on a hand-authored record
|
|
35
|
+
* page and vanished on the console one.
|
|
36
|
+
*
|
|
37
|
+
* Publishing it is what lets there be ONE reading. Adding a member is now a
|
|
38
|
+
* single edit at `ACTIVITY_TYPE_TO_FEED_TYPE`; re-forking it is caught by
|
|
39
|
+
* `RecordDetailView.activityMapIdentity-5878.test.tsx`, which spies on THIS
|
|
40
|
+
* object rather than comparing values (a member-identical private copy passes
|
|
41
|
+
* a value check, which is the whole failure mode being closed).
|
|
42
|
+
*
|
|
43
|
+
* No new module enters the eager closure: `renderers/record-activity`, already
|
|
44
|
+
* imported above, pulls `recordActivityFeed` in.
|
|
45
|
+
*/
|
|
46
|
+
export { ACTIVITY_TYPE_TO_FEED_TYPE } from './renderers/recordActivityFeed';
|
|
17
47
|
export { RecordDetailDrawer, deriveRecordPageHref } from './RecordDetailDrawer';
|
|
18
48
|
export type { RecordDetailDrawerProps } from './RecordDetailDrawer';
|
|
19
49
|
export { ConcurrentUpdateDialog, isConcurrentUpdateError, } from './ConcurrentUpdateDialog';
|
|
@@ -76,4 +106,62 @@ export type { ReactionPickerProps } from './ReactionPicker';
|
|
|
76
106
|
export type { ThreadedRepliesProps } from './ThreadedReplies';
|
|
77
107
|
export { buildDefaultPageSchema, buildDefaultHeader, buildDefaultActions, buildDefaultHighlights, buildDefaultDetails, buildDefaultTabs, buildDefaultDiscussion, detectStatusField, deriveStages, deriveHighlightFields, deriveFieldGroupDetailSections, resolveDetailSections, resolveTitleField, } from './synth/buildDefaultPageSchema';
|
|
78
108
|
export type { ObjectDefLike, ObjectDefFieldLike, BuildPageOptions, } from './synth/buildDefaultPageSchema';
|
|
109
|
+
/**
|
|
110
|
+
* The registry face of `detail-view` — objectui#5378 item 1.
|
|
111
|
+
*
|
|
112
|
+
* ## What was wrong
|
|
113
|
+
*
|
|
114
|
+
* `detail-view` was registered as the RAW `DetailView` component, which reads
|
|
115
|
+
* its adapter from its own React `dataSource` PROP. Its two siblings in the
|
|
116
|
+
* family are registered through wrappers that read the adapter from
|
|
117
|
+
* `SchemaRendererContext` (`ObjectGridRenderer`, `ObjectFormRenderer`), and
|
|
118
|
+
* `SchemaRenderer` itself reads only context — an explicit `dataSource` PROP
|
|
119
|
+
* arrives through `...props` and never becomes context for anything below.
|
|
120
|
+
*
|
|
121
|
+
* So the two wirings were mutually exclusive, and a page could satisfy only one
|
|
122
|
+
* of them. Measured on the published getting-started guide's own snippets,
|
|
123
|
+
* keys held correct in every cell:
|
|
124
|
+
*
|
|
125
|
+
* | wiring | `object-grid` | `detail-view` |
|
|
126
|
+
* |-------------------------------------------|---------------|---------------|
|
|
127
|
+
* | `SchemaRendererProvider dataSource={…}` | `find` 1 | `findOne` 0 |
|
|
128
|
+
* | `SchemaRenderer dataSource={…}` (prop) | `find` 0 | `findOne` 1 |
|
|
129
|
+
*
|
|
130
|
+
* Neither cell reported anything: one half of the page fetched, the other half
|
|
131
|
+
* rendered an empty shell in silence. The registry gave the author no signal
|
|
132
|
+
* about which wiring they were holding.
|
|
133
|
+
*
|
|
134
|
+
* ## What this is
|
|
135
|
+
*
|
|
136
|
+
* The same context-reading wrapper the siblings have, so every block in the
|
|
137
|
+
* family resolves the adapter the same way — maintainer ruling of 2026-08-20 on
|
|
138
|
+
* objectui#5378, item 1 (「其他接受你的建议。」), which also settled the
|
|
139
|
+
* compatibility question: this is ADDITIVE. The `dataSource`-PROP form stays
|
|
140
|
+
* accepted, and no prop is removed this pass.
|
|
141
|
+
*
|
|
142
|
+
* ## Precedence, when both are present
|
|
143
|
+
*
|
|
144
|
+
* The explicit prop WINS. It is the more specific signal — written on this one
|
|
145
|
+
* placement, by someone who can see it — while the context adapter is ambient
|
|
146
|
+
* and applies to every descendant of the provider. That is also the only
|
|
147
|
+
* precedence under which the ruling's \"stays accepted\" is true of the case that
|
|
148
|
+
* matters: a prop-form caller mounted somewhere inside an app that has a
|
|
149
|
+
* provider would otherwise have had its explicit choice silently overruled by
|
|
150
|
+
* an ancestor it never wrote.
|
|
151
|
+
*
|
|
152
|
+
* Measured caller population behind that judgement (objectui#5378's stated
|
|
153
|
+
* confidence gap): in this repo, every `dataSource`-prop consumer of
|
|
154
|
+
* `DetailView` — `renderers/record-details.tsx`, `RecordDetailDrawer.tsx`, and
|
|
155
|
+
* the published README's documented usage — renders the COMPONENT directly and
|
|
156
|
+
* never passes through the registry, so this wrapper does not sit between any
|
|
157
|
+
* of them and `DetailView`. Registry-routed `detail-view` nodes carrying a
|
|
158
|
+
* `dataSource` prop: zero, the getting-started guide being the one that tried.
|
|
159
|
+
* The additive shape therefore changes no measured caller's behaviour, and the
|
|
160
|
+
* precedence above is pinned by test rather than left to be discovered.
|
|
161
|
+
*/
|
|
162
|
+
export declare const DetailViewRenderer: React.FC<{
|
|
163
|
+
schema: any;
|
|
164
|
+
dataSource?: unknown;
|
|
165
|
+
[key: string]: any;
|
|
166
|
+
}>;
|
|
79
167
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAK/D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC;AAC9D,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,kBAAkB,EAClB,0BAA0B,EAC1B,qBAAqB,EACrB,2BAA2B,EAC3B,mBAAmB,GAC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