Strelit UI Kit のレイアウトツリーは、4つのノードタイプ(‘row’、‘column’
、‘stack’、‘component’)で構成されます。
import { LayoutConfig, ComponentItemConfig, StackItemConfig } from 'strelit-ui-kit';
const config: LayoutConfig = {
root: {
type: 'row',
content: [
{
type: 'component',
componentType: 'sourceViewer',
title: 'ソースコード',
size: '60%',
componentState: { filePath: '/src/main.ts' },
} as ComponentItemConfig,
{
type: 'stack',
size: '40%',
activeItemIndex: 0,
content: [
{
type: 'component',
componentType: 'terminal',
title: 'ビルドターミナル',
},
{
type: 'component',
componentType: 'telemetry',
title: 'パフォーマンス',
},
],
} as StackItemConfig,
],
},
};
共通アイテムプロパティ (ItemConfig)
| 引数 | 型 | 省略可能 | デフォルト値 | 説明 |
|---|---|---|---|---|
| type | ‘row’ | ‘column’ | ‘stack’ | ‘component’ | false | - | アイテムの構造タイプ。 |
| id | string | true | ‘’ |
|
| size | string | true | - | 兄弟アイテム間におけるこのアイテムの相対的または固定のサイズ。パーセンテージ(例:
|
| minSize | string | true | - | これ以上小さくリサイズできない最小サイズ(例: |
| isClosable | boolean | true | true | false の場合、タブ/ヘッダーの閉じるボタンが省略され、ユーザーによって閉じることができなくなります。 |
| title | string | true | ‘’ | コンポーネントアイテムのタブヘッダーに表示されるラベル。 |
コンポーネントアイテム (ComponentItemConfig)
| 引数 | 型 | 省略可能 | デフォルト値 | 説明 |
|---|---|---|---|---|
| componentType | ComponentType (string) | false | - |
|
| componentState | SerializableValue | true | undefined | マウント時にコンポーネントコンテナに渡される任意のシリアライズ可能なオブジェクト、文字列、数値、または配列。 |
| reorderEnabled | boolean | true | true | このコンポーネントタブをドラッグして、スタック内またはスタック間で並べ替えできるかどうか。 |
| header | HeaderedItemConfigHeader | true | undefined | ヘッダーコントロール(閉じる、ポップアウト、最小化、最大化)のアイテム単位のカスタムオーバーライド。 |
スタックアイテム (StackItemConfig)
| 引数 | 型 | 省略可能 | デフォルト値 | 説明 |
|---|---|---|---|---|
| content | ComponentItemConfig[] | false | [] | このタブ付きスタック内でホストされるコンポーネントアイテムの配列。注意:スタック内に他のスタックや行/列を含めることはできません。 |
| activeItemIndex | number | true | 0 | 初期状態でアクティブかつ可視となるコンポーネントタブの 0 から始まるインデックス。 |
| maximised | boolean | true | false | このスタックがレイアウトビューポート全体を満たす最大化状態で開始するかどうか。 |
行および列アイテム (RowOrColumnItemConfig)
| 引数 | 型 | 省略可能 | デフォルト値 | 説明 |
|---|---|---|---|---|
| type | ‘row’ | ‘column’ | false | - |
|
| content | ItemConfig[] | false | [] | 子アイテムの配列(行、列、スタック、またはコンポーネントを指定可能)。 |