@_tc/template-core 0.0.1-bate.35 → 0.0.1-bate.37

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 (418) hide show
  1. package/cjs/app/controller/base.js +3 -3
  2. package/cjs/app/controller/project.js +1 -1
  3. package/cjs/app/controller/view.js +16 -7
  4. package/cjs/app/middleware/api-params-verify.js +10 -1
  5. package/cjs/app/middleware/error-handle.js +9 -3
  6. package/cjs/app/middleware/project-handler.js +1 -1
  7. package/cjs/app/router/view.js +3 -1
  8. package/cjs/app/router-schema/project.js +1 -1
  9. package/cjs/app/service/project.js +5 -0
  10. package/cjs/bundler/defaultAlias.js +5 -0
  11. package/cjs/bundler/dev.js +4 -3
  12. package/cjs/bundler/index.js +2 -1
  13. package/cjs/bundler/prod.js +4 -3
  14. package/cjs/bundler/utils.js +53 -24
  15. package/cjs/packages/common/LRUCache.js +4 -0
  16. package/cjs/packages/common/array/index.js +43 -0
  17. package/cjs/packages/common/cache/LRUCache.js +45 -0
  18. package/cjs/packages/common/cache/index.js +4 -0
  19. package/cjs/packages/common/guards/index.js +34 -0
  20. package/cjs/packages/common/i18n/default.js +95 -0
  21. package/cjs/packages/common/i18n/en-US.js +95 -0
  22. package/cjs/packages/common/i18n/index.js +178 -0
  23. package/cjs/packages/common/i18n/locales.js +17 -0
  24. package/cjs/packages/common/i18n/types.js +1 -0
  25. package/cjs/packages/common/index.js +65 -0
  26. package/cjs/packages/common/log/index.js +160 -0
  27. package/cjs/packages/common/number/index.js +14 -0
  28. package/cjs/packages/common/object/filterEmpty.js +32 -0
  29. package/cjs/packages/common/object/filtereEmpty.js +5 -0
  30. package/cjs/packages/common/object/index.js +26 -0
  31. package/cjs/packages/common/string/index.js +17 -0
  32. package/cjs/packages/common/types/index.js +1 -0
  33. package/cjs/packages/core/index.js +17 -12
  34. package/cjs/packages/core/loader/model.js +3 -3
  35. package/cjs/packages/core/loader/router.js +14 -5
  36. package/esm/app/controller/base.js +3 -3
  37. package/esm/app/controller/project.js +3 -3
  38. package/esm/app/controller/view.js +16 -7
  39. package/esm/app/middleware/api-params-verify.js +10 -1
  40. package/esm/app/middleware/error-handle.js +9 -3
  41. package/esm/app/middleware/project-handler.js +1 -1
  42. package/esm/app/router/view.js +3 -1
  43. package/esm/app/router-schema/project.js +1 -1
  44. package/esm/app/service/project.js +5 -0
  45. package/esm/bundler/defaultAlias.js +4 -0
  46. package/esm/bundler/dev.js +4 -3
  47. package/esm/bundler/index.js +2 -1
  48. package/esm/bundler/prod.js +4 -3
  49. package/esm/bundler/utils.js +53 -24
  50. package/esm/index.js +2 -2
  51. package/esm/packages/common/LRUCache.js +2 -0
  52. package/esm/packages/common/array/index.js +37 -0
  53. package/esm/packages/common/cache/LRUCache.js +43 -0
  54. package/esm/packages/common/cache/index.js +2 -0
  55. package/esm/packages/common/guards/index.js +26 -0
  56. package/esm/packages/common/i18n/default.js +93 -0
  57. package/esm/packages/common/i18n/en-US.js +93 -0
  58. package/esm/packages/common/i18n/index.js +162 -0
  59. package/esm/packages/common/i18n/locales.js +11 -0
  60. package/esm/packages/common/i18n/types.js +0 -0
  61. package/esm/packages/common/index.js +13 -0
  62. package/esm/packages/common/log/index.js +146 -0
  63. package/esm/packages/common/number/index.js +11 -0
  64. package/esm/packages/common/object/filterEmpty.js +29 -0
  65. package/esm/packages/common/object/filtereEmpty.js +2 -0
  66. package/esm/packages/common/object/index.js +20 -0
  67. package/esm/packages/common/string/index.js +13 -0
  68. package/esm/packages/common/types/index.js +0 -0
  69. package/esm/packages/core/index.js +17 -12
  70. package/esm/packages/core/loader/model.js +3 -3
  71. package/esm/packages/core/loader/router.js +14 -5
  72. package/fe/frontend/dash/Dashboard.d.ts +7 -0
  73. package/fe/frontend/dash/Dashboard.js +63 -0
  74. package/fe/frontend/dash/dash.entry.d.ts +2 -0
  75. package/fe/frontend/dash/dash.entry.js +62 -0
  76. package/fe/frontend/index.d.ts +3 -0
  77. package/fe/frontend/index.js +1 -0
  78. package/fe/frontend/main.css +5 -1
  79. package/fe/frontend/main.d.ts +10 -3
  80. package/fe/frontend/main.js +13 -4
  81. package/fe/frontend/testPage/testPage.entry.js +1 -2
  82. package/fe/frontend/typing/window.d.ts +7 -0
  83. package/fe/frontend/typing/window.js +1 -0
  84. package/fe/frontend/widgets/api/baseInfo.d.ts +31 -0
  85. package/fe/frontend/widgets/api/baseInfo.js +15 -0
  86. package/fe/frontend/widgets/common/CRUD/CRUD.d.ts +70 -0
  87. package/fe/frontend/widgets/common/CRUD/CRUD.js +207 -0
  88. package/fe/frontend/widgets/common/CRUD/index.d.ts +2 -0
  89. package/fe/frontend/widgets/common/CRUD/index.js +1 -0
  90. package/fe/frontend/widgets/common/auth/index.d.ts +7 -0
  91. package/fe/frontend/widgets/common/auth/index.js +20 -0
  92. package/fe/frontend/widgets/common/generateMenuData.d.ts +4 -0
  93. package/fe/frontend/widgets/common/generateMenuData.js +14 -0
  94. package/fe/frontend/widgets/common/importComponent.d.ts +5 -0
  95. package/fe/frontend/widgets/common/importComponent.js +7 -0
  96. package/fe/frontend/widgets/common/language.d.ts +2 -0
  97. package/fe/frontend/widgets/common/language.js +8 -0
  98. package/fe/frontend/widgets/common/logFn/index.d.ts +4 -0
  99. package/fe/frontend/widgets/common/logFn/index.js +8 -0
  100. package/fe/frontend/widgets/common/menu.d.ts +22 -0
  101. package/fe/frontend/widgets/common/menu.js +80 -0
  102. package/fe/frontend/widgets/common/request.d.ts +33 -0
  103. package/fe/frontend/widgets/common/request.js +127 -0
  104. package/fe/frontend/widgets/components/BasePage/HeaderView.d.ts +9 -0
  105. package/fe/frontend/widgets/components/BasePage/HeaderView.js +14 -0
  106. package/fe/frontend/widgets/components/Router/index.d.ts +9 -0
  107. package/fe/frontend/widgets/components/Router/index.js +11 -0
  108. package/fe/frontend/widgets/components/Router/type.d.ts +2 -0
  109. package/fe/frontend/widgets/components/Router/type.js +1 -0
  110. package/fe/frontend/widgets/defaultPages/Iframe/index.d.ts +3 -0
  111. package/fe/frontend/widgets/defaultPages/Iframe/index.js +14 -0
  112. package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/DetailPanel.d.ts +7 -0
  113. package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/DetailPanel.js +94 -0
  114. package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/PopFrom.d.ts +13 -0
  115. package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/PopFrom.js +109 -0
  116. package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/data.d.ts +3 -0
  117. package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/data.js +6 -0
  118. package/fe/frontend/widgets/defaultPages/Schema/components/SchemaSearch/index.d.ts +3 -0
  119. package/fe/frontend/widgets/defaultPages/Schema/components/SchemaSearch/index.js +58 -0
  120. package/fe/frontend/widgets/defaultPages/Schema/components/SchemaTable/index.d.ts +11 -0
  121. package/fe/frontend/widgets/defaultPages/Schema/components/SchemaTable/index.js +176 -0
  122. package/fe/frontend/widgets/defaultPages/Schema/data/eventInfo.d.ts +8 -0
  123. package/fe/frontend/widgets/defaultPages/Schema/data/eventInfo.js +6 -0
  124. package/fe/frontend/widgets/defaultPages/Schema/data/index.d.ts +3 -0
  125. package/fe/frontend/widgets/defaultPages/Schema/data/index.js +1 -0
  126. package/fe/frontend/widgets/defaultPages/Schema/hooks/useComConfig.d.ts +10 -0
  127. package/fe/frontend/widgets/defaultPages/Schema/hooks/useComConfig.js +14 -0
  128. package/fe/frontend/widgets/defaultPages/Schema/index.d.ts +3 -0
  129. package/fe/frontend/widgets/defaultPages/Schema/index.js +67 -0
  130. package/fe/frontend/widgets/defaultPages/Schema/schemaType.d.ts +41 -0
  131. package/fe/frontend/widgets/defaultPages/Schema/schemaType.js +4 -0
  132. package/fe/frontend/widgets/defaultPages/Schema/stores/schemaEventBus.d.ts +23 -0
  133. package/fe/frontend/widgets/defaultPages/Schema/stores/schemaEventBus.js +66 -0
  134. package/fe/frontend/widgets/defaultPages/Schema/stores/schemaStore.d.ts +33 -0
  135. package/fe/frontend/widgets/defaultPages/Schema/stores/schemaStore.js +24 -0
  136. package/fe/frontend/widgets/defaultPages/Schema/utils/fetchErrorShow.d.ts +3 -0
  137. package/fe/frontend/widgets/defaultPages/Schema/utils/fetchErrorShow.js +8 -0
  138. package/fe/frontend/widgets/defaultPages/Schema/utils/permissions.d.ts +3 -0
  139. package/fe/frontend/widgets/defaultPages/Schema/utils/permissions.js +3 -0
  140. package/fe/frontend/widgets/defaultPages/Schema/utils/schemaConversion.d.ts +3 -0
  141. package/fe/frontend/widgets/defaultPages/Schema/utils/schemaConversion.js +72 -0
  142. package/fe/frontend/widgets/defaultPages/Schema/utils/validator.d.ts +4 -0
  143. package/fe/frontend/widgets/defaultPages/Schema/utils/validator.js +31 -0
  144. package/fe/frontend/widgets/defaultPages/SidebarSlotPage/SidebarSlotContainer.d.ts +10 -0
  145. package/fe/frontend/widgets/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +31 -0
  146. package/fe/frontend/widgets/defaultPages/SidebarSlotPage/index.d.ts +3 -0
  147. package/fe/frontend/widgets/defaultPages/SidebarSlotPage/index.js +15 -0
  148. package/fe/frontend/widgets/defaultPages/SidebarSlotPageTmp.d.ts +3 -0
  149. package/fe/frontend/widgets/defaultPages/SidebarSlotPageTmp.js +17 -0
  150. package/fe/frontend/widgets/defaultPages/SlotPage/index.d.ts +3 -0
  151. package/fe/frontend/widgets/defaultPages/SlotPage/index.js +24 -0
  152. package/fe/frontend/widgets/defaultPages/Todo.d.ts +3 -0
  153. package/fe/frontend/widgets/defaultPages/Todo.js +5 -0
  154. package/fe/frontend/widgets/hooks/useCurrentMenuData.d.ts +11 -0
  155. package/fe/frontend/widgets/hooks/useCurrentMenuData.js +20 -0
  156. package/fe/frontend/widgets/hooks/useRouterParams.d.ts +5 -0
  157. package/fe/frontend/widgets/hooks/useRouterParams.js +11 -0
  158. package/fe/frontend/widgets/store/mode.d.ts +16 -0
  159. package/fe/frontend/widgets/store/mode.js +36 -0
  160. package/fe/model/types/data/button.d.ts +23 -0
  161. package/fe/model/types/data/button.js +1 -0
  162. package/fe/model/types/data/component.d.ts +37 -0
  163. package/fe/model/types/data/component.js +1 -0
  164. package/fe/model/types/data/fetchInfo.d.ts +8 -0
  165. package/fe/model/types/data/fetchInfo.js +1 -0
  166. package/fe/model/types/data/schema.d.ts +47 -0
  167. package/fe/model/types/data/schema.js +1 -0
  168. package/fe/model/types/data/search.d.ts +7 -0
  169. package/fe/model/types/data/search.js +1 -0
  170. package/fe/model/types/menuType.d.ts +44 -0
  171. package/fe/model/types/menuType.js +1 -0
  172. package/fe/model/types/model.d.ts +20 -0
  173. package/fe/model/types/model.js +1 -0
  174. package/fe/packages/common/array/index.d.ts +7 -0
  175. package/fe/packages/common/array/index.js +40 -0
  176. package/fe/packages/common/cache/LRUCache.d.ts +13 -0
  177. package/fe/packages/common/cache/LRUCache.js +47 -0
  178. package/fe/packages/common/cache/index.d.ts +2 -0
  179. package/fe/packages/common/cache/index.js +1 -0
  180. package/fe/packages/common/guards/index.d.ts +9 -0
  181. package/fe/packages/common/guards/index.js +24 -0
  182. package/fe/packages/common/i18n/default.d.ts +87 -0
  183. package/fe/packages/common/i18n/default.js +85 -0
  184. package/fe/packages/common/i18n/en-US.d.ts +87 -0
  185. package/fe/packages/common/i18n/en-US.js +85 -0
  186. package/fe/packages/common/i18n/index.d.ts +19 -0
  187. package/fe/packages/common/i18n/index.js +142 -0
  188. package/fe/packages/common/i18n/locales.d.ts +8 -0
  189. package/fe/packages/common/i18n/locales.js +10 -0
  190. package/fe/packages/common/i18n/types.d.ts +47 -0
  191. package/fe/packages/common/i18n/types.js +1 -0
  192. package/fe/packages/common/index.d.ts +10 -0
  193. package/fe/packages/common/index.js +9 -0
  194. package/fe/packages/common/log/index.d.ts +33 -0
  195. package/fe/packages/common/log/index.js +176 -0
  196. package/fe/packages/common/number/index.d.ts +3 -0
  197. package/fe/packages/common/number/index.js +10 -0
  198. package/fe/packages/common/object/filterEmpty.d.ts +3 -0
  199. package/fe/packages/common/object/filterEmpty.js +33 -0
  200. package/fe/packages/common/object/index.d.ts +5 -0
  201. package/fe/packages/common/object/index.js +25 -0
  202. package/fe/packages/common/string/index.d.ts +4 -0
  203. package/fe/packages/common/string/index.js +17 -0
  204. package/fe/packages/common/types/index.d.ts +4 -0
  205. package/fe/packages/common/types/index.js +1 -0
  206. package/fe/packages/ui/react/components/Button/Button.d.ts +16 -30
  207. package/fe/packages/ui/react/components/Button/Button.js +53 -26
  208. package/fe/packages/ui/react/components/Button/SumbitButton.d.ts +2 -6
  209. package/fe/packages/ui/react/components/Button/SumbitButton.js +3 -14
  210. package/fe/packages/ui/react/components/Button/index.d.ts +1 -1
  211. package/fe/packages/ui/react/components/Checkbox/Checkbox.d.ts +1 -1
  212. package/fe/packages/ui/react/components/Checkbox/Checkbox.js +5 -3
  213. package/fe/packages/ui/react/components/{ConfirmDialog.d.ts → ConfirmDialog/ConfirmDialog.d.ts} +0 -8
  214. package/fe/packages/ui/react/components/ConfirmDialog/ConfirmDialog.js +11 -0
  215. package/fe/packages/ui/react/components/ConfirmDialog/index.d.ts +2 -0
  216. package/fe/packages/ui/react/components/ConfirmDialog/index.js +1 -0
  217. package/fe/packages/ui/react/components/DataTable/ActionBtn.d.ts +3 -1
  218. package/fe/packages/ui/react/components/DataTable/ActionBtn.js +85 -4
  219. package/fe/packages/ui/react/components/DataTable/{data-table.d.ts → index.d.ts} +10 -23
  220. package/fe/packages/ui/react/components/DataTable/{data-table.js → index.js} +57 -47
  221. package/fe/packages/ui/react/components/Date/Calendar.d.ts +0 -13
  222. package/fe/packages/ui/react/components/Date/Calendar.js +5 -13
  223. package/fe/packages/ui/react/components/Date/Date.d.ts +4 -13
  224. package/fe/packages/ui/react/components/Date/Date.js +70 -66
  225. package/fe/packages/ui/react/components/Date/LocaleContext.d.ts +0 -4
  226. package/fe/packages/ui/react/components/Date/LocaleContext.js +0 -4
  227. package/fe/packages/ui/react/components/Date/LocaleProvider.d.ts +0 -11
  228. package/fe/packages/ui/react/components/Date/LocaleProvider.js +0 -11
  229. package/fe/packages/ui/react/components/Date/TimePicker.js +3 -2
  230. package/fe/packages/ui/react/components/Date/dateLocaleStore.d.ts +0 -6
  231. package/fe/packages/ui/react/components/Date/dropdownPositioning.d.ts +3 -0
  232. package/fe/packages/ui/react/components/Date/dropdownPositioning.js +12 -0
  233. package/fe/packages/ui/react/components/Date/locales.d.ts +1 -19
  234. package/fe/packages/ui/react/components/Date/locales.js +7 -47
  235. package/fe/packages/ui/react/components/Drawer/Drawer.d.ts +23 -0
  236. package/fe/packages/ui/react/components/Drawer/Drawer.js +100 -0
  237. package/fe/packages/ui/react/components/Drawer/index.d.ts +3 -0
  238. package/fe/packages/ui/react/components/Drawer/index.js +1 -0
  239. package/fe/packages/ui/react/components/Dropdown/Dropdown.d.ts +24 -0
  240. package/fe/packages/ui/react/components/Dropdown/Dropdown.js +28 -0
  241. package/fe/packages/ui/react/components/Dropdown/index.d.ts +2 -0
  242. package/fe/packages/ui/react/components/Dropdown/index.js +1 -0
  243. package/fe/packages/ui/react/components/Form/Form.d.ts +0 -6
  244. package/fe/packages/ui/react/components/Form/Form.js +1 -1
  245. package/fe/packages/ui/react/components/Form/FormItem.d.ts +0 -21
  246. package/fe/packages/ui/react/components/Form/FormItem.js +2 -9
  247. package/fe/packages/ui/react/components/Form/SchemaForm/data.d.ts +45 -0
  248. package/fe/packages/ui/react/components/Form/{SchemeForm → SchemaForm}/data.js +8 -1
  249. package/fe/packages/ui/react/components/Form/SchemaForm/index.d.ts +60 -0
  250. package/fe/packages/ui/react/components/Form/SchemaForm/index.js +75 -0
  251. package/fe/packages/ui/react/components/Form/index.d.ts +1 -1
  252. package/fe/packages/ui/react/components/Form/index.js +1 -1
  253. package/fe/packages/ui/react/components/ImagePreview/ImagePreview.js +15 -20
  254. package/fe/packages/ui/react/components/ImagePreview/PreviewImage.d.ts +0 -3
  255. package/fe/packages/ui/react/components/ImagePreview/PreviewImage.js +5 -2
  256. package/fe/packages/ui/react/components/Input/Input.d.ts +3 -21
  257. package/fe/packages/ui/react/components/Input/Input.js +5 -7
  258. package/fe/packages/ui/react/components/InputNumber/InputNumber.d.ts +26 -0
  259. package/fe/packages/ui/react/components/InputNumber/InputNumber.js +144 -0
  260. package/fe/packages/ui/react/components/InputNumber/index.d.ts +2 -0
  261. package/fe/packages/ui/react/components/InputNumber/index.js +1 -0
  262. package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.d.ts +30 -0
  263. package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.js +63 -0
  264. package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.test.d.ts +2 -0
  265. package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.test.js +27 -0
  266. package/fe/packages/ui/react/components/Label/Label.d.ts +0 -29
  267. package/fe/packages/ui/react/components/Label/Label.js +2 -4
  268. package/fe/packages/ui/react/components/Menu/Menu.d.ts +18 -0
  269. package/fe/packages/ui/react/components/Menu/Menu.js +98 -0
  270. package/fe/packages/ui/react/components/Menu/MenuContext.d.ts +39 -0
  271. package/fe/packages/ui/react/components/Menu/MenuContext.js +97 -0
  272. package/fe/packages/ui/react/components/Menu/MenuItem.d.ts +3 -0
  273. package/fe/packages/ui/react/components/Menu/MenuItem.js +33 -0
  274. package/fe/packages/ui/react/components/Menu/SubMenu.d.ts +3 -0
  275. package/fe/packages/ui/react/components/Menu/SubMenu.js +124 -0
  276. package/fe/packages/ui/react/components/Menu/index.d.ts +9 -0
  277. package/fe/packages/ui/react/components/Menu/index.js +5 -0
  278. package/fe/packages/ui/react/components/Menu/menuTypes.d.ts +58 -0
  279. package/fe/packages/ui/react/components/Menu/menuTypes.js +1 -0
  280. package/fe/packages/ui/react/components/Menu/utils.d.ts +2 -0
  281. package/fe/packages/ui/react/components/Menu/utils.js +7 -0
  282. package/fe/packages/ui/react/components/Message/Message.d.ts +0 -7
  283. package/fe/packages/ui/react/components/Message/Message.js +4 -4
  284. package/fe/packages/ui/react/components/Message/MessageManager.js +0 -8
  285. package/fe/packages/ui/react/components/Modal/Modal.d.ts +3 -7
  286. package/fe/packages/ui/react/components/Modal/Modal.js +6 -44
  287. package/fe/packages/ui/react/components/Modal/ModalManager.d.ts +0 -12
  288. package/fe/packages/ui/react/components/Modal/ModalManager.js +5 -7
  289. package/fe/packages/ui/react/components/Overlay/Overlay.d.ts +20 -0
  290. package/fe/packages/ui/react/components/Overlay/Overlay.js +53 -0
  291. package/fe/packages/ui/react/components/Overlay/index.d.ts +3 -0
  292. package/fe/packages/ui/react/components/Overlay/index.js +1 -0
  293. package/fe/packages/ui/react/components/{Pagination.d.ts → Pagination/Pagination.d.ts} +0 -7
  294. package/fe/packages/ui/react/components/{Pagination.js → Pagination/Pagination.js} +5 -12
  295. package/fe/packages/ui/react/components/Pagination/index.d.ts +2 -0
  296. package/fe/packages/ui/react/components/Pagination/index.js +1 -0
  297. package/fe/packages/ui/react/components/Popup/Popup.d.ts +26 -0
  298. package/fe/packages/ui/react/components/Popup/Popup.js +69 -0
  299. package/fe/packages/ui/react/components/Popup/index.d.ts +2 -0
  300. package/fe/packages/ui/react/components/Popup/index.js +1 -0
  301. package/fe/packages/ui/react/components/Search/Search.d.ts +2 -5
  302. package/fe/packages/ui/react/components/Search/Search.js +3 -3
  303. package/fe/packages/ui/react/components/Select/Select.d.ts +2 -2
  304. package/fe/packages/ui/react/components/Select/Select.js +52 -113
  305. package/fe/packages/ui/react/components/Select/dropdownPositioning.d.ts +3 -0
  306. package/fe/packages/ui/react/components/Select/dropdownPositioning.js +13 -0
  307. package/fe/packages/ui/react/components/Skeleton/Skeleton.d.ts +0 -15
  308. package/fe/packages/ui/react/components/Skeleton/Skeleton.js +3 -3
  309. package/fe/packages/ui/react/components/Switch/Switch.js +3 -1
  310. package/fe/packages/ui/react/components/TableSearch/TableSearch.d.ts +5 -41
  311. package/fe/packages/ui/react/components/TableSearch/TableSearch.js +21 -22
  312. package/fe/packages/ui/react/components/TableSearch/lang.js +5 -14
  313. package/fe/packages/ui/react/components/Textarea/Textarea.d.ts +21 -0
  314. package/fe/packages/ui/react/components/Textarea/Textarea.js +36 -0
  315. package/fe/packages/ui/react/components/Textarea/index.d.ts +2 -0
  316. package/fe/packages/ui/react/components/Textarea/index.js +1 -0
  317. package/fe/packages/ui/react/components/Tooltip/Tooltip.d.ts +9 -0
  318. package/fe/packages/ui/react/components/Tooltip/Tooltip.js +71 -0
  319. package/fe/packages/ui/react/components/Tooltip/index.d.ts +2 -0
  320. package/fe/packages/ui/react/components/Tooltip/index.js +1 -0
  321. package/fe/packages/ui/react/components/{TreeSelect.d.ts → TreeSelect/TreeSelect.d.ts} +0 -6
  322. package/fe/packages/ui/react/components/{TreeSelect.js → TreeSelect/TreeSelect.js} +9 -17
  323. package/fe/packages/ui/react/components/TreeSelect/index.d.ts +2 -0
  324. package/fe/packages/ui/react/components/TreeSelect/index.js +1 -0
  325. package/fe/packages/ui/react/components/Upload/ImageUpload.js +18 -6
  326. package/fe/packages/ui/react/components/Upload/Upload.d.ts +0 -27
  327. package/fe/packages/ui/react/components/Upload/Upload.js +2 -1
  328. package/fe/packages/ui/react/components/{breadcrumb.js → breadcrumb/breadcrumb.js} +15 -21
  329. package/fe/packages/ui/react/components/breadcrumb/index.d.ts +2 -0
  330. package/fe/packages/ui/react/components/breadcrumb/index.js +1 -0
  331. package/fe/packages/ui/react/components/hooks/useDropdownPositioning.d.ts +43 -0
  332. package/fe/packages/ui/react/components/hooks/useDropdownPositioning.js +123 -0
  333. package/fe/packages/ui/react/components/hooks/useInputController.d.ts +0 -3
  334. package/fe/packages/ui/react/components/hooks/useInputController.js +0 -7
  335. package/fe/packages/ui/react/components/index.d.ts +7 -1
  336. package/fe/packages/ui/react/components/index.js +7 -1
  337. package/fe/packages/ui/react/components/table/index.d.ts +2 -0
  338. package/fe/packages/ui/react/components/table/index.js +1 -0
  339. package/fe/packages/ui/react/components/table/table.js +20 -0
  340. package/fe/packages/ui/react/components/testPage/MenuTestPage.d.ts +2 -0
  341. package/fe/packages/ui/react/components/testPage/MenuTestPage.js +101 -0
  342. package/fe/packages/ui/react/components/testPage/index.js +251 -81
  343. package/fe/packages/ui/react/hooks/useExecuteOnce.d.ts +12 -0
  344. package/fe/packages/ui/react/hooks/useExecuteOnce.js +36 -0
  345. package/fe/packages/ui/react/hooks/useInit.d.ts +1 -1
  346. package/fe/packages/ui/react/hooks/useInit.js +1 -1
  347. package/fe/packages/ui/react/hooks/useLanguage.d.ts +1 -6
  348. package/fe/packages/ui/react/hooks/useRefState.d.ts +18 -0
  349. package/fe/packages/ui/react/hooks/useRefState.js +28 -0
  350. package/fe/packages/ui/react/hooks/useWatch.d.ts +15 -0
  351. package/fe/packages/ui/react/hooks/useWatch.js +87 -0
  352. package/fe/packages/ui/react/hooks/useWatch.test.d.ts +2 -0
  353. package/fe/packages/ui/react/hooks/useWatch.test.js +22 -0
  354. package/fe/packages/ui/react/i18n/I18nProvider.d.ts +13 -0
  355. package/fe/packages/ui/react/i18n/I18nProvider.js +25 -0
  356. package/fe/packages/ui/react/i18n/index.d.ts +4 -0
  357. package/fe/packages/ui/react/i18n/index.js +3 -0
  358. package/fe/packages/ui/react/i18n/useI18n.d.ts +9 -0
  359. package/fe/packages/ui/react/i18n/useI18n.js +14 -0
  360. package/fe/packages/ui/react/index.css +238 -0
  361. package/fe/packages/ui/react/index.d.ts +2 -0
  362. package/fe/packages/ui/react/index.js +2 -2
  363. package/fe/packages/ui/react/lib/createStoreHook.d.ts +9 -0
  364. package/fe/packages/ui/react/lib/createStoreHook.js +6 -0
  365. package/fe/packages/ui/react/lib/export.d.ts +2 -46
  366. package/fe/packages/ui/react/lib/export.js +0 -40
  367. package/fe/packages/ui/react/lib/utils.d.ts +0 -24
  368. package/fe/packages/ui/react/lib/utils.js +0 -25
  369. package/fe/packages/ui/react/stores/breadcrumb.js +0 -2
  370. package/fe/packages/ui/react/stores/language.d.ts +3 -12
  371. package/fe/packages/ui/react/stores/language.js +2 -51
  372. package/fe/typings/type.d.ts +5 -0
  373. package/fe/typings/type.js +1 -0
  374. package/package.json +14 -2
  375. package/types/app/controller/base.d.ts +3 -3
  376. package/types/app/router/view.d.ts +2 -3
  377. package/types/app/service/project.d.ts +29 -4
  378. package/types/app/type.d.ts +1 -0
  379. package/types/app/typings.d.ts +12 -21
  380. package/types/bundler/defaultAlias.d.ts +3 -0
  381. package/types/bundler/utils.d.ts +1 -1
  382. package/types/config/config.default.d.ts +14 -0
  383. package/types/packages/common/LRUCache.d.ts +1 -0
  384. package/types/packages/common/array/index.d.ts +6 -0
  385. package/types/packages/common/cache/LRUCache.d.ts +12 -0
  386. package/types/packages/common/cache/index.d.ts +1 -0
  387. package/types/packages/common/guards/index.d.ts +8 -0
  388. package/types/packages/common/i18n/default.d.ts +86 -0
  389. package/types/packages/common/i18n/en-US.d.ts +86 -0
  390. package/types/packages/common/i18n/index.d.ts +18 -0
  391. package/types/packages/common/i18n/locales.d.ts +7 -0
  392. package/types/packages/common/i18n/types.d.ts +46 -0
  393. package/types/packages/common/index.d.ts +9 -0
  394. package/types/packages/common/log/index.d.ts +32 -0
  395. package/types/packages/common/number/index.d.ts +2 -0
  396. package/types/packages/common/object/filterEmpty.d.ts +2 -0
  397. package/types/packages/common/object/filtereEmpty.d.ts +1 -0
  398. package/types/packages/common/object/index.d.ts +4 -0
  399. package/types/packages/common/string/index.d.ts +3 -0
  400. package/types/packages/common/types/index.d.ts +3 -0
  401. package/types/packages/core/index.d.ts +1 -1
  402. package/types/packages/core/loader/router.d.ts +1 -1
  403. package/types/packages/core/types.d.ts +12 -3
  404. package/fe/packages/ui/react/components/ConfirmDialog.js +0 -9
  405. package/fe/packages/ui/react/components/Dropdown.d.ts +0 -16
  406. package/fe/packages/ui/react/components/Dropdown.js +0 -54
  407. package/fe/packages/ui/react/components/Form/SchemeForm/data.d.ts +0 -51
  408. package/fe/packages/ui/react/components/Form/SchemeForm/index.d.ts +0 -152
  409. package/fe/packages/ui/react/components/Form/SchemeForm/index.js +0 -69
  410. package/fe/packages/ui/react/components/Textarea.d.ts +0 -59
  411. package/fe/packages/ui/react/components/Textarea.js +0 -35
  412. package/fe/packages/ui/react/components/Tooltip.d.ts +0 -25
  413. package/fe/packages/ui/react/components/Tooltip.js +0 -118
  414. package/fe/packages/ui/react/components/table.js +0 -20
  415. package/fe/packages/ui/react/locales/index.d.ts +0 -8
  416. package/fe/packages/ui/react/locales/index.js +0 -6
  417. /package/fe/packages/ui/react/components/{breadcrumb.d.ts → breadcrumb/breadcrumb.d.ts} +0 -0
  418. /package/fe/packages/ui/react/components/{table.d.ts → table/table.d.ts} +0 -0
