@object-ui/fields 17.1.0 → 17.3.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.
Files changed (171) hide show
  1. package/CHANGELOG.md +786 -0
  2. package/dist/FieldEditWidget.d.ts +2 -2
  3. package/dist/__tests__/cell-truncation.test.d.ts +0 -0
  4. package/dist/__tests__/field-carrier-sdui.test.d.ts +0 -0
  5. package/dist/__tests__/spec-symbol-batch7.test.d.ts +8 -0
  6. package/dist/__tests__/widget-aria-invalid-e2e.test.d.ts +0 -0
  7. package/dist/__tests__/widget-aria-invalid-registry-e2e.test.d.ts +0 -0
  8. package/dist/__tests__/widget-dom-leak-e2e.test.d.ts +0 -0
  9. package/dist/__tests__/widget-props-contract.test.d.ts +8 -0
  10. package/dist/index.cjs +5 -5
  11. package/dist/index.d.ts +4 -0
  12. package/dist/index.js +2882 -2569
  13. package/dist/widgets/AddressField.d.ts +2 -2
  14. package/dist/widgets/AddressField.uniqueIds.test.d.ts +0 -0
  15. package/dist/widgets/AutoNumberField.d.ts +2 -2
  16. package/dist/widgets/AvatarField.d.ts +2 -2
  17. package/dist/widgets/BooleanField.d.ts +2 -2
  18. package/dist/widgets/CapabilityMultiSelectField.d.ts +2 -2
  19. package/dist/widgets/CharacterCount.d.ts +56 -0
  20. package/dist/widgets/CheckboxesField.d.ts +2 -2
  21. package/dist/widgets/CodeField.d.ts +2 -2
  22. package/dist/widgets/ColorField.d.ts +2 -2
  23. package/dist/widgets/CurrencyField.d.ts +2 -2
  24. package/dist/widgets/DateField.d.ts +2 -2
  25. package/dist/widgets/DateTimeField.d.ts +2 -2
  26. package/dist/widgets/EmailField.d.ts +2 -2
  27. package/dist/widgets/FileField.d.ts +2 -2
  28. package/dist/widgets/FilterConditionField.d.ts +2 -2
  29. package/dist/widgets/FormulaField.d.ts +2 -2
  30. package/dist/widgets/FullscreenFieldEditor.d.ts +155 -0
  31. package/dist/widgets/GeolocationField.d.ts +2 -2
  32. package/dist/widgets/GeolocationField.uniqueIds.test.d.ts +0 -0
  33. package/dist/widgets/GridField.d.ts +2 -2
  34. package/dist/widgets/ImageField.d.ts +2 -2
  35. package/dist/widgets/LocationField.d.ts +2 -2
  36. package/dist/widgets/LookupField.d.ts +2 -2
  37. package/dist/widgets/LookupField.gateHintLabel.test.d.ts +8 -0
  38. package/dist/widgets/MasterDetailField.d.ts +2 -2
  39. package/dist/widgets/MultiSelectField.d.ts +2 -2
  40. package/dist/widgets/NumberField.d.ts +2 -2
  41. package/dist/widgets/ObjectField.d.ts +2 -2
  42. package/dist/widgets/ObjectRefField.d.ts +2 -2
  43. package/dist/widgets/OptionsEmptyState.d.ts +45 -0
  44. package/dist/widgets/OptionsEmptyState.no-provider.test.d.ts +0 -0
  45. package/dist/widgets/OptionsEmptyState.test.d.ts +0 -0
  46. package/dist/widgets/PasswordField.d.ts +2 -2
  47. package/dist/widgets/PercentField.d.ts +2 -2
  48. package/dist/widgets/PhoneField.d.ts +2 -2
  49. package/dist/widgets/QRCodeField.d.ts +2 -2
  50. package/dist/widgets/RadioField.d.ts +2 -2
  51. package/dist/widgets/RatingField.d.ts +2 -2
  52. package/dist/widgets/RecipientPickerField.d.ts +2 -2
  53. package/dist/widgets/RecordPickerDialog.d.ts +17 -1
  54. package/dist/widgets/RecordPickerDialog.filterOptions.test.d.ts +8 -0
  55. package/dist/widgets/RecordPickerDialog.selectLabel.test.d.ts +8 -0
  56. package/dist/widgets/RichTextField.d.ts +20 -2
  57. package/dist/widgets/SelectField.d.ts +2 -2
  58. package/dist/widgets/SignatureField.d.ts +2 -2
  59. package/dist/widgets/SliderField.d.ts +2 -2
  60. package/dist/widgets/SummaryField.d.ts +2 -2
  61. package/dist/widgets/TagsField.d.ts +2 -2
  62. package/dist/widgets/TagsField.placeholder.no-provider.test.d.ts +0 -0
  63. package/dist/widgets/TagsField.placeholder.test.d.ts +0 -0
  64. package/dist/widgets/TextAreaField.d.ts +45 -6
  65. package/dist/widgets/TextField.d.ts +2 -2
  66. package/dist/widgets/TimeField.d.ts +2 -2
  67. package/dist/widgets/UrlField.d.ts +2 -2
  68. package/dist/widgets/UserField.d.ts +2 -2
  69. package/dist/widgets/VectorField.d.ts +2 -2
  70. package/dist/widgets/__tests__/FullscreenFieldEditor.i18n.test.d.ts +0 -0
  71. package/dist/widgets/__tests__/FullscreenFieldEditor.no-provider.test.d.ts +0 -0
  72. package/dist/widgets/__tests__/RichTextField.fullscreenDisabled.test.d.ts +0 -0
  73. package/dist/widgets/__tests__/RichTextField.mobileFullscreen.test.d.ts +0 -0
  74. package/dist/widgets/__tests__/TextAreaField.characterCount.announcements.test.d.ts +0 -0
  75. package/dist/widgets/__tests__/TextAreaField.characterCount.i18n.test.d.ts +0 -0
  76. package/dist/widgets/__tests__/TextAreaField.characterCount.no-provider.test.d.ts +0 -0
  77. package/dist/widgets/__tests__/TextAreaField.fullscreenCharacterCount.i18n.test.d.ts +0 -0
  78. package/dist/widgets/__tests__/TextAreaField.fullscreenCharacterCount.test.d.ts +0 -0
  79. package/dist/widgets/__tests__/TextAreaField.fullscreenDisabled.test.d.ts +0 -0
  80. package/dist/widgets/__tests__/TextAreaField.mobileFullscreen.test.d.ts +0 -0
  81. package/dist/widgets/file-value.d.ts +20 -33
  82. package/dist/widgets/toDomProps.d.ts +91 -0
  83. package/dist/widgets/types.d.ts +215 -4
  84. package/dist/withFieldCarrier.d.ts +56 -0
  85. package/package.json +13 -13
  86. package/src/FieldEditWidget.tsx +6 -4
  87. package/src/__tests__/cell-truncation.test.tsx +96 -0
  88. package/src/__tests__/field-carrier-sdui.test.tsx +169 -0
  89. package/src/__tests__/spec-symbol-batch7.test.ts +126 -0
  90. package/src/__tests__/validation-feedback.test.tsx +22 -13
  91. package/src/__tests__/widget-aria-invalid-e2e.test.tsx +265 -0
  92. package/src/__tests__/widget-aria-invalid-registry-e2e.test.tsx +338 -0
  93. package/src/__tests__/widget-dom-leak-e2e.test.tsx +598 -0
  94. package/src/__tests__/widget-props-contract.test.tsx +142 -0
  95. package/src/complex-widgets.test.tsx +3 -3
  96. package/src/datetime-widgets.test.tsx +2 -2
  97. package/src/index.tsx +77 -27
  98. package/src/widgets/AddressField.tsx +32 -13
  99. package/src/widgets/AddressField.uniqueIds.test.tsx +92 -0
  100. package/src/widgets/AutoNumberField.tsx +2 -2
  101. package/src/widgets/AvatarField.tsx +10 -3
  102. package/src/widgets/BooleanField.tsx +5 -5
  103. package/src/widgets/CapabilityMultiSelectField.tsx +4 -4
  104. package/src/widgets/CharacterCount.tsx +263 -0
  105. package/src/widgets/CheckboxesField.tsx +35 -18
  106. package/src/widgets/CodeField.tsx +10 -3
  107. package/src/widgets/ColorField.tsx +12 -3
  108. package/src/widgets/CurrencyField.tsx +6 -5
  109. package/src/widgets/DateField.tsx +4 -4
  110. package/src/widgets/DateTimeField.tsx +4 -4
  111. package/src/widgets/EmailField.tsx +6 -6
  112. package/src/widgets/FileField.tsx +14 -4
  113. package/src/widgets/FilterConditionField.tsx +14 -3
  114. package/src/widgets/FormulaField.tsx +3 -3
  115. package/src/widgets/FullscreenFieldEditor.tsx +271 -0
  116. package/src/widgets/GeolocationField.tsx +22 -7
  117. package/src/widgets/GeolocationField.uniqueIds.test.tsx +88 -0
  118. package/src/widgets/GridField.tsx +4 -4
  119. package/src/widgets/ImageField.tsx +10 -3
  120. package/src/widgets/LocationField.tsx +10 -3
  121. package/src/widgets/LookupField.gateHintLabel.test.tsx +135 -0
  122. package/src/widgets/LookupField.tsx +50 -15
  123. package/src/widgets/MasterDetailField.tsx +3 -3
  124. package/src/widgets/MultiSelectField.tsx +34 -18
  125. package/src/widgets/NumberField.tsx +5 -5
  126. package/src/widgets/ObjectField.tsx +18 -9
  127. package/src/widgets/ObjectRefField.tsx +14 -4
  128. package/src/widgets/OptionsEmptyState.no-provider.test.tsx +88 -0
  129. package/src/widgets/OptionsEmptyState.test.tsx +169 -0
  130. package/src/widgets/OptionsEmptyState.tsx +83 -0
  131. package/src/widgets/PasswordField.tsx +5 -5
  132. package/src/widgets/PeoplePicker.tsx +7 -1
  133. package/src/widgets/PercentField.tsx +6 -5
  134. package/src/widgets/PhoneField.tsx +6 -6
  135. package/src/widgets/QRCodeField.tsx +10 -3
  136. package/src/widgets/RadioField.tsx +28 -18
  137. package/src/widgets/RatingField.tsx +19 -4
  138. package/src/widgets/RecipientPickerField.tsx +22 -4
  139. package/src/widgets/RecordPickerDialog.filterOptions.test.tsx +611 -0
  140. package/src/widgets/RecordPickerDialog.selectLabel.test.tsx +112 -0
  141. package/src/widgets/RecordPickerDialog.tsx +173 -8
  142. package/src/widgets/RichTextField.tsx +152 -25
  143. package/src/widgets/SelectField.tsx +53 -22
  144. package/src/widgets/SignatureField.tsx +2 -2
  145. package/src/widgets/SliderField.tsx +3 -3
  146. package/src/widgets/SummaryField.tsx +3 -3
  147. package/src/widgets/TagsField.placeholder.no-provider.test.tsx +68 -0
  148. package/src/widgets/TagsField.placeholder.test.tsx +95 -0
  149. package/src/widgets/TagsField.tsx +25 -4
  150. package/src/widgets/TextAreaField.tsx +172 -94
  151. package/src/widgets/TextField.tsx +5 -5
  152. package/src/widgets/TimeField.tsx +4 -4
  153. package/src/widgets/UrlField.tsx +6 -6
  154. package/src/widgets/UserField.tsx +3 -3
  155. package/src/widgets/VectorField.tsx +3 -3
  156. package/src/widgets/__tests__/FullscreenFieldEditor.i18n.test.tsx +248 -0
  157. package/src/widgets/__tests__/FullscreenFieldEditor.no-provider.test.tsx +116 -0
  158. package/src/widgets/__tests__/RichTextField.fullscreenDisabled.test.tsx +244 -0
  159. package/src/widgets/__tests__/RichTextField.mobileFullscreen.test.tsx +195 -0
  160. package/src/widgets/__tests__/TextAreaField.characterCount.announcements.test.tsx +417 -0
  161. package/src/widgets/__tests__/TextAreaField.characterCount.i18n.test.tsx +287 -0
  162. package/src/widgets/__tests__/TextAreaField.characterCount.no-provider.test.tsx +160 -0
  163. package/src/widgets/__tests__/TextAreaField.fullscreenCharacterCount.i18n.test.tsx +161 -0
  164. package/src/widgets/__tests__/TextAreaField.fullscreenCharacterCount.test.tsx +346 -0
  165. package/src/widgets/__tests__/TextAreaField.fullscreenDisabled.test.tsx +246 -0
  166. package/src/widgets/__tests__/TextAreaField.mobileFullscreen.test.tsx +175 -0
  167. package/src/widgets/file-value.ts +21 -5
  168. package/src/widgets/toDomProps.ts +175 -0
  169. package/src/widgets/types.ts +230 -7
  170. package/src/widgets/useFieldTranslation.ts +60 -0
  171. package/src/withFieldCarrier.tsx +75 -0
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * Address data structure
5
5
  */
