@object-ui/fields 17.5.0 → 17.7.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 (249) hide show
  1. package/CHANGELOG.md +6150 -0
  2. package/README.md +108 -8
  3. package/dist/FieldEditWidget.d.ts +70 -8
  4. package/dist/coerceToSafeValue.d.ts +54 -0
  5. package/dist/currency.d.ts +1 -1
  6. package/dist/field-type-alias.d.ts +16 -0
  7. package/dist/index.cjs +5 -5
  8. package/dist/index.css +53 -11
  9. package/dist/index.d.ts +653 -128
  10. package/dist/index.js +4275 -3171
  11. package/dist/widgets/AddressField.d.ts +3 -3
  12. package/dist/widgets/AutoNumberField.d.ts +1 -1
  13. package/dist/widgets/AvatarField.d.ts +20 -4
  14. package/dist/widgets/BooleanField.d.ts +2 -2
  15. package/dist/widgets/CapabilityMultiSelectField.d.ts +1 -1
  16. package/dist/widgets/CheckboxesField.d.ts +1 -1
  17. package/dist/widgets/CodeField.d.ts +1 -1
  18. package/dist/widgets/ColorField.d.ts +1 -1
  19. package/dist/widgets/CurrencyField.d.ts +1 -1
  20. package/dist/widgets/DateField.d.ts +2 -2
  21. package/dist/widgets/DateTimeField.d.ts +2 -2
  22. package/dist/widgets/EmailField.d.ts +1 -1
  23. package/dist/widgets/FileField.d.ts +18 -2
  24. package/dist/widgets/FilterConditionField.d.ts +43 -2
  25. package/dist/widgets/FormulaField.d.ts +1 -1
  26. package/dist/widgets/FullscreenFieldEditor.d.ts +9 -2
  27. package/dist/widgets/GeolocationField.d.ts +10 -4
  28. package/dist/widgets/GridField.d.ts +102 -86
  29. package/dist/widgets/ImageField.d.ts +1 -1
  30. package/dist/widgets/LocationField.d.ts +31 -4
  31. package/dist/widgets/LookupField.d.ts +9 -1
  32. package/dist/widgets/MasterDetailField.d.ts +1 -1
  33. package/dist/widgets/MultiSelectField.d.ts +1 -1
  34. package/dist/widgets/NumberField.d.ts +2 -2
  35. package/dist/widgets/ObjectField.d.ts +10 -3
  36. package/dist/widgets/ObjectRefField.d.ts +1 -1
  37. package/dist/widgets/OptionsEmptyState.d.ts +38 -8
  38. package/dist/widgets/PasswordField.d.ts +15 -1
  39. package/dist/widgets/PeoplePicker.d.ts +17 -2
  40. package/dist/widgets/PercentField.d.ts +3 -2
  41. package/dist/widgets/PersonRow.d.ts +13 -2
  42. package/dist/widgets/PhoneField.d.ts +1 -1
  43. package/dist/widgets/QRCodeField.d.ts +1 -1
  44. package/dist/widgets/RadioField.d.ts +1 -1
  45. package/dist/widgets/RatingField.d.ts +1 -1
  46. package/dist/widgets/RecipientPickerField.d.ts +44 -1
  47. package/dist/widgets/RecordPickerDialog.d.ts +33 -16
  48. package/dist/widgets/RichTextField.d.ts +37 -1
  49. package/dist/widgets/SelectField.d.ts +1 -1
  50. package/dist/widgets/SelectionTray.d.ts +13 -2
  51. package/dist/widgets/SignatureField.d.ts +32 -2
  52. package/dist/widgets/SliderField.d.ts +37 -2
  53. package/dist/widgets/SummaryField.d.ts +1 -1
  54. package/dist/widgets/TagsField.d.ts +1 -1
  55. package/dist/widgets/TextAreaField.d.ts +6 -2
  56. package/dist/widgets/TextField.d.ts +2 -2
  57. package/dist/widgets/TimeField.d.ts +2 -2
  58. package/dist/widgets/UrlField.d.ts +1 -1
  59. package/dist/widgets/UserField.d.ts +1 -1
  60. package/dist/widgets/VectorField.d.ts +1 -1
  61. package/dist/widgets/_cell-renderer-bridge.d.ts +1 -1
  62. package/dist/widgets/address-format.d.ts +27 -7
  63. package/dist/widgets/file-affordance.d.ts +33 -0
  64. package/dist/widgets/file-size-guard.d.ts +5 -23
  65. package/dist/widgets/file-value.d.ts +38 -9
  66. package/dist/widgets/lookupColumnDisplay.d.ts +110 -0
  67. package/dist/widgets/nativeDateValue.d.ts +9 -27
  68. package/dist/widgets/number-format.d.ts +137 -0
  69. package/dist/widgets/numberBadInput.d.ts +135 -0
  70. package/dist/widgets/personDisplay.d.ts +22 -4
  71. package/dist/widgets/richTextDisplay.d.ts +116 -0
  72. package/dist/widgets/toDomProps.d.ts +10 -1
  73. package/dist/widgets/toHostGroupProps.d.ts +172 -21
  74. package/dist/widgets/toHostProps.d.ts +105 -0
  75. package/dist/widgets/types.d.ts +19 -6
  76. package/dist/widgets/upload-error-message.d.ts +6 -0
  77. package/dist/widgets/uploadingScope.d.ts +142 -0
  78. package/dist/widgets/useCascadingOptions.d.ts +3 -2
  79. package/dist/widgets/useRecordQuery.d.ts +4 -2
  80. package/dist/widgets/useUploadingSignal.d.ts +8 -0
  81. package/package.json +11 -13
  82. package/dist/widgets/CharacterCount.d.ts +0 -56
  83. package/src/FieldEditWidget.test.ts +0 -133
  84. package/src/FieldEditWidget.tsx +0 -207
  85. package/src/__tests__/AddressCellRenderer.test.tsx +0 -166
  86. package/src/__tests__/CurrencyField.minorUnits.test.tsx +0 -191
  87. package/src/__tests__/CurrencyField.symbol.test.tsx +0 -198
  88. package/src/__tests__/DateCellRenderer.test.tsx +0 -82
  89. package/src/__tests__/NumberCellRenderer.grouping.test.tsx +0 -146
  90. package/src/__tests__/NumberCellRenderer.test.tsx +0 -60
  91. package/src/__tests__/PercentCellRenderer.locale.test.tsx +0 -152
  92. package/src/__tests__/PercentCellRenderer.test.tsx +0 -115
  93. package/src/__tests__/boolean-label-association-e2e.test.tsx +0 -298
  94. package/src/__tests__/capability-multiselect-retired.test.ts +0 -109
  95. package/src/__tests__/cell-truncation.test.tsx +0 -96
  96. package/src/__tests__/composite-group-label-e2e.test.tsx +0 -436
  97. package/src/__tests__/composite-group-label-readonly-e2e.test.tsx +0 -403
  98. package/src/__tests__/date-formatter-residue-4272.test.ts +0 -120
  99. package/src/__tests__/date-locale-channel.test.tsx +0 -305
  100. package/src/__tests__/field-carrier-sdui.test.tsx +0 -169
  101. package/src/__tests__/formatCurrency.centsDigit.test.tsx +0 -158
  102. package/src/__tests__/formatCurrency.minorUnits.test.tsx +0 -221
  103. package/src/__tests__/group-labelling-declaration.test.ts +0 -148
  104. package/src/__tests__/lookupCellDisplayField.test.tsx +0 -107
  105. package/src/__tests__/lookupCellDisplayName.test.tsx +0 -119
  106. package/src/__tests__/lookupCellRecordLink.test.tsx +0 -171
  107. package/src/__tests__/lookupCellReferenceKey.test.tsx +0 -57
  108. package/src/__tests__/percent-cell-vs-measure-4576.test.ts +0 -115
  109. package/src/__tests__/percent-formatter-locale-4553.test.ts +0 -147
  110. package/src/__tests__/percent-tie-halfup-4590.test.ts +0 -224
  111. package/src/__tests__/registry-collision.test.ts +0 -91
  112. package/src/__tests__/resolveFieldCurrency.test.ts +0 -20
  113. package/src/__tests__/select-label-association-e2e.test.tsx +0 -199
  114. package/src/__tests__/spec-symbol-batch7.test.ts +0 -126
  115. package/src/__tests__/validation-feedback.test.tsx +0 -361
  116. package/src/__tests__/widget-aria-invalid-e2e.test.tsx +0 -265
  117. package/src/__tests__/widget-aria-invalid-registry-e2e.test.tsx +0 -338
  118. package/src/__tests__/widget-dom-leak-e2e.test.tsx +0 -357
  119. package/src/__tests__/widget-props-contract.test.tsx +0 -142
  120. package/src/coerce-safe-value.test.ts +0 -34
  121. package/src/complex-widgets.test.tsx +0 -924
  122. package/src/currency.ts +0 -144
  123. package/src/datetime-widgets.test.tsx +0 -185
  124. package/src/field-type-alias.multiple.test.ts +0 -81
  125. package/src/field-type-alias.ts +0 -156
  126. package/src/field-type-coverage.test.ts +0 -67
  127. package/src/index.css +0 -44
  128. package/src/index.tsx +0 -2745
  129. package/src/standard-widgets.test.tsx +0 -364
  130. package/src/widgets/AddressField.postalCode.test.tsx +0 -257
  131. package/src/widgets/AddressField.tsx +0 -182
  132. package/src/widgets/AddressField.uniqueIds.test.tsx +0 -93
  133. package/src/widgets/AutoNumberField.tsx +0 -18
  134. package/src/widgets/AvatarField.tsx +0 -117
  135. package/src/widgets/BooleanField.tsx +0 -86
  136. package/src/widgets/CapabilityMultiSelectField.test.tsx +0 -168
  137. package/src/widgets/CapabilityMultiSelectField.tsx +0 -241
  138. package/src/widgets/CharacterCount.tsx +0 -263
  139. package/src/widgets/CheckboxesField.cascade.test.tsx +0 -143
  140. package/src/widgets/CheckboxesField.tsx +0 -169
  141. package/src/widgets/CodeField.tsx +0 -41
  142. package/src/widgets/ColorField.tsx +0 -53
  143. package/src/widgets/CurrencyField.tsx +0 -135
  144. package/src/widgets/DateField.tsx +0 -40
  145. package/src/widgets/DateTimeField.tsx +0 -46
  146. package/src/widgets/EmailField.tsx +0 -37
  147. package/src/widgets/FileField.tsx +0 -512
  148. package/src/widgets/FilterConditionField.tsx +0 -454
  149. package/src/widgets/FormulaField.tsx +0 -38
  150. package/src/widgets/FullscreenFieldEditor.tsx +0 -60
  151. package/src/widgets/GeolocationField.tsx +0 -193
  152. package/src/widgets/GeolocationField.uniqueIds.test.tsx +0 -88
  153. package/src/widgets/GridField.test.tsx +0 -632
  154. package/src/widgets/GridField.tsx +0 -1070
  155. package/src/widgets/ImageCropperDialog.tsx +0 -245
  156. package/src/widgets/ImageField.maxSize.test.tsx +0 -154
  157. package/src/widgets/ImageField.tsx +0 -305
  158. package/src/widgets/ImageLightbox.test.tsx +0 -52
  159. package/src/widgets/ImageLightbox.tsx +0 -108
  160. package/src/widgets/LocationField.tsx +0 -57
  161. package/src/widgets/LookupField.dependsOn.test.tsx +0 -233
  162. package/src/widgets/LookupField.gateHintLabel.test.tsx +0 -135
  163. package/src/widgets/LookupField.hydration.test.tsx +0 -136
  164. package/src/widgets/LookupField.idField.test.tsx +0 -61
  165. package/src/widgets/LookupField.tsx +0 -1295
  166. package/src/widgets/MarkdownContent.tsx +0 -19
  167. package/src/widgets/MasterDetailField.tsx +0 -131
  168. package/src/widgets/MultiSelectField.cascade.test.tsx +0 -143
  169. package/src/widgets/MultiSelectField.tsx +0 -196
  170. package/src/widgets/NumberField.tsx +0 -49
  171. package/src/widgets/ObjectField.tsx +0 -94
  172. package/src/widgets/ObjectRefField.tsx +0 -121
  173. package/src/widgets/OptionsEmptyState.no-provider.test.tsx +0 -88
  174. package/src/widgets/OptionsEmptyState.test.tsx +0 -169
  175. package/src/widgets/OptionsEmptyState.tsx +0 -99
  176. package/src/widgets/PasswordField.tsx +0 -49
  177. package/src/widgets/PeoplePicker.test.tsx +0 -360
  178. package/src/widgets/PeoplePicker.tsx +0 -579
  179. package/src/widgets/PeoplePickerComponents.test.tsx +0 -104
  180. package/src/widgets/PercentField.tsx +0 -95
  181. package/src/widgets/PersonRow.tsx +0 -117
  182. package/src/widgets/PhoneField.tsx +0 -37
  183. package/src/widgets/QRCodeField.tsx +0 -103
  184. package/src/widgets/RadioField.cascade.test.tsx +0 -141
  185. package/src/widgets/RadioField.tsx +0 -143
  186. package/src/widgets/RatingField.tsx +0 -94
  187. package/src/widgets/RecipientPickerField.test.tsx +0 -157
  188. package/src/widgets/RecipientPickerField.tsx +0 -188
  189. package/src/widgets/RecordPickerDialog.baseFilterShapes.test.tsx +0 -191
  190. package/src/widgets/RecordPickerDialog.dateLocale.test.tsx +0 -124
  191. package/src/widgets/RecordPickerDialog.filterOptions.test.tsx +0 -611
  192. package/src/widgets/RecordPickerDialog.selectLabel.test.tsx +0 -112
  193. package/src/widgets/RecordPickerDialog.tsx +0 -1365
  194. package/src/widgets/RichTextField.tsx +0 -176
  195. package/src/widgets/SelectField.cascade.test.tsx +0 -138
  196. package/src/widgets/SelectField.tsx +0 -193
  197. package/src/widgets/SelectionTray.tsx +0 -110
  198. package/src/widgets/SignatureField.tsx +0 -140
  199. package/src/widgets/SliderField.tsx +0 -39
  200. package/src/widgets/SummaryField.tsx +0 -31
  201. package/src/widgets/TagsField.placeholder.no-provider.test.tsx +0 -68
  202. package/src/widgets/TagsField.placeholder.test.tsx +0 -95
  203. package/src/widgets/TagsField.tsx +0 -88
  204. package/src/widgets/TextAreaField.tsx +0 -213
  205. package/src/widgets/TextField.tsx +0 -45
  206. package/src/widgets/TimeField.tsx +0 -31
  207. package/src/widgets/UrlField.tsx +0 -46
  208. package/src/widgets/UserField.tsx +0 -59
  209. package/src/widgets/UserFieldPicker.test.tsx +0 -78
  210. package/src/widgets/VectorField.tsx +0 -29
  211. package/src/widgets/__tests__/FilterConditionField.matchAll.test.ts +0 -66
  212. package/src/widgets/__tests__/FilterConditionField.operators.test.ts +0 -166
  213. package/src/widgets/__tests__/FullscreenFieldEditor.i18n.test.tsx +0 -248
  214. package/src/widgets/__tests__/FullscreenFieldEditor.no-provider.test.tsx +0 -116
  215. package/src/widgets/__tests__/RichTextField.fullscreenDisabled.test.tsx +0 -244
  216. package/src/widgets/__tests__/RichTextField.mobileFullscreen.test.tsx +0 -195
  217. package/src/widgets/__tests__/TextAreaField.characterCount.announcements.test.tsx +0 -417
  218. package/src/widgets/__tests__/TextAreaField.characterCount.i18n.test.tsx +0 -287
  219. package/src/widgets/__tests__/TextAreaField.characterCount.no-provider.test.tsx +0 -160
  220. package/src/widgets/__tests__/TextAreaField.fullscreenCharacterCount.i18n.test.tsx +0 -161
  221. package/src/widgets/__tests__/TextAreaField.fullscreenCharacterCount.test.tsx +0 -346
  222. package/src/widgets/__tests__/TextAreaField.fullscreenDisabled.test.tsx +0 -246
  223. package/src/widgets/__tests__/TextAreaField.mobileFullscreen.test.tsx +0 -175
  224. package/src/widgets/_cell-renderer-bridge.ts +0 -19
  225. package/src/widgets/address-format.ts +0 -120
  226. package/src/widgets/deriveLookupColumns.test.ts +0 -112
  227. package/src/widgets/deriveLookupColumns.ts +0 -108
  228. package/src/widgets/file-size-guard.ts +0 -55
  229. package/src/widgets/file-value.test.ts +0 -230
  230. package/src/widgets/file-value.ts +0 -246
  231. package/src/widgets/nativeDateValue.test.ts +0 -115
  232. package/src/widgets/nativeDateValue.ts +0 -112
  233. package/src/widgets/openNativePicker.ts +0 -18
  234. package/src/widgets/optionWidgets.gatedOptions.test.tsx +0 -267
  235. package/src/widgets/optionWidgets.unconfiguredOptions.test.tsx +0 -150
  236. package/src/widgets/personDisplay.test.ts +0 -113
  237. package/src/widgets/personDisplay.ts +0 -92
  238. package/src/widgets/recentLookups.test.ts +0 -45
  239. package/src/widgets/recentLookups.ts +0 -47
  240. package/src/widgets/toDomProps.ts +0 -204
  241. package/src/widgets/toHostGroupProps.ts +0 -102
  242. package/src/widgets/types.ts +0 -242
  243. package/src/widgets/useCascadingOptions.ts +0 -46
  244. package/src/widgets/useFieldTranslation.ts +0 -132
  245. package/src/widgets/useRecordQuery.test.ts +0 -174
  246. package/src/widgets/useRecordQuery.ts +0 -291
  247. package/src/widgets/useUploadingSignal.test.tsx +0 -62
  248. package/src/widgets/useUploadingSignal.ts +0 -20
  249. package/src/withFieldCarrier.tsx +0 -75
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
3
- import { AddressValue } from './address-format';
4
- export type { AddressValue } from './address-format';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
+ import { AddressValue } from './address-format.js';
4
+ export type { AddressValue } from './address-format.js';
5
5
  /**
6
6
  * Address field widget - provides a structured address input
7
7
  * Supports street, city, state, postal code, and country
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
3
  /**
4
4
  * AutoNumberField - Read-only auto-generated field
5
5
  * Values are automatically generated by the system and cannot be edited
@@ -1,7 +1,23 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
3
  /**
4
- * Avatar field widget - provides an avatar/profile picture uploader
5
- * Supports image URLs or file uploads
4
+ * Avatar field widget - provides an avatar/profile picture uploader.
5
+ *
6
+ * `avatar` is a member of the file-reference family, so its stored value is
7
+ * the bare `sys_file` id, exactly as for `file` and `image` (see
8
+ * `file-value`'s "Submitting"). A pick uploads through the ambient
9
+ * `UploadProvider` (`useUpload()`), and the id the adapter surfaced in
10
+ * `meta.fileId` is what `onChange` receives, through `fileValueForSubmit` —
11
+ * the one submit rule the file and image widgets use. A pick whose adapter
12
+ * surfaced no id (the object-URL default `useUpload()` falls back to when no
13
+ * provider is mounted, an S3/Azure-style adapter that mints no `sys_file`
14
+ * row) is refused with the same translated "did not complete" row, and the
15
+ * field is not changed. ⛔ The widget used to read the pick into a `data:` URL
16
+ * and store that string, inlining the whole image into the record row as a
17
+ * value the stored contract refuses (objectui#10785).
18
+ *
19
+ * Reading is `readFileValue`'s: a bare id renders from the storage endpoint,
20
+ * and a legacy `data:` or http(s) URL already on a record still renders as
21
+ * itself — ADR-0104's dual-read window is a read rule.
6
22
  */
