@declarion/react 0.60.0 → 0.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (487) hide show
  1. package/dist-lib/ActionDialog-uiuse5W8.js +374 -0
  2. package/dist-lib/ActionResultDialog.impl-BUBm9Ck3.js +273 -0
  3. package/dist-lib/ActionRunner-DAxgnKB3.js +1440 -0
  4. package/dist-lib/AdminCatalogPage.impl-BJGn7EvA.js +441 -0
  5. package/dist-lib/{AgentChatPanel.impl-BY-Ir7Sh.js → AgentChatPanel.impl-8bw8J-xV.js} +358 -319
  6. package/dist-lib/AgentOpenFollower.impl-Cga1q7_e.js +81 -0
  7. package/dist-lib/AssociatedBlock-D6qDYmRO.js +1515 -0
  8. package/dist-lib/AuthShell-DdiughRT.js +361 -0
  9. package/dist-lib/ChangePasswordDialog-DFe7lVQg.js +12 -0
  10. package/dist-lib/ChangePasswordDialog.impl-DtSIaP-A.js +194 -0
  11. package/dist-lib/CommandPalette.impl-Db3AFA5w.js +383 -0
  12. package/dist-lib/CopyButton-C0iEvaT1.js +119 -0
  13. package/dist-lib/DirtyTabsCloseDialog.impl-DWaFaWKn.js +191 -0
  14. package/dist-lib/{DraggableChildrenTable-CtL7rdT6.js → DraggableChildrenTable-Cy8uevS_.js} +45 -44
  15. package/dist-lib/DynamicIcon-DuBSz6TZ.js +133 -0
  16. package/dist-lib/FieldRow-BXBBFOZh.js +157 -0
  17. package/dist-lib/FilterChips-8fMDBXHp.js +1031 -0
  18. package/dist-lib/Forgot.impl-CmT5A__V.js +105 -0
  19. package/dist-lib/{Grid-CYERLdXO.js → Grid-Cg29k0jv.js} +98 -99
  20. package/dist-lib/Icons-Dzl-AkD_.d.ts +159 -0
  21. package/dist-lib/Icons-lt-7lhYR.js +151 -0
  22. package/dist-lib/ImpersonationBanner.impl-CBJJx6an.js +76 -0
  23. package/dist-lib/ImpersonationStartModal.impl-RaZcsJpG.js +158 -0
  24. package/dist-lib/Kbd-CNttVu0z.js +23 -0
  25. package/dist-lib/{LayoutRenderer-B08IJKsZ.js → LayoutRenderer-DEHtYtzV.js} +965 -942
  26. package/dist-lib/{ListCardsBody-Dje_rays.js → ListCardsBody-BAwFR3yO.js} +46 -52
  27. package/dist-lib/{MarkdownRenderer-N0IWjTH5.js → MarkdownRenderer-kNEMr6K_.js} +15 -16
  28. package/dist-lib/MenuItem-CfkVXPvC.js +140 -0
  29. package/dist-lib/NotFoundPage.impl-ZSBn4WWb.js +68 -0
  30. package/dist-lib/PageHeader-tw4pX3lI.js +71 -0
  31. package/dist-lib/PageShell-tI-mm0C5.js +47 -0
  32. package/dist-lib/Pill-D-wsfRhx.js +42 -0
  33. package/dist-lib/Preferences.impl-BG9XBZDf.js +162 -0
  34. package/dist-lib/Profile.impl-CbzSzxyG.js +527 -0
  35. package/dist-lib/PropertyGridEditor-BTjscqfz.js +4378 -0
  36. package/dist-lib/RecordHeader-Bv9nJXnG.js +217 -0
  37. package/dist-lib/RecordIdBadge-C3MgoZvt.js +25 -0
  38. package/dist-lib/RefreshControl-Ce-T_wSQ.js +195 -0
  39. package/dist-lib/Reset.impl-Cesyqt5p.js +168 -0
  40. package/dist-lib/SSOCallbackPage.impl-BC_W9nQA.js +31 -0
  41. package/dist-lib/SectionCard-VonaiLrx.js +150 -0
  42. package/dist-lib/SignUp.impl-C1KCQbfZ.js +212 -0
  43. package/dist-lib/SmartDetailPage.impl-8iOAMYQh.js +1609 -0
  44. package/dist-lib/SmartListPage.impl-Cc4Zwz5f.js +2818 -0
  45. package/dist-lib/SmartRecordListPage.impl-xTSohkqG.js +795 -0
  46. package/dist-lib/{SortHeaderMenu-DKKeCGTH.js → SortHeaderMenu-BKTrq0Wb.js} +23 -23
  47. package/dist-lib/TenantParamsPage.impl-DMuSs3eP.js +306 -0
  48. package/dist-lib/TwoFA.impl-BClZ3ndk.js +125 -0
  49. package/dist-lib/{cardProjection-nveYLvHR.js → cardProjection-Cr7fG6wJ.js} +134 -133
  50. package/dist-lib/declarion-react.css +1 -1
  51. package/dist-lib/format-count-CSEFw2ht.js +943 -0
  52. package/dist-lib/headerActionZone-bef-tZZ7.js +14 -0
  53. package/dist-lib/{stores/icon-registry.d.ts → icon-registry-CUT4eF63.d.ts} +14 -11
  54. package/dist-lib/icons.d.ts +20 -4
  55. package/dist-lib/icons.js +3 -2
  56. package/dist-lib/index.d.ts +2516 -150
  57. package/dist-lib/index.js +1532 -5053
  58. package/dist-lib/page-inset-D_kkVwwN.js +9 -0
  59. package/dist-lib/page-state-eA6J_KIR.js +124 -0
  60. package/dist-lib/param-editors-9yJr7xmN.js +201 -0
  61. package/dist-lib/payload-B2wODLAX.js +86 -0
  62. package/dist-lib/{peekDraftStore-DSExeoAh.js → peekDraftStore-D4GRsRKW.js} +44 -43
  63. package/dist-lib/registry-BpzE8-h8.js +119 -0
  64. package/dist-lib/screen-back-Cs4kzeqD.js +44 -0
  65. package/dist-lib/testing.d.ts +53 -56
  66. package/dist-lib/testing.js +54 -55
  67. package/dist-lib/use-filter-value-labels-DuqvAIVG.js +413 -0
  68. package/dist-lib/{useAgentConversation-BavrHfrU.js → useAgentConversation-D210VDCQ.js} +158 -169
  69. package/dist-lib/useAuth-CR2YKKXb.js +49 -0
  70. package/dist-lib/useBranding-Ckp_AuJb.js +41 -0
  71. package/dist-lib/useBrandingChrome-bKTXXDLy.js +170 -0
  72. package/dist-lib/useCurrentLocation-BdngVeQv.js +22 -0
  73. package/dist-lib/useCurrentScreen--UovgvRj.js +2511 -0
  74. package/dist-lib/useImpersonation-DNV23Ks1.js +35 -0
  75. package/dist-lib/useObject-1OCeV34A.js +26 -0
  76. package/dist-lib/useOwnRefresh-DkOuM4yo.js +435 -0
  77. package/dist-lib/useParams-ei6w4I7w.js +133 -0
  78. package/dist-lib/useProperties-CbdhlhZd.js +81 -0
  79. package/dist-lib/useResponsiveMode-DIR1bZfo.d.ts +1786 -0
  80. package/dist-lib/useScreenBack-J861tbwn.js +71 -0
  81. package/dist-lib/useTabNavigate-BZiW4q3M.js +78 -0
  82. package/dist-lib/useTabTitle-CZZnWIQi.js +22 -0
  83. package/dist-lib/utils-D_QDpB8_.js +11 -0
  84. package/dist-lib/{value-By1-WJ8J.js → value-CDCeHgOv.js} +8 -22
  85. package/dist-lib/{action-dispatch-DbiOpvd6.js → variants-CbAwl3Mn.js} +734 -740
  86. package/dist-lib/vite/index.d.ts +42 -16
  87. package/dist-lib/window-election-CHIvIZwx.js +45 -0
  88. package/package.json +17 -24
  89. package/dist-lib/DetailAuditStrip-B9p1XhjC.js +0 -288
  90. package/dist-lib/DynamicIcon-DW5krHuX.js +0 -280
  91. package/dist-lib/RefreshControl-BEWSHtAC.js +0 -399
  92. package/dist-lib/SmartDetailPage.impl-CYiM-ITJ.js +0 -1565
  93. package/dist-lib/SmartListPage.impl-Db_Pv9Xc.js +0 -3051
  94. package/dist-lib/SmartRecordListPage.impl-hbbLglC1.js +0 -780
  95. package/dist-lib/api/agents.d.ts +0 -140
  96. package/dist-lib/api/auth-redirect.d.ts +0 -3
  97. package/dist-lib/api/auth.d.ts +0 -26
  98. package/dist-lib/api/batch.d.ts +0 -25
  99. package/dist-lib/api/client.d.ts +0 -51
  100. package/dist-lib/api/data.d.ts +0 -153
  101. package/dist-lib/api/entities.d.ts +0 -149
  102. package/dist-lib/api/events.d.ts +0 -91
  103. package/dist-lib/api/params.d.ts +0 -28
  104. package/dist-lib/api/properties.d.ts +0 -3
  105. package/dist-lib/api/schema.d.ts +0 -2
  106. package/dist-lib/api/status.d.ts +0 -2
  107. package/dist-lib/app.d.ts +0 -1
  108. package/dist-lib/components/actions/ActionButton.d.ts +0 -18
  109. package/dist-lib/components/actions/ActionDialog.d.ts +0 -20
  110. package/dist-lib/components/actions/ActionResultDialog.d.ts +0 -22
  111. package/dist-lib/components/actions/ActionRunner.d.ts +0 -62
  112. package/dist-lib/components/actions/ObjectActionBar.d.ts +0 -29
  113. package/dist-lib/components/actions/PropertyGridEditor.d.ts +0 -20
  114. package/dist-lib/components/actions/ResponsiveActionBar.d.ts +0 -259
  115. package/dist-lib/components/actions/RowActionsKebab.d.ts +0 -20
  116. package/dist-lib/components/agents/AgentChatPanel.d.ts +0 -3
  117. package/dist-lib/components/agents/AgentChatPanel.impl.d.ts +0 -14
  118. package/dist-lib/components/agents/AgentConversationDrawer.d.ts +0 -11
  119. package/dist-lib/components/agents/AgentElicitForm.d.ts +0 -27
  120. package/dist-lib/components/agents/AgentPicker.d.ts +0 -8
  121. package/dist-lib/components/agents/transcript-runs.d.ts +0 -29
  122. package/dist-lib/components/chrome/AssociationTabs.d.ts +0 -9
  123. package/dist-lib/components/chrome/AuditMetaStrip.d.ts +0 -11
  124. package/dist-lib/components/chrome/Breadcrumbs.d.ts +0 -14
  125. package/dist-lib/components/chrome/HighlightsStrip.d.ts +0 -10
  126. package/dist-lib/components/chrome/PageHeader.d.ts +0 -16
  127. package/dist-lib/components/chrome/PageShell.d.ts +0 -7
  128. package/dist-lib/components/chrome/RecordHeader.d.ts +0 -17
  129. package/dist-lib/components/chrome/headerActionZone.d.ts +0 -27
  130. package/dist-lib/components/detail-layout/AssociatedBlock.d.ts +0 -20
  131. package/dist-lib/components/detail-layout/AssociatedToolbar.d.ts +0 -13
  132. package/dist-lib/components/detail-layout/ChildrenBlock.d.ts +0 -16
  133. package/dist-lib/components/detail-layout/ChildrenCards.d.ts +0 -2
  134. package/dist-lib/components/detail-layout/ChildrenList.d.ts +0 -2
  135. package/dist-lib/components/detail-layout/ChildrenTable.d.ts +0 -2
  136. package/dist-lib/components/detail-layout/ChildrenTimeline.d.ts +0 -2
  137. package/dist-lib/components/detail-layout/DetailAuditStrip.d.ts +0 -12
  138. package/dist-lib/components/detail-layout/DetailHighlights.d.ts +0 -14
  139. package/dist-lib/components/detail-layout/DraggableChildrenTable.d.ts +0 -16
  140. package/dist-lib/components/detail-layout/EditableChildrenTable.d.ts +0 -16
  141. package/dist-lib/components/detail-layout/ErrorSummary.d.ts +0 -11
  142. package/dist-lib/components/detail-layout/EvidenceBlock.d.ts +0 -6
  143. package/dist-lib/components/detail-layout/FieldRow.d.ts +0 -23
  144. package/dist-lib/components/detail-layout/FieldsBlock.d.ts +0 -8
  145. package/dist-lib/components/detail-layout/LayoutColumn.d.ts +0 -9
  146. package/dist-lib/components/detail-layout/LayoutRenderer.d.ts +0 -46
  147. package/dist-lib/components/detail-layout/LayoutRow.d.ts +0 -8
  148. package/dist-lib/components/detail-layout/LayoutTabs.d.ts +0 -8
  149. package/dist-lib/components/detail-layout/PropertiesBlock.d.ts +0 -8
  150. package/dist-lib/components/detail-layout/QuickAddForm.d.ts +0 -10
  151. package/dist-lib/components/detail-layout/SectionBlock.d.ts +0 -8
  152. package/dist-lib/components/detail-layout/StatusesBlock.d.ts +0 -8
  153. package/dist-lib/components/detail-layout/TimelineComposer.d.ts +0 -10
  154. package/dist-lib/components/detail-layout/blockMeta.d.ts +0 -5
  155. package/dist-lib/components/detail-layout/index.d.ts +0 -21
  156. package/dist-lib/components/detail-layout/useManualColumnResize.d.ts +0 -25
  157. package/dist-lib/components/detail-layout/useQuickAdd.d.ts +0 -16
  158. package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.d.ts +0 -2
  159. package/dist-lib/components/detail-layout/widgets/JsonDiffWidget.d.ts +0 -2
  160. package/dist-lib/components/detail-layout/widgets/MonacoJson.d.ts +0 -9
  161. package/dist-lib/components/detail-layout/widgets/WidgetHost.d.ts +0 -9
  162. package/dist-lib/components/detail-layout/widgets/builtins.d.ts +0 -1
  163. package/dist-lib/components/detail-layout/widgets/canonicalizeJson.d.ts +0 -1
  164. package/dist-lib/components/detail-layout/widgets/monacoBootstrap.d.ts +0 -1
  165. package/dist-lib/components/detail-layout/widgets/registry.d.ts +0 -14
  166. package/dist-lib/components/fields/BoolField.d.ts +0 -2
  167. package/dist-lib/components/fields/EmailField.d.ts +0 -2
  168. package/dist-lib/components/fields/EnumField.d.ts +0 -2
  169. package/dist-lib/components/fields/IntArrayField.d.ts +0 -2
  170. package/dist-lib/components/fields/JsonEditor.d.ts +0 -10
  171. package/dist-lib/components/fields/JsonField.d.ts +0 -3
  172. package/dist-lib/components/fields/MultilangArrayField.d.ts +0 -2
  173. package/dist-lib/components/fields/MultilangField.d.ts +0 -2
  174. package/dist-lib/components/fields/MultilangTextField.d.ts +0 -2
  175. package/dist-lib/components/fields/NumberField.d.ts +0 -2
  176. package/dist-lib/components/fields/PasswordField.d.ts +0 -2
  177. package/dist-lib/components/fields/PhoneField.d.ts +0 -2
  178. package/dist-lib/components/fields/RefCombobox.d.ts +0 -45
  179. package/dist-lib/components/fields/RefField.d.ts +0 -2
  180. package/dist-lib/components/fields/RichTextField.d.ts +0 -2
  181. package/dist-lib/components/fields/SecretField.d.ts +0 -2
  182. package/dist-lib/components/fields/StringArrayField.d.ts +0 -2
  183. package/dist-lib/components/fields/StringField.d.ts +0 -2
  184. package/dist-lib/components/fields/StructureField.d.ts +0 -2
  185. package/dist-lib/components/fields/TextField.d.ts +0 -2
  186. package/dist-lib/components/fields/TimestampField.d.ts +0 -2
  187. package/dist-lib/components/fields/UrlField.d.ts +0 -2
  188. package/dist-lib/components/fields/cells/factories/badge.d.ts +0 -2
  189. package/dist-lib/components/fields/cells/factories/boolPill.d.ts +0 -2
  190. package/dist-lib/components/fields/cells/factories/code.d.ts +0 -2
  191. package/dist-lib/components/fields/cells/factories/date.d.ts +0 -2
  192. package/dist-lib/components/fields/cells/factories/email.d.ts +0 -2
  193. package/dist-lib/components/fields/cells/factories/emptyCell.d.ts +0 -2
  194. package/dist-lib/components/fields/cells/factories/host-icons.d.ts +0 -17
  195. package/dist-lib/components/fields/cells/factories/json.d.ts +0 -2
  196. package/dist-lib/components/fields/cells/factories/link.d.ts +0 -2
  197. package/dist-lib/components/fields/cells/factories/markdown.d.ts +0 -2
  198. package/dist-lib/components/fields/cells/factories/markdownPreview.d.ts +0 -9
  199. package/dist-lib/components/fields/cells/factories/money.d.ts +0 -2
  200. package/dist-lib/components/fields/cells/factories/multilangInline.d.ts +0 -2
  201. package/dist-lib/components/fields/cells/factories/nextRun.d.ts +0 -2
  202. package/dist-lib/components/fields/cells/factories/number.d.ts +0 -2
  203. package/dist-lib/components/fields/cells/factories/passwordMask.d.ts +0 -2
  204. package/dist-lib/components/fields/cells/factories/phone.d.ts +0 -2
  205. package/dist-lib/components/fields/cells/factories/refLink.d.ts +0 -2
  206. package/dist-lib/components/fields/cells/factories/richTextPreview.d.ts +0 -2
  207. package/dist-lib/components/fields/cells/factories/statusPill.d.ts +0 -2
  208. package/dist-lib/components/fields/cells/factories/tagList.d.ts +0 -2
  209. package/dist-lib/components/fields/cells/factories/text.d.ts +0 -2
  210. package/dist-lib/components/fields/cells/factories/timestamp.d.ts +0 -3
  211. package/dist-lib/components/fields/cells/factories/url-helpers.d.ts +0 -12
  212. package/dist-lib/components/fields/cells/factories/url.d.ts +0 -2
  213. package/dist-lib/components/fields/cells/registry.d.ts +0 -21
  214. package/dist-lib/components/fields/index.d.ts +0 -28
  215. package/dist-lib/components/fields/langMap.d.ts +0 -2
  216. package/dist-lib/components/fields/secretValue.d.ts +0 -2
  217. package/dist-lib/components/file-widgets/CircleImage.d.ts +0 -2
  218. package/dist-lib/components/file-widgets/DocumentCard.d.ts +0 -2
  219. package/dist-lib/components/file-widgets/FileList.d.ts +0 -2
  220. package/dist-lib/components/file-widgets/Grid.d.ts +0 -2
  221. package/dist-lib/components/file-widgets/GridLazy.d.ts +0 -2
  222. package/dist-lib/components/file-widgets/ImageWidget.d.ts +0 -12
  223. package/dist-lib/components/file-widgets/LabeledSlots.d.ts +0 -2
  224. package/dist-lib/components/file-widgets/SquareImage.d.ts +0 -2
  225. package/dist-lib/components/file-widgets/UnknownFileWidget.d.ts +0 -3
  226. package/dist-lib/components/file-widgets/UploadFailureText.d.ts +0 -4
  227. package/dist-lib/components/file-widgets/WideBanner.d.ts +0 -2
  228. package/dist-lib/components/file-widgets/builtins.d.ts +0 -1
  229. package/dist-lib/components/file-widgets/cropper.d.ts +0 -14
  230. package/dist-lib/components/file-widgets/draft-scope.d.ts +0 -22
  231. package/dist-lib/components/file-widgets/helpers.d.ts +0 -15
  232. package/dist-lib/components/file-widgets/host.d.ts +0 -28
  233. package/dist-lib/components/file-widgets/index.d.ts +0 -16
  234. package/dist-lib/components/file-widgets/payload.d.ts +0 -21
  235. package/dist-lib/components/file-widgets/registry.d.ts +0 -5
  236. package/dist-lib/components/file-widgets/types.d.ts +0 -17
  237. package/dist-lib/components/file-widgets/upload.d.ts +0 -45
  238. package/dist-lib/components/file-widgets/useEmbedFileSrc.d.ts +0 -42
  239. package/dist-lib/components/file-widgets/value.d.ts +0 -4
  240. package/dist-lib/components/filters/FilterChips.d.ts +0 -14
  241. package/dist-lib/components/filters/FilterDrawer.d.ts +0 -32
  242. package/dist-lib/components/filters/filter-op-label.d.ts +0 -3
  243. package/dist-lib/components/layout/CommandPalette.d.ts +0 -21
  244. package/dist-lib/components/layout/DirtyTabsCloseDialog.d.ts +0 -9
  245. package/dist-lib/components/layout/ImpersonationBanner.d.ts +0 -11
  246. package/dist-lib/components/layout/ImpersonationFrame.d.ts +0 -11
  247. package/dist-lib/components/layout/ImpersonationStartModal.d.ts +0 -22
  248. package/dist-lib/components/layout/Layout.d.ts +0 -6
  249. package/dist-lib/components/layout/Rail.d.ts +0 -22
  250. package/dist-lib/components/layout/Sidebar.d.ts +0 -12
  251. package/dist-lib/components/layout/TabStrip.d.ts +0 -6
  252. package/dist-lib/components/layout/TenantChip.d.ts +0 -26
  253. package/dist-lib/components/layout/TopBar.d.ts +0 -22
  254. package/dist-lib/components/layout/tab-close.d.ts +0 -13
  255. package/dist-lib/components/list/ColumnPicker.d.ts +0 -20
  256. package/dist-lib/components/list/InlineEditCell.d.ts +0 -15
  257. package/dist-lib/components/list/PeekFieldCell.d.ts +0 -16
  258. package/dist-lib/components/list/QuickPeek.d.ts +0 -59
  259. package/dist-lib/components/list/ViewSwitcher.d.ts +0 -24
  260. package/dist-lib/components/list/peekDraftStore.d.ts +0 -6
  261. package/dist-lib/components/pages/AdminCatalogPage.d.ts +0 -1
  262. package/dist-lib/components/pages/DocumentsMenu.d.ts +0 -21
  263. package/dist-lib/components/pages/ExportMenu.d.ts +0 -30
  264. package/dist-lib/components/pages/NotFoundPage.d.ts +0 -1
  265. package/dist-lib/components/pages/RecordDocumentsPanel.d.ts +0 -41
  266. package/dist-lib/components/pages/SSOCallbackPage.d.ts +0 -1
  267. package/dist-lib/components/pages/SmartDetailPage.d.ts +0 -2
  268. package/dist-lib/components/pages/SmartDetailPage.impl.d.ts +0 -4
  269. package/dist-lib/components/pages/SmartListPage.d.ts +0 -2
  270. package/dist-lib/components/pages/SmartListPage.impl.d.ts +0 -4
  271. package/dist-lib/components/pages/SmartRecordListPage.d.ts +0 -2
  272. package/dist-lib/components/pages/SmartRecordListPage.impl.d.ts +0 -4
  273. package/dist-lib/components/pages/auth/AuthShell.d.ts +0 -18
  274. package/dist-lib/components/pages/auth/Forgot.d.ts +0 -1
  275. package/dist-lib/components/pages/auth/Reset.d.ts +0 -1
  276. package/dist-lib/components/pages/auth/SignIn.d.ts +0 -1
  277. package/dist-lib/components/pages/auth/SignUp.d.ts +0 -1
  278. package/dist-lib/components/pages/auth/TwoFA.d.ts +0 -1
  279. package/dist-lib/components/pages/auth/icons.d.ts +0 -6
  280. package/dist-lib/components/pages/exportRequest.d.ts +0 -69
  281. package/dist-lib/components/pages/list/DataCell.d.ts +0 -4
  282. package/dist-lib/components/pages/list/DeleteViewDialog.d.ts +0 -8
  283. package/dist-lib/components/pages/list/ListCardRow.d.ts +0 -39
  284. package/dist-lib/components/pages/list/ListCardsBody.d.ts +0 -33
  285. package/dist-lib/components/pages/list/ListFloatbar.d.ts +0 -29
  286. package/dist-lib/components/pages/list/ListFooter.d.ts +0 -26
  287. package/dist-lib/components/pages/list/ListHeader.d.ts +0 -26
  288. package/dist-lib/components/pages/list/ListNoRows.d.ts +0 -31
  289. package/dist-lib/components/pages/list/ListTable.d.ts +0 -33
  290. package/dist-lib/components/pages/list/ListTableRow.d.ts +0 -17
  291. package/dist-lib/components/pages/list/ListToolbar.d.ts +0 -46
  292. package/dist-lib/components/pages/list/ListUrlBanner.d.ts +0 -10
  293. package/dist-lib/components/pages/list/RowActionsCell.d.ts +0 -34
  294. package/dist-lib/components/pages/list/RowContextMenu.d.ts +0 -28
  295. package/dist-lib/components/pages/list/SaveViewDialog.d.ts +0 -10
  296. package/dist-lib/components/pages/list/SortHeaderMenu.d.ts +0 -14
  297. package/dist-lib/components/pages/list/cardProjection.d.ts +0 -67
  298. package/dist-lib/components/pages/list/column-sizing.d.ts +0 -14
  299. package/dist-lib/components/pages/list/columns.d.ts +0 -46
  300. package/dist-lib/components/pages/list/filter-meta.d.ts +0 -25
  301. package/dist-lib/components/pages/list/page-size.d.ts +0 -3
  302. package/dist-lib/components/pages/list/sortable-header.d.ts +0 -2
  303. package/dist-lib/components/pages/list/table-features.d.ts +0 -14
  304. package/dist-lib/components/pages/list/use-filter-value-labels.d.ts +0 -24
  305. package/dist-lib/components/pages/list/useActiveView.d.ts +0 -45
  306. package/dist-lib/components/pages/list/useHeaderReorder.d.ts +0 -26
  307. package/dist-lib/components/pages/list/useListColumnLayout.d.ts +0 -38
  308. package/dist-lib/components/pages/list/useListQuery.d.ts +0 -67
  309. package/dist-lib/components/pages/list/useListRowInteraction.d.ts +0 -61
  310. package/dist-lib/components/pages/list/useListSelection.d.ts +0 -31
  311. package/dist-lib/components/pages/list/useListSort.d.ts +0 -46
  312. package/dist-lib/components/pages/list/useListViews.d.ts +0 -57
  313. package/dist-lib/components/pages/list/useRowMenu.d.ts +0 -46
  314. package/dist-lib/components/pages/profile/Preferences.d.ts +0 -1
  315. package/dist-lib/components/pages/profile/Profile.d.ts +0 -7
  316. package/dist-lib/components/pages/tenant-params/TenantParamsPage.d.ts +0 -2
  317. package/dist-lib/components/params/ParamsBlock.d.ts +0 -13
  318. package/dist-lib/components/params/param-editors.d.ts +0 -20
  319. package/dist-lib/components/primitives/Avatar.d.ts +0 -6
  320. package/dist-lib/components/primitives/BoolToggle.d.ts +0 -7
  321. package/dist-lib/components/primitives/BrandGlyph.d.ts +0 -8
  322. package/dist-lib/components/primitives/BrandLogo.d.ts +0 -12
  323. package/dist-lib/components/primitives/Btn.d.ts +0 -19
  324. package/dist-lib/components/primitives/Check.d.ts +0 -7
  325. package/dist-lib/components/primitives/Chip.d.ts +0 -9
  326. package/dist-lib/components/primitives/ClassifiedFieldLocked.d.ts +0 -9
  327. package/dist-lib/components/primitives/Dropdown.d.ts +0 -20
  328. package/dist-lib/components/primitives/Fields.d.ts +0 -109
  329. package/dist-lib/components/primitives/HoverCard.d.ts +0 -15
  330. package/dist-lib/components/primitives/IconBtn.d.ts +0 -11
  331. package/dist-lib/components/primitives/Icons.d.ts +0 -136
  332. package/dist-lib/components/primitives/Kbd.d.ts +0 -4
  333. package/dist-lib/components/primitives/MenuItem.d.ts +0 -14
  334. package/dist-lib/components/primitives/Pill.d.ts +0 -11
  335. package/dist-lib/components/primitives/RecordIdBadge.d.ts +0 -8
  336. package/dist-lib/components/primitives/RowField.d.ts +0 -10
  337. package/dist-lib/components/primitives/SectionCard.d.ts +0 -24
  338. package/dist-lib/components/primitives/Spinner.d.ts +0 -3
  339. package/dist-lib/components/primitives/Tooltip.d.ts +0 -34
  340. package/dist-lib/components/primitives/dataTableStyles.d.ts +0 -4
  341. package/dist-lib/components/primitives/index.d.ts +0 -37
  342. package/dist-lib/components/shared/ChangePasswordDialog.d.ts +0 -9
  343. package/dist-lib/components/shared/ConfirmDialog.d.ts +0 -11
  344. package/dist-lib/components/shared/CopyButton.d.ts +0 -8
  345. package/dist-lib/components/shared/DynamicIcon.d.ts +0 -20
  346. package/dist-lib/components/shared/EmptyState.d.ts +0 -9
  347. package/dist-lib/components/shared/ErrorBoundary.d.ts +0 -17
  348. package/dist-lib/components/shared/LoadingSkeleton.d.ts +0 -6
  349. package/dist-lib/components/shared/LucideIcon.d.ts +0 -16
  350. package/dist-lib/components/shared/Markdown.d.ts +0 -3
  351. package/dist-lib/components/shared/MarkdownRenderer.d.ts +0 -11
  352. package/dist-lib/components/shared/RefreshControl.d.ts +0 -25
  353. package/dist-lib/components/shared/StatusGroupsDisplay.d.ts +0 -11
  354. package/dist-lib/components/shared/StatusStepper.d.ts +0 -13
  355. package/dist-lib/components/shared/toast/DeclarionToast.d.ts +0 -31
  356. package/dist-lib/components/shared/useOwnRefresh.d.ts +0 -9
  357. package/dist-lib/embed/EmbedAuthBootstrap.d.ts +0 -8
  358. package/dist-lib/embed/EmbedContext.d.ts +0 -50
  359. package/dist-lib/embed/EmbedDirtyReporter.d.ts +0 -10
  360. package/dist-lib/embed/EmbedHistoryTracker.d.ts +0 -1
  361. package/dist-lib/embed/EmbedLocationReporter.d.ts +0 -8
  362. package/dist-lib/embed/EmbedResizeReporter.d.ts +0 -6
  363. package/dist-lib/embed/EmbedUnsavedGuard.d.ts +0 -7
  364. package/dist-lib/embed/embed-dirty.d.ts +0 -24
  365. package/dist-lib/embed/embed-history.d.ts +0 -19
  366. package/dist-lib/embed/embed-nav-guard.d.ts +0 -20
  367. package/dist-lib/embed/file-src.d.ts +0 -63
  368. package/dist-lib/embed/handshake.d.ts +0 -57
  369. package/dist-lib/embed/index.d.ts +0 -19
  370. package/dist-lib/embed/params.d.ts +0 -75
  371. package/dist-lib/embed/protocol.d.ts +0 -165
  372. package/dist-lib/embed/screen-location.d.ts +0 -50
  373. package/dist-lib/embed/theme.d.ts +0 -34
  374. package/dist-lib/embed/token.d.ts +0 -57
  375. package/dist-lib/embed/useEmbedNavigate.d.ts +0 -48
  376. package/dist-lib/embed/useGlobalLinkInterceptor.d.ts +0 -66
  377. package/dist-lib/failure-BT54OLHy.js +0 -158
  378. package/dist-lib/format-count-DLFCdtME.js +0 -1771
  379. package/dist-lib/hooks/useActionData.d.ts +0 -61
  380. package/dist-lib/hooks/useAgentConversation.d.ts +0 -24
  381. package/dist-lib/hooks/useAllEntityData.d.ts +0 -16
  382. package/dist-lib/hooks/useAssociatedData.d.ts +0 -10
  383. package/dist-lib/hooks/useAuth.d.ts +0 -22
  384. package/dist-lib/hooks/useBranding.d.ts +0 -8
  385. package/dist-lib/hooks/useBrandingChrome.d.ts +0 -59
  386. package/dist-lib/hooks/useChildrenData.d.ts +0 -3
  387. package/dist-lib/hooks/useColumns.d.ts +0 -13
  388. package/dist-lib/hooks/useCurrentScreen.d.ts +0 -34
  389. package/dist-lib/hooks/useCursorEntityData.d.ts +0 -79
  390. package/dist-lib/hooks/useDebounce.d.ts +0 -1
  391. package/dist-lib/hooks/useEntity.d.ts +0 -2
  392. package/dist-lib/hooks/useEntityData.d.ts +0 -41
  393. package/dist-lib/hooks/useFilters.d.ts +0 -14
  394. package/dist-lib/hooks/useImpersonation.d.ts +0 -23
  395. package/dist-lib/hooks/useLanguage.d.ts +0 -4
  396. package/dist-lib/hooks/useLiveObject.d.ts +0 -9
  397. package/dist-lib/hooks/useLongPress.d.ts +0 -29
  398. package/dist-lib/hooks/useMutations.d.ts +0 -13
  399. package/dist-lib/hooks/useObject.d.ts +0 -11
  400. package/dist-lib/hooks/useObjectStatus.d.ts +0 -5
  401. package/dist-lib/hooks/usePageState.d.ts +0 -32
  402. package/dist-lib/hooks/usePageStateRuntime.d.ts +0 -27
  403. package/dist-lib/hooks/usePageStateTtl.d.ts +0 -11
  404. package/dist-lib/hooks/useParams.d.ts +0 -49
  405. package/dist-lib/hooks/useProperties.d.ts +0 -5
  406. package/dist-lib/hooks/useRealtimeThresholds.d.ts +0 -1
  407. package/dist-lib/hooks/useRegisterScreenTab.d.ts +0 -11
  408. package/dist-lib/hooks/useResponsiveMode.d.ts +0 -27
  409. package/dist-lib/hooks/useSSE.d.ts +0 -31
  410. package/dist-lib/hooks/useSchema.d.ts +0 -1
  411. package/dist-lib/hooks/useScreen.d.ts +0 -2
  412. package/dist-lib/hooks/useScreenBack.d.ts +0 -21
  413. package/dist-lib/hooks/useScreenTab.d.ts +0 -10
  414. package/dist-lib/hooks/useTabNavigate.d.ts +0 -34
  415. package/dist-lib/hooks/useTabSearchMirror.d.ts +0 -1
  416. package/dist-lib/hooks/useTabTitle.d.ts +0 -2
  417. package/dist-lib/hooks/useText.d.ts +0 -3
  418. package/dist-lib/hooks/useTimelineData.d.ts +0 -10
  419. package/dist-lib/hooks/useVersionWatcher.d.ts +0 -30
  420. package/dist-lib/hooks/useViews.d.ts +0 -26
  421. package/dist-lib/lib/action-dispatch.d.ts +0 -8
  422. package/dist-lib/lib/actions.d.ts +0 -254
  423. package/dist-lib/lib/anchor.d.ts +0 -36
  424. package/dist-lib/lib/brand-tokens.d.ts +0 -43
  425. package/dist-lib/lib/branding.d.ts +0 -20
  426. package/dist-lib/lib/canonical-url.d.ts +0 -27
  427. package/dist-lib/lib/capabilityPrefetch.d.ts +0 -6
  428. package/dist-lib/lib/child-config.d.ts +0 -24
  429. package/dist-lib/lib/children-validation.d.ts +0 -5
  430. package/dist-lib/lib/decimal-text.d.ts +0 -1
  431. package/dist-lib/lib/display-value.d.ts +0 -1
  432. package/dist-lib/lib/document-templates.d.ts +0 -11
  433. package/dist-lib/lib/download.d.ts +0 -21
  434. package/dist-lib/lib/evidence-verdict.d.ts +0 -11
  435. package/dist-lib/lib/failure.d.ts +0 -2
  436. package/dist-lib/lib/field-classification.d.ts +0 -61
  437. package/dist-lib/lib/field-regions.d.ts +0 -8
  438. package/dist-lib/lib/filter-evaluator.d.ts +0 -16
  439. package/dist-lib/lib/filters.d.ts +0 -93
  440. package/dist-lib/lib/format-count.d.ts +0 -41
  441. package/dist-lib/lib/html-state.d.ts +0 -11
  442. package/dist-lib/lib/language.d.ts +0 -19
  443. package/dist-lib/lib/longPressGesture.d.ts +0 -55
  444. package/dist-lib/lib/mass-edit.d.ts +0 -32
  445. package/dist-lib/lib/page-inset.d.ts +0 -3
  446. package/dist-lib/lib/quick-add.d.ts +0 -2
  447. package/dist-lib/lib/realtime-query-keys.d.ts +0 -22
  448. package/dist-lib/lib/realtime-reconcile.d.ts +0 -33
  449. package/dist-lib/lib/realtime-resync.d.ts +0 -23
  450. package/dist-lib/lib/record-documents-key.d.ts +0 -1
  451. package/dist-lib/lib/rich-text.d.ts +0 -14
  452. package/dist-lib/lib/rowClickGesture.d.ts +0 -26
  453. package/dist-lib/lib/safe-url.d.ts +0 -15
  454. package/dist-lib/lib/schema-routing.d.ts +0 -3
  455. package/dist-lib/lib/screen-back.d.ts +0 -70
  456. package/dist-lib/lib/scroll-restoration.d.ts +0 -90
  457. package/dist-lib/lib/size-value.d.ts +0 -16
  458. package/dist-lib/lib/sort.d.ts +0 -72
  459. package/dist-lib/lib/timestamp.d.ts +0 -53
  460. package/dist-lib/lib/toast.d.ts +0 -49
  461. package/dist-lib/lib/ui-actions.d.ts +0 -12
  462. package/dist-lib/lib/utils.d.ts +0 -9
  463. package/dist-lib/lib/variants.d.ts +0 -7
  464. package/dist-lib/lib/versionTracker.d.ts +0 -72
  465. package/dist-lib/lib/viewport-category.d.ts +0 -44
  466. package/dist-lib/main.d.ts +0 -1
  467. package/dist-lib/registry-CRPxNbkk.js +0 -1956
  468. package/dist-lib/safe-url-oSJw5pzO.js +0 -34
  469. package/dist-lib/stores/auth.d.ts +0 -16
  470. package/dist-lib/stores/list-layout.d.ts +0 -85
  471. package/dist-lib/stores/page-state.d.ts +0 -61
  472. package/dist-lib/stores/preferences.d.ts +0 -37
  473. package/dist-lib/stores/realtime.d.ts +0 -96
  474. package/dist-lib/stores/screen-registry.d.ts +0 -17
  475. package/dist-lib/stores/tabs.d.ts +0 -73
  476. package/dist-lib/types/api.d.ts +0 -580
  477. package/dist-lib/types/fieldType.d.ts +0 -2
  478. package/dist-lib/types/files.d.ts +0 -79
  479. package/dist-lib/types/ordmap.d.ts +0 -39
  480. package/dist-lib/types/schema.d.ts +0 -1089
  481. package/dist-lib/useCurrentScreen-BPq7HMF1.js +0 -7840
  482. package/dist-lib/useListQuery-CG1WM4cv.js +0 -103
  483. package/dist-lib/useOwnRefresh-C18iWRgr.js +0 -1167
  484. package/dist-lib/useProperties-C35JrjwQ.js +0 -83
  485. package/dist-lib/useTabSearchMirror-DKktWWLB.js +0 -175
  486. package/dist-lib/useText-BFDCTUSo.js +0 -952
  487. package/dist-lib/vite/fingerprint-plugin.d.ts +0 -44
