nexus-shared 1.1.21 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/CHANGELOG.md +262 -0
  2. package/LICENSE +21 -0
  3. package/README.md +1000 -0
  4. package/dist/Client.Index.d.ts +55 -0
  5. package/dist/Client.Index.js +60 -0
  6. package/dist/Components/Chats/Chat.d.ts +28 -0
  7. package/dist/Components/Chats/Chat.js +19 -0
  8. package/dist/Components/Chats/ChatButton.d.ts +26 -0
  9. package/dist/Components/Chats/ChatButton.js +41 -0
  10. package/dist/Components/Chats/ChatComposer.d.ts +41 -0
  11. package/dist/Components/Chats/ChatComposer.js +177 -0
  12. package/dist/Components/Chats/ChatConversations.d.ts +35 -0
  13. package/dist/Components/Chats/ChatConversations.js +38 -0
  14. package/dist/Components/Chats/ChatPanel.d.ts +66 -0
  15. package/dist/Components/Chats/ChatPanel.js +94 -0
  16. package/dist/Components/Chats/ChatParts.d.ts +87 -0
  17. package/dist/Components/Chats/ChatParts.js +100 -0
  18. package/dist/Components/Chats/ChatThread.d.ts +22 -0
  19. package/dist/Components/Chats/ChatThread.js +96 -0
  20. package/dist/Components/Documents/Button.d.ts +29 -0
  21. package/dist/Components/Documents/Button.js +11 -0
  22. package/dist/Components/Documents/Menu.d.ts +102 -0
  23. package/dist/Components/Documents/Menu.js +242 -0
  24. package/dist/Components/Documents/SplitButton.d.ts +64 -0
  25. package/dist/Components/Documents/SplitButton.js +129 -0
  26. package/dist/Components/Documents/TabButtons.d.ts +80 -0
  27. package/dist/Components/Documents/TabButtons.js +38 -0
  28. package/dist/Components/Forms/ApiForm.d.ts +23 -0
  29. package/dist/Components/Forms/ApiForm.js +100 -0
  30. package/dist/Components/Forms/Crud.d.ts +17 -0
  31. package/dist/Components/Forms/Crud.js +708 -0
  32. package/dist/Components/Forms/CrudParts.d.ts +15 -0
  33. package/dist/Components/Forms/CrudParts.js +36 -0
  34. package/dist/Components/Forms/ExcelImport.d.ts +42 -0
  35. package/dist/Components/Forms/ExcelImport.js +190 -0
  36. package/dist/Components/Forms/Form.d.ts +52 -0
  37. package/dist/Components/Forms/Form.js +323 -0
  38. package/dist/Components/Forms/SubmitForm.d.ts +65 -0
  39. package/dist/Components/Forms/SubmitForm.js +198 -0
  40. package/dist/Components/Inputs/Calendar.d.ts +69 -0
  41. package/dist/Components/Inputs/Calendar.js +258 -0
  42. package/dist/Components/Inputs/CheckBox.d.ts +53 -0
  43. package/dist/Components/Inputs/CheckBox.js +87 -0
  44. package/dist/Components/Inputs/CheckBoxGroup.d.ts +20 -0
  45. package/dist/Components/Inputs/CheckBoxGroup.js +80 -0
  46. package/dist/Components/Inputs/ChoiceField.d.ts +122 -0
  47. package/dist/Components/Inputs/ChoiceField.js +169 -0
  48. package/dist/Components/Inputs/DatePicker.d.ts +54 -0
  49. package/dist/Components/Inputs/DatePicker.js +246 -0
  50. package/dist/Components/Inputs/DateRangePicker.d.ts +62 -0
  51. package/dist/Components/Inputs/DateRangePicker.js +283 -0
  52. package/dist/Components/Inputs/DateTimePicker.d.ts +75 -0
  53. package/dist/Components/Inputs/DateTimePicker.js +400 -0
  54. package/dist/Components/Inputs/Dropdown.d.ts +117 -0
  55. package/dist/Components/Inputs/Dropdown.js +839 -0
  56. package/dist/Components/Inputs/DropdownParts.d.ts +84 -0
  57. package/dist/Components/Inputs/DropdownParts.js +102 -0
  58. package/dist/Components/Inputs/EditorShell.d.ts +45 -0
  59. package/dist/Components/Inputs/EditorShell.js +214 -0
  60. package/dist/Components/Inputs/Field.d.ts +53 -0
  61. package/dist/Components/Inputs/Field.js +16 -0
  62. package/dist/Components/Inputs/GroupForm.d.ts +20 -0
  63. package/dist/Components/Inputs/GroupForm.js +172 -0
  64. package/dist/Components/Inputs/InputField.d.ts +59 -0
  65. package/dist/Components/Inputs/InputField.js +169 -0
  66. package/dist/Components/Inputs/InputRenderer.d.ts +37 -0
  67. package/dist/Components/Inputs/InputRenderer.js +99 -0
  68. package/dist/Components/Inputs/MarkdownEditor.d.ts +67 -0
  69. package/dist/Components/Inputs/MarkdownEditor.js +289 -0
  70. package/dist/Components/Inputs/NumberBox.d.ts +53 -0
  71. package/dist/Components/Inputs/NumberBox.js +228 -0
  72. package/dist/Components/Inputs/RadioGroup.d.ts +20 -0
  73. package/dist/Components/Inputs/RadioGroup.js +43 -0
  74. package/dist/Components/Inputs/ReadOnlyNotice.d.ts +36 -0
  75. package/dist/Components/Inputs/ReadOnlyNotice.js +117 -0
  76. package/dist/Components/Inputs/RichTextEditor.d.ts +103 -0
  77. package/dist/Components/Inputs/RichTextEditor.js +1170 -0
  78. package/dist/Components/Inputs/RichTextParts.d.ts +63 -0
  79. package/dist/Components/Inputs/RichTextParts.js +157 -0
  80. package/dist/Components/Inputs/RowsInput.d.ts +115 -0
  81. package/dist/Components/Inputs/RowsInput.js +308 -0
  82. package/dist/Components/Inputs/Slider.d.ts +87 -0
  83. package/dist/Components/Inputs/Slider.js +216 -0
  84. package/dist/Components/Inputs/TabularForm.d.ts +27 -0
  85. package/dist/Components/Inputs/TabularForm.js +348 -0
  86. package/dist/Components/Inputs/TextArea.d.ts +43 -0
  87. package/dist/Components/Inputs/TextArea.js +31 -0
  88. package/dist/Components/Inputs/TextBox.d.ts +52 -0
  89. package/dist/Components/Inputs/TextBox.js +58 -0
  90. package/dist/Components/Inputs/TextField.d.ts +31 -0
  91. package/dist/Components/Inputs/TextField.js +35 -0
  92. package/dist/Components/Inputs/TimePanel.d.ts +34 -0
  93. package/dist/Components/Inputs/TimePanel.js +288 -0
  94. package/dist/Components/Inputs/TimePicker.d.ts +54 -0
  95. package/dist/Components/Inputs/TimePicker.js +240 -0
  96. package/dist/Components/Inputs/TreeView.d.ts +160 -0
  97. package/dist/Components/Inputs/TreeView.js +947 -0
  98. package/dist/Components/Layouts/MessageBox.d.ts +71 -0
  99. package/dist/Components/Layouts/MessageBox.js +104 -0
  100. package/dist/Components/Layouts/Popup.d.ts +92 -0
  101. package/dist/Components/Layouts/Popup.js +376 -0
  102. package/dist/Components/Layouts/PopupContext.d.ts +2 -0
  103. package/dist/Components/Layouts/PopupContext.js +4 -0
  104. package/dist/Components/Layouts/PopupDock.d.ts +22 -0
  105. package/dist/Components/Layouts/PopupDock.js +121 -0
  106. package/dist/Components/Layouts/PopupHost.d.ts +56 -0
  107. package/dist/Components/Layouts/PopupHost.js +163 -0
  108. package/dist/Components/Layouts/PopupRules.d.ts +30 -0
  109. package/dist/Components/Layouts/PopupRules.js +63 -0
  110. package/dist/Components/Layouts/ThemePicker.d.ts +13 -0
  111. package/dist/Components/Layouts/ThemePicker.js +22 -0
  112. package/dist/Components/Layouts/ThemeScript.d.ts +14 -0
  113. package/dist/Components/Layouts/ThemeScript.js +13 -0
  114. package/dist/Components/Layouts/ThemeSwitcher.d.ts +13 -0
  115. package/dist/Components/Layouts/ThemeSwitcher.js +49 -0
  116. package/dist/Components/Layouts/Toaster.d.ts +76 -0
  117. package/dist/Components/Layouts/Toaster.js +172 -0
  118. package/dist/Components/Viewers/DataTable.d.ts +25 -0
  119. package/dist/Components/Viewers/DataTable.js +596 -0
  120. package/dist/Components/Viewers/DataTableColumns.d.ts +28 -0
  121. package/dist/Components/Viewers/DataTableColumns.js +243 -0
  122. package/dist/Components/Viewers/DataTableParts.d.ts +138 -0
  123. package/dist/Components/Viewers/DataTableParts.js +157 -0
  124. package/dist/Components/Viewers/MarkdownView.d.ts +26 -0
  125. package/dist/Components/Viewers/MarkdownView.js +79 -0
  126. package/dist/Components/Viewers/RichTextView.d.ts +18 -0
  127. package/dist/Components/Viewers/RichTextView.js +17 -0
  128. package/dist/Helpers/AnimationHelpers.d.ts +6 -0
  129. package/dist/Helpers/AnimationHelpers.js +35 -0
  130. package/dist/Helpers/ApiClient.d.ts +96 -0
  131. package/dist/Helpers/ApiClient.js +200 -0
  132. package/dist/Helpers/ApiFormHelpers.d.ts +49 -0
  133. package/dist/Helpers/ApiFormHelpers.js +120 -0
  134. package/dist/Helpers/ApiModules.d.ts +131 -0
  135. package/dist/Helpers/ApiModules.js +195 -0
  136. package/dist/Helpers/ApiResponses.d.ts +51 -0
  137. package/dist/Helpers/ApiResponses.js +250 -0
  138. package/dist/Helpers/ApiRoutes.d.ts +140 -0
  139. package/dist/Helpers/ApiRoutes.js +183 -0
  140. package/dist/Helpers/ApiToasts.d.ts +21 -0
  141. package/dist/Helpers/ApiToasts.js +22 -0
  142. package/dist/Helpers/ChatBackend.d.ts +134 -0
  143. package/dist/Helpers/ChatBackend.js +332 -0
  144. package/dist/Helpers/ChatHelpers.d.ts +189 -0
  145. package/dist/Helpers/ChatHelpers.js +486 -0
  146. package/dist/Helpers/ChatHooks.d.ts +81 -0
  147. package/dist/Helpers/ChatHooks.js +175 -0
  148. package/dist/Helpers/ChatStore.d.ts +132 -0
  149. package/dist/Helpers/ChatStore.js +394 -0
  150. package/dist/Helpers/ChatSummaries.d.ts +39 -0
  151. package/dist/Helpers/ChatSummaries.js +118 -0
  152. package/dist/Helpers/ClassHelpers.d.ts +3 -0
  153. package/dist/Helpers/ClassHelpers.js +4 -0
  154. package/dist/Helpers/CrudBackend.d.ts +98 -0
  155. package/dist/Helpers/CrudBackend.js +214 -0
  156. package/dist/Helpers/CrudHelpers.d.ts +111 -0
  157. package/dist/Helpers/CrudHelpers.js +267 -0
  158. package/dist/Helpers/DateHelpers.d.ts +88 -0
  159. package/dist/Helpers/DateHelpers.js +363 -0
  160. package/dist/Helpers/DatePreferences.d.ts +14 -0
  161. package/dist/Helpers/DatePreferences.js +94 -0
  162. package/dist/Helpers/DateTimeHelpers.d.ts +87 -0
  163. package/dist/Helpers/DateTimeHelpers.js +286 -0
  164. package/dist/Helpers/DragHelpers.d.ts +129 -0
  165. package/dist/Helpers/DragHelpers.js +281 -0
  166. package/dist/Helpers/DropdownHelpers.d.ts +56 -0
  167. package/dist/Helpers/DropdownHelpers.js +180 -0
  168. package/dist/Helpers/ExcelBackend.d.ts +106 -0
  169. package/dist/Helpers/ExcelBackend.js +290 -0
  170. package/dist/Helpers/ExcelHelpers.d.ts +98 -0
  171. package/dist/Helpers/ExcelHelpers.js +302 -0
  172. package/dist/Helpers/FormDrafts.d.ts +18 -0
  173. package/dist/Helpers/FormDrafts.js +76 -0
  174. package/dist/Helpers/FormStore.d.ts +233 -0
  175. package/dist/Helpers/FormStore.js +752 -0
  176. package/dist/Helpers/InputParamsHelpers.d.ts +79 -0
  177. package/dist/Helpers/InputParamsHelpers.js +388 -0
  178. package/dist/Helpers/MarkdownEditing.d.ts +27 -0
  179. package/dist/Helpers/MarkdownEditing.js +250 -0
  180. package/dist/Helpers/MarkdownHelpers.d.ts +82 -0
  181. package/dist/Helpers/MarkdownHelpers.js +775 -0
  182. package/dist/Helpers/MessageBuilder.d.ts +74 -0
  183. package/dist/Helpers/MessageBuilder.js +252 -0
  184. package/dist/Helpers/NepaliCalendar.d.ts +25 -0
  185. package/dist/Helpers/NepaliCalendar.js +107 -0
  186. package/dist/Helpers/NumberHelpers.d.ts +71 -0
  187. package/dist/Helpers/NumberHelpers.js +202 -0
  188. package/dist/Helpers/Permissions.d.ts +62 -0
  189. package/dist/Helpers/Permissions.js +133 -0
  190. package/dist/Helpers/PopoverHelpers.d.ts +68 -0
  191. package/dist/Helpers/PopoverHelpers.js +195 -0
  192. package/dist/Helpers/RichTextHelpers.d.ts +77 -0
  193. package/dist/Helpers/RichTextHelpers.js +1072 -0
  194. package/dist/Helpers/RowsStore.d.ts +166 -0
  195. package/dist/Helpers/RowsStore.js +606 -0
  196. package/dist/Helpers/TableColumns.d.ts +47 -0
  197. package/dist/Helpers/TableColumns.js +282 -0
  198. package/dist/Helpers/TableExport.d.ts +30 -0
  199. package/dist/Helpers/TableExport.js +97 -0
  200. package/dist/Helpers/TableHelpers.d.ts +110 -0
  201. package/dist/Helpers/TableHelpers.js +301 -0
  202. package/dist/Helpers/TableStore.d.ts +142 -0
  203. package/dist/Helpers/TableStore.js +530 -0
  204. package/dist/Helpers/ThemeHelpers.d.ts +15 -0
  205. package/dist/Helpers/ThemeHelpers.js +16 -0
  206. package/dist/Helpers/TimeHelpers.d.ts +73 -0
  207. package/dist/Helpers/TimeHelpers.js +253 -0
  208. package/dist/Helpers/TreeStore.d.ts +188 -0
  209. package/dist/Helpers/TreeStore.js +577 -0
  210. package/dist/Helpers/ValidationHelpers.d.ts +124 -0
  211. package/dist/Helpers/ValidationHelpers.js +301 -0
  212. package/dist/Interfaces/ApiInterfaces.d.ts +174 -0
  213. package/dist/Interfaces/ApiInterfaces.js +30 -0
  214. package/dist/Interfaces/ChatInterfaces.d.ts +240 -0
  215. package/{src/sso-client.tsx → dist/Interfaces/ChatInterfaces.js} +1 -1
  216. package/dist/Interfaces/CrudInterfaces.d.ts +232 -0
  217. package/dist/Interfaces/CrudInterfaces.js +1 -0
  218. package/dist/Interfaces/DateInterfaces.d.ts +154 -0
  219. package/dist/Interfaces/DateInterfaces.js +29 -0
  220. package/dist/Interfaces/ExcelInterfaces.d.ts +215 -0
  221. package/dist/Interfaces/ExcelInterfaces.js +45 -0
  222. package/dist/Interfaces/FormInterfaces.d.ts +402 -0
  223. package/dist/Interfaces/FormInterfaces.js +1 -0
  224. package/dist/Interfaces/InputInterfaces.d.ts +141 -0
  225. package/dist/Interfaces/InputInterfaces.js +1 -0
  226. package/dist/Interfaces/MessageInterfaces.d.ts +111 -0
  227. package/dist/Interfaces/MessageInterfaces.js +5 -0
  228. package/dist/Interfaces/TableInterfaces.d.ts +351 -0
  229. package/dist/Interfaces/TableInterfaces.js +1 -0
  230. package/dist/Interfaces/ThemeInterfaces.d.ts +17 -0
  231. package/dist/Interfaces/ThemeInterfaces.js +17 -0
  232. package/dist/Interfaces/TypeInterfaces.d.ts +4 -0
  233. package/dist/Interfaces/TypeInterfaces.js +1 -0
  234. package/dist/Server.Index.d.ts +2 -0
  235. package/dist/Server.Index.js +5 -0
  236. package/dist/Services/ApiProxy.d.ts +32 -0
  237. package/dist/Services/ApiProxy.js +111 -0
  238. package/dist/Services/BrowserApi.d.ts +95 -0
  239. package/dist/Services/BrowserApi.js +129 -0
  240. package/dist/Services/ChatApi.d.ts +37 -0
  241. package/dist/Services/ChatApi.js +98 -0
  242. package/dist/Services/ExcelApi.d.ts +46 -0
  243. package/dist/Services/ExcelApi.js +196 -0
  244. package/dist/Services/ServerApi.d.ts +54 -0
  245. package/dist/Services/ServerApi.js +78 -0
  246. package/dist/Services/ThemeService.d.ts +17 -0
  247. package/dist/Services/ThemeService.js +83 -0
  248. package/dist/Shared.Index.d.ts +51 -0
  249. package/dist/Shared.Index.js +55 -0
  250. package/package.json +85 -33
  251. package/src/Styles/Nexus.Base.css +70 -0
  252. package/src/Styles/Nexus.Button.css +153 -0
  253. package/src/Styles/Nexus.Calendar.css +275 -0
  254. package/src/Styles/Nexus.Chat.css +1489 -0
  255. package/src/Styles/Nexus.Choice.css +345 -0
  256. package/src/Styles/Nexus.Crud.css +161 -0
  257. package/src/Styles/Nexus.DateTime.css +81 -0
  258. package/src/Styles/Nexus.Dropdown.css +774 -0
  259. package/src/Styles/Nexus.Editor.css +297 -0
  260. package/src/Styles/Nexus.Excel.css +370 -0
  261. package/src/Styles/Nexus.Form.css +321 -0
  262. package/src/Styles/Nexus.Index.css +36 -0
  263. package/src/Styles/Nexus.Input.css +637 -0
  264. package/src/Styles/Nexus.Markdown.css +265 -0
  265. package/src/Styles/Nexus.Menu.css +259 -0
  266. package/src/Styles/Nexus.Popup.css +731 -0
  267. package/src/Styles/Nexus.RichText.css +463 -0
  268. package/src/Styles/Nexus.Rows.css +596 -0
  269. package/src/Styles/Nexus.Slider.css +278 -0
  270. package/src/Styles/Nexus.Tab.Buttons.css +419 -0
  271. package/src/Styles/Nexus.Table.css +1296 -0
  272. package/src/Styles/Nexus.Theme.Picker.css +232 -0
  273. package/src/Styles/Nexus.Themes.css +194 -0
  274. package/src/Styles/Nexus.Time.css +147 -0
  275. package/src/Styles/Nexus.Toast.css +265 -0
  276. package/src/Styles/Nexus.Tokens.css +72 -0
  277. package/src/Styles/Nexus.Tree.css +435 -0
  278. package/src/api-services/authentication-service.tsx +0 -23
  279. package/src/api-services/preference-service.tsx +0 -5
  280. package/src/api-services/system-service.tsx +0 -29
  281. package/src/client.ts +0 -31
  282. package/src/components/documents/button.tsx +0 -133
  283. package/src/components/documents/icon-box.tsx +0 -93
  284. package/src/components/documents/page-title.tsx +0 -7
  285. package/src/components/documents/tab-button.tsx +0 -172
  286. package/src/components/documents/tag.tsx +0 -30
  287. package/src/components/index.js +0 -0
  288. package/src/components/inputs/checkbox-input.tsx +0 -66
  289. package/src/components/inputs/input-box.tsx +0 -48
  290. package/src/components/inputs/input-element.tsx +0 -65
  291. package/src/components/inputs/input-form.tsx +0 -164
  292. package/src/components/inputs/input.tsx +0 -181
  293. package/src/components/inputs/number-input.tsx +0 -108
  294. package/src/components/inputs/radiobox-input.tsx +0 -53
  295. package/src/components/inputs/textarea-input.tsx +0 -47
  296. package/src/components/inputs/textbox-input.tsx +0 -45
  297. package/src/components/layouts/global-dialogbox.tsx +0 -431
  298. package/src/components/layouts/global-layout.tsx +0 -64
  299. package/src/components/layouts/layout-helpers.tsx +0 -20
  300. package/src/components/layouts/panels/user-panel.tsx +0 -112
  301. package/src/components/layouts/utility-menu.tsx +0 -49
  302. package/src/components/panels/theme-panel.tsx +0 -46
  303. package/src/helpers/bitwise-helpers.tsx +0 -11
  304. package/src/helpers/browser-helpers.tsx +0 -156
  305. package/src/helpers/datasource-helpers.tsx +0 -99
  306. package/src/helpers/element-helpers.tsx +0 -123
  307. package/src/helpers/input-helpers.tsx +0 -74
  308. package/src/helpers/string-helpers.tsx +0 -28
  309. package/src/helpers/utility-helpers.tsx +0 -45
  310. package/src/helpers/validation-helpers.tsx +0 -302
  311. package/src/index.ts +0 -26
  312. package/src/interface.ts +0 -19
  313. package/src/interfaces/auth-token-interfaces.tsx +0 -6
  314. package/src/interfaces/browser-interfaces.tsx +0 -36
  315. package/src/interfaces/button-interfaces.tsx +0 -63
  316. package/src/interfaces/datasource-interfaces.tsx +0 -22
  317. package/src/interfaces/datatable-interfaces.tsx +0 -25
  318. package/src/interfaces/dialogbox-interfaces.tsx +0 -5
  319. package/src/interfaces/exception-interfaces.tsx +0 -99
  320. package/src/interfaces/http-interfaces.tsx +0 -129
  321. package/src/interfaces/icon-interfaces.tsx +0 -129
  322. package/src/interfaces/input-interfaces.tsx +0 -410
  323. package/src/interfaces/layout-interfaces.tsx +0 -191
  324. package/src/interfaces/menu-interfaces.tsx +0 -53
  325. package/src/interfaces/message-interfaces.tsx +0 -32
  326. package/src/interfaces/permission-interfaces.tsx +0 -9
  327. package/src/interfaces/storage-interfaces.tsx +0 -5
  328. package/src/interfaces/system-interfaces.tsx +0 -22
  329. package/src/interfaces/theme-interfaces.tsx +0 -123
  330. package/src/interfaces/type-interfaces.tsx +0 -28
  331. package/src/interfaces/user-interfaces.tsx +0 -47
  332. package/src/nexus-client.tsx +0 -21
  333. package/src/nexus.environments.tsx +0 -66
  334. package/src/proxy-api/proxy-backend.tsx +0 -60
  335. package/src/proxy-api/proxy-constants.tsx +0 -28
  336. package/src/proxy-api/proxy-helpers.tsx +0 -91
  337. package/src/proxy-api-client.tsx +0 -1
  338. package/src/proxy-api-server.tsx +0 -2
  339. package/src/services/http-client-services.tsx +0 -75
  340. package/src/services/http-services.tsx +0 -158
  341. package/src/services/loader-service.tsx +0 -185
  342. package/src/services/localstorage-service.tsx +0 -119
  343. package/src/services/message-services.tsx +0 -383
  344. package/src/services/theme-service.tsx +0 -163
  345. package/src/services/user-services.tsx +0 -10
  346. package/src/sso-config/auth-token-validation.ts +0 -16
  347. package/src/sso-config/callback-route.tsx +0 -35
  348. package/src/sso-config/cookie-encryption.ts +0 -51
  349. package/src/sso-config/cookie-helpers.tsx +0 -102
  350. package/src/sso-config/forgot-password-route.tsx +0 -36
  351. package/src/sso-config/oauth-callback-state.ts +0 -61
  352. package/src/sso-config/pkce-helpers.ts +0 -9
  353. package/src/sso-config/provider-complete-route.tsx +0 -18
  354. package/src/sso-config/redirect-context-actions.tsx +0 -45
  355. package/src/sso-config/redirect-context-helpers.tsx +0 -159
  356. package/src/sso-config/redirect-context-persist.tsx +0 -18
  357. package/src/sso-config/redirect-context-route.tsx +0 -45
  358. package/src/sso-config/refresh-route.tsx +0 -23
  359. package/src/sso-config/sign-in-route.tsx +0 -74
  360. package/src/sso-config/sign-out-route.tsx +0 -57
  361. package/src/sso-config/sign-up-route.tsx +0 -57
  362. package/src/sso-config/sso-backend-flow.ts +0 -38
  363. package/src/sso-config/sso-complete-route.tsx +0 -50
  364. package/src/sso-config/sso-config.ts +0 -59
  365. package/src/sso-config/sso-interfaces.tsx +0 -99
  366. package/src/sso-config/sso-response-helpers.tsx +0 -20
  367. package/src/sso-server.tsx +0 -21
  368. package/src/styles/nexus.animation.css +0 -269
  369. package/src/styles/nexus.core.css +0 -119
  370. package/src/styles/nexus.dialog.css +0 -144
  371. package/src/styles/nexus.grid-view.css +0 -42
  372. package/src/styles/nexus.icon.css +0 -51
  373. package/src/styles/nexus.input.css +0 -207
  374. package/src/styles/nexus.loader.css +0 -11
  375. package/src/styles/nexus.logic.css +0 -47
  376. package/src/styles/nexus.utility.css +0 -347