7
- export declare function AvatarField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<string>): React.JSX.Element;
23
+ export declare function AvatarField({ value, onChange, field, readonly, onUploadingChange, error, ...props }: FieldWidgetComponentProps<string>): React.JSX.Element;
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
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 }: FieldWidgetComponentProps<boolean>): React.JSX.Element;
7
+ export declare function BooleanField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<boolean>): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
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
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
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
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
3
  /**
4
4
  * Code field widget - provides a code editor with syntax highlighting
5
5
  * Uses a simple textarea with monospace font
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
3
  /**
4
4
  * Color field widget - provides a color picker input
5
5
  * Supports hex color values (e.g., #ff0000)
@@ -1,3 +1,3 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
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 { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
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 }: FieldWidgetComponentProps<string>): React.JSX.Element;
7
+ export declare function DateField({ 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 { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
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 }: FieldWidgetComponentProps<string>): React.JSX.Element;
7
+ export declare function DateTimeField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<string>): React.JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
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
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
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.
@@ -15,7 +15,7 @@ export declare function FileField({ value, onChange, field, readonly, onUploadin
15
15
  * drag-and-drop zone — a grid cell has no room for one; the per-row expand
16
16
  * form still offers the full-size FileField.
17
17
  */
18
- export declare function FileCell({ value, onChange, disabled, multiple, accept, maxSize, 'aria-label': ariaLabel, 'data-cell': dataCell, }: {
18
+ export declare function FileCell({ value, onChange, disabled, multiple, accept, maxSize, error, 'aria-label': ariaLabel, 'data-cell': dataCell, }: {
19
19
  value: any;
20
20
  onChange: (value: any) => void;
21
21
  disabled?: boolean;
@@ -24,6 +24,22 @@ export declare function FileCell({ value, onChange, disabled, multiple, accept,
24
24
  accept?: string;
25
25
  /** Max file size in bytes (oversize picks are rejected with an inline error). */
26
26
  maxSize?: number;
27
+ /**
28
+ * The active validation message for this cell, named as
29
+ * `@objectstack/spec/ui`'s `FieldWidgetPropsSchema` names it — the same
30
+ * published slot `FieldWidgetComponentProps` declares and `LookupField` /
31
+ * `FileField` above already consume (objectui#5431, completing #3318's
32
+ * per-cell delivery). NOT the per-pick upload `errors` this component
33
+ * computes itself — this is the HOST's verdict on the cell's value.
34
+ *
35
+ * **Producer**: `GridField`, for a required-but-empty `file` cell.
36
+ * **Consumer**: drives `aria-invalid` on the picker button — the focusable
37
+ * control assistive tech reads a control state from (objectui#5223; a mark
38
+ * on the non-focusable wrapper is exactly what the registry sweep forbids).
39
+ * The message TEXT stays with the cell's `title` in `GridField`; rendering
40
+ * it here would double-display it.
41
+ */
42
+ error?: string;
27
43
  'aria-label'?: string;
28
44
  /** Focus-grid coordinate (see GridField keyboard navigation). */
29
45
  'data-cell'?: string;
@@ -1,22 +1,63 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
3
  interface BuilderCondition {
4
4
  id: string;
5
5
  field: string;
6
6
  operator: string;
7
7
  value: any;
8
8
  }
9
+ /**
10
+ * Opt-in FilterBuilder operators this widget offers (objectui#4736).
11
+ *
12
+ * The shared dropdown withholds these because two of its three consumers
13
+ * persist into dialects that cannot carry them (see `OPT_IN_OPERATORS` in
14
+ * `@object-ui/components`'s `filter-builder.tsx`). THIS widget can: its value
15
+ * is a MongoDB-style `FieldOperatorsSchema` criteria that the server's engine
16
+ * evaluates directly — never lowered through the array/triplet AST and never
17
+ * folded into a `ViewFilterRule` — so the spec's `FILTER_OPERATORS` is the only
18
+ * vocabulary it has to satisfy.
19
+ *
20
+ * - `exists` / `notExists` author `$exists`, which `condToMongo` has emitted
21
+ * and `kvToCondition` has read back since objectui#2942. Naming them here
22
+ * is what KEEPS them reachable now that the shared dropdown no longer
23
+ * offers them to the list and view surfaces, whose dialects have no
24
+ * existence operator at all (objectui#4736). They are NOT folded onto
25
+ * `is_not_null` / `is_null` (objectui#9559 ruling B, objectui#9306): on the
26
+ * key-presence drivers that would change which records a stored sharing
27
+ * rule matches.
28
+ *
29
+ * The case-insensitive contains used to be named here too, as
30
+ * `containsCaseInsensitive`. Since objectui#9306 it is the protocol's own
31
+ * `icontains` and an ordinary operator every consumer is offered, so there is
32
+ * nothing to opt into; it still authors `$icontains`, exactly as before.
33
+ *
34
+ * Module scope, not an inline literal: a fresh array each render would reset
35
+ * `FilterBuilder`'s memo inputs on every keystroke.
36
+ *
37
+ * @internal exported for tests
38
+ */
39
+ export declare const FILTER_CONDITION_EXTRA_OPERATORS: readonly string[];
9
40
  /**
10
41
  * Builder condition → `$`-operator criteria. Exported for tests: this is the
11
42
  * chokepoint where a builder token becomes a spec `FieldOperatorsSchema` key,
12
43
  * and a wrong spelling here is rejected downstream by `convertFiltersToAST`
13
44
  * rather than at authoring time. @internal
45
+ *
46
+ * ⚠️ The arms are keyed on the builder's PROTOCOL ids (objectui#9306), and the
47
+ * `default` arm stores an EQUALITY. So an operator id with no arm here is not
48
+ * refused — it silently becomes `{ [field]: value }`, which for a
49
+ * `greater_than_or_equal` row would share a different set of records than the
50
+ * one on screen. Every id the dropdown can draw has its own arm, and
51
+ * `filter-builder-protocol-ids-census-9306.test.ts` (app-shell) pins each one's
52
+ * stored predicate, so a missing arm is a red test rather than a quiet `$eq`.
14
53
  */
15
54
  export declare function condToMongo(c: BuilderCondition, typeOf: (f: string) => string | undefined): Record<string, any> | null;
16
55
  /**
17
56
  * Criteria → builder condition (the reverse of {@link condToMongo}). Returning
18
57
  * `null` makes the builder refuse to load the rule ("criteria can't be
19
58
  * represented"), so this must keep accepting spellings previously written.
59
+ * The rows it produces carry the builder's protocol ids (objectui#9306); the
60
+ * stored criteria are `$`-tokens, which that change did not touch.
20
61
  * @internal
21
62
  */
22
63
  export declare function kvToCondition(field: string, v: any, idx: number): BuilderCondition | null;
@@ -24,7 +65,7 @@ export declare function kvToCondition(field: string, v: any, idx: number): Build
24
65
  * Would this criteria select EVERY record of the object?
25
66
  *
26
67
  * Mirrors the server's `isMatchAllCriteria` (objectstack `plugin-sharing`,
27
- * #3896) closely enough to warn before the round-trip: blank, `{}`, `[]`, and
68
+ * objectstack-ai/objectstack#3896) closely enough to warn before the round-trip: blank, `{}`, `[]`, and
28
69
  * the vacuous combinators. Deliberately conservative in the same direction —
29
70
  * the cost of a false positive is one extra hint, the cost of a false negative
30
71
  * is a save that fails with a toast. The server stays authoritative.
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
3
  /**
4
4
  * FormulaField - Read-only computed field
5
5
  * Values are computed on the backend and cannot be edited
@@ -36,8 +36,15 @@ import { FullscreenEditorProps } from '@object-ui/components';
36
36
  * primitive already answers it (no affordance at all).
37
37
  *
38
38
  * Everything else — `value` / `onCommit` / `label` / `testIdPrefix` /
39
- * `disabled` / `children` / `footer` — passes straight through, so the hosts and
40
- * their pins are unchanged. `testIdPrefix` still namespaces this package's ids
39
+ * `disabled` / `error` / `children` / `footer` — passes straight through, so the
40
+ * hosts and their pins are unchanged. `error` is REQUIRED by the primitive
41
+ * (objectui#4824) and stays required here: both hosts already destructure it off
42
+ * the widget props contract (objectui#3222), and it is what the primitive turns
43
+ * into the dialog control's `aria-invalid` / `aria-errormessage` and into the
44
+ * dialog-local message node. A host that omits it gets a dialog announcing
45
+ * `aria-invalid="false"` for an invalid field, which is the defect #4824
46
+ * measured — so the type system asks for it rather than trusting the next
47
+ * author to remember. `testIdPrefix` still namespaces this package's ids
41
48
  * (`textarea-`, `richtext-`), distinct from the built-in branch's
42
49
  * `form-textarea-`, so a test can still say which render path it found.
43
50
  */
@@ -1,12 +1,18 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
3
  /**
4
4
  * Geolocation data structure
5
5
  */
6
6
  export interface GeolocationValue {
7
- latitude?: number;
8
- longitude?: number;
9
- accuracy?: number;
7
+ /**
8
+ * `number | null` since objectui#6848. `null` is what an emptied box emits —
9
+ * the spelling `CurrencyField` / `PercentField` / `NumberField` already used
10
+ * for the same user action — so the type has to admit it. `undefined` stays
11
+ * admissible because an untouched coordinate is genuinely absent.
12
+ */
13
+ latitude?: number | null;
14
+ longitude?: number | null;
15
+ accuracy?: number | null;
10
16
  }
11
17
  /**
12
18
  * Geolocation field widget - provides a location picker with coordinates
@@ -1,99 +1,110 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
+ import { InlineGridColumn } from '@objectstack/spec/data';
3
4
  /**
4
5
  * GridField / LineItemsField — editable child-grid ("line items") widget.
5
6
  *
7
+ * ## Where the host's label and help text land, and why (objectui#4857)
8
+ *
9
+ * This widget forwarded nothing a host handed it, so the field's visible label
10
+ * pointed `for` at an id no element carried and the help text had zero
11
+ * consumers. Measured on `origin/main` at `e71c854ce`, a real form, editable
12
+ * state, `description` set:
13
+ *
14
+ * ```
15
+ * bare (no columns) for=DANGLING hostIdEl=NONE consumers=0 focusables=[button]
16
+ * columns + one row for=DANGLING hostIdEl=NONE consumers=0 focusables=[drag,
17
+ * input(Item), input(Qty), button(Duplicate row),
18
+ * button(Remove row), input(Item), input(Qty), button(Add)]
19
+ * ```
20
+ *
21
+ * The bare row's single focusable is the auxiliary "Add line" BUTTON — labelable,
22
+ * but routing the host id (and so the label's `for`) onto it would make the
23
+ * field's label NAME the add-row action and make a click on the label insert a
24
+ * row. Every realistic config is a composite: many cell inputs, each with its
25
+ * own `aria-label`, under one container. So this widget declares
26
+ * `labelling: 'group'` (see `FIELD_WIDGET_LABELLING` in `../index`) — the
27
+ * objectui#3961 composite shape, like `address` — and the CONTAINER consumes the
28
+ * host's keys:
29
+ *
30
+ * - editable / list mode: the root div takes the DOM pass-through minus `name`
31
+ * (DOM-legal on form controls only — the objectui#3291 leak) and minus
32
+ * `aria-invalid` (control-channel state; this grid reports validity per CELL,
33
+ * with its own inline marks), answering `role="group"` only when a host
34
+ * actually named it — `CheckboxesField`'s split, key for key.
35
+ *
36
+ * That strip STANDS (objectui#3318 upheld it rather than overturning it):
37
+ * the container is not a control, so the host's state is not re-routed onto
38
+ * it. What #3318 added is the other half the strip implied but nobody had
39
+ * built — the host's failure now DRIVES the per-cell channel this comment
40
+ * already claimed as the reporting path. See `hostFailedEmpty`.
41
+ * - readonly: the table replaces the inputs entirely, so that surface takes the
42
+ * name AND the description via `toHostGroupProps` — `'instead-of-the-inputs'`.
43
+ *
6
44
  * A controlled component: `value` is an array of row objects, `onChange`
7
45
  * receives the next array. It renders one editable cell per configured
8
46
  * column, supports add / delete row, and shows a running total of a numeric
9
47
  * column. This is the renderer for the `field:grid` widget and the cell
10
48
  * engine behind the master-detail subform (see ADR-0001).
11
49
  *
12
- * Column config (a subset of `GridColumnDefinition`):
13
- * { field, label?, type?, options?, width?, required?, prefix?, step? }
14
- * type ∈ 'text' | 'number' | 'currency' | 'date' | 'datetime' | 'time'
15
- * | 'select' | 'lookup' | 'file'
50
+ * Column config: `@objectstack/spec`'s inline grid column, by reference —
51
+ * see {@link GridColumn}.
16
52
  *
17
- * Field-level config (from `GridFieldMetadata`):
18
- * columns, min_rows, max_rows, allow_add, allow_delete, total_field
53
+ * Field-level config: the keys `GridFieldMetadata` (`@object-ui/types`)
54
+ * declares, each read under that one spelling (objectui#11070 round 8), and
55
+ * no other key: `sort_field`, the last key read before any face declared it,
56
+ * is declared there too (objectui#11070 round 9).
19
57
  */
20
- export interface GridColumn {
21
- field: string;
22
- label?: string;
23
- /**
24
- * Cell control + read/write adapter for the column.
25
- *
26
- * `date` / `datetime` / `time` are three DISTINCT controls, not one
27
- * (objectui#3569). Collapsing `datetime` onto the `date` control did not
28
- * merely under-render it — `<input type="date">` hands back a bare
29
- * `YYYY-MM-DD` on change, so touching the day of a `datetime` cell silently
30
- * DELETED its time component from the record.
31
- */
32
- type?: 'text' | 'number' | 'currency' | 'date' | 'datetime' | 'time' | 'select' | 'lookup' | 'file';
33
- options?: Array<{
34
- label: string;
35
- value: string;
36
- }>;
37
- width?: number;
38
- required?: boolean;
39
- prefix?: string;
40
- step?: number;
41
- /** For `type: 'lookup'` — the referenced object and label/id fields. */
42
- reference?: string;
43
- displayField?: string;
44
- idField?: string;
45
- /** Multi-value column: multi-record lookup, or multi-file upload cell. */
46
- multiple?: boolean;
47
- /** For `type: 'file'` — accepted MIME types / extensions for the picker
48
- * (e.g. `['image/*', '.pdf']`). Omit to accept anything. */
49
- accept?: string[];
50
- /**
51
- * Hidden from the grid by default but revealable via the column chooser.
52
- * Set by `deriveColumns` for fields beyond the default-visible budget — the
53
- * data is NOT dropped (it's just collapsed, like Odoo's `optional` columns /
54
- * Salesforce column personalization), so business-critical fields stay
55
- * reachable. Required columns are never default-hidden.
56
- */
57
- defaultHidden?: boolean;
58
- /**
59
- * A computed (read-only) column whose value is derived live from sibling
60
- * cells via {@link expr} — e.g. an invoice line's `amount = quantity *
61
- * unit_price`. The grid renders it read-only, recomputes it as the row's
62
- * inputs change, and writes the result back into the row so it persists
63
- * (and any running total reflects it). The classic spreadsheet pattern used
64
- * by QuickBooks / Stripe / NetSuite line grids — nobody types the amount.
65
- */
66
- computed?: boolean;
67
- /** Arithmetic expression for a {@link computed} column. Supports `+ - * / %`,
68
- * parentheses, numeric literals and field refs (`record.qty` or bare `qty`). */
69
- expr?: string;
70
- /** Decimal places to round a computed numeric/currency result to. */
71
- scale?: number;
72
- /** For `type: 'lookup'` — when a record is picked, copy its fields into any
73
- * sibling columns of the same name (e.g. a product's unit_price/description).
74
- * On by default for lookup columns; set `false` to disable the auto-fill. */
75
- autofill?: boolean;
76
- /**
77
- * CEL predicate: when TRUE for this row, the cell is **read-only** (B2 field
78
- * rules, generalized to grid cells). Evaluated per row against the row as
79
- * `record` plus the header as `parent` (so a line locks when
80
- * `parent.status == 'paid'` *or* on an intra-row condition like
81
- * `record.kind == 'auto'`). Client-side UX; fails open (stays editable).
82
- */
83
- readonlyWhen?: string | {
84
- dialect?: string;
85
- source: string;
86
- };
87
- /**
88
- * CEL predicate: when TRUE for this row, the cell is **required** (flagged
89
- * inline-invalid while empty). Same `record` + `parent` scope as
90
- * {@link readonlyWhen}.
91
- */
92
- requiredWhen?: string | {
93
- dialect?: string;
94
- source: string;
95
- };
96
- }
58
+ /**
59
+ * One grid column — `@objectstack/spec`'s inline grid column
60
+ * (`InlineGridColumn`, the element of `FieldSchema.inlineColumns`), BY
61
+ * REFERENCE (objectui#11070). The spec declares that shape as the strict
62
+ * mirror of this widget's column, so the widget's type IS the spec's: one
63
+ * declaration, the same one `GridFieldMetadata.columns` and
64
+ * `FormField.columns` (`@object-ui/types`) carry. This widget reads each
65
+ * column by exactly the spec's keys — every key below is one the spec
66
+ * declares, and there is no second spelling of any of them.
67
+ *
68
+ * How the widget reads the keys (the spec's own descriptions say what each
69
+ * MEANS; these are the renderer's notes):
70
+ *
71
+ * - `name` — the key a column reads and writes on each row object. There is
72
+ * deliberately no tolerant alias bridging the spelling objectui#3951
73
+ * retired to this one: a single spelling, enforced at the producer —
74
+ * AGENTS.md #0.1 (the spec refuses the retired spelling by name).
75
+ * (Wording note: do not restate that rule as an alternation expression over
76
+ * the two key names. `column-identity.ratchet.test.ts` (objectui#3104) scans
77
+ * these files line by line and cannot tell prose from code, so spelling the
78
+ * shape out here registers as a new dual read and fails the gate.)
79
+ * - `type` — the cell control and its read/write adapter. `date` /
80
+ * `datetime` / `time` are three DISTINCT controls, not one
81
+ * (objectui#3569): `<input type="date">` hands back a bare `YYYY-MM-DD` on
82
+ * change, so collapsing `datetime` onto it silently DELETED the time
83
+ * component from the record.
84
+ * - `prefix` — a symbol shown in a `currency` cell IN PLACE OF the resolved
85
+ * currency's own symbol. When absent, the cell shows the symbol of the
86
+ * currency it resolves (objectui#10355); there is no default symbol.
87
+ * - `defaultHidden` — collapsed into the column chooser, not dropped
88
+ * (`deriveColumns` sets it beyond the default-visible budget). Required
89
+ * columns are never default-hidden.
90
+ * - `computed` + `expr` — a read-only column recomputed live from sibling
91
+ * cells by this file's own safe arithmetic evaluator (`+ - * / %`,
92
+ * parentheses, numeric literals, `record.qty` or bare `qty`), and written
93
+ * back into the row so it persists and any running total reflects it.
94
+ * - `scale` — decimal places for a computed `number` result. ⛔ Not read on
95
+ * a `currency` column (objectui#10783): the resolved currency's ISO 4217
96
+ * minor unit decides both the stored and the shown width
97
+ * (`currencyWidth`), and the spec refuses `scale` on a column declaring
98
+ * `type: 'currency'`. A column that takes `currency` from its child field
99
+ * at render time is reported by `hydrateColumns` in
100
+ * `@object-ui/plugin-form` instead of being read in silence.
101
+ * - `autofill` — for a `lookup` column: picking a record copies its fields
102
+ * into sibling columns of the same name. On unless set `false`.
103
+ * - `readonlyWhen` / `requiredWhen` — CEL predicates evaluated per row
104
+ * against the row as `record` plus the header as `parent`. Client-side UX;
105
+ * a predicate that faults fails open.
106
+ */
107
+ export type GridColumn = InlineGridColumn;
97
108
  type Row = Record<string, any>;
98
109
  /** Evaluate an arithmetic `expr` against `row`. null when blank/unparseable. */
99
110
  export declare function evalArith(expr: string, row: Row): number | null;
@@ -111,10 +122,15 @@ export declare function evalArith(expr: string, row: Row): number | null;
111
122
  * it is unit-testable independent of the picker UI.
112
123
  */
113
124
  export declare function lookupAutofillPatch(columns: GridColumn[], col: GridColumn, record: any): Row;
114
- export declare function computeRow(columns: GridColumn[], row: Row): Row;
125
+ /**
126
+ * @param tenantCurrency the tenant's default currency (`useLocalization()`),
127
+ * the resolver's last step for a `currency` column — see
128
+ * {@link storedFractionScale}.
129
+ */
130
+ export declare function computeRow(columns: GridColumn[], row: Row, tenantCurrency?: string): Row;
115
131
  /** Sum a numeric column across rows (ignoring blanks/NaN). */
116
132
  export declare function sumColumn(rows: Row[], field: string): number;
117
- export declare function GridField({ value, onChange, field, readonly, disabled, className, onRowExpand, displayMode, onAdd, ...props }: FieldWidgetComponentProps<Row[]> & {
133
+ export declare function GridField({ value, onChange, field, readonly, disabled, className, error, onRowExpand, displayMode, onAdd, ...props }: FieldWidgetComponentProps<Row[]> & {
118
134
  /** When provided, each row shows an "expand" button that opens the row in a
119
135
  * full form (the host — e.g. MasterDetailForm — renders the drawer/modal and
120
136
  * writes the edited values back). Lets a "fat" child be edited in a real form
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
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
@@ -1,7 +1,34 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { LocationValue } from '@objectstack/spec/data';
3
+ import { FieldWidgetComponentProps } from './types.js';
3
4
  /**
4
- * LocationField - Geographic coordinate input for latitude and longitude
5
- * Stores location as { latitude, longitude } object and displays as comma-separated pair
5
+ * The stored shape of a `type: 'location'` value — RE-EXPORTED from
6
+ * `@objectstack/spec/data`, never re-declared here (objectui#6272).
7
+ *
8
+ * `LocationValue` is `z.input` of the spec's `LocationValueSchema`
9
+ * (`{ lat, lng, altitude?, accuracy? }`), which is what `valueSchemaFor({ type:
10
+ * 'location' })` validates a stored location against. A second local
11
+ * declaration under the spec's own name is objectstack#4115's failure class and
12
+ * is refused by `scripts/check-spec-symbol-derivation.mjs` — it was refused on
13
+ * the closed PR #6418, which is why this is a bare re-export.
6
14
  */
7
- export declare function LocationField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<any>): React.JSX.Element;
15
+ export type { LocationValue } from '@objectstack/spec/data';
16
+ /**
17
+ * LocationField - Geographic coordinate input for a `type: 'location'` value.
18
+ *
19
+ * Reads and writes `@objectstack/spec`'s `LocationValue` (`{ lat, lng }`) and
20
+ * displays it as the comma-separated pair a user types. The coordinates are
21
+ * still called latitude and longitude to a human — only the STORED key names
22
+ * are the spec's (objectui#6272), which is why the placeholder names the two
23
+ * coordinates rather than the `lat`/`lng` keys. That is a statement about KEY
24
+ * NAMES, not about language: the placeholder's words are the reader's, from
25
+ * the locale packs (objectui#8149, {@link placeholderPair}).
26
+ *
27
+ * ⚠️ BREAKING (objectui#6272): a record stored in the deprecated
28
+ * `{ latitude, longitude }` spelling — including one this widget itself wrote
29
+ * before the flip — now renders EMPTY here until it is re-saved or fixed at the
30
+ * data layer. It keeps rendering correctly in detail views and on the map,
31
+ * which read the spec spelling first. That cost was presented and accepted as
32
+ * part of the A1 ruling; it is not an oversight to route around with a shim.
33
+ */
34
+ export declare function LocationField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<LocationValue | null>): React.JSX.Element;
@@ -1,8 +1,16 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
3
  export interface LookupOption {
4
4
  value: string | number;
5
5
  label: string;
6
+ /**
7
+ * Secondary text: searched by the popover typeahead alongside the label, and
8
+ * rendered as supporting text. For AUTHORED static options this is the
9
+ * declared `SelectOptionMetadata.description` (objectui#6153 — declared
10
+ * there, and on `@objectstack/spec`'s `SelectOptionSchema`, precisely
11
+ * because this widget consumes it); for fetched records `recordToOption`
12
+ * derives it from `descriptionField`.
13
+ */
6
14
  description?: string;
7
15
  [key: string]: any;
8
16
  }
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
3
  /**
4
4
  * Master-Detail relationship data structure
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
3
  /**
4
4
  * MultiSelectField - select zero or more values from a fixed option set.
5
5
  *
@@ -1,7 +1,7 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
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 }: FieldWidgetComponentProps<number>): React.JSX.Element;
7
+ export declare function NumberField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<number>): React.JSX.Element;
@@ -1,7 +1,14 @@
1
1
  import { default as React } from 'react';
2
- import { FieldWidgetComponentProps } from './types';
2
+ import { FieldWidgetComponentProps } from './types.js';
3
3
  /**
4
- * ObjectField - JSON object editor
5
- * Allows editing structured JSON data
4
+ * ObjectField - JSON editor for a structured value.
5
+ *
6
+ * The form face of the free-form JSON types: `object`, `composite`, `record`, and
7
+ * since objectui#11448 `json`, which used to alias the raw-text code editor and
8
+ * so showed a stored object as `[object Object]` and saved an edit as a string.
9
+ * A json value need not be an object — an array, a number, a string, a boolean
10
+ * and `null` are all JSON — and this editor shows and parses each of them as
11
+ * itself: the box holds `JSON.stringify(value, null, 2)` and an edit emits
12
+ * `JSON.parse(text)`.
6
13
  */
7
14
  export declare function ObjectField({ value, onChange, field, readonly, error, ...props }: FieldWidgetComponentProps<any>): React.JSX.Element;