@@ -1,1956 +0,0 @@
1
- import { s as e, t } from "./DynamicIcon-DW5krHuX.js";
2
- import { $ as n, D as r, Dn as i, En as a, Fn as o, G as s, It as c, Jn as l, Kn as u, L as d, O as f, Q as p, R as m, Rt as h, Tn as g, Vn as _, W as v, Wn as y, X as b, fn as x, gn as S, i as C, jt as w, kn as T, pn as E, q as D, qn as O, rt as k, sn as A, tt as j, un as M, yn as N, zt as P } from "./useCurrentScreen-BPq7HMF1.js";
3
- import { A as F, M as I, f as L, s as R, t as z } from "./useText-BFDCTUSo.js";
4
- import { a as B, c as V, f as H, m as U, o as ee, s as te, t as ne, u as W, y as re } from "./failure-BT54OLHy.js";
5
- import { E as G } from "./useOwnRefresh-C18iWRgr.js";
6
- import { c as ie, l as ae, o as oe, t as se } from "./action-dispatch-DbiOpvd6.js";
7
- import { n as ce, r as le, t as ue } from "./dataTableStyles-vwD1mVOP.js";
8
- import { Component as K, createContext as de, useCallback as q, useContext as fe, useEffect as pe, useId as me, useMemo as J, useRef as Y, useState as X } from "react";
9
- import { QueryClientContext as he, useInfiniteQuery as ge, useQuery as _e, useQueryClient as Z } from "@tanstack/react-query";
10
- import { Fragment as ve, jsx as Q, jsxs as $ } from "react/jsx-runtime";
11
- import { clsx as ye } from "clsx";
12
- import { twMerge as be } from "tailwind-merge";
13
- //#region src/components/primitives/SectionCard.tsx
14
- var xe = {
15
- primary: {
16
- surface: "var(--surface)",
17
- shadow: "var(--shadow-xs)"
18
- },
19
- secondary: {
20
- surface: "var(--surface-2)",
21
- shadow: "none"
22
- }
23
- };
24
- function Se({ title: t, subtitle: n, right: r, badge: i, count: a, children: o, footer: s, collapsible: c = !0, defaultOpen: l = !0, icon: d, emphasis: f = "primary", headingLevel: p = 2, padding: m = "16px" }) {
25
- let h = z(), [g, _] = X(l), v = xe[f] ?? xe.primary;
26
- return /* @__PURE__ */ $("div", {
27
- "data-emphasis": f,
28
- style: {
29
- background: v.surface,
30
- border: "1px solid var(--border)",
31
- borderRadius: 10,
32
- overflow: "hidden",
33
- boxShadow: v.shadow,
34
- flexShrink: 0
35
- },
36
- children: [
37
- /* @__PURE__ */ $("div", {
38
- style: {
39
- display: "flex",
40
- alignItems: "center",
41
- gap: 10,
42
- padding: "10px 14px",
43
- borderBottom: g ? "1px solid var(--divider)" : "none",
44
- minHeight: 40
45
- },
46
- children: [
47
- /* @__PURE__ */ Q("div", {
48
- role: "heading",
49
- "aria-level": p,
50
- style: {
51
- display: "flex",
52
- flex: 1,
53
- minWidth: 0
54
- },
55
- children: /* @__PURE__ */ $("div", {
56
- role: c ? "button" : void 0,
57
- tabIndex: c ? 0 : void 0,
58
- "aria-expanded": c ? g : void 0,
59
- onClick: c ? () => _((e) => !e) : void 0,
60
- onKeyDown: c ? (e) => {
61
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), _((e) => !e));
62
- } : void 0,
63
- style: {
64
- display: "flex",
65
- alignItems: "center",
66
- gap: 8,
67
- flex: 1,
68
- minWidth: 0,
69
- cursor: c ? "pointer" : "default",
70
- userSelect: "none"
71
- },
72
- children: [
73
- d && /* @__PURE__ */ Q("span", {
74
- style: {
75
- color: "var(--text-3)",
76
- display: "flex",
77
- flexShrink: 0
78
- },
79
- children: d
80
- }),
81
- /* @__PURE__ */ Q("div", {
82
- style: {
83
- fontSize: 12.5,
84
- fontWeight: 600,
85
- color: "var(--text)",
86
- letterSpacing: "-0.005em",
87
- overflow: "hidden",
88
- textOverflow: "ellipsis",
89
- whiteSpace: "nowrap",
90
- minWidth: 0
91
- },
92
- children: t
93
- }),
94
- a !== void 0 && /* @__PURE__ */ Q("span", {
95
- className: "num",
96
- style: {
97
- fontSize: 11,
98
- fontWeight: 600,
99
- color: "var(--text-3)",
100
- background: "var(--surface-3)",
101
- borderRadius: 999,
102
- padding: "1px 7px",
103
- minWidth: 20,
104
- textAlign: "center",
105
- flexShrink: 0
106
- },
107
- children: a
108
- }),
109
- n && /* @__PURE__ */ Q("div", {
110
- style: {
111
- fontSize: 11.5,
112
- color: "var(--text-3)",
113
- flexShrink: 0,
114
- borderLeft: "1px solid var(--divider)",
115
- paddingLeft: 8,
116
- marginLeft: 2
117
- },
118
- children: n
119
- })
120
- ]
121
- })
122
- }),
123
- i && /* @__PURE__ */ Q(u, {
124
- tone: i.tone ?? "violet",
125
- size: "xs",
126
- dot: i.dot,
127
- children: i.text
128
- }),
129
- r,
130
- c && /* @__PURE__ */ Q(O, {
131
- size: 24,
132
- icon: Q(g ? e.up : e.down, { size: 14 }),
133
- onClick: () => _((e) => !e),
134
- title: g ? h("control.collapse", "Collapse") : h("control.expand", "Expand")
135
- })
136
- ]
137
- }),
138
- g && /* @__PURE__ */ Q("div", {
139
- style: { padding: m },
140
- children: o
141
- }),
142
- s && g && /* @__PURE__ */ Q("div", {
143
- style: {
144
- padding: "8px 14px",
145
- borderTop: "1px solid var(--divider)",
146
- background: "var(--surface-2)",
147
- fontSize: 11.5,
148
- color: "var(--text-3)"
149
- },
150
- children: s
151
- })
152
- ]
153
- });
154
- }
155
- //#endregion
156
- //#region src/components/primitives/ClassifiedFieldLocked.tsx
157
- function Ce({ tier: t, tierDef: n, requiredPermission: r, variant: i = "value" }) {
158
- let a = z(), o = a(n?.name) || t, s = r ? a("control.locked.permission_hint", "Locked: requires permission \"{permission}\". Ask your administrator to grant it to your role.", { permission: r }) : a("control.locked.classification_hint", "Locked: {classification} classification — requires explicit grant.", { classification: o });
159
- return /* @__PURE__ */ $("span", {
160
- title: s,
161
- "aria-label": s,
162
- className: `inline-flex items-center gap-1 text-muted-foreground italic select-none ${i === "input" ? "border border-divider rounded-md px-2 py-1 bg-surface" : ""}`,
163
- children: [/* @__PURE__ */ Q(e.lock, { size: 12 }), /* @__PURE__ */ Q("span", { children: o })]
164
- });
165
- }
166
- //#endregion
167
- //#region src/lib/utils.ts
168
- function we(...e) {
169
- return be(ye(e));
170
- }
171
- function Te(e) {
172
- return e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0;
173
- }
174
- //#endregion
175
- //#region src/components/detail-layout/FieldRow.tsx
176
- var Ee = 150, De = 560, Oe = 270, ke = "20px", Ae = 4, je = /* @__PURE__ */ new Set([
177
- "text",
178
- "rich_text",
179
- "json",
180
- "structure",
181
- "multilang_text",
182
- "multilang_array"
183
- ]), Me = de({
184
- columns: 2,
185
- stackPairs: !1
186
- });
187
- function Ne({ columns: e = 2, children: t }) {
188
- let n = Y(null), [r, i] = X(null);
189
- pe(() => {
190
- let e = n.current;
191
- if (!e || typeof ResizeObserver > "u") return;
192
- let t = new ResizeObserver(([e]) => {
193
- i(e.contentRect.width);
194
- });
195
- return t.observe(e), () => t.disconnect();
196
- }, []);
197
- let a = e === 1 || r !== null && r < De ? 1 : e, o = r === null ? null : (r - (a - 1) * 24) / a, s = o !== null && o < Oe;
198
- return /* @__PURE__ */ Q(Me.Provider, {
199
- value: {
200
- columns: a,
201
- stackPairs: s
202
- },
203
- children: /* @__PURE__ */ Q("div", {
204
- ref: n,
205
- style: {
206
- display: "grid",
207
- gridTemplateColumns: `repeat(${a}, minmax(0, 1fr))`,
208
- columnGap: 24,
209
- rowGap: 2
210
- },
211
- children: t
212
- })
213
- });
214
- }
215
- function Pe({ label: t, children: n, span: r = !1, required: i, error: a, hint: o, actions: s, copyValue: c, mode: l = "display", htmlFor: u, labelId: d, labelTitle: f, "data-testid": p }) {
216
- let m = z(), g = fe(Me), _ = r || g.stackPairs, v = !!a;
217
- return /* @__PURE__ */ $("div", {
218
- className: "detail-row",
219
- "data-error": v || void 0,
220
- "data-testid": p,
221
- style: {
222
- display: "flex",
223
- flexDirection: _ ? "column" : "row",
224
- gap: _ ? 4 : 16,
225
- alignItems: _ ? "stretch" : "flex-start",
226
- padding: "6px 0",
227
- ...r ? { gridColumn: "1 / -1" } : null
228
- },
229
- children: [/* @__PURE__ */ $("div", {
230
- style: {
231
- width: _ ? "auto" : Ee,
232
- flexShrink: 0,
233
- paddingTop: _ ? 0 : Ae,
234
- fontSize: 12,
235
- lineHeight: ke,
236
- fontWeight: 500,
237
- color: "var(--text-3)",
238
- display: "flex",
239
- alignItems: "flex-start",
240
- gap: 2
241
- },
242
- children: [u ? /* @__PURE__ */ Q("label", {
243
- id: d,
244
- htmlFor: u,
245
- title: f || void 0,
246
- children: t
247
- }) : /* @__PURE__ */ Q("span", {
248
- id: d,
249
- title: f || void 0,
250
- children: t
251
- }), i && l === "edit" && /* @__PURE__ */ Q("span", {
252
- "aria-hidden": "true",
253
- style: {
254
- color: "var(--danger)",
255
- marginLeft: 2
256
- },
257
- children: "*"
258
- })]
259
- }), /* @__PURE__ */ $("div", {
260
- style: {
261
- flex: 1,
262
- minWidth: 0,
263
- display: "flex",
264
- flexDirection: "column",
265
- gap: 3
266
- },
267
- children: [/* @__PURE__ */ $("div", {
268
- style: {
269
- display: "flex",
270
- alignItems: "flex-start",
271
- gap: 6,
272
- minHeight: 24
273
- },
274
- children: [/* @__PURE__ */ Q("div", {
275
- style: {
276
- flex: 1,
277
- minWidth: 0,
278
- fontSize: 13,
279
- lineHeight: ke,
280
- color: "var(--text)",
281
- overflowWrap: "anywhere",
282
- paddingTop: l === "display" && !_ ? Ae : 0
283
- },
284
- children: v && l === "edit" ? /* @__PURE__ */ Q("div", {
285
- style: {
286
- borderRadius: 6,
287
- boxShadow: "0 0 0 1.5px var(--danger)"
288
- },
289
- children: n
290
- }) : n
291
- }), (c || s) && /* @__PURE__ */ $("div", {
292
- className: "detail-row-action",
293
- style: {
294
- display: "flex",
295
- gap: 2,
296
- flexShrink: 0,
297
- marginTop: -2
298
- },
299
- children: [c && /* @__PURE__ */ Q(h, {
300
- value: c,
301
- size: "sm",
302
- title: m("record.field.copy_value", "Copy value")
303
- }), s]
304
- })]
305
- }), (v || o != null) && /* @__PURE__ */ $("div", {
306
- style: {
307
- fontSize: 11.5,
308
- lineHeight: 1.4,
309
- color: v ? "var(--danger)" : "var(--text-3)",
310
- display: "flex",
311
- alignItems: "center",
312
- gap: 4
313
- },
314
- children: [v && /* @__PURE__ */ Q(e.warning, { size: 11 }), /* @__PURE__ */ Q("span", { children: v ? a : o })]
315
- })]
316
- })]
317
- });
318
- }
319
- //#endregion
320
- //#region src/hooks/useObject.ts
321
- function Fe(e, t, n = {}) {
322
- let r = t === void 0 || t === "new" ? void 0 : typeof t == "string" ? t : Object.keys(t).sort().map((e) => [e, t[e]]), i = n.expand?.join(",");
323
- return i ? [
324
- "entity-item",
325
- e,
326
- r,
327
- i
328
- ] : [
329
- "entity-item",
330
- e,
331
- r
332
- ];
333
- }
334
- function Ie(e, t, n = {}) {
335
- let r = Fe(e, t, n), i = r[2];
336
- return _e({
337
- queryKey: r,
338
- queryFn: () => H(e, t, n),
339
- enabled: !!e && !!t && t !== "new" && i !== void 0
340
- });
341
- }
342
- //#endregion
343
- //#region src/hooks/useAssociatedData.ts
344
- function Le(e, t, n, i, a, o, s, c) {
345
- let l = c ? JSON.stringify(Object.entries(c).sort()) : void 0;
346
- return ge({
347
- queryKey: [
348
- r,
349
- e,
350
- t,
351
- n,
352
- a,
353
- o,
354
- s,
355
- l
356
- ],
357
- queryFn: ({ pageParam: e }) => {
358
- let r = new URLSearchParams(), l = [{
359
- field: i,
360
- op: "eq",
361
- value: t
362
- }];
363
- if (c) for (let [e, t] of Object.entries(c)) t && t !== "__all__" && l.push({
364
- field: e,
365
- op: "eq",
366
- value: t
367
- });
368
- return r.set("filters", JSON.stringify(l)), a && r.set("sort", a), o && r.set("limit", String(o)), s && r.set("search", s), e && r.set("after", e), I(`/api/data/${n}?${r.toString()}`);
369
- },
370
- getNextPageParam: (e) => e.meta?.has_more ? e.meta.cursor : void 0,
371
- initialPageParam: void 0,
372
- enabled: !!e && !!t && !!n && !!i
373
- });
374
- }
375
- //#endregion
376
- //#region src/components/actions/ActionButton.tsx
377
- function Re({ actionCode: n, action: r, entityCode: i, objectIds: a = [], row: o, variant: s = "outline", size: c = "default", onSuccess: u }) {
378
- let f = z(), h = z("errors"), [g, _] = X(!1), [v, y] = X(!1), { data: x } = L(), S = G(), { run: w } = C(), T = p(r), E = !o || D(r.conditions, o), k = q(async () => {
379
- if (r.association && a.length !== 0) {
380
- _(!0);
381
- try {
382
- let e = i ? `${i}.${r.association}` : r.association, t = await U(e, a), n = b(x, t.target_entity);
383
- if (!n) {
384
- P.error(h("action.list_screen_missing", "No list screen is declared for this entity."), t.target_entity);
385
- return;
386
- }
387
- let o = x?.entities[t.target_entity], s = f(r.display?.name) || t.target_entity;
388
- if (t.ids.length === 0) {
389
- P.info(f("action.association.none_related", "No related {name} found", { name: s }));
390
- return;
391
- }
392
- let c = o?.fields.names().find((e) => o.fields.get(e)?.primary) ?? "id", l = new URLSearchParams();
393
- l.set(`filter_${c}`, t.ids.join(",")), S(n.route, {
394
- title: s,
395
- icon: r.display?.icon || n.icon,
396
- search: l.toString()
397
- }), u?.();
398
- } catch (e) {
399
- P.error(ne(h, e));
400
- } finally {
401
- _(!1);
402
- }
403
- }
404
- }, [
405
- f,
406
- h,
407
- r,
408
- i,
409
- a,
410
- x,
411
- S,
412
- u
413
- ]), A = r.entity ? `${r.entity}.${n}` : n, M = a.length > 0 ? a : void 0, N = q(() => {
414
- y(!0), w({
415
- action: r,
416
- title: f(r.display?.name) || n,
417
- row: o,
418
- entity: i,
419
- execute: (e) => W(A, B(e, M)),
420
- onSuccess: () => u?.()
421
- }).finally(() => y(!1));
422
- }, [
423
- f,
424
- w,
425
- r,
426
- n,
427
- o,
428
- i,
429
- A,
430
- M,
431
- u
432
- ]), F = q(() => {
433
- if (m(r)) {
434
- d(h, r.ui_steps, { row: o }).then(() => u?.());
435
- return;
436
- }
437
- if (T) {
438
- k();
439
- return;
440
- }
441
- if (r.href && !r.handler && !r.association) {
442
- let e = i ? x?.entities[i] : void 0, t = j(o, e), a = r.href;
443
- i && (a = a.replaceAll("${entity}", i)), t && (a = a.replaceAll("${id}", encodeURIComponent(t))), S(a, {
444
- title: f(r.display?.name) || n,
445
- icon: r.display?.icon
446
- }), u?.();
447
- return;
448
- }
449
- N();
450
- }, [
451
- f,
452
- h,
453
- r,
454
- o,
455
- i,
456
- x?.entities,
457
- n,
458
- S,
459
- T,
460
- k,
461
- N,
462
- u
463
- ]), I = f(r.display?.name), R = r.display?.icon, V = R && e[R], H = V ? /* @__PURE__ */ Q(V, { size: 13 }) : R ? /* @__PURE__ */ Q(t, {
464
- name: R,
465
- size: 13
466
- }) : null, ee = !E || v || g;
467
- return c === "icon" ? /* @__PURE__ */ Q(O, {
468
- icon: H ?? /* @__PURE__ */ Q(e.bolt, { size: 13 }),
469
- onClick: F,
470
- title: I
471
- }) : /* @__PURE__ */ Q(l, {
472
- kind: s === "default" ? "primary" : s === "ghost" ? "ghost" : "default",
473
- size: "sm",
474
- icon: H,
475
- danger: r.destructive,
476
- onClick: F,
477
- disabled: ee,
478
- title: I,
479
- "aria-label": I,
480
- children: I
481
- });
482
- }
483
- //#endregion
484
- //#region src/components/actions/RowActionsKebab.tsx
485
- function ze({ actions: t, objectIds: n, row: r, entity: i, onSuccess: a, preMenu: o, divider: s, size: c = 22, align: l = "end" }) {
486
- let u = z(), d = Y(null), [f, p] = X(!1), [m, h] = X(null), { run: g } = C(), _ = J(() => {
487
- let e = {};
488
- for (let { code: n, action: r } of t) e[n] = r;
489
- return e;
490
- }, [t]), b = J(() => {
491
- let e = t.map(({ code: e }) => ({
492
- kind: "action",
493
- code: e,
494
- enabled: !0,
495
- reason: null
496
- }));
497
- return r ? v(u, e, _, void 0, r, [], oe(i, r)) : e;
498
- }, [
499
- u,
500
- t,
501
- _,
502
- r,
503
- i
504
- ]), x = q((e, t) => {
505
- p(!1);
506
- let i = t.entity ? `${t.entity}.${e}` : e;
507
- return g({
508
- action: t,
509
- title: u(t.display?.name) || e,
510
- row: r,
511
- execute: async (e) => {
512
- let t = await W(i, B(e, n));
513
- return a?.(), t;
514
- }
515
- });
516
- }, [
517
- u,
518
- g,
519
- r,
520
- n,
521
- a
522
- ]);
523
- return !o && b.length === 0 ? null : /* @__PURE__ */ $("div", {
524
- className: "sl-row-actions",
525
- "data-open": f ? "true" : void 0,
526
- style: {
527
- display: "flex",
528
- alignItems: "center",
529
- justifyContent: "flex-end"
530
- },
531
- children: [/* @__PURE__ */ Q(O, {
532
- ref: d,
533
- size: c,
534
- icon: /* @__PURE__ */ Q(e.more, { size: Math.round(c * .55) }),
535
- onClick: () => p((e) => !e),
536
- title: u("action.menu.title", "Actions")
537
- }), /* @__PURE__ */ $(y, {
538
- open: f,
539
- anchor: d.current,
540
- onClose: () => p(!1),
541
- width: 200,
542
- align: l,
543
- children: [
544
- o,
545
- o && s && b.length > 0 && /* @__PURE__ */ Q(E, { divider: !0 }),
546
- /* @__PURE__ */ Q(ae, {
547
- layout: b,
548
- entityActions: _,
549
- onRun: x,
550
- loading: m,
551
- onLoadingChange: h,
552
- row: r
553
- })
554
- ]
555
- })]
556
- });
557
- }
558
- //#endregion
559
- //#region src/components/detail-layout/AssociatedToolbar.tsx
560
- function Be({ entity: t, searchable: n, filterFields: r, searchValue: a, onSearchChange: o, filters: s, onFilterChange: c, allEntities: l }) {
561
- let u = z(), d = n === !0, f = r && r.length > 0;
562
- return !d && !f ? null : /* @__PURE__ */ $("div", {
563
- style: {
564
- display: "flex",
565
- alignItems: "center",
566
- gap: 6,
567
- marginBottom: 8
568
- },
569
- children: [d && /* @__PURE__ */ Q("div", {
570
- style: {
571
- flex: 1,
572
- maxWidth: 220
573
- },
574
- children: /* @__PURE__ */ Q(M, {
575
- value: a,
576
- onChange: o,
577
- placeholder: u("record.associated.search", "Search…"),
578
- prefix: /* @__PURE__ */ Q(e.search, { size: 12 })
579
- })
580
- }), f && r.map((e) => {
581
- let n = t.fields.get(e);
582
- if (!n) return null;
583
- let r = s[e] ?? "__all__", a = i(u, n, e, l);
584
- if (n.type === "ref" && n.ref?.entity) return /* @__PURE__ */ Q(Ve, {
585
- field: n,
586
- label: a,
587
- value: r,
588
- onChange: (t) => c(e, t)
589
- }, e);
590
- if (!n.values) return null;
591
- let o = [{
592
- value: "__all__",
593
- label: u("record.associated.filter_all", "All {name}", { name: a })
594
- }, ...n.values.map((e) => ({
595
- value: e.code,
596
- label: u(e.name) || e.code
597
- }))];
598
- return /* @__PURE__ */ Q("div", {
599
- style: { width: 160 },
600
- children: /* @__PURE__ */ Q(A, {
601
- value: r,
602
- options: o,
603
- onChange: (t) => c(e, t),
604
- placeholder: a
605
- })
606
- }, e);
607
- })]
608
- });
609
- }
610
- function Ve({ field: e, label: t, value: n, onChange: r }) {
611
- let i = z(), a = w(e.ref?.entity), o = e.display?.ref_display_field ?? a?.display?.display_field, s = J(() => a ? [...a.fields].find(([, e]) => e.primary)?.[0] ?? "id" : "id", [a]), { data: l } = c(e.ref?.entity, {
612
- per_page: 200,
613
- sort: o ? `${o}:asc` : void 0
614
- }), u = l?.data ?? [], d = (e) => e == null ? "—" : typeof e == "object" && !Array.isArray(e) ? i(e) || "—" : _(e), f = [{
615
- value: "__all__",
616
- label: i("record.associated.filter_all", "All {name}", { name: t })
617
- }, ...u.map((e) => {
618
- let t = String(e[s]), n = e[N];
619
- return {
620
- value: t,
621
- label: typeof n == "string" && n !== "" ? n : o ? d(e[o] ?? t) : t
622
- };
623
- })];
624
- return /* @__PURE__ */ Q("div", {
625
- style: { width: 160 },
626
- children: /* @__PURE__ */ Q(A, {
627
- value: n,
628
- options: f,
629
- onChange: r,
630
- placeholder: t
631
- })
632
- });
633
- }
634
- //#endregion
635
- //#region src/components/detail-layout/AssociatedBlock.tsx
636
- function He(e) {
637
- if (!e) return [];
638
- let t = [];
639
- for (let [r, i] of Object.entries(e)) (i.visibility ?? []).includes("list_row") && (i.association || n(r) || t.push({
640
- code: r,
641
- action: i
642
- }));
643
- return t;
644
- }
645
- function Ue(e, t, n) {
646
- if (!e) return [];
647
- let r = [];
648
- for (let [i, a] of Object.entries(e)) {
649
- if (!(a.visibility ?? []).includes("list_toolbar") || a.association || i.startsWith("__")) continue;
650
- let e = {
651
- ...a,
652
- resolved_hidden_defaults: {
653
- ...a.resolved_hidden_defaults ?? {},
654
- [t]: n
655
- }
656
- };
657
- if (a.resolved_params?.has(t)) {
658
- let n = a.resolved_params.items().filter((e) => e.name !== t);
659
- e = {
660
- ...e,
661
- resolved_params: new F(n)
662
- };
663
- }
664
- r.push({
665
- code: i,
666
- action: e
667
- });
668
- }
669
- return r;
670
- }
671
- function We(e, t, n) {
672
- let r = e[n];
673
- if (!r) return null;
674
- let i = e[t], a = i?.children?.find((e) => e.entity === n);
675
- if (a) {
676
- let e = a.foreign_key;
677
- if (typeof e == "string") return e;
678
- if (Array.isArray(e) && e.length === 1) return e[0];
679
- }
680
- let o = i?.table;
681
- for (let [n, i] of r.fields) {
682
- let r = i.ref?.entity;
683
- if (r) {
684
- if (r === t) return n;
685
- if (o) {
686
- let t = e[r]?.table;
687
- if (t && t === o) return n;
688
- }
689
- }
690
- }
691
- return null;
692
- }
693
- function Ge(e, t, n) {
694
- let r = new Set(T(e));
695
- return new Set(t.filter((t) => {
696
- if (t === n || r.has(t)) return !1;
697
- let i = e.fields.get(t);
698
- return !(!i || i.auto || i.primary || i.source);
699
- }));
700
- }
701
- function Ke(e, t, n) {
702
- return new Set(t.filter((t) => {
703
- if (t === n) return !1;
704
- let r = e.fields.get(t);
705
- return !(!r || r.auto);
706
- }));
707
- }
708
- function qe(e, t, n, r) {
709
- let i = [];
710
- for (let a of t) {
711
- let t = n.fields.get(a);
712
- if (!t || !t.required || t.auto || t.primary || a === r || n.tenant_key && a === n.tenant_key) continue;
713
- let o = e[a];
714
- (o == null || o === "") && i.push(a);
715
- }
716
- return i;
717
- }
718
- function Je({ node: e, ctx: t }) {
719
- let n = z("errors"), r = e.associated;
720
- if (!r || t.isNew) return null;
721
- let i = t.schema.entities[r];
722
- if (!i) return /* @__PURE__ */ $("div", {
723
- style: {
724
- fontSize: 12.5,
725
- color: "var(--text-3)",
726
- padding: "8px 0"
727
- },
728
- children: [
729
- n("record.related_entity_not_found", "The related record type is not declared in this deployment."),
730
- " ",
731
- /* @__PURE__ */ Q("code", { children: r })
732
- ]
733
- });
734
- let a = We(t.schema.entities, t.entityCode, r);
735
- return a ? /* @__PURE__ */ Q(Ye, {
736
- node: e,
737
- ctx: t,
738
- assocCode: r,
739
- assocEntity: i,
740
- fkField: a
741
- }) : /* @__PURE__ */ $("div", {
742
- style: {
743
- fontSize: 12.5,
744
- color: "var(--text-3)",
745
- padding: "8px 0"
746
- },
747
- children: [
748
- n("record.associated_foreign_key_not_found", "No foreign key joins these two entities."),
749
- " ",
750
- r,
751
- " → ",
752
- t.entityCode
753
- ]
754
- });
755
- }
756
- function Ye({ node: n, ctx: r, assocCode: i, assocEntity: a, fkField: o }) {
757
- let c = z(), u = z("errors"), d = n.columns && n.columns.length > 0 ? n.columns.filter((e) => e !== o && !!a.fields.get(e)) : a.fields.names().filter((e) => {
758
- if (e === o) return !1;
759
- let t = a.fields.get(e);
760
- return !(!t || t.primary || t.display?.is_listable === !1);
761
- }), f = g(a, "update"), p = n.interaction ?? (f ? "navigate" : "readonly"), m = (p === "inline_edit" || p === "row_edit") && f && n.editable !== !1, h = c(a.display?.name_plural) || c(a.display?.name) || i, _ = n.searchable === !0 || n.filters && n.filters.length > 0, y = J(() => Ue(a.actions, o, r.recordId), [
762
- a.actions,
763
- o,
764
- r.recordId
765
- ]), b = J(() => {
766
- let e = {};
767
- for (let { code: t, action: n } of y) e[t] = n;
768
- return e;
769
- }, [y]), x = J(() => {
770
- let e = a.action_layout ?? null;
771
- return v(c, e ?? s(b, "list_toolbar"), b, void 0, {}, []);
772
- }, [
773
- c,
774
- a.action_layout,
775
- b
776
- ]), { run: S } = C(), w = G(), T = J(() => ({
777
- entity: a,
778
- entityCode: i,
779
- screenRoute: typeof window < "u" ? window.location.pathname : "",
780
- selectedRows: [],
781
- selectedIds: [],
782
- t: c,
783
- tabNavigate: (e, t) => w(e, {
784
- title: t?.title,
785
- icon: t?.icon,
786
- search: t?.search
787
- }),
788
- runActionApi: (e, t) => W(e, t)
789
- }), [
790
- a,
791
- i,
792
- c,
793
- w
794
- ]), E = Z(), D = q(() => {
795
- E.invalidateQueries({ predicate: (e) => {
796
- let t = e.queryKey;
797
- return t[0] === "entity-children" && t[3] === i;
798
- } });
799
- }, [E, i]), O = q((e, t) => {
800
- let n = se(u, e, t, {}, i);
801
- if (n !== null) return S({
802
- action: t,
803
- title: c(t.display?.name) || e,
804
- execute: async (e) => {
805
- let t = await W(n, B(e, void 0));
806
- return D(), t;
807
- }
808
- });
809
- }, [
810
- c,
811
- u,
812
- S,
813
- i,
814
- D
815
- ]), [k, A] = X(0), j = /* @__PURE__ */ $("div", {
816
- style: {
817
- display: "flex",
818
- alignItems: "center",
819
- gap: 6,
820
- flex: "1 1 auto",
821
- minWidth: 0,
822
- justifyContent: "flex-end"
823
- },
824
- children: [a.action_layout ? x.length > 0 && /* @__PURE__ */ Q(ie, {
825
- kind: "toolbar",
826
- layout: x,
827
- entityActions: b,
828
- onRun: O,
829
- widgetContext: T,
830
- ariaLabel: c("record.associated.toolbar_actions", "{name} toolbar actions", { name: h })
831
- }) : y.map(({ code: e, action: t }) => /* @__PURE__ */ Q(Re, {
832
- actionCode: e,
833
- action: t,
834
- entityCode: i,
835
- variant: "ghost",
836
- size: "sm",
837
- onSuccess: D
838
- }, e)), m && /* @__PURE__ */ Q(l, {
839
- kind: "ghost",
840
- size: "xs",
841
- icon: /* @__PURE__ */ Q(e.plus, { size: 12 }),
842
- onClick: () => A((e) => e + 1),
843
- children: c("record.row.add", "Add row")
844
- })]
845
- }), M = _ ? /* @__PURE__ */ Q(Ze, {
846
- entityCode: i,
847
- entity: a,
848
- parentEntity: r.entityCode,
849
- parentId: r.recordId,
850
- foreignKey: o,
851
- columns: d,
852
- editable: m,
853
- interaction: p,
854
- ctx: r,
855
- searchable: n.searchable,
856
- filterFields: n.filters,
857
- sort: n.sort,
858
- startDraftSignal: k
859
- }) : /* @__PURE__ */ Q(Xe, {
860
- entityCode: i,
861
- entity: a,
862
- parentEntity: r.entityCode,
863
- parentId: r.recordId,
864
- foreignKey: o,
865
- columns: d,
866
- editable: m,
867
- interaction: p,
868
- ctx: r,
869
- sort: n.sort,
870
- startDraftSignal: k
871
- });
872
- return r.withinCard ? /* @__PURE__ */ $("div", { children: [/* @__PURE__ */ Q("div", {
873
- style: {
874
- display: "flex",
875
- justifyContent: "flex-end",
876
- marginBottom: 8
877
- },
878
- children: j
879
- }), M] }) : /* @__PURE__ */ Q(Se, {
880
- title: h,
881
- icon: a.display?.icon ? /* @__PURE__ */ Q(t, {
882
- name: a.display.icon,
883
- size: 14
884
- }) : void 0,
885
- right: j,
886
- children: M
887
- });
888
- }
889
- function Xe({ entityCode: e, entity: t, parentEntity: n, parentId: i, foreignKey: a, columns: o, editable: s, interaction: c, ctx: l, sort: u, startDraftSignal: d }) {
890
- let p = Z(), { data: m, isLoading: h, isError: g } = f(n, i, e, a, u), _ = m?.data ?? [], v = m?.$refs, y = q(() => {
891
- p.invalidateQueries({ queryKey: [
892
- r,
893
- n,
894
- i,
895
- e
896
- ] });
897
- }, [
898
- p,
899
- n,
900
- i,
901
- e
902
- ]);
903
- return /* @__PURE__ */ Q(Qe, {
904
- entityCode: e,
905
- entity: t,
906
- parentId: i,
907
- foreignKey: a,
908
- columns: o,
909
- editable: s,
910
- interaction: c,
911
- ctx: l,
912
- rows: _,
913
- refs: v,
914
- isLoading: h,
915
- isError: g,
916
- invalidateQuery: y,
917
- startDraftSignal: d
918
- });
919
- }
920
- function Ze({ entityCode: e, entity: t, parentEntity: n, parentId: r, foreignKey: i, columns: a, editable: o, interaction: s, ctx: c, searchable: u, filterFields: d, sort: f, startDraftSignal: p }) {
921
- let m = z(), h = Z(), [g, _] = X(""), [v, y] = X(""), [b, S] = X({}), C = Y(void 0);
922
- pe(() => (C.current && clearTimeout(C.current), C.current = setTimeout(() => {
923
- y(g);
924
- }, 300), () => {
925
- C.current && clearTimeout(C.current);
926
- }), [g]);
927
- let w = q((e, t) => {
928
- S((n) => {
929
- if (t === "__all__") {
930
- let { [e]: t, ...r } = n;
931
- return r;
932
- }
933
- return {
934
- ...n,
935
- [e]: t
936
- };
937
- });
938
- }, []), T = J(() => Object.keys(b).length > 0 ? b : void 0, [b]), { data: E, isLoading: D, isError: O, hasNextPage: k, fetchNextPage: A, isFetchingNextPage: j } = Le(n, r, e, i, f, void 0, v || void 0, T), { rows: M, refs: N } = J(() => {
939
- if (!E?.pages) return {
940
- rows: [],
941
- refs: void 0
942
- };
943
- let e = [], t;
944
- for (let n of E.pages) if (e.push(...n.data), n.$refs) {
945
- if (!t) t = { ...n.$refs };
946
- else for (let [e, r] of Object.entries(n.$refs)) t[e] = {
947
- ...t[e],
948
- ...r
949
- };
950
- }
951
- return {
952
- rows: e,
953
- refs: t
954
- };
955
- }, [E]), P = q(() => {
956
- h.invalidateQueries({ predicate: (t) => {
957
- let n = t.queryKey;
958
- return n[0] === "entity-children" && n[3] === e;
959
- } });
960
- }, [h, e]);
961
- return /* @__PURE__ */ $("div", { children: [
962
- /* @__PURE__ */ Q(Be, {
963
- entity: t,
964
- searchable: u,
965
- filterFields: d,
966
- searchValue: g,
967
- onSearchChange: _,
968
- filters: b,
969
- onFilterChange: w,
970
- allEntities: c.schema.entities
971
- }),
972
- /* @__PURE__ */ Q(Qe, {
973
- entityCode: e,
974
- entity: t,
975
- parentId: r,
976
- foreignKey: i,
977
- columns: a,
978
- editable: o,
979
- interaction: s,
980
- ctx: c,
981
- rows: M,
982
- refs: N,
983
- isLoading: D,
984
- isError: O,
985
- invalidateQuery: P,
986
- startDraftSignal: p
987
- }),
988
- k && /* @__PURE__ */ Q("div", {
989
- style: { marginTop: 4 },
990
- children: /* @__PURE__ */ Q(l, {
991
- kind: "ghost",
992
- size: "xs",
993
- icon: j ? /* @__PURE__ */ Q(x, { size: 12 }) : void 0,
994
- onClick: () => A(),
995
- disabled: j,
996
- children: m("record.associated.load_more", "Load more")
997
- })
998
- })
999
- ] });
1000
- }
1001
- function Qe({ entityCode: e, entity: t, parentId: n, foreignKey: r, columns: s, editable: c, interaction: l, ctx: u, rows: d, refs: f, isLoading: p, isError: m, invalidateQuery: h, startDraftSignal: g }) {
1002
- let _ = z(), v = z("errors"), y = S(), b = y.isPhone && u.relatedRecordsPresentation === "table", x = s.find((e) => e !== r), w = J(() => l === "navigate" ? o(void 0, t, u.schema.screens) : null, [
1003
- l,
1004
- t,
1005
- u.schema.screens
1006
- ]), T = J(() => c ? Ge(t, s, r) : /* @__PURE__ */ new Set(), [
1007
- s,
1008
- r,
1009
- t,
1010
- c
1011
- ]), E = J(() => Ke(t, s, r), [
1012
- s,
1013
- r,
1014
- t
1015
- ]), D = J(() => {
1016
- let e = /* @__PURE__ */ new Map();
1017
- for (let n of d) {
1018
- let r = a(t, n);
1019
- e.set(V(r), r);
1020
- }
1021
- return e;
1022
- }, [d, t]), O = J(() => {
1023
- let e = /* @__PURE__ */ new Map();
1024
- for (let n of d) {
1025
- let r = n.$row_version;
1026
- typeof r == "string" && r !== "" && e.set(V(a(t, n)), r);
1027
- }
1028
- return e;
1029
- }, [d, t]), k = J(() => He(t.actions), [t.actions]), [A, j] = X(null), [M, N] = X(null), [P, F] = X([]), [I, L] = X({}), R = Y(I);
1030
- R.current = I;
1031
- let B = Y({});
1032
- pe(() => {
1033
- let e = B.current;
1034
- return () => {
1035
- for (let t of Object.values(e)) clearTimeout(t);
1036
- };
1037
- }, []);
1038
- let [H, U] = X(null), [W, G] = X([]), [ie, ae] = X(!1), { run: oe } = C(), [se, ue] = X(/* @__PURE__ */ new Set()), K = q(async (t, n, r) => {
1039
- L((e) => ({
1040
- ...e,
1041
- [t]: {
1042
- ...e[t],
1043
- saving: !0,
1044
- error: void 0
1045
- }
1046
- }));
1047
- try {
1048
- let i = O.get(t), a = i ? {
1049
- ...n,
1050
- $row_version: i
1051
- } : n;
1052
- return await re(e, D.get(t) ?? t, a), L((e) => {
1053
- let n = e[t];
1054
- if (!n) return e;
1055
- if (n.ver > r) return {
1056
- ...e,
1057
- [t]: {
1058
- ...n,
1059
- saving: !1
1060
- }
1061
- };
1062
- let { [t]: i, ...a } = e;
1063
- return a;
1064
- }), h(), !0;
1065
- } catch (e) {
1066
- let n = ne(v, e);
1067
- return L((e) => ({
1068
- ...e,
1069
- [t]: {
1070
- ...e[t],
1071
- saving: !1,
1072
- error: n
1073
- }
1074
- })), !1;
1075
- }
1076
- }, [
1077
- e,
1078
- v,
1079
- h,
1080
- D,
1081
- O
1082
- ]), de = q((e, t, n) => {
1083
- L((r) => {
1084
- let i = r[e] ?? {
1085
- buffer: {},
1086
- ver: 0,
1087
- saving: !1
1088
- }, a = i.ver + 1;
1089
- return {
1090
- ...r,
1091
- [e]: {
1092
- ...i,
1093
- buffer: {
1094
- ...i.buffer,
1095
- [t]: n
1096
- },
1097
- ver: a
1098
- }
1099
- };
1100
- }), l === "inline_edit" && (B.current[e] && clearTimeout(B.current[e]), B.current[e] = setTimeout(() => {
1101
- let t = R.current[e];
1102
- t && Object.keys(t.buffer).length > 0 && K(e, { ...t.buffer }, t.ver);
1103
- }, 500));
1104
- }, [K, l]), fe = q(() => {
1105
- let e = {};
1106
- e[r] = n;
1107
- for (let n of s) {
1108
- let r = t.fields.get(n);
1109
- r && (r.default === void 0 ? r.type === "bool" && (e[n] = !1) : e[n] = r.default);
1110
- }
1111
- U(e), G([]);
1112
- }, [
1113
- r,
1114
- n,
1115
- s,
1116
- t.fields
1117
- ]), me = Y(g);
1118
- pe(() => {
1119
- g !== void 0 && g !== me.current && (me.current = g, !H && fe());
1120
- }, [
1121
- g,
1122
- H,
1123
- fe
1124
- ]);
1125
- let he = q(async () => {
1126
- if (!H) return;
1127
- let n = qe(H, s, t, r);
1128
- if (n.length > 0) {
1129
- G(n);
1130
- return;
1131
- }
1132
- ae(!0);
1133
- try {
1134
- await ee(e, H), U(null), G([]), h();
1135
- } catch (e) {
1136
- let t = ne(v, e);
1137
- G([`_error:${t}`]);
1138
- } finally {
1139
- ae(!1);
1140
- }
1141
- }, [
1142
- H,
1143
- s,
1144
- t,
1145
- r,
1146
- e,
1147
- v,
1148
- h
1149
- ]), ge = q((e) => {
1150
- L({}), F([]), N(e);
1151
- }, []), _e = q(async (e) => {
1152
- let n = R.current[e], i = n?.buffer ?? {};
1153
- if (Object.keys(i).length === 0) {
1154
- N(null), F([]);
1155
- return;
1156
- }
1157
- let o = qe({
1158
- ...d.find((n) => V(a(t, n)) === e) ?? {},
1159
- ...i
1160
- }, s, t, r);
1161
- if (o.length > 0) {
1162
- F(o);
1163
- return;
1164
- }
1165
- await K(e, { ...i }, n?.ver ?? 0) && (N(null), F([]));
1166
- }, [
1167
- d,
1168
- t,
1169
- s,
1170
- r,
1171
- K
1172
- ]), Z = q((e) => {
1173
- L((t) => {
1174
- if (!t[e]) return t;
1175
- let { [e]: n, ...r } = t;
1176
- return r;
1177
- }), F([]), N(null);
1178
- }, []), ve = q((n, r) => {
1179
- let i = D.get(n) ?? n;
1180
- return oe({
1181
- action: t.actions?.__delete,
1182
- destructive: !0,
1183
- title: _(t.display?.name) || _("record.action.delete", "Delete"),
1184
- row: r,
1185
- entity: e,
1186
- execute: async () => {
1187
- ue((e) => new Set(e).add(n));
1188
- try {
1189
- return await te(e, i);
1190
- } finally {
1191
- ue((e) => {
1192
- let t = new Set(e);
1193
- return t.delete(n), t;
1194
- });
1195
- }
1196
- },
1197
- onSuccess: () => h()
1198
- });
1199
- }, [
1200
- _,
1201
- oe,
1202
- t,
1203
- e,
1204
- h,
1205
- D
1206
- ]);
1207
- if (m) return /* @__PURE__ */ Q("div", {
1208
- style: {
1209
- fontSize: 12.5,
1210
- color: "var(--danger)",
1211
- padding: "8px 0"
1212
- },
1213
- children: v("record.related_rows_unreadable", "The related records could not be loaded.")
1214
- });
1215
- if (p) return /* @__PURE__ */ $("div", {
1216
- style: {
1217
- display: "flex",
1218
- flexDirection: "column",
1219
- gap: 8,
1220
- padding: "8px 0"
1221
- },
1222
- children: [/* @__PURE__ */ Q("div", { style: {
1223
- height: 32,
1224
- background: "var(--surface-3)",
1225
- borderRadius: 6
1226
- } }), /* @__PURE__ */ Q("div", { style: {
1227
- height: 32,
1228
- background: "var(--surface-3)",
1229
- borderRadius: 6
1230
- } })]
1231
- });
1232
- let ye = d.length === 0 && !H;
1233
- return y.isPhone && !b ? /* @__PURE__ */ $("div", { children: [ye && !c && /* @__PURE__ */ Q("div", {
1234
- style: {
1235
- fontSize: 12.5,
1236
- color: "var(--text-3)",
1237
- padding: "12px 0"
1238
- },
1239
- children: _("record.related.empty", "No records yet.")
1240
- }), (!ye || c) && /* @__PURE__ */ $("div", {
1241
- style: {
1242
- display: "flex",
1243
- flexDirection: "column",
1244
- gap: 10
1245
- },
1246
- children: [d.map((n) => {
1247
- let r = V(a(t, n)), i = se.has(r), o = I[r], d = w && r ? w.replace(/:\w+/, r) : void 0;
1248
- return /* @__PURE__ */ Q($e, {
1249
- rowId: r,
1250
- row: n,
1251
- entity: t,
1252
- entities: u.schema.entities,
1253
- screens: u.schema.screens,
1254
- columns: s,
1255
- editableColumns: T,
1256
- editable: c,
1257
- interaction: l,
1258
- isEditing: M === r,
1259
- editErrors: P,
1260
- isDeleting: i,
1261
- activeCell: A,
1262
- setActiveCell: j,
1263
- rowState: o,
1264
- onCellChange: de,
1265
- onDeleteClick: (e) => void ve(e, n),
1266
- onStartEdit: ge,
1267
- onConfirmEdit: _e,
1268
- onCancelEdit: Z,
1269
- refs: f,
1270
- identityCol: x,
1271
- href: d,
1272
- rowActions: k,
1273
- entityCode: e,
1274
- onRowActionSuccess: h
1275
- }, r);
1276
- }), H && /* @__PURE__ */ Q(it, {
1277
- draftRow: H,
1278
- entity: t,
1279
- columns: s,
1280
- editableColumns: E,
1281
- foreignKey: r,
1282
- draftErrors: W,
1283
- draftSaving: ie,
1284
- onChange: (e, t) => U((n) => n && {
1285
- ...n,
1286
- [e]: t
1287
- }),
1288
- onConfirm: he,
1289
- onCancel: () => {
1290
- U(null), G([]);
1291
- },
1292
- refs: f
1293
- })]
1294
- })] }) : /* @__PURE__ */ $("div", { children: [ye && !c && /* @__PURE__ */ Q("div", {
1295
- style: {
1296
- fontSize: 12.5,
1297
- color: "var(--text-3)",
1298
- padding: "12px 0"
1299
- },
1300
- children: _("record.related.empty", "No records yet.")
1301
- }), (!ye || c) && /* @__PURE__ */ Q("div", {
1302
- style: { overflowX: "auto" },
1303
- children: /* @__PURE__ */ $("table", {
1304
- style: le,
1305
- children: [/* @__PURE__ */ Q("thead", { children: /* @__PURE__ */ $("tr", { children: [
1306
- s.map((e) => {
1307
- let n = t.fields.get(e);
1308
- return /* @__PURE__ */ Q("th", {
1309
- style: ce,
1310
- children: n ? i(_, n, e, u.schema.entities) : e
1311
- }, e);
1312
- }),
1313
- c && /* @__PURE__ */ Q("th", { style: {
1314
- height: 30,
1315
- width: 72
1316
- } }),
1317
- !c && k.length > 0 && /* @__PURE__ */ Q("th", { style: {
1318
- height: 30,
1319
- width: 40
1320
- } })
1321
- ] }) }), /* @__PURE__ */ $("tbody", { children: [d.map((n) => {
1322
- let r = V(a(t, n)), i = se.has(r), o = I[r], d = w && r ? w.replace(/:\w+/, r) : void 0;
1323
- return /* @__PURE__ */ Q(et, {
1324
- rowId: r,
1325
- row: n,
1326
- entity: t,
1327
- entities: u.schema.entities,
1328
- screens: u.schema.screens,
1329
- columns: s,
1330
- editableColumns: T,
1331
- editable: c,
1332
- interaction: l,
1333
- isEditing: M === r,
1334
- editErrors: P,
1335
- isDeleting: i,
1336
- activeCell: A,
1337
- setActiveCell: j,
1338
- rowState: o,
1339
- onCellChange: de,
1340
- onDeleteClick: (e) => void ve(e, n),
1341
- onStartEdit: ge,
1342
- onConfirmEdit: _e,
1343
- onCancelEdit: Z,
1344
- refs: f,
1345
- identityCol: x,
1346
- href: d,
1347
- rowActions: k,
1348
- entityCode: e,
1349
- onRowActionSuccess: h
1350
- }, r);
1351
- }), H && /* @__PURE__ */ Q(rt, {
1352
- draftRow: H,
1353
- entity: t,
1354
- columns: s,
1355
- editableColumns: E,
1356
- foreignKey: r,
1357
- draftErrors: W,
1358
- draftSaving: ie,
1359
- onChange: (e, t) => U((n) => n && {
1360
- ...n,
1361
- [e]: t
1362
- }),
1363
- onConfirm: he,
1364
- onCancel: () => {
1365
- U(null), G([]);
1366
- },
1367
- refs: f
1368
- })] })]
1369
- })
1370
- })] });
1371
- }
1372
- function $e({ rowId: t, row: n, entity: r, entities: a, screens: o, columns: s, editableColumns: c, editable: l, interaction: u, isEditing: d, editErrors: f, isDeleting: p, rowState: m, onCellChange: h, onDeleteClick: g, onStartEdit: v, onConfirmEdit: y, onCancelEdit: b, refs: S, identityCol: C, href: w, rowActions: T, onRowActionSuccess: E }) {
1373
- let D = z(), A = me(), j = J(() => !m || Object.keys(m.buffer).length === 0 ? n : {
1374
- ...n,
1375
- ...m.buffer
1376
- }, [n, m]);
1377
- if (u === "row_edit" && d) {
1378
- let e = m?.error ? [...f, `_error:${m.error}`] : f;
1379
- return /* @__PURE__ */ Q(nt, {
1380
- values: j,
1381
- entity: r,
1382
- columns: s,
1383
- editableColumns: c,
1384
- errors: e,
1385
- saving: m?.saving ?? !1,
1386
- onChange: (e, n) => h(t, e, n),
1387
- onConfirm: () => y(t),
1388
- onCancel: () => b(t),
1389
- refs: S
1390
- });
1391
- }
1392
- return /* @__PURE__ */ $("div", {
1393
- style: {
1394
- border: "1px solid var(--border)",
1395
- borderRadius: 8,
1396
- background: "var(--surface)",
1397
- opacity: p ? .58 : 1,
1398
- overflow: "hidden"
1399
- },
1400
- children: [/* @__PURE__ */ Q("div", {
1401
- style: {
1402
- padding: 10,
1403
- display: "flex",
1404
- flexDirection: "column",
1405
- gap: 12
1406
- },
1407
- children: s.map((e) => {
1408
- let n = r.fields.get(e), s = l && u === "inline_edit" && c.has(e), d = w && e === C, f = n ? i(D, n, e, a) : e, p = `${A}-${t}-${e}`, m = `${p}-label`, g = {
1409
- fontSize: 11.5,
1410
- fontWeight: 600,
1411
- color: "var(--text-3)"
1412
- }, v = n ? k({
1413
- field: n,
1414
- fieldName: e,
1415
- value: j[e],
1416
- mode: s ? "edit" : "display",
1417
- onChange: s ? (n) => h(t, e, n) : void 0,
1418
- record: j,
1419
- refs: S,
1420
- compact: s,
1421
- entity: r,
1422
- entities: a,
1423
- screens: d ? void 0 : o,
1424
- fieldId: p,
1425
- labelId: m,
1426
- t: D
1427
- }) : _(j[e]);
1428
- return /* @__PURE__ */ $("div", {
1429
- style: {
1430
- display: "flex",
1431
- flexDirection: "column",
1432
- gap: 5,
1433
- minWidth: 0
1434
- },
1435
- children: [s && n ? /* @__PURE__ */ Q("label", {
1436
- id: m,
1437
- htmlFor: p,
1438
- style: g,
1439
- children: f
1440
- }) : /* @__PURE__ */ Q("div", {
1441
- id: m,
1442
- style: g,
1443
- children: f
1444
- }), /* @__PURE__ */ Q("div", {
1445
- style: { minWidth: 0 },
1446
- children: d && !s ? /* @__PURE__ */ Q("a", {
1447
- href: w,
1448
- style: {
1449
- color: "var(--accent)",
1450
- textDecoration: "none",
1451
- fontWeight: 500
1452
- },
1453
- children: v
1454
- }) : v
1455
- })]
1456
- }, e);
1457
- })
1458
- }), (l || T && T.length > 0) && /* @__PURE__ */ $("div", {
1459
- style: {
1460
- minHeight: 42,
1461
- padding: "6px 8px",
1462
- borderTop: "1px solid var(--divider)",
1463
- display: "flex",
1464
- alignItems: "center",
1465
- justifyContent: "flex-end",
1466
- gap: 6
1467
- },
1468
- children: [l && /* @__PURE__ */ $(ve, { children: [
1469
- m?.saving && /* @__PURE__ */ Q(x, { size: 12 }),
1470
- m?.error && /* @__PURE__ */ Q("span", {
1471
- style: {
1472
- fontSize: 11,
1473
- color: "var(--danger)"
1474
- },
1475
- title: m.error,
1476
- children: "!"
1477
- }),
1478
- u === "row_edit" && /* @__PURE__ */ Q(O, {
1479
- size: 32,
1480
- icon: /* @__PURE__ */ Q(e.edit, { size: 14 }),
1481
- onClick: () => v(t),
1482
- title: D("record.row.edit", "Edit row")
1483
- }),
1484
- /* @__PURE__ */ Q(O, {
1485
- size: 32,
1486
- icon: /* @__PURE__ */ Q(e.trash, { size: 14 }),
1487
- onClick: () => g(t),
1488
- title: D("record.row.delete", "Delete row")
1489
- })
1490
- ] }), !l && T && T.length > 0 && /* @__PURE__ */ Q(ze, {
1491
- entity: r,
1492
- actions: T,
1493
- objectIds: [t],
1494
- row: j,
1495
- onSuccess: E
1496
- })]
1497
- })]
1498
- });
1499
- }
1500
- function et({ rowId: t, row: n, entity: r, entities: i, screens: a, columns: o, editableColumns: s, editable: c, interaction: l, isEditing: u, editErrors: d, isDeleting: f, activeCell: p, setActiveCell: m, rowState: h, onCellChange: g, onDeleteClick: v, onStartEdit: y, onConfirmEdit: b, onCancelEdit: S, refs: C, identityCol: w, href: T, rowActions: E, onRowActionSuccess: D }) {
1501
- let A = z(), j = J(() => !h || Object.keys(h.buffer).length === 0 ? n : {
1502
- ...n,
1503
- ...h.buffer
1504
- }, [n, h]);
1505
- if (l === "row_edit" && u) {
1506
- let e = h?.error ? [...d, `_error:${h.error}`] : d;
1507
- return /* @__PURE__ */ Q(tt, {
1508
- values: j,
1509
- entity: r,
1510
- columns: o,
1511
- editableColumns: s,
1512
- errors: e,
1513
- saving: h?.saving ?? !1,
1514
- onChange: (e, n) => g(t, e, n),
1515
- onConfirm: () => b(t),
1516
- onCancel: () => S(t),
1517
- refs: C
1518
- });
1519
- }
1520
- let M = ue, N = {
1521
- padding: "4px 4px",
1522
- borderBottom: "1px solid var(--divider)",
1523
- verticalAlign: "middle"
1524
- }, P = l === "inline_edit";
1525
- return /* @__PURE__ */ $("tr", {
1526
- style: { opacity: f ? .5 : 1 },
1527
- children: [
1528
- o.map((e) => {
1529
- let n = r.fields.get(e), o = s.has(e);
1530
- if (P && p?.rowId === t && p?.col === e && o) return /* @__PURE__ */ Q("td", {
1531
- style: N,
1532
- children: n ? k({
1533
- field: n,
1534
- fieldName: e,
1535
- value: j[e],
1536
- mode: "edit",
1537
- onChange: (n) => g(t, e, n),
1538
- record: j,
1539
- refs: C,
1540
- compact: !0,
1541
- t: A
1542
- }) : _(j[e])
1543
- }, e);
1544
- let c = T && e === w, l = n ? k({
1545
- field: n,
1546
- fieldName: e,
1547
- value: j[e],
1548
- mode: "display",
1549
- record: j,
1550
- refs: C,
1551
- entity: r,
1552
- entities: i,
1553
- screens: c ? void 0 : a,
1554
- t: A
1555
- }) : _(j[e]), u = P && o && !f;
1556
- return /* @__PURE__ */ Q("td", {
1557
- style: {
1558
- ...M,
1559
- cursor: u ? "pointer" : "default"
1560
- },
1561
- onClick: u ? () => m({
1562
- rowId: t,
1563
- col: e
1564
- }) : void 0,
1565
- children: c ? /* @__PURE__ */ Q("a", {
1566
- href: T,
1567
- style: {
1568
- color: "var(--accent)",
1569
- textDecoration: "none",
1570
- fontWeight: 500
1571
- },
1572
- onMouseEnter: (e) => e.currentTarget.style.textDecoration = "underline",
1573
- onMouseLeave: (e) => e.currentTarget.style.textDecoration = "none",
1574
- children: l
1575
- }) : l
1576
- }, e);
1577
- }),
1578
- c && /* @__PURE__ */ Q("td", {
1579
- style: {
1580
- padding: "4px 8px",
1581
- borderBottom: "1px solid var(--divider)",
1582
- verticalAlign: "middle"
1583
- },
1584
- children: /* @__PURE__ */ $("div", {
1585
- style: {
1586
- display: "flex",
1587
- alignItems: "center",
1588
- gap: 4
1589
- },
1590
- children: [
1591
- h?.saving && /* @__PURE__ */ Q(x, { size: 12 }),
1592
- h?.error && /* @__PURE__ */ Q("span", {
1593
- style: {
1594
- fontSize: 11,
1595
- color: "var(--danger)"
1596
- },
1597
- title: h.error,
1598
- children: "!"
1599
- }),
1600
- l === "row_edit" && /* @__PURE__ */ Q(O, {
1601
- size: 24,
1602
- icon: /* @__PURE__ */ Q(e.edit, { size: 12 }),
1603
- onClick: () => y(t),
1604
- title: A("record.row.edit", "Edit row")
1605
- }),
1606
- /* @__PURE__ */ Q(O, {
1607
- size: 24,
1608
- icon: /* @__PURE__ */ Q(e.trash, { size: 12 }),
1609
- onClick: () => v(t),
1610
- title: A("record.row.delete", "Delete row")
1611
- })
1612
- ]
1613
- })
1614
- }),
1615
- !c && E && E.length > 0 && /* @__PURE__ */ Q("td", {
1616
- style: {
1617
- padding: "4px 8px",
1618
- borderBottom: "1px solid var(--divider)",
1619
- verticalAlign: "middle"
1620
- },
1621
- children: /* @__PURE__ */ Q(ze, {
1622
- entity: r,
1623
- actions: E,
1624
- objectIds: [t],
1625
- row: j,
1626
- onSuccess: D
1627
- })
1628
- })
1629
- ]
1630
- });
1631
- }
1632
- function tt({ values: t, entity: n, columns: r, editableColumns: i, errors: a, saving: o, onChange: s, onConfirm: c, onCancel: l, refs: u, accent: d }) {
1633
- let f = z(), p = a.find((e) => e.startsWith("_error:")), m = new Set(a.filter((e) => !e.startsWith("_error:"))), h = {
1634
- padding: "6px 12px",
1635
- borderBottom: "1px solid var(--divider)",
1636
- verticalAlign: "middle",
1637
- height: 40,
1638
- minWidth: 0
1639
- }, g = {
1640
- display: "block",
1641
- width: "100%",
1642
- maxWidth: "100%",
1643
- minWidth: 0
1644
- };
1645
- return /* @__PURE__ */ $("tr", {
1646
- style: d ? { boxShadow: "inset 3px 0 0 var(--accent)" } : void 0,
1647
- onKeyDown: (e) => {
1648
- e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), c()) : e.key === "Escape" && (e.preventDefault(), l());
1649
- },
1650
- children: [r.map((e) => {
1651
- let r = n.fields.get(e), a = i.has(e), o = m.has(e);
1652
- return a ? /* @__PURE__ */ Q("td", {
1653
- style: {
1654
- ...h,
1655
- outline: o ? "1px solid var(--danger)" : "none",
1656
- outlineOffset: -1
1657
- },
1658
- title: o ? f("record.row.field_required", "{field} is required", { field: e }) : void 0,
1659
- children: /* @__PURE__ */ Q("div", {
1660
- style: g,
1661
- children: r ? k({
1662
- field: r,
1663
- fieldName: e,
1664
- value: t[e],
1665
- mode: "edit",
1666
- onChange: (t) => s(e, t),
1667
- record: t,
1668
- refs: u,
1669
- compact: !0,
1670
- t: f
1671
- }) : _(t[e])
1672
- })
1673
- }, e) : /* @__PURE__ */ Q("td", {
1674
- style: {
1675
- ...h,
1676
- color: "var(--text-3)"
1677
- },
1678
- children: r?.auto ? "—" : _(t[e])
1679
- }, e);
1680
- }), /* @__PURE__ */ Q("td", {
1681
- style: h,
1682
- children: /* @__PURE__ */ $("div", {
1683
- style: {
1684
- display: "flex",
1685
- alignItems: "center",
1686
- gap: 4,
1687
- justifyContent: "flex-end"
1688
- },
1689
- children: [
1690
- p && /* @__PURE__ */ Q("span", {
1691
- style: {
1692
- fontSize: 11,
1693
- color: "var(--danger)"
1694
- },
1695
- title: p.slice(7),
1696
- children: "!"
1697
- }),
1698
- /* @__PURE__ */ Q(O, {
1699
- size: 24,
1700
- icon: Q(o ? x : e.check, { size: 12 }),
1701
- onClick: c,
1702
- title: f("record.row.confirm", "Confirm (Enter)")
1703
- }),
1704
- /* @__PURE__ */ Q(O, {
1705
- size: 24,
1706
- icon: /* @__PURE__ */ Q(e.x, { size: 12 }),
1707
- onClick: l,
1708
- title: f("record.row.cancel", "Cancel (Esc)")
1709
- })
1710
- ]
1711
- })
1712
- })]
1713
- });
1714
- }
1715
- function nt({ values: t, entity: n, columns: r, editableColumns: a, errors: o, saving: s, onChange: c, onConfirm: l, onCancel: u, refs: d, accent: f }) {
1716
- let p = z(), m = me(), h = o.find((e) => e.startsWith("_error:")), g = new Set(o.filter((e) => !e.startsWith("_error:")));
1717
- return /* @__PURE__ */ $("div", {
1718
- style: {
1719
- border: "1px solid var(--border)",
1720
- borderRadius: 8,
1721
- background: "var(--surface)",
1722
- overflow: "hidden",
1723
- boxShadow: f ? "inset 3px 0 0 var(--accent)" : void 0
1724
- },
1725
- onKeyDown: (e) => {
1726
- e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), l()) : e.key === "Escape" && (e.preventDefault(), u());
1727
- },
1728
- children: [/* @__PURE__ */ Q("div", {
1729
- style: {
1730
- padding: 10,
1731
- display: "flex",
1732
- flexDirection: "column",
1733
- gap: 12
1734
- },
1735
- children: r.map((e) => {
1736
- let r = n.fields.get(e), o = a.has(e), s = g.has(e), l = r ? i(p, r, e) : e, u = `${m}-${e}`, f = `${u}-label`, h = {
1737
- fontSize: 11.5,
1738
- fontWeight: 600,
1739
- color: "var(--text-3)"
1740
- };
1741
- return /* @__PURE__ */ $("div", {
1742
- style: {
1743
- display: "flex",
1744
- flexDirection: "column",
1745
- gap: 5,
1746
- minWidth: 0
1747
- },
1748
- children: [o && r ? /* @__PURE__ */ Q("label", {
1749
- id: f,
1750
- htmlFor: u,
1751
- style: h,
1752
- children: l
1753
- }) : /* @__PURE__ */ Q("div", {
1754
- id: f,
1755
- style: h,
1756
- children: l
1757
- }), /* @__PURE__ */ Q("div", {
1758
- style: {
1759
- minWidth: 0,
1760
- outline: s ? "1px solid var(--danger)" : "none",
1761
- outlineOffset: 3,
1762
- borderRadius: s ? 5 : 0
1763
- },
1764
- title: s ? p("record.row.field_required", "{field} is required", { field: e }) : void 0,
1765
- children: o ? r ? k({
1766
- field: r,
1767
- fieldName: e,
1768
- value: t[e],
1769
- mode: "edit",
1770
- onChange: (t) => c(e, t),
1771
- record: t,
1772
- refs: d,
1773
- compact: !0,
1774
- fieldId: u,
1775
- labelId: f,
1776
- t: p
1777
- }) : _(t[e]) : r?.auto ? "—" : _(t[e])
1778
- })]
1779
- }, e);
1780
- })
1781
- }), /* @__PURE__ */ $("div", {
1782
- style: {
1783
- minHeight: 42,
1784
- padding: "6px 8px",
1785
- borderTop: "1px solid var(--divider)",
1786
- display: "flex",
1787
- alignItems: "center",
1788
- justifyContent: "flex-end",
1789
- gap: 6
1790
- },
1791
- children: [
1792
- h && /* @__PURE__ */ Q("span", {
1793
- style: {
1794
- fontSize: 11,
1795
- color: "var(--danger)"
1796
- },
1797
- title: h.slice(7),
1798
- children: "!"
1799
- }),
1800
- /* @__PURE__ */ Q(O, {
1801
- size: 32,
1802
- icon: Q(s ? x : e.check, { size: 14 }),
1803
- onClick: l,
1804
- title: p("record.row.confirm", "Confirm (Enter)")
1805
- }),
1806
- /* @__PURE__ */ Q(O, {
1807
- size: 32,
1808
- icon: /* @__PURE__ */ Q(e.x, { size: 14 }),
1809
- onClick: u,
1810
- title: p("record.row.cancel", "Cancel (Esc)")
1811
- })
1812
- ]
1813
- })]
1814
- });
1815
- }
1816
- function rt({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
1817
- let d = J(() => {
1818
- let e = new Set(r);
1819
- return e.delete(i), e;
1820
- }, [r, i]);
1821
- return /* @__PURE__ */ Q(tt, {
1822
- values: e,
1823
- entity: t,
1824
- columns: n,
1825
- editableColumns: d,
1826
- errors: a,
1827
- saving: o,
1828
- onChange: s,
1829
- onConfirm: c,
1830
- onCancel: l,
1831
- refs: u,
1832
- accent: !0
1833
- });
1834
- }
1835
- function it({ draftRow: e, entity: t, columns: n, editableColumns: r, foreignKey: i, draftErrors: a, draftSaving: o, onChange: s, onConfirm: c, onCancel: l, refs: u }) {
1836
- let d = J(() => {
1837
- let e = new Set(r);
1838
- return e.delete(i), e;
1839
- }, [r, i]);
1840
- return /* @__PURE__ */ Q(nt, {
1841
- values: e,
1842
- entity: t,
1843
- columns: n,
1844
- editableColumns: d,
1845
- errors: a,
1846
- saving: o,
1847
- onChange: s,
1848
- onConfirm: c,
1849
- onCancel: l,
1850
- refs: u,
1851
- accent: !0
1852
- });
1853
- }
1854
- //#endregion
1855
- //#region src/components/shared/ErrorBoundary.tsx
1856
- var at = class extends K {
1857
- constructor(e) {
1858
- super(e), this.state = {
1859
- hasError: !1,
1860
- error: null
1861
- };
1862
- }
1863
- static getDerivedStateFromError(e) {
1864
- return {
1865
- hasError: !0,
1866
- error: e
1867
- };
1868
- }
1869
- componentDidCatch(e, t) {
1870
- console.error("[ErrorBoundary]", e, t.componentStack);
1871
- }
1872
- handleRetry = () => {
1873
- this.setState({
1874
- hasError: !1,
1875
- error: null
1876
- });
1877
- };
1878
- render() {
1879
- return this.state.hasError ? this.props.fallback ? this.props.fallback : /* @__PURE__ */ Q(st, {
1880
- message: this.state.error?.message,
1881
- onRetry: this.handleRetry
1882
- }) : this.props.children;
1883
- }
1884
- }, ot = R(void 0, "en", "en");
1885
- function st(e) {
1886
- return fe(he) ? /* @__PURE__ */ Q(ct, { ...e }) : /* @__PURE__ */ Q(lt, {
1887
- ...e,
1888
- t: ot,
1889
- errorTitle: ot
1890
- });
1891
- }
1892
- function ct(e) {
1893
- let t = z(), n = z("errors");
1894
- return /* @__PURE__ */ Q(lt, {
1895
- ...e,
1896
- t,
1897
- errorTitle: n
1898
- });
1899
- }
1900
- function lt({ message: e, onRetry: t, t: n, errorTitle: r }) {
1901
- return /* @__PURE__ */ Q("div", {
1902
- style: {
1903
- display: "flex",
1904
- alignItems: "center",
1905
- justifyContent: "center",
1906
- minHeight: 200,
1907
- padding: 32
1908
- },
1909
- children: /* @__PURE__ */ $("div", {
1910
- style: {
1911
- textAlign: "center",
1912
- maxWidth: 420,
1913
- display: "flex",
1914
- flexDirection: "column",
1915
- gap: 10
1916
- },
1917
- children: [
1918
- /* @__PURE__ */ Q("h2", {
1919
- style: {
1920
- fontSize: 16,
1921
- fontWeight: 600,
1922
- margin: 0,
1923
- color: "var(--text)"
1924
- },
1925
- children: r("ui.render_failed", "This part of the page could not be shown.")
1926
- }),
1927
- /* @__PURE__ */ Q("p", {
1928
- style: {
1929
- fontSize: 12.5,
1930
- color: "var(--text-3)",
1931
- margin: 0
1932
- },
1933
- children: e || r("ui.render_failed_undescribed", "An unexpected error occurred.")
1934
- }),
1935
- /* @__PURE__ */ Q("div", { children: /* @__PURE__ */ Q(l, {
1936
- onClick: t,
1937
- children: n("control.try_again", "Try again")
1938
- }) })
1939
- ]
1940
- })
1941
- });
1942
- }
1943
- //#endregion
1944
- //#region src/components/detail-layout/widgets/registry.ts
1945
- var ut = /* @__PURE__ */ new Map();
1946
- function dt(e, t) {
1947
- ut.set(e, t);
1948
- }
1949
- function ft(e) {
1950
- return ut.get(e);
1951
- }
1952
- function pt(e) {
1953
- return ut.has(e);
1954
- }
1955
- //#endregion
1956
- export { Je as a, Ie as c, je as d, we as f, Se as h, at as i, Pe as l, Ce as m, pt as n, Re as o, Te as p, dt as r, Fe as s, ft as t, Ne as u };