@mistriwork/kit 1.0.0-rc.10 → 1.0.0-rc.12

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 (970) hide show
  1. package/dist/client/actionGrants.d.ts +21 -0
  2. package/dist/client/actionGrants.js +24 -0
  3. package/dist/client/addressMount.d.ts +67 -0
  4. package/dist/client/addressMount.js +136 -0
  5. package/dist/client/app.d.ts +10 -0
  6. package/dist/client/app.js +976 -0
  7. package/dist/client/boot.d.ts +1 -0
  8. package/dist/client/boot.js +37 -0
  9. package/dist/client/brandLook.css +125 -0
  10. package/dist/client/breakdownBatch.d.ts +34 -0
  11. package/dist/client/breakdownBatch.js +115 -0
  12. package/dist/client/bulkActions.d.ts +66 -0
  13. package/dist/client/bulkActions.js +171 -0
  14. package/dist/client/chart.d.ts +20 -0
  15. package/dist/client/chart.js +80 -0
  16. package/dist/client/clauses.d.ts +121 -0
  17. package/dist/client/clauses.js +276 -0
  18. package/dist/client/columns.d.ts +77 -0
  19. package/dist/client/columns.js +102 -0
  20. package/dist/client/components/Accordion.d.ts +26 -0
  21. package/dist/client/components/Accordion.js +44 -0
  22. package/dist/client/components/ApiOperations.d.ts +3 -0
  23. package/dist/client/components/ApiOperations.js +162 -0
  24. package/dist/client/components/AppColumnMenu.d.ts +66 -0
  25. package/dist/client/components/AppColumnMenu.js +59 -0
  26. package/dist/client/components/AppColumnMenuPopups.d.ts +21 -0
  27. package/dist/client/components/AppColumnMenuPopups.js +92 -0
  28. package/dist/client/components/AppFooter.css +17 -0
  29. package/dist/client/components/AppFooter.d.ts +23 -0
  30. package/dist/client/components/AppFooter.js +12 -0
  31. package/dist/client/components/AppIssues.d.ts +4 -0
  32. package/dist/client/components/AppIssues.js +18 -0
  33. package/dist/client/components/AppList.d.ts +20 -0
  34. package/dist/client/components/AppList.js +696 -0
  35. package/dist/client/components/AttachmentList.d.ts +45 -0
  36. package/dist/client/components/AttachmentList.js +178 -0
  37. package/dist/client/components/BoardList.css +9 -0
  38. package/dist/client/components/Breakdown.d.ts +11 -0
  39. package/dist/client/components/Breakdown.js +157 -0
  40. package/dist/client/components/BreakdownRoom.d.ts +4 -0
  41. package/dist/client/components/BreakdownRoom.js +48 -0
  42. package/dist/client/components/CardsList.d.ts +23 -0
  43. package/dist/client/components/CardsList.js +209 -0
  44. package/dist/client/components/Chart.css +165 -0
  45. package/dist/client/components/Chart.d.ts +194 -0
  46. package/dist/client/components/Chart.js +801 -0
  47. package/dist/client/components/ChartFigure.d.ts +82 -0
  48. package/dist/client/components/ChartFigure.js +102 -0
  49. package/dist/client/components/ChartShapes.css +213 -0
  50. package/dist/client/components/ChartShapes.d.ts +63 -0
  51. package/dist/client/components/ChartShapes.js +393 -0
  52. package/dist/client/components/Checklist.css +16 -0
  53. package/dist/client/components/Composer.d.ts +1 -0
  54. package/dist/client/components/Composer.js +331 -0
  55. package/dist/client/components/Content.d.ts +8 -0
  56. package/dist/client/components/Content.js +170 -0
  57. package/dist/client/components/CountedLabel.d.ts +10 -0
  58. package/dist/client/components/CountedLabel.js +26 -0
  59. package/dist/client/components/Crumbs.d.ts +11 -0
  60. package/dist/client/components/Crumbs.js +142 -0
  61. package/dist/client/components/DashboardList.css +7 -0
  62. package/dist/client/components/DashboardList.d.ts +9 -0
  63. package/dist/client/components/DashboardList.js +46 -0
  64. package/dist/client/components/DashboardNote.d.ts +21 -0
  65. package/dist/client/components/DashboardNote.js +22 -0
  66. package/dist/client/components/DateField.css +6 -0
  67. package/dist/client/components/DateField.d.ts +7 -0
  68. package/dist/client/components/DateField.js +27 -0
  69. package/dist/client/components/DefinedFields.d.ts +50 -0
  70. package/dist/client/components/DefinedFields.js +186 -0
  71. package/dist/client/components/DeleteButton.d.ts +30 -0
  72. package/dist/client/components/DeleteButton.js +198 -0
  73. package/dist/client/components/Diagram.d.ts +7 -0
  74. package/dist/client/components/Diagram.js +320 -0
  75. package/dist/client/components/Dressed.d.ts +31 -0
  76. package/dist/client/components/Dressed.js +138 -0
  77. package/dist/client/components/Dropdown.d.ts +14 -0
  78. package/dist/client/components/Dropdown.js +20 -0
  79. package/dist/client/components/EditLayoutButton.d.ts +13 -0
  80. package/dist/client/components/EditLayoutButton.js +7 -0
  81. package/dist/client/components/Editable.d.ts +47 -0
  82. package/dist/client/components/Editable.js +422 -0
  83. package/dist/client/components/ErrorBoundary.d.ts +40 -0
  84. package/dist/client/components/ErrorBoundary.js +41 -0
  85. package/dist/client/components/Export.d.ts +15 -0
  86. package/dist/client/components/Export.js +151 -0
  87. package/dist/client/components/ExportHold.d.ts +18 -0
  88. package/dist/client/components/ExportHold.js +30 -0
  89. package/dist/client/components/FavoriteStar.d.ts +5 -0
  90. package/dist/client/components/FavoriteStar.js +14 -0
  91. package/dist/client/components/FieldArranger.d.ts +28 -0
  92. package/dist/client/components/FieldArranger.js +82 -0
  93. package/dist/client/components/FilePreview.css +20 -0
  94. package/dist/client/components/FilePreview.d.ts +26 -0
  95. package/dist/client/components/FilePreview.js +170 -0
  96. package/dist/client/components/FilterBoxes.d.ts +76 -0
  97. package/dist/client/components/FilterBoxes.js +294 -0
  98. package/dist/client/components/FilterRail.css +100 -0
  99. package/dist/client/components/FilterRail.d.ts +61 -0
  100. package/dist/client/components/FilterRail.js +559 -0
  101. package/dist/client/components/Gallery.d.ts +11 -0
  102. package/dist/client/components/Gallery.js +53 -0
  103. package/dist/client/components/Grid.d.ts +122 -0
  104. package/dist/client/components/Grid.js +1115 -0
  105. package/dist/client/components/GridCellEditor.d.ts +35 -0
  106. package/dist/client/components/GridCellEditor.js +291 -0
  107. package/dist/client/components/GridSelection.d.ts +16 -0
  108. package/dist/client/components/GridSelection.js +28 -0
  109. package/dist/client/components/HelpPanel.d.ts +5 -0
  110. package/dist/client/components/HelpPanel.js +92 -0
  111. package/dist/client/components/History.d.ts +10 -0
  112. package/dist/client/components/History.js +22 -0
  113. package/dist/client/components/Icon.d.ts +31 -0
  114. package/dist/client/components/Icon.js +20 -0
  115. package/dist/client/components/JsonPreview.d.ts +5 -0
  116. package/dist/client/components/JsonPreview.js +25 -0
  117. package/dist/client/components/JsonValue.d.ts +4 -0
  118. package/dist/client/components/JsonValue.js +3 -0
  119. package/dist/client/components/JsonView.css +109 -0
  120. package/dist/client/components/JsonView.d.ts +3 -0
  121. package/dist/client/components/JsonView.js +118 -0
  122. package/dist/client/components/Landing.d.ts +19 -0
  123. package/dist/client/components/Landing.js +55 -0
  124. package/dist/client/components/LandingSurface.css +177 -0
  125. package/dist/client/components/LandingSurface.d.ts +42 -0
  126. package/dist/client/components/LandingSurface.js +108 -0
  127. package/dist/client/components/LayoutBuilder.d.ts +36 -0
  128. package/dist/client/components/LayoutBuilder.js +104 -0
  129. package/dist/client/components/Lightbox.d.ts +29 -0
  130. package/dist/client/components/Lightbox.js +62 -0
  131. package/dist/client/components/ListEmpty.css +13 -0
  132. package/dist/client/components/ListEmpty.d.ts +10 -0
  133. package/dist/client/components/ListEmpty.js +8 -0
  134. package/dist/client/components/ListFilterBar.css +76 -0
  135. package/dist/client/components/ListFilterBar.d.ts +52 -0
  136. package/dist/client/components/ListFilterBar.js +304 -0
  137. package/dist/client/components/LiveNotices.css +105 -0
  138. package/dist/client/components/LiveNotices.d.ts +26 -0
  139. package/dist/client/components/LiveNotices.js +211 -0
  140. package/dist/client/components/MinorMoneyInput.d.ts +26 -0
  141. package/dist/client/components/MinorMoneyInput.js +50 -0
  142. package/dist/client/components/Modal.css +3 -0
  143. package/dist/client/components/MultiStepForm.css +122 -0
  144. package/dist/client/components/MultiStepForm.d.ts +59 -0
  145. package/dist/client/components/MultiStepForm.js +216 -0
  146. package/dist/client/components/NavGlyph.d.ts +14 -0
  147. package/dist/client/components/NavGlyph.js +27 -0
  148. package/dist/client/components/Nested.d.ts +21 -0
  149. package/dist/client/components/Nested.js +86 -0
  150. package/dist/client/components/NewRecord.d.ts +89 -0
  151. package/dist/client/components/NewRecord.js +897 -0
  152. package/dist/client/components/NewRecordButton.d.ts +13 -0
  153. package/dist/client/components/NewRecordButton.js +28 -0
  154. package/dist/client/components/Notes.css +39 -0
  155. package/dist/client/components/Notes.d.ts +59 -0
  156. package/dist/client/components/Notes.js +96 -0
  157. package/dist/client/components/OverflowMenu.d.ts +3 -0
  158. package/dist/client/components/OverflowMenu.js +60 -0
  159. package/dist/client/components/Page.d.ts +52 -0
  160. package/dist/client/components/Page.js +237 -0
  161. package/dist/client/components/PageCurrent.d.ts +38 -0
  162. package/dist/client/components/PageCurrent.js +27 -0
  163. package/dist/client/components/PageEmptyRun.d.ts +18 -0
  164. package/dist/client/components/PageEmptyRun.js +118 -0
  165. package/dist/client/components/PageFields.d.ts +3 -0
  166. package/dist/client/components/PageFields.js +294 -0
  167. package/dist/client/components/PageFlowDiagram.css +193 -0
  168. package/dist/client/components/PageFlowDiagram.d.ts +95 -0
  169. package/dist/client/components/PageFlowDiagram.js +276 -0
  170. package/dist/client/components/PageFlows.css +27 -0
  171. package/dist/client/components/PageFlows.d.ts +54 -0
  172. package/dist/client/components/PageFlows.js +92 -0
  173. package/dist/client/components/PageGroups.d.ts +43 -0
  174. package/dist/client/components/PageGroups.js +123 -0
  175. package/dist/client/components/PageHead.d.ts +28 -0
  176. package/dist/client/components/PageHead.js +279 -0
  177. package/dist/client/components/PageHeadline.d.ts +23 -0
  178. package/dist/client/components/PageHeadline.js +101 -0
  179. package/dist/client/components/PageHistory.d.ts +62 -0
  180. package/dist/client/components/PageHistory.js +160 -0
  181. package/dist/client/components/PageLayout.d.ts +22 -0
  182. package/dist/client/components/PageLayout.js +13 -0
  183. package/dist/client/components/PageMetrics.d.ts +11 -0
  184. package/dist/client/components/PageMetrics.js +252 -0
  185. package/dist/client/components/PageRelated.d.ts +70 -0
  186. package/dist/client/components/PageRelated.js +667 -0
  187. package/dist/client/components/PageRoom.d.ts +37 -0
  188. package/dist/client/components/PageRoom.js +277 -0
  189. package/dist/client/components/PageSectionBox.d.ts +28 -0
  190. package/dist/client/components/PageSectionBox.js +65 -0
  191. package/dist/client/components/PageSections.d.ts +38 -0
  192. package/dist/client/components/PageSections.js +352 -0
  193. package/dist/client/components/PageSkeleton.css +17 -0
  194. package/dist/client/components/PageSkeleton.d.ts +11 -0
  195. package/dist/client/components/PageSkeleton.js +25 -0
  196. package/dist/client/components/PageTimeline.d.ts +2 -0
  197. package/dist/client/components/PageTimeline.js +273 -0
  198. package/dist/client/components/Palette.d.ts +4 -0
  199. package/dist/client/components/Palette.js +176 -0
  200. package/dist/client/components/Peek.d.ts +1 -0
  201. package/dist/client/components/Peek.js +158 -0
  202. package/dist/client/components/PeekPanel.d.ts +16 -0
  203. package/dist/client/components/PeekPanel.js +120 -0
  204. package/dist/client/components/Picker.d.ts +13 -0
  205. package/dist/client/components/Picker.js +33 -0
  206. package/dist/client/components/Prefs.d.ts +3 -0
  207. package/dist/client/components/Prefs.js +121 -0
  208. package/dist/client/components/PresentationSwitch.d.ts +13 -0
  209. package/dist/client/components/PresentationSwitch.js +10 -0
  210. package/dist/client/components/Prompt.d.ts +35 -0
  211. package/dist/client/components/Prompt.js +114 -0
  212. package/dist/client/components/QrCode.css +11 -0
  213. package/dist/client/components/QrCode.d.ts +4 -0
  214. package/dist/client/components/QrCode.js +57 -0
  215. package/dist/client/components/QueueList.css +122 -0
  216. package/dist/client/components/QuickAdd.css +18 -0
  217. package/dist/client/components/QuickAdd.d.ts +11 -0
  218. package/dist/client/components/QuickAdd.js +53 -0
  219. package/dist/client/components/QuickAddOnDemand.d.ts +4 -0
  220. package/dist/client/components/QuickAddOnDemand.js +10 -0
  221. package/dist/client/components/Record.d.ts +36 -0
  222. package/dist/client/components/Record.js +385 -0
  223. package/dist/client/components/RecordGone.d.ts +7 -0
  224. package/dist/client/components/RecordGone.js +22 -0
  225. package/dist/client/components/RecordPicker.d.ts +59 -0
  226. package/dist/client/components/RecordPicker.js +299 -0
  227. package/dist/client/components/RecordSummaries.d.ts +55 -0
  228. package/dist/client/components/RecordSummaries.js +151 -0
  229. package/dist/client/components/RecordTags.d.ts +6 -0
  230. package/dist/client/components/RecordTags.js +119 -0
  231. package/dist/client/components/RecordTrailNav.d.ts +25 -0
  232. package/dist/client/components/RecordTrailNav.js +110 -0
  233. package/dist/client/components/RichText.d.ts +7 -0
  234. package/dist/client/components/RichText.js +82 -0
  235. package/dist/client/components/RichTextEditor.css +202 -0
  236. package/dist/client/components/RichTextEditor.d.ts +33 -0
  237. package/dist/client/components/RichTextEditor.js +348 -0
  238. package/dist/client/components/RichTextField.d.ts +26 -0
  239. package/dist/client/components/RichTextField.js +71 -0
  240. package/dist/client/components/Rooms.d.ts +35 -0
  241. package/dist/client/components/Rooms.js +276 -0
  242. package/dist/client/components/RowActions.d.ts +8 -0
  243. package/dist/client/components/RowActions.js +49 -0
  244. package/dist/client/components/RowHost.d.ts +110 -0
  245. package/dist/client/components/RowHost.js +212 -0
  246. package/dist/client/components/SavedViews.d.ts +25 -0
  247. package/dist/client/components/SavedViews.js +35 -0
  248. package/dist/client/components/SchemaExport.d.ts +15 -0
  249. package/dist/client/components/SchemaExport.js +42 -0
  250. package/dist/client/components/SectionPeriod.css +14 -0
  251. package/dist/client/components/SectionPeriod.d.ts +7 -0
  252. package/dist/client/components/SectionPeriod.js +14 -0
  253. package/dist/client/components/SetFieldDialog.d.ts +12 -0
  254. package/dist/client/components/SetFieldDialog.js +51 -0
  255. package/dist/client/components/Sidebar.d.ts +34 -0
  256. package/dist/client/components/Sidebar.js +398 -0
  257. package/dist/client/components/Skeleton.d.ts +35 -0
  258. package/dist/client/components/Skeleton.js +49 -0
  259. package/dist/client/components/SortMenu.d.ts +20 -0
  260. package/dist/client/components/SortMenu.js +45 -0
  261. package/dist/client/components/SplitListDetail.css +119 -0
  262. package/dist/client/components/SuggestBox.d.ts +29 -0
  263. package/dist/client/components/SuggestBox.js +60 -0
  264. package/dist/client/components/Summary.d.ts +14 -0
  265. package/dist/client/components/Summary.js +93 -0
  266. package/dist/client/components/TableRoom.d.ts +88 -0
  267. package/dist/client/components/TableRoom.js +246 -0
  268. package/dist/client/components/TableView.d.ts +111 -0
  269. package/dist/client/components/TableView.js +324 -0
  270. package/dist/client/components/ThMenu.d.ts +40 -0
  271. package/dist/client/components/ThMenu.js +163 -0
  272. package/dist/client/components/ThemeLab.d.ts +4 -0
  273. package/dist/client/components/ThemeLab.js +67 -0
  274. package/dist/client/components/TimelineSides.css +23 -0
  275. package/dist/client/components/TimelineSides.d.ts +7 -0
  276. package/dist/client/components/TimelineSides.js +9 -0
  277. package/dist/client/components/Tour.d.ts +12 -0
  278. package/dist/client/components/Tour.js +131 -0
  279. package/dist/client/components/Value.d.ts +38 -0
  280. package/dist/client/components/Value.js +172 -0
  281. package/dist/client/components/WorkPanel.d.ts +9 -0
  282. package/dist/client/components/WorkPanel.js +43 -0
  283. package/dist/client/components/WorkflowStatus.d.ts +6 -0
  284. package/dist/client/components/WorkflowStatus.js +44 -0
  285. package/dist/client/components/WriteConfirm.d.ts +4 -0
  286. package/dist/client/components/WriteConfirm.js +27 -0
  287. package/dist/client/components/appColumnMenuModel.d.ts +46 -0
  288. package/dist/client/components/appColumnMenuModel.js +51 -0
  289. package/dist/client/components/appListModel.d.ts +179 -0
  290. package/dist/client/components/appListModel.js +421 -0
  291. package/dist/client/components/appRooms.d.ts +106 -0
  292. package/dist/client/components/appRooms.js +133 -0
  293. package/dist/client/components/autoChart.d.ts +33 -0
  294. package/dist/client/components/autoChart.js +107 -0
  295. package/dist/client/components/avatarPhotos.d.ts +45 -0
  296. package/dist/client/components/avatarPhotos.js +93 -0
  297. package/dist/client/components/besideDetail.d.ts +1 -0
  298. package/dist/client/components/besideDetail.js +10 -0
  299. package/dist/client/components/boardNew.d.ts +2 -0
  300. package/dist/client/components/boardNew.js +8 -0
  301. package/dist/client/components/cardsModel.d.ts +11 -0
  302. package/dist/client/components/cardsModel.js +24 -0
  303. package/dist/client/components/chromeIcons.d.ts +16 -0
  304. package/dist/client/components/chromeIcons.js +16 -0
  305. package/dist/client/components/columnPresentation.d.ts +8 -0
  306. package/dist/client/components/columnPresentation.js +47 -0
  307. package/dist/client/components/componentSlot.d.ts +31 -0
  308. package/dist/client/components/componentSlot.js +76 -0
  309. package/dist/client/components/composerDraft.d.ts +16 -0
  310. package/dist/client/components/composerDraft.js +16 -0
  311. package/dist/client/components/conditionText.d.ts +14 -0
  312. package/dist/client/components/conditionText.js +45 -0
  313. package/dist/client/components/conditionWords.d.ts +37 -0
  314. package/dist/client/components/conditionWords.js +382 -0
  315. package/dist/client/components/crumbSlot.d.ts +14 -0
  316. package/dist/client/components/crumbSlot.js +49 -0
  317. package/dist/client/components/dashboardModel.d.ts +283 -0
  318. package/dist/client/components/dashboardModel.js +415 -0
  319. package/dist/client/components/dashboardParts.d.ts +9 -0
  320. package/dist/client/components/dashboardParts.js +18 -0
  321. package/dist/client/components/diagramModel.d.ts +83 -0
  322. package/dist/client/components/diagramModel.js +211 -0
  323. package/dist/client/components/dueOpen.d.ts +1 -0
  324. package/dist/client/components/dueOpen.js +23 -0
  325. package/dist/client/components/editInteraction.d.ts +20 -0
  326. package/dist/client/components/editInteraction.js +178 -0
  327. package/dist/client/components/favoriteNav.d.ts +6 -0
  328. package/dist/client/components/favoriteNav.js +31 -0
  329. package/dist/client/components/favorites.d.ts +23 -0
  330. package/dist/client/components/favorites.js +86 -0
  331. package/dist/client/components/filePreviewModel.d.ts +18 -0
  332. package/dist/client/components/filePreviewModel.js +21 -0
  333. package/dist/client/components/filterRailModel.d.ts +93 -0
  334. package/dist/client/components/filterRailModel.js +302 -0
  335. package/dist/client/components/formControlsStyle.d.ts +1 -0
  336. package/dist/client/components/formControlsStyle.js +3 -0
  337. package/dist/client/components/formDefaults.d.ts +17 -0
  338. package/dist/client/components/formDefaults.js +128 -0
  339. package/dist/client/components/gridArrange.d.ts +33 -0
  340. package/dist/client/components/gridArrange.js +62 -0
  341. package/dist/client/components/gridCellModel.d.ts +32 -0
  342. package/dist/client/components/gridCellModel.js +42 -0
  343. package/dist/client/components/gridSizing.d.ts +89 -0
  344. package/dist/client/components/gridSizing.js +295 -0
  345. package/dist/client/components/groupMoves.d.ts +44 -0
  346. package/dist/client/components/groupMoves.js +295 -0
  347. package/dist/client/components/groupOrder.d.ts +43 -0
  348. package/dist/client/components/groupOrder.js +63 -0
  349. package/dist/client/components/inputRenderers.d.ts +48 -0
  350. package/dist/client/components/inputRenderers.js +37 -0
  351. package/dist/client/components/intakeStyle.d.ts +2 -0
  352. package/dist/client/components/intakeStyle.js +6 -0
  353. package/dist/client/components/jsonModel.d.ts +98 -0
  354. package/dist/client/components/jsonModel.js +264 -0
  355. package/dist/client/components/listColumn.d.ts +20 -0
  356. package/dist/client/components/listColumn.js +31 -0
  357. package/dist/client/components/listNavigation.d.ts +16 -0
  358. package/dist/client/components/listNavigation.js +14 -0
  359. package/dist/client/components/mentionRows.d.ts +5 -0
  360. package/dist/client/components/mentionRows.js +62 -0
  361. package/dist/client/components/mount.d.ts +55 -0
  362. package/dist/client/components/mount.js +155 -0
  363. package/dist/client/components/myViews.d.ts +54 -0
  364. package/dist/client/components/myViews.js +82 -0
  365. package/dist/client/components/navCounts.d.ts +84 -0
  366. package/dist/client/components/navCounts.js +194 -0
  367. package/dist/client/components/navigationTree.d.ts +52 -0
  368. package/dist/client/components/navigationTree.js +49 -0
  369. package/dist/client/components/newMenuModel.d.ts +27 -0
  370. package/dist/client/components/newMenuModel.js +58 -0
  371. package/dist/client/components/newRecordModel.d.ts +58 -0
  372. package/dist/client/components/newRecordModel.js +232 -0
  373. package/dist/client/components/onDemand.d.ts +30 -0
  374. package/dist/client/components/onDemand.js +121 -0
  375. package/dist/client/components/optimisticMoves.d.ts +21 -0
  376. package/dist/client/components/optimisticMoves.js +145 -0
  377. package/dist/client/components/pageContext.d.ts +154 -0
  378. package/dist/client/components/pageContext.js +47 -0
  379. package/dist/client/components/pageFieldsRead.d.ts +67 -0
  380. package/dist/client/components/pageFieldsRead.js +55 -0
  381. package/dist/client/components/pageModel.d.ts +203 -0
  382. package/dist/client/components/pageModel.js +67 -0
  383. package/dist/client/components/pageStep.d.ts +31 -0
  384. package/dist/client/components/pageStep.js +15 -0
  385. package/dist/client/components/paletteModel.d.ts +9 -0
  386. package/dist/client/components/paletteModel.js +46 -0
  387. package/dist/client/components/pickerStaleness.d.ts +32 -0
  388. package/dist/client/components/pickerStaleness.js +27 -0
  389. package/dist/client/components/placeOrder.d.ts +47 -0
  390. package/dist/client/components/placeOrder.js +71 -0
  391. package/dist/client/components/pointerDrag.d.ts +54 -0
  392. package/dist/client/components/pointerDrag.js +95 -0
  393. package/dist/client/components/presentationFit.d.ts +19 -0
  394. package/dist/client/components/presentationFit.js +32 -0
  395. package/dist/client/components/recordKeys.d.ts +2 -0
  396. package/dist/client/components/recordKeys.js +8 -0
  397. package/dist/client/components/recordSearch.d.ts +31 -0
  398. package/dist/client/components/recordSearch.js +80 -0
  399. package/dist/client/components/recordSurface.d.ts +86 -0
  400. package/dist/client/components/recordSurface.js +267 -0
  401. package/dist/client/components/rowOpens.d.ts +19 -0
  402. package/dist/client/components/rowOpens.js +25 -0
  403. package/dist/client/components/sidebarModel.d.ts +152 -0
  404. package/dist/client/components/sidebarModel.js +372 -0
  405. package/dist/client/components/suggestModel.d.ts +22 -0
  406. package/dist/client/components/suggestModel.js +49 -0
  407. package/dist/client/components/suggestPart.d.ts +4 -0
  408. package/dist/client/components/suggestPart.js +4 -0
  409. package/dist/client/components/textMeasure.d.ts +2 -0
  410. package/dist/client/components/textMeasure.js +35 -0
  411. package/dist/client/components/unknownIcon.d.ts +8 -0
  412. package/dist/client/components/unknownIcon.js +32 -0
  413. package/dist/client/components/useBulkSelection.d.ts +30 -0
  414. package/dist/client/components/useBulkSelection.js +360 -0
  415. package/dist/client/components/useConditionWords.d.ts +17 -0
  416. package/dist/client/components/useConditionWords.js +104 -0
  417. package/dist/client/components/useGridKeyboard.d.ts +32 -0
  418. package/dist/client/components/useGridKeyboard.js +223 -0
  419. package/dist/client/components/useListOrder.d.ts +94 -0
  420. package/dist/client/components/useListOrder.js +294 -0
  421. package/dist/client/components/useMediaQuery.d.ts +10 -0
  422. package/dist/client/components/useMediaQuery.js +45 -0
  423. package/dist/client/components/useMessageLanguage.d.ts +1 -0
  424. package/dist/client/components/useMessageLanguage.js +6 -0
  425. package/dist/client/components/usePins.d.ts +20 -0
  426. package/dist/client/components/usePins.js +66 -0
  427. package/dist/client/components/usePointerDrag.d.ts +72 -0
  428. package/dist/client/components/usePointerDrag.js +553 -0
  429. package/dist/client/components/useRecordInsert.d.ts +42 -0
  430. package/dist/client/components/useRecordInsert.js +145 -0
  431. package/dist/client/components/useRowWindow.d.ts +35 -0
  432. package/dist/client/components/useRowWindow.js +149 -0
  433. package/dist/client/components/useStickyHead.d.ts +17 -0
  434. package/dist/client/components/useStickyHead.js +65 -0
  435. package/dist/client/components/useTabFold.d.ts +32 -0
  436. package/dist/client/components/useTabFold.js +145 -0
  437. package/dist/client/components/valueModel.d.ts +300 -0
  438. package/dist/client/components/valueModel.js +560 -0
  439. package/dist/client/components/valueRenderers.d.ts +36 -0
  440. package/dist/client/components/valueRenderers.js +13 -0
  441. package/dist/client/components/viewLink.d.ts +27 -0
  442. package/dist/client/components/viewLink.js +79 -0
  443. package/dist/client/components/walk.d.ts +14 -0
  444. package/dist/client/components/walk.js +16 -0
  445. package/dist/client/compose.d.ts +8 -0
  446. package/dist/client/compose.js +163 -0
  447. package/dist/client/composedHook.d.ts +20 -0
  448. package/dist/client/composedHook.js +12 -0
  449. package/dist/client/composedReads.d.ts +26 -0
  450. package/dist/client/composedReads.js +183 -0
  451. package/dist/client/composer.css +499 -0
  452. package/dist/client/composer.d.ts +121 -0
  453. package/dist/client/composer.js +1079 -0
  454. package/dist/client/composerEntry.d.ts +1 -0
  455. package/dist/client/composerEntry.js +58 -0
  456. package/dist/client/composerTab.d.ts +6 -0
  457. package/dist/client/composerTab.js +20 -0
  458. package/dist/client/conditions.d.ts +46 -0
  459. package/dist/client/conditions.js +150 -0
  460. package/dist/client/connectionList.d.ts +11 -0
  461. package/dist/client/connectionList.js +146 -0
  462. package/dist/client/connectionScope.d.ts +6 -0
  463. package/dist/client/connectionScope.js +14 -0
  464. package/dist/client/connectionTransition.d.ts +12 -0
  465. package/dist/client/connectionTransition.js +41 -0
  466. package/dist/client/copy/columnMenu/components/AppColumnMenu.d.ts +4 -0
  467. package/dist/client/copy/columnMenu/components/AppColumnMenu.js +6 -0
  468. package/dist/client/copy/columnMenu/components/AppColumnMenuPopups.d.ts +4 -0
  469. package/dist/client/copy/columnMenu/components/AppColumnMenuPopups.js +6 -0
  470. package/dist/client/copy/columnMenu/components/ThMenu.d.ts +35 -0
  471. package/dist/client/copy/columnMenu/components/ThMenu.js +37 -0
  472. package/dist/client/copy/columnMenu/components/appColumnMenuModel.d.ts +10 -0
  473. package/dist/client/copy/columnMenu/components/appColumnMenuModel.js +12 -0
  474. package/dist/client/copy/dashboards/breakdownBatch.d.ts +3 -0
  475. package/dist/client/copy/dashboards/breakdownBatch.js +5 -0
  476. package/dist/client/copy/dashboards/components/Breakdown.d.ts +32 -0
  477. package/dist/client/copy/dashboards/components/Breakdown.js +25 -0
  478. package/dist/client/copy/dashboards/components/BreakdownRoom.d.ts +3 -0
  479. package/dist/client/copy/dashboards/components/BreakdownRoom.js +5 -0
  480. package/dist/client/copy/dashboards/components/Chart.d.ts +26 -0
  481. package/dist/client/copy/dashboards/components/Chart.js +19 -0
  482. package/dist/client/copy/dashboards/components/ChartShapes.d.ts +16 -0
  483. package/dist/client/copy/dashboards/components/ChartShapes.js +12 -0
  484. package/dist/client/copy/dashboards/components/PageMetrics.d.ts +21 -0
  485. package/dist/client/copy/dashboards/components/PageMetrics.js +20 -0
  486. package/dist/client/copy/dashboards/components/SectionPeriod.d.ts +4 -0
  487. package/dist/client/copy/dashboards/components/SectionPeriod.js +6 -0
  488. package/dist/client/copy/dashboards/components/dashboardModel.d.ts +3 -0
  489. package/dist/client/copy/dashboards/components/dashboardModel.js +5 -0
  490. package/dist/client/copy/es.d.ts +11 -0
  491. package/dist/client/copy/es.js +60 -0
  492. package/dist/client/copy/filters/components/FilterBoxes.d.ts +10 -0
  493. package/dist/client/copy/filters/components/FilterBoxes.js +12 -0
  494. package/dist/client/copy/filters/components/FilterRail.d.ts +16 -0
  495. package/dist/client/copy/filters/components/FilterRail.js +18 -0
  496. package/dist/client/copy/filters/components/ListFilterBar.d.ts +9 -0
  497. package/dist/client/copy/filters/components/ListFilterBar.js +11 -0
  498. package/dist/client/copy/filters/components/conditionWords.d.ts +46 -0
  499. package/dist/client/copy/filters/components/conditionWords.js +95 -0
  500. package/dist/client/copy/filters/components/filterRailModel.d.ts +12 -0
  501. package/dist/client/copy/filters/components/filterRailModel.js +14 -0
  502. package/dist/client/copy/forms/components/DateField.d.ts +13 -0
  503. package/dist/client/copy/forms/components/DateField.js +15 -0
  504. package/dist/client/copy/forms/components/MinorMoneyInput.d.ts +4 -0
  505. package/dist/client/copy/forms/components/MinorMoneyInput.js +6 -0
  506. package/dist/client/copy/forms/components/MultiStepForm.d.ts +10 -0
  507. package/dist/client/copy/forms/components/MultiStepForm.js +12 -0
  508. package/dist/client/copy/forms/components/NewRecord.d.ts +29 -0
  509. package/dist/client/copy/forms/components/NewRecord.js +31 -0
  510. package/dist/client/copy/forms/components/NewRecordButton.d.ts +6 -0
  511. package/dist/client/copy/forms/components/NewRecordButton.js +8 -0
  512. package/dist/client/copy/forms/components/Picker.d.ts +4 -0
  513. package/dist/client/copy/forms/components/Picker.js +6 -0
  514. package/dist/client/copy/forms/components/QuickAdd.d.ts +3 -0
  515. package/dist/client/copy/forms/components/QuickAdd.js +5 -0
  516. package/dist/client/copy/forms/components/RecordPicker.d.ts +6 -0
  517. package/dist/client/copy/forms/components/RecordPicker.js +8 -0
  518. package/dist/client/copy/forms/components/RichTextEditor.d.ts +36 -0
  519. package/dist/client/copy/forms/components/RichTextEditor.js +40 -0
  520. package/dist/client/copy/forms/components/RichTextField.d.ts +3 -0
  521. package/dist/client/copy/forms/components/RichTextField.js +5 -0
  522. package/dist/client/copy/forms/components/SetFieldDialog.d.ts +10 -0
  523. package/dist/client/copy/forms/components/SetFieldDialog.js +9 -0
  524. package/dist/client/copy/forms/components/useRecordInsert.d.ts +7 -0
  525. package/dist/client/copy/forms/components/useRecordInsert.js +9 -0
  526. package/dist/client/copy/help/helpContent.d.ts +71 -0
  527. package/dist/client/copy/help/helpContent.js +73 -0
  528. package/dist/client/copy/lists/bulkActions.d.ts +12 -0
  529. package/dist/client/copy/lists/bulkActions.js +14 -0
  530. package/dist/client/copy/lists/components/AppList.d.ts +28 -0
  531. package/dist/client/copy/lists/components/AppList.js +30 -0
  532. package/dist/client/copy/lists/components/CardsList.d.ts +3 -0
  533. package/dist/client/copy/lists/components/CardsList.js +5 -0
  534. package/dist/client/copy/lists/components/Gallery.d.ts +7 -0
  535. package/dist/client/copy/lists/components/Gallery.js +9 -0
  536. package/dist/client/copy/lists/components/Grid.d.ts +30 -0
  537. package/dist/client/copy/lists/components/Grid.js +29 -0
  538. package/dist/client/copy/lists/components/GridCellEditor.d.ts +5 -0
  539. package/dist/client/copy/lists/components/GridCellEditor.js +7 -0
  540. package/dist/client/copy/lists/components/GridSelection.d.ts +4 -0
  541. package/dist/client/copy/lists/components/GridSelection.js +6 -0
  542. package/dist/client/copy/lists/components/Nested.d.ts +7 -0
  543. package/dist/client/copy/lists/components/Nested.js +9 -0
  544. package/dist/client/copy/lists/components/RowActions.d.ts +1 -0
  545. package/dist/client/copy/lists/components/RowActions.js +3 -0
  546. package/dist/client/copy/lists/components/SavedViews.d.ts +5 -0
  547. package/dist/client/copy/lists/components/SavedViews.js +7 -0
  548. package/dist/client/copy/lists/components/SortMenu.d.ts +5 -0
  549. package/dist/client/copy/lists/components/SortMenu.js +7 -0
  550. package/dist/client/copy/lists/components/TableRoom.d.ts +12 -0
  551. package/dist/client/copy/lists/components/TableRoom.js +14 -0
  552. package/dist/client/copy/lists/components/TableView.d.ts +37 -0
  553. package/dist/client/copy/lists/components/TableView.js +39 -0
  554. package/dist/client/copy/lists/components/appListModel.d.ts +6 -0
  555. package/dist/client/copy/lists/components/appListModel.js +5 -0
  556. package/dist/client/copy/lists/components/myViews.d.ts +4 -0
  557. package/dist/client/copy/lists/components/myViews.js +6 -0
  558. package/dist/client/copy/lists/components/placeOrder.d.ts +4 -0
  559. package/dist/client/copy/lists/components/placeOrder.js +6 -0
  560. package/dist/client/copy/lists/components/useBulkSelection.d.ts +20 -0
  561. package/dist/client/copy/lists/components/useBulkSelection.js +16 -0
  562. package/dist/client/copy/lists/components/useListOrder.d.ts +7 -0
  563. package/dist/client/copy/lists/components/useListOrder.js +9 -0
  564. package/dist/client/copy/public/components/appRooms.d.ts +3 -0
  565. package/dist/client/copy/public/components/appRooms.js +5 -0
  566. package/dist/client/copy/record/components/Actions.d.ts +13 -0
  567. package/dist/client/copy/record/components/Actions.js +15 -0
  568. package/dist/client/copy/record/components/AttachmentList.d.ts +23 -0
  569. package/dist/client/copy/record/components/AttachmentList.js +22 -0
  570. package/dist/client/copy/record/components/DeleteButton.d.ts +22 -0
  571. package/dist/client/copy/record/components/DeleteButton.js +24 -0
  572. package/dist/client/copy/record/components/Dressed.d.ts +5 -0
  573. package/dist/client/copy/record/components/Dressed.js +7 -0
  574. package/dist/client/copy/record/components/EditLayoutButton.d.ts +5 -0
  575. package/dist/client/copy/record/components/EditLayoutButton.js +7 -0
  576. package/dist/client/copy/record/components/Editable.d.ts +25 -0
  577. package/dist/client/copy/record/components/Editable.js +24 -0
  578. package/dist/client/copy/record/components/FieldArranger.d.ts +15 -0
  579. package/dist/client/copy/record/components/FieldArranger.js +17 -0
  580. package/dist/client/copy/record/components/FilePreview.d.ts +13 -0
  581. package/dist/client/copy/record/components/FilePreview.js +15 -0
  582. package/dist/client/copy/record/components/JsonPreview.d.ts +3 -0
  583. package/dist/client/copy/record/components/JsonPreview.js +5 -0
  584. package/dist/client/copy/record/components/JsonView.d.ts +12 -0
  585. package/dist/client/copy/record/components/JsonView.js +14 -0
  586. package/dist/client/copy/record/components/LayoutBuilder.d.ts +23 -0
  587. package/dist/client/copy/record/components/LayoutBuilder.js +25 -0
  588. package/dist/client/copy/record/components/Lightbox.d.ts +5 -0
  589. package/dist/client/copy/record/components/Lightbox.js +7 -0
  590. package/dist/client/copy/record/components/LiveNotices.d.ts +33 -0
  591. package/dist/client/copy/record/components/LiveNotices.js +29 -0
  592. package/dist/client/copy/record/components/PageCurrent.d.ts +1 -0
  593. package/dist/client/copy/record/components/PageCurrent.js +3 -0
  594. package/dist/client/copy/record/components/PageEmptyRun.d.ts +3 -0
  595. package/dist/client/copy/record/components/PageEmptyRun.js +5 -0
  596. package/dist/client/copy/record/components/PageFields.d.ts +5 -0
  597. package/dist/client/copy/record/components/PageFields.js +7 -0
  598. package/dist/client/copy/record/components/PageFlowDiagram.d.ts +33 -0
  599. package/dist/client/copy/record/components/PageFlowDiagram.js +37 -0
  600. package/dist/client/copy/record/components/PageFlows.d.ts +20 -0
  601. package/dist/client/copy/record/components/PageFlows.js +22 -0
  602. package/dist/client/copy/record/components/PageGroups.d.ts +12 -0
  603. package/dist/client/copy/record/components/PageGroups.js +14 -0
  604. package/dist/client/copy/record/components/PageHead.d.ts +8 -0
  605. package/dist/client/copy/record/components/PageHead.js +10 -0
  606. package/dist/client/copy/record/components/PageHistory.d.ts +18 -0
  607. package/dist/client/copy/record/components/PageHistory.js +20 -0
  608. package/dist/client/copy/record/components/PageLayout.d.ts +5 -0
  609. package/dist/client/copy/record/components/PageLayout.js +7 -0
  610. package/dist/client/copy/record/components/PageRelated.d.ts +24 -0
  611. package/dist/client/copy/record/components/PageRelated.js +26 -0
  612. package/dist/client/copy/record/components/PageRoom.d.ts +4 -0
  613. package/dist/client/copy/record/components/PageRoom.js +6 -0
  614. package/dist/client/copy/record/components/PageSectionBox.d.ts +6 -0
  615. package/dist/client/copy/record/components/PageSectionBox.js +10 -0
  616. package/dist/client/copy/record/components/PageTimeline.d.ts +9 -0
  617. package/dist/client/copy/record/components/PageTimeline.js +8 -0
  618. package/dist/client/copy/record/components/Peek.d.ts +3 -0
  619. package/dist/client/copy/record/components/Peek.js +5 -0
  620. package/dist/client/copy/record/components/PeekPanel.d.ts +5 -0
  621. package/dist/client/copy/record/components/PeekPanel.js +7 -0
  622. package/dist/client/copy/record/components/QrCode.d.ts +3 -0
  623. package/dist/client/copy/record/components/QrCode.js +5 -0
  624. package/dist/client/copy/record/components/Record.d.ts +19 -0
  625. package/dist/client/copy/record/components/Record.js +21 -0
  626. package/dist/client/copy/record/components/RecordGone.d.ts +4 -0
  627. package/dist/client/copy/record/components/RecordGone.js +6 -0
  628. package/dist/client/copy/record/components/RecordSummaries.d.ts +1 -0
  629. package/dist/client/copy/record/components/RecordSummaries.js +3 -0
  630. package/dist/client/copy/record/components/RecordTags.d.ts +9 -0
  631. package/dist/client/copy/record/components/RecordTags.js +11 -0
  632. package/dist/client/copy/record/components/RecordTrailNav.d.ts +8 -0
  633. package/dist/client/copy/record/components/RecordTrailNav.js +10 -0
  634. package/dist/client/copy/record/components/RichText.d.ts +4 -0
  635. package/dist/client/copy/record/components/RichText.js +6 -0
  636. package/dist/client/copy/record/components/Value.d.ts +4 -0
  637. package/dist/client/copy/record/components/Value.js +6 -0
  638. package/dist/client/copy/record/components/WorkflowStatus.d.ts +7 -0
  639. package/dist/client/copy/record/components/WorkflowStatus.js +9 -0
  640. package/dist/client/copy/record/components/WriteConfirm.d.ts +11 -0
  641. package/dist/client/copy/record/components/WriteConfirm.js +13 -0
  642. package/dist/client/copy/record/components/groupMoves.d.ts +7 -0
  643. package/dist/client/copy/record/components/groupMoves.js +9 -0
  644. package/dist/client/copy/record/components/jsonModel.d.ts +3 -0
  645. package/dist/client/copy/record/components/jsonModel.js +5 -0
  646. package/dist/client/copy/record/components/pageModel.d.ts +5 -0
  647. package/dist/client/copy/record/components/pageModel.js +7 -0
  648. package/dist/client/copy/record/components/recordSurface.d.ts +6 -0
  649. package/dist/client/copy/record/components/recordSurface.js +8 -0
  650. package/dist/client/copy/record/components/valueModel.d.ts +5 -0
  651. package/dist/client/copy/record/components/valueModel.js +7 -0
  652. package/dist/client/copy/record/fileSource.d.ts +3 -0
  653. package/dist/client/copy/record/fileSource.js +5 -0
  654. package/dist/client/copy/record/insert.d.ts +6 -0
  655. package/dist/client/copy/record/insert.js +8 -0
  656. package/dist/client/copy/record/page.d.ts +4 -0
  657. package/dist/client/copy/record/page.js +6 -0
  658. package/dist/client/copy/record/recordEditValidation.d.ts +4 -0
  659. package/dist/client/copy/record/recordEditValidation.js +6 -0
  660. package/dist/client/copy/record/savedPages.d.ts +4 -0
  661. package/dist/client/copy/record/savedPages.js +6 -0
  662. package/dist/client/copy/record/template.d.ts +9 -0
  663. package/dist/client/copy/record/template.js +11 -0
  664. package/dist/client/copy/record/write.d.ts +30 -0
  665. package/dist/client/copy/record/write.js +26 -0
  666. package/dist/client/copy/shell/app.d.ts +27 -0
  667. package/dist/client/copy/shell/app.js +43 -0
  668. package/dist/client/copy/shell/components/AppIssues.d.ts +10 -0
  669. package/dist/client/copy/shell/components/AppIssues.js +9 -0
  670. package/dist/client/copy/shell/components/Crumbs.d.ts +7 -0
  671. package/dist/client/copy/shell/components/Crumbs.js +17 -0
  672. package/dist/client/copy/shell/components/Dropdown.d.ts +3 -0
  673. package/dist/client/copy/shell/components/Dropdown.js +5 -0
  674. package/dist/client/copy/shell/components/ErrorBoundary.d.ts +4 -0
  675. package/dist/client/copy/shell/components/ErrorBoundary.js +6 -0
  676. package/dist/client/copy/shell/components/FavoriteStar.d.ts +4 -0
  677. package/dist/client/copy/shell/components/FavoriteStar.js +6 -0
  678. package/dist/client/copy/shell/components/MobileNavDrawer.d.ts +4 -0
  679. package/dist/client/copy/shell/components/MobileNavDrawer.js +12 -0
  680. package/dist/client/copy/shell/components/OverflowMenu.d.ts +3 -0
  681. package/dist/client/copy/shell/components/OverflowMenu.js +10 -0
  682. package/dist/client/copy/shell/components/Palette.d.ts +15 -0
  683. package/dist/client/copy/shell/components/Palette.js +18 -0
  684. package/dist/client/copy/shell/components/Prefs.d.ts +4 -0
  685. package/dist/client/copy/shell/components/Prefs.js +11 -0
  686. package/dist/client/copy/shell/components/Prompt.d.ts +1 -0
  687. package/dist/client/copy/shell/components/Prompt.js +3 -0
  688. package/dist/client/copy/shell/components/Rooms.d.ts +6 -0
  689. package/dist/client/copy/shell/components/Rooms.js +8 -0
  690. package/dist/client/copy/shell/components/Sidebar.d.ts +7 -0
  691. package/dist/client/copy/shell/components/Sidebar.js +9 -0
  692. package/dist/client/copy/shell/components/Skeleton.d.ts +5 -0
  693. package/dist/client/copy/shell/components/Skeleton.js +7 -0
  694. package/dist/client/copy/shell/components/TopNav.d.ts +4 -0
  695. package/dist/client/copy/shell/components/TopNav.js +12 -0
  696. package/dist/client/copy/shell/components/Tour.d.ts +4 -0
  697. package/dist/client/copy/shell/components/Tour.js +6 -0
  698. package/dist/client/copy/shell/components/newMenuModel.d.ts +3 -0
  699. package/dist/client/copy/shell/components/newMenuModel.js +5 -0
  700. package/dist/client/copy/shell/components/onDemand.d.ts +3 -0
  701. package/dist/client/copy/shell/components/onDemand.js +5 -0
  702. package/dist/client/copy/shell/components/sidebarModel.d.ts +3 -0
  703. package/dist/client/copy/shell/components/sidebarModel.js +5 -0
  704. package/dist/client/copy/shell/connectionList.d.ts +6 -0
  705. package/dist/client/copy/shell/connectionList.js +8 -0
  706. package/dist/client/copy/shell/core.d.ts +16 -0
  707. package/dist/client/copy/shell/core.js +18 -0
  708. package/dist/client/copy/shell/palette.d.ts +6 -0
  709. package/dist/client/copy/shell/palette.js +8 -0
  710. package/dist/client/copy/shell/prompt.d.ts +1 -0
  711. package/dist/client/copy/shell/prompt.js +3 -0
  712. package/dist/client/copy/shell/requestIdentity.d.ts +9 -0
  713. package/dist/client/copy/shell/requestIdentity.js +11 -0
  714. package/dist/client/copy/shell/resourceRequests.d.ts +4 -0
  715. package/dist/client/copy/shell/resourceRequests.js +6 -0
  716. package/dist/client/copy/shell/sessionIdentity.d.ts +11 -0
  717. package/dist/client/copy/shell/sessionIdentity.js +13 -0
  718. package/dist/client/copy/shell/sessionLifecycle.d.ts +5 -0
  719. package/dist/client/copy/shell/sessionLifecycle.js +7 -0
  720. package/dist/client/copy/shell/startup.d.ts +5 -0
  721. package/dist/client/copy/shell/startup.js +7 -0
  722. package/dist/client/copy/shell/theme.d.ts +5 -0
  723. package/dist/client/copy/shell/theme.js +14 -0
  724. package/dist/client/copy/shell/toast.d.ts +3 -0
  725. package/dist/client/copy/shell/toast.js +5 -0
  726. package/dist/client/copy/shell/updateAttempts.d.ts +6 -0
  727. package/dist/client/copy/shell/updateAttempts.js +8 -0
  728. package/dist/client/copy/shell/visualTheme.d.ts +4 -0
  729. package/dist/client/copy/shell/visualTheme.js +6 -0
  730. package/dist/client/copy/workbench/clauses.d.ts +3 -0
  731. package/dist/client/copy/workbench/clauses.js +5 -0
  732. package/dist/client/copy/workbench/components/ApiOperations.d.ts +21 -0
  733. package/dist/client/copy/workbench/components/ApiOperations.js +23 -0
  734. package/dist/client/copy/workbench/components/Composer.d.ts +105 -0
  735. package/dist/client/copy/workbench/components/Composer.js +92 -0
  736. package/dist/client/copy/workbench/components/Diagram.d.ts +56 -0
  737. package/dist/client/copy/workbench/components/Diagram.js +46 -0
  738. package/dist/client/copy/workbench/components/Export.d.ts +26 -0
  739. package/dist/client/copy/workbench/components/Export.js +25 -0
  740. package/dist/client/copy/workbench/components/HelpPanel.d.ts +10 -0
  741. package/dist/client/copy/workbench/components/HelpPanel.js +12 -0
  742. package/dist/client/copy/workbench/components/History.d.ts +11 -0
  743. package/dist/client/copy/workbench/components/History.js +10 -0
  744. package/dist/client/copy/workbench/components/Landing.d.ts +5 -0
  745. package/dist/client/copy/workbench/components/Landing.js +7 -0
  746. package/dist/client/copy/workbench/components/SchemaExport.d.ts +24 -0
  747. package/dist/client/copy/workbench/components/SchemaExport.js +20 -0
  748. package/dist/client/copy/workbench/components/Summary.d.ts +28 -0
  749. package/dist/client/copy/workbench/components/Summary.js +24 -0
  750. package/dist/client/copy/workbench/components/ThemeLab.d.ts +25 -0
  751. package/dist/client/copy/workbench/components/ThemeLab.js +27 -0
  752. package/dist/client/copy/workbench/components/WorkPanel.d.ts +12 -0
  753. package/dist/client/copy/workbench/components/WorkPanel.js +14 -0
  754. package/dist/client/copy/workbench/composer.d.ts +36 -0
  755. package/dist/client/copy/workbench/composer.js +32 -0
  756. package/dist/client/copy/workbench/composerEntry.d.ts +4 -0
  757. package/dist/client/copy/workbench/composerEntry.js +6 -0
  758. package/dist/client/copy/workbench/export.d.ts +8 -0
  759. package/dist/client/copy/workbench/export.js +7 -0
  760. package/dist/client/copy/workbench/filterbar.d.ts +6 -0
  761. package/dist/client/copy/workbench/filterbar.js +8 -0
  762. package/dist/client/copy/workbench/handoff.d.ts +20 -0
  763. package/dist/client/copy/workbench/handoff.js +19 -0
  764. package/dist/client/copy/workbench/help.d.ts +6 -0
  765. package/dist/client/copy/workbench/help.js +8 -0
  766. package/dist/client/copy/workbench/history.d.ts +3 -0
  767. package/dist/client/copy/workbench/history.js +5 -0
  768. package/dist/client/copy/workbench/schemaexport.d.ts +5 -0
  769. package/dist/client/copy/workbench/schemaexport.js +7 -0
  770. package/dist/client/copy/workbench/tour.d.ts +22 -0
  771. package/dist/client/copy/workbench/tour.js +24 -0
  772. package/dist/client/copy/workbench/views.d.ts +6 -0
  773. package/dist/client/copy/workbench/views.js +8 -0
  774. package/dist/client/core.d.ts +312 -0
  775. package/dist/client/core.js +1067 -0
  776. package/dist/client/customThemes.css +43 -0
  777. package/dist/client/dashboard.d.ts +16 -0
  778. package/dist/client/dashboard.js +35 -0
  779. package/dist/client/deeplink.d.ts +64 -0
  780. package/dist/client/deeplink.js +384 -0
  781. package/dist/client/delete.d.ts +8 -0
  782. package/dist/client/delete.js +35 -0
  783. package/dist/client/density.d.ts +8 -0
  784. package/dist/client/density.js +102 -0
  785. package/dist/client/devtoolsEventClient.d.ts +27 -0
  786. package/dist/client/devtoolsEventClient.js +32 -0
  787. package/dist/client/documents.d.ts +9 -0
  788. package/dist/client/documents.js +23 -0
  789. package/dist/client/dom.d.ts +36 -0
  790. package/dist/client/dom.js +232 -0
  791. package/dist/client/draftRecovery.d.ts +16 -0
  792. package/dist/client/draftRecovery.js +56 -0
  793. package/dist/client/export.d.ts +59 -0
  794. package/dist/client/export.js +217 -0
  795. package/dist/client/features.css +2187 -0
  796. package/dist/client/fieldErrors.d.ts +27 -0
  797. package/dist/client/fieldErrors.js +20 -0
  798. package/dist/client/fileSource.d.ts +10 -0
  799. package/dist/client/fileSource.js +115 -0
  800. package/dist/client/filterbar.d.ts +87 -0
  801. package/dist/client/filterbar.js +168 -0
  802. package/dist/client/firstPaint.d.ts +26 -0
  803. package/dist/client/firstPaint.js +102 -0
  804. package/dist/client/fonts/Barlow-OFL.txt +125 -0
  805. package/dist/client/fonts/IBMPlexMono-OFL.txt +104 -0
  806. package/dist/client/fonts/Inter-OFL.txt +92 -0
  807. package/dist/client/fonts/barlow-400.woff2 +0 -0
  808. package/dist/client/fonts/barlow-600.woff2 +0 -0
  809. package/dist/client/fonts/barlow-semi-condensed-700.woff2 +0 -0
  810. package/dist/client/fonts/ibm-plex-mono-400.woff2 +0 -0
  811. package/dist/client/fonts/ibm-plex-mono-500.woff2 +0 -0
  812. package/dist/client/fonts/inter-latin.woff2 +0 -0
  813. package/dist/client/formControls.css +5 -0
  814. package/dist/client/handoff.d.ts +47 -0
  815. package/dist/client/handoff.js +138 -0
  816. package/dist/client/help.css +151 -0
  817. package/dist/client/help.d.ts +20 -0
  818. package/dist/client/help.js +103 -0
  819. package/dist/client/helpContent.d.ts +95 -0
  820. package/dist/client/helpContent.js +661 -0
  821. package/dist/client/history.d.ts +10 -0
  822. package/dist/client/history.js +181 -0
  823. package/dist/client/historyToken.d.ts +18 -0
  824. package/dist/client/historyToken.js +27 -0
  825. package/dist/client/iconWeight.d.ts +16 -0
  826. package/dist/client/iconWeight.js +44 -0
  827. package/dist/client/index.html +244 -0
  828. package/dist/client/insert.d.ts +50 -0
  829. package/dist/client/insert.js +269 -0
  830. package/dist/client/kit.d.ts +7 -0
  831. package/dist/client/kit.js +1 -0
  832. package/dist/client/layoutDraftRecovery.d.ts +8 -0
  833. package/dist/client/layoutDraftRecovery.js +33 -0
  834. package/dist/client/ledgerLook.css +32 -0
  835. package/dist/client/liveReads.d.ts +23 -0
  836. package/dist/client/liveReads.js +38 -0
  837. package/dist/client/liveState.d.ts +94 -0
  838. package/dist/client/liveState.js +212 -0
  839. package/dist/client/locale.d.ts +141 -0
  840. package/dist/client/locale.js +0 -0
  841. package/dist/client/lumenLook.css +1867 -0
  842. package/dist/client/menu.d.ts +49 -0
  843. package/dist/client/menu.js +131 -0
  844. package/dist/client/menuScope.d.ts +6 -0
  845. package/dist/client/menuScope.js +4 -0
  846. package/dist/client/messages.d.ts +240 -0
  847. package/dist/client/messages.js +370 -0
  848. package/dist/client/motionStill.d.ts +1 -0
  849. package/dist/client/motionStill.js +17 -0
  850. package/dist/client/navigationHold.d.ts +37 -0
  851. package/dist/client/navigationHold.js +503 -0
  852. package/dist/client/nested.d.ts +8 -0
  853. package/dist/client/nested.js +26 -0
  854. package/dist/client/ownWrites.d.ts +33 -0
  855. package/dist/client/ownWrites.js +76 -0
  856. package/dist/client/page.css +4052 -0
  857. package/dist/client/page.d.ts +21 -0
  858. package/dist/client/page.js +187 -0
  859. package/dist/client/pagemarks.d.ts +32 -0
  860. package/dist/client/pagemarks.js +98 -0
  861. package/dist/client/palette.d.ts +35 -0
  862. package/dist/client/palette.js +357 -0
  863. package/dist/client/partsLook.css +1047 -0
  864. package/dist/client/peek.d.ts +11 -0
  865. package/dist/client/peek.js +51 -0
  866. package/dist/client/peekpanel.d.ts +26 -0
  867. package/dist/client/peekpanel.js +121 -0
  868. package/dist/client/pendingWork.d.ts +19 -0
  869. package/dist/client/pendingWork.js +36 -0
  870. package/dist/client/pins.d.ts +24 -0
  871. package/dist/client/pins.js +97 -0
  872. package/dist/client/prefs.d.ts +3 -0
  873. package/dist/client/prefs.js +32 -0
  874. package/dist/client/prompt.d.ts +27 -0
  875. package/dist/client/prompt.js +61 -0
  876. package/dist/client/readGathering.d.ts +4 -0
  877. package/dist/client/readGathering.js +23 -0
  878. package/dist/client/recordCompose.d.ts +11 -0
  879. package/dist/client/recordCompose.js +69 -0
  880. package/dist/client/recordDrafts.d.ts +40 -0
  881. package/dist/client/recordDrafts.js +57 -0
  882. package/dist/client/recordEditValidation.d.ts +12 -0
  883. package/dist/client/recordEditValidation.js +52 -0
  884. package/dist/client/recordIntent.d.ts +6 -0
  885. package/dist/client/recordIntent.js +15 -0
  886. package/dist/client/recordPress.d.ts +12 -0
  887. package/dist/client/recordPress.js +84 -0
  888. package/dist/client/recordSource.d.ts +6 -0
  889. package/dist/client/recordSource.js +15 -0
  890. package/dist/client/recordTrail.d.ts +77 -0
  891. package/dist/client/recordTrail.js +101 -0
  892. package/dist/client/recordWriteRefresh.d.ts +74 -0
  893. package/dist/client/recordWriteRefresh.js +284 -0
  894. package/dist/client/relatedRows.d.ts +4 -0
  895. package/dist/client/relatedRows.js +24 -0
  896. package/dist/client/requestIdentity.d.ts +36 -0
  897. package/dist/client/requestIdentity.js +97 -0
  898. package/dist/client/resourceRequests.d.ts +7 -0
  899. package/dist/client/resourceRequests.js +32 -0
  900. package/dist/client/roleLabels.d.ts +7 -0
  901. package/dist/client/roleLabels.js +24 -0
  902. package/dist/client/rowEditing.d.ts +15 -0
  903. package/dist/client/rowEditing.js +36 -0
  904. package/dist/client/sageLook.css +242 -0
  905. package/dist/client/savedPages.d.ts +15 -0
  906. package/dist/client/savedPages.js +123 -0
  907. package/dist/client/schemaexport.d.ts +14 -0
  908. package/dist/client/schemaexport.js +182 -0
  909. package/dist/client/sessionIdentity.d.ts +39 -0
  910. package/dist/client/sessionIdentity.js +255 -0
  911. package/dist/client/sessionLifecycle.d.ts +33 -0
  912. package/dist/client/sessionLifecycle.js +276 -0
  913. package/dist/client/shellHost.d.ts +70 -0
  914. package/dist/client/shellHost.js +92 -0
  915. package/dist/client/shellMain.d.ts +8 -0
  916. package/dist/client/shellMode.d.ts +433 -0
  917. package/dist/client/shellMode.js +68 -0
  918. package/dist/client/shellStart.d.ts +5 -0
  919. package/dist/client/shellStart.js +54 -0
  920. package/dist/client/shells.d.ts +123 -0
  921. package/dist/client/shells.js +1 -0
  922. package/dist/client/sql.css +139 -0
  923. package/dist/client/startup.d.ts +8 -0
  924. package/dist/client/startup.js +85 -0
  925. package/dist/client/startupHold.d.ts +10 -0
  926. package/dist/client/startupHold.js +73 -0
  927. package/dist/client/structure.css +1296 -0
  928. package/dist/client/style.css +3526 -0
  929. package/dist/client/styleImports.d.ts +3 -0
  930. package/dist/client/surfaces.d.ts +18 -0
  931. package/dist/client/surfaces.js +27 -0
  932. package/dist/client/surfacesLook.css +88 -0
  933. package/dist/client/template.d.ts +75 -0
  934. package/dist/client/template.js +403 -0
  935. package/dist/client/theme.d.ts +14 -0
  936. package/dist/client/theme.js +112 -0
  937. package/dist/client/themeFamilies.css +788 -0
  938. package/dist/client/thmenu.d.ts +12 -0
  939. package/dist/client/thmenu.js +94 -0
  940. package/dist/client/toast.d.ts +7 -0
  941. package/dist/client/toast.js +117 -0
  942. package/dist/client/tour.d.ts +8 -0
  943. package/dist/client/tour.js +176 -0
  944. package/dist/client/transport.d.ts +2 -0
  945. package/dist/client/transport.js +13 -0
  946. package/dist/client/typography.d.ts +4 -0
  947. package/dist/client/typography.js +51 -0
  948. package/dist/client/uiBridge.d.ts +57 -0
  949. package/dist/client/uiBridge.js +30 -0
  950. package/dist/client/updateAttempts.d.ts +46 -0
  951. package/dist/client/updateAttempts.js +131 -0
  952. package/dist/client/url.d.ts +74 -0
  953. package/dist/client/url.js +388 -0
  954. package/dist/client/views.d.ts +19 -0
  955. package/dist/client/views.js +133 -0
  956. package/dist/client/visualTheme.d.ts +62 -0
  957. package/dist/client/visualTheme.js +502 -0
  958. package/dist/client/visualThemes.css +421 -0
  959. package/dist/client/workshopLook.css +126 -0
  960. package/dist/client/write.d.ts +100 -0
  961. package/dist/client/write.js +882 -0
  962. package/dist/client/writePaths.d.ts +16 -0
  963. package/dist/client/writePaths.js +35 -0
  964. package/dist/client/yesNoRule.d.ts +12 -0
  965. package/dist/client/yesNoRule.js +39 -0
  966. package/dist/clientFiles.d.ts +11 -4
  967. package/dist/clientFiles.js +16 -12
  968. package/dist/vite.d.ts +136 -0
  969. package/dist/vite.js +571 -0
  970. package/package.json +130 -3
