@cloudbase/cals 1.1.14 → 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,463 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { camelcase, isEmptyObj, isPlainObject } from './common';
|
|
13
|
+
import _map from 'lodash/map';
|
|
14
|
+
import _uniq from 'lodash/uniq';
|
|
15
|
+
import { isUnitlessNumber } from '../../../utils';
|
|
16
|
+
const DISTANCE_KEY_LIST = ['top', 'right', 'bottom', 'left'];
|
|
17
|
+
export function removeInvalidStyleFormValue(styleForm = {}) {
|
|
18
|
+
return Object.keys(styleForm).reduce((result, key) => {
|
|
19
|
+
const propStyleFormData = styleForm[key];
|
|
20
|
+
if (isPlainObject(propStyleFormData)) {
|
|
21
|
+
setStyleValue(result, key, removeInvalidStyleFormValue(propStyleFormData));
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
setStyleValue(result, key, styleForm[key]);
|
|
25
|
+
}
|
|
26
|
+
return result;
|
|
27
|
+
}, {});
|
|
28
|
+
}
|
|
29
|
+
function setStyleValue(object, key, value) {
|
|
30
|
+
if (value === undefined || value === null || value === '') {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
// 特殊样式移除
|
|
34
|
+
if (key === 'open') {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (isEmptyObj(value)) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
if (key.startsWith('--')) {
|
|
41
|
+
// css 自定义属性
|
|
42
|
+
object[key] = value;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
object[camelcase(key)] = value;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function _handleStyleNumValue(styleVal, addPXUnit) {
|
|
49
|
+
if (addPXUnit) {
|
|
50
|
+
/**
|
|
51
|
+
* 2022.12.13
|
|
52
|
+
* 改分支未启用
|
|
53
|
+
*/
|
|
54
|
+
const value = `${styleVal}`;
|
|
55
|
+
if (/^-?(?:\d*\.)?\d+$/.test(value)) {
|
|
56
|
+
return `${value}px`;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return styleVal;
|
|
60
|
+
}
|
|
61
|
+
function setDistanceStyle(style, distance, attr, addPXUnit) {
|
|
62
|
+
const attributeKey = camelcase(`${attr}`);
|
|
63
|
+
if (Object.keys(distance).length === 4) {
|
|
64
|
+
if (_uniq(_map(distance, (val) => val)).length === 1) {
|
|
65
|
+
// 4个值全相等的情况
|
|
66
|
+
setStyleValue(style, attributeKey, _handleStyleNumValue(distance.top, addPXUnit));
|
|
67
|
+
}
|
|
68
|
+
else if (distance.top === distance.bottom && distance.left === distance.right) {
|
|
69
|
+
// 俩俩相等的情况
|
|
70
|
+
setStyleValue(style, attributeKey, `${_handleStyleNumValue(distance.top, addPXUnit)} ${_handleStyleNumValue(distance.right, addPXUnit)}`);
|
|
71
|
+
}
|
|
72
|
+
else if (distance.left === distance.right) {
|
|
73
|
+
setStyleValue(style, attributeKey, `${_handleStyleNumValue(distance.top, addPXUnit)} ${_handleStyleNumValue(distance.right, addPXUnit)} ${_handleStyleNumValue(distance.bottom, addPXUnit)}`);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
setStyleValue(style, attributeKey, `${_handleStyleNumValue(distance.top, addPXUnit)} ${_handleStyleNumValue(distance.right, addPXUnit)} ${_handleStyleNumValue(distance.bottom, addPXUnit)} ${_handleStyleNumValue(distance.left, addPXUnit)}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
DISTANCE_KEY_LIST.forEach((key) => {
|
|
81
|
+
if (distance[key] !== undefined)
|
|
82
|
+
setStyleValue(style, camelcase(`${attr}_${key}`), _handleStyleNumValue(distance[key], addPXUnit));
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function translateStyleByHandler(style = {}, handler, options) {
|
|
87
|
+
const { looseError = false, rpxCalcRoot } = options || {};
|
|
88
|
+
return Object.keys(style).reduce((result, key) => {
|
|
89
|
+
const value = style[key];
|
|
90
|
+
if (isUnitlessNumber[key]) {
|
|
91
|
+
setStyleValue(result, key, value);
|
|
92
|
+
}
|
|
93
|
+
else if (value !== undefined && value !== null) {
|
|
94
|
+
try {
|
|
95
|
+
setStyleValue(result, key, handler(value, rpxCalcRoot));
|
|
96
|
+
}
|
|
97
|
+
catch (e) {
|
|
98
|
+
if (looseError) {
|
|
99
|
+
console.warn('translate style error, key:value', key, value);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
throw e;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return result;
|
|
107
|
+
}, {});
|
|
108
|
+
}
|
|
109
|
+
function toREM(cssLen, rpxCalcRoot = undefined) {
|
|
110
|
+
if (typeof cssLen === 'string' || typeof cssLen === 'number') {
|
|
111
|
+
const cssLenArr = `${cssLen}`.split(' ');
|
|
112
|
+
return cssLenArr
|
|
113
|
+
.map((attr) => {
|
|
114
|
+
const matchResult = attr.match(/^(-?\d*\.?\d+)(r?px)?$/);
|
|
115
|
+
if (matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) {
|
|
116
|
+
const px = +matchResult[1];
|
|
117
|
+
if (Number.isNaN(px / 1))
|
|
118
|
+
return px.toString();
|
|
119
|
+
if (px === 0) {
|
|
120
|
+
return '0';
|
|
121
|
+
}
|
|
122
|
+
if ((matchResult === null || matchResult === void 0 ? void 0 : matchResult[2]) === 'rpx') {
|
|
123
|
+
return rpxCalcRoot ? `calc(${px}px / ${rpxCalcRoot})` : attr;
|
|
124
|
+
}
|
|
125
|
+
return `${(px / 28).toFixed(4)}rem`;
|
|
126
|
+
}
|
|
127
|
+
return attr;
|
|
128
|
+
})
|
|
129
|
+
.join(' ');
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
throw new Error(`cssLen type error ${cssLen}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function toRPX(cssLen, rpxCalcRoot = undefined) {
|
|
136
|
+
const cssLenArr = `${cssLen}`.split(' ');
|
|
137
|
+
return cssLenArr
|
|
138
|
+
.map((attr) => {
|
|
139
|
+
const matchResult = attr.match(/^(-?\d*\.?\d+)(px)?$/);
|
|
140
|
+
if (matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) {
|
|
141
|
+
const px = +matchResult[1];
|
|
142
|
+
if (Number.isNaN(px / 1))
|
|
143
|
+
return px.toString();
|
|
144
|
+
if (px === 0) {
|
|
145
|
+
return '0';
|
|
146
|
+
}
|
|
147
|
+
return rpxCalcRoot ? `calc(${px}px / ${rpxCalcRoot})` : `${px}rpx`;
|
|
148
|
+
}
|
|
149
|
+
return attr;
|
|
150
|
+
})
|
|
151
|
+
.join(' ');
|
|
152
|
+
}
|
|
153
|
+
function toPX(cssLen, rpxCalcRoot = undefined) {
|
|
154
|
+
return `${cssLen}`
|
|
155
|
+
.split(' ')
|
|
156
|
+
.map((attr) => {
|
|
157
|
+
const matchResult = attr.match(/^(-?\d*\.?\d+)(rpx)?$/);
|
|
158
|
+
if (matchResult === null || matchResult === void 0 ? void 0 : matchResult[1]) {
|
|
159
|
+
const px = +matchResult[1];
|
|
160
|
+
if (Number.isNaN(px / 1))
|
|
161
|
+
return px.toString();
|
|
162
|
+
if (px === 0) {
|
|
163
|
+
return '0';
|
|
164
|
+
}
|
|
165
|
+
if ((matchResult === null || matchResult === void 0 ? void 0 : matchResult[2]) === 'rpx') {
|
|
166
|
+
return rpxCalcRoot ? `calc(${px}px / ${rpxCalcRoot})` : attr;
|
|
167
|
+
}
|
|
168
|
+
return `${+matchResult[1]}px`;
|
|
169
|
+
}
|
|
170
|
+
return attr;
|
|
171
|
+
})
|
|
172
|
+
.join(' ');
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Convert WeApps common style to css styles(React.CSSProperties)
|
|
176
|
+
* toRem/toRpx/toRpx 三者互斥 @deprecated
|
|
177
|
+
* 应使用 defaultUnit 来声明
|
|
178
|
+
*/
|
|
179
|
+
export function processCommonStyle2CSSProperties(commonStyle = {}, options = { toRem: true, ignoreSelf: false, addPXUnit: false, toRpx: false, rpxCalcRoot: undefined }) {
|
|
180
|
+
const { size,
|
|
181
|
+
// transform,
|
|
182
|
+
text, border, background, margin, padding, zIndex, position, display, flexConfig, custom, self, boxShadow, } = commonStyle;
|
|
183
|
+
const style = {};
|
|
184
|
+
if (size) {
|
|
185
|
+
setStyleValue(style, 'width', _handleStyleNumValue(size.width, !!options.addPXUnit));
|
|
186
|
+
setStyleValue(style, 'height', _handleStyleNumValue(size.height, !!options.addPXUnit));
|
|
187
|
+
}
|
|
188
|
+
// if (transform) {
|
|
189
|
+
// const { rotate, opacity, scale, radius } = transform
|
|
190
|
+
// if ((rotate && rotate !== 0) || (scale && scale !== 1)) {
|
|
191
|
+
// style.transform = `${rotate ? `rotate(${rotate}deg) ` : ''}${scale ? `scale(${scale})` : ''}`
|
|
192
|
+
// }
|
|
193
|
+
// setStyleValue(style, 'opacity', opacity)
|
|
194
|
+
// setStyleValue(style, 'borderRadius', radius)
|
|
195
|
+
// }
|
|
196
|
+
if (margin) {
|
|
197
|
+
setDistanceStyle(style, margin, 'margin', !!options.addPXUnit);
|
|
198
|
+
}
|
|
199
|
+
if (padding) {
|
|
200
|
+
setDistanceStyle(style, padding, 'padding', !!options.addPXUnit);
|
|
201
|
+
}
|
|
202
|
+
if (display) {
|
|
203
|
+
setStyleValue(style, 'display', display);
|
|
204
|
+
}
|
|
205
|
+
if (display === 'flex' && flexConfig) {
|
|
206
|
+
if (flexConfig.justifyContent)
|
|
207
|
+
setStyleValue(style, 'justifyContent', flexConfig.justifyContent);
|
|
208
|
+
if (flexConfig.alignItems)
|
|
209
|
+
setStyleValue(style, 'alignItems', flexConfig.alignItems);
|
|
210
|
+
if (flexConfig.flexWrap && flexConfig.flexDirection) {
|
|
211
|
+
setStyleValue(style, 'flexFlow', `${flexConfig.flexDirection} ${flexConfig.flexWrap}`);
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
if (flexConfig.flexWrap)
|
|
215
|
+
setStyleValue(style, 'flexWrap', flexConfig.flexWrap);
|
|
216
|
+
if (flexConfig.flexDirection)
|
|
217
|
+
setStyleValue(style, 'flexDirection', flexConfig.flexDirection);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
if (typeof zIndex === 'number' || `${zIndex}`.search(/^\d+$/) === 0) {
|
|
221
|
+
style.zIndex = zIndex;
|
|
222
|
+
}
|
|
223
|
+
if (text) {
|
|
224
|
+
setStyleValue(style, 'color', text.color);
|
|
225
|
+
setStyleValue(style, 'fontSize', _handleStyleNumValue(text.fontSize, !!options.addPXUnit));
|
|
226
|
+
setStyleValue(style, 'lineHeight', text.lineHeight);
|
|
227
|
+
setStyleValue(style, 'textAlign', text.textAlign);
|
|
228
|
+
setStyleValue(style, 'fontWeight', text.weight);
|
|
229
|
+
if (text.opacity !== undefined) {
|
|
230
|
+
setStyleValue(style, 'opacity', text.opacity / 100);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
if (border) {
|
|
234
|
+
const { type, color, width, radius, radiusInfo } = border;
|
|
235
|
+
// width
|
|
236
|
+
if (typeof width === 'string') {
|
|
237
|
+
if (type && type !== 'none') {
|
|
238
|
+
setStyleValue(style, 'border', `${_handleStyleNumValue(width, !!options.addPXUnit)} ${type} ${color || ''}`);
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
setStyleValue(style, 'borderWidth', _handleStyleNumValue(width, !!options.addPXUnit));
|
|
242
|
+
if (color)
|
|
243
|
+
setStyleValue(style, 'borderColor', color);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
else if (Object.prototype.toString.call(width) === '[object Object]' && Object.keys(width).length !== 0) {
|
|
247
|
+
// https://developer.mozilla.org/zh-CN/docs/Web/CSS/border
|
|
248
|
+
// 虽然border-width,、border-style和 border-color 简写属性接受最多 4 个参数来为不同的边设置宽度、风格和颜色,但 boder 属性只接受三个参数,分别是宽度、风格和颜色,所以这样会使得四条边的边框相同。
|
|
249
|
+
const { top = '0', right = '0', bottom = '0', left = '0' } = width;
|
|
250
|
+
setStyleValue(style, 'borderWidth', `${_handleStyleNumValue(top, !!options.addPXUnit) || '0'} ${_handleStyleNumValue(right, !!options.addPXUnit) || '0'} ${_handleStyleNumValue(bottom, !!options.addPXUnit) || '0'} ${_handleStyleNumValue(left, !!options.addPXUnit) || '0'}`);
|
|
251
|
+
if (type) {
|
|
252
|
+
setStyleValue(style, 'borderStyle', type);
|
|
253
|
+
}
|
|
254
|
+
if (color) {
|
|
255
|
+
setStyleValue(style, 'borderColor', color);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
// border radius
|
|
259
|
+
if (radius !== undefined) {
|
|
260
|
+
setStyleValue(style, 'borderRadius', _handleStyleNumValue(radius, !!options.addPXUnit));
|
|
261
|
+
}
|
|
262
|
+
if (radiusInfo && !isEmptyObj(radiusInfo)) {
|
|
263
|
+
let { topLeft, topRight, bottomRight, bottomLeft } = radiusInfo;
|
|
264
|
+
if (Object.keys(radiusInfo).length === 4) {
|
|
265
|
+
// 包含不为空的属性,将部分为空属性处理成 0
|
|
266
|
+
if (Object.values(radiusInfo).some((corner) => !!corner)) {
|
|
267
|
+
if (!topLeft) {
|
|
268
|
+
topLeft = '0';
|
|
269
|
+
}
|
|
270
|
+
if (!topRight) {
|
|
271
|
+
topRight = '0';
|
|
272
|
+
}
|
|
273
|
+
if (!bottomRight) {
|
|
274
|
+
bottomRight = '0';
|
|
275
|
+
}
|
|
276
|
+
if (!bottomLeft) {
|
|
277
|
+
bottomLeft = '0';
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
if (_uniq(_map(radiusInfo, (val) => val)).length === 1) {
|
|
281
|
+
// 4个值全相等的情况
|
|
282
|
+
setStyleValue(style, 'borderRadius', _handleStyleNumValue(topLeft, !!options.addPXUnit));
|
|
283
|
+
}
|
|
284
|
+
else if (topLeft === bottomRight && topRight === bottomLeft) {
|
|
285
|
+
// 俩俩相等的情况
|
|
286
|
+
setStyleValue(style, 'borderRadius', `${_handleStyleNumValue(topLeft, !!options.addPXUnit)} ${_handleStyleNumValue(topRight, !!options.addPXUnit)}`);
|
|
287
|
+
}
|
|
288
|
+
else if (topRight === bottomLeft) {
|
|
289
|
+
setStyleValue(style, 'borderRadius', `${_handleStyleNumValue(topLeft, !!options.addPXUnit)} ${_handleStyleNumValue(topRight, !!options.addPXUnit)} ${_handleStyleNumValue(bottomRight, !!options.addPXUnit)}`);
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
setStyleValue(style, 'borderRadius', `${_handleStyleNumValue(topLeft, !!options.addPXUnit)} ${_handleStyleNumValue(topRight, !!options.addPXUnit)} ${_handleStyleNumValue(bottomRight, !!options.addPXUnit)} ${_handleStyleNumValue(bottomLeft, !!options.addPXUnit)}`);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
setStyleValue(style, 'borderTopLeftRadius', _handleStyleNumValue(topLeft, !!options.addPXUnit));
|
|
297
|
+
setStyleValue(style, 'borderTopRightRadius', _handleStyleNumValue(topRight, !!options.addPXUnit));
|
|
298
|
+
setStyleValue(style, 'borderBottomRightRadius', _handleStyleNumValue(bottomRight, !!options.addPXUnit));
|
|
299
|
+
setStyleValue(style, 'borderBottomLeftRadius', _handleStyleNumValue(bottomLeft, !!options.addPXUnit));
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
if (type === 'none') {
|
|
303
|
+
setStyleValue(style, 'border', `none`);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
if (background) {
|
|
307
|
+
const { bgType, color, image, size, repeat, position, positionObj } = background;
|
|
308
|
+
if (bgType === 'none') {
|
|
309
|
+
setStyleValue(style, 'background', 'none');
|
|
310
|
+
}
|
|
311
|
+
else if (bgType === 'color') {
|
|
312
|
+
setStyleValue(style, 'background', color);
|
|
313
|
+
}
|
|
314
|
+
else if (bgType === 'image') {
|
|
315
|
+
// 如 radial-gradient(crimson, skyblue);
|
|
316
|
+
if (image != null) {
|
|
317
|
+
if (image.search(/[()]/) >= 0) {
|
|
318
|
+
style.background = image;
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
style.background = `url(${image})`;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
if (repeat)
|
|
325
|
+
style.background += ` ${repeat}`;
|
|
326
|
+
if (size) {
|
|
327
|
+
setStyleValue(style, 'backgroundSize', _handleStyleNumValue(size, !!options.addPXUnit));
|
|
328
|
+
}
|
|
329
|
+
setStyleValue(style, 'backgroundPosition', position);
|
|
330
|
+
if (positionObj && !isEmptyObj(positionObj)) {
|
|
331
|
+
style.background += ` ${_handleStyleNumValue(positionObj.left, !!options.addPXUnit)} ${_handleStyleNumValue(positionObj.top, !!options.addPXUnit)}`;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
// FIXME: 这里兼容原有应用的数据,后面应去掉
|
|
335
|
+
if (bgType === undefined) {
|
|
336
|
+
setStyleValue(style, 'backgroundColor', color);
|
|
337
|
+
if (image != null) {
|
|
338
|
+
style.backgroundImage = `url(${image})`;
|
|
339
|
+
setStyleValue(style, 'backgroundRepeat', repeat);
|
|
340
|
+
setStyleValue(style, 'backgroundSize', _handleStyleNumValue(size, !!options.addPXUnit));
|
|
341
|
+
setStyleValue(style, 'backgroundPosition', position);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
if (position) {
|
|
346
|
+
setStyleValue(style, 'position', position.position);
|
|
347
|
+
if (position.left !== undefined) {
|
|
348
|
+
setStyleValue(style, 'left', _handleStyleNumValue(position.left, !!options.addPXUnit));
|
|
349
|
+
}
|
|
350
|
+
if (position.right !== undefined) {
|
|
351
|
+
setStyleValue(style, 'right', _handleStyleNumValue(position.right, !!options.addPXUnit));
|
|
352
|
+
}
|
|
353
|
+
if (position.top !== undefined) {
|
|
354
|
+
setStyleValue(style, 'top', _handleStyleNumValue(position.top, !!options.addPXUnit));
|
|
355
|
+
}
|
|
356
|
+
if (position.bottom !== undefined) {
|
|
357
|
+
setStyleValue(style, 'bottom', _handleStyleNumValue(position.bottom, !!options.addPXUnit));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
if (boxShadow) {
|
|
361
|
+
let processedBoxShadow = boxShadow;
|
|
362
|
+
if (Object.prototype.toString.call(boxShadow) === '[object Object]') {
|
|
363
|
+
processedBoxShadow = [boxShadow];
|
|
364
|
+
}
|
|
365
|
+
let boxShadowStyleString = '';
|
|
366
|
+
if (Array.isArray(processedBoxShadow)) {
|
|
367
|
+
processedBoxShadow.forEach((boxShadowItem, index) => {
|
|
368
|
+
let currentBoxShadowStyleString = '';
|
|
369
|
+
const { keyWord, offsetX, offsetY, blurRadius, spreadRadius, color, global, inset } = boxShadowItem;
|
|
370
|
+
// Keyword values
|
|
371
|
+
if (keyWord === 'none') {
|
|
372
|
+
currentBoxShadowStyleString = 'none';
|
|
373
|
+
}
|
|
374
|
+
else if (!!global) {
|
|
375
|
+
currentBoxShadowStyleString = global;
|
|
376
|
+
}
|
|
377
|
+
else if (!!offsetX || !!offsetY) {
|
|
378
|
+
// inset
|
|
379
|
+
if (!!inset) {
|
|
380
|
+
currentBoxShadowStyleString = 'inset ';
|
|
381
|
+
}
|
|
382
|
+
// offsetX
|
|
383
|
+
currentBoxShadowStyleString += _handleStyleNumValue(!!offsetX ? offsetX : 0, !!options.addPXUnit);
|
|
384
|
+
// offsetY
|
|
385
|
+
currentBoxShadowStyleString += ` ${_handleStyleNumValue(!!offsetY ? offsetY : 0, !!options.addPXUnit)}`;
|
|
386
|
+
// blur-radius 当 spread-radius 存在时,即使不存在 blur-radius,blur-radius 也要为 0
|
|
387
|
+
if (!!blurRadius || !!spreadRadius) {
|
|
388
|
+
currentBoxShadowStyleString += ` ${_handleStyleNumValue(!!blurRadius ? blurRadius : 0, !!options.addPXUnit)}`;
|
|
389
|
+
}
|
|
390
|
+
// spread-radius
|
|
391
|
+
if (!!spreadRadius) {
|
|
392
|
+
currentBoxShadowStyleString += ` ${_handleStyleNumValue(spreadRadius, !!options.addPXUnit)}`;
|
|
393
|
+
}
|
|
394
|
+
// color
|
|
395
|
+
if (!!color) {
|
|
396
|
+
currentBoxShadowStyleString += ` ${color}`;
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
if (!!currentBoxShadowStyleString) {
|
|
400
|
+
const splitLabel = !!boxShadowStyleString ? ' , ' : '';
|
|
401
|
+
boxShadowStyleString += splitLabel + currentBoxShadowStyleString;
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
}
|
|
405
|
+
else if (typeof boxShadow === 'string') {
|
|
406
|
+
boxShadowStyleString = boxShadow;
|
|
407
|
+
}
|
|
408
|
+
if (!!boxShadowStyleString) {
|
|
409
|
+
setStyleValue(style, 'boxShadow', boxShadowStyleString);
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
if (custom && custom.length > 0) {
|
|
413
|
+
custom.map((item) => {
|
|
414
|
+
setStyleValue(style, item.key, item.value);
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
if (self && !options.ignoreSelf) {
|
|
418
|
+
const _a = self, { cssFloat } = _a, restSelf = __rest(_a, ["cssFloat"]);
|
|
419
|
+
Object.assign(style, restSelf);
|
|
420
|
+
if (cssFloat) {
|
|
421
|
+
Object.assign(style, { float: cssFloat });
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
for (const key in style) {
|
|
425
|
+
const value = style[key];
|
|
426
|
+
if (Array.isArray(value)) {
|
|
427
|
+
style[key] = value[value.length - 1];
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
let { defaultUnit } = options;
|
|
431
|
+
const translateStyleOptions = { rpxCalcRoot: options.rpxCalcRoot };
|
|
432
|
+
if (!defaultUnit) {
|
|
433
|
+
if (options.toRpx) {
|
|
434
|
+
defaultUnit = 'rpx';
|
|
435
|
+
}
|
|
436
|
+
if (options.toRem) {
|
|
437
|
+
defaultUnit = 'rem';
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
if (defaultUnit) {
|
|
441
|
+
return processCSSPropertiesUnit(style, defaultUnit, translateStyleOptions);
|
|
442
|
+
}
|
|
443
|
+
return style;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* @deprecated
|
|
447
|
+
*/
|
|
448
|
+
export function processCSSProperties2Rem(style = {}, options) {
|
|
449
|
+
return translateStyleByHandler(style, toREM, options);
|
|
450
|
+
}
|
|
451
|
+
export function processCSSPropertiesUnit(style = {}, type, options) {
|
|
452
|
+
const _a = style, { cssFloat } = _a, restCssProperties = __rest(_a, ["cssFloat"]);
|
|
453
|
+
const handerMap = {
|
|
454
|
+
px: toPX,
|
|
455
|
+
rem: toREM,
|
|
456
|
+
rpx: toRPX,
|
|
457
|
+
};
|
|
458
|
+
const handler = handerMap[type] ||
|
|
459
|
+
function (cssLen, _) {
|
|
460
|
+
return cssLen;
|
|
461
|
+
};
|
|
462
|
+
return translateStyleByHandler(Object.assign({ float: cssFloat }, restCssProperties), handler, options);
|
|
463
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../../../src/parser/cals/utils/template.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAoM3C,wBAAgB,mBAAmB,CACjC,GAAG,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,EACrC,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,KAAK,UA6BpC"}
|