@gct-paas/core 0.1.4-dev.7 → 0.1.4-dev.9

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 (276) hide show
  1. package/dist/index.esm.min.mjs +6520 -18715
  2. package/dist/index.min.cjs +386 -2
  3. package/dist/index.system.min.js +386 -2
  4. package/es/constants/core.mjs +0 -1
  5. package/es/constants/editor-register/editor-register.mjs +0 -1
  6. package/es/constants/editor-type/editor-type.d.ts +65 -1
  7. package/es/constants/editor-type/editor-type.mjs +14 -1
  8. package/es/constants/expression-type/BuiltOperators.d.ts +20 -0
  9. package/es/constants/expression-type/BuiltOperators.mjs +148 -0
  10. package/es/constants/expression-type/FunctionKeys.d.ts +1 -0
  11. package/es/constants/expression-type/FunctionKeys.mjs +81 -0
  12. package/es/constants/expression-type/editor.d.ts +8 -0
  13. package/es/constants/expression-type/editor.mjs +4 -0
  14. package/es/constants/expression-type/function.d.ts +7 -0
  15. package/es/constants/expression-type/function.mjs +875 -0
  16. package/es/constants/expression-type/index.d.ts +42 -0
  17. package/es/constants/expression-type/index.mjs +120 -0
  18. package/es/constants/expression-type/modeCfg.d.ts +30 -0
  19. package/es/constants/expression-type/modeCfg.mjs +268 -0
  20. package/es/constants/expression-type/variable.d.ts +12 -0
  21. package/es/constants/expression-type/variable.mjs +42 -0
  22. package/es/constants/form-container-type/form-container-type.mjs +0 -1
  23. package/es/constants/index.d.ts +5 -0
  24. package/es/constants/index.mjs +6 -6
  25. package/es/controller/edit-form/edit-form.controller.mjs +0 -1
  26. package/es/controller/editor/color-editor.controller.mjs +0 -1
  27. package/es/controller/editor/length-unit-editor.controller.mjs +0 -1
  28. package/es/controller/editor-item/editor-item.controller.mjs +0 -1
  29. package/es/controller/form/form.controller.mjs +5 -4
  30. package/es/controller/form-collapse/form-collapse.controller.mjs +4 -3
  31. package/es/controller/form-collapse-pane/form-collapse-pane.controller.mjs +4 -3
  32. package/es/controller/form-edit-item/form-edit-item.controller.d.ts +1 -0
  33. package/es/controller/form-edit-item/form-edit-item.controller.mjs +6 -2
  34. package/es/controller/form-group/form-group.controller.mjs +4 -3
  35. package/es/controller/form-item/form-item.controller.d.ts +1 -0
  36. package/es/controller/form-item/form-item.controller.mjs +7 -3
  37. package/es/controller/form-item-basic/form-item-basic.controller.mjs +3 -2
  38. package/es/controller/form-item-hidden/form-item-hidden.controller.mjs +0 -1
  39. package/es/controller/form-tab/form-tab.controller.mjs +4 -3
  40. package/es/controller/form-tab-pane/form-tab-pane.controller.mjs +4 -3
  41. package/es/controller/gct-form/gct-form.controller.mjs +5 -4
  42. package/es/create-app-vue.mjs +3 -9
  43. package/es/enums/app-designer/index.d.ts +13 -1
  44. package/es/enums/app-designer/index.mjs +8 -2
  45. package/es/enums/appEnum.d.ts +22 -66
  46. package/es/enums/appEnum.mjs +24 -15
  47. package/es/enums/appStateEnum.mjs +0 -1
  48. package/es/enums/authActionEnum.mjs +0 -1
  49. package/es/enums/breakpointEnum.mjs +0 -1
  50. package/es/enums/cacheEnum.mjs +0 -1
  51. package/es/enums/designEnum.d.ts +2 -2
  52. package/es/enums/designEnum.mjs +31 -32
  53. package/es/enums/developer-center/index.d.ts +1 -0
  54. package/es/enums/developer-center/integration.d.ts +4 -0
  55. package/es/enums/developer-center/integration.mjs +7 -0
  56. package/es/enums/exceptionEnum.mjs +0 -1
  57. package/es/enums/expressionEnum.d.ts +130 -0
  58. package/es/enums/expressionEnum.mjs +75 -0
  59. package/es/enums/globalEnum.d.ts +38 -0
  60. package/es/enums/globalEnum.mjs +25 -0
  61. package/es/enums/httpEnum.mjs +0 -1
  62. package/es/enums/index.d.ts +19 -0
  63. package/es/enums/index.mjs +13 -16
  64. package/es/enums/menuEnum.mjs +0 -1
  65. package/es/enums/page-designer/designer.d.ts +23 -3
  66. package/es/enums/page-designer/designer.mjs +90 -6
  67. package/es/enums/page-designer/panel.d.ts +78 -7
  68. package/es/enums/page-designer/panel.mjs +22 -4
  69. package/es/enums/page-designer/toolkit.mjs +0 -1
  70. package/es/enums/page-designer/widget.d.ts +2 -1
  71. package/es/enums/page-designer/widget.mjs +3 -3
  72. package/es/enums/pageEnum.mjs +0 -1
  73. package/es/enums/plugin-enum.mjs +0 -1
  74. package/es/enums/processEnum.d.ts +54 -0
  75. package/es/enums/processEnum.mjs +36 -2
  76. package/es/enums/roleEnum.mjs +0 -1
  77. package/es/enums/sizeEnum.mjs +0 -1
  78. package/es/global/gct/gct.d.ts +11 -28
  79. package/es/global/gct/gct.mjs +29 -32
  80. package/es/hooks/index.d.ts +2 -1
  81. package/es/hooks/use-app-inst/use-app-inst.d.ts +8 -0
  82. package/es/hooks/use-app-inst/use-app-inst.mjs +8 -0
  83. package/es/hooks/use-form/use-form.mjs +0 -1
  84. package/es/hooks/use-gct-form-value/use-gct-form-value.d.ts +1 -1
  85. package/es/hooks/use-gct-form-value/use-gct-form-value.mjs +0 -4
  86. package/es/hooks/use-modal/use-modal.mjs +0 -1
  87. package/es/hooks/use-overlay-scrollbars/use-overlay-scrollbars.d.ts +11 -0
  88. package/es/hooks/use-sub-app-utils/use-sub-app-utils.d.ts +31 -0
  89. package/es/hooks/use-sub-app-utils/use-sub-app-utils.mjs +30 -0
  90. package/es/hooks/useCopyToClipboard.mjs +0 -1
  91. package/es/index.d.ts +6 -8
  92. package/es/index.mjs +98 -64
  93. package/es/interface/controller/form-edit-item/form-edit-item.controller.d.ts +5 -0
  94. package/es/interface/controller/index.d.ts +0 -1
  95. package/es/interface/form/i-editor/i-editor-basic.d.ts +2 -2
  96. package/es/interface/form/i-editor/i-model-field-select-editor.d.ts +18 -0
  97. package/es/interface/form/i-form/i-form-collapse-pane.d.ts +4 -0
  98. package/es/interface/form/i-form/i-form-item-basic.d.ts +1 -1
  99. package/es/interface/form/i-form/i-form-tab-pane.d.ts +4 -0
  100. package/es/interface/form/index.d.ts +1 -0
  101. package/es/interface/i-app-context/i-app-context.d.ts +34 -0
  102. package/es/interface/i-field-code-chain/i-field-code-chain.d.ts +17 -0
  103. package/es/interface/i-global-var/i-global-var.d.ts +15 -0
  104. package/es/interface/i-mobile-home-menu-item/i-mobile-home-menu-item.d.ts +94 -0
  105. package/es/interface/i-pinia-action/i-global-actions.d.ts +8 -20
  106. package/es/interface/i-pinia-getter/i-global-getters.d.ts +1 -1
  107. package/es/interface/i-pinia-state/i-global-state.d.ts +7 -14
  108. package/es/interface/index.d.ts +5 -5
  109. package/es/interface/open-util/i-message-util/i-message-util.d.ts +54 -0
  110. package/es/interface/{i-modal → open-util/i-modal}/i-modal.d.ts +9 -10
  111. package/es/interface/{i-modal-data → open-util/i-modal-data}/i-modal-data.d.ts +6 -0
  112. package/es/interface/open-util/i-modal-options/i-modal-options.d.ts +12 -0
  113. package/es/interface/open-util/i-open-window-options/i-open-window-options.d.ts +59 -0
  114. package/es/interface/open-util/i-overlay-container/i-overlay-container.d.ts +36 -0
  115. package/es/interface/open-util/i-overlay-controller/i-overlay-controller.d.ts +36 -0
  116. package/es/interface/open-util/index.d.ts +7 -0
  117. package/es/interface/state/index.d.ts +0 -1
  118. package/es/locale/index.mjs +2 -2
  119. package/es/modules/env-manager/env-manager.const.mjs +0 -1
  120. package/es/modules/env-manager/env-manager.interface.mjs +0 -1
  121. package/es/modules/env-manager/env-manager.mjs +7 -8
  122. package/es/modules/error-handler/error-handler.const.mjs +1 -30
  123. package/es/modules/error-handler/error-strategy.mjs +0 -1
  124. package/es/modules/error-handler/index.mjs +0 -1
  125. package/es/modules/platform-config/constants/index.d.ts +7 -0
  126. package/es/modules/platform-config/constants/login.const.d.ts +15 -0
  127. package/es/modules/platform-config/constants/login.const.mjs +50 -0
  128. package/es/modules/platform-config/constants/org.const.d.ts +9 -0
  129. package/es/modules/platform-config/constants/org.const.mjs +54 -0
  130. package/es/modules/platform-config/constants/theme.const.d.ts +9 -0
  131. package/es/modules/platform-config/constants/theme.const.mjs +5 -0
  132. package/es/modules/platform-config/constants/watermark.const.d.ts +16 -0
  133. package/es/modules/platform-config/constants/watermark.const.mjs +14 -0
  134. package/es/modules/platform-config/enums/deploy.enum.d.ts +10 -0
  135. package/es/modules/platform-config/enums/deploy.enum.mjs +7 -0
  136. package/es/modules/platform-config/enums/index.d.ts +6 -0
  137. package/es/modules/platform-config/{constants.d.ts → enums/login.enum.d.ts} +3 -7
  138. package/es/modules/platform-config/enums/login.enum.mjs +16 -0
  139. package/es/modules/platform-config/enums/platform.enum.d.ts +27 -0
  140. package/es/modules/platform-config/enums/platform.enum.mjs +26 -0
  141. package/es/modules/platform-config/index.d.ts +6 -17
  142. package/es/modules/platform-config/interfaces/global-setting.interface.d.ts +7 -0
  143. package/es/modules/platform-config/interfaces/index.d.ts +7 -0
  144. package/es/modules/platform-config/interfaces/login-config.interface.d.ts +17 -0
  145. package/es/modules/platform-config/interfaces/platform-map.interface.d.ts +8 -0
  146. package/es/modules/platform-config/interfaces/theme-setting.interface.d.ts +30 -0
  147. package/es/modules/platform-config/store.d.ts +221 -0
  148. package/es/modules/platform-config/store.mjs +78 -0
  149. package/es/modules/platform-config/useBasicSetting.d.ts +6 -2
  150. package/es/modules/platform-config/useBasicSetting.mjs +39 -0
  151. package/es/modules/platform-config/useDeploySetting.d.ts +9 -4
  152. package/es/modules/platform-config/useDeploySetting.mjs +27 -0
  153. package/es/modules/platform-config/useLoginSetting.d.ts +4 -14
  154. package/es/modules/platform-config/useLoginSetting.mjs +177 -0
  155. package/es/modules/platform-config/useOrgSetting.d.ts +5 -1
  156. package/es/modules/platform-config/useOrgSetting.mjs +66 -0
  157. package/es/modules/platform-config/useProjectSetting.d.ts +12 -0
  158. package/es/modules/platform-config/useProjectSetting.mjs +11 -0
  159. package/es/modules/platform-config/useSecuritySetting.d.ts +5 -1
  160. package/es/modules/platform-config/useSecuritySetting.mjs +60 -0
  161. package/es/modules/platform-config/useThemeSetting.d.ts +6 -3
  162. package/es/modules/platform-config/useThemeSetting.mjs +64 -0
  163. package/es/modules/platform-config/useWatermarkSetting.d.ts +4 -1
  164. package/es/modules/platform-config/useWatermarkSetting.mjs +26 -0
  165. package/es/modules/user-stores/index.d.ts +3 -0
  166. package/es/modules/user-stores/store/permission.store.d.ts +21 -0
  167. package/es/modules/user-stores/store/permission.store.mjs +38 -0
  168. package/es/modules/user-stores/store/tenant.store.d.ts +9 -0
  169. package/es/modules/user-stores/store/tenant.store.mjs +24 -0
  170. package/es/modules/user-stores/store/user.store.d.ts +154 -0
  171. package/es/modules/user-stores/store/user.store.mjs +107 -0
  172. package/es/modules/user-stores/types/permission.d.ts +1 -0
  173. package/es/modules/user-stores/types/tenant.d.ts +1 -0
  174. package/es/modules/user-stores/types/user.d.ts +14 -0
  175. package/es/register/editor-register/editor-register.d.ts +5 -13
  176. package/es/register/editor-register/editor-register.mjs +8 -17
  177. package/es/register/form-item-register/form-item-register.d.ts +4 -15
  178. package/es/register/form-item-register/form-item-register.mjs +7 -17
  179. package/es/register/index.d.ts +12 -2
  180. package/es/router/index.mjs +0 -1
  181. package/es/setup-app.d.ts +8 -0
  182. package/es/setup-app.mjs +30 -0
  183. package/es/state/form/form.state.mjs +0 -1
  184. package/es/state/form-collapse/form-collapse.state.mjs +0 -1
  185. package/es/state/form-collapse-pane/form-collapse-pane.state.mjs +0 -1
  186. package/es/state/form-edit-item/form-edit-item.state.mjs +0 -1
  187. package/es/state/form-group/form-group.state.mjs +0 -1
  188. package/es/state/form-item/form-item.state.mjs +0 -1
  189. package/es/state/form-item-basic/form-item-basic.state.mjs +0 -1
  190. package/es/state/form-tab/form-tab.state.mjs +0 -1
  191. package/es/state/form-tab-pane/form-tab-pane.state.mjs +0 -1
  192. package/es/state/global-pinia-state/global-pinia-state.d.ts +8 -25
  193. package/es/state/global-pinia-state/global-pinia-state.mjs +30 -16
  194. package/es/store/global-store.d.ts +1 -0
  195. package/es/store/global-store.mjs +40 -37
  196. package/es/store/index.d.ts +2 -3
  197. package/es/store/index.mjs +0 -1
  198. package/es/types/index.d.ts +18 -1
  199. package/es/utils/axios/interceptors.mjs +2 -23
  200. package/es/utils/cache-adapter/cache-adapter.d.ts +2 -0
  201. package/es/utils/cache-adapter/cache-adapter.mjs +59 -0
  202. package/es/utils/deviceFingerprint.d.ts +17 -0
  203. package/es/utils/deviceFingerprint.mjs +73 -0
  204. package/es/utils/dictionary/dictionary.mjs +0 -1
  205. package/es/utils/i18n/index.d.ts +2 -1
  206. package/es/utils/i18n/index.mjs +3 -4
  207. package/es/utils/index.d.ts +17 -3
  208. package/es/utils/linked-list/linked-list.d.ts +72 -0
  209. package/es/utils/linked-list/linked-list.mjs +119 -0
  210. package/es/utils/linked-node/linked-node.d.ts +31 -0
  211. package/es/utils/linked-node/linked-node.mjs +32 -0
  212. package/es/utils/lowcode/utils.d.ts +1 -0
  213. package/es/utils/lowcode/utils.mjs +20 -0
  214. package/es/utils/lowcode/validate.d.ts +13 -0
  215. package/es/utils/lowcode/validate.mjs +29 -0
  216. package/es/utils/mitt/mitt.d.ts +1 -0
  217. package/es/utils/mitt/mitt.mjs +5 -0
  218. package/es/utils/model-loader/model-loader.d.ts +118 -0
  219. package/es/utils/model-loader/model-loader.mjs +326 -0
  220. package/es/utils/namespace/namespace.d.ts +8 -0
  221. package/es/utils/namespace/namespace.mjs +4 -2
  222. package/es/utils/openUtil/index.d.ts +2 -0
  223. package/es/utils/openUtil/modal/modal.d.ts +61 -0
  224. package/es/utils/openUtil/modal/modal.mjs +80 -0
  225. package/es/utils/openUtil/overlay-container/overlay-container.d.ts +100 -0
  226. package/es/utils/openUtil/overlay-container/overlay-container.mjs +139 -0
  227. package/es/utils/plugin-static-resource/plugin-static-resource.mjs +0 -1
  228. package/es/utils/props/gct-form-item/gct-form-item.props.d.ts +63 -0
  229. package/es/utils/props/gct-form-item/gct-form-item.props.mjs +66 -0
  230. package/es/utils/props/index.d.ts +1 -0
  231. package/es/utils/style/index.d.ts +16 -0
  232. package/es/utils/style/index.mjs +141 -0
  233. package/es/utils/tools/tools.d.ts +13 -10
  234. package/es/utils/tools/tools.mjs +23 -11
  235. package/es/utils/treeHelper/treeHelper.d.ts +124 -0
  236. package/es/utils/treeHelper/treeHelper.mjs +234 -0
  237. package/es/utils/util.d.ts +39 -0
  238. package/es/utils/util.mjs +40 -0
  239. package/es/utils/uuid/uuid.d.ts +3 -0
  240. package/es/utils/uuid/uuid.mjs +48 -0
  241. package/es/utils/value-helper/value-helper.d.ts +49 -0
  242. package/es/utils/value-helper/value-helper.mjs +111 -0
  243. package/es/utils/width-install/width-install.mjs +4 -2
  244. package/package.json +13 -16
  245. package/es/controller/index.mjs +0 -17
  246. package/es/enums/page-designer/index.mjs +0 -6
  247. package/es/global/index.mjs +0 -3
  248. package/es/hooks/index.mjs +0 -7
  249. package/es/hooks/use-namespace/use-namespace.d.ts +0 -9
  250. package/es/hooks/use-namespace/use-namespace.mjs +0 -9
  251. package/es/interface/controller/i-designer-controller.d.ts +0 -116
  252. package/es/interface/hooks/i-designer-hooks.d.ts +0 -26
  253. package/es/interface/hooks/index.d.ts +0 -1
  254. package/es/interface/i-message-util/i-message-util.d.ts +0 -78
  255. package/es/interface/index.mjs +0 -1
  256. package/es/interface/low-code-types/index.d.ts +0 -4
  257. package/es/interface/low-code-types/modal-types.d.ts +0 -67
  258. package/es/interface/low-code-types/model/index.d.ts +0 -5338
  259. package/es/interface/low-code-types/schema/index.d.ts +0 -12
  260. package/es/interface/low-code-types/widget-basic-types.d.ts +0 -667
  261. package/es/interface/state/i-designer-state.d.ts +0 -27
  262. package/es/modules/env-manager/index.mjs +0 -5
  263. package/es/modules/platform-config/index.mjs +0 -17
  264. package/es/modules/platform-config/types.d.ts +0 -67
  265. package/es/provider/i-designer-provider/i-designer-provider.d.ts +0 -102
  266. package/es/provider/index.d.ts +0 -1
  267. package/es/provider/index.mjs +0 -1
  268. package/es/register/designer-register/designer-register.d.ts +0 -53
  269. package/es/register/designer-register/designer-register.mjs +0 -68
  270. package/es/register/index.mjs +0 -6
  271. package/es/register/render-register/render-register.d.ts +0 -59
  272. package/es/register/render-register/render-register.mjs +0 -64
  273. package/es/state/index.mjs +0 -12
  274. package/es/utils/index.mjs +0 -10
  275. package/es/utils/plugin-pkg-util/plugin-pkg-util.d.ts +0 -96
  276. package/es/utils/plugin-pkg-util/plugin-pkg-util.mjs +0 -260
