@cloudbase/cals 1.1.14-alpha.1 → 1.2.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.
- package/lib/{parser → cjs/parser}/cals/index.d.ts +1 -1
- package/lib/cjs/parser/cals/index.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/get-component-namespace.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/merge-dataset.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/merge-listeners.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/merge-resources.d.ts.map +1 -0
- package/lib/{parser → cjs/parser}/cals/utils/block/helpers/remap-component-ids.d.ts +2 -2
- package/lib/cjs/parser/cals/utils/block/helpers/remap-component-ids.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/renew-id-in-code.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/renew-id-in-expr.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/renew-id-in-resource.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/helpers/resolve-new-id.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/block/index.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/code/index.d.ts.map +1 -0
- package/lib/{parser → cjs/parser}/cals/utils/common.d.ts +1 -1
- package/lib/cjs/parser/cals/utils/common.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/getUsedReference.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/getUsedResources.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/runtime.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/spinoff/index.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/style.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/template.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/version/common.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/version/config.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/version/index.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/version/parses.d.ts.map +1 -0
- package/lib/cjs/parser/cals/utils/version/utils.d.ts.map +1 -0
- package/lib/cjs/parser/dependiencies/index.d.ts.map +1 -0
- package/lib/cjs/parser/expression/index.d.ts.map +1 -0
- package/lib/cjs/parser/index.d.ts.map +1 -0
- package/lib/cjs/parser/plugins/postcss-rpx2clac.d.ts.map +1 -0
- package/lib/cjs/types/basic/app.d.ts.map +1 -0
- package/lib/cjs/types/basic/common.d.ts.map +1 -0
- package/lib/cjs/types/basic/component.d.ts.map +1 -0
- package/lib/cjs/types/basic/datasource.d.ts.map +1 -0
- package/lib/cjs/types/index.d.ts.map +1 -0
- package/lib/{types → cjs/types}/lcds.d.ts +4 -4
- package/lib/cjs/types/lcds.d.ts.map +1 -0
- package/lib/{types → cjs/types}/platform/app.d.ts +2 -2
- package/lib/cjs/types/platform/app.d.ts.map +1 -0
- package/lib/cjs/types/platform/common.d.ts.map +1 -0
- package/lib/{types → cjs/types}/platform/component.d.ts +1 -1
- package/lib/cjs/types/platform/component.d.ts.map +1 -0
- package/lib/{types → cjs/types}/platform/datasource.d.ts +4 -4
- package/lib/cjs/types/platform/datasource.d.ts.map +1 -0
- package/lib/cjs/types/platform/eventFlow.d.ts.map +1 -0
- package/lib/cjs/types/platform/query.d.ts.map +1 -0
- package/lib/{types → cjs/types}/platform/theme.d.ts +4 -4
- package/lib/cjs/types/platform/theme.d.ts.map +1 -0
- package/lib/cjs/utils/CSSProperty.d.ts.map +1 -0
- package/lib/cjs/utils/color-generator/core.d.ts.map +1 -0
- package/lib/cjs/utils/color-generator/generate.d.ts.map +1 -0
- package/lib/cjs/utils/color-generator/utils.d.ts.map +1 -0
- package/lib/cjs/utils/constant.d.ts.map +1 -0
- package/lib/cjs/utils/dts/auto-generated.d.ts.map +1 -0
- package/lib/{utils → cjs/utils}/dts/build.d.ts.map +1 -1
- package/lib/cjs/utils/dts/index.d.ts.map +1 -0
- package/lib/cjs/utils/index.d.ts.map +1 -0
- package/lib/cjs/utils/version/common.d.ts.map +1 -0
- package/lib/cjs/utils/version/featureChecker.d.ts.map +1 -0
- package/lib/cjs/utils/version/migrations/version4.d.ts.map +1 -0
- package/lib/esm/parser/cals/index.d.ts +625 -0
- package/lib/esm/parser/cals/index.d.ts.map +1 -0
- package/lib/esm/parser/cals/index.js +1548 -0
- package/lib/esm/parser/cals/utils/block/helpers/get-component-namespace.d.ts +2 -0
- package/lib/esm/parser/cals/utils/block/helpers/get-component-namespace.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/get-component-namespace.js +5 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-dataset.d.ts +6 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-dataset.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-dataset.js +13 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-listeners.d.ts +6 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-listeners.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-listeners.js +10 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-resources.d.ts +6 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-resources.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/merge-resources.js +25 -0
- package/lib/esm/parser/cals/utils/block/helpers/remap-component-ids.d.ts +30 -0
- package/lib/esm/parser/cals/utils/block/helpers/remap-component-ids.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/remap-component-ids.js +125 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-code.d.ts +7 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-code.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-code.js +9 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-expr.d.ts +8 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-expr.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-expr.js +56 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-resource.d.ts +15 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-resource.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/renew-id-in-resource.js +13 -0
- package/lib/esm/parser/cals/utils/block/helpers/resolve-new-id.d.ts +7 -0
- package/lib/esm/parser/cals/utils/block/helpers/resolve-new-id.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/helpers/resolve-new-id.js +17 -0
- package/lib/esm/parser/cals/utils/block/index.d.ts +67 -0
- package/lib/esm/parser/cals/utils/block/index.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/block/index.js +451 -0
- package/lib/esm/parser/cals/utils/code/index.d.ts +36 -0
- package/lib/esm/parser/cals/utils/code/index.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/code/index.js +401 -0
- package/lib/esm/parser/cals/utils/common.d.ts +35 -0
- package/lib/esm/parser/cals/utils/common.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/common.js +301 -0
- package/lib/esm/parser/cals/utils/getUsedReference.d.ts +8 -0
- package/lib/esm/parser/cals/utils/getUsedReference.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/getUsedReference.js +54 -0
- package/lib/esm/parser/cals/utils/getUsedResources.d.ts +10 -0
- package/lib/esm/parser/cals/utils/getUsedResources.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/getUsedResources.js +132 -0
- package/lib/esm/parser/cals/utils/runtime.d.ts +14 -0
- package/lib/esm/parser/cals/utils/runtime.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/runtime.js +254 -0
- package/lib/esm/parser/cals/utils/spinoff/index.d.ts +10 -0
- package/lib/esm/parser/cals/utils/spinoff/index.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/spinoff/index.js +95 -0
- package/lib/esm/parser/cals/utils/style.d.ts +43 -0
- package/lib/esm/parser/cals/utils/style.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/style.js +463 -0
- package/lib/esm/parser/cals/utils/template.d.ts +6 -0
- package/lib/esm/parser/cals/utils/template.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/template.js +221 -0
- package/lib/esm/parser/cals/utils/version/common.d.ts +5 -0
- package/lib/esm/parser/cals/utils/version/common.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/version/common.js +375 -0
- package/lib/esm/parser/cals/utils/version/config.d.ts +16 -0
- package/lib/esm/parser/cals/utils/version/config.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/version/config.js +241 -0
- package/lib/esm/parser/cals/utils/version/index.d.ts +3 -0
- package/lib/esm/parser/cals/utils/version/index.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/version/index.js +68 -0
- package/lib/esm/parser/cals/utils/version/parses.d.ts +16 -0
- package/lib/esm/parser/cals/utils/version/parses.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/version/parses.js +560 -0
- package/lib/esm/parser/cals/utils/version/utils.d.ts +14 -0
- package/lib/esm/parser/cals/utils/version/utils.d.ts.map +1 -0
- package/lib/esm/parser/cals/utils/version/utils.js +129 -0
- package/lib/esm/parser/dependiencies/index.d.ts +143 -0
- package/lib/esm/parser/dependiencies/index.d.ts.map +1 -0
- package/lib/esm/parser/dependiencies/index.js +684 -0
- package/lib/esm/parser/expression/index.d.ts +123 -0
- package/lib/esm/parser/expression/index.d.ts.map +1 -0
- package/lib/esm/parser/expression/index.js +296 -0
- package/lib/esm/parser/index.d.ts +13 -0
- package/lib/esm/parser/index.d.ts.map +1 -0
- package/lib/esm/parser/index.js +12 -0
- package/lib/esm/parser/plugins/postcss-rpx2clac.d.ts +18 -0
- package/lib/esm/parser/plugins/postcss-rpx2clac.d.ts.map +1 -0
- package/lib/esm/parser/plugins/postcss-rpx2clac.js +67 -0
- package/lib/esm/types/basic/app.d.ts +76 -0
- package/lib/esm/types/basic/app.d.ts.map +1 -0
- package/lib/esm/types/basic/app.js +1 -0
- package/lib/esm/types/basic/common.d.ts +125 -0
- package/lib/esm/types/basic/common.d.ts.map +1 -0
- package/lib/esm/types/basic/common.js +1 -0
- package/lib/esm/types/basic/component.d.ts +212 -0
- package/lib/esm/types/basic/component.d.ts.map +1 -0
- package/lib/esm/types/basic/component.js +1 -0
- package/lib/esm/types/basic/datasource.d.ts +50 -0
- package/lib/esm/types/basic/datasource.d.ts.map +1 -0
- package/lib/esm/types/basic/datasource.js +1 -0
- package/lib/esm/types/index.d.ts +12 -0
- package/lib/esm/types/index.d.ts.map +1 -0
- package/lib/esm/types/index.js +14 -0
- package/lib/esm/types/lcds.d.ts +610 -0
- package/lib/esm/types/lcds.d.ts.map +1 -0
- package/lib/esm/types/lcds.js +22 -0
- package/lib/esm/types/platform/app.d.ts +276 -0
- package/lib/esm/types/platform/app.d.ts.map +1 -0
- package/lib/esm/types/platform/app.js +8 -0
- package/lib/esm/types/platform/common.d.ts +190 -0
- package/lib/esm/types/platform/common.d.ts.map +1 -0
- package/lib/esm/types/platform/common.js +84 -0
- package/lib/esm/types/platform/component.d.ts +166 -0
- package/lib/esm/types/platform/component.d.ts.map +1 -0
- package/lib/esm/types/platform/component.js +8 -0
- package/lib/esm/types/platform/datasource.d.ts +500 -0
- package/lib/esm/types/platform/datasource.d.ts.map +1 -0
- package/lib/esm/types/platform/datasource.js +6 -0
- package/lib/esm/types/platform/eventFlow.d.ts +20 -0
- package/lib/esm/types/platform/eventFlow.d.ts.map +1 -0
- package/lib/esm/types/platform/eventFlow.js +1 -0
- package/lib/esm/types/platform/query.d.ts +78 -0
- package/lib/esm/types/platform/query.d.ts.map +1 -0
- package/lib/esm/types/platform/query.js +12 -0
- package/lib/esm/types/platform/theme.d.ts +47 -0
- package/lib/esm/types/platform/theme.d.ts.map +1 -0
- package/lib/esm/types/platform/theme.js +1 -0
- package/lib/esm/utils/CSSProperty.d.ts +64 -0
- package/lib/esm/utils/CSSProperty.d.ts.map +1 -0
- package/lib/esm/utils/CSSProperty.js +86 -0
- package/lib/esm/utils/color-generator/core.d.ts +52 -0
- package/lib/esm/utils/color-generator/core.d.ts.map +1 -0
- package/lib/esm/utils/color-generator/core.js +57 -0
- package/lib/esm/utils/color-generator/generate.d.ts +67 -0
- package/lib/esm/utils/color-generator/generate.d.ts.map +1 -0
- package/lib/esm/utils/color-generator/generate.js +92 -0
- package/lib/esm/utils/color-generator/utils.d.ts +15 -0
- package/lib/esm/utils/color-generator/utils.d.ts.map +1 -0
- package/lib/esm/utils/color-generator/utils.js +30 -0
- package/lib/esm/utils/constant.d.ts +65 -0
- package/lib/esm/utils/constant.d.ts.map +1 -0
- package/lib/esm/utils/constant.js +69 -0
- package/lib/esm/utils/dts/auto-generated.d.ts +2 -0
- package/lib/esm/utils/dts/auto-generated.d.ts.map +1 -0
- package/lib/esm/utils/dts/auto-generated.js +1796 -0
- package/lib/esm/utils/dts/build.d.ts +2 -0
- package/lib/esm/utils/dts/build.d.ts.map +1 -0
- package/lib/esm/utils/dts/build.js +147 -0
- package/lib/esm/utils/dts/index.d.ts +141 -0
- package/lib/esm/utils/dts/index.d.ts.map +1 -0
- package/lib/esm/utils/dts/index.js +1071 -0
- package/lib/esm/utils/index.d.ts +9 -0
- package/lib/esm/utils/index.d.ts.map +1 -0
- package/lib/esm/utils/index.js +8 -0
- package/lib/esm/utils/version/common.d.ts +3 -0
- package/lib/esm/utils/version/common.d.ts.map +1 -0
- package/lib/esm/utils/version/common.js +22 -0
- package/lib/esm/utils/version/featureChecker.d.ts +5 -0
- package/lib/esm/utils/version/featureChecker.d.ts.map +1 -0
- package/lib/esm/utils/version/featureChecker.js +32 -0
- package/lib/esm/utils/version/migrations/version4.d.ts +3 -0
- package/lib/esm/utils/version/migrations/version4.d.ts.map +1 -0
- package/lib/esm/utils/version/migrations/version4.js +192 -0
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/package.json +7 -5
- package/lib/parser/cals/index.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/get-component-namespace.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/merge-dataset.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/merge-listeners.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/merge-resources.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/remap-component-ids.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/renew-id-in-code.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/renew-id-in-expr.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/renew-id-in-resource.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/helpers/resolve-new-id.d.ts.map +0 -1
- package/lib/parser/cals/utils/block/index.d.ts.map +0 -1
- package/lib/parser/cals/utils/code/index.d.ts.map +0 -1
- package/lib/parser/cals/utils/common.d.ts.map +0 -1
- package/lib/parser/cals/utils/getUsedReference.d.ts.map +0 -1
- package/lib/parser/cals/utils/getUsedResources.d.ts.map +0 -1
- package/lib/parser/cals/utils/runtime.d.ts.map +0 -1
- package/lib/parser/cals/utils/spinoff/index.d.ts.map +0 -1
- package/lib/parser/cals/utils/style.d.ts.map +0 -1
- package/lib/parser/cals/utils/template.d.ts.map +0 -1
- package/lib/parser/cals/utils/version/common.d.ts.map +0 -1
- package/lib/parser/cals/utils/version/config.d.ts.map +0 -1
- package/lib/parser/cals/utils/version/index.d.ts.map +0 -1
- package/lib/parser/cals/utils/version/parses.d.ts.map +0 -1
- package/lib/parser/cals/utils/version/utils.d.ts.map +0 -1
- package/lib/parser/dependiencies/index.d.ts.map +0 -1
- package/lib/parser/expression/index.d.ts.map +0 -1
- package/lib/parser/index.d.ts.map +0 -1
- package/lib/parser/plugins/postcss-rpx2clac.d.ts.map +0 -1
- package/lib/types/basic/app.d.ts.map +0 -1
- package/lib/types/basic/common.d.ts.map +0 -1
- package/lib/types/basic/component.d.ts.map +0 -1
- package/lib/types/basic/datasource.d.ts.map +0 -1
- package/lib/types/index.d.ts.map +0 -1
- package/lib/types/lcds.d.ts.map +0 -1
- package/lib/types/platform/app.d.ts.map +0 -1
- package/lib/types/platform/common.d.ts.map +0 -1
- package/lib/types/platform/component.d.ts.map +0 -1
- package/lib/types/platform/datasource.d.ts.map +0 -1
- package/lib/types/platform/eventFlow.d.ts.map +0 -1
- package/lib/types/platform/query.d.ts.map +0 -1
- package/lib/types/platform/theme.d.ts.map +0 -1
- package/lib/utils/CSSProperty.d.ts.map +0 -1
- package/lib/utils/color-generator/core.d.ts.map +0 -1
- package/lib/utils/color-generator/generate.d.ts.map +0 -1
- package/lib/utils/color-generator/utils.d.ts.map +0 -1
- package/lib/utils/constant.d.ts.map +0 -1
- package/lib/utils/dts/auto-generated.d.ts.map +0 -1
- package/lib/utils/dts/index.d.ts.map +0 -1
- package/lib/utils/index.d.ts.map +0 -1
- package/lib/utils/version/common.d.ts.map +0 -1
- package/lib/utils/version/featureChecker.d.ts.map +0 -1
- package/lib/utils/version/migrations/version4.d.ts.map +0 -1
- /package/lib/{parser → cjs/parser}/cals/index.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/get-component-namespace.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/get-component-namespace.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/merge-dataset.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/merge-dataset.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/merge-listeners.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/merge-listeners.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/merge-resources.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/merge-resources.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/remap-component-ids.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/renew-id-in-code.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/renew-id-in-code.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/renew-id-in-expr.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/renew-id-in-expr.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/renew-id-in-resource.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/renew-id-in-resource.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/resolve-new-id.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/helpers/resolve-new-id.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/index.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/block/index.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/code/index.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/code/index.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/common.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/getUsedReference.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/getUsedReference.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/getUsedResources.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/getUsedResources.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/runtime.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/runtime.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/spinoff/index.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/spinoff/index.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/style.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/style.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/template.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/template.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/common.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/common.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/config.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/config.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/index.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/index.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/parses.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/parses.js +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/utils.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/cals/utils/version/utils.js +0 -0
- /package/lib/{parser → cjs/parser}/dependiencies/index.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/dependiencies/index.js +0 -0
- /package/lib/{parser → cjs/parser}/expression/index.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/expression/index.js +0 -0
- /package/lib/{parser → cjs/parser}/index.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/index.js +0 -0
- /package/lib/{parser → cjs/parser}/plugins/postcss-rpx2clac.d.ts +0 -0
- /package/lib/{parser → cjs/parser}/plugins/postcss-rpx2clac.js +0 -0
- /package/lib/{types → cjs/types}/basic/app.d.ts +0 -0
- /package/lib/{types → cjs/types}/basic/app.js +0 -0
- /package/lib/{types → cjs/types}/basic/common.d.ts +0 -0
- /package/lib/{types → cjs/types}/basic/common.js +0 -0
- /package/lib/{types → cjs/types}/basic/component.d.ts +0 -0
- /package/lib/{types → cjs/types}/basic/component.js +0 -0
- /package/lib/{types → cjs/types}/basic/datasource.d.ts +0 -0
- /package/lib/{types → cjs/types}/basic/datasource.js +0 -0
- /package/lib/{types → cjs/types}/index.d.ts +0 -0
- /package/lib/{types → cjs/types}/index.js +0 -0
- /package/lib/{types → cjs/types}/lcds.js +0 -0
- /package/lib/{types → cjs/types}/platform/app.js +0 -0
- /package/lib/{types → cjs/types}/platform/common.d.ts +0 -0
- /package/lib/{types → cjs/types}/platform/common.js +0 -0
- /package/lib/{types → cjs/types}/platform/component.js +0 -0
- /package/lib/{types → cjs/types}/platform/datasource.js +0 -0
- /package/lib/{types → cjs/types}/platform/eventFlow.d.ts +0 -0
- /package/lib/{types → cjs/types}/platform/eventFlow.js +0 -0
- /package/lib/{types → cjs/types}/platform/query.d.ts +0 -0
- /package/lib/{types → cjs/types}/platform/query.js +0 -0
- /package/lib/{types → cjs/types}/platform/theme.js +0 -0
- /package/lib/{utils → cjs/utils}/CSSProperty.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/CSSProperty.js +0 -0
- /package/lib/{utils → cjs/utils}/color-generator/core.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/color-generator/core.js +0 -0
- /package/lib/{utils → cjs/utils}/color-generator/generate.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/color-generator/generate.js +0 -0
- /package/lib/{utils → cjs/utils}/color-generator/utils.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/color-generator/utils.js +0 -0
- /package/lib/{utils → cjs/utils}/constant.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/constant.js +0 -0
- /package/lib/{utils → cjs/utils}/dts/auto-generated.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/dts/auto-generated.js +0 -0
- /package/lib/{utils → cjs/utils}/dts/build.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/dts/build.js +0 -0
- /package/lib/{utils → cjs/utils}/dts/index.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/dts/index.js +0 -0
- /package/lib/{utils → cjs/utils}/index.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/index.js +0 -0
- /package/lib/{utils → cjs/utils}/version/common.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/version/common.js +0 -0
- /package/lib/{utils → cjs/utils}/version/featureChecker.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/version/featureChecker.js +0 -0
- /package/lib/{utils → cjs/utils}/version/migrations/version4.d.ts +0 -0
- /package/lib/{utils → cjs/utils}/version/migrations/version4.js +0 -0
|
@@ -0,0 +1,560 @@
|
|
|
1
|
+
import { addDefaultData, addDefaultSlot, findComponentInTree, getComponentChildren, getId, checkIsNeedAddFormWrapper, } from './utils';
|
|
2
|
+
import get from 'lodash/get';
|
|
3
|
+
import set from 'lodash/set';
|
|
4
|
+
import merge from 'lodash/merge';
|
|
5
|
+
import { addFormItem } from './common';
|
|
6
|
+
import { OFFICIAL_COMPONENT_LIB_NAME } from '../../../../utils';
|
|
7
|
+
export function parseGsdKboneFooter(comp) {
|
|
8
|
+
const { xComponent, xProps } = comp;
|
|
9
|
+
if (xComponent.moduleName === 'gsd-kbone') {
|
|
10
|
+
xComponent.moduleName = OFFICIAL_COMPONENT_LIB_NAME;
|
|
11
|
+
xComponent.name = 'Footer';
|
|
12
|
+
const { data } = xProps;
|
|
13
|
+
const textValue = data.text.value;
|
|
14
|
+
comp.properties = {
|
|
15
|
+
text: {
|
|
16
|
+
properties: {
|
|
17
|
+
[getId()]: {
|
|
18
|
+
xComponent: {
|
|
19
|
+
moduleName: 'gsd-h5-react',
|
|
20
|
+
name: 'Text',
|
|
21
|
+
},
|
|
22
|
+
xProps: {
|
|
23
|
+
data: {
|
|
24
|
+
text: {
|
|
25
|
+
value: textValue,
|
|
26
|
+
},
|
|
27
|
+
decode: {
|
|
28
|
+
value: false,
|
|
29
|
+
},
|
|
30
|
+
selectable: {
|
|
31
|
+
value: false,
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
xIndex: 0,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
delete data.text;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export function parseGsdKboneButton(comp) {
|
|
44
|
+
const { xComponent, xProps } = comp;
|
|
45
|
+
if (xComponent.moduleName === 'gsd-kbone') {
|
|
46
|
+
xComponent.moduleName = OFFICIAL_COMPONENT_LIB_NAME;
|
|
47
|
+
xComponent.name = 'Button';
|
|
48
|
+
const targetData = {
|
|
49
|
+
size: {
|
|
50
|
+
type: 'static',
|
|
51
|
+
value: 'default',
|
|
52
|
+
},
|
|
53
|
+
type: {
|
|
54
|
+
type: 'static',
|
|
55
|
+
value: 'primary',
|
|
56
|
+
},
|
|
57
|
+
plain: {
|
|
58
|
+
type: 'static',
|
|
59
|
+
value: false,
|
|
60
|
+
},
|
|
61
|
+
loading: {
|
|
62
|
+
type: 'static',
|
|
63
|
+
value: false,
|
|
64
|
+
},
|
|
65
|
+
disabled: {
|
|
66
|
+
type: 'static',
|
|
67
|
+
value: false,
|
|
68
|
+
},
|
|
69
|
+
formType: {
|
|
70
|
+
type: 'static',
|
|
71
|
+
value: '',
|
|
72
|
+
},
|
|
73
|
+
openType: {
|
|
74
|
+
type: 'static',
|
|
75
|
+
value: '',
|
|
76
|
+
},
|
|
77
|
+
categoryId: {
|
|
78
|
+
type: 'static',
|
|
79
|
+
value: [],
|
|
80
|
+
},
|
|
81
|
+
sessionFrom: {
|
|
82
|
+
type: 'static',
|
|
83
|
+
value: '',
|
|
84
|
+
},
|
|
85
|
+
appParameter: {
|
|
86
|
+
type: 'static',
|
|
87
|
+
value: '',
|
|
88
|
+
},
|
|
89
|
+
sendMessageImg: {
|
|
90
|
+
type: 'static',
|
|
91
|
+
value: '',
|
|
92
|
+
},
|
|
93
|
+
sendMessagePath: {
|
|
94
|
+
type: 'static',
|
|
95
|
+
value: '',
|
|
96
|
+
},
|
|
97
|
+
showMessageCard: {
|
|
98
|
+
type: 'static',
|
|
99
|
+
value: false,
|
|
100
|
+
},
|
|
101
|
+
sendMessageTitle: {
|
|
102
|
+
type: 'static',
|
|
103
|
+
value: '',
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
const { data } = xProps;
|
|
107
|
+
const { text = {} } = data;
|
|
108
|
+
// 转换 data
|
|
109
|
+
for (const i in targetData) {
|
|
110
|
+
for (const j in targetData[i]) {
|
|
111
|
+
if (data[i] && data[i][j]) {
|
|
112
|
+
targetData[i][j] = data[i][j];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
xProps.data = targetData;
|
|
117
|
+
// 转换内容
|
|
118
|
+
if (text.type === 'slot') {
|
|
119
|
+
comp.properties = {
|
|
120
|
+
contentSlot: {
|
|
121
|
+
properties: comp.properties.text.properties,
|
|
122
|
+
},
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
comp.properties = {
|
|
127
|
+
contentSlot: {
|
|
128
|
+
properties: {
|
|
129
|
+
[getId()]: {
|
|
130
|
+
xComponent: {
|
|
131
|
+
moduleName: 'gsd-h5-react',
|
|
132
|
+
name: 'Text',
|
|
133
|
+
},
|
|
134
|
+
xProps: {
|
|
135
|
+
data: {
|
|
136
|
+
decode: {
|
|
137
|
+
value: false,
|
|
138
|
+
},
|
|
139
|
+
selectable: {
|
|
140
|
+
value: false,
|
|
141
|
+
},
|
|
142
|
+
text: text,
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
xIndex: 0,
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
export function parseGsdKbonePopLayer(comp) {
|
|
154
|
+
// 特殊处理,因为组件名字大小写改了
|
|
155
|
+
comp.xComponent.name = 'Poplayer';
|
|
156
|
+
const slotKeys = ['content', 'footer'];
|
|
157
|
+
addDefaultSlot(slotKeys, comp);
|
|
158
|
+
const defaultData = {
|
|
159
|
+
visible: {
|
|
160
|
+
value: true,
|
|
161
|
+
},
|
|
162
|
+
content: {
|
|
163
|
+
value: '内容',
|
|
164
|
+
type: 'slot',
|
|
165
|
+
},
|
|
166
|
+
footer: {
|
|
167
|
+
value: '',
|
|
168
|
+
type: 'slot',
|
|
169
|
+
},
|
|
170
|
+
direction: {
|
|
171
|
+
value: 'bottom',
|
|
172
|
+
},
|
|
173
|
+
popWidth: {
|
|
174
|
+
value: '100%',
|
|
175
|
+
},
|
|
176
|
+
popHeight: {
|
|
177
|
+
value: '120',
|
|
178
|
+
},
|
|
179
|
+
};
|
|
180
|
+
addDefaultData(defaultData, comp);
|
|
181
|
+
}
|
|
182
|
+
export function parseGsdKboneAgree(comp, key, parent) {
|
|
183
|
+
addFormItem(comp, key, parent, true);
|
|
184
|
+
const slotKeys = ['content'];
|
|
185
|
+
addDefaultSlot(slotKeys, comp);
|
|
186
|
+
const defaultData = {
|
|
187
|
+
name: {
|
|
188
|
+
value: 'thisIsAgreeKey',
|
|
189
|
+
},
|
|
190
|
+
value: {
|
|
191
|
+
value: false,
|
|
192
|
+
},
|
|
193
|
+
checkedIcon: {
|
|
194
|
+
value: 'https://weapps-prod-1301730524.cos.ap-guangzhou.myqcloud.com/res/2/square.svg',
|
|
195
|
+
},
|
|
196
|
+
uncheckedIcon: {
|
|
197
|
+
value: 'https://weapps-prod-1301730524.cos.ap-guangzhou.myqcloud.com/res/2/square_un.svg',
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
addDefaultData(defaultData, comp);
|
|
201
|
+
if (comp.properties && comp.properties.custom) {
|
|
202
|
+
comp.properties.content = comp.properties.custom;
|
|
203
|
+
delete comp.properties.custom;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
export function parseGsdKboneSwiper(comp) {
|
|
207
|
+
const defaultData = {
|
|
208
|
+
indicatorDots: {
|
|
209
|
+
value: false,
|
|
210
|
+
},
|
|
211
|
+
autoplay: {
|
|
212
|
+
value: true,
|
|
213
|
+
},
|
|
214
|
+
current: {
|
|
215
|
+
value: 0,
|
|
216
|
+
},
|
|
217
|
+
interval: {
|
|
218
|
+
value: 2000,
|
|
219
|
+
},
|
|
220
|
+
duration: {
|
|
221
|
+
value: 500,
|
|
222
|
+
},
|
|
223
|
+
circular: {
|
|
224
|
+
value: false,
|
|
225
|
+
},
|
|
226
|
+
vertical: {
|
|
227
|
+
value: false,
|
|
228
|
+
},
|
|
229
|
+
previousMargin: {
|
|
230
|
+
value: 0,
|
|
231
|
+
},
|
|
232
|
+
nextMargin: {
|
|
233
|
+
value: 0,
|
|
234
|
+
},
|
|
235
|
+
displayMultipleItems: {
|
|
236
|
+
value: 1,
|
|
237
|
+
},
|
|
238
|
+
updated: {
|
|
239
|
+
value: 0,
|
|
240
|
+
},
|
|
241
|
+
indicatorColor: {
|
|
242
|
+
value: '',
|
|
243
|
+
},
|
|
244
|
+
indicatorActiveColor: {
|
|
245
|
+
value: '',
|
|
246
|
+
},
|
|
247
|
+
};
|
|
248
|
+
addDefaultData(defaultData, comp);
|
|
249
|
+
getComponentChildren(comp).map(([subKey, subComp]) => {
|
|
250
|
+
const { xComponent } = subComp;
|
|
251
|
+
if (xComponent.name === 'Container') {
|
|
252
|
+
xComponent.moduleName = 'gsd-h5-react';
|
|
253
|
+
xComponent.name = 'SwiperItem';
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
const newSwiperItemId = getId();
|
|
257
|
+
const newSubComp = JSON.parse(JSON.stringify(subComp).replace(new RegExp(`forItems\\.${subKey}`, 'g'), `forItems.${newSwiperItemId}`));
|
|
258
|
+
const waFor = get(newSubComp, 'xProps.directives.waFor');
|
|
259
|
+
try {
|
|
260
|
+
delete newSubComp.xProps.directives.waFor;
|
|
261
|
+
delete comp.properties[subKey];
|
|
262
|
+
}
|
|
263
|
+
catch (e) {
|
|
264
|
+
console.error('parseGsdKboneSwiper 删除 waFor 出错', e);
|
|
265
|
+
}
|
|
266
|
+
comp.properties[newSwiperItemId] = {
|
|
267
|
+
xComponent: {
|
|
268
|
+
moduleName: 'gsd-h5-react',
|
|
269
|
+
name: 'SwiperItem',
|
|
270
|
+
},
|
|
271
|
+
// @ts-ignore
|
|
272
|
+
xProps: {
|
|
273
|
+
commonStyle: {
|
|
274
|
+
self: {
|
|
275
|
+
width: '100%',
|
|
276
|
+
height: '100%',
|
|
277
|
+
position: 'absolute',
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
directives: {
|
|
281
|
+
waFor,
|
|
282
|
+
},
|
|
283
|
+
},
|
|
284
|
+
properties: {
|
|
285
|
+
[subKey]: newSubComp,
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
export function parseGsdKboneRichText(comp) {
|
|
292
|
+
const { xProps } = comp;
|
|
293
|
+
if (xProps.data) {
|
|
294
|
+
xProps.data.nodes = xProps.data.nodes || xProps.data.content;
|
|
295
|
+
delete xProps.data.content;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
export function parseGsdKboneText(comp) {
|
|
299
|
+
// @ts-ignore
|
|
300
|
+
comp.xProps = comp.xProps || {};
|
|
301
|
+
comp.xProps.commonStyle = comp.xProps.commonStyle || {};
|
|
302
|
+
// v1 版本 text 为 block
|
|
303
|
+
comp.xProps.commonStyle = merge({
|
|
304
|
+
display: 'block',
|
|
305
|
+
self: {
|
|
306
|
+
display: 'block',
|
|
307
|
+
},
|
|
308
|
+
}, comp.xProps.commonStyle);
|
|
309
|
+
}
|
|
310
|
+
export function parseGsdKboneInput(comp, key, parent) {
|
|
311
|
+
addFormItem(comp, key, parent);
|
|
312
|
+
const slotKeys = ['prefix', 'suffix'];
|
|
313
|
+
addDefaultSlot(slotKeys, comp);
|
|
314
|
+
const defaultData = {
|
|
315
|
+
name: {
|
|
316
|
+
value: 'uniqueFormKey',
|
|
317
|
+
},
|
|
318
|
+
placeholder: {
|
|
319
|
+
value: '请输入',
|
|
320
|
+
},
|
|
321
|
+
disabled: {
|
|
322
|
+
value: false,
|
|
323
|
+
},
|
|
324
|
+
focus: {
|
|
325
|
+
value: false,
|
|
326
|
+
},
|
|
327
|
+
password: {
|
|
328
|
+
value: false,
|
|
329
|
+
},
|
|
330
|
+
type: {
|
|
331
|
+
value: 'text',
|
|
332
|
+
},
|
|
333
|
+
maxLength: {
|
|
334
|
+
value: 140,
|
|
335
|
+
},
|
|
336
|
+
clearable: {
|
|
337
|
+
value: true,
|
|
338
|
+
},
|
|
339
|
+
value: {
|
|
340
|
+
value: '',
|
|
341
|
+
},
|
|
342
|
+
confirmType: {
|
|
343
|
+
value: 'done',
|
|
344
|
+
},
|
|
345
|
+
prefix: {
|
|
346
|
+
value: '',
|
|
347
|
+
type: 'slot',
|
|
348
|
+
},
|
|
349
|
+
suffix: {
|
|
350
|
+
value: '',
|
|
351
|
+
type: 'slot',
|
|
352
|
+
},
|
|
353
|
+
};
|
|
354
|
+
addDefaultData(defaultData, comp);
|
|
355
|
+
const append = get(comp, 'properties.append');
|
|
356
|
+
if (append) {
|
|
357
|
+
set(comp, 'properties.suffix', append);
|
|
358
|
+
set(comp, 'xProps.data.isSuffix.value', true);
|
|
359
|
+
delete comp.properties.append;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
export function parseGsdKboneSwitch(comp, key, parent) {
|
|
363
|
+
addFormItem(comp, key, parent, true);
|
|
364
|
+
const defaultValue = get(comp, 'xProps.data.defaultValue');
|
|
365
|
+
defaultValue && set(comp, 'xProps.data.value', defaultValue);
|
|
366
|
+
const originStyle = get(comp, 'xProps.commonStyle.margin');
|
|
367
|
+
set(comp, 'xProps.commonStyle.margin', Object.assign(Object.assign({}, originStyle), { top: '30', right: '40', bottom: '30', left: '40' }));
|
|
368
|
+
}
|
|
369
|
+
export function parseGsdKbonePicker(comp, key, parent) {
|
|
370
|
+
addFormItem(comp, key, parent);
|
|
371
|
+
comp.xComponent.name = 'Selector';
|
|
372
|
+
}
|
|
373
|
+
export function parseGsdKboneDateTimePicker(comp, key, parent) {
|
|
374
|
+
addFormItem(comp, key, parent);
|
|
375
|
+
const modeValue = get(comp, 'xProps.data.mode.value');
|
|
376
|
+
if (modeValue === 'date') {
|
|
377
|
+
comp.xComponent.name = 'Date';
|
|
378
|
+
}
|
|
379
|
+
else {
|
|
380
|
+
comp.xComponent.name = 'Time';
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
export function parseGsdKboneUpload(comp, key, parent) {
|
|
384
|
+
addFormItem(comp, key, parent);
|
|
385
|
+
comp.xComponent.name = 'Uploader';
|
|
386
|
+
const defaultData = {
|
|
387
|
+
name: {
|
|
388
|
+
value: 'thisIsUploadKey',
|
|
389
|
+
},
|
|
390
|
+
value: {
|
|
391
|
+
value: [],
|
|
392
|
+
},
|
|
393
|
+
maxNumber: {
|
|
394
|
+
value: 9,
|
|
395
|
+
},
|
|
396
|
+
type: {
|
|
397
|
+
value: 'media',
|
|
398
|
+
},
|
|
399
|
+
mediaType: {
|
|
400
|
+
value: ['image'],
|
|
401
|
+
},
|
|
402
|
+
sourceType: {
|
|
403
|
+
value: ['album', 'camera'],
|
|
404
|
+
},
|
|
405
|
+
maxSize: {
|
|
406
|
+
value: 500,
|
|
407
|
+
},
|
|
408
|
+
filename: {
|
|
409
|
+
value: 'file',
|
|
410
|
+
},
|
|
411
|
+
header: {
|
|
412
|
+
value: {},
|
|
413
|
+
},
|
|
414
|
+
formData: {
|
|
415
|
+
value: {},
|
|
416
|
+
},
|
|
417
|
+
disabled: {
|
|
418
|
+
value: false,
|
|
419
|
+
},
|
|
420
|
+
action: {
|
|
421
|
+
value: '',
|
|
422
|
+
},
|
|
423
|
+
extension: {
|
|
424
|
+
value: '',
|
|
425
|
+
},
|
|
426
|
+
};
|
|
427
|
+
addDefaultData(defaultData, comp);
|
|
428
|
+
}
|
|
429
|
+
export function addFormWrapperComp(pageInstance) {
|
|
430
|
+
const { componentInstances } = pageInstance;
|
|
431
|
+
const cloneTree = {
|
|
432
|
+
properties: componentInstances,
|
|
433
|
+
};
|
|
434
|
+
if (checkIsNeedAddFormWrapper(cloneTree)) {
|
|
435
|
+
let listeners = [];
|
|
436
|
+
// 获取 Button 按钮事件,赋值到 Form 并删除按钮事件监听
|
|
437
|
+
findComponentInTree(cloneTree, (_comp) => {
|
|
438
|
+
let comp = _comp;
|
|
439
|
+
const { xComponent, xProps } = comp;
|
|
440
|
+
if (xComponent && xComponent.name === 'Button') {
|
|
441
|
+
const target = get(xProps, 'listeners[0]');
|
|
442
|
+
if (target && target.trigger && target.trigger === 'click') {
|
|
443
|
+
listeners = xProps.listeners;
|
|
444
|
+
set(xProps, 'data.formType', {
|
|
445
|
+
value: 'submit',
|
|
446
|
+
});
|
|
447
|
+
target.trigger = 'submit';
|
|
448
|
+
delete xProps.listeners;
|
|
449
|
+
return true;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
// @ts-ignore
|
|
454
|
+
pageInstance.componentInstances = {
|
|
455
|
+
[getId()]: {
|
|
456
|
+
xComponent: {
|
|
457
|
+
moduleName: 'gsd-h5-react',
|
|
458
|
+
name: 'Form',
|
|
459
|
+
},
|
|
460
|
+
xProps: {
|
|
461
|
+
data: {
|
|
462
|
+
layout: {
|
|
463
|
+
value: 'horizontal',
|
|
464
|
+
},
|
|
465
|
+
},
|
|
466
|
+
listeners,
|
|
467
|
+
},
|
|
468
|
+
xIndex: 1,
|
|
469
|
+
properties: {
|
|
470
|
+
contentSlot: {
|
|
471
|
+
properties: componentInstances,
|
|
472
|
+
},
|
|
473
|
+
},
|
|
474
|
+
},
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
export function parseGsdKboneTabs(comp) {
|
|
479
|
+
const { xProps, properties } = comp;
|
|
480
|
+
// 有内容说明之前已经转过了,不需要再次转
|
|
481
|
+
if (properties === null || properties === void 0 ? void 0 : properties.content) {
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
if (xProps.listeners) {
|
|
485
|
+
xProps.listeners = xProps.listeners.map((lItem) => {
|
|
486
|
+
// tab change 事件名由 handleTabChange 改为 change
|
|
487
|
+
if (lItem.trigger === 'handleTabChange') {
|
|
488
|
+
lItem.trigger = 'change';
|
|
489
|
+
}
|
|
490
|
+
return lItem;
|
|
491
|
+
});
|
|
492
|
+
}
|
|
493
|
+
let tabItems; // [{key, title, content}]
|
|
494
|
+
if (xProps.data) {
|
|
495
|
+
tabItems = get(xProps.data, 'TabItems.value', []);
|
|
496
|
+
// 只保留 activeKey
|
|
497
|
+
Object.keys(xProps.data).forEach((key) => {
|
|
498
|
+
if (key !== 'activeKey')
|
|
499
|
+
delete xProps.data[key];
|
|
500
|
+
});
|
|
501
|
+
}
|
|
502
|
+
if (properties) {
|
|
503
|
+
const newProperties = {};
|
|
504
|
+
Object.values(properties).forEach((pItem, idx) => {
|
|
505
|
+
const tabItem = tabItems[idx];
|
|
506
|
+
if (tabItem) {
|
|
507
|
+
newProperties[getId()] = {
|
|
508
|
+
xComponent: {
|
|
509
|
+
moduleName: OFFICIAL_COMPONENT_LIB_NAME,
|
|
510
|
+
name: 'TabPane',
|
|
511
|
+
},
|
|
512
|
+
xProps: {
|
|
513
|
+
data: {
|
|
514
|
+
key: {
|
|
515
|
+
value: tabItem.key,
|
|
516
|
+
},
|
|
517
|
+
tab: {
|
|
518
|
+
value: tabItem.title,
|
|
519
|
+
},
|
|
520
|
+
},
|
|
521
|
+
},
|
|
522
|
+
xIndex: idx,
|
|
523
|
+
properties: {
|
|
524
|
+
content: pItem,
|
|
525
|
+
},
|
|
526
|
+
};
|
|
527
|
+
}
|
|
528
|
+
});
|
|
529
|
+
comp.properties = {
|
|
530
|
+
content: {
|
|
531
|
+
properties: newProperties,
|
|
532
|
+
},
|
|
533
|
+
};
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
// 处理组件公共部分
|
|
537
|
+
export function parseComplexComponentInstance(instance) {
|
|
538
|
+
const { data, lowCodes = [], componentInstances = {} } = instance;
|
|
539
|
+
const styleLowCode = lowCodes.find((item) => item.name == 'style');
|
|
540
|
+
// 默认样式加.
|
|
541
|
+
if ((styleLowCode === null || styleLowCode === void 0 ? void 0 : styleLowCode.code) && (styleLowCode === null || styleLowCode === void 0 ? void 0 : styleLowCode.code.match(/^&/m)) === null) {
|
|
542
|
+
// 没有添加过的才进行添加
|
|
543
|
+
styleLowCode.code = `&{
|
|
544
|
+
${styleLowCode.code}
|
|
545
|
+
}`;
|
|
546
|
+
}
|
|
547
|
+
const keys = Object.keys(componentInstances);
|
|
548
|
+
if (keys.length > 1) {
|
|
549
|
+
instance.componentInstances = {
|
|
550
|
+
[getId()]: {
|
|
551
|
+
xComponent: {
|
|
552
|
+
moduleName: 'gsd-h5-react',
|
|
553
|
+
name: 'Container',
|
|
554
|
+
},
|
|
555
|
+
xIndex: 0,
|
|
556
|
+
properties: componentInstances,
|
|
557
|
+
},
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function init(json: any): void;
|
|
2
|
+
export declare function getId(): string;
|
|
3
|
+
export declare function isComplexComponent(name?: string): string;
|
|
4
|
+
export declare function isGsdH5ReactComponent(name?: string): string;
|
|
5
|
+
export declare function addDefaultSlot(slotKey: string[], comp: any): void;
|
|
6
|
+
export declare function addDefaultData(defaultData: any, comp: any): void;
|
|
7
|
+
export declare function isComplexJSON(json: any): any;
|
|
8
|
+
export declare function getComponentChildren(component: any): [string, unknown][];
|
|
9
|
+
export declare function isWeAppId(key?: string): RegExpMatchArray;
|
|
10
|
+
export declare function isEmptyObject(obj?: {}): boolean;
|
|
11
|
+
export declare function isPlainObject(src: any): boolean;
|
|
12
|
+
export declare function checkIsNeedAddFormWrapper(tree: any): boolean;
|
|
13
|
+
export declare function findComponentInTree(tree: any, cb: (cmp: any, path: string) => any, path?: string): any;
|
|
14
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/cals/utils/version/utils.ts"],"names":[],"mappings":"AAKA,wBAAgB,IAAI,CAAC,IAAI,EAAE,GAAG,QA2B7B;AAED,wBAAgB,KAAK,WAEpB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,SAAK,UAQ3C;AAED,wBAAgB,qBAAqB,CAAC,IAAI,SAAK,UAQ9C;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAO,EAAE,IAAI,EAAE,GAAG,QAO/D;AAED,wBAAgB,cAAc,CAAC,WAAW,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,QAKzD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,GAAG,OAItC;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,GAAG,uBASlD;AAED,wBAAgB,SAAS,CAAC,GAAG,SAAK,oBAEjC;AAED,wBAAgB,aAAa,CAAC,GAAG,KAAK,WAErC;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,WAErC;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,GAAG,WAkBlD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,GAAG,EAAE,IAAI,SAAK,GAAG,GAAG,CAmBlG"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { COMPLEX_COMPONENT_KEYS, FORM_COMPONENT_KEYS, GSD_H5_REACT_COMPONENT_KEYS } from './config';
|
|
2
|
+
import merge from 'lodash/merge';
|
|
3
|
+
const ids = [];
|
|
4
|
+
let maxId = 10000;
|
|
5
|
+
export function init(json) {
|
|
6
|
+
const { pageInstanceList = [] } = json;
|
|
7
|
+
const comps = [];
|
|
8
|
+
pageInstanceList.forEach((instance, index) => {
|
|
9
|
+
const { componentInstances } = instance;
|
|
10
|
+
for (const i in componentInstances) {
|
|
11
|
+
ids.push(i);
|
|
12
|
+
const comp = componentInstances[i];
|
|
13
|
+
comps.push(comp);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
while (true) {
|
|
17
|
+
const topComp = comps.pop();
|
|
18
|
+
if (!topComp) {
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
const keys = Object.keys(topComp['properties'] || {});
|
|
22
|
+
if (keys.length > 0) {
|
|
23
|
+
keys.forEach((key) => {
|
|
24
|
+
ids.push(key);
|
|
25
|
+
const _comp = topComp['properties'][key];
|
|
26
|
+
comps.push(_comp);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const idNums = ids.map((id) => parseInt(id.replace('id', ''))).filter((item) => !isNaN(item));
|
|
31
|
+
maxId = Math.max(...idNums);
|
|
32
|
+
}
|
|
33
|
+
export function getId() {
|
|
34
|
+
return `id${++maxId}`;
|
|
35
|
+
}
|
|
36
|
+
export function isComplexComponent(name = '') {
|
|
37
|
+
const bigoName = COMPLEX_COMPONENT_KEYS.map((item) => {
|
|
38
|
+
return {
|
|
39
|
+
key: item.toLocaleLowerCase(),
|
|
40
|
+
compName: item,
|
|
41
|
+
};
|
|
42
|
+
}).find((item) => item.key === name.toLocaleLowerCase());
|
|
43
|
+
return bigoName === null || bigoName === void 0 ? void 0 : bigoName.compName;
|
|
44
|
+
}
|
|
45
|
+
export function isGsdH5ReactComponent(name = '') {
|
|
46
|
+
const bigoName = GSD_H5_REACT_COMPONENT_KEYS.map((item) => {
|
|
47
|
+
return {
|
|
48
|
+
key: item.toLocaleLowerCase(),
|
|
49
|
+
compName: item,
|
|
50
|
+
};
|
|
51
|
+
}).find((item) => item.key === name.toLocaleLowerCase());
|
|
52
|
+
return bigoName === null || bigoName === void 0 ? void 0 : bigoName.compName;
|
|
53
|
+
}
|
|
54
|
+
export function addDefaultSlot(slotKey = [], comp) {
|
|
55
|
+
comp.properties = comp.properties || {};
|
|
56
|
+
slotKey.map((key) => {
|
|
57
|
+
comp.properties[key] = comp.properties[key] || {
|
|
58
|
+
properties: {},
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
export function addDefaultData(defaultData, comp) {
|
|
63
|
+
// @ts-ignore
|
|
64
|
+
comp.xProps = comp.xProps || {};
|
|
65
|
+
comp.xProps.data = comp.xProps.data || {};
|
|
66
|
+
comp.xProps.data = merge(defaultData, comp.xProps.data);
|
|
67
|
+
}
|
|
68
|
+
export function isComplexJSON(json) {
|
|
69
|
+
// FIX: pure render 组件无法通过该方法判断
|
|
70
|
+
// 在 v2 导出时会有 isComposite 的标识字段可识别
|
|
71
|
+
return json.isComposite || Object.keys((json === null || json === void 0 ? void 0 : json.dataForm) || {}).length > 0;
|
|
72
|
+
}
|
|
73
|
+
export function getComponentChildren(component) {
|
|
74
|
+
if (!component) {
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
const { properties } = component;
|
|
78
|
+
if (!properties) {
|
|
79
|
+
return [];
|
|
80
|
+
}
|
|
81
|
+
return Object.entries(properties).sort((a, b) => (a['x-index'] || 0) - (b['x-index'] || 0));
|
|
82
|
+
}
|
|
83
|
+
export function isWeAppId(key = '') {
|
|
84
|
+
return key.match(/^id\d+$/);
|
|
85
|
+
}
|
|
86
|
+
export function isEmptyObject(obj = {}) {
|
|
87
|
+
return Object.keys(obj).length === 0;
|
|
88
|
+
}
|
|
89
|
+
export function isPlainObject(src) {
|
|
90
|
+
return Object.prototype.toString.call(src) === '[object Object]';
|
|
91
|
+
}
|
|
92
|
+
export function checkIsNeedAddFormWrapper(tree) {
|
|
93
|
+
let isNeedAddFormWrapper = false;
|
|
94
|
+
findComponentInTree(tree, (comp) => {
|
|
95
|
+
const { xComponent } = comp;
|
|
96
|
+
if (xComponent && xComponent.name) {
|
|
97
|
+
const lowerCaseName = xComponent.name.toLocaleLowerCase();
|
|
98
|
+
// 存在 Form 组件时,不需要加最外层 Form
|
|
99
|
+
if (lowerCaseName === 'form') {
|
|
100
|
+
isNeedAddFormWrapper = false;
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
// 当存在 Input 类型组件,而没有 Form 组件时,需要加最外层 Form
|
|
104
|
+
isNeedAddFormWrapper = FORM_COMPONENT_KEYS.some((key) => key.toLocaleLowerCase() === lowerCaseName);
|
|
105
|
+
return isNeedAddFormWrapper;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return isNeedAddFormWrapper;
|
|
109
|
+
}
|
|
110
|
+
export function findComponentInTree(tree, cb, path = '') {
|
|
111
|
+
// tree.path = path
|
|
112
|
+
const stop = cb(tree, path);
|
|
113
|
+
if (stop) {
|
|
114
|
+
return tree;
|
|
115
|
+
}
|
|
116
|
+
const { properties } = tree;
|
|
117
|
+
if (!properties) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
// eslint-disable-next-line guard-for-in
|
|
121
|
+
for (const id in properties) {
|
|
122
|
+
const node = properties[id];
|
|
123
|
+
const compPath = path ? `${path}.${id}` : id;
|
|
124
|
+
const found = findComponentInTree(node, cb, compPath);
|
|
125
|
+
if (found) {
|
|
126
|
+
return found;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|