src/ui/smart-tab-folder/smart-tab-folder.component.ts
OnInit
OnChanges
OnDestroy
AfterViewInit
| changeDetection | ChangeDetectionStrategy.OnPush |
| providers |
SmartTabFolderCountService
|
| selector | smart-tab-folder |
| styleUrls | ./smart-tab-folder.component.css, |
| templateUrl | ./smart-tab-folder.component.html |
Properties |
Methods |
Inputs |
Accessors |
constructor(http: SmartHttpService, serviceAdapter: SmartServiceAdapter, tabfolderService: SmartTabFolderRegistryService, injector: Injector, renderer: Renderer2, elementRef: ElementRef)
|
|||||||||||||||||||||
|
Parameters :
|
| smart-help-url |
Type : string
|
|
Sets the help URL on the host element and toggles the CSS class. |
| smart-tab-display-style |
Type : string
|
| smart-tab-folder-pages |
Type : any
|
| tab-strip-scrollable |
Type : boolean
|
| ignoreFlexboxLayout |
Type : boolean
|
| smart-help-text |
Type : string | undefined
|
|
Sets the HelpText value for this form child. |
| smart-instance-name |
Type : string
|
|
The instance name of the component |
| smart-object-name |
Type : string
|
|
The object name of the component |
| _onTabSelect | ||||||
_onTabSelect(event: SelectEvent)
|
||||||
|
Parameters :
Returns :
void
|
| computeTabPagePadding | |||||||||
computeTabPagePadding(padding: number, element: HTMLElement)
|
|||||||||
|
Parameters :
Returns :
any
|
| disablePage | ||||||||
disablePage(tab: number | string)
|
||||||||
|
Disables a tab page.
Parameters :
Returns :
void
|
| enablePage | ||||||||
enablePage(tab: number | string)
|
||||||||
|
Enables a tab page.
Parameters :
Returns :
void
|
| Public handleLayoutChange | ||||||
handleLayoutChange(newLayout: any)
|
||||||
|
Parameters :
Returns :
void
|
| hasPage | ||||||||
hasPage(tab: number | string)
|
||||||||
|
Indicates whether a tab page with the given key, sequence, or index exists.
Parameters :
Returns :
boolean
True when the page exists. |
| isPageEnabled | ||||||||
isPageEnabled(tab: number | string)
|
||||||||
|
Indicates whether the given tab page exists and is currently enabled.
Parameters :
Returns :
boolean
True when the page exists and is not disabled. |
| isPageRendered | ||||||||
isPageRendered(pageIndex: number)
|
||||||||
|
Checks if a tab page has been rendered (visited at least once).
Parameters :
Returns :
boolean
True if the page has been rendered |
| markPageAsRendered | ||||||||
markPageAsRendered(pageIndex: number)
|
||||||||
|
Marks a tab page as rendered (visited) for lazy rendering optimization.
Parameters :
Returns :
void
|
| selectPage | ||||||
selectPage(tab: number | string)
|
||||||
|
Parameters :
Returns :
void
|
| trySelectPage | ||||||||
trySelectPage(tab: number | string)
|
||||||||
|
Selects the given tab page only when it exists and is enabled.
Parameters :
Returns :
boolean
True when the page was selected. |
| Public notifyLoadingFinished | ||||||
notifyLoadingFinished(objectName: string)
|
||||||
|
Notifies the parent Smart Form that this form child has finished loading
Parameters :
Returns :
void
void |
| _activePage |
Type : TabFolderPageSettings
|
| _activeTab |
| Deprecated in favor of _activePage |
Type : number
|
Default value : 0
|
| _pages |
Type : TabFolderPageSettings[]
|
| activeTabPageSignal |
Type : WritableSignal<TabFolderPageSettings | undefined>
|
Default value : signal<TabFolderPageSettings | undefined>(undefined)
|
|
Signal that holds the currently active tab page settings. |
| contentPages |
Type : QueryList<SmartTabFolderTab>
|
Decorators :
@ContentChildren(SmartTabFolderTab)
|
| Public Readonly countService |
Type : unknown
|
Default value : inject(SmartTabFolderCountService)
|
| disabledPages |
Type : WritableSignal<number[]>
|
Default value : signal<number[]>([])
|
|
Tracks which pages are disabled. Uses a signal for reactive change detection with OnPush. |
| height |
Type : number
|
| notifiedLoading |
Type : unknown
|
Default value : false
|
| onPageChanged |
Type : EventEmitter<SmartTabInfo>
|
Default value : new EventEmitter()
|
| onTabChanged |
| Deprecated in favor of onPageChanged |
Type : EventEmitter<number>
|
Default value : new EventEmitter()
|
| Optional processedLayout |
Type : TabFolderPageSettings[]
|
| smartTabFolderPages |
Type : QueryList<ElementRef>
|
Decorators :
@ViewChildren(SmartTabFolderPageComponent, {read: ElementRef})
|
| tabStripElement |
Type : ElementRef
|
Decorators :
@ViewChild(TabStripComponent, {read: ElementRef})
|
| Public injector |
Type : Injector
|
| tabDisplayStyle | ||||||
gettabDisplayStyle()
|
||||||
|
Returns :
string
|
||||||
settabDisplayStyle(value: string)
|
||||||
|
Parameters :
Returns :
void
|
| helpUrl | ||||||
gethelpUrl()
|
||||||
|
Gets the help URL.
Returns :
string
|
||||||
sethelpUrl(value: string)
|
||||||
|
Sets the help URL on the host element and toggles the CSS class.
Parameters :
Returns :
void
|
| tabstrip | ||||||
gettabstrip()
|
||||||
|
Returns :
ElementRef
|
||||||
settabstrip(kendoTabStrip: ElementRef)
|
||||||
|
Parameters :
Returns :
void
|
| tabStripComponent | ||||||
gettabStripComponent()
|
||||||
|
Returns :
TabStripComponent
|
||||||
settabStripComponent(value: TabStripComponent)
|
||||||
|
Parameters :
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-tab-folder.component.html
Purpose : Template for Smart Tab Folder.
Author(s) : Radu Nicoara
Created : Feb 19, 2018
--------------------------------------------------------------------------
-->
<!-- Reusable skeleton template for tab pages -->
<ng-template #tabPageSkeletonTemplate>
<div
class="smart-tab-page-skeleton"
style="flex: 0 0 auto; align-self: flex-start"
>
<div class="skeleton-toolbar">
<kendo-skeleton
shape="rectangle"
[width]="'100%'"
[height]="'40px'"
animation="wave"
></kendo-skeleton>
</div>
<div class="skeleton-content-area">
<div class="skeleton-form-fields">
<kendo-skeleton
shape="text"
[width]="'30%'"
animation="wave"
></kendo-skeleton>
<kendo-skeleton
shape="rectangle"
[width]="'100%'"
[height]="'32px'"
animation="wave"
></kendo-skeleton>
<kendo-skeleton
shape="text"
[width]="'25%'"
animation="wave"
></kendo-skeleton>
<kendo-skeleton
shape="rectangle"
[width]="'100%'"
[height]="'32px'"
animation="wave"
></kendo-skeleton>
</div>
<div class="skeleton-grid">
<kendo-skeleton
shape="rectangle"
[width]="'100%'"
[height]="'100px'"
animation="wave"
></kendo-skeleton>
</div>
</div>
</div>
</ng-template>
<kendo-tabstrip
#tabstrip
(tabSelect)="_onTabSelect($event)"
[keepTabContent]="true"
[scrollable]="
tabStripScrollable === false
? false
: { enabled: true, mouseScroll: true }
"
>
@for (tab of (processedLayout || pages); track tab.sequence) {
<kendo-tabstrip-tab
[selected]="tab.selected"
[disabled]="
disabledPages().includes($index) ||
tab.disabled ||
tab.enabled === false
"
>
<ng-template kendoTabTitle>
<div class="tab-title d-flex flex-row gap-2">
@if (tabDisplayStyle.toLowerCase() === 'imagelabel' ||
tabDisplayStyle.toLowerCase() === 'image') { @if (!!tab.icon) {
<span>
@if (!tab.fontIcon) {
<img [src]="tab.icon" />
} @else {
<i [class]="tab.fontIcon"></i>
}
</span>
} } @if (tabDisplayStyle.toLowerCase() === 'imagelabel' ||
tabDisplayStyle.toLowerCase() === 'label') {
<span>
{{ tab.label }}
@if
($safeNavigationMigration(countService?.countsByPageId()?.[(tab.key
|| tab.sequence)]) !== undefined) { ({{
countService.countsByPageId()[tab.key || tab.sequence]
}}) }
</span>
}
</div>
</ng-template>
<ng-template kendoTabContent>
<!-- Lazy rendering: only render tab content when the page has been visited -->
@if (renderedPages().has($index)) { @defer { @if (!tab.tabContent) {
<SmartTabFolderPage
[layout]="tab"
[selected]="tab.selected"
[key]="tab.key"
[sequence]="tab.sequence"
></SmartTabFolderPage>
} @else {
<SmartTabFolderPage
[tabContent]="tab.tabContent"
[selected]="tab.selected"
[key]="tab.key"
[sequence]="tab.sequence"
></SmartTabFolderPage>
} } @loading (minimum 150ms) {
<ng-container
*ngTemplateOutlet="tabPageSkeletonTemplate"
></ng-container>
} @placeholder {
<ng-container
*ngTemplateOutlet="tabPageSkeletonTemplate"
></ng-container>
} } @else {
<ng-container
*ngTemplateOutlet="tabPageSkeletonTemplate"
></ng-container>
}
</ng-template>
</kendo-tabstrip-tab>
}
</kendo-tabstrip>
./smart-tab-folder.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-tab-folder.component.css
Purpose : Styles for Smart Tab Folder.
Author(s) : Mike Fechner
Created : Dec 12, 2016
----------------------------------------------------------------------*/
::ng-deep .smart-form-row {
margin-inline: 0;
}
::ng-deep .row.tab-title {
margin-inline: 0px !important;
}
::ng-deep .tab-icon {
width: 16px;
height: 16px;
object-fit: contain;
}
::ng-deep ul.k-tabstrip-items {
z-index: 999 !important;
}
::ng-deep .k-tabstrip-items .k-item {
border-radius: 0.25rem 0.25rem 0 0;
}
::ng-deep .k-tabstrip-items .k-item.k-active {
border-bottom: none;
}
::ng-deep .k-tabstrip-top .k-content.k-state-active {
border-top-width: 0px !important;
border-top-color: transparent !important;
}
::ng-deep .k-tabstrip > .k-content:focus {
outline-width: 0px !important;
}
::ng-deep FormColumn + FormColumn {
margin-left: 0px !important;
}
/* Kendo Skeleton placeholder for lazy-loaded tab pages */
.smart-tab-page-skeleton {
display: block; /* Use block instead of flex to prevent child stretching */
padding: 1rem;
width: 100%;
height: auto; /* Let content determine height */
overflow: hidden; /* Prevent any overflow issues */
}
.smart-tab-page-skeleton .skeleton-toolbar {
margin-bottom: 1rem;
}
.smart-tab-page-skeleton .skeleton-content-area {
display: block; /* Use block to prevent flex stretching */
}
.smart-tab-page-skeleton .skeleton-form-fields {
display: flex;
flex-direction: column;
gap: 0.5rem;
margin-bottom: 1rem;
}
.smart-tab-page-skeleton .skeleton-grid {
/* Height is set inline on kendo-skeleton */
}
/* Ensure Kendo Skeleton components don't stretch beyond their set dimensions */
.smart-tab-page-skeleton kendo-skeleton {
flex-shrink: 0;
flex-grow: 0;
}
../mdi/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;
}