@@ -0,0 +1,141 @@
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;
114
+ };
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;
139
+ };
140
+
141
+ export { calcFontStyle, calcStyle };
@@ -1,3 +1,4 @@
1
+ import { default as qs } from 'qs';
1
2
  /**
2
3
  * 获取认证令牌
3
4
  *
@@ -26,16 +27,6 @@ export declare function getTenant(): string | null;
26
27
  * @param {string} tenant
27
28
  */
28
29
  export declare function setTenant(tenant: string): void;
29
- /**
30
- * 获取路径参数
31
- *
32
- * @export
33
- * @returns {*} {{ aid: string; pid: string }}
34
- */
35
- export declare function getPathQuery(): {
36
- aid: string;
37
- pid: string;
38
- };
39
30
  /**
40
31
  * 是否为移动端设备
41
32
  */
@@ -57,3 +48,15 @@ export declare function getTimezone(): string;
57
48
  * @returns {(T & U)} 合并后的对象
58
49
  */
59
50
  export declare function deepMerge<T extends object | null | undefined, U extends object | null | undefined>(target: T, source: U): T & U;
51
+ /**
52
+ * 对象 → 矩阵参数(stringify)
53
+ * @param {*} params
54
+ * @returns
55
+ */
56
+ export declare function stringifyMatrixParams(params: Record<string, string | number | null | undefined>): string;
57
+ /**
58
+ * 矩阵参数 → 对象(parse)
59
+ * @param {*} path
60
+ * @returns
61
+ */
62
+ export declare function parseMatrixParams(path: string): qs.ParsedQs;
@@ -1,11 +1,16 @@
1
1
  import { getCookie, setCookie, clearCookie } from 'qx-util';
