TComponents. MultiView

new MultiView(parent, props)

MultiView component that extends the Tab component, allowing for multiple views within a tabbed interface. This class focuses on the specific properties of the MultiView component. Since it inherits from Accessor_A, all basic properties (e.g., height, width) are available but documented in the Accessor_A part.

Parameters:
NameTypeDescription
parentHTMLElement

The parent HTML element to which the component will be attached.

propsTComponents.TabProps

Properties to initialize the component.

Example
const multiview = new TComponents.Tab(document.body, {
  position: 'absolute',
  width: 200,
  height: 200,
  zIndex: 1000,
  views: [
    {
      name: 'Multiview 1',
      icon: '',
      content: `view_${API.generateUUID()}`,
      children: [],
    },
   {
      name: 'Multiview 2',
      icon: '',
      content: `view_${API.generateUUID()}`,
      children: [],
    },
  ],
  activeViewIndex: 0,
});

// Render the component.
await multiview.render();

Extends

Methods

(protected) defaultProps() → {TComponents.TabProps}

Returns the default properties of the tab component.

Returns:

Default properties.

Type: 
TComponents.TabProps

markup() → {string}

Generates the markup for the MultiView component.

Returns:

The HTML markup string.

Type: 
string

onRender() → {void}

Renders the MultiView component, setting up necessary event listeners and styles.

Throws:

Throws an error if rendering fails.

Type
Error
Returns:
Type: 
void

(static) loadCssClassFromString(css) → {void}

Add css properties to the component

Parameters:
NameTypeDescription
cssstring

The css string to be loaded into style tag

Returns:
Type: 
void
Example
TComponents.MultiView.loadCssClassFromString(`
  .tc-multiview {
    position: absolute;
    height: 100%;
  }`
);