@@ -13,7 +13,6 @@ koa_router = require_runtime.__toESM(koa_router, 1);
13
13
  * 解析 xx/app/router/下的所有文件 加载到 koa-router上
14
14
  */
15
15
  var router_default = (app) => {
16
- const router = new koa_router.default();
17
16
  let routerGuard;
18
17
  try {
19
18
  const businessPath = require_packages_core_paths.getAppPath(app, "business");
@@ -21,8 +20,12 @@ var router_default = (app) => {
21
20
  } catch (error) {
22
21
  console.info("-- [router-guard] -- not router-guard.js file");
23
22
  }
23
+ const routers = [];
24
24
  require_packages_core_paths.getAppPaths(app).forEach((currentPath) => {
25
25
  require_packages_utils_loadFile.loadFileFn(currentPath, "router", { preProcessingFileCallback: (filePath) => {
26
+ const router = new koa_router.default();
27
+ router.level = 0;
28
+ routers.push(router);
26
29
  /**
27
30
  * module.export = (app,router) => {
28
31
  * router.get('/xxx/xxxx', app.controller)
@@ -31,7 +34,9 @@ var router_default = (app) => {
31
34
  require_packages_utils_runFileFn.runFileFn(require(require_packages_utils_path.resolve(filePath)))(app, router);
32
35
  } });
33
36
  });
34
- router.get("(.*)", async (ctx, _next) => {
37
+ const BaseRouters = new koa_router.default();
38
+ BaseRouters.level = 99;
39
+ BaseRouters.get("(.*)", async (ctx, _next) => {
35
40
  console.info("\x1B[31m%s\x1B[0m", `-- notFound path: ${ctx.path} --`);
36
41
  ctx.status = 302;
37
42
  const executionResults = routerGuard?.(ctx);
@@ -41,9 +46,13 @@ var router_default = (app) => {
41
46
  ctx.body = "notFound";
42
47
  }
43
48
  });
44
- app.use(router.routes());
45
- app.use(router.allowedMethods());
46
- app.currentUseRouter = router;
49
+ routers.push(BaseRouters);
50
+ routers.sort((r, nr) => (r.level ?? 0) < (nr.level ?? 0) ? -1 : 1);
51
+ routers.forEach((r) => {
52
+ app.use(r.routes());
53
+ app.use(r.allowedMethods());
54
+ });
55
+ app.currentUseRouter = routers;
47
56
  };
48
57
  //#endregion
49
58
  module.exports = router_default;
@@ -1,5 +1,5 @@
1
1
  //#region app/controller/base.ts
2
- var base_default = (app) => class BaseController {
2
+ var getBaseController = (app) => class BaseController {
3
3
  app;
4
4
  config;
5
5
  constructor() {
@@ -20,9 +20,9 @@ var base_default = (app) => class BaseController {
20
20
  ctx.body = {
21
21
  data,
22
22
  code,
23
- message
23
+ message: message ?? "ok"
24
24
  };
25
25
  }
26
26
  };
27
27
  //#endregion
28
- export { base_default as default };
28
+ export { getBaseController as default };
@@ -1,7 +1,7 @@
1
- import base_default from "./base.js";
1
+ import getBaseController from "./base.js";
2
2
  //#region app/controller/project.ts
3
3
  var getProjectController = (app) => {
4
- const BaseController = base_default(app);
4
+ const BaseController = getBaseController(app);
5
5
  return class ProjectController extends BaseController {
6
6
  getModelList = async (ctx) => {
7
7
  const dtoModelList = (await this.service.project.getModelList()).reduce((preList, item) => {
@@ -31,7 +31,7 @@ var getProjectController = (app) => {
31
31
  this.success(ctx, dtoModelList);
32
32
  };
33
33
  getProjectList = async (ctx) => {
34
- const { proj_key: projectKey } = ctx.query;
34
+ const { projk: projectKey } = ctx.query;
35
35
  const dtoProject = (await this.service.project.getList(projectKey))?.map((project) => {
36
36
  const { modelKey, key, name, desc, homePage } = project;
37
37
  return {
@@ -1,13 +1,22 @@
1
1
  //#region app/controller/view.ts
2
2
  var getViewController = (app) => class ViewController {
3
3
  async renderPage(ctx) {
4
- app.extends.renderView(`dist/${ctx.params.page}.entry.tpl`, ctx, {
5
- projKey: ctx.query.proj_key,
6
- name: app.options?.name,
7
- env: app.envs.get(),
8
- basePath: `/view/${ctx.params.page}`,
9
- options: JSON.stringify(app.options)
10
- });
4
+ app.extends.logger.log(" - render page: " + ctx.params.page);
5
+ try {
6
+ app.extends.renderView(`dist/${ctx.params.page}.entry.tpl`, ctx, {
7
+ projKey: ctx.query.projk,
8
+ name: app.options?.name,
9
+ env: app.envs.get(),
10
+ basePath: `${app.options.pageBasePage}${ctx.params.page}`,
11
+ options: JSON.stringify(app.options)
12
+ });
13
+ } catch (error) {
14
+ app.extends.generateErrorMessage("template not found", {
15
+ status: 404,
16
+ showError: true,
17
+ code: 0
18
+ });
19
+ }
11
20
  }
12
21
  };
13
22
  //#endregion
@@ -12,7 +12,16 @@ var validateFN = (key, data, schema) => {
12
12
  var api_params_verify_default = (app) => async (ctx, next) => {
13
13
  const { path, method } = ctx;
14
14
  if (path.indexOf("/api") < 0) return next();
15
- const routePath = app.currentUseRouter.match(path, "get").path[0]?.path;
15
+ const currentUseRouter = app.currentUseRouter;
16
+ let route;
17
+ for (const r of currentUseRouter) {
18
+ const data = r.match(path, "get");
19
+ if (data) {
20
+ route = data;
21
+ break;
22
+ }
23
+ }
24
+ const routePath = route?.path[0]?.path;
16
25
  if (routePath) {
17
26
  const params = app.extends.parsingParamsOnUrl(routePath, path);
18
27
  const { body, query, headers } = ctx.request;
@@ -1,4 +1,5 @@
1
1
  //#region app/middleware/error-handle.ts
2
+ var redirectInfo = {};
2
3
  var error_handle_default = (app) => async (ctx, next) => {
3
4
  try {
4
5
  await next();
@@ -8,9 +9,14 @@ var error_handle_default = (app) => async (ctx, next) => {
8
9
  app.extends.logger?.error("-- [excption] --", error);
9
10
  app.extends.logger?.error("-- [excption] info --", status, message, detail);
10
11
  if (message?.includes("template not found")) {
11
- ctx.status = 302;
12
- ctx.redirect(app.options?.homePage ?? "/");
13
- return;
12
+ const url = ctx.req.url;
13
+ if (redirectInfo[url] !== void 0) redirectInfo[url] += 1;
14
+ else redirectInfo[url] = 0;
15
+ if (redirectInfo[url] < app.config.notFoundRedirectCount) {
16
+ ctx.status = 302;
17
+ ctx.redirect(app.options?.homePage ?? "/");
18
+ return;
19
+ } else redirectInfo[url] = 0;
14
20
  }
15
21
  if (returnError) {
16
22
  ctx.status = status;
@@ -1,6 +1,6 @@
1
1
  //#region app/middleware/project-handler.ts
2
2
  var project_handler_default = () => async (ctx, next) => {
3
- const key = ctx.headers.proj_key;
3
+ const key = ctx.headers.projk;
4
4
  const { path } = ctx;
5
5
  if (path.indexOf("/api/proj/") !== -1) {
6
6
  if (!key || ["undefined", "null"].includes(key)) {
@@ -1,6 +1,8 @@
1
1
  //#region app/router/view.ts
2
2
  var view_default = (app, router) => {
3
- router.get(["/view/:page", "/view/:page(.*)"], app.controller.view.renderPage.bind(app.controller.view));
3
+ const { pageBasePage } = app.options;
4
+ router.level = 2;
5
+ router.get([`${pageBasePage}:page`, `${pageBasePage}:page/:r(.*)`], app.controller.view.renderPage.bind(app.controller.view));
4
6
  };
5
7
  //#endregion
6
8
  export { view_default as default };
@@ -7,7 +7,7 @@ var routerSchema = {
7
7
  } } },
8
8
  "/api/project/list": { get: { query: {
9
9
  type: "object",
10
- properties: { proj_key: { type: "string" } }
10
+ properties: { projk: { type: "string" } }
11
11
  } } },
12
12
  "/api/project/model_list": { get: {} }
13
13
  };
@@ -8,6 +8,11 @@ var getProjectService = (app) => {
8
8
  async getModelList() {
9
9
  return modelData;
10
10
  }
11
+ /**
12
+ *
13
+ * @param key 不传查所有
14
+ * @returns
15
+ */
11
16
  getList = (key) => {
12
17
  return modelData.reduce((preList, modeItem) => {
13
18
  const { project } = modeItem;
@@ -0,0 +1,4 @@
1
+ //#region bundler/defaultAlias.ts
2
+ var defaultAlias_default = {};
3
+ //#endregion
4
+ export { defaultAlias_default as default };
@@ -1,13 +1,14 @@
1
+ import { logGreen, logRed } from "../packages/common/log/index.js";
1
2
  import { VBuildFE, entries, watchFiles } from "./utils.js";
2
3
  //#region bundler/dev.ts
3
4
  var init = async () => {
4
5
  const input = entries();
5
- console.log(input);
6
+ logGreen(input);
6
7
  if (!Object.keys(input).length) {
7
- console.error("no entry found");
8
+ logRed("no entry found");
8
9
  process.exit(1);
9
10
  }
10
- await VBuildFE(input);
11
+ await VBuildFE(input, "dev");
11
12
  };
12
13
  async function dev() {
13
14
  await init();
@@ -1,3 +1,4 @@
1
+ import { logRed } from "../packages/common/log/index.js";
1
2
  import { dev } from "./dev.js";
2
3
  import { prod } from "./prod.js";
3
4
  //#region bundler/index.ts
@@ -9,7 +10,7 @@ var buildFE = (mode) => {
9
10
  case "prod":
10
11
  prod();
11
12
  break;
12
- default: console.log("Usage: npx tsx scripts/index.ts [dev|prod]");
13
+ default: logRed("Usage: npx tsx scripts/index.ts [dev|prod]");
13
14
  }
14
15
  };
15
16
  //#endregion
@@ -1,16 +1,17 @@
1
+ import { logGreen, logRed } from "../packages/common/log/index.js";
1
2
  import { VBuildFE, entries } from "./utils.js";
2
3
  //#region bundler/prod.ts
3
4
  async function prod() {
4
5
  const input = entries();
5
6
  if (!Object.keys(input).length) {
6
- console.error("no entry found");
7
+ logRed("no entry found");
7
8
  process.exit(1);
8
9
  }
9
10
  try {
10
11
  await VBuildFE(input);
11
- console.log("build done");
12
+ logGreen("build done");
12
13
  } catch (err) {
13
- console.error(String(err));
14
+ logRed(String(err));
14
15
  process.exit(1);
15
16
  }
16
17
  }
@@ -1,10 +1,11 @@
1
1
  import { resolve as resolve$1 } from "../packages/utils/path.js";
2
2
  import "../packages/utils/index.js";
3
+ import { colorize, logJoinColorized, logRed, logWhite, logYellow } from "../packages/common/log/index.js";
3
4
  import path from "path";
4
5
  import * as glob from "glob";
5
- import { build } from "vite";
6
- import { copyFileSync, existsSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "fs";
7
6
  import tailwindcss from "@tailwindcss/vite";
7
+ import { copyFileSync, existsSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "fs";
8
+ import { build } from "vite";
8
9
  //#region bundler/utils.ts
9
10
  var base = process.cwd();
10
11
  var framePath = path.resolve(__dirname, "../../");
@@ -18,8 +19,8 @@ var runFEPath = path.resolve(runPath, "./frontend");
18
19
  * 生成入口
19
20
  */
20
21
  function entries() {
21
- console.log("frameFEPath: ", frameFEPath);
22
- console.log("runFEPath: ", runFEPath);
22
+ logWhite("frameFEPath: " + frameFEPath);
23
+ logWhite("runFEPath: " + runFEPath);
23
24
  /**
24
25
  * 所有包含 entry 的文件
25
26
  */
@@ -72,12 +73,11 @@ var watchFiles = async (callback) => {
72
73
  watcher.on("change", async (filePath) => {
73
74
  if (building) return;
74
75
  building = true;
75
- console.log(`changed: ${filePath}`);
76
+ logYellow(`changed: ${filePath}`);
76
77
  await callback?.();
77
- console.log("rebuild done");
78
78
  building = false;
79
79
  });
80
- console.log(`watching ${runFEPath}/...`);
80
+ logYellow(`watching ${runFEPath}/...`);
81
81
  };
82
82
  /**
83
83
  *
@@ -122,26 +122,55 @@ function flattenHtmlPlugin(suffix = ".html") {
122
122
  * ------------------
123
123
  */
124
124
  const endFiles = glob.sync("**/*" + suffix, { cwd: feDir });
125
- for (const f of endFiles) console.log("final file path -----> ", f);
125
+ for (const f of endFiles) logYellow("final file path -----> " + f);
126
126
  }
127
127
  };
128
128
  }
129
- var VBuildFE = async (input) => {
130
- await build({
131
- configFile: false,
132
- base: "dist",
133
- plugins: [
134
- (await import("@vitejs/plugin-react")).default(),
135
- flattenHtmlPlugin(".tpl"),
136
- tailwindcss()
137
- ],
138
- build: {
139
- outDir: outDir(),
140
- emptyOutDir: true,
141
- rollupOptions: { input }
142
- },
143
- resolve: { alias: { "@tc/ui-react": path.resolve(__dirname, "../../fe/packages/ui/react/") } }
144
- });
129
+ /**
130
+ * 处理别名目录兜底
131
+ * 如果 alias 指向的路径不存在,则使用 ./defaultAlias 兜底文件
132
+ */
133
+ function resolveAliasWithFallback(aliasList) {
134
+ const aliasExtensions = [
135
+ "",
136
+ ".ts",
137
+ ".tsx",
138
+ ".js",
139
+ ".jsx"
140
+ ];
141
+ return aliasList.reduce((o, [aliasName, aliasPath]) => {
142
+ const businessFilePath = aliasExtensions.map((ext) => path.resolve(runFEPath, aliasPath + ext)).find((filePath) => existsSync(filePath));
143
+ let filePath = path.resolve(__dirname, "./defaultAlias");
144
+ if (businessFilePath) filePath = businessFilePath;
145
+ o[aliasName] = filePath;
146
+ return o;
147
+ }, {});
148
+ }
149
+ var VBuildFE = async (input, OperatingEnv) => {
150
+ try {
151
+ await build({
152
+ configFile: false,
153
+ base: "/dist",
154
+ plugins: [
155
+ (await import("@vitejs/plugin-react")).default(),
156
+ flattenHtmlPlugin(".tpl"),
157
+ tailwindcss()
158
+ ],
159
+ build: {
160
+ outDir: outDir(),
161
+ emptyOutDir: true,
162
+ sourcemap: OperatingEnv === "dev" ? "inline" : "hidden",
163
+ rollupOptions: { input }
164
+ },
165
+ resolve: { alias: {
166
+ "@tc/ui-react": path.resolve(__dirname, "../../fe/packages/ui/react/"),
167
+ ...resolveAliasWithFallback([["$business/SchemaForm/data", "./extended/SchemaForm/data"]])
168
+ } }
169
+ });
170
+ logJoinColorized(colorize("builded", "green"), colorize(" -> ", "white"), colorize("time: ", "cyan"), colorize(/* @__PURE__ */ new Date(), "pink"));
171
+ } catch (error) {
172
+ logRed(error);
173
+ }
145
174
  };
146
175
  //#endregion
147
176
  export { VBuildFE, entries, outDir, watchFiles };
package/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import base_default from "./app/controller/base.js";
1
+ import getBaseController from "./app/controller/base.js";
2
2
  import bese_default from "./app/service/bese.js";
3
3
  import { resolve } from "./packages/utils/path.js";
4
4
  import "./packages/utils/index.js";
@@ -12,7 +12,7 @@ var serverStart = (options) => {
12
12
  });
13
13
  };
14
14
  var baseFn = {
15
- baseControllerFn: base_default,
15
+ baseControllerFn: getBaseController,
16
16
  baseServiceFn: bese_default
17
17
  };
18
18
  //#endregion
@@ -0,0 +1,2 @@
1
+ import { LRUCache } from "./cache/LRUCache.js";
2
+ export { LRUCache };
@@ -0,0 +1,37 @@
1
+ import { isNonNullable } from "../guards/index.js";
2
+ //#region packages/common/array/index.ts
3
+ function toArray(value) {
4
+ if (value === null || value === void 0) return [];
5
+ return Array.isArray(value) ? [...value] : [value];
6
+ }
7
+ var compact = (items) => {
8
+ return items.filter(isNonNullable);
9
+ };
10
+ var uniqueBy = (items, getKey) => {
11
+ const keys = /* @__PURE__ */ new Set();
12
+ const result = [];
13
+ for (const item of items) {
14
+ const key = getKey(item);
15
+ if (keys.has(key)) continue;
16
+ keys.add(key);
17
+ result.push(item);
18
+ }
19
+ return result;
20
+ };
21
+ var groupBy = (items, getKey) => {
22
+ const result = {};
23
+ for (const item of items) {
24
+ const key = getKey(item);
25
+ result[key] = result[key] ?? [];
26
+ result[key].push(item);
27
+ }
28
+ return result;
29
+ };
30
+ var chunk = (items, size) => {
31
+ if (!Number.isInteger(size) || size <= 0) throw new RangeError("chunk size must be a positive integer");
32
+ const result = [];
33
+ for (let index = 0; index < items.length; index += size) result.push(items.slice(index, index + size));
34
+ return result;
35
+ };
36
+ //#endregion
37
+ export { chunk, compact, groupBy, toArray, uniqueBy };
@@ -0,0 +1,43 @@
1
+ //#region packages/common/cache/LRUCache.ts
2
+ var LRUCache = class {
3
+ limit;
4
+ data;
5
+ constructor(limit) {
6
+ if (!Number.isInteger(limit) || limit <= 0) throw new Error("LRUCache limit must be a positive integer");
7
+ this.limit = limit;
8
+ this.data = /* @__PURE__ */ new Map();
9
+ }
10
+ get size() {
11
+ return this.data.size;
12
+ }
13
+ has(k) {
14
+ return this.data.has(k);
15
+ }
16
+ get(k) {
17
+ if (!this.data.has(k)) return void 0;
18
+ const value = this.data.get(k);
19
+ this.updateSorting(k, value);
20
+ return value;
21
+ }
22
+ set(k, v) {
23
+ if (this.data.has(k)) {
24
+ this.updateSorting(k, v);
25
+ return;
26
+ }
27
+ if (this.data.size >= this.limit) this.deleteFirstKey();
28
+ this.data.set(k, v);
29
+ }
30
+ push(k, v) {
31
+ this.set(k, v);
32
+ }
33
+ deleteFirstKey() {
34
+ const firstKey = this.data.keys().next().value;
35
+ if (firstKey !== void 0) this.data.delete(firstKey);
36
+ }
37
+ updateSorting(k, v) {
38
+ this.data.delete(k);
39
+ this.data.set(k, v);
40
+ }
41
+ };
42
+ //#endregion
43
+ export { LRUCache };
@@ -0,0 +1,2 @@
1
+ import { LRUCache } from "./LRUCache.js";
2
+ export { LRUCache };
@@ -0,0 +1,26 @@
1
+ //#region packages/common/guards/index.ts
2
+ var isNil = (value) => {
3
+ return value === null || value === void 0;
4
+ };
5
+ var isNonNullable = (value) => {
6
+ return value !== null && value !== void 0;
7
+ };
8
+ var isString = (value) => {
9
+ return typeof value === "string";
10
+ };
11
+ var isNumber = (value) => {
12
+ return typeof value === "number" && Number.isFinite(value);
13
+ };
14
+ var isBoolean = (value) => {
15
+ return typeof value === "boolean";
16
+ };
17
+ var isFunction = (value) => {
18
+ return typeof value === "function";
19
+ };
20
+ var isPlainObject = (value) => {
21
+ if (value === null || typeof value !== "object") return false;
22
+ const prototype = Object.getPrototypeOf(value);
23
+ return prototype === Object.prototype || prototype === null;
24
+ };
25
+ //#endregion
26
+ export { isBoolean, isFunction, isNil, isNonNullable, isNumber, isPlainObject, isString };
@@ -0,0 +1,93 @@
1
+ //#region packages/common/i18n/default.ts
2
+ /**
3
+ * UI 组件库默认中文语言资源。
4
+ *
5
+ * 这里只放组件内置文案,业务项目可以通过 I18nProvider.resources 覆盖或追加。
6
+ */
7
+ var defaultLanguageResources = {
8
+ common: {
9
+ tip: "提示",
10
+ confirm: "确认",
11
+ cancel: "取消",
12
+ close: "关闭",
13
+ submit: "提交",
14
+ reset: "重置"
15
+ },
16
+ components: {
17
+ breadcrumb: { close: "关闭" },
18
+ confirmDialog: {
19
+ title: "提示",
20
+ okText: "确认",
21
+ cancelText: "取消"
22
+ },
23
+ dataTable: { noData: "暂无数据" },
24
+ date: {
25
+ placeholder: "请选择日期",
26
+ placeholderDateTime: "请选择日期时间",
27
+ placeholderRange: "选择日期范围",
28
+ placeholderDateTimeRange: "选择日期时间范围",
29
+ weekDays: [
30
+ "日",
31
+ "一",
32
+ "二",
33
+ "三",
34
+ "四",
35
+ "五",
36
+ "六"
37
+ ],
38
+ selectTime: "选择时间",
39
+ startTime: "开始时间",
40
+ endTime: "结束时间",
41
+ confirm: "确认",
42
+ monthFormat: "yyyy年 M月",
43
+ quickRanges: "快速选择",
44
+ quickRangeToday: "今天",
45
+ quickRangeYesterday: "昨天",
46
+ quickRangeLast7Days: "近7天",
47
+ quickRangeLast30Days: "近30天",
48
+ quickRangeThisMonth: "本月",
49
+ quickRangeLastYear: "最近一年",
50
+ clear: "清除"
51
+ },
52
+ form: {
53
+ submit: "提交",
54
+ cancel: "取消"
55
+ },
56
+ imagePreview: {
57
+ closePreview: "关闭预览",
58
+ previousImage: "上一张",
59
+ nextImage: "下一张",
60
+ zoomOut: "缩小",
61
+ zoomIn: "放大",
62
+ reset: "重置",
63
+ rotateLeft: "左旋转",
64
+ rotateRight: "右旋转",
65
+ flipHorizontal: "左右镜像",
66
+ flipVertical: "上下镜像",
67
+ previewImage: "预览第{index}张"
68
+ },
69
+ modal: {
70
+ close: "关闭",
71
+ confirmTitle: "提示",
72
+ okText: "确认",
73
+ cancelText: "取消"
74
+ },
75
+ message: { close: "关闭" },
76
+ select: { empty: "暂无选项" },
77
+ tableSearch: {
78
+ reset: "重置",
79
+ search: "查询",
80
+ export: "导出Excel",
81
+ expand: "展开",
82
+ collapse: "收起",
83
+ exportCurrentPage: "当前页",
84
+ exportCurrentQuery: "当前查询条件"
85
+ },
86
+ upload: {
87
+ deleteImage: "删除图片",
88
+ upload: "上传"
89
+ }
90
+ }
91
+ };
92
+ //#endregion
93
+ export { defaultLanguageResources };