@gct-paas/core 0.1.4-dev.8 → 0.1.5-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/dist/index.esm.min.js +1 -0
  2. package/es/constants/core.mjs +5 -4
  3. package/es/constants/default-date-type/default-date-type.d.ts +70 -0
  4. package/es/constants/default-date-type/default-date-type.mjs +74 -0
  5. package/es/constants/editor-register/editor-register.mjs +17 -5
  6. package/es/constants/expression-type/BuiltOperators.d.ts +20 -0
  7. package/es/constants/expression-type/BuiltOperators.mjs +156 -0
  8. package/es/constants/expression-type/FunctionKeys.d.ts +1 -0
  9. package/es/constants/expression-type/FunctionKeys.mjs +77 -0
  10. package/es/constants/expression-type/editor.d.ts +8 -0
  11. package/es/constants/expression-type/editor.mjs +11 -0
  12. package/es/constants/expression-type/function.d.ts +7 -0
  13. package/es/constants/expression-type/function.mjs +864 -0
  14. package/es/constants/expression-type/index.d.ts +42 -0
  15. package/es/constants/expression-type/index.mjs +118 -0
  16. package/es/constants/expression-type/modeCfg.d.ts +30 -0
  17. package/es/constants/expression-type/modeCfg.mjs +261 -0
  18. package/es/constants/expression-type/variable.d.ts +12 -0
  19. package/es/constants/expression-type/variable.mjs +46 -0
  20. package/es/constants/form-container-type/form-container-type.mjs +17 -5
  21. package/es/constants/index.d.ts +8 -1
  22. package/es/constants/index.mjs +32 -5
  23. package/es/constants/page-designer/model.d.ts +4 -0
  24. package/es/constants/page-designer/model.mjs +17 -0
  25. package/es/constants/page-designer/regex.d.ts +2 -0
  26. package/es/constants/page-designer/regex.mjs +5 -0
  27. package/es/create-app-vue.mjs +15 -16
  28. package/es/enums/app-designer/index.d.ts +19 -0
  29. package/es/enums/app-designer/index.mjs +131 -63
  30. package/es/enums/appEnum.d.ts +5 -0
  31. package/es/enums/appEnum.mjs +682 -356
  32. package/es/enums/appStateEnum.mjs +17 -10
  33. package/es/enums/authActionEnum.mjs +63 -51
  34. package/es/enums/breakpointEnum.mjs +27 -26
  35. package/es/enums/cacheEnum.d.ts +0 -1
  36. package/es/enums/cacheEnum.mjs +22 -22
  37. package/es/enums/designEnum.d.ts +9 -3
  38. package/es/enums/designEnum.mjs +111 -69
  39. package/es/enums/developer-center/index.d.ts +1 -0
  40. package/es/enums/developer-center/integration.d.ts +4 -0
  41. package/es/enums/developer-center/integration.mjs +8 -0
  42. package/es/enums/exceptionEnum.mjs +21 -17
  43. package/es/enums/expressionEnum.d.ts +130 -0
  44. package/es/enums/expressionEnum.mjs +82 -0
  45. package/es/enums/globalEnum.d.ts +15 -0
  46. package/es/enums/globalEnum.mjs +60 -25
  47. package/es/enums/httpEnum.mjs +71 -61
  48. package/es/enums/index.d.ts +11 -5
  49. package/es/enums/index.mjs +45 -17
  50. package/es/enums/menuEnum.mjs +42 -38
  51. package/es/enums/page-designer/designer.d.ts +7 -8
  52. package/es/enums/page-designer/designer.mjs +404 -403
  53. package/es/enums/page-designer/index.d.ts +1 -0
  54. package/es/enums/page-designer/index.mjs +5 -0
  55. package/es/enums/page-designer/layout.d.ts +12 -0
  56. package/es/enums/page-designer/layout.mjs +17 -0
  57. package/es/enums/page-designer/panel.d.ts +78 -7
  58. package/es/enums/page-designer/panel.mjs +342 -195
  59. package/es/enums/page-designer/toolkit.mjs +13 -12
  60. package/es/enums/page-designer/widget.d.ts +5 -0
  61. package/es/enums/page-designer/widget.mjs +426 -334
  62. package/es/enums/pageEnum.mjs +14 -13
  63. package/es/enums/plugin-enum.d.ts +8 -4
  64. package/es/enums/plugin-enum.mjs +27 -7
  65. package/es/enums/processEnum.d.ts +54 -0
  66. package/es/enums/processEnum.mjs +96 -26
  67. package/es/enums/roleEnum.mjs +7 -6
  68. package/es/enums/sizeEnum.d.ts +18 -0
  69. package/es/enums/sizeEnum.mjs +28 -8
  70. package/es/global/gct/gct.d.ts +245 -13
  71. package/es/global/gct/gct.mjs +98 -95
  72. package/es/global/index.mjs +1 -0
  73. package/es/hooks/index.d.ts +0 -3
  74. package/es/hooks/index.mjs +4 -0
  75. package/es/hooks/use-app-inst/use-app-inst.mjs +11 -5
  76. package/es/hooks/use-modal/use-modal.mjs +16 -10
  77. package/es/hooks/use-sub-app-utils/use-sub-app-utils.d.ts +8 -12
  78. package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +45 -25
  79. package/es/hooks/useCopyToClipboard.mjs +50 -50
  80. package/es/index.d.ts +2 -10
  81. package/es/index.mjs +130 -119
  82. package/es/interface/i-dictionary/i-dictionary-item.d.ts +6 -0
  83. package/es/interface/i-global-register/i-global-register.d.ts +8 -0
  84. package/es/interface/i-kit-info/i-kit-info.d.ts +20 -0
  85. package/es/interface/i-pinia-action/i-global-actions.d.ts +4 -6
  86. package/es/interface/i-pinia-getter/i-global-getters.d.ts +2 -0
  87. package/es/interface/i-pinia-state/i-global-state.d.ts +12 -12
  88. package/es/interface/index.d.ts +5 -10
  89. package/es/interface/model-designer/entity.d.ts +110 -0
  90. package/es/interface/open-util/i-message-util/i-message-util.d.ts +54 -0
  91. package/es/interface/{i-modal → open-util/i-modal}/i-modal.d.ts +9 -10
  92. package/es/interface/{i-modal-data → open-util/i-modal-data}/i-modal-data.d.ts +6 -0
  93. package/es/interface/open-util/i-modal-options/i-modal-options.d.ts +12 -0
  94. package/es/interface/open-util/i-overlay-container/i-overlay-container.d.ts +36 -0
  95. package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +36 -0
  96. package/es/interface/open-util/index.d.ts +7 -0
  97. package/es/interface/provider/index.d.ts +0 -2
  98. package/es/locale/index.d.ts +11 -3
  99. package/es/locale/index.mjs +75 -56
  100. package/es/modules/env-manager/env-manager.const.mjs +16 -8
  101. package/es/modules/env-manager/env-manager.d.ts +2 -0
  102. package/es/modules/env-manager/env-manager.interface.d.ts +2 -0
  103. package/es/modules/env-manager/env-manager.interface.mjs +14 -7
  104. package/es/modules/env-manager/env-manager.mjs +108 -107
  105. package/es/modules/error-handler/error-handler.const.mjs +11 -16
  106. package/es/modules/error-handler/error-strategy.mjs +199 -175
  107. package/es/modules/error-handler/index.mjs +120 -106
  108. package/es/modules/mqtt/constants/mqtt.const.d.ts +33 -0
  109. package/es/modules/mqtt/constants/mqtt.const.mjs +24 -0
  110. package/es/modules/mqtt/enums/mqtt-status.enum.d.ts +20 -0
  111. package/es/modules/mqtt/enums/mqtt-status.enum.mjs +24 -0
  112. package/es/modules/mqtt/index.d.ts +5 -0
  113. package/es/modules/mqtt/index.mjs +4 -0
  114. package/es/modules/mqtt/interfaces/i-mqtt.d.ts +139 -0
  115. package/es/modules/mqtt/mqtt-client.d.ts +117 -0
  116. package/es/modules/mqtt/mqtt-client.mjs +229 -0
  117. package/es/modules/mqtt/mqtt-manager.d.ts +87 -0
  118. package/es/modules/mqtt/mqtt-manager.mjs +118 -0
  119. package/es/modules/platform-config/constants/index.mjs +4 -0
  120. package/es/modules/platform-config/constants/login.const.mjs +48 -45
  121. package/es/modules/platform-config/constants/org.const.mjs +57 -52
  122. package/es/modules/platform-config/constants/theme.const.mjs +11 -4
  123. package/es/modules/platform-config/constants/watermark.const.mjs +17 -12
  124. package/es/modules/platform-config/enums/deploy.enum.mjs +13 -6
  125. package/es/modules/platform-config/enums/login.enum.mjs +29 -15
  126. package/es/modules/platform-config/enums/platform.enum.d.ts +0 -15
  127. package/es/modules/platform-config/enums/platform.enum.mjs +17 -26
  128. package/es/modules/platform-config/index.d.ts +1 -1
  129. package/es/modules/platform-config/index.mjs +9 -0
  130. package/es/modules/platform-config/interfaces/index.d.ts +0 -1
  131. package/es/modules/platform-config/store.d.ts +5 -1
  132. package/es/modules/platform-config/store.mjs +68 -76
  133. package/es/modules/platform-config/useBasicSetting.mjs +47 -35
  134. package/es/modules/platform-config/useDeploySetting.mjs +29 -21
  135. package/es/modules/platform-config/useLoginSetting.mjs +151 -173
  136. package/es/modules/platform-config/useOrgSetting.mjs +63 -62
  137. package/es/modules/platform-config/useProjectSetting.mjs +14 -6
  138. package/es/modules/platform-config/useSecuritySetting.d.ts +1 -0
  139. package/es/modules/platform-config/useSecuritySetting.mjs +81 -56
  140. package/es/modules/platform-config/useThemeSetting.mjs +78 -59
  141. package/es/modules/platform-config/useWatermarkSetting.mjs +37 -23
  142. package/es/modules/user-stores/index.mjs +3 -0
  143. package/es/modules/user-stores/store/permission.store.mjs +27 -36
  144. package/es/modules/user-stores/store/tenant.store.mjs +20 -22
  145. package/es/modules/user-stores/store/user.store.d.ts +149 -1
  146. package/es/modules/user-stores/store/user.store.mjs +97 -94
  147. package/es/modules/user-stores/types/user.d.ts +1 -0
  148. package/es/router/index.mjs +25 -28
  149. package/es/setup-app.d.ts +8 -0
  150. package/es/setup-app.mjs +24 -0
  151. package/es/state/global-pinia-state/global-pinia-state.d.ts +15 -7
  152. package/es/state/global-pinia-state/global-pinia-state.mjs +43 -57
  153. package/es/state/index.d.ts +0 -9
  154. package/es/state/index.mjs +1 -0
  155. package/es/store/global-store.mjs +44 -51
  156. package/es/store/index.d.ts +8 -0
  157. package/es/store/index.mjs +35 -19
  158. package/es/store/storage-store.d.ts +9 -0
  159. package/es/store/storage-store.mjs +10 -0
  160. package/es/types/index.d.ts +22 -0
  161. package/es/utils/axios/interceptors.mjs +22 -18
  162. package/es/utils/cache-adapter/cache-adapter.d.ts +2 -0
  163. package/es/utils/cache-adapter/cache-adapter.mjs +64 -0
  164. package/es/utils/css-loader/css-loader.d.ts +36 -0
  165. package/es/utils/css-loader/css-loader.mjs +82 -0
  166. package/es/utils/design/design.d.ts +11 -0
  167. package/es/utils/design/design.mjs +21 -0
  168. package/es/utils/deviceFingerprint.mjs +77 -63
  169. package/es/utils/dictionary/dictionary.mjs +142 -145
  170. package/es/utils/file/base64Conver.d.ts +9 -0
  171. package/es/utils/file/base64Conver.mjs +40 -0
  172. package/es/utils/file/download.d.ts +44 -0
  173. package/es/utils/file/download.mjs +101 -0
  174. package/es/utils/file/parser.d.ts +3 -0
  175. package/es/utils/file/parser.mjs +29 -0
  176. package/es/utils/i18n/index.mjs +14 -3
  177. package/es/utils/index.d.ts +20 -5
  178. package/es/utils/index.mjs +34 -0
  179. package/es/utils/is-sort-filed/is-sort-filed.d.ts +10 -0
  180. package/es/utils/is-sort-filed/is-sort-filed.mjs +45 -0
  181. package/es/utils/kit-pkg-util/kit-pkg-util.d.ts +32 -0
  182. package/es/utils/kit-pkg-util/kit-pkg-util.mjs +73 -0
  183. package/es/utils/linked-list/linked-list.mjs +115 -118
  184. package/es/utils/linked-node/linked-node.mjs +41 -31
  185. package/es/utils/lowcode/utils.d.ts +1 -0
  186. package/es/utils/lowcode/utils.mjs +15 -0
  187. package/es/utils/lowcode/validate.d.ts +13 -0
  188. package/es/utils/lowcode/validate.mjs +23 -0
  189. package/es/utils/mitt/mitt.mjs +4 -4
  190. package/es/utils/model-loader/model-loader.mjs +288 -325
  191. package/es/utils/namespace/namespace.d.ts +8 -0
  192. package/es/utils/namespace/namespace.mjs +180 -163
  193. package/es/utils/openUtil/index.d.ts +2 -0
  194. package/es/utils/openUtil/index.mjs +2 -0
  195. package/es/utils/openUtil/modal/modal.d.ts +61 -0
  196. package/es/utils/openUtil/modal/modal.mjs +73 -0
  197. package/es/utils/openUtil/overlay-container/overlay-container.d.ts +100 -0
  198. package/es/utils/openUtil/overlay-container/overlay-container.mjs +145 -0
  199. package/es/utils/permission.d.ts +19 -0
  200. package/es/utils/permission.mjs +34 -0
  201. package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +63 -0
  202. package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +119 -0
  203. package/es/utils/plugin-static-resource/plugin-static-resource.d.ts +2 -27
  204. package/es/utils/plugin-static-resource/plugin-static-resource.mjs +19 -42
  205. package/es/utils/style/index.mjs +94 -138
  206. package/es/utils/tools/tools.d.ts +12 -10
  207. package/es/utils/tools/tools.mjs +128 -53
  208. package/es/utils/treeHelper/treeHelper.d.ts +10 -9
  209. package/es/utils/treeHelper/treeHelper.mjs +205 -219
  210. package/es/utils/uploader/uploader.d.ts +20 -0
  211. package/es/utils/uploader/uploader.mjs +86 -0
  212. package/es/utils/useUUid.d.ts +41 -0
  213. package/es/utils/useUUid.mjs +85 -0
  214. package/es/utils/util.mjs +55 -35
  215. package/es/utils/uuid/uuid.d.ts +5 -0
  216. package/es/utils/uuid/uuid.mjs +38 -0
  217. package/es/utils/validate.d.ts +5 -0
  218. package/es/utils/validate.mjs +21 -0
  219. package/es/utils/value-helper/value-helper.mjs +113 -96
  220. package/package.json +19 -27
  221. package/dist/index.esm.min.mjs +0 -6103
  222. package/dist/index.min.cjs +0 -14
  223. package/dist/index.system.min.js +0 -14
  224. package/es/constants/editor-type/editor-type.d.ts +0 -244
  225. package/es/constants/editor-type/editor-type.mjs +0 -63
  226. package/es/controller/edit-form/edit-form.controller.d.ts +0 -28
  227. package/es/controller/edit-form/edit-form.controller.mjs +0 -47
  228. package/es/controller/editor/color-editor.controller.d.ts +0 -13
  229. package/es/controller/editor/color-editor.controller.mjs +0 -6
  230. package/es/controller/editor/length-unit-editor.controller.d.ts +0 -13
  231. package/es/controller/editor/length-unit-editor.controller.mjs +0 -6
  232. package/es/controller/editor-item/editor-item.controller.d.ts +0 -14
  233. package/es/controller/editor-item/editor-item.controller.mjs +0 -8
  234. package/es/controller/form/form.controller.d.ts +0 -76
  235. package/es/controller/form/form.controller.mjs +0 -147
  236. package/es/controller/form-collapse/form-collapse.controller.d.ts +0 -18
  237. package/es/controller/form-collapse/form-collapse.controller.mjs +0 -14
  238. package/es/controller/form-collapse-pane/form-collapse-pane.controller.d.ts +0 -18
  239. package/es/controller/form-collapse-pane/form-collapse-pane.controller.mjs +0 -14
  240. package/es/controller/form-edit-item/form-edit-item.controller.d.ts +0 -27
  241. package/es/controller/form-edit-item/form-edit-item.controller.mjs +0 -74
  242. package/es/controller/form-group/form-group.controller.d.ts +0 -18
  243. package/es/controller/form-group/form-group.controller.mjs +0 -14
  244. package/es/controller/form-item/form-item.controller.d.ts +0 -21
  245. package/es/controller/form-item/form-item.controller.mjs +0 -43
  246. package/es/controller/form-item-basic/form-item-basic.controller.d.ts +0 -57
  247. package/es/controller/form-item-basic/form-item-basic.controller.mjs +0 -49
  248. package/es/controller/form-item-hidden/form-item-hidden.controller.d.ts +0 -17
  249. package/es/controller/form-item-hidden/form-item-hidden.controller.mjs +0 -7
  250. package/es/controller/form-tab/form-tab.controller.d.ts +0 -18
  251. package/es/controller/form-tab/form-tab.controller.mjs +0 -14
  252. package/es/controller/form-tab-pane/form-tab-pane.controller.d.ts +0 -18
  253. package/es/controller/form-tab-pane/form-tab-pane.controller.mjs +0 -14
  254. package/es/controller/gct-form/gct-form.controller.d.ts +0 -101
  255. package/es/controller/gct-form/gct-form.controller.mjs +0 -214
  256. package/es/controller/index.d.ts +0 -15
  257. package/es/hooks/use-form/use-form.d.ts +0 -10
  258. package/es/hooks/use-form/use-form.mjs +0 -8
  259. package/es/hooks/use-gct-form-value/use-gct-form-value.d.ts +0 -22
  260. package/es/hooks/use-gct-form-value/use-gct-form-value.mjs +0 -89
  261. package/es/hooks/use-namespace/use-namespace.d.ts +0 -9
  262. package/es/hooks/use-namespace/use-namespace.mjs +0 -18
  263. package/es/interface/controller/edit-form/edit-form.controller.d.ts +0 -26
  264. package/es/interface/controller/editor/i-color-editor.controller.d.ts +0 -11
  265. package/es/interface/controller/editor/i-length-unit-editor.controller.d.ts +0 -11
  266. package/es/interface/controller/editor-item/editor-item.controller.d.ts +0 -19
  267. package/es/interface/controller/form/form.controller.d.ts +0 -121
  268. package/es/interface/controller/form-collapse/form-collapse.controller.d.ts +0 -23
  269. package/es/interface/controller/form-collapse-pane/form-collapse-pane.controller.d.ts +0 -23
  270. package/es/interface/controller/form-edit-item/form-edit-item.controller.d.ts +0 -59
  271. package/es/interface/controller/form-group/form-group.controller.d.ts +0 -24
  272. package/es/interface/controller/form-hidden-item/form-hidden-item.controller.d.ts +0 -24
  273. package/es/interface/controller/form-item/form-item.controller.d.ts +0 -40
  274. package/es/interface/controller/form-item-basic/form-item-basic.controller.d.ts +0 -51
  275. package/es/interface/controller/form-tab/form-tab.controller.d.ts +0 -23
  276. package/es/interface/controller/form-tab-pane/form-tab-pane.controller.d.ts +0 -23
  277. package/es/interface/controller/index.d.ts +0 -14
  278. package/es/interface/events/form/i-form.event.d.ts +0 -11
  279. package/es/interface/events/index.d.ts +0 -1
  280. package/es/interface/form/i-editor/i-check-switch.d.ts +0 -29
  281. package/es/interface/form/i-editor/i-checkbox-editor.d.ts +0 -9
  282. package/es/interface/form/i-editor/i-color-editor.d.ts +0 -13
  283. package/es/interface/form/i-editor/i-editor-basic.d.ts +0 -87
  284. package/es/interface/form/i-editor/i-icon-select-editor.d.ts +0 -21
  285. package/es/interface/form/i-editor/i-info-editor.d.ts +0 -21
  286. package/es/interface/form/i-editor/i-length-unit-editor.d.ts +0 -13
  287. package/es/interface/form/i-editor/i-model-field-select-editor.d.ts +0 -18
  288. package/es/interface/form/i-editor/i-number-editor.d.ts +0 -21
  289. package/es/interface/form/i-editor/i-picker-editor.d.ts +0 -30
  290. package/es/interface/form/i-editor/i-radio-editor.d.ts +0 -21
  291. package/es/interface/form/i-editor/i-select-editor.d.ts +0 -14
  292. package/es/interface/form/i-editor/i-span-editor.d.ts +0 -30
  293. package/es/interface/form/i-editor/i-switch-editor.d.ts +0 -14
  294. package/es/interface/form/i-editor/i-text-editor.d.ts +0 -46
  295. package/es/interface/form/i-editor/i-textarea-editor.d.ts +0 -25
  296. package/es/interface/form/i-form/i-edit-form.d.ts +0 -48
  297. package/es/interface/form/i-form/i-form-collapse-pane.d.ts +0 -30
  298. package/es/interface/form/i-form/i-form-collapse.d.ts +0 -35
  299. package/es/interface/form/i-form/i-form-container.d.ts +0 -53
  300. package/es/interface/form/i-form/i-form-edit-item.d.ts +0 -140
  301. package/es/interface/form/i-form/i-form-group-container.d.ts +0 -24
  302. package/es/interface/form/i-form/i-form-group.d.ts +0 -35
  303. package/es/interface/form/i-form/i-form-hidden-item.d.ts +0 -11
  304. package/es/interface/form/i-form/i-form-item-basic.d.ts +0 -126
  305. package/es/interface/form/i-form/i-form-item.d.ts +0 -11
  306. package/es/interface/form/i-form/i-form-tab-pane.d.ts +0 -23
  307. package/es/interface/form/i-form/i-form-tab.d.ts +0 -21
  308. package/es/interface/form/i-form/i-form.d.ts +0 -79
  309. package/es/interface/form/index.d.ts +0 -29
  310. package/es/interface/i-message-util/i-message-util.d.ts +0 -78
  311. package/es/interface/layout/i-flex-layout/i-flex-container.d.ts +0 -75
  312. package/es/interface/layout/i-flex-layout/i-flex-item.d.ts +0 -51
  313. package/es/interface/layout/i-grid-layout/i-grid-container.d.ts +0 -29
  314. package/es/interface/layout/i-grid-layout/i-grid-item-span.d.ts +0 -54
  315. package/es/interface/layout/i-grid-layout/i-grid-item.d.ts +0 -37
  316. package/es/interface/layout/i-layout-basis/i-layout-container-basis.d.ts +0 -11
  317. package/es/interface/layout/index.d.ts +0 -6
  318. package/es/interface/provider/i-editor-provider/i-editor-provider.d.ts +0 -24
  319. package/es/interface/provider/i-form-item-provider/i-form-item-provider.d.ts +0 -44
  320. package/es/interface/state/form/form.state.d.ts +0 -53
  321. package/es/interface/state/form-collapse/form-collapse.state.d.ts +0 -11
  322. package/es/interface/state/form-collapse-pane/form-collapse-pane.state.d.ts +0 -11
  323. package/es/interface/state/form-edit-item/form-edit-item.state.d.ts +0 -38
  324. package/es/interface/state/form-group/form-group.state.d.ts +0 -21
  325. package/es/interface/state/form-hidden-item/form-hidden-item.state.d.ts +0 -5
  326. package/es/interface/state/form-item/form-item.state.d.ts +0 -20
  327. package/es/interface/state/form-item-basic/form-item-basic.state.d.ts +0 -63
  328. package/es/interface/state/form-tab/form-tab.state.d.ts +0 -19
  329. package/es/interface/state/form-tab-pane/form-tab-pane.state.d.ts +0 -11
  330. package/es/interface/state/index.d.ts +0 -10
  331. package/es/modules/platform-config/interfaces/global-setting.interface.d.ts +0 -7
  332. package/es/register/editor-register/editor-register.d.ts +0 -49
  333. package/es/register/editor-register/editor-register.mjs +0 -57
  334. package/es/register/form-item-register/form-item-register.d.ts +0 -36
  335. package/es/register/form-item-register/form-item-register.mjs +0 -42
  336. package/es/register/index.d.ts +0 -21
  337. package/es/register/render-register/render-register.d.ts +0 -59
  338. package/es/register/render-register/render-register.mjs +0 -63
  339. package/es/state/form/form.state.d.ts +0 -24
  340. package/es/state/form/form.state.mjs +0 -16
  341. package/es/state/form-collapse/form-collapse.state.d.ts +0 -14
  342. package/es/state/form-collapse/form-collapse.state.mjs +0 -6
  343. package/es/state/form-collapse-pane/form-collapse-pane.state.d.ts +0 -14
  344. package/es/state/form-collapse-pane/form-collapse-pane.state.mjs +0 -6
  345. package/es/state/form-edit-item/form-edit-item.state.d.ts +0 -17
  346. package/es/state/form-edit-item/form-edit-item.state.mjs +0 -10
  347. package/es/state/form-group/form-group.state.d.ts +0 -21
  348. package/es/state/form-group/form-group.state.mjs +0 -14
  349. package/es/state/form-item/form-item.state.d.ts +0 -14
  350. package/es/state/form-item/form-item.state.mjs +0 -6
  351. package/es/state/form-item-basic/form-item-basic.state.d.ts +0 -17
  352. package/es/state/form-item-basic/form-item-basic.state.mjs +0 -9
  353. package/es/state/form-tab/form-tab.state.d.ts +0 -15
  354. package/es/state/form-tab/form-tab.state.mjs +0 -7
  355. package/es/state/form-tab-pane/form-tab-pane.state.d.ts +0 -14
  356. package/es/state/form-tab-pane/form-tab-pane.state.mjs +0 -6
  357. package/es/utils/props/gct-form-item/gct-form-item.props.d.ts +0 -63
  358. package/es/utils/props/gct-form-item/gct-form-item.props.mjs +0 -66
  359. package/es/utils/props/index.d.ts +0 -1
  360. package/es/utils/width-install/width-install.d.ts +0 -17
  361. package/es/utils/width-install/width-install.mjs +0 -19