2
2
  import { mergeWith, cloneDeep, unionWith, isEqual } from 'lodash-es';
3
- import '../../constants/index.mjs';
4
- import '../../enums/index.mjs';
3
+ import '../../constants/expression-type/modeCfg.mjs';
4
+ import '../../constants/expression-type/BuiltOperators.mjs';
5
+ import '../../constants/expression-type/function.mjs';
6
+ import '../../constants/expression-type/variable.mjs';
5
7
  import { CoreConst } from '../../constants/core.mjs';
8
+ import '../../enums/app-designer/index.mjs';
9
+ import '../../enums/page-designer/designer.mjs';
10
+ import '../../enums/breakpointEnum.mjs';
6
11
  import { TIMEZONE_KEY } from '../../enums/cacheEnum.mjs';
12
+ import qs from 'qs';
7
13
 
8
- "use strict";
9
14
  function getToken() {
10
15
  return getCookie(CoreConst.TOKEN);
11
16
  }
@@ -26,13 +31,6 @@ function setTenant(tenant) {
26
31
  clearCookie(CoreConst.TENANT, true);
27
32
  }
28
33
  }
29
- function getPathQuery() {
30
- const params = location.pathname.replace("/src/projects", "").split("/");
31
- return {
32
- aid: params[2],
33
- pid: params[3]
34
- };
35
- }
36
34
  const isMobile = (() => {
37
35
  const ua = navigator.userAgent;
38
36
  const mobileRegex = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/;
@@ -56,5 +54,19 @@ function deepMerge(target, source) {
56
54
  }
57
55
  });
