mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-11-23 07:01:24 +00:00
commit
a4e34c6611
@ -209,7 +209,7 @@ export struct RichEditorBootcamp {
|
||||
return;
|
||||
}
|
||||
let richEditorSelection = this.controller.getSelection();
|
||||
this.PopDataFromPasteboard(richEditorSelection)
|
||||
this.popDataFromPasteboard(richEditorSelection)
|
||||
|
||||
} else if (index as number == 3) {
|
||||
if (!this.controller) {
|
||||
@ -356,7 +356,7 @@ export struct RichEditorBootcamp {
|
||||
})
|
||||
}
|
||||
|
||||
PopDataFromPasteboard(richEditorSeletion: RichEditorSelection) {
|
||||
popDataFromPasteboard(richEditorSeletion: RichEditorSelection) {
|
||||
let start = richEditorSeletion.selection[0];
|
||||
let end = richEditorSeletion.selection[1];
|
||||
|
||||
|
@ -15,11 +15,20 @@
|
||||
|
||||
|
||||
import { Drawer } from 'common/src/main/ets/components/Drawer';
|
||||
import { ColorBlock, RadioBlock, SliderBlock, useEnabled } from 'common';
|
||||
|
||||
@Component
|
||||
export struct CalendarPickerBootcamp {
|
||||
@Require @Prop title: ResourceStr;
|
||||
@State showParameters: boolean = false;
|
||||
@State enableEdgeAlign: boolean = false;
|
||||
@State edgeAlign: CalendarAlign = CalendarAlign.CENTER;
|
||||
@State enableAlignItems: boolean = false;
|
||||
@State alignItems: HorizontalAlign = HorizontalAlign.Center;
|
||||
@State enableTextColor: boolean = false;
|
||||
@State textColor: ResourceColor = 'rgb(255, 0, 0, 0.9)';
|
||||
@State hintRadius: number = 10;
|
||||
@State enableHintRadius: boolean = false;
|
||||
@State duration : number = 2000;
|
||||
private selectedDate: Date = new Date();
|
||||
|
||||
@ -42,21 +51,54 @@ export struct CalendarPickerBootcamp {
|
||||
|
||||
@Builder
|
||||
Content() {
|
||||
Column() {
|
||||
Column({ space: 8 }) {
|
||||
Column() {
|
||||
CalendarPicker({ hintRadius: 10, selected: this.selectedDate })
|
||||
CalendarPicker({ hintRadius: useEnabled(this.enableHintRadius, this.hintRadius), selected: this.selectedDate })
|
||||
.edgeAlign(useEnabled(this.enableEdgeAlign, this.edgeAlign))
|
||||
.onChange((value) => {
|
||||
console.info('CalendarPicker onChange:' + JSON.stringify(value))
|
||||
})
|
||||
}
|
||||
}.width('100%')
|
||||
}.width('100%').height('100%')
|
||||
}
|
||||
|
||||
@Builder
|
||||
Parameters() {
|
||||
Scroll() {
|
||||
Column({ space: 8 }) {
|
||||
}.width('100%')
|
||||
RadioBlock({
|
||||
title: '选择器与入口组件的对齐方式',
|
||||
isEnabled: this.enableAlignItems,
|
||||
value: this.edgeAlign,
|
||||
dataSource: [
|
||||
{ label: 'START', value: CalendarAlign.START },
|
||||
{ label: 'CENTER', value: CalendarAlign.CENTER },
|
||||
{ label: 'END', value: CalendarAlign.END }
|
||||
]
|
||||
})
|
||||
RadioBlock({
|
||||
title: '选择器在容器内的对齐方式',
|
||||
isEnabled: this.enableEdgeAlign,
|
||||
value: this.alignItems,
|
||||
dataSource: [
|
||||
{ label: 'START', value: HorizontalAlign.Start },
|
||||
{ label: 'CENTER', value: HorizontalAlign.Center },
|
||||
{ label: 'END', value: HorizontalAlign.End }
|
||||
]
|
||||
})
|
||||
ColorBlock({
|
||||
title: '字体颜色',
|
||||
isEnabled: this.enableTextColor,
|
||||
color: this.textColor
|
||||
})
|
||||
SliderBlock({
|
||||
title: '日期选中态底板样式',
|
||||
isEnabled: this.enableHintRadius,
|
||||
value: this.hintRadius,
|
||||
min: 0,
|
||||
max: 16
|
||||
})
|
||||
}.width('100%').height('100%')
|
||||
}.height('50%')
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,6 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { Drawer } from 'common/src/main/ets/components/Drawer';
|
||||
import { RadioBlock, SliderBlock, useEnabled } from 'common';
|
||||
|
||||
@ -30,6 +29,8 @@ export struct RatingBootcamp {
|
||||
@State enableStepSize: boolean = false;
|
||||
@State stepSize: number = 0.5;
|
||||
@State enableStarStyle: boolean = false;
|
||||
@State enableDirection: boolean = false;
|
||||
@State compDirection: Direction = Direction.Auto;
|
||||
|
||||
build() {
|
||||
NavDestination() {
|
||||
@ -44,6 +45,7 @@ export struct RatingBootcamp {
|
||||
}
|
||||
})
|
||||
}
|
||||
.backgroundColor($r('sys.color.ohos_id_color_sub_background'))
|
||||
.hideTitleBar(true)
|
||||
}
|
||||
|
||||
@ -59,6 +61,7 @@ export struct RatingBootcamp {
|
||||
.onChange((value: number) => {
|
||||
this.rating = value;
|
||||
})
|
||||
.direction(useEnabled(this.enableDirection, this.compDirection))
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,6 +87,17 @@ export struct RatingBootcamp {
|
||||
]
|
||||
})
|
||||
|
||||
RadioBlock({
|
||||
title: '评分组件布局方式',
|
||||
isEnabled: this.enableDirection,
|
||||
value: this.compDirection,
|
||||
dataSource: [
|
||||
{ label: '跟随系统默认布局', value: Direction.Auto },
|
||||
{ label: '从右到左', value: Direction.Rtl },
|
||||
{ label: '从左到右', value: Direction.Ltr }
|
||||
]
|
||||
})
|
||||
|
||||
SliderBlock({
|
||||
title: '评分总数',
|
||||
isEnabled: this.enableStars,
|
||||
|
Loading…
Reference in New Issue
Block a user