@@ -14,4 +14,4 @@ export interface AddressValue {
14
14
  * Address field widget - provides a structured address input
15
15
  * Supports street, city, state, zip code, and country
16
16
  */
17
- export declare function AddressField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<AddressValue>): React.JSX.Element;
17
+ export declare function AddressField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<AddressValue>): React.JSX.Element;
File without changes
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * AutoNumberField - Read-only auto-generated field
5
5
  * Values are automatically generated by the system and cannot be edited
6
6
  */
7
- export declare function AutoNumberField({ value, field, ...props }: FieldWidgetProps<string | number>): React.JSX.Element;
7
+ export declare function AutoNumberField({ value, field, ...props }: FieldWidgetComponentProps<string | number>): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * Avatar field widget - provides an avatar/profile picture uploader
5
5
  * Supports image URLs or file uploads
6
6
  */
7
- export declare function AvatarField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
7
+ export declare function AvatarField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<string>): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * BooleanField - Toggle input supporting switch and checkbox variants
5
5
  * Renders as Switch or Checkbox based on field widget configuration
6
6
  */
7
- export declare function BooleanField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<boolean>): React.JSX.Element;
7
+ export declare function BooleanField({ value, onChange, field, readonly, ...props }: FieldWidgetComponentProps<boolean>): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * Parse the stored value into the selected capability-name list. The canonical
5
5
  * storage is a JSON-string array; we also tolerate an already-parsed array (in
@@ -7,5 +7,5 @@ import { FieldWidgetProps } from './types';
7
7
  * (legacy/hand-authored) so no selection is silently dropped.
8
8
  */
9
9
  export declare function parseCapabilityNames(value: unknown): string[];
10
- export declare function CapabilityMultiSelectField({ value, onChange, readonly, className, ...props }: FieldWidgetProps<string | string[]>): React.JSX.Element;
10
+ export declare function CapabilityMultiSelectField({ value, onChange, readonly, className, ...props }: FieldWidgetComponentProps<string | string[]>): React.JSX.Element;
11
11
  export default CapabilityMultiSelectField;
@@ -0,0 +1,56 @@
1
+ import { default as React } from 'react';
2
+ export interface CharacterCountProps {
3
+ /**
4
+ * Length of the text this surface is counting. The inline surface passes the
5
+ * committed value's length; the fullscreen dialog passes the DRAFT's, which
6
+ * is the number that is true of what the user is looking at.
7
+ */
8
+ length: number;
9
+ /**
10
+ * The declared cap. Callers render this component only when the field
11
+ * declares one, so it is non-optional here — a counter with no cap to count
12
+ * against has nothing to say and must not be mounted at all (an unconditional
13
+ * live region in every long-text field is the objectui#3408 defect back
14
+ * again).
15
+ */
16
+ maxLength: number;
17
+ /**
18
+ * The description node's `id`, minted by the host from `useId()`.
19
+ *
20
+ * The host MUST also name it in the edited control's `aria-describedby` —
21
+ * this component renders the sentence, only the host knows which element is
22
+ * being described, and a description nothing references is a node no screen
23
+ * reader will ever reach. That association is asserted from the OUTSIDE (the
24
+ * tests resolve `aria-describedby` and concatenate the referenced nodes' text,
25
+ * exactly as an assistive technology does) rather than trusted here.
26
+ *
27
+ * Two surfaces of one widget therefore need two ids: the dialog's draft and
28
+ * the inline value diverge the moment the user types in the dialog, so one
29
+ * shared id would point both controls at whichever sentence rendered last.
30
+ */
31
+ descriptionId: string;
32
+ /**
33
+ * Render node 3, the threshold-gated debounced `aria-live` status region.
34
+ *
35
+ * Required on purpose — see the component doc above. `false` removes the
36
+ * region from the DOM entirely (not merely empties it), which is the only
37
+ * form of "no live region" a test can tell apart from "a live region that
38
+ * happens to be silent right now".
39
+ */
40
+ announceNearLimit: boolean;
41
+ /**
42
+ * Classes for the visible digits. Required because placement is entirely the
43
+ * surface's business — inline pins them to the textarea's bottom-right
44
+ * corner, the dialog lays them out as a footer item — and a default borrowed
45
+ * from either one would position the other wrongly while looking deliberate.
46
+ */
47
+ className: string;
48
+ /**
49
+ * `data-testid` for the visible digits, namespaced per surface
50
+ * (`textarea-character-count`, `textarea-fullscreen-character-count`) so a
51
+ * test that finds digits can say WHICH surface it found them on. Same
52
+ * convention, same reason, as `FullscreenFieldEditor`'s `testIdPrefix`.
53
+ */
54
+ testId: string;
55
+ }
56
+ export declare function CharacterCount({ length, maxLength, descriptionId, announceNearLimit, className, testId, }: CharacterCountProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * CheckboxesField - select zero or more values from a fixed option set, rendered
5
5
  * as a list of checkboxes. The stored value is a string[]. Used for the
@@ -12,4 +12,4 @@ import { FieldWidgetProps } from './types';
12
12
  * first" hint while a dependency is empty, and selections no longer offered
13
13
  * (parent changed / predicate flipped) are pruned from the array.
14
14
  */
15
- export declare function CheckboxesField({ value, onChange, field, readonly, className, schema, dependentValues, dependsOn: dependsOnProp, emptyHint: _emptyHint, dataSource: _dataSource, ...props }: FieldWidgetProps<string[]>): React.JSX.Element;
15
+ export declare function CheckboxesField({ value, onChange, field, readonly, className, dependentValues, dependsOn: dependsOnProp, emptyHint, dataSource: _dataSource, error, ...props }: FieldWidgetComponentProps<string[]>): React.JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * Code field widget - provides a code editor with syntax highlighting
5
5
  * Uses a simple textarea with monospace font
6
6
  * For advanced code editing, use the @object-ui/plugin-editor component
7
7
  */
8
- export declare function CodeField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
8
+ export declare function CodeField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<string>): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * Color field widget - provides a color picker input
5
5
  * Supports hex color values (e.g., #ff0000)
6
6
  */
7
- export declare function ColorField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
7
+ export declare function ColorField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<string>): React.JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
3
- export declare function CurrencyField({ value, onChange, field, readonly, errorMessage, className, ...props }: FieldWidgetProps<number>): React.JSX.Element;
2
+ import { FieldWidgetComponentProps } from './types';
3
+ export declare function CurrencyField({ value, onChange, field, readonly, error, className, ...props }: FieldWidgetComponentProps<number>): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * DateField - Date picker input widget
5
5
  * Uses native date input and displays locale-formatted date in readonly mode
6
6
  */
7
- export declare function DateField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
7
+ export declare function DateField({ value, onChange, field, readonly, ...props }: FieldWidgetComponentProps<string>): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * DateTimeField - Combined date and time picker widget
5
5
  * Displays both date and time in locale format when readonly
6
6
  */
7
- export declare function DateTimeField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<string>): React.JSX.Element;
7
+ export declare function DateTimeField({ value, onChange, field, readonly, ...props }: FieldWidgetComponentProps<string>): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * EmailField - Email address input with mailto link in readonly mode
5
5
  * Renders as a clickable mailto link when readonly, standard email input otherwise
