@etsoo/materialui 1.4.68 → 1.4.69

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 (543) hide show
  1. package/lib/cjs/AddresSelector.js +141 -0
  2. package/lib/cjs/AuditDisplay.js +52 -0
  3. package/lib/cjs/AutocompleteExtendedProps.js +2 -0
  4. package/lib/cjs/BackButton.js +38 -0
  5. package/lib/cjs/BridgeCloseButton.js +35 -0
  6. package/lib/cjs/ButtonLink.js +22 -0
  7. package/lib/cjs/ButtonPopover.js +63 -0
  8. package/lib/cjs/ComboBox.js +134 -0
  9. package/lib/cjs/ComboBoxMultiple.js +132 -0
  10. package/lib/cjs/ComboBoxPro.js +71 -0
  11. package/lib/cjs/CountdownButton.js +91 -0
  12. package/lib/cjs/CountryList.js +29 -0
  13. package/lib/cjs/CultureDataTable.js +48 -0
  14. package/lib/cjs/CustomFabProps.js +2 -0
  15. package/lib/cjs/DataGridEx.js +333 -0
  16. package/lib/cjs/DataGridRenderers.js +105 -0
  17. package/lib/cjs/DataSteps.js +93 -0
  18. package/lib/cjs/DataTable.js +52 -0
  19. package/lib/cjs/DialogButton.js +43 -0
  20. package/lib/cjs/DnDList.js +222 -0
  21. package/lib/cjs/DraggablePaperComponent.js +19 -0
  22. package/lib/cjs/EmailInput.js +17 -0
  23. package/lib/cjs/FabBox.js +42 -0
  24. package/lib/cjs/FieldSetEx.js +32 -0
  25. package/lib/cjs/FileUploadButton.js +46 -0
  26. package/lib/cjs/FlexBox.js +22 -0
  27. package/lib/cjs/GridDataCacheType.js +2 -0
  28. package/lib/cjs/GridDataFormat.js +46 -0
  29. package/lib/cjs/GridUtils.js +90 -0
  30. package/lib/cjs/HiSelector.js +49 -0
  31. package/lib/cjs/HiSelectorTL.js +43 -0
  32. package/lib/cjs/IconButtonLink.js +19 -0
  33. package/lib/cjs/InputField.js +54 -0
  34. package/lib/cjs/InputTipField.js +50 -0
  35. package/lib/cjs/IntInputField.js +116 -0
  36. package/lib/cjs/ItemList.js +71 -0
  37. package/lib/{LineChart.d.ts → cjs/LineChart.d.ts} +1 -1
  38. package/lib/cjs/LineChart.js +59 -0
  39. package/lib/cjs/ListChooser.js +95 -0
  40. package/lib/cjs/ListItemRightIcon.js +11 -0
  41. package/lib/cjs/ListMoreDisplay.js +101 -0
  42. package/lib/cjs/LoadingButton.js +47 -0
  43. package/lib/cjs/MUGlobal.js +189 -0
  44. package/lib/cjs/MUUtils.js +58 -0
  45. package/lib/cjs/MaskInput.d.ts +40 -0
  46. package/lib/cjs/MaskInput.js +54 -0
  47. package/lib/cjs/MenuButton.js +68 -0
  48. package/lib/cjs/MobileListItemRenderer.js +33 -0
  49. package/lib/cjs/MoneyInputField.js +18 -0
  50. package/lib/cjs/MoreFab.js +100 -0
  51. package/lib/cjs/NotifierMU.js +368 -0
  52. package/lib/cjs/NotifierPopupProps.js +2 -0
  53. package/lib/cjs/NotifierPromptProps.js +2 -0
  54. package/lib/cjs/NumberInputField.js +32 -0
  55. package/lib/cjs/OptionBool.js +17 -0
  56. package/lib/cjs/OptionGroup.js +108 -0
  57. package/lib/cjs/OptionGroupFlag.js +92 -0
  58. package/lib/cjs/PList.js +19 -0
  59. package/lib/cjs/PercentCircularProgress.js +20 -0
  60. package/lib/cjs/PercentLinearProgress.js +11 -0
  61. package/lib/cjs/ProgressCount.js +79 -0
  62. package/lib/cjs/PullToRefreshUI.js +29 -0
  63. package/lib/cjs/QuickList.js +48 -0
  64. package/lib/cjs/RegionsRQ.js +2 -0
  65. package/lib/cjs/ResponsibleContainer.js +196 -0
  66. package/lib/cjs/ResponsiveStyleValue.js +2 -0
  67. package/lib/cjs/ScrollTopFab.js +30 -0
  68. package/lib/cjs/ScrollerListEx.js +168 -0
  69. package/lib/cjs/SearchBar.js +270 -0
  70. package/lib/cjs/SearchField.js +52 -0
  71. package/lib/cjs/SearchOptionGroup.js +17 -0
  72. package/lib/cjs/SelectBool.js +22 -0
  73. package/lib/cjs/SelectEx.js +180 -0
  74. package/lib/cjs/ShowDataComparison.js +63 -0
  75. package/lib/cjs/Switch.js +40 -0
  76. package/lib/cjs/SwitchAnt.js +48 -0
  77. package/lib/cjs/SwitchField.js +36 -0
  78. package/lib/cjs/TabBox.js +34 -0
  79. package/lib/cjs/TableEx.js +294 -0
  80. package/lib/cjs/TagList.js +62 -0
  81. package/lib/cjs/TagListPro.js +66 -0
  82. package/lib/cjs/TextFieldEx.js +145 -0
  83. package/lib/cjs/Tiplist.js +211 -0
  84. package/lib/cjs/TiplistPro.js +206 -0
  85. package/lib/cjs/TooltipClick.js +46 -0
  86. package/lib/cjs/TwoFieldInput.js +69 -0
  87. package/lib/cjs/UserAvatar.js +26 -0
  88. package/lib/cjs/UserAvatarEditor.js +169 -0
  89. package/lib/cjs/app/CommonApp.js +32 -0
  90. package/lib/cjs/app/IServiceApp.js +11 -0
  91. package/lib/cjs/app/IServiceAppSettings.js +2 -0
  92. package/lib/cjs/app/IServicePage.js +2 -0
  93. package/lib/cjs/app/IServiceUser.js +2 -0
  94. package/lib/cjs/app/ISmartERPUser.js +2 -0
  95. package/lib/cjs/app/Labels.js +65 -0
  96. package/lib/cjs/app/ReactApp.js +387 -0
  97. package/lib/cjs/app/ServiceApp.js +232 -0
  98. package/lib/cjs/custom/CustomFieldUtils.js +152 -0
  99. package/lib/cjs/custom/CustomFieldViewer.js +57 -0
  100. package/lib/cjs/custom/CustomFieldWindow.js +95 -0
  101. package/lib/cjs/custom/FieldAmountLabel.js +47 -0
  102. package/lib/cjs/custom/FieldCheckbox.js +56 -0
  103. package/lib/cjs/custom/FieldCombobox.js +47 -0
  104. package/lib/cjs/custom/FieldDateInput.js +50 -0
  105. package/lib/cjs/custom/FieldDivider.js +19 -0
  106. package/lib/cjs/custom/FieldInput.js +34 -0
  107. package/lib/cjs/custom/FieldJson.js +57 -0
  108. package/lib/cjs/custom/FieldLabel.js +35 -0
  109. package/lib/cjs/custom/FieldNumberInput.js +44 -0
  110. package/lib/cjs/custom/FieldRadio.js +56 -0
  111. package/lib/cjs/custom/FieldSelect.js +55 -0
  112. package/lib/cjs/custom/FieldSwitch.js +49 -0
  113. package/lib/cjs/custom/FieldTexarea.js +35 -0
  114. package/lib/cjs/index.js +134 -0
  115. package/lib/cjs/messages/MessageUtils.js +76 -0
  116. package/lib/cjs/messages/OperationMessageContainer.js +49 -0
  117. package/lib/cjs/messages/OperationMessageDto.js +2 -0
  118. package/lib/cjs/messages/OperationMessageHandler.js +2 -0
  119. package/lib/cjs/messages/RefreshHandler.js +2 -0
  120. package/lib/cjs/messages/SignalRUser.js +2 -0
  121. package/lib/cjs/pages/CommonPage.js +64 -0
  122. package/lib/cjs/pages/DataGridPage.js +114 -0
  123. package/lib/cjs/pages/DataGridPageProps.js +2 -0
  124. package/lib/cjs/pages/DrawerHeader.js +16 -0
  125. package/lib/cjs/pages/EditPage.js +30 -0
  126. package/lib/cjs/pages/FixedListPage.js +104 -0
  127. package/lib/cjs/pages/LeftDrawer.js +37 -0
  128. package/lib/cjs/pages/ListPage.js +83 -0
  129. package/lib/cjs/pages/ResponsivePage.js +53 -0
  130. package/lib/cjs/pages/SearchPageProps.js +2 -0
  131. package/lib/cjs/pages/TablePage.js +72 -0
  132. package/lib/cjs/pages/UserMenu.js +91 -0
  133. package/lib/cjs/pages/ViewPage.js +160 -0
  134. package/lib/cjs/texts/DateText.js +28 -0
  135. package/lib/cjs/texts/MoneyText.js +19 -0
  136. package/lib/cjs/texts/NumberText.js +17 -0
  137. package/lib/mjs/AddresSelector.d.ts +107 -0
  138. package/lib/mjs/AuditDisplay.d.ts +31 -0
  139. package/lib/mjs/AutocompleteExtendedProps.d.ts +73 -0
  140. package/lib/mjs/BackButton.d.ts +12 -0
  141. package/lib/mjs/BridgeCloseButton.d.ts +22 -0
  142. package/lib/mjs/ButtonLink.d.ts +20 -0
  143. package/lib/mjs/ButtonPopover.d.ts +29 -0
  144. package/lib/mjs/ComboBox.d.ts +45 -0
  145. package/lib/mjs/ComboBoxMultiple.d.ts +41 -0
  146. package/lib/mjs/ComboBoxPro.d.ts +31 -0
  147. package/lib/mjs/CountdownButton.d.ts +27 -0
  148. package/lib/mjs/CountryList.d.ts +30 -0
  149. package/lib/mjs/CultureDataTable.d.ts +19 -0
  150. package/lib/mjs/CustomFabProps.d.ts +27 -0
  151. package/lib/mjs/DataGridEx.d.ts +101 -0
  152. package/lib/mjs/DataGridRenderers.d.ts +22 -0
  153. package/lib/mjs/DataSteps.d.ts +38 -0
  154. package/lib/mjs/DataTable.d.ts +27 -0
  155. package/lib/mjs/DialogButton.d.ts +54 -0
  156. package/lib/mjs/DnDList.d.ts +104 -0
  157. package/lib/mjs/DraggablePaperComponent.d.ts +7 -0
  158. package/lib/mjs/EmailInput.d.ts +10 -0
  159. package/lib/mjs/FabBox.d.ts +26 -0
  160. package/lib/mjs/FieldSetEx.d.ts +21 -0
  161. package/lib/mjs/FileUploadButton.d.ts +36 -0
  162. package/lib/mjs/FlexBox.d.ts +13 -0
  163. package/lib/mjs/GridDataCacheType.d.ts +9 -0
  164. package/lib/mjs/GridDataFormat.d.ts +10 -0
  165. package/lib/mjs/GridUtils.d.ts +44 -0
  166. package/lib/mjs/HiSelector.d.ts +79 -0
  167. package/lib/mjs/HiSelectorTL.d.ts +67 -0
  168. package/lib/mjs/IconButtonLink.d.ts +20 -0
  169. package/lib/mjs/InputField.d.ts +80 -0
  170. package/lib/mjs/InputTipField.d.ts +38 -0
  171. package/lib/mjs/IntInputField.d.ts +55 -0
  172. package/lib/mjs/ItemList.d.ts +68 -0
  173. package/lib/mjs/LineChart.d.ts +28 -0
  174. package/lib/{LineChart.js → mjs/LineChart.js} +2 -1
  175. package/lib/mjs/ListChooser.d.ts +64 -0
  176. package/lib/mjs/ListItemRightIcon.d.ts +5 -0
  177. package/lib/mjs/ListMoreDisplay.d.ts +38 -0
  178. package/lib/mjs/LoadingButton.d.ts +15 -0
  179. package/lib/mjs/MUGlobal.d.ts +101 -0
  180. package/lib/mjs/MUUtils.d.ts +22 -0
  181. package/lib/mjs/MaskInput.d.ts +40 -0
  182. package/lib/{MaskInput.js → mjs/MaskInput.js} +7 -1
  183. package/lib/mjs/MenuButton.d.ts +9 -0
  184. package/lib/mjs/MobileListItemRenderer.d.ts +17 -0
  185. package/lib/mjs/MoneyInputField.d.ts +10 -0
  186. package/lib/mjs/MoreFab.d.ts +45 -0
  187. package/lib/mjs/NotifierMU.d.ts +48 -0
  188. package/lib/mjs/NotifierPopupProps.d.ts +5 -0
  189. package/lib/mjs/NotifierPromptProps.d.ts +21 -0
  190. package/lib/mjs/NumberInputField.d.ts +42 -0
  191. package/lib/mjs/OptionBool.d.ts +12 -0
  192. package/lib/mjs/OptionGroup.d.ts +80 -0
  193. package/lib/mjs/OptionGroupFlag.d.ts +76 -0
  194. package/lib/mjs/PList.d.ts +14 -0
  195. package/lib/mjs/PercentCircularProgress.d.ts +7 -0
  196. package/lib/mjs/PercentLinearProgress.d.ts +7 -0
  197. package/lib/mjs/ProgressCount.d.ts +43 -0
  198. package/lib/mjs/PullToRefreshUI.d.ts +8 -0
  199. package/lib/mjs/QuickList.d.ts +56 -0
  200. package/lib/mjs/RegionsRQ.d.ts +22 -0
  201. package/lib/mjs/ResponsibleContainer.d.ts +98 -0
  202. package/lib/mjs/ResponsiveStyleValue.d.ts +7 -0
  203. package/lib/mjs/ScrollTopFab.d.ts +6 -0
  204. package/lib/mjs/ScrollerListEx.d.ts +75 -0
  205. package/lib/mjs/SearchBar.d.ts +32 -0
  206. package/lib/mjs/SearchField.d.ts +24 -0
  207. package/lib/mjs/SearchOptionGroup.d.ts +8 -0
  208. package/lib/mjs/SelectBool.d.ts +12 -0
  209. package/lib/mjs/SelectEx.d.ts +74 -0
  210. package/lib/mjs/ShowDataComparison.d.ts +15 -0
  211. package/lib/mjs/Switch.d.ts +28 -0
  212. package/lib/mjs/SwitchAnt.d.ts +24 -0
  213. package/lib/mjs/SwitchField.d.ts +45 -0
  214. package/lib/mjs/TabBox.d.ts +54 -0
  215. package/lib/mjs/TableEx.d.ts +64 -0
  216. package/lib/mjs/TagList.d.ts +21 -0
  217. package/lib/mjs/TagListPro.d.ts +22 -0
  218. package/lib/mjs/TextFieldEx.d.ts +157 -0
  219. package/lib/mjs/Tiplist.d.ts +29 -0
  220. package/lib/mjs/TiplistPro.d.ts +60 -0
  221. package/lib/mjs/TooltipClick.d.ts +15 -0
  222. package/lib/mjs/TwoFieldInput.d.ts +22 -0
  223. package/lib/mjs/UserAvatar.d.ts +23 -0
  224. package/lib/mjs/UserAvatarEditor.d.ts +60 -0
  225. package/lib/mjs/app/CommonApp.d.ts +21 -0
  226. package/lib/mjs/app/IServiceApp.d.ts +41 -0
  227. package/lib/mjs/app/IServiceAppSettings.d.ts +6 -0
  228. package/lib/mjs/app/IServicePage.d.ts +6 -0
  229. package/lib/mjs/app/IServiceUser.d.ts +42 -0
  230. package/lib/mjs/app/ISmartERPUser.d.ts +21 -0
  231. package/lib/mjs/app/Labels.d.ts +65 -0
  232. package/lib/mjs/app/ReactApp.d.ts +252 -0
  233. package/lib/mjs/app/ServiceApp.d.ts +76 -0
  234. package/lib/mjs/custom/CustomFieldUtils.d.ts +56 -0
  235. package/lib/mjs/custom/CustomFieldViewer.d.ts +50 -0
  236. package/lib/mjs/custom/CustomFieldWindow.d.ts +55 -0
  237. package/lib/mjs/custom/FieldAmountLabel.d.ts +7 -0
  238. package/lib/mjs/custom/FieldCheckbox.d.ts +8 -0
  239. package/lib/mjs/custom/FieldCombobox.d.ts +8 -0
  240. package/lib/mjs/custom/FieldDateInput.d.ts +7 -0
  241. package/lib/mjs/custom/FieldDivider.d.ts +7 -0
  242. package/lib/mjs/custom/FieldInput.d.ts +7 -0
  243. package/lib/mjs/custom/FieldJson.d.ts +7 -0
  244. package/lib/mjs/custom/FieldLabel.d.ts +7 -0
  245. package/lib/mjs/custom/FieldNumberInput.d.ts +7 -0
  246. package/lib/mjs/custom/FieldRadio.d.ts +8 -0
  247. package/lib/mjs/custom/FieldSelect.d.ts +8 -0
  248. package/lib/mjs/custom/FieldSwitch.d.ts +7 -0
  249. package/lib/mjs/custom/FieldTexarea.d.ts +7 -0
  250. package/lib/mjs/index.js +118 -0
  251. package/lib/mjs/messages/MessageUtils.d.ts +52 -0
  252. package/lib/mjs/messages/OperationMessageContainer.d.ts +24 -0
  253. package/lib/mjs/messages/OperationMessageDto.d.ts +26 -0
  254. package/lib/mjs/messages/OperationMessageHandler.d.ts +24 -0
  255. package/lib/mjs/messages/RefreshHandler.d.ts +5 -0
  256. package/lib/mjs/messages/SignalRUser.d.ts +31 -0
  257. package/lib/mjs/pages/CommonPage.d.ts +72 -0
  258. package/lib/mjs/pages/DataGridPage.d.ts +7 -0
  259. package/lib/mjs/pages/DataGridPageProps.d.ts +18 -0
  260. package/lib/mjs/pages/DrawerHeader.d.ts +4 -0
  261. package/lib/mjs/pages/EditPage.d.ts +46 -0
  262. package/lib/mjs/pages/FixedListPage.d.ts +14 -0
  263. package/lib/mjs/pages/LeftDrawer.d.ts +35 -0
  264. package/lib/mjs/pages/ListPage.d.ts +12 -0
  265. package/lib/mjs/pages/ResponsivePage.d.ts +56 -0
  266. package/lib/mjs/pages/SearchPageProps.d.ts +36 -0
  267. package/lib/mjs/pages/TablePage.d.ts +13 -0
  268. package/lib/mjs/pages/UserMenu.d.ts +40 -0
  269. package/lib/mjs/pages/ViewPage.d.ts +104 -0
  270. package/lib/{pages → mjs/pages}/ViewPage.js +1 -1
  271. package/lib/mjs/texts/DateText.d.ts +33 -0
  272. package/lib/mjs/texts/MoneyText.d.ts +20 -0
  273. package/lib/mjs/texts/NumberText.d.ts +24 -0
  274. package/package.json +12 -6
  275. package/src/LineChart.tsx +3 -3
  276. package/src/MaskInput.tsx +23 -10
  277. package/src/pages/ViewPage.tsx +1 -1
  278. package/tsconfig.cjs.json +19 -0
  279. package/tsconfig.json +1 -1
  280. package/lib/MaskInput.d.ts +0 -34
  281. /package/lib/{AddresSelector.d.ts → cjs/AddresSelector.d.ts} +0 -0
  282. /package/lib/{AuditDisplay.d.ts → cjs/AuditDisplay.d.ts} +0 -0
  283. /package/lib/{AutocompleteExtendedProps.d.ts → cjs/AutocompleteExtendedProps.d.ts} +0 -0
  284. /package/lib/{BackButton.d.ts → cjs/BackButton.d.ts} +0 -0
  285. /package/lib/{BridgeCloseButton.d.ts → cjs/BridgeCloseButton.d.ts} +0 -0
  286. /package/lib/{ButtonLink.d.ts → cjs/ButtonLink.d.ts} +0 -0
  287. /package/lib/{ButtonPopover.d.ts → cjs/ButtonPopover.d.ts} +0 -0
  288. /package/lib/{ComboBox.d.ts → cjs/ComboBox.d.ts} +0 -0
  289. /package/lib/{ComboBoxMultiple.d.ts → cjs/ComboBoxMultiple.d.ts} +0 -0
  290. /package/lib/{ComboBoxPro.d.ts → cjs/ComboBoxPro.d.ts} +0 -0
  291. /package/lib/{CountdownButton.d.ts → cjs/CountdownButton.d.ts} +0 -0
  292. /package/lib/{CountryList.d.ts → cjs/CountryList.d.ts} +0 -0
  293. /package/lib/{CultureDataTable.d.ts → cjs/CultureDataTable.d.ts} +0 -0
  294. /package/lib/{CustomFabProps.d.ts → cjs/CustomFabProps.d.ts} +0 -0
  295. /package/lib/{DataGridEx.d.ts → cjs/DataGridEx.d.ts} +0 -0
  296. /package/lib/{DataGridRenderers.d.ts → cjs/DataGridRenderers.d.ts} +0 -0
  297. /package/lib/{DataSteps.d.ts → cjs/DataSteps.d.ts} +0 -0
  298. /package/lib/{DataTable.d.ts → cjs/DataTable.d.ts} +0 -0
  299. /package/lib/{DialogButton.d.ts → cjs/DialogButton.d.ts} +0 -0
  300. /package/lib/{DnDList.d.ts → cjs/DnDList.d.ts} +0 -0
  301. /package/lib/{DraggablePaperComponent.d.ts → cjs/DraggablePaperComponent.d.ts} +0 -0
  302. /package/lib/{EmailInput.d.ts → cjs/EmailInput.d.ts} +0 -0
  303. /package/lib/{FabBox.d.ts → cjs/FabBox.d.ts} +0 -0
  304. /package/lib/{FieldSetEx.d.ts → cjs/FieldSetEx.d.ts} +0 -0
  305. /package/lib/{FileUploadButton.d.ts → cjs/FileUploadButton.d.ts} +0 -0
  306. /package/lib/{FlexBox.d.ts → cjs/FlexBox.d.ts} +0 -0
  307. /package/lib/{GridDataCacheType.d.ts → cjs/GridDataCacheType.d.ts} +0 -0
  308. /package/lib/{GridDataFormat.d.ts → cjs/GridDataFormat.d.ts} +0 -0
  309. /package/lib/{GridUtils.d.ts → cjs/GridUtils.d.ts} +0 -0
  310. /package/lib/{HiSelector.d.ts → cjs/HiSelector.d.ts} +0 -0
  311. /package/lib/{HiSelectorTL.d.ts → cjs/HiSelectorTL.d.ts} +0 -0
  312. /package/lib/{IconButtonLink.d.ts → cjs/IconButtonLink.d.ts} +0 -0
  313. /package/lib/{InputField.d.ts → cjs/InputField.d.ts} +0 -0
  314. /package/lib/{InputTipField.d.ts → cjs/InputTipField.d.ts} +0 -0
  315. /package/lib/{IntInputField.d.ts → cjs/IntInputField.d.ts} +0 -0
  316. /package/lib/{ItemList.d.ts → cjs/ItemList.d.ts} +0 -0
  317. /package/lib/{ListChooser.d.ts → cjs/ListChooser.d.ts} +0 -0
  318. /package/lib/{ListItemRightIcon.d.ts → cjs/ListItemRightIcon.d.ts} +0 -0
  319. /package/lib/{ListMoreDisplay.d.ts → cjs/ListMoreDisplay.d.ts} +0 -0
  320. /package/lib/{LoadingButton.d.ts → cjs/LoadingButton.d.ts} +0 -0
  321. /package/lib/{MUGlobal.d.ts → cjs/MUGlobal.d.ts} +0 -0
  322. /package/lib/{MUUtils.d.ts → cjs/MUUtils.d.ts} +0 -0
  323. /package/lib/{MenuButton.d.ts → cjs/MenuButton.d.ts} +0 -0
  324. /package/lib/{MobileListItemRenderer.d.ts → cjs/MobileListItemRenderer.d.ts} +0 -0
  325. /package/lib/{MoneyInputField.d.ts → cjs/MoneyInputField.d.ts} +0 -0
  326. /package/lib/{MoreFab.d.ts → cjs/MoreFab.d.ts} +0 -0
  327. /package/lib/{NotifierMU.d.ts → cjs/NotifierMU.d.ts} +0 -0
  328. /package/lib/{NotifierPopupProps.d.ts → cjs/NotifierPopupProps.d.ts} +0 -0
  329. /package/lib/{NotifierPromptProps.d.ts → cjs/NotifierPromptProps.d.ts} +0 -0
  330. /package/lib/{NumberInputField.d.ts → cjs/NumberInputField.d.ts} +0 -0
  331. /package/lib/{OptionBool.d.ts → cjs/OptionBool.d.ts} +0 -0
  332. /package/lib/{OptionGroup.d.ts → cjs/OptionGroup.d.ts} +0 -0
  333. /package/lib/{OptionGroupFlag.d.ts → cjs/OptionGroupFlag.d.ts} +0 -0
  334. /package/lib/{PList.d.ts → cjs/PList.d.ts} +0 -0
  335. /package/lib/{PercentCircularProgress.d.ts → cjs/PercentCircularProgress.d.ts} +0 -0
  336. /package/lib/{PercentLinearProgress.d.ts → cjs/PercentLinearProgress.d.ts} +0 -0
  337. /package/lib/{ProgressCount.d.ts → cjs/ProgressCount.d.ts} +0 -0
  338. /package/lib/{PullToRefreshUI.d.ts → cjs/PullToRefreshUI.d.ts} +0 -0
  339. /package/lib/{QuickList.d.ts → cjs/QuickList.d.ts} +0 -0
  340. /package/lib/{RegionsRQ.d.ts → cjs/RegionsRQ.d.ts} +0 -0
  341. /package/lib/{ResponsibleContainer.d.ts → cjs/ResponsibleContainer.d.ts} +0 -0
  342. /package/lib/{ResponsiveStyleValue.d.ts → cjs/ResponsiveStyleValue.d.ts} +0 -0
  343. /package/lib/{ScrollTopFab.d.ts → cjs/ScrollTopFab.d.ts} +0 -0
  344. /package/lib/{ScrollerListEx.d.ts → cjs/ScrollerListEx.d.ts} +0 -0
  345. /package/lib/{SearchBar.d.ts → cjs/SearchBar.d.ts} +0 -0
  346. /package/lib/{SearchField.d.ts → cjs/SearchField.d.ts} +0 -0
  347. /package/lib/{SearchOptionGroup.d.ts → cjs/SearchOptionGroup.d.ts} +0 -0
  348. /package/lib/{SelectBool.d.ts → cjs/SelectBool.d.ts} +0 -0
  349. /package/lib/{SelectEx.d.ts → cjs/SelectEx.d.ts} +0 -0
  350. /package/lib/{ShowDataComparison.d.ts → cjs/ShowDataComparison.d.ts} +0 -0
  351. /package/lib/{Switch.d.ts → cjs/Switch.d.ts} +0 -0
  352. /package/lib/{SwitchAnt.d.ts → cjs/SwitchAnt.d.ts} +0 -0
  353. /package/lib/{SwitchField.d.ts → cjs/SwitchField.d.ts} +0 -0
  354. /package/lib/{TabBox.d.ts → cjs/TabBox.d.ts} +0 -0
  355. /package/lib/{TableEx.d.ts → cjs/TableEx.d.ts} +0 -0
  356. /package/lib/{TagList.d.ts → cjs/TagList.d.ts} +0 -0
  357. /package/lib/{TagListPro.d.ts → cjs/TagListPro.d.ts} +0 -0
  358. /package/lib/{TextFieldEx.d.ts → cjs/TextFieldEx.d.ts} +0 -0
  359. /package/lib/{Tiplist.d.ts → cjs/Tiplist.d.ts} +0 -0
  360. /package/lib/{TiplistPro.d.ts → cjs/TiplistPro.d.ts} +0 -0
  361. /package/lib/{TooltipClick.d.ts → cjs/TooltipClick.d.ts} +0 -0
  362. /package/lib/{TwoFieldInput.d.ts → cjs/TwoFieldInput.d.ts} +0 -0
  363. /package/lib/{UserAvatar.d.ts → cjs/UserAvatar.d.ts} +0 -0
  364. /package/lib/{UserAvatarEditor.d.ts → cjs/UserAvatarEditor.d.ts} +0 -0
  365. /package/lib/{app → cjs/app}/CommonApp.d.ts +0 -0
  366. /package/lib/{app → cjs/app}/IServiceApp.d.ts +0 -0
  367. /package/lib/{app → cjs/app}/IServiceAppSettings.d.ts +0 -0
  368. /package/lib/{app → cjs/app}/IServicePage.d.ts +0 -0
  369. /package/lib/{app → cjs/app}/IServiceUser.d.ts +0 -0
  370. /package/lib/{app → cjs/app}/ISmartERPUser.d.ts +0 -0
  371. /package/lib/{app → cjs/app}/Labels.d.ts +0 -0
  372. /package/lib/{app → cjs/app}/ReactApp.d.ts +0 -0
  373. /package/lib/{app → cjs/app}/ServiceApp.d.ts +0 -0
  374. /package/lib/{custom → cjs/custom}/CustomFieldUtils.d.ts +0 -0
  375. /package/lib/{custom → cjs/custom}/CustomFieldViewer.d.ts +0 -0
  376. /package/lib/{custom → cjs/custom}/CustomFieldWindow.d.ts +0 -0
  377. /package/lib/{custom → cjs/custom}/FieldAmountLabel.d.ts +0 -0
  378. /package/lib/{custom → cjs/custom}/FieldCheckbox.d.ts +0 -0
  379. /package/lib/{custom → cjs/custom}/FieldCombobox.d.ts +0 -0
  380. /package/lib/{custom → cjs/custom}/FieldDateInput.d.ts +0 -0
  381. /package/lib/{custom → cjs/custom}/FieldDivider.d.ts +0 -0
  382. /package/lib/{custom → cjs/custom}/FieldInput.d.ts +0 -0
  383. /package/lib/{custom → cjs/custom}/FieldJson.d.ts +0 -0
  384. /package/lib/{custom → cjs/custom}/FieldLabel.d.ts +0 -0
  385. /package/lib/{custom → cjs/custom}/FieldNumberInput.d.ts +0 -0
  386. /package/lib/{custom → cjs/custom}/FieldRadio.d.ts +0 -0
  387. /package/lib/{custom → cjs/custom}/FieldSelect.d.ts +0 -0
  388. /package/lib/{custom → cjs/custom}/FieldSwitch.d.ts +0 -0
  389. /package/lib/{custom → cjs/custom}/FieldTexarea.d.ts +0 -0
  390. /package/lib/{index.d.ts → cjs/index.d.ts} +0 -0
  391. /package/lib/{messages → cjs/messages}/MessageUtils.d.ts +0 -0
  392. /package/lib/{messages → cjs/messages}/OperationMessageContainer.d.ts +0 -0
  393. /package/lib/{messages → cjs/messages}/OperationMessageDto.d.ts +0 -0
  394. /package/lib/{messages → cjs/messages}/OperationMessageHandler.d.ts +0 -0
  395. /package/lib/{messages → cjs/messages}/RefreshHandler.d.ts +0 -0
  396. /package/lib/{messages → cjs/messages}/SignalRUser.d.ts +0 -0
  397. /package/lib/{pages → cjs/pages}/CommonPage.d.ts +0 -0
  398. /package/lib/{pages → cjs/pages}/DataGridPage.d.ts +0 -0
  399. /package/lib/{pages → cjs/pages}/DataGridPageProps.d.ts +0 -0
  400. /package/lib/{pages → cjs/pages}/DrawerHeader.d.ts +0 -0
  401. /package/lib/{pages → cjs/pages}/EditPage.d.ts +0 -0
  402. /package/lib/{pages → cjs/pages}/FixedListPage.d.ts +0 -0
  403. /package/lib/{pages → cjs/pages}/LeftDrawer.d.ts +0 -0
  404. /package/lib/{pages → cjs/pages}/ListPage.d.ts +0 -0
  405. /package/lib/{pages → cjs/pages}/ResponsivePage.d.ts +0 -0
  406. /package/lib/{pages → cjs/pages}/SearchPageProps.d.ts +0 -0
  407. /package/lib/{pages → cjs/pages}/TablePage.d.ts +0 -0
  408. /package/lib/{pages → cjs/pages}/UserMenu.d.ts +0 -0
  409. /package/lib/{pages → cjs/pages}/ViewPage.d.ts +0 -0
  410. /package/lib/{texts → cjs/texts}/DateText.d.ts +0 -0
  411. /package/lib/{texts → cjs/texts}/MoneyText.d.ts +0 -0
  412. /package/lib/{texts → cjs/texts}/NumberText.d.ts +0 -0
  413. /package/lib/{AddresSelector.js → mjs/AddresSelector.js} +0 -0
  414. /package/lib/{AuditDisplay.js → mjs/AuditDisplay.js} +0 -0
  415. /package/lib/{AutocompleteExtendedProps.js → mjs/AutocompleteExtendedProps.js} +0 -0
  416. /package/lib/{BackButton.js → mjs/BackButton.js} +0 -0
  417. /package/lib/{BridgeCloseButton.js → mjs/BridgeCloseButton.js} +0 -0
  418. /package/lib/{ButtonLink.js → mjs/ButtonLink.js} +0 -0
  419. /package/lib/{ButtonPopover.js → mjs/ButtonPopover.js} +0 -0
  420. /package/lib/{ComboBox.js → mjs/ComboBox.js} +0 -0
  421. /package/lib/{ComboBoxMultiple.js → mjs/ComboBoxMultiple.js} +0 -0
  422. /package/lib/{ComboBoxPro.js → mjs/ComboBoxPro.js} +0 -0
  423. /package/lib/{CountdownButton.js → mjs/CountdownButton.js} +0 -0
  424. /package/lib/{CountryList.js → mjs/CountryList.js} +0 -0
  425. /package/lib/{CultureDataTable.js → mjs/CultureDataTable.js} +0 -0
  426. /package/lib/{CustomFabProps.js → mjs/CustomFabProps.js} +0 -0
  427. /package/lib/{DataGridEx.js → mjs/DataGridEx.js} +0 -0
  428. /package/lib/{DataGridRenderers.js → mjs/DataGridRenderers.js} +0 -0
  429. /package/lib/{DataSteps.js → mjs/DataSteps.js} +0 -0
  430. /package/lib/{DataTable.js → mjs/DataTable.js} +0 -0
  431. /package/lib/{DialogButton.js → mjs/DialogButton.js} +0 -0
  432. /package/lib/{DnDList.js → mjs/DnDList.js} +0 -0
  433. /package/lib/{DraggablePaperComponent.js → mjs/DraggablePaperComponent.js} +0 -0
  434. /package/lib/{EmailInput.js → mjs/EmailInput.js} +0 -0
  435. /package/lib/{FabBox.js → mjs/FabBox.js} +0 -0
  436. /package/lib/{FieldSetEx.js → mjs/FieldSetEx.js} +0 -0
  437. /package/lib/{FileUploadButton.js → mjs/FileUploadButton.js} +0 -0
  438. /package/lib/{FlexBox.js → mjs/FlexBox.js} +0 -0
  439. /package/lib/{GridDataCacheType.js → mjs/GridDataCacheType.js} +0 -0
  440. /package/lib/{GridDataFormat.js → mjs/GridDataFormat.js} +0 -0
  441. /package/lib/{GridUtils.js → mjs/GridUtils.js} +0 -0
  442. /package/lib/{HiSelector.js → mjs/HiSelector.js} +0 -0
  443. /package/lib/{HiSelectorTL.js → mjs/HiSelectorTL.js} +0 -0
  444. /package/lib/{IconButtonLink.js → mjs/IconButtonLink.js} +0 -0
  445. /package/lib/{InputField.js → mjs/InputField.js} +0 -0
  446. /package/lib/{InputTipField.js → mjs/InputTipField.js} +0 -0
  447. /package/lib/{IntInputField.js → mjs/IntInputField.js} +0 -0
  448. /package/lib/{ItemList.js → mjs/ItemList.js} +0 -0
  449. /package/lib/{ListChooser.js → mjs/ListChooser.js} +0 -0
  450. /package/lib/{ListItemRightIcon.js → mjs/ListItemRightIcon.js} +0 -0
  451. /package/lib/{ListMoreDisplay.js → mjs/ListMoreDisplay.js} +0 -0
  452. /package/lib/{LoadingButton.js → mjs/LoadingButton.js} +0 -0
  453. /package/lib/{MUGlobal.js → mjs/MUGlobal.js} +0 -0
  454. /package/lib/{MUUtils.js → mjs/MUUtils.js} +0 -0
  455. /package/lib/{MenuButton.js → mjs/MenuButton.js} +0 -0
  456. /package/lib/{MobileListItemRenderer.js → mjs/MobileListItemRenderer.js} +0 -0
  457. /package/lib/{MoneyInputField.js → mjs/MoneyInputField.js} +0 -0
  458. /package/lib/{MoreFab.js → mjs/MoreFab.js} +0 -0
  459. /package/lib/{NotifierMU.js → mjs/NotifierMU.js} +0 -0
  460. /package/lib/{NotifierPopupProps.js → mjs/NotifierPopupProps.js} +0 -0
  461. /package/lib/{NotifierPromptProps.js → mjs/NotifierPromptProps.js} +0 -0
  462. /package/lib/{NumberInputField.js → mjs/NumberInputField.js} +0 -0
  463. /package/lib/{OptionBool.js → mjs/OptionBool.js} +0 -0
  464. /package/lib/{OptionGroup.js → mjs/OptionGroup.js} +0 -0
  465. /package/lib/{OptionGroupFlag.js → mjs/OptionGroupFlag.js} +0 -0
  466. /package/lib/{PList.js → mjs/PList.js} +0 -0
  467. /package/lib/{PercentCircularProgress.js → mjs/PercentCircularProgress.js} +0 -0
  468. /package/lib/{PercentLinearProgress.js → mjs/PercentLinearProgress.js} +0 -0
  469. /package/lib/{ProgressCount.js → mjs/ProgressCount.js} +0 -0
  470. /package/lib/{PullToRefreshUI.js → mjs/PullToRefreshUI.js} +0 -0
  471. /package/lib/{QuickList.js → mjs/QuickList.js} +0 -0
  472. /package/lib/{RegionsRQ.js → mjs/RegionsRQ.js} +0 -0
  473. /package/lib/{ResponsibleContainer.js → mjs/ResponsibleContainer.js} +0 -0
  474. /package/lib/{ResponsiveStyleValue.js → mjs/ResponsiveStyleValue.js} +0 -0
  475. /package/lib/{ScrollTopFab.js → mjs/ScrollTopFab.js} +0 -0
  476. /package/lib/{ScrollerListEx.js → mjs/ScrollerListEx.js} +0 -0
  477. /package/lib/{SearchBar.js → mjs/SearchBar.js} +0 -0
  478. /package/lib/{SearchField.js → mjs/SearchField.js} +0 -0
  479. /package/lib/{SearchOptionGroup.js → mjs/SearchOptionGroup.js} +0 -0
  480. /package/lib/{SelectBool.js → mjs/SelectBool.js} +0 -0
  481. /package/lib/{SelectEx.js → mjs/SelectEx.js} +0 -0
  482. /package/lib/{ShowDataComparison.js → mjs/ShowDataComparison.js} +0 -0
  483. /package/lib/{Switch.js → mjs/Switch.js} +0 -0
  484. /package/lib/{SwitchAnt.js → mjs/SwitchAnt.js} +0 -0
  485. /package/lib/{SwitchField.js → mjs/SwitchField.js} +0 -0
  486. /package/lib/{TabBox.js → mjs/TabBox.js} +0 -0
  487. /package/lib/{TableEx.js → mjs/TableEx.js} +0 -0
  488. /package/lib/{TagList.js → mjs/TagList.js} +0 -0
  489. /package/lib/{TagListPro.js → mjs/TagListPro.js} +0 -0
  490. /package/lib/{TextFieldEx.js → mjs/TextFieldEx.js} +0 -0
  491. /package/lib/{Tiplist.js → mjs/Tiplist.js} +0 -0
  492. /package/lib/{TiplistPro.js → mjs/TiplistPro.js} +0 -0
  493. /package/lib/{TooltipClick.js → mjs/TooltipClick.js} +0 -0
  494. /package/lib/{TwoFieldInput.js → mjs/TwoFieldInput.js} +0 -0
  495. /package/lib/{UserAvatar.js → mjs/UserAvatar.js} +0 -0
  496. /package/lib/{UserAvatarEditor.js → mjs/UserAvatarEditor.js} +0 -0
  497. /package/lib/{app → mjs/app}/CommonApp.js +0 -0
  498. /package/lib/{app → mjs/app}/IServiceApp.js +0 -0
  499. /package/lib/{app → mjs/app}/IServiceAppSettings.js +0 -0
  500. /package/lib/{app → mjs/app}/IServicePage.js +0 -0
  501. /package/lib/{app → mjs/app}/IServiceUser.js +0 -0
  502. /package/lib/{app → mjs/app}/ISmartERPUser.js +0 -0
  503. /package/lib/{app → mjs/app}/Labels.js +0 -0
  504. /package/lib/{app → mjs/app}/ReactApp.js +0 -0
  505. /package/lib/{app → mjs/app}/ServiceApp.js +0 -0
  506. /package/lib/{custom → mjs/custom}/CustomFieldUtils.js +0 -0
  507. /package/lib/{custom → mjs/custom}/CustomFieldViewer.js +0 -0
  508. /package/lib/{custom → mjs/custom}/CustomFieldWindow.js +0 -0
  509. /package/lib/{custom → mjs/custom}/FieldAmountLabel.js +0 -0
  510. /package/lib/{custom → mjs/custom}/FieldCheckbox.js +0 -0
  511. /package/lib/{custom → mjs/custom}/FieldCombobox.js +0 -0
  512. /package/lib/{custom → mjs/custom}/FieldDateInput.js +0 -0
  513. /package/lib/{custom → mjs/custom}/FieldDivider.js +0 -0
  514. /package/lib/{custom → mjs/custom}/FieldInput.js +0 -0
  515. /package/lib/{custom → mjs/custom}/FieldJson.js +0 -0
  516. /package/lib/{custom → mjs/custom}/FieldLabel.js +0 -0
  517. /package/lib/{custom → mjs/custom}/FieldNumberInput.js +0 -0
  518. /package/lib/{custom → mjs/custom}/FieldRadio.js +0 -0
  519. /package/lib/{custom → mjs/custom}/FieldSelect.js +0 -0
  520. /package/lib/{custom → mjs/custom}/FieldSwitch.js +0 -0
  521. /package/lib/{custom → mjs/custom}/FieldTexarea.js +0 -0
  522. /package/lib/{index.js → mjs/index.d.ts} +0 -0
  523. /package/lib/{messages → mjs/messages}/MessageUtils.js +0 -0
  524. /package/lib/{messages → mjs/messages}/OperationMessageContainer.js +0 -0
  525. /package/lib/{messages → mjs/messages}/OperationMessageDto.js +0 -0
  526. /package/lib/{messages → mjs/messages}/OperationMessageHandler.js +0 -0
  527. /package/lib/{messages → mjs/messages}/RefreshHandler.js +0 -0
  528. /package/lib/{messages → mjs/messages}/SignalRUser.js +0 -0
  529. /package/lib/{pages → mjs/pages}/CommonPage.js +0 -0
  530. /package/lib/{pages → mjs/pages}/DataGridPage.js +0 -0
  531. /package/lib/{pages → mjs/pages}/DataGridPageProps.js +0 -0
  532. /package/lib/{pages → mjs/pages}/DrawerHeader.js +0 -0
  533. /package/lib/{pages → mjs/pages}/EditPage.js +0 -0
  534. /package/lib/{pages → mjs/pages}/FixedListPage.js +0 -0
  535. /package/lib/{pages → mjs/pages}/LeftDrawer.js +0 -0
  536. /package/lib/{pages → mjs/pages}/ListPage.js +0 -0
  537. /package/lib/{pages → mjs/pages}/ResponsivePage.js +0 -0
  538. /package/lib/{pages → mjs/pages}/SearchPageProps.js +0 -0
  539. /package/lib/{pages → mjs/pages}/TablePage.js +0 -0
  540. /package/lib/{pages → mjs/pages}/UserMenu.js +0 -0
  541. /package/lib/{texts → mjs/texts}/DateText.js +0 -0
  542. /package/lib/{texts → mjs/texts}/MoneyText.js +0 -0
  543. /package/lib/{texts → mjs/texts}/NumberText.js +0 -0
