File

src/smart-developer-tools/smart-developer-tools.form.ts

Extends

SmartFormComponent

Implements

OnInit OnDestroy AfterViewInit

Metadata

Index

Properties
Methods
Inputs
Outputs
HostBindings

Constructor

constructor(injector: Injector, elementRef: ElementRef, tabRegistry: SmartTabFolderRegistryService, developerToolsService: SmartDeveloperToolsService)
Parameters :
Name Type Optional
injector Injector No
elementRef ElementRef No
tabRegistry SmartTabFolderRegistryService No
developerToolsService SmartDeveloperToolsService No

Inputs

component-type
Type : any

Sets the component type.

formTitle
Type : string
smart-form-layout
Type : any

Sets the form layout.

smart-help-text
Type : string

Sets the HelpText value for the Smart Form.

smart-help-url
Type : string
viewReference
Type : ViewRef

Sets the view reference.

Outputs

componentRefChange
Type : EventEmitter<ComponentRef<any>>
initError
Type : EventEmitter<any>
onDataSourceAdded
Type : EventEmitter<AbstractSmartDataSource>
onDirtyStateChanged
Type : EventEmitter<boolean>
onFormClosed
Type : EventEmitter<SmartFormClosedEventArgs<SmartFormComponent>>
onFormClosing
Type : EventEmitter<SmartFormClosingEventArgs<SmartFormComponent>>
onModalFormClosed
Type : EventEmitter<SmartModalFormClosedEventArgs<SmartFormComponent>>
onReady
Type : EventEmitter<FormReadyEvent>
rootViewLoaded$
Type : ReplaySubject<void>
viewLoaded
Type : EventEmitter<ViewRef>
dataSourcesContainerLoaded$
Type : ReplaySubject<void>

HostBindings

attr.kendoRippleContainer
Type : RippleContainerDirective

Methods

componentLoaded
componentLoaded(instanceName: string, componentInstance: AbstractFormChild)
Parameters :
Name Type Optional
instanceName string No
componentInstance AbstractFormChild No
Returns : void
setFormFullSize
setFormFullSize()
Returns : void
Public addFormChild
addFormChild(item: unknown)
Parameters :
Name Type Optional
item unknown No
Returns : void
callFormAction
Use callLogicMethod instead
callFormAction(actionName: string, ...actionArgs: any[])

Calls the given form action

Parameters :
Name Type Optional Description
actionName string No

The name of the action to call

actionArgs any[] No

The arguments to pass to the action

Returns : any
Public callLogicClassMethod
Use callLogicMethod instead
callLogicClassMethod(methodName: string, args: any[])

Invokes a specified method on the first available logic class instance that has the method defined.

Parameters :
Name Type Optional Description
methodName string No
  • The name of the method to call.
args any[] No
  • An array of arguments to pass to the method.
Returns : any
Public callLogicMethod
callLogicMethod(methodName: string, ...args: any[])

Calls a method on the logic class instances

Parameters :
Name Type Optional Description
methodName string No
  • The method name to call
args any[] No
  • Arguments to pass to the method
Returns : Promise | any

The result of the method call

Public checkIfAllChildrenLoaded
checkIfAllChildrenLoaded()
Returns : boolean

boolean

Public clearLayoutFragment
clearLayoutFragment(slotId: string)

Clears the dynamic layout fragment from a named slot owned by this form.

Parameters :
Name Type Optional Description
slotId string No
  • The stable slot identifier.
Returns : void
Public clearWaitState
clearWaitState()
Returns : void
Public Async closeForm
closeForm(result?: any)

Programmatically closes the form In MDI, it closes the floating-window instance In SDI, it navigates back to the default route (ex. "home")

Parameters :
Name Type Optional Description
result any Yes

The close result payload

Returns : Promise<boolean>

True when the close was accepted

Public Async closeWindow
closeWindow(result?: any)

Closes the floating window, if the Smart Form has been rendered in one.

Parameters :
Name Type Optional Description
result any Yes

The close result payload

Returns : Promise<boolean>

True when the close was accepted

Public componentLoadedFromLayoutContainer
componentLoadedFromLayoutContainer(instanceName: string, componentInstance: AbstractFormChild)