@@ -0,0 +1,897 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Adding a row, in a form the schema wrote.
4
+ *
5
+ * Nobody declares a form for this: the columns, their types, what is
6
+ * required and what the database will fill are all in the catalog already.
7
+ * Required is NOT NULL with no default and no auto-assigned key; everything
8
+ * else is optional, and an empty box means "leave it to the database" — its
9
+ * defaults are part of the schema's design and pre-filling them here would
10
+ * turn every default into a value somebody appears to have chosen.
11
+ *
12
+ * Validation checks required values against the catalog. Constraints such
13
+ * as uniqueness and reference integrity remain the database's responsibility.
14
+ *
15
+ * Two readers. The workbench reads the schema: `account_id integer
16
+ * required`, `→ account`. An app's reader reads a form: "Account", a search
17
+ * box that finds an account by name, and no word about integers. Same
18
+ * fields, same values on the wire; only the dress differs. And two frames:
19
+ * the workbench's dialog and the app's drawer over the list, one form
20
+ * wearing either.
21
+ */
22
+ import { useMessageLanguage } from './useMessageLanguage.js';
23
+ import { MultiStepForm } from './MultiStepForm.js';
24
+ import { Columns } from '@mistriwork/ui/FormParts.js';
25
+ import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from 'react';
26
+ import { state, viewportBox, writeAllowed } from '../core.js';
27
+ import { RichTextField, mentionSearch } from './RichTextField.js';
28
+ import { createPortal } from 'react-dom';
29
+ import { Modal } from '@mistriwork/ui/Modal.js';
30
+ import { Button } from '@mistriwork/ui/Button.js';
31
+ import { ConfirmDialog } from './Prompt.js';
32
+ import { useForm } from '@tanstack/react-form';
33
+ import { columnKind, isFlagColumn } from '@mistriwork/engine/shared/schema.js';
34
+ import { humanName, vocabularyWord } from '@mistriwork/engine/shared/model.js';
35
+ import { inferredFormDefaults } from '@mistriwork/engine/shared/formValues.js';
36
+ import { sessionIdentity } from '../sessionIdentity.js';
37
+ import { Dropdown, readsAsName } from './Dropdown.js';
38
+ import { RecordPicker } from './RecordPicker.js';
39
+ import { DateField } from './DateField.js';
40
+ import { isPickerDate } from '@mistriwork/ui/internal/datePickerModel.js';
41
+ import { formatLocale, formatTimezone } from '../locale.js';
42
+ import { InputSlot, columnInput } from './inputRenderers.js';
43
+ import { autoKey, isRequired } from '@mistriwork/engine/shared/form.js';
44
+ import { columnTextRule, textRuleBreak } from '@mistriwork/engine/shared/textRules.js';
45
+ import { shell } from '../shellMode.js';
46
+ import { resourceOf } from './appRooms.js';
47
+ import { Icon } from './Icon.js';
48
+ import { isAppIcon } from '@mistriwork/engine/shared/appIcons.js';
49
+ import { onDemand, useArrived } from './onDemand.js';
50
+ import { isPickerDateTime } from '@mistriwork/ui/internal/datePickerModel.js';
51
+ import { defaultCurrency } from '../locale.js';
52
+ import { wordFor } from './valueModel.js';
53
+ import { rowCurrency } from '@mistriwork/engine/shared/money.js';
54
+ import { MinorMoneyInput, minorProblem } from './MinorMoneyInput.js';
55
+ import { fieldInput, flagStart, formColumns, formFrame, formGroups, hasFormChanges, insertValues, isFormFieldVisible, missingFields, narrowingCondition, presetValue, } from './newRecordModel.js';
56
+ import { derivedValue, formWords, resolvedForm, useMeDefaults } from './formDefaults.js';
57
+ import { useRecordInsert } from './useRecordInsert.js';
58
+ import { say } from '../copy/forms/components/NewRecord.js';
59
+ export { autoKey, isRequired } from '@mistriwork/engine/shared/form.js';
60
+ const DefinedInputs = onDemand(() => import('./DefinedFields.js'), 'DefinedInputs', { quiet: true });
61
+ const dateOnly = (column) => columnKind(column.type) === 'date' && !/time/i.test(column.type);
62
+ /* A date is judged in the Workbench too; a date and time only where an App draws its picker. */
63
+ const invalidDate = (column, value, kind) => value !== '' && (dateOnly(column) ? !isPickerDate(value) : kind === 'datetime' && !isPickerDateTime(value));
64
+ import { addHostListener, removeHostListener, shellBody, shellById, shellQuery } from '../shellHost.js';
65
+ /* What a text rule says when a value breaks it: the App's sentence, else the rule in plain words. */
66
+ const textRuleMessage = (rule, value) => {
67
+ const broken = textRuleBreak(rule, value);
68
+ if (!broken)
69
+ return '';
70
+ if (rule.message)
71
+ return rule.message;
72
+ return broken === 'min'
73
+ ? say('useAtLeast', { min: rule.min })
74
+ : broken === 'max'
75
+ ? say('useAtMost', { max: rule.max })
76
+ : say('enterTheExpectedForm');
77
+ };
78
+ /* Where the shell has no lines part, nothing to wait for. */
79
+ const NO_LINES = { ready: () => Promise.resolve(), here: () => true };
80
+ /** The fields, the required check and the save, apart from any frame: once its starting words (`today`, `me`) are values. */
81
+ export function NewRecordForm(props) {
82
+ /* An App's form with lines or live figures waits for their part (FormLines.tsx, the shell's: shellMode.ts
83
+ `formLines`), fetched the first time a form has them, so the form is drawn whole. */
84
+ const wantsLines = props.app && !props.compact && Boolean(props.form?.lines?.length || props.form?.live?.length);
85
+ const linesHere = useArrived(shell().slots.formLines ?? NO_LINES, wantsLines);
86
+ if (wantsLines && !linesHere)
87
+ return (_jsx("p", { className: "insert-status", role: "status", children: say('common.loading') }));
88
+ const words = formWords(props.table, props.form, props.app);
89
+ /* `me` is the server's to say, so only a form that starts with it waits on a question. */
90
+ if (words.some((w) => w.word === 'me'))
91
+ return _jsx(NewRecordFormAsking, { ...props, words: words });
92
+ return _jsx(NewRecordFormBody, { ...props, form: resolvedForm(props.form, words) });
93
+ }
94
+ function NewRecordFormAsking({ words, ...props }) {
95
+ const me = useMeDefaults(props.table, words, props.target);
96
+ if (!me)
97
+ return (_jsx("p", { className: "insert-status", role: "status", children: say('common.loading') }));
98
+ return _jsx(NewRecordFormBody, { ...props, form: resolvedForm(props.form, words, me) });
99
+ }
100
+ function NewRecordFormBody({ table, form, app, label: columnLabel, target, insert, onAdded, onCancel, onPendingChange, onDiscardChange, onUnresolvedChange, compact = false, retainUncertain = compact, display, frame = app ? 'drawer' : 'dialog', }) {
101
+ useMessageLanguage();
102
+ const assigned = autoKey(table);
103
+ const columns = formColumns(table, form, app);
104
+ const groups = formGroups(table, form, app);
105
+ /* A switch is on or off, never "leave it": a flag it draws starts where the
106
+ form, else the database, says — off for one that must be answered — and
107
+ that start is sent like any default. */
108
+ const flags = app
109
+ ? columns
110
+ .filter((column) => isFlagColumn(column) && !column.allowed?.length)
111
+ .flatMap((column) => {
112
+ const start = flagStart(column, form?.defaults ?? {});
113
+ return start === undefined ? [] : [[column.name, start]];
114
+ })
115
+ : [];
116
+ /* A vocabulary opens on the choice the database would write (`default 'booked'`), unless the form says another. */
117
+ const defaults = {
118
+ ...Object.fromEntries(flags),
119
+ ...(app ? inferredFormDefaults({ columns }) : {}),
120
+ ...(form?.defaults ?? {}),
121
+ };
122
+ const switches = new Set(flags.map(([name]) => name));
123
+ /* Each field's dress on this form (`form.fields`), in an App only: the Workbench reads the schema. */
124
+ /* The database's text rule, with the App's own on top (textRules.ts): judged as someone types. */
125
+ const authoredText = app ? shell().app()?.resources?.[table.id]?.text : undefined;
126
+ const textRule = (column) => columnTextRule(column, authoredText?.[column.name]);
127
+ /* A record's tags (`tags` on the resource), chosen with the record and sent
128
+ with it: the server inserts the link rows in the record's own transaction.
129
+ Offered where this reader may add link rows. A tenant App's insert takes
130
+ the row alone. */
131
+ const tagRule = app && !sessionIdentity().tenantRequired ? shell().app()?.resources?.[table.id]?.tags : undefined;
132
+ const tagThrough = tagRule ? target(tagRule.through) : undefined;
133
+ const tagTable = tagRule ? target(tagRule.to) : undefined;
134
+ /* The link table as the New form itself is judged (insert.js canInsert): the record's own connection is writable already. */
135
+ const offersTags = Boolean(tagThrough && tagTable && !tagThrough.isView && tagThrough.insertable !== false && writeAllowed(tagThrough.id));
136
+ const [tagValues, setTagValues] = useState([]);
137
+ const textBroken = (column, value) => {
138
+ const rule = textRule(column);
139
+ return Boolean(rule && textRuleBreak(rule, value));
140
+ };
141
+ const dress = (column) => app && form?.fields && Object.hasOwn(form.fields, column.name) ? form.fields[column.name] : undefined;
142
+ const label = (column) => dress(column)?.label ?? columnLabel(column);
143
+ const kindOf = (column) => app
144
+ ? fieldInput(column, {
145
+ money: display?.(column)?.format === 'money',
146
+ richText: display?.(column)?.format === 'richText',
147
+ multiline: dress(column)?.multiline,
148
+ required: isRequired(column, assigned),
149
+ hasStart: switches.has(column.name) ||
150
+ (!isFlagColumn(column) && (presetValue(column, defaults) !== '' || column.default !== undefined || column.hasDefault === true)),
151
+ reference: Boolean(column.references && target(column.references.table)),
152
+ })
153
+ : undefined;
154
+ /* A money rule over the draft: where each record keeps its own currency (`currency: { column }`), the code the form holds. */
155
+ const ruleIn = (column, values) => {
156
+ const rule = display?.(column) ?? undefined;
157
+ return rule?.currencyColumn
158
+ ? {
159
+ ...rule,
160
+ currency: rowCurrency(rule, values, rule.currency ?? '') || undefined,
161
+ }
162
+ : rule;
163
+ };
164
+ /* An amount of minor units the box could not read as one (MinorMoneyInput.tsx). */
165
+ const amountProblem = (column, values) => {
166
+ const rule = app ? ruleIn(column, { ...defaults, ...values }) : undefined;
167
+ return rule?.format === 'money' && rule.minor ? minorProblem(values[column.name], rule.currency ?? defaultCurrency()) : '';
168
+ };
169
+ /* The record's lines (`form.lines`), asked under its fields and inserted with it in one transaction
170
+ (FormLines.tsx), on a tenant lease and under a row policy as anywhere else. */
171
+ const linesPart = app && !compact ? shell().slots.formLines?.get() : undefined;
172
+ const lineSets = (linesPart ? (form?.lines ?? []) : []).flatMap((line) => {
173
+ const child = target(line.from);
174
+ return child ? [{ ...line, table: child }] : [];
175
+ });
176
+ const [lines, setLines] = useState(() => Object.fromEntries(lineSets.map((line) => [line.table.id, Array.from({ length: line.min ?? 0 }, linesPart.blankLine)])));
177
+ const [linesTried, setLinesTried] = useState(false);
178
+ const lineChecks = Object.fromEntries(lineSets.map((line) => [
179
+ line.table.id,
180
+ linesPart.lineProblems(line.table, line.show, lines[line.table.id] ?? [], [line.whose, ...(line.order ? [line.order] : [])]),
181
+ ]));
182
+ const linesShort = lineSets.find((line) => (lines[line.table.id]?.length ?? 0) < (line.min ?? 0));
183
+ const live = linesPart ? (form?.live ?? []) : [];
184
+ /* What the form fills without asking (a bound parent key, a hidden default), as its boxes would hold it. */
185
+ const draftDefaults = Object.fromEntries(Object.entries(defaults).map(([name, value]) => [name, value === null || value === undefined ? '' : String(value)]));
186
+ /* The fields whose choices read another: a picker narrowed by a project empties when the project changes. */
187
+ const dependents = (name) => columns.filter((column) => Object.values(dress(column)?.where ?? {}).includes(name));
188
+ /* Steps carve the New form into pages (`form.steps`); an inline Quick Add stays one row. */
189
+ const steps = !compact && form?.steps?.length ? form.steps : undefined;
190
+ const [stepIndex, setStepIndex] = useState(0);
191
+ const stepOf = (name) => Math.max(0, steps?.findIndex((step) => step.fields.includes(name)) ?? 0);
192
+ const errorPrefix = useId();
193
+ const [validationAttempt, setValidationAttempt] = useState();
194
+ const tried = validationAttempt !== undefined;
195
+ const [clearedServerFields, setClearedServerFields] = useState(new Set());
196
+ const [dirty, setDirty] = useState(false);
197
+ const controls = useRef(new Map());
198
+ const edited = useRef(new Set());
199
+ const pendingChange = useCallback((pending) => {
200
+ if (pending)
201
+ onUnresolvedChange?.(true);
202
+ onPendingChange?.(pending);
203
+ }, [onPendingChange, onUnresolvedChange]);
204
+ const submission = useRecordInsert(insert, onAdded, pendingChange);
205
+ useEffect(() => {
206
+ setClearedServerFields(new Set());
207
+ }, [submission.fieldErrors]);
208
+ const hasVisibleServerErrors = submission.fieldErrors.some((error) => columns.some((column) => column.name === error.field));
209
+ const firstVisibleServerField = submission.fieldErrors.find((error) => columns.some((column) => column.name === error.field))?.field;
210
+ // useRecordInsert's pending=false also means a lost response or timeout.
211
+ // Only its actual phase can release the supplemental host exit guard.
212
+ useLayoutEffect(() => {
213
+ onUnresolvedChange?.(submission.phase === 'pending' || submission.phase === 'uncertain');
214
+ }, [submission.phase, onUnresolvedChange]);
215
+ const needsDiscard = dirty && submission.phase === 'idle';
216
+ useLayoutEffect(() => {
217
+ onDiscardChange?.(needsDiscard);
218
+ }, [needsDiscard, onDiscardChange]);
219
+ useEffect(() => {
220
+ if (!needsDiscard)
221
+ return;
222
+ const warn = (event) => {
223
+ event.preventDefault();
224
+ event.returnValue = '';
225
+ };
226
+ addHostListener(window, 'beforeunload', warn);
227
+ return () => removeHostListener(window, 'beforeunload', warn);
228
+ }, [needsDiscard]);
229
+ const feedback = useRef(null);
230
+ const status = useRef(null);
231
+ useLayoutEffect(() => {
232
+ const firstServerField = firstVisibleServerField && controls.current.has(firstVisibleServerField) ? firstVisibleServerField : undefined;
233
+ if (firstServerField)
234
+ controls.current.get(firstServerField)?.focus();
235
+ else if (submission.problem)
236
+ feedback.current?.focus();
237
+ else if (submission.phase === 'pending')
238
+ status.current?.focus();
239
+ }, [submission.fieldErrors, submission.problem, submission.phase]);
240
+ useLayoutEffect(() => {
241
+ if (!validationAttempt)
242
+ return;
243
+ // Focus after the field descriptions and invalid state have been rendered.
244
+ const control = validationAttempt.firstField === undefined ? feedback.current : controls.current.get(validationAttempt.firstField);
245
+ control?.focus();
246
+ }, [validationAttempt]);
247
+ const preset = (column) => presetValue(column, defaults);
248
+ const required = (column) => isRequired(column, assigned);
249
+ const visibilityOf = (values) => {
250
+ /* Untouched defaults are part of the draft even when the control
251
+ * intentionally renders as an empty/omitted input. Once a user
252
+ * edits a field, the live value wins, including an explicit clear. */
253
+ const visibilityValues = {};
254
+ for (const column of columns) {
255
+ const candidate = edited.current.has(column.name) || !Object.hasOwn(defaults, column.name) ? values[column.name] : defaults[column.name];
256
+ /* An empty box is no value: `insurer_id is not empty` is false while the picker is empty, not unknown. */
257
+ if (candidate === '')
258
+ visibilityValues[column.name] = null;
259
+ else if (candidate === null ||
260
+ typeof candidate === 'string' ||
261
+ typeof candidate === 'boolean' ||
262
+ (typeof candidate === 'number' && Number.isFinite(candidate)))
263
+ visibilityValues[column.name] = candidate;
264
+ }
265
+ return visibilityValues;
266
+ };
267
+ const f = useForm({
268
+ defaultValues: Object.fromEntries(columns.map((c) => [c.name, preset(c)])),
269
+ onSubmit: async ({ value }) => {
270
+ if (submission.locked)
271
+ return;
272
+ submission.clearProblem();
273
+ /* Required means required here, before the wire: a form that let the
274
+ database say "NOT NULL constraint failed: task.due_on" had told the
275
+ reader nothing it did not already know about the row and everything
276
+ about the schema. Each missing field is marked where it is, and the
277
+ first gets focus. */
278
+ const values = insertValues(value, defaults, edited.current, table.columns);
279
+ const missing = [
280
+ ...missingFields(columns, values, assigned),
281
+ ...missingFields(table.columns.filter((c) => !columns.includes(c)), values, assigned, form?.derived),
282
+ ];
283
+ const invalid = columns.filter((column) => invalidDate(column, value[column.name] ?? '', kindOf(column)) ||
284
+ textBroken(column, value[column.name]) ||
285
+ amountProblem(column, value));
286
+ const linesWrong = lineSets.length > 0 && (Boolean(linesShort) || Object.values(lineChecks).some((problems) => Object.keys(problems).length));
287
+ if (linesWrong)
288
+ setLinesTried(true);
289
+ if (missing.length || invalid.length || linesWrong) {
290
+ const firstField = missing.find((c) => columns.includes(c))?.name ?? invalid[0]?.name;
291
+ // A field left empty on an earlier page takes the reader back to it.
292
+ if (steps && firstField)
293
+ setStepIndex(stepOf(firstField));
294
+ setValidationAttempt({ firstField });
295
+ return;
296
+ }
297
+ const sentLines = lineSets.length
298
+ ? {
299
+ lines: Object.fromEntries(lineSets.map((line) => [
300
+ line.table.id,
301
+ (lines[line.table.id] ?? []).map((row) => ({
302
+ values: linesPart.lineValues(row, line.show),
303
+ })),
304
+ ])),
305
+ }
306
+ : {};
307
+ const extra = {
308
+ ...(tagValues.length ? { tags: tagValues } : {}),
309
+ ...sentLines,
310
+ };
311
+ await submission.submit(values, Object.keys(extra).length ? extra : undefined);
312
+ },
313
+ });
314
+ /* The first box someone has to fill, not the first box. */
315
+ useEffect(() => {
316
+ const initialValues = Object.fromEntries(columns.map((c) => [c.name, preset(c)]));
317
+ const first = columns.find((c) => isFormFieldVisible(form, c, initialValues, table) && required(c) && !preset(c)) ??
318
+ columns.find((c) => isFormFieldVisible(form, c, initialValues, table));
319
+ if (first)
320
+ controls.current.get(first.name)?.focus();
321
+ }, []);
322
+ /* Leaving a step checks only what it owns; the next step starts unmarked. */
323
+ const stepReady = (step) => {
324
+ const values = f.state.values;
325
+ const visible = visibilityOf(values);
326
+ const owned = columns.filter((column) => step.fields.includes(column.name) && isFormFieldVisible(form, column, visible, table));
327
+ const missing = missingFields(owned, insertValues(values, defaults, edited.current, table.columns), assigned);
328
+ const invalid = owned.filter((column) => invalidDate(column, values[column.name] ?? '', kindOf(column)) ||
329
+ textBroken(column, values[column.name]) ||
330
+ amountProblem(column, values));
331
+ setValidationAttempt(missing.length || invalid.length ? { firstField: missing[0]?.name ?? invalid[0]?.name } : undefined);
332
+ return !missing.length && !invalid.length;
333
+ };
334
+ /* Enter goes forward a step rather than adding the record from its first page. */
335
+ const advance = () => {
336
+ const at = Math.min(stepIndex, steps.length - 1);
337
+ if (!stepReady(steps[at]))
338
+ return;
339
+ if (at === steps.length - 1)
340
+ void f.handleSubmit();
341
+ else
342
+ setStepIndex(at + 1);
343
+ };
344
+ useEffect(() => {
345
+ if (steps && firstVisibleServerField)
346
+ setStepIndex(stepOf(firstVisibleServerField));
347
+ }, [submission.fieldErrors]); // eslint-disable-line react-hooks/exhaustive-deps
348
+ /* The groups, laid out; within a step, only the fields that step owns. */
349
+ const fieldsFor = (only, rows) => (_jsx(f.Subscribe, { selector: (state) => state.values, children: (values) => {
350
+ const visibilityValues = visibilityOf(values);
351
+ return (_jsx(_Fragment, { children: groups.map((group, groupIndex) => {
352
+ const fields = group.columns.filter((column) => (!only || only.has(column.name)) && isFormFieldVisible(form, column, visibilityValues, table));
353
+ if (!fields.length)
354
+ return null;
355
+ const body = fields.map((column) => {
356
+ const index = columns.indexOf(column);
357
+ const kind = kindOf(column);
358
+ const own = dress(column);
359
+ /* A narrowed picker offers nothing until the fields it reads are filled, and says which. */
360
+ /* It reads the draft, and the values the form fills without asking (a bound parent key, a default). */
361
+ const narrowed = own?.where && kind === 'reference' ? narrowingCondition(own.where, { ...defaults, ...values }) : '';
362
+ const waitingOn = narrowed === undefined
363
+ ? Object.values(own.where)
364
+ .map((name) => table.columns.find((c) => c.name === name))
365
+ .filter((c) => Boolean(c))
366
+ .map(label)
367
+ .join(' and ')
368
+ : '';
369
+ /* A row-defined column is its fields, for the definitions the chosen `per` picks (DefinedFields.tsx). */
370
+ const binding = app ? resourceOf(shell().app(), table.id)?.defined?.[column.name] : undefined;
371
+ if (binding)
372
+ return (_jsx(f.Field, { name: column.name, children: (field) => (_jsx(DefinedInputs, { column: column.name, binding: binding, per: binding.per ? { ...defaults, ...values }[binding.per] : undefined, value: field.state.value, errors: submission.fieldErrors, Control: PlatformControl, onChange: (text) => {
373
+ edited.current.add(column.name);
374
+ field.handleChange(text);
375
+ setDirty(hasFormChanges(columns, f.state.values, defaults, edited.current));
376
+ } })) }, column.name));
377
+ return (_jsx(f.Field, { name: column.name, children: (field) => {
378
+ const missing = tried &&
379
+ missingFields([column], insertValues({ [column.name]: field.state.value }, defaults, edited.current, table.columns), assigned).length > 0;
380
+ const serverError = submission.fieldErrors.find((error) => error.field === column.name);
381
+ const fieldMessage = missing
382
+ ? say('fill', { column: label(column) })
383
+ : tried && invalidDate(column, field.state.value, kind)
384
+ ? kind === 'datetime'
385
+ ? say('enterAValidDate')
386
+ : say('enterAValidDateInYyyy')
387
+ : tried && amountProblem(column, values)
388
+ ? amountProblem(column, values)
389
+ : textRule(column) &&
390
+ typeof field.state.value === 'string' &&
391
+ textRuleMessage(textRule(column), field.state.value)
392
+ ? textRuleMessage(textRule(column), field.state.value)
393
+ : serverError && !clearedServerFields.has(column.name)
394
+ ? serverError.message
395
+ : '';
396
+ const errorId = `${errorPrefix}-${index}-error`;
397
+ const help = [own?.help, waitingOn ? say('chooseFirst', { waitingOn }) : ''].filter(Boolean).join(' ') || undefined;
398
+ const helpId = help ? `${errorPrefix}-${index}-help` : undefined;
399
+ return (_jsxs("div", { className: `insert-field${app ? ' form-field' : ''}${fieldMessage ? ' missing is-invalid' : ''}`, children: [app ? (_jsxs("div", { className: "form-field-label-row", children: [_jsx("label", { className: "form-field-label", children: label(column) }), !required(column) && (_jsxs(_Fragment, { children: [' ', _jsx("span", { className: "form-field-optional-word", children: say('optionalWord') })] }))] })) : (_jsxs("label", { children: [label(column), _jsx("span", { className: "type", children: column.type.toLowerCase() }), column.primaryKey && _jsx("span", { className: "pk", children: say('common.key') }), required(column) && (_jsx("span", { className: "req", title: say('notNullWithNoDefault'), children: say('requiredMark') }))] })), _jsx(Control, { column: column, app: app, input: app ? columnInput(table.id, column.name) : undefined, resource: table.id, required: required(column), assigned: assigned, spoken: label(column), target: target, value: field.state.value, kind: kind, rule: app ? ruleIn(column, { ...defaults, ...values }) : (display?.(column) ?? undefined), placeholder: own?.placeholder, as: own?.as, where: narrowed === undefined ? undefined : narrowed || undefined, waiting: narrowed === undefined, helpId: helpId, onChange: (value) => {
400
+ edited.current.add(column.name);
401
+ field.handleChange(value);
402
+ /* A value taken from the record this field names follows the choice, until the person says their own. */
403
+ for (const [name, path] of Object.entries(form?.derived ?? {})) {
404
+ if (!path?.startsWith(`${column.name}.`) || edited.current.has(name))
405
+ continue;
406
+ void derivedValue(path, column, value, target).then((taken) => {
407
+ if (!edited.current.has(name) && f.getFieldValue(column.name) === value)
408
+ f.setFieldValue(name, taken);
409
+ });
410
+ }
411
+ /* A choice narrowed by this field no longer belongs to it. */
412
+ for (const dependent of dependents(column.name)) {
413
+ if (f.getFieldValue(dependent.name)) {
414
+ edited.current.add(dependent.name);
415
+ f.setFieldValue(dependent.name, '');
416
+ }
417
+ }
418
+ if (serverError)
419
+ setClearedServerFields((previous) => {
420
+ const next = new Set(previous);
421
+ next.add(column.name);
422
+ return next;
423
+ });
424
+ setDirty(hasFormChanges(columns, f.state.values, defaults, edited.current));
425
+ }, explicitNull: !edited.current.has(column.name) && Object.hasOwn(defaults, column.name) && defaults[column.name] === null, register: (node) => controls.current.set(column.name, node), errorId: fieldMessage ? errorId : undefined }), help && (_jsx("p", { id: helpId, className: "form-field-hint", children: help })), _jsx("span", { id: errorId, className: "insert-missing", "aria-live": "polite", hidden: !fieldMessage, children: fieldMessage })] }));
426
+ } }, column.name));
427
+ });
428
+ const placed = inRows(fields.map((column) => column.name), body, rows);
429
+ const groupHelp = app ? form?.groups?.find((authored) => authored.label === group.label)?.description : undefined;
430
+ return group.label ? (_jsxs("fieldset", { className: "insert-group", children: [_jsx("legend", { children: group.label }), groupHelp && _jsx("p", { className: "insert-group-description", children: groupHelp }), _jsx("div", { className: "insert-group-fields", children: placed })] }, `${group.label}:${groupIndex}`)) : (_jsx("div", { className: "insert-group-fields", children: placed }, `ungrouped:${groupIndex}`));
431
+ }) }));
432
+ } }));
433
+ /* The Workbench says what an empty box means; an App's form says what the
434
+ author wrote (`description`), if anything — each field's own help says
435
+ what leaving it empty does, where that is worth a sentence. */
436
+ /* The form's `live` figures as its fields and lines change (FormLines.tsx). */
437
+ const liveSummary = (_jsx(f.Subscribe, { selector: (state) => state.values, children: (values) => linesPart && _jsx(linesPart.LiveValues, { table: table, names: live, values: { ...draftDefaults, ...values }, lines: lines }) }));
438
+ const lede = app ? form?.description : say('emptyFieldsAreLeft');
439
+ const cancel = (_jsx(Button, { intent: "secondary", onClick: onCancel, disabled: submission.phase === 'pending' || (retainUncertain && submission.locked), children: submission.locked && submission.phase !== 'pending' && !retainUncertain ? say('common.close') : say('common.cancel') }));
440
+ return (_jsxs("form", { className: `insert-form${app ? ' insert-form-app' : ''}`, "aria-busy": submission.phase === 'pending', onSubmit: (e) => {
441
+ e.preventDefault();
442
+ if (steps)
443
+ advance();
444
+ else
445
+ void f.handleSubmit();
446
+ }, children: [!compact && lede && frame !== 'page' && _jsx("p", { className: "insert-lede", children: lede }), _jsxs("fieldset", { className: "insert-fields", disabled: submission.locked, children: [steps ? (_jsx(MultiStepForm, { steps: steps, step: stepIndex, onStepChange: (index) => setStepIndex(index), className: "insert-steps", validateStep: (step) => stepReady(step), onComplete: () => f.handleSubmit(), completeLabel: app ? say('common.add') : say('addRow'), leading: cancel, presentation: frame === 'page' ? 'page' : 'dialog', ...(form?.style === 'intake' ? { style: 'intake' } : {}), children: (step) => fieldsFor(new Set(step.fields), [...(step.rows ?? []), ...(form?.groups?.flatMap((group) => group.rows ?? []) ?? [])]) })) : (fieldsFor(undefined, form?.showRows)), linesPart && lineSets.length > 0 && (!steps || stepIndex === steps.length - 1) && (_jsxs(_Fragment, { children: [lineSets.map((line, at) => (_jsx(linesPart.LinesEditor, { title: line.label, table: line.table, columns: line.show, rows: lines[line.table.id] ?? [], ordered: Boolean(line.order), max: line.max, problems: {
447
+ ...(linesTried ? lineChecks[line.table.id] : {}),
448
+ ...linesPart.lineServerProblems(line.table, submission.fieldErrors),
449
+ }, onChange: (rows) => {
450
+ setLines((previous) => ({
451
+ ...previous,
452
+ [line.table.id]: rows,
453
+ }));
454
+ setDirty(true);
455
+ },
456
+ /* The totals stand beside the last grid's Add line, their figures under its amounts. */
457
+ summary: at === lineSets.length - 1 && live.length > 0 ? liveSummary : undefined }, line.table.id))), linesTried && linesShort && (_jsx("p", { className: "form-lines-problem", role: "alert", children: say('addAtLeastLines', { min: linesShort.min }) }))] })), live.length > 0 && !lineSets.length && (!steps || stepIndex === steps.length - 1) && liveSummary, offersTags && (!steps || stepIndex === steps.length - 1) && (_jsxs("div", { className: `insert-field${app ? ' form-field' : ''}`, children: [_jsx("label", { className: "form-field-label", children: humanName(tagTable.name) }), _jsx(RecordPicker, { table: tagTable, multiple: true, value: tagValues, onChange: setTagValues, app: true, hideKey: true, ariaLabel: humanName(tagTable.name) })] }))] }), _jsx("p", { ref: status, className: "insert-status", role: "status", tabIndex: -1, hidden: submission.phase !== 'pending', children: say('adding') }), _jsx(f.Subscribe, { selector: (state) => state.values, children: (values) => {
458
+ const hiddenMissing = tried
459
+ ? missingFields(table.columns.filter((c) => !columns.includes(c)), insertValues(values, defaults, edited.current, table.columns), assigned, form?.derived)
460
+ : [];
461
+ const problem = hasVisibleServerErrors
462
+ ? ''
463
+ : submission.problem ||
464
+ (hiddenMissing.length
465
+ ? say('cannotAddThisRecord', {
466
+ map: hiddenMissing.map(label).join(', '),
467
+ })
468
+ : '');
469
+ return (_jsx("p", { ref: feedback, className: "insert-problem", role: "alert", tabIndex: -1, hidden: !problem, children: problem }));
470
+ } }), !steps && (_jsx(NewRecordFrameFooter, { app: app, frame: frame, onCancel: onCancel, pending: submission.phase === 'pending', locked: submission.locked, retainUncertain: retainUncertain }))] }));
471
+ }
472
+ /**
473
+ * A form's rows — a step's, a group's, `show`'s: fields the author put in one row (`[['first_name', 'last_name'], 'dob']`) stand side by side in
474
+ * one Columns, where the form draws them in this order; a row with a field hidden or in another group is what is
475
+ * left of it. Rows only gather neighbours, so the order of the fields is never changed.
476
+ */
477
+ function inRows(names, nodes, rows) {
478
+ if (!rows?.some((row) => row.length > 1))
479
+ return nodes;
480
+ const placed = [];
481
+ let at = 0;
482
+ while (at < names.length) {
483
+ const row = rows.find((candidate) => candidate.length > 1 && candidate.includes(names[at]));
484
+ let end = at + 1;
485
+ while (row && end < names.length && row.includes(names[end]))
486
+ end++;
487
+ placed.push(end - at > 1 ? _jsx(Columns, { children: nodes.slice(at, end) }, `row-${at}`) : nodes[at]);
488
+ at = end;
489
+ }
490
+ return placed;
491
+ }
492
+ /**
493
+ * One control per shape, every one the page's own: a listbox for a
494
+ * vocabulary or a flag, a record picker for a reference, a date box for a
495
+ * date, a text box for the rest. Nothing native draws its menu over the
496
+ * page in the OS's font.
497
+ */
498
+ function Control(props) {
499
+ const { input, resource, ...rest } = props;
500
+ const id = useId();
501
+ if (!input)
502
+ return _jsx(PlatformControl, { ...rest });
503
+ /* The App's own input: it hands back text the form keeps, checks and inserts like any control's. */
504
+ return (_jsx(InputSlot, { component: input, fallback: _jsx(PlatformControl, { ...rest }), value: rest.value, onChange: (next) => rest.onChange(next === null ? '' : String(next)), id: `new-${id}`, describedBy: rest.errorId, invalid: Boolean(rest.errorId), disabled: false, required: rest.required, label: rest.spoken, field: { name: rest.column.name, resource }, context: "new" }));
505
+ }
506
+ let controlsStyled = false;
507
+ /** Whether the cards-and-buttons rules are here; the first field that wants them fetches the sheet. */
508
+ function useControlsStyle(wanted) {
509
+ const [here, setHere] = useState(controlsStyled);
510
+ useEffect(() => {
511
+ if (!wanted || controlsStyled)
512
+ return;
513
+ let live = true;
514
+ void import('./formControlsStyle.js').then(() => {
515
+ controlsStyled = true;
516
+ if (live)
517
+ setHere(true);
518
+ });
519
+ return () => {
520
+ live = false;
521
+ };
522
+ }, [wanted]);
523
+ return here || controlsStyled;
524
+ }
525
+ export function PlatformControl({ column, app, required, assigned, spoken, target, value, onChange, register, explicitNull, errorId, kind, rule, placeholder, as, where, waiting = false, helpId, }) {
526
+ const dateId = useId();
527
+ const radioName = useId();
528
+ const styled = useControlsStyle(app && (as === 'cards' || as === 'buttons'));
529
+ // The shared pickers expose their actual control through these refs. Keep
530
+ // form validation on that focusable element, including after picker renders.
531
+ const validation = useRef(null);
532
+ const setControl = (node) => {
533
+ const previous = validation.current;
534
+ if (previous) {
535
+ // Remove only our descriptions; picker owners may have changed theirs.
536
+ const descriptions = (previous.node.getAttribute('aria-describedby') ?? '')
537
+ .split(/\s+/)
538
+ .filter((id) => id && id !== previous.errorId && id !== previous.helpId);
539
+ if (descriptions.length)
540
+ previous.node.setAttribute('aria-describedby', descriptions.join(' '));
541
+ else
542
+ previous.node.removeAttribute('aria-describedby');
543
+ if (previous.errorId && previous.node.getAttribute('aria-invalid') === 'true') {
544
+ if (previous.invalid === null)
545
+ previous.node.removeAttribute('aria-invalid');
546
+ else
547
+ previous.node.setAttribute('aria-invalid', previous.invalid);
548
+ }
549
+ validation.current = null;
550
+ }
551
+ if (node && (errorId || helpId)) {
552
+ validation.current = {
553
+ node,
554
+ errorId,
555
+ helpId,
556
+ invalid: node.getAttribute('aria-invalid'),
557
+ };
558
+ const descriptions = (node.getAttribute('aria-describedby') ?? '').split(/\s+/).filter(Boolean);
559
+ if (errorId)
560
+ node.setAttribute('aria-invalid', 'true');
561
+ // The help first, then what is wrong: read in the order they are drawn.
562
+ node.setAttribute('aria-describedby', [...new Set([...descriptions, ...(helpId ? [helpId] : []), ...(errorId ? [errorId] : [])])].join(' '));
563
+ }
564
+ // A field that takes typing says it is required; a listbox's button cannot carry the state.
565
+ if (node && node.matches('input, textarea, [role="combobox"]')) {
566
+ if (required)
567
+ node.setAttribute('aria-required', 'true');
568
+ else
569
+ node.removeAttribute('aria-required');
570
+ }
571
+ register(node);
572
+ };
573
+ /* The default as the database spells it in the workbench — `'open'`,
574
+ `CURRENT_TIMESTAMP` — and as a person would in an app: quotes off,
575
+ capitalised, no arrow to a table name. */
576
+ const plainDefault = String(column.default ?? '').replace(/^'(.*)'$/, '$1');
577
+ const allowed = column.allowed;
578
+ /* A stored word as the App says it everywhere else: its `values`, else the vocabulary's words. */
579
+ const word = (stored) => (app ? (wordFor(rule, stored) ?? vocabularyWord(stored)) : stored);
580
+ const hint = explicitNull
581
+ ? app
582
+ ? say('common.noValue')
583
+ : 'null'
584
+ : column.identity || column.name === assigned
585
+ ? say('assignedByTheDatabase')
586
+ : column.default !== undefined
587
+ ? app
588
+ ? say('defaultValue', {
589
+ value: allowed?.includes(plainDefault) ? word(plainDefault) : plainDefault,
590
+ })
591
+ : `default: ${column.default}`
592
+ : column.hasDefault === true
593
+ ? say('defaultSuppliedByTheDatabase')
594
+ : column.references
595
+ ? `→ ${column.references.table}`
596
+ : '';
597
+ const said = placeholder ?? hint;
598
+ /* An App's listbox with nothing chosen asks, quietly, as a command form's does; the workbench keeps its dash. */
599
+ const unchosen = hint || (app ? (readsAsName(spoken) ? say('choosePlaceholder', { label: spoken.toLowerCase() }) : say('chooseOne')) : '—');
600
+ const quietWhenEmpty = value === '' ? 'is-empty' : undefined;
601
+ /* The author's word over the default the kind and the size pick (formRules.ts says which columns may take one). */
602
+ if (app && (as === 'cards' || as === 'buttons') && (allowed?.length || isFlagColumn(column))) {
603
+ if (!styled)
604
+ return null;
605
+ const words = allowed?.length
606
+ ? allowed.map((stored) => [stored, word(stored)])
607
+ : [
608
+ ['1', say('common.yes')],
609
+ ['0', say('common.no')],
610
+ ];
611
+ const cards = as === 'cards';
612
+ return (_jsx("div", { className: cards ? 'choice-cards' : 'choice-pair', role: "radiogroup", "aria-label": spoken, "aria-required": required || undefined, children: words.map(([stored, said], index) => (_jsxs("label", { className: `${cards ? 'choice-card' : 'choice-pick'}${value === stored ? ' is-on' : ''}`, children: [cards && rule?.icons?.[stored] && isAppIcon(rule.icons[stored]) ? (_jsx("span", { className: "choice-card-icon", "aria-hidden": "true", children: _jsx(Icon, { name: rule.icons[stored] }) })) : null, cards ? _jsx("span", { className: "choice-card-label", children: said }) : null, _jsx("input", { type: "radio", name: radioName, value: stored, className: "choice-input", checked: value === stored, onChange: () => onChange(stored), ref: index === 0 ? setControl : undefined }), cards ? _jsx("span", { className: "choice-box", "aria-hidden": "true" }) : said] }, stored))) }));
613
+ }
614
+ if (((kind === 'radios' && as !== 'select') || (as === 'radios' && app)) && allowed?.length) {
615
+ return (_jsx("div", { className: "command-choices insert-choices", role: "radiogroup", "aria-label": spoken, "aria-required": required || undefined, children: allowed.map((stored, index) => (_jsxs("label", { className: "command-choice", children: [_jsx("input", { type: "radio", name: radioName, value: stored, checked: value === stored, onChange: () => onChange(stored), ref: index === 0 ? setControl : undefined }), word(stored)] }, stored))) }));
616
+ }
617
+ if (allowed?.length) {
618
+ return (_jsx(Dropdown, { items: [{ value: '', label: unchosen }, ...allowed.map((v) => ({ value: v, label: word(v) }))], value: value, valueClassName: quietWhenEmpty, ariaLabel: `${spoken}${app ? '' : say('one', { allowed: allowed.join(', ') })}`, onChange: onChange, buttonRef: setControl }));
619
+ }
620
+ if (kind === 'switch' && as !== 'select') {
621
+ /* A flag that is answered either way is a switch: on is yes, off is no — never "leave it to the database". */
622
+ return (_jsxs("label", { className: "insert-switch", children: [_jsx("input", { ref: setControl, type: "checkbox", role: "switch", "aria-label": spoken, checked: value === '1', onChange: (e) => onChange(e.target.checked ? '1' : '0') }), _jsx("span", { "aria-hidden": "true", children: value === '1' ? say('common.yes') : say('common.no') })] }));
623
+ }
624
+ if (isFlagColumn(column)) {
625
+ return (_jsx(Dropdown, { items: [
626
+ { value: '', label: unchosen },
627
+ { value: '1', label: app ? say('common.yes') : 'yes' },
628
+ { value: '0', label: app ? say('common.no') : 'no' },
629
+ ], value: value, valueClassName: quietWhenEmpty, ariaLabel: `${spoken}${app ? '' : ` (${column.type})`}`, onChange: onChange, buttonRef: setControl }));
630
+ }
631
+ const referenced = column.references ? target(column.references.table) : undefined;
632
+ if (referenced) {
633
+ return (_jsx(RecordPicker, { table: referenced, value: value, onChange: onChange, ariaLabel: spoken, app: app, inputRef: setControl, where: where, disabled: waiting, ...(placeholder ? { placeholder } : {}) }));
634
+ }
635
+ if (dateOnly(column) || kind === 'datetime') {
636
+ return (_jsx(DateField, { id: dateId, inputRef: setControl, className: "insert-input", value: value, onChange: onChange, withTime: kind === 'datetime', "aria-label": app ? spoken : `${column.name} (${column.type})`, placeholder: said || (kind === 'datetime' ? say('yyyyMmDdHh') : 'YYYY-MM-DD'), locale: formatLocale(), timezone: formatTimezone() }));
637
+ }
638
+ /* Formatted text: the editor, fetched when the form first draws one. A new record has no row yet for a
639
+ picture to be attached to, so it takes pictures once it is saved and edited. */
640
+ if (kind === 'richText') {
641
+ return (_jsx(RichTextField, { label: spoken, value: value, onChange: onChange, ...(said ? { placeholder: said } : {}), ...(rule?.mentions ? { mentions: mentionSearch(rule.mentions, state.activeConnection) } : {}) }));
642
+ }
643
+ if (kind === 'textarea') {
644
+ return (_jsx("textarea", { ref: setControl, className: "insert-input", rows: 4, placeholder: said, "aria-label": spoken, value: value, onChange: (e) => onChange(e.target.value) }));
645
+ }
646
+ const box = (style, shown = value, change = onChange) => (_jsx("input", { ref: setControl, style: style, type: "text", className: "insert-input", placeholder: app && column.name === assigned ? '' : said, "aria-label": app ? spoken : `${column.name} (${column.type})`, autoComplete: "off", spellCheck: false, ...(kind === 'number' || kind === 'money' ? { inputMode: 'decimal' } : {}), value: shown, onChange: (e) => change(e.target.value) }));
647
+ if (kind !== 'money')
648
+ return box();
649
+ /* Money says its currency in the box, before the figure, as the figure will read once stored. */
650
+ const currency = rule?.currency ?? defaultCurrency();
651
+ /* Kept as minor units: typed as the figure, "19.99", and held as stored, 1999 (MinorMoneyInput.tsx). */
652
+ if (rule?.minor)
653
+ return (_jsx(MinorMoneyInput, { value: value, currency: currency, onChange: onChange, children: (text, typed) => _jsx(MoneyAffix, { sign: currencySymbol(currency), box: (style) => box(style, text, typed) }) }));
654
+ return _jsx(MoneyAffix, { sign: currencySymbol(currency), box: box });
655
+ }
656
+ /* Room between the sign and the first digit, as between a word and the next. */
657
+ const AFFIX_GAP = 4;
658
+ /* The sign a currency is written with here: "$", "€", "CHF". Its own, as FilterRail's is: the lines grid that has
659
+ the same (FormLines.tsx) is the App framework's part, fetched apart from the form. */
660
+ function currencySymbol(currency) {
661
+ try {
662
+ return (new Intl.NumberFormat(formatLocale(), { style: 'currency', currency }).formatToParts(0).find((part) => part.type === 'currency')
663
+ ?.value ?? currency);
664
+ }
665
+ catch {
666
+ return currency;
667
+ }
668
+ }
669
+ /**
670
+ * The currency sign before a money box's figure, and the box's text starting
671
+ * after it. Where the text starts is measured from the sign as drawn — its
672
+ * look's font, a wide sign ("CHF") — on the zoom-aware ruler, and given to
673
+ * the box itself: a padding in `ch` of the box's font, which a look's own
674
+ * padding outranked, left "$" over the first digit of "1850".
675
+ */
676
+ function MoneyAffix({ sign, box }) {
677
+ const unit = useRef(null);
678
+ const [inset, setInset] = useState(undefined);
679
+ useLayoutEffect(() => {
680
+ const node = unit.current;
681
+ const host = node?.parentElement;
682
+ if (!node || !host)
683
+ return;
684
+ const measure = () => {
685
+ const end = viewportBox(node).right - viewportBox(host).left;
686
+ if (end > 0)
687
+ setInset(Math.ceil(end) + AFFIX_GAP);
688
+ };
689
+ measure();
690
+ const observer = new ResizeObserver(measure);
691
+ observer.observe(node);
692
+ return () => observer.disconnect();
693
+ }, [sign]);
694
+ return (_jsxs("span", { className: "insert-affix", children: [_jsx("span", { ref: unit, className: "insert-affix-unit", "aria-hidden": "true", children: sign }), box(inset === undefined ? undefined : { paddingLeft: `${inset}px` })] }));
695
+ }
696
+ /** Cancel and Add, in the frame's own dress: a drawer's foot, a page's actions under its last field, a dialog's row. */
697
+ function NewRecordFrameFooter({ app, frame, onCancel, pending, locked, retainUncertain = false, }) {
698
+ return (_jsxs("div", { className: frame === 'page' ? 'form-actions' : app ? 'newpanel-foot' : 'confirm-actions', children: [_jsx(Button, { intent: "secondary", onClick: onCancel, disabled: pending || (retainUncertain && locked), children: locked && !pending && !retainUncertain ? say('common.close') : say('common.cancel') }), _jsx(Button, { intent: "primary", type: "submit", disabled: locked, children: app ? say('common.add') : say('addRow') })] }));
699
+ }
700
+ /** What Tab stops on inside the drawer. */
701
+ const TAB_STOPS = 'a[href], button:not(:disabled), input:not(:disabled):not([type="hidden"]), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])';
702
+ /** The form's heading, the way both frames say it. */
703
+ function newRecordTitle(table, app) {
704
+ return say('newThing', {
705
+ thing: app ? humanName(table.name).toLowerCase() : table.name,
706
+ });
707
+ }
708
+ /**
709
+ * The New form as an app shows it: a drawer over the list. A modal hid the
710
+ * list you were on, fought the picker's menu for room, and could not be
711
+ * linked to. Escape closes it — unless a picker or listbox inside is open,
712
+ * which takes the first Escape.
713
+ */
714
+ export function NewRecordDrawer(props) {
715
+ const frame = props.app ? formFrame(props.form, formColumns(props.table, props.form, props.app).length) : 'drawer';
716
+ const pane = frame === 'page' ? shellById('content') : null;
717
+ return pane ? _jsx(NewRecordPage, { ...props, pane: pane }) : _jsx(NewRecordSheet, { ...props });
718
+ }
719
+ /**
720
+ * The New form as a page of its own (`form.open: 'page'`, or a long or
721
+ * stepped form): drawn in the content pane, beside the App's menu, as a
722
+ * command form is — one centred measure under the App's name and the
723
+ * form's title. The list it was opened from stays where it was, hidden
724
+ * rather than taken down, so Cancel finds it as it was left.
725
+ */
726
+ function NewRecordPage({ pane, ...props }) {
727
+ const title = newRecordTitle(props.table, props.app);
728
+ const titleId = useId();
729
+ const dismissal = useRecordClose(props.onCancel, props.canClose);
730
+ const opener = useRef(document.activeElement);
731
+ useLayoutEffect(() => {
732
+ pane.classList.add('has-new-page');
733
+ pane.scrollTo?.({ top: 0 });
734
+ return () => pane.classList.remove('has-new-page');
735
+ }, [pane]);
736
+ useEffect(() => () => {
737
+ const back = opener.current;
738
+ queueMicrotask(() => {
739
+ const now = document.activeElement;
740
+ if ((!now || now === document.body) && back instanceof HTMLElement && back.isConnected)
741
+ back.focus({ preventScroll: true });
742
+ });
743
+ }, []);
744
+ return createPortal(_jsxs("div", { className: "newrecord-page-host", children: [_jsxs("section", { className: "form-page newrecord-page", "aria-labelledby": titleId, children: [props.appName && _jsx("p", { className: "eyebrow", children: props.appName }), _jsx("h1", { id: titleId, children: title }), props.form?.description && _jsx("p", { className: "form-page-description", children: props.form.description }), _jsx(NewRecordForm, { ...props, frame: "page", onCancel: dismissal.close, onPendingChange: dismissal.change, onDiscardChange: dismissal.discardChange })] }), dismissal.discard && _jsx(DiscardNewRecord, { onDone: dismissal.resolve })] }), pane);
745
+ }
746
+ /**
747
+ * Everything beside `panel` and beside each of its ancestors up to the shell's body made inert, until the release
748
+ * this returns: out of the accessibility tree, the Tab order and hit testing. What was inert already is left as it
749
+ * was; a popup's portal (one a field in the panel opens, or one the page keeps mounted and closed) and a live region,
750
+ * which says a save's outcome, are left out.
751
+ */
752
+ function inertBehind(panel) {
753
+ const made = [];
754
+ const top = shellBody();
755
+ for (let node = panel; node !== top && node.parentElement; node = node.parentElement) {
756
+ for (const sibling of node.parentElement.children) {
757
+ if (sibling === node || !(sibling instanceof HTMLElement) || sibling.inert)
758
+ continue;
759
+ if (sibling.matches('[data-base-ui-portal], [aria-live], [role="status"], [role="alert"]'))
760
+ continue;
761
+ sibling.inert = true;
762
+ made.push(sibling);
763
+ }
764
+ if (node.parentElement === top)
765
+ break;
766
+ }
767
+ return () => {
768
+ for (const el of made)
769
+ el.inert = false;
770
+ };
771
+ }
772
+ /** The drawer frame: over the list's right side, which stays in sight. */
773
+ function NewRecordSheet(props) {
774
+ const title = newRecordTitle(props.table, props.app);
775
+ const dismissal = useRecordClose(props.onCancel, props.canClose);
776
+ const { pending, close: onCancel, discard } = dismissal;
777
+ /* The drawer is not Modal.tsx (the list stays in sight), so nothing handed
778
+ focus back when it went: the field that had it is removed and focus fell
779
+ to the page itself. It goes back to what opened the drawer — the New
780
+ button — unless the reader has already put it somewhere. */
781
+ const opener = useRef(document.activeElement);
782
+ const panel = useRef(null);
783
+ const root = useRef(null);
784
+ useEffect(() => () => {
785
+ const back = opener.current;
786
+ queueMicrotask(() => {
787
+ const now = document.activeElement;
788
+ if ((!now || now === document.body) && back instanceof HTMLElement && back.isConnected)
789
+ back.focus({ preventScroll: true });
790
+ });
791
+ }, []);
792
+ /* The page behind is inert while the drawer is open, as aria-modal says it is: a list drawn beside the form was
793
+ still in the accessibility tree and under a finger, and a grade of Compass's New lead read the list's grid as a
794
+ control drawn over the form's fields. Released before focus goes back to the New button, which is behind. */
795
+ useLayoutEffect(() => (root.current ? inertBehind(root.current) : undefined), []);
796
+ useEffect(() => {
797
+ const popupOpen = () => shellQuery('.picker-popup:not([data-closed]) .picker-list, .dd-popup:not([data-closed]) .dd-list');
798
+ /* Tab stays in the drawer. A pointer on the list closes the drawer first,
799
+ so the keyboard gets no more of the list than the pointer does; and the
800
+ drawer covers the list's right side, where Tab walked on under it. An
801
+ open picker or listbox inside keeps its own keys. */
802
+ const holdTab = (e) => {
803
+ const box = panel.current;
804
+ if (!box || discard || popupOpen())
805
+ return;
806
+ const stops = [...box.querySelectorAll(TAB_STOPS)].filter((el) => el.checkVisibility?.() ?? true);
807
+ const first = stops[0], last = stops[stops.length - 1];
808
+ if (!first || !last)
809
+ return;
810
+ const at = document.activeElement;
811
+ if (!box.contains(at)) {
812
+ e.preventDefault();
813
+ first.focus();
814
+ }
815
+ else if (e.shiftKey && at === first) {
816
+ e.preventDefault();
817
+ last.focus();
818
+ }
819
+ else if (!e.shiftKey && at === last) {
820
+ e.preventDefault();
821
+ first.focus();
822
+ }
823
+ };
824
+ const onKey = (e) => {
825
+ if (e.key === 'Tab') {
826
+ holdTab(e);
827
+ return;
828
+ }
829
+ if (e.key !== 'Escape')
830
+ return;
831
+ if (discard)
832
+ return;
833
+ if (popupOpen())
834
+ return;
835
+ e.preventDefault();
836
+ e.stopPropagation();
837
+ onCancel();
838
+ };
839
+ addHostListener(document, 'keydown', onKey, true);
840
+ return () => removeHostListener(document, 'keydown', onKey, true);
841
+ }, [onCancel, discard]);
842
+ return (_jsxs("div", { ref: root, className: "peekpanel-root", children: [_jsx("div", { className: "peekpanel-backdrop", onPointerDown: onCancel }), _jsxs("aside", { ref: panel, className: "peekpanel newpanel", role: "dialog", "aria-modal": "true", "aria-label": title, children: [_jsxs("div", { className: "peekpanel-head", children: [_jsx("h2", { className: "peekpanel-title", children: title }), _jsx("button", { type: "button", className: "peekpanel-close", "aria-label": say('common.close'), onClick: onCancel, disabled: pending, children: "\u00D7" })] }), _jsx("div", { className: "peekpanel-body newpanel-body", children: _jsx(NewRecordForm, { ...props, onCancel: onCancel, onPendingChange: dismissal.change, onDiscardChange: dismissal.discardChange }) })] }), discard && _jsx(DiscardNewRecord, { onDone: dismissal.resolve })] }));
843
+ }
844
+ /** Workbench and nested related creation share this dialog and the same form. */
845
+ export function NewRecordDialog(props) {
846
+ const title = newRecordTitle(props.table, props.app);
847
+ const dismissal = useRecordClose(props.onCancel, props.canClose);
848
+ const unresolved = useCallback((next) => {
849
+ if (props.retainUncertain)
850
+ dismissal.change(next);
851
+ props.onUnresolvedChange?.(next);
852
+ }, [props.retainUncertain, props.onUnresolvedChange, dismissal.change]);
853
+ return (_jsxs(Modal, { className: "confirm insert-dialog", onClose: props.onCancel, closeDisabled: dismissal.pending, beforeClose: dismissal.beforeClose, ariaLabel: title, children: [_jsx("h2", { children: title }), _jsx(NewRecordForm, { ...props, onCancel: dismissal.close, onPendingChange: props.retainUncertain ? undefined : dismissal.change, onUnresolvedChange: unresolved, onDiscardChange: dismissal.discardChange }), dismissal.discard && _jsx(DiscardNewRecord, { onDone: dismissal.resolve })] }));
854
+ }
855
+ export function DiscardNewRecord({ onDone }) {
856
+ return (_jsx(ConfirmDialog, { title: say('discardNewRecord'), body: say('yourEntriesHaveNotBeen'), confirmLabel: say('discardRecord'), cancelLabel: say('keepEditing'), onDone: onDone }));
857
+ }
858
+ export function useRecordClose(onCancel, canClose) {
859
+ const [pending, setPending] = useState(false);
860
+ const [discard, setDiscard] = useState(false);
861
+ const busy = useRef(false);
862
+ const dirty = useRef(false);
863
+ const change = useCallback((next) => {
864
+ busy.current = next;
865
+ setPending(next);
866
+ }, []);
867
+ const discardChange = useCallback((next) => {
868
+ dirty.current = next;
869
+ }, []);
870
+ const beforeClose = () => {
871
+ if (busy.current || canClose?.() === false)
872
+ return false;
873
+ if (dirty.current) {
874
+ setDiscard(true);
875
+ return false;
876
+ }
877
+ return true;
878
+ };
879
+ const close = () => {
880
+ if (beforeClose())
881
+ onCancel();
882
+ };
883
+ const resolve = (confirmed) => {
884
+ setDiscard(false);
885
+ if (confirmed && !busy.current && canClose?.() !== false)
886
+ onCancel();
887
+ };
888
+ return {
889
+ pending,
890
+ change,
891
+ close,
892
+ beforeClose,
893
+ discard,
894
+ discardChange,
895
+ resolve,
896
+ };
897
+ }