SectionおよびSectionColumnコンポーネントは、フォームフィールドやコンテンツを整理するためのレスポンシブな多列レイアウトを提供します。列は水平に配置され、利用可能な幅が制限されると自動的に次の行に巻き付きます。
<Section>
<SectionColumn headerText="連絡先情報">
<TextEdit columnName="firstname" />
<TextEdit columnName="lastname" />
</SectionColumn>
<SectionColumn headerText="アカウント情報">
<TextEdit columnName="name" />
</SectionColumn>
</Section><Section>
<SectionColumn HeaderText="連絡先情報">
<TextEdit ColumnName="firstname" />
<TextEdit ColumnName="lastname" />
</SectionColumn>
<SectionColumn HeaderText="アカウント情報">
<TextEdit ColumnName="name" />
</SectionColumn>
</Section>Sectionの中に1つ以上のSectionColumn部品を配置します。列は利用可能な幅に均等に分布しています。ColumnCountを使って列数(1〜4)を明示的に設定します。省略すると、SectionColumn子の数がデフォルトになります。
{/* 明示的3列レイアウト */}
<Section columnCount={3}>
<SectionColumn>第1列</SectionColumn>
<SectionColumn>第2列</SectionColumn>
<SectionColumn>第3列</SectionColumn>
</Section><!-- 明示的3列レイアウト -->
<Section ColumnCount="3">
<SectionColumn>第1列</SectionColumn>
<SectionColumn>第2列</SectionColumn>
<SectionColumn>第3列</SectionColumn>
</Section>SectionのColumnMinWidthを設定して、列が次の行に巻き替わるタイミングを制御します。1列あたりの利用可能な幅がこの閾値を下回ると、列は縦に積み重なります。デフォルトは340pxです。
<Section columnMinWidth="200px">
<SectionColumn>狭い列1</SectionColumn>
<SectionColumn>狭い列2</SectionColumn>
<SectionColumn>狭い柱3</SectionColumn>
<SectionColumn>狭い柱4</SectionColumn>
</Section><Section ColumnMinWidth="200px">
<SectionColumn>狭い列1</SectionColumn>
<SectionColumn>狭い列2</SectionColumn>
<SectionColumn>狭い柱3</SectionColumn>
<SectionColumn>狭い柱4</SectionColumn>
</Section>SectionColumnに付けてWidthを使い、列のシェアを大きくしたり小さくしたりします。幅はCSSパーセンテージではなく比率です。3列に3列、Width="3"、Width="4"、Width="3"30%(3 + 4 + 3 = 10)で配置されます。Widthのない列はデフォルトの等分分布に戻されます。
{/* 幅は比率で、3 + 4 + 3 = 10パーツ、つまり30% / 40% / 30% */}
<Section>
<SectionColumn width={3}>第1列(30%)</SectionColumn>
<SectionColumn width={4}>列2(40%)</SectionColumn>
<SectionColumn width={3}>第3列(30%)</SectionColumn>
</Section><!-- 幅は比率で、3 + 4 + 3 = 10パーツ、つまり30% / 40% / 30% -->
<Section>
<SectionColumn Width="3">第1列(30%)</SectionColumn>
<SectionColumn Width="4">列2(40%)</SectionColumn>
<SectionColumn Width="3">第3列(30%)</SectionColumn>
</Section>SectionもSectionColumnもHeaderText/HeaderおよびFooterText/Footerパラメータをサポートしています。簡単なテキスト見出しにはHeaderTextを、カスタムの断片をレンダリングするにはHeaderを使いましょう。
<Section headerText="アカウント詳細" footerText="最終更新日:今日">
<SectionColumn headerText="一般">
<TextEdit columnName="name" />
</SectionColumn>
<SectionColumn headerText="住所">
<TextEdit columnName="address1_city" />
</SectionColumn>
</Section><Section HeaderText="アカウント詳細" FooterText="最終更新日:今日">
<SectionColumn HeaderText="一般">
<TextEdit ColumnName="name" />
</SectionColumn>
<SectionColumn HeaderText="住所">
<TextEdit ColumnName="address1_city" />
</SectionColumn>
</Section>SectionやSectionColumnにBorderVisible="true"を設定して、その周囲に枠を表示させてください。境界線は断面と各列で独立して設定できます。
<Section borderVisible>
<SectionColumn borderVisible>縁取りされた柱</SectionColumn>
<SectionColumn borderVisible={false}>この柱には境界線はありません</SectionColumn>
</Section><Section BorderVisible="true">
<SectionColumn BorderVisible="true">
縁取りされた柱
</SectionColumn>
<SectionColumn BorderVisible="false">
この柱には境界線はありません
</SectionColumn>
</Section>デフォルトでは、 SectionColumn 内のエディタコンポーネントは縦に積み重ねられています。 ColumnContentOrientation="ComponentOrientation.Horizontal" を水平に配置するように設定してください。 HorizontalGap と VerticalGap を使ってアイテム間の間隔をコントロールしましょう。
import { SectionColumnOrientation } from '@powerportalspro/react-fluent';
<Section>
<SectionColumn
columnContentOrientation={SectionColumnOrientation.Horizontal}
horizontalGap={20}
verticalGap={10}
>
<TextEdit columnName="firstname" />
<TextEdit columnName="lastname" />
</SectionColumn>
</Section><Section>
<SectionColumn ColumnContentOrientation="ComponentOrientation.Horizontal"
HorizontalGap="20"
VerticalGap="10">
<TextEdit ColumnName="firstname" />
<TextEdit ColumnName="lastname" />
</SectionColumn>
</Section>4列のリアクションでラップする Section 。
以下の Width 値を調整して、各列の行割合を変更します。幅は比率であり、列のレンダリングパーセンテージはその値を3つの合計で割ったものです。
以下のコントロールを使って、 Section と SectionColumnの両方の境界線、ヘッダー、フッターを探索できます。
名称 | 種類 | デフォルト | 概要 |
|---|---|---|---|
BorderVisible | bool | False | |
ChildContent | RenderFragment? | ||
ChildContentStyle | string? | ||
ColumnCount | int? | ||
ColumnMinWidth | string? | 340px | |
Footer | RenderFragment? | ||
FooterStyle | string? | ||
FooterText | string? | ||
Header | RenderFragment? | ||
HeaderStyle | string? | ||
HeaderText | string? |
BorderVisibleChildContentChildContentStyleColumnCountColumnMinWidthFooterFooterStyleFooterTextHeaderHeaderStyleHeaderText名称 | 種類 | デフォルト | 概要 |
|---|---|---|---|
BorderVisible | bool | True | |
ChildContent | RenderFragment? | ||
ColumnContentOrientation | ComponentOrientation | Vertical | |
Footer | RenderFragment? | ||
FooterText | string? | ||
Header | RenderFragment? | ||
HeaderText | string? | ||
HorizontalGap | int? | 10 | |
VerticalGap | int? | 10 | |
Width | double? |
BorderVisibleChildContentColumnContentOrientationFooterFooterTextHeaderHeaderTextHorizontalGapVerticalGapWidth