@declarion/react 0.61.1 → 0.63.1

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-rgkewyMl.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-DruYOxKm.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-Dsf3I0xG.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-QN7Wp2W6.js → LayoutRenderer-DEHtYtzV.js} +965 -942
  26. package/dist-lib/{ListCardsBody-CNaZ0xwz.js → ListCardsBody-BAwFR3yO.js} +46 -52
  27. package/dist-lib/{MarkdownRenderer-BuO5hYJh.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-BV-aQbPy.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-BnmWukxk.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 +1588 -5117
  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-Dk1Ha5u3.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-nT5UypJX.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-Dwfyghtj.js → value-CDCeHgOv.js} +8 -22
  85. package/dist-lib/{action-dispatch-gWmOYjOP.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 +16 -23
  89. package/dist-lib/DetailAuditStrip-CSXZoy7v.js +0 -288
  90. package/dist-lib/DynamicIcon-DW5krHuX.js +0 -280
  91. package/dist-lib/RefreshControl-DO9rYcdq.js +0 -399
  92. package/dist-lib/SmartDetailPage.impl-DFIIx80b.js +0 -1565
  93. package/dist-lib/SmartListPage.impl-D694R32H.js +0 -3051
  94. package/dist-lib/SmartRecordListPage.impl-CB5cuQJV.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 -111
  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-BUxXuP4c.js +0 -158
  378. package/dist-lib/format-count-bXVfHzbI.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-nSeHd5si.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 -579
  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-0WBj7wT6.js +0 -7860
  482. package/dist-lib/useListQuery-C7dq_sEo.js +0 -103
  483. package/dist-lib/useOwnRefresh-q80kCMMh.js +0 -1167
  484. package/dist-lib/useProperties-CeGKtq7Q.js +0 -83
  485. package/dist-lib/useTabSearchMirror-CzNAj82Q.js +0 -175
  486. package/dist-lib/useText-BsedsJ-J.js +0 -952
  487. package/dist-lib/vite/fingerprint-plugin.d.ts +0 -44
@@ -0,0 +1,2818 @@
1
+ import { $t as e, A as t, F as n, Ft as r, It as i, L as a, M as o, Nt as s, O as c, P as l, Q as u, T as d, U as f, Xt as p, Zt as m, an as h, at as g, dt as _, en as v, f as y, g as b, in as x, j as S, l as C, on as w, pn as T, qn as E, s as D, sn as ee, ut as O, wn as k, wt as A, xt as te } from "./useCurrentScreen--UovgvRj.js";
2
+ import { t as j } from "./Icons-lt-7lhYR.js";
3
+ import { n as M, r as N } from "./CopyButton-C0iEvaT1.js";
4
+ import { t as P } from "./Pill-D-wsfRhx.js";
5
+ import { t as ne } from "./Kbd-CNttVu0z.js";
6
+ import { a as re, c as ie, d as ae, f as oe, l as se, m as ce, o as le, s as ue, t as de } from "./format-count-CSEFw2ht.js";
7
+ import { n as fe, t as F } from "./MenuItem-CfkVXPvC.js";
8
+ import { A as pe, L as me, Q as he, X as ge, _ as _e, h as ve, p as ye, z as be } from "./PropertyGridEditor-BTjscqfz.js";
9
+ import { a as xe, n as Se } from "./useBrandingChrome-bKTXXDLy.js";
10
+ import { t as I } from "./Check-DAfMbQIw.js";
11
+ import { t as Ce } from "./useScreenBack-J861tbwn.js";
12
+ import { n as we } from "./useTabNavigate-BZiW4q3M.js";
13
+ import { t as Te } from "./page-inset-D_kkVwwN.js";
14
+ import { d as Ee, f as De, g as Oe, h as ke, m as Ae, n as je, p as Me, v as Ne } from "./ActionRunner-DAxgnKB3.js";
15
+ import { a as Pe, c as Fe, g as L, o as Ie, v as Le } from "./useOwnRefresh-DkOuM4yo.js";
16
+ import { a as Re, c as ze, f as Be, g as Ve, i as He, l as Ue, m as We, n as Ge, p as Ke, s as qe, t as Je } from "./variants-CbAwl3Mn.js";
17
+ import { n as Ye, t as Xe } from "./payload-B2wODLAX.js";
18
+ import { a as Ze, d as Qe, g as $e, m as et, n as tt, o as nt, t as rt, u as it } from "./FilterChips-8fMDBXHp.js";
19
+ import { a as at, i as ot, t as st } from "./RefreshControl-Ce-T_wSQ.js";
20
+ import { a as ct, c as lt, i as ut, n as R, o as dt, s as ft, t as pt } from "./peekDraftStore-D4GRsRKW.js";
21
+ import { i as mt, n as ht, r as gt, t as _t } from "./cardProjection-Cr7fG6wJ.js";
22
+ import { a as vt, i as yt, n as bt, o as xt, t as St } from "./use-filter-value-labels-DuqvAIVG.js";
23
+ import { Suspense as Ct, createElement as z, lazy as wt, memo as Tt, useCallback as B, useEffect as V, useMemo as H, useRef as U, useState as W } from "react";
24
+ import { useQueryClient as Et } from "@tanstack/react-query";
25
+ import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
26
+ import { useSearchParams as Dt } from "react-router";
27
+ import { columnResizingFeature as Ot, columnSizingFeature as kt, columnVisibilityFeature as At, flexRender as J, rowSelectionFeature as Y, rowSortingFeature as jt, tableFeatures as Mt, useTable as Nt } from "@tanstack/react-table";
28
+ import { useVirtualizer as Pt } from "@tanstack/react-virtual";
29
+ //#region src/components/pages/list/useActiveView.ts
30
+ var Ft = [], X = [], It = [
31
+ "search",
32
+ "per_page",
33
+ "include_deleted"
34
+ ];
35
+ function Lt(e) {
36
+ let t = new URLSearchParams();
37
+ for (let n of [...It, ...m]) {
38
+ let r = e.get(n);
39
+ r !== null && r !== "" && t.set(n, r);
40
+ }
41
+ return t.set("page", "1"), t;
42
+ }
43
+ function Rt(e, t, n) {
44
+ return `dcl:smartlist:default-view-cleared:${t ?? ""}:${n ?? ""}:${e}`;
45
+ }
46
+ function zt(e) {
47
+ if (typeof window > "u") return !1;
48
+ try {
49
+ return window.sessionStorage?.getItem(e) === "1";
50
+ } catch {
51
+ return !1;
52
+ }
53
+ }
54
+ function Bt(e, t, n) {
55
+ return {
56
+ filters: t?.filters ?? Ft,
57
+ sort: b(e, t?.sort) ?? b(e, n?.sort_default)
58
+ };
59
+ }
60
+ function Vt({ screenCode: e, screen: t, entity: n, searchParams: r, setSearchParams: i, userId: a, tenantId: o, filterError: s }) {
61
+ let { views: c, isSettled: l, refetch: u } = ae(e, a), d = r.get("view"), f = H(() => c.find((e) => e.id === d), [c, d]), p = se(l && !f ? d : null, a), m = f ?? p.view, h = !!d && !m && (!l || !p.isSettled), g = r.get("filters") !== null || r.get("columns") !== null || r.get("sort") !== null, _ = `${e}|${d ?? ""}`, [v, y] = W(null), b = v === _, x = Rt(e, o, a), S = zt(x), C = H(() => {
62
+ if (!(d || S || g)) return c.find((e) => e.source === "personal" && e.is_default) ?? (t?.default_view ? c.find((e) => e.source === "system" && e.id === t.default_view) : void 0);
63
+ }, [
64
+ d,
65
+ S,
66
+ g,
67
+ c,
68
+ t?.default_view
69
+ ]);
70
+ V(() => {
71
+ if (b) return;
72
+ if (s || d || S || g) {
73
+ y(_);
74
+ return;
75
+ }
76
+ if (!l || (y(_), !C?.id)) return;
77
+ let e = Lt(r);
78
+ e.set("view", C.id), i(e, { replace: !0 });
79
+ }, [
80
+ b,
81
+ _,
82
+ s,
83
+ d,
84
+ S,
85
+ g,
86
+ l,
87
+ C,
88
+ r,
89
+ i
90
+ ]);
91
+ let w = h, T = !d && !s && !S && !g && (!b || !!C);
92
+ return {
93
+ all: c,
94
+ activeId: d,
95
+ active: m,
96
+ defaults: H(() => ({
97
+ ...Bt(n, m, t),
98
+ columns: m?.columns?.length ? m.columns : t?.default_columns ?? t?.columns ?? X
99
+ }), [
100
+ n,
101
+ m,
102
+ t
103
+ ]),
104
+ clearedKey: x,
105
+ clearActiveView: B(() => {
106
+ if (typeof window < "u") try {
107
+ window.sessionStorage?.setItem(x, "1");
108
+ } catch {}
109
+ let e = new URLSearchParams(r);
110
+ e.delete("view"), e.set("page", "1"), i(e, { replace: !0 });
111
+ }, [
112
+ r,
113
+ i,
114
+ x
115
+ ]),
116
+ retryViews: u,
117
+ isUnresolved: !!d && !m && !h,
118
+ isHeld: w || T
119
+ };
120
+ }
121
+ //#endregion
122
+ //#region src/components/pages/list/table-features.ts
123
+ var Ht = Mt({
124
+ rowSortingFeature: jt,
125
+ rowSelectionFeature: Y,
126
+ columnSizingFeature: kt,
127
+ columnResizingFeature: Ot,
128
+ columnVisibilityFeature: At
129
+ }), Ut = [
130
+ 25,
131
+ 50,
132
+ 100,
133
+ 200,
134
+ 500,
135
+ 1e3
136
+ ];
137
+ //#endregion
138
+ //#region src/components/pages/list/useListSort.ts
139
+ function Wt({ searchParams: e, setSearchParams: t, defaultSort: n, commitScreenTabSearch: r }) {
140
+ let i = e.get("sort") ?? n ?? "", a = H(() => Me(i), [i]), o = H(() => {
141
+ let e = /* @__PURE__ */ new Map();
142
+ for (let t of a) t.nulls && e.set(t.field, t.nulls);
143
+ return e;
144
+ }, [a]), s = H(() => Oe(i), [i]), c = H(() => a.map((e) => ({
145
+ id: e.field,
146
+ desc: e.dir === "desc"
147
+ })), [a]), l = B((i) => {
148
+ let a = i.slice(0, 5), o = new URLSearchParams(e), s = a.length === 0 ? "" : ke(a);
149
+ s === (n ?? "") ? o.delete("sort") : o.set("sort", s), o.set("page", "1"), r(o.toString()), t(o);
150
+ }, [
151
+ e,
152
+ r,
153
+ t,
154
+ n
155
+ ]);
156
+ return {
157
+ value: i,
158
+ cols: a,
159
+ nullsByField: o,
160
+ forRequest: s,
161
+ tableSorting: c,
162
+ write: l,
163
+ applyColumn: B((e, t, n) => l([{
164
+ field: e,
165
+ dir: t,
166
+ ...n ? { nulls: n } : {}
167
+ }]), [l]),
168
+ shiftClickColumn: B((e) => l(De(a, e)), [a, l]),
169
+ appendColumn: B((e, t, n) => l(Ee(a, {
170
+ field: e,
171
+ dir: t,
172
+ ...n ? { nulls: n } : {}
173
+ })), [a, l]),
174
+ clearColumn: B((e) => l(Ae(a, e)), [a, l]),
175
+ clearAll: B(() => l([]), [l])
176
+ };
177
+ }
178
+ //#endregion
179
+ //#region src/components/pages/list/useListSelection.ts
180
+ var Gt = {};
181
+ function Kt(e, t) {
182
+ return T(e, h(e, t));
183
+ }
184
+ function qt(e, t, n) {
185
+ if (!e || n.length === 0) return [];
186
+ let r = new Set(n);
187
+ return t.filter((t) => r.has(Kt(e, t))).map((t) => h(e, t));
188
+ }
189
+ function Jt(e, t, n) {
190
+ let [r, i] = ie("selection", Gt, { scope: "path" }), a = H(() => e?.fields.names().find((t) => e.fields.get(t)?.primary) ?? "id", [e]), o = B((t) => e ? Kt(e, t) : k(t[a]), [e, a]), s = H(() => Object.keys(r).filter((e) => r[e]), [r]), c = H(() => qt(e, t, s), [
191
+ e,
192
+ t,
193
+ s
194
+ ]), l = H(() => {
195
+ if (s.length === 0) return [];
196
+ let e = /* @__PURE__ */ new Map();
197
+ for (let n of t) e.set(o(n), n);
198
+ return s.map((t) => e.get(t)).filter((e) => e !== void 0);
199
+ }, [
200
+ s,
201
+ t,
202
+ o
203
+ ]);
204
+ return V(() => {
205
+ n || i((e) => {
206
+ let n = Object.keys(e);
207
+ if (n.length === 0) return e;
208
+ let r = new Set(t.map((e) => o(e))), i = {}, a = !1;
209
+ for (let t of n) r.has(t) ? i[t] = e[t] : a = !0;
210
+ return a ? i : e;
211
+ });
212
+ }, [
213
+ t,
214
+ n,
215
+ o,
216
+ i
217
+ ]), {
218
+ state: r,
219
+ setState: i,
220
+ ids: s,
221
+ pkValues: c,
222
+ rows: l,
223
+ keyOf: o
224
+ };
225
+ }
226
+ //#endregion
227
+ //#region src/components/pages/list/useListColumnLayout.ts
228
+ function Yt({ screenCode: e, screen: t, searchParams: n, setSearchParams: r, defaultColumns: i }) {
229
+ let a = A(), o = H(() => {
230
+ let e = n.get("columns");
231
+ return e ? e.split(",").filter(Boolean) : i;
232
+ }, [n, i]), { widths: s, prune: c, setWidths: l, resetWidths: u, resizeEduShown: d, markResizeEduShown: p } = Le(e), [m, h] = W(() => s);
233
+ V(() => {
234
+ h(s);
235
+ }, [s]);
236
+ let g = H(() => t?.columns ?? [], [t?.columns]);
237
+ V(() => {
238
+ g.length > 0 && c(g);
239
+ }, [g, c]);
240
+ let _ = B((e) => {
241
+ if (e.length === 0) return;
242
+ let t = new URLSearchParams(n);
243
+ e.join(",") === i.join(",") ? t.delete("columns") : t.set("columns", e.join(",")), r(t);
244
+ }, [
245
+ n,
246
+ r,
247
+ i
248
+ ]);
249
+ return {
250
+ visible: o,
251
+ sizing: m,
252
+ setSizing: h,
253
+ apply: _,
254
+ clear: B(() => {
255
+ let e = new URLSearchParams(n);
256
+ e.delete("columns"), r(e);
257
+ }, [n, r]),
258
+ move: B((e, t) => {
259
+ let n = o.indexOf(e);
260
+ if (n === -1) return;
261
+ let r = t === "up" ? n - 1 : n + 1;
262
+ if (r < 0 || r >= o.length) return;
263
+ let i = [...o];
264
+ [i[n], i[r]] = [i[r], i[n]], _(i);
265
+ }, [o, _]),
266
+ commitResize: B((e) => {
267
+ l(e), !d && (p(), f.info(a("list.columns.width_saved_title", "Column width saved on this device"), a("list.columns.width_saved_body", "Widths are personal and never shared. Column order, sort and filters can be saved into a view.")));
268
+ }, [
269
+ a,
270
+ l,
271
+ d,
272
+ p
273
+ ]),
274
+ resetWidths: u
275
+ };
276
+ }
277
+ function Xt(e, t, n = 10) {
278
+ switch (t.type) {
279
+ case "down": return {
280
+ origin: {
281
+ x: t.x,
282
+ y: t.y
283
+ },
284
+ outcome: "pending"
285
+ };
286
+ case "move": return e ? Math.abs(t.x - e.x) > n || Math.abs(t.y - e.y) > n ? {
287
+ origin: null,
288
+ outcome: "idle"
289
+ } : {
290
+ origin: e,
291
+ outcome: "pending"
292
+ } : {
293
+ origin: null,
294
+ outcome: "idle"
295
+ };
296
+ case "release": return {
297
+ origin: null,
298
+ outcome: "idle"
299
+ };
300
+ case "held": return e ? {
301
+ origin: null,
302
+ outcome: "fire"
303
+ } : {
304
+ origin: null,
305
+ outcome: "idle"
306
+ };
307
+ }
308
+ }
309
+ function Zt(e) {
310
+ return e instanceof Element && e.closest("a, button, input, select, [role='button'], [role='menuitem']") !== null;
311
+ }
312
+ function Qt(e, t) {
313
+ return e != null && e.rowId === t ? "double" : "single";
314
+ }
315
+ //#endregion
316
+ //#region src/hooks/useLongPress.ts
317
+ function $t(e) {
318
+ let t = U(null), n = U(null), r = U(!1), i = B(() => {
319
+ n.current !== null && clearTimeout(n.current), n.current = null;
320
+ }, []);
321
+ V(() => i, [i]);
322
+ let a = B((e) => {
323
+ let n = Xt(t.current, e);
324
+ return t.current = n.origin, n.outcome !== "pending" && i(), n;
325
+ }, [i]);
326
+ return {
327
+ handlers: {
328
+ onPointerDown: (o) => {
329
+ if (o.pointerType === "mouse" || Zt(o.target)) return;
330
+ r.current = !1, i();
331
+ let s = {
332
+ x: o.clientX,
333
+ y: o.clientY
334
+ };
335
+ a({
336
+ type: "down",
337
+ ...s
338
+ }), n.current = setTimeout(() => {
339
+ let i = Xt(t.current, { type: "held" });
340
+ t.current = i.origin, n.current = null, i.outcome === "fire" && (r.current = !0, e(s));
341
+ }, 500);
342
+ },
343
+ onPointerMove: (e) => {
344
+ t.current && a({
345
+ type: "move",
346
+ x: e.clientX,
347
+ y: e.clientY
348
+ });
349
+ },
350
+ onPointerUp: () => void a({ type: "release" }),
351
+ onPointerCancel: () => void a({ type: "release" }),
352
+ onPointerLeave: () => void a({ type: "release" })
353
+ },
354
+ consumePressFired: B(() => {
355
+ let e = r.current;
356
+ return r.current = !1, e;
357
+ }, [])
358
+ };
359
+ }
360
+ //#endregion
361
+ //#region src/components/pages/list/useListRowInteraction.ts
362
+ function en({ entity: e, screen: t, screens: n, entities: r, searchParams: i, tabNavigate: a, commitScreenTabSearch: o, isPhone: s, canUpdate: c }) {
363
+ let l = A(), [u, d] = W(null), [f, p] = W(null), m = U(null), _ = U(null);
364
+ V(() => () => {
365
+ _.current && clearTimeout(_.current.timer);
366
+ }, []);
367
+ let y = t?.on_row_click === "peek" && t.quick_peek?.enabled !== !1 && !s, b = B((r, s) => {
368
+ if (!e || !t) return;
369
+ let c = h(e, r), u = T(e, c), d = v(t, e, n, c);
370
+ if (!d) return;
371
+ if (s?.draft) {
372
+ R(u, s.draft);
373
+ let [e, t] = d.split("?", 2), n = new URLSearchParams(t ?? "");
374
+ n.set("edit", "true"), d = `${e}?${n.toString()}`;
375
+ }
376
+ let f = ee(l, r, e) ?? l(e.display.name), p = t.display?.icon || e.display.icon;
377
+ o(i.toString()), a(d, {
378
+ title: f,
379
+ icon: p
380
+ });
381
+ }, [
382
+ l,
383
+ e,
384
+ t,
385
+ n,
386
+ i,
387
+ a,
388
+ o
389
+ ]), x = $t(B((e) => {
390
+ let t = m.current;
391
+ t && p({
392
+ x: e.x,
393
+ y: e.y,
394
+ row: t
395
+ });
396
+ }, [])), S = B((t, n) => {
397
+ if (x.consumePressFired() || Zt(t.target)) return;
398
+ if (!y || !e) {
399
+ b(n);
400
+ return;
401
+ }
402
+ let r = Kt(e, n);
403
+ if (Qt(_.current, r) === "double") {
404
+ clearTimeout(_.current.timer), _.current = null, d(null), b(n);
405
+ return;
406
+ }
407
+ _.current && clearTimeout(_.current.timer);
408
+ let i = setTimeout(() => {
409
+ _.current = null, d(n);
410
+ }, 250);
411
+ _.current = {
412
+ rowId: r,
413
+ timer: i
414
+ };
415
+ }, [
416
+ e,
417
+ y,
418
+ b,
419
+ x
420
+ ]);
421
+ return {
422
+ peekAllowed: y,
423
+ peekRow: u,
424
+ setPeekRow: d,
425
+ peekFields: H(() => {
426
+ if (!y || !e || !u) return [];
427
+ let i = Ge(e, t, u);
428
+ return gt(e, i, n).map((t) => {
429
+ if (e.files?.get(t)) return {
430
+ key: t,
431
+ label: We(l, e, t, r),
432
+ kind: "file",
433
+ readOnly: !c
434
+ };
435
+ let n = e.fields.get(t), i = c && !n.primary && !n.auto && !n.ref && n.files?.mode !== "rich_text_inline";
436
+ return {
437
+ key: t,
438
+ label: w(l, n, t, r),
439
+ kind: "field",
440
+ field: n,
441
+ readOnly: !i
442
+ };
443
+ });
444
+ }, [
445
+ l,
446
+ y,
447
+ u,
448
+ e,
449
+ t,
450
+ r,
451
+ n,
452
+ c
453
+ ]),
454
+ peekActions: H(() => e?.actions ?? {}, [e?.actions]),
455
+ peekExecute: B(async (t, n, r) => {
456
+ let i = e?.fields.names().find((t) => e.fields.get(t)?.primary), a = i && u ? [k(u[i])] : void 0, o = n.entity ? `${n.entity}.${t}` : t;
457
+ return O(o, g(r, a));
458
+ }, [e, u]),
459
+ contextMenu: f,
460
+ setContextMenu: p,
461
+ pressedRow: m,
462
+ longPress: x,
463
+ onRowClick: S,
464
+ navigateToDetail: b
465
+ };
466
+ }
467
+ //#endregion
468
+ //#region src/components/pages/list/column-sizing.ts
469
+ function tn(e) {
470
+ return `--header-${e}-size`;
471
+ }
472
+ function Z(e) {
473
+ return `--col-${e}-size`;
474
+ }
475
+ function nn(e) {
476
+ return `calc(var(${e}) * 1px)`;
477
+ }
478
+ function rn(e) {
479
+ let t = e.getFlatHeaders(), n = {};
480
+ for (let e of t) n[tn(e.id)] = e.getSize(), n[Z(e.column.id)] = e.column.getSize();
481
+ return n;
482
+ }
483
+ //#endregion
484
+ //#region src/components/pages/list/sortable-header.ts
485
+ var an = /* @__PURE__ */ new Set([
486
+ "secret",
487
+ "password",
488
+ "json",
489
+ "string_array",
490
+ "int_array",
491
+ "uuid_array",
492
+ "multilang_array"
493
+ ]);
494
+ function on(e, t) {
495
+ if (e === "_actions" || e === "_select" || e.startsWith("$property.") || e.startsWith("$refs.")) return !1;
496
+ if (e.startsWith("$status.")) return !0;
497
+ let n = t?.fields.get(e);
498
+ return !n || t?.list_pagination === "cursor" && n.cross_store_sortable === !1 ? !1 : !an.has(n.type);
499
+ }
500
+ //#endregion
501
+ //#region src/components/pages/list/ListTable.tsx
502
+ var sn = wt(() => import("./SortHeaderMenu-BKTrq0Wb.js").then((e) => ({ default: e.SortHeaderMenu }))), cn = Tt(function({ virtualItems: e, topPad: t, bottomPad: n, colSpan: r, rows: i, renderRow: a, showsPreviousRows: o }) {
503
+ return /* @__PURE__ */ q("tbody", {
504
+ style: o ? {
505
+ opacity: .45,
506
+ transition: "opacity 120ms"
507
+ } : void 0,
508
+ children: [
509
+ e.length > 0 && /* @__PURE__ */ K("tr", { children: /* @__PURE__ */ K("td", {
510
+ style: { height: t },
511
+ colSpan: r
512
+ }) }),
513
+ e.map((e) => a(i[e.index], e.index)),
514
+ e.length > 0 && /* @__PURE__ */ K("tr", { children: /* @__PURE__ */ K("td", {
515
+ style: { height: n },
516
+ colSpan: r
517
+ }) })
518
+ ]
519
+ });
520
+ }, (e, t) => t.isResizing);
521
+ function ln({ table: e, columns: t, rows: n, entity: r, columnSizeVars: i, totalColumnsWidth: a, theadRef: o, virtualizer: s, visibleCols: c, headerReorder: l, sortCols: u, sortNullsMap: d, shiftClickColumn: f, applyColumnSort: p, appendColumnSort: m, clearColumnSort: h, clearAllSorts: g, renderRow: _, isResizingColumn: v, showsPreviousRows: y }) {
522
+ let b = A();
523
+ return /* @__PURE__ */ q("table", {
524
+ "data-virtual-rows": "true",
525
+ "aria-busy": y || void 0,
526
+ style: {
527
+ ...i,
528
+ tableLayout: "fixed",
529
+ width: "100%",
530
+ minWidth: a,
531
+ borderCollapse: "separate",
532
+ borderSpacing: 0,
533
+ fontSize: 12.5,
534
+ color: "var(--text)"
535
+ },
536
+ children: [/* @__PURE__ */ K("thead", {
537
+ ref: o,
538
+ children: e.getHeaderGroups().map((e) => /* @__PURE__ */ q("tr", {
539
+ style: {
540
+ height: 32,
541
+ background: "var(--surface-2)"
542
+ },
543
+ children: [e.headers.map((e) => {
544
+ let t = on(e.id, r), n = e.column.getIsSorted(), i = e.id === "_select", a = e.id === "_actions", o = n ? u.findIndex((t) => t.field === e.id) + 1 : 0, s = u.length > 1 && o > 0, _ = o > 0, v = u.length < 5, y = t ? e.column.getToggleSortingHandler() : void 0, x = t ? (t) => {
545
+ t.shiftKey ? (t.preventDefault(), f(e.id)) : y?.(t);
546
+ } : void 0, S = !i && !a, C = S ? c.indexOf(e.id) : -1, w = l.dragColId === e.id, T = l.isDragging && C !== -1 && l.dropIndex === C, E = l.isDragging && C !== -1 && C === c.length - 1 && l.dropIndex === c.length;
547
+ return /* @__PURE__ */ q("th", {
548
+ "data-col-id": S ? e.id : void 0,
549
+ onMouseDown: S ? (t) => l.onHeaderMouseDown(e.id, t) : void 0,
550
+ onClick: (e) => {
551
+ l.consumeDragSuppression() || x?.(e);
552
+ },
553
+ style: {
554
+ padding: i ? "0 6px 0 12px" : a ? "0 6px" : "0 10px",
555
+ textAlign: "left",
556
+ fontWeight: 600,
557
+ fontSize: 11,
558
+ letterSpacing: "0.01em",
559
+ color: "var(--text-3)",
560
+ whiteSpace: "nowrap",
561
+ cursor: t ? "pointer" : "default",
562
+ opacity: w ? .4 : 1,
563
+ boxShadow: T ? "inset 2px 0 0 0 var(--accent)" : E ? "inset -2px 0 0 0 var(--accent)" : void 0,
564
+ width: nn(tn(e.id)),
565
+ minWidth: nn(tn(e.id)),
566
+ borderBottom: "1px solid var(--border)",
567
+ background: "var(--surface-2)",
568
+ position: "sticky",
569
+ top: 0,
570
+ left: i ? 0 : "auto",
571
+ zIndex: i ? 3 : 2
572
+ },
573
+ children: [e.isPlaceholder ? null : t ? /* @__PURE__ */ q("span", {
574
+ style: {
575
+ display: "inline-flex",
576
+ alignItems: "center",
577
+ gap: 4
578
+ },
579
+ children: [
580
+ J(e.column.columnDef.header, e.getContext()),
581
+ /* @__PURE__ */ q("span", {
582
+ style: {
583
+ display: "inline-flex",
584
+ flexDirection: "column",
585
+ alignItems: "center",
586
+ lineHeight: 0
587
+ },
588
+ children: [n === "asc" ? /* @__PURE__ */ K(j.arrowUp, { size: 11 }) : n === "desc" ? /* @__PURE__ */ K(j.arrowDown, { size: 11 }) : /* @__PURE__ */ K(j.sort, {
589
+ size: 11,
590
+ style: { opacity: .35 }
591
+ }), n && d.get(e.id) === "first" ? /* @__PURE__ */ K("span", {
592
+ "aria-hidden": "true",
593
+ style: {
594
+ width: 4,
595
+ height: 4,
596
+ marginTop: 1,
597
+ borderRadius: 9999,
598
+ background: "var(--text-3)"
599
+ }
600
+ }) : null]
601
+ }),
602
+ s ? /* @__PURE__ */ K("span", {
603
+ "aria-label": b("list.sort.rank", "Sort rank {rank}", { rank: o }),
604
+ style: {
605
+ fontSize: 10,
606
+ lineHeight: 1,
607
+ color: "var(--text-3)",
608
+ verticalAlign: "super",
609
+ fontVariantNumeric: "tabular-nums"
610
+ },
611
+ children: o
612
+ }) : null,
613
+ /* @__PURE__ */ K(Ct, {
614
+ fallback: null,
615
+ children: /* @__PURE__ */ K(sn, {
616
+ field: e.id,
617
+ activeDir: n,
618
+ activeNulls: d.get(e.id),
619
+ inMultiSort: _,
620
+ canAppend: v,
621
+ onApply: (t, n) => p(e.id, t, n),
622
+ onAppend: (t, n) => m(e.id, t, n),
623
+ onClearColumn: () => h(e.id),
624
+ onClearAll: g
625
+ })
626
+ })
627
+ ]
628
+ }) : J(e.column.columnDef.header, e.getContext()), e.column.getCanResize() && /* @__PURE__ */ K("div", {
629
+ "data-testid": "col-resize-handle",
630
+ "aria-hidden": "true",
631
+ onMouseDown: (t) => {
632
+ t.stopPropagation(), e.getResizeHandler()(t);
633
+ },
634
+ onTouchStart: (t) => {
635
+ t.stopPropagation(), e.getResizeHandler()(t);
636
+ },
637
+ onClick: (e) => e.stopPropagation(),
638
+ style: {
639
+ position: "absolute",
640
+ top: 0,
641
+ right: 0,
642
+ height: "100%",
643
+ width: 9,
644
+ display: "flex",
645
+ justifyContent: "center",
646
+ cursor: "col-resize",
647
+ touchAction: "none",
648
+ userSelect: "none",
649
+ zIndex: 3
650
+ },
651
+ children: /* @__PURE__ */ K("span", { style: {
652
+ width: 2,
653
+ height: "60%",
654
+ alignSelf: "center",
655
+ borderRadius: 1,
656
+ background: e.column.getIsResizing() ? "var(--accent)" : "var(--border)"
657
+ } })
658
+ })]
659
+ }, e.id);
660
+ }), /* @__PURE__ */ K("th", {
661
+ "aria-hidden": "true",
662
+ style: {
663
+ borderBottom: "1px solid var(--border)",
664
+ background: "var(--surface-2)",
665
+ position: "sticky",
666
+ top: 0,
667
+ zIndex: 2
668
+ }
669
+ })]
670
+ }, e.id))
671
+ }), /* @__PURE__ */ K(cn, {
672
+ virtualItems: s.getVirtualItems(),
673
+ topPad: s.getVirtualItems()[0]?.start ?? 0,
674
+ bottomPad: s.getTotalSize() - (s.getVirtualItems().at(-1)?.end ?? 0),
675
+ colSpan: t.length + 1,
676
+ rows: n,
677
+ renderRow: _,
678
+ isResizing: !!v,
679
+ showsPreviousRows: y
680
+ })]
681
+ });
682
+ }
683
+ //#endregion
684
+ //#region src/components/pages/list/DataCell.tsx
685
+ function un({ cell: e }) {
686
+ let t = e.column.id === "_select", n = e.column.id === "_actions", r = e.column.columnDef.cell, i = typeof r == "function" ? r(e.getContext()) : r;
687
+ return /* @__PURE__ */ K("td", {
688
+ title: typeof i == "string" ? i : void 0,
689
+ style: {
690
+ padding: t ? "0 6px 0 12px" : n ? "0 6px" : "0 10px",
691
+ verticalAlign: "middle",
692
+ borderBottom: "1px solid var(--divider)",
693
+ width: nn(Z(e.column.id)),
694
+ whiteSpace: "nowrap",
695
+ overflow: "hidden",
696
+ textOverflow: "ellipsis",
697
+ maxWidth: nn(Z(e.column.id)),
698
+ color: "var(--text)",
699
+ position: t ? "sticky" : "static",
700
+ left: t ? 0 : "auto",
701
+ zIndex: +!!t
702
+ },
703
+ onClick: t || n ? (e) => e.stopPropagation() : void 0,
704
+ children: i
705
+ });
706
+ }
707
+ //#endregion
708
+ //#region src/components/pages/list/ListTableRow.tsx
709
+ function dn({ row: e, rowIndex: t, entity: n, hasSoftDelete: r, zebra: i, hasDetailTarget: a, interaction: o, measureElement: s }) {
710
+ let c = e.original, l = r && c[n.soft_delete] != null, u = e.getIsSelected(), d = i && t % 2 == 1;
711
+ return /* @__PURE__ */ q("tr", {
712
+ "data-index": t,
713
+ "data-row-stripe": d ? "" : void 0,
714
+ "aria-selected": u,
715
+ ref: (e) => s(e),
716
+ style: {
717
+ height: "var(--row-h)",
718
+ cursor: a || o.peekAllowed ? "pointer" : "default",
719
+ opacity: l ? .5 : 1,
720
+ fontStyle: l ? "italic" : "normal",
721
+ transition: "background-color 120ms"
722
+ },
723
+ onClick: a || o.peekAllowed ? (e) => o.onRowClick(e, c) : void 0,
724
+ onContextMenu: (e) => {
725
+ e.preventDefault(), o.setContextMenu({
726
+ x: e.clientX,
727
+ y: e.clientY,
728
+ row: c
729
+ });
730
+ },
731
+ ...o.longPress.handlers,
732
+ onPointerDown: (e) => {
733
+ o.pressedRow.current = c, o.longPress.handlers.onPointerDown(e);
734
+ },
735
+ children: [e.getVisibleCells().map((e) => /* @__PURE__ */ K(un, { cell: e }, e.id)), /* @__PURE__ */ K("td", {
736
+ "aria-hidden": "true",
737
+ style: { borderBottom: "1px solid var(--divider)" }
738
+ })]
739
+ }, e.id);
740
+ }
741
+ //#endregion
742
+ //#region src/components/pages/list/ListFooter.tsx
743
+ function fn({ meta: e, isCursor: t, isPhone: n, rowsLoaded: r, selectedCount: i, countTotal: a, countStrategy: o, countLoading: c, countError: l, page: u, totalPages: d, goToPage: f, perPage: p, setPerPage: m, hasMorePages: h, fetchNextPage: g, isFetchingNextPage: _ }) {
744
+ let v = Se("list"), y = A();
745
+ return !e && !t ? null : /* @__PURE__ */ q("div", {
746
+ style: {
747
+ display: "flex",
748
+ alignItems: "center",
749
+ paddingTop: 8,
750
+ paddingBottom: 8,
751
+ ...n ? Te(12) : {
752
+ paddingLeft: 14,
753
+ paddingRight: 14
754
+ },
755
+ background: "var(--surface-2)",
756
+ borderTop: "1px solid var(--border)",
757
+ fontSize: 11.5,
758
+ color: "var(--text-3)",
759
+ gap: 12,
760
+ flexWrap: "wrap"
761
+ },
762
+ children: [
763
+ v.isVisible("show_count") && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("span", {
764
+ className: "num",
765
+ "data-testid": "list-footer-count",
766
+ style: {
767
+ display: "inline-flex",
768
+ alignItems: "center",
769
+ gap: 5
770
+ },
771
+ children: a === void 0 ? c && !l ? /* @__PURE__ */ K("span", {
772
+ "data-testid": "list-footer-count-pending",
773
+ style: { display: "inline-flex" },
774
+ children: /* @__PURE__ */ K(he, { size: 11 })
775
+ }) : s(y, "list.footer.count", r, {
776
+ one: "{count} record",
777
+ other: "{count} records"
778
+ }) : s(y, "list.footer.count_of", a, {
779
+ one: "{loaded} of {total} record",
780
+ other: "{loaded} of {total} records"
781
+ }, {
782
+ loaded: r,
783
+ total: de(a, o ?? "exact", y.language)
784
+ })
785
+ }), /* @__PURE__ */ K("span", { children: "·" })] }),
786
+ /* @__PURE__ */ q("span", { children: [
787
+ y("list.footer.selected", "Selected:"),
788
+ " ",
789
+ /* @__PURE__ */ K("span", {
790
+ className: "num",
791
+ style: {
792
+ color: "var(--text-2)",
793
+ fontWeight: 500
794
+ },
795
+ children: i
796
+ })
797
+ ] }),
798
+ /* @__PURE__ */ K("div", { style: { flex: n ? "1 1 100%" : 1 } }),
799
+ !n && /* @__PURE__ */ K("span", { children: y("list.footer.rows_per_page", "Rows per page") }),
800
+ /* @__PURE__ */ K("select", {
801
+ "aria-label": y("list.footer.rows_per_page", "Rows per page"),
802
+ value: p,
803
+ onChange: (e) => m(parseInt(e.target.value, 10)),
804
+ style: {
805
+ fontSize: 11.5,
806
+ padding: "2px 4px",
807
+ background: "var(--surface)",
808
+ border: "1px solid var(--border)",
809
+ borderRadius: 4,
810
+ color: "var(--text-2)",
811
+ cursor: "pointer"
812
+ },
813
+ children: Ut.map((e) => /* @__PURE__ */ K("option", {
814
+ value: e,
815
+ children: e
816
+ }, e))
817
+ }),
818
+ t ? h && /* @__PURE__ */ q("button", {
819
+ type: "button",
820
+ className: "num",
821
+ "data-testid": "list-footer-load-more",
822
+ onClick: g,
823
+ disabled: _,
824
+ style: {
825
+ display: "inline-flex",
826
+ alignItems: "center",
827
+ gap: 6,
828
+ padding: "2px 10px",
829
+ background: "var(--surface)",
830
+ border: "1px solid var(--border)",
831
+ borderRadius: 4,
832
+ color: "var(--text-2)",
833
+ cursor: _ ? "default" : "pointer"
834
+ },
835
+ children: [_ ? /* @__PURE__ */ K(he, { size: 11 }) : null, y("list.footer.load_more", "Load more")]
836
+ }) : (h || u > 1) && /* @__PURE__ */ q("div", {
837
+ style: {
838
+ display: "flex",
839
+ alignItems: "center",
840
+ gap: 4
841
+ },
842
+ children: [
843
+ /* @__PURE__ */ K(M, {
844
+ size: 22,
845
+ icon: /* @__PURE__ */ K(j.left, { size: 12 }),
846
+ onClick: () => f(u - 1),
847
+ disabled: u <= 1
848
+ }),
849
+ /* @__PURE__ */ K("span", {
850
+ className: "num",
851
+ style: { padding: "0 6px" },
852
+ children: d === void 0 ? y("list.footer.page", "Page {page}", { page: u }) : y("list.footer.page_of", "Page {page} of {total}", {
853
+ page: u,
854
+ total: d
855
+ })
856
+ }),
857
+ /* @__PURE__ */ K(M, {
858
+ size: 22,
859
+ icon: /* @__PURE__ */ K(j.right, { size: 12 }),
860
+ onClick: () => f(u + 1),
861
+ disabled: d === void 0 ? !h : u >= d
862
+ })
863
+ ]
864
+ })
865
+ ]
866
+ });
867
+ }
868
+ //#endregion
869
+ //#region src/components/pages/ExportMenu.tsx
870
+ function pn(e) {
871
+ return !(e && e.enabled === !1);
872
+ }
873
+ function mn(e, t) {
874
+ return t == null ? e("export.scope.current_view_all", "Current view (CSV) · all matching rows") : s(e, "export.scope.current_view", t, {
875
+ one: "Current view (CSV) · {total} row",
876
+ other: "Current view (CSV) · {total} rows"
877
+ }, { total: t.toLocaleString(e.language) });
878
+ }
879
+ function hn(e) {
880
+ let t = A(), n = A("errors"), { isPhone: r } = te(), { entityCode: i, entity: a, screen: o, viewState: c, visibleColumns: l, selectedRowPKs: d, totalRows: f, pageRows: p, language: m, align: h = "end", variant: g = "toolbar", onBeforeOpen: v } = e, [y, b] = W(!1), [x, S] = W(!1), [C, w] = W(null), T = U(null), D = pn(a.export), ee = pn(o?.export);
881
+ if (!D || !ee) return null;
882
+ async function O(e) {
883
+ w(null), S(!0);
884
+ try {
885
+ let t = lt(c, {
886
+ scope: e,
887
+ visibleColumns: l,
888
+ selectedRowPKs: e === "selected_rows" ? d : void 0,
889
+ language: m
890
+ }), { blob: n, filename: r } = await _(i, t);
891
+ _n(n, r || `${i}-${gn()}.csv`), b(!1);
892
+ } catch (e) {
893
+ w({
894
+ code: e instanceof E ? e.code : "",
895
+ message: u(n, e)
896
+ });
897
+ } finally {
898
+ S(!1);
899
+ }
900
+ }
901
+ if (g === "selection-menu-item") {
902
+ let e = x || d.length === 0;
903
+ return /* @__PURE__ */ K(F, {
904
+ icon: /* @__PURE__ */ K(j.download, { size: 12 }),
905
+ "data-testid": "export-selection-menu-item",
906
+ onClick: e ? void 0 : () => {
907
+ v?.(), O("selected_rows");
908
+ },
909
+ children: x ? t("export.menu.exporting", "Exporting…") : t("export.menu.selection", "Export selection (CSV)")
910
+ });
911
+ }
912
+ let k = d.length > 0, M = a.list_pagination === "cursor";
913
+ return /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(N, {
914
+ ref: T,
915
+ kind: "ghost",
916
+ size: "sm",
917
+ icon: /* @__PURE__ */ K(j.download, { size: 12 }),
918
+ onClick: () => {
919
+ v?.(), b((e) => !e);
920
+ },
921
+ disabled: x,
922
+ "aria-label": t("export.menu.export", "Export"),
923
+ title: t("export.menu.export", "Export"),
924
+ children: r ? null : x ? t("export.menu.exporting", "Exporting…") : t("export.menu.export", "Export")
925
+ }), /* @__PURE__ */ q(fe, {
926
+ open: y,
927
+ anchor: T.current,
928
+ onClose: () => b(!1),
929
+ align: h,
930
+ width: 260,
931
+ children: [
932
+ /* @__PURE__ */ K(F, {
933
+ icon: /* @__PURE__ */ K(j.download, { size: 12 }),
934
+ onClick: x ? void 0 : () => void O("current_view"),
935
+ children: mn(t, f)
936
+ }),
937
+ k && /* @__PURE__ */ K(F, {
938
+ icon: /* @__PURE__ */ K(j.check, { size: 12 }),
939
+ onClick: x ? void 0 : () => void O("selected_rows"),
940
+ children: t("export.scope.selected_rows", "Selected rows (CSV) · {count}", { count: d.length })
941
+ }),
942
+ M ? /* @__PURE__ */ K(F, {
943
+ icon: /* @__PURE__ */ K(j.columns, { size: 12 }),
944
+ "data-testid": "export-current-page-disabled",
945
+ disabled: !0,
946
+ children: t("export.scope.current_page_unavailable_cursor", "Current page · n/a (infinite scroll)")
947
+ }) : /* @__PURE__ */ K(F, {
948
+ icon: /* @__PURE__ */ K(j.columns, { size: 12 }),
949
+ onClick: x ? void 0 : () => void O("current_page"),
950
+ children: p === void 0 ? t("export.scope.current_page_window", "Current page (CSV) · page window") : s(t, "export.scope.current_page", p, {
951
+ one: "Current page (CSV) · {count} row",
952
+ other: "Current page (CSV) · {count} rows"
953
+ })
954
+ }),
955
+ C && /* @__PURE__ */ K("div", {
956
+ role: "alert",
957
+ style: {
958
+ padding: "6px 10px",
959
+ marginTop: 4,
960
+ fontSize: 12,
961
+ color: "var(--destructive)",
962
+ borderTop: "1px solid var(--border)"
963
+ },
964
+ children: C.message
965
+ })
966
+ ]
967
+ })] });
968
+ }
969
+ function gn() {
970
+ let e = /* @__PURE__ */ new Date(), t = (e) => String(e).padStart(2, "0");
971
+ return `${e.getUTCFullYear()}${t(e.getUTCMonth() + 1)}${t(e.getUTCDate())}-${t(e.getUTCHours())}${t(e.getUTCMinutes())}`;
972
+ }
973
+ function _n(e, t) {
974
+ let n = URL.createObjectURL(e), r = document.createElement("a");
975
+ r.href = n, r.download = t, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), setTimeout(() => URL.revokeObjectURL(n), 0);
976
+ }
977
+ //#endregion
978
+ //#region src/components/pages/list/ListToolbar.tsx
979
+ function vn({ screen: e, entity: t, entityCode: n, schema: r, screenCode: i, screenName: a, isPhone: o, isCardsPresentation: s, sort: c, columns: l, views: u, query: d, selection: f, filters: p, searchValue: m, onSearchChange: h, onSaveView: g, onDeleteView: _, page: v, perPage: y, includeDeleted: b, canViewDeleted: x, onToggleDeleted: S, realtime: C, isLive: w }) {
980
+ let T = A(), E = D("view")?.actions, [ee, O] = W(!1), [k, te] = W(!1), [re, ie] = W(!1), ae = U(null), oe = U(null), se = be((e) => e.density), ce = () => {
981
+ let e = se === "compact" ? "comfortable" : se === "comfortable" ? "cozy" : "compact";
982
+ be.getState().setMany({ density: e });
983
+ }, de = !o || ee || m !== "", pe = (e) => {
984
+ if (e.startsWith("$status.")) {
985
+ let n = e.slice(8), r = t.status_groups?.[n];
986
+ return r ? T(r.name) || n : e;
987
+ }
988
+ if (e.startsWith("$property.")) {
989
+ let n = e.slice(10), r = t.properties?.[n];
990
+ return r ? T(r.name) || n : e;
991
+ }
992
+ return We(T, t, e, r?.entities);
993
+ }, me = (e.columns ?? []).filter((e) => on(e, t));
994
+ return /* @__PURE__ */ q("div", {
995
+ style: {
996
+ display: "flex",
997
+ alignItems: "center",
998
+ gap: o ? 6 : 8,
999
+ paddingTop: 0,
1000
+ paddingBottom: 10,
1001
+ ...o ? Te(12) : {
1002
+ paddingLeft: 20,
1003
+ paddingRight: 20
1004
+ },
1005
+ flexWrap: "wrap"
1006
+ },
1007
+ children: [
1008
+ /* @__PURE__ */ K(le, {
1009
+ views: u.all,
1010
+ activeViewId: u.activeId,
1011
+ isDirty: u.isDirty,
1012
+ onSelect: u.apply,
1013
+ onSaveAs: E?.__create ? g : void 0,
1014
+ onSave: E?.__update ? () => {
1015
+ u.overwriteActive().catch(() => void 0);
1016
+ } : void 0,
1017
+ onDiscard: u.discard,
1018
+ onDelete: E?.__delete ? _ : void 0,
1019
+ deletePending: u.isDeleting
1020
+ }),
1021
+ de ? /* @__PURE__ */ q("div", {
1022
+ style: {
1023
+ position: "relative",
1024
+ width: o ? "100%" : 260,
1025
+ order: o ? -1 : 0
1026
+ },
1027
+ children: [/* @__PURE__ */ K(ge, {
1028
+ value: m,
1029
+ onChange: h,
1030
+ placeholder: T("list.toolbar.search_placeholder", "Search {name}…", { name: a }),
1031
+ prefix: /* @__PURE__ */ K(j.search, { size: 13 })
1032
+ }), /* @__PURE__ */ K("span", {
1033
+ style: {
1034
+ position: "absolute",
1035
+ right: 6,
1036
+ top: "50%",
1037
+ transform: "translateY(-50%)",
1038
+ pointerEvents: "none"
1039
+ },
1040
+ children: /* @__PURE__ */ K(ne, { children: "/" })
1041
+ })]
1042
+ }) : /* @__PURE__ */ K(M, {
1043
+ icon: /* @__PURE__ */ K(j.search, { size: 14 }),
1044
+ title: T("list.toolbar.search", "Search {name}", { name: a }),
1045
+ onClick: () => O(!0)
1046
+ }),
1047
+ /* @__PURE__ */ q(N, {
1048
+ icon: /* @__PURE__ */ K(j.filter, { size: 13 }),
1049
+ onClick: p.onOpen,
1050
+ active: p.count > 0,
1051
+ children: [T("list.toolbar.filters", "Filters"), p.count > 0 && /* @__PURE__ */ K(P, {
1052
+ tone: "violet",
1053
+ size: "xs",
1054
+ style: { marginLeft: 4 },
1055
+ children: p.count
1056
+ })]
1057
+ }),
1058
+ s && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ q(N, {
1059
+ ref: ae,
1060
+ icon: /* @__PURE__ */ K(j.sort, { size: 13 }),
1061
+ onClick: () => te((e) => !e),
1062
+ active: k || c.cols.length > 0,
1063
+ children: [T("list.toolbar.sort", "Sort"), c.cols.length > 0 && /* @__PURE__ */ K(P, {
1064
+ tone: "slate",
1065
+ size: "xs",
1066
+ style: { marginLeft: 4 },
1067
+ children: c.cols.length
1068
+ })]
1069
+ }), /* @__PURE__ */ q(fe, {
1070
+ open: k,
1071
+ anchor: ae.current,
1072
+ onClose: () => te(!1),
1073
+ align: "start",
1074
+ width: 280,
1075
+ children: [
1076
+ /* @__PURE__ */ K("div", {
1077
+ style: {
1078
+ padding: "6px 8px 4px",
1079
+ fontSize: 10,
1080
+ color: "var(--text-3)",
1081
+ fontWeight: 700,
1082
+ letterSpacing: "0.08em",
1083
+ textTransform: "uppercase"
1084
+ },
1085
+ children: T("list.toolbar.sort_by", "Sort by")
1086
+ }),
1087
+ me.map((e) => {
1088
+ let t = c.cols.find((t) => t.field === e);
1089
+ return /* @__PURE__ */ K(F, {
1090
+ icon: t ? t.dir === "desc" ? /* @__PURE__ */ K(j.arrowDown, { size: 12 }) : /* @__PURE__ */ K(j.arrowUp, { size: 12 }) : /* @__PURE__ */ K("span", { style: {
1091
+ width: 12,
1092
+ display: "inline-block"
1093
+ } }),
1094
+ active: !!t,
1095
+ onClick: () => {
1096
+ c.applyColumn(e, t?.dir === "asc" ? "desc" : "asc", void 0), te(!1);
1097
+ },
1098
+ children: pe(e)
1099
+ }, e);
1100
+ }),
1101
+ c.cols.length > 0 && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(F, { divider: !0 }), /* @__PURE__ */ K(F, {
1102
+ icon: /* @__PURE__ */ K(j.x, { size: 12 }),
1103
+ onClick: () => {
1104
+ c.clearAll(), te(!1);
1105
+ },
1106
+ children: T("list.toolbar.clear_sort", "Clear sort")
1107
+ })] })
1108
+ ]
1109
+ })] }),
1110
+ !s && /* @__PURE__ */ K(ue, {
1111
+ availableColumns: e.columns ?? [],
1112
+ visibleColumns: l.visible,
1113
+ onToggle: (e) => {
1114
+ let t = l.visible.includes(e) ? l.visible.filter((t) => t !== e) : [...l.visible, e];
1115
+ l.apply(t);
1116
+ },
1117
+ onMove: l.move,
1118
+ onReset: l.clear,
1119
+ onShowAll: () => l.apply(e.columns ?? []),
1120
+ onResetWidths: l.resetWidths,
1121
+ columnLabel: pe
1122
+ }),
1123
+ !o && /* @__PURE__ */ K("span", { style: {
1124
+ width: 1,
1125
+ height: 20,
1126
+ background: "var(--divider)"
1127
+ } }),
1128
+ !o && /* @__PURE__ */ K(M, {
1129
+ icon: /* @__PURE__ */ K(j.grid, { size: 14 }),
1130
+ title: T("list.toolbar.density", "Density"),
1131
+ active: se !== "compact",
1132
+ onClick: ce
1133
+ }),
1134
+ /* @__PURE__ */ K(st, {
1135
+ liveObject: {
1136
+ refetch: d.retry,
1137
+ isLoading: d.isLoading,
1138
+ isLive: w
1139
+ },
1140
+ realtime: C
1141
+ }),
1142
+ !o && /* @__PURE__ */ K("div", { style: { flex: 1 } }),
1143
+ !o && x && /* @__PURE__ */ K(N, {
1144
+ kind: "ghost",
1145
+ size: "sm",
1146
+ icon: K(b ? j.eyeOff : j.eye, { size: 12 }),
1147
+ onClick: S,
1148
+ active: b,
1149
+ children: b ? T("list.toolbar.hide_deleted", "Hide deleted") : T("list.toolbar.show_deleted", "Show deleted")
1150
+ }),
1151
+ o && /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(M, {
1152
+ ref: oe,
1153
+ icon: /* @__PURE__ */ K(j.more, { size: 14 }),
1154
+ title: T("list.toolbar.more", "More"),
1155
+ active: re,
1156
+ onClick: () => ie((e) => !e)
1157
+ }), /* @__PURE__ */ q(fe, {
1158
+ open: re,
1159
+ anchor: oe.current,
1160
+ onClose: () => ie(!1),
1161
+ align: "end",
1162
+ width: 220,
1163
+ children: [/* @__PURE__ */ K(F, {
1164
+ icon: /* @__PURE__ */ K(j.grid, { size: 13 }),
1165
+ onClick: () => {
1166
+ ce(), ie(!1);
1167
+ },
1168
+ children: T("list.toolbar.density", "Density")
1169
+ }), x && /* @__PURE__ */ K(F, {
1170
+ icon: K(b ? j.eyeOff : j.eye, { size: 13 }),
1171
+ onClick: () => {
1172
+ S(), ie(!1);
1173
+ },
1174
+ children: b ? T("list.toolbar.hide_deleted", "Hide deleted") : T("list.toolbar.show_deleted", "Show deleted")
1175
+ })]
1176
+ })] }),
1177
+ n && t && /* @__PURE__ */ K(ft, {
1178
+ entityCode: n,
1179
+ scope: "list",
1180
+ selectedIds: f.ids,
1181
+ viewState: {
1182
+ screenCode: i,
1183
+ jsonFilters: p.json,
1184
+ search: p.debouncedSearch,
1185
+ sort: c.forRequest,
1186
+ includeDeleted: b || void 0,
1187
+ page: v,
1188
+ perPage: y
1189
+ },
1190
+ capability: t.documents,
1191
+ canManageTemplates: dt(r)
1192
+ }),
1193
+ n && t && /* @__PURE__ */ K(hn, {
1194
+ entityCode: n,
1195
+ entity: t,
1196
+ screen: e,
1197
+ viewState: {
1198
+ screenCode: i,
1199
+ jsonFilters: p.json,
1200
+ search: p.debouncedSearch,
1201
+ sort: c.forRequest,
1202
+ includeDeleted: b || void 0,
1203
+ page: v,
1204
+ perPage: y
1205
+ },
1206
+ visibleColumns: l.visible,
1207
+ selectedRowPKs: f.pkValues,
1208
+ totalRows: d.countTotal,
1209
+ pageRows: d.isLoading || d.isShowingPreviousRows ? void 0 : d.rows.length,
1210
+ language: T.language
1211
+ })
1212
+ ]
1213
+ });
1214
+ }
1215
+ //#endregion
1216
+ //#region src/components/pages/list/useListViews.ts
1217
+ function yn(e, t) {
1218
+ let n = k(t.id);
1219
+ n && e.setQueriesData({ queryKey: ["entity-data", "view"] }, (e) => {
1220
+ if (!e) return e;
1221
+ let r = e.data.findIndex((e) => k(e.id) === n);
1222
+ if (r === -1) return {
1223
+ ...e,
1224
+ data: [t, ...e.data]
1225
+ };
1226
+ let i = [...e.data];
1227
+ return i[r] = {
1228
+ ...i[r],
1229
+ ...t
1230
+ }, {
1231
+ ...e,
1232
+ data: i
1233
+ };
1234
+ });
1235
+ }
1236
+ function bn(e) {
1237
+ let t = new URLSearchParams(e);
1238
+ return t.delete("filters"), t.delete("columns"), t.delete("sort"), t;
1239
+ }
1240
+ function xn({ screenCode: e, screen: t, entity: n, searchParams: r, setSearchParams: i, userId: a, tenantId: o, all: s, activeId: c, active: l, clearedKey: u, filters: d, visibleColumns: p, sort: m }) {
1241
+ let h = A(), g = Et(), _ = Pe("view"), v = Fe("view"), y = Ie("view"), b = H(() => {
1242
+ if (!c || !l) return !1;
1243
+ let e = Bt(n, l, t), r = e.filters, i = l.columns?.length ? l.columns : t?.default_columns ?? t?.columns ?? [], a = e.sort ?? "";
1244
+ return !Qe(d, r) || p.join(",") !== i.join(",") || m !== a;
1245
+ }, [
1246
+ c,
1247
+ l,
1248
+ d,
1249
+ p,
1250
+ m,
1251
+ n,
1252
+ t
1253
+ ]), x = B((e) => {
1254
+ let n = new URLSearchParams(r), a = Lt(r);
1255
+ e.id ? a.set("view", e.id) : typeof window < "u" && window.sessionStorage?.setItem(u, "1"), i(a);
1256
+ let o = n.get("view"), c = o ? s.find((e) => e.id === o) : void 0, l = (c?.columns?.length ? c.columns : t?.default_columns ?? t?.columns ?? []).join(",");
1257
+ (n.get("columns") ?? l) !== l && f.info(h("list.view.applied_title", "View applied"), h("list.view.applied_body", "Your unsaved column changes were replaced."), { action: {
1258
+ label: h("list.view.undo", "Undo"),
1259
+ onClick: () => i(n)
1260
+ } });
1261
+ }, [
1262
+ h,
1263
+ r,
1264
+ i,
1265
+ u,
1266
+ s,
1267
+ t?.default_columns,
1268
+ t?.columns
1269
+ ]), S = B(() => {
1270
+ let e = bn(r);
1271
+ e.set("page", "1"), i(e);
1272
+ }, [r, i]), C = B(async () => {
1273
+ if (!l?.id || l.source !== "personal") return;
1274
+ let e = await v.mutateAsync({
1275
+ pkValues: l.id,
1276
+ data: {
1277
+ filters: d,
1278
+ columns: p,
1279
+ sort: m
1280
+ }
1281
+ });
1282
+ e?.data && yn(g, e.data), i(bn(r)), await g.invalidateQueries({ queryKey: ["entity-data", "view"] });
1283
+ }, [
1284
+ l,
1285
+ v,
1286
+ d,
1287
+ p,
1288
+ m,
1289
+ g,
1290
+ r,
1291
+ i
1292
+ ]);
1293
+ return {
1294
+ all: s,
1295
+ activeId: c,
1296
+ active: l,
1297
+ clearedKey: u,
1298
+ isDirty: b,
1299
+ apply: x,
1300
+ discard: S,
1301
+ saveAsNew: B(async (t) => {
1302
+ if (!a || !o) return;
1303
+ let n = await _.mutateAsync({
1304
+ tenant_id: o,
1305
+ screen_code: e,
1306
+ user_id: a,
1307
+ name: { en: t },
1308
+ filters: d,
1309
+ columns: p,
1310
+ sort: m,
1311
+ is_shared: !1,
1312
+ is_default: !1
1313
+ }), s = k(n.data.id);
1314
+ if (!s) return;
1315
+ yn(g, n.data);
1316
+ let c = bn(r);
1317
+ c.set("view", s), i(c), await g.invalidateQueries({ queryKey: ["entity-data", "view"] });
1318
+ }, [
1319
+ a,
1320
+ o,
1321
+ _,
1322
+ e,
1323
+ d,
1324
+ p,
1325
+ m,
1326
+ g,
1327
+ r,
1328
+ i
1329
+ ]),
1330
+ overwriteActive: C,
1331
+ deleteView: B(async (e) => {
1332
+ if (e.id && e.source === "personal") {
1333
+ if (await y.mutateAsync(e.id), e.id === c) {
1334
+ typeof window < "u" && window.sessionStorage?.setItem(u, "1");
1335
+ let e = new URLSearchParams(r);
1336
+ e.delete("view"), e.set("page", "1"), i(e, { replace: !0 });
1337
+ }
1338
+ await g.invalidateQueries({ queryKey: ["entity-data", "view"] });
1339
+ }
1340
+ }, [
1341
+ y,
1342
+ c,
1343
+ u,
1344
+ r,
1345
+ i,
1346
+ g
1347
+ ]),
1348
+ isSaving: _.isPending || v.isPending,
1349
+ isDeleting: y.isPending
1350
+ };
1351
+ }
1352
+ function Sn(e, t) {
1353
+ return t && t.source === "personal" ? e(t.name) : null;
1354
+ }
1355
+ //#endregion
1356
+ //#region src/components/pages/list/DeleteViewDialog.tsx
1357
+ function Cn({ view: e, onCancel: t, onConfirm: n }) {
1358
+ let r = A(), i = e ? r(e.name) : "";
1359
+ return /* @__PURE__ */ K(ce, {
1360
+ open: e !== null,
1361
+ onOpenChange: (e) => {
1362
+ e || t();
1363
+ },
1364
+ title: r("list.view.delete_title", "Delete this view?"),
1365
+ description: r("list.view.delete_body", "“{name}” and the filters saved in it are deleted permanently. This cannot be undone.", { name: i }),
1366
+ confirmLabel: r("list.view.delete_confirm", "Delete view"),
1367
+ destructive: !0,
1368
+ onConfirm: () => {
1369
+ e && n(e);
1370
+ }
1371
+ });
1372
+ }
1373
+ //#endregion
1374
+ //#region src/components/pages/list/ListUrlBanner.tsx
1375
+ var wn = {
1376
+ margin: "0 20px 10px",
1377
+ padding: "8px 10px",
1378
+ border: "1px solid var(--danger)",
1379
+ borderRadius: 6,
1380
+ color: "var(--danger)",
1381
+ fontSize: 12,
1382
+ display: "flex",
1383
+ alignItems: "center",
1384
+ gap: 8
1385
+ };
1386
+ function Tn({ filterError: e, unresolvedViewId: t, onClearFilters: n, onClearView: r }) {
1387
+ let i = A(), a = i("list.banner.clear", "Clear");
1388
+ return e ? /* @__PURE__ */ q("div", {
1389
+ role: "alert",
1390
+ "data-testid": "filter-url-error",
1391
+ style: wn,
1392
+ children: [/* @__PURE__ */ q("span", { children: [
1393
+ e,
1394
+ " ",
1395
+ i("list.filters.invalid_suffix", "Showing this list without URL filters.")
1396
+ ] }), /* @__PURE__ */ K(N, {
1397
+ kind: "ghost",
1398
+ size: "xs",
1399
+ onClick: n,
1400
+ children: a
1401
+ })]
1402
+ }) : t ? /* @__PURE__ */ q("div", {
1403
+ role: "alert",
1404
+ "data-testid": "view-url-unresolved",
1405
+ style: wn,
1406
+ children: [/* @__PURE__ */ K("span", { children: i("list.view.unresolved", "The view “{id}” could not be opened - it may have been deleted, or it belongs to someone else. Showing this list without it.", { id: t }) }), /* @__PURE__ */ K(N, {
1407
+ kind: "ghost",
1408
+ size: "xs",
1409
+ onClick: r,
1410
+ children: a
1411
+ })]
1412
+ }) : null;
1413
+ }
1414
+ //#endregion
1415
+ //#region src/components/pages/list/SaveViewDialog.tsx
1416
+ function En({ open: e, pending: t, onClose: n, onSave: r, overwriteViewName: i, onOverwrite: a }) {
1417
+ let o = A(), [s, c] = W(""), l = !!(i && a);
1418
+ if (V(() => {
1419
+ e && c("");
1420
+ }, [e]), !e) return null;
1421
+ let u = s.trim();
1422
+ return /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("div", {
1423
+ onClick: n,
1424
+ style: {
1425
+ position: "fixed",
1426
+ inset: 0,
1427
+ background: "var(--scrim)",
1428
+ zIndex: 70
1429
+ }
1430
+ }), /* @__PURE__ */ q("div", {
1431
+ role: "dialog",
1432
+ "aria-label": o("list.view.save_dialog_title", "Save view"),
1433
+ "aria-modal": "true",
1434
+ style: {
1435
+ position: "fixed",
1436
+ top: "50%",
1437
+ left: "50%",
1438
+ transform: "translate(-50%, -50%)",
1439
+ width: 360,
1440
+ maxWidth: "calc(100vw - 32px)",
1441
+ background: "var(--surface)",
1442
+ border: "1px solid var(--border)",
1443
+ borderRadius: 10,
1444
+ boxShadow: "var(--shadow-lg)",
1445
+ zIndex: 80,
1446
+ padding: 16,
1447
+ display: "flex",
1448
+ flexDirection: "column",
1449
+ gap: 12
1450
+ },
1451
+ children: [
1452
+ /* @__PURE__ */ q("div", { children: [/* @__PURE__ */ K("h3", {
1453
+ style: {
1454
+ margin: 0,
1455
+ fontSize: 14,
1456
+ color: "var(--text)"
1457
+ },
1458
+ children: o("list.view.save_dialog_title", "Save view")
1459
+ }), /* @__PURE__ */ K("p", {
1460
+ style: {
1461
+ margin: "4px 0 0",
1462
+ fontSize: 12,
1463
+ color: "var(--text-3)"
1464
+ },
1465
+ children: o("list.view.save_dialog_body", "Views save columns, order, filters, and sort. Widths stay personal to this device and are never part of a view.")
1466
+ })] }),
1467
+ /* @__PURE__ */ q("label", {
1468
+ style: {
1469
+ display: "flex",
1470
+ flexDirection: "column",
1471
+ gap: 4
1472
+ },
1473
+ children: [/* @__PURE__ */ K("span", {
1474
+ style: {
1475
+ fontSize: 11.5,
1476
+ color: "var(--text-3)",
1477
+ fontWeight: 500
1478
+ },
1479
+ children: o("list.view.name", "Name")
1480
+ }), /* @__PURE__ */ K(ge, {
1481
+ autoFocus: !0,
1482
+ "aria-label": o("list.view.name_input", "View name"),
1483
+ value: s,
1484
+ onChange: c,
1485
+ placeholder: o("list.view.name_placeholder", "My filtered view"),
1486
+ onKeyDown: (e) => {
1487
+ e.key === "Escape" && n(), e.key === "Enter" && u && !t && r(u);
1488
+ }
1489
+ })]
1490
+ }),
1491
+ /* @__PURE__ */ q("div", {
1492
+ style: {
1493
+ display: "flex",
1494
+ justifyContent: "flex-end",
1495
+ gap: 8
1496
+ },
1497
+ children: [
1498
+ /* @__PURE__ */ K(N, {
1499
+ onClick: n,
1500
+ disabled: t,
1501
+ children: o("dialog.cancel", "Cancel")
1502
+ }),
1503
+ l && /* @__PURE__ */ K(N, {
1504
+ onClick: () => void a(),
1505
+ disabled: t,
1506
+ children: o("list.view.overwrite", "Overwrite “{name}”", { name: i ?? "" })
1507
+ }),
1508
+ /* @__PURE__ */ K(N, {
1509
+ kind: "primary",
1510
+ onClick: () => void r(u),
1511
+ disabled: !u || t,
1512
+ children: o("list.view.save_as", "Save as new")
1513
+ })
1514
+ ]
1515
+ })
1516
+ ]
1517
+ })] });
1518
+ }
1519
+ //#endregion
1520
+ //#region src/components/pages/list/ListHeader.tsx
1521
+ function Dn({ title: e, description: n, toolbarActions: r, screenActionLayout: i, entityActionLayout: a, selectedIds: s, data: u, rowKey: d, onActionSuccess: f, widgetContext: p }) {
1522
+ let m = A(), h = A("errors"), { run: _ } = je(), { isPhone: v } = te(), y = Se("list"), b = y.isVisible("show_title"), x = y.isVisible("show_actions"), C = Ce(), w = H(() => {
1523
+ let e = {};
1524
+ for (let { code: t, action: n } of r) e[t] = n;
1525
+ return e;
1526
+ }, [r]), T = H(() => l((i ?? a) || S(w, "list_toolbar"), w, void 0, "list_toolbar"), [
1527
+ i,
1528
+ a,
1529
+ w
1530
+ ]), E = H(() => o(T, w, void 0, c, m("list.toolbar.select_rows_first", "Select one or more rows first")), [
1531
+ m,
1532
+ T,
1533
+ w
1534
+ ]), D = H(() => {
1535
+ if (s.length === 0) return [];
1536
+ let e = /* @__PURE__ */ new Map();
1537
+ for (let t of u) e.set(d(t), t);
1538
+ return s.map((t) => e.get(t)).filter((e) => e !== void 0);
1539
+ }, [
1540
+ s,
1541
+ u,
1542
+ d
1543
+ ]), ee = H(() => t(m, T, w, void 0, {}, D), [
1544
+ m,
1545
+ T,
1546
+ w,
1547
+ D
1548
+ ]), k = s.length > 0 ? ee : E, N = (e, t) => {
1549
+ let n = Ue(h, e, t, {});
1550
+ if (n === null) return;
1551
+ let r = m(t.display?.name) || e;
1552
+ return _({
1553
+ action: t,
1554
+ title: r,
1555
+ bulkSelection: D.length > 0 ? D : void 0,
1556
+ execute: async (e) => {
1557
+ let t = s.length > 0 ? s : void 0, r = await O(n, g(e, t));
1558
+ return t && t.length > 0 && f(), r;
1559
+ }
1560
+ });
1561
+ };
1562
+ return !b && !x ? null : /* @__PURE__ */ q("div", {
1563
+ style: {
1564
+ display: "flex",
1565
+ alignItems: "center",
1566
+ gap: 8,
1567
+ flexWrap: v ? "wrap" : "nowrap",
1568
+ paddingTop: v ? 12 : 16,
1569
+ paddingBottom: 10,
1570
+ ...v ? Te(12) : {
1571
+ paddingLeft: 20,
1572
+ paddingRight: 20
1573
+ }
1574
+ },
1575
+ children: [
1576
+ b && C.hasOriginBack && /* @__PURE__ */ K(M, {
1577
+ icon: /* @__PURE__ */ K(j.back, { size: 14 }),
1578
+ title: m("list.header.back", "Back"),
1579
+ onClick: C.goBack
1580
+ }),
1581
+ b && /* @__PURE__ */ K("div", {
1582
+ style: {
1583
+ flex: v ? "1 1 100%" : "1 1 auto",
1584
+ minWidth: 0
1585
+ },
1586
+ children: /* @__PURE__ */ q("div", {
1587
+ style: {
1588
+ display: "flex",
1589
+ alignItems: "baseline",
1590
+ gap: 10
1591
+ },
1592
+ children: [/* @__PURE__ */ K("h1", {
1593
+ style: {
1594
+ margin: 0,
1595
+ minWidth: 0,
1596
+ overflow: "hidden",
1597
+ textOverflow: "ellipsis",
1598
+ whiteSpace: "nowrap",
1599
+ fontSize: "var(--page-title-size, var(--page-title-size-list))",
1600
+ lineHeight: "var(--page-title-line-height, var(--page-title-line-height-list))",
1601
+ fontWeight: 600,
1602
+ letterSpacing: "-0.012em",
1603
+ color: "var(--text)"
1604
+ },
1605
+ children: e
1606
+ }), n && /* @__PURE__ */ K(xe, {
1607
+ label: n,
1608
+ "data-testid": "list-description-info"
1609
+ })]
1610
+ })
1611
+ }),
1612
+ x && k.length > 0 && /* @__PURE__ */ K(qe, {
1613
+ layout: k,
1614
+ kind: "toolbar",
1615
+ entityActions: w,
1616
+ onRun: N,
1617
+ widgetContext: p,
1618
+ ariaLabel: m("list.toolbar.actions", "List toolbar actions")
1619
+ })
1620
+ ]
1621
+ });
1622
+ }
1623
+ //#endregion
1624
+ //#region src/components/pages/list/ListFloatbar.tsx
1625
+ var On = "@keyframes floatbarIn{from{transform:translateX(-50%) translateY(8px);opacity:0}to{transform:translateX(-50%) translateY(0);opacity:1}}";
1626
+ function kn({ selectedIds: e, floatbarActions: n, screenActionLayout: r, entityActionLayout: i, data: a, rowKey: o, entityCode: c, entity: u, screen: d, onClear: f, onActionSuccess: p, widgetContext: m }) {
1627
+ let h = A(), _ = A("errors"), { run: v } = je(), y = H(() => {
1628
+ let e = {};
1629
+ for (let { code: t, action: r } of n) e[t] = r;
1630
+ return e;
1631
+ }, [n]), b = H(() => {
1632
+ if (e.length === 0) return [];
1633
+ let t = /* @__PURE__ */ new Map();
1634
+ for (let e of a) t.set(o(e), e);
1635
+ return e.map((e) => t.get(e)).filter((e) => e !== void 0);
1636
+ }, [
1637
+ e,
1638
+ a,
1639
+ o
1640
+ ]), x = H(() => {
1641
+ if (!u || !d || b.length === 0) return r;
1642
+ let e = b.map((e) => He(u, d, e));
1643
+ return e.some((t) => t !== e[0]) ? r : Ge(u, d, b[0])?.action_layout;
1644
+ }, [
1645
+ u,
1646
+ d,
1647
+ b,
1648
+ r
1649
+ ]), C = H(() => l((x ?? i) || S(y, "list_floatbar"), y, void 0, "list_floatbar"), [
1650
+ x,
1651
+ i,
1652
+ y
1653
+ ]), w = H(() => t(h, C, y, void 0, {}, b, Je(u, b)), [
1654
+ h,
1655
+ C,
1656
+ y,
1657
+ b,
1658
+ u
1659
+ ]);
1660
+ return w.length === 0 ? null : /* @__PURE__ */ q("div", {
1661
+ style: {
1662
+ position: "fixed",
1663
+ left: "50%",
1664
+ bottom: "calc(var(--tabbar-h) + var(--safe-area-bottom) + 14px)",
1665
+ transform: "translateX(-50%)",
1666
+ zIndex: 45,
1667
+ display: "flex",
1668
+ alignItems: "center",
1669
+ flexWrap: "wrap",
1670
+ gap: 8,
1671
+ padding: "6px 10px 6px 14px",
1672
+ maxWidth: "calc(100vw - var(--safe-area-left) - var(--safe-area-right) - 24px)",
1673
+ boxSizing: "border-box",
1674
+ background: "var(--text)",
1675
+ color: "var(--background)",
1676
+ borderRadius: 10,
1677
+ boxShadow: "var(--shadow-lg)",
1678
+ animation: "floatbarIn .15s ease-out"
1679
+ },
1680
+ children: [
1681
+ /* @__PURE__ */ K("style", { children: On }),
1682
+ /* @__PURE__ */ q("span", {
1683
+ style: {
1684
+ fontSize: 12.5,
1685
+ fontWeight: 600
1686
+ },
1687
+ children: [/* @__PURE__ */ K("span", {
1688
+ style: {
1689
+ padding: "1px 7px",
1690
+ borderRadius: 4,
1691
+ background: "var(--accent)",
1692
+ color: "var(--accent-foreground)",
1693
+ marginRight: 6,
1694
+ fontSize: 11.5
1695
+ },
1696
+ children: e.length
1697
+ }), s(h, "list.selection.selected", e.length, {
1698
+ one: "selected",
1699
+ other: "selected"
1700
+ })]
1701
+ }),
1702
+ /* @__PURE__ */ K(qe, {
1703
+ layout: w,
1704
+ kind: "toolbar",
1705
+ entityActions: y,
1706
+ rowSelection: b,
1707
+ onRun: (t, n) => {
1708
+ let r = Ue(_, t, n, {}, c);
1709
+ if (r !== null) return v({
1710
+ action: n,
1711
+ title: h(n.display?.name) || t,
1712
+ bulkSelection: b,
1713
+ entity: c,
1714
+ execute: async (t) => {
1715
+ let n = await O(r, g(t, e));
1716
+ return p(), n;
1717
+ }
1718
+ });
1719
+ },
1720
+ widgetContext: m,
1721
+ ariaLabel: h("list.selection.floatbar", "Floating action bar"),
1722
+ constrain: !1
1723
+ }),
1724
+ /* @__PURE__ */ K("button", {
1725
+ onClick: f,
1726
+ style: {
1727
+ background: "none",
1728
+ border: "none",
1729
+ color: "var(--background)",
1730
+ cursor: "pointer",
1731
+ opacity: .6,
1732
+ padding: "4px 6px",
1733
+ borderRadius: 6
1734
+ },
1735
+ title: h("list.selection.clear", "Clear selection"),
1736
+ children: /* @__PURE__ */ K(j.x, { size: 14 })
1737
+ })
1738
+ ]
1739
+ });
1740
+ }
1741
+ //#endregion
1742
+ //#region src/components/pages/list/useRowMenu.ts
1743
+ function An(e, t) {
1744
+ let n = (e) => e === "__peek" && !t.peek || e === "__open" && !t.open, r = [];
1745
+ for (let i of e) if (i.kind === "action") {
1746
+ if (n(i.code)) continue;
1747
+ r.push(i);
1748
+ } else {
1749
+ let e = An(i.items, t);
1750
+ e.length > 0 && r.push({
1751
+ ...i,
1752
+ items: e
1753
+ });
1754
+ }
1755
+ return r;
1756
+ }
1757
+ function jn(e, t) {
1758
+ for (let n of e) if (n.kind === "action") {
1759
+ if (n.code === t) return !0;
1760
+ } else if (jn(n.items, t)) return !0;
1761
+ return !1;
1762
+ }
1763
+ function Mn({ row: n, rowId: i, screen: a, fullScreen: o, entity: s, entityCode: c, rowActions: u, tabNavigate: f, peekAllowed: p, hasDetailTarget: m, onPeek: h }) {
1764
+ let _ = A(), v = A("errors"), { run: y } = je(), { data: b } = r(), x = o.detail_screen === void 0 && a.detail_screen !== void 0 ? {
1765
+ ...o,
1766
+ detail_screen: a.detail_screen
1767
+ } : o, C = Ge(s, x, n) ?? x, w = H(() => {
1768
+ let e = {}, t = C.row_actions === void 0 ? void 0 : new Set(C.row_actions);
1769
+ for (let { code: n, action: r } of u) (!t || t.has(n)) && (e[n] = r);
1770
+ return e;
1771
+ }, [u, C.row_actions]), T = H(() => ({
1772
+ entity: s,
1773
+ entityCode: c ?? "",
1774
+ screen: C,
1775
+ screenRoute: C.route,
1776
+ selectedRows: [],
1777
+ selectedIds: [],
1778
+ t: _,
1779
+ tabNavigate: (e, t) => f(e, {
1780
+ title: t?.title,
1781
+ icon: t?.icon,
1782
+ search: t?.search
1783
+ }),
1784
+ runActionApi: (e, t) => O(e, t),
1785
+ openPeek: (e) => h(e ?? n),
1786
+ recordHref: (t) => e(C, t, s, b?.screens)
1787
+ }), [
1788
+ s,
1789
+ c,
1790
+ C,
1791
+ _,
1792
+ f,
1793
+ h,
1794
+ n,
1795
+ b?.screens
1796
+ ]), E = H(() => {
1797
+ let e = C.action_layout ?? null, t = s.action_layout ?? null, n = e ?? t ?? S(w, "list_row");
1798
+ return l(n, w, void 0, "list_row");
1799
+ }, [
1800
+ C,
1801
+ s,
1802
+ w
1803
+ ]), D = H(() => An(t(_, E, w, void 0, n, [], Re(s, n)), {
1804
+ peek: p,
1805
+ open: m
1806
+ }), [
1807
+ _,
1808
+ E,
1809
+ w,
1810
+ n,
1811
+ s,
1812
+ p,
1813
+ m
1814
+ ]);
1815
+ return {
1816
+ layout: D,
1817
+ entityActions: w,
1818
+ runRowAction: B((e, t) => {
1819
+ let r = Ue(v, e, t, { row: n });
1820
+ if (r !== null) return y({
1821
+ action: t,
1822
+ title: _(t.display?.name) || e,
1823
+ row: n,
1824
+ execute: (e) => O(r, g(e, [i]))
1825
+ });
1826
+ }, [
1827
+ _,
1828
+ v,
1829
+ y,
1830
+ i,
1831
+ n
1832
+ ]),
1833
+ widgetContext: T,
1834
+ hasPeek: H(() => jn(D, d), [D])
1835
+ };
1836
+ }
1837
+ //#endregion
1838
+ //#region src/components/pages/list/RowActionsCell.tsx
1839
+ function Nn({ row: e, rowId: t, screen: n, fullScreen: r, entity: i, entityCode: a, rowActions: o, tabNavigate: s, peekAllowed: c, hasDetailTarget: l, onPeek: u }) {
1840
+ let d = A(), { layout: f, entityActions: p, runRowAction: m, widgetContext: h, hasPeek: g } = Mn({
1841
+ row: e,
1842
+ rowId: t,
1843
+ screen: n,
1844
+ fullScreen: r,
1845
+ entity: i,
1846
+ entityCode: a,
1847
+ rowActions: o,
1848
+ tabNavigate: s,
1849
+ peekAllowed: c,
1850
+ hasDetailTarget: l,
1851
+ onPeek: u
1852
+ });
1853
+ return /* @__PURE__ */ q("div", {
1854
+ className: "sl-row-actions",
1855
+ style: {
1856
+ display: "flex",
1857
+ alignItems: "center",
1858
+ gap: 2,
1859
+ justifyContent: "flex-end"
1860
+ },
1861
+ children: [g && /* @__PURE__ */ K(M, {
1862
+ size: 22,
1863
+ icon: /* @__PURE__ */ K(j.eye, { size: 12 }),
1864
+ onClick: (t) => {
1865
+ t.stopPropagation(), u(e);
1866
+ },
1867
+ title: d("list.row.peek", "Peek")
1868
+ }), f.length > 0 && /* @__PURE__ */ K(qe, {
1869
+ layout: f,
1870
+ row: e,
1871
+ kind: "row",
1872
+ entityActions: p,
1873
+ onRun: m,
1874
+ widgetContext: h,
1875
+ ariaLabel: d("list.row.actions", "Row actions")
1876
+ })]
1877
+ });
1878
+ }
1879
+ //#endregion
1880
+ //#region src/components/pages/list/columns.ts
1881
+ function Q(e, t, n, r, i) {
1882
+ let a = C(n, r);
1883
+ if (!a || a.read !== "denied") return i ? z("span", { title: i }, t) : t;
1884
+ let o = a.required_permission ? e("list.columns.locked_permission", "Locked column: requires \"{permission}\"", { permission: a.required_permission }) : e("list.columns.locked_classification", "Locked column: {classification} classification", { classification: a.classification });
1885
+ return z("span", {
1886
+ title: o,
1887
+ "aria-label": o,
1888
+ className: "inline-flex items-center gap-1"
1889
+ }, z(j.lock, { size: 12 }), t);
1890
+ }
1891
+ function $(e) {
1892
+ return {
1893
+ minSize: Math.min(60, e),
1894
+ maxSize: Math.max(L, e)
1895
+ };
1896
+ }
1897
+ function Pn(e) {
1898
+ let { visibleCols: t, entity: n, screen: r, schema: i, entityCode: a, rowActions: o, hasBatchActions: s, hasExplicitRowActions: c, canUpdate: l, canDelete: u, peekEnabled: d, hasDetailTarget: f, t: p, tabNavigate: m, refsRef: h, rowSelectionKey: g, setPeekRow: _ } = e;
1899
+ if (t.length === 0 || !n) return [];
1900
+ let v = [];
1901
+ s && v.push({
1902
+ id: "_select",
1903
+ enableResizing: !1,
1904
+ header: ({ table: e }) => z(I, {
1905
+ checked: e.getIsAllRowsSelected(),
1906
+ indeterminate: e.getIsSomeRowsSelected(),
1907
+ onChange: () => e.toggleAllRowsSelected()
1908
+ }),
1909
+ size: 34,
1910
+ cell: ({ row: e }) => z("span", { "data-testid": "row-select-checkbox" }, z(I, {
1911
+ checked: e.getIsSelected(),
1912
+ onChange: () => e.toggleSelected()
1913
+ }))
1914
+ });
1915
+ for (let e of t) {
1916
+ if (e.startsWith("$status.")) {
1917
+ let t = e.slice(8), r = n.status_groups?.[t];
1918
+ if (!r) continue;
1919
+ let i = new Map(r.statuses.map((e) => [e.code, e]));
1920
+ v.push({
1921
+ id: e,
1922
+ header: p(r.name) || t,
1923
+ size: 140,
1924
+ ...$(140),
1925
+ cell: ({ row: e }) => {
1926
+ let n = e.original.$statuses?.find((e) => e.group_code === t);
1927
+ if (!n) return z("span", { className: "text-sm text-muted-foreground" }, "-");
1928
+ let r = i.get(n.status_code);
1929
+ return z(P, {
1930
+ tone: r?.color ?? "slate",
1931
+ size: "xs"
1932
+ }, p(r?.name) || n.status_code);
1933
+ }
1934
+ });
1935
+ continue;
1936
+ }
1937
+ if (e.startsWith("$property.")) {
1938
+ let t = e.slice(10), r = n.properties?.[t];
1939
+ if (!r) continue;
1940
+ v.push({
1941
+ id: e,
1942
+ header: () => Q(p, p(r.name) || t, n, t, p(r.description) || void 0),
1943
+ size: 150,
1944
+ ...$(150),
1945
+ enableSorting: !1,
1946
+ cell: ({ row: e }) => {
1947
+ let n = e.original.$properties?.find((e) => e.property_code === t);
1948
+ return !n || n.value == null ? z("span", { className: "text-sm text-muted-foreground" }, "-") : z("span", { className: "text-sm" }, k(n.value));
1949
+ }
1950
+ });
1951
+ continue;
1952
+ }
1953
+ if (e === "$evidence") {
1954
+ v.push({
1955
+ id: e,
1956
+ header: p("list.columns.evidence", "Evidence"),
1957
+ size: 140,
1958
+ ...$(140),
1959
+ enableSorting: !1,
1960
+ cell: ({ row: e }) => {
1961
+ let t = e.original.$evidence?.verdict ?? "unverified";
1962
+ return z(P, {
1963
+ tone: ct(t),
1964
+ size: "xs",
1965
+ dot: !0
1966
+ }, ut(p, t));
1967
+ }
1968
+ });
1969
+ continue;
1970
+ }
1971
+ if (n.files?.get(e)) {
1972
+ v.push({
1973
+ id: e,
1974
+ accessorFn: (t) => t.$files?.[e] ?? null,
1975
+ header: () => Q(p, We(p, n, e, i?.entities), n, e),
1976
+ size: 150,
1977
+ ...$(150),
1978
+ cell: ({ row: t }) => Ke({
1979
+ entity: n,
1980
+ entityCode: a,
1981
+ fieldName: e,
1982
+ record: t.original,
1983
+ mode: "display",
1984
+ surface: "list",
1985
+ refs: h.current,
1986
+ t: p
1987
+ })
1988
+ });
1989
+ continue;
1990
+ }
1991
+ let t = n.fields.get(e);
1992
+ if (!t) continue;
1993
+ let r = w(p, t, e, i?.entities), o = t.display?.width, s = ye({
1994
+ field: t,
1995
+ fieldName: e,
1996
+ surface: "list",
1997
+ entity: n,
1998
+ entityCode: a,
1999
+ entities: i?.entities,
2000
+ screens: i?.screens,
2001
+ refs: () => h.current,
2002
+ t: p
2003
+ });
2004
+ v.push({
2005
+ id: e,
2006
+ accessorKey: e,
2007
+ header: () => Q(p, r, n, e, p(t.display?.description) || void 0),
2008
+ enableSorting: t.type !== "json" && y(n, e),
2009
+ size: o ?? 150,
2010
+ ...$(o ?? 150),
2011
+ cell: ({ getValue: e, row: t }) => s(e(), t.original)
2012
+ });
2013
+ }
2014
+ return (!c && l || !c && u || o.length > 0) && v.push({
2015
+ id: "_actions",
2016
+ enableResizing: !1,
2017
+ header: "",
2018
+ size: 40,
2019
+ cell: ({ row: e }) => z(Nn, {
2020
+ row: e.original,
2021
+ rowId: g(n, e.original),
2022
+ screen: r,
2023
+ fullScreen: r,
2024
+ entity: n,
2025
+ entityCode: a,
2026
+ rowActions: o,
2027
+ tabNavigate: m,
2028
+ peekAllowed: d,
2029
+ hasDetailTarget: f,
2030
+ onPeek: _
2031
+ })
2032
+ }), v;
2033
+ }
2034
+ //#endregion
2035
+ //#region src/components/pages/list/RowContextMenu.tsx
2036
+ function Fn({ x: e, y: t, row: n, rowId: r, screen: i, fullScreen: a, entity: o, entityCode: s, rowActions: c, tabNavigate: l, peekAllowed: u, hasDetailTarget: d, onPeek: f, onClose: p }) {
2037
+ let { layout: m, entityActions: h, runRowAction: g, widgetContext: _ } = Mn({
2038
+ row: n,
2039
+ rowId: r,
2040
+ screen: i,
2041
+ fullScreen: a,
2042
+ entity: o,
2043
+ entityCode: s,
2044
+ rowActions: c,
2045
+ tabNavigate: l,
2046
+ peekAllowed: u,
2047
+ hasDetailTarget: d,
2048
+ onPeek: f
2049
+ }), [v, y] = W(null), b = B((e, t) => (p(), g(e, t)), [p, g]);
2050
+ return m.length === 0 ? null : /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K("div", {
2051
+ onClick: p,
2052
+ onContextMenu: (e) => {
2053
+ e.preventDefault(), p();
2054
+ },
2055
+ style: {
2056
+ position: "fixed",
2057
+ inset: 0,
2058
+ zIndex: 190
2059
+ }
2060
+ }), /* @__PURE__ */ K(fe, {
2061
+ open: !0,
2062
+ anchor: null,
2063
+ anchorPoint: {
2064
+ x: e,
2065
+ y: t
2066
+ },
2067
+ onClose: p,
2068
+ width: 220,
2069
+ children: /* @__PURE__ */ K("div", {
2070
+ onClick: p,
2071
+ children: /* @__PURE__ */ K(ze, {
2072
+ layout: m,
2073
+ entityActions: h,
2074
+ onRun: b,
2075
+ loading: v,
2076
+ onLoadingChange: y,
2077
+ row: n,
2078
+ widgetContext: _
2079
+ })
2080
+ })
2081
+ })] });
2082
+ }
2083
+ //#endregion
2084
+ //#region src/components/pages/list/useHeaderReorder.ts
2085
+ var In = 5, Ln = 48, Rn = 18;
2086
+ function zn({ visibleCols: e, onReorder: t, scrollElRef: n, theadRef: r }) {
2087
+ let [i, a] = W(null), [o, s] = W(null), [c, l] = W(!1), u = U(null), d = U(!1), f = U(!1), p = U([]), m = U(null), h = U(0), g = U(null), _ = U(0), v = B(() => {
2088
+ g.current !== null && (cancelAnimationFrame(g.current), g.current = null);
2089
+ }, []), y = B(() => {
2090
+ u.current = null, d.current = !1, p.current = [], m.current = null, v(), a(null), s(null), l(!1);
2091
+ }, [v]), b = B((e) => {
2092
+ let t = p.current, r = e + ((n.current?.scrollLeft ?? 0) - _.current);
2093
+ for (let e = 0; e < t.length; e++) if (r < (t[e].left + t[e].right) / 2) return e;
2094
+ return t.length;
2095
+ }, [n]), x = B(() => {
2096
+ let e = n.current;
2097
+ if (!d.current || !e) {
2098
+ g.current = null;
2099
+ return;
2100
+ }
2101
+ let t = e.getBoundingClientRect(), r = h.current, i = 0;
2102
+ if (r < t.left + Ln ? i = -Math.ceil((t.left + Ln - r) / Ln * Rn) : r > t.right - Ln && (i = Math.ceil((r - (t.right - Ln)) / Ln * Rn)), i !== 0) {
2103
+ e.scrollLeft += i;
2104
+ let t = b(h.current);
2105
+ m.current = t, s(t);
2106
+ }
2107
+ g.current = requestAnimationFrame(x);
2108
+ }, [n, b]), S = B((e, t) => {
2109
+ t.button === 0 && (u.current = {
2110
+ colId: e,
2111
+ x: t.clientX
2112
+ }, d.current = !1, f.current = !1);
2113
+ }, []), C = B(() => f.current ? (f.current = !1, !0) : !1, []);
2114
+ return V(() => {
2115
+ let i = (t) => {
2116
+ let i = u.current;
2117
+ if (!i) return;
2118
+ if (h.current = t.clientX, !d.current) {
2119
+ if (Math.abs(t.clientX - i.x) < In) return;
2120
+ let o = r.current, s = [];
2121
+ if (o) for (let t of e) {
2122
+ let e = o.querySelector(`[data-col-id="${CSS.escape(t)}"]`);
2123
+ if (e) {
2124
+ let n = e.getBoundingClientRect();
2125
+ s.push({
2126
+ id: t,
2127
+ left: n.left,
2128
+ right: n.right
2129
+ });
2130
+ }
2131
+ }
2132
+ p.current = s, _.current = n.current?.scrollLeft ?? 0, d.current = !0, f.current = !0, a(i.colId), l(!0), g.current === null && (g.current = requestAnimationFrame(x));
2133
+ }
2134
+ let o = b(t.clientX);
2135
+ m.current = o, s(o);
2136
+ }, o = (n) => {
2137
+ let r = u.current;
2138
+ if (r && d.current && n) {
2139
+ let n = e.indexOf(r.colId), i = m.current ?? n;
2140
+ if (n !== -1) {
2141
+ let a = e.filter((e, t) => t !== n);
2142
+ i > n && --i, i = Math.max(0, Math.min(i, a.length));
2143
+ let o = [
2144
+ ...a.slice(0, i),
2145
+ r.colId,
2146
+ ...a.slice(i)
2147
+ ];
2148
+ o.some((t, n) => t !== e[n]) && t(o);
2149
+ }
2150
+ }
2151
+ y();
2152
+ }, c = () => o(!0), v = (e) => {
2153
+ e.key === "Escape" && d.current && o(!1);
2154
+ };
2155
+ return window.addEventListener("mousemove", i), window.addEventListener("mouseup", c), window.addEventListener("keydown", v), () => {
2156
+ window.removeEventListener("mousemove", i), window.removeEventListener("mouseup", c), window.removeEventListener("keydown", v);
2157
+ };
2158
+ }, [
2159
+ e,
2160
+ t,
2161
+ r,
2162
+ n,
2163
+ b,
2164
+ x,
2165
+ y
2166
+ ]), V(() => y, [y]), {
2167
+ dragColId: i,
2168
+ dropIndex: o,
2169
+ isDragging: c,
2170
+ onHeaderMouseDown: S,
2171
+ consumeDragSuppression: C
2172
+ };
2173
+ }
2174
+ //#endregion
2175
+ //#region src/components/pages/SmartListPage.impl.tsx
2176
+ var Bn = wt(() => import("./ListCardsBody-BAwFR3yO.js").then((e) => ({ default: e.ListCardsBody })));
2177
+ function Vn({ screenCode: e }) {
2178
+ return /* @__PURE__ */ K(ve, { children: /* @__PURE__ */ K(Un, { screenCode: e }) });
2179
+ }
2180
+ var Hn = [];
2181
+ function Un({ screenCode: t }) {
2182
+ let o = A(), s = A("errors"), c = we(), [l, u] = Dt(), { data: d } = r(), [f, m] = W(!1), [h, g] = W(!1), [_, v] = W(null), y = i((e) => e.user), b = i((e) => e.activeTenant), S = _e(), C = d?.screens[t], w = C?.entity ? d?.entities[C.entity] : void 0, E = C?.entity, D = x(w, "create"), ee = x(w, "update"), j = x(w, "delete"), M = d?.actions, N = H(() => n(a(w?.actions, C?.actions, "list_toolbar", M), w), [
2183
+ w,
2184
+ C?.actions,
2185
+ M
2186
+ ]), P = H(() => n(a(w?.actions, void 0, "list_floatbar", M), w), [w, M]), ne = H(() => {
2187
+ let e = /* @__PURE__ */ new Map(), t = (t) => {
2188
+ for (let n of a(w?.actions, t, "list_row", M)) e.set(n.code, n);
2189
+ };
2190
+ t(C?.row_actions);
2191
+ for (let e of C?.variants?.items() ?? []) e.row_actions !== void 0 && t(e.row_actions);
2192
+ return n([...e.values()], w);
2193
+ }, [
2194
+ w,
2195
+ C,
2196
+ M
2197
+ ]), ie = C?.row_actions !== void 0, ae = H(() => P.length > 0 || w?.export?.enabled !== !1 && C?.export?.enabled !== !1, [
2198
+ P,
2199
+ w?.export?.enabled,
2200
+ C?.export?.enabled
2201
+ ]), se = !!w?.soft_delete, ce = se && (y?.permissions ?? []).some((e) => e === "feature:view_deleted" || e === "feature:*" || e === "*"), le = ce && l.get("include_deleted") === "true", ue = p(), { openTab: de, updateTabSearch: fe, findTabByPathname: F } = me();
2202
+ nt(C, w, l.toString()), Ze(C?.route);
2203
+ let he = B((e) => {
2204
+ if (!C?.route || !w || ue.enabled) return;
2205
+ let t = F(C.route);
2206
+ t ? fe(t.id, e) : de({
2207
+ pathname: C.route,
2208
+ search: e,
2209
+ title: o(C.display?.name) || o(w.display.name_plural),
2210
+ icon: C.display?.icon || w.display.icon,
2211
+ closable: !0
2212
+ });
2213
+ }, [
2214
+ o,
2215
+ C,
2216
+ w,
2217
+ ue.enabled,
2218
+ F,
2219
+ fe,
2220
+ de
2221
+ ]), ge = parseInt(l.get("page") ?? "1", 10), ve = (() => {
2222
+ let e = parseInt(l.get("per_page") ?? "", 10);
2223
+ return !Number.isFinite(e) || e <= 0 || e > 1e3 ? 200 : e;
2224
+ })(), xe = l.get("search") ?? "", Se = H(() => {
2225
+ let e = et(l);
2226
+ return e.error === null ? null : s(e.errorCode ?? "", e.error);
2227
+ }, [s, l]), I = Vt({
2228
+ screenCode: t,
2229
+ screen: C,
2230
+ entity: w,
2231
+ searchParams: l,
2232
+ setSearchParams: u,
2233
+ userId: y?.id,
2234
+ tenantId: b?.id,
2235
+ filterError: !!Se
2236
+ }), { filters: Ce, columns: Te, sort: Ee } = I.defaults, { filters: De, setFilters: Oe, clearFilters: ke } = oe({ defaults: Ce }), { visibleFilterState: Ae, filterFieldMeta: je, allFilterFieldMeta: Me, filterFieldName: Pe } = xt(C, w, d?.entities, De), L = Ae.filters, Ie = it(L), Le = B(() => Oe(Hn), [Oe]), Re = Wt({
2237
+ searchParams: l,
2238
+ setSearchParams: u,
2239
+ defaultSort: Ee,
2240
+ commitScreenTabSearch: he
2241
+ }), { cols: ze, nullsByField: He, value: Ue, forRequest: We, tableSorting: Ke, write: qe, applyColumn: Je, shiftClickColumn: Qe, appendColumn: st, clearColumn: ct, clearAll: lt } = Re, ut = Yt({
2242
+ screenCode: t,
2243
+ screen: C,
2244
+ searchParams: l,
2245
+ setSearchParams: u,
2246
+ defaultColumns: Te
2247
+ }), { visible: R, sizing: dt, setSizing: ft, apply: gt, commitResize: z } = ut, wt = xn({
2248
+ screenCode: t,
2249
+ screen: C,
2250
+ entity: w,
2251
+ searchParams: l,
2252
+ setSearchParams: u,
2253
+ userId: y?.id,
2254
+ tenantId: b?.id,
2255
+ all: I.all,
2256
+ activeId: I.activeId,
2257
+ active: I.active,
2258
+ clearedKey: I.clearedKey,
2259
+ filters: De,
2260
+ visibleColumns: R,
2261
+ sort: Ue
2262
+ }), { active: Tt, saveAsNew: Et, overwriteActive: Ot, isSaving: kt } = wt, At = pe(xe, 300), J = te(), Y = H(() => {
2263
+ let e = C?.responsive?.[J.category]?.presentation;
2264
+ return e === "table" || e === "cards" ? e : J.category === "phone" ? "cards" : "table";
2265
+ }, [C?.responsive, J.category]), jt = H(() => _t({
2266
+ entity: w,
2267
+ screen: C,
2268
+ savedViewColumns: Tt?.columns
2269
+ }), [
2270
+ w,
2271
+ C,
2272
+ Tt?.columns
2273
+ ]), Mt = H(() => ht({
2274
+ entity: w,
2275
+ screen: C,
2276
+ presentation: Y,
2277
+ visibleColumns: R,
2278
+ card: jt,
2279
+ rowActions: ne,
2280
+ toolbarActions: N,
2281
+ bulkActions: P,
2282
+ sort: ze,
2283
+ screens: d?.screens
2284
+ }), [
2285
+ w,
2286
+ C,
2287
+ Y,
2288
+ R,
2289
+ jt,
2290
+ ne,
2291
+ N,
2292
+ P,
2293
+ ze,
2294
+ d?.screens
2295
+ ]), Ft = yt({
2296
+ entity: w,
2297
+ entityCode: E,
2298
+ screen: C,
2299
+ screenCode: t,
2300
+ page: ge,
2301
+ perPage: ve,
2302
+ sortForRequest: We,
2303
+ debouncedSearch: At,
2304
+ filters: L,
2305
+ isHeld: I.isHeld,
2306
+ retryHeld: I.retryViews,
2307
+ includeDeleted: le,
2308
+ expand: Mt.expandFields,
2309
+ select: Mt.selectFields,
2310
+ runCountQuery: !0,
2311
+ urlKey: `${E ?? ""}|${l.toString()}`
2312
+ }), { rows: X, meta: It, refs: Lt, isLoading: Rt, isFetching: zt, isShowingPreviousRows: Bt, isError: Ut, error: Gt, isLoadingStale: qt, retry: Xt, countTotal: Zt, countStrategy: Qt, countLoading: $t, countError: tn, totalPages: Z, hasMorePages: nn, isCursor: an, fetchNextPage: on, isFetchingNextPage: sn } = Ft, cn = Jt(w, X, zt), { state: un, setState: pn, ids: mn, pkValues: hn, rows: gn, keyOf: _n } = cn, yn = Ne(w?.realtime, E ?? ""), bn = Fe(E ?? ""), wn = U(Lt);
2313
+ wn.current = Lt;
2314
+ let On = H(() => {
2315
+ let e = /* @__PURE__ */ new Map();
2316
+ if (!w) return e;
2317
+ for (let t of mt(w, C, Tt?.columns)) {
2318
+ if (t.startsWith("$") || w.files?.get(t)) continue;
2319
+ let n = w.fields.get(t);
2320
+ n && e.set(t, ye({
2321
+ field: n,
2322
+ fieldName: t,
2323
+ surface: "list",
2324
+ entity: w,
2325
+ entityCode: E,
2326
+ entities: d?.entities,
2327
+ screens: d?.screens,
2328
+ refs: () => wn.current,
2329
+ t: o
2330
+ }));
2331
+ }
2332
+ return e;
2333
+ }, [
2334
+ w,
2335
+ E,
2336
+ C,
2337
+ Tt?.columns,
2338
+ d?.entities,
2339
+ d?.screens,
2340
+ wn,
2341
+ o
2342
+ ]), { labelFor: An, refs: jn } = St(Me, L, Lt, d?.entities), Mn = en({
2343
+ entity: w,
2344
+ screen: C,
2345
+ screens: d?.screens,
2346
+ entities: d?.entities,
2347
+ searchParams: l,
2348
+ tabNavigate: c,
2349
+ commitScreenTabSearch: he,
2350
+ isPhone: J.category === "phone",
2351
+ canUpdate: ee
2352
+ }), { peekAllowed: Nn, peekRow: Q, setPeekRow: $, peekFields: In, peekActions: Ln, peekExecute: Rn, contextMenu: Vn, setContextMenu: Un } = Mn, Wn = H(() => !C || !w ? !1 : e(C, "_", w, d?.screens) !== null, [
2353
+ C,
2354
+ w,
2355
+ d?.screens
2356
+ ]), Gn = H(() => Pn({
2357
+ visibleCols: R,
2358
+ entity: w,
2359
+ screen: C,
2360
+ schema: d,
2361
+ entityCode: E,
2362
+ rowActions: ne,
2363
+ hasBatchActions: ae,
2364
+ hasExplicitRowActions: ie,
2365
+ canUpdate: ee,
2366
+ canDelete: j,
2367
+ peekEnabled: Nn,
2368
+ hasDetailTarget: Wn,
2369
+ t: o,
2370
+ tabNavigate: c,
2371
+ refsRef: wn,
2372
+ rowSelectionKey: Kt,
2373
+ setPeekRow: $
2374
+ }), [
2375
+ C,
2376
+ w,
2377
+ R,
2378
+ c,
2379
+ ae,
2380
+ ne,
2381
+ ie,
2382
+ E,
2383
+ Nn,
2384
+ Wn,
2385
+ d,
2386
+ o,
2387
+ ee,
2388
+ j,
2389
+ wn,
2390
+ $
2391
+ ]), Kn = Nt({
2392
+ features: Ht,
2393
+ data: X,
2394
+ columns: Gn,
2395
+ manualSorting: !0,
2396
+ enableColumnResizing: !0,
2397
+ columnResizeMode: "onChange",
2398
+ onColumnSizingChange: ft,
2399
+ state: {
2400
+ sorting: Ke,
2401
+ rowSelection: un,
2402
+ columnSizing: dt
2403
+ },
2404
+ onSortingChange: (e) => {
2405
+ let t = (typeof e == "function" ? e(Ke) : e).slice(0, 5);
2406
+ if (t.length === 0) {
2407
+ qe([]);
2408
+ return;
2409
+ }
2410
+ let n = t.map((e) => {
2411
+ let t = He.get(e.id);
2412
+ return {
2413
+ field: e.id,
2414
+ dir: e.desc ? "desc" : "asc",
2415
+ ...t ? { nulls: t } : {}
2416
+ };
2417
+ });
2418
+ qe(n);
2419
+ },
2420
+ onRowSelectionChange: pn,
2421
+ getRowId: _n
2422
+ }), qn = Kn.state.columnResizing.isResizingColumn, Jn = U(!1);
2423
+ V(() => {
2424
+ let e = !!Jn.current && !qn;
2425
+ Jn.current = qn, e && z(Kn.state.columnSizing);
2426
+ }, [
2427
+ qn,
2428
+ z,
2429
+ Kn
2430
+ ]);
2431
+ let Yn = rn(Kn), Xn = Kn.getTotalSize();
2432
+ V(() => {
2433
+ let e = (e) => {
2434
+ let t = e.target?.tagName;
2435
+ t === "INPUT" || t === "TEXTAREA" || t === "SELECT" ? e.key === "Escape" && (e.target.blur(), m(!1)) : (e.key === "/" && !e.metaKey && !e.ctrlKey && (e.preventDefault(), document.querySelector("[placeholder*=\"Search\"]")?.focus()), e.key === "f" && !e.metaKey && !e.ctrlKey && (e.preventDefault(), m((e) => !e)), e.key === "Escape" && m(!1));
2436
+ };
2437
+ return document.addEventListener("keydown", e), () => document.removeEventListener("keydown", e);
2438
+ }, []);
2439
+ let Zn = U(null), { rows: Qn } = Kn.getRowModel(), $n = U(null), er = zn({
2440
+ visibleCols: R,
2441
+ onReorder: gt,
2442
+ scrollElRef: Zn,
2443
+ theadRef: $n
2444
+ }), tr = be((e) => e.density), nr = be((e) => e.zebra), rr = ot(), ir = Pt({
2445
+ count: Qn.length,
2446
+ getScrollElement: () => Zn.current,
2447
+ estimateSize: () => Y === "cards" ? 142 : 48,
2448
+ overscan: 10,
2449
+ initialOffset: rr
2450
+ }), ar = H(() => Qn.map((e) => e.id), [Qn]);
2451
+ at({
2452
+ virtualizer: ir,
2453
+ scrollElementRef: Zn,
2454
+ rowKeys: ar
2455
+ }), V(() => {
2456
+ ir.measure();
2457
+ }, [tr, ir]), V(() => {
2458
+ ir.measure();
2459
+ }, [
2460
+ J.width,
2461
+ J.height,
2462
+ Y,
2463
+ ir
2464
+ ]);
2465
+ let or = B((e) => {
2466
+ u((t) => {
2467
+ let n = new URLSearchParams(t);
2468
+ return e ? n.set("search", e) : n.delete("search"), n.set("page", "1"), n;
2469
+ });
2470
+ }, [u]), sr = B(() => {
2471
+ u((e) => {
2472
+ let t = new URLSearchParams(e);
2473
+ return t.get("include_deleted") ? t.delete("include_deleted") : t.set("include_deleted", "true"), t.set("page", "1"), t;
2474
+ });
2475
+ }, [u]), cr = B((e) => {
2476
+ u((t) => {
2477
+ let n = new URLSearchParams(t);
2478
+ return n.set("page", String(e)), n;
2479
+ });
2480
+ }, [u]);
2481
+ V(() => {
2482
+ Z !== void 0 && ge > Z && cr(Z);
2483
+ }, [
2484
+ Z,
2485
+ ge,
2486
+ cr
2487
+ ]);
2488
+ let lr = B((e) => {
2489
+ u((t) => {
2490
+ let n = new URLSearchParams(t);
2491
+ return n.set("per_page", String(e)), n.set("page", "1"), n;
2492
+ });
2493
+ }, [u]);
2494
+ if (!C || !w) return null;
2495
+ let ur = w.display, dr = o(C.display?.name) || o(ur.name), fr = C.display?.icon || ur.icon, pr = o(C.display?.description) || o(ur.description), mr = J.category === "phone", hr = Y === "cards", gr = hn.map((e) => T(w, e)), _r = {
2496
+ entity: w,
2497
+ entityCode: E ?? "",
2498
+ screen: C,
2499
+ screenRoute: C.route,
2500
+ selectedRows: gn,
2501
+ selectedIds: gr,
2502
+ t: o,
2503
+ tabNavigate: (e, t) => c(e, {
2504
+ title: t?.title,
2505
+ icon: t?.icon,
2506
+ search: t?.search
2507
+ }),
2508
+ runActionApi: (e, t) => O(e, t)
2509
+ };
2510
+ return /* @__PURE__ */ q("div", {
2511
+ style: {
2512
+ display: "flex",
2513
+ flexDirection: "column",
2514
+ height: "100%",
2515
+ background: "var(--background)"
2516
+ },
2517
+ children: [
2518
+ /* @__PURE__ */ q(G, { children: [
2519
+ /* @__PURE__ */ K(Dn, {
2520
+ title: dr,
2521
+ description: pr,
2522
+ toolbarActions: N,
2523
+ screenActionLayout: C.action_layout,
2524
+ entityActionLayout: w.action_layout,
2525
+ selectedIds: mn,
2526
+ data: X,
2527
+ rowKey: _n,
2528
+ onActionSuccess: () => pn({}),
2529
+ widgetContext: _r
2530
+ }),
2531
+ /* @__PURE__ */ K(vn, {
2532
+ screen: C,
2533
+ entity: w,
2534
+ entityCode: E,
2535
+ schema: d,
2536
+ screenCode: t,
2537
+ screenName: dr,
2538
+ isPhone: mr,
2539
+ isCardsPresentation: hr,
2540
+ sort: Re,
2541
+ columns: ut,
2542
+ views: wt,
2543
+ query: Ft,
2544
+ selection: cn,
2545
+ filters: {
2546
+ json: L,
2547
+ debouncedSearch: At,
2548
+ count: Ie,
2549
+ onOpen: () => m(!0)
2550
+ },
2551
+ searchValue: xe,
2552
+ onSearchChange: or,
2553
+ onSaveView: () => g(!0),
2554
+ onDeleteView: v,
2555
+ page: ge,
2556
+ perPage: ve,
2557
+ includeDeleted: le,
2558
+ canViewDeleted: ce,
2559
+ onToggleDeleted: sr,
2560
+ realtime: w?.realtime === !0,
2561
+ isLive: yn
2562
+ }),
2563
+ /* @__PURE__ */ K(Tn, {
2564
+ filterError: Se,
2565
+ unresolvedViewId: I.isUnresolved ? I.activeId : null,
2566
+ onClearFilters: ke,
2567
+ onClearView: I.clearActiveView
2568
+ }),
2569
+ Ae.omitted && /* @__PURE__ */ K(vt, { className: "px-5 pb-2.5" }),
2570
+ L.length > 0 && /* @__PURE__ */ K("div", {
2571
+ style: { padding: "0 20px 10px" },
2572
+ children: /* @__PURE__ */ K(rt, {
2573
+ filters: L,
2574
+ resolveValue: An,
2575
+ onRemoveAtPath: (e) => Oe($e(L, e)),
2576
+ onClearAll: Le,
2577
+ onChipClick: () => m(!0),
2578
+ fieldLabel: Pe
2579
+ })
2580
+ })
2581
+ ] }),
2582
+ /* @__PURE__ */ K(bt, {
2583
+ isLoading: Rt,
2584
+ tableLoadingStale: qt,
2585
+ isError: Ut,
2586
+ error: Gt,
2587
+ rowCount: X.length,
2588
+ entity: w,
2589
+ screen: C,
2590
+ screenName: dr,
2591
+ screenIcon: fr,
2592
+ isFiltered: !!At || Ie > 0,
2593
+ canCreate: D,
2594
+ toolbarActions: N,
2595
+ onRetry: Xt
2596
+ }),
2597
+ Rt || Ut || X.length === 0 ? null : /* @__PURE__ */ K("div", {
2598
+ style: {
2599
+ flex: 1,
2600
+ minHeight: 0,
2601
+ padding: "0 20px 16px",
2602
+ display: "flex",
2603
+ flexDirection: "column"
2604
+ },
2605
+ children: /* @__PURE__ */ q("div", {
2606
+ style: {
2607
+ background: "var(--surface)",
2608
+ border: "1px solid var(--border)",
2609
+ borderRadius: 8,
2610
+ overflow: "hidden",
2611
+ boxShadow: "var(--shadow-xs)",
2612
+ display: "flex",
2613
+ flexDirection: "column",
2614
+ flex: 1,
2615
+ minHeight: 0
2616
+ },
2617
+ children: [/* @__PURE__ */ K("div", {
2618
+ ref: Zn,
2619
+ "data-testid": "list-scroll",
2620
+ "data-presentation": Y,
2621
+ style: {
2622
+ overflow: "auto",
2623
+ flex: 1,
2624
+ minHeight: 0
2625
+ },
2626
+ children: Y === "cards" ? /* @__PURE__ */ K(Ct, {
2627
+ fallback: null,
2628
+ children: /* @__PURE__ */ K(Bn, {
2629
+ rows: Qn,
2630
+ virtualizer: ir,
2631
+ entity: w,
2632
+ screen: C,
2633
+ entityCode: E,
2634
+ entities: d?.entities,
2635
+ savedViewColumns: Tt?.columns,
2636
+ refs: wn.current,
2637
+ renderers: On,
2638
+ rowActions: ne,
2639
+ tabNavigate: c,
2640
+ interaction: Mn,
2641
+ hasSoftDelete: se,
2642
+ zebra: nr,
2643
+ hasBatchActions: ae,
2644
+ hasDetailTarget: Wn,
2645
+ rowKey: _n
2646
+ })
2647
+ }) : /* @__PURE__ */ K(ln, {
2648
+ showsPreviousRows: Bt,
2649
+ table: Kn,
2650
+ columns: Gn,
2651
+ rows: Qn,
2652
+ entity: w,
2653
+ columnSizeVars: Yn,
2654
+ totalColumnsWidth: Xn,
2655
+ theadRef: $n,
2656
+ virtualizer: ir,
2657
+ visibleCols: R,
2658
+ headerReorder: er,
2659
+ sortCols: ze,
2660
+ sortNullsMap: He,
2661
+ shiftClickColumn: Qe,
2662
+ applyColumnSort: Je,
2663
+ appendColumnSort: st,
2664
+ clearColumnSort: ct,
2665
+ clearAllSorts: lt,
2666
+ renderRow: (e, t) => /* @__PURE__ */ K(dn, {
2667
+ row: e,
2668
+ rowIndex: t,
2669
+ entity: w,
2670
+ hasSoftDelete: se,
2671
+ zebra: nr,
2672
+ hasDetailTarget: Wn,
2673
+ interaction: Mn,
2674
+ measureElement: ir.measureElement
2675
+ }, e.id),
2676
+ isResizingColumn: qn
2677
+ })
2678
+ }), /* @__PURE__ */ K(fn, {
2679
+ meta: It,
2680
+ isCursor: an,
2681
+ isPhone: mr,
2682
+ rowsLoaded: X.length,
2683
+ selectedCount: mn.length,
2684
+ countTotal: Zt,
2685
+ countStrategy: Qt,
2686
+ countLoading: $t,
2687
+ countError: tn,
2688
+ page: ge,
2689
+ totalPages: Z,
2690
+ goToPage: cr,
2691
+ perPage: ve,
2692
+ setPerPage: lr,
2693
+ hasMorePages: nn,
2694
+ fetchNextPage: on,
2695
+ isFetchingNextPage: sn
2696
+ })]
2697
+ })
2698
+ }),
2699
+ /* @__PURE__ */ K(tt, {
2700
+ open: f,
2701
+ onClose: () => m(!1),
2702
+ filters: L,
2703
+ onApply: Oe,
2704
+ availableFields: je,
2705
+ allFields: Me,
2706
+ fieldLabel: Pe,
2707
+ resolveValue: An,
2708
+ defaultFilters: C?.default_filters,
2709
+ refs: jn
2710
+ }),
2711
+ /* @__PURE__ */ K(Cn, {
2712
+ view: _,
2713
+ onCancel: () => v(null),
2714
+ onConfirm: (e) => {
2715
+ wt.deleteView(e).catch(() => void 0).finally(() => v(null));
2716
+ }
2717
+ }),
2718
+ /* @__PURE__ */ K(En, {
2719
+ open: h,
2720
+ pending: kt,
2721
+ onClose: () => g(!1),
2722
+ overwriteViewName: Sn(o, Tt),
2723
+ onOverwrite: async () => {
2724
+ await Ot(), g(!1);
2725
+ },
2726
+ onSave: async (e) => {
2727
+ await Et(e), g(!1);
2728
+ }
2729
+ }),
2730
+ mn.length > 0 && /* @__PURE__ */ K(kn, {
2731
+ selectedIds: mn,
2732
+ floatbarActions: P,
2733
+ screenActionLayout: C.action_layout,
2734
+ entityActionLayout: w.action_layout,
2735
+ data: X,
2736
+ rowKey: _n,
2737
+ entityCode: E,
2738
+ entity: w,
2739
+ screen: C,
2740
+ onClear: () => pn({}),
2741
+ onActionSuccess: () => pn({}),
2742
+ widgetContext: _r
2743
+ }),
2744
+ Vn && w && C && /* @__PURE__ */ K(Fn, {
2745
+ x: Vn.x,
2746
+ y: Vn.y,
2747
+ row: Vn.row,
2748
+ rowId: _n(Vn.row),
2749
+ screen: C,
2750
+ fullScreen: C,
2751
+ entity: w,
2752
+ entityCode: E,
2753
+ rowActions: ne,
2754
+ tabNavigate: c,
2755
+ peekAllowed: Nn,
2756
+ hasDetailTarget: Wn,
2757
+ onPeek: $,
2758
+ onClose: () => Un(null)
2759
+ }),
2760
+ Nn && Q && w && /* @__PURE__ */ K(re, {
2761
+ entity: w,
2762
+ entityCode: E,
2763
+ record: Q,
2764
+ title: (() => {
2765
+ let e = C.columns?.find((e) => !e.startsWith("$status.") && !e.startsWith("$property."));
2766
+ return e ? k(Q[e] ?? o(w.display.name)) : o(w.display.name);
2767
+ })(),
2768
+ recordId: (() => {
2769
+ let e = w.fields.names()?.find((e) => w.fields.get(e)?.primary);
2770
+ return e ? k(Q[e]) : void 0;
2771
+ })(),
2772
+ fields: In,
2773
+ screen: Ge(w, C, Q),
2774
+ actions: Ln,
2775
+ screenActionLayout: Ge(w, C, Q)?.action_layout,
2776
+ entityActionLayout: w.action_layout,
2777
+ executeAction: Rn,
2778
+ onClose: () => {
2779
+ if (w && Q) {
2780
+ let e = w.fields.names()?.find((e) => w.fields.get(e)?.primary);
2781
+ e && pt(k(Q[e]));
2782
+ }
2783
+ $(null);
2784
+ },
2785
+ onOpen: (e) => {
2786
+ let t = Q;
2787
+ $(null), Mn.navigateToDetail(t, { draft: e });
2788
+ },
2789
+ onSave: (e) => {
2790
+ $(e);
2791
+ let t = w.fields.names()?.find((e) => w.fields.get(e)?.primary);
2792
+ if (!t) return;
2793
+ let n = k(e[t]), r = {};
2794
+ for (let t of w.fields.names()) {
2795
+ let n = Be(w, e, t), i = Be(w, Q, t), a = Ve(w, t, n), o = Ve(w, t, i);
2796
+ (a === "" ? null : a) !== (o === "" || o === void 0 ? null : o) && (r[t] = a);
2797
+ }
2798
+ let i = Xe({
2799
+ entity: w,
2800
+ formData: e,
2801
+ record: Q,
2802
+ isNew: !1
2803
+ });
2804
+ if (Object.keys(i).length > 0 && (r.$files = i), Object.keys(r).length === 0) return;
2805
+ let a = Ye(i);
2806
+ bn.mutate({
2807
+ pkValues: n,
2808
+ data: r
2809
+ }, { onSuccess: () => {
2810
+ a.forEach((e) => S.markCommitted(e));
2811
+ } });
2812
+ }
2813
+ })
2814
+ ]
2815
+ });
2816
+ }
2817
+ //#endregion
2818
+ export { Vn as SmartListPage, Nn as t };