Registers a child component with the Smart Form without delegating to the layout container. Intended for calls originating from a SmartLayoutContainerComponent to avoid cycles. Re-registration replaces the previous entry for the same instanceName instead of being skipped, because dynamic layout fragments re-create same-named children (SCLNG-1677) and a stale entry would otherwise keep getInstanceFromName returning a destroyed instance.

Parameters :
Name Type Optional
instanceName string No
componentInstance AbstractFormChild No
Returns : void
Public componentUnloadedFromLayoutContainer
componentUnloadedFromLayoutContainer(instanceName: string, componentInstance: AbstractFormChild)

Unregisters a child component previously contributed by a layout container.

Parameters :
Name Type Optional
instanceName string No
componentInstance AbstractFormChild No
Returns : void
Public computeFormChildren
computeFormChildren()
Returns : void
Public Async fireModalFormClosed
fireModalFormClosed(closeResult: IProvidesDialogResult, launchedFormName: string, launchedFormParameter?: unknown)

Fires the ModalFormClosed event handler on the parent form.

Parameters :
Name Type Optional Description
closeResult IProvidesDialogResult No

The launched modal form close result

launchedFormName string No

The launched modal form name

launchedFormParameter unknown Yes

The parameter passed to the launched modal form

Returns : Promise<void>
Public getColumnCssClasses
getColumnCssClasses()

Gets column CSS classes for the layout container

Returns : string
Public getContainerCssClasses
getContainerCssClasses()

Gets container CSS classes for the layout container

Returns : string
Public getContainerSizeCategory
getContainerSizeCategory(width: number, height: number)
Parameters :
Name Type Optional
width number No
height number No
Returns : string

{string}

getCurrentViewInjector
getCurrentViewInjector()
Returns : Injector

Injector

Public getDataSource
getDataSource(dataSourceName?: string)

Gets a form data source for server-side event handler payload generation.

Parameters :
Name Type Optional Description
dataSourceName string Yes

The data source name

The data source observable

getFormDatasource
getFormDatasource(datasourceName: string)
Parameters :
Name Type Optional
datasourceName string No
Returns : SmartDataSource

SmartDataSource

getFormDatasourceAsObservable
getFormDatasourceAsObservable(datasourceName: string)
Type parameters :
  • T

Gets a data source as an observable

Parameters :
Name Type Optional Default value Description
datasourceName string No this.primaryDataSource
  • The name of the data source to get. If not provided, the primary data source is used.
Returns : Observable<T>
getFormDataSourceRegistry
getFormDataSourceRegistry()
Returns : DataSourceRegistry

{DataSourceRegistry}

Public getFormNameFromLayoutURL
getFormNameFromLayoutURL()

Returns the instance name of the Smart Form based on the repository layout URL. Throws an error if the layout is an object or the URL is a frontend URL.

Returns : string

{string}

Public getInstanceFromName
getInstanceFromName(name: string)
Parameters :
Name Type Optional
name string No
Returns : AbstractFormChild

AbstractFormChild

Public getOwnFunction
getOwnFunction(functionName: string)
Parameters :
Name Type Optional
functionName string No
Returns : any
getSmartGridEventsObservable
getSmartGridEventsObservable(gridInstanceName: string, eventType?: any)

Returns grid events

Parameters :
Name Type Optional
gridInstanceName string No
eventType any Yes
Returns : Observable<any>
getSmartViewerEventsObservable
getSmartViewerEventsObservable(viewerInstanceName: string, eventType?: any)

Returns viewer events

Parameters :
Name Type Optional
viewerInstanceName string No
eventType any Yes
Returns : Observable<any>
Public getWrapperContainer
getWrapperContainer(element: HTMLElement)
Parameters :
Name Type Optional
element HTMLElement No
Returns : HTMLElement
Public Async handleChildLayoutChanged
Layout changes are now handled by the SmartLayoutContainerComponent. This method is kept for backwards compatibility.
handleChildLayoutChanged()
Returns : any
handleComponentTypeChange
handleComponentTypeChange(newCmpType: any)
Parameters :
Name Type Optional
newCmpType any No
Returns : boolean

boolean