6
6
  */
7
- export declare function EmailField({ value, onChange, field, readonly, errorMessage, ...props }: FieldWidgetProps<string>): React.JSX.Element;
7
+ export declare function EmailField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<string>): React.JSX.Element;
@@ -1,11 +1,11 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * FileField - File upload widget with drag-and-drop support
5
5
  * Supports single and multiple file uploads with configurable accepted file types.
6
6
  * L2: File size validation, per-file progress indicators, error messages.
7
7
  */
8
- export declare function FileField({ value, onChange, field, readonly, onUploadingChange, ...props }: FieldWidgetProps<any>): React.JSX.Element;
8
+ export declare function FileField({ value, onChange, field, readonly, onUploadingChange, error, ...props }: FieldWidgetComponentProps<any>): React.JSX.Element;
9
9
  /**
10
10
  * FileCell — compact upload control for a line-item grid cell (objectui#2360).
11
11
  *
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  interface BuilderCondition {
4
4
  id: string;
5
5
  field: string;
@@ -32,5 +32,5 @@ export declare function kvToCondition(field: string, v: any, idx: number): Build
32
32
  * @internal exported for tests
33
33
  */
34
34
  export declare function isMatchAllCriteria(parsed: any): boolean;
35
- export declare function FilterConditionField({ value, onChange, readonly, className, ...props }: FieldWidgetProps<string | object>): React.JSX.Element;
35
+ export declare function FilterConditionField({ value, onChange, readonly, className, error, ...props }: FieldWidgetComponentProps<string | object>): React.JSX.Element;
36
36
  export default FilterConditionField;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * FormulaField - Read-only computed field