@@ -1,141 +1,97 @@
1
- const calcStyle = (data, ignoringStyle = []) => {
2
- const style = {};
3
- const padding = data.padding;
4
- if (padding) {
5
- if (padding.top != null && padding.top != "" && !ignoringStyle.includes("paddingTop"))
6
- style["padding-top"] = padding.top;
7
- if (padding.right != null && padding.right != "" && !ignoringStyle.includes("paddingRight"))
8
- style["padding-right"] = padding.right;
9
- if (padding.bottom != null && padding.bottom != "" && !ignoringStyle.includes("paddingBottom"))
10
- style["padding-bottom"] = padding.bottom;
11
- if (padding.left != null && padding.left != "" && !ignoringStyle.includes("paddingLeft"))
12
- style["padding-left"] = padding.left;
13
- }
14
- const margin = data.margin;
15
- if (margin) {
16
- if (margin.top != null && margin.top != "" && !ignoringStyle.includes("marginTop"))
17
- style["margin-top"] = margin.top;
18
- if (margin.right != null && margin.right != "" && !ignoringStyle.includes("marginRight"))
19
- style["margin-right"] = margin.right;
20
- if (margin.bottom != null && margin.bottom != "" && !ignoringStyle.includes("marginBottom"))
21
- style["margin-bottom"] = margin.bottom;
22
- if (margin.left != null && margin.left != "" && !ignoringStyle.includes("marginLeft"))
23
- style["margin-left"] = margin.left;
24
- }
25
- if (data.background != null && data.background != "" && !ignoringStyle.includes("backgroundColor")) {
26
- style["background-color"] = data.background;
27
- }
28
- if (data.width != null && data.width != "" && !ignoringStyle.includes("width")) {
29
- style.width = data.width;
30
- }
31
- if (data.height != null && data.height != "" && !ignoringStyle.includes("height")) {
32
- style.height = data.height;
33
- style.overflowX = "hidden";
34
- style.overflowY = "auto";
35
- }
36
- const position = data.position;
37
- if (position) {
38
- if (position.position != null && position.position != "" && !ignoringStyle.includes("zIndex")) {
39
- style.position = position.position;
40
- style["z-index"] = 1;
41
- }
42
- if (position.top != null && position.top != "" && !ignoringStyle.includes("top"))
43
- style.top = `${position.top}px`;
44
- if (position.right != null && position.right != "" && !ignoringStyle.includes("right"))
45
- style.right = `${position.right}px`;
46
- if (position.bottom != null && position.bottom != "" && !ignoringStyle.includes("bottom"))
47
- style.bottom = `${position.bottom}px`;
48
- if (position.left != null && position.left != "" && !ignoringStyle.includes("left"))
49
- style.left = `${position.left}px`;
50
- }
51
- const border = data.border;
52
- if (border) {
53
- if (border.topLeftRadius != null && border.topLeftRadius != "" && !ignoringStyle.includes("borderTopLeftRadius")) {
54
- style["border-top-left-radius"] = border.topLeftRadius;
55
- }
56
- if (border.topRightRadius != null && border.topRightRadius != "" && !ignoringStyle.includes("borderTopRightRadius")) {
57
- style["border-top-right-radius"] = border.topRightRadius;
58
- }
59
- if (border.bottomLeftRadius != null && border.bottomLeftRadius != "" && !ignoringStyle.includes("borderBottomLeftRadius")) {
60
- style["border-bottom-left-radius"] = border.bottomLeftRadius;
61
- }
62
- if (border.bottomRightRadius != null && border.bottomRightRadius != "" && !ignoringStyle.includes("borderBottomRightRadius")) {
63
- style["border-bottom-right-radius"] = border.bottomRightRadius;
64
- }
65
- if (border.top) {
66
- if (border.top.color != null && border.top.color != "" && !ignoringStyle.includes("borderTopColor")) {
67
- style["border-top-color"] = border.top.color;
68
- }
69
- if (border.top.width != null && border.top.width != "" && !ignoringStyle.includes("borderTopWidth")) {
70
- style["border-top-width"] = border.top.width;
71
- }
72
- if (border.top.style && !ignoringStyle.includes("borderTopStyle")) {
73
- style["border-top-style"] = border.top.style;
74
- }
75
- }
76
- if (border.right) {
77
- if (border.right.color != null && border.right.color != "" && !ignoringStyle.includes("borderRightColor")) {
78
- style["border-right-color"] = border.right.color;
79
- }
80
- if (border.right.width != null && border.right.width != "" && !ignoringStyle.includes("borderRightWidth")) {
81
- style["border-right-width"] = border.right.width;
82
- }
83
- if (border.right.style && !ignoringStyle.includes("borderRightStyle")) {
84
- style["border-right-style"] = border.right.style;
85
- }
86
- }
87
- if (border.bottom) {
88
- if (border.bottom.color != null && border.bottom.color != "" && !ignoringStyle.includes("borderBottomColor")) {
89
- style["border-bottom-color"] = border.bottom.color;
90
- }
91
- if (border.bottom.width != null && border.bottom.width != "" && !ignoringStyle.includes("borderBottomWidth")) {
92
- style["border-bottom-width"] = border.bottom.width;
93
- }
94
- if (border.bottom.style && !ignoringStyle.includes("borderBottomStyle")) {
95
- style["border-bottom-style"] = border.bottom.style;
96
- }
97
- }
98
- if (border.left) {
99
- if (border.left.color != null && border.left.color != "" && !ignoringStyle.includes("borderLeftColor")) {
100
- style["border-left-color"] = border.left.color;
101
- }
102
- if (border.left.width != null && border.left.width != "" && !ignoringStyle.includes("borderLeftWidth")) {
103
- style["border-left-width"] = border.left.width;
104
- }
105
- if (border.left.style && !ignoringStyle.includes("borderLeftStyle")) {
106
- style["border-left-style"] = border.left.style;
107
- }
108
- }
109
- }
110
- if (data.border_radius) {
111
- style["border-radius"] = `${data.border_radius}px`;
112
- }
113
- return style;
1
+ //#region src/utils/style/index.ts
2
+ /**
3
+ * 计算配置样式
4
+ *
5
+ * @param data
6
+ * @param ignoringStyle 忽略计算的样式
7
+ * @returns
8
+ */
9
+ var calcStyle = (data, ignoringStyle = []) => {
10
+ const style = {};
11
+ const padding = data.padding;
12
+ if (padding) {
13
+ if (padding.top != null && padding.top != "" && !ignoringStyle.includes("paddingTop")) style["padding-top"] = padding.top;
14
+ if (padding.right != null && padding.right != "" && !ignoringStyle.includes("paddingRight")) style["padding-right"] = padding.right;
15
+ if (padding.bottom != null && padding.bottom != "" && !ignoringStyle.includes("paddingBottom")) style["padding-bottom"] = padding.bottom;
16
+ if (padding.left != null && padding.left != "" && !ignoringStyle.includes("paddingLeft")) style["padding-left"] = padding.left;
17
+ }
18
+ const margin = data.margin;
19
+ if (margin) {
20
+ if (margin.top != null && margin.top != "" && !ignoringStyle.includes("marginTop")) style["margin-top"] = margin.top;
21
+ if (margin.right != null && margin.right != "" && !ignoringStyle.includes("marginRight")) style["margin-right"] = margin.right;
22
+ if (margin.bottom != null && margin.bottom != "" && !ignoringStyle.includes("marginBottom")) style["margin-bottom"] = margin.bottom;
23
+ if (margin.left != null && margin.left != "" && !ignoringStyle.includes("marginLeft")) style["margin-left"] = margin.left;
24
+ }
25
+ if (data.background != null && data.background != "" && !ignoringStyle.includes("backgroundColor")) style["background-color"] = data.background;
26
+ if (data.width != null && data.width != "" && !ignoringStyle.includes("width")) style.width = data.width;
27
+ if (data.height != null && data.height != "" && !ignoringStyle.includes("height")) {
28
+ style.height = data.height;
29
+ style.overflowX = "hidden";
30
+ style.overflowY = "auto";
31
+ }
32
+ const position = data.position;
33
+ if (position) {
34
+ if (position.position != null && position.position != "" && !ignoringStyle.includes("zIndex")) {
35
+ style.position = position.position;
36
+ style["z-index"] = 1;
37
+ }
38
+ if (position.top != null && position.top != "" && !ignoringStyle.includes("top")) style.top = `${position.top}px`;
39
+ if (position.right != null && position.right != "" && !ignoringStyle.includes("right")) style.right = `${position.right}px`;
40
+ if (position.bottom != null && position.bottom != "" && !ignoringStyle.includes("bottom")) style.bottom = `${position.bottom}px`;
41
+ if (position.left != null && position.left != "" && !ignoringStyle.includes("left")) style.left = `${position.left}px`;
42
+ }
43
+ const border = data.border;
44
+ if (border) {
45
+ if (border.topLeftRadius != null && border.topLeftRadius != "" && !ignoringStyle.includes("borderTopLeftRadius")) style["border-top-left-radius"] = border.topLeftRadius;
46
+ if (border.topRightRadius != null && border.topRightRadius != "" && !ignoringStyle.includes("borderTopRightRadius")) style["border-top-right-radius"] = border.topRightRadius;
47
+ if (border.bottomLeftRadius != null && border.bottomLeftRadius != "" && !ignoringStyle.includes("borderBottomLeftRadius")) style["border-bottom-left-radius"] = border.bottomLeftRadius;
48
+ if (border.bottomRightRadius != null && border.bottomRightRadius != "" && !ignoringStyle.includes("borderBottomRightRadius")) style["border-bottom-right-radius"] = border.bottomRightRadius;
49
+ if (border.top) {
50
+ if (border.top.color != null && border.top.color != "" && !ignoringStyle.includes("borderTopColor")) style["border-top-color"] = border.top.color;
51
+ if (border.top.width != null && border.top.width != "" && !ignoringStyle.includes("borderTopWidth")) style["border-top-width"] = border.top.width;
52
+ if (border.top.style && !ignoringStyle.includes("borderTopStyle")) style["border-top-style"] = border.top.style;
53
+ }
54
+ if (border.right) {
55
+ if (border.right.color != null && border.right.color != "" && !ignoringStyle.includes("borderRightColor")) style["border-right-color"] = border.right.color;
56
+ if (border.right.width != null && border.right.width != "" && !ignoringStyle.includes("borderRightWidth")) style["border-right-width"] = border.right.width;
57
+ if (border.right.style && !ignoringStyle.includes("borderRightStyle")) style["border-right-style"] = border.right.style;
58
+ }
59
+ if (border.bottom) {
60
+ if (border.bottom.color != null && border.bottom.color != "" && !ignoringStyle.includes("borderBottomColor")) style["border-bottom-color"] = border.bottom.color;
61
+ if (border.bottom.width != null && border.bottom.width != "" && !ignoringStyle.includes("borderBottomWidth")) style["border-bottom-width"] = border.bottom.width;
62
+ if (border.bottom.style && !ignoringStyle.includes("borderBottomStyle")) style["border-bottom-style"] = border.bottom.style;
63
+ }
64
+ if (border.left) {
65
+ if (border.left.color != null && border.left.color != "" && !ignoringStyle.includes("borderLeftColor")) style["border-left-color"] = border.left.color;
66
+ if (border.left.width != null && border.left.width != "" && !ignoringStyle.includes("borderLeftWidth")) style["border-left-width"] = border.left.width;
67
+ if (border.left.style && !ignoringStyle.includes("borderLeftStyle")) style["border-left-style"] = border.left.style;
68
+ }
69
+ }
70
+ if (data.border_radius) style["border-radius"] = `${data.border_radius}px`;
71
+ return style;
114
72
  };
115
- const calcFontStyle = (data, ignoringStyle = []) => {
116
- const style = {};
117
- const labelFont = data.labelFont;
118
- if (labelFont) {
119
- if (labelFont.color != null && labelFont.color != "" && !ignoringStyle.includes("color"))
120
- style.color = labelFont.color;
121
- if (labelFont.fontSize != null && labelFont.fontSize != "" && !ignoringStyle.includes("fontSize")) {
122
- style["font-size"] = labelFont.fontSize;
123
- }
124
- if (labelFont.align && !ignoringStyle.includes("textAlign")) {
125
- style["text-align"] = labelFont.align;
126
- style["text-align-last"] = labelFont.align;
127
- }
128
- if (labelFont.bold === true && !ignoringStyle.includes("fontWeight")) {
129
- style["font-weight"] = "bold";
130
- }
131
- if (labelFont.italic === true && !ignoringStyle.includes("fontStyle")) {
132
- style["font-style"] = "italic";
133
- }
134
- if (labelFont.textDecoration && !ignoringStyle.includes("textDecoration")) {
135
- style["text-decoration"] = labelFont.textDecoration;
136
- }
137
- }
138
- return style;
73
+ /**
74
+ * 计算字体样式
75
+ *
76
+ * @param data
77
+ * @param ignoringStyle 忽略的样式
78
+ * @returns
79
+ */
80
+ var calcFontStyle = (data, ignoringStyle = []) => {
81
+ const style = {};
82
+ const labelFont = data.labelFont;
83
+ if (labelFont) {
84
+ if (labelFont.color != null && labelFont.color != "" && !ignoringStyle.includes("color")) style.color = labelFont.color;
85
+ if (labelFont.fontSize != null && labelFont.fontSize != "" && !ignoringStyle.includes("fontSize")) style["font-size"] = labelFont.fontSize;
86
+ if (labelFont.align && !ignoringStyle.includes("textAlign")) {
87
+ style["text-align"] = labelFont.align;
88
+ style["text-align-last"] = labelFont.align;
89
+ }
90
+ if (labelFont.bold === true && !ignoringStyle.includes("fontWeight")) style["font-weight"] = "bold";
91
+ if (labelFont.italic === true && !ignoringStyle.includes("fontStyle")) style["font-style"] = "italic";
92
+ if (labelFont.textDecoration && !ignoringStyle.includes("textDecoration")) style["text-decoration"] = labelFont.textDecoration;
93
+ }
94
+ return style;
139
95
  };
140
-
96
+ //#endregion
141
97
  export { calcFontStyle, calcStyle };
@@ -1,4 +1,3 @@
1
- import { default as qs } from 'qs';
2
1
  /**
3
2
  * 获取认证令牌
4
3
  *
@@ -31,13 +30,6 @@ export declare function setTenant(tenant: string): void;
31
30
  * 是否为移动端设备
32
31
  */
33
32
  export declare const isMobile: boolean;
34
- /**
35
- * 获取时区,默认: UTC+08:00
36
- *
37
- * @export
38
- * @returns {*}
39
- */
40
- export declare function getTimezone(): string;
41
33
  /**
42
34
  * 递归合并两个对象
43
35
  *
@@ -53,10 +45,20 @@ export declare function deepMerge<T extends object | null | undefined, U extends
53
45
  * @param {*} params
54
46
  * @returns
55
47
  */
56
- export declare function stringifyMatrixParams(params: Record<string, string | number | null | undefined>): string;
48
+ export declare function stringifyMatrixParams(params: Record<string, unknown>): string;
57
49
  /**
58
50
  * 矩阵参数 → 对象(parse)
59
51
  * @param {*} path
60
52
  * @returns
61
53
  */
62
- export declare function parseMatrixParams(path: string): qs.ParsedQs;
54
+ export declare function parseMatrixParams(path: string): IObject;
55
+ /**
56
+ * 创建白色背景的图片,并添加文本
57
+ *
58
+ * @export
59
+ * @param {string} name - 文本
60
+ * @param {number} width - 宽度
61
+ * @param {number} height - 高度
62
+ * @return {string} 图片 base64 编码(png 格式)
63
+ */
64
+ export declare function createWhiteImageWithText(name: string, width: number, height: number): string;
@@ -1,68 +1,143 @@
1
- import { getCookie, setCookie, clearCookie } from 'qx-util';
2
- import { mergeWith, cloneDeep, unionWith, isEqual } from 'lodash-es';
3
- import { CoreConst } from '../../constants/core.mjs';
4
- import '../../enums/app-designer/index.mjs';
5
- import '../../enums/page-designer/designer.mjs';
6
- import '../../enums/breakpointEnum.mjs';
7
- import { TIMEZONE_KEY } from '../../enums/cacheEnum.mjs';
8
- import qs from 'qs';
9
-
1
+ import { CoreConst } from "../../constants/core.mjs";
2
+ import "../../constants/index.mjs";
3
+ import qs from "qs";
4
+ import { cloneDeep, isEqual, mergeWith, unionWith } from "lodash-es";
5
+ import { clearCookie, getCookie, setCookie } from "qx-util";
6
+ //#region src/utils/tools/tools.ts
7
+ /**
8
+ * 获取认证令牌
9
+ *
10
+ * @export
11
+ * @returns {*} {(string | null)}
12
+ */
10
13
  function getToken() {
11
- return getCookie(CoreConst.TOKEN);
14
+ return getCookie(CoreConst.TOKEN);
12
15
  }
16
+ /**
17
+ * 设置认证令牌(目前只有 session 级别生效)
18
+ *
19
+ * @export
20
+ * @param {string} token
21
+ */
13
22
  function setToken(token) {
14
- if (token) {
15
- setCookie(CoreConst.TOKEN, token, 7, true);
16
- } else {
17
- clearCookie(CoreConst.TOKEN, true);
18
- }
23
+ if (token) setCookie(CoreConst.TOKEN, token, 7, true);
24
+ else clearCookie(CoreConst.TOKEN, true);
19
25
  }
26
+ /**
27
+ * 从 cookie 获取租户标识
28
+ *
29
+ * @export
30
+ * @returns {*} {(string | null)}
31
+ */
20
32
  function getTenant() {
21
- return getCookie(CoreConst.TENANT);
33
+ return getCookie(CoreConst.TENANT);
22
34
  }
35
+ /**
36
+ * 设置租户标识至 cookie
37
+ *
38
+ * @export
39
+ * @param {string} tenant
40
+ */
23
41
  function setTenant(tenant) {
24
- if (tenant) {
25
- setCookie(CoreConst.TENANT, tenant, 7, true);
26
- } else {
27
- clearCookie(CoreConst.TENANT, true);
28
- }
42
+ if (tenant) setCookie(CoreConst.TENANT, tenant, 7, true);
43
+ else clearCookie(CoreConst.TENANT, true);
29
44
  }
30
- const isMobile = (() => {
31
- const ua = navigator.userAgent;
32
- const mobileRegex = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/;
33
- const isSmallScreen = window.innerWidth <= 768;
34
- const isTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
35
- return mobileRegex.test(ua) || isSmallScreen && isTouch;
45
+ /**
46
+ * 是否为移动端设备
47
+ */
48
+ var isMobile = (() => {
49
+ const ua = navigator.userAgent;
50
+ const mobileRegex = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/;
51
+ const isSmallScreen = window.innerWidth <= 768;
52
+ const isTouch = "ontouchstart" in window || navigator.maxTouchPoints > 0;
53
+ return mobileRegex.test(ua) || isSmallScreen && isTouch;
36
54
  })();
37
- function getTimezone() {
38
- return localStorage.getItem(TIMEZONE_KEY) || "UTC+08:00";
39
- }
55
+ /**
56
+ * 递归合并两个对象
57
+ *
58
+ * @template T
59
+ * @template U
60
+ * @param {T} target 目标对象,合并后结果存放于此
61
+ * @param {U} source 要合并的源对象
62
+ * @returns {(T & U)} 合并后的对象
63
+ */
40
64
  function deepMerge(target, source) {
41
- return mergeWith(cloneDeep(target), source, (objValue, srcValue) => {
42
- if (typeof objValue === "object" && typeof srcValue === "object") {
43
- return mergeWith(
44
- cloneDeep(objValue),
45
- srcValue,
46
- (prevValue, nextValue) => {
47
- return Array.isArray(prevValue) ? unionWith(prevValue, nextValue, isEqual) : void 0;
48
- }
49
- );
50
- }
51
- });
65
+ return mergeWith(cloneDeep(target), source, (objValue, srcValue) => {
66
+ if (typeof objValue === "object" && typeof srcValue === "object") return mergeWith(cloneDeep(objValue), srcValue, (prevValue, nextValue) => {
67
+ return Array.isArray(prevValue) ? unionWith(prevValue, nextValue, isEqual) : void 0;
68
+ });
69
+ });
52
70
  }
71
+ /**
72
+ * 对象 → 矩阵参数(stringify)
73
+ * @param {*} params
74
+ * @returns
75
+ */
53
76
  function stringifyMatrixParams(params) {
54
- const str = qs.stringify(params, {
55
- encode: true,
56
- delimiter: ";"
57
- });
58
- return str ? `;${str}` : "";
77
+ const str = qs.stringify(params, {
78
+ encode: true,
79
+ delimiter: ";"
80
+ });
81
+ return str ? `;${str}` : "";
59
82
  }
83
+ /**
84
+ * 矩阵参数 → 对象(parse)
85
+ * @param {*} path
86
+ * @returns
87
+ */
60
88
  function parseMatrixParams(path) {
61
- const idx = path.indexOf(";");
62
- if (idx === -1) return {};
63
- return qs.parse(path, {
64
- delimiter: ";"
65
- });
89
+ if (path.indexOf(";") === -1) return {};
90
+ return qs.parse(path, { delimiter: ";" });
91
+ }
92
+ /**
93
+ * 创建白色背景的图片,并添加文本
94
+ *
95
+ * @export
96
+ * @param {string} name - 文本
97
+ * @param {number} width - 宽度
98
+ * @param {number} height - 高度
99
+ * @return {string} 图片 base64 编码(png 格式)
100
+ */
101
+ function createWhiteImageWithText(name, width, height) {
102
+ const canvas = document.createElement("canvas");
103
+ canvas.width = width;
104
+ canvas.height = height;
105
+ const ctx = canvas.getContext("2d");
106
+ ctx.fillStyle = "#ffffff";
107
+ ctx.fillRect(0, 0, width, height);
108
+ let fontSize = Math.floor(height / 3);
109
+ ctx.font = `${fontSize}px Arial`;
110
+ function wrapText(text, maxWidth, context) {
111
+ const characters = text.split("");
112
+ const lines = [];
113
+ let currentLine = "";
114
+ for (const char of characters) {
115
+ const testLine = currentLine + char;
116
+ if (context.measureText(testLine).width > maxWidth && currentLine !== "") {
117
+ lines.push(currentLine);
118
+ currentLine = char;
119
+ } else currentLine = testLine;
120
+ }
121
+ if (currentLine) lines.push(currentLine);
122
+ return lines;
123
+ }
124
+ const maxTextWidth = width * .9;
125
+ let lines = wrapText(name, maxTextWidth, ctx);
126
+ let lineHeight = fontSize * 1.2;
127
+ while (lines.length * lineHeight > height && fontSize > 10) {
128
+ fontSize -= 1;
129
+ lineHeight = fontSize * 1.2;
130
+ ctx.font = `${fontSize}px Arial`;
131
+ lines = wrapText(name, maxTextWidth, ctx);
132
+ }
133
+ const startY = (height - lines.length * lineHeight) / 2 + lineHeight / 2;
134
+ ctx.fillStyle = "#000000";
135
+ ctx.textAlign = "center";
136
+ ctx.textBaseline = "middle";
137
+ lines.forEach((line, index) => {
138
+ ctx.fillText(line, width / 2, startY + index * lineHeight);
139
+ });
140
+ return canvas.toDataURL("image/png");
66
141
  }
67
-
68
- export { deepMerge, getTenant, getTimezone, getToken, isMobile, parseMatrixParams, setTenant, setToken, stringifyMatrixParams };
142
+ //#endregion
143
+ export { createWhiteImageWithText, deepMerge, getTenant, getToken, isMobile, parseMatrixParams, setTenant, setToken, stringifyMatrixParams };
@@ -15,12 +15,6 @@ interface ITreeHelperConfig {
15
15
  /** 是否深度遍历 */
16
16
  deep: boolean;
17
17
  }
18
- /**
19
- * 带子节点的对象接口
20
- */
21
- interface IWithChildren<R> {
22
- children?: R[];
23
- }
24
18
  /**
25
19
  * 树结构数据处理工具类
26
20
  * 提供树形数据与列表数据的相互转换、节点查找、路径查找等功能
@@ -93,16 +87,16 @@ export declare class TreeHelper {
93
87
  static list_to_tree<T extends {
94
88
  id?: string;
95
89
  parentId?: string;
96
- }, R = T>(list: T[], callBack?: (n: T & IWithChildren<R>) => R): R[];
90
+ }, R = T>(list: T[], callBack: (n: IObject) => R): R[];
97
91
  /**
98
92
  * 获取所有父级路径
99
93
  * @param treeData 树形结构数据
100
94
  * @param path 目标路径
101
95
  * @returns 从根节点到目标节点的所有路径数组
102
96
  */
103
- static getAllParentPath(treeData: object & {
97
+ static getAllParentPath(treeData: (IObject & {
104
98
  path: string;
105
- }[], path: string): string[];
99
+ })[], path: string): string[];
106
100
  /**
107
101
  * 递归遍历树并且根据callback返回新数据再拼装成一个新树
108
102
  *
@@ -113,5 +107,12 @@ export declare class TreeHelper {
113
107
  * @return {*}
114
108
  */
115
109
  static traverseAndBuildTree(treeData: IObject[], callback: (node: IObject) => IObject | unknown, config?: Partial<ITreeHelperConfig>): IObject[];
110
+ /**
111
+ * 递归遍历树结构
112
+ * @param treeData 树形结构数据
113
+ * @param callBack 回调函数
114
+ * @param parentNode 父节点
115
+ */
116
+ static eachTree<T extends IObject = IObject>(treeData: T[], callBack: (node: T, parentNode?: T) => any, parentNode?: any): void;
116
117
  }
117
118
  export {};