import {LayoutSection, LayoutProperty, LayoutSectionKeyEnum} from "./LayoutSection"; import {Layout} from "./Layout"; import {CommonProperty, TextProperty, BoxProperty} from "../properties/define"; export class TextItemLayout extends Layout { constructor() { super(); this.sections.push(TextItemLayout.text()); this.sections.push(TextItemLayout.preference()); this.sections.push(TextItemLayout.layout()); } private static preference(): LayoutSection { const section = new LayoutSection(LayoutSection.LAYOUT_SECTION[LayoutSectionKeyEnum.PREFERENCE]); section.properties.push( new LayoutProperty(BoxProperty.border), new LayoutProperty(CommonProperty.backColor), new LayoutProperty(TextProperty.textColor) ); return section; } private static layout(): LayoutSection { const section = new LayoutSection(LayoutSection.LAYOUT_SECTION[LayoutSectionKeyEnum.LAYOUT]); section.properties.push( new LayoutProperty(CommonProperty.position), new LayoutProperty(CommonProperty.size), new LayoutProperty(BoxProperty.padding) // new LayoutProperty(CommonProperty.x), // new LayoutProperty(CommonProperty.y), // new LayoutProperty(CommonProperty.width), // new LayoutProperty(CommonProperty.height), // new LayoutProperty(BoxProperty.topPadding), // new LayoutProperty(BoxProperty.leftPadding), // new LayoutProperty(BoxProperty.bottomPadding), // new LayoutProperty(BoxProperty.rightPadding) // 'foreColor' ); return section; } private static text(): LayoutSection { const section = new LayoutSection(LayoutSection.LAYOUT_SECTION[LayoutSectionKeyEnum.TEXT]); section.properties.push( new LayoutProperty(TextProperty.text), new LayoutProperty(TextProperty.font), new LayoutProperty(TextProperty.align) // new LayoutProperty(TextProperty.hAlign), // new LayoutProperty(TextProperty.vAlign) ); return section; } }