5
5
  * Values are computed on the backend and cannot be edited
6
6
  */
7
- export declare function FormulaField({ value, field, ...props }: FieldWidgetProps<any>): React.JSX.Element;
7
+ export declare function FormulaField({ value, field, ...props }: FieldWidgetComponentProps<any>): React.JSX.Element;
@@ -0,0 +1,155 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * The fullscreen-edit affordance shared by every long-text widget: the "expand"
4
+ * button plus the full-height dialog it opens.
5
+ *
6
+ * ## Why this is shared rather than copied
7
+ *
8
+ * `ObjectFormSchema.mobile.fullscreenLongText` is ONE form-level promise, and
9
+ * `ObjectForm` projects it onto EVERY long-text field as `mobile_fullscreen`
10
+ * (`field:textarea` → `TextAreaField`, `field:markdown` / `field:html` →
11
+ * `RichTextField`). A user who turns the setting on gets one behaviour, so the
12
+ * behaviour has one implementation. objectui#3301 is what the other
13
+ * arrangement costs: the flag reached `RichTextField` for as long as the
14
+ * feature has existed and that widget simply never read it, so half the
15
+ * documented promise ("textarea/rich-text get an expand button") silently did
16
+ * nothing. A second hand-written copy of the state machine is the same failure
17
+ * with an extra step — it drifts, and nothing reports the drift.
18
+ *
19
+ * What is genuinely per-widget is the EDITOR, so that is the only thing
20
+ * injected: `children` renders it against the draft. Everything a user can
21
+ * observe about the *interaction* — when the affordance appears, that the
22
+ * dialog seeds from the committed value, that typing stays local until "Done",
23
+ * that "Cancel" discards — lives here, once.
24
+ *
25
+ * ## Draft semantics (unchanged from the original `TextAreaField` behaviour)
26
+ *
27
+ * The dialog edits a LOCAL draft seeded from `value` at open time and commits
28
+ * once, on "Done". It deliberately does not stream every keystroke to the host:
29
+ * these widgets sit in a react-hook-form field, and per-keystroke `onChange`
30
+ * during a modal edit would mark the form dirty (and fire validation) for an
31
+ * edit the user may still cancel. "Cancel" therefore needs no undo — nothing
32
+ * was written.
33
+ *
34
+ * ## `disabled` (objectui#3402)
35
+ *
36
+ * The dialog is a SECOND editing surface for the same value, so a field that is
37
+ * not interactive has to be not interactive here too. It was not: hosts landed
38
+ * `disabled` on their inline control only, this component never declared the
39
+ * prop at all, and a disabled long-text field therefore sat correctly greyed out
40
+ * next to a live expand button — click it, type anything, press "Done", and the
41
+ * edit went into form state through `onCommit`. Measured on `origin/main`
42
+ * before the fix: inline `disabled=true`, toggle `disabled=false`, dialog input
43
+ * `disabled=false`, `onChange` called with "EDITED WHILE DISABLED".
44
+ *
45
+ * The gate is shaped like the built-in path's (`FullscreenTextarea` in
46
+ * `components/src/renderers/form/form.tsx`, objectui#3400/PR #3401), because
47
+ * one form-level setting must keep producing one behaviour on both paths:
48
+ *
49
+ * - the toggle STAYS but is `disabled` — `disabled` means "not interactive,
50
+ * muted", not "shown plainly", which is `readonly`'s job (and `readonly`
51
+ * never reaches this component at all — see below);
52
+ * - `openFullscreen` refuses independently of the attribute, since a
53
+ * programmatic dispatch and a lost `pointer-events` rule both get past it;
54
+ * - the dialog locks on its OWN — `disabled` is not merely a static flag, it is
55
+ * also the form's `isSubmitting`, which flips to true while the dialog may
56
+ * already be open. At that moment the toggle is no longer the gate. So the
57
+ * editor is told (third `children` argument) and "Done" is disabled;
58
+ * - and `onCommit` is gated, because that is the single point where a value can
59
+ * leave this component for host state. Nothing native guards it: it is a
60
+ * click handler on a different control reading React state.
61
+ *
62
+ * "Cancel" and `Esc` stay live in every state — a dialog that goes disabled
63
+ * mid-edit must still be closable, or a submit in flight traps the user in it.
64
+ *
65
+ * ## Why there is no `readonly` prop
66
+ *
67
+ * Both hosts early-return a read-only DISPLAY before they compute the affordance
68
+ * (`TextAreaField.tsx`, `RichTextField.tsx`), so this component is never
69
+ * rendered for a read-only field and a `readonly` prop here would be declared
70
+ * with no producer — the shape this package keeps deleting (objectui#3232/#3233).
71
+ * A future host that renders an editor for read-only fields must add the prop
72
+ * AND the producer together; do not add it "for symmetry" beforehand.
73
+ *
74
+ * ## `testIdPrefix`
75
+ *
76
+ * Each host passes its own (`textarea`, `richtext`), yielding the same
77
+ * convention with a per-widget namespace: `<prefix>-fullscreen-toggle` /
78
+ * `-dialog` / `-save`. One form can contain both a textarea and a markdown
79
+ * field, so a single shared id would make a test unable to say which widget it
80
+ * had found. The editor's own test id belongs to `children` for the same
81
+ * reason.
82
+ *
83
+ * ## Copy (objectui#3404)
84
+ *
85
+ * Every string here goes through `useFieldTranslation()` and consumes the
86
+ * EXISTING `form.fullscreen.*` / `common.cancel` keys — the same ones the
87
+ * built-in branch consumes since objectui#3272. Nothing was missing from the
88
+ * ten locale packs; this path simply never read them, so a zh session opened a
89
+ * dialog reading `Cancel` / `Done` while a long-text field rendered by the
90
+ * built-in branch **in the same form** read 「取消 / 完成」.
91
+ *
92
+ * Sharing the keys rather than minting `fields.fullscreen.*` twins is the
93
+ * point: one form-level setting (`mobile.fullscreenLongText`) projects onto
94
+ * both render paths, so two copies of this copy could only drift.
95
+ *
96
+ * `useFieldTranslation` (not bare `useObjectTranslation`) because this widget
97
+ * is rendered without an `I18nProvider` by standalone/embedded hosts and by
98
+ * every bare-render test in this package. Measured before the change: with no
99
+ * provider mounted `useObjectTranslation().t('common.cancel')` returns
100
+ * `"common.cancel"` — the raw key — and the `{{label}}` interpolation collapses
101
+ * entirely. The safe hook's English defaults are byte-identical to the literals
102
+ * they replaced, so the provider-less rendering is unchanged.
103
+ *
104
+ * Focus management, `Esc`, the overlay and the close button are Radix's, via
105
+ * the repo's `Dialog` (`@object-ui/components`) — deliberately not re-answered
106
+ * here.
107
+ */
108
+ export interface FullscreenFieldEditorProps {
109
+ /**
110
+ * The committed value. Seeds the draft each time the dialog opens — read at
111
+ * open time, not held, so a value that changes underneath while the dialog is
112
+ * closed is picked up on the next open.
113
+ */
114
+ value: string;
115
+ /** Called once with the draft when the user confirms. */
116
+ onCommit: (next: string) => void;
117
+ /** Field label — the dialog title and part of the toggle's accessible name. */
118
+ label?: string;
119
+ /** Namespace for this widget's fullscreen test ids. See above. */
120
+ testIdPrefix: string;
121
+ /**
122
+ * The host field is not interactive (objectui#3402). Disables the toggle, the
123
+ * "Done" button and the write-back, and is handed to `children` so the host's
124
+ * own editor renders disabled too. See the `disabled` section above for why
125
+ * each of those is a separate line rather than belt-and-braces.
126
+ *
127
+ * **Producer**: the widget's `disabled` prop, which the form renderer computes
128
+ * as `disabled || fieldDisabled || isSubmitting || optionGroupGated` and
129
+ * forwards to registered widgets (`stripRegisteredFieldProps` does not strip
130
+ * it).
131
+ */
132
+ disabled?: boolean;
133
+ /**
134
+ * The editor itself, rendered inside the dialog body against the draft. The
135
+ * host passes the SAME editor it renders inline, so "fullscreen" is a size
136
+ * change rather than a second, poorer editing surface.
137
+ *
138
+ * The third argument is this component's `disabled`, and the host is expected
139
+ * to put it on the control it renders: only the host knows which element its
140
+ * editor's disabled state belongs on. Ignoring it is not a write-back hole —
141
+ * `onCommit` is gated here regardless — but it does leave a control that looks
142
+ * editable while the field is not, so both in-repo hosts apply it and their
143
+ * tests pin it.
144
+ */
145
+ children: (draft: string, setDraft: (next: string) => void, disabled: boolean) => React.ReactNode;
146
+ /** Optional footer status for the draft (e.g. a character counter). */
147
+ footer?: (draft: string) => React.ReactNode;
148
+ /**
149
+ * Extra classes for the toggle button. It is absolutely positioned by
150
+ * default and expects a `relative` ancestor; a host whose layout has a
151
+ * better home for it can re-place it here.
152
+ */
153
+ toggleClassName?: string;
154
+ }
155
+ export declare function FullscreenFieldEditor({ value, onCommit, label, testIdPrefix, disabled, children, footer, toggleClassName, }: FullscreenFieldEditorProps): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * Geolocation data structure
5
5
  */
@@ -12,4 +12,4 @@ export interface GeolocationValue {
12
12
  * Geolocation field widget - provides a location picker with coordinates
13
13
  * Supports manual entry and browser geolocation API
14
14
  */
15
- export declare function GeolocationField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<GeolocationValue>): React.JSX.Element;
15
+ export declare function GeolocationField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<GeolocationValue>): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * GridField / LineItemsField — editable child-grid ("line items") widget.
5
5
  *
