📖ドキュメント一覧▼

コンテンツアイテム階層 (Content Item Hierarchy)

Strelit レイアウト内のすべての視覚要素は ContentItem を継承しています。アイテム階層は厳格なツリー構造を形成します:

  • RowOrColumn: 子要素を水平方向(row)または垂直方向( column)に配置します。

  • Stack: タブ付きのコンポーネントパネル(stack)をホストします。

  • ComponentItem: 個別の ComponentContainer をホストするリーフノードです。

階層概要 (Hierarchy Overview)

EventEmitter
 └── ContentItem (abstract)
      ├── ComponentParentableItem (abstract)
      │    └── Stack
      ├── ComponentItem
      └── RowOrColumn

プロパティ (Properties)

type

アイテムのタイプ: 'row' | 'column' | 'stack' | 'component' | 'ground'。

contentItems

直接の子 ContentItem インスタンスの配列。

parent

親 ContentItem ノード(ルートアイテムの場合は null)。

id

このアイテムに割り当てられた一意の文字列識別子。

isInitialised

アイテムが初期化され DOM にバインドされた後に true。

isRow / isColumn / isStack / isComponent

真偽値によるタイプ判別フラグ。

layoutManager

所有する LayoutManager / StrelitLayout インスタンスへの参照。

element

このアイテムノードのネイティブ HTMLElement DOM ラッパー。

isClosable

このアイテムをユーザーが閉じることができるかどうか。

静的型ガード (Static Type Guards)

Strelit UI Kit は、実行時にアイテムの型を安全に判別するための静的 TypeScript 型ガードを提供します:

import { ContentItem } from 'strelit-ui-kit';

if (ContentItem.isComponentItem(item)) {
  // item は ComponentItem
  console.log(item.componentType, item.container);
} else if (ContentItem.isStack(item)) {
  // item は Stack
  const activeComp = item.getActiveComponentItem();
}

ツリー操作 (Tree Manipulation)

addChild( contentItem, index?, suspendResize? )

指定されたインデックス位置に子 ContentItem をこのアイテムノードに追加します。

removeChild( contentItem, keepChild? )

子アイテムを削除します。keepChild が false(デフォルト)の場合、子アイテムは破棄されます。

replaceChild( oldChild, newChild, destroyOldChild? )

既存の子ノードを新しいコンテンツアイテムでインプレース置換します。

remove()

親からこのアイテムを削除して破棄します。

popout()

このアイテムを分離して、新しい BrowserPopout ウィンドウにポップアウトします。

クエリヘルパー (Query Helpers)

getItemsById( id )

指定された文字列 ID に一致するすべてのコンテンツアイテムをサブツリーから再帰的に検索します。

getItemsByType( type )

指定された ItemType(例:'stack'、'component')に一致するすべてのアイテムを再帰的に返します。

getComponentItemsByType( componentType )

指定されたコンポーネントタイプ名で登録されているすべての ComponentItem リーフを再帰的に検索します。

スタック API (Stack API)

ContentItem.isStack(item) が true のアイテム向け API:

getActiveComponentItem()

スタック内で現在選択/アクティブな ComponentItem タブを返します。

setActiveComponentItem( item, focus, suppressFocusEvent? )

アクティブなタブを指定されたコンポーネントアイテムに切り替え、必要に応じてフォーカスを設定します。

maximise() / minimise() / toggleMaximise()

このスタックのビューポート全体への最大化を切り替えます。

スタックのタブおよびアクションボタンを管理する Header コントロールインスタンスにアクセスします。

マルチ画面トレーディング端末やエンタープライズ分析ダッシュボードの構築、レガシーレイアウトからの移行など、チームとコミュニティがサポートします。

GitHub で Issue を作成 →