@@ -0,0 +1,232 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServiceApp = void 0;
4
+ const appscript_1 = require("@etsoo/appscript");
5
+ const ReactApp_1 = require("./ReactApp");
6
+ const coreName = "core";
7
+ const coreTokenKey = "core-refresh-token";
8
+ const tryLoginKey = "tryLogin";
9
+ /**
10
+ * Core Service App
11
+ * Service login to core system, get the refesh token and access token
12
+ * Use the acess token to the service api, get a service access token
13
+ * Use the new acess token and refresh token to login
14
+ */
15
+ class ServiceApp extends ReactApp_1.ReactApp {
16
+ /**
17
+ * Core endpoint
18
+ */
19
+ coreEndpoint;
20
+ /**
21
+ * Core system API
22
+ */
23
+ coreApi;
24
+ /**
25
+ * Core system origin
26
+ */
27
+ coreOrigin;
28
+ coreAccessToken;
29
+ /**
30
+ * Constructor
31
+ * @param settings Settings
32
+ * @param name Application name
33
+ * @param debug Debug mode
34
+ */
35
+ constructor(settings, name, debug = false) {
36
+ super(settings, name, debug);
37
+ const coreEndpoint = settings.endpoints?.core;
38
+ if (coreEndpoint == null) {
39
+ throw new Error("Core API endpont is required.");
40
+ }
41
+ this.coreEndpoint = coreEndpoint;
42
+ this.coreOrigin = new URL(coreEndpoint.webUrl).origin;
43
+ this.coreApi = this.createApi(coreName, coreEndpoint);
44
+ this.keepLogin = true;
45
+ }
46
+ /**
47
+ * Load core system UI
48
+ * @param tryLogin Try login or not
49
+ */
50
+ loadCore(tryLogin = false) {
51
+ if (appscript_1.BridgeUtils.host == null) {
52
+ let url = this.coreEndpoint.webUrl;
53
+ if (!tryLogin)
54
+ url = url.addUrlParam(tryLoginKey, tryLogin);
55
+ globalThis.location.href = url;
56
+ }
57
+ else {
58
+ const startUrl = tryLogin
59
+ ? undefined
60
+ : "".addUrlParam(tryLoginKey, tryLogin);
61
+ appscript_1.BridgeUtils.host.loadApp(coreName, startUrl);
62
+ }
63
+ }
64
+ /**
65
+ * Go to the login page
66
+ * @param data Login parameters
67
+ */
68
+ toLoginPage(data) {
69
+ // Destruct
70
+ const { removeUrl, showLoading, params } = data ?? {};
71
+ // Cache current URL
72
+ this.cachedUrl = removeUrl ? undefined : globalThis.location.href;
73
+ // Get the redirect URL
74
+ new appscript_1.AuthApi(this)
75
+ .getLogInUrl({
76
+ region: this.region,
77
+ device: this.deviceId
78
+ })
79
+ .then((url) => {
80
+ if (!url)
81
+ return;
82
+ // Add try login flag
83
+ if (params != null) {
84
+ url = url.addUrlParams(params);
85
+ }
86
+ // Is it embeded?
87
+ if (this.embedded) {
88
+ globalThis.parent.postMessage(["login", url], this.coreOrigin);
89
+ }
90
+ else {
91
+ if (appscript_1.BridgeUtils.host == null) {
92
+ globalThis.location.href = url;
93
+ }
94
+ else {
95
+ appscript_1.BridgeUtils.host.loadApp(coreName, url);
96
+ }
97
+ }
98
+ });
99
+ // Make sure apply new device id for new login
100
+ this.clearDeviceId();
101
+ }
102
+ /**
103
+ * Signout, with userLogout and toLoginPage
104
+ * @param action Callback
105
+ */
106
+ signout(action) {
107
+ // Clear core token
108
+ this.storage.setData(coreTokenKey, undefined);
109
+ // Super call
110
+ return super.signout(action);
111
+ }
112
+ /**
113
+ *
114
+ * @param user Current user
115
+ * @param core Core system API token data
116
+ * @param keep Keep in local storage or not
117
+ * @param dispatch User state dispatch
118
+ */
119
+ userLoginEx(user, core, dispatch) {
120
+ if (user.clientDeviceId && user.passphrase) {
121
+ // Save the passphrase
122
+ // Interpolated string expressions are different between TypeScript and C# for the null value
123
+ const passphrase = this.decrypt(user.passphrase, `${user.uid ?? ""}-${this.settings.appId}`);
124
+ if (passphrase) {
125
+ this.deviceId = user.clientDeviceId;
126
+ this.updatePassphrase(passphrase);
127
+ }
128
+ }
129
+ // User login
130
+ const { refreshToken } = user;
131
+ // Core system login
132
+ // It's the extreme case, the core system token should not be the same with the current app user token
133
+ core ??= {
134
+ refreshToken,
135
+ accessToken: user.token,
136
+ tokenType: user.tokenScheme ?? "Bearer",
137
+ expiresIn: user.seconds
138
+ };
139
+ // Cache the core system data
140
+ this.saveCoreToken(core);
141
+ // User login and trigger the dispatch at last
142
+ this.userLogin(user, refreshToken, dispatch);
143
+ }
144
+ /**
145
+ * Save core system data
146
+ * @param data Data
147
+ */
148
+ saveCoreToken(data) {
149
+ // Hold the core system access token
150
+ this.coreAccessToken = data.accessToken;
151
+ // Cache the core system refresh token
152
+ this.storage.setData(coreTokenKey, this.encrypt(data.refreshToken));
153
+ // Exchange tokens
154
+ this.exchangeTokenAll(data, coreName);
155
+ }
156
+ /**
157
+ * Switch organization
158
+ * @param organizationId Organization ID
159
+ * @param fromOrganizationId From organization ID
160
+ * @param payload Payload
161
+ */
162
+ async switchOrg(organizationId, fromOrganizationId, payload) {
163
+ if (!this.coreAccessToken) {
164
+ throw new Error("Core access token is required to switch organization.");
165
+ }
166
+ const [result, refreshToken] = await new appscript_1.AuthApi(this).switchOrg({ organizationId, fromOrganizationId, token: this.coreAccessToken }, payload);
167
+ if (result == null)
168
+ return;
169
+ if (!result.ok) {
170
+ return result;
171
+ }
172
+ if (result.data == null) {
173
+ throw new Error("Invalid switch organization result.");
174
+ }
175
+ let core;
176
+ if ("core" in result.data && typeof result.data.core === "string") {
177
+ core = JSON.parse(result.data.core);
178
+ delete result.data.core;
179
+ }
180
+ // Override the user data's refresh token
181
+ const user = refreshToken ? { ...result.data, refreshToken } : result.data;
182
+ // User login
183
+ this.userLoginEx(user, core, true);
184
+ return result;
185
+ }
186
+ async refreshTokenSucceed(user, token, callback) {
187
+ // Check core system token
188
+ const coreToken = this.storage.getData(coreTokenKey);
189
+ if (!coreToken) {
190
+ callback?.({ ok: false, type: "noData", title: "Core token is blank" });
191
+ return;
192
+ }
193
+ const coreTokenDecrypted = this.decrypt(coreToken);
194
+ if (!coreTokenDecrypted) {
195
+ callback?.({
196
+ ok: false,
197
+ type: "noData",
198
+ title: "Core token decrypted is blank"
199
+ });
200
+ return;
201
+ }
202
+ // Call the core system API refresh token
203
+ const data = await this.apiRefreshTokenData(this.coreApi, {
204
+ token: coreTokenDecrypted,
205
+ appId: this.settings.appId
206
+ });
207
+ if (data == null)
208
+ return;
209
+ // Cache the core system refresh token
210
+ // Follow similar logic in userLoginEx
211
+ this.saveCoreToken(data);
212
+ // Call the super
213
+ await super.refreshTokenSucceed(user, token, callback);
214
+ }
215
+ /**
216
+ * Try login
217
+ * @param params Login parameters
218
+ */
219
+ async tryLogin(params) {
220
+ // Destruct
221
+ params ??= {};
222
+ let { onFailure, ...rest } = params;
223
+ if (onFailure == null) {
224
+ onFailure = params.onFailure = (type) => {
225
+ console.log(`Try login failed: ${type}.`);
226
+ this.toLoginPage(rest);
227
+ };
228
+ }
229
+ return await super.tryLogin(params);
230
+ }
231
+ }
232
+ exports.ServiceApp = ServiceApp;
@@ -0,0 +1,152 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CustomFieldUtils = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const material_1 = require("@mui/material");
9
+ const react_1 = __importDefault(require("react"));
10
+ const FieldCheckbox_1 = require("./FieldCheckbox");
11
+ const FieldAmountLabel_1 = require("./FieldAmountLabel");
12
+ const FieldDateInput_1 = require("./FieldDateInput");
13
+ const FieldDivider_1 = require("./FieldDivider");
14
+ const FieldCombobox_1 = require("./FieldCombobox");
15
+ const FieldInput_1 = require("./FieldInput");
16
+ const FieldLabel_1 = require("./FieldLabel");
17
+ const FieldNumberInput_1 = require("./FieldNumberInput");
18
+ const FieldTexarea_1 = require("./FieldTexarea");
19
+ const FieldJson_1 = require("./FieldJson");
20
+ const FieldRadio_1 = require("./FieldRadio");
21
+ const FieldSelect_1 = require("./FieldSelect");
22
+ const FieldSwitch_1 = require("./FieldSwitch");
23
+ /**
24
+ * Custom field utilities
25
+ */
26
+ var CustomFieldUtils;
27
+ (function (CustomFieldUtils) {
28
+ /**
29
+ * Custom field creators
30
+ */
31
+ CustomFieldUtils.customFieldCreators = {
32
+ amountlabel: FieldAmountLabel_1.FieldAmountLabel,
33
+ checkbox: FieldCheckbox_1.FieldCheckbox,
34
+ combobox: FieldCombobox_1.FieldCombobox,
35
+ date: FieldDateInput_1.FieldDateInput,
36
+ divider: FieldDivider_1.FieldDivider,
37
+ input: FieldInput_1.FieldInput,
38
+ json: FieldJson_1.FieldJson,
39
+ label: FieldLabel_1.FieldLabel,
40
+ number: FieldNumberInput_1.FieldNumberInput,
41
+ radio: FieldRadio_1.FieldRadio,
42
+ select: FieldSelect_1.FieldSelect,
43
+ switch: FieldSwitch_1.FieldSwitch,
44
+ textarea: FieldTexarea_1.FieldTexarea
45
+ };
46
+ /**
47
+ * Create layout
48
+ * @param fields Fields
49
+ * @param collections Ref collections
50
+ * @param getValue Get default value callback
51
+ * @param onChange Callback for value change
52
+ * @param globalCallback Global label callback, can be repeated
53
+ * @param fieldCalback Field callback
54
+ * @returns
55
+ */
56
+ function create(fields, collections, getValue, onChange, globalCallback, fieldCalback) {
57
+ return fields.map((field, index) => {
58
+ // Global callback for labels
59
+ if (globalCallback) {
60
+ if (field.label)
61
+ field.label = globalCallback(field.label);
62
+ if (field.helperText)
63
+ field.helperText = globalCallback(field.helperText);
64
+ if (field.mainSlotProps)
65
+ updateProperties(field.mainSlotProps, globalCallback);
66
+ }
67
+ // Field callback for each field
68
+ if (fieldCalback)
69
+ fieldCalback(field);
70
+ const creator = CustomFieldUtils.customFieldCreators[field.type];
71
+ if (creator == null) {
72
+ return ((0, jsx_runtime_1.jsx)(material_1.Grid2, { size: transformSpace(field.space), ...field.gridItemProps, children: `Type ${field.type} is not supported currently` }, index));
73
+ }
74
+ const Creator = creator;
75
+ const mref = react_1.default.createRef();
76
+ let ui = ((0, jsx_runtime_1.jsx)(Creator, { field: field, mref: mref, onChange: onChange, defaultValue: getValue(field) }));
77
+ const name = field.name;
78
+ if (name) {
79
+ if (collections[name] == null) {
80
+ collections[name] = [mref, field];
81
+ }
82
+ else {
83
+ ui = `Duplicate custom field ${name}`;
84
+ }
85
+ }
86
+ return ((0, jsx_runtime_1.jsx)(material_1.Grid2, { size: transformSpace(field.space), ...field.gridItemProps, children: ui }, name ?? index));
87
+ });
88
+ }
89
+ CustomFieldUtils.create = create;
90
+ /**
91
+ * Create multiline label
92
+ * @param label Original label
93
+ * @param props Properties
94
+ * @returns Result
95
+ */
96
+ function createMultilineLabel(label, props) {
97
+ return label?.split("\n").map((line, index) => ((0, jsx_runtime_1.jsx)(material_1.Typography, { component: "div", ...props, children: line }, index)));
98
+ }
99
+ CustomFieldUtils.createMultilineLabel = createMultilineLabel;
100
+ /**
101
+ * Transform custom field space
102
+ * @param space Space
103
+ * @returns Result
104
+ */
105
+ function transformSpace(space) {
106
+ const size = space === "full"
107
+ ? { xs: 12 }
108
+ : space === "quater"
109
+ ? { sm: 12, md: 6, lg: 3 }
110
+ : space === "five"
111
+ ? { sm: 12, md: 5 }
112
+ : space === "seven"
113
+ ? { sm: 12, md: 7 }
114
+ : space === "half1"
115
+ ? { xs: 12, sm: 6 }
116
+ : { sm: 12, md: 6 };
117
+ return size;
118
+ }
119
+ CustomFieldUtils.transformSpace = transformSpace;
120
+ /**
121
+ * Update ref options
122
+ * @param fields Fields
123
+ * @param callback Callback
124
+ */
125
+ function updateOptions(fields, callback) {
126
+ fields.forEach((field) => {
127
+ if (field.refs == null || field.refs.length < 2)
128
+ return;
129
+ const key = field.refs[0];
130
+ const ids = field.refs.slice(1);
131
+ field.options = callback(key, ids);
132
+ });
133
+ }
134
+ CustomFieldUtils.updateOptions = updateOptions;
135
+ /**
136
+ * Update properties
137
+ * @param input Input object
138
+ * @param globalCallback Global callback
139
+ */
140
+ function updateProperties(input, globalCallback) {
141
+ for (const key in input) {
142
+ const value = Reflect.get(input, key);
143
+ if (typeof value === "string") {
144
+ Reflect.set(input, key, globalCallback(value));
145
+ }
146
+ else if (typeof value === "object" && value != null) {
147
+ updateProperties(value, globalCallback);
148
+ }
149
+ }
150
+ }
151
+ CustomFieldUtils.updateProperties = updateProperties;
152
+ })(CustomFieldUtils || (exports.CustomFieldUtils = CustomFieldUtils = {}));
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CustomFieldViewer = CustomFieldViewer;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const material_1 = require("@mui/material");
6
+ const CustomFieldUtils_1 = require("./CustomFieldUtils");
7
+ const MUGlobal_1 = require("../MUGlobal");
8
+ const FlexBox_1 = require("../FlexBox");
9
+ const shared_1 = require("@etsoo/shared");
10
+ /**
11
+ * Custom field viewer
12
+ * 自定义字段查看器
13
+ * @param props Props
14
+ * @returns Component
15
+ */
16
+ function CustomFieldViewer(props) {
17
+ // Destruct
18
+ const { fields, gridProps, jsonData, titleProps, verticalGap = 0.5, valueLabelFormatter = (value, field) => {
19
+ if (value == null)
20
+ return "";
21
+ if (field.options) {
22
+ const option = field.options.find((o) => o.id === value);
23
+ if (option) {
24
+ return shared_1.DataTypes.getListItemLabel(option);
25
+ }
26
+ }
27
+ if (typeof value === "object") {
28
+ if (value instanceof Date) {
29
+ return value.toLocaleString();
30
+ }
31
+ else {
32
+ return JSON.stringify(value);
33
+ }
34
+ }
35
+ else {
36
+ return `${value}`;
37
+ }
38
+ }, valueProps } = props;
39
+ const spacing = MUGlobal_1.MUGlobal.half(MUGlobal_1.MUGlobal.pagePaddings);
40
+ const data = typeof jsonData === "string" ? JSON.parse(jsonData) : jsonData;
41
+ if (data == null || typeof data !== "object" || Array.isArray(data)) {
42
+ throw new Error("Invalid JSON data");
43
+ }
44
+ return ((0, jsx_runtime_1.jsx)(material_1.Grid2, { container: true, justifyContent: "left", spacing: spacing, sx: {
45
+ ".MuiTypography-subtitle2": {
46
+ fontWeight: "bold"
47
+ }
48
+ }, ...gridProps, children: fields.map((field, index) => {
49
+ // Field name
50
+ const name = field.name;
51
+ if (!name)
52
+ return;
53
+ // Field value
54
+ const value = shared_1.Utils.getNestedValue(data, name);
55
+ return ((0, jsx_runtime_1.jsx)(material_1.Grid2, { size: CustomFieldUtils_1.CustomFieldUtils.transformSpace(field.space), ...field.gridItemProps, children: (0, jsx_runtime_1.jsxs)(FlexBox_1.VBox, { gap: verticalGap, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: "bold", fontSize: "small", ...titleProps, children: field.label ?? name }), (0, jsx_runtime_1.jsx)(material_1.Typography, { ...valueProps, children: valueLabelFormatter(value, field) })] }) }, name ?? index));
56
+ }) }));
57
+ }
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.CustomFieldWindow = CustomFieldWindow;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const shared_1 = require("@etsoo/shared");
9
+ const material_1 = require("@mui/material");
10
+ const react_1 = __importDefault(require("react"));
11
+ const ReactApp_1 = require("../app/ReactApp");
12
+ const MUGlobal_1 = require("../MUGlobal");
13
+ const CustomFieldUtils_1 = require("./CustomFieldUtils");
14
+ function calculateKeys(data) {
15
+ let count = 0;
16
+ for (const key in data) {
17
+ const item = data[key];
18
+ if (typeof item === "object" && item !== null && !Array.isArray(item)) {
19
+ count += calculateKeys(item);
20
+ }
21
+ else {
22
+ count++;
23
+ }
24
+ }
25
+ return count;
26
+ }
27
+ function parseJsonData(jsonData) {
28
+ let data = {};
29
+ if (jsonData) {
30
+ try {
31
+ data =
32
+ typeof jsonData === "object"
33
+ ? jsonData
34
+ : typeof jsonData === "string"
35
+ ? JSON.parse(jsonData)
36
+ : {};
37
+ }
38
+ catch { }
39
+ }
40
+ return [data, calculateKeys(data)];
41
+ }
42
+ /**
43
+ * Custom field window
44
+ * 自定义字段窗口
45
+ * @param props Props
46
+ * @returns Component
47
+ */
48
+ function CustomFieldWindow(props) {
49
+ // Validate app
50
+ const app = ReactApp_1.globalApp;
51
+ if (app == null) {
52
+ throw new Error("No globalApp");
53
+ }
54
+ const { children, label = app.get("jsonData"), gridProps, jsonData, inputName = "jsonData", inputRef, onUpdate } = props;
55
+ const spacing = MUGlobal_1.MUGlobal.half(MUGlobal_1.MUGlobal.pagePaddings);
56
+ const [count, setCount] = react_1.default.useState(0);
57
+ const [initData, propertyCount] = parseJsonData(jsonData);
58
+ react_1.default.useEffect(() => setCount(propertyCount), [propertyCount]);
59
+ return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)("input", { type: "hidden", name: inputName, ref: inputRef }), children((customFields, jsonData) => {
60
+ const collections = {};
61
+ let data = {};
62
+ jsonData ??= inputRef?.current?.value;
63
+ if (jsonData) {
64
+ const [d, pc] = parseJsonData(jsonData);
65
+ data = d;
66
+ setCount(pc);
67
+ }
68
+ else {
69
+ data = initData;
70
+ }
71
+ app.notifier.confirm(label, undefined, (value) => {
72
+ if (value) {
73
+ if (inputRef?.current) {
74
+ inputRef.current.value = JSON.stringify(data);
75
+ }
76
+ setCount(calculateKeys(data));
77
+ if (onUpdate)
78
+ onUpdate(data);
79
+ }
80
+ }, {
81
+ fullScreen: app.smDown,
82
+ inputs: ((0, jsx_runtime_1.jsx)(material_1.Stack, { marginTop: 1.5, children: (0, jsx_runtime_1.jsx)(material_1.Grid2, { container: true, justifyContent: "left", spacing: spacing, sx: {
83
+ ".MuiTypography-subtitle2": {
84
+ fontWeight: "bold"
85
+ }
86
+ }, ...gridProps, children: CustomFieldUtils_1.CustomFieldUtils.create(customFields, collections, (field) => {
87
+ if (field.name == null)
88
+ return;
89
+ return shared_1.Utils.getNestedValue(data, field.name);
90
+ }, (name, value) => {
91
+ shared_1.Utils.setNestedValue(data, name, value);
92
+ }) }) }))
93
+ });
94
+ }, label, count)] }));
95
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FieldAmountLabel = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const shared_1 = require("@etsoo/shared");
9
+ const material_1 = require("@mui/material");
10
+ const react_1 = __importDefault(require("react"));
11
+ /**
12
+ * Amount label field creator
13
+ * type: amountlabel
14
+ * @returns Component
15
+ */
16
+ const FieldAmountLabel = ({ field, mref, defaultValue }) => {
17
+ // Destruct
18
+ const { label, mainSlotProps = {}, helperText } = field;
19
+ const { currency, ...rest } = mainSlotProps;
20
+ const currencySymbol = react_1.default.useMemo(() => (currency ? shared_1.NumberUtils.getCurrencySymbol(currency) : ""), [currency]);
21
+ // State
22
+ const [amountLabel, setAmountLabel] = react_1.default.useState(label);
23
+ react_1.default.useEffect(() => {
24
+ setAmountLabel(label);
25
+ }, [label]);
26
+ // Ref
27
+ const getValue = () => amountLabel;
28
+ const setValue = (value) => {
29
+ if (typeof value === "number") {
30
+ setAmountLabel(shared_1.NumberUtils.formatMoney(value));
31
+ }
32
+ else {
33
+ setAmountLabel(`${value} ?? ''`);
34
+ }
35
+ };
36
+ react_1.default.useImperativeHandle(mref, () => ({
37
+ getValue,
38
+ setValue
39
+ }));
40
+ react_1.default.useEffect(() => {
41
+ if (defaultValue == null)
42
+ return;
43
+ setValue(defaultValue);
44
+ }, [defaultValue]);
45
+ return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, { ...rest, children: [currencySymbol, " ", amountLabel] }), helperText && (0, jsx_runtime_1.jsx)(material_1.FormHelperText, { children: helperText })] }));
46
+ };
47
+ exports.FieldAmountLabel = FieldAmountLabel;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FieldCheckbox = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const material_1 = require("@mui/material");
9
+ const react_1 = __importDefault(require("react"));
10
+ const OptionGroup_1 = require("../OptionGroup");
11
+ /**
12
+ * Checkbox (multiple values) field creator
13
+ * type: checkbox
14
+ * @returns Component
15
+ */
16
+ const FieldCheckbox = ({ field, mref, onChange, defaultValue }) => {
17
+ // State
18
+ const [value, setLocalValue] = react_1.default.useState();
19
+ // Ref
20
+ const getValue = () => value;
21
+ const setValue = (value) => {
22
+ if (Array.isArray(value)) {
23
+ setLocalValue(value);
24
+ }
25
+ else if (typeof value === "string" || typeof value === "number") {
26
+ setLocalValue([value]);
27
+ }
28
+ else {
29
+ setLocalValue(undefined);
30
+ }
31
+ };
32
+ react_1.default.useImperativeHandle(mref, () => ({
33
+ getValue,
34
+ setValue
35
+ }));
36
+ react_1.default.useEffect(() => {
37
+ if (defaultValue == null)
38
+ return;
39
+ setValue(defaultValue);
40
+ }, [defaultValue]);
41
+ // Name
42
+ const name = field.name;
43
+ if (!name) {
44
+ return ((0, jsx_runtime_1.jsxs)(material_1.Typography, { children: ["No name for FieldCheckbox ", JSON.stringify(field)] }));
45
+ }
46
+ return ((0, jsx_runtime_1.jsx)(OptionGroup_1.OptionGroup, { name: name, options: field.options ?? [], multiple: true, row: true, helperText: field.helperText, label: field.label, variant: "outlined", fullWidth: true, defaultValue: value, onValueChange: (value) => {
47
+ const newValue = Array.isArray(value)
48
+ ? value
49
+ : value == null
50
+ ? undefined
51
+ : [value];
52
+ setLocalValue(newValue);
53
+ onChange(name, newValue);
54
+ }, ...field.mainSlotProps }));
55
+ };
56
+ exports.FieldCheckbox = FieldCheckbox;
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.FieldCombobox = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const material_1 = require("@mui/material");
9
+ const react_1 = __importDefault(require("react"));
10
+ const ComboBoxMultiple_1 = require("../ComboBoxMultiple");
11
+ /**
12
+ * Combobox (multiple values) field creator
13
+ * type combobox
14
+ * @returns Component
15
+ */
16
+ const FieldCombobox = ({ field, mref, onChange, defaultValue }) => {
17
+ // State
18
+ const [ids, setIds] = react_1.default.useState();
19
+ const getValue = () => ids;
20
+ const setValue = (value) => {
21
+ if (Array.isArray(value))
22
+ setIds(value);
23
+ else if (typeof value === "number" || typeof value === "string")
24
+ setIds([value]);
25
+ };
26
+ // Ref
27
+ react_1.default.useImperativeHandle(mref, () => ({
28
+ getValue,
29
+ setValue
30
+ }));
31
+ react_1.default.useEffect(() => {
32
+ if (defaultValue == null)
33
+ return;
34
+ setValue(defaultValue);
35
+ }, [defaultValue]);
36
+ // Name
37
+ const name = field.name;
38
+ if (!name) {
39
+ return ((0, jsx_runtime_1.jsxs)(material_1.Typography, { children: ["No name for FieldCombobox ", JSON.stringify(field)] }));
40
+ }
41
+ return ((0, jsx_runtime_1.jsx)(ComboBoxMultiple_1.ComboBoxMultiple, { label: field.label ?? "", inputHelperText: field.helperText, name: name, options: field.options, fullWidth: true, idValues: ids, onChange: (_event, value) => {
42
+ const ids = value.map((v) => v.id);
43
+ setIds(ids);
44
+ onChange(name, ids);
45
+ }, ...field.mainSlotProps }));
46
+ };
47
+ exports.FieldCombobox = FieldCombobox;