58
56
  }
57
+ function stringifyMatrixParams(params) {
58
+ const str = qs.stringify(params, {
59
+ encode: true,
60
+ delimiter: ";"
61
+ });
62
+ return str ? `;${str}` : "";
63
+ }
64
+ function parseMatrixParams(path) {
65
+ const idx = path.indexOf(";");
66
+ if (idx === -1) return {};
67
+ return qs.parse(path, {
68
+ delimiter: ";"
69
+ });
70
+ }
59
71
 
60
- export { deepMerge, getPathQuery, getTenant, getTimezone, getToken, isMobile, setTenant, setToken };
72
+ export { deepMerge, getTenant, getTimezone, getToken, isMobile, parseMatrixParams, setTenant, setToken, stringifyMatrixParams };
@@ -0,0 +1,124 @@
1
+ /**
2
+ * 节点判断函数类型
3
+ */
4
+ type Fn<T> = (node: T, parent?: T) => boolean | unknown;
5
+ /**
6
+ * 树结构辅助配置接口
7
+ */
8
+ interface ITreeHelperConfig {
9
+ /** 节点 ID 字段名 */
10
+ id: string;
11
+ /** 子节点字段名 */
12
+ children: string;
13
+ /** 父节点 ID 字段名 */
14
+ pid: string;
15
+ /** 是否深度遍历 */
16
+ deep: boolean;
17
+ }
18
+ /**
19
+ * 带子节点的对象接口
20
+ */
21
+ interface IWithChildren<R> {
22
+ children?: R[];
23
+ }
24
+ /**
25
+ * 树结构数据处理工具类
26
+ * 提供树形数据与列表数据的相互转换、节点查找、路径查找等功能
27
+ */
28
+ export declare class TreeHelper {
29
+ /**
30
+ * 默认配置
31
+ */
32
+ private static readonly _DEFAULT_CONFIG;
33
+ /**
34
+ * 获取合并后的配置
35
+ * @param config 用户配置
36
+ * @returns 合并后的完整配置
37
+ */
38
+ private static _getConfig;
39
+ /**
40
+ * 将列表数据转换为树形结构
41
+ * @param list 列表数据
42
+ * @param config 配置项
43
+ * @param callBack 节点转换回调函数
44
+ * @returns 树形结构数据
45
+ */
46
+ static listToTree<T extends IObject = IObject, R = T>(list: T[], config: Partial<ITreeHelperConfig> | undefined, callBack: (node: T) => R): R[];
47
+ /**
48
+ * 将树形结构转换为列表数据
49
+ * @param tree 树形结构数据
50
+ * @param config 配置项
51
+ * @returns 列表数据
52
+ */
53
+ static treeToList<T extends IObject = IObject>(tree: T[], config?: Partial<ITreeHelperConfig>): T[];
54
+ /**
55
+ * 在树中查找单个节点
56
+ * @param tree 树形结构数据
57
+ * @param func 查找条件函数
58
+ * @param config 配置项
59
+ * @returns 找到的节点或 null
60
+ */
61
+ static findNode<T extends IObject = IObject>(tree: T[], func: Fn<T>, config?: Partial<ITreeHelperConfig>): T | null;
62
+ /**
63
+ * 在树中查找所有匹配的节点
64
+ * @param tree 树形结构数据
65
+ * @param func 查找条件函数
66
+ * @param config 配置项
67
+ * @returns 所有匹配的节点数组
68
+ */
69
+ static findNodeAll<T extends IObject = IObject>(tree: T[], func: Fn<T>, config?: Partial<ITreeHelperConfig>): T[];
70
+ /**
71
+ * 查找节点的路径
72
+ * @param tree 树形结构数据
73
+ * @param func 查找条件函数
74
+ * @param config 配置项
75
+ * @returns 从根节点到目标节点的路径数组,未找到返回 null
76
+ */
77
+ static findPath<T extends IObject = IObject>(tree: T[], func: Fn<T>, config?: Partial<ITreeHelperConfig>): T[] | null;
78
+ /**
79
+ * 查找最近的符合条件的父节点
80
+ * @param tree 树形结构数据
81
+ * @param startId 起始节点 ID
82
+ * @param func 查找条件函数
83
+ * @param config 配置项
84
+ * @returns 找到的父节点或 undefined
85
+ */
86
+ static findClosestParent<T extends IObject = IObject>(tree: T[], startId: string | number, func: Fn<T>, config?: Partial<ITreeHelperConfig>): T | undefined;
87
+ /**
88
+ * 将具有 id 和 parentId 的列表转换为树形结构
89
+ * @param list 列表数据,需要包含 id 和 parentId 字段
90
+ * @param callBack 节点转换回调函数
91
+ * @returns 树形结构数据
92
+ */
93
+ static list_to_tree<T extends {
94
+ id?: string;
95
+ parentId?: string;
96
+ }, R = T>(list: T[], callBack?: (n: T & IWithChildren<R>) => R): R[];
97
+ /**
98
+ * 获取所有父级路径
99
+ * @param treeData 树形结构数据
100
+ * @param path 目标路径
101
+ * @returns 从根节点到目标节点的所有路径数组
102
+ */
103
+ static getAllParentPath(treeData: object & {
104
+ path: string;
105
+ }[], path: string): string[];
106
+ /**
107
+ * 递归遍历树并且根据callback返回新数据再拼装成一个新树
108
+ *
109
+ * @static
110
+ * @param {IObject[]} treeData
111
+ * @param {Function} callback
112
+ * @param {Partial<ITreeHelperConfig>} [config={}]
113
+ * @return {*}
114
+ */
115
+ static traverseAndBuildTree(treeData: IObject[], callback: (node: IObject) => IObject | unknown, config?: Partial<ITreeHelperConfig>): IObject[];
116
+ /**
117
+ * 递归遍历树结构
118
+ * @param treeData 树形结构数据
119
+ * @param callBack 回调函数
120
+ * @param parentNode 父节点
121
+ */
122
+ static eachTree<T extends IObject = IObject>(treeData: T[], callBack: (node: T, parentNode?: T) => any, parentNode?: any): void;
123
+ }
124
+ export {};
@@ -0,0 +1,234 @@
1
+ class TreeHelper {
2
+ /**
3
+ * 默认配置
4
+ */
5
+ static _DEFAULT_CONFIG = {
6
+ id: "id",
7
+ children: "children",
8
+ pid: "pid",
9
+ deep: true
10
+ };
11
+ /**
12
+ * 获取合并后的配置
13
+ * @param config 用户配置
14
+ * @returns 合并后的完整配置
15
+ */
16
+ static _getConfig(config) {
17
+ return Object.assign({}, TreeHelper._DEFAULT_CONFIG, config);
18
+ }
19
+ /**
20
+ * 将列表数据转换为树形结构
21
+ * @param list 列表数据
22
+ * @param config 配置项
23
+ * @param callBack 节点转换回调函数
24
+ * @returns 树形结构数据
25
+ */
26
+ static listToTree(list, config = {}, callBack) {
27
+ const conf = TreeHelper._getConfig(config);
28
+ const nodeMap = /* @__PURE__ */ new Map();
29
+ const result = [];
30
+ const { id, children, pid, deep } = conf;
31
+ for (const node of list) {
32
+ const record = node;
33
+ if (!deep) {
34
+ record[children] = record[pid] === "ROOT" ? record[children] ?? [] : [];
35
+ } else {
36
+ record[children] = record[children] ?? void 0;
37
+ }
38
+ nodeMap.set(record[id], callBack(node));
39
+ }
40
+ for (const node of list) {
41
+ const record = node;
42
+ const parent = nodeMap.get(record[pid]);
43
+ if (parent) {
44
+ const parentRecord = parent;
45
+ if (!parentRecord[children]) {
46
+ parentRecord[children] = [];
47
+ }
48
+ parentRecord[children].push(callBack(node));
49
+ } else {
50
+ result.push(callBack(node));
51
+ }
52
+ }
53
+ return result;
54
+ }
55
+ /**
56
+ * 将树形结构转换为列表数据
57
+ * @param tree 树形结构数据
58
+ * @param config 配置项
59
+ * @returns 列表数据
60
+ */
61
+ static treeToList(tree, config = {}) {
62
+ const { children } = TreeHelper._getConfig(config);
63
+ const result = [...tree];
64
+ for (let i = 0; i < result.length; i++) {
65
+ const record = result[i];
66
+ const child = record[children];
67
+ if (!Array.isArray(child)) continue;
68
+ result.splice(i + 1, 0, ...child);
69
+ }
70
+ return result;
71
+ }
72
+ /**
73
+ * 在树中查找单个节点
74
+ * @param tree 树形结构数据
75
+ * @param func 查找条件函数
76
+ * @param config 配置项
77
+ * @returns 找到的节点或 null
78
+ */
79
+ static findNode(tree, func, config = {}) {
80
+ const { children } = TreeHelper._getConfig(config);
81
+ const list = tree ? [...tree] : [];
82
+ for (const node of list) {
83
+ if (func(node)) return node;
84
+ const record = node;
85
+ const child = record[children];
86
+ if (Array.isArray(child)) {
87
+ list.push(...child);
88
+ }
89
+ }
90
+ return null;
91
+ }
92
+ /**
93
+ * 在树中查找所有匹配的节点
94
+ * @param tree 树形结构数据
95
+ * @param func 查找条件函数
96
+ * @param config 配置项
97
+ * @returns 所有匹配的节点数组
98
+ */
99
+ static findNodeAll(tree, func, config = {}) {
100
+ const { children } = TreeHelper._getConfig(config);
101
+ const list = tree ? [...tree] : [];
102
+ const result = [];
103
+ for (const node of list) {
104
+ if (func(node)) result.push(node);
105
+ const record = node;
106
+ const child = record[children];
107
+ if (Array.isArray(child)) {
108
+ list.push(...child);
109
+ }
110
+ }
111
+ return result;
112
+ }
113
+ /**
114
+ * 查找节点的路径
115
+ * @param tree 树形结构数据
116
+ * @param func 查找条件函数
117
+ * @param config 配置项
118
+ * @returns 从根节点到目标节点的路径数组,未找到返回 null
119
+ */
120
+ static findPath(tree, func, config = {}) {
121
+ const { children } = TreeHelper._getConfig(config);
122
+ const path = [];
123
+ const list = tree ? [...tree] : [];
124
+ const visitedSet = /* @__PURE__ */ new Set();
125
+ while (list.length) {
126
+ const node = list[0];
127
+ if (visitedSet.has(node)) {
128
+ path.pop();
129
+ list.shift();
130
+ } else {
131
+ visitedSet.add(node);
132
+ const record = node;
133
+ const child = record[children];
134
+ if (Array.isArray(child)) {
135
+ list.unshift(...child);
136
+ }
137
+ path.push(node);
138
+ if (func(node)) return path;
139
+ }
140
+ }
141
+ return null;
142
+ }
143
+ /**
144
+ * 查找最近的符合条件的父节点
145
+ * @param tree 树形结构数据
146
+ * @param startId 起始节点 ID
147
+ * @param func 查找条件函数
148
+ * @param config 配置项
149
+ * @returns 找到的父节点或 undefined
150
+ */
151
+ static findClosestParent(tree, startId, func, config = {}) {
152
+ const { id } = TreeHelper._getConfig(config);
153
+ const path = TreeHelper.findPath(
154
+ tree,
155
+ (node) => node[id] === startId,
156
+ config
157
+ );
158
+ return path?.reverse().find((n) => func(n));
159
+ }
160
+ /**
161
+ * 将具有 id 和 parentId 的列表转换为树形结构
162
+ * @param list 列表数据,需要包含 id 和 parentId 字段
163
+ * @param callBack 节点转换回调函数
164
+ * @returns 树形结构数据
165
+ */
166
+ static list_to_tree(list, callBack = (n) => n) {
167
+ const map = {};
168
+ const roots = [];
169
+ for (let i = 0; i < list.length; i++) {
170
+ const node = list[i];
171
+ map[node.id] = i;
172
+ node.children = [];
173
+ }
174
+ for (const node of list) {
175
+ if (node.parentId === "ROOT" || !node.parentId) {
176
+ roots.push(callBack(node));
177
+ } else {
178
+ const current = node;
179
+ const parentIndex = map[node.parentId];
180
+ if (parentIndex !== void 0) {
181
+ const parent = list[parentIndex];
182
+ parent.children?.push(callBack(current));
183
+ }
184
+ }
185
+ }
186
+ return roots;
187
+ }
188
+ /**
189
+ * 获取所有父级路径
190
+ * @param treeData 树形结构数据
191
+ * @param path 目标路径
192
+ * @returns 从根节点到目标节点的所有路径数组
193
+ */
194
+ static getAllParentPath(treeData, path) {
195
+ const menuList = TreeHelper.findPath(treeData, (n) => n.path === path);
196
+ return (menuList || []).map((item) => item.path);
197
+ }
198
+ /**
199
+ * 递归遍历树并且根据callback返回新数据再拼装成一个新树
200
+ *
201
+ * @static
202
+ * @param {IObject[]} treeData
203
+ * @param {Function} callback
204
+ * @param {Partial<ITreeHelperConfig>} [config={}]
205
+ * @return {*}
206
+ */
207
+ static traverseAndBuildTree(treeData, callback, config = {}) {
208
+ config = this._getConfig(config);
209
+ const { children } = config;
210
+ return treeData.map((node) => {
211
+ const newNode = callback(node) || node;
212
+ if (children && node[children] && node[children].length > 0) {
213
+ newNode[children] = this.traverseAndBuildTree(node.children, callback);
214
+ }
215
+ return newNode;
216
+ });
217
+ }
218
+ /**
219
+ * 递归遍历树结构
220
+ * @param treeData 树形结构数据
221
+ * @param callBack 回调函数
222
+ * @param parentNode 父节点
223
+ */
224
+ static eachTree(treeData, callBack, parentNode = {}) {
225
+ treeData.forEach((element) => {
226
+ const newNode = callBack(element, parentNode) || element;
227
+ if (element.children) {
228
+ TreeHelper.eachTree(element.children, callBack, newNode);
229
+ }
230
+ });
231
+ }
232
+ }
233
+
234
+ export { TreeHelper };
@@ -0,0 +1,39 @@
1
+ import { IOpenWindowOptions } from '../interface';
2
+ /**
3
+ * 替换url中的参数,格式为xxx/{aid}/xxx/{pid}/{bid?}
4
+ *
5
+ * @export
6
+ * @param {string} url - 原始 URL 字符串
7
+ * @param {IObject} data - 用于替换占位符的数据对象
8
+ * @return {string} 处理后的 URL 字符串
9
+ */
10
+ export declare function genUrl(url: string, data: IObject): string;
11
+ /**
12
+ * 打开新窗口
13
+ *
14
+ * @export
15
+ * @param {string} url - 要打开的 URL
16
+ * @param {IOpenWindowOptions} [options] - 窗口配置选项
17
+ * @return {Window | null} 新打开的窗口对象,如果打开失败则返回 null
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * // 简单打开新窗口
22
+ * openWindow('https://example.com');
23
+ *
24
+ * // 使用 URL 参数替换
25
+ * openWindow('/user/{id}/profile', {
26
+ * genUrlData: { id: '123' }
27
+ * });
28
+ *
29
+ * // 完整配置
30
+ * openWindow('https://example.com', {
31
+ * target: '_blank',
32
+ * noopener: true,
33
+ * noreferrer: true,
34
+ * routePath: '/dashboard',
35
+ * optionStr: 'width=800,height=600'
36
+ * });
37
+ * ```
38
+ */
39
+ export declare function openWindow(url: string, options?: IOpenWindowOptions): Window | null;
@@ -0,0 +1,40 @@
1
+ function genUrl(url, data) {
2
+ let result = url;
3
+ Object.keys(data).forEach((key) => {
4
+ result = result.replace(`{${key}}`, data[key] ?? "");
5
+ result = result.replace(`{${key}?}`, data[key] ?? "");
6
+ });
7
+ result = result.replace(/\/\{[a-z]+\?\}/g, "");
8
+ return result;
9
+ }
10
+ function openWindow(url, options) {
11
+ const {
12
+ target = "_blank",
13
+ noopener = true,
14
+ noreferrer = true,
15
+ genUrlData,
16
+ routePath = "",
17
+ optionStr = ""
18
+ } = options || {};
19
+ const features = [];
20
+ if (noopener) {
21
+ features.push("noopener=yes");
22
+ }
23
+ if (noreferrer) {
24
+ features.push("noreferrer=yes");
25
+ }
26
+ let finalUrl = url;
27
+ if (genUrlData) {
28
+ finalUrl = genUrl(finalUrl, genUrlData);
29
+ }
30
+ if (routePath) {
31
+ finalUrl += routePath;
32
+ }
33
+ let featuresStr = features.join(",");
34
+ if (optionStr) {
35
+ featuresStr = featuresStr ? `${featuresStr},${optionStr}` : optionStr;
36
+ }
37
+ return window.open(finalUrl, target, featuresStr);
38
+ }
39
+
40
+ export { genUrl, openWindow };
@@ -0,0 +1,3 @@
1
+ export declare function buildUUID(): string;
2
+ export declare function buildShortUUID(prefix?: string): string;
3
+ export declare const uuid2: (len: number, radix?: number) => string;