@_tc/template-core 0.0.1-bate.46 → 0.0.1-bate.48

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 (856) hide show
  1. package/.skills/tc-component-usage-skills/SKILL.md +132 -0
  2. package/.skills/tc-component-usage-skills/reference/component-api.md +801 -0
  3. package/.skills/tc-component-usage-skills/reference/examples.md +435 -0
  4. package/.skills/tc-component-usage-skills/reference/patterns.md +392 -0
  5. package/.skills/tc-component-usage-skills/reference/template-core-frontend.md +104 -0
  6. package/.skills/tc-generator/SKILL.md +70 -0
  7. package/.skills/tc-generator/reference/example.md +357 -0
  8. package/.skills/tc-generator/reference/model-schema.md +328 -0
  9. package/.skills/tc-generator/reference/project-template/app/controller/product.js +73 -0
  10. package/.skills/tc-generator/reference/project-template/app/router/product.js +9 -0
  11. package/.skills/tc-generator/reference/project-template/config/config.default.js +7 -0
  12. package/.skills/tc-generator/reference/project-template/index.js +17 -0
  13. package/.skills/tc-generator/reference/project-template/model/product/mode.js +179 -0
  14. package/.skills/tc-generator/reference/project-template/model/product/project/default.js +5 -0
  15. package/.skills/tc-generator/reference/project-template/package.json +25 -0
  16. package/.skills/tc-generator/reference/runtime-extensions.md +190 -0
  17. package/README.md +1723 -0
  18. package/cjs/_virtual/_rolldown/runtime.js +1 -37
  19. package/cjs/app/controller/base.js +1 -29
  20. package/cjs/app/controller/project.js +1 -60
  21. package/cjs/app/controller/view.js +1 -24
  22. package/cjs/app/extend/$fetch.js +1 -0
  23. package/cjs/app/extend/db.js +20 -8
  24. package/cjs/app/extend/generateErrorMessage.js +1 -16
  25. package/cjs/app/extend/logger.js +1 -35
  26. package/cjs/app/extend/parsingParamsOnUrl.js +1 -22
  27. package/cjs/app/extend/render-view.js +1 -24
  28. package/cjs/app/middleware/api-params-verify.js +1 -72
  29. package/cjs/app/middleware/api-sign-verify.js +1 -23
  30. package/cjs/app/middleware/error-handle.js +1 -38
  31. package/cjs/app/middleware/project-handler.js +1 -21
  32. package/cjs/app/middleware.js +1 -32
  33. package/cjs/app/router/project.js +1 -10
  34. package/cjs/app/router/view.js +1 -9
  35. package/cjs/app/router-schema/project.js +1 -16
  36. package/cjs/app/service/base.js +1 -17
  37. package/cjs/app/service/project.js +1 -38
  38. package/cjs/app/type.js +0 -1
  39. package/cjs/app/typings.js +0 -1
  40. package/cjs/app/view/entry.tpl +27 -28
  41. package/cjs/bundler/buildBE.js +1 -0
  42. package/cjs/bundler/defaultAlias.js +1 -5
  43. package/cjs/bundler/dev.js +1 -20
  44. package/cjs/bundler/index.js +1 -19
  45. package/cjs/bundler/prod.js +1 -21
  46. package/cjs/bundler/state.js +1 -0
  47. package/cjs/bundler/utils.js +1 -262
  48. package/cjs/config/config.default.js +1 -0
  49. package/cjs/index.js +1 -23
  50. package/cjs/packages/common/LRUCache.js +1 -4
  51. package/cjs/packages/common/array/index.js +1 -43
  52. package/cjs/packages/common/cache/LRUCache.js +1 -45
  53. package/cjs/packages/common/cache/index.js +1 -4
  54. package/cjs/packages/common/guards/index.js +1 -34
  55. package/cjs/packages/common/http/index.js +1 -0
  56. package/cjs/packages/common/i18n/default.js +1 -95
  57. package/cjs/packages/common/i18n/en-US.js +1 -95
  58. package/cjs/packages/common/i18n/index.js +1 -178
  59. package/cjs/packages/common/i18n/locales.js +1 -17
  60. package/cjs/packages/common/i18n/types.js +0 -1
  61. package/cjs/packages/common/index.js +1 -65
  62. package/cjs/packages/common/log/index.js +2 -160
  63. package/cjs/packages/common/number/index.js +1 -14
  64. package/cjs/packages/common/object/filterEmpty.js +1 -32
  65. package/cjs/packages/common/object/filtereEmpty.js +1 -5
  66. package/cjs/packages/common/object/index.js +1 -26
  67. package/cjs/packages/common/string/index.js +1 -17
  68. package/cjs/packages/common/types/index.js +0 -1
  69. package/cjs/packages/core/env.js +1 -27
  70. package/cjs/packages/core/index.js +1 -110
  71. package/cjs/packages/core/loader/config.js +1 -43
  72. package/cjs/packages/core/loader/controller.js +1 -33
  73. package/cjs/packages/core/loader/extend.js +1 -31
  74. package/cjs/packages/core/loader/middleware.js +1 -30
  75. package/cjs/packages/core/loader/model.js +1 -111
  76. package/cjs/packages/core/loader/router-schema.js +1 -36
  77. package/cjs/packages/core/loader/router.js +1 -62
  78. package/cjs/packages/core/loader/service.js +1 -30
  79. package/cjs/packages/core/paths.js +1 -12
  80. package/cjs/packages/core/types.js +0 -1
  81. package/cjs/packages/utils/getAllFilesInFolder.js +1 -14
  82. package/cjs/packages/utils/getAllFnReturnValue.js +0 -1
  83. package/cjs/packages/utils/index.js +1 -11
  84. package/cjs/packages/utils/loadFile.js +1 -55
  85. package/cjs/packages/utils/path.js +1 -31
  86. package/cjs/packages/utils/runFileFn.js +1 -51
  87. package/cjs/scripts/vite-build/build.js +3 -0
  88. package/cjs/scripts/vite-build/collect.js +1 -0
  89. package/cjs/scripts/vite-build/constants.js +1 -0
  90. package/cjs/scripts/vite-build/dts.js +1 -0
  91. package/cjs/scripts/vite-build/index.js +1 -0
  92. package/cjs/scripts/vite-build/normalize.js +1 -0
  93. package/cjs/scripts/vite-build/plugins.js +1 -0
  94. package/cjs/scripts/vite-build/resolve.js +1 -0
  95. package/cjs/scripts/vite-build/types.js +0 -0
  96. package/cjs/scripts/vite-build/utils.js +1 -0
  97. package/esm/_virtual/_rolldown/runtime.js +4 -29
  98. package/esm/app/controller/base.js +14 -16
  99. package/esm/app/controller/project.js +39 -46
  100. package/esm/app/controller/view.js +23 -19
  101. package/esm/app/extend/$fetch.js +15 -0
  102. package/esm/app/extend/db.js +138 -4
  103. package/esm/app/extend/generateErrorMessage.js +4 -12
  104. package/esm/app/extend/logger.js +9 -17
  105. package/esm/app/extend/parsingParamsOnUrl.js +11 -18
  106. package/esm/app/extend/render-view.js +18 -16
  107. package/esm/app/middleware/api-params-verify.js +36 -50
  108. package/esm/app/middleware/api-sign-verify.js +10 -16
  109. package/esm/app/middleware/error-handle.js +17 -30
  110. package/esm/app/middleware/project-handler.js +11 -16
  111. package/esm/app/middleware.js +12 -19
  112. package/esm/app/router/project.js +4 -6
  113. package/esm/app/router/view.js +4 -5
  114. package/esm/app/router-schema/project.js +2 -2
  115. package/esm/app/service/base.js +6 -7
  116. package/esm/app/service/project.js +18 -32
  117. package/esm/app/view/entry.tpl +27 -28
  118. package/esm/bundler/buildBE.js +54 -0
  119. package/esm/bundler/defaultAlias.js +2 -2
  120. package/esm/bundler/dev.js +8 -14
  121. package/esm/bundler/index.js +11 -9
  122. package/esm/bundler/prod.js +9 -14
  123. package/esm/bundler/state.js +10 -0
  124. package/esm/bundler/utils.js +115 -164
  125. package/esm/config/config.default.js +9 -0
  126. package/esm/index.js +12 -15
  127. package/esm/packages/common/LRUCache.js +2 -2
  128. package/esm/packages/common/array/index.js +21 -31
  129. package/esm/packages/common/cache/LRUCache.js +21 -25
  130. package/esm/packages/common/cache/index.js +2 -2
  131. package/esm/packages/common/guards/index.js +5 -23
  132. package/esm/packages/common/http/index.js +256 -0
  133. package/esm/packages/common/i18n/default.js +2 -7
  134. package/esm/packages/common/i18n/en-US.js +2 -7
  135. package/esm/packages/common/i18n/index.js +73 -144
  136. package/esm/packages/common/i18n/locales.js +6 -8
  137. package/esm/packages/common/index.js +14 -13
  138. package/esm/packages/common/log/index.js +69 -122
  139. package/esm/packages/common/number/index.js +7 -8
  140. package/esm/packages/common/object/filterEmpty.js +16 -22
  141. package/esm/packages/common/object/filtereEmpty.js +2 -2
  142. package/esm/packages/common/object/index.js +14 -17
  143. package/esm/packages/common/string/index.js +2 -11
  144. package/esm/packages/core/env.js +22 -24
  145. package/esm/packages/core/index.js +36 -92
  146. package/esm/packages/core/loader/config.js +21 -35
  147. package/esm/packages/core/loader/controller.js +8 -27
  148. package/esm/packages/core/loader/extend.js +19 -21
  149. package/esm/packages/core/loader/middleware.js +9 -22
  150. package/esm/packages/core/loader/model.js +50 -91
  151. package/esm/packages/core/loader/router-schema.js +13 -29
  152. package/esm/packages/core/loader/router.js +27 -51
  153. package/esm/packages/core/loader/service.js +8 -24
  154. package/esm/packages/core/paths.js +5 -5
  155. package/esm/packages/utils/getAllFilesInFolder.js +6 -8
  156. package/esm/packages/utils/index.js +5 -5
  157. package/esm/packages/utils/loadFile.js +28 -43
  158. package/esm/packages/utils/path.js +10 -22
  159. package/esm/packages/utils/runFileFn.js +32 -37
  160. package/esm/scripts/vite-build/build.js +141 -0
  161. package/esm/scripts/vite-build/collect.js +79 -0
  162. package/esm/scripts/vite-build/constants.js +34 -0
  163. package/esm/scripts/vite-build/dts.js +132 -0
  164. package/esm/scripts/vite-build/index.js +3 -0
  165. package/esm/scripts/vite-build/normalize.js +78 -0
  166. package/esm/scripts/vite-build/plugins.js +106 -0
  167. package/esm/scripts/vite-build/resolve.js +46 -0
  168. package/esm/scripts/vite-build/types.js +0 -0
  169. package/esm/scripts/vite-build/utils.js +24 -0
  170. package/fe/bundler/defaultAlias.js +4 -0
  171. package/fe/frontend/apps/dash/Dashboard.d.ts +6 -0
  172. package/fe/frontend/apps/dash/Dashboard.js +164 -0
  173. package/fe/frontend/apps/dash/dash.entry.js +54 -0
  174. package/fe/frontend/apps/dash/types.d.ts +25 -0
  175. package/fe/frontend/apps/dash/types.js +0 -0
  176. package/fe/frontend/apps/ui-components/index.js +16 -0
  177. package/fe/frontend/apps/ui-components/ui-components.entry.d.ts +2 -0
  178. package/fe/frontend/apps/ui-components/ui-components.entry.js +8 -0
  179. package/fe/frontend/extended/SchemaForm/data.d.ts +1 -1
  180. package/fe/frontend/extended/SchemaForm/data.js +7 -7
  181. package/fe/frontend/{widgets → src}/api/baseInfo.d.ts +2 -2
  182. package/fe/frontend/src/api/baseInfo.js +14 -0
  183. package/fe/frontend/src/common/CRUD/CRUD.d.ts +3 -0
  184. package/fe/frontend/src/common/CRUD/CRUD.js +2 -0
  185. package/fe/frontend/src/common/CRUD/index.d.ts +2 -0
  186. package/fe/frontend/src/common/CRUD/index.js +2 -0
  187. package/fe/frontend/src/common/auth/index.js +21 -0
  188. package/fe/frontend/{widgets/defaultPages/Schema/utils → src/common}/fetchErrorShow.d.ts +1 -1
  189. package/fe/frontend/src/common/fetchErrorShow.js +11 -0
  190. package/fe/frontend/src/common/generateMenuData.d.ts +4 -0
  191. package/fe/frontend/src/common/generateMenuData.js +16 -0
  192. package/fe/frontend/{widgets → src}/common/importComponent.d.ts +1 -1
  193. package/fe/frontend/src/common/importComponent.js +23 -0
  194. package/fe/frontend/src/common/language.d.ts +3 -0
  195. package/fe/frontend/src/common/language.js +12 -0
  196. package/fe/frontend/{widgets → src}/common/logFn/index.d.ts +1 -0
  197. package/fe/frontend/src/common/logFn/index.js +14 -0
  198. package/fe/frontend/{widgets → src}/common/menu.d.ts +1 -1
  199. package/fe/frontend/src/common/menu.js +97 -0
  200. package/fe/frontend/src/common/request.d.ts +37 -0
  201. package/fe/frontend/src/common/request.js +183 -0
  202. package/fe/frontend/{components → src/components}/AsyncSelect/AsyncSelect.d.ts +3 -3
  203. package/fe/frontend/src/components/AsyncSelect/AsyncSelect.js +35 -0
  204. package/fe/frontend/src/components/AsyncSelect/index.d.ts +4 -0
  205. package/fe/frontend/src/components/AsyncSelect/index.js +5 -0
  206. package/fe/frontend/{widgets → src}/components/BasePage/HeaderView.d.ts +1 -0
  207. package/fe/frontend/src/components/BasePage/HeaderView.js +55 -0
  208. package/fe/frontend/src/components/LanguageSwitch/LanguageSwitch.d.ts +14 -0
  209. package/fe/frontend/src/components/LanguageSwitch/LanguageSwitch.js +44 -0
  210. package/fe/frontend/src/components/LanguageSwitch/index.d.ts +4 -0
  211. package/fe/frontend/src/components/LanguageSwitch/index.js +5 -0
  212. package/fe/frontend/{widgets → src}/components/Router/index.d.ts +2 -2
  213. package/fe/frontend/src/components/Router/index.js +21 -0
  214. package/fe/frontend/src/components/Router/type.js +0 -0
  215. package/fe/frontend/src/components/ThemeSwitch/ThemeSwitch.d.ts +15 -0
  216. package/fe/frontend/src/components/ThemeSwitch/ThemeSwitch.js +83 -0
  217. package/fe/frontend/src/components/ThemeSwitch/index.d.ts +4 -0
  218. package/fe/frontend/src/components/ThemeSwitch/index.js +5 -0
  219. package/fe/frontend/src/components/index.d.ts +11 -0
  220. package/fe/frontend/src/components/index.js +7 -0
  221. package/fe/frontend/src/defaultPages/Iframe/index.js +15 -0
  222. package/fe/frontend/src/defaultPages/NotFoundPage/index.d.ts +3 -0
  223. package/fe/frontend/src/defaultPages/NotFoundPage/index.js +28 -0
  224. package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/components/CallCom/DetailPanel.d.ts +1 -1
  225. package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/DetailPanel.js +102 -0
  226. package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/components/CallCom/PopFrom.d.ts +1 -1
  227. package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/PopFrom.js +119 -0
  228. package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.d.ts +44 -0
  229. package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/builtIn.js +10 -0
  230. package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/data.d.ts +4 -0
  231. package/fe/frontend/src/defaultPages/SchemaPage/components/CallCom/data.js +9 -0
  232. package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaSearch/index.js +62 -0
  233. package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/components/SchemaTable/index.d.ts +2 -2
  234. package/fe/frontend/src/defaultPages/SchemaPage/components/SchemaTable/index.js +200 -0
  235. package/fe/frontend/src/defaultPages/SchemaPage/data/eventInfo.js +9 -0
  236. package/fe/frontend/src/defaultPages/SchemaPage/data/index.js +4 -0
  237. package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/hooks/useComConfig.d.ts +1 -1
  238. package/fe/frontend/src/defaultPages/SchemaPage/hooks/useComConfig.js +17 -0
  239. package/fe/frontend/src/defaultPages/SchemaPage/index.css +112 -0
  240. package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/index.d.ts +1 -0
  241. package/fe/frontend/src/defaultPages/SchemaPage/index.js +90 -0
  242. package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/schemaType.d.ts +7 -6
  243. package/fe/frontend/src/defaultPages/SchemaPage/schemaType.js +7 -0
  244. package/fe/frontend/src/defaultPages/SchemaPage/utils/permissions.js +6 -0
  245. package/fe/frontend/src/defaultPages/SchemaPage/utils/schemaConversion.d.ts +3 -0
  246. package/fe/frontend/src/defaultPages/SchemaPage/utils/schemaConversion.js +66 -0
  247. package/fe/frontend/src/defaultPages/SchemaPage/utils/validator.d.ts +11 -0
  248. package/fe/frontend/src/defaultPages/SchemaPage/utils/validator.js +122 -0
  249. package/fe/frontend/{widgets → src}/defaultPages/SidebarSlotPage/SidebarSlotContainer.d.ts +2 -2
  250. package/fe/frontend/src/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +55 -0
  251. package/fe/frontend/src/defaultPages/SidebarSlotPage/index.js +21 -0
  252. package/fe/frontend/src/defaultPages/SidebarSlotPageTmp.js +21 -0
  253. package/fe/frontend/src/defaultPages/SlotPage/index.js +22 -0
  254. package/fe/frontend/src/exportStore.d.ts +17 -0
  255. package/fe/frontend/src/exportStore.js +5 -0
  256. package/fe/frontend/src/hooks/useCurrentMenuData.js +30 -0
  257. package/fe/frontend/src/hooks/useRouterParams.js +16 -0
  258. package/fe/frontend/src/index.d.ts +21 -0
  259. package/fe/frontend/src/index.js +19 -0
  260. package/fe/frontend/src/language/en-US.d.ts +89 -0
  261. package/fe/frontend/src/language/en-US.js +89 -0
  262. package/fe/frontend/src/language/index.d.ts +73 -0
  263. package/fe/frontend/src/language/index.js +79 -0
  264. package/fe/frontend/src/language/zh-CN.d.ts +89 -0
  265. package/fe/frontend/src/language/zh-CN.js +89 -0
  266. package/fe/frontend/src/main.css +96 -0
  267. package/fe/frontend/src/main.d.ts +27 -0
  268. package/fe/frontend/src/main.js +60 -0
  269. package/fe/frontend/src/stores/apiFreezer.d.ts +93 -0
  270. package/fe/frontend/src/stores/apiFreezer.js +53 -0
  271. package/fe/frontend/{widgets/store → src/stores}/mode.d.ts +3 -3
  272. package/fe/frontend/src/stores/mode.js +36 -0
  273. package/fe/frontend/{widgets/defaultPages/Schema → src}/stores/schemaEventBus.d.ts +1 -1
  274. package/fe/frontend/src/stores/schemaEventBus.js +53 -0
  275. package/fe/frontend/{widgets/defaultPages/Schema → src}/stores/schemaStore.d.ts +5 -5
  276. package/fe/frontend/src/stores/schemaStore.js +28 -0
  277. package/fe/frontend/{typing → src/typing}/scalability.d.ts +3 -3
  278. package/fe/frontend/src/typing/scalability.js +0 -0
  279. package/fe/frontend/src/typing/window.d.ts +9 -0
  280. package/fe/frontend/src/typing/window.js +0 -0
  281. package/fe/model/types/data/button.d.ts +4 -4
  282. package/fe/model/types/data/component.d.ts +32 -47
  283. package/fe/model/types/data/schema.d.ts +6 -6
  284. package/fe/model/types/data/search.d.ts +1 -1
  285. package/fe/model/types/model.d.ts +19 -12
  286. package/fe/packages/common/cache/LRUCache.js +43 -47
  287. package/fe/packages/common/guards/index.js +8 -24
  288. package/fe/packages/common/http/index.d.ts +90 -0
  289. package/fe/packages/common/http/index.js +300 -0
  290. package/fe/packages/common/i18n/default.js +91 -88
  291. package/fe/packages/common/i18n/en-US.js +91 -88
  292. package/fe/packages/common/i18n/index.d.ts +3 -3
  293. package/fe/packages/common/i18n/index.js +142 -153
  294. package/fe/packages/common/i18n/locales.d.ts +3 -3
  295. package/fe/packages/common/i18n/locales.js +10 -9
  296. package/fe/packages/common/index.d.ts +1 -0
  297. package/fe/packages/common/object/filterEmpty.js +25 -30
  298. package/fe/packages/react/hooks/useBreadcrumb.d.ts +10 -0
  299. package/fe/packages/react/hooks/useBreadcrumb.js +5 -0
  300. package/fe/packages/react/hooks/useExecuteOnce.js +47 -0
  301. package/fe/packages/react/hooks/useInit.js +11 -0
  302. package/fe/packages/react/hooks/useLanguage.d.ts +2 -0
  303. package/fe/packages/react/hooks/useLanguage.js +8 -0
  304. package/fe/packages/react/hooks/usePagination.js +30 -0
  305. package/fe/packages/{ui/react → react}/hooks/useRefState.d.ts +1 -1
  306. package/fe/packages/react/hooks/useRefState.js +35 -0
  307. package/fe/packages/react/hooks/useWatch.js +60 -0
  308. package/fe/packages/react/hooks/useWatch.test.js +24 -0
  309. package/fe/packages/react/ui/assets/table/no-result.js +4 -0
  310. package/fe/packages/{ui/react → react/ui}/components/Button/Button.d.ts +1 -1
  311. package/fe/packages/react/ui/components/Button/Button.js +88 -0
  312. package/fe/packages/react/ui/components/Button/SubmitButton.d.ts +13 -0
  313. package/fe/packages/react/ui/components/Button/SubmitButton.js +30 -0
  314. package/fe/packages/react/ui/components/Button/index.d.ts +4 -0
  315. package/fe/packages/react/ui/components/Button/index.js +3 -0
  316. package/fe/packages/react/ui/components/Card/Card.d.ts +15 -0
  317. package/fe/packages/react/ui/components/Card/Card.js +31 -0
  318. package/fe/packages/react/ui/components/Card/index.d.ts +2 -0
  319. package/fe/packages/react/ui/components/Card/index.js +2 -0
  320. package/fe/packages/{ui/react → react/ui}/components/Checkbox/Checkbox.d.ts +1 -1
  321. package/fe/packages/react/ui/components/Checkbox/Checkbox.js +52 -0
  322. package/fe/packages/react/ui/components/Checkbox/index.d.ts +2 -0
  323. package/fe/packages/react/ui/components/Checkbox/index.js +2 -0
  324. package/fe/packages/react/ui/components/ConfirmDialog/ConfirmDialog.js +41 -0
  325. package/fe/packages/react/ui/components/ConfirmDialog/index.d.ts +2 -0
  326. package/fe/packages/react/ui/components/ConfirmDialog/index.js +2 -0
  327. package/fe/packages/{ui/react → react/ui}/components/DataTable/ActionBtn.d.ts +1 -1
  328. package/fe/packages/react/ui/components/DataTable/ActionBtn.js +116 -0
  329. package/fe/packages/{ui/react → react/ui}/components/DataTable/index.d.ts +9 -7
  330. package/fe/packages/react/ui/components/DataTable/index.js +235 -0
  331. package/fe/packages/{ui/react → react/ui}/components/Date/Calendar.d.ts +2 -2
  332. package/fe/packages/react/ui/components/Date/Calendar.js +351 -0
  333. package/fe/packages/react/ui/components/Date/Date.js +210 -0
  334. package/fe/packages/react/ui/components/Date/DateTestPage.js +340 -0
  335. package/fe/packages/react/ui/components/Date/LocaleContext.js +11 -0
  336. package/fe/packages/{ui/react → react/ui}/components/Date/LocaleProvider.d.ts +2 -2
  337. package/fe/packages/react/ui/components/Date/LocaleProvider.js +31 -0
  338. package/fe/packages/react/ui/components/Date/TimePicker.js +136 -0
  339. package/fe/packages/react/ui/components/Date/data.js +7 -0
  340. package/fe/packages/{ui/react → react/ui}/components/Date/dateLocaleStore.d.ts +1 -1
  341. package/fe/packages/react/ui/components/Date/dateLocaleStore.js +14 -0
  342. package/fe/packages/react/ui/components/Date/dropdownPositioning.d.ts +3 -0
  343. package/fe/packages/react/ui/components/Date/dropdownPositioning.js +12 -0
  344. package/fe/packages/react/ui/components/Date/index.d.ts +6 -0
  345. package/fe/packages/react/ui/components/Date/index.js +6 -0
  346. package/fe/packages/react/ui/components/Date/locales.js +25 -0
  347. package/fe/packages/{ui/react → react/ui}/components/Drawer/Drawer.d.ts +1 -1
  348. package/fe/packages/react/ui/components/Drawer/Drawer.js +151 -0
  349. package/fe/packages/react/ui/components/Drawer/index.d.ts +3 -0
  350. package/fe/packages/react/ui/components/Drawer/index.js +2 -0
  351. package/fe/packages/{ui/react → react/ui}/components/Dropdown/Dropdown.d.ts +3 -2
  352. package/fe/packages/react/ui/components/Dropdown/Dropdown.js +105 -0
  353. package/fe/packages/react/ui/components/Dropdown/index.d.ts +2 -0
  354. package/fe/packages/react/ui/components/Dropdown/index.js +2 -0
  355. package/fe/packages/{ui/react → react/ui}/components/Form/Form.d.ts +2 -2
  356. package/fe/packages/react/ui/components/Form/Form.js +15 -0
  357. package/fe/packages/{ui/react → react/ui}/components/Form/FormItem.d.ts +3 -3
  358. package/fe/packages/react/ui/components/Form/FormItem.js +60 -0
  359. package/fe/packages/{ui/react → react/ui}/components/Form/SchemaForm/data.d.ts +8 -8
  360. package/fe/packages/react/ui/components/Form/SchemaForm/data.js +16 -0
  361. package/fe/packages/react/ui/components/Form/SchemaForm/defaultComponentsMap.d.ts +4 -0
  362. package/fe/packages/react/ui/components/Form/SchemaForm/defaultComponentsMap.js +4 -0
  363. package/fe/packages/{ui/react → react/ui}/components/Form/SchemaForm/index.d.ts +9 -9
  364. package/fe/packages/react/ui/components/Form/SchemaForm/index.js +119 -0
  365. package/fe/packages/react/ui/components/Form/index.d.ts +5 -0
  366. package/fe/packages/react/ui/components/Form/index.js +5 -0
  367. package/fe/packages/react/ui/components/Form/useForm.d.ts +3 -0
  368. package/fe/packages/react/ui/components/Form/useForm.js +2 -0
  369. package/fe/packages/react/ui/components/ImagePreview/ImagePreview.js +307 -0
  370. package/fe/packages/{ui/react → react/ui}/components/ImagePreview/PreviewImage.d.ts +2 -2
  371. package/fe/packages/react/ui/components/ImagePreview/PreviewImage.js +56 -0
  372. package/fe/packages/react/ui/components/ImagePreview/index.d.ts +3 -0
  373. package/fe/packages/react/ui/components/ImagePreview/index.js +3 -0
  374. package/fe/packages/{ui/react → react/ui}/components/Input/Input.d.ts +1 -1
  375. package/fe/packages/react/ui/components/Input/Input.js +88 -0
  376. package/fe/packages/react/ui/components/Input/index.d.ts +2 -0
  377. package/fe/packages/react/ui/components/Input/index.js +2 -0
  378. package/fe/packages/{ui/react → react/ui}/components/InputNumber/InputNumber.d.ts +2 -2
  379. package/fe/packages/react/ui/components/InputNumber/InputNumber.js +207 -0
  380. package/fe/packages/react/ui/components/InputNumber/index.d.ts +2 -0
  381. package/fe/packages/react/ui/components/InputNumber/index.js +2 -0
  382. package/fe/packages/react/ui/components/InputNumber/inputNumberUtils.js +45 -0
  383. package/fe/packages/react/ui/components/InputNumber/inputNumberUtils.test.js +59 -0
  384. package/fe/packages/{ui/react → react/ui}/components/Label/Label.d.ts +1 -1
  385. package/fe/packages/react/ui/components/Label/Label.js +58 -0
  386. package/fe/packages/react/ui/components/Label/index.d.ts +3 -0
  387. package/fe/packages/react/ui/components/Label/index.js +2 -0
  388. package/fe/packages/react/ui/components/Layout/Layout.d.ts +11 -0
  389. package/fe/packages/react/ui/components/Layout/Layout.js +33 -0
  390. package/fe/packages/react/ui/components/Layout/index.d.ts +2 -0
  391. package/fe/packages/react/ui/components/Layout/index.js +2 -0
  392. package/fe/packages/react/ui/components/Loading/Loading.d.ts +25 -0
  393. package/fe/packages/react/ui/components/Loading/Loading.js +48 -0
  394. package/fe/packages/react/ui/components/Loading/index.d.ts +2 -0
  395. package/fe/packages/react/ui/components/Loading/index.js +2 -0
  396. package/fe/packages/react/ui/components/Menu/Menu.js +147 -0
  397. package/fe/packages/react/ui/components/Menu/MenuContext.js +88 -0
  398. package/fe/packages/react/ui/components/Menu/MenuItem.js +78 -0
  399. package/fe/packages/react/ui/components/Menu/SubMenu.js +207 -0
  400. package/fe/packages/react/ui/components/Menu/index.d.ts +9 -0
  401. package/fe/packages/react/ui/components/Menu/index.js +5 -0
  402. package/fe/packages/{ui/react → react/ui}/components/Menu/menuTypes.d.ts +1 -1
  403. package/fe/packages/react/ui/components/Menu/menuTypes.js +0 -0
  404. package/fe/packages/react/ui/components/Menu/utils.js +8 -0
  405. package/fe/packages/{ui/react → react/ui}/components/Message/Message.d.ts +1 -1
  406. package/fe/packages/react/ui/components/Message/Message.js +76 -0
  407. package/fe/packages/{ui/react → react/ui}/components/Message/MessageManager.d.ts +2 -2
  408. package/fe/packages/react/ui/components/Message/MessageManager.js +104 -0
  409. package/fe/packages/react/ui/components/Message/data.js +4 -0
  410. package/fe/packages/react/ui/components/Message/index.d.ts +3 -0
  411. package/fe/packages/react/ui/components/Message/index.js +2 -0
  412. package/fe/packages/{ui/react → react/ui}/components/Modal/Modal.d.ts +1 -1
  413. package/fe/packages/react/ui/components/Modal/Modal.js +59 -0
  414. package/fe/packages/{ui/react → react/ui}/components/Modal/ModalManager.d.ts +5 -5
  415. package/fe/packages/react/ui/components/Modal/ModalManager.js +106 -0
  416. package/fe/packages/react/ui/components/Modal/index.d.ts +4 -0
  417. package/fe/packages/react/ui/components/Modal/index.js +3 -0
  418. package/fe/packages/react/ui/components/Notification/Notification.d.ts +14 -0
  419. package/fe/packages/react/ui/components/Notification/Notification.js +56 -0
  420. package/fe/packages/react/ui/components/Notification/index.d.ts +2 -0
  421. package/fe/packages/react/ui/components/Notification/index.js +2 -0
  422. package/fe/packages/{ui/react → react/ui}/components/Overlay/Overlay.d.ts +1 -1
  423. package/fe/packages/react/ui/components/Overlay/Overlay.js +61 -0
  424. package/fe/packages/react/ui/components/Overlay/index.d.ts +3 -0
  425. package/fe/packages/react/ui/components/Overlay/index.js +2 -0
  426. package/fe/packages/react/ui/components/Pagination/Pagination.js +115 -0
  427. package/fe/packages/react/ui/components/Pagination/index.d.ts +2 -0
  428. package/fe/packages/react/ui/components/Pagination/index.js +2 -0
  429. package/fe/packages/react/ui/components/Popup/Popup.js +86 -0
  430. package/fe/packages/react/ui/components/Popup/index.d.ts +2 -0
  431. package/fe/packages/react/ui/components/Popup/index.js +2 -0
  432. package/fe/packages/react/ui/components/Radio/Radio.d.ts +9 -0
  433. package/fe/packages/react/ui/components/Radio/Radio.js +36 -0
  434. package/fe/packages/react/ui/components/Radio/RadioGroup.d.ts +19 -0
  435. package/fe/packages/react/ui/components/Radio/RadioGroup.js +33 -0
  436. package/fe/packages/react/ui/components/Radio/index.d.ts +3 -0
  437. package/fe/packages/react/ui/components/Radio/index.js +3 -0
  438. package/fe/packages/{ui/react → react/ui}/components/Search/Search.d.ts +4 -4
  439. package/fe/packages/react/ui/components/Search/Search.js +24 -0
  440. package/fe/packages/react/ui/components/Search/index.d.ts +2 -0
  441. package/fe/packages/react/ui/components/Search/index.js +2 -0
  442. package/fe/packages/{ui/react → react/ui}/components/Select/Select.d.ts +1 -1
  443. package/fe/packages/react/ui/components/Select/Select.js +276 -0
  444. package/fe/packages/react/ui/components/Select/dropdownPositioning.d.ts +3 -0
  445. package/fe/packages/react/ui/components/Select/dropdownPositioning.js +16 -0
  446. package/fe/packages/react/ui/components/Select/index.d.ts +2 -0
  447. package/fe/packages/react/ui/components/Select/index.js +2 -0
  448. package/fe/packages/{ui/react → react/ui}/components/Skeleton/Skeleton.d.ts +1 -1
  449. package/fe/packages/react/ui/components/Skeleton/Skeleton.js +101 -0
  450. package/fe/packages/react/ui/components/Skeleton/index.d.ts +3 -0
  451. package/fe/packages/react/ui/components/Skeleton/index.js +2 -0
  452. package/fe/packages/{ui/react → react/ui}/components/Switch/Switch.d.ts +1 -1
  453. package/fe/packages/react/ui/components/Switch/Switch.js +28 -0
  454. package/fe/packages/react/ui/components/Switch/index.d.ts +2 -0
  455. package/fe/packages/react/ui/components/Switch/index.js +2 -0
  456. package/fe/packages/{ui/react → react/ui}/components/TableSearch/TableSearch.d.ts +6 -6
  457. package/fe/packages/react/ui/components/TableSearch/TableSearch.js +146 -0
  458. package/fe/packages/react/ui/components/TableSearch/index.d.ts +3 -0
  459. package/fe/packages/react/ui/components/TableSearch/index.js +2 -0
  460. package/fe/packages/react/ui/components/TableSearch/lang.js +14 -0
  461. package/fe/packages/{ui/react → react/ui}/components/TableSearch/tableSearchLocaleStore.d.ts +1 -1
  462. package/fe/packages/react/ui/components/TableSearch/tableSearchLocaleStore.js +10 -0
  463. package/fe/packages/react/ui/components/Tabs/Tabs.d.ts +16 -0
  464. package/fe/packages/react/ui/components/Tabs/Tabs.js +33 -0
  465. package/fe/packages/react/ui/components/Tabs/index.d.ts +2 -0
  466. package/fe/packages/react/ui/components/Tabs/index.js +2 -0
  467. package/fe/packages/react/ui/components/Textarea/Textarea.js +58 -0
  468. package/fe/packages/react/ui/components/Textarea/index.d.ts +2 -0
  469. package/fe/packages/react/ui/components/Textarea/index.js +2 -0
  470. package/fe/packages/react/ui/components/Tooltip/Tooltip.js +77 -0
  471. package/fe/packages/react/ui/components/Tooltip/index.d.ts +2 -0
  472. package/fe/packages/react/ui/components/Tooltip/index.js +2 -0
  473. package/fe/packages/react/ui/components/TreeSelect/TreeSelect.js +190 -0
  474. package/fe/packages/react/ui/components/TreeSelect/index.d.ts +2 -0
  475. package/fe/packages/react/ui/components/TreeSelect/index.js +2 -0
  476. package/fe/packages/react/ui/components/Upload/ImageUpload.js +101 -0
  477. package/fe/packages/{ui/react → react/ui}/components/Upload/Upload.d.ts +1 -1
  478. package/fe/packages/react/ui/components/Upload/Upload.js +29 -0
  479. package/fe/packages/react/ui/components/Upload/index.d.ts +3 -0
  480. package/fe/packages/react/ui/components/Upload/index.js +3 -0
  481. package/fe/packages/react/ui/components/breadcrumb/breadcrumb.js +155 -0
  482. package/fe/packages/react/ui/components/breadcrumb/index.d.ts +2 -0
  483. package/fe/packages/react/ui/components/breadcrumb/index.js +2 -0
  484. package/fe/packages/react/ui/components/hooks/useDropdownPositioning.js +121 -0
  485. package/fe/packages/react/ui/components/hooks/useInputController.js +39 -0
  486. package/fe/packages/react/ui/components/index.d.ts +36 -0
  487. package/fe/packages/react/ui/components/index.js +81 -0
  488. package/fe/packages/react/ui/components/table/index.d.ts +2 -0
  489. package/fe/packages/react/ui/components/table/index.js +2 -0
  490. package/fe/packages/{ui/react → react/ui}/components/table/table.d.ts +16 -3
  491. package/fe/packages/react/ui/components/table/table.js +166 -0
  492. package/fe/packages/react/ui/components/testPage/MenuTestPage.js +397 -0
  493. package/fe/packages/react/ui/components/testPage/index.js +1612 -0
  494. package/fe/packages/{ui/react → react/ui}/i18n/I18nProvider.d.ts +2 -2
  495. package/fe/packages/react/ui/i18n/I18nProvider.js +38 -0
  496. package/fe/packages/react/ui/i18n/index.d.ts +4 -0
  497. package/fe/packages/react/ui/i18n/index.js +7 -0
  498. package/fe/packages/react/ui/i18n/useI18n.d.ts +13 -0
  499. package/fe/packages/react/ui/i18n/useI18n.js +25 -0
  500. package/fe/packages/{ui/react → react/ui}/index.css +70 -9
  501. package/fe/packages/react/ui/index.d.ts +5 -0
  502. package/fe/packages/react/ui/index.js +58 -0
  503. package/fe/packages/{ui/react → react/ui}/lib/createStoreHook.d.ts +1 -1
  504. package/fe/packages/react/ui/lib/createStoreHook.js +9 -0
  505. package/fe/packages/{ui/react → react/ui}/lib/export.d.ts +1 -1
  506. package/fe/packages/react/ui/lib/export.js +112 -0
  507. package/fe/packages/react/ui/lib/utils.js +64 -0
  508. package/fe/packages/{ui/react → react/ui}/stores/breadcrumb.d.ts +1 -1
  509. package/fe/packages/react/ui/stores/breadcrumb.js +52 -0
  510. package/fe/packages/react/ui/stores/language.d.ts +4 -0
  511. package/fe/packages/react/ui/stores/language.js +4 -0
  512. package/fe/packages/react/ui/types/index.js +0 -0
  513. package/fe/typings/type.d.ts +1 -0
  514. package/model/index.d.ts +1 -1
  515. package/model/types/data/button.d.ts +4 -4
  516. package/model/types/data/component.d.ts +32 -47
  517. package/model/types/data/schema.d.ts +6 -6
  518. package/model/types/data/search.d.ts +1 -1
  519. package/model/types/index.d.ts +2 -1
  520. package/model/types/model.d.ts +19 -12
  521. package/package.json +37 -39
  522. package/types/app/controller/project.d.ts +14 -2
  523. package/types/app/controller/view.d.ts +1 -1
  524. package/types/app/extend/$fetch.d.ts +8 -0
  525. package/types/app/extend/db.d.ts +54 -1
  526. package/types/app/extend/render-view.d.ts +3 -0
  527. package/types/app/middleware/api-params-verify.d.ts +1 -1
  528. package/types/app/middleware/project-handler.d.ts +2 -2
  529. package/types/app/router/project.d.ts +1 -1
  530. package/types/app/service/base.d.ts +3 -4
  531. package/types/app/service/project.d.ts +7 -2
  532. package/types/app/type.d.ts +5 -3
  533. package/types/app/typings.d.ts +4 -2
  534. package/types/bundler/buildBE.d.ts +13 -0
  535. package/types/bundler/index.d.ts +4 -1
  536. package/types/bundler/state.d.ts +18 -0
  537. package/types/bundler/utils.d.ts +5 -0
  538. package/types/config/config.default.d.ts +33 -2
  539. package/types/index.d.ts +6 -5
  540. package/{fe/frontend/widgets/common/CRUD/CRUD.d.ts → types/packages/common/http/index.d.ts} +29 -10
  541. package/types/packages/common/i18n/default.d.ts +5 -0
  542. package/types/packages/common/i18n/en-US.d.ts +5 -0
  543. package/types/packages/common/i18n/index.d.ts +24 -0
  544. package/types/packages/common/i18n/types.d.ts +24 -0
  545. package/types/packages/common/index.d.ts +1 -0
  546. package/types/packages/core/index.d.ts +3 -3
  547. package/types/packages/core/loader/config.d.ts +6 -0
  548. package/types/packages/core/loader/controller.d.ts +14 -0
  549. package/types/packages/core/loader/extend.d.ts +6 -1
  550. package/types/packages/core/loader/middleware.d.ts +8 -0
  551. package/types/packages/core/loader/model.d.ts +22 -0
  552. package/types/packages/core/loader/router-schema.d.ts +15 -0
  553. package/types/packages/core/loader/router.d.ts +5 -0
  554. package/types/packages/core/loader/service.d.ts +14 -0
  555. package/types/packages/core/paths.d.ts +10 -7
  556. package/types/packages/core/types.d.ts +66 -3
  557. package/types/packages/utils/getAllFilesInFolder.d.ts +5 -0
  558. package/types/packages/utils/loadFile.d.ts +6 -0
  559. package/types/packages/utils/path.d.ts +18 -0
  560. package/types/scripts/vite-build/build.d.ts +24 -0
  561. package/types/scripts/vite-build/collect.d.ts +57 -0
  562. package/types/scripts/vite-build/constants.d.ts +6 -0
  563. package/types/scripts/vite-build/dts.d.ts +53 -0
  564. package/types/scripts/vite-build/index.d.ts +2 -0
  565. package/types/scripts/vite-build/normalize.d.ts +66 -0
  566. package/types/scripts/vite-build/plugins.d.ts +67 -0
  567. package/types/scripts/vite-build/resolve.d.ts +61 -0
  568. package/types/scripts/vite-build/types.d.ts +174 -0
  569. package/types/scripts/vite-build/utils.d.ts +35 -0
  570. package/types/typings/type.d.ts +1 -0
  571. package/cjs/app/README.md +0 -286
  572. package/cjs/app/data/signKey.js +0 -23
  573. package/esm/app/README.md +0 -286
  574. package/esm/app/data/signKey.js +0 -10
  575. package/fe/frontend/components/AsyncSelect/AsyncSelect.js +0 -32
  576. package/fe/frontend/components/AsyncSelect/index.d.ts +0 -4
  577. package/fe/frontend/components/AsyncSelect/index.js +0 -3
  578. package/fe/frontend/dash/Dashboard.d.ts +0 -7
  579. package/fe/frontend/dash/Dashboard.js +0 -73
  580. package/fe/frontend/dash/dash.entry.js +0 -93
  581. package/fe/frontend/dash/types.d.ts +0 -17
  582. package/fe/frontend/dash/types.js +0 -1
  583. package/fe/frontend/index.d.ts +0 -5
  584. package/fe/frontend/index.js +0 -2
  585. package/fe/frontend/main.css +0 -5
  586. package/fe/frontend/main.d.ts +0 -11
  587. package/fe/frontend/main.js +0 -19
  588. package/fe/frontend/testPage/index.js +0 -6
  589. package/fe/frontend/testPage/testPage.entry.d.ts +0 -2
  590. package/fe/frontend/testPage/testPage.entry.js +0 -3
  591. package/fe/frontend/typing/scalability.js +0 -1
  592. package/fe/frontend/typing/window.d.ts +0 -7
  593. package/fe/frontend/typing/window.js +0 -1
  594. package/fe/frontend/widgets/api/baseInfo.js +0 -15
  595. package/fe/frontend/widgets/common/CRUD/CRUD.js +0 -208
  596. package/fe/frontend/widgets/common/CRUD/index.d.ts +0 -2
  597. package/fe/frontend/widgets/common/CRUD/index.js +0 -1
  598. package/fe/frontend/widgets/common/auth/index.js +0 -20
  599. package/fe/frontend/widgets/common/generateMenuData.d.ts +0 -4
  600. package/fe/frontend/widgets/common/generateMenuData.js +0 -14
  601. package/fe/frontend/widgets/common/importComponent.js +0 -8
  602. package/fe/frontend/widgets/common/language.d.ts +0 -2
  603. package/fe/frontend/widgets/common/language.js +0 -9
  604. package/fe/frontend/widgets/common/logFn/index.js +0 -8
  605. package/fe/frontend/widgets/common/menu.js +0 -101
  606. package/fe/frontend/widgets/common/request.d.ts +0 -36
  607. package/fe/frontend/widgets/common/request.js +0 -133
  608. package/fe/frontend/widgets/components/BasePage/HeaderView.js +0 -16
  609. package/fe/frontend/widgets/components/Router/index.js +0 -11
  610. package/fe/frontend/widgets/components/Router/type.js +0 -1
  611. package/fe/frontend/widgets/defaultPages/Iframe/index.js +0 -14
  612. package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/DetailPanel.js +0 -94
  613. package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/PopFrom.js +0 -124
  614. package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/data.d.ts +0 -3
  615. package/fe/frontend/widgets/defaultPages/Schema/components/CallCom/data.js +0 -6
  616. package/fe/frontend/widgets/defaultPages/Schema/components/SchemaSearch/index.js +0 -63
  617. package/fe/frontend/widgets/defaultPages/Schema/components/SchemaTable/index.js +0 -188
  618. package/fe/frontend/widgets/defaultPages/Schema/data/eventInfo.js +0 -6
  619. package/fe/frontend/widgets/defaultPages/Schema/data/index.js +0 -1
  620. package/fe/frontend/widgets/defaultPages/Schema/hooks/useComConfig.js +0 -14
  621. package/fe/frontend/widgets/defaultPages/Schema/index.js +0 -74
  622. package/fe/frontend/widgets/defaultPages/Schema/schemaType.js +0 -4
  623. package/fe/frontend/widgets/defaultPages/Schema/stores/schemaEventBus.js +0 -70
  624. package/fe/frontend/widgets/defaultPages/Schema/stores/schemaStore.js +0 -26
  625. package/fe/frontend/widgets/defaultPages/Schema/utils/fetchErrorShow.js +0 -8
  626. package/fe/frontend/widgets/defaultPages/Schema/utils/permissions.js +0 -3
  627. package/fe/frontend/widgets/defaultPages/Schema/utils/schemaConversion.d.ts +0 -3
  628. package/fe/frontend/widgets/defaultPages/Schema/utils/schemaConversion.js +0 -115
  629. package/fe/frontend/widgets/defaultPages/Schema/utils/validator.d.ts +0 -7
  630. package/fe/frontend/widgets/defaultPages/Schema/utils/validator.js +0 -36
  631. package/fe/frontend/widgets/defaultPages/SidebarSlotPage/SidebarSlotContainer.js +0 -38
  632. package/fe/frontend/widgets/defaultPages/SidebarSlotPage/index.js +0 -16
  633. package/fe/frontend/widgets/defaultPages/SidebarSlotPageTmp.js +0 -17
  634. package/fe/frontend/widgets/defaultPages/SlotPage/index.js +0 -26
  635. package/fe/frontend/widgets/defaultPages/Todo.d.ts +0 -3
  636. package/fe/frontend/widgets/defaultPages/Todo.js +0 -5
  637. package/fe/frontend/widgets/hooks/useCurrentMenuData.js +0 -28
  638. package/fe/frontend/widgets/hooks/useRouterParams.js +0 -11
  639. package/fe/frontend/widgets/store/mode.js +0 -37
  640. package/fe/model/types/data/button.js +0 -16
  641. package/fe/model/types/data/component.js +0 -11
  642. package/fe/model/types/data/fetchInfo.js +0 -1
  643. package/fe/model/types/data/schema.js +0 -1
  644. package/fe/model/types/data/search.js +0 -1
  645. package/fe/model/types/menuType.js +0 -1
  646. package/fe/model/types/model.js +0 -1
  647. package/fe/packages/common/array/index.js +0 -40
  648. package/fe/packages/common/cache/index.js +0 -1
  649. package/fe/packages/common/i18n/types.js +0 -1
  650. package/fe/packages/common/index.js +0 -9
  651. package/fe/packages/common/log/index.js +0 -176
  652. package/fe/packages/common/number/index.js +0 -10
  653. package/fe/packages/common/object/index.js +0 -25
  654. package/fe/packages/common/string/index.js +0 -17
  655. package/fe/packages/common/types/index.js +0 -1
  656. package/fe/packages/ui/react/components/Button/Button.js +0 -72
  657. package/fe/packages/ui/react/components/Button/SumbitButton.d.ts +0 -13
  658. package/fe/packages/ui/react/components/Button/SumbitButton.js +0 -25
  659. package/fe/packages/ui/react/components/Button/index.d.ts +0 -4
  660. package/fe/packages/ui/react/components/Button/index.js +0 -2
  661. package/fe/packages/ui/react/components/Checkbox/Checkbox.js +0 -39
  662. package/fe/packages/ui/react/components/Checkbox/index.d.ts +0 -2
  663. package/fe/packages/ui/react/components/Checkbox/index.js +0 -1
  664. package/fe/packages/ui/react/components/ConfirmDialog/ConfirmDialog.js +0 -11
  665. package/fe/packages/ui/react/components/ConfirmDialog/index.d.ts +0 -2
  666. package/fe/packages/ui/react/components/ConfirmDialog/index.js +0 -1
  667. package/fe/packages/ui/react/components/DataTable/ActionBtn.js +0 -94
  668. package/fe/packages/ui/react/components/DataTable/index.js +0 -155
  669. package/fe/packages/ui/react/components/Date/Calendar.js +0 -216
  670. package/fe/packages/ui/react/components/Date/Date.js +0 -201
  671. package/fe/packages/ui/react/components/Date/DateTestPage.js +0 -29
  672. package/fe/packages/ui/react/components/Date/LocaleContext.js +0 -8
  673. package/fe/packages/ui/react/components/Date/LocaleProvider.js +0 -24
  674. package/fe/packages/ui/react/components/Date/TimePicker.js +0 -78
  675. package/fe/packages/ui/react/components/Date/data.js +0 -4
  676. package/fe/packages/ui/react/components/Date/dateLocaleStore.js +0 -14
  677. package/fe/packages/ui/react/components/Date/dropdownPositioning.d.ts +0 -3
  678. package/fe/packages/ui/react/components/Date/dropdownPositioning.js +0 -12
  679. package/fe/packages/ui/react/components/Date/index.d.ts +0 -6
  680. package/fe/packages/ui/react/components/Date/index.js +0 -5
  681. package/fe/packages/ui/react/components/Date/locales.js +0 -21
  682. package/fe/packages/ui/react/components/Drawer/Drawer.js +0 -100
  683. package/fe/packages/ui/react/components/Drawer/index.d.ts +0 -3
  684. package/fe/packages/ui/react/components/Drawer/index.js +0 -1
  685. package/fe/packages/ui/react/components/Dropdown/Dropdown.js +0 -28
  686. package/fe/packages/ui/react/components/Dropdown/index.d.ts +0 -2
  687. package/fe/packages/ui/react/components/Dropdown/index.js +0 -1
  688. package/fe/packages/ui/react/components/Form/Form.js +0 -8
  689. package/fe/packages/ui/react/components/Form/FormItem.js +0 -43
  690. package/fe/packages/ui/react/components/Form/SchemaForm/data.js +0 -18
  691. package/fe/packages/ui/react/components/Form/SchemaForm/index.js +0 -79
  692. package/fe/packages/ui/react/components/Form/index.d.ts +0 -5
  693. package/fe/packages/ui/react/components/Form/index.js +0 -4
  694. package/fe/packages/ui/react/components/Form/useForm.d.ts +0 -3
  695. package/fe/packages/ui/react/components/Form/useForm.js +0 -1
  696. package/fe/packages/ui/react/components/ImagePreview/ImagePreview.js +0 -169
  697. package/fe/packages/ui/react/components/ImagePreview/PreviewImage.js +0 -28
  698. package/fe/packages/ui/react/components/ImagePreview/index.d.ts +0 -3
  699. package/fe/packages/ui/react/components/ImagePreview/index.js +0 -2
  700. package/fe/packages/ui/react/components/Input/Input.js +0 -61
  701. package/fe/packages/ui/react/components/Input/index.d.ts +0 -2
  702. package/fe/packages/ui/react/components/Input/index.js +0 -1
  703. package/fe/packages/ui/react/components/InputNumber/InputNumber.js +0 -144
  704. package/fe/packages/ui/react/components/InputNumber/index.d.ts +0 -2
  705. package/fe/packages/ui/react/components/InputNumber/index.js +0 -1
  706. package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.js +0 -63
  707. package/fe/packages/ui/react/components/InputNumber/inputNumberUtils.test.js +0 -27
  708. package/fe/packages/ui/react/components/Label/Label.js +0 -35
  709. package/fe/packages/ui/react/components/Label/index.d.ts +0 -3
  710. package/fe/packages/ui/react/components/Label/index.js +0 -2
  711. package/fe/packages/ui/react/components/Menu/Menu.js +0 -102
  712. package/fe/packages/ui/react/components/Menu/MenuContext.js +0 -97
  713. package/fe/packages/ui/react/components/Menu/MenuItem.js +0 -33
  714. package/fe/packages/ui/react/components/Menu/SubMenu.js +0 -169
  715. package/fe/packages/ui/react/components/Menu/index.d.ts +0 -9
  716. package/fe/packages/ui/react/components/Menu/index.js +0 -5
  717. package/fe/packages/ui/react/components/Menu/menuTypes.js +0 -1
  718. package/fe/packages/ui/react/components/Menu/utils.js +0 -7
  719. package/fe/packages/ui/react/components/Message/Message.js +0 -58
  720. package/fe/packages/ui/react/components/Message/MessageManager.js +0 -90
  721. package/fe/packages/ui/react/components/Message/data.js +0 -1
  722. package/fe/packages/ui/react/components/Message/index.d.ts +0 -3
  723. package/fe/packages/ui/react/components/Message/index.js +0 -1
  724. package/fe/packages/ui/react/components/Modal/Modal.js +0 -14
  725. package/fe/packages/ui/react/components/Modal/ModalManager.js +0 -90
  726. package/fe/packages/ui/react/components/Modal/index.d.ts +0 -4
  727. package/fe/packages/ui/react/components/Modal/index.js +0 -2
  728. package/fe/packages/ui/react/components/Overlay/Overlay.js +0 -53
  729. package/fe/packages/ui/react/components/Overlay/index.d.ts +0 -3
  730. package/fe/packages/ui/react/components/Overlay/index.js +0 -1
  731. package/fe/packages/ui/react/components/Pagination/Pagination.js +0 -88
  732. package/fe/packages/ui/react/components/Pagination/index.d.ts +0 -2
  733. package/fe/packages/ui/react/components/Pagination/index.js +0 -1
  734. package/fe/packages/ui/react/components/Popup/Popup.js +0 -81
  735. package/fe/packages/ui/react/components/Popup/index.d.ts +0 -2
  736. package/fe/packages/ui/react/components/Popup/index.js +0 -1
  737. package/fe/packages/ui/react/components/Search/Search.js +0 -12
  738. package/fe/packages/ui/react/components/Search/index.d.ts +0 -2
  739. package/fe/packages/ui/react/components/Search/index.js +0 -1
  740. package/fe/packages/ui/react/components/Select/Select.js +0 -123
  741. package/fe/packages/ui/react/components/Select/dropdownPositioning.d.ts +0 -3
  742. package/fe/packages/ui/react/components/Select/dropdownPositioning.js +0 -13
  743. package/fe/packages/ui/react/components/Select/index.d.ts +0 -2
  744. package/fe/packages/ui/react/components/Select/index.js +0 -1
  745. package/fe/packages/ui/react/components/Skeleton/Skeleton.js +0 -31
  746. package/fe/packages/ui/react/components/Skeleton/index.d.ts +0 -3
  747. package/fe/packages/ui/react/components/Skeleton/index.js +0 -1
  748. package/fe/packages/ui/react/components/Switch/Switch.js +0 -22
  749. package/fe/packages/ui/react/components/Switch/index.d.ts +0 -2
  750. package/fe/packages/ui/react/components/Switch/index.js +0 -1
  751. package/fe/packages/ui/react/components/TableSearch/TableSearch.js +0 -121
  752. package/fe/packages/ui/react/components/TableSearch/index.d.ts +0 -2
  753. package/fe/packages/ui/react/components/TableSearch/index.js +0 -1
  754. package/fe/packages/ui/react/components/TableSearch/lang.js +0 -14
  755. package/fe/packages/ui/react/components/TableSearch/tableSearchLocaleStore.js +0 -11
  756. package/fe/packages/ui/react/components/Textarea/Textarea.js +0 -37
  757. package/fe/packages/ui/react/components/Textarea/index.d.ts +0 -2
  758. package/fe/packages/ui/react/components/Textarea/index.js +0 -1
  759. package/fe/packages/ui/react/components/Tooltip/Tooltip.js +0 -79
  760. package/fe/packages/ui/react/components/Tooltip/index.d.ts +0 -2
  761. package/fe/packages/ui/react/components/Tooltip/index.js +0 -1
  762. package/fe/packages/ui/react/components/TreeSelect/TreeSelect.js +0 -160
  763. package/fe/packages/ui/react/components/TreeSelect/index.d.ts +0 -2
  764. package/fe/packages/ui/react/components/TreeSelect/index.js +0 -1
  765. package/fe/packages/ui/react/components/Upload/ImageUpload.js +0 -75
  766. package/fe/packages/ui/react/components/Upload/Upload.js +0 -6
  767. package/fe/packages/ui/react/components/Upload/index.d.ts +0 -3
  768. package/fe/packages/ui/react/components/Upload/index.js +0 -2
  769. package/fe/packages/ui/react/components/breadcrumb/breadcrumb.js +0 -81
  770. package/fe/packages/ui/react/components/breadcrumb/index.d.ts +0 -2
  771. package/fe/packages/ui/react/components/breadcrumb/index.js +0 -1
  772. package/fe/packages/ui/react/components/hooks/useDropdownPositioning.js +0 -137
  773. package/fe/packages/ui/react/components/hooks/useInputController.js +0 -45
  774. package/fe/packages/ui/react/components/index.d.ts +0 -30
  775. package/fe/packages/ui/react/components/index.js +0 -29
  776. package/fe/packages/ui/react/components/table/index.d.ts +0 -2
  777. package/fe/packages/ui/react/components/table/index.js +0 -1
  778. package/fe/packages/ui/react/components/table/table.js +0 -20
  779. package/fe/packages/ui/react/components/testPage/MenuTestPage.js +0 -104
  780. package/fe/packages/ui/react/components/testPage/index.js +0 -314
  781. package/fe/packages/ui/react/hooks/useBreadcrumb.d.ts +0 -10
  782. package/fe/packages/ui/react/hooks/useBreadcrumb.js +0 -2
  783. package/fe/packages/ui/react/hooks/useExecuteOnce.js +0 -57
  784. package/fe/packages/ui/react/hooks/useInit.js +0 -9
  785. package/fe/packages/ui/react/hooks/useLanguage.d.ts +0 -2
  786. package/fe/packages/ui/react/hooks/useLanguage.js +0 -4
  787. package/fe/packages/ui/react/hooks/usePagination.js +0 -27
  788. package/fe/packages/ui/react/hooks/useRefState.js +0 -29
  789. package/fe/packages/ui/react/hooks/useWatch.js +0 -87
  790. package/fe/packages/ui/react/hooks/useWatch.test.js +0 -22
  791. package/fe/packages/ui/react/i18n/I18nProvider.js +0 -25
  792. package/fe/packages/ui/react/i18n/index.d.ts +0 -4
  793. package/fe/packages/ui/react/i18n/index.js +0 -3
  794. package/fe/packages/ui/react/i18n/useI18n.d.ts +0 -13
  795. package/fe/packages/ui/react/i18n/useI18n.js +0 -18
  796. package/fe/packages/ui/react/index.d.ts +0 -5
  797. package/fe/packages/ui/react/index.js +0 -6
  798. package/fe/packages/ui/react/lib/createStoreHook.js +0 -6
  799. package/fe/packages/ui/react/lib/export.js +0 -138
  800. package/fe/packages/ui/react/lib/utils.js +0 -70
  801. package/fe/packages/ui/react/stores/breadcrumb.js +0 -66
  802. package/fe/packages/ui/react/stores/language.d.ts +0 -4
  803. package/fe/packages/ui/react/stores/language.js +0 -2
  804. package/fe/packages/ui/react/types/index.js +0 -1
  805. package/fe/typings/type.js +0 -1
  806. package/types/app/data/signKey.d.ts +0 -1
  807. /package/fe/frontend/{dash → apps/dash}/dash.entry.d.ts +0 -0
  808. /package/fe/frontend/{testPage → apps/ui-components}/index.d.ts +0 -0
  809. /package/fe/frontend/{widgets → src}/common/auth/index.d.ts +0 -0
  810. /package/fe/frontend/{widgets → src}/components/Router/type.d.ts +0 -0
  811. /package/fe/frontend/{widgets → src}/defaultPages/Iframe/index.d.ts +0 -0
  812. /package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/components/SchemaSearch/index.d.ts +0 -0
  813. /package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/data/eventInfo.d.ts +0 -0
  814. /package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/data/index.d.ts +0 -0
  815. /package/fe/frontend/{widgets/defaultPages/Schema → src/defaultPages/SchemaPage}/utils/permissions.d.ts +0 -0
  816. /package/fe/frontend/{widgets → src}/defaultPages/SidebarSlotPage/index.d.ts +0 -0
  817. /package/fe/frontend/{widgets → src}/defaultPages/SidebarSlotPageTmp.d.ts +0 -0
  818. /package/fe/frontend/{widgets → src}/defaultPages/SlotPage/index.d.ts +0 -0
  819. /package/fe/frontend/{widgets → src}/hooks/useCurrentMenuData.d.ts +0 -0
  820. /package/fe/frontend/{widgets → src}/hooks/useRouterParams.d.ts +0 -0
  821. /package/fe/packages/{ui/react → react}/hooks/useExecuteOnce.d.ts +0 -0
  822. /package/fe/packages/{ui/react → react}/hooks/useInit.d.ts +0 -0
  823. /package/fe/packages/{ui/react → react}/hooks/usePagination.d.ts +0 -0
  824. /package/fe/packages/{ui/react → react}/hooks/useWatch.d.ts +0 -0
  825. /package/fe/packages/{ui/react → react}/hooks/useWatch.test.d.ts +0 -0
  826. /package/fe/packages/{ui/react → react/ui}/assets/table/no-result.svg +0 -0
  827. /package/fe/packages/{ui/react → react/ui}/components/ConfirmDialog/ConfirmDialog.d.ts +0 -0
  828. /package/fe/packages/{ui/react → react/ui}/components/Date/Date.d.ts +0 -0
  829. /package/fe/packages/{ui/react → react/ui}/components/Date/DateTestPage.d.ts +0 -0
  830. /package/fe/packages/{ui/react → react/ui}/components/Date/LocaleContext.d.ts +0 -0
  831. /package/fe/packages/{ui/react → react/ui}/components/Date/TimePicker.d.ts +0 -0
  832. /package/fe/packages/{ui/react → react/ui}/components/Date/data.d.ts +0 -0
  833. /package/fe/packages/{ui/react → react/ui}/components/Date/locales.d.ts +0 -0
  834. /package/fe/packages/{ui/react → react/ui}/components/ImagePreview/ImagePreview.d.ts +0 -0
  835. /package/fe/packages/{ui/react → react/ui}/components/InputNumber/inputNumberUtils.d.ts +0 -0
  836. /package/fe/packages/{ui/react → react/ui}/components/InputNumber/inputNumberUtils.test.d.ts +0 -0
  837. /package/fe/packages/{ui/react → react/ui}/components/Menu/Menu.d.ts +0 -0
  838. /package/fe/packages/{ui/react → react/ui}/components/Menu/MenuContext.d.ts +0 -0
  839. /package/fe/packages/{ui/react → react/ui}/components/Menu/MenuItem.d.ts +0 -0
  840. /package/fe/packages/{ui/react → react/ui}/components/Menu/SubMenu.d.ts +0 -0
  841. /package/fe/packages/{ui/react → react/ui}/components/Menu/utils.d.ts +0 -0
  842. /package/fe/packages/{ui/react → react/ui}/components/Message/data.d.ts +0 -0
  843. /package/fe/packages/{ui/react → react/ui}/components/Pagination/Pagination.d.ts +0 -0
  844. /package/fe/packages/{ui/react → react/ui}/components/Popup/Popup.d.ts +0 -0
  845. /package/fe/packages/{ui/react → react/ui}/components/TableSearch/lang.d.ts +0 -0
  846. /package/fe/packages/{ui/react → react/ui}/components/Textarea/Textarea.d.ts +0 -0
  847. /package/fe/packages/{ui/react → react/ui}/components/Tooltip/Tooltip.d.ts +0 -0
  848. /package/fe/packages/{ui/react → react/ui}/components/TreeSelect/TreeSelect.d.ts +0 -0
  849. /package/fe/packages/{ui/react → react/ui}/components/Upload/ImageUpload.d.ts +0 -0
  850. /package/fe/packages/{ui/react → react/ui}/components/breadcrumb/breadcrumb.d.ts +0 -0
  851. /package/fe/packages/{ui/react → react/ui}/components/hooks/useDropdownPositioning.d.ts +0 -0
  852. /package/fe/packages/{ui/react → react/ui}/components/hooks/useInputController.d.ts +0 -0
  853. /package/fe/packages/{ui/react → react/ui}/components/testPage/MenuTestPage.d.ts +0 -0
  854. /package/fe/packages/{ui/react → react/ui}/components/testPage/index.d.ts +0 -0
  855. /package/fe/packages/{ui/react → react/ui}/lib/utils.d.ts +0 -0
  856. /package/fe/packages/{ui/react → react/ui}/types/index.d.ts +0 -0
