src/ui/viewer/components/field-set/field-set.component.ts
| changeDetection | ChangeDetectionStrategy.OnPush |
| selector | smart-viewer-fieldset |
| styleUrls | ./field-set.component.css |
| templateUrl | ./field-set.component.html |
Properties |
Methods |
|
Inputs |
Accessors |
| definition |
Type : any
|
|
Sets the fieldset definition. |
| hasAbsolutePosition |
Type : boolean
|
|
Sets whether the fieldset uses absolute positioning. |
| inline-labels |
Type : boolean
|
|
Sets the inline labels flag. |
| itemIndex |
Type : number
|
| partOfGroup |
Type : boolean
|
|
Sets whether this fieldset is part of a group. |
| smart-help-url |
Type : string
|
| title |
Type : string
|
| Public refreshTitle |
refreshTitle()
|
|
Recomputes label visibility and forces view refresh.
Returns :
void
|
| classList |
Type : string[]
|
Default value : []
|
| fieldSet |
Type : ElementRef
|
Decorators :
@ViewChild('fieldSet', {read: ElementRef})
|
| height |
Type : number
|
Default value : 0
|
| lastChild |
Type : SmartViewerFieldComponent | FieldSetComponent
|
| maxDepthValue |
Type : number
|
Default value : 0
|
| padded |
Type : boolean
|
| definition | ||||||||
getdefinition()
|
||||||||
|
Returns the fieldset definition.
Returns :
any
|
||||||||
setdefinition(value: any)
|
||||||||
|
Sets the fieldset definition.
Parameters :
Returns :
void
|
| inlineLabels | ||||||||
getinlineLabels()
|
||||||||
|
Returns whether labels are inline.
Returns :
boolean
|
||||||||
setinlineLabels(value: boolean)
|
||||||||
|
Sets the inline labels flag.
Parameters :
Returns :
void
|
| partOfGroup | ||||||||
getpartOfGroup()
|
||||||||
|
Returns whether this fieldset is part of a group.
Returns :
boolean
|
||||||||
setpartOfGroup(value: boolean)
|
||||||||
|
Sets whether this fieldset is part of a group.
Parameters :
Returns :
void
|
| hasAbsolutePosition | ||||||||
gethasAbsolutePosition()
|
||||||||
|
Returns whether the fieldset uses absolute positioning.
Returns :
boolean
|
||||||||
sethasAbsolutePosition(value: boolean)
|
||||||||
|
Sets whether the fieldset uses absolute positioning.
Parameters :
Returns :
void
|
| helpUrl | ||||||
gethelpUrl()
|
||||||
|
Returns :
string
|
||||||
sethelpUrl(value: string)
|
||||||
|
Parameters :
Returns :
void
|
| noLabel | ||||||||
getnoLabel()
|
||||||||
|
Returns whether the label is hidden.
Returns :
boolean
|
||||||||
setnoLabel(value: boolean)
|
||||||||
|
Sets the no-label flag.
Parameters :
Returns :
void
|
| fieldChildren | ||||||
setfieldChildren(fieldChildren: QueryList<SmartViewerFieldComponent>)
|
||||||
|
Parameters :
Returns :
void
|
| fieldsetChildren | ||||||
setfieldsetChildren(fieldsetChildren: QueryList<FieldSetComponent>)
|
||||||
|
Parameters :
Returns :
void
|
| fields | ||||||||
getfields()
|
||||||||
|
Returns the fields array.
Returns :
SmartViewerFieldSettings[]
|
||||||||
setfields(value: SmartViewerFieldSettings[])
|
||||||||
|
Sets the fields array.
Parameters :
Returns :
void
|
| fieldsetHeight |
getfieldsetHeight()
|
|
|
| top |
gettop()
|
|
Returns :
number
|
<!--
**************************************************************************
* 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 : field-set.component.html
Purpose : Template for field set.
Author(s) : Radu Nicoara
Created : Dec 21, 2017
--------------------------------------------------------------------------
-->
<fieldset
#fieldSet
class="smart-viewer-fieldset k-form-fieldset"
smart-widget
smart-widget-target="self"
[name]="_definitionSignal().fieldName"
[componentInstance]="this"
>
@if (!_noLabelSignal()) {
<legend class="k-form-legend">{{ titleSignal() }}</legend>
} @else {
<legend class="k-form-legend"></legend>
}
<div class="fieldset-content">
@for (item of _fieldsSignal(); track item.fieldName) { @if (item.type
=== 'group') {
<smart-viewer-group
[definition]="item"
[hasAbsolutePosition]="_hasAbsolutePositionSignal()"
[inline-labels]="_inlineLabelsSignal()"
[ngClass]="{ 'labels-left-group': _inlineLabelsSignal() }"
[smart-help-url]="
$safeNavigationMigration(item.inputSettings?.helpUrl)
"
>
</smart-viewer-group>
} @else if (item.type === 'fieldset') {
<smart-viewer-fieldset
[definition]="item"
[hasAbsolutePosition]="_hasAbsolutePositionSignal()"
[inline-labels]="_inlineLabelsSignal()"
[partOfGroup]="_partOfGroupSignal()"
[smart-help-url]="
$safeNavigationMigration(item.inputSettings?.helpUrl)
"
>
</smart-viewer-fieldset>
} @else {
<smart-viewer-field
[field]="item"
[hasAbsolutePosition]="_hasAbsolutePositionSignal()"
[inline-label]="_inlineLabelsSignal()"
[smart-help-url]="
$safeNavigationMigration(item.inputSettings?.helpUrl)
"
[ngClass]="{
'vertical-stretch': item.inputSettings?.editorOptions
?.verticalStretch
? true
: false
}"
>
</smart-viewer-field>
} }
</div>
</fieldset>
./field-set.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 : field-set.component.css
Purpose : Styles for field set.
Author(s) : Mike Fechner
Created : Dec 12, 2016
----------------------------------------------------------------------*/
::ng-deep legend {
border-bottom: unset !important;
margin-bottom: unset !important;
}
fieldset.padded {
margin-top: 20px;
}
.smart-viewer-fieldset.border-all {
border: 1px solid lightgray !important;
padding: 10px;
border-radius: 0.25rem !important;
}
::ng-deep .absolute-layout .smart-viewer-fieldset.border-all {
padding: 0px 10px !important;
}
.smart-viewer-fieldset.border-top {
border-top: 1px solid black !important;
}
::ng-deep .smart-viewer-fieldset smart-viewer-field:first-of-type div.k-form-field.form-field-label {
margin-top: 0px !important;
}
fieldset.no-legend legend {
width: 0px;
padding: 0px;
}