From 4990f429472526e401db341a5ef60e0d0f76f523 Mon Sep 17 00:00:00 2001 From: lihong Date: Wed, 13 Oct 2021 15:09:55 +0800 Subject: [PATCH] lihong67@huawei.com sync code. Signed-off-by: lihong Change-Id: Ie736d68b82983f8d87bfd00a4694671242c0619c --- compiler/src/component_map.ts | 10 +++++++--- compiler/src/process_ui_syntax.ts | 7 +++++++ compiler/tsconfig.json | 1 + 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/compiler/src/component_map.ts b/compiler/src/component_map.ts index 9eb781611..9dea80f23 100644 --- a/compiler/src/component_map.ts +++ b/compiler/src/component_map.ts @@ -203,7 +203,7 @@ export const COMPONENT_MAP: any = { Progress: { atomic: true, attrs: [ - 'value', 'color', 'cricularStyle' + 'value', 'color', 'cricularStyle', 'circularStyle' ] }, Rect: { @@ -287,6 +287,10 @@ export const COMPONENT_MAP: any = { atomic: true, attrs: ['checked', 'onChange'] }, + Web: { + atomic: true, + attrs: ['pagestart', 'pagefinish', 'error','message', 'reload'] + }, GeometryView: { atomic: true }, @@ -335,11 +339,11 @@ export const COMPONENT_MAP: any = { }, Menu: { children: ['Option'], - attrs: ['show', 'showPosition'], + attrs: ['show', 'showPosition', 'fontColor', 'fontSize', 'fontWeight', 'fontFamily'], }, Option: { parents: ['Menu'], - attrs: [], + attrs: ['fontColor', 'fontSize', 'fontWeight', 'fontFamily'], }, }; diff --git a/compiler/src/process_ui_syntax.ts b/compiler/src/process_ui_syntax.ts index b8335049a..d2f0d106d 100644 --- a/compiler/src/process_ui_syntax.ts +++ b/compiler/src/process_ui_syntax.ts @@ -65,6 +65,7 @@ export function processUISyntax(program: ts.Program, ut = false): Function { pagesDir = path.resolve(path.dirname(node.fileName)); if (process.env.compiler === BUILD_ON) { if (!ut && (path.basename(node.fileName) === 'app.ets.ts' || !/\.ets\.ts$/.test(node.fileName))) { + node = ts.visitEachChild(node, processResourceNode, context); return node; } collectComponents(node); @@ -102,6 +103,12 @@ export function processUISyntax(program: ts.Program, ut = false): Function { } return ts.visitEachChild(node, processAllNodes, context); } + function processResourceNode(node: ts.Node): ts.Node { + if (isResource(node)) { + node = processResourceData(node as ts.CallExpression); + } + return ts.visitEachChild(node, processResourceNode, context); + } function validateSourceFileNode(node: ts.SourceFile): void { if (program) { node = ts.visitEachChild(node, validateAllNodes, context); diff --git a/compiler/tsconfig.json b/compiler/tsconfig.json index 156470233..0cc98114f 100644 --- a/compiler/tsconfig.json +++ b/compiler/tsconfig.json @@ -4,6 +4,7 @@ "allowJs": true, "allowSyntheticDefaultImports": true, "esModuleInterop": true, + "importsNotUsedAsValues": "preserve", "noImplicitAny": false, "noUnusedLocals": false, "noUnusedParameters": false, -- Gitee