@@ -1,14 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useI18n } from '../../i18n';
3
- import { cn } from '../../lib/utils';
4
- import { X } from 'lucide-react';
5
- import { Button } from '../Button';
6
- import { Overlay } from '../Overlay';
7
- export function Modal({ open = false, onClose, title, children, footer, className, contentClassName, mask = true, maskClosable = true, lockScroll = true, closable = true, width = 520, centered = true, renderNode, keyboard = true, zIndex = 1000, }) {
8
- const t = useI18n();
9
- // 点击内容区域阻止冒泡
10
- const handleContentClick = (e) => {
11
- e.stopPropagation();
12
- };
13
- return (_jsx(Overlay, { open: open, onClose: onClose, mask: mask, maskClosable: maskClosable, lockScroll: lockScroll, keyboard: keyboard, closable: closable, renderNode: renderNode, zIndex: zIndex, className: cn('tc-ui-modal flex items-center justify-center'), children: _jsxs("div", { className: cn('relative bg-background rounded-lg shadow-lg', 'flex flex-col max-h-[90vh]', 'transition-all duration-200', open ? 'scale-100 opacity-100' : 'scale-95 opacity-0', centered ? 'my-auto' : 'mt-[10vh]', className), style: { width: typeof width === 'number' ? `${width}px` : width }, onClick: handleContentClick, children: [(title || closable) && (_jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-border", children: [title && _jsx("div", { className: "text-lg font-semibold text-foreground", children: title }), closable && (_jsx(Button, { variant: "text", type: "button", onClick: onClose, "aria-label": t('components.modal.close'), className: cn('ml-auto p-1 rounded-md', 'text-muted-foreground hover:text-foreground', 'hover:bg-muted', 'transition-colors', 'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2'), children: _jsx(X, { size: 20 }) }))] })), _jsx("div", { className: cn('flex-1 overflow-auto px-6 py-4', contentClassName), children: children }), footer && _jsx("div", { className: "px-6 py-4 border-border", children: footer })] }) }));
14
- }
@@ -1,90 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { t } from '../../i18n';
3
- import { createRoot } from 'react-dom/client';
4
- import { AsynchronousButton, Button } from '../Button';
5
- import { Modal } from './Modal';
6
- class ModalManagerClass {
7
- modals = new Map();
8
- listeners = new Set();
9
- container = null;
10
- root = null;
11
- init() {
12
- if (typeof document === 'undefined' || this.container)
13
- return;
14
- this.container = document.createElement('div');
15
- this.container.id = 'modal-container';
16
- document.body.appendChild(this.container);
17
- // 创建 React 根节点
18
- this.root = createRoot(this.container);
19
- this.render();
20
- }
21
- notify() {
22
- this.listeners.forEach((listener) => listener());
23
- this.render();
24
- }
25
- subscribe(listener) {
26
- this.listeners.add(listener);
27
- return () => {
28
- this.listeners.delete(listener);
29
- };
30
- }
31
- open(config) {
32
- this.init(); // 确保已初始化
33
- const id = `modal-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
34
- const modalConfig = {
35
- ...config,
36
- id,
37
- onClose: () => {
38
- config.onClose?.();
39
- this.close(id);
40
- },
41
- };
42
- this.modals.set(id, modalConfig);
43
- this.notify();
44
- return id;
45
- }
46
- close(id) {
47
- this.modals.delete(id);
48
- this.notify();
49
- }
50
- closeAll() {
51
- this.modals.clear();
52
- this.notify();
53
- }
54
- getModals() {
55
- return Array.from(this.modals.values());
56
- }
57
- render() {
58
- if (!this.root)
59
- return;
60
- const modals = this.getModals();
61
- this.root.render(_jsx(_Fragment, { children: modals.map((modal) => (_jsx(Modal, { ...modal, open: true, children: modal.content }, modal.id))) }));
62
- }
63
- }
64
- export const openConfirmModal = (pConfig) => {
65
- const { onOk, onCancel, okText = t('components.modal.okText'), cancelText = t('components.modal.cancelText'), ...props } = pConfig;
66
- const config = {
67
- title: t('components.modal.confirmTitle'),
68
- footer: (_jsxs("div", { className: "flex justify-end gap-3", children: [_jsx(Button, { onClick: () => {
69
- onCancel?.();
70
- modalManager.close(currentModalId);
71
- }, className: "min-w-[100px] bg-background border-[hsl(var(--theme-primary))] text-[hsl(var(--theme-primary))] hover:bg-[hsl(var(--theme-primary))]/5", children: cancelText }), _jsx(AsynchronousButton, { variant: "primary", onClick: async (e) => {
72
- const result = await onOk?.(e);
73
- if (typeof result === 'boolean' && !result)
74
- return;
75
- modalManager.close(currentModalId);
76
- }, className: "min-w-[100px] bg-[hsl(var(--theme-primary))] hover:bg-[hsl(var(--theme-primary))]/90 border-[hsl(var(--theme-primary))] text-[hsl(var(--theme-primary-foreground))]", children: okText })] })),
77
- ...props,
78
- };
79
- const currentModalId = modalManager.open(config);
80
- return currentModalId;
81
- };
82
- // 单例模式
83
- export const modalManager = new ModalManagerClass();
84
- // 函数式 API
85
- export const modal = {
86
- open: (config) => modalManager.open(config),
87
- confirm: openConfirmModal,
88
- close: (id) => modalManager.close(id),
89
- closeAll: () => modalManager.closeAll(),
90
- };
@@ -1,4 +0,0 @@
1
- export { Modal } from './Modal';
2
- export type { ModalProps } from './Modal';
3
- export { modal } from './ModalManager';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +0,0 @@
1
- export { Modal } from './Modal';
2
- export { modal } from './ModalManager';
@@ -1,53 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '../../lib/utils';
3
- import { useEffect } from 'react';
4
- import { createPortal } from 'react-dom';
5
- let bodyScrollLockCount = 0;
6
- let originalBodyOverflow = '';
7
- export const canUseDocument = () => typeof document !== 'undefined';
8
- const lockBodyScroll = () => {
9
- if (!canUseDocument())
10
- return () => { };
11
- if (bodyScrollLockCount === 0) {
12
- originalBodyOverflow = document.body.style.overflow;
13
- document.body.style.overflow = 'hidden';
14
- }
15
- bodyScrollLockCount += 1;
16
- return () => {
17
- bodyScrollLockCount = Math.max(0, bodyScrollLockCount - 1);
18
- if (bodyScrollLockCount === 0) {
19
- document.body.style.overflow = originalBodyOverflow;
20
- originalBodyOverflow = '';
21
- }
22
- };
23
- };
24
- export function Overlay({ open = false, visible = open, children, className, style, zIndex = 1000, mask = true, maskClosable = true, lockScroll = true, keyboard = true, closable = true, onClose, onClick, renderNode, }) {
25
- useEffect(() => {
26
- if (!open || !keyboard || !canUseDocument())
27
- return;
28
- const handleEscape = (e) => {
29
- if (e.key === 'Escape' && closable) {
30
- onClose?.();
31
- }
32
- };
33
- document.addEventListener('keydown', handleEscape);
34
- return () => {
35
- document.removeEventListener('keydown', handleEscape);
36
- };
37
- }, [open, closable, onClose, keyboard]);
38
- useEffect(() => {
39
- if (!open || !lockScroll)
40
- return;
41
- return lockBodyScroll();
42
- }, [lockScroll, open]);
43
- const handleMaskClick = (e) => {
44
- onClick?.(e);
45
- if (maskClosable && e.target === e.currentTarget) {
46
- onClose?.();
47
- }
48
- };
49
- if (!open || !canUseDocument())
50
- return null;
51
- const parent = typeof renderNode === 'function' ? renderNode() : (renderNode ?? document.body);
52
- return createPortal(_jsx("div", { className: cn('tc-ui-overlay fixed inset-0 z-[1000]', mask && 'bg-black/50 backdrop-blur-sm', 'transition-opacity duration-200', visible ? 'opacity-100' : 'opacity-0', className), style: { zIndex, ...style }, onClick: handleMaskClick, children: children }), parent);
53
- }
@@ -1,3 +0,0 @@
1
- export { Overlay, canUseDocument } from './Overlay';
2
- export type { OverlayProps } from './Overlay';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- export { Overlay, canUseDocument } from './Overlay';
@@ -1,88 +0,0 @@
1
- import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '../../lib/utils';
3
- import { ChevronLeft, ChevronRight } from 'lucide-react';
4
- import { Button } from '../Button';
5
- import { Select } from '../Select';
6
- export function Pagination({ current, pageSize, total, onChange, onPageSizeChange, pageSizeOptions = [10, 20, 50, 100], className, }) {
7
- const totalPages = Math.ceil(total / pageSize);
8
- // 生成页码数组
9
- const getPageNumbers = () => {
10
- const pages = [];
11
- const maxVisible = 7; // 最多显示7个页码
12
- if (totalPages <= maxVisible) {
13
- // 总页数少于等于7,显示所有页码
14
- for (let i = 1; i <= totalPages; i++) {
15
- pages.push(i);
16
- }
17
- }
18
- else {
19
- // 总页数大于7,需要省略
20
- if (current <= 4) {
21
- // 当前页在前面
22
- for (let i = 1; i <= 5; i++) {
23
- pages.push(i);
24
- }
25
- pages.push('...');
26
- pages.push(totalPages);
27
- }
28
- else if (current >= totalPages - 3) {
29
- // 当前页在后面
30
- pages.push(1);
31
- pages.push('...');
32
- for (let i = totalPages - 4; i <= totalPages; i++) {
33
- pages.push(i);
34
- }
35
- }
36
- else {
37
- // 当前页在中间
38
- pages.push(1);
39
- pages.push('...');
40
- for (let i = current - 1; i <= current + 1; i++) {
41
- pages.push(i);
42
- }
43
- pages.push('...');
44
- pages.push(totalPages);
45
- }
46
- }
47
- return pages;
48
- };
49
- const handlePrevious = () => {
50
- if (current > 1) {
51
- onChange(current - 1);
52
- }
53
- };
54
- const handleNext = () => {
55
- if (current < totalPages) {
56
- onChange(current + 1);
57
- }
58
- };
59
- const handlePageClick = (page) => {
60
- if (typeof page === 'number' && page !== current) {
61
- onChange(page);
62
- }
63
- };
64
- const handlePageSizeChange = (newPageSize) => {
65
- if (newPageSize !== undefined && typeof newPageSize === 'number' && newPageSize !== pageSize && onPageSizeChange) {
66
- onPageSizeChange(newPageSize);
67
- // 当改变 pageSize 时,通常需要重置到第一页
68
- if (current !== 1) {
69
- onChange(1);
70
- }
71
- }
72
- };
73
- if (totalPages === 0)
74
- return null;
75
- return (_jsxs("div", { className: cn('tc-ui-pagination flex items-center gap-4', className), children: [_jsxs("div", { className: "text-sm text-muted-foreground", children: ["Total ", total] }), _jsxs("div", { className: "flex-1 flex items-center justify-center gap-2", children: [_jsx(Button, { onClick: handlePrevious, disabled: current === 1, size: "sm", className: cn('inline-flex items-center justify-center', 'h-8 px-3 rounded-md', 'text-sm font-medium', 'border border-border', 'transition-colors', current === 1 ? 'cursor-not-allowed opacity-50 bg-muted' : 'hover:bg-muted bg-background cursor-pointer'), children: _jsx(ChevronLeft, { className: "h-4 w-4" }) }), getPageNumbers().map((page, index) => {
76
- if (page === '...') {
77
- return (_jsx("span", { className: "px-2 text-muted-foreground", children: "..." }, `ellipsis-${index}`));
78
- }
79
- return (_jsx(Button, { onClick: () => handlePageClick(page), size: "sm", className: cn('inline-flex items-center justify-center', 'h-8 min-w-[32px] px-3 rounded-md', 'text-sm font-medium', 'border transition-colors', page === current
80
- ? 'bg-theme text-theme-foreground border-theme cursor-default'
81
- : 'bg-background border-border hover:bg-muted cursor-pointer'), children: page }, page));
82
- }), _jsx(Button, { onClick: handleNext, size: "sm", disabled: current === totalPages, className: cn('inline-flex items-center justify-center', 'h-8 px-3 rounded-md', 'text-sm font-medium', 'border border-border', 'transition-colors', current === totalPages
83
- ? 'cursor-not-allowed opacity-50 bg-muted'
84
- : 'hover:bg-muted bg-background cursor-pointer'), children: _jsx(ChevronRight, { className: "h-4 w-4" }) })] }), onPageSizeChange && (_jsx("div", { className: "flex items-center gap-2", children: _jsx(Select, { value: pageSize, onChange: handlePageSizeChange, options: pageSizeOptions.map((size) => ({
85
- label: `${size}`,
86
- value: size,
87
- })), className: "w-20 [&>div]:bg-muted [&>div]:border-border [&>div]:shadow-sm [&>div]:py-2 [&>div]:px-3 [&>div]:h-8", clearable: false, searchable: false }) }))] }));
88
- }
@@ -1,2 +0,0 @@
1
- export * from './Pagination';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- export * from './Pagination';
@@ -1,81 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from "../../lib/utils";
3
- import { useEffect, useMemo, useRef } from "react";
4
- import { createPortal } from "react-dom";
5
- import { getDefaultDropdownPosition, useDropdownPositioning, } from "../hooks/useDropdownPositioning";
6
- const DEFAULT_POPUP_CLASSNAME = cn("fixed z-[9999]", "bg-background rounded-lg shadow-lg border border-gray-200", "animate-in fade-in-0 zoom-in-95");
7
- const canUseDocument = () => typeof document !== "undefined";
8
- export function Popup({ open, anchorRef, children, className, style, placement = "bottom-end", offset = 8, keepMounted = false, closeOnClickOutside = true, closeOnEscape = true, matchAnchorWidth = false, position, positioning, strategy = getDefaultDropdownPosition, contentRef, container, positionMode = "fixed", hoverBridge = 0, hoverBridgePlacement = "auto", onOpenChange, }) {
9
- // 默认自己保存弹窗 DOM;如果外部传了 contentRef,就用外部的。
10
- const internalContentRef = useRef(null);
11
- const panelRef = contentRef ?? internalContentRef;
12
- const containerRef = useMemo(() => ({ current: container ?? null }), [container]);
13
- // 默认用 useDropdownPositioning 算位置;也允许外部直接传 position 或 positioning 接管。
14
- const internalPositioning = useDropdownPositioning({
15
- open,
16
- anchorRef,
17
- contentRef: panelRef,
18
- placement,
19
- offset,
20
- matchAnchorWidth,
21
- strategy,
22
- containerRef,
23
- positionMode,
24
- });
25
- const resolvedPositioning = position
26
- ? null
27
- : (positioning ?? internalPositioning);
28
- useEffect(() => {
29
- if (!open || !closeOnClickOutside)
30
- return;
31
- // 点到触发元素和弹窗外面,就通知外部关闭。
32
- const handleClickOutside = (event) => {
33
- const target = event.target;
34
- const clickedAnchor = anchorRef.current?.contains(target);
35
- const clickedPanel = panelRef.current?.contains(target);
36
- if (!clickedAnchor && !clickedPanel) {
37
- onOpenChange?.(false);
38
- }
39
- };
40
- document.addEventListener("mousedown", handleClickOutside);
41
- return () => document.removeEventListener("mousedown", handleClickOutside);
42
- }, [anchorRef, closeOnClickOutside, onOpenChange, open, panelRef]);
43
- useEffect(() => {
44
- if (!open || !closeOnEscape)
45
- return;
46
- // 按 Esc 时关闭,常见弹窗交互都需要这个。
47
- const handleKeyDown = (event) => {
48
- if (event.key === "Escape") {
49
- onOpenChange?.(false);
50
- }
51
- };
52
- document.addEventListener("keydown", handleKeyDown);
53
- return () => document.removeEventListener("keydown", handleKeyDown);
54
- }, [closeOnEscape, onOpenChange, open]);
55
- const mergedStyle = useMemo(() => ({
56
- // 定位样式优先来自 hook,也可以被外部 position/style 覆盖。
57
- ...resolvedPositioning?.position,
58
- ...position,
59
- ...style,
60
- }), [position, resolvedPositioning?.position, style]);
61
- // hoverBridge 是透明桥。鼠标从触发元素移动到弹窗时,中间有间距也不会断 hover。
62
- const showHorizontalHoverBridge = hoverBridge > 0 &&
63
- (placement.startsWith("right") || placement.startsWith("left"));
64
- const showBothHorizontalHoverBridges = showHorizontalHoverBridge && hoverBridgePlacement === "horizontal";
65
- if (!keepMounted && !open) {
66
- // 不需要常驻 DOM 时,关闭就不渲染。
67
- return null;
68
- }
69
- const portalContainer = container ?? (canUseDocument() ? document.body : undefined);
70
- if (!portalContainer) {
71
- return null;
72
- }
73
- // 用 portal 把弹窗挂到指定容器;没传 container 就挂到 body。
74
- return createPortal(_jsxs("div", { ref: panelRef, className: cn("tc-ui-popup", DEFAULT_POPUP_CLASSNAME, positionMode === "absolute" && "absolute", !resolvedPositioning?.ready && "invisible", keepMounted && !open && "hidden", className), style: mergedStyle, children: [hoverBridge > 0 && (
75
- // 默认只补当前 placement 方向上的透明桥。
76
- _jsx("div", { "aria-hidden": "true", className: cn("absolute bg-transparent", placement.startsWith("bottom") && "left-0 right-0 top-0 -translate-y-full", placement.startsWith("top") && "bottom-0 left-0 right-0 translate-y-full", placement.startsWith("right") && "bottom-0 left-0 top-0 -translate-x-full", placement.startsWith("left") && "bottom-0 right-0 top-0 translate-x-full"), style: placement.startsWith("right") || placement.startsWith("left")
77
- ? { width: hoverBridge }
78
- : { height: hoverBridge } })), showBothHorizontalHoverBridges && (
79
- // 横向弹窗可能动态从右改到左,这里左右都补桥,避免鼠标移过去时弹窗关闭。
80
- _jsx("div", { "aria-hidden": "true", className: "absolute bottom-0 right-0 top-0 translate-x-full bg-transparent", style: { width: hoverBridge } })), children] }), portalContainer);
81
- }
@@ -1,2 +0,0 @@
1
- export * from './Popup';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- export * from './Popup';
@@ -1,12 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from '../../lib/utils';
3
- import { useMemo } from 'react';
4
- import { SchemaForm } from '../Form';
5
- const Search = (props) => {
6
- const { defaultValue: pDefaultValue, schemas, children, getForm, btnsClassName } = props;
7
- const defaultValue = useMemo(() => {
8
- return pDefaultValue;
9
- }, []);
10
- return (_jsxs("div", { className: "tc-ui-search flex items-end justify-between gap-4 flex-wrap", children: [_jsx(SchemaForm, { preserve: true, layout: "horizontal", schemas: schemas, initialValues: defaultValue, getForm: getForm, footerButtons: false }), _jsx("div", { className: cn('flex items-center gap-2 self-end ml-auto flex-wrap', btnsClassName), children: children })] }));
11
- };
12
- export default Search;
@@ -1,2 +0,0 @@
1
- export { default as Search } from './Search';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- export { default as Search } from './Search';
@@ -1,123 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useI18n } from '../../i18n';
3
- import { cn } from '../../lib/utils';
4
- import { ChevronUp, X } from 'lucide-react';
5
- import { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from 'react';
6
- import { Button } from '../Button';
7
- import { Input } from '../Input';
8
- import { Popup } from '../Popup';
9
- import { useDropdownPositioning } from '../hooks/useDropdownPositioning';
10
- import { getSelectDropdownPosition } from './dropdownPositioning';
11
- const Select = forwardRef(({ options, value: controlledValue, defaultValue, placeholder, onChange, className, disabled, clearable = true, searchable = true, getPopupContainer, }, ref) => {
12
- const t = useI18n();
13
- const [isOpen, setIsOpen] = useState(false);
14
- const [internalValue, setInternalValue] = useState(defaultValue);
15
- const [isHover, setIsHover] = useState(false);
16
- const [searchTerm, setSearchTerm] = useState('');
17
- const rootRef = useRef(null);
18
- const selectRef = useRef(null);
19
- const dropdownRef = useRef(null);
20
- const inputRef = useRef(null);
21
- const popupContainerRef = useRef(null);
22
- const isParentPopupContainer = getPopupContainer === 'parent';
23
- popupContainerRef.current = isParentPopupContainer ? (rootRef.current?.parentElement ?? null) : null;
24
- useEffect(() => {
25
- if (!isParentPopupContainer)
26
- return;
27
- const container = rootRef.current?.parentElement;
28
- popupContainerRef.current = container ?? null;
29
- if (!container || window.getComputedStyle(container).position !== 'static')
30
- return;
31
- const previousPosition = container.style.position;
32
- container.style.position = 'relative';
33
- return () => {
34
- container.style.position = previousPosition;
35
- };
36
- }, [isParentPopupContainer]);
37
- // 合并 refs
38
- const setRefs = useCallback((node) => {
39
- selectRef.current = node;
40
- if (typeof ref === 'function') {
41
- ref(node);
42
- }
43
- else if (ref) {
44
- ref.current = node;
45
- }
46
- }, [ref]);
47
- const isControlled = controlledValue !== undefined;
48
- const value = isControlled ? controlledValue : internalValue;
49
- // 获取当前选中的选项
50
- const selectedOption = options.find((opt) => opt.value === value);
51
- const displayText = selectedOption ? selectedOption.label : placeholder || '';
52
- const filteredOptions = useMemo(() => {
53
- if (!searchable || !searchTerm.trim())
54
- return options;
55
- const lower = searchTerm.trim().toLowerCase();
56
- return options.filter((opt) => {
57
- const searchText = opt.searchText ??
58
- (typeof opt.label === 'string' || typeof opt.label === 'number' ? String(opt.label) : '');
59
- return searchText.toLowerCase().includes(lower);
60
- });
61
- }, [options, searchTerm, searchable]);
62
- const positioning = useDropdownPositioning({
63
- open: isOpen,
64
- anchorRef: selectRef,
65
- contentRef: dropdownRef,
66
- placement: 'bottom-start',
67
- offset: 4,
68
- matchAnchorWidth: true,
69
- strategy: getSelectDropdownPosition,
70
- estimateSize: () => ({
71
- height: Math.min(filteredOptions.length * 40 + 8, 240),
72
- }),
73
- watchDeps: [filteredOptions.length, searchTerm, searchable],
74
- containerRef: isParentPopupContainer ? popupContainerRef : undefined,
75
- positionMode: isParentPopupContainer ? 'absolute' : 'fixed',
76
- });
77
- // 展开时更新位置并获取焦点
78
- useEffect(() => {
79
- if (isOpen) {
80
- requestAnimationFrame(() => {
81
- if (searchable) {
82
- inputRef.current?.focus();
83
- }
84
- });
85
- }
86
- }, [isOpen, searchable]);
87
- const handleToggle = useCallback(() => {
88
- if (disabled)
89
- return;
90
- setIsOpen((prev) => {
91
- const next = !prev;
92
- if (next && searchable) {
93
- setSearchTerm('');
94
- }
95
- return next;
96
- });
97
- }, [disabled, searchable]);
98
- const handleSelect = useCallback((optionValue) => {
99
- if (!isControlled) {
100
- setInternalValue(optionValue);
101
- }
102
- onChange?.(optionValue);
103
- setIsOpen(false);
104
- }, [isControlled, onChange]);
105
- const handleClear = useCallback((event) => {
106
- event.stopPropagation();
107
- if (disabled)
108
- return;
109
- // 清除时 重置内外状态
110
- setInternalValue(undefined);
111
- onChange?.(undefined);
112
- }, [disabled, onChange]);
113
- const handleSearchChange = useCallback((event) => {
114
- setSearchTerm(event.target.value);
115
- }, []);
116
- const popupContainer = getPopupContainer === 'parent' ? (rootRef.current?.parentElement ?? undefined) : getPopupContainer?.();
117
- return (_jsxs("div", { ref: rootRef, className: cn('tc-ui-select relative w-full', className), children: [_jsxs("div", { ref: setRefs, onClick: handleToggle, onMouseEnter: () => setIsHover(true), onMouseLeave: () => setIsHover(false), className: cn('flex w-full items-center justify-between rounded-lg px-4 py-3 text-sm', 'border transition-colors duration-200', 'focus:outline-none', disabled ? 'cursor-not-allowed bg-muted border-border' : 'cursor-pointer bg-background', !disabled && isOpen && 'border-theme', !disabled && !isOpen && 'border-border'), children: [searchable && isOpen ? (_jsx(Input, { ref: inputRef, value: searchTerm, onChange: (_, e) => handleSearchChange(e), onClick: (e) => e.stopPropagation(), placeholder: typeof displayText === 'string' ? displayText : placeholder, className: "min-w-0 flex-1", inputClassName: cn('h-5 min-w-0 flex-1 rounded-none border-0 bg-transparent px-0 py-0 text-left leading-5 outline-none', 'placeholder:text-muted-foreground', disabled && 'text-muted-foreground cursor-not-allowed'), disabled: disabled })) : (_jsx("span", { className: cn('min-h-5 min-w-0 flex-1 text-left truncate leading-5', disabled ? 'text-muted-foreground' : !selectedOption && 'text-muted-foreground'), children: displayText })), clearable && !disabled && value !== undefined && isHover ? (_jsx(Button, { variant: "text", type: "button", onClick: handleClear, className: "ml-2 flex items-center justify-center text-muted-foreground hover:text-foreground cursor-pointer", "aria-label": "Clear selection", title: "Clear", children: _jsx(X, { size: 14 }) })) : (_jsx(ChevronUp, { size: 16, className: cn('ml-2 transition-transform duration-200', isOpen ? 'rotate-0' : 'rotate-180') }))] }), _jsx(Popup, { open: isOpen, anchorRef: selectRef, contentRef: dropdownRef, positioning: positioning, keepMounted: true, onOpenChange: setIsOpen, container: popupContainer, positionMode: isParentPopupContainer ? 'absolute' : 'fixed', className: cn('z-[1000] w-full rounded-lg bg-background shadow-lg', 'border border-border', 'max-h-60 overflow-auto'), children: _jsx("div", { className: cn('w-full', !isOpen && 'hidden'), children: _jsx("div", { className: "p-1", children: filteredOptions.length > 0 ? (filteredOptions.map((option) => {
118
- const isSelected = option.value === value;
119
- return (_jsx("div", { onClick: () => handleSelect(option.value), className: cn('px-4 py-2 text-sm cursor-pointer transition-colors rounded-md', 'hover:bg-muted', isSelected && 'bg-muted'), children: option.label }, option.value));
120
- })) : (_jsx("div", { className: "px-4 py-2 text-sm text-muted-foreground text-center", children: t('components.select.empty') })) }) }) })] }));
121
- });
122
- Select.displayName = 'Select';
123
- export { Select };
@@ -1,3 +0,0 @@
1
- import type { DropdownPositioningStrategy } from '../hooks/useDropdownPositioning';
2
- export declare const getSelectDropdownPosition: DropdownPositioningStrategy;
3
- //# sourceMappingURL=dropdownPositioning.d.ts.map
@@ -1,13 +0,0 @@
1
- export const getSelectDropdownPosition = ({ anchorRect, contentRect, containerRect, viewportHeight, offset, matchAnchorWidth, }) => {
2
- const dropdownHeight = contentRect?.height ?? 240;
3
- const spaceBelow = viewportHeight - anchorRect.bottom;
4
- const spaceAbove = anchorRect.top;
5
- const shouldPlaceTop = spaceBelow < dropdownHeight && spaceAbove > spaceBelow;
6
- const containerTop = containerRect?.top ?? 0;
7
- const containerLeft = containerRect?.left ?? 0;
8
- return {
9
- top: (shouldPlaceTop ? anchorRect.top - dropdownHeight - offset : anchorRect.bottom + offset) - containerTop,
10
- left: anchorRect.left - containerLeft,
11
- width: matchAnchorWidth ? anchorRect.width : undefined,
12
- };
13
- };
@@ -1,2 +0,0 @@
1
- export * from './Select';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- export * from './Select';
@@ -1,31 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { cn } from '../../lib/utils';
3
- import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '../table';
4
- const SkeletonItem = ({ className, ...props }) => (_jsx("div", { className: cn('animate-pulse rounded bg-gray-200/60 dark:bg-gray-700/60', className), ...props }));
5
- const SkeletonText = ({ width = '100%', className }) => (_jsx(SkeletonItem, { className: cn('h-4', className), style: { width: typeof width === 'number' ? `${width}px` : width } }));
6
- const PageLoadingSkeleton = ({ rows = 5, showTitle = true, showActions = true }) => {
7
- return (_jsxs("div", { className: "w-full space-y-6 p-6", children: [showTitle && (_jsxs("div", { className: "flex items-center justify-between", children: [_jsx(SkeletonItem, { className: "h-8 w-48" }), showActions && (_jsxs("div", { className: "flex gap-3", children: [_jsx(SkeletonItem, { className: "h-10 w-24" }), _jsx(SkeletonItem, { className: "h-10 w-24" })] }))] })), _jsxs("div", { className: "flex gap-4", children: [_jsx(SkeletonItem, { className: "h-10 flex-1" }), _jsx(SkeletonItem, { className: "h-10 w-24" }), _jsx(SkeletonItem, { className: "h-10 w-24" })] }), _jsx("div", { className: "space-y-4", children: Array.from({ length: rows }).map((_, index) => (_jsxs("div", { className: "flex gap-4", children: [_jsx(SkeletonItem, { className: "h-20 flex-1" }), _jsx(SkeletonItem, { className: "h-20 w-32" }), _jsx(SkeletonItem, { className: "h-20 w-32" })] }, index))) }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsx(SkeletonItem, { className: "h-4 w-32" }), _jsxs("div", { className: "flex gap-2", children: [_jsx(SkeletonItem, { className: "h-8 w-8" }), _jsx(SkeletonItem, { className: "h-8 w-8" }), _jsx(SkeletonItem, { className: "h-8 w-8" })] })] })] }));
8
- };
9
- const TableLoadingSkeleton = ({ rows = 5 }) => {
10
- const columnCount = 6; // 默认列数,可以根据需要调整
11
- return (_jsx("div", { className: "w-full", children: _jsx("div", { className: "bg-background rounded-[20px] overflow-hidden", children: _jsxs(Table, { containerClassName: "rounded-b-none", children: [_jsx(TableHeader, { children: _jsx(TableRow, { children: Array.from({ length: columnCount }).map((_, index) => (_jsx(TableHead, { children: _jsx(SkeletonText, { width: index === 0 ? 120 : index === columnCount - 1 ? 80 : 150 }) }, index))) }) }), _jsx(TableBody, { children: Array.from({ length: rows }).map((_, rowIndex) => (_jsx(TableRow, { children: Array.from({ length: columnCount }).map((_, colIndex) => (_jsx(TableCell, { children: colIndex === columnCount - 1 ? (_jsxs("div", { className: "flex gap-2", children: [_jsx(SkeletonItem, { className: "h-8 w-16" }), _jsx(SkeletonItem, { className: "h-8 w-16" })] })) : (_jsx(SkeletonText, { width: colIndex === 0 ? 120 : colIndex === 1 ? '80%' : 150 })) }, colIndex))) }, rowIndex))) })] }) }) }));
12
- };
13
- const ComponentsLoadingSkeleton = ({ rows = 3 }) => {
14
- return (_jsx("div", { className: "w-full space-y-3", children: Array.from({ length: rows }).map((_, index) => (_jsx(SkeletonItem, { className: "h-4 w-full" }, index))) }));
15
- };
16
- export const Skeleton = ({ mode = 'componentsloading', className, rows, showTitle, showActions, ...props }) => {
17
- const renderSkeleton = () => {
18
- switch (mode) {
19
- case 'pageloading':
20
- return _jsx(PageLoadingSkeleton, { rows: rows, showTitle: showTitle, showActions: showActions });
21
- case 'tableloading':
22
- return _jsx(TableLoadingSkeleton, { rows: rows });
23
- case 'componentsloading':
24
- return _jsx(ComponentsLoadingSkeleton, { rows: rows });
25
- default:
26
- return _jsx(ComponentsLoadingSkeleton, { rows: rows });
27
- }
28
- };
29
- return (_jsx("div", { className: cn('tc-ui-skeleton w-full', className), ...props, children: renderSkeleton() }));
30
- };
31
- Skeleton.displayName = 'Skeleton';
@@ -1,3 +0,0 @@
1
- export { Skeleton } from './Skeleton';
2
- export type { SkeletonProps, SkeletonMode } from './Skeleton';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- export { Skeleton } from './Skeleton';
@@ -1,22 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from '../../lib/utils';
3
- import React, { forwardRef } from 'react';
4
- const Switch = forwardRef(({ checked: controlledChecked, defaultChecked, onChange, disabled, className }, ref) => {
5
- const [internalChecked, setInternalChecked] = React.useState(defaultChecked || false);
6
- const isControlled = controlledChecked !== undefined;
7
- const checked = isControlled ? controlledChecked : internalChecked;
8
- const handleToggle = () => {
9
- if (disabled)
10
- return;
11
- const newChecked = !checked;
12
- if (!isControlled) {
13
- setInternalChecked(newChecked);
14
- }
15
- onChange?.(newChecked);
16
- };
17
- return (_jsx("button", { ref: ref, type: "button", role: "switch", "aria-checked": checked, disabled: disabled, onClick: handleToggle, className: cn('tc-ui-switch relative inline-flex h-6 w-11 items-center rounded-full transition-colors duration-200', 'focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2', disabled && 'cursor-not-allowed opacity-50', !disabled && 'cursor-pointer', checked
18
- ? 'bg-[hsl(var(--ring))] dark:bg-[hsl(var(--ring))]'
19
- : 'bg-muted dark:bg-muted', className), children: _jsx("span", { className: cn('inline-block h-4 w-4 transform rounded-full bg-background transition-transform duration-200', checked ? 'translate-x-6' : 'translate-x-1') }) }));
20
- });
21
- Switch.displayName = 'Switch';
22
- export { Switch };
@@ -1,2 +0,0 @@
1
- export * from './Switch';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- export * from './Switch';