From 4b3eede7604e4ea1f24fc7cd82e09d7e90d13f4f Mon Sep 17 00:00:00 2001 From: bayanxing Date: Tue, 22 Feb 2022 14:00:50 +0800 Subject: [PATCH] add tabs testcase Signed-off-by: bayanxing --- ace/ace_standard/src/main/config.json | 12 +- .../js/default/pages/divider/router/index.js | 2 +- .../main/js/default/pages/option/index.css | 80 -- .../main/js/default/pages/option/index.hml | 20 - .../src/main/js/default/pages/option/index.js | 34 - .../js/default/pages/option/prop/index.css | 368 ++++++++ .../js/default/pages/option/prop/index.hml | 180 ++++ .../js/default/pages/option/prop/index.js | 134 +++ .../js/default/pages/option/router/index.css | 373 ++++++++ .../js/default/pages/option/router/index.hml | 271 ++++++ .../js/default/pages/option/router/index.js | 516 +++++++++++ .../main/js/default/pages/picker/index.css | 67 -- .../main/js/default/pages/picker/index.hml | 22 - .../src/main/js/default/pages/picker/index.js | 80 -- .../js/default/pages/picker/prop/index.css | 392 +++++++++ .../js/default/pages/picker/prop/index.hml | 211 +++++ .../js/default/pages/picker/prop/index.js | 152 ++++ .../js/default/pages/picker/router/index.css | 376 ++++++++ .../js/default/pages/picker/router/index.hml | 331 ++++++++ .../js/default/pages/picker/router/index.js | 581 +++++++++++++ .../js/default/pages/pickerView/index.css | 56 -- .../js/default/pages/pickerView/index.hml | 7 - .../main/js/default/pages/pickerView/index.js | 41 - .../default/pages/pickerView/prop/index.css | 370 ++++++++ .../default/pages/pickerView/prop/index.hml | 207 +++++ .../js/default/pages/pickerView/prop/index.js | 140 +++ .../default/pages/pickerView/router/index.css | 385 +++++++++ .../default/pages/pickerView/router/index.hml | 327 +++++++ .../default/pages/pickerView/router/index.js | 547 ++++++++++++ .../main/js/default/pages/progress/index.css | 39 - .../main/js/default/pages/progress/index.hml | 13 - .../main/js/default/pages/progress/index.js | 20 - .../js/default/pages/progress/prop/index.css | 385 +++++++++ .../js/default/pages/progress/prop/index.hml | 175 ++++ .../js/default/pages/progress/prop/index.js | 142 ++++ .../default/pages/progress/router/index.css | 358 ++++++++ .../default/pages/progress/router/index.hml | 334 ++++++++ .../js/default/pages/progress/router/index.js | 516 +++++++++++ .../src/main/js/default/test/List.test.js | 6 +- .../main/js/default/test/dividerProps.test.js | 725 ++++++++++++++++ .../main/js/default/test/optionProps.test.js | 764 +++++++++++++++++ .../main/js/default/test/pickerProps.test.js | 779 +++++++++++++++++ .../js/default/test/pickerViewProps.test.js | 779 +++++++++++++++++ .../js/default/test/progressProps.test.js | 801 ++++++++++++++++++ 44 files changed, 11633 insertions(+), 485 deletions(-) delete mode 100644 ace/ace_standard/src/main/js/default/pages/option/index.css delete mode 100644 ace/ace_standard/src/main/js/default/pages/option/index.hml delete mode 100644 ace/ace_standard/src/main/js/default/pages/option/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/option/prop/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/option/prop/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/option/prop/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/option/router/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/option/router/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/option/router/index.js delete mode 100644 ace/ace_standard/src/main/js/default/pages/picker/index.css delete mode 100644 ace/ace_standard/src/main/js/default/pages/picker/index.hml delete mode 100644 ace/ace_standard/src/main/js/default/pages/picker/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/picker/prop/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/picker/prop/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/picker/prop/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/picker/router/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/picker/router/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/picker/router/index.js delete mode 100644 ace/ace_standard/src/main/js/default/pages/pickerView/index.css delete mode 100644 ace/ace_standard/src/main/js/default/pages/pickerView/index.hml delete mode 100644 ace/ace_standard/src/main/js/default/pages/pickerView/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/pickerView/prop/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/pickerView/prop/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/pickerView/prop/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/pickerView/router/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/pickerView/router/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/pickerView/router/index.js delete mode 100644 ace/ace_standard/src/main/js/default/pages/progress/index.css delete mode 100644 ace/ace_standard/src/main/js/default/pages/progress/index.hml delete mode 100644 ace/ace_standard/src/main/js/default/pages/progress/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/progress/prop/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/progress/prop/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/progress/prop/index.js create mode 100644 ace/ace_standard/src/main/js/default/pages/progress/router/index.css create mode 100644 ace/ace_standard/src/main/js/default/pages/progress/router/index.hml create mode 100644 ace/ace_standard/src/main/js/default/pages/progress/router/index.js create mode 100644 ace/ace_standard/src/main/js/default/test/dividerProps.test.js create mode 100644 ace/ace_standard/src/main/js/default/test/optionProps.test.js create mode 100644 ace/ace_standard/src/main/js/default/test/pickerProps.test.js create mode 100644 ace/ace_standard/src/main/js/default/test/pickerViewProps.test.js create mode 100644 ace/ace_standard/src/main/js/default/test/progressProps.test.js diff --git a/ace/ace_standard/src/main/config.json b/ace/ace_standard/src/main/config.json index fbb289622..05b06230e 100755 --- a/ace/ace_standard/src/main/config.json +++ b/ace/ace_standard/src/main/config.json @@ -69,11 +69,15 @@ "pages/span/router/index", "pages/switch/router/index", "pages/toggle/index", - "pages/option/index", - "pages/picker/index", - "pages/pickerView/index", + "pages/option/router/index", + "pages/option/prop/index", + "pages/picker/router/index", + "pages/picker/prop/index", + "pages/pickerView/router/index", + "pages/pickerView/prop/index", "pages/piece/index", - "pages/progress/index", + "pages/progress/router/index", + "pages/progress/prop/index", "pages/qrcode/index", "pages/select/index", "pages/div/router/index", diff --git a/ace/ace_standard/src/main/js/default/pages/divider/router/index.js b/ace/ace_standard/src/main/js/default/pages/divider/router/index.js index 4988a2eb6..e778c4f80 100644 --- a/ace/ace_standard/src/main/js/default/pages/divider/router/index.js +++ b/ace/ace_standard/src/main/js/default/pages/divider/router/index.js @@ -1,5 +1,5 @@ /** - * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Copyright (c) 2022 Shenzhen kaiHong Digital Industry Development Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at diff --git a/ace/ace_standard/src/main/js/default/pages/option/index.css b/ace/ace_standard/src/main/js/default/pages/option/index.css deleted file mode 100644 index 83e590100..000000000 --- a/ace/ace_standard/src/main/js/default/pages/option/index.css +++ /dev/null @@ -1,80 +0,0 @@ - -.container { - flex-direction: column; - align-items: flex-start; - justify-content: center; -} -.title-text { - margin: 20px; -} -.menu-option1 { - color:red; - font-size:40px; - allow-scale:true; - letter-spacing:5px; - min-width: 25px; - min-height: 10px; - max-width: 300px; - max-height: 100px; - font-style:normal; - font-weight:200; - font-family:sans-serif; - text-decoration: line-through; -} -.menu-option2 { - color:pink; - font-size:30px; - allow-scale:true; - letter-spacing:5px; - min-width: 25px; - min-height: 10px; - max-width: 300px; - max-height: 50px; - font-style:normal; - font-weight:200; - font-family:sans-serif; - text-decoration: underline; -} -.menu-option3 { - color:cadetblue; - font-size:20px; - allow-scale:true; - letter-spacing:5px; - min-width: 25px; - min-height: 10px; - max-width: 300px; - max-height: 50px; - font-style:normal; - font-weight:200; - font-family:sans-serif; - text-decoration: none; -} -.select-option1 { - color:red; - font-size:40px; - allow-scale:true; - letter-spacing:5px; - min-width: 25px; - min-height: 10px; - max-width: 300px; - max-height: 50px; - font-style:normal; - font-weight:200; - font-family:sans-serif; - text-decoration: line-through; -} - -.select-option2 { - color:yellow; - font-size:40px; - allow-scale:true; - letter-spacing:5px; - min-width: 25px; - min-height: 10px; - max-width: 300px; - max-height: 50px; - font-style:normal; - font-weight:200; - font-family:sans-serif; - text-decoration: underline; -} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/option/index.hml b/ace/ace_standard/src/main/js/default/pages/option/index.hml deleted file mode 100644 index 8de807e35..000000000 --- a/ace/ace_standard/src/main/js/default/pages/option/index.hml +++ /dev/null @@ -1,20 +0,0 @@ -
- Click show popup menu1. - - - - - - Select Option - -
\ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/option/index.js b/ace/ace_standard/src/main/js/default/pages/option/index.js deleted file mode 100644 index 28718fd1a..000000000 --- a/ace/ace_standard/src/main/js/default/pages/option/index.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import prompt from '@system.prompt'; -export default { - data: { - testArray:['item1', 'item2', 'item3'] - }, - onMenuSelected(e) { - prompt.showToast({ - message: e.value - }) - }, - onTextClick() { - this.$element("apiMenu").show({x:280,y:120}); - }, - changeFruit(e) { - prompt.showToast({ - message: e.newValue - }) - } -} diff --git a/ace/ace_standard/src/main/js/default/pages/option/prop/index.css b/ace/ace_standard/src/main/js/default/pages/option/prop/index.css new file mode 100644 index 000000000..3db067e45 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/option/prop/index.css @@ -0,0 +1,368 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + flex-direction:row; + width:100%; + height:100%; +} +divider { + color: #0d0000; +} +.title{ + width: 100%; + font-size: 18px; + margin: 2px; + padding: 2px; + font-weight: bold; + text-align: center; +} + +.sub-title{ + width: 100%; + font-size: 14px; + text-align: left; + margin: 2px; + padding: 2px; +} + +.prop-container{ + flex-direction: column; + flex-weight: 1; +} + +#idProp { + flex-weight: 1; + background-color:#f00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +.classProp { + flex-weight: 1; + background-color:#0f0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#classPropNone { + flex-weight: 1; + background-color:#0000e0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#refProp { + flex-weight: 1; + background-color:#00f000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#refPropNone { + flex-weight: 1; + background-color:#00000e; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#disabledPropTrue { + flex-weight: 1; + background-color:#000f00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#disabledPropFalse { + flex-weight: 1; + background-color:#0000f0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#disabledPropNone { + flex-weight: 1; + background-color:#d00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#focusablePropTrue { + flex-weight: 1; + background-color:#00000f; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#focusablePropFalse { + flex-weight: 1; + background-color:#ff0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#focusablePropNone { + flex-weight: 1; + background-color:#0d0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dataProp { + flex-weight: 1; + background-color:#0ff000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dataPropNone { + flex-weight: 1; + background-color:#00d000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropSmall { + height: 15px; + background-color:#00ff00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropMedium { + height: 15px; + background-color:#000ff0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropLarge { + height: 15px; + background-color:#fff000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropNone{ + height: 15px; + background-color:#000d00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropRtl { + flex-weight: 1; + background-color:#0fff00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropAuto { + flex-weight: 1; + background-color:#00fff0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropLtr { + flex-weight: 1; + background-color:#000fff; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropNone { + flex-weight: 1; + background-color:#0000d0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#forPropNull { + flex-weight: 1; + background-color:#ffff00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#forPropOne { + flex-weight: 1; + background-color:#00e000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#forPropThree { + flex-weight: 1; + background-color:#000e00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#ifPropTrue { + flex-weight: 1; + background-color:#0ffff0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#ifPropFalse { + flex-weight: 1; + background-color:#00ffff; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#ifPropNone { + flex-weight: 1; + background-color:#00000d; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#showPropTrue { + flex-weight: 1; + background-color:#e00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#showPropFalse { + flex-weight: 1; + background-color:#0e0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#showPropNone { + flex-weight: 1; + background-color:#c00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +.specific-container{ + flex-direction: column; + flex-weight: 1; +} + +#selectedTrue { + color: #0d0000; + background-color: skyblue; + height: 40px; + margin: 2px; +} + +#selectedFalse { + background-color: skyblue; + height: 40px; + margin: 2px; +} + +#optionValue { + background-color: skyblue; + height: 40px; + margin: 2px; +} diff --git a/ace/ace_standard/src/main/js/default/pages/option/prop/index.hml b/ace/ace_standard/src/main/js/default/pages/option/prop/index.hml new file mode 100644 index 000000000..6fbb2d712 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/option/prop/index.hml @@ -0,0 +1,180 @@ + + +
+
+ + option通用属性 + + + + 通用属性 -- id + + + + + 通用属性 -- class + + + + + + + 通用属性 -- style + + + + + 通用属性 -- ref + + + + + + 通用属性 -- disabled + + + + + + + 通用属性 -- focusable + + + + + + + 通用属性 -- data-* + + + + + + 通用属性 -- click-effect + + + + + + + + 通用属性 -- dir + + + + + + + + 渲染属性 -- for + + + + + + + 渲染属性 -- if + + + + + 渲染属性 -- show + + + + +
+ +
+
+
+ + option特有属性 + + + option特有属性 -- selected + + + + option特有属性 -- value + + + + option特有属性 -- icon + + +
+
diff --git a/ace/ace_standard/src/main/js/default/pages/option/prop/index.js b/ace/ace_standard/src/main/js/default/pages/option/prop/index.js new file mode 100644 index 000000000..7dad22496 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/option/prop/index.js @@ -0,0 +1,134 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import prompt from '@system.prompt'; + +export default { + data:{ + listOne:[{}], + listThree:[{},{},{}], + idProp : null, + classProp : null, + classPropNone : null, + styleProp : null, + refProp : null, + refPropNone : null, + disabledPropTrue : null, + disabledPropFalse : null, + disabledPropNone : null, + focusablePropTrue : null, + focusablePropFalse : null, + focusablePropNone : null, + dataProp : null, + dataPropNone : null, + clickEffectPropSmall : null, + clickEffectPropMedium : null, + clickEffectPropLarge : null, + clickEffectPropNone : null, + dirPropRtl : null, + dirPropAuto : null, + dirPropLtr : null, + dirPropNone : null, + forPropNull : null, + forPropOne : null, + forPropThree : null, + ifPropTrue : null, + showPropTrue : null, + showPropFalse : null, + showPropNone : null, + selectedTrue: null, + selectedFalse: null, + optionValue: null, + optionIcon: false + }, + + onCreate(){ + this.getCommonPropValues(); + this.getSpecificPropValues(); + globalThis.value = { + idProp : this.idProp, + classProp : this.classProp, + classPropNone : this.classPropNone, + styleProp : this.styleProp, + refProp : this.refProp, + refPropNone : this.refPropNone, + disabledPropTrue : this.disabledPropTrue, + disabledPropFalse : this.disabledPropFalse, + disabledPropNone : this.disabledPropNone, + focusablePropTrue : this.focusablePropTrue, + focusablePropFalse : this.focusablePropFalse, + focusablePropNone : this.focusablePropNone, + dataProp : this.dataProp, + dataPropNone : this.dataPropNone, + clickEffectPropSmall : this.clickEffectPropSmall, + clickEffectPropMedium : this.clickEffectPropMedium, + clickEffectPropLarge : this.clickEffectPropLarge, + clickEffectPropNone : this.clickEffectPropNone, + dirPropRtl : this.dirPropRtl, + dirPropAuto : this.dirPropAuto, + dirPropLtr : this.dirPropLtr, + dirPropNone : this.dirPropNone, + forPropNull : this.forPropNull, + forPropOne : this.forPropOne, + forPropThree : this.forPropThree, + ifPropTrue : this.ifPropTrue, + showPropTrue : this.showPropTrue, + showPropFalse : this.showPropFalse, + showPropNone : this.showPropNone, + selectedTrue: this.selectedTrue, + selectedFalse: this.selectedFalse, + optionValue: this.optionValue, + optionIcon: this.optionIcon + } + }, + + getCommonPropValues(){ + this.idProp = this.$element("idProp").getInspector() + this.classProp = this.$element("classProp").getInspector() + this.classPropNone = this.$element("classPropNone").getInspector() + this.styleProp = this.$element("styleProp").getInspector() + this.refProp = this.$element("refProp").getInspector() + this.refPropNone = this.$element("refPropNone").getInspector() + this.disabledPropTrue = this.$element("disabledPropTrue").getInspector() + this.disabledPropFalse = this.$element("disabledPropFalse").getInspector() + this.disabledPropNone = this.$element("disabledPropNone").getInspector() + this.focusablePropTrue = this.$element("focusablePropTrue").getInspector() + this.focusablePropFalse = this.$element("focusablePropFalse").getInspector() + this.focusablePropNone = this.$element("focusablePropNone").getInspector() + this.dataProp = this.$element("dataProp").getInspector() + this.dataPropNone = this.$element("dataPropNone").getInspector() + this.clickEffectPropSmall = this.$element("clickEffectPropSmall").getInspector() + this.clickEffectPropMedium = this.$element("clickEffectPropMedium").getInspector() + this.clickEffectPropLarge = this.$element("clickEffectPropLarge").getInspector() + this.clickEffectPropNone = this.$element("clickEffectPropNone").getInspector() + this.dirPropRtl = this.$element("dirPropRtl").getInspector() + this.dirPropAuto = this.$element("dirPropAuto").getInspector() + this.dirPropLtr = this.$element("dirPropLtr").getInspector() + this.dirPropNone = this.$element("dirPropNone").getInspector() + this.forPropNull = this.$element("forPropNull").getInspector() + this.forPropOne = this.$element("forPropOne").getInspector() + this.forPropThree = this.$element("forPropThree").getInspector() + this.ifPropTrue = this.$element("ifPropTrue").getInspector() + this.showPropTrue = this.$element("showPropTrue").getInspector() + this.showPropFalse = this.$element("showPropFalse").getInspector() + this.showPropNone = this.$element("showPropNone").getInspector() + }, + getSpecificPropValues () { + this.selectedTrue = this.$element("selectedTrue").getInspector() + this.selectedFalse = this.$element("selectedFalse").getInspector() + this.optionValue = this.$element("optionValue").getInspector() + this.optionIcon = this.$element("optionIcon").getInspector() + } +} diff --git a/ace/ace_standard/src/main/js/default/pages/option/router/index.css b/ace/ace_standard/src/main/js/default/pages/option/router/index.css new file mode 100644 index 000000000..f6927c154 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/option/router/index.css @@ -0,0 +1,373 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + flex-direction:row; + width:100%; + height:100%; + padding: 1px; +} + +.sub-container{ + flex-direction: column; + height: 100%; + flex-weight: 1; +} + +.style-container{ + flex-direction: column; + height: 70%; +} +.contain1{ + width: 100%; + height: 15%; + flex-direction: column; +} + +.ani-container{ + flex-direction: column; + height: 100%; + flex-weight: 1; +} + +.prop-container{ + flex-direction: column; + height: 45%; + padding-left: 2px; +} + +.event-container{ + flex-direction: column; + height: 40%; +} + +.function-container{ + flex-direction: column; + height: 25%; +} + +.gradient-container{ + flex-direction: column; + height: 40%; +} + +.access-container{ + flex-direction: column; + height: 15%; +} + +.atom-container{ + flex-direction: column; + height: 45%; +} + +.multimode-container{ + flex-direction: column; + height: 45%; +} + +.title{ + width: 100%; + font-size: 18px; + margin: 2px; + font-weight: bold; + text-align: center; +} +.sub-title{ + width: 100%; + height: 25px; + font-size: 15px; + text-align: left; + margin-bottom: 1px; + padding: 2px; +} + +.style1{ + width: 100%; + mask-color:red; + height: 100%; + min-width: 25px; + min-height: 10px; + max-width: 300px; + max-height: 50px; + padding-left: 10px; + padding-top: 1px; + padding-right: 15px; + padding-bottom: 1px; + margin-left: 10px; + margin-top: 0px; + margin-right: 15px; + margin-bottom: 5px; + border-left-style: solid; + border-right-style: dashed; + border-top-style: dashed; + border-bottom-style: dotted; + border-left-width: 1px; + border-right-width: 2px; + border-top-width: 2px; + border-bottom-width: 1px; + border-left-color: #ff0000; + border-right-color: #00ff00; + border-top-color: #0000ff; + border-bottom-color: #fff000; + border-bottom-left-radius: 10px; + border-bottom-right-radius: 15px; + border-top-left-radius: 8px; + border-top-right-radius: 12px; + background: linear-gradient(pink,#fff000); + box-shadow: 2px 4px 6px 8px #888888; + opacity: 0.5; + display: flex; + visibility: visible; + align-self: center; + image-fill: #000fff; + clip-path: margin-box; +} + +.style2{ + width: 70%; + height: 12%; + padding-start: 10px; + padding-end: 15px; + margin-start: 5px; + margin-end: 10px; + border-style: dotted; + border-width: 2px; + border-color:#000000; + border-radius:5px; + background-color:#ffaa00; + mask-image: url('common/images/icon.png'); + mask-size: cover; + mask-position: center; +} + +.style3{ + width: 100%; + padding: 10px; + margin: 5px; + border-left: 1px solid #000000; + border-right: 2px dashed #00ff00; + border-top: 1.5px dotted #0000ff; + border-bottom: 2.5px dotted #fff000; + background-image:url('common/images/image.png'); + background-size:cover; + background-repeat: repeat-x; + background-position: center; + flex:1; + flex-grow: 2; + flex-basis: 10px; + flex-shrink: 1; +} + +.style4{ + width: 60%; + height: 5%; + padding: 1px; + margin: 5px; + border: 2px solid #000000; +} + +.style5{ + width: 50%; + height: 30px; + background-color: yellow; + border-image-source: url('/common/images/image.png'); + border-image-slice: 1px 2px 3px 4px; + border-image-width: 2px 3px 4px 5px; + border-image-outset: 3px 4px 5px 6px; + border-image-repeat: repeat; +} + +.style6{ + width: 70px; + height: 30px; + position: absolute; + left: 10px; + top: 35px; + bottom: 5px; + right: 10px; + background-color: pink; + border-image: url('common/images/icon.png') 1px 2px 3px 4px 2px 3px 4px 5px 3px 4px 5px 6px round; +} + +.style7 { + color: red; + font-size: 20px; + allow-scale: true; + font-weight: 700; + text-decoration: underline; + font-family: HYQiHei-65S; +} + +.event1{ + width: 100%; + height: 40px; + background-color: salmon; +} + +.event2{ + width: 100%; + height: 40px; + background-color: darkorchid; +} + +.event3{ + width: 100%; + height: 40px; + background-color: #ad4e2a; +} + +.event4{ + width: 100%; + height: 40px; + background-color: blanchedalmond; +} + +.event5{ + width: 100%; + height: 40px; + background-color: blanchedalmond; +} + + +#prop1 { + background-color: mediumslateblue; + height: 40px; + margin: 2px; +} + +.prop2 { + background-color: salmon; + height: 40px; + margin: 2px; +} + +.prop4 { + background-color: skyblue; + height: 40px; + margin: 2px; +} + +.prop5 { + background-color: gold; + height: 40px; + width: 100%; + margin: 2px; +} + + +.ani1{ + color: #72ac33; + margin: 5px; + transform-origin: 0% 0%; + animation: ani1Go 3s infinite; +} + +@keyframes ani1Go +{ + from { + background-color: #f76160; + opacity:0.3; + width:50px; + height: 50px; + transform:translate(20px) rotate(10deg) scale(0.2) skew(40deg); + background-position:10% 10% + } + 30% { + background-color: #60f761; + opacity:0.5; + width:70px; + height: 70px; + background-position:12% 12%; + transform:translateX(10px) translateY(5px) rotateX(20deg) rotateY(25deg) scaleX(0.6) scaleY(0.5) skewX(25deg) skewY(15deg) + } + to { + background-color: #6160f7; + opacity:1; + width:90px; + height: 90px; + background-position:22% 22%; + transform:rotate(180deg) scale(2) + } +} + +.ani2{ + background-color: #ad4e2a; + width: 100%; + height: 55px; + margin: 5px; +} + +.gradient1{ + margin: 5px; + height: 40px; + background: linear-gradient(red, #00ff00); +} + +.gradient2{ + margin: 5px; + height: 40px; + background: linear-gradient(45deg, rgb(255,0,0),rgb(0, 255, 0)); +} + +.gradient3{ + margin: 5px; + height: 40px; + background: linear-gradient(to right, rgb(255,0,0) 90px, rgb(0, 255, 0) 60%); +} + +.gradient4{ + margin: 5px; + height: 40px; + background: repeating-linear-gradient(to right, rgba(255, 255, 0, 1) 30px,rgba(0, 0, 255, .5) 60px); +} + +.access1{ + color: #321124; + height: 40px; + margin: 5px; +} + +.multimode1{ + background-color: firebrick; + height: 40px; + margin: 5px; +} + + +.function1{ + background-color: #ff0000; + width: 60%; + height: 30px; +} + +.function2{ + background-color: #00ff00; + width: 60%; + height: 30px; +} + +.function3{ + background-color: #0000ff; + width: 100%; + height: 30px; +} + +.function4 { + flex-direction: row; + width: 60%; + height: 60px; + overflow: scroll; +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/option/router/index.hml b/ace/ace_standard/src/main/js/default/pages/option/router/index.hml new file mode 100644 index 000000000..9efbd70fa --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/option/router/index.hml @@ -0,0 +1,271 @@ + + +
+
+ +
+ + 通用样式 + + + option通用样式1 + + + + + option通用样式2 + + + + + option通用样式3 + + + + + option通用样式4 + + + + + option通用样式5 + +
+ + +
+ + + option特有样式 + + +
+ + + + +
+ + 动画样式 + + + + option动画样式1 + + + + + option动画样式2 + + + +
+
+ +
+
+ +
+ +
+ + 通用属性 + + + option通用属性1 + + + + + option通用属性2 + + + + + option通用属性3 + + + + + option特有属性4 + + + + option特有属性5 + + +
+
+
+
+ +
+
+ +
+ +
+ + 渐变样式 + + + + option渐变样式1 + + + + + option渐变样式2 + + + + + option渐变样式3 + + + + + option渐变样式4 + + +
+
+
+ +
+ + 无障碍 + + + option无障碍1 + + +
+
+
+ +
+ + 原子布局 + + + option原子布局1 + +
+ + + +
+ + option原子布局2 + +
+ + + +
+ + option原子布局3 + +
+ + + +
+
+
+
+ + 多模输入 + + + option多模输入1 + + +
+
+
+
+ + + + + + diff --git a/ace/ace_standard/src/main/js/default/pages/option/router/index.js b/ace/ace_standard/src/main/js/default/pages/option/router/index.js new file mode 100644 index 000000000..94ba7b359 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/option/router/index.js @@ -0,0 +1,516 @@ +/** + * Copyright (c) 2022 Shenzhen kaiHong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import prompt from '@system.prompt'; + +var options = { + duration: 1500, + easing: 'friction', + delay: 100, + fill: 'forwards', + iterations: 2, + direction: 'normal', +}; +var frames = [ + { + transform: { + translate: '-120px', + rotate:'10deg', + scale:0.2, + skew:'40deg' + }, + opacity: 0.1, + offset: 0.0, + width: '40%', + height:'20px', + backgroundColor:'#ff0000', + backgroundPosition:'10px 20px', + transformOrigin:'left top' + }, + { + transform: { + translateX: '0px', + translateY: '5px', + rotateX:'10deg', + rotateY:'10deg', + scaleX:0.5, + scaleY:0.7, + skewX:'22deg', + skewY:'30deg' + }, + opacity: 0.6, + offset: 2.0, + width: '60%', + height:'30px', + backgroundColor:'#ff00ff', + backgroundPosition:'15px 25px', + transformOrigin:'center top' + }, + { + transform: { + translateX: '100px', + translateY: '0px', + translateZ: '20px', + rotateX:'0deg', + rotateY:'0deg', + rotateZ:'30deg', + scaleX:1, + scaleY:1, + scaleZ:2, + skewX:'0', + skewY:'0', + skewZ:'30deg' + }, + opacity: 1, + offset: 0.0, + width: '100%', + height:'30px', + backgroundColor:'#ffff00', + backgroundPosition:'0px', + transformOrigin:'center center' + }, +]; + +export default { + + onMenuSelected(e) { + prompt.showToast({ + message: e.value + }) + }, + onTextClick1() { + this.$element('apiMenu1').show({x:120,y:10}); + }, + onTextClick2() { + this.$element('apiMenu2').show({x:120,y:80}); + }, + onTextClick3() { + this.$element('apiMenu3').show({x:120,y:150}); + }, + onTextClick4() { + this.$element('apiMenu4').show({x:120,y:220}); + }, + onTextClick5() { + this.$element('apiMenu5').show({x:120,y:290}); + }, + onTextClick6() { + this.$element('apiMenu6').show({x:120,y:360}); + }, + onTextClick7() { + this.$element('apiMenu7').show({x:120,y:650}); + }, + + onShow(){ + // 通用属性 + var prop1 = this.$element('prop1'); + var name1 = prop1.dataSet.name + var prop2 = this.$refs.prop2; + var name2 = prop2.dataSet.name + prompt.showToast({ + message: 'prop1--' + name1 + '\nprop2--' + name2 + }); + }, + + touchStart(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchstart:\n' + message + }); + }, + + touchMove(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchMove:\n' +message + }); + }, + + touchEnd(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchEnd:\n' +message + }); + }, + + touchCancel(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchCancel:\n' +message + }); + }, + + click(){ + prompt.showToast({ + message: 'click' + }); + }, + + doubleClick(){ + prompt.showToast({ + message: 'doubleClick' + }); + }, + + longPress(){ + prompt.showToast({ + message: 'longPress' + }); + }, + + focus(){ + prompt.showToast({ + message: 'focus' + }); + }, + + blur(){ + prompt.showToast({ + message: 'blur' + }); + }, + + key(event){ + var code = event.code; + var action = event.action; + var repeatCount = event.repeatCount; + var timestampStart = event.timestampStart; + var message = 'code--' + code + ',action--' + action + + ',repeatCount--' + repeatCount + ',timestampStart--' + timestampStart; + prompt.showToast({ + message: 'key:\n' + message + }); + }, + + swipe(event){ + var direction = event.direction; + var distance = event.distance; + var message = 'direction--' + direction + ',distance--' + distance; + prompt.showToast({ + message: 'swipe:\n' + message + }); + }, + + attached(){ + prompt.showToast({ + message: 'attached' + }); + }, + + detached(){ + prompt.showToast({ + message: 'detached' + }); + }, + + pinchStart(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchStart:\n' + message + }); + }, + + pinchUpdate(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchUpdate:\n' + message + }); + }, + + pinchEnd(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchUpdate:\n' + message + }); + }, + + pinchCancel(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchCancel:\n' + message + }); + }, + + dragStart(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragStart:\n' + message + }); + }, + + drag(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'drag:\n' + message + }); + }, + + dragEnd(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragEnd:\n' + message + }); + }, + + dragEnter(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragEnter:\n' + message + }); + }, + + dragOver(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragOver:\n' + message + }); + }, + + dragLeave(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragLeave:\n' + message + }); + }, + + drop(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'drop:\n' + message + }); + }, + + functionTest1(event){ + var function1 = this.$element('function1'); + function1.focus(true) + var rect = function1.getBoundingClientRect(); + var width = rect.width; + var height = rect.height; + var left = rect.left; + var top = rect.top; + var message = 'width--' + width + ',height--' + height + + ',left--' + left + ',top--' + top; + prompt.showToast({ + message: 'function1 rect:\n' + message + }); + }, + + functionTest2(event){ + var function2 = this.$element('function2'); + let observer = function2.createIntersectionObserver({ + ratios: [0.2, 0], // number + }); + observer.observe((isVisible, ratio)=> { + console.info('this element is ' + isVisible + 'ratio is ' + ratio) + prompt.showToast({ + message: 'function2 observer:\n' + 'isVisible--' + isVisible + ',ratio--' + ratio + }); + }) + + observer.unobserve() + }, + + functionTest3(event){ + var function3 = this.$element('function3'); + + var animation = function3.animate(frames, options); + animation.play() + animation.onfinish = function(){ + prompt.showToast({ + message: 'The animation is finished.' + }); + }; + + animation.oncancel = function(){ + prompt.showToast({ + message: 'The animation is canceled.' + }); + }; + + animation.onrepeat = function(){ + prompt.showToast({ + message: 'The animation is repeated.' + }); + }; + + setTimeout(() => { + animation.reverse() + }, 500) + + setTimeout(() => { + animation.pause() + }, 1000) + + setTimeout(() => { + animation.cancel() + }, 1500) + }, + + functionTest4(event){ + var function4 = this.$element('function4'); + var scrollOffset = function4.getScrollOffset(); + var x = scrollOffset.x; + var y = scrollOffset.y; + var message = 'x--' + x + ',y--' + y; + prompt.showToast({ + message: 'functionTest4 scrollOffset:\n' + message + }); + + var scrollParam = { + dx:60, + dy:0, + smooth:true + } + function4.scrollBy(scrollParam) + }, + + reachStart(){ + prompt.showToast({ + message: 'reachStart' + }); + }, + + reachEnd(){ + prompt.showToast({ + message: 'reachEnd' + }); + }, + + reachTop(){ + prompt.showToast({ + message: 'reachTop' + }); + }, + + reachBottom(){ + prompt.showToast({ + message: 'reachBottom' + }); + } +} diff --git a/ace/ace_standard/src/main/js/default/pages/picker/index.css b/ace/ace_standard/src/main/js/default/pages/picker/index.css deleted file mode 100644 index fc2ec14e5..000000000 --- a/ace/ace_standard/src/main/js/default/pages/picker/index.css +++ /dev/null @@ -1,67 +0,0 @@ -.container { - flex-direction: column; - justify-content: center; - align-items: center; -} -picker{ - width:60%; - height:80px; - min-width: 25px; - min-height: 10px; - max-width: 300px; - max-height: 100px; - margin: 10px; - padding: 20px; - border-radius:20px; - text-color:white; - font-size:15px; - margin-left:20%; - background-color: pink; -} -select{ - background-color: #efecec; - height: 50px; - width: 60%; - margin-left: 20%; - margin-top: 30px; - margin-bottom: 50px; - font-size: 22px; -} -#picker0{ - text-color: plum; - font-size: 30px; - allow-scale: true; - letter-spacing: 2px; - text-decoration: underline; - font-style: normal; - font-family: sans-serif; - line-height: 30px; - column-height: 300px; - background-color:#4747e3; - border: 3px dotted brown; -} -#picker1{ - text-color: pink; - font-size: 30px; - allow-scale: true; - letter-spacing: 5px; - text-decoration: line-through; - font-style: normal; - font-family: sans-serif; - line-height: 30px; - column-height: 300px; - border: 3px solid brown; - background-color:deepskyblue; -} -#picker2{ - text-color: gray; - font-size: 20px; - allow-scale: true; - letter-spacing: 10px; - text-decoration: underline; - font-style: normal; - font-family: sans-serif; - line-height: 30px; - column-height: 300px; - background-color: orange; -} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/picker/index.hml b/ace/ace_standard/src/main/js/default/pages/picker/index.hml deleted file mode 100644 index e7aa03846..000000000 --- a/ace/ace_standard/src/main/js/default/pages/picker/index.hml +++ /dev/null @@ -1,22 +0,0 @@ - -
- - - - - - - - - - -
\ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/picker/index.js b/ace/ace_standard/src/main/js/default/pages/picker/index.js deleted file mode 100644 index 4a9c975b2..000000000 --- a/ace/ace_standard/src/main/js/default/pages/picker/index.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import prompt from '@system.prompt'; -export default { - data: { - selectList:["text","data","time","datetime","multitext"], - rangetext:['15', "20", "25"], - multitext:[["a", "b", "c"], ["e", "f", "g"], ["h", "i"], ["k", "l", "m"]], - textvalue:'default textvalue', - datevalue:'default datevalue', - timevalue:'default timevalue', - datetimevalue:'default datetimevalue', - multitextvalue:'default multitextvalue', - containsecond:true, - multitextselect:[1,2,0], - datetimeselect:'2012-5-6-11-25', - timeselect:'11:22:30', - dateselect:'2021-3-2', - textselect:'2' - }, - selectChange(e){ - for(let i = 0;i + +
+
+ + picker通用属性 + + + + 通用属性 -- id + + + picker + + + 通用属性 -- class + + + picker + + picker + + + + 通用属性 -- style + + + picker + + + 通用属性 -- ref + + + picker + + picker + + + 通用属性 -- disabled + + + picker + + picker + + picker + + + 通用属性 -- focusable + + + picker + + picker + + picker + + + 通用属性 -- data-* + + + picker + + picker + + + 通用属性 -- click-effect + + + picker + + picker + + picker + + picker + + + 通用属性 -- dir + + + picker + + picker + + picker + + picker + + + 渲染属性 -- for + + + picker + + picker + + picker + + + 渲染属性 -- if + + + picker + + + 渲染属性 -- show + + + picker + + picker + + picker +
+ +
+
+
+ + picker特有属性 + + + picker特有属性 -- type + + + + + + + + +
+
diff --git a/ace/ace_standard/src/main/js/default/pages/picker/prop/index.js b/ace/ace_standard/src/main/js/default/pages/picker/prop/index.js new file mode 100644 index 000000000..3416a2b93 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/picker/prop/index.js @@ -0,0 +1,152 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import prompt from '@system.prompt'; + +export default { + data:{ + listOne:[{}], + listThree:[{},{},{}], + idProp : null, + classProp : null, + classPropNone : null, + styleProp : null, + refProp : null, + refPropNone : null, + disabledPropTrue : null, + disabledPropFalse : null, + disabledPropNone : null, + focusablePropTrue : null, + focusablePropFalse : null, + focusablePropNone : null, + dataProp : null, + dataPropNone : null, + clickEffectPropSmall : null, + clickEffectPropMedium : null, + clickEffectPropLarge : null, + clickEffectPropNone : null, + dirPropRtl : null, + dirPropAuto : null, + dirPropLtr : null, + dirPropNone : null, + forPropNull : null, + forPropOne : null, + forPropThree : null, + ifPropTrue : null, + showPropTrue : null, + showPropFalse : null, + showPropNone : null, + verticalTrue: null, + verticalFalse: null, + rangetext:['15', "20", "25"], + multitext:[["a", "b", "c"], ["e", "f", "g"], ["h", "i"], ["k", "l", "m"]], + textvalue:'textvalue', + datevalue:'datevalue', + timevalue:'timevalue', + datetimevalue:'datetimevalue', + multitextvalue:'multitextvalue', + containsecond:true, + multitextselect:[1,2,0], + datetimeselect:'2012-5-6-11-25', + timeselect:'11:22:30', + dateselect:'2021-3-2', + textselect:'2', + pickerText: null, + pickerDate: null, + pickerTime: null, + pickerDatetime: null, + pickerMultiText: null + }, + + onCreate(){ + this.getCommonPropValues(); + this.getSpecificPropValues(); + globalThis.value = { + idProp : this.idProp, + classProp : this.classProp, + classPropNone : this.classPropNone, + styleProp : this.styleProp, + refProp : this.refProp, + refPropNone : this.refPropNone, + disabledPropTrue : this.disabledPropTrue, + disabledPropFalse : this.disabledPropFalse, + disabledPropNone : this.disabledPropNone, + focusablePropTrue : this.focusablePropTrue, + focusablePropFalse : this.focusablePropFalse, + focusablePropNone : this.focusablePropNone, + dataProp : this.dataProp, + dataPropNone : this.dataPropNone, + clickEffectPropSmall : this.clickEffectPropSmall, + clickEffectPropMedium : this.clickEffectPropMedium, + clickEffectPropLarge : this.clickEffectPropLarge, + clickEffectPropNone : this.clickEffectPropNone, + dirPropRtl : this.dirPropRtl, + dirPropAuto : this.dirPropAuto, + dirPropLtr : this.dirPropLtr, + dirPropNone : this.dirPropNone, + forPropNull : this.forPropNull, + forPropOne : this.forPropOne, + forPropThree : this.forPropThree, + ifPropTrue : this.ifPropTrue, + showPropTrue : this.showPropTrue, + showPropFalse : this.showPropFalse, + showPropNone : this.showPropNone, + pickerText: this.pickerText, + pickerDate: this.pickerDate, + pickerTime: this.pickerTime, + pickerDatetime: this.pickerDatetime, + pickerMultiText: this.pickerMultiText + } + }, + + getCommonPropValues(){ + this.idProp = this.$element("idProp").getInspector() + this.classProp = this.$element("classProp").getInspector() + this.classPropNone = this.$element("classPropNone").getInspector() + this.styleProp = this.$element("styleProp").getInspector() + this.refProp = this.$element("refProp").getInspector() + this.refPropNone = this.$element("refPropNone").getInspector() + this.disabledPropTrue = this.$element("disabledPropTrue").getInspector() + this.disabledPropFalse = this.$element("disabledPropFalse").getInspector() + this.disabledPropNone = this.$element("disabledPropNone").getInspector() + this.focusablePropTrue = this.$element("focusablePropTrue").getInspector() + this.focusablePropFalse = this.$element("focusablePropFalse").getInspector() + this.focusablePropNone = this.$element("focusablePropNone").getInspector() + this.dataProp = this.$element("dataProp").getInspector() + this.dataPropNone = this.$element("dataPropNone").getInspector() + this.clickEffectPropSmall = this.$element("clickEffectPropSmall").getInspector() + this.clickEffectPropMedium = this.$element("clickEffectPropMedium").getInspector() + this.clickEffectPropLarge = this.$element("clickEffectPropLarge").getInspector() + this.clickEffectPropNone = this.$element("clickEffectPropNone").getInspector() + this.dirPropRtl = this.$element("dirPropRtl").getInspector() + this.dirPropAuto = this.$element("dirPropAuto").getInspector() + this.dirPropLtr = this.$element("dirPropLtr").getInspector() + this.dirPropNone = this.$element("dirPropNone").getInspector() + this.forPropNull = this.$element("forPropNull").getInspector() + this.forPropOne = this.$element("forPropOne").getInspector() + this.forPropThree = this.$element("forPropThree").getInspector() + this.ifPropTrue = this.$element("ifPropTrue").getInspector() + this.showPropTrue = this.$element("showPropTrue").getInspector() + this.showPropFalse = this.$element("showPropFalse").getInspector() + this.showPropNone = this.$element("showPropNone").getInspector() + }, + getSpecificPropValues () { + this.pickerText = this.$element("pickerText").getInspector() + this.pickerDate = this.$element("pickerDate").getInspector() + this.pickerTime = this.$element("pickerTime").getInspector() + this.pickerDatetime = this.$element("pickerDatetime").getInspector() + this.pickerMultiText = this.$element("pickerMultiText").getInspector() + } +} diff --git a/ace/ace_standard/src/main/js/default/pages/picker/router/index.css b/ace/ace_standard/src/main/js/default/pages/picker/router/index.css new file mode 100644 index 000000000..a322b6252 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/picker/router/index.css @@ -0,0 +1,376 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + flex-direction:row; + width:100%; + height:100%; + padding: 1px; +} + +.sub-container{ + flex-direction: column; + height: 100%; + flex-weight: 1; +} + +.style-container{ + flex-direction: column; + height: 70%; +} +.contain1{ + width: 100%; + height: 15%; + flex-direction: column; +} + +.ani-container{ + flex-direction: column; + height: 100%; + flex-weight: 1; +} + +.prop-container{ + flex-direction: column; + padding-left: 2px; +} + +.event-container{ + flex-direction: column; +} + +.function-container{ + flex-direction: column; +} + +.gradient-container{ + flex-direction: column; + height: 40%; +} + +.access-container{ + flex-direction: column; + height: 15%; +} + +.atom-container{ + flex-direction: column; + height: 45%; +} + +.multimode-container{ + flex-direction: column; + height: 45%; +} + +.title{ + width: 100%; + font-size: 18px; + margin: 2px; + font-weight: bold; + text-align: center; +} +.sub-title{ + width: 100%; + height: 25px; + font-size: 15px; + text-align: left; + margin-bottom: 1px; + padding: 2px; +} + +.style1{ + width: 100%; + mask-color:red; + height: 100%; + min-width: 25px; + min-height: 10px; + max-width: 300px; + max-height: 50px; + padding-left: 10px; + padding-top: 1px; + padding-right: 15px; + padding-bottom: 1px; + margin-left: 10px; + margin-top: 0px; + margin-right: 15px; + margin-bottom: 5px; + border-left-style: solid; + border-right-style: dashed; + border-top-style: dashed; + border-bottom-style: dotted; + border-left-width: 1px; + border-right-width: 2px; + border-top-width: 2px; + border-bottom-width: 1px; + border-left-color: #ff0000; + border-right-color: #00ff00; + border-top-color: #0000ff; + border-bottom-color: #fff000; + border-bottom-left-radius: 10px; + border-bottom-right-radius: 15px; + border-top-left-radius: 8px; + border-top-right-radius: 12px; + background: linear-gradient(pink,#fff000); + box-shadow: 2px 4px 6px 8px #888888; + opacity: 0.5; + display: flex; + visibility: visible; + align-self: center; + image-fill: #000fff; + clip-path: margin-box; +} + +.style2{ + width: 70%; + height: 12%; + padding-start: 10px; + padding-end: 15px; + margin-start: 5px; + margin-end: 10px; + border-style: dotted; + border-width: 2px; + border-color:#000000; + border-radius:5px; + background-color:#ffaa00; + mask-image: url('common/images/icon.png'); + mask-size: cover; + mask-position: center; +} + +.style3{ + width: 100%; + padding: 10px; + margin: 5px; + border-left: 1px solid #000000; + border-right: 2px dashed #00ff00; + border-top: 1.5px dotted #0000ff; + border-bottom: 2.5px dotted #fff000; + background-image:url('common/images/image.png'); + background-size:cover; + background-repeat: repeat-x; + background-position: center; + flex:1; + flex-grow: 2; + flex-basis: 10px; + flex-shrink: 1; +} + +.style4{ + width: 60%; + height: 5%; + padding: 1px; + margin: 5px; + border: 2px solid #000000; +} + +.style5{ + width: 50%; + height: 30px; + background-color: yellow; + border-image-source: url('/common/images/image.png'); + border-image-slice: 1px 2px 3px 4px; + border-image-width: 2px 3px 4px 5px; + border-image-outset: 3px 4px 5px 6px; + border-image-repeat: repeat; +} + +.style6{ + width: 70px; + height: 30px; + position: absolute; + left: 10px; + top: 35px; + bottom: 5px; + right: 10px; + background-color: pink; + border-image: url('common/images/icon.png') 1px 2px 3px 4px 2px 3px 4px 5px 3px 4px 5px 6px round; +} + +.style7 { + text-color: red; + font-size: 16px; + allow-scale: true; + letter-spacing: 4px; + text-decoration: underline; + font-style: normal; + font-weight: 700; + font-family: HYQiHei-65S; + line-height: 20px; + column-height: 50px; +} +picker { + font-size: 12px; +} +.event1{ + width: 100%; + height: 20px; + background-color: salmon; +} + +.event2{ + width: 100%; + height: 20px; + background-color: darkorchid; +} + +.event3{ + width: 100%; + height: 20px; + background-color: #ad4e2a; +} + +.event4{ + width: 100%; + height: 20px; + background-color: blanchedalmond; +} + +.event5{ + width: 100%; + height: 20px; + background-color: blanchedalmond; +} + + +#prop1 { + background-color: mediumslateblue; + height: 20px; + margin: 2px; +} + +.prop2 { + background-color: salmon; + height: 20px; + margin: 2px; +} + +.prop4 { + background-color: skyblue; + height: 20px; + margin: 2px; +} + +.prop5 { + background-color: gold; + height: 20px; + width: 100%; + margin: 2px; +} + + +.ani1{ + color: #72ac33; + margin: 5px; + transform-origin: 0% 0%; + animation: ani1Go 3s infinite; +} + +@keyframes ani1Go +{ + from { + background-color: #f76160; + opacity:0.3; + width:50px; + height: 50px; + transform:translate(20px) rotate(10deg) scale(0.2) skew(40deg); + background-position:10% 10% + } + 30% { + background-color: #60f761; + opacity:0.5; + width:70px; + height: 70px; + background-position:12% 12%; + transform:translateX(10px) translateY(5px) rotateX(20deg) rotateY(25deg) scaleX(0.6) scaleY(0.5) skewX(25deg) skewY(15deg) + } + to { + background-color: #6160f7; + opacity:1; + width:90px; + height: 90px; + background-position:22% 22%; + transform:rotate(180deg) scale(2) + } +} + +.ani2{ + background-color: #ad4e2a; + width: 100%; + height: 55px; + margin: 5px; +} + +.gradient1{ + margin: 5px; + height: 40px; + background: linear-gradient(red, #00ff00); +} + +.gradient2{ + margin: 5px; + height: 40px; + background: linear-gradient(45deg, rgb(255,0,0),rgb(0, 255, 0)); +} + +.gradient3{ + margin: 5px; + height: 40px; + background: linear-gradient(to right, rgb(255,0,0) 90px, rgb(0, 255, 0) 60%); +} + +.gradient4{ + margin: 5px; + height: 40px; + background: repeating-linear-gradient(to right, rgba(255, 255, 0, 1) 30px,rgba(0, 0, 255, .5) 60px); +} + +.access1{ + color: #321124; + height: 40px; + margin: 5px; +} + +.multimode1{ + background-color: firebrick; + height: 40px; + margin: 5px; +} + + +.function1{ + background-color: #ff0000; + width: 60%; + height: 30px; +} + +.function2{ + background-color: #00ff00; + width: 60%; + height: 30px; +} + +.function3{ + background-color: #0000ff; + width: 100%; + height: 30px; +} + +.function4 { + flex-direction: row; + width: 60%; + height: 60px; + overflow: scroll; +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/picker/router/index.hml b/ace/ace_standard/src/main/js/default/pages/picker/router/index.hml new file mode 100644 index 000000000..6465105fe --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/picker/router/index.hml @@ -0,0 +1,331 @@ + + +
+
+ +
+ + 通用样式 + + + + picker通用样式1 + + + + + picker通用样式2 + + + + + picker通用样式3 + + + + + + picker通用样式4 + + + + + + picker通用样式5 + +
+ + + + +
+ + + picker特有样式 + + + +
+ + + +
+ +
+
+ +
+ +
+ + 通用属性 + + + picker通用属性1 + + + + + + picker通用属性2 + + + + + + picker通用属性3 + + + + + + picker特有属性4 + + + + + + picker特有属性5 + + + +
+
+
+ +
+ + 通用事件 + + + picker通用事件1 + + + + + + picker通用事件2 + + + + + + picker通用事件3 + + + + + + picker特有事件1 + + + +
+
+
+ +
+ + 通用方法 + + + picker通用方法1 + + + + + + + picker通用方法2 + + + + + + + picker通用方法3 + + + + + + picker特有方法1 + + + +
+
+ +
+
+ +
+ +
+ + 渐变样式 + + + + picker渐变样式1 + + + + + + picker渐变样式2 + + + + + + picker渐变样式3 + + + + + + picker渐变样式4 + + + +
+
+
+ +
+ + 无障碍 + + + picker无障碍1 + + + +
+
+
+
+ + 原子布局 + + + picker原子布局1 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + picker原子布局2 + +
+ + + + + + + + + + + + +
+ + picker原子布局3 + +
+ + + + + + + + + + + + +
+
+
+
+ + 多模输入 + + + menu多模输入1 + + + +
+
+
+
+ + + + + + diff --git a/ace/ace_standard/src/main/js/default/pages/picker/router/index.js b/ace/ace_standard/src/main/js/default/pages/picker/router/index.js new file mode 100644 index 000000000..662706b51 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/picker/router/index.js @@ -0,0 +1,581 @@ +/** + * Copyright (c) 2022 Shenzhen kaiHong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; +import prompt from '@system.prompt'; + +var options = { + duration: 1500, + easing: 'friction', + delay: 100, + fill: 'forwards', + iterations: 2, + direction: 'normal', +}; +var frames = [ + { + transform: { + translate: '-120px', + rotate:'10deg', + scale:0.2, + skew:'40deg' + }, + opacity: 0.1, + offset: 0.0, + width: '40%', + height:'20px', + backgroundColor:'#ff0000', + backgroundPosition:'10px 20px', + transformOrigin:'left top' + }, + { + transform: { + translateX: '0px', + translateY: '5px', + rotateX:'10deg', + rotateY:'10deg', + scaleX:0.5, + scaleY:0.7, + skewX:'22deg', + skewY:'30deg' + }, + opacity: 0.6, + offset: 2.0, + width: '60%', + height:'30px', + backgroundColor:'#ff00ff', + backgroundPosition:'15px 25px', + transformOrigin:'center top' + }, + { + transform: { + translateX: '100px', + translateY: '0px', + translateZ: '20px', + rotateX:'0deg', + rotateY:'0deg', + rotateZ:'30deg', + scaleX:1, + scaleY:1, + scaleZ:2, + skewX:'0', + skewY:'0', + skewZ:'30deg' + }, + opacity: 1, + offset: 0.0, + width: '100%', + height:'30px', + backgroundColor:'#ffff00', + backgroundPosition:'0px', + transformOrigin:'center center' + }, +]; + +export default { + data: { + selectList:["text","data","time","datetime","multitext"], + rangetext:['15', "20", "25"], + multitext:[["a", "b", "c"], ["e", "f", "g"], ["h", "i"], ["k", "l", "m"]], + textvalue:'default textvalue', + datevalue:'default datevalue', + timevalue:'default timevalue', + datetimevalue:'default datetimevalue', + multitextvalue:'default multitextvalue', + containsecond:true, + multitextselect:[1,2,0], + datetimeselect:'2012-5-6-11-25', + timeselect:'11:22:30', + dateselect:'2021-3-2', + textselect:'2' + }, + onMenuSelected(e) { + prompt.showToast({ + message: e.value + }) + }, + onTextClick1() { + this.$element('apiMenu1').show({x:120,y:10}); + }, + onTextClick2() { + this.$element('apiMenu2').show({x:120,y:80}); + }, + onTextClick3() { + this.$element('apiMenu3').show({x:120,y:150}); + }, + onTextClick4() { + this.$element('apiMenu4').show({x:120,y:220}); + }, + onTextClick5() { + this.$element('apiMenu5').show({x:120,y:290}); + }, + onTextClick6() { + this.$element('apiMenu6').show({x:120,y:360}); + }, + onTextClick7() { + this.$element('apiMenu7').show({x:120,y:650}); + }, + + onShow(){ + // 通用属性 + var prop1 = this.$element('prop1'); + var name1 = prop1.dataSet.name + var prop2 = this.$refs.prop2; + var name2 = prop2.dataSet.name + prompt.showToast({ + message: 'prop1--' + name1 + '\nprop2--' + name2 + }); + }, + + touchStart(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchstart:\n' + message + }); + }, + + touchMove(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchMove:\n' +message + }); + }, + + touchEnd(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchEnd:\n' +message + }); + }, + + touchCancel(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchCancel:\n' +message + }); + }, + + click(){ + prompt.showToast({ + message: 'click' + }); + }, + + doubleClick(){ + prompt.showToast({ + message: 'doubleClick' + }); + }, + + longPress(){ + prompt.showToast({ + message: 'longPress' + }); + }, + + focus(){ + prompt.showToast({ + message: 'focus' + }); + }, + + blur(){ + prompt.showToast({ + message: 'blur' + }); + }, + + key(event){ + var code = event.code; + var action = event.action; + var repeatCount = event.repeatCount; + var timestampStart = event.timestampStart; + var message = 'code--' + code + ',action--' + action + + ',repeatCount--' + repeatCount + ',timestampStart--' + timestampStart; + prompt.showToast({ + message: 'key:\n' + message + }); + }, + + swipe(event){ + var direction = event.direction; + var distance = event.distance; + var message = 'direction--' + direction + ',distance--' + distance; + prompt.showToast({ + message: 'swipe:\n' + message + }); + }, + + attached(){ + prompt.showToast({ + message: 'attached' + }); + }, + + detached(){ + prompt.showToast({ + message: 'detached' + }); + }, + + pinchStart(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchStart:\n' + message + }); + }, + + pinchUpdate(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchUpdate:\n' + message + }); + }, + + pinchEnd(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchUpdate:\n' + message + }); + }, + + pinchCancel(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchCancel:\n' + message + }); + }, + + dragStart(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragStart:\n' + message + }); + }, + + drag(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'drag:\n' + message + }); + }, + + dragEnd(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragEnd:\n' + message + }); + }, + + dragEnter(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragEnter:\n' + message + }); + }, + + dragOver(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragOver:\n' + message + }); + }, + + dragLeave(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragLeave:\n' + message + }); + }, + + drop(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'drop:\n' + message + }); + }, + + functionTest1(event){ + var function1 = this.$element('function1'); + function1.focus(true) + var rect = function1.getBoundingClientRect(); + var width = rect.width; + var height = rect.height; + var left = rect.left; + var top = rect.top; + var message = 'width--' + width + ',height--' + height + + ',left--' + left + ',top--' + top; + prompt.showToast({ + message: 'function1 rect:\n' + message + }); + }, + + functionTest2(event){ + var function2 = this.$element('function2'); + let observer = function2.createIntersectionObserver({ + ratios: [0.2, 0], // number + }); + observer.observe((isVisible, ratio)=> { + console.info('this element is ' + isVisible + 'ratio is ' + ratio) + prompt.showToast({ + message: 'function2 observer:\n' + 'isVisible--' + isVisible + ',ratio--' + ratio + }); + }) + + observer.unobserve() + }, + + functionTest3(event){ + var function3 = this.$element('function3'); + + var animation = function3.animate(frames, options); + animation.play() + animation.onfinish = function(){ + prompt.showToast({ + message: 'The animation is finished.' + }); + }; + + animation.oncancel = function(){ + prompt.showToast({ + message: 'The animation is canceled.' + }); + }; + + animation.onrepeat = function(){ + prompt.showToast({ + message: 'The animation is repeated.' + }); + }; + + setTimeout(() => { + animation.reverse() + }, 500) + + setTimeout(() => { + animation.pause() + }, 1000) + + setTimeout(() => { + animation.cancel() + }, 1500) + }, + + functionTest4(event){ + var function4 = this.$element('function4'); + var scrollOffset = function4.getScrollOffset(); + var x = scrollOffset.x; + var y = scrollOffset.y; + var message = 'x--' + x + ',y--' + y; + prompt.showToast({ + message: 'functionTest4 scrollOffset:\n' + message + }); + + var scrollParam = { + dx:60, + dy:0, + smooth:true + } + function4.scrollBy(scrollParam) + }, + + reachStart(){ + prompt.showToast({ + message: 'reachStart' + }); + }, + + reachEnd(){ + prompt.showToast({ + message: 'reachEnd' + }); + }, + + reachTop(){ + prompt.showToast({ + message: 'reachTop' + }); + }, + + reachBottom(){ + prompt.showToast({ + message: 'reachBottom' + }); + }, + + selectChange(e){ + for(let i = 0;i - - Selected:{{time}} - - - - \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/pickerView/index.js b/ace/ace_standard/src/main/js/default/pages/pickerView/index.js deleted file mode 100644 index 76b95651a..000000000 --- a/ace/ace_standard/src/main/js/default/pages/pickerView/index.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - defaultTime: "", - time: "", - }, - onInit() { - this.defaultTime = this.now(); - }, - handleChange(data) { - this.time = this.concat(data.hour, data.minute); - }, - now() { - const date = new Date(); - const hours = date.getHours(); - const minutes = date.getMinutes(); - return this.concat(hours, minutes); - }, - - fill(value) { - return (value > 9 ? "" : "0") + value; - }, - - concat(hours, minutes) { - return `${this.fill(hours)}:${this.fill(minutes)}`; - }, -} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/pickerView/prop/index.css b/ace/ace_standard/src/main/js/default/pages/pickerView/prop/index.css new file mode 100644 index 000000000..6faa9ab9d --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/pickerView/prop/index.css @@ -0,0 +1,370 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + flex-direction:row; + width:100%; + height:100%; +} +divider { + color: #0d0000; +} +.title{ + width: 100%; + font-size: 18px; + margin: 2px; + padding: 2px; + font-weight: bold; + text-align: center; +} + +.sub-title{ + width: 100%; + font-size: 14px; + text-align: left; + margin: 2px; + padding: 2px; +} + +.prop-container{ + flex-direction: column; + flex-weight: 1; +} + +#idProp { + flex-weight: 1; + background-color:#f00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +.classProp { + flex-weight: 1; + background-color:#0f0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#classPropNone { + flex-weight: 1; + background-color:#0000e0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#refProp { + flex-weight: 1; + background-color:#00f000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#refPropNone { + flex-weight: 1; + background-color:#00000e; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#disabledPropTrue { + flex-weight: 1; + background-color:#000f00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#disabledPropFalse { + flex-weight: 1; + background-color:#0000f0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#disabledPropNone { + flex-weight: 1; + background-color:#d00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#focusablePropTrue { + flex-weight: 1; + background-color:#00000f; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#focusablePropFalse { + flex-weight: 1; + background-color:#ff0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#focusablePropNone { + flex-weight: 1; + background-color:#0d0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dataProp { + flex-weight: 1; + background-color:#0ff000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dataPropNone { + flex-weight: 1; + background-color:#00d000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropSmall { + height: 15px; + background-color:#00ff00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropMedium { + height: 15px; + background-color:#000ff0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropLarge { + height: 15px; + background-color:#fff000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropNone{ + height: 15px; + background-color:#000d00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropRtl { + flex-weight: 1; + background-color:#0fff00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropAuto { + flex-weight: 1; + background-color:#00fff0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropLtr { + flex-weight: 1; + background-color:#000fff; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropNone { + flex-weight: 1; + background-color:#0000d0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#forPropNull { + flex-weight: 1; + background-color:#ffff00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#forPropOne { + flex-weight: 1; + background-color:#00e000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#forPropThree { + flex-weight: 1; + background-color:#000e00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#ifPropTrue { + flex-weight: 1; + background-color:#0ffff0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#ifPropFalse { + flex-weight: 1; + background-color:#00ffff; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#ifPropNone { + flex-weight: 1; + background-color:#00000d; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#showPropTrue { + flex-weight: 1; + background-color:#e00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#showPropFalse { + flex-weight: 1; + background-color:#0e0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#showPropNone { + flex-weight: 1; + background-color:#c00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +.specific-container{ + flex-direction: column; + flex-weight: 1; +} +picker-view { + font-size: 12px; + selected-font-size: 12px; + height: 60px; + disappear-font-size: 12px; +} +#pickerViewText { + background-color: deeppink; +} +#pickerViewTime { + background-color: pink; +} +#pickerViewDate { + background-color: yellow; +} +#pickerViewDatetime { + background-color: greenyellow; +} +#pickerViewMultiText { + background-color: skyblue; +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/pickerView/prop/index.hml b/ace/ace_standard/src/main/js/default/pages/pickerView/prop/index.hml new file mode 100644 index 000000000..695c7406c --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/pickerView/prop/index.hml @@ -0,0 +1,207 @@ + + +
+
+ + picker-view通用属性 + + + + 通用属性 -- id + + + + + + 通用属性 -- class + + + + + + + + + 通用属性 -- style + + + + + + 通用属性 -- ref + + + + + + + + 通用属性 -- disabled + + + + + + + + + + 通用属性 -- focusable + + + + + + + + + + 通用属性 -- data-* + + + + + + + + 通用属性 -- click-effect + + + + + + + + + + + + 通用属性 -- dir + + + + + + + + + + + + 渲染属性 -- for + + + + + + + + + + 渲染属性 -- if + + + + + + 渲染属性 -- show + + + + + + + +
+ +
+
+
+ + picker-view特有属性 + + + picker-view特有属性 -- type + + + + + + +
+
diff --git a/ace/ace_standard/src/main/js/default/pages/pickerView/prop/index.js b/ace/ace_standard/src/main/js/default/pages/pickerView/prop/index.js new file mode 100644 index 000000000..e5586f615 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/pickerView/prop/index.js @@ -0,0 +1,140 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import prompt from '@system.prompt'; + +export default { + data:{ + listOne:[{}], + listThree:[{},{},{}], + idProp : null, + classProp : null, + classPropNone : null, + styleProp : null, + refProp : null, + refPropNone : null, + disabledPropTrue : null, + disabledPropFalse : null, + disabledPropNone : null, + focusablePropTrue : null, + focusablePropFalse : null, + focusablePropNone : null, + dataProp : null, + dataPropNone : null, + clickEffectPropSmall : null, + clickEffectPropMedium : null, + clickEffectPropLarge : null, + clickEffectPropNone : null, + dirPropRtl : null, + dirPropAuto : null, + dirPropLtr : null, + dirPropNone : null, + forPropNull : null, + forPropOne : null, + forPropThree : null, + ifPropTrue : null, + showPropTrue : null, + showPropFalse : null, + showPropNone : null, + rangetext:['15', "20", "25"], + multitext:[["a", "b", "c"], ["e", "f", "g"], ["h", "i"], ["k", "l", "m"]], + multitextselect:[1,2,0], + pickerViewText: null, + pickerViewDate: null, + pickerViewTime: null, + pickerViewDatetime: null, + pickerViewMultiText: null + }, + + onCreate(){ + this.getCommonPropValues(); + this.getSpecificPropValues(); + globalThis.value = { + idProp : this.idProp, + classProp : this.classProp, + classPropNone : this.classPropNone, + styleProp : this.styleProp, + refProp : this.refProp, + refPropNone : this.refPropNone, + disabledPropTrue : this.disabledPropTrue, + disabledPropFalse : this.disabledPropFalse, + disabledPropNone : this.disabledPropNone, + focusablePropTrue : this.focusablePropTrue, + focusablePropFalse : this.focusablePropFalse, + focusablePropNone : this.focusablePropNone, + dataProp : this.dataProp, + dataPropNone : this.dataPropNone, + clickEffectPropSmall : this.clickEffectPropSmall, + clickEffectPropMedium : this.clickEffectPropMedium, + clickEffectPropLarge : this.clickEffectPropLarge, + clickEffectPropNone : this.clickEffectPropNone, + dirPropRtl : this.dirPropRtl, + dirPropAuto : this.dirPropAuto, + dirPropLtr : this.dirPropLtr, + dirPropNone : this.dirPropNone, + forPropNull : this.forPropNull, + forPropOne : this.forPropOne, + forPropThree : this.forPropThree, + ifPropTrue : this.ifPropTrue, + showPropTrue : this.showPropTrue, + showPropFalse : this.showPropFalse, + showPropNone : this.showPropNone, + pickerViewText: this.pickerViewText, + pickerViewDate: this.pickerViewDate, + pickerViewTime: this.pickerViewTime, + pickerViewDatetime: this.pickerViewDatetime, + pickerViewMultiText: this.pickerViewMultiText + } + }, + + getCommonPropValues(){ + this.idProp = this.$element("idProp").getInspector() + this.classProp = this.$element("classProp").getInspector() + this.classPropNone = this.$element("classPropNone").getInspector() + this.styleProp = this.$element("styleProp").getInspector() + this.refProp = this.$element("refProp").getInspector() + this.refPropNone = this.$element("refPropNone").getInspector() + this.disabledPropTrue = this.$element("disabledPropTrue").getInspector() + this.disabledPropFalse = this.$element("disabledPropFalse").getInspector() + this.disabledPropNone = this.$element("disabledPropNone").getInspector() + this.focusablePropTrue = this.$element("focusablePropTrue").getInspector() + this.focusablePropFalse = this.$element("focusablePropFalse").getInspector() + this.focusablePropNone = this.$element("focusablePropNone").getInspector() + this.dataProp = this.$element("dataProp").getInspector() + this.dataPropNone = this.$element("dataPropNone").getInspector() + this.clickEffectPropSmall = this.$element("clickEffectPropSmall").getInspector() + this.clickEffectPropMedium = this.$element("clickEffectPropMedium").getInspector() + this.clickEffectPropLarge = this.$element("clickEffectPropLarge").getInspector() + this.clickEffectPropNone = this.$element("clickEffectPropNone").getInspector() + this.dirPropRtl = this.$element("dirPropRtl").getInspector() + this.dirPropAuto = this.$element("dirPropAuto").getInspector() + this.dirPropLtr = this.$element("dirPropLtr").getInspector() + this.dirPropNone = this.$element("dirPropNone").getInspector() + this.forPropNull = this.$element("forPropNull").getInspector() + this.forPropOne = this.$element("forPropOne").getInspector() + this.forPropThree = this.$element("forPropThree").getInspector() + this.ifPropTrue = this.$element("ifPropTrue").getInspector() + this.showPropTrue = this.$element("showPropTrue").getInspector() + this.showPropFalse = this.$element("showPropFalse").getInspector() + this.showPropNone = this.$element("showPropNone").getInspector() + }, + getSpecificPropValues () { + this.pickerViewViewText = this.$element("pickerViewViewText").getInspector() + this.pickerViewViewDate = this.$element("pickerViewViewDate").getInspector() + this.pickerViewViewTime = this.$element("pickerViewViewTime").getInspector() + this.pickerViewViewDatetime = this.$element("pickerViewViewDatetime").getInspector() + this.pickerViewViewMultiText = this.$element("pickerViewViewMultiText").getInspector() + } +} diff --git a/ace/ace_standard/src/main/js/default/pages/pickerView/router/index.css b/ace/ace_standard/src/main/js/default/pages/pickerView/router/index.css new file mode 100644 index 000000000..bd61813df --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/pickerView/router/index.css @@ -0,0 +1,385 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + flex-direction:row; + width:100%; + height:100%; + padding: 1px; +} + +.sub-container{ + flex-direction: column; + height: 100%; + flex-weight: 1; +} + +.style-container{ + flex-direction: column; + height: 100%; +} +.contain1{ + width: 100%; + height: 15%; + flex-direction: column; +} + +.ani-container{ + flex-direction: column; + height: 100%; + flex-weight: 1; +} + +.prop-container{ + flex-direction: column; + padding-left: 2px; +} + +.event-container{ + flex-direction: column; +} + +.function-container{ + flex-direction: column; +} + +.gradient-container{ + flex-direction: column; + height: 40%; +} + +.access-container{ + flex-direction: column; + height: 15%; +} + +.atom-container{ + flex-direction: column; + height: 45%; +} + +.multimode-container{ + flex-direction: column; + height: 45%; +} + +.title{ + width: 100%; + font-size: 18px; + margin: 2px; + font-weight: bold; + text-align: center; +} +.sub-title{ + width: 100%; + height: 25px; + font-size: 14px; + text-align: left; + margin-bottom: 1px; + padding: 2px; +} + +picker-view { + font-size: 12px; + selected-font-size: 12px; + color: blue; + selected-color: blue; + disappear-color: darkblue; + disappear-font-size: 12px; +} +.style1{ + width: 100%; + height: 60px; + mask-color:red; + min-width: 25px; + min-height: 10px; + max-width: 300px; + max-height: 300px; + padding-left: 1px; + padding-top: 1px; + padding-right: 15px; + padding-bottom: 1px; + margin-left: 1px; + margin-top: 0px; + margin-right: 1px; + margin-bottom: 5px; + border-left-style: solid; + border-right-style: dashed; + border-top-style: dashed; + border-bottom-style: dotted; + border-left-width: 1px; + border-right-width: 2px; + border-top-width: 2px; + border-bottom-width: 1px; + border-left-color: #ff0000; + border-right-color: #00ff00; + border-top-color: #0000ff; + border-bottom-color: #fff000; + border-bottom-left-radius: 10px; + border-bottom-right-radius: 15px; + border-top-left-radius: 8px; + border-top-right-radius: 12px; + background: linear-gradient(pink,#fff000); + box-shadow: 2px 4px 6px 8px #888888; + opacity: 0.5; + display: flex; + visibility: visible; + align-self: center; + image-fill: #000fff; + clip-path: margin-box; +} + +.style2{ + width: 100%; + height: 60px; + padding-start: 1px; + padding-end: 1px; + margin-start: 1px; + margin-end: 1px; + border-style: dotted; + border-width: 2px; + border-color:#000000; + border-radius:5px; + background-color:#ffaa00; + mask-image: url('common/images/icon.png'); + mask-size: cover; + mask-position: center; +} + +.style3{ + width: 100%; + height: 60px; + padding: 1px; + margin: 1px; + border-left: 1px solid #000000; + border-right: 2px dashed #00ff00; + border-top: 1.5px dotted #0000ff; + border-bottom: 2.5px dotted #fff000; + background-image:url('common/images/image.png'); + background-size:cover; + background-repeat: repeat-x; + background-position: center; + flex:1; + flex-grow: 2; + flex-basis: 10px; + flex-shrink: 1; +} + +.style4{ + width: 60%; + height: 5%; + padding: 1px; + margin: 5px; + border: 2px solid #000000; +} + +.style5{ + width: 50%; + height: 30px; + background-color: yellow; + border-image-source: url('/common/images/image.png'); + border-image-slice: 1px 2px 3px 4px; + border-image-width: 2px 3px 4px 5px; + border-image-outset: 3px 4px 5px 6px; + border-image-repeat: repeat; +} + +.style6{ + width: 70px; + height: 30px; + position: absolute; + left: 10px; + top: 35px; + bottom: 5px; + right: 10px; + background-color: pink; + border-image: url('common/images/icon.png') 1px 2px 3px 4px 2px 3px 4px 5px 3px 4px 5px 6px round; +} + +.style7 { + text-color: red; + font-size: 16px; + allow-scale: true; + letter-spacing: 4px; + text-decoration: underline; + font-style: normal; + font-weight: 700; + font-family: HYQiHei-65S; + line-height: 20px; + column-height: 50px; +} +picker { + font-size: 12px; +} +.event1{ + width: 100%; + height: 20px; + background-color: salmon; +} + +.event2{ + width: 100%; + height: 20px; + background-color: darkorchid; +} + +.event3{ + width: 100%; + height: 20px; + background-color: #ad4e2a; +} + +.event4{ + width: 100%; + height: 20px; + background-color: blanchedalmond; +} + +.event5{ + width: 100%; + height: 20px; + background-color: blanchedalmond; +} + + +#prop1 { + background-color: mediumslateblue; + height: 20px; + margin: 2px; +} + +.prop2 { + background-color: salmon; + height: 20px; + margin: 2px; +} + +.prop4 { + background-color: skyblue; + height: 20px; + margin: 2px; +} + +.prop5 { + background-color: gold; + height: 20px; + width: 100%; + margin: 2px; +} + + +.ani1{ + color: #72ac33; + margin: 5px; + transform-origin: 0% 0%; + animation: ani1Go 3s infinite; +} + +@keyframes ani1Go +{ + from { + background-color: #f76160; + opacity:0.3; + width:50px; + height: 50px; + transform:translate(20px) rotate(10deg) scale(0.2) skew(40deg); + background-position:10% 10% + } + 30% { + background-color: #60f761; + opacity:0.5; + width:70px; + height: 70px; + background-position:12% 12%; + transform:translateX(10px) translateY(5px) rotateX(20deg) rotateY(25deg) scaleX(0.6) scaleY(0.5) skewX(25deg) skewY(15deg) + } + to { + background-color: #6160f7; + opacity:1; + width:90px; + height: 90px; + background-position:22% 22%; + transform:rotate(180deg) scale(2) + } +} + +.ani2{ + background-color: #ad4e2a; + width: 100%; + height: 55px; + margin: 5px; +} + +.gradient1{ + margin: 5px; + height: 40px; + background: linear-gradient(red, #00ff00); +} + +.gradient2{ + margin: 5px; + height: 40px; + background: linear-gradient(45deg, rgb(255,0,0),rgb(0, 255, 0)); +} + +.gradient3{ + margin: 5px; + height: 40px; + background: linear-gradient(to right, rgb(255,0,0) 90px, rgb(0, 255, 0) 60%); +} + +.gradient4{ + margin: 5px; + height: 40px; + background: repeating-linear-gradient(to right, rgba(255, 255, 0, 1) 30px,rgba(0, 0, 255, .5) 60px); +} + +.access1{ + color: #321124; + height: 40px; + margin: 5px; +} + +.multimode1{ + background-color: firebrick; + height: 40px; + margin: 5px; +} + + +.function1{ + background-color: #ff0000; + width: 60%; + height: 30px; +} + +.function2{ + background-color: #00ff00; + width: 60%; + height: 30px; +} + +.function3{ + background-color: #0000ff; + width: 100%; + height: 30px; +} + +.function4 { + flex-direction: row; + width: 60%; + height: 60px; + overflow: scroll; +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/pickerView/router/index.hml b/ace/ace_standard/src/main/js/default/pages/pickerView/router/index.hml new file mode 100644 index 000000000..c6fef1ebe --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/pickerView/router/index.hml @@ -0,0 +1,327 @@ + + +
+
+ +
+ + 通用样式 + + + + 通用样式1:{{time}} + + + + + 通用样式2 + + + + + 通用样式3 + + + + + 通用样式4 + + + + + + 通用样式5 + +
+ + + + +
+ + + 特有样式 + + + +
+
+ +
+
+ +
+ +
+ + 通用属性 + + + picker-view通用属性1 + + + + + + picker-view通用属性2 + + + + + + picker-view通用属性3 + + + + + + picker-view特有属性4 + + + + + + picker-view特有属性5 + + + +
+
+
+ +
+ + 通用事件 + + + picker-view通用事件1 + + + + + + picker-view通用事件2 + + + + + + picker-view通用事件3 + + + + + + picker-view特有事件1 + + + +
+
+
+ +
+ + 通用方法 + + + picker-view通用方法1 + + + + + + + picker-view通用方法2 + + + + + + + picker-view通用方法3 + + + + + + picker-view特有方法1 + + + +
+
+ +
+
+ +
+ +
+ + 渐变样式 + + + + picker-view渐变样式1 + + + + + + picker-view渐变样式2 + + + + + + picker-view渐变样式3 + + + + + + picker-view渐变样式4 + + + +
+
+
+ +
+ + 无障碍 + + + picker-view无障碍1 + + + +
+
+
+
+ + 原子布局 + + + picker-view原子布局1 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + picker-view原子布局2 + +
+ + + + + + + + + + + + +
+ + picker-view原子布局3 + +
+ + + + + + + + + + + + +
+
+
+
+ + 多模输入 + + + menu多模输入1 + + + +
+
+
+
+ + + + + + diff --git a/ace/ace_standard/src/main/js/default/pages/pickerView/router/index.js b/ace/ace_standard/src/main/js/default/pages/pickerView/router/index.js new file mode 100644 index 000000000..a1d629116 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/pickerView/router/index.js @@ -0,0 +1,547 @@ +/** + * Copyright (c) 2022 Shenzhen kaiHong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import router from '@system.router'; +import prompt from '@system.prompt'; + +var options = { + duration: 1500, + easing: 'friction', + delay: 100, + fill: 'forwards', + iterations: 2, + direction: 'normal', +}; +var frames = [ + { + transform: { + translate: '-120px', + rotate:'10deg', + scale:0.2, + skew:'40deg' + }, + opacity: 0.1, + offset: 0.0, + width: '40%', + height:'20px', + backgroundColor:'#ff0000', + backgroundPosition:'10px 20px', + transformOrigin:'left top' + }, + { + transform: { + translateX: '0px', + translateY: '5px', + rotateX:'10deg', + rotateY:'10deg', + scaleX:0.5, + scaleY:0.7, + skewX:'22deg', + skewY:'30deg' + }, + opacity: 0.6, + offset: 2.0, + width: '60%', + height:'30px', + backgroundColor:'#ff00ff', + backgroundPosition:'15px 25px', + transformOrigin:'center top' + }, + { + transform: { + translateX: '100px', + translateY: '0px', + translateZ: '20px', + rotateX:'0deg', + rotateY:'0deg', + rotateZ:'30deg', + scaleX:1, + scaleY:1, + scaleZ:2, + skewX:'0', + skewY:'0', + skewZ:'30deg' + }, + opacity: 1, + offset: 0.0, + width: '100%', + height:'30px', + backgroundColor:'#ffff00', + backgroundPosition:'0px', + transformOrigin:'center center' + }, +]; + +export default { + data: { + defaultTime: "", + time: "", + }, + onMenuSelected(e) { + prompt.showToast({ + message: e.value + }) + }, + onTextClick1() { + this.$element('apiMenu1').show({x:120,y:10}); + }, + onTextClick2() { + this.$element('apiMenu2').show({x:120,y:80}); + }, + onTextClick3() { + this.$element('apiMenu3').show({x:120,y:150}); + }, + onTextClick4() { + this.$element('apiMenu4').show({x:120,y:220}); + }, + onTextClick5() { + this.$element('apiMenu5').show({x:120,y:290}); + }, + onTextClick6() { + this.$element('apiMenu6').show({x:120,y:360}); + }, + onTextClick7() { + this.$element('apiMenu7').show({x:120,y:650}); + }, + + onShow(){ + // 通用属性 + var prop1 = this.$element('prop1'); + var name1 = prop1.dataSet.name + var prop2 = this.$refs.prop2; + var name2 = prop2.dataSet.name + prompt.showToast({ + message: 'prop1--' + name1 + '\nprop2--' + name2 + }); + }, + + touchStart(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchstart:\n' + message + }); + }, + + touchMove(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchMove:\n' +message + }); + }, + + touchEnd(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchEnd:\n' +message + }); + }, + + touchCancel(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchCancel:\n' +message + }); + }, + + click(){ + prompt.showToast({ + message: 'click' + }); + }, + + doubleClick(){ + prompt.showToast({ + message: 'doubleClick' + }); + }, + + longPress(){ + prompt.showToast({ + message: 'longPress' + }); + }, + + focus(){ + prompt.showToast({ + message: 'focus' + }); + }, + + blur(){ + prompt.showToast({ + message: 'blur' + }); + }, + + key(event){ + var code = event.code; + var action = event.action; + var repeatCount = event.repeatCount; + var timestampStart = event.timestampStart; + var message = 'code--' + code + ',action--' + action + + ',repeatCount--' + repeatCount + ',timestampStart--' + timestampStart; + prompt.showToast({ + message: 'key:\n' + message + }); + }, + + swipe(event){ + var direction = event.direction; + var distance = event.distance; + var message = 'direction--' + direction + ',distance--' + distance; + prompt.showToast({ + message: 'swipe:\n' + message + }); + }, + + attached(){ + prompt.showToast({ + message: 'attached' + }); + }, + + detached(){ + prompt.showToast({ + message: 'detached' + }); + }, + + pinchStart(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchStart:\n' + message + }); + }, + + pinchUpdate(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchUpdate:\n' + message + }); + }, + + pinchEnd(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchUpdate:\n' + message + }); + }, + + pinchCancel(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchCancel:\n' + message + }); + }, + + dragStart(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragStart:\n' + message + }); + }, + + drag(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'drag:\n' + message + }); + }, + + dragEnd(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragEnd:\n' + message + }); + }, + + dragEnter(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragEnter:\n' + message + }); + }, + + dragOver(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragOver:\n' + message + }); + }, + + dragLeave(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragLeave:\n' + message + }); + }, + + drop(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'drop:\n' + message + }); + }, + + functionTest1(event){ + var function1 = this.$element('function1'); + function1.focus(true) + var rect = function1.getBoundingClientRect(); + var width = rect.width; + var height = rect.height; + var left = rect.left; + var top = rect.top; + var message = 'width--' + width + ',height--' + height + + ',left--' + left + ',top--' + top; + prompt.showToast({ + message: 'function1 rect:\n' + message + }); + }, + + functionTest2(event){ + var function2 = this.$element('function2'); + let observer = function2.createIntersectionObserver({ + ratios: [0.2, 0], // number + }); + observer.observe((isVisible, ratio)=> { + console.info('this element is ' + isVisible + 'ratio is ' + ratio) + prompt.showToast({ + message: 'function2 observer:\n' + 'isVisible--' + isVisible + ',ratio--' + ratio + }); + }) + + observer.unobserve() + }, + + functionTest3(event){ + var function3 = this.$element('function3'); + + var animation = function3.animate(frames, options); + animation.play() + animation.onfinish = function(){ + prompt.showToast({ + message: 'The animation is finished.' + }); + }; + + animation.oncancel = function(){ + prompt.showToast({ + message: 'The animation is canceled.' + }); + }; + + animation.onrepeat = function(){ + prompt.showToast({ + message: 'The animation is repeated.' + }); + }; + + setTimeout(() => { + animation.reverse() + }, 500) + + setTimeout(() => { + animation.pause() + }, 1000) + + setTimeout(() => { + animation.cancel() + }, 1500) + }, + + functionTest4(event){ + var function4 = this.$element('function4'); + var scrollOffset = function4.getScrollOffset(); + var x = scrollOffset.x; + var y = scrollOffset.y; + var message = 'x--' + x + ',y--' + y; + prompt.showToast({ + message: 'functionTest4 scrollOffset:\n' + message + }); + + var scrollParam = { + dx:60, + dy:0, + smooth:true + } + function4.scrollBy(scrollParam) + }, + + reachStart(){ + prompt.showToast({ + message: 'reachStart' + }); + }, + + reachEnd(){ + prompt.showToast({ + message: 'reachEnd' + }); + }, + + reachTop(){ + prompt.showToast({ + message: 'reachTop' + }); + }, + + reachBottom(){ + prompt.showToast({ + message: 'reachBottom' + }); + }, + + selectChange(e){ + for(let i = 0;i 9 ? "" : "0") + value; + }, + + concat(hours, minutes) { + return `${this.fill(hours)}:${this.fill(minutes)}`; + }, +} diff --git a/ace/ace_standard/src/main/js/default/pages/progress/index.css b/ace/ace_standard/src/main/js/default/pages/progress/index.css deleted file mode 100644 index fa6decbf0..000000000 --- a/ace/ace_standard/src/main/js/default/pages/progress/index.css +++ /dev/null @@ -1,39 +0,0 @@ -.container { - flex-direction: column; -/* height: 100%;*/ - width: 100%; - align-items: center; -} -.min-progress { - width: 250px; - height: 250px; -} -.progress2{ - color:red; - secondary-color:red; - scale-width:20; - scale-number:60; - -} - -.progress4{ - color: red; - stroke-width:10px; - secondary-color:red -} -.arc1{ - color:red; - stroke-width:30px; -} -.arc2{ - color:yellow; - stroke-width:30px; - total-angle:360; -/* center-x:10;*/ -/* center-y:10;*/ -/* radius:5;*/ -} -.eclipse{ - color:crimson; - background-color: antiquewhite; -} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/progress/index.hml b/ace/ace_standard/src/main/js/default/pages/progress/index.hml deleted file mode 100644 index 72013851f..000000000 --- a/ace/ace_standard/src/main/js/default/pages/progress/index.hml +++ /dev/null @@ -1,13 +0,0 @@ -
- - - - - - - - - - - -
\ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/progress/index.js b/ace/ace_standard/src/main/js/default/pages/progress/index.js deleted file mode 100644 index 6de413880..000000000 --- a/ace/ace_standard/src/main/js/default/pages/progress/index.js +++ /dev/null @@ -1,20 +0,0 @@ -/** - * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -export default { - data: { - title: "World" - }, -} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/progress/prop/index.css b/ace/ace_standard/src/main/js/default/pages/progress/prop/index.css new file mode 100644 index 000000000..ade66fdc7 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/progress/prop/index.css @@ -0,0 +1,385 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + flex-direction:row; + width:100%; + height:100%; +} +progress { + color: pink; +} +.title{ + width: 100%; + font-size: 18px; + margin: 2px; + padding: 2px; + font-weight: bold; + text-align: center; +} + +.sub-title{ + width: 100%; + font-size: 14px; + text-align: left; + margin: 2px; + padding: 2px; +} + +.prop-container{ + flex-direction: column; + flex-weight: 1; +} + +#idProp { + flex-weight: 1; + background-color:#f00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +.classProp { + flex-weight: 1; + background-color:#0f0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#classPropNone { + flex-weight: 1; + background-color:#0000e0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#refProp { + flex-weight: 1; + background-color:#00f000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#refPropNone { + flex-weight: 1; + background-color:#00000e; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#disabledPropTrue { + flex-weight: 1; + background-color:#000f00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#disabledPropFalse { + flex-weight: 1; + background-color:#0000f0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#disabledPropNone { + flex-weight: 1; + background-color:#d00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#focusablePropTrue { + flex-weight: 1; + background-color:#00000f; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#focusablePropFalse { + flex-weight: 1; + background-color:#ff0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#focusablePropNone { + flex-weight: 1; + background-color:#0d0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dataProp { + flex-weight: 1; + background-color:#0ff000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dataPropNone { + flex-weight: 1; + background-color:#00d000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropSmall { + height: 15px; + background-color:#00ff00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropMedium { + height: 15px; + background-color:#000ff0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropLarge { + height: 15px; + background-color:#fff000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#clickEffectPropNone{ + height: 15px; + background-color:#000d00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropRtl { + flex-weight: 1; + background-color:#0fff00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropAuto { + flex-weight: 1; + background-color:#00fff0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropLtr { + flex-weight: 1; + background-color:#000fff; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#dirPropNone { + flex-weight: 1; + background-color:#0000d0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#forPropNull { + flex-weight: 1; + background-color:#ffff00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#forPropOne { + flex-weight: 1; + background-color:#00e000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#forPropThree { + flex-weight: 1; + background-color:#000e00; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#ifPropTrue { + flex-weight: 1; + background-color:#0ffff0; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#ifPropFalse { + flex-weight: 1; + background-color:#00ffff; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#ifPropNone { + flex-weight: 1; + background-color:#00000d; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#showPropTrue { + flex-weight: 1; + background-color:#e00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#showPropFalse { + flex-weight: 1; + background-color:#0e0000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +#showPropNone { + flex-weight: 1; + background-color:#c00000; + width: 100%; + margin-left: 10px; + margin-right: 10px; + padding-start: 10px; + padding-end: 10px; +} + +.specific-container{ + flex-direction: column; + flex-weight: 1; +} +#typeHorizontal { + width: 100%; + height: 10px; + margin-bottom: 10px; + +} +#typeCircular { + width: 100%; + height: 40px; + margin-bottom: 10px; + +} +#typeRing { + width: 100%; + height: 40px; + margin-bottom: 10px; + +} +#typeScaleRing { + width: 100%; + height: 40px; + margin-bottom: 10px; + +} +#typeArc { + width: 100%; + height: 40px; + margin-bottom: 10px; + +} +#typeEclipse { + width: 100%; + height: 40px; + margin-bottom: 10px; + +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/progress/prop/index.hml b/ace/ace_standard/src/main/js/default/pages/progress/prop/index.hml new file mode 100644 index 000000000..f90d2d4be --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/progress/prop/index.hml @@ -0,0 +1,175 @@ + + +
+
+ + progress通用属性 + + + + 通用属性 -- id + + + + + + 通用属性 -- class + + + + + + + + + 通用属性 -- style + + + + + + 通用属性 -- ref + + + + + + + + 通用属性 -- disabled + + + + + + + + + + 通用属性 -- focusable + + + + + + + + + + 通用属性 -- data-* + + + + + + + + 通用属性 -- click-effect + + + + + + + + + + + + 通用属性 -- dir + + + + + + + + + + + + 渲染属性 -- for + + + + + + + + + + 渲染属性 -- if + + + + + + 渲染属性 -- show + + + + + + + +
+ +
+
+
+ + progress特有属性 + + + progress特有属性 -- type + + + + + + + + +
+
diff --git a/ace/ace_standard/src/main/js/default/pages/progress/prop/index.js b/ace/ace_standard/src/main/js/default/pages/progress/prop/index.js new file mode 100644 index 000000000..4c94b2e95 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/progress/prop/index.js @@ -0,0 +1,142 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import prompt from '@system.prompt'; + +export default { + data:{ + listOne:[{}], + listThree:[{},{},{}], + idProp : null, + classProp : null, + classPropNone : null, + styleProp : null, + refProp : null, + refPropNone : null, + disabledPropTrue : null, + disabledPropFalse : null, + disabledPropNone : null, + focusablePropTrue : null, + focusablePropFalse : null, + focusablePropNone : null, + dataProp : null, + dataPropNone : null, + clickEffectPropSmall : null, + clickEffectPropMedium : null, + clickEffectPropLarge : null, + clickEffectPropNone : null, + dirPropRtl : null, + dirPropAuto : null, + dirPropLtr : null, + dirPropNone : null, + forPropNull : null, + forPropOne : null, + forPropThree : null, + ifPropTrue : null, + showPropTrue : null, + showPropFalse : null, + showPropNone : null, + verticalTrue: null, + verticalFalse: null, + typeHorizontal: null, + typeCircular: null, + typeRing: null, + typeScaleRing: null, + typeArc: null, + typeEclipse: null + }, + + onCreate(){ + this.getCommonPropValues(); + this.getSpecificPropValues(); + globalThis.value = { + idProp : this.idProp, + classProp : this.classProp, + classPropNone : this.classPropNone, + styleProp : this.styleProp, + refProp : this.refProp, + refPropNone : this.refPropNone, + disabledPropTrue : this.disabledPropTrue, + disabledPropFalse : this.disabledPropFalse, + disabledPropNone : this.disabledPropNone, + focusablePropTrue : this.focusablePropTrue, + focusablePropFalse : this.focusablePropFalse, + focusablePropNone : this.focusablePropNone, + dataProp : this.dataProp, + dataPropNone : this.dataPropNone, + clickEffectPropSmall : this.clickEffectPropSmall, + clickEffectPropMedium : this.clickEffectPropMedium, + clickEffectPropLarge : this.clickEffectPropLarge, + clickEffectPropNone : this.clickEffectPropNone, + dirPropRtl : this.dirPropRtl, + dirPropAuto : this.dirPropAuto, + dirPropLtr : this.dirPropLtr, + dirPropNone : this.dirPropNone, + forPropNull : this.forPropNull, + forPropOne : this.forPropOne, + forPropThree : this.forPropThree, + ifPropTrue : this.ifPropTrue, + showPropTrue : this.showPropTrue, + showPropFalse : this.showPropFalse, + showPropNone : this.showPropNone, + typeHorizontal: this.typeHorizontal, + typeCircular: this.typeCircular, + typeRing: this.typeRing, + typeScaleRing: this.typeScaleRing, + typeArc: this.typeArc, + typeEclipse: this.typeEclipse + } + }, + + getCommonPropValues(){ + this.idProp = this.$element("idProp").getInspector() + this.classProp = this.$element("classProp").getInspector() + this.classPropNone = this.$element("classPropNone").getInspector() + this.styleProp = this.$element("styleProp").getInspector() + this.refProp = this.$element("refProp").getInspector() + this.refPropNone = this.$element("refPropNone").getInspector() + this.disabledPropTrue = this.$element("disabledPropTrue").getInspector() + this.disabledPropFalse = this.$element("disabledPropFalse").getInspector() + this.disabledPropNone = this.$element("disabledPropNone").getInspector() + this.focusablePropTrue = this.$element("focusablePropTrue").getInspector() + this.focusablePropFalse = this.$element("focusablePropFalse").getInspector() + this.focusablePropNone = this.$element("focusablePropNone").getInspector() + this.dataProp = this.$element("dataProp").getInspector() + this.dataPropNone = this.$element("dataPropNone").getInspector() + this.clickEffectPropSmall = this.$element("clickEffectPropSmall").getInspector() + this.clickEffectPropMedium = this.$element("clickEffectPropMedium").getInspector() + this.clickEffectPropLarge = this.$element("clickEffectPropLarge").getInspector() + this.clickEffectPropNone = this.$element("clickEffectPropNone").getInspector() + this.dirPropRtl = this.$element("dirPropRtl").getInspector() + this.dirPropAuto = this.$element("dirPropAuto").getInspector() + this.dirPropLtr = this.$element("dirPropLtr").getInspector() + this.dirPropNone = this.$element("dirPropNone").getInspector() + this.forPropNull = this.$element("forPropNull").getInspector() + this.forPropOne = this.$element("forPropOne").getInspector() + this.forPropThree = this.$element("forPropThree").getInspector() + this.ifPropTrue = this.$element("ifPropTrue").getInspector() + this.showPropTrue = this.$element("showPropTrue").getInspector() + this.showPropFalse = this.$element("showPropFalse").getInspector() + this.showPropNone = this.$element("showPropNone").getInspector() + }, + getSpecificPropValues () { + this.typeHorizontal = this.$element("typeHorizontal").getInspector() + this.typeCircular = this.$element("typeCircular").getInspector() + this.typeRing = this.$element("typeRing").getInspector() + this.typeScaleRing = this.$element("typeScaleRing").getInspector() + this.typeArc = this.$element("typeArc").getInspector() + this.typeEclipse = this.$element("typeEclipse").getInspector() + } +} diff --git a/ace/ace_standard/src/main/js/default/pages/progress/router/index.css b/ace/ace_standard/src/main/js/default/pages/progress/router/index.css new file mode 100644 index 000000000..4661ac8a4 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/progress/router/index.css @@ -0,0 +1,358 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +.container { + flex-direction:row; + width:100%; + height:100%; + padding: 1px; +} + +.sub-container{ + flex-direction: column; + height: 100%; + flex-weight: 1; +} + +.style-container{ + flex-direction: column; + height: 70%; +} +.contain1{ + width: 100%; + height: 15%; + flex-direction: column; +} + +.ani-container{ + flex-direction: column; + height: 100%; + flex-weight: 1; +} + +.prop-container{ + flex-direction: column; + height: 45%; + padding-left: 2px; +} + +.event-container{ + flex-direction: column; + height: 40%; +} + +.function-container{ + flex-direction: column; + height: 25%; +} + +.gradient-container{ + flex-direction: column; + height: 40%; +} + +.access-container{ + flex-direction: column; + height: 15%; +} + +.atom-container{ + flex-direction: column; + height: 45%; +} + +.multimode-container{ + flex-direction: column; + height: 45%; +} + +.title{ + width: 100%; + font-size: 18px; + margin: 2px; + font-weight: bold; + text-align: center; +} +.sub-title{ + width: 100%; + height: 25px; + font-size: 15px; + text-align: left; + margin-bottom: 1px; + padding: 2px; +} + +.style1{ + width: 100%; + mask-color:red; + height: 100%; + min-width: 25px; + min-height: 10px; + max-width: 300px; + max-height: 50px; + padding-left: 10px; + padding-top: 1px; + padding-right: 15px; + padding-bottom: 1px; + margin-left: 10px; + margin-top: 0px; + margin-right: 15px; + margin-bottom: 5px; + border-left-style: solid; + border-right-style: dashed; + border-top-style: dashed; + border-bottom-style: dotted; + border-left-width: 1px; + border-right-width: 2px; + border-top-width: 2px; + border-bottom-width: 1px; + border-left-color: #ff0000; + border-right-color: #00ff00; + border-top-color: #0000ff; + border-bottom-color: #fff000; + border-bottom-left-radius: 10px; + border-bottom-right-radius: 15px; + border-top-left-radius: 8px; + border-top-right-radius: 12px; + background: linear-gradient(pink,#fff000); + box-shadow: 2px 4px 6px 8px #888888; + opacity: 0.5; + display: flex; + visibility: visible; + align-self: center; + image-fill: #000fff; + clip-path: margin-box; +} + +.style2{ + +} + +.style3{ + width: 100%; + padding: 10px; + margin: 5px; + border-left: 1px solid #000000; + border-right: 2px dashed #00ff00; + border-top: 1.5px dotted #0000ff; + border-bottom: 2.5px dotted #fff000; + background-image:url('common/images/image.png'); + background-size:cover; + background-repeat: repeat-x; + background-position: center; + flex:1; + flex-grow: 2; + flex-basis: 10px; + flex-shrink: 1; +} + +.style4{ + width: 60%; + height: 5%; + padding: 1px; + margin: 5px; + border: 2px solid #000000; +} + +.style5{ + width: 50%; + height: 30px; + background-color: yellow; + border-image-source: url('/common/images/image.png'); + border-image-slice: 1px 2px 3px 4px; + border-image-width: 2px 3px 4px 5px; + border-image-outset: 3px 4px 5px 6px; + border-image-repeat: repeat; +} + +.style6{ + width: 70px; + height: 30px; + position: absolute; + left: 10px; + top: 35px; + bottom: 5px; + right: 10px; + background-color: pink; + border-image: url('common/images/icon.png') 1px 2px 3px 4px 2px 3px 4px 5px 3px 4px 5px 6px round; +} + +.style7 { + color: blue; + stroke-width: 10px; + background-color: red; + secondary-color: pink; +} + +.event1{ + width: 100%; + height: 40px; + background-color: salmon; +} + +.event2{ + width: 100%; + height: 40px; + background-color: darkorchid; +} + +.event3{ + width: 100%; + height: 40px; + background-color: #ad4e2a; +} + +.event4{ + width: 100%; + height: 40px; + background-color: blanchedalmond; +} + +.event5{ + width: 100%; + height: 40px; + background-color: blanchedalmond; +} + + +#prop1 { + background-color: mediumslateblue; + height: 40px; + margin: 2px; +} + +.prop2 { + background-color: salmon; + height: 40px; + margin: 2px; +} + +.prop4 { + background-color: skyblue; + height: 40px; + margin: 2px; +} + +.prop5 { + background-color: gold; + height: 40px; + width: 100%; + margin: 2px; +} + + +.ani1{ + color: #72ac33; + margin: 5px; + transform-origin: 0% 0%; + animation: ani1Go 3s infinite; +} + +@keyframes ani1Go +{ + from { + background-color: #f76160; + opacity:0.3; + width:50px; + height: 50px; + transform:translate(20px) rotate(10deg) scale(0.2) skew(40deg); + background-position:10% 10% + } + 30% { + background-color: #60f761; + opacity:0.5; + width:70px; + height: 70px; + background-position:12% 12%; + transform:translateX(10px) translateY(5px) rotateX(20deg) rotateY(25deg) scaleX(0.6) scaleY(0.5) skewX(25deg) skewY(15deg) + } + to { + background-color: #6160f7; + opacity:1; + width:90px; + height: 90px; + background-position:22% 22%; + transform:rotate(180deg) scale(2) + } +} + +.ani2{ + background-color: #ad4e2a; + width: 100%; + height: 55px; + margin: 5px; +} + +.gradient1{ + margin: 5px; + stroke-width: 10px; + background: linear-gradient(red, #00ff00); +} + +.gradient2{ + margin: 5px; + stroke-width: 10px; + background: linear-gradient(45deg, rgb(255,0,0),rgb(0, 255, 0)); +} + +.gradient3{ + margin: 5px; + stroke-width: 10px; + background: linear-gradient(to right, rgb(255,0,0) 90px, rgb(0, 255, 0) 60%); +} + +.gradient4{ + margin: 5px; + stroke-width: 10px; + background: repeating-linear-gradient(to right, rgba(255, 255, 0, 1) 30px,rgba(0, 0, 255, .5) 60px); +} + +.access1{ + color: #321124; + height: 40px; + margin: 5px; +} + +.multimode1{ + background-color: firebrick; + height: 40px; + margin: 5px; +} + + +.function1{ + background-color: #ff0000; + width: 60%; + height: 30px; +} + +.function2{ + background-color: #00ff00; + width: 60%; + height: 30px; +} + +.function3{ + background-color: #0000ff; + width: 100%; + height: 30px; +} + +.function4 { + flex-direction: row; + width: 60%; + height: 60px; + overflow: scroll; +} \ No newline at end of file diff --git a/ace/ace_standard/src/main/js/default/pages/progress/router/index.hml b/ace/ace_standard/src/main/js/default/pages/progress/router/index.hml new file mode 100644 index 000000000..f369f1207 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/progress/router/index.hml @@ -0,0 +1,334 @@ + + +
+
+ +
+ + 通用样式 + + + + progress通用样式1 + + + + + + progress通用样式2 + + + + + + progress通用样式3 + + + + + + progress通用样式4 + + + + + + progress通用样式5 + +
+ + + + +
+ + + progress特有样式 + + + +
+ + + + +
+ + 动画样式 + + + + progress动画样式1 + + + + + + progress动画样式2 + + + + +
+
+ +
+
+ +
+ +
+ + 通用属性 + + + progress通用属性1 + + + + + + progress通用属性2 + + + + + + progress通用属性3 + + + + + + progress特有属性4 + + + + + + progress特有属性5 + + + +
+
+
+ +
+ + 通用事件 + + + progress通用事件1 + + + + + + progress通用事件2 + + + + + + progress通用事件3 + + + +
+
+
+ +
+ + 通用方法 + + + progress通用方法1 + + + + + + + progress通用方法2 + + + + + + + progress通用方法3 + + + +
+
+ +
+
+ +
+ +
+ + 渐变样式 + + + + progress渐变样式1 + + + + + + progress渐变样式2 + + + + + + progress渐变样式3 + + + + + + progress渐变样式4 + + + +
+
+
+ +
+ + 无障碍 + + + progress无障碍1 + + + +
+
+
+
+ + 原子布局 + + + progress原子布局1 + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ + progress原子布局2 + +
+ + + + + + + + + + + + +
+ + progress原子布局3 + +
+ + + + + + + + + + + + +
+
+
+
+ + 多模输入 + + + progress多模输入1 + + + +
+
+
+
+ + + + + + diff --git a/ace/ace_standard/src/main/js/default/pages/progress/router/index.js b/ace/ace_standard/src/main/js/default/pages/progress/router/index.js new file mode 100644 index 000000000..94ba7b359 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/pages/progress/router/index.js @@ -0,0 +1,516 @@ +/** + * Copyright (c) 2022 Shenzhen kaiHong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import prompt from '@system.prompt'; + +var options = { + duration: 1500, + easing: 'friction', + delay: 100, + fill: 'forwards', + iterations: 2, + direction: 'normal', +}; +var frames = [ + { + transform: { + translate: '-120px', + rotate:'10deg', + scale:0.2, + skew:'40deg' + }, + opacity: 0.1, + offset: 0.0, + width: '40%', + height:'20px', + backgroundColor:'#ff0000', + backgroundPosition:'10px 20px', + transformOrigin:'left top' + }, + { + transform: { + translateX: '0px', + translateY: '5px', + rotateX:'10deg', + rotateY:'10deg', + scaleX:0.5, + scaleY:0.7, + skewX:'22deg', + skewY:'30deg' + }, + opacity: 0.6, + offset: 2.0, + width: '60%', + height:'30px', + backgroundColor:'#ff00ff', + backgroundPosition:'15px 25px', + transformOrigin:'center top' + }, + { + transform: { + translateX: '100px', + translateY: '0px', + translateZ: '20px', + rotateX:'0deg', + rotateY:'0deg', + rotateZ:'30deg', + scaleX:1, + scaleY:1, + scaleZ:2, + skewX:'0', + skewY:'0', + skewZ:'30deg' + }, + opacity: 1, + offset: 0.0, + width: '100%', + height:'30px', + backgroundColor:'#ffff00', + backgroundPosition:'0px', + transformOrigin:'center center' + }, +]; + +export default { + + onMenuSelected(e) { + prompt.showToast({ + message: e.value + }) + }, + onTextClick1() { + this.$element('apiMenu1').show({x:120,y:10}); + }, + onTextClick2() { + this.$element('apiMenu2').show({x:120,y:80}); + }, + onTextClick3() { + this.$element('apiMenu3').show({x:120,y:150}); + }, + onTextClick4() { + this.$element('apiMenu4').show({x:120,y:220}); + }, + onTextClick5() { + this.$element('apiMenu5').show({x:120,y:290}); + }, + onTextClick6() { + this.$element('apiMenu6').show({x:120,y:360}); + }, + onTextClick7() { + this.$element('apiMenu7').show({x:120,y:650}); + }, + + onShow(){ + // 通用属性 + var prop1 = this.$element('prop1'); + var name1 = prop1.dataSet.name + var prop2 = this.$refs.prop2; + var name2 = prop2.dataSet.name + prompt.showToast({ + message: 'prop1--' + name1 + '\nprop2--' + name2 + }); + }, + + touchStart(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchstart:\n' + message + }); + }, + + touchMove(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchMove:\n' +message + }); + }, + + touchEnd(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchEnd:\n' +message + }); + }, + + touchCancel(event){ + var globalX = event.touches[0].globalX + var globalY = event.touches[0].globalY + var localX = event.touches[0].localX + var localY = event.touches[0].localY + var size = event.touches[0].size + var force = event.touches[0].force + var changeGlobalX = event.changedTouches[0].globalX + var changeGlobalY = event.changedTouches[0].globalY + var changeLocalX = event.changedTouches[0].localX + var changeLocalY = event.changedTouches[0].localY + var changeSize = event.changedTouches[0].size + var changeForce = event.changedTouches[0].force + var message = 'globalX--' + globalX + ',globalY--' + globalY + + ',localX--' + localX + ',localY--' + localY + ',size--' + size + ',force--' + force + + ',changeGlobalX--' + changeGlobalX + ',changeGlobalY--' + changeGlobalY + + ',changeLocalX--' + changeLocalX + ',changeLocalY--' + changeLocalY + + ',changeSize--' + changeSize + ',changeForce--' + changeForce; + prompt.showToast({ + message: 'touchCancel:\n' +message + }); + }, + + click(){ + prompt.showToast({ + message: 'click' + }); + }, + + doubleClick(){ + prompt.showToast({ + message: 'doubleClick' + }); + }, + + longPress(){ + prompt.showToast({ + message: 'longPress' + }); + }, + + focus(){ + prompt.showToast({ + message: 'focus' + }); + }, + + blur(){ + prompt.showToast({ + message: 'blur' + }); + }, + + key(event){ + var code = event.code; + var action = event.action; + var repeatCount = event.repeatCount; + var timestampStart = event.timestampStart; + var message = 'code--' + code + ',action--' + action + + ',repeatCount--' + repeatCount + ',timestampStart--' + timestampStart; + prompt.showToast({ + message: 'key:\n' + message + }); + }, + + swipe(event){ + var direction = event.direction; + var distance = event.distance; + var message = 'direction--' + direction + ',distance--' + distance; + prompt.showToast({ + message: 'swipe:\n' + message + }); + }, + + attached(){ + prompt.showToast({ + message: 'attached' + }); + }, + + detached(){ + prompt.showToast({ + message: 'detached' + }); + }, + + pinchStart(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchStart:\n' + message + }); + }, + + pinchUpdate(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchUpdate:\n' + message + }); + }, + + pinchEnd(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchUpdate:\n' + message + }); + }, + + pinchCancel(event){ + var scale = event.scale + var pinchCenterX = event.pinchCenterX + var pinchCenterY = event.pinchCenterY + var message = 'scale--' + scale + ',pinchCenterX--' + pinchCenterX + + ',pinchCenterY--' + pinchCenterY; + prompt.showToast({ + message: 'pinchCancel:\n' + message + }); + }, + + dragStart(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragStart:\n' + message + }); + }, + + drag(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'drag:\n' + message + }); + }, + + dragEnd(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragEnd:\n' + message + }); + }, + + dragEnter(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragEnter:\n' + message + }); + }, + + dragOver(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragOver:\n' + message + }); + }, + + dragLeave(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'dragLeave:\n' + message + }); + }, + + drop(event){ + var type = event.type + var globalX = event.globalX + var globalY = event.globalY + var timestamp = event.timestamp + var message = 'type--' + type + ',globalX--' + globalX + + ',globalY--' + globalY + ',timestamp--' + timestamp; + prompt.showToast({ + message: 'drop:\n' + message + }); + }, + + functionTest1(event){ + var function1 = this.$element('function1'); + function1.focus(true) + var rect = function1.getBoundingClientRect(); + var width = rect.width; + var height = rect.height; + var left = rect.left; + var top = rect.top; + var message = 'width--' + width + ',height--' + height + + ',left--' + left + ',top--' + top; + prompt.showToast({ + message: 'function1 rect:\n' + message + }); + }, + + functionTest2(event){ + var function2 = this.$element('function2'); + let observer = function2.createIntersectionObserver({ + ratios: [0.2, 0], // number + }); + observer.observe((isVisible, ratio)=> { + console.info('this element is ' + isVisible + 'ratio is ' + ratio) + prompt.showToast({ + message: 'function2 observer:\n' + 'isVisible--' + isVisible + ',ratio--' + ratio + }); + }) + + observer.unobserve() + }, + + functionTest3(event){ + var function3 = this.$element('function3'); + + var animation = function3.animate(frames, options); + animation.play() + animation.onfinish = function(){ + prompt.showToast({ + message: 'The animation is finished.' + }); + }; + + animation.oncancel = function(){ + prompt.showToast({ + message: 'The animation is canceled.' + }); + }; + + animation.onrepeat = function(){ + prompt.showToast({ + message: 'The animation is repeated.' + }); + }; + + setTimeout(() => { + animation.reverse() + }, 500) + + setTimeout(() => { + animation.pause() + }, 1000) + + setTimeout(() => { + animation.cancel() + }, 1500) + }, + + functionTest4(event){ + var function4 = this.$element('function4'); + var scrollOffset = function4.getScrollOffset(); + var x = scrollOffset.x; + var y = scrollOffset.y; + var message = 'x--' + x + ',y--' + y; + prompt.showToast({ + message: 'functionTest4 scrollOffset:\n' + message + }); + + var scrollParam = { + dx:60, + dy:0, + smooth:true + } + function4.scrollBy(scrollParam) + }, + + reachStart(){ + prompt.showToast({ + message: 'reachStart' + }); + }, + + reachEnd(){ + prompt.showToast({ + message: 'reachEnd' + }); + }, + + reachTop(){ + prompt.showToast({ + message: 'reachTop' + }); + }, + + reachBottom(){ + prompt.showToast({ + message: 'reachBottom' + }); + } +} diff --git a/ace/ace_standard/src/main/js/default/test/List.test.js b/ace/ace_standard/src/main/js/default/test/List.test.js index 515a4d376..3614ff4fd 100755 --- a/ace/ace_standard/src/main/js/default/test/List.test.js +++ b/ace/ace_standard/src/main/js/default/test/List.test.js @@ -26,4 +26,8 @@ require('./switchProps.test.js') require('./tabsProps.test.js') require('./tabBarProps.test.js') require('./tabContentProps.test.js') - +require('./progressProps.test.js') +require('./dividerProps.test.js') +require('./optionProps.test.js') +require('./pickerProps.test.js') +require('./pickerViewProps.test.js') diff --git a/ace/ace_standard/src/main/js/default/test/dividerProps.test.js b/ace/ace_standard/src/main/js/default/test/dividerProps.test.js new file mode 100644 index 000000000..99dafb833 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/dividerProps.test.js @@ -0,0 +1,725 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('dividerPropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[dividerPropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/divider/prop/index' + } + try { + result = router.push(options) + console.info("push dividerProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push dividerProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[dividerPropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerIdProp + * @tc.desc ACE + */ + it('testDividerIdProp', 0, async function (done) { + console.info('testDividerIdProp START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerClassProp + * @tc.desc ACE + */ + it('testDividerClassProp', 0, async function (done) { + console.info('testDividerClassProp START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerClassPropNone + * @tc.desc ACE + */ + it('testDividerClassPropNone', 0, async function (done) { + console.info('testDividerClassPropNone START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("[dividerProps] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerStyleProp + * @tc.desc ACEs + */ +// it('testDividerStyleProp', 0, async function (done) { +// console.info('testDividerStyleProp START'); +// console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); +// +// let obj = JSON.parse(globalThis.value.styleProp); +// console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); +// console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); +// +// expect(obj.$type).assertEqual('divider') +// expect(obj.$attrs.id).assertEqual('styleProp') +// expect(obj.$attrs.style).assertEqual(undefined) +// console.info("[dividerProps] get style value is: " + JSON.stringify(obj.$attrs.style)); +// +// expect(obj.$styles.width).assertEqual(undefined); +// console.info("[dividerProps] get style width value is: " + JSON.stringify(obj.$styles.width)); +// expect(obj.$styles.height).assertEqual(undefined); +// console.info("[dividerProps] get style height value is: " + JSON.stringify(obj.$styles.height)); +// expect(obj.$styles.get('background-color')).assertEqual(undefined); +// done(); +// }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerRefProp + * @tc.desc ACE + */ + it('testDividerRefProp', 0, async function (done) { + console.info('testDividerRefProp START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refProp); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerRefPropNone + * @tc.desc ACE + */ + it('testDividerRefPropNone', 0, async function (done) { + console.info('testDividerRefPropNone START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refPropNone); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + console.info("[dividerProps] get ref value is: " + JSON.stringify(obj.$attrs.ref)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerDisabledPropTrue + * @tc.desc ACE + */ + it('testDividerDisabledPropTrue', 0, async function (done) { + console.info('testDividerDisabledPropTrue START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropTrue); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerDisabledPropFalse + * @tc.desc ACE + */ + it('testDividerDisabledPropFalse', 0, async function (done) { + console.info('testDividerDisabledPropFalse START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropFalse); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerDisabledPropNone + * @tc.desc ACE + */ + it('testDividerDisabledPropNone', 0, async function (done) { + console.info('testDividerDisabledPropNone START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropNone); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerFocusablePropTrue + * @tc.desc ACE + */ + it('testDividerFocusablePropTrue', 0, async function (done) { + console.info('testDividerFocusablePropTrue START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropTrue); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerFocusablePropFalse + * @tc.desc ACE + */ + it('testDividerFocusablePropFalse', 0, async function (done) { + console.info('testDividerFocusablePropFalse START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropFalse); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerFocusablePropNone + * @tc.desc ACE + */ + it('testDividerFocusablePropNone', 0, async function (done) { + console.info('testDividerFocusablePropNone START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropNone); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerDataProp + * @tc.desc ACE + */ + it('testDividerDataProp', 0, async function (done) { + console.info('testDividerDataProp START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataProp); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.dataDiv).assertEqual(undefined); + console.info("[dividerProps] get dataDiv value is: " + JSON.stringify(obj.$attrs.dataDiv)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerDataPropNone + * @tc.desc ACE + */ + it('testDividerDataPropNone', 0, async function (done) { + console.info('testDividerDataPropNone START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataPropNone); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.dataDiv).assertEqual(undefined) + console.info("[dividerProps] get dataDiv value is: " + JSON.stringify(obj.$attrs.dataDiv)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerClickEffectPropSmall + * @tc.desc ACE + */ + it('testDividerClickEffectPropSmall', 0, async function (done) { + console.info('testDividerClickEffectPropSmall START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropSmall); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') + expect(obj.$attrs.clickEffect).assertEqual('spring-small') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerClickEffectPropMedium + * @tc.desc ACE + */ + it('testDividerClickEffectPropMedium', 0, async function (done) { + console.info('testDividerClickEffectPropMedium START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropMedium); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') + expect(obj.$attrs.clickEffect).assertEqual('spring-medium') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerClickEffectPropLarge + * @tc.desc ACE + */ + it('testDividerClickEffectPropLarge', 0, async function (done) { + console.info('testDividerClickEffectPropLarge START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropLarge); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') + expect(obj.$attrs.clickEffect).assertEqual('spring-large') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerClickEffectPropNone + * @tc.desc ACE + */ + it('testDividerClickEffectPropNone', 0, async function (done) { + console.info('testDividerClickEffectPropNone START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropNone); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('clickEffectPropNone') + expect(obj.$attrs.clickEffect).assertEqual(undefined) + console.info("[dividerProps] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerDirPropRtl + * @tc.desc ACE + */ + it('testDividerDirPropRtl', 0, async function (done) { + console.info('testDividerDirPropRtl START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropRtl); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerDirPropLtr + * @tc.desc ACE + */ + it('testDividerDirPropLtr', 0, async function (done) { + console.info('testDividerDirPropLtr START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropLtr); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerDirPropAuto + * @tc.desc ACE + */ + it('testDividerDirPropAuto', 0, async function (done) { + console.info('testDividerDirPropAuto START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropAuto); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerDirPropNone + * @tc.desc ACE + */ + it('testDividerDirPropNone', 0, async function (done) { + console.info('testDividerDirPropNone START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropNone); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerForPropNull + * @tc.desc ACE + */ + it('testDividerForPropNull', 0, async function (done) { + console.info('testDividerForPropNull START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropNull); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[dividerProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerForPropOne + * @tc.desc ACE + */ + it('testDividerForPropOne', 0, async function (done) { + console.info('testDividerForPropOne START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropOne); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[dividerProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerForPropThree + * @tc.desc ACE + */ + it('testDividerForPropThree', 0, async function (done) { + console.info('testDividerForPropThree START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropThree); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[dividerProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerIfPropTrue + * @tc.desc ACE + */ + it('testDividerIfPropTrue', 0, async function (done) { + console.info('testDividerIfPropTrue START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropTrue); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + console.info("[dividerProps] get for value is: " + JSON.stringify(obj.$attrs.if)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerIfPropFalse + * @tc.desc ACE + */ + // it('testDividerIfPropFalse', 0, async function (done) { + // console.info('testDividerIfPropFalse START'); + // console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropFalse); + // console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('divider') + // expect(obj.$attrs.id).assertEqual('ifPropFalse') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerIfPropNone + * @tc.desc ACE + */ + // it('testDividerIfPropNone', 0, async function (done) { + // console.info('testDividerIfPropNone START'); + // console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropNone); + // console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('divider') + // expect(obj.$attrs.id).assertEqual('ifPropNone') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerShowPropTrue + * @tc.desc ACE + */ + it('testDividerShowPropTrue', 0, async function (done) { + console.info('testDividerShowPropTrue START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropTrue); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + console.info("[dividerProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerShowPropFalse + * @tc.desc ACE + */ + it('testDividerShowPropFalse', 0, async function (done) { + console.info('testDividerShowPropFalse START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropFalse); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + console.info("[dividerProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerShowPropNone + * @tc.desc ACE + */ + it('testDividerShowPropNone', 0, async function (done) { + console.info('testDividerShowPropNone START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropNone); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual('true') + console.info("[dividerProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerVerticalTrue + * @tc.desc ACE + */ + it('testDividerVerticalTrue', 0, async function (done) { + console.info('testDividerVerticalTrue START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.verticalTrue); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('verticalTrue') + expect(obj.$attrs.vertical).assertEqual('true') + console.info("[dividerProps] get vertical value is: " + JSON.stringify(obj.$attrs.vertical)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testDividerVerticalFalse + * @tc.desc ACE + */ + it('testDividerVerticalFalse', 0, async function (done) { + console.info('testDividerVerticalFalse START'); + console.info("[dividerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.verticalFalse); + console.info("[dividerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[dividerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('divider') + expect(obj.$attrs.id).assertEqual('verticalFalse') + expect(obj.$attrs.vertical).assertEqual('false') + console.info("[dividerProps] get vertical value is: " + JSON.stringify(obj.$attrs.vertical)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/optionProps.test.js b/ace/ace_standard/src/main/js/default/test/optionProps.test.js new file mode 100644 index 000000000..e97664064 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/optionProps.test.js @@ -0,0 +1,764 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('optionPropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[optionPropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/option/prop/index' + } + try { + result = router.push(options) + console.info("push optionProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push optionProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[optionPropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionIdProp + * @tc.desc ACE + */ + it('testOptionIdProp', 0, async function (done) { + console.info('testOptionIdProp START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionClassProp + * @tc.desc ACE + */ + it('testOptionClassProp', 0, async function (done) { + console.info('testOptionClassProp START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionClassPropNone + * @tc.desc ACE + */ + it('testOptionClassPropNone', 0, async function (done) { + console.info('testOptionClassPropNone START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("[optionProps] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionStyleProp + * @tc.desc ACEs + */ +// it('testOptionStyleProp', 0, async function (done) { +// console.info('testOptionStyleProp START'); +// console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); +// +// let obj = JSON.parse(globalThis.value.styleProp); +// console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); +// console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); +// +// expect(obj.$type).assertEqual('option') +// expect(obj.$attrs.id).assertEqual('styleProp') +// expect(obj.$attrs.style).assertEqual(undefined) +// console.info("[optionProps] get style value is: " + JSON.stringify(obj.$attrs.style)); +// +// expect(obj.$styles.width).assertEqual(undefined); +// console.info("[optionProps] get style width value is: " + JSON.stringify(obj.$styles.width)); +// expect(obj.$styles.height).assertEqual(undefined); +// console.info("[optionProps] get style height value is: " + JSON.stringify(obj.$styles.height)); +// expect(obj.$styles.get('background-color')).assertEqual(undefined); +// done(); +// }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionRefProp + * @tc.desc ACE + */ + it('testOptionRefProp', 0, async function (done) { + console.info('testOptionRefProp START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refProp); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionRefPropNone + * @tc.desc ACE + */ + it('testOptionRefPropNone', 0, async function (done) { + console.info('testOptionRefPropNone START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refPropNone); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + console.info("[optionProps] get ref value is: " + JSON.stringify(obj.$attrs.ref)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionDisabledPropTrue + * @tc.desc ACE + */ + it('testOptionDisabledPropTrue', 0, async function (done) { + console.info('testOptionDisabledPropTrue START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropTrue); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionDisabledPropFalse + * @tc.desc ACE + */ + it('testOptionDisabledPropFalse', 0, async function (done) { + console.info('testOptionDisabledPropFalse START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropFalse); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionDisabledPropNone + * @tc.desc ACE + */ + it('testOptionDisabledPropNone', 0, async function (done) { + console.info('testOptionDisabledPropNone START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropNone); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionFocusablePropTrue + * @tc.desc ACE + */ + it('testOptionFocusablePropTrue', 0, async function (done) { + console.info('testOptionFocusablePropTrue START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropTrue); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionFocusablePropFalse + * @tc.desc ACE + */ + it('testOptionFocusablePropFalse', 0, async function (done) { + console.info('testOptionFocusablePropFalse START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropFalse); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionFocusablePropNone + * @tc.desc ACE + */ + it('testOptionFocusablePropNone', 0, async function (done) { + console.info('testOptionFocusablePropNone START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropNone); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionDataProp + * @tc.desc ACE + */ + it('testOptionDataProp', 0, async function (done) { + console.info('testOptionDataProp START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataProp); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.dataoption).assertEqual(undefined); + console.info("[optionProps] get dataoption value is: " + JSON.stringify(obj.$attrs.dataoption)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionDataPropNone + * @tc.desc ACE + */ + it('testOptionDataPropNone', 0, async function (done) { + console.info('testOptionDataPropNone START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataPropNone); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.dataoption).assertEqual(undefined) + console.info("[optionProps] get dataoption value is: " + JSON.stringify(obj.$attrs.dataoption)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionClickEffectPropSmall + * @tc.desc ACE + */ + it('testOptionClickEffectPropSmall', 0, async function (done) { + console.info('testOptionClickEffectPropSmall START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropSmall); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') + expect(obj.$attrs.clickEffect).assertEqual('spring-small') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionClickEffectPropMedium + * @tc.desc ACE + */ + it('testOptionClickEffectPropMedium', 0, async function (done) { + console.info('testOptionClickEffectPropMedium START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropMedium); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') + expect(obj.$attrs.clickEffect).assertEqual('spring-medium') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionClickEffectPropLarge + * @tc.desc ACE + */ + it('testOptionClickEffectPropLarge', 0, async function (done) { + console.info('testOptionClickEffectPropLarge START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropLarge); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') + expect(obj.$attrs.clickEffect).assertEqual('spring-large') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionClickEffectPropNone + * @tc.desc ACE + */ + it('testOptionClickEffectPropNone', 0, async function (done) { + console.info('testOptionClickEffectPropNone START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropNone); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('clickEffectPropNone') + expect(obj.$attrs.clickEffect).assertEqual(undefined) + console.info("[optionProps] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionDirPropRtl + * @tc.desc ACE + */ + it('testOptionDirPropRtl', 0, async function (done) { + console.info('testOptionDirPropRtl START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropRtl); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionDirPropLtr + * @tc.desc ACE + */ + it('testOptionDirPropLtr', 0, async function (done) { + console.info('testOptionDirPropLtr START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropLtr); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionDirPropAuto + * @tc.desc ACE + */ + it('testOptionDirPropAuto', 0, async function (done) { + console.info('testOptionDirPropAuto START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropAuto); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionDirPropNone + * @tc.desc ACE + */ + it('testOptionDirPropNone', 0, async function (done) { + console.info('testOptionDirPropNone START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropNone); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionForPropNull + * @tc.desc ACE + */ + it('testOptionForPropNull', 0, async function (done) { + console.info('testOptionForPropNull START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropNull); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[optionProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionForPropOne + * @tc.desc ACE + */ + it('testOptionForPropOne', 0, async function (done) { + console.info('testOptionForPropOne START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropOne); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[optionProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionForPropThree + * @tc.desc ACE + */ + it('testOptionForPropThree', 0, async function (done) { + console.info('testOptionForPropThree START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropThree); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[optionProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionIfPropTrue + * @tc.desc ACE + */ + it('testOptionIfPropTrue', 0, async function (done) { + console.info('testOptionIfPropTrue START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropTrue); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + console.info("[optionProps] get for value is: " + JSON.stringify(obj.$attrs.if)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionIfPropFalse + * @tc.desc ACE + */ + // it('testOptionIfPropFalse', 0, async function (done) { + // console.info('testOptionIfPropFalse START'); + // console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropFalse); + // console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('option') + // expect(obj.$attrs.id).assertEqual('ifPropFalse') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionIfPropNone + * @tc.desc ACE + */ + // it('testOptionIfPropNone', 0, async function (done) { + // console.info('testOptionIfPropNone START'); + // console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropNone); + // console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('option') + // expect(obj.$attrs.id).assertEqual('ifPropNone') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionShowPropTrue + * @tc.desc ACE + */ + it('testOptionShowPropTrue', 0, async function (done) { + console.info('testOptionShowPropTrue START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropTrue); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + console.info("[optionProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionShowPropFalse + * @tc.desc ACE + */ + it('testOptionShowPropFalse', 0, async function (done) { + console.info('testOptionShowPropFalse START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropFalse); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + console.info("[optionProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionShowPropNone + * @tc.desc ACE + */ + it('testOptionShowPropNone', 0, async function (done) { + console.info('testOptionShowPropNone START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropNone); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual('true') + console.info("[optionProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionSelectedTrue + * @tc.desc ACE + */ + it('testOptionSelectedTrue', 0, async function (done) { + console.info('testOptionSelectedTrue START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.selectedTrue); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('selectedTrue') + expect(obj.$attrs.selected).assertEqual('true') + console.info("[optionProps] get selected value is: " + JSON.stringify(obj.$attrs.selected)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionSelectedFalse + * @tc.desc ACE + */ + it('testOptionSelectedFalse', 0, async function (done) { + console.info('testOptionSelectedFalse START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.selectedFalse); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('selectedFalse') + expect(obj.$attrs.selected).assertEqual('false') + console.info("[optionProps] get selected value is: " + JSON.stringify(obj.$attrs.selected)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionOptionValue + * @tc.desc ACE + */ + it('testOptionOptionValue', 0, async function (done) { + console.info('testOptionOptionValue START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.optionValue); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('optionValue') + expect(obj.$attrs.value).assertEqual('optionValue') + console.info("[optionProps] get value value is: " + JSON.stringify(obj.$attrs.value)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testOptionOptionIcon + * @tc.desc ACE + */ + it('testOptionOptionIcon', 0, async function (done) { + console.info('testOptionOptionIcon START'); + console.info("[optionProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.optionIcon); + console.info("[optionProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[optionProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('option') + expect(obj.$attrs.id).assertEqual('optionIcon') + expect(obj.$attrs.icon).assertEqual('optionIcon') + console.info("[optionProps] get icon value is: " + JSON.stringify(obj.$attrs.icon)); + console.info("[optionProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/pickerProps.test.js b/ace/ace_standard/src/main/js/default/test/pickerProps.test.js new file mode 100644 index 000000000..6e68a506a --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/pickerProps.test.js @@ -0,0 +1,779 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('pickerPropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[pickerPropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/picker/prop/index' + } + try { + result = router.push(options) + console.info("push pickerProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push pickerProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[pickerPropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerIdProp + * @tc.desc ACE + */ + it('testPickerIdProp', 0, async function (done) { + console.info('testPickerIdProp START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerClassProp + * @tc.desc ACE + */ + it('testPickerClassProp', 0, async function (done) { + console.info('testPickerClassProp START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerClassPropNone + * @tc.desc ACE + */ + it('testPickerClassPropNone', 0, async function (done) { + console.info('testPickerClassPropNone START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("[pickerProps] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerStyleProp + * @tc.desc ACEs + */ +// it('testPickerStyleProp', 0, async function (done) { +// console.info('testPickerStyleProp START'); +// console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); +// +// let obj = JSON.parse(globalThis.value.styleProp); +// console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); +// console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); +// +// expect(obj.$type).assertEqual('picker') +// expect(obj.$attrs.id).assertEqual('styleProp') +// expect(obj.$attrs.style).assertEqual(undefined) +// console.info("[pickerProps] get style value is: " + JSON.stringify(obj.$attrs.style)); +// +// expect(obj.$styles.width).assertEqual(undefined); +// console.info("[pickerProps] get style width value is: " + JSON.stringify(obj.$styles.width)); +// expect(obj.$styles.height).assertEqual(undefined); +// console.info("[pickerProps] get style height value is: " + JSON.stringify(obj.$styles.height)); +// expect(obj.$styles.get('background-color')).assertEqual(undefined); +// done(); +// }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerRefProp + * @tc.desc ACE + */ + it('testPickerRefProp', 0, async function (done) { + console.info('testPickerRefProp START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refProp); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerRefPropNone + * @tc.desc ACE + */ + it('testPickerRefPropNone', 0, async function (done) { + console.info('testPickerRefPropNone START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refPropNone); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + console.info("[pickerProps] get ref value is: " + JSON.stringify(obj.$attrs.ref)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerDisabledPropTrue + * @tc.desc ACE + */ + it('testPickerDisabledPropTrue', 0, async function (done) { + console.info('testPickerDisabledPropTrue START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropTrue); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerDisabledPropFalse + * @tc.desc ACE + */ + it('testPickerDisabledPropFalse', 0, async function (done) { + console.info('testPickerDisabledPropFalse START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropFalse); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerDisabledPropNone + * @tc.desc ACE + */ + it('testPickerDisabledPropNone', 0, async function (done) { + console.info('testPickerDisabledPropNone START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropNone); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerFocusablePropTrue + * @tc.desc ACE + */ + it('testPickerFocusablePropTrue', 0, async function (done) { + console.info('testPickerFocusablePropTrue START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropTrue); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerFocusablePropFalse + * @tc.desc ACE + */ + it('testPickerFocusablePropFalse', 0, async function (done) { + console.info('testPickerFocusablePropFalse START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropFalse); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerFocusablePropNone + * @tc.desc ACE + */ + it('testPickerFocusablePropNone', 0, async function (done) { + console.info('testPickerFocusablePropNone START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropNone); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerDataProp + * @tc.desc ACE + */ + it('testPickerDataProp', 0, async function (done) { + console.info('testPickerDataProp START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataProp); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.datapicker).assertEqual(undefined); + console.info("[pickerProps] get datapicker value is: " + JSON.stringify(obj.$attrs.datapicker)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerDataPropNone + * @tc.desc ACE + */ + it('testPickerDataPropNone', 0, async function (done) { + console.info('testPickerDataPropNone START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataPropNone); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.datapicker).assertEqual(undefined) + console.info("[pickerProps] get datapicker value is: " + JSON.stringify(obj.$attrs.datapicker)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerClickEffectPropSmall + * @tc.desc ACE + */ + it('testPickerClickEffectPropSmall', 0, async function (done) { + console.info('testPickerClickEffectPropSmall START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropSmall); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') + expect(obj.$attrs.clickEffect).assertEqual('spring-small') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerClickEffectPropMedium + * @tc.desc ACE + */ + it('testPickerClickEffectPropMedium', 0, async function (done) { + console.info('testPickerClickEffectPropMedium START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropMedium); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') + expect(obj.$attrs.clickEffect).assertEqual('spring-medium') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerClickEffectPropLarge + * @tc.desc ACE + */ + it('testPickerClickEffectPropLarge', 0, async function (done) { + console.info('testPickerClickEffectPropLarge START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropLarge); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') + expect(obj.$attrs.clickEffect).assertEqual('spring-large') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerClickEffectPropNone + * @tc.desc ACE + */ + it('testPickerClickEffectPropNone', 0, async function (done) { + console.info('testPickerClickEffectPropNone START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropNone); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('clickEffectPropNone') + expect(obj.$attrs.clickEffect).assertEqual(undefined) + console.info("[pickerProps] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerDirPropRtl + * @tc.desc ACE + */ + it('testPickerDirPropRtl', 0, async function (done) { + console.info('testPickerDirPropRtl START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropRtl); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerDirPropLtr + * @tc.desc ACE + */ + it('testPickerDirPropLtr', 0, async function (done) { + console.info('testPickerDirPropLtr START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropLtr); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerDirPropAuto + * @tc.desc ACE + */ + it('testPickerDirPropAuto', 0, async function (done) { + console.info('testPickerDirPropAuto START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropAuto); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerDirPropNone + * @tc.desc ACE + */ + it('testPickerDirPropNone', 0, async function (done) { + console.info('testPickerDirPropNone START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropNone); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerForPropNull + * @tc.desc ACE + */ + it('testPickerForPropNull', 0, async function (done) { + console.info('testPickerForPropNull START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropNull); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[pickerProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerForPropOne + * @tc.desc ACE + */ + it('testPickerForPropOne', 0, async function (done) { + console.info('testPickerForPropOne START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropOne); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[pickerProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerForPropThree + * @tc.desc ACE + */ + it('testPickerForPropThree', 0, async function (done) { + console.info('testPickerForPropThree START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropThree); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[pickerProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerIfPropTrue + * @tc.desc ACE + */ + it('testPickerIfPropTrue', 0, async function (done) { + console.info('testPickerIfPropTrue START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropTrue); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + console.info("[pickerProps] get for value is: " + JSON.stringify(obj.$attrs.if)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerIfPropFalse + * @tc.desc ACE + */ + // it('testPickerIfPropFalse', 0, async function (done) { + // console.info('testPickerIfPropFalse START'); + // console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropFalse); + // console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('picker') + // expect(obj.$attrs.id).assertEqual('ifPropFalse') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerIfPropNone + * @tc.desc ACE + */ + // it('testPickerIfPropNone', 0, async function (done) { + // console.info('testPickerIfPropNone START'); + // console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropNone); + // console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('picker') + // expect(obj.$attrs.id).assertEqual('ifPropNone') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerShowPropTrue + * @tc.desc ACE + */ + it('testPickerShowPropTrue', 0, async function (done) { + console.info('testPickerShowPropTrue START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropTrue); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + console.info("[pickerProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerShowPropFalse + * @tc.desc ACE + */ + it('testPickerShowPropFalse', 0, async function (done) { + console.info('testPickerShowPropFalse START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropFalse); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + console.info("[pickerProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerShowPropNone + * @tc.desc ACE + */ + it('testPickerShowPropNone', 0, async function (done) { + console.info('testPickerShowPropNone START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropNone); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual('true') + console.info("[pickerProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerPickerText + * @tc.desc ACE + */ + it('testPickerPickerText', 0, async function (done) { + console.info('testPickerPickerText START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerText); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('pickerText') + expect(obj.$attrs.type).assertEqual('text') + console.info("[pickerProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerPickerTime + * @tc.desc ACE + */ + it('testPickerPickerTime', 0, async function (done) { + console.info('testPickerPickerTime START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerTime); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('pickerTime') + expect(obj.$attrs.type).assertEqual('time') + console.info("[pickerProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + });/** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerPickerDate + * @tc.desc ACE + */ + it('testPickerPickerDate', 0, async function (done) { + console.info('testPickerPickerDate START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerDate); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('pickerDate') + expect(obj.$attrs.type).assertEqual('date') + console.info("[pickerProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + });/** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerPickerDatetime + * @tc.desc ACE + */ + it('testPickerPickerDatetime', 0, async function (done) { + console.info('testPickerPickerDatetime START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerDatetime); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('pickerDatetime') + expect(obj.$attrs.if).assertEqual('datetime') + console.info("[pickerProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + });/** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerPickerMultiText + * @tc.desc ACE + */ + it('testPickerPickerMultiText', 0, async function (done) { + console.info('testPickerPickerMultiText START'); + console.info("[pickerProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerMultiText); + console.info("[pickerProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('picker') + expect(obj.$attrs.id).assertEqual('pickerMultiText') + expect(obj.$attrs.type).assertEqual('multi-text') + console.info("[pickerProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/pickerViewProps.test.js b/ace/ace_standard/src/main/js/default/test/pickerViewProps.test.js new file mode 100644 index 000000000..21ba58042 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/pickerViewProps.test.js @@ -0,0 +1,779 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('pickerViewPropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[pickerViewPropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/pickerView/prop/index' + } + try { + result = router.push(options) + console.info("push pickerViewProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push pickerViewProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[pickerViewPropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewIdProp + * @tc.desc ACE + */ + it('testPickerViewIdProp', 0, async function (done) { + console.info('testPickerViewIdProp START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewClassProp + * @tc.desc ACE + */ + it('testPickerViewClassProp', 0, async function (done) { + console.info('testPickerViewClassProp START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewClassPropNone + * @tc.desc ACE + */ + it('testPickerViewClassPropNone', 0, async function (done) { + console.info('testPickerViewClassPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("[pickerViewProps] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewStyleProp + * @tc.desc ACEs + */ + // it('testPickerViewStyleProp', 0, async function (done) { + // console.info('testPickerViewStyleProp START'); + // console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.styleProp); + // console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('pickerView') + // expect(obj.$attrs.id).assertEqual('styleProp') + // expect(obj.$attrs.style).assertEqual(undefined) + // console.info("[pickerViewProps] get style value is: " + JSON.stringify(obj.$attrs.style)); + // + // expect(obj.$styles.width).assertEqual(undefined); + // console.info("[pickerViewProps] get style width value is: " + JSON.stringify(obj.$styles.width)); + // expect(obj.$styles.height).assertEqual(undefined); + // console.info("[pickerViewProps] get style height value is: " + JSON.stringify(obj.$styles.height)); + // expect(obj.$styles.get('background-color')).assertEqual(undefined); + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewRefProp + * @tc.desc ACE + */ + it('testPickerViewRefProp', 0, async function (done) { + console.info('testPickerViewRefProp START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refProp); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewRefPropNone + * @tc.desc ACE + */ + it('testPickerViewRefPropNone', 0, async function (done) { + console.info('testPickerViewRefPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + console.info("[pickerViewProps] get ref value is: " + JSON.stringify(obj.$attrs.ref)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDisabledPropTrue + * @tc.desc ACE + */ + it('testPickerViewDisabledPropTrue', 0, async function (done) { + console.info('testPickerViewDisabledPropTrue START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropTrue); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDisabledPropFalse + * @tc.desc ACE + */ + it('testPickerViewDisabledPropFalse', 0, async function (done) { + console.info('testPickerViewDisabledPropFalse START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropFalse); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDisabledPropNone + * @tc.desc ACE + */ + it('testPickerViewDisabledPropNone', 0, async function (done) { + console.info('testPickerViewDisabledPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewFocusablePropTrue + * @tc.desc ACE + */ + it('testPickerViewFocusablePropTrue', 0, async function (done) { + console.info('testPickerViewFocusablePropTrue START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropTrue); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewFocusablePropFalse + * @tc.desc ACE + */ + it('testPickerViewFocusablePropFalse', 0, async function (done) { + console.info('testPickerViewFocusablePropFalse START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropFalse); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewFocusablePropNone + * @tc.desc ACE + */ + it('testPickerViewFocusablePropNone', 0, async function (done) { + console.info('testPickerViewFocusablePropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDataProp + * @tc.desc ACE + */ + it('testPickerViewDataProp', 0, async function (done) { + console.info('testPickerViewDataProp START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataProp); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.datapickerView).assertEqual(undefined); + console.info("[pickerViewProps] get datapickerView value is: " + JSON.stringify(obj.$attrs.datapickerView)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDataPropNone + * @tc.desc ACE + */ + it('testPickerViewDataPropNone', 0, async function (done) { + console.info('testPickerViewDataPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.datapickerView).assertEqual(undefined) + console.info("[pickerViewProps] get datapickerView value is: " + JSON.stringify(obj.$attrs.datapickerView)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewClickEffectPropSmall + * @tc.desc ACE + */ + it('testPickerViewClickEffectPropSmall', 0, async function (done) { + console.info('testPickerViewClickEffectPropSmall START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropSmall); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') + expect(obj.$attrs.clickEffect).assertEqual('spring-small') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewClickEffectPropMedium + * @tc.desc ACE + */ + it('testPickerViewClickEffectPropMedium', 0, async function (done) { + console.info('testPickerViewClickEffectPropMedium START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropMedium); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') + expect(obj.$attrs.clickEffect).assertEqual('spring-medium') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewClickEffectPropLarge + * @tc.desc ACE + */ + it('testPickerViewClickEffectPropLarge', 0, async function (done) { + console.info('testPickerViewClickEffectPropLarge START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropLarge); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') + expect(obj.$attrs.clickEffect).assertEqual('spring-large') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewClickEffectPropNone + * @tc.desc ACE + */ + it('testPickerViewClickEffectPropNone', 0, async function (done) { + console.info('testPickerViewClickEffectPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('clickEffectPropNone') + expect(obj.$attrs.clickEffect).assertEqual(undefined) + console.info("[pickerViewProps] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDirPropRtl + * @tc.desc ACE + */ + it('testPickerViewDirPropRtl', 0, async function (done) { + console.info('testPickerViewDirPropRtl START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropRtl); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDirPropLtr + * @tc.desc ACE + */ + it('testPickerViewDirPropLtr', 0, async function (done) { + console.info('testPickerViewDirPropLtr START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropLtr); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDirPropAuto + * @tc.desc ACE + */ + it('testPickerViewDirPropAuto', 0, async function (done) { + console.info('testPickerViewDirPropAuto START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropAuto); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewDirPropNone + * @tc.desc ACE + */ + it('testPickerViewDirPropNone', 0, async function (done) { + console.info('testPickerViewDirPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewForPropNull + * @tc.desc ACE + */ + it('testPickerViewForPropNull', 0, async function (done) { + console.info('testPickerViewForPropNull START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropNull); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[pickerViewProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewForPropOne + * @tc.desc ACE + */ + it('testPickerViewForPropOne', 0, async function (done) { + console.info('testPickerViewForPropOne START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropOne); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[pickerViewProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewForPropThree + * @tc.desc ACE + */ + it('testPickerViewForPropThree', 0, async function (done) { + console.info('testPickerViewForPropThree START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropThree); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[pickerViewProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewIfPropTrue + * @tc.desc ACE + */ + it('testPickerViewIfPropTrue', 0, async function (done) { + console.info('testPickerViewIfPropTrue START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropTrue); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + console.info("[pickerViewProps] get for value is: " + JSON.stringify(obj.$attrs.if)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewIfPropFalse + * @tc.desc ACE + */ + // it('testPickerViewIfPropFalse', 0, async function (done) { + // console.info('testPickerViewIfPropFalse START'); + // console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropFalse); + // console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('pickerView') + // expect(obj.$attrs.id).assertEqual('ifPropFalse') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewIfPropNone + * @tc.desc ACE + */ + // it('testPickerViewIfPropNone', 0, async function (done) { + // console.info('testPickerViewIfPropNone START'); + // console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropNone); + // console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('pickerView') + // expect(obj.$attrs.id).assertEqual('ifPropNone') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewShowPropTrue + * @tc.desc ACE + */ + it('testPickerViewShowPropTrue', 0, async function (done) { + console.info('testPickerViewShowPropTrue START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropTrue); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + console.info("[pickerViewProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewShowPropFalse + * @tc.desc ACE + */ + it('testPickerViewShowPropFalse', 0, async function (done) { + console.info('testPickerViewShowPropFalse START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropFalse); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + console.info("[pickerViewProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewShowPropNone + * @tc.desc ACE + */ + it('testPickerViewShowPropNone', 0, async function (done) { + console.info('testPickerViewShowPropNone START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropNone); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual('true') + console.info("[pickerViewProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewPickerViewText + * @tc.desc ACE + */ + it('testPickerViewPickerViewText', 0, async function (done) { + console.info('testPickerViewPickerViewText START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerViewText); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('pickerViewText') + expect(obj.$attrs.type).assertEqual('text') + console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewPickerViewTime + * @tc.desc ACE + */ + it('testPickerViewPickerViewTime', 0, async function (done) { + console.info('testPickerViewPickerViewTime START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerViewTime); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('pickerViewTime') + expect(obj.$attrs.type).assertEqual('time') + console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + });/** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewPickerViewDate + * @tc.desc ACE + */ + it('testPickerViewPickerViewDate', 0, async function (done) { + console.info('testPickerViewPickerViewDate START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerViewDate); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('pickerViewDate') + expect(obj.$attrs.type).assertEqual('date') + console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + });/** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewPickerViewDatetime + * @tc.desc ACE + */ + it('testPickerViewPickerViewDatetime', 0, async function (done) { + console.info('testPickerViewPickerViewDatetime START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerViewDatetime); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('pickerViewDatetime') + expect(obj.$attrs.type).assertEqual('datetime') + console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + });/** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testPickerViewPickerViewMultiText + * @tc.desc ACE + */ + it('testPickerViewPickerViewMultiText', 0, async function (done) { + console.info('testPickerViewPickerViewMultiText START'); + console.info("[pickerViewProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.pickerViewMultiText); + console.info("[pickerViewProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[pickerViewProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('pickerView') + expect(obj.$attrs.id).assertEqual('pickerViewMultiText') + expect(obj.$attrs.type).assertEqual('multi-text') + console.info("[pickerViewProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); +}); diff --git a/ace/ace_standard/src/main/js/default/test/progressProps.test.js b/ace/ace_standard/src/main/js/default/test/progressProps.test.js new file mode 100644 index 000000000..bba9f4d03 --- /dev/null +++ b/ace/ace_standard/src/main/js/default/test/progressProps.test.js @@ -0,0 +1,801 @@ +/** + * Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import router from '@system.router'; +import {describe, beforeAll,afterAll, it, expect} from 'deccjsunit/index'; + + +describe('progressPropsJsTest', function () { + + async function sleep(time) { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve() + }, time) + }).then(() => { + console.info(`sleep ${time} over...`) + }) + }; + + async function backToIndex() { + let backToIndexPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.back({ + uri: 'pages/index/index' + }); + resolve(); + }, 500); + }); + let clearPromise = new Promise((resolve, reject) => { + setTimeout(() => { + router.clear(); + resolve(); + }, 500); + }); + await backToIndexPromise.then(() => { + return clearPromise; + }); + } + + /** + * run before testcase + */ + beforeAll(async function (done) { + console.info('[progressPropsJsTest] before each called') + + let result; + let options = { + uri: 'pages/progress/prop/index' + } + try { + result = router.push(options) + console.info("push progressProps page success " + JSON.stringify(result)); + } catch (err) { + console.error("push progressProps page error " + JSON.stringify(result)); + } + await sleep(4000) + done() + }); + + /** + * run after testcase + */ + afterAll(async function () { + console.info('[progressPropsJsTest] after each called') + await backToIndex() + await sleep(1000) + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressIdProp + * @tc.desc ACE + */ + it('testProgressIdProp', 0, async function (done) { + console.info('testProgressIdProp START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.idProp); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('idProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressClassProp + * @tc.desc ACE + */ + it('testProgressClassProp', 0, async function (done) { + console.info('testProgressClassProp START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classProp); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('classProp') + expect(obj.$attrs.className).assertEqual('classProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressClassPropNone + * @tc.desc ACE + */ + it('testProgressClassPropNone', 0, async function (done) { + console.info('testProgressClassPropNone START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.classPropNone); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('classPropNone') + expect(obj.$attrs.className).assertEqual(undefined) + console.info("[progressProps] get className value is: " + JSON.stringify(obj.$attrs.className)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressStyleProp + * @tc.desc ACEs + */ + // it('testProgressStyleProp', 0, async function (done) { + // console.info('testProgressStyleProp START'); + // console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.styleProp); + // console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('progress') + // expect(obj.$attrs.id).assertEqual('styleProp') + // expect(obj.$attrs.style).assertEqual(undefined) + // console.info("[progressProps] get style value is: " + JSON.stringify(obj.$attrs.style)); + // + // expect(obj.$styles.width).assertEqual(undefined); + // console.info("[progressProps] get style width value is: " + JSON.stringify(obj.$styles.width)); + // expect(obj.$styles.height).assertEqual(undefined); + // console.info("[progressProps] get style height value is: " + JSON.stringify(obj.$styles.height)); + // expect(obj.$styles.get('background-color')).assertEqual(undefined); + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressRefProp + * @tc.desc ACE + */ + it('testProgressRefProp', 0, async function (done) { + console.info('testProgressRefProp START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refProp); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('refProp') + expect(obj.$attrs.ref).assertEqual('refProp') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressRefPropNone + * @tc.desc ACE + */ + it('testProgressRefPropNone', 0, async function (done) { + console.info('testProgressRefPropNone START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.refPropNone); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('refPropNone') + expect(obj.$attrs.ref).assertEqual(undefined) + console.info("[progressProps] get ref value is: " + JSON.stringify(obj.$attrs.ref)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressDisabledPropTrue + * @tc.desc ACE + */ + it('testProgressDisabledPropTrue', 0, async function (done) { + console.info('testProgressDisabledPropTrue START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropTrue); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('disabledPropTrue') + expect(obj.$attrs.disabled).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressDisabledPropFalse + * @tc.desc ACE + */ + it('testProgressDisabledPropFalse', 0, async function (done) { + console.info('testProgressDisabledPropFalse START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropFalse); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('disabledPropFalse') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressDisabledPropNone + * @tc.desc ACE + */ + it('testProgressDisabledPropNone', 0, async function (done) { + console.info('testProgressDisabledPropNone START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.disabledPropNone); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('disabledPropNone') + expect(obj.$attrs.disabled).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressFocusablePropTrue + * @tc.desc ACE + */ + it('testProgressFocusablePropTrue', 0, async function (done) { + console.info('testProgressFocusablePropTrue START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropTrue); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('focusablePropTrue') + expect(obj.$attrs.focusable).assertEqual('true') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressFocusablePropFalse + * @tc.desc ACE + */ + it('testProgressFocusablePropFalse', 0, async function (done) { + console.info('testProgressFocusablePropFalse START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropFalse); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('focusablePropFalse') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressFocusablePropNone + * @tc.desc ACE + */ + it('testProgressFocusablePropNone', 0, async function (done) { + console.info('testProgressFocusablePropNone START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.focusablePropNone); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('focusablePropNone') + expect(obj.$attrs.focusable).assertEqual('false') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressDataProp + * @tc.desc ACE + */ + it('testProgressDataProp', 0, async function (done) { + console.info('testProgressDataProp START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataProp); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('dataProp') + expect(obj.$attrs.dataprogress).assertEqual(undefined); + console.info("[progressProps] get dataprogress value is: " + JSON.stringify(obj.$attrs.dataprogress)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressDataPropNone + * @tc.desc ACE + */ + it('testProgressDataPropNone', 0, async function (done) { + console.info('testProgressDataPropNone START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dataPropNone); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('dataPropNone') + expect(obj.$attrs.dataprogress).assertEqual(undefined) + console.info("[progressProps] get dataprogress value is: " + JSON.stringify(obj.$attrs.dataprogress)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressClickEffectPropSmall + * @tc.desc ACE + */ + it('testProgressClickEffectPropSmall', 0, async function (done) { + console.info('testProgressClickEffectPropSmall START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropSmall); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('clickEffectPropSmall') + expect(obj.$attrs.clickEffect).assertEqual('spring-small') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressClickEffectPropMedium + * @tc.desc ACE + */ + it('testProgressClickEffectPropMedium', 0, async function (done) { + console.info('testProgressClickEffectPropMedium START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropMedium); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('clickEffectPropMedium') + expect(obj.$attrs.clickEffect).assertEqual('spring-medium') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressClickEffectPropLarge + * @tc.desc ACE + */ + it('testProgressClickEffectPropLarge', 0, async function (done) { + console.info('testProgressClickEffectPropLarge START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropLarge); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('clickEffectPropLarge') + expect(obj.$attrs.clickEffect).assertEqual('spring-large') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressClickEffectPropNone + * @tc.desc ACE + */ + it('testProgressClickEffectPropNone', 0, async function (done) { + console.info('testProgressClickEffectPropNone START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.clickEffectPropNone); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('clickEffectPropNone') + expect(obj.$attrs.clickEffect).assertEqual(undefined) + console.info("[progressProps] get clickEffect value is: " + JSON.stringify(obj.$attrs.clickEffect)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressDirPropRtl + * @tc.desc ACE + */ + it('testProgressDirPropRtl', 0, async function (done) { + console.info('testProgressDirPropRtl START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropRtl); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('dirPropRtl') + expect(obj.$attrs.dir).assertEqual('rtl') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressDirPropLtr + * @tc.desc ACE + */ + it('testProgressDirPropLtr', 0, async function (done) { + console.info('testProgressDirPropLtr START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropLtr); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('dirPropLtr') + expect(obj.$attrs.dir).assertEqual('ltr') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressDirPropAuto + * @tc.desc ACE + */ + it('testProgressDirPropAuto', 0, async function (done) { + console.info('testProgressDirPropAuto START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropAuto); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('dirPropAuto') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressDirPropNone + * @tc.desc ACE + */ + it('testProgressDirPropNone', 0, async function (done) { + console.info('testProgressDirPropNone START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.dirPropNone); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('dirPropNone') + expect(obj.$attrs.dir).assertEqual('auto') + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressForPropNull + * @tc.desc ACE + */ + it('testProgressForPropNull', 0, async function (done) { + console.info('testProgressForPropNull START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropNull); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('forPropNull') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[progressProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressForPropOne + * @tc.desc ACE + */ + it('testProgressForPropOne', 0, async function (done) { + console.info('testProgressForPropOne START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropOne); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('forPropOne') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[progressProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressForPropThree + * @tc.desc ACE + */ + it('testProgressForPropThree', 0, async function (done) { + console.info('testProgressForPropThree START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.forPropThree); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('forPropThree') + expect(obj.$attrs.for).assertEqual(undefined) + console.info("[progressProps] get for value is: " + JSON.stringify(obj.$attrs.for)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressIfPropTrue + * @tc.desc ACE + */ + it('testProgressIfPropTrue', 0, async function (done) { + console.info('testProgressIfPropTrue START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.ifPropTrue); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('ifPropTrue') + expect(obj.$attrs.if).assertEqual(undefined) + console.info("[progressProps] get for value is: " + JSON.stringify(obj.$attrs.if)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressIfPropFalse + * @tc.desc ACE + */ + // it('testProgressIfPropFalse', 0, async function (done) { + // console.info('testProgressIfPropFalse START'); + // console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropFalse); + // console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('progress') + // expect(obj.$attrs.id).assertEqual('ifPropFalse') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressIfPropNone + * @tc.desc ACE + */ + // it('testProgressIfPropNone', 0, async function (done) { + // console.info('testProgressIfPropNone START'); + // console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + // + // let obj = JSON.parse(globalThis.value.ifPropNone); + // console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + // console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + // + // expect(obj.$type).assertEqual('progress') + // expect(obj.$attrs.id).assertEqual('ifPropNone') + // expect(obj.$attrs.if).assertEqual(false) + // done(); + // }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressShowPropTrue + * @tc.desc ACE + */ + it('testProgressShowPropTrue', 0, async function (done) { + console.info('testProgressShowPropTrue START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropTrue); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('showPropTrue') + expect(obj.$attrs.show).assertEqual('true') + console.info("[progressProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressShowPropFalse + * @tc.desc ACE + */ + it('testProgressShowPropFalse', 0, async function (done) { + console.info('testProgressShowPropFalse START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropFalse); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('showPropFalse') + expect(obj.$attrs.show).assertEqual('false') + console.info("[progressProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressShowPropNone + * @tc.desc ACE + */ + it('testProgressShowPropNone', 0, async function (done) { + console.info('testProgressShowPropNone START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.showPropNone); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('showPropNone') + expect(obj.$attrs.show).assertEqual('true') + console.info("[progressProps] get show value is: " + JSON.stringify(obj.$attrs.show)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressTypeHorizontal + * @tc.desc ACE + */ + it('testProgressTypeHorizontal', 0, async function (done) { + console.info('testProgressTypeHorizontal START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeHorizontal); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('typeHorizontal') + expect(obj.$attrs.type).assertEqual('horizontal') + console.info("[progressProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressTypeCircular + * @tc.desc ACE + */ + it('testProgressTypeCircular', 0, async function (done) { + console.info('testProgressTypeCircular START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeCircular); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('typeCircular') + expect(obj.$attrs.type).assertEqual('circular') + console.info("[progressProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressTypeRing + * @tc.desc ACE + */ + it('testProgressTypeRing', 0, async function (done) { + console.info('testProgressTypeRing START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeRing); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('typeRing') + expect(obj.$attrs.type).assertEqual('ring') + console.info("[progressProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressTypeScaleRing + * @tc.desc ACE + */ + it('testProgressTypeScaleRing', 0, async function (done) { + console.info('testProgressTypeScaleRing START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeScaleRing); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('typeScaleRing') + expect(obj.$attrs.type).assertEqual('scale-ring') + console.info("[progressProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressTypeArc + * @tc.desc ACE + */ + it('testProgressTypeArc', 0, async function (done) { + console.info('testProgressTypeArc START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeArc); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('typeArc') + expect(obj.$attrs.type).assertEqual('arc') + console.info("[progressProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); + /** + * @tc.number SUB_ACE_BASIC_COMPONENT_JS_API_0100 + * @tc.name testProgressTypeEclipse + * @tc.desc ACE + */ + it('testProgressTypeEclipse', 0, async function (done) { + console.info('testProgressTypeEclipse START'); + console.info("[progressProps] get globalThis.value is: " + JSON.stringify(globalThis.value)); + + let obj = JSON.parse(globalThis.value.typeEclipse); + console.info("[progressProps] get inspector value is: " + JSON.stringify(obj)); + console.info("[progressProps] get inspector attrs value is: " + JSON.stringify(obj.$attrs)); + + expect(obj.$type).assertEqual('progress') + expect(obj.$attrs.id).assertEqual('typeEclipse') + expect(obj.$attrs.type).assertEqual('eclipse') + console.info("[progressProps] get type value is: " + JSON.stringify(obj.$attrs.type)); + done(); + }); +}); -- GitLab