init
init()
Returns : void
isInjectedDataSource
isInjectedDataSource(dataSourceName: string)
Parameters :
Name Type Optional
dataSourceName string No
Returns : boolean

{boolean}

Public Async PerformAction
PerformAction(actionName: string, ...actionArgs: any[])

Performs a FormAction

Parameters :
Name Type Optional Description
actionName string No

The name of the action to perform

actionArgs any[] No

The arguments to pass to the action

Returns : any
Async refreshBreadcrumbLabel
refreshBreadcrumbLabel(label?: string)

Refreshes the breadcrumb label for the current form

Parameters :
Name Type Optional Description
label string Yes

The new label to set

Returns : Promise<void>
Public registerLayoutFragment
registerLayoutFragment(slotId: string, fragment: string | SmartFormConfiguration | SmartFormLayoutFragment)

Loads a dynamic layout fragment into a named slot owned by this form. The fragment's data sources are merged into this form's runtime and its controls participate in this form (SSEH, TableIO, UIActions) without creating a nested smart-form (SCLNG-1677).

Parameters :
Name Type Optional Description
slotId string No
  • The stable slot identifier.
fragment string | SmartFormConfiguration | SmartFormLayoutFragment No
  • The fragment URL or layout object.
Returns : Promise<boolean>
Public Async reload
reload()

Reloads the form by cleaning up all state, destroying child views, and reinitializing as if the form has just been initialized. Re-reads the JSON layout and recreates all components.

Returns : Promise<void>
setComponentType
setComponentType(cmpType: unknown)
Parameters :
Name Type Optional
cmpType unknown No
Returns : void
Public setDialogResult
setDialogResult(result: any)

Sets the dialog result returned when the form is closed.

Parameters :
Name Type Optional Description
result any No

The dialog result payload

Returns : void
setFormConfiguration
setFormConfiguration(layout: string | SmartFormConfiguration)
Parameters :
Name Type Optional
layout string | SmartFormConfiguration No
Returns : void
Public Async setFormHeight
setFormHeight()
Returns : any
Public setFormResult
setFormResult(formResult: any, dialogResult?: any)

Sets the form result returned when the form is closed.

Parameters :
Name Type Optional Description
formResult any No

The form result

dialogResult any Yes

The dialog result