@@ -0,0 +1,240 @@
1
+ import type { DropdownPage, DropdownPageRequest } from "./InputInterfaces.ts";
2
+ /** An id, as the backend hands it out: a number, or text (a GUID, an encrypted id). */
3
+ export type ChatId = string | number;
4
+ /**
5
+ * A domain's value in an app's own enum: a number (`EDomainTypes.Leave`) or a string (`"leave"`). The backend will
6
+ * own the enum; until it does, a plain number is the value, and the components never read it — they only pass it on.
7
+ */
8
+ export type ChatDomainValue = string | number;
9
+ /**
10
+ * Where an app names its domain enum for the types, once, next to its other registrations:
11
+ *
12
+ * @example
13
+ * export enum EDomainTypes { Leave = 1, Procurement = 2, Applicant = 3 }
14
+ * declare module "nexus-shared" {
15
+ * interface ChatRegister { domain: EDomainTypes }
16
+ * }
17
+ *
18
+ * Every chat component, scope, and store then takes only those domains. Without it, any number.
19
+ */
20
+ export interface ChatRegister {
21
+ }
22
+ /** The app's domain type: the one named in `ChatRegister`, else any number. A component can also take one as `<Chat<EDomainTypes> …>`. */
23
+ export type AppChatDomain = ChatRegister extends {
24
+ domain: infer TDomain extends ChatDomainValue;
25
+ } ? TDomain : number;
26
+ /**
27
+ * Which conversation this is: the kind of record, the record, and who is reading it. Everything else a chat needs —
28
+ * where its messages come from, who may write — follows from these three.
29
+ *
30
+ * @example
31
+ * const scope = { domain: EDomainTypes.Leave, parentId: leave.id, userId: me.id };
32
+ */
33
+ export interface ChatScope<TDomain extends ChatDomainValue = AppChatDomain> {
34
+ /** Which kind of record the conversation hangs on: a leave request, a purchase order, an applicant, a tender. */
35
+ domain: TDomain;
36
+ /** The record's own id. The domain and the id together are the conversation. */
37
+ parentId: ChatId;
38
+ /** Who is reading and writing. Their messages sit on the right, and the unread count is theirs. */
39
+ userId: ChatId;
40
+ }
41
+ /** One domain's name, for the panel's heading and messages. An app registers its own with `defineChatDomains`. */
42
+ export interface ChatDomainInfo<TDomain extends ChatDomainValue = AppChatDomain> {
43
+ domain: TDomain;
44
+ /** Its name in a URL or a cache key: `leave`. Letters, digits, dots, dashes, and underscores. */
45
+ key: string;
46
+ /** Its name on screen: "Leave request". */
47
+ label: string;
48
+ }
49
+ /** `sent`: the server has it. `sending`: on its way. `failed`: it did not arrive, and the text is kept to send again. */
50
+ export type ChatMessageStatus = "sent" | "sending" | "failed";
51
+ /** A file on a message. The chat shows and links it; uploading is the app's `ChatSource`. */
52
+ export interface ChatAttachment {
53
+ id?: ChatId;
54
+ name: string;
55
+ /** Bytes, shown as "248 KB". */
56
+ size?: number;
57
+ /** Where it opens or downloads. Without one, the name shows but does not link. */
58
+ url?: string | null;
59
+ contentType?: string | null;
60
+ }
61
+ /** One message in a conversation. A backend maps its own rows to this in `ChatBackend.readMessage`. */
62
+ export interface ChatMessage {
63
+ /** The server's id. A message still on its way carries its `clientId` here until the answer brings the real one. */
64
+ id: ChatId;
65
+ /** Who wrote it. Compared with the scope's `userId` to decide which side it sits on. */
66
+ authorId: ChatId;
67
+ /** Their name, for the avatar and the line above the message. Without one, the chat says "Unknown". */
68
+ authorName?: string | null;
69
+ /** A photo URL. Without one, the initials of the name on a tone picked from it. */
70
+ authorAvatar?: string | null;
71
+ /** What they wrote, as plain text. Newlines are kept; nothing is parsed as HTML or Markdown. */
72
+ body: string;
73
+ /** When it was written, as a UTC moment (`2026-10-01T03:21:04.000Z`). Shown in the reader's own zone. */
74
+ createdAt: string;
75
+ /** When it was last changed, as a UTC moment. Shown as "edited". */
76
+ editedAt?: string | null;
77
+ /** Default `sent`. `sending` and `failed` belong to messages this browser has not had answered yet. */
78
+ status?: ChatMessageStatus;
79
+ /** The message this one answers, quoted above it. */
80
+ replyToId?: ChatId | null;
81
+ attachments?: readonly ChatAttachment[];
82
+ /** Written by the system, not a person ("Sita approved the request."): a centered note, with no avatar or side. */
83
+ isSystem?: boolean;
84
+ /** Who it has reached. Two ticks once anyone has it, filled once anyone has read it. */
85
+ deliveredTo?: readonly ChatId[];
86
+ /** Who has read it. */
87
+ readBy?: readonly ChatId[];
88
+ /** The people named with @ in the body, for the backend to tell them. */
89
+ mentions?: readonly ChatId[];
90
+ /** Set while a message is on its way or failed, so Retry can send the very same draft again. */
91
+ clientId?: string;
92
+ /** Why it failed, under the message, beside Retry. */
93
+ error?: string | null;
94
+ }
95
+ /**
96
+ * What the trigger icon draws itself from, and the only thing a list of 500 rows needs per row. The three states are
97
+ * `messageCount === 0` (quiet), messages but none unread (highlighted), and `unreadCount > 0` (highlighted, badged).
98
+ */
99
+ export interface ChatSummary {
100
+ /** Messages in the conversation. 0 leaves the icon quiet. */
101
+ messageCount: number;
102
+ /** Messages this user has not read. */
103
+ unreadCount: number;
104
+ /** When the last message was written, as a UTC moment, for the trigger's tooltip. */
105
+ lastMessageAt?: string | null;
106
+ /** The last message's text, cut to a line, for the tooltip. */
107
+ lastMessageText?: string | null;
108
+ /** Who wrote the last message, for the tooltip. */
109
+ lastMessageBy?: string | null;
110
+ /** How many take part. */
111
+ participantCount?: number;
112
+ /** How many conversations the record holds, when it holds more than one. */
113
+ conversationCount?: number;
114
+ }
115
+ /** The three looks of the trigger icon, in the order the owner described them. */
116
+ export type ChatHighlight = "quiet" | "active" | "unread";
117
+ /** One page of history: the newest messages first, then older ones with `before`, or only the new ones with `after`. */
118
+ export interface ChatHistoryRequest {
119
+ /** Messages older than this one, for the page above. */
120
+ before?: ChatId | null;
121
+ /** Messages newer than this one, for a refresh. `before` and `after` are never both set. */
122
+ after?: ChatId | null;
123
+ /** How many to send. */
124
+ take: number;
125
+ /** Aborted when the conversation changes or the panel unmounts. */
126
+ signal?: AbortSignal;
127
+ }
128
+ /** What a history request answers with. Messages may come in any order; the store sorts them oldest first. */
129
+ export interface ChatHistory {
130
+ messages: readonly ChatMessage[];
131
+ /** Whether older messages remain. Default: the page was full (`messages.length >= take`). */
132
+ hasMore?: boolean;
133
+ /** The conversation's counts, when the answer carries them, so one call fills the header too. */
134
+ summary?: ChatSummary;
135
+ /** Everyone taking part, when the answer carries them, so the panel needs no second call. */
136
+ participants?: readonly ChatParticipant[];
137
+ /** Whether this user may write here. Default true. */
138
+ canSend?: boolean;
139
+ }
140
+ /** What the composer sends. */
141
+ export interface ChatDraft {
142
+ body: string;
143
+ replyToId?: ChatId | null;
144
+ /** The people named with @ while writing it. */
145
+ mentions?: readonly ChatId[];
146
+ /** Files picked in the composer. A source that cannot take files leaves them out of its request. */
147
+ files?: readonly File[];
148
+ /** This browser's id for the message, so the answer replaces the right one and Retry sends the same draft. */
149
+ clientId: string;
150
+ }
151
+ /** Someone in a conversation, or someone who could be added to it. */
152
+ export interface ChatParticipant {
153
+ id: ChatId;
154
+ name: string;
155
+ avatar?: string | null;
156
+ /** What they are here: "Manager", "Co-worker", "Requested by". Shown under the name. */
157
+ role?: string | null;
158
+ /** They read but cannot write. */
159
+ readOnly?: boolean;
160
+ /** How far they have read, as a UTC moment. */
161
+ lastReadAt?: string | null;
162
+ /** Someone who has left or is no longer active: shown, never offered again. */
163
+ inactive?: boolean;
164
+ }
165
+ /** What a participant search receives: the same request a dropdown's `loadOptions` takes, so one loader serves both. */
166
+ export type ChatParticipantQuery = DropdownPageRequest;
167
+ /** What a participant search answers: the same page a dropdown takes. */
168
+ export type ChatParticipantPage = DropdownPage<ChatParticipant>;
169
+ /**
170
+ * Where one conversation's data comes from. The store calls only this, so it never knows about HTTP: the API source
171
+ * (`apiChatSource`) talks to the app's `ChatBackend`, and `localChatSource` keeps everything in memory for a demo or
172
+ * a test. Only `history` and `send` are required.
173
+ */
174
+ export interface ChatSource {
175
+ /** One page of messages. */
176
+ history(request: ChatHistoryRequest): Promise<ChatHistory>;
177
+ /** Sends one message, and answers with the saved one: its real id, its server time. */
178
+ send(draft: ChatDraft, signal?: AbortSignal): Promise<ChatMessage>;
179
+ /** Everyone in the conversation, and the people who could join, searched. Without it, the panel shows no participants. */
180
+ participants?(query: ChatParticipantQuery): Promise<ChatParticipantPage>;
181
+ /** Adds people to the conversation. Without it, the panel offers no Add. */
182
+ addParticipants?(ids: readonly ChatId[], signal?: AbortSignal): Promise<readonly ChatParticipant[]>;
183
+ /** Tells the server the user has read up to a message. Without it, unread counts clear in the browser only. */
184
+ markRead?(upTo: ChatId, signal?: AbortSignal): Promise<void>;
185
+ /** Removes a message. Without it, the panel offers no Delete. */
186
+ remove?(id: ChatId, signal?: AbortSignal): Promise<void>;
187
+ /**
188
+ * Pushes new messages in, from a socket or an event stream, and returns the function that stops it. While a source
189
+ * watches, the store does not poll.
190
+ */
191
+ watch?(onMessages: (messages: readonly ChatMessage[]) => void): () => void;
192
+ }
193
+ /** `one-to-one`: two people, named after the other one. `group`: three or more, or any conversation with a name. */
194
+ export type ChatConversationType = "one-to-one" | "group";
195
+ /** One conversation at a place. One of these shows on its own; several offer a switch between them. */
196
+ export interface ChatConversation {
197
+ id: ChatId;
198
+ type: ChatConversationType;
199
+ /** A group's name. A one-to-one has none: it is called after the other person. */
200
+ title?: string | null;
201
+ /** Everyone in it. Needed to name a one-to-one, and to fill the people column without a second call. */
202
+ participants?: readonly ChatParticipant[];
203
+ /** Its own counts, so the switch can show which conversation is waiting. */
204
+ summary?: ChatSummary;
205
+ /** When it was started, as a UTC moment. */
206
+ createdAt?: string | null;
207
+ createdBy?: ChatId | null;
208
+ /** This user may write in it. Default true. */
209
+ canSend?: boolean;
210
+ /** Nobody writes in it any more: it is read, never written to. */
211
+ closed?: boolean;
212
+ }
213
+ /** What starting a conversation sends. The backend settles the type; this is what the user asked for. */
214
+ export interface NewChatRequest {
215
+ /** One other person makes a one-to-one, more make a group. */
216
+ type: ChatConversationType;
217
+ /** Everyone to put in it, the starter aside. */
218
+ userIds: readonly ChatId[];
219
+ /** A group's name. */
220
+ title?: string | null;
221
+ }
222
+ /**
223
+ * The conversations at one place: what there is, and how to start another. A panel without one shows the single
224
+ * conversation its `ChatSource` serves, which is what a page that already knows its conversation wants.
225
+ */
226
+ export interface ChatPlaceSource {
227
+ /** Every conversation here this user may see, the one with the newest message first. */
228
+ conversations(signal?: AbortSignal): Promise<readonly ChatConversation[]>;
229
+ /** Starts one. A one-to-one that already exists comes back instead of a second one. Without it, no New chat. */
230
+ create?(request: NewChatRequest, signal?: AbortSignal): Promise<ChatConversation>;
231
+ /** Who can be put in a conversation here. Without it, New chat has nobody to pick. */
232
+ participants?(query: ChatParticipantQuery): Promise<ChatParticipantPage>;
233
+ }
234
+ /**
235
+ * A scope of any domain. Helpers that only pass the domain on — a cache key, the counts of a record — take this, so a
236
+ * component generic over the app's own enum can hand them its scope without a cast.
237
+ */
238
+ export type AnyChatScope = ChatScope<ChatDomainValue>;
239
+ /** A conversation's key in a cache: `"1:482"`, the domain and the parent id. */
240
+ export type ChatScopeKey = string;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -0,0 +1,232 @@
1
+ import type { CSSProperties, ReactNode, Ref } from "react";
2
+ import type { PopupSize } from "../Components/Layouts/Popup.tsx";
3
+ import type { FormStore } from "../Helpers/FormStore.ts";
4
+ import type { TableStore } from "../Helpers/TableStore.ts";
5
+ import type { ApiEndpoint } from "./ApiInterfaces.ts";
6
+ import type { FormProps, FormValues, InputParams } from "./FormInterfaces.ts";
7
+ import type { InputDesign } from "./InputInterfaces.ts";
8
+ import type { DataTableProps, TableColumn, TableMassAction, TablePaging, TableRowAction } from "./TableInterfaces.ts";
9
+ /**
10
+ * The lists of a controller: every active record (`normal`), the flagged ones, the trash, and the deleted ones
11
+ * (which can go back to the trash). The records the user pinned are not a list of their own: they sit above the
12
+ * active list, and in it.
13
+ */
14
+ export type CrudMode = "normal" | "flag" | "trash" | "deleted";
15
+ /** The built-in actions on one record. */
16
+ export type CrudRowActionName = "view" | "edit" | "flag" | "pin" | "trash" | "recover" | "delete" | "trashFromDelete";
17
+ /** The built-in actions on many records at once. */
18
+ export type CrudMassActionName = "flag" | "pin" | "trash" | "recover" | "delete" | "trashFromDelete" | "description";
19
+ /** Every built-in action: Add, the row actions, and a new description for many records. */
20
+ export type CrudActionName = "create" | CrudRowActionName | "description";
21
+ /**
22
+ * The endpoints a CRUD calls. `apiController` (and an app's `MODULES.controller`) builds all of them for a Nexus
23
+ * controller; another backend lists its own. Leave one out, and its action or list is not offered.
24
+ */
25
+ export interface CrudEndpoints {
26
+ /** Every record of a list, for tables that page in the browser: `Room/NormalListing`, `Room/TrashListing`, … */
27
+ lists?: Partial<Record<CrudMode, ApiEndpoint>>;
28
+ /** One page of a list, for tables that page on the server: `Room/NormalPagination`, … */
29
+ pages?: Partial<Record<CrudMode, ApiEndpoint>>;
30
+ /**
31
+ * The records the user pinned: `Room/PinListing`. They show in a section above the active list, which the user folds
32
+ * open, and in the list itself. Without it there is no pinned section, and nothing counts the pins against the limit.
33
+ */
34
+ pins?: ApiEndpoint;
35
+ /** One record by its key: `{id}` in the path. */
36
+ details?: ApiEndpoint;
37
+ create?: ApiEndpoint;
38
+ update?: ApiEndpoint;
39
+ flag?: ApiEndpoint;
40
+ /** Pins a record, or unpins it: `Room/Pin/{id}`. */
41
+ pin?: ApiEndpoint;
42
+ trash?: ApiEndpoint;
43
+ recover?: ApiEndpoint;
44
+ delete?: ApiEndpoint;
45
+ trashFromDelete?: ApiEndpoint;
46
+ /** Actions on many records, sent the selected keys. */
47
+ mass?: Partial<Record<CrudMassActionName, ApiEndpoint>>;
48
+ }
49
+ /** Inputs of the Add and Edit forms: one list for both, a list for each, or a function of the action and the row. */
50
+ export type CrudInputs<TRow extends FormValues = FormValues> = readonly InputParams[] | {
51
+ create?: readonly InputParams[];
52
+ edit?: readonly InputParams[];
53
+ } | ((action: "create" | "edit", row: TRow | null) => readonly InputParams[] | Promise<readonly InputParams[]>);
54
+ /** What a form popup's side panel is handed: the live form, and which record it was opened on. */
55
+ export interface CrudFormAsideContext<TRow extends FormValues = FormValues> {
56
+ /**
57
+ * The form of this popup. Read it with `getValue()` and follow it with `subscribeValue()`: the panel then updates
58
+ * itself without the form around it re-rendering, which is what keeps a long form typeable while the panel works.
59
+ */
60
+ form: FormStore<TRow>;
61
+ action: "create" | "edit";
62
+ /** The record being edited, or null for a new one. */
63
+ row: TRow | null;
64
+ }
65
+ /** The Add and Edit popups and their forms. */
66
+ export interface CrudFormOptions<TRow extends FormValues = FormValues> {
67
+ /** Width of the popups. Default `md`, or `lg` for forms of more than 8 inputs. */
68
+ size?: PopupSize;
69
+ /**
70
+ * A panel beside the form, in the same popup: a preview of what will be written, a summary, a help panel. It is
71
+ * given the popup's own `FormStore`, so it can follow what is typed.
72
+ *
73
+ * Side by side where there is room; under about 1000px the two stack and the **form comes first**, since that is
74
+ * what the popup is for. Pair it with a wide `size` (`xl` or `full`): a panel in a 560px popup leaves the form none.
75
+ */
76
+ aside?: ReactNode | ((context: CrudFormAsideContext<TRow>) => ReactNode);
77
+ /** Values of a new record, over each input's default. */
78
+ newValues?: Partial<TRow> | (() => Partial<TRow>);
79
+ /**
80
+ * What Edit opens with: the row as the table has it (`row`, the default), the record from the `details` endpoint
81
+ * (`details`, for fields a list leaves out), or a function that loads it.
82
+ */
83
+ load?: "row" | "details" | ((row: TRow, signal: AbortSignal) => Promise<Partial<TRow> | null | undefined>);
84
+ /** Shapes what is sent, e.g. to add a parent's id. Default: the values, with the fields the record came with. */
85
+ transform?: (values: TRow, context: {
86
+ action: "create" | "edit";
87
+ row: TRow | null;
88
+ }) => unknown;
89
+ /** The form's own rule over its values. */
90
+ validate?: FormProps<TRow>["validate"];
91
+ /** Derived values: return values to set after a change. */
92
+ onFieldChange?: FormProps<TRow>["onFieldChange"];
93
+ /** Label design of every input that does not set its own. */
94
+ design?: InputDesign;
95
+ /**
96
+ * Keeps unsaved values on this device, per record, under keys that start with this: `hotel-3:user-8:guests`.
97
+ * Make it unique per user.
98
+ */
99
+ draftKey?: string;
100
+ }
101
+ /** What a details popup's side panel is handed: the record, in the shape a form's side panel is handed it. */
102
+ export interface CrudDetailsAsideContext<TRow extends FormValues = FormValues> {
103
+ /**
104
+ * The record, in a `FormStore` no input writes to: the row as the list has it at once, then the `details`
105
+ * endpoint's record when that lands. Read it with `getValue()` and follow it with `subscribeValue()`, exactly as a
106
+ * form's panel does — so the panel beside the Edit form can be the panel beside the details, unchanged.
107
+ */
108
+ form: FormStore<TRow>;
109
+ /** The row the popup was opened on, as the list has it. */
110
+ row: TRow;
111
+ }
112
+ /** The details popup that View opens. */
113
+ export interface CrudDetailsOptions<TRow extends FormValues = FormValues> {
114
+ /** The fields to show. Default: every column, hidden ones too. */
115
+ columns?: readonly TableColumn<TRow>[];
116
+ /** Draws the details instead. */
117
+ render?: (row: TRow) => ReactNode;
118
+ /** Default `md`. */
119
+ size?: PopupSize;
120
+ /**
121
+ * A panel beside the details, in the same popup: what the record generates, a chart, a preview. It is laid out as
122
+ * the Add and Edit popups' `form.aside` is, except that here the panel takes the larger share, since the details
123
+ * beside it are a short list of fields. Pair it with a wide `size` (`xl` or `full`).
124
+ */
125
+ aside?: ReactNode | ((context: CrudDetailsAsideContext<TRow>) => ReactNode);
126
+ /**
127
+ * What the popup is called, as a noun: the row's menu offers "View {label}" and the popup's title is
128
+ * "{Subject} {label}". Default `details`. A popup whose panel is the point says so: `schema`, `preview`.
129
+ */
130
+ label?: string;
131
+ }
132
+ /** What changed, for `onChange`. */
133
+ export interface CrudChange<TRow extends FormValues = FormValues> {
134
+ action: CrudActionName;
135
+ /** The records as they are now; for actions that took them out of the list, as they were. */
136
+ rows: TRow[];
137
+ mode: CrudMode;
138
+ }
139
+ /** Table settings a CRUD passes on to its `DataTable`. */
140
+ export type CrudTableOptions<TRow extends FormValues = FormValues> = Pick<DataTableProps<TRow>, "pageSize" | "pageSizes" | "defaultSort" | "numbered" | "maxHeight" | "fill" | "excel" | "size" | "searchPlaceholder" | "maxSelection" | "emptyMessage" | "columnsMenu" | "stateKey" | "searchDelay" | "reorderable" | "resizable" | "pinnable" | "moreActions" | "exportable" | "printable" | "exportName" | "onImport" | "openOnClick">;
141
+ /** Props of `Crud`. */
142
+ export interface CrudProps<TRow extends FormValues = FormValues> {
143
+ /** The endpoints: `MODULES.controller(NexusModule.Reservation, "Guest", "guest")`, or an object of your own. */
144
+ api: CrudEndpoints;
145
+ /** The table's columns. */
146
+ columns: readonly TableColumn<TRow>[];
147
+ /** The inputs of the Add and Edit forms. */
148
+ inputs: CrudInputs<TRow>;
149
+ /** What one record is: "guest". Titles ("Add guest"), questions, and messages use it. Default: the endpoints' subject, else "record". */
150
+ subject?: string;
151
+ /** Its plural, when adding "s" is wrong: "people". */
152
+ subjectPlural?: string;
153
+ /** Tells popups and saved table settings apart. Default: the subject. */
154
+ name?: string;
155
+ /** The field that tells records apart. Default `id`. */
156
+ rowKey?: string;
157
+ /** Names a record in titles and questions: "Sita Sharma". Default: the first column's text. */
158
+ rowLabel?: (row: TRow) => string;
159
+ /** `client` (default): each list loads once, and the table searches, sorts, and pages it. `server`: every page is a request. */
160
+ paging?: TablePaging;
161
+ /** The lists to offer, in order. Default all five; each also needs its endpoint and the user's permission. */
162
+ modes?: readonly CrudMode[];
163
+ /** The list shown first. Default the first one offered. */
164
+ defaultMode?: CrudMode;
165
+ /** The built-in actions to offer. Default all; each also needs its endpoint and the user's permission. */
166
+ actions?: readonly CrudActionName[];
167
+ /** More actions on a row, after the built-in ones. */
168
+ rowActions?: (row: TRow, mode: CrudMode) => readonly TableRowAction<TRow>[];
169
+ /** More actions on selected rows, or `false` for no selection at all. */
170
+ massActions?: false | ((rows: TRow[], mode: CrudMode) => readonly TableMassAction<TRow>[]);
171
+ /** The Add and Edit forms. */
172
+ form?: CrudFormOptions<TRow>;
173
+ /** The details popup, or `false` for none. */
174
+ details?: false | CrudDetailsOptions<TRow>;
175
+ /**
176
+ * Keeps lists this long (milliseconds) while the page is open, so going back to a list shows it at once. A change is
177
+ * **written into** every list kept, from the record the answer carried: a record flagged joins the flagged list and
178
+ * one trashed joins the trash, with no request on either. Only a list the record cannot answer for is dropped, and
179
+ * that one loads when it is shown. Default 5 minutes; `false` loads every time. Cleared when the page closes.
180
+ */
181
+ cache?: false | {
182
+ lifetime?: number;
183
+ };
184
+ /** Before the Add button: more buttons, such as Import. */
185
+ toolbar?: ReactNode;
186
+ /** Settings of the table. */
187
+ table?: CrudTableOptions<TRow>;
188
+ /** After every change the CRUD made: a record added, saved, trashed, deleted. */
189
+ onChange?: (change: CrudChange<TRow>) => void;
190
+ /** The table's name for screen readers. Default: the plural of the subject ("Guests"). */
191
+ "aria-label"?: string;
192
+ "aria-labelledby"?: string;
193
+ id?: string;
194
+ className?: string;
195
+ style?: CSSProperties;
196
+ ref?: Ref<CrudHandle<TRow>>;
197
+ }
198
+ /** What `ref` gives on a CRUD. */
199
+ export interface CrudHandle<TRow extends FormValues = FormValues> {
200
+ /** The table's store: rows, selection, `reload`. */
201
+ table: TableStore<TRow>;
202
+ /** The list shown. */
203
+ mode: CrudMode;
204
+ setMode: (mode: CrudMode) => void;
205
+ /** Loads the list again, past the cache. A last resort: `apply` writes a change in without a request. */
206
+ reload: () => Promise<void>;
207
+ /**
208
+ * Records a page's **own** action changed, written where the built-in actions write theirs: into the table, the
209
+ * pinned band and every list kept in the cache - no request, on any list. Each record is merged over the one the
210
+ * table holds, so the key and the fields that changed are enough:
211
+ *
212
+ * ```ts
213
+ * const answer = await api.send(REGION_MARKS.flag, { params: { id: row.id } });
214
+ * if (answer.ok) handle.current?.apply([{ ...row, recordStatus: answer.result }]);
215
+ * ```
216
+ *
217
+ * Which list each record now belongs in comes from the record itself (`CrudBackend.listMembership`), so one that
218
+ * no longer belongs to the list on screen leaves it, and the other lists are patched behind it. `gone` is for an
219
+ * action that ends a record: it is taken out of every list.
220
+ *
221
+ * It does not call `onChange`, since the page calling it is the one that made the change.
222
+ */
223
+ apply: (rows: readonly Partial<TRow>[], options?: {
224
+ gone?: boolean;
225
+ }) => void;
226
+ /** Opens the Add popup, with these values over the new record's. */
227
+ create: (values?: Partial<TRow>) => void;
228
+ /** Opens the Edit popup of a record. */
229
+ edit: (row: TRow) => void;
230
+ /** Opens the details popup of a record. */
231
+ view: (row: TRow) => void;
232
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Dates in Nexus apps are calendar dates: a day, with no time of day and no time zone. A value is always an ISO
3
+ * date string in the Gregorian calendar, `"2026-09-17"`, whatever calendar the user sees it in. That is what a form
4
+ * sends, what an API stores (`DateOnly` in .NET), and what never shifts by a day between time zones.
5
+ */
6
+ /** The calendar a date is shown and picked in: `ad` Gregorian (English), `bs` Bikram Sambat (Nepali). Values stay Gregorian. */
7
+ export type CalendarType = "ad" | "bs";
8
+ /** How a Nepali date is written: `latin` (2083, Ashwin, 1) or `devanagari` (२०८३, असोज, १). Gregorian dates are always Latin. */
9
+ export type DateScript = "latin" | "devanagari";
10
+ /** A date as its parts in one calendar. Month and day start at 1. */
11
+ export interface DateParts {
12
+ year: number;
13
+ month: number;
14
+ day: number;
15
+ }
16
+ /**
17
+ * A date the components accept: an ISO date `"2026-09-17"`, an ISO date-time (with a zone it is read in the browser's
18
+ * local time; without one its date part is taken), or a `Date` (read in local time, like `new Date()`).
19
+ */
20
+ export type DateInput = string | Date | null | undefined;
21
+ /**
22
+ * The user's date and time settings, saved in local storage and read by every date and time component.
23
+ * - `calendar`: which calendar the pickers show. Default `ad`.
24
+ * - `format`: how a date is written, with the tokens of `formatDate`: `YYYY-MM-DD`, `DD/MM/YYYY`, `MMM DD, YYYY`, ... Default `YYYY-MM-DD`.
25
+ * - `script`: digits and names of Nepali dates. Default `latin`.
26
+ * - `timeFormat`: how a time is written, with the tokens of `formatTime`: `hh:mm A` (12-hour) or `HH:mm` (24-hour), ...
27
+ * Default `hh:mm A`. Optional here, so date-only settings stay valid; `useDatePreferences` always fills it.
28
+ */
29
+ export interface DatePreferences {
30
+ calendar: CalendarType;
31
+ format: string;
32
+ script: DateScript;
33
+ timeFormat?: string;
34
+ }
35
+ export declare const DEFAULT_TIME_FORMAT = "hh:mm A";
36
+ export declare const DEFAULT_DATE_PREFERENCES: Required<DatePreferences>;
37
+ /** Local storage keys of the date and time settings. Other code (a settings page, a login bootstrap) may write them. */
38
+ export declare const DATE_STORAGE_KEYS: {
39
+ readonly calendar: "nx-date-calendar";
40
+ readonly format: "nx-date-format";
41
+ readonly script: "nx-date-script";
42
+ readonly timeFormat: "nx-time-format";
43
+ };
44
+ /** Formats offered in a settings page. Any string of tokens works; these are the common ones. */
45
+ export declare const DATE_FORMATS: readonly string[];
46
+ /** Time formats offered in a settings page: 12-hour with and without a leading zero, and 24-hour. Seconds are added when a field needs them. */
47
+ export declare const TIME_FORMATS: readonly string[];
48
+ /**
49
+ * A time of day the components accept: an ISO time `"14:30"` or `"14:30:15"`, an ISO date-time (with a zone, the
50
+ * browser's local time of that instant; without one, its time part), or a `Date` (its local time, like `new Date()`).
51
+ * Like a date, a time value has no zone: "14:30" is half past two wherever the form is opened (a .NET `TimeOnly`).
52
+ */
53
+ export type TimeInput = string | Date | null | undefined;
54
+ /** Custom check for a time. Receives the ISO time, or `null` when the field is empty; returns a message to fail. */
55
+ export type TimeValidator = (value: string | null) => string | null | undefined;
56
+ /** Validation rules for a time, named like the HTML attributes. Limits are inclusive. */
57
+ export interface TimeRules {
58
+ required?: boolean;
59
+ /** Earliest time allowed, e.g. "09:00". With `max` earlier than `min`, the allowed range runs past midnight: "22:00" to "06:00". */
60
+ min?: TimeInput;
61
+ /** Latest time allowed, e.g. "18:00". */
62
+ max?: TimeInput;
63
+ /** Seconds between allowed times, counted from midnight, as in HTML: 60 (default) for any minute, 900 for quarter hours, 1 for seconds. */
64
+ step?: number;
65
+ /** Runs after the built-in rules pass. */
66
+ validate?: TimeValidator;
67
+ }
68
+ /**
69
+ * A moment the date and time components accept. Unlike a date or a time of day, a date-time value is an instant: the
70
+ * same moment everywhere, held as a UTC ISO string, `"2026-09-17T08:45:00.000Z"`, and shown in the user's time zone.
71
+ * - an ISO date-time with a zone: `"2026-09-17T08:45:00Z"`, `"2026-09-17T14:30:00+05:45"`;
72
+ * - an ISO date-time without a zone, `"2026-09-17T08:45:00"`, is read as UTC: that is how a .NET `DateTime` saved as
73
+ * UTC often comes back from a database, with its "Z" lost, and reading it as local time would move it;
74
+ * - a date alone, `"2026-09-17"`, is the first moment of that day in the user's time zone;
75
+ * - a `Date`, or milliseconds since 1970 (`Date.now()`).
76
+ */
77
+ export type DateTimeInput = string | number | Date | null | undefined;
78
+ /** A moment as the user sees it in a time zone: an ISO date and an ISO time of day with seconds. */
79
+ export interface LocalDateTime {
80
+ /** "2026-09-17" */
81
+ date: string;
82
+ /** "14:30:00" */
83
+ time: string;
84
+ }
85
+ /** Custom check for a date-time. Receives the UTC ISO value, or `null` when the field is empty; returns a message to fail. */
86
+ export type DateTimeValidator = (value: string | null) => string | null | undefined;
87
+ /**
88
+ * Validation rules for a date-time, named like the HTML attributes. Limits are inclusive. `min` and `max` are moments;
89
+ * `minTime`, `maxTime`, and `step` apply to the time of day where the user is, on every day.
90
+ */
91
+ export interface DateTimeRules {
92
+ required?: boolean;
93
+ /** Earliest moment allowed, e.g. `new Date()` for "not in the past". */
94
+ min?: DateTimeInput;
95
+ /** Latest moment allowed. */
96
+ max?: DateTimeInput;
97
+ /** Earliest time of day allowed, e.g. "09:00" for opening hours. With `maxTime` earlier than `minTime`, the hours run past midnight. */
98
+ minTime?: TimeInput;
99
+ /** Latest time of day allowed, e.g. "18:00". */
100
+ maxTime?: TimeInput;
101
+ /** Seconds between allowed times, counted from each midnight: 60 (default) for any minute, 900 for quarter hours, 1 for seconds. */
102
+ step?: number;
103
+ /** Runs after the built-in rules pass. */
104
+ validate?: DateTimeValidator;
105
+ }
106
+ /** Custom check for a date. Receives the ISO date, or `null` when the field is empty; returns a message to fail. */
107
+ export type DateValidator = (value: string | null) => string | null | undefined;
108
+ /** Validation rules for a date, named like the HTML attributes. Limits are inclusive. */
109
+ export interface DateRules {
110
+ required?: boolean;
111
+ /** Earliest date allowed. */
112
+ min?: DateInput;
113
+ /** Latest date allowed. */
114
+ max?: DateInput;
115
+ /** Runs after the built-in rules pass. */
116
+ validate?: DateValidator;
117
+ }
118
+ /** A start and an end, as ISO dates. Either may still be `null`; both `null` is an empty range. */
119
+ export type DateRange = readonly [string | null, string | null];
120
+ /** A range the components accept: a start and an end, each a `DateInput`, or nothing. */
121
+ export type DateRangeInput = readonly [DateInput, DateInput] | null | undefined;
122
+ /** Custom check for a date range. Receives the range, with `null` ends when empty; returns a message to fail. */
123
+ export type DateRangeValidator = (range: DateRange) => string | null | undefined;
124
+ /** Validation rules for a date range. `min` and `max` bound both ends; a distance is the end minus the start, in days. */
125
+ export interface DateRangeRules {
126
+ /** A range with a start and no end (or the reverse) is never valid; `required` also refuses an empty one. */
127
+ required?: boolean;
128
+ /** Earliest day of the range. */
129
+ min?: DateInput;
130
+ /** Latest day of the range. */
131
+ max?: DateInput;
132
+ /** Fewest days from the start to the end: `1` puts the end after the start, as the nights of a stay. Default 0, so one day is a range. */
133
+ minDistance?: number;
134
+ /** Most days from the start to the end, e.g. 30 for a stay of up to 30 nights. */
135
+ maxDistance?: number;
136
+ /** Runs after the built-in rules pass. */
137
+ validate?: DateRangeValidator;
138
+ }
139
+ /** A day in a calendar grid, given to `renderDay` so an event calendar can draw markers inside the cell. */
140
+ export interface CalendarDay {
141
+ /** The ISO date, always Gregorian. */
142
+ iso: string;
143
+ /** The day in the calendar being shown (`ad` or `bs`). */
144
+ parts: DateParts;
145
+ /** 0 = Sunday. */
146
+ weekday: number;
147
+ /** Belongs to the month before or after the one shown. */
148
+ outside: boolean;
149
+ today: boolean;
150
+ selected: boolean;
151
+ /** Between the two ends of a range, or of the range being picked. */
152
+ inRange: boolean;
153
+ disabled: boolean;
154
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Dates in Nexus apps are calendar dates: a day, with no time of day and no time zone. A value is always an ISO
3
+ * date string in the Gregorian calendar, `"2026-09-17"`, whatever calendar the user sees it in. That is what a form
4
+ * sends, what an API stores (`DateOnly` in .NET), and what never shifts by a day between time zones.
5
+ */
6
+ export const DEFAULT_TIME_FORMAT = "hh:mm A";
7
+ export const DEFAULT_DATE_PREFERENCES = { calendar: "ad", format: "YYYY-MM-DD", script: "latin", timeFormat: DEFAULT_TIME_FORMAT };
8
+ /** Local storage keys of the date and time settings. Other code (a settings page, a login bootstrap) may write them. */
9
+ export const DATE_STORAGE_KEYS = {
10
+ calendar: "nx-date-calendar",
11
+ format: "nx-date-format",
12
+ script: "nx-date-script",
13
+ timeFormat: "nx-time-format",
14
+ };
15
+ /** Formats offered in a settings page. Any string of tokens works; these are the common ones. */
16
+ export const DATE_FORMATS = [
17
+ "YYYY-MM-DD",
18
+ "DD/MM/YYYY",
19
+ "MM/DD/YYYY",
20
+ "DD.MM.YYYY",
21
+ "D MMMM YYYY",
22
+ "DD MMM YYYY",
23
+ "MMM DD, YYYY",
24
+ "MMMM DD, YYYY",
25
+ "ddd, DD MMM YYYY",
26
+ "dddd, MMMM DD, YYYY",
27
+ ];
28
+ /** Time formats offered in a settings page: 12-hour with and without a leading zero, and 24-hour. Seconds are added when a field needs them. */
29
+ export const TIME_FORMATS = ["hh:mm A", "h:mm A", "hh:mm a", "HH:mm", "H:mm"];