@@ -104,7 +104,7 @@ export declare function lookupAutofillPatch(columns: GridColumn[], col: GridColu
104
104
  export declare function computeRow(columns: GridColumn[], row: Row): Row;
105
105
  /** Sum a numeric column across rows (ignoring blanks/NaN). */
106
106
  export declare function sumColumn(rows: Row[], field: string): number;
107
- export declare function GridField({ value, onChange, field, readonly, disabled, className, onRowExpand, displayMode, onAdd, ...props }: FieldWidgetProps<Row[]> & {
107
+ export declare function GridField({ value, onChange, field, readonly, disabled, className, onRowExpand, displayMode, onAdd, ...props }: FieldWidgetComponentProps<Row[]> & {
108
108
  /** When provided, each row shows an "expand" button that opens the row in a
109
109
  * full form (the host — e.g. MasterDetailForm — renders the drawer/modal and
110
110
  * writes the edited values back). Lets a "fat" child be edited in a real form
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * ImageField - Image upload widget with preview thumbnails
5
5
  * Supports single and multiple image uploads with drag-and-drop and preview display
6
6
  */
7
- export declare function ImageField({ value, onChange, field, readonly, onUploadingChange, ...props }: FieldWidgetProps<any>): React.JSX.Element;
7
+ export declare function ImageField({ value, onChange, field, readonly, onUploadingChange, error, ...props }: FieldWidgetComponentProps<any>): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * LocationField - Geographic coordinate input for latitude and longitude
5
5
  * Stores location as { latitude, longitude } object and displays as comma-separated pair
6
6
  */
7
- export declare function LocationField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): React.JSX.Element;
7
+ export declare function LocationField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<any>): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  export interface LookupOption {
4
4
  value: string | number;
5
5
  label: string;
@@ -15,4 +15,4 @@ export interface LookupOption {
15
15
  * from the referenced object using `DataSource.find()`.
16
16
  * Falls back to static `options` when no DataSource is available.
17
17
  */
18
- export declare function LookupField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): React.JSX.Element;
18
+ export declare function LookupField({ value, onChange, field, readonly, error: fieldError, ...props }: FieldWidgetComponentProps<any>): React.JSX.Element;
@@ -0,0 +1,8 @@
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
+ export {};
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * Master-Detail relationship data structure
5
5
  */
@@ -12,4 +12,4 @@ export interface MasterDetailValue {
12
12
  * Master-Detail field widget - manages one-to-many relationships
13
13
  * Displays related records with add/remove capabilities
14
14
  */
15
- export declare function MasterDetailField({ value, onChange, field, readonly, className, ...props }: FieldWidgetProps<MasterDetailValue[]>): React.JSX.Element;
15
+ export declare function MasterDetailField({ value, onChange, field, readonly, className, ...props }: FieldWidgetComponentProps<MasterDetailValue[]>): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * MultiSelectField - select zero or more values from a fixed option set.
5
5
  *
@@ -14,4 +14,4 @@ import { FieldWidgetProps } from './types';
14
14
  * parent first" hint while a dependency is empty, and selections no longer
15
15
  * offered (parent changed / predicate flipped) are dropped from the array.
16
16
  */
17
- export declare function MultiSelectField({ value, onChange, field, readonly, className, schema, dependentValues, dependsOn: dependsOnProp, emptyHint: _emptyHint, dataSource: _dataSource, ...props }: FieldWidgetProps<string[]>): React.JSX.Element;
17
+ export declare function MultiSelectField({ value, onChange, field, readonly, className, dependentValues, dependsOn: dependsOnProp, emptyHint, dataSource: _dataSource, error, ...props }: FieldWidgetComponentProps<string[]>): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * NumberField - Numeric input with optional decimal precision
5
5
  * Supports min/max/step constraints and configurable decimal precision
6
6
  */
7
- export declare function NumberField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<number>): React.JSX.Element;
7
+ export declare function NumberField({ value, onChange, field, readonly, ...props }: FieldWidgetComponentProps<number>): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * ObjectField - JSON object editor
5
5
  * Allows editing structured JSON data
6
6
  */
7
- export declare function ObjectField({ value, onChange, field, readonly, ...props }: FieldWidgetProps<any>): React.JSX.Element;
7
+ export declare function ObjectField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<any>): React.JSX.Element;
@@ -1,4 +1,4 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
3
- export declare function ObjectRefField({ value, onChange, readonly, className, ...props }: FieldWidgetProps<string>): React.JSX.Element;
2
+ import { FieldWidgetComponentProps } from './types';
3
+ export declare function ObjectRefField({ value, onChange, readonly, className, error, ...props }: FieldWidgetComponentProps<string>): React.JSX.Element;
4
4
  export default ObjectRefField;
@@ -0,0 +1,45 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * The "this option list cannot be filled" state shared by every fixed-option
4
+ * widget (`SelectField` single, `MultiSelectField`, `RadioField`,
5
+ * `CheckboxesField`) — objectui#3231.
6
+ *
7
+ * ## One producer, one consumer
8
+ *
9
+ * `emptyHint` is a declared prop on `FieldWidgetComponentProps`, computed by
10
+ * the form renderer (`form.tsx`, the `#2284` dependency gate) and forwarded to
11
+ * these widgets. **When the host supplies it, it wins**: the host resolves the
12
+ * controlling fields to their human LABELS ("Select Country first"), where a
13
+ * widget on its own only knows the raw metadata names ("Select country first").
14
+ * Absent a host hint — a standalone widget, the inline grid editor, an action
15
+ * param dialog — the widget falls back to its own copy.
16
+ *
17
+ * Each of the four widgets used to inline this box, destructure `emptyHint`
18
+ * into `_emptyHint` and throw it away, then render a hardcoded English literal.
19
+ * Four independent copies is precisely why they drifted together, so the box
20
+ * AND the copy live here only: adding a fifth option widget cannot re-introduce
21
+ * the gap without deliberately re-implementing it.
22
+ *
23
+ * ## Fallback copy is translated
24
+ *
25
+ * The fallback goes through `useFieldTranslation()` (`fields.options.*`,
26
+ * present in all ten locale packs) rather than an English string literal — the
27
+ * gate sentence is the SAME i18n key the form renderer uses, so the two can
28
+ * never say different things in the same locale.
29
+ */
30
+ export interface OptionsEmptyStateProps {
31
+ /**
32
+ * Host-computed hint. Wins over the widget's own copy whenever it is a
33
+ * non-empty string — this is the whole point of the prop.
34
+ */
35
+ emptyHint?: string;
36
+ /** The list is waiting on a `dependsOn` controlling field (vs. unconfigured). */
37
+ gated: boolean;
38
+ /** Controlling field names, used by the fallback gate sentence. */
39
+ dependsOnFields: readonly string[];
40
+ /** Widget-specific stable locator, e.g. `select-empty-${fieldName}`. */
41
+ testId?: string;
42
+ /** Widget-specific sizing (the dropdown is a fixed `h-9`, lists grow). */
43
+ className?: string;
44
+ }
45
+ export declare function OptionsEmptyState({ emptyHint, gated, dependsOnFields, testId, className, }: OptionsEmptyStateProps): React.JSX.Element;
File without changes
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * PasswordField - Secure password input with visibility toggle
5
5
  * Includes show/hide toggle button and masks value in readonly mode
6
6
  */
7
- export declare function PasswordField({ value, onChange, field, readonly, className, ...props }: FieldWidgetProps<string>): React.JSX.Element;
7
+ export declare function PasswordField({ value, onChange, field, readonly, className, ...props }: FieldWidgetComponentProps<string>): React.JSX.Element;
@@ -1,8 +1,8 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * PercentField - Percentage input with configurable decimal precision
5
5
  * Stores values as decimals (0-1) and displays as percentages (0-100%)
6
6
  * Includes a slider for interactive control.
7
7
  */
8
- export declare function PercentField({ value, onChange, field, readonly, errorMessage, className, ...props }: FieldWidgetProps<number>): React.JSX.Element;
8
+ export declare function PercentField({ value, onChange, field, readonly, error, className, ...props }: FieldWidgetComponentProps<number>): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types';
3
3
  /**
4
4
  * PhoneField - Telephone number input with tel link in readonly mode
5
5
  * Renders as a clickable tel link when readonly, standard phone input otherwise
6
6
  */
7
- export declare function PhoneField({ value, onChange, field, readonly, errorMessage, ...props }: FieldWidgetProps<string>): React.JSX.Element;
7
+ export declare function PhoneField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<string>): React.JSX.Element;