File

src/ui/mdi/smart-mdi.component.ts

Description

A Component used for MDI-style navigation of SCL apps.

Implements

AfterViewInit OnInit OnDestroy

Metadata

Index

Properties
Methods
Inputs
Outputs
Accessors

Constructor

constructor(router: Router, location: Location, serviceAdapter: SmartServiceAdapter, registry: SmartMdiRegistryService, smartConfig: SmartConfig, viewManager: SmartViewManagerService, locationStrategy: LocationStrategy, changeDetector: ChangeDetectorRef, windowTitle: SmartWindowTitleService, logger: SmartLoggerService)
Parameters :
Name Type Optional
router Router No
location Location No
serviceAdapter SmartServiceAdapter No
registry SmartMdiRegistryService No
smartConfig SmartConfig No
viewManager SmartViewManagerService No
locationStrategy LocationStrategy No
changeDetector ChangeDetectorRef No
windowTitle SmartWindowTitleService No
logger SmartLoggerService No

Inputs

disableKeyboardControls
Type : boolean

If set to false, will disable keyboard controls for the MDI interface.

Outputs

tabClosed
Type : EventEmitter<SmartTab>

Fires when a SmartTab is closed.

tabOpened
Type : EventEmitter<SmartTab>

Fires when a SmartTab is opened.

Methods

closeAll
closeAll()

Closes all opened tabs

Returns : void
closeTab
closeTab(tab: SmartTab)

Closes and discards the given SmartTab.

Parameters :
Name Type Optional
tab SmartTab No
Returns : void
showForm
showForm(formName: string, paramMap: any, sameTab: unknown, routeParams: any)

Shows the given form, using the given parameter map. If a tab is already showing the given form, that tab will be selected instead of a new one being opened.

Parameters :
Name Type Optional Default value
formName string No
paramMap any No {}
sameTab unknown No false
routeParams any No {}
Returns : void
switchTab
switchTab(tab: SmartTab)

Switches to the given SmartTab.

Parameters :
Name Type Optional
tab SmartTab No
Returns : void
tabSelected
tabSelected(event: SelectEvent)

Called by the TabStripComponent when a tab is selected.

Parameters :
Name Type Optional
event SelectEvent No
Returns : void

Properties

currentTab
Type : SmartTab

The currently selected SmartTab.

tabStrip
Type : TabStripComponent
Decorators :
@ViewChild(TabStripComponent)

The underlying TabStripComponent.

Accessors

authenticated
getauthenticated()

Returns the authenticated state.

Returns : boolean
setauthenticated(value: boolean)

Sets the authenticated state.

Parameters :
Name Type Optional Description
value boolean No
  • The authenticated state.
Returns : void
activeTabs
getactiveTabs()

Returns the currently opened tabs.

Returns : SmartTab[]
setactiveTabs(value: SmartTab[])

Sets the currently opened tabs.

Parameters :
Name Type Optional Description
value SmartTab[] No
  • The active tabs array.
Returns : void
breadcrumbNavigation
getbreadcrumbNavigation()

Returns whether tabs should display a breadcrumb trail.

Returns : boolean
setbreadcrumbNavigation(value: boolean)

Sets whether tabs should display a breadcrumb trail.

Parameters :
Name Type Optional Description
value boolean No
  • The breadcrumb navigation state.
Returns : void
mdiInterface
getmdiInterface()

Returns the MDI interface state.

Returns : boolean
setmdiInterface(value: boolean)

Sets the MDI interface state.

Parameters :
Name Type Optional Description
value boolean No
  • The MDI interface state.
Returns : void
<!--
**************************************************************************
* Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") -                  *
* www.consultingwerk.com and other contributors as listed                *
* below. All Rights Reserved.                                            *
*                                                                        *
*  Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY        *
*   KIND, either express or implied.                                     *
*                                                                        *
*  Contributors:                                                         *
*                                                                        *
**************************************************************************

--------------------------------------------------------------------------
    File        : smart-mdi.component.html
    Purpose     : Template for Smart Mdi.
    Author(s)   : Radu Nicoara
    Created     : Dec 07, 2017
--------------------------------------------------------------------------
-->
@if (_authenticatedSignal() && _activeTabsSignal().length > 0) {
<kendo-tabstrip [keepTabContent]="true" (tabSelect)="tabSelected($event)">
    @for (tab of _activeTabsSignal(); track tab) {
    <kendo-tabstrip-tab [selected]="tab.selected">
        <ng-template kendoTabTitle>
            @if (tab.canGoBack && !!tab.title) {
            <span [ngClass]="{ disabled: tab.inUpdateMode}" (click)="tab.navigateBack()">&larr;&nbsp;&nbsp;</span>
            }
            <span>{{tab.title}}</span>
            <span (click)="closeTab(tab)">&nbsp;&nbsp;&times;</span>
        </ng-template>
        <ng-template kendoTabContent>
            <smart-tab [tab]="tab" [breadcrumbNavigation]="_breadcrumbNavigationSignal()"></smart-tab>
        </ng-template>
    </kendo-tabstrip-tab>
    }
</kendo-tabstrip>
}
@if (_mdiInterfaceSignal()) {
<router-outlet name="smart-mdi-tab"></router-outlet>
}

./smart-mdi.component.css

/**********************************************************************
 * Copyright © 2006-2026 by Consultingwerk Ltd. ("CW") -              *
 * www.consultingwerk.com and other contributors as listed            *
 * below. All Rights Reserved.                                        *
 *                                                                    *
 *  Software is distributed on an "AS IS", WITHOUT WARRANTY OF ANY    *
 *   KIND, either express or implied.                                 *
 *                                                                    *
 *  Contributors:                                                     *
 *                                                                    *
 **********************************************************************/
/*------------------------------------------------------------------------
    File        : smart-mdi.component.css
    Purpose     : Styles for Smart Mdi.
    Author(s)   : Radu Nicoara
    Created     : Dec 07, 2017
  ----------------------------------------------------------------------*/

.smart-tab-header {
    cursor: pointer !important
}

 ::ng-deep span.disabled {
    color: lightgray !important;
    cursor: default !important;
}

 ::ng-deep .k-tabstrip>.k-content {
    border-color: rgba(0, 0, 0, .08) !important;
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""