@object-ui/fields 17.7.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 +792 -0
- package/README.md +146 -4
- package/dist/fieldHelpText.d.ts +41 -0
- package/dist/index.cjs +4 -4
- package/dist/index.css +42 -3
- package/dist/index.d.ts +219 -14
- package/dist/index.js +4090 -3009
- package/dist/resolveActionParams.d.ts +259 -0
- package/dist/widgets/FormulaField.d.ts +41 -0
- package/dist/widgets/GridField.d.ts +12 -4
- package/dist/widgets/RecipientPickerField.d.ts +32 -0
- package/dist/widgets/RegistryRefField.d.ts +77 -0
- package/dist/widgets/SummaryField.d.ts +30 -0
- package/dist/widgets/booleanValueLabel.d.ts +18 -0
- package/dist/widgets/date-picker/DatePickerField.d.ts +40 -0
- package/dist/widgets/date-picker/localeDateText.d.ts +39 -0
- package/dist/widgets/deriveLookupColumns.d.ts +1 -1
- package/dist/widgets/file-affordance.d.ts +30 -0
- package/dist/widgets/file-refused.d.ts +17 -0
- package/dist/widgets/file-value.d.ts +11 -0
- package/dist/widgets/longTextCarrierHandoff.d.ts +35 -0
- package/dist/widgets/lookupColumnDisplay.d.ts +2 -2
- package/dist/widgets/objectRefLabel.d.ts +16 -0
- package/dist/widgets/recipientKinds.d.ts +85 -0
- package/dist/widgets/richTextDisplay.d.ts +0 -17
- package/dist/widgets/searchOffer.d.ts +8 -0
- package/dist/widgets/toDomProps.d.ts +16 -3
- package/dist/widgets/useRecordQuery.d.ts +13 -0
- package/package.json +9 -9
package/dist/index.css
CHANGED
|
@@ -119,6 +119,9 @@
|
|
|
119
119
|
.cursor-zoom-in {
|
|
120
120
|
cursor: zoom-in;
|
|
121
121
|
}
|
|
122
|
+
.grid-cols-\[auto_minmax\(0\,max-content\)\] {
|
|
123
|
+
grid-template-columns: auto minmax(0,max-content);
|
|
124
|
+
}
|
|
122
125
|
.gap-x-3 {
|
|
123
126
|
column-gap: calc(var(--spacing, 0.25rem) * 3);
|
|
124
127
|
}
|
|
@@ -307,12 +310,24 @@
|
|
|
307
310
|
.pr-8 {
|
|
308
311
|
padding-right: calc(var(--spacing, 0.25rem) * 8);
|
|
309
312
|
}
|
|
313
|
+
.pr-9 {
|
|
314
|
+
padding-right: calc(var(--spacing, 0.25rem) * 9);
|
|
315
|
+
}
|
|
316
|
+
.pr-16 {
|
|
317
|
+
padding-right: calc(var(--spacing, 0.25rem) * 16);
|
|
318
|
+
}
|
|
310
319
|
.pl-0\.5 {
|
|
311
320
|
padding-left: calc(var(--spacing, 0.25rem) * 0.5);
|
|
312
321
|
}
|
|
313
322
|
.pl-9 {
|
|
314
323
|
padding-left: calc(var(--spacing, 0.25rem) * 9);
|
|
315
324
|
}
|
|
325
|
+
.align-top {
|
|
326
|
+
vertical-align: top;
|
|
327
|
+
}
|
|
328
|
+
.text-\[9px\] {
|
|
329
|
+
font-size: 9px;
|
|
330
|
+
}
|
|
316
331
|
.text-\[color\:var\(--os-badge-fg\)\] {
|
|
317
332
|
color: var(--os-badge-fg);
|
|
318
333
|
}
|
|
@@ -358,9 +373,6 @@
|
|
|
358
373
|
.text-yellow-800 {
|
|
359
374
|
color: var(--color-yellow-800, oklch(47.6% 0.114 61.907));
|
|
360
375
|
}
|
|
361
|
-
.underline-offset-2 {
|
|
362
|
-
text-underline-offset: 2px;
|
|
363
|
-
}
|
|
364
376
|
.opacity-30 {
|
|
365
377
|
opacity: 30%;
|
|
366
378
|
}
|
|
@@ -379,6 +391,10 @@
|
|
|
379
391
|
--tw-ring-color: color-mix(in oklab, var(--color-destructive, hsl(var(--destructive))) 50%, transparent);
|
|
380
392
|
}
|
|
381
393
|
}
|
|
394
|
+
.invert {
|
|
395
|
+
--tw-invert: invert(100%);
|
|
396
|
+
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
397
|
+
}
|
|
382
398
|
.duration-150 {
|
|
383
399
|
--tw-duration: 150ms;
|
|
384
400
|
transition-duration: 150ms;
|
|
@@ -509,14 +525,28 @@
|
|
|
509
525
|
}
|
|
510
526
|
}
|
|
511
527
|
@media (width >= 40rem) {
|
|
528
|
+
.sm\:ml-auto {
|
|
529
|
+
margin-left: auto;
|
|
530
|
+
}
|
|
512
531
|
.sm\:max-w-4xl {
|
|
513
532
|
max-width: var(--container-4xl, 56rem);
|
|
514
533
|
}
|
|
534
|
+
.sm\:max-w-xl {
|
|
535
|
+
max-width: var(--container-xl, 36rem);
|
|
536
|
+
}
|
|
515
537
|
.sm\:justify-between {
|
|
516
538
|
justify-content: space-between;
|
|
517
539
|
}
|
|
540
|
+
:where(.sm\:space-x-0 > :not(:last-child)) {
|
|
541
|
+
--tw-space-x-reverse: 0;
|
|
542
|
+
margin-inline-start: 0;
|
|
543
|
+
margin-inline-end: 0;
|
|
544
|
+
}
|
|
518
545
|
}
|
|
519
546
|
@media (width >= 64rem) {
|
|
547
|
+
.lg\:max-w-4xl {
|
|
548
|
+
max-width: var(--container-4xl, 56rem);
|
|
549
|
+
}
|
|
520
550
|
.lg\:max-w-5xl {
|
|
521
551
|
max-width: var(--container-5xl, 64rem);
|
|
522
552
|
}
|
|
@@ -524,6 +554,9 @@
|
|
|
524
554
|
.dark\:border-\[color\:var\(--os-badge-border-dark\)\]:where(.dark, .dark *) {
|
|
525
555
|
border-color: var(--os-badge-border-dark);
|
|
526
556
|
}
|
|
557
|
+
.dark\:border-amber-700:where(.dark, .dark *) {
|
|
558
|
+
border-color: var(--color-amber-700, oklch(55.5% 0.163 48.998));
|
|
559
|
+
}
|
|
527
560
|
.dark\:border-blue-900\/60:where(.dark, .dark *) {
|
|
528
561
|
border-color: color-mix(in srgb, oklch(37.9% 0.146 265.522) 60%, transparent);
|
|
529
562
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -584,6 +617,9 @@
|
|
|
584
617
|
.dark\:bg-\[color\:var\(--os-dot-bg-dark\)\]:where(.dark, .dark *) {
|
|
585
618
|
background-color: var(--os-dot-bg-dark);
|
|
586
619
|
}
|
|
620
|
+
.dark\:bg-amber-950:where(.dark, .dark *) {
|
|
621
|
+
background-color: var(--color-amber-950, oklch(27.9% 0.077 45.635));
|
|
622
|
+
}
|
|
587
623
|
.dark\:bg-blue-950\/40:where(.dark, .dark *) {
|
|
588
624
|
background-color: color-mix(in srgb, oklch(28.2% 0.091 267.935) 40%, transparent);
|
|
589
625
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -644,6 +680,9 @@
|
|
|
644
680
|
.dark\:text-\[color\:var\(--os-badge-fg-dark\)\]:where(.dark, .dark *) {
|
|
645
681
|
color: var(--os-badge-fg-dark);
|
|
646
682
|
}
|
|
683
|
+
.dark\:text-amber-100:where(.dark, .dark *) {
|
|
684
|
+
color: var(--color-amber-100, oklch(96.2% 0.059 95.617));
|
|
685
|
+
}
|
|
647
686
|
.dark\:text-blue-300:where(.dark, .dark *) {
|
|
648
687
|
color: var(--color-blue-300, oklch(80.9% 0.105 251.813));
|
|
649
688
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { FieldMetadata } from '@object-ui/types';
|
|
3
|
-
import { PercentScale, humanizeLabel, formatDate, formatDateTime, formatDateTimeCompactParts, formatRelativeDate,
|
|
3
|
+
import { PercentScale, humanizeLabel, formatDate, formatDateTime, formatDateTimeCompactParts, formatRelativeDate, RegistryComponentMeta, DateDisplayOptions } from '@object-ui/core';
|
|
4
4
|
import { formatCurrency, percentCellScale } from './widgets/number-format.js';
|
|
5
5
|
import { coerceToSafeValue } from './coerceToSafeValue.js';
|
|
6
6
|
import { resolveFieldCurrency } from './currency.js';
|
|
@@ -33,6 +33,29 @@ export interface CellRendererProps {
|
|
|
33
33
|
field: FieldMetadata;
|
|
34
34
|
isEditing?: boolean;
|
|
35
35
|
onChange?: (value: any) => void;
|
|
36
|
+
/**
|
|
37
|
+
* The row's values, for a renderer whose value only means something next to
|
|
38
|
+
* a sibling column — the cell-side counterpart of the edit widget's
|
|
39
|
+
* `FieldWidgetComponentProps.dependentValues` (objectui#12613). The console's
|
|
40
|
+
* `recipient-picker` face reads the row's `recipient_type` from it, as the
|
|
41
|
+
* picker reads the form record's.
|
|
42
|
+
*
|
|
43
|
+
* A call site that holds the row passes it; a renderer that needs a sibling
|
|
44
|
+
* and gets none draws the stored value as the text cell does, so a call site
|
|
45
|
+
* that does not pass it changes nothing.
|
|
46
|
+
*/
|
|
47
|
+
dependentValues?: Record<string, unknown>;
|
|
48
|
+
/**
|
|
49
|
+
* The host's answer to "is this declared deadline settled for this row?"
|
|
50
|
+
* (objectui#11815) — `isDeadlineSettled` from `@object-ui/core`, which
|
|
51
|
+
* evaluates the field's `settledWhen` against the row the host holds. A cell
|
|
52
|
+
* cannot evaluate a predicate, so the host hands it the verdict.
|
|
53
|
+
*
|
|
54
|
+
* While it is `true` the `date` and `datetime` cells paint no overdue wording
|
|
55
|
+
* and no overdue colour: the relative wording falls back to the neutral
|
|
56
|
+
* phrase a non-deadline reads. Absent or `false` changes nothing.
|
|
57
|
+
*/
|
|
58
|
+
deadlineSettled?: boolean;
|
|
36
59
|
}
|
|
37
60
|
export { coerceToSafeValue };
|
|
38
61
|
export { resolveFieldCurrency };
|
|
@@ -148,11 +171,11 @@ export declare function BooleanCellRenderer({ value, field }: CellRendererProps)
|
|
|
148
171
|
/**
|
|
149
172
|
* Date field cell renderer
|
|
150
173
|
*/
|
|
151
|
-
export declare function DateCellRenderer({ value, field }: CellRendererProps): React.ReactElement;
|
|
174
|
+
export declare function DateCellRenderer({ value, field, deadlineSettled }: CellRendererProps): React.ReactElement;
|
|
152
175
|
/**
|
|
153
176
|
* DateTime field cell renderer (Airtable-style with date and time visually separated)
|
|
154
177
|
*/
|
|
155
|
-
export declare function DateTimeCellRenderer({ value, field }: CellRendererProps): React.ReactElement;
|
|
178
|
+
export declare function DateTimeCellRenderer({ value, field, deadlineSettled }: CellRendererProps): React.ReactElement;
|
|
156
179
|
/** The six pill colors plus the two dot colors derived from one declared hex. */
|
|
157
180
|
export interface HexBadgePalette {
|
|
158
181
|
bg: string;
|
|
@@ -273,9 +296,47 @@ export declare function ImageCellRenderer({ value }: CellRendererProps): React.R
|
|
|
273
296
|
*/
|
|
274
297
|
export declare function LookupCellRenderer({ value, field }: CellRendererProps): React.ReactElement;
|
|
275
298
|
/**
|
|
276
|
-
* Formula field cell renderer (read-only)
|
|
299
|
+
* Formula field cell renderer (read-only). `summary` is registered to it too.
|
|
300
|
+
*
|
|
301
|
+
* The TABLE face of a formula; `FormulaField`'s read-only branch is its FORM
|
|
302
|
+
* face, and the two read one rule (objectui#11748): the declared `returnType`,
|
|
303
|
+
* or, with none, a JS number as a number and anything else as text. Each type
|
|
304
|
+
* is then drawn through the calls the matching field type's faces make, so
|
|
305
|
+
* one stored value reads the same in the form and in the table. The rule is
|
|
306
|
+
* spelled in both modules because this barrel and the lazily loaded widget may
|
|
307
|
+
* not import each other; `__tests__/formulaFaces.returnType-11748.test.tsx`
|
|
308
|
+
* compares the two faces' text for every declared type.
|
|
277
309
|
*/
|
|
278
|
-
export declare function FormulaCellRenderer({ value }: CellRendererProps): React.ReactElement;
|
|
310
|
+
export declare function FormulaCellRenderer({ value, field }: CellRendererProps): React.ReactElement;
|
|
311
|
+
/**
|
|
312
|
+
* The shipped PRESENTATION of an unresolved reference, shared by the two
|
|
313
|
+
* renderers that state one (objectui#8434 for `user`, objectui#8695 for
|
|
314
|
+
* `lookup` / `master_detail` / `tree`), and published for the host faces of the
|
|
315
|
+
* widget-hinted reference keys (objectui#12613), which draw the same state.
|
|
316
|
+
*
|
|
317
|
+
* Only the drawing is shared. Each caller keeps its own literal i18n key and
|
|
318
|
+
* its own English fallback, because a key reaching this component as a prop
|
|
319
|
+
* would be a key `check:i18n-keys` can no longer judge — and because the two
|
|
320
|
+
* sentences are genuinely different claims: one is about a person, the other
|
|
321
|
+
* about a record of whatever object the lookup points at.
|
|
322
|
+
*
|
|
323
|
+
* ⚠️ No `pointer-events-none` here, unlike `EmptyValue`: that utility stops the
|
|
324
|
+
* span being a hit target, so a `title` on it never renders a tooltip
|
|
325
|
+
* (objectui#8506). The stated sentence has to be reachable by hovering.
|
|
326
|
+
*
|
|
327
|
+
* ⚠️ `truncate` on the inner span rather than the outer one, and the outer is
|
|
328
|
+
* `inline-flex`: `overflow: hidden` gives a flex item an automatic minimum
|
|
329
|
+
* size of zero, so the text shrinks and ellipsises instead of forcing the row
|
|
330
|
+
* wider. The full value stays reachable through the `title` sentence, which
|
|
331
|
+
* names it — that is how this shape meets objectui#3466's truncation contract
|
|
332
|
+
* (a single-line value must never expand its column and must expose its full
|
|
333
|
+
* text) with an icon in front of the text.
|
|
334
|
+
*/
|
|
335
|
+
export declare function UnresolvedReferenceMark({ raw, hint, className, }: {
|
|
336
|
+
raw: string;
|
|
337
|
+
hint: string;
|
|
338
|
+
className?: string;
|
|
339
|
+
}): React.ReactElement;
|
|
279
340
|
/**
|
|
280
341
|
* User/Owner field cell renderer (with avatars)
|
|
281
342
|
*
|
|
@@ -294,20 +355,126 @@ export declare function UserCellRenderer({ value, field }: CellRendererProps): R
|
|
|
294
355
|
* @param renderer React component to render the field
|
|
295
356
|
*/
|
|
296
357
|
export declare function registerFieldRenderer(type: string, renderer: React.FC<CellRendererProps>): void;
|
|
358
|
+
/**
|
|
359
|
+
* ## Polymorphic pointer pairs: `referenceVia` (objectui#12045)
|
|
360
|
+
*
|
|
361
|
+
* `@objectstack/spec`'s `FieldSchema.referenceVia` declares a `text` field as
|
|
362
|
+
* the ID HALF of a two-column pointer pair (ADR-0052 §5): its value is a
|
|
363
|
+
* record id of the object that the SIBLING column names, on the same row.
|
|
364
|
+
* `sys_approval_request.record_id` with `referenceVia: 'object_name'` is one;
|
|
365
|
+
* `sys_activity.source_id` with `referenceVia: 'source_object'` is another.
|
|
366
|
+
*
|
|
367
|
+
* The target object varies per ROW, so the pair is resolved where the row is
|
|
368
|
+
* in hand, at the call site. {@link CellRendererProps} carries one value and no
|
|
369
|
+
* row, which is why this is a function a call site asks and not a branch inside
|
|
370
|
+
* {@link getCellRenderer}, whose dispatch stays on the field type alone.
|
|
371
|
+
*
|
|
372
|
+
* ⭐ This is the one place the rule lives. A call site that holds the row asks
|
|
373
|
+
* `resolveRecordPointer(field, row, optionsOf)`, and draws a pair it gets back
|
|
374
|
+
* with the renderer registered under {@link RECORD_POINTER_CARD_TYPE}, passing
|
|
375
|
+
* the pair as that renderer's `value`. The same call answers whether the
|
|
376
|
+
* platform asserted the target deleted on this row (`referenceDeletedWhen`,
|
|
377
|
+
* objectui#12489), so no face and no call site evaluates that predicate. This package registers a default under that key
|
|
378
|
+
* which draws the record id as text, exactly as the field drew before its pair
|
|
379
|
+
* was read, so a host with nothing better changes nothing. A host that can read
|
|
380
|
+
* records registers a richer face under the same key with
|
|
381
|
+
* {@link registerFieldRenderer}: `@object-ui/app-shell` registers its record
|
|
382
|
+
* preview card there.
|
|
383
|
+
*
|
|
384
|
+
* Two call sites ask it. The record details grid (`DetailSection` in
|
|
385
|
+
* `@object-ui/plugin-detail`) draws the pair with the renderer registered under
|
|
386
|
+
* {@link RECORD_POINTER_CARD_TYPE}. The list grid (`ObjectGrid` in
|
|
387
|
+
* `@object-ui/plugin-grid`, objectui#12608) draws it with its own cell face,
|
|
388
|
+
* not with that renderer: a face that reads its target one record at a time
|
|
389
|
+
* costs one request per row in a list, so the list face batches the page's
|
|
390
|
+
* targets into one read per object.
|
|
391
|
+
*/
|
|
392
|
+
export declare const RECORD_POINTER_CARD_TYPE = "record_pointer_card";
|
|
393
|
+
/** One resolved pointer pair: the record a `referenceVia` field points at. */
|
|
394
|
+
export interface RecordPointer {
|
|
395
|
+
/** The target's object machine name: the sibling column's value. */
|
|
396
|
+
objectName: string;
|
|
397
|
+
/** The target's record id: the pointer field's own value. */
|
|
398
|
+
recordId: string;
|
|
399
|
+
/**
|
|
400
|
+
* Present only when the platform asserted, on this row, that the target was
|
|
401
|
+
* deleted (the field's `referenceDeletedWhen` predicate holds, objectui#12489):
|
|
402
|
+
* the label of the declared option that says so, as the call site's option
|
|
403
|
+
* labels spell it. A face that receives it draws the tombstone in this text,
|
|
404
|
+
* reads nothing and links nothing. Absent on every other row, and a face
|
|
405
|
+
* then draws the pair as before.
|
|
406
|
+
*/
|
|
407
|
+
deletedLabel?: string;
|
|
408
|
+
}
|
|
409
|
+
/**
|
|
410
|
+
* `@objectstack/spec`'s `FieldSchema.referenceDeletedWhen`: the sibling
|
|
411
|
+
* `select` field, and the one option of it, that the platform writes on a row
|
|
412
|
+
* whose pointed-at record it deleted. The spec refuses it at parse unless the
|
|
413
|
+
* field declares `referenceVia`, `field` is a single-value `select` of the same
|
|
414
|
+
* object declaring inline `options`, and `value` is one of those options.
|
|
415
|
+
*/
|
|
416
|
+
type ReferenceDeletedWhen = {
|
|
417
|
+
readonly field: string;
|
|
418
|
+
readonly value: string;
|
|
419
|
+
};
|
|
420
|
+
/** The call site's option list for one field: what `select` cells draw with. */
|
|
421
|
+
type OptionsOf = (fieldName: string) => ReadonlyArray<{
|
|
422
|
+
readonly value?: unknown;
|
|
423
|
+
readonly label?: unknown;
|
|
424
|
+
}> | null | undefined;
|
|
425
|
+
/**
|
|
426
|
+
* Resolve the record a `referenceVia` pointer field points at on one row, or
|
|
427
|
+
* `null` when the field is not a pointer or the row does not address a record.
|
|
428
|
+
*
|
|
429
|
+
* - `field` must be a `text` field declaring a non-empty `referenceVia`; the
|
|
430
|
+
* spec refuses the key on every other type, so nothing else qualifies here.
|
|
431
|
+
* - The pair is read from `row`: the id under the field's own name, the object
|
|
432
|
+
* name under the sibling column the field names.
|
|
433
|
+
* - Both halves must be non-blank strings. A half-addressed row is not a
|
|
434
|
+
* pointer this can draw, and the caller falls back to the field's ordinary
|
|
435
|
+
* face (the stored text).
|
|
436
|
+
*
|
|
437
|
+
* ## A deletion the platform asserts: `referenceDeletedWhen` (objectui#12489)
|
|
438
|
+
*
|
|
439
|
+
* When the field also declares `referenceDeletedWhen: { field, value }` and
|
|
440
|
+
* this row's sibling `field` holds exactly `value`, the pair comes back with
|
|
441
|
+
* `deletedLabel`: the label of that declared option, looked up in
|
|
442
|
+
* `optionsOf(field)`. The call site supplies `optionsOf` because it holds the
|
|
443
|
+
* object definition and the option labels the rest of its grid draws with
|
|
444
|
+
* (localized ones included), so the tombstone and the sibling `select`'s own
|
|
445
|
+
* cell say the same thing.
|
|
446
|
+
*
|
|
447
|
+
* - Only the declared assertion marks a target deleted. A target read that
|
|
448
|
+
* fails or answers no record says nothing about why: the platform answers a
|
|
449
|
+
* deleted record and one outside the reader's row set alike, on purpose.
|
|
450
|
+
* - No `optionsOf`, or no option with that value among the sibling's options,
|
|
451
|
+
* means no label to draw, and the pair comes back without `deletedLabel`.
|
|
452
|
+
* The spec refuses a predicate whose value is not a declared option, so the
|
|
453
|
+
* second case is not reachable from spec-valid metadata. ⛔ Never the raw
|
|
454
|
+
* option value as the text: the tombstone is the option's own label.
|
|
455
|
+
*/
|
|
456
|
+
export declare function resolveRecordPointer(field: {
|
|
457
|
+
readonly name: string;
|
|
458
|
+
readonly type?: string | null;
|
|
459
|
+
readonly referenceVia?: string | null;
|
|
460
|
+
readonly referenceDeletedWhen?: ReferenceDeletedWhen | null;
|
|
461
|
+
} | null | undefined, row: Readonly<Record<string, unknown>> | null | undefined, optionsOf?: OptionsOf): RecordPointer | null;
|
|
297
462
|
/**
|
|
298
463
|
* Resolve the canonical cell-renderer key for a field. Accepts either a
|
|
299
464
|
* raw type string (back-compat) or a field-metadata object so that
|
|
300
465
|
* format hints (`format: 'phone'` etc.) can promote a plain `text`
|
|
301
|
-
* field to its richer renderer counterpart
|
|
466
|
+
* field to its richer renderer counterpart, and a declared `widget` with
|
|
467
|
+
* a read cell of its own (`WIDGET_CELL_RENDERER_TYPES`) to that cell.
|
|
302
468
|
*/
|
|
303
469
|
export declare function resolveCellRendererType(fieldOrType: string | {
|
|
304
470
|
type?: string;
|
|
305
471
|
format?: string;
|
|
472
|
+
widget?: string;
|
|
306
473
|
} | null | undefined): string;
|
|
307
474
|
/**
|
|
308
|
-
* Renders
|
|
309
|
-
*
|
|
310
|
-
*
|
|
475
|
+
* Renders a free-form JSON value (`json`, `object`) as compact, readable JSON,
|
|
476
|
+
* and is the fallback face for a shape a structured renderer cannot recognize
|
|
477
|
+
* (`location` / `geolocation`, `address`, `composite` / `record`).
|
|
311
478
|
*/
|
|
312
479
|
export declare function JsonCellRenderer({ value }: CellRendererProps): React.ReactElement;
|
|
313
480
|
/**
|
|
@@ -497,6 +664,14 @@ export declare function formatFileSize(bytes: number): string;
|
|
|
497
664
|
* Build validation rules from field metadata
|
|
498
665
|
* @param field - Field metadata from ObjectStack
|
|
499
666
|
* @returns Validation rule object compatible with react-hook-form
|
|
667
|
+
*
|
|
668
|
+
* ⛔ No field-level `pattern` / `pattern_message` / `validate` (objectui#12242,
|
|
669
|
+
* maintainer ruling A). `@objectstack/spec`'s `FieldSchema` refuses all three
|
|
670
|
+
* by name, so no published object carries them, and the field metadata types
|
|
671
|
+
* retire them as `never`. A regex check is the OBJECT's `format` validation
|
|
672
|
+
* rule (`validations[]`), which the server runs on every write that touches
|
|
673
|
+
* the field and refuses with the rule's message; this function adds no client
|
|
674
|
+
* pre-check of it.
|
|
500
675
|
*/
|
|
501
676
|
export declare function buildValidationRules(field: any): any;
|
|
502
677
|
/**
|
|
@@ -535,12 +710,12 @@ declare const fieldWidgetMap: {
|
|
|
535
710
|
date: () => Promise<{
|
|
536
711
|
default: React.ComponentType<any>;
|
|
537
712
|
} | {
|
|
538
|
-
default: typeof import('./widgets/
|
|
713
|
+
default: typeof import('./widgets/date-picker/DatePickerField.js').DatePickerField;
|
|
539
714
|
}>;
|
|
540
715
|
datetime: () => Promise<{
|
|
541
716
|
default: React.ComponentType<any>;
|
|
542
717
|
} | {
|
|
543
|
-
default: typeof import('./widgets/
|
|
718
|
+
default: typeof import('./widgets/date-picker/DatePickerField.js').DateTimePickerField;
|
|
544
719
|
}>;
|
|
545
720
|
time: () => Promise<{
|
|
546
721
|
default: React.ComponentType<any>;
|
|
@@ -732,6 +907,16 @@ declare const fieldWidgetMap: {
|
|
|
732
907
|
} | {
|
|
733
908
|
default: typeof import('./widgets/RecipientPickerField.js').RecipientPickerField;
|
|
734
909
|
}>;
|
|
910
|
+
'position-ref': () => Promise<{
|
|
911
|
+
default: React.ComponentType<any>;
|
|
912
|
+
} | {
|
|
913
|
+
default: typeof import('./widgets/RegistryRefField.js').PositionRefField;
|
|
914
|
+
}>;
|
|
915
|
+
'permission-ref': () => Promise<{
|
|
916
|
+
default: React.ComponentType<any>;
|
|
917
|
+
} | {
|
|
918
|
+
default: typeof import('./widgets/RegistryRefField.js').PermissionRefField;
|
|
919
|
+
}>;
|
|
735
920
|
};
|
|
736
921
|
/** The registered field widget keys, as a literal union (objectui#4857). */
|
|
737
922
|
export type RegisteredFieldWidgetType = keyof typeof fieldWidgetMap;
|
|
@@ -766,6 +951,23 @@ export declare function resolveFormWidgetType(fieldType: string): string;
|
|
|
766
951
|
* which converged the three private copies that preceded it).
|
|
767
952
|
*/
|
|
768
953
|
export { CASCADE_OPTION_WIDGET_TYPES } from '@object-ui/core';
|
|
954
|
+
/**
|
|
955
|
+
* The ONE action-param resolver (objectui#12105): a declared action param —
|
|
956
|
+
* inline, or field-backed via `{ field, objectOverride }` — resolved against
|
|
957
|
+
* the object's field definitions into the `ActionParamDef` a param dialog
|
|
958
|
+
* renders. Exported from here because this is the package both of its callers
|
|
959
|
+
* depend on: app-shell's single-record `ActionParamDialog` and plugin-grid's
|
|
960
|
+
* selection-bar bulk dialog (a promoted action's params). See the module.
|
|
961
|
+
*/
|
|
962
|
+
export { resolveActionParam, resolveActionParams, resolveParamWidgetType, withKnownObjects, RESOLVED_ONLY_PARAM_KEYS, } from './resolveActionParams.js';
|
|
963
|
+
export type { RawActionParam, RawActionParamOption, ResolveActionParamsContext, } from './resolveActionParams.js';
|
|
964
|
+
/**
|
|
965
|
+
* The ONE read of a field definition's help line (objectui#12213):
|
|
966
|
+
* `inlineHelpText`, else `description`. Exported from here because both of its
|
|
967
|
+
* readers can reach this package: `@object-ui/plugin-form`'s record form and
|
|
968
|
+
* this package's own `resolveActionParam`. See the module.
|
|
969
|
+
*/
|
|
970
|
+
export { fieldHelpText } from './fieldHelpText.js';
|
|
769
971
|
/**
|
|
770
972
|
* Lazily-loaded form field widget for a field type. Shares the exact loaders
|
|
771
973
|
* of {@link fieldWidgetMap} (the same components `registerField` registers for
|
|
@@ -777,7 +979,7 @@ export { CASCADE_OPTION_WIDGET_TYPES } from '@object-ui/core';
|
|
|
777
979
|
export declare function getLazyFieldWidget(fieldType: string): React.ComponentType<any>;
|
|
778
980
|
/**
|
|
779
981
|
* The labelling declaration of EVERY registered field widget
|
|
780
|
-
* (`
|
|
982
|
+
* (`RegistryComponentMeta.labelling` — the closed `'control' | 'group' | 'display'`
|
|
781
983
|
* vocabulary, objectui#3961 extended by objectui#4857). This `Record` is keyed
|
|
782
984
|
* by the widget map's own literal key union, so it is exhaustive BY
|
|
783
985
|
* CONSTRUCTION: registering a widget without deciding how a host's label
|
|
@@ -827,7 +1029,7 @@ export declare function getLazyFieldWidget(fieldType: string): React.ComponentTy
|
|
|
827
1029
|
* out-of-registry widgets alike; the entry here is still mandatory, because
|
|
828
1030
|
* "defaulted by omission" and "decided to be the default" are different facts.
|
|
829
1031
|
*/
|
|
830
|
-
export declare const FIELD_WIDGET_LABELLING: Record<RegisteredFieldWidgetType, NonNullable<
|
|
1032
|
+
export declare const FIELD_WIDGET_LABELLING: Record<RegisteredFieldWidgetType, NonNullable<RegistryComponentMeta['labelling']>>;
|
|
831
1033
|
export declare function registerField(fieldType: string): void;
|
|
832
1034
|
/**
|
|
833
1035
|
* Register all field types (for backward compatibility)
|
|
@@ -870,6 +1072,7 @@ export * from './FieldEditWidget.js';
|
|
|
870
1072
|
export * from './widgets/TextField.js';
|
|
871
1073
|
export * from './widgets/NumberField.js';
|
|
872
1074
|
export * from './widgets/BooleanField.js';
|
|
1075
|
+
export { useBooleanValueLabel, type BooleanValueLabel } from './widgets/booleanValueLabel.js';
|
|
873
1076
|
export * from './widgets/SelectField.js';
|
|
874
1077
|
export * from './widgets/DateField.js';
|
|
875
1078
|
export * from './widgets/DateTimeField.js';
|
|
@@ -887,6 +1090,8 @@ export * from './widgets/CapabilityMultiSelectField.js';
|
|
|
887
1090
|
export * from './widgets/ObjectRefField.js';
|
|
888
1091
|
export * from './widgets/FilterConditionField.js';
|
|
889
1092
|
export * from './widgets/RecipientPickerField.js';
|
|
1093
|
+
export { objectRefOptionLabel } from './widgets/objectRefLabel.js';
|
|
1094
|
+
export { RECIPIENT_RECORD_KINDS, RECIPIENT_REGISTRY_KINDS, FIELD_RECIPIENT_TYPE, recipientCandidateLabel, } from './widgets/recipientKinds.js';
|
|
890
1095
|
export * from './widgets/RecordPickerDialog.js';
|
|
891
1096
|
export * from './widgets/deriveLookupColumns.js';
|
|
892
1097
|
export * from './widgets/FileField.js';
|
|
@@ -917,7 +1122,7 @@ export * from './widgets/CheckboxesField.js';
|
|
|
917
1122
|
export * from './widgets/TagsField.js';
|
|
918
1123
|
export { withFieldCarrier } from './withFieldCarrier.js';
|
|
919
1124
|
export { toDomProps } from './widgets/toDomProps.js';
|
|
920
|
-
export type {
|
|
1125
|
+
export type { FieldDomProps } from './widgets/toDomProps.js';
|
|
921
1126
|
export { toHostProps } from './widgets/toHostProps.js';
|
|
922
1127
|
export type { HostProps } from './widgets/toHostProps.js';
|
|
923
1128
|
export { toDateInputValue, toDateTimeInputValue, fromDateTimeInputValue, } from './widgets/nativeDateValue.js';
|