Returns : void
setUpdateMode
setUpdateMode(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void
setViewRef
setViewRef(viewRef: ViewRef)
Parameters :
Name Type Optional
viewRef ViewRef No
Returns : void
Public setWaitState
setWaitState()
Returns : void
Public setWindowState
setWindowState(state: WindowState)

Sets the floating window state, if the Smart Form has been redered in one

Parameters :
Name Type Optional
state WindowState No
Returns : void
setWindowTitle
setWindowTitle()
Returns : void
subscribeSmartComponentEvents
subscribeSmartComponentEvents(instanceName: string, callback: any)
Parameters :
Name Type Optional
instanceName string No
callback any No
Returns : Subscription

{Subscription}

subscribeToGridToolbarEvents
subscribeToGridToolbarEvents(grid: SmartGridComponent)

Subscribes to a Smart Grid's toolbar events

Parameters :
Name Type Optional
grid SmartGridComponent No
Returns : Subscription
Public trackRuntimeDataSource
trackRuntimeDataSource(ds: SmartDataSource)

Tracks a runtime-merged data source (e.g. from a dynamic layout fragment slot, SCLNG-1677) in this form's dirty-state handling so the existing unsaved-changes conventions (route-leave prompt, floating-window close prompt) cover edits made through it.

Parameters :
Name Type Optional Description
ds SmartDataSource No
  • The runtime-merged data source.
Returns : void

Disposer that detaches the data source again.

Properties

splitView
Type : ReplaySubject<SmartSplitPaneComponent>
Default value : new ReplaySubject<SmartSplitPaneComponent>()
tabStripElement
Type : ElementRef
Decorators :
@ViewChild(TabStripComponent, {read: ElementRef})
breadcrumbInstance
Type : SmartBreadCrumbNavigationComponent
Public Readonly componentLoaded$
Type : EventEmitter<SmartFormComponentLoadedEventArgs>
Default value : new EventEmitter(null)
container
Type : ViewRef
Decorators :
@ViewChild('container', {read: ViewRef, static: true})
containerVcRef
Type : ViewContainerRef
Decorators :
@ViewChild('container', {read: ViewContainerRef, static: true})
currentBrowserTitleTemplate
Type : string
datasources
Type : SmartDataSource[]
Default value : []
destroy$
Type : Subject<boolean>
Default value : new Subject<boolean>()
disablingOverlay
Type : HTMLDivElement
flexDirection
Type : string
floatingWindowTitleBarTemplate
Type : TemplateRef<any>
Decorators :
@ViewChild('floatingWindowTitleBar', {read: TemplateRef})
Public formChildren
Type : string[]
Default value : []
formConfigurationStacked
Type : SmartFormConfiguration
formDomElement
Type : ElementRef
Decorators :
@ViewChild('container', {read: ElementRef})
formIsStacked
Type : boolean
formSize
Type : string
injectedFormDataSources
Type : SmartFormDataSources
Public injector
Type : Injector
inUpdateMode
Type : EventEmitter<boolean>
Default value : new EventEmitter<boolean>()
layoutContainer
Type : SmartLayoutContainerComponent
Decorators :
@ViewChild('layoutContainer', {read: SmartLayoutContainerComponent})

Reference to the layout container component

Public loadedChildren
Type : LoadedChild[]
Default value : []
Public rippleContainerHeight
Type : number
rippleEffect
Type : RippleContainerDirective
Decorators :
@HostBinding('attr.kendoRippleContainer')
screenService
Type : SmartScreenService
templatePlaceholders
Type : QueryList<SmartFormPlaceholderDirective>
Decorators :
@ViewChildren(SmartFormPlaceholderDirective)
translationProviderService
Type : SmartTranslationProviderService
<!--
**************************************************************************
* 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-form.component.html
    Purpose     : Template for Smart Form.
    Author(s)   : Radu Nicoara
    Created     : Dec 22, 2017
--------------------------------------------------------------------------
-->
<div class="smart-form-root">
        <div #container>
            @if(!!_formConfigurationSignal()) {
                <div 
                    #root
                    kendoRippleContainer
                    [disabled]="!_enableRippleEffectSignal()"
                    [ngClass]="_formConfigurationSignal().settings?.classList || ''">
                    <div #dataSourcesContainer></div>
                    
                    @if (!_isChildActiveSignal()) {
                        <smart-layout-container
                            #layoutContainer
                            class="p-2"
                            [layout]="_formConfigurationSignal()"
                            [stretchMode]="_formConfigurationSignal().settings?.stretchMode === true"
                            [height]="_formHeightSignal()"
                            [containerClass]="_containerClassStrSignal()"
                            [columnClass]="_columnClassStrSignal()">
                        </smart-layout-container>
                    }
                    <router-outlet></router-outlet>   
                </div>   
            }
        </div>

        <!-- FAB Action Buttons -->
        @if (visibleActionButtons().length > 0) {
            <div class="smart-form-fab-container">
                @for (button of visibleActionButtons(); track $index) {
                    <smart-fab
                        [smart-fab-icon]="button.icon"
                        [smart-fab-svg-icon]="button.svgIcon"
                        [smart-fab-text]="button.text"
                        [smart-fab-actions]="button.actions"
                        [smart-fab-position-mode]="'absolute'"
                        [smart-fab-align]="{ vertical: 'bottom', horizontal: 'end' }"
                        [smart-fab-offset]="{ x: '0px', y: ($index * -72) + 'px' }">
                    </smart-fab>
                }
            </div>
        }
    </div>

    <ng-template #floatingWindowTitleBar let-win>
        <div #floatingWindowTitle class="k-window-title">
            @if(_formIconUrlSignal() && _iconTypeSignal() === 'image') {
                <img class="form-window-icon" [src]="_formIconUrlSignal()">
            }
            @if(_formIconUrlSignal() && _iconTypeSignal() === 'icon') {
                <i [class]="'form-window-icon ' + _formIconUrlSignal()"></i>
            }

            <span style="margin-left: inherit">
                {{_layoutFormTitleSignal() || _formTitleSignal() || _fallbackTitleSignal() || _formRepositoryNameSignal()}}
            </span>
        </div>
        
        @if(_windowStateSignal() !== 'minimized' && !isModal) {
            <button
                (click)="setWindowState('minimized')"
                kendoButton
                iconClass="fa-regular fa-window-minimize"
                style="display: inline-flex"
                title="Minimize"
                [fillMode]="'flat'"
            >
            </button>
        }
        @if((!_windowStateSignal() || _windowStateSignal() === 'default') && !isModal) {
            <button
                (click)="setWindowState('maximized')"
                kendoButton
                iconClass="fa-regular fa-window-maximize"
                style="display: inline-flex"
                title="Maximize"
                [fillMode]="'flat'"
            >
            </button>
        }
        @if(_windowStateSignal() === 'maximized' || _windowStateSignal() === 'minimized') {
            <button
                (click)="setWindowState('default')"
                kendoButton
                iconClass="fa-regular fa-window-restore"
                style="display: inline-flex"
                title="Restore"
                [fillMode]="'flat'"
            >
            </button>
        }
        <button
            (click)="closeWindow()"
            kendoButton
            iconClass="fa-solid fa-xmark"
            style="display: inline-flex"
            title="Close" 
            [fillMode]="'flat'"
        >
        </button>
    </ng-template>

../ui/form/smart-form.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-form.component.css
    Purpose     : Styles for Smart Form.
    Author(s)   : Radu Nicoara
    Created     : Jan 15, 2018
  ----------------------------------------------------------------------*/

::ng-deep FormItem {
    display: block;
}

::ng-deep .form-column.vertical-stretch {
    display: flex !important;
    height: 100% !important;
}

::ng-deep .k-ripple-container {
    padding: var(--kendo-spacing-2.5, 0.625rem) 0px;
}

::ng-deep .container-fluid > .row.smart-form-row  {
    display: block;
    flex-direction: unset;
}
::ng-deep .container-fluid > .row.smart-form-row > formcolumn  {
    padding-inline-start: 0px;
    padding-inline-end: 0px;
    display: block;
    height: 100% !important;
}

/* Only apply overflow-y: auto when NOT in stretch mode */
::ng-deep .container-fluid:not(.stretch-mode) > .row.smart-form-row > formcolumn  {
    overflow-y: auto !important;
}
::ng-deep .k-window .k-window-titlebar .k-window-actions.floating-window-buttons .k-button:nth-of-type(1),
::ng-deep .k-window .k-window-titlebar .k-window-actions.floating-window-buttons .k-button:nth-of-type(2) {
    visibility: visible !important;
}


::ng-deep .unsaved-changes-warning-dialog {
    z-index: 100000 !important;
}

::ng-deep .smart-form-dirty-state > div {
    border: 1px solid var(--kendo-color-error, #dc3545);
}

::ng-deep * {
    font-family: var(--kendo-font-family, "Segoe UI", "Helvetica Neue", Arial, sans-serif);
}

::ng-deep .form-window-icon {
    margin-right: var(--kendo-spacing-2, 0.5rem);
}

::ng-deep img.form-window-icon {
    width: var(--kendo-spacing-4, 1rem);
    height: var(--kendo-spacing-4, 1rem);
    object-fit: contain;
    vertical-align: middle;
}

.smart-form-root {
    position: relative;
    height: 100%;
}

.smart-form-fab-container {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    z-index: 100;
    pointer-events: none;
}

.smart-form-fab-container smart-fab {
    pointer-events: auto;
}

./smart-developer-tools.form.scss

/**********************************************************************
 * 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-developer-tools.form.scss
    Purpose     : Styles for Smart Developer Tools form.
    Author(s)   : Radu Nicoara
    Created     : Sep 11, 2025
  ----------------------------------------------------------------------*/

kendo-tabstrip {
    height: 100% !important;
    width: 100% !important;
}

.form-column.vertical-stretch {
    width: 100% !important;
}

:host {
    height: 100% !important;
    width: 100% !important;
    display: block !important;
    & > div {
        height: 100% !important;
        width: 100% !important;
        display: block !important;
        & > div {
            height: 100% !important;
            width: 100% !important;
            display: block !important;
            
            & > div.k-ripple-container {
                height: 100% !important;
                width: 100% !important;
                display: block !important;
            }
         }
    }
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""