@cloudbase/cals 1.1.14 → 1.2.1
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/{parser → cjs/parser}/cals/index.js +2 -1
- 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/{parser → cjs/parser}/cals/utils/block/index.d.ts +2 -2
- 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/{parser → cjs/parser}/cals/utils/template.js +2 -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/{types → cjs/types}/index.d.ts +1 -1
- package/lib/cjs/types/index.d.ts.map +1 -0
- package/lib/{types → cjs/types}/index.js +2 -13
- package/lib/cjs/types/lcds.d.ts +612 -0
- package/lib/cjs/types/lcds.d.ts.map +1 -0
- package/lib/cjs/types/lcds.js +34 -0
- package/lib/{types → cjs/types}/platform/app.d.ts +4 -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 +5 -5
- 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 +2 -0
- package/lib/cjs/utils/dts/auto-generated.d.ts.map +1 -0
- package/lib/{utils → cjs/utils}/dts/auto-generated.js +113 -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 +1549 -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 +223 -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 +612 -0
- package/lib/esm/types/lcds.d.ts.map +1 -0
- package/lib/esm/types/lcds.js +31 -0
- package/lib/esm/types/platform/app.d.ts +278 -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 +1909 -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/schema/lcds_component.json +1 -1
- package/lib/schema/platform_application.json +1 -1
- package/lib/schema/platform_template.json +1 -1
- 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 +0 -610
- package/lib/types/lcds.d.ts.map +0 -1
- package/lib/types/lcds.js +0 -25
- 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 +0 -2
- 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/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.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/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}/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/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,223 @@
|
|
|
1
|
+
import template from 'lodash/template';
|
|
2
|
+
import { ECodeType } from '../../../types';
|
|
3
|
+
const TEMPLATES = {
|
|
4
|
+
/* ========== 低代码简化类型代码 ========== */
|
|
5
|
+
// 应用生命周期
|
|
6
|
+
appLifeCycle: `/**
|
|
7
|
+
* 可通过 app 获取或修改全局应用的 变量 状态 等信息
|
|
8
|
+
* 具体可以console.info 在编辑器Console面板查看更多信息
|
|
9
|
+
* 如果需要 async-await,请在方法前 async
|
|
10
|
+
* 生命周期文档请参考:https://cloud.tencent.com/document/product/1301/71504
|
|
11
|
+
**/
|
|
12
|
+
export default {
|
|
13
|
+
onAppLaunch(launchOpts) {
|
|
14
|
+
//console.log('---------> LifeCycle onAppLaunch', launchOpts)
|
|
15
|
+
},
|
|
16
|
+
onAppShow(appShowOpts) {
|
|
17
|
+
//console.log('---------> LifeCycle onAppShow', appShowOpts)
|
|
18
|
+
},
|
|
19
|
+
onAppHide() {
|
|
20
|
+
//console.log('---------> LifeCycle onAppHide')
|
|
21
|
+
},
|
|
22
|
+
onAppError(options) {
|
|
23
|
+
//console.log('---------> LifeCycle onAppError', options)
|
|
24
|
+
},
|
|
25
|
+
onAppPageNotFound(options) {
|
|
26
|
+
//console.log('---------> LifeCycle onAppPageNotFound', options)
|
|
27
|
+
},
|
|
28
|
+
onAppUnhandledRejection(options) {
|
|
29
|
+
//console.log('---------> LifeCycle onAppUnhandledRejection', options)
|
|
30
|
+
}
|
|
31
|
+
}`,
|
|
32
|
+
// 页面生命周期
|
|
33
|
+
pageLifeCycle: `/*
|
|
34
|
+
* 可通过 $page 获取或修改当前页面的 变量 状态 handler lifecycle 等信息
|
|
35
|
+
* 可通过 app 获取或修改全局应用的 变量 状态 等信息
|
|
36
|
+
* 具体可以 console.info 在编辑器Console面板查看更多信息
|
|
37
|
+
* 如果需要 async-await,请在方法前 async
|
|
38
|
+
* 生命周期文档请参考:https://cloud.tencent.com/document/product/1301/71504
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
export default {
|
|
42
|
+
onPageLoad(query) {
|
|
43
|
+
//console.log('---------> LifeCycle onPageLoad', query)
|
|
44
|
+
},
|
|
45
|
+
onPageShow() {
|
|
46
|
+
//console.log('---------> LifeCycle onPageShow')
|
|
47
|
+
},
|
|
48
|
+
onPageReady() {
|
|
49
|
+
//console.log('---------> LifeCycle onPageReady')
|
|
50
|
+
},
|
|
51
|
+
onPageHide() {
|
|
52
|
+
//console.log('---------> LifeCycle onPageHide')
|
|
53
|
+
},
|
|
54
|
+
onPageUnload() {
|
|
55
|
+
//console.log('---------> LifeCycle onPageUnload')
|
|
56
|
+
},
|
|
57
|
+
}`,
|
|
58
|
+
// 组件生命周期
|
|
59
|
+
compLifeCycle: `export default {
|
|
60
|
+
onAttached() {
|
|
61
|
+
//console.log('---------> LifeCycle onAttached')
|
|
62
|
+
},
|
|
63
|
+
onDetached() {
|
|
64
|
+
//console.log('---------> LifeCycle onDetached')
|
|
65
|
+
},
|
|
66
|
+
}`,
|
|
67
|
+
// 以下为用户可增加的代码类型,所以需要与代码类型一一对应
|
|
68
|
+
// 状态
|
|
69
|
+
[ECodeType.STATE]: `/*
|
|
70
|
+
* <% if (type === 'app') { %>可通过 app.state.xxx 访问这里定义的状态<% } %><% if (type === 'page') { %>可通过 $page.state.xxx 访问这里定义的状态<% } %><% if (type === 'component') { %>可通过 $comp.state.xxx 访问这里定义的状态<% } %>
|
|
71
|
+
* <% if (type === 'page') { %>注意:页面级别的状态仅在所属的页面有效<% } %>
|
|
72
|
+
* 修改状态时,直接赋值即可。如:<% if (type === 'app') { %>$app.state.xxx = 'xxx'<% } %><% if (type === 'page') { %>$page.state.xxx = 'xxx'<% } %><% if (type === 'component') { %>$comp.state.xxx = 'xxx'<% } %>
|
|
73
|
+
* 请注意:避免在页面处于后台状态时state,页面在后台时对全局state的修改会丢失!
|
|
74
|
+
*/
|
|
75
|
+
|
|
76
|
+
<% if (type !== 'component') { %>
|
|
77
|
+
export default {
|
|
78
|
+
name: 'LowCode'
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/* 在这里定义页面变量。
|
|
82
|
+
* 页面变量区别于 state 的是:页面变量不会作响应处理,不可被绑定
|
|
83
|
+
* <% if (type === 'page') { %>在 handler 中使用的例子:import { data } from '../state'<% } %>
|
|
84
|
+
* <% if (type === 'app') { %>在 common 中使用的例子:import { data } from '../state'<% } %>
|
|
85
|
+
*/
|
|
86
|
+
export const data = {
|
|
87
|
+
|
|
88
|
+
}
|
|
89
|
+
<% } %>
|
|
90
|
+
<% if (type === 'component') { %>
|
|
91
|
+
export default function() {
|
|
92
|
+
return {
|
|
93
|
+
name: 'LowCode'
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
<% } %>
|
|
97
|
+
`,
|
|
98
|
+
// 计算属性
|
|
99
|
+
[ECodeType.COMPUTEDN]: `
|
|
100
|
+
/*
|
|
101
|
+
* <% if (type === 'app') { %>可通过 app.computed.xxx 访问这里定义的计算状态<% } %><% if (type === 'page') { %>可通过 $page.computed.xxx 访问这里定义的计算状态<% } %><% if (type === 'component') { %>可通过 $comp.computed.xxx 访问这里定义的计算状态<% } %>
|
|
102
|
+
* <% if (type === 'page') { %>注意:页面级别的计算状态仅在所属的页面有效<% } %>
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
export default {
|
|
106
|
+
name() { return 'LowCode' }
|
|
107
|
+
}`,
|
|
108
|
+
// 处理方法-有上下文的方法,相当于小程序的methods,可获取 state,computed 等信息
|
|
109
|
+
[ECodeType.HANDLER_FN]: `/**
|
|
110
|
+
* <% if (type === 'component') { %>可通过 $comp.handler.xxx 访问这里定义的方法<% } %>
|
|
111
|
+
* <% if (type === 'page') { %>可通过 $page 获取或修改当前页面的 变量 状态 handler lifecycle 等信息<% } %>
|
|
112
|
+
* <% if (type === 'page') { %>可通过 app 获取或修改全局应用的 变量 状态 等信息<% } %>
|
|
113
|
+
* <% if (type === 'page') { %>具体可以console.info 在编辑器Console面板查看更多信息<% } %>
|
|
114
|
+
* <% if (type === 'page') { %>注意:该方法仅在所属的页面有效<% } %>
|
|
115
|
+
* 如果需要 async-await,请修改成 export default async function() {}
|
|
116
|
+
* 帮助文档 https://cloud.tencent.com/document/product/1301/57912
|
|
117
|
+
**/
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @param {Object} event - 事件对象
|
|
121
|
+
* @param {string} event.type - 事件名
|
|
122
|
+
* @param {any} event.detail - 事件携带自定义数据
|
|
123
|
+
*
|
|
124
|
+
* @param {Object} data
|
|
125
|
+
* @param {any} data.target - 获取事件传参的数据
|
|
126
|
+
**/
|
|
127
|
+
export default function({event, data}) {
|
|
128
|
+
|
|
129
|
+
}`,
|
|
130
|
+
// 普通模块-没有上下文,无法直接获取 state 信息
|
|
131
|
+
[ECodeType.NORMAL_MODULE]: `
|
|
132
|
+
/*
|
|
133
|
+
* 函数里面访问:通过 app.common.[name] 访问这里定义的方法或值
|
|
134
|
+
* 函数外面访问:通过 import(如在页面的 handler 引用的例子:import sayHi from '../../common/[name]')
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
export default function sayHi() {
|
|
138
|
+
console.log('Hi LowCode')
|
|
139
|
+
}
|
|
140
|
+
`,
|
|
141
|
+
// 样式
|
|
142
|
+
[ECodeType.STYLE]: `
|
|
143
|
+
<% if (type !== 'component') { %>
|
|
144
|
+
/**
|
|
145
|
+
* 可以使用theme中定义的 mixin 和 定义变量
|
|
146
|
+
**/
|
|
147
|
+
<% } else {%>
|
|
148
|
+
/**
|
|
149
|
+
* 使用less书写样式
|
|
150
|
+
* */
|
|
151
|
+
<% } %>
|
|
152
|
+
<%= type === 'component' ? '&':'' %>.<%= type === 'component' ? type: id%>-class-name {
|
|
153
|
+
<% if (type === 'app') { %>// 使用样式变量<% } %>
|
|
154
|
+
// 使用theme中的变量
|
|
155
|
+
// color: <% if (type === 'app' || type === 'page') { %>@example-primary-color<% } %><% if (type === 'component') { %>blue<% } %>;
|
|
156
|
+
|
|
157
|
+
// <%= version[0] === '4' ? '默认 rpx 会转换成 动态cals实现,px/PX/Px 均代表传统一样上的px':'默认 px 会转换成 rem,含大写字母 PX 和 Px 则不会转换' %>
|
|
158
|
+
// margin-top: 20px;
|
|
159
|
+
// 使用theme中的混合(mixins)
|
|
160
|
+
// <%= type === 'component' ? '':'.mixins();' %>
|
|
161
|
+
// 可写嵌套样式
|
|
162
|
+
.<%= type === 'component' ? type: id%>-nest-class {
|
|
163
|
+
// color: #fff;
|
|
164
|
+
// 使用theme中的混合(mixins)
|
|
165
|
+
// <%= type === 'component' ? '':'.mixins(green);' %>
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
`,
|
|
169
|
+
[ECodeType.THEME]: `@example-primary-color: blue;`,
|
|
170
|
+
[ECodeType.MPCONFIG]: `export default {
|
|
171
|
+
appJson: {
|
|
172
|
+
// 小程序接口权限相关设置,可选
|
|
173
|
+
/* permission: {
|
|
174
|
+
'scope.userLocation': {
|
|
175
|
+
desc: '你的位置信息将用于小程序位置接口的效果展示',
|
|
176
|
+
},
|
|
177
|
+
}, */
|
|
178
|
+
},
|
|
179
|
+
}
|
|
180
|
+
`,
|
|
181
|
+
[ECodeType.RENDERER]: `/**
|
|
182
|
+
* 可通过 $page 获取或修改当前页面的 变量 状态 handler lifecycle 等信息
|
|
183
|
+
* 可通过 app 获取或修改全局应用的 变量 状态 等信息
|
|
184
|
+
* 具体可以console.info 在编辑器Console面板查看更多信息
|
|
185
|
+
* 注意:该方法仅在所属的页面有效
|
|
186
|
+
**/
|
|
187
|
+
|
|
188
|
+
import * as React from 'react';
|
|
189
|
+
import * as ReactDOM from 'react-dom';
|
|
190
|
+
|
|
191
|
+
export default function(props) {
|
|
192
|
+
return <div>自定义渲染</div>
|
|
193
|
+
}`,
|
|
194
|
+
};
|
|
195
|
+
export function generateDefaultCode(ctx, type, scope) {
|
|
196
|
+
const { id, version = '' } = ctx;
|
|
197
|
+
const data = {
|
|
198
|
+
type: scope,
|
|
199
|
+
id,
|
|
200
|
+
version,
|
|
201
|
+
};
|
|
202
|
+
switch (type) {
|
|
203
|
+
case ECodeType.LIFECYCLE: {
|
|
204
|
+
let tpl = '';
|
|
205
|
+
switch (scope) {
|
|
206
|
+
case 'component':
|
|
207
|
+
tpl = TEMPLATES.compLifeCycle;
|
|
208
|
+
break;
|
|
209
|
+
case 'page':
|
|
210
|
+
tpl = TEMPLATES.pageLifeCycle;
|
|
211
|
+
break;
|
|
212
|
+
case 'app':
|
|
213
|
+
tpl = TEMPLATES.appLifeCycle;
|
|
214
|
+
break;
|
|
215
|
+
}
|
|
216
|
+
return template(tpl)(data);
|
|
217
|
+
}
|
|
218
|
+
default: {
|
|
219
|
+
const tpl = TEMPLATES[type] || 'epxort default {}';
|
|
220
|
+
return template(tpl)(data);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function beforeCommonParse(comp: any): void;
|
|
2
|
+
export declare function afterCommonParse(comp: any): void;
|
|
3
|
+
export declare function addFormItem(comp: any, key: any, parent: any, isOnlySlot?: boolean): void;
|
|
4
|
+
export declare function renameRepeatId(json: any): void;
|
|
5
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/cals/utils/version/common.ts"],"names":[],"mappings":"AAiBA,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,GAAG,QAE1C;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,GAAG,QAYzC;AA2LD,wBAAgB,WAAW,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,UAAU,UAAQ,QAiJ/E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,QAsCvC"}
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { isComplexComponent, getId, isPlainObject, isEmptyObject, isWeAppId, getComponentChildren, isGsdH5ReactComponent, } from './utils';
|
|
2
|
+
import get from 'lodash/get';
|
|
3
|
+
import set from 'lodash/set';
|
|
4
|
+
import cloneDeep from 'lodash/cloneDeep';
|
|
5
|
+
import merge from 'lodash/merge';
|
|
6
|
+
import { deepParse } from './index';
|
|
7
|
+
import { isEmptyObj } from '../common';
|
|
8
|
+
import { OFFICIAL_COMPONENT_LIB_NAME, OFFICIAL_LIB_KEY } from '../../../../utils';
|
|
9
|
+
export function beforeCommonParse(comp) {
|
|
10
|
+
addDefaultXIndex(comp);
|
|
11
|
+
}
|
|
12
|
+
export function afterCommonParse(comp) {
|
|
13
|
+
translateClassList(comp);
|
|
14
|
+
translateStyleBinding(comp);
|
|
15
|
+
translateComponentModuleName(comp);
|
|
16
|
+
translateListeners(comp);
|
|
17
|
+
translateStyleToCommonStyle(comp);
|
|
18
|
+
translateSlot(comp);
|
|
19
|
+
}
|
|
20
|
+
// 复合组件 slot 属性配置迁移,从 xProps.data.content.value 里取
|
|
21
|
+
function translateSlot(comp) {
|
|
22
|
+
if (comp['xComponent'].name === 'Slot' && comp['xProps'].data.content) {
|
|
23
|
+
comp['xProps'].data.name = {
|
|
24
|
+
value: comp['xProps'].data.content.value,
|
|
25
|
+
};
|
|
26
|
+
delete comp['xProps'].data.content;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function translateListeners(comp) {
|
|
30
|
+
const { xProps } = comp;
|
|
31
|
+
// 处理click 转 tap
|
|
32
|
+
if (xProps === null || xProps === void 0 ? void 0 : xProps.listeners) {
|
|
33
|
+
const { listeners = [] } = xProps;
|
|
34
|
+
listeners.forEach((listenerItem) => {
|
|
35
|
+
const { handler } = listenerItem;
|
|
36
|
+
if (listenerItem.trigger === 'click' || listenerItem.trigger === '__weapps_action_trigger_click') {
|
|
37
|
+
listenerItem.trigger = 'tap';
|
|
38
|
+
}
|
|
39
|
+
if (handler.moduleName === 'gsd-kbone') {
|
|
40
|
+
handler.moduleName = OFFICIAL_LIB_KEY;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function translateComponentModuleName(comp) {
|
|
46
|
+
const { xComponent } = comp;
|
|
47
|
+
if (xComponent) {
|
|
48
|
+
const { name } = xComponent;
|
|
49
|
+
const complexName = isComplexComponent(name);
|
|
50
|
+
const gsdH5ReactName = isGsdH5ReactComponent(name);
|
|
51
|
+
if (complexName) {
|
|
52
|
+
xComponent.moduleName = OFFICIAL_COMPONENT_LIB_NAME;
|
|
53
|
+
xComponent.name = complexName;
|
|
54
|
+
}
|
|
55
|
+
else if (gsdH5ReactName) {
|
|
56
|
+
xComponent.moduleName = OFFICIAL_LIB_KEY;
|
|
57
|
+
xComponent.name = gsdH5ReactName;
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
xComponent.moduleName = OFFICIAL_COMPONENT_LIB_NAME;
|
|
61
|
+
}
|
|
62
|
+
switch (name) {
|
|
63
|
+
case 'Wx-map':
|
|
64
|
+
xComponent.name = 'Map';
|
|
65
|
+
break;
|
|
66
|
+
case 'Telephone':
|
|
67
|
+
xComponent.name = 'telephone';
|
|
68
|
+
default:
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
if (xComponent.moduleName === OFFICIAL_COMPONENT_LIB_NAME) {
|
|
72
|
+
switch (xComponent.name) {
|
|
73
|
+
case 'Cell': {
|
|
74
|
+
xComponent.name = 'Item';
|
|
75
|
+
let xprops = comp.xProps;
|
|
76
|
+
if (xprops === null || xprops === void 0 ? void 0 : xprops.data) {
|
|
77
|
+
xprops.data.value = {
|
|
78
|
+
value: '',
|
|
79
|
+
};
|
|
80
|
+
xprops.data.detail = {
|
|
81
|
+
value: false,
|
|
82
|
+
};
|
|
83
|
+
xprops.data.description = {
|
|
84
|
+
value: '',
|
|
85
|
+
};
|
|
86
|
+
if (xprops.data.label) {
|
|
87
|
+
xprops.data.title = xprops.data.label;
|
|
88
|
+
delete xprops.data.label;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
case 'NavBar': {
|
|
94
|
+
let xprops = comp.xProps;
|
|
95
|
+
if (xprops === null || xprops === void 0 ? void 0 : xprops.data) {
|
|
96
|
+
if (xprops.data.text) {
|
|
97
|
+
xprops.data.title = xprops.data.text;
|
|
98
|
+
delete xprops.data.text;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
case 'TabBar':
|
|
104
|
+
case 'Tabbar': {
|
|
105
|
+
xComponent.name = 'TabBar';
|
|
106
|
+
let xprops = comp.xProps;
|
|
107
|
+
if (xprops === null || xprops === void 0 ? void 0 : xprops.data) {
|
|
108
|
+
if (xprops.data.itemList) {
|
|
109
|
+
let dynamicValue = xprops.data.itemList;
|
|
110
|
+
if (dynamicValue.type === 'static' || !dynamicValue.type) {
|
|
111
|
+
xprops.data.tabs = {
|
|
112
|
+
value: (dynamicValue.value || []).map((item) => {
|
|
113
|
+
return Object.assign({ name: item.value }, item);
|
|
114
|
+
}),
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
xprops.data.tabs = xprops.data.itemList;
|
|
119
|
+
}
|
|
120
|
+
delete xprops.data.itemList;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function translateClassList(comp) {
|
|
130
|
+
const { xProps } = comp;
|
|
131
|
+
if (!xProps) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
if (xProps['classNameList']) {
|
|
135
|
+
// @ts-ignore
|
|
136
|
+
xProps['classList'] = xProps['classList'] || xProps.classNameList;
|
|
137
|
+
// @ts-ignore
|
|
138
|
+
delete xProps.classNameList;
|
|
139
|
+
}
|
|
140
|
+
if (xProps['classNameListBind']) {
|
|
141
|
+
// @ts-ignore
|
|
142
|
+
xProps['classListBind'] = xProps['classListBind'] || xProps.classNameListBind;
|
|
143
|
+
// @ts-ignore
|
|
144
|
+
xProps.classListBind.value = xProps.classListBind.bindDataPath;
|
|
145
|
+
// @ts-ignore
|
|
146
|
+
delete xProps['classListBind'].propertyPath;
|
|
147
|
+
// @ts-ignore
|
|
148
|
+
delete xProps['classListBind'].bindDataPath;
|
|
149
|
+
// @ts-ignore
|
|
150
|
+
delete xProps.classNameListBind;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function translateStyleBinding(comp) {
|
|
154
|
+
const { xProps } = comp;
|
|
155
|
+
if (!xProps) {
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
if (xProps['styleBind']) {
|
|
159
|
+
// @ts-ignore
|
|
160
|
+
if (xProps['styleBind'].bindDataPath) {
|
|
161
|
+
xProps['styleBind'] = {
|
|
162
|
+
type: xProps['styleBind'].type,
|
|
163
|
+
// @ts-ignore
|
|
164
|
+
value: xProps['styleBind'].bindDataPath,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
function translateStyleToCommonStyle(comp) {
|
|
170
|
+
const { xProps } = comp;
|
|
171
|
+
if (xProps === null || xProps === void 0 ? void 0 : xProps.style) {
|
|
172
|
+
xProps.commonStyle = xProps.commonStyle || {};
|
|
173
|
+
xProps.commonStyle.self = xProps.commonStyle.self || {};
|
|
174
|
+
xProps.commonStyle.self = merge(xProps.style, xProps.commonStyle.self);
|
|
175
|
+
delete xProps.style;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function addDefaultXIndex(comp) {
|
|
179
|
+
const { properties } = comp;
|
|
180
|
+
if (!properties) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
let xIndex = 1;
|
|
184
|
+
Object.values(properties).map((_comp) => {
|
|
185
|
+
let comp = _comp;
|
|
186
|
+
if (comp.xIndex === undefined) {
|
|
187
|
+
comp.xIndex = xIndex;
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
xIndex = comp.xIndex + 1;
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
export function addFormItem(comp, key, parent, isOnlySlot = false) {
|
|
195
|
+
const { properties, xIndex, xProps } = comp;
|
|
196
|
+
const defaultValue = get(xProps, 'data.defaultValue');
|
|
197
|
+
if (defaultValue) {
|
|
198
|
+
set(xProps, 'data.value', defaultValue);
|
|
199
|
+
delete xProps.data.defaultValue;
|
|
200
|
+
}
|
|
201
|
+
const rulesValue = get(xProps, 'data.rules') || {
|
|
202
|
+
value: [],
|
|
203
|
+
};
|
|
204
|
+
if (!rulesValue.type || rulesValue.type === 'static') {
|
|
205
|
+
rulesValue.value = (rulesValue.value || []).filter((meta) => {
|
|
206
|
+
return meta && !isEmptyObj(meta);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
if (isPlainObject(rulesValue.value)) {
|
|
210
|
+
if (isEmptyObject(rulesValue.value)) {
|
|
211
|
+
rulesValue.value = [];
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
rulesValue.value = [rulesValue.value];
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const layoutValue = get(xProps, 'data.layout') || {
|
|
218
|
+
value: 'vertical',
|
|
219
|
+
};
|
|
220
|
+
const requireValue = get(xProps, 'data.required') || {
|
|
221
|
+
value: false,
|
|
222
|
+
};
|
|
223
|
+
const requiredTextValue = {
|
|
224
|
+
value: (requireValue === null || requireValue === void 0 ? void 0 : requireValue.value) ? '该项为必填项' : false,
|
|
225
|
+
};
|
|
226
|
+
const nameValue = get(xProps, 'data.name') || {
|
|
227
|
+
value: 'uniqueFormKey',
|
|
228
|
+
};
|
|
229
|
+
let labelText = get(xProps, 'data.label.value') || '';
|
|
230
|
+
let isShowTitleSlot = false;
|
|
231
|
+
if (properties) {
|
|
232
|
+
Object.keys(properties).map((subKey) => {
|
|
233
|
+
if (isWeAppId(subKey)) {
|
|
234
|
+
delete properties[subKey];
|
|
235
|
+
}
|
|
236
|
+
if (subKey === 'label') {
|
|
237
|
+
const targetLabelSlot = properties[subKey];
|
|
238
|
+
getComponentChildren(targetLabelSlot).map(([key, item]) => {
|
|
239
|
+
labelText = get(item, 'xProps.data.text.value');
|
|
240
|
+
const cloneItem = cloneDeep(item);
|
|
241
|
+
deepParse(cloneItem, key, comp);
|
|
242
|
+
isShowTitleSlot = true;
|
|
243
|
+
});
|
|
244
|
+
delete comp.properties.label;
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
const titleSlot = {
|
|
249
|
+
[getId()]: {
|
|
250
|
+
xComponent: {
|
|
251
|
+
moduleName: OFFICIAL_LIB_KEY,
|
|
252
|
+
name: 'Text',
|
|
253
|
+
},
|
|
254
|
+
xProps: {
|
|
255
|
+
data: {
|
|
256
|
+
text: {
|
|
257
|
+
value: labelText,
|
|
258
|
+
},
|
|
259
|
+
decode: {
|
|
260
|
+
value: false,
|
|
261
|
+
},
|
|
262
|
+
selectable: {
|
|
263
|
+
value: false,
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
listeners: [],
|
|
267
|
+
},
|
|
268
|
+
xIndex: 0,
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
try {
|
|
272
|
+
delete xProps.data.layout;
|
|
273
|
+
delete xProps.data.required;
|
|
274
|
+
delete xProps.data.rules;
|
|
275
|
+
delete xProps.data.requiredText;
|
|
276
|
+
delete xProps.data.label;
|
|
277
|
+
delete xProps.data.name;
|
|
278
|
+
}
|
|
279
|
+
catch (e) { }
|
|
280
|
+
if (parent) {
|
|
281
|
+
if (!parent.xComponent || (parent.xComponent && parent.xComponent.name !== 'FormItem')) {
|
|
282
|
+
// add FormItem
|
|
283
|
+
const newFormItemId = getId();
|
|
284
|
+
// @ts-ignore
|
|
285
|
+
parent.properties[newFormItemId] = {
|
|
286
|
+
xComponent: {
|
|
287
|
+
moduleName: OFFICIAL_COMPONENT_LIB_NAME,
|
|
288
|
+
name: 'FormItem',
|
|
289
|
+
},
|
|
290
|
+
// @ts-ignore
|
|
291
|
+
xProps: {
|
|
292
|
+
data: {
|
|
293
|
+
name: nameValue,
|
|
294
|
+
rules: rulesValue,
|
|
295
|
+
layout: layoutValue,
|
|
296
|
+
required: requireValue,
|
|
297
|
+
requiredMsg: requiredTextValue,
|
|
298
|
+
requiredFlag: true,
|
|
299
|
+
labelVisible: { value: true },
|
|
300
|
+
validateStatus: {
|
|
301
|
+
value: 'success',
|
|
302
|
+
},
|
|
303
|
+
validateTrigger: {
|
|
304
|
+
value: 'onChange',
|
|
305
|
+
},
|
|
306
|
+
},
|
|
307
|
+
},
|
|
308
|
+
xIndex,
|
|
309
|
+
properties: {
|
|
310
|
+
labelSlot: {
|
|
311
|
+
properties: Object.assign({}, titleSlot),
|
|
312
|
+
},
|
|
313
|
+
contentSlot: {
|
|
314
|
+
properties: {
|
|
315
|
+
[key]: comp,
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
};
|
|
320
|
+
try {
|
|
321
|
+
// 删除原来组件
|
|
322
|
+
delete parent.properties[key];
|
|
323
|
+
}
|
|
324
|
+
catch (e) {
|
|
325
|
+
console.error('删除组件多余属性失败 parseGsdKboneInput', e, comp);
|
|
326
|
+
}
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
delete xProps.data.rules;
|
|
331
|
+
delete xProps.data.defaultValue;
|
|
332
|
+
delete xProps.data.layout;
|
|
333
|
+
delete xProps.data.require;
|
|
334
|
+
}
|
|
335
|
+
export function renameRepeatId(json) {
|
|
336
|
+
const { pageInstanceList = [] } = json;
|
|
337
|
+
pageInstanceList.forEach((instance, index) => {
|
|
338
|
+
const { componentInstances } = instance;
|
|
339
|
+
const _compIds = {};
|
|
340
|
+
const comps = [];
|
|
341
|
+
for (const i in componentInstances) {
|
|
342
|
+
const comp = componentInstances[i];
|
|
343
|
+
if (_compIds[i] && i.startsWith('id')) {
|
|
344
|
+
const newId = getId();
|
|
345
|
+
componentInstances[newId] = comp;
|
|
346
|
+
delete componentInstances[i];
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
_compIds[i] = i;
|
|
350
|
+
}
|
|
351
|
+
comps.push(comp);
|
|
352
|
+
}
|
|
353
|
+
while (true) {
|
|
354
|
+
const topComp = comps.pop();
|
|
355
|
+
if (!topComp) {
|
|
356
|
+
break;
|
|
357
|
+
}
|
|
358
|
+
const keys = Object.keys(topComp['properties'] || {});
|
|
359
|
+
if (keys.length > 0) {
|
|
360
|
+
keys.forEach((key) => {
|
|
361
|
+
const _comp = topComp['properties'][key];
|
|
362
|
+
if (_compIds[key] && key.startsWith('id')) {
|
|
363
|
+
const newId = getId();
|
|
364
|
+
topComp['properties'][newId] = _comp;
|
|
365
|
+
delete topComp['properties'][key];
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
_compIds[key] = key;
|
|
369
|
+
}
|
|
370
|
+
comps.push(_comp);
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
备注:登录 WeApps v2,在任一页面控制台输入以下代码(需要修改相应的分类名称),以获取指定分类的 COMPLEX_COMPONENT_KEYS
|
|
3
|
+
|
|
4
|
+
fetch(`http://dev.weapps.woa.com/api/compositeComp/list?pageIndex=0&category=${encodeURI('审批系统')}&keyword=&pageSize=500`).then(function(response) {
|
|
5
|
+
return response.json();
|
|
6
|
+
}).then(function(json) {
|
|
7
|
+
console.log(JSON.stringify(json.data.rows.map(item => item.name), null, 2))
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
*/
|
|
11
|
+
export declare const COMPLEX_COMPONENT_KEYS: string[];
|
|
12
|
+
export declare const FORM_COMPONENT_KEYS: string[];
|
|
13
|
+
export declare const GSD_H5_REACT_COMPONENT_KEYS: string[];
|
|
14
|
+
export declare const COMPONENT_SELECTABLEBLOCK_WHITELIST: string[];
|
|
15
|
+
export declare const MODULE_SELECTABLEBLOCK_REGEX: RegExp;
|
|
16
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../src/parser/cals/utils/version/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAyKH,eAAO,MAAM,sBAAsB,UAMlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,UAgB/B,CAAC;AAEF,eAAO,MAAM,2BAA2B,UAgDvC,CAAC;AAGF,eAAO,MAAM,mCAAmC,UAA8D,CAAC;AAG/G,eAAO,MAAM,4BAA4B,QAA6B,CAAC"}
|