diff --git a/BUILD.gn b/BUILD.gn index 0535ce60da5f4a838483b6f64b57ef30be3d1522..58e58aa2164cf1aff6811d6089eaa7b89ee41dbb 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -28,6 +28,7 @@ ets_sysResource = get_label_info(":build_ets_sysResource", "target_out_dir") + "/sysResource.js" action("build_ets_loader_library") { + deps = [ ":components" ] script = "build_ets_loader_library.py" depfile = "$target_gen_dir/$target_name.d" outputs = [ @@ -162,6 +163,13 @@ ohos_copy("ets_loader_syntax") { module_install_name = "" } +ohos_copy("components") { + sources = [ "compiler/components" ] + outputs = [ target_out_dir + "/$target_name" ] + module_source_dir = target_out_dir + "/$target_name" + module_install_name = "" +} + ohos_copy("ets_loader_declaration") { deps = [ ":build_ets_loader_library" ] sources = [ ets_loader_declarations_dir ] diff --git a/compiler/components/ability_component.json b/compiler/components/ability_component.json new file mode 100644 index 0000000000000000000000000000000000000000..544e737967a82f02553eb87e02b0b75ee8cfb456 --- /dev/null +++ b/compiler/components/ability_component.json @@ -0,0 +1,4 @@ +{ + "name": "AbilityComponent", + "attrs": ["onReady", "onDestroy", "onAbilityCreated", "onAbilityMoveToFront", "onAbilityWillRemove"] +} \ No newline at end of file diff --git a/compiler/components/action_sheet.json b/compiler/components/action_sheet.json new file mode 100644 index 0000000000000000000000000000000000000000..f4152ea9e2afbb1126c2fa4e78f8e102f0218639 --- /dev/null +++ b/compiler/components/action_sheet.json @@ -0,0 +1,4 @@ +{ + "name": "ActionSheet", + "attrs": ["show"] +} \ No newline at end of file diff --git a/compiler/components/alert_dialog.json b/compiler/components/alert_dialog.json new file mode 100644 index 0000000000000000000000000000000000000000..1e58758ae8ab0f57c0ac9663cd8cfcf84ca7ab1e --- /dev/null +++ b/compiler/components/alert_dialog.json @@ -0,0 +1,4 @@ +{ + "name": "AlertDialog", + "attrs": ["show"] +} \ No newline at end of file diff --git a/compiler/components/alphabet_indexer.json b/compiler/components/alphabet_indexer.json new file mode 100644 index 0000000000000000000000000000000000000000..40be388027b3606c097e7771a4149a36a4a38894 --- /dev/null +++ b/compiler/components/alphabet_indexer.json @@ -0,0 +1,7 @@ +{ + "name": "AlphabetIndexer", + "attrs": [ + "onSelected", "selectedColor", "popupColor", "selectedBackgroundColor", "popupBackground", "usingPopup", + "selectedFont", "popupFont", "itemSize", "font", "color", "alignStyle" + ] +} \ No newline at end of file diff --git a/compiler/components/animator.json b/compiler/components/animator.json new file mode 100644 index 0000000000000000000000000000000000000000..091ccb03314f3e8bad80da5888c1b8d08ec28381 --- /dev/null +++ b/compiler/components/animator.json @@ -0,0 +1,9 @@ +{ + "name": "Animator", + "atomic": true, + "noDebugLine": true, + "attrs": [ + "state", "duration", "curve", "delay", "fillMode", "iterations", "playMode", "motion", + "onStart", "onPause", "onRepeat", "onCancel", "onFinish", "onFrame" + ] +} \ No newline at end of file diff --git a/compiler/components/badge.json b/compiler/components/badge.json new file mode 100644 index 0000000000000000000000000000000000000000..b4b3bc6b2d64b84a04bc5d64557690a42d3f82d4 --- /dev/null +++ b/compiler/components/badge.json @@ -0,0 +1,5 @@ +{ + "name": "Badge", + "atomics": true, + "attrs": [] +} \ No newline at end of file diff --git a/compiler/components/blank.json b/compiler/components/blank.json new file mode 100644 index 0000000000000000000000000000000000000000..9fe088f444585a56b0753c8c44ce76a81b7ebfb9 --- /dev/null +++ b/compiler/components/blank.json @@ -0,0 +1,6 @@ +{ + "name": "Blank", + "parents": ["Row", "Column"], + "atomic": true, + "attrs": ["color"] +} \ No newline at end of file diff --git a/compiler/components/button.json b/compiler/components/button.json new file mode 100644 index 0000000000000000000000000000000000000000..948df251c3ce33f5415a18293612107fa8967cb2 --- /dev/null +++ b/compiler/components/button.json @@ -0,0 +1,4 @@ +{ + "name": "Button", + "attrs": ["type", "stateEffect", "fontColor", "fontSize", "fontWeight"] +} \ No newline at end of file diff --git a/compiler/components/calendar.json b/compiler/components/calendar.json new file mode 100644 index 0000000000000000000000000000000000000000..a24b65df31f6d68d4fa5fd64acc706058c4c4ab4 --- /dev/null +++ b/compiler/components/calendar.json @@ -0,0 +1,8 @@ +{ + "name": "Calendar", + "attrs": [ + "date", "showLunar", "startOfWeek", "offDays", "onSelectChange", "onRequestData", + "currentData", "preData", "nextData", "needSlide", "showHoliday", "direction", + "currentDayStyle", "nonCurrentDayStyle", "todayStyle", "weekStyle", "workStateStyle" + ] +} \ No newline at end of file diff --git a/compiler/components/camera.json b/compiler/components/camera.json new file mode 100644 index 0000000000000000000000000000000000000000..4e2068bd4dc0d2aa37c78e6217a7a8b559521d5e --- /dev/null +++ b/compiler/components/camera.json @@ -0,0 +1,5 @@ +{ + "name": "Camera", + "atomic": true, + "attrs": ["devicePosition"] +} \ No newline at end of file diff --git a/compiler/components/circle.json b/compiler/components/circle.json new file mode 100644 index 0000000000000000000000000000000000000000..85a8ffe8103d62e81b39ba47a915d66ae4d207cb --- /dev/null +++ b/compiler/components/circle.json @@ -0,0 +1,4 @@ +{ + "name": "Circle", + "atomic": true +} \ No newline at end of file diff --git a/compiler/components/column.json b/compiler/components/column.json new file mode 100644 index 0000000000000000000000000000000000000000..6f6312a84e78af501dfa67493c7d69723cd8de8d --- /dev/null +++ b/compiler/components/column.json @@ -0,0 +1,4 @@ +{ + "name": "Column", + "attrs": ["alignItems"] +} \ No newline at end of file diff --git a/compiler/components/column_split.json b/compiler/components/column_split.json new file mode 100644 index 0000000000000000000000000000000000000000..cfa1e52bca635bcefa1b8e93b8ea3ddd9451538f --- /dev/null +++ b/compiler/components/column_split.json @@ -0,0 +1,4 @@ +{ + "name": "ColumnSplit", + "attrs": ["resizeable"] +} \ No newline at end of file diff --git a/compiler/components/common_attrs.json b/compiler/components/common_attrs.json new file mode 100644 index 0000000000000000000000000000000000000000..e6e57a800caed2c590380b7dd1a8e987165b98ef --- /dev/null +++ b/compiler/components/common_attrs.json @@ -0,0 +1,24 @@ +{ + "attrs": [ + "width", "height", "size", "constraintSize", "layoutPriority", "layoutWeight", + "padding", "paddingLeft", "paddingRight", "paddingTop", "paddingBottom", + "margin", "marginLeft", "marginRight", "marginTop", "marginBottom", + "border", "borderStyle", "borderWidth", "borderColor", "borderRadius", + "backgroundColor", "backgroundImage", "backgroundImageSize", "backgroundImagePosition", + "opacity", "animation", "transition", + "navigationTitle", "navigationSubTitle", "hideNavigationBar", "hideNavigationBackButton", + "toolBar", "hideToolBar", "onClick", "onTouch", "onKeyEvent", "onHover", + "blur", "backdropBlur", "windowBlur", "translate", "rotate", "scale", "transform", + "onAppear", "onDisAppear", "visibility", "flexBasis", "flexShrink", "flexGrow", "alignSelf", + "useAlign", "zIndex", "sharedTransition", "direction", "align", "position", "markAnchor", + "offset", "enabled", "aspectRatio", "displayPriority", + "onDrag", "onDragEnter", "onDragMove", "onDragLeave", "onDrop", + "overlay", "linearGradient", "sweepGradient", "radialGradient", + "gridOffset", "gridSpan", "useSizeType", + "motionPath", "clip", "shadow", "mask", + "accessibilityGroup", "accessibilityText", "accessibilityDescription", + "accessibilityImportance", "onAccessibility", "grayscale", "brightness", "contrast", + "saturate", "geometryTransition", + "bindPopup", "colorBlend", "invert", "sepia", "hueRotate", "bindMenu" + ] +} \ No newline at end of file diff --git a/compiler/components/counter.json b/compiler/components/counter.json new file mode 100644 index 0000000000000000000000000000000000000000..34746f606a00e9581c46c91d51a1b69b01003165 --- /dev/null +++ b/compiler/components/counter.json @@ -0,0 +1,7 @@ +{ + "name": "Counter", + "attrs": [ + "onStateChange", "onInc", + "onDec", "height", "width" + ] +} \ No newline at end of file diff --git a/compiler/components/datapanel.json b/compiler/components/datapanel.json new file mode 100644 index 0000000000000000000000000000000000000000..3128924d62d40428cb66ee82379bbc215f2c274e --- /dev/null +++ b/compiler/components/datapanel.json @@ -0,0 +1,5 @@ +{ + "name": "DataPanel", + "atomic": false, + "attrs": ["closeEffect"] +} \ No newline at end of file diff --git a/compiler/components/datePicker.json b/compiler/components/datePicker.json new file mode 100644 index 0000000000000000000000000000000000000000..28a77764eb54bd8ca19c86687ed36f4ca49c08f4 --- /dev/null +++ b/compiler/components/datePicker.json @@ -0,0 +1,5 @@ +{ + "name": "DatePicker", + "atomic": true, + "attrs": ["lunar", "onChange", "useMilitaryTime"] +} \ No newline at end of file diff --git a/compiler/components/divider.json b/compiler/components/divider.json new file mode 100644 index 0000000000000000000000000000000000000000..75728fd5c2b94639c25a30b958c73e65155b5200 --- /dev/null +++ b/compiler/components/divider.json @@ -0,0 +1,5 @@ +{ + "name": "Divider", + "atomic": true, + "attrs": ["color", "vertical", "strokeWidth", "lineCap"] +} \ No newline at end of file diff --git a/compiler/components/ellipse.json b/compiler/components/ellipse.json new file mode 100644 index 0000000000000000000000000000000000000000..0f4a225bcdf388626c32fa2dd200e8b69996990a --- /dev/null +++ b/compiler/components/ellipse.json @@ -0,0 +1,4 @@ +{ + "name": "Ellipse", + "atomic": true +} \ No newline at end of file diff --git a/compiler/components/flex.json b/compiler/components/flex.json new file mode 100644 index 0000000000000000000000000000000000000000..32cee03f48dcd3b07fc6888c95470897f9b48d9d --- /dev/null +++ b/compiler/components/flex.json @@ -0,0 +1,4 @@ +{ + "name": "Flex", + "attrs": [] +} \ No newline at end of file diff --git a/compiler/components/form_component.json b/compiler/components/form_component.json new file mode 100644 index 0000000000000000000000000000000000000000..5532c7f5a9effb104127bc5bb840837c6822c50b --- /dev/null +++ b/compiler/components/form_component.json @@ -0,0 +1,8 @@ +{ + "name": "FormComponent", + "atomic": true, + "attrs": [ + "size", "moduleName", "dimension", "allowUpdate", "visibility", + "onAcquired", "onError", "onRouter" + ] +} \ No newline at end of file diff --git a/compiler/components/friction_motion.json b/compiler/components/friction_motion.json new file mode 100644 index 0000000000000000000000000000000000000000..d87b5bbbc7550a8f5b252ca058ba02e73d75d215 --- /dev/null +++ b/compiler/components/friction_motion.json @@ -0,0 +1,4 @@ +{ + "name": "FrictionMotion", + "atomic": true +} \ No newline at end of file diff --git a/compiler/components/gauge.json b/compiler/components/gauge.json new file mode 100644 index 0000000000000000000000000000000000000000..150ed06b05670e241ca3b6f4e76d4dd8d6f93d95 --- /dev/null +++ b/compiler/components/gauge.json @@ -0,0 +1,8 @@ +{ + "name": "Gauge", + "atomic": true, + "attrs": [ + "value", "startAngle", "endAngle", "colors", "strokeWidth", "labelTextConfig", + "labelColorConfig" + ] +} \ No newline at end of file diff --git a/compiler/components/geometryView.json b/compiler/components/geometryView.json new file mode 100644 index 0000000000000000000000000000000000000000..d9dfd5cef4f637f2449a4ca566b4eee43ba588a2 --- /dev/null +++ b/compiler/components/geometryView.json @@ -0,0 +1,4 @@ +{ + "name": "GeometryView", + "atomic": true +} \ No newline at end of file diff --git a/compiler/components/grid.json b/compiler/components/grid.json new file mode 100644 index 0000000000000000000000000000000000000000..4d82c84ddee39fdd161e79d88906358dc9eb7e09 --- /dev/null +++ b/compiler/components/grid.json @@ -0,0 +1,8 @@ +{ + "name": "Grid", + "children": ["GridItem"], + "attrs": [ + "columnsTemplate", "rowsTemplate", "columnsGap", "rowsGap", "scrollBar", "scrollBarWidth", + "scrollBarColor" + ] +} \ No newline at end of file diff --git a/compiler/components/gridItem.json b/compiler/components/gridItem.json new file mode 100644 index 0000000000000000000000000000000000000000..be369c12d26a48835ea56667657ee433b229f5ee --- /dev/null +++ b/compiler/components/gridItem.json @@ -0,0 +1,6 @@ +{ + "name": "GridItem", + "parents": ["Grid"], + "single": true, + "attrs": ["rowStart", "rowEnd", "columnStart", "columnEnd", "forceRebuild"] +} \ No newline at end of file diff --git a/compiler/components/grid_container.json b/compiler/components/grid_container.json new file mode 100644 index 0000000000000000000000000000000000000000..0d067c274e6727fda7583d415034e8ad404db322 --- /dev/null +++ b/compiler/components/grid_container.json @@ -0,0 +1,4 @@ +{ + "name": "GridContainer", + "attrs": ["columns", "sizeType", "gutter", "margin"] +} \ No newline at end of file diff --git a/compiler/components/hyperlink.json b/compiler/components/hyperlink.json new file mode 100644 index 0000000000000000000000000000000000000000..990662d80eff4ef0a2b82ea946c4abcccd1ebffe --- /dev/null +++ b/compiler/components/hyperlink.json @@ -0,0 +1,4 @@ +{ + "name": "Hyperlink", + "attrs": ["color"] +} \ No newline at end of file diff --git a/compiler/components/image.json b/compiler/components/image.json new file mode 100644 index 0000000000000000000000000000000000000000..feeaea4f47048312bf6ab524de0382218b804b76 --- /dev/null +++ b/compiler/components/image.json @@ -0,0 +1,8 @@ +{ + "name": "Image", + "atomic": true, + "attrs": [ + "alt", "objectFit", "matchTextDirection", "fitOriginalSize", "objectRepeat", "renderMode", + "interpolation", "onComplete", "onError", "onFinish", "sourceSize", "fillColor", "autoResize" + ] +} \ No newline at end of file diff --git a/compiler/components/image_animator.json b/compiler/components/image_animator.json new file mode 100644 index 0000000000000000000000000000000000000000..73208d2cbadc745952aa9ad6ccea1a5bc23c3e5d --- /dev/null +++ b/compiler/components/image_animator.json @@ -0,0 +1,8 @@ +{ + "name": "ImageAnimator", + "atomic": true, + "attrs": [ + "images", "state", "duration", "reverse", "fixedSize", "preDecode", "fillMode", "iterations", + "onStart", "onPause", "onRepeat", "onCancel", "onFinish" + ] +} \ No newline at end of file diff --git a/compiler/components/line.json b/compiler/components/line.json new file mode 100644 index 0000000000000000000000000000000000000000..bb5340aeca8f0e129138861f1daa9dd3663ede67 --- /dev/null +++ b/compiler/components/line.json @@ -0,0 +1,7 @@ +{ + "name": "Line", + "atomic": true, + "attrs": [ + "startPoint","endPoint" + ] +} \ No newline at end of file diff --git a/compiler/components/list.json b/compiler/components/list.json new file mode 100644 index 0000000000000000000000000000000000000000..f4c7d751a966a2353740176e7a08de9130894ead --- /dev/null +++ b/compiler/components/list.json @@ -0,0 +1,9 @@ +{ + "name": "List", + "children": ["ListItem", "Section"], + "attrs": [ + "listDirection", "scrollBar", "edgeEffect", "divider", "editMode", "cachedCount", + "chainAnimation", "onScroll", "onReachStart", "onReachEnd", "onScrollStop", "onItemDelete", + "onItemMove" + ] +} \ No newline at end of file diff --git a/compiler/components/listItem.json b/compiler/components/listItem.json new file mode 100644 index 0000000000000000000000000000000000000000..467c66e2319d98091a3b8daf82042d6c07499633 --- /dev/null +++ b/compiler/components/listItem.json @@ -0,0 +1,6 @@ +{ + "name": "ListItem", + "parents": ["List"], + "single": true, + "attrs": ["sticky", "editable"] +} \ No newline at end of file diff --git a/compiler/components/loadingProgress.json b/compiler/components/loadingProgress.json new file mode 100644 index 0000000000000000000000000000000000000000..08d1a29aae1162213bb146648b10e3db93f90734 --- /dev/null +++ b/compiler/components/loadingProgress.json @@ -0,0 +1,5 @@ +{ + "name": "LoadingProgress", + "atomic": true, + "attrs": ["color"] +} \ No newline at end of file diff --git a/compiler/components/marquee.json b/compiler/components/marquee.json new file mode 100644 index 0000000000000000000000000000000000000000..ccf4abd98d9b7f1fb36099c4a86d940c57393e84 --- /dev/null +++ b/compiler/components/marquee.json @@ -0,0 +1,6 @@ +{ + "name": "Marquee", + "atomic": true, + "attrs": ["fontColor", "fontSize", "allowScale", "fontWeight", "fontFamily", "onStart", + "onBounce", "onFinish"] +} \ No newline at end of file diff --git a/compiler/components/menu.json b/compiler/components/menu.json new file mode 100644 index 0000000000000000000000000000000000000000..2db5287ec32a1546fe7c122fc08d37bf56e89168 --- /dev/null +++ b/compiler/components/menu.json @@ -0,0 +1,5 @@ +{ + "name": "Menu", + "children": ["Option"], + "attrs": ["show", "showPosition", "fontColor", "fontSize", "fontWeight", "fontFamily"] +} \ No newline at end of file diff --git a/compiler/components/navigationView.json b/compiler/components/navigationView.json new file mode 100644 index 0000000000000000000000000000000000000000..f9b5099b5dc89fb5baf2283d0c6da4bd30567ad1 --- /dev/null +++ b/compiler/components/navigationView.json @@ -0,0 +1,4 @@ +{ + "name": "NavigationView", + "attrs": [] +} \ No newline at end of file diff --git a/compiler/components/navigator.json b/compiler/components/navigator.json new file mode 100644 index 0000000000000000000000000000000000000000..8ca4c9404fe62e9214417fb1bbec5543c3843fd8 --- /dev/null +++ b/compiler/components/navigator.json @@ -0,0 +1,5 @@ +{ + "name": "Navigator", + "single": true, + "attrs": ["target", "type", "params", "active"] +} \ No newline at end of file diff --git a/compiler/components/option.json b/compiler/components/option.json new file mode 100644 index 0000000000000000000000000000000000000000..7cdad7d91a7cf88ebc1f6120ad8fac701f5b00c9 --- /dev/null +++ b/compiler/components/option.json @@ -0,0 +1,5 @@ +{ + "name": "Option", + "parents": ["Menu"], + "attrs": ["fontColor", "fontSize", "fontWeight", "fontFamily"] +} \ No newline at end of file diff --git a/compiler/components/pageTransition_enter.json b/compiler/components/pageTransition_enter.json new file mode 100644 index 0000000000000000000000000000000000000000..d0d84825d2999a0bd857a0e116dcb5dc035f38d2 --- /dev/null +++ b/compiler/components/pageTransition_enter.json @@ -0,0 +1,6 @@ +{ + "name": "PageTransitionEnter", + "atomic": true, + "noDebugLine": true, + "attrs": ["onEnter"] +} \ No newline at end of file diff --git a/compiler/components/pageTransition_exit.json b/compiler/components/pageTransition_exit.json new file mode 100644 index 0000000000000000000000000000000000000000..24716df5a9546d63ba7e7e55a2ffad58eda17c29 --- /dev/null +++ b/compiler/components/pageTransition_exit.json @@ -0,0 +1,6 @@ +{ + "name": "PageTransitionExit", + "atomic": true, + "noDebugLine": true, + "attrs": ["onExit"] +} \ No newline at end of file diff --git a/compiler/components/panel.json b/compiler/components/panel.json new file mode 100644 index 0000000000000000000000000000000000000000..636ee17d4b70b5fc1e8487c9e07a6eb38e1e206d --- /dev/null +++ b/compiler/components/panel.json @@ -0,0 +1,7 @@ +{ + "name": "Panel", + "attrs": [ + "type", "mode", "dragBar", "fullHeight", + "halfHeight", "miniHeight", "show", "onChange" + ] +} \ No newline at end of file diff --git a/compiler/components/path.json b/compiler/components/path.json new file mode 100644 index 0000000000000000000000000000000000000000..7e3efd76b66434c830a612ca2228dd1324be8f2a --- /dev/null +++ b/compiler/components/path.json @@ -0,0 +1,7 @@ +{ + "name": "Path", + "atomic": true, + "attrs": [ + "commands" + ] +} \ No newline at end of file diff --git a/compiler/components/piece.json b/compiler/components/piece.json new file mode 100644 index 0000000000000000000000000000000000000000..bafa42ebd90e6ca1988e959596b119b882520a3f --- /dev/null +++ b/compiler/components/piece.json @@ -0,0 +1,5 @@ +{ + "name": "Piece", + "atomic": true, + "attrs": ["iconPosition"] +} \ No newline at end of file diff --git a/compiler/components/polygon.json b/compiler/components/polygon.json new file mode 100644 index 0000000000000000000000000000000000000000..bc0b1033b30c51dca975d42b7cc4fe80ccb0d9be --- /dev/null +++ b/compiler/components/polygon.json @@ -0,0 +1,5 @@ +{ + "name": "Polygon", + "atomic": true, + "attrs": ["points"] +} \ No newline at end of file diff --git a/compiler/components/polyline.json b/compiler/components/polyline.json new file mode 100644 index 0000000000000000000000000000000000000000..5f5862ba767a0bfe6c9edcbe51eeb4f0f1499d54 --- /dev/null +++ b/compiler/components/polyline.json @@ -0,0 +1,5 @@ +{ + "name": "Polyline", + "atomic": true, + "attrs": ["points"] +} \ No newline at end of file diff --git a/compiler/components/progress.json b/compiler/components/progress.json new file mode 100644 index 0000000000000000000000000000000000000000..027e80dbd253c775c45a254e90eccfe8508ec468 --- /dev/null +++ b/compiler/components/progress.json @@ -0,0 +1,7 @@ +{ + "name": "Progress", + "atomic": true, + "attrs": [ + "value", "color", "cricularStyle", "circularStyle" + ] +} \ No newline at end of file diff --git a/compiler/components/qrcode.json b/compiler/components/qrcode.json new file mode 100644 index 0000000000000000000000000000000000000000..eda56a4b739275e9b01d909b918682be0c90ec06 --- /dev/null +++ b/compiler/components/qrcode.json @@ -0,0 +1,4 @@ +{ + "name": "QRCode", + "attrs": ["color", "backgroundColor"] +} \ No newline at end of file diff --git a/compiler/components/radio.json b/compiler/components/radio.json new file mode 100644 index 0000000000000000000000000000000000000000..ae90392d7e30aaa1d571e94ebc5802677224fbbe --- /dev/null +++ b/compiler/components/radio.json @@ -0,0 +1,5 @@ +{ + "name": "Radio", + "atomic": true, + "attrs": ["checked", "onChange"] +} \ No newline at end of file diff --git a/compiler/components/rating.json b/compiler/components/rating.json new file mode 100644 index 0000000000000000000000000000000000000000..ec43a7a37987ca2cc47eef8da378b514b5c12ab0 --- /dev/null +++ b/compiler/components/rating.json @@ -0,0 +1,4 @@ +{ + "name": "Rating", + "attrs": ["stars", "stepSize", "starStyle", "onChange"] +} \ No newline at end of file diff --git a/compiler/components/rect.json b/compiler/components/rect.json new file mode 100644 index 0000000000000000000000000000000000000000..fce921d52d640848b48cd8b6aa36b7da57ab777e --- /dev/null +++ b/compiler/components/rect.json @@ -0,0 +1,7 @@ +{ + "name": "Rect", + "atomic": true, + "attrs": [ + "radiusWidth", "radiusHeight", "radius" + ] +} \ No newline at end of file diff --git a/compiler/components/refresh.json b/compiler/components/refresh.json new file mode 100644 index 0000000000000000000000000000000000000000..6346ca41ed76a280d0c930dbd17ffaf91ae561a1 --- /dev/null +++ b/compiler/components/refresh.json @@ -0,0 +1,7 @@ +{ + "name": "Refresh", + "single": true, + "attrs": [ + "refreshing", "offset", "friction", "onStateChange", "onRefreshing" + ] +} \ No newline at end of file diff --git a/compiler/components/row.json b/compiler/components/row.json new file mode 100644 index 0000000000000000000000000000000000000000..556b560aefbeb5c3b8aa4dfa66e6e7da6994b6b7 --- /dev/null +++ b/compiler/components/row.json @@ -0,0 +1,4 @@ +{ + "name": "Row", + "attrs": ["alignItems"] +} \ No newline at end of file diff --git a/compiler/components/row_split.json b/compiler/components/row_split.json new file mode 100644 index 0000000000000000000000000000000000000000..da1c9182dda0fa21c46783e07952be9081075a6b --- /dev/null +++ b/compiler/components/row_split.json @@ -0,0 +1,4 @@ +{ + "name": "RowSplit", + "attrs": ["resizeable"] +} \ No newline at end of file diff --git a/compiler/components/scroll.json b/compiler/components/scroll.json new file mode 100644 index 0000000000000000000000000000000000000000..8c9a9ece75eedaff83f8ac7c3e24ada9a193fe19 --- /dev/null +++ b/compiler/components/scroll.json @@ -0,0 +1,7 @@ +{ + "name": "Scroll", + "attrs": [ + "scrollable", "onScroll", "onScrollEdge", "onScrollEnd", "scrollBar", "scrollBarColor", + "scrollBarWidth", "edgeEffect" + ] +} \ No newline at end of file diff --git a/compiler/components/scroll_motion.json b/compiler/components/scroll_motion.json new file mode 100644 index 0000000000000000000000000000000000000000..bd2b26a91a52cd6f5991c2b70ddad678b47a03e2 --- /dev/null +++ b/compiler/components/scroll_motion.json @@ -0,0 +1,4 @@ +{ + "name": "ScrollMotion", + "atomic": true +} \ No newline at end of file diff --git a/compiler/components/search.json b/compiler/components/search.json new file mode 100644 index 0000000000000000000000000000000000000000..4410d06476988d924a461962775e07fbefff9d2d --- /dev/null +++ b/compiler/components/search.json @@ -0,0 +1,7 @@ +{ + "name": "Search", + "atomic": true, + "attrs": [ + "searchButton", "placeholderColor", "placeholderFont", "onSubmit", "onChange" + ] +} \ No newline at end of file diff --git a/compiler/components/section.json b/compiler/components/section.json new file mode 100644 index 0000000000000000000000000000000000000000..97bc13f1db94ca57a1dba9cab369f8691ac0837d --- /dev/null +++ b/compiler/components/section.json @@ -0,0 +1,4 @@ +{ + "name": "Section", + "attrs": [] +} \ No newline at end of file diff --git a/compiler/components/shape.json b/compiler/components/shape.json new file mode 100644 index 0000000000000000000000000000000000000000..1f79dbcce9864acb4f579f4cc4b04a0ab0fb0d3f --- /dev/null +++ b/compiler/components/shape.json @@ -0,0 +1,12 @@ +{ + "name": "Shape", + "children": [ + "Rect", "Path", "Circle", "Ellipse", "Shape", "Polyline", "Polygon", "Image", "Text" + ], + "attrs": [ + "stroke", "fill", "strokeDashOffset", "strokeLineCap", + "strokeLineJoin", "strokeMiterLimit", "strokeOpacity", + "fillOpacity", "strokeWidth", "antiAlias", "strokeDashArray", + "viewPort" + ] +} \ No newline at end of file diff --git a/compiler/components/sheet.json b/compiler/components/sheet.json new file mode 100644 index 0000000000000000000000000000000000000000..3195882ffc21421b53cd332c265c061f3b6c0db7 --- /dev/null +++ b/compiler/components/sheet.json @@ -0,0 +1,5 @@ +{ + "name": "Sheet", + "children": ["Section"], + "attrs": [] +} \ No newline at end of file diff --git a/compiler/components/slider.json b/compiler/components/slider.json new file mode 100644 index 0000000000000000000000000000000000000000..be167b398268b1aca79fe06f944fe3692a3fea6b --- /dev/null +++ b/compiler/components/slider.json @@ -0,0 +1,8 @@ +{ + "name": "Slider", + "atomic": true, + "attrs": [ + "blockColor", "trackColor", "selectedColor", "minLabel","maxLabel", "showSteps","showTips", + "onChange" + ] +} \ No newline at end of file diff --git a/compiler/components/span.json b/compiler/components/span.json new file mode 100644 index 0000000000000000000000000000000000000000..d8467e61b34bee0b840773b3032dca9a6c2778aa --- /dev/null +++ b/compiler/components/span.json @@ -0,0 +1,8 @@ +{ + "name": "Span", + "atomic": true, + "attrs": [ + "fontColor", "fontSize", "fontStyle", "fontFamily", "fontWeight", "decoration", "letterSpacing", + "textCase" + ] +} \ No newline at end of file diff --git a/compiler/components/spring_motion.json b/compiler/components/spring_motion.json new file mode 100644 index 0000000000000000000000000000000000000000..abb415f4c8bab4ce7bc3a4cdcb64463821268a3d --- /dev/null +++ b/compiler/components/spring_motion.json @@ -0,0 +1,4 @@ +{ + "name": "SpringMotion", + "atomic": true +} \ No newline at end of file diff --git a/compiler/components/spring_prop.json b/compiler/components/spring_prop.json new file mode 100644 index 0000000000000000000000000000000000000000..9c53c7bdd278d9d8a5fa13ee5a37549181ef65b1 --- /dev/null +++ b/compiler/components/spring_prop.json @@ -0,0 +1,4 @@ +{ + "name": "SpringProp", + "atomic": true +} \ No newline at end of file diff --git a/compiler/components/stack.json b/compiler/components/stack.json new file mode 100644 index 0000000000000000000000000000000000000000..7007a9f8cb487052c73022aaaaf57e13ad257b3c --- /dev/null +++ b/compiler/components/stack.json @@ -0,0 +1,4 @@ +{ + "name": "Stack", + "attrs": ["alignContent"] +} \ No newline at end of file diff --git a/compiler/components/swiper.json b/compiler/components/swiper.json new file mode 100644 index 0000000000000000000000000000000000000000..745fe8443ab2ef328a2feb9f54e5347485a3bd14 --- /dev/null +++ b/compiler/components/swiper.json @@ -0,0 +1,7 @@ +{ + "name": "Swiper", + "attrs": [ + "index", "autoPlay", "interval", "indicator", + "loop", "duration", "vertical", "itemSpace", "displayMode", "onChange" + ] +} \ No newline at end of file diff --git a/compiler/components/tab_content.json b/compiler/components/tab_content.json new file mode 100644 index 0000000000000000000000000000000000000000..e0beff067eea43fd90f106bb3d7cbb08e479c0d6 --- /dev/null +++ b/compiler/components/tab_content.json @@ -0,0 +1,5 @@ +{ + "name": "TabContent", + "parents": ["Tabs"], + "attrs": ["tabBar"] +} \ No newline at end of file diff --git a/compiler/components/tabs.json b/compiler/components/tabs.json new file mode 100644 index 0000000000000000000000000000000000000000..68369496ce721d6054180066b7b70eaf80363fb2 --- /dev/null +++ b/compiler/components/tabs.json @@ -0,0 +1,8 @@ +{ + "name": "Tabs", + "children": ["TabContent"], + "attrs": [ + "vertical", "scrollable", "barMode", "barWidth", "barHeight", "animationDuration", + "onChange" + ] +} \ No newline at end of file diff --git a/compiler/components/text.json b/compiler/components/text.json new file mode 100644 index 0000000000000000000000000000000000000000..9d8d8eff53bf81c070f4356f699004765d744853 --- /dev/null +++ b/compiler/components/text.json @@ -0,0 +1,9 @@ +{ + "name": "Text", + "children": ["Span"], + "attrs": [ + "fontColor", "fontSize", "fontStyle", "fontWeight", "textAlign", "lineHeight", "textOverflow", + "maxLines", "decoration", "letterSpacing", "textCase", "baselineOffset", "minFontSize", + "maxFontSize" + ] +} \ No newline at end of file diff --git a/compiler/components/textPicker.json b/compiler/components/textPicker.json new file mode 100644 index 0000000000000000000000000000000000000000..418f9861f9c5c36d79020453dee12b7e750d3241 --- /dev/null +++ b/compiler/components/textPicker.json @@ -0,0 +1,5 @@ +{ + "name": "TextPicker", + "atomic": true, + "attrs": ["defaultPickerItemHeight", "onAccept", "onCancel", "onChange"] +} \ No newline at end of file diff --git a/compiler/components/textarea.json b/compiler/components/textarea.json new file mode 100644 index 0000000000000000000000000000000000000000..ce7f5ccb8bff7df507b41f0fdac82f10e5edfb76 --- /dev/null +++ b/compiler/components/textarea.json @@ -0,0 +1,7 @@ +{ + "name": "TextArea", + "atomic": true, + "attrs": [ + "placeholderColor", "placeholderFont", "textAlign", "caretColor", "onChange" + ] +} \ No newline at end of file diff --git a/compiler/components/textinput.json b/compiler/components/textinput.json new file mode 100644 index 0000000000000000000000000000000000000000..41c04b2f6c92e7b79448f841cdfed6445ffdc499 --- /dev/null +++ b/compiler/components/textinput.json @@ -0,0 +1,8 @@ +{ + "name": "TextInput", + "atomic": true, + "attrs": [ + "type", "placeholderColor", "placeholderFont", "enterKeyType", "caretColor", "maxLength", + "onEditChanged", "onSubmit", "onChange" + ] +} \ No newline at end of file diff --git a/compiler/components/toggle.json b/compiler/components/toggle.json new file mode 100644 index 0000000000000000000000000000000000000000..15fd3a2c717446aa6a935b47116bebc1e24cf722 --- /dev/null +++ b/compiler/components/toggle.json @@ -0,0 +1,4 @@ +{ + "name": "Toggle", + "attrs": ["onChange", "selectedColor", "swithPointStyle"] +} \ No newline at end of file diff --git a/compiler/components/video.json b/compiler/components/video.json new file mode 100644 index 0000000000000000000000000000000000000000..3a9e18ca32cd887415bbd97f4a5ca20971d5127c --- /dev/null +++ b/compiler/components/video.json @@ -0,0 +1,8 @@ +{ + "name": "Video", + "atomic": true, + "attrs": [ + "muted", "autoPlay", "controls", "loop", "objectFit", "onSeeking", "onFullscreenChange", + "onStart", "onPause", "onPrepared", "onFinish", "onSeeked", "onUpdate", "onError" + ] +} \ No newline at end of file diff --git a/compiler/components/web.json b/compiler/components/web.json new file mode 100644 index 0000000000000000000000000000000000000000..6c3c610f4fa8bfb61baaf165da9c4ddd2eef82b2 --- /dev/null +++ b/compiler/components/web.json @@ -0,0 +1,5 @@ +{ + "name": "Web", + "atomic": true, + "attrs": ["pagestart", "pagefinish", "error","message", "reload"] +} \ No newline at end of file diff --git a/compiler/src/component_map.ts b/compiler/src/component_map.ts index 81a7ef1f2e04cbb11a62314b8b5727810be84fd2..e522b739df1655bbf80910086ef9afd564fb00fc 100644 --- a/compiler/src/component_map.ts +++ b/compiler/src/component_map.ts @@ -13,371 +13,34 @@ * limitations under the License. */ +const fs = require('fs'); +const path = require('path'); + export const COMPONENT_MAP: any = { - Search: { - atomic: true, - attrs: [ - 'searchButton', 'placeholderColor', 'placeholderFont', 'onSubmit', 'onChange' - ] - }, - FormComponent: { - atomic: true, - attrs: [ - 'size', 'moduleName', 'dimension', 'allowUpdate', 'visibility', - 'onAcquired', 'onError', 'onRouter' - ] - }, - Image: { - atomic: true, - attrs: [ - 'alt', 'objectFit', 'matchTextDirection', 'fitOriginalSize', 'objectRepeat', 'renderMode', 'interpolation', - 'onComplete', 'onError', 'onFinish', 'sourceSize', 'fillColor', 'autoResize' - ] - }, - ImageAnimator: { - atomic: true, - attrs: [ - 'images', 'state', 'duration', 'reverse', 'fixedSize', 'preDecode', 'fillMode', 'iterations', 'onStart', - 'onPause', 'onRepeat', 'onCancel', 'onFinish' - ] - }, - Animator: { - atomic: true, - noDebugLine: true, - attrs: [ - 'state', 'duration', 'curve', 'delay', 'fillMode', 'iterations', 'playMode', 'motion', 'onStart', - 'onPause', 'onRepeat', 'onCancel', 'onFinish', 'onFrame' - ] - }, - Refresh: { - single: true, - attrs: [ - 'refreshing', 'offset', 'friction', - 'onStateChange', 'onRefreshing' - ] - }, - SpringProp: { - atomic: true - }, - SpringMotion: { - atomic: true - }, - FrictionMotion: { - atomic: true - }, - ScrollMotion: { - atomic: true - }, - Text: { - children: ['Span'], - attrs: [ - 'fontColor', 'fontSize', 'fontStyle', 'fontWeight', 'textAlign', 'lineHeight', 'textOverflow', 'maxLines', - 'decoration', 'letterSpacing', 'textCase', 'baselineOffset', 'minFontSize', 'maxFontSize' - ] - }, - TextPicker: { - atomic: true, - attrs: ['defaultPickerItemHeight', 'onAccept', 'onCancel', 'onChange'] - }, - DatePicker: { - atomic: true, - attrs: ['lunar', 'onChange', 'useMilitaryTime'] - }, - Span: { - atomic: true, - attrs: [ - 'fontColor', 'fontSize', 'fontStyle', 'fontFamily', 'fontWeight', 'decoration', 'letterSpacing', 'textCase' - ] - }, - Button: { - attrs: ['type', 'stateEffect', 'fontColor', 'fontSize', 'fontWeight'] - }, - Divider: { - atomic: true, - attrs: ['color', 'vertical', 'strokeWidth', 'lineCap'] - }, - Piece: { - atomic: true, - attrs: ['iconPosition'] - }, - Slider: { - atomic: true, - attrs: ['blockColor', 'trackColor', 'selectedColor', 'minLabel','maxLabel', 'showSteps', 'showTips', 'onChange'] - }, - Counter: { - attrs: [ - 'onStateChange', 'onInc', - 'onDec', 'height', 'width' - ] - }, - Row: { - attrs: ['alignItems'] - }, - Column: { - attrs: ['alignItems'] - }, - Stack: { - attrs: ['alignContent'] - }, - List: { - children: ['ListItem', 'Section'], - attrs: [ - 'listDirection', 'scrollBar', 'edgeEffect', 'divider', 'editMode', 'cachedCount', 'chainAnimation', - 'onScroll', 'onReachStart', 'onReachEnd', 'onScrollStop', 'onItemDelete', 'onItemMove' - ] - }, - ListItem: { - parents: ['List'], - single: true, - attrs: ['sticky', 'editable'] - }, - Grid: { - children: ['GridItem'], - attrs: ['columnsTemplate', 'rowsTemplate', 'columnsGap', 'rowsGap', 'scrollBar', 'scrollBarWidth', 'scrollBarColor'] - }, - GridItem: { - parents: ['Grid'], - single: true, - attrs: ['rowStart', 'rowEnd', 'columnStart', 'columnEnd', 'forceRebuild'] - }, - GridContainer: { - attrs: ['columns', 'sizeType', 'gutter', 'margin'] - }, - Hyperlink: { - attrs: ['color'] - }, - Swiper: { - attrs: [ - 'index', 'autoPlay', 'interval', 'indicator', - 'loop', 'duration', 'vertical', 'itemSpace', 'displayMode', 'onChange' - ] - }, - Rating: { - attrs: ['stars', 'stepSize', 'starStyle', 'onChange'] - }, - Calendar: { - attrs: [ - 'date', 'showLunar', 'startOfWeek', 'offDays', 'onSelectChange', 'onRequestData', - 'currentData', 'preData', 'nextData', 'needSlide', 'showHoliday', 'direction', - 'currentDayStyle', 'nonCurrentDayStyle', 'todayStyle', 'weekStyle', 'workStateStyle' - ] - }, - Panel: { - attrs: [ - 'type', 'mode', 'dragBar', 'fullHeight', - 'halfHeight', 'miniHeight', 'show', 'onChange' - ] - }, - Navigator: { - single: true, - attrs: ['target', 'type', 'params', 'active'] - }, - Sheet: { - children: ['Section'], - attrs: [] - }, - Section: { - attrs: [] - }, - QRCode: { - attrs: ['color', 'backgroundColor'] - }, - Flex: { - attrs: [] - }, - LoadingProgress: { - atomic: true, - attrs: ['color'] - }, - NavigationView: { - attrs: [] - }, - Scroll: { - attrs: [ - 'scrollable', 'onScroll', 'onScrollEdge', 'onScrollEnd', 'scrollBar', 'scrollBarColor', - 'scrollBarWidth', 'edgeEffect' - ] - }, - Shape: { - children: ['Rect', 'Path', 'Circle', 'Ellipse', 'Shape', 'Polyline', 'Polygon', 'Image', 'Text'], - attrs: [ - 'stroke', 'fill', 'strokeDashOffset', 'strokeLineCap', - 'strokeLineJoin', 'strokeMiterLimit', 'strokeOpacity', - 'fillOpacity', 'strokeWidth', 'antiAlias', 'strokeDashArray', - 'viewPort' - ] - }, - Progress: { - atomic: true, - attrs: [ - 'value', 'color', 'cricularStyle', 'circularStyle' - ] - }, - Rect: { - atomic: true, - attrs: [ - 'radiusWidth', 'radiusHeight', 'radius' - ] - }, - Path: { - atomic: true, - attrs: [ - 'commands' - ] - }, - Circle: { - atomic: true - }, - Ellipse: { - atomic: true - }, - Camera: { - atomic: true, - attrs: ['devicePosition'] - }, - Tabs: { - children: ['TabContent'], - attrs: [ - 'vertical', 'scrollable', 'barMode', 'barWidth', 'barHeight', 'animationDuration', - 'onChange' - ] - }, - TabContent: { - parents: ['Tabs'], - attrs: ['tabBar'] - }, - PageTransitionEnter: { - atomic: true, - noDebugLine: true, - attrs: ['onEnter'] - }, - PageTransitionExit: { - atomic: true, - noDebugLine: true, - attrs: ['onExit'] - }, - Blank: { - parents: ['Row', 'Column'], - atomic: true, - attrs: ['color'] - }, - RowSplit: { - attrs: ['resizeable'] - }, - ColumnSplit: { - attrs: ['resizeable'] - }, - Toggle: { - attrs: ['onChange', 'selectedColor', 'swithPointStyle'] - }, - AlertDialog: { - attrs: ['show'] - }, - ActionSheet: { - attrs: ['show'] - }, - Video: { - atomic: true, - attrs: [ - 'muted', 'autoPlay', 'controls', 'loop', 'objectFit', 'onSeeking', 'onFullscreenChange', - 'onStart', 'onPause', 'onPrepared', 'onFinish', 'onSeeked', 'onUpdate', 'onError' - ] - }, - AbilityComponent: { - attrs: ['onReady', 'onDestroy', 'onAbilityCreated', 'onAbilityMoveToFront', 'onAbilityWillRemove'] - }, - AlphabetIndexer: { - attrs: [ - 'onSelected', 'selectedColor', 'popupColor', 'selectedBackgroundColor', 'popupBackground', 'usingPopup', - 'selectedFont', 'popupFont', 'itemSize', 'font', 'color', 'alignStyle' - ] - }, - Radio: { - atomic: true, - attrs: ['checked', 'onChange'] - }, - Web: { - atomic: true, - attrs: ['pagestart', 'pagefinish', 'error','message', 'reload'] - }, - GeometryView: { - atomic: true - }, - DataPanel: { - atomic: false, - attrs: ['closeEffect'] - }, - Badge: { - atomics: true, - attrs: [] - }, - Line: { - atomic: true, - attrs: [ - 'startPoint','endPoint' - ] - }, - Polygon: { - atomic: true, - attrs: ['points'] - }, - Polyline: { - atomic: true, - attrs: ['points'] - }, - Gauge: { - atomic: true, - attrs: ['value', 'startAngle', 'endAngle', 'colors', 'strokeWidth', 'labelTextConfig', 'labelColorConfig'] - }, - TextArea: { - atomic: true, - attrs: [ - 'placeholderColor', 'placeholderFont', 'textAlign', 'caretColor', 'onChange' - ] - }, - TextInput: { - atomic: true, - attrs: [ - 'type', 'placeholderColor', 'placeholderFont', 'enterKeyType', 'caretColor', 'maxLength', 'onEditChanged', - 'onSubmit', 'onChange' - ] - }, - Marquee: { - atomic: true, - attrs: ['fontColor', 'fontSize', 'allowScale', 'fontWeight', 'fontFamily', 'onStart', 'onBounce', 'onFinish'] - }, - Menu: { - children: ['Option'], - attrs: ['show', 'showPosition', 'fontColor', 'fontSize', 'fontWeight', 'fontFamily'], - }, - Option: { - parents: ['Menu'], - attrs: ['fontColor', 'fontSize', 'fontWeight', 'fontFamily'], - }, -}; -const COMMON_ATTRS: Set = new Set([ - 'width', 'height', 'size', 'constraintSize', 'layoutPriority', 'layoutWeight', - 'padding', 'paddingLeft', 'paddingRight', 'paddingTop', 'paddingBottom', - 'margin', 'marginLeft', 'marginRight', 'marginTop', 'marginBottom', - 'border', 'borderStyle', 'borderWidth', 'borderColor', 'borderRadius', - 'backgroundColor', 'backgroundImage', 'backgroundImageSize', 'backgroundImagePosition', - 'opacity', 'animation', 'transition', - 'navigationTitle', 'navigationSubTitle', 'hideNavigationBar', 'hideNavigationBackButton', - 'toolBar', 'hideToolBar', 'onClick', 'onTouch', 'onKeyEvent', 'onHover', - 'blur', 'backdropBlur', 'windowBlur', 'translate', 'rotate', 'scale', 'transform', - 'onAppear', 'onDisAppear', 'visibility', 'flexBasis', 'flexShrink', 'flexGrow', 'alignSelf', - 'useAlign', 'zIndex', 'sharedTransition', 'direction', 'align', 'position', 'markAnchor', 'offset', - 'enabled', 'aspectRatio', 'displayPriority', - 'onDrag', 'onDragEnter', 'onDragMove', 'onDragLeave', 'onDrop', - 'overlay', 'linearGradient', 'sweepGradient', 'radialGradient', - 'gridOffset', 'gridSpan', 'useSizeType', - 'motionPath', 'clip', 'shadow', 'mask', - 'accessibilityGroup', 'accessibilityText', 'accessibilityDescription', - 'accessibilityImportance', 'onAccessibility', 'grayscale', 'brightness', 'contrast', - 'saturate', 'geometryTransition', - 'bindPopup', 'colorBlend', 'invert', 'sepia', 'hueRotate', 'bindMenu' -]); +} + +let COMMON_ATTRS: Set = new Set([]); + +(function readComponents() { + const componentsFile: string = path.join(__dirname, '../components'); + const files: string[] = fs.readdirSync(componentsFile); + files.forEach(function(item) { + const fPath: string = path.join(componentsFile, item); + const json: any = require(fPath); + const stat: any = fs.statSync(fPath); + if (stat.isFile()) { + if (json.name) { + const compName: string = json.name; + delete json.name; + COMPONENT_MAP[compName] = json; + } else { + COMMON_ATTRS = new Set(json.attrs) + } + } + }); +})() + const TRANSITION_COMMON_ATTRS: Set = new Set([ 'slide', 'translate', 'scale', 'opacity' ]);