src/ui/viewer/components/field/field.component.ts
OnInit
AfterViewInit
OnDestroy
| changeDetection | ChangeDetectionStrategy.OnPush |
| selector | smart-viewer-field |
| styleUrls | ./field.component.css |
| templateUrl | ./field.component.html |
Properties |
Methods |
Inputs |
Outputs |
Accessors |
constructor(helperService: SmartViewerHelperService<AbstractFrameComponent>, formInstanceService: SmartFormInstanceService, serviceAdapter: SmartServiceAdapter, globalValues: SmartGlobalValueStoreService, element: ElementRef, renderer: Renderer2, smartConfig: SmartConfig, domSanitizer: DomSanitizer, smartServiceAdapter: SmartServiceAdapter, changeDetector: ChangeDetectorRef, injector: Injector, zone: NgZone)
|
|||||||||||||||||||||||||||||||||||||||
|
Parameters :
|
| field |
Type : SmartViewerFieldSettings
|
|
Sets the field settings. |
| hasAbsolutePosition |
Type : boolean
|
|
Sets whether the field uses absolute positioning. |
| inline-label |
Type : boolean
|
|
Sets the inline label flag. |
| smart-help-url |
Type : string
|
| componentRendered$ |
Type : ReplaySubject<void>
|
| computeStyling | ||||||||
computeStyling(style: any)
|
||||||||
|
Computes and applies the styling for the field component.
Parameters :
Returns :
void
|
| createFieldComponent |
createFieldComponent()
|
|
Creates and initializes the field component based on the field type and input settings.
Returns :
void
|
| getLabelStyle | ||||||||
getLabelStyle(label: HTMLElement)
|
||||||||
|
Computes and returns the style for the label element.
Parameters :
Returns :
any
The computed style for the label element. |
| setLabelStyle |
setLabelStyle()
|
|
Sets the label style for the field component. It retrieves the label element reference and applies the computed label style.
Returns :
void
|
| setStyleOnFieldContainer |
setStyleOnFieldContainer()
|
|
Applies the styles to the field container element.
Returns :
void
|
| setUseDateTimeZones | ||||||||
setUseDateTimeZones(useDateTimeZones: boolean)
|
||||||||
|
Updates the DATETIME-TZ usage preference on this field and its wrapper.
Parameters :
Returns :
void
|
| updateImageURL |
updateImageURL()
|
|
Updates the image URL based on the input settings of the field. It is called whenever the image file name is updated.
Returns :
void
|
| updateValue | |||||||||||||||
updateValue(value: any, publishUpdate: unknown)
|
|||||||||||||||
|
Updates the value of the field and optionally publishes the update.
Parameters :
Returns :
void
|
| buttonComponentContainer |
Type : ViewContainerRef
|
Decorators :
@ViewChild('buttonContainer', {read: ViewContainerRef})
|
| checkBoxLabel |
Type : ElementRef
|
Decorators :
@ViewChild('label', {read: ElementRef})
|
| contentStyle |
Type : any
|
Default value : {}
|
|
set on wrapper, absolute positioning properties |
| fieldComponentContainer |
Type : ViewContainerRef
|
Decorators :
@ViewChild('fieldComponentContainer', {read: ViewContainerRef})
|
| fieldLabel |
Type : ElementRef
|
Decorators :
@ViewChild('fieldLabel', {read: ElementRef})
|
| fieldStyle |
Type : any
|
Default value : {}
|
|
customization for the field element |
| Public formInstanceService |
Type : SmartFormInstanceService
|
Decorators :
@Optional()
|
| Public helperService |
Type : SmartViewerHelperService<AbstractFrameComponent>
|
| imageURL |
Type : string | SafeResourceUrl
|
| isRegularField |
Type : unknown
|
Default value : false
|
| labelStyle |
Type : any
|
Default value : {}
|
|
contains field's label customization + absolute positioning properties |
| mandatory |
Type : boolean
|
| showDatePickerWeekNumbers |
Type : unknown
|
Default value : false
|
| textArea |
Type : ElementRef
|
Decorators :
@ViewChild('vTextArea', {read: ElementRef})
|
| field | ||||||||
getfield()
|
||||||||
|
Returns the field settings.
Returns :
SmartViewerFieldSettings
|
||||||||
setfield(value: SmartViewerFieldSettings)
|
||||||||
|
Sets the field settings.
Parameters :
Returns :
void
|
| inlineLabel | ||||||||
getinlineLabel()
|
||||||||
|
Returns whether the label is inline.
Returns :
boolean
|
||||||||
setinlineLabel(value: boolean)
|
||||||||
|
Sets the inline label flag.
Parameters :
Returns :
void
|
| hasAbsolutePosition | ||||||||
gethasAbsolutePosition()
|
||||||||
|
Returns whether the field uses absolute positioning.
Returns :
boolean
|
||||||||
sethasAbsolutePosition(value: boolean)
|
||||||||
|
Sets whether the field uses absolute positioning.
Parameters :
Returns :
void
|
| fieldLabelOverride | ||||||||
getfieldLabelOverride()
|
||||||||
|
Returns the field label override.
Returns :
string
|
||||||||
setfieldLabelOverride(value: string)
|
||||||||
|
Sets the field label override.
Parameters :
Returns :
void
|
| helpUrl | ||||||
gethelpUrl()
|
||||||
|
Returns :
string
|
||||||
sethelpUrl(value: string)
|
||||||
|
Parameters :
Returns :
void
|
| container | ||||||
getcontainer()
|
||||||
|
Returns :
ViewContainerRef
|
||||||
setcontainer(value: ViewContainerRef)
|
||||||
|
Parameters :
Returns :
void
|
| selected | ||||||||
getselected()
|
||||||||
|
Returns the selected record.
Returns :
any
|
||||||||
setselected(value: any)
|
||||||||
|
Sets the selected record.
Parameters :
Returns :
void
|
| fieldContainerStyle | ||||||||
getfieldContainerStyle()
|
||||||||
|
Returns the field container style object.
Returns :
any
|
||||||||
setfieldContainerStyle(value: any)
|
||||||||
|
Sets the field container style object.
Parameters :
Returns :
void
|
| classList | ||||||||
getclassList()
|
||||||||
|
Returns the class list for the field.
Returns :
any
|
||||||||
setclassList(value: any)
|
||||||||
|
Sets the class list for the field.
Parameters :
Returns :
void
|
| height |
getheight()
|
|
|
| top |
gettop()
|
|
Returns :
number
|
| buttonImageUrl |
getbuttonImageUrl()
|
|
Returns :
string
|
| buttonIcon |
getbuttonIcon()
|
|
Returns :
string
|
| isButton |
getisButton()
|
|
Returns :
boolean
|
| isNumeric |
getisNumeric()
|
|
Returns :
boolean
|
| model | ||||||
getmodel()
|
||||||
|
Returns :
any
|
||||||
setmodel(value: any)
|
||||||
|
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 : field.component.html
Purpose : Template for field.
Author(s) : Radu Nicoara
Created : Dec 07, 2017
--------------------------------------------------------------------------
-->
@if (!!_selectedSignal()) {
<kendo-form-field
[ngClass]="_classListSignal()"
[ngStyle]="_fieldContainerStyleSignal()"
>
@if (!_fieldSignal().inputSettings?.noLabel) {
@if ((_fieldLabelOverrideSignal() || _fieldSignal().label) && _fieldSignal().inputSettings.inputType !== 'checkbox' && _fieldSignal().inputSettings.inputType !== 'button' && _fieldSignal().type !== 'text') {
<kendo-label #fieldLabel [text]="_fieldLabelOverrideSignal() || _fieldSignal().label">
@if (_fieldSignal().required || _fieldSignal().definition?.mandatory) {
<span class="k-required smart-field-required">*</span>
}
</kendo-label>
} @else if ((!_fieldLabelOverrideSignal() && !_fieldSignal().label) && _fieldSignal().preserveLabelSpace) {
<kendo-label #fieldLabel [text]="' '"></kendo-label>
} @else if (
(_fieldLabelOverrideSignal() || _fieldSignal().label) &&
(_fieldSignal().inputSettings.inputType === 'checkbox' || _fieldSignal().inputSettings.inputType === 'button' || _fieldSignal().type === 'text') &&
_fieldSignal().preserveLabelSpace
) {
<kendo-label #fieldLabel [text]="' '"></kendo-label>
}
} @else if (_fieldSignal().preserveLabelSpace) {
<kendo-label #fieldLabel [text]="' '"></kendo-label>
}
<div #fieldComponentContainer></div>
</kendo-form-field>
}
./field.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.component.css
Purpose : Styles for field.
Author(s) : Radu Nicoara
Created : Dec 21, 2017
----------------------------------------------------------------------*/
::ng-deep input[disabled],
::ng-deep textarea[disabled],
::ng-deep select[disabled],
::ng-deep [smart-widget-disabled],
::ng-deep span.k-numeric-wrap[smart-widget-disabled] {
opacity: 1 !important;
}
::ng-deep smart-viewer-field:not(.absolute-positioned) .k-form-field.vertical-stretch {
flex: 1 !important;
display: flex !important;
flex-direction: column !important;
}
::ng-deep smart-viewer-field:not(.absolute-positioned) .k-form-field.vertical-stretch.inline-label {
flex-direction: row !important;
padding-bottom: 10px !important;
}
::ng-deep .smart-editor {
width: 100%;
}
::ng-deep kendo-textarea.k-textarea.k-disabled .k-input-inner {
cursor: default !important;
pointer-events: auto !important;
}
::ng-deep smart-viewer-field:not(.absolute-positioned) .k-form-field .vertical-stretch .smart-editor .k-input-inner {
height: 100%;
}
::ng-deep smart-viewer-field:not(.absolute-positioned) .inline-label .smart-editor.vertical-stretch {
height: 100% !important;
}
::ng-deep smart-viewer-field:not(.absolute-positioned) .smart-editor.vertical-stretch .k-input-inner {
height: 100% !important;
position: absolute !important;
left: 0;
top: 0;
padding: 5px !important;
}
::ng-deep .k-form-field.smart-checkbox {
display: flex !important;
margin-top: 0px !important;
}
::ng-deep kendo-autocomplete.k-state-disabled {
padding-right: 0px !important;
}
::ng-deep .k-form-field.inline-label > span {
width: auto !important;
line-height: 1.7 !important;
padding-inline-end: 5px !important;
align-self: start !important;
}
::ng-deep .k-animation-container {
z-index: 1000;
}
::ng-deep .k-autocomplete {
padding-right: 0px !important;
}
::ng-deep .smart-checkbox .disabled {
pointer-events: none !important;
}
::ng-deep .labels-left-field {
margin-top: 1em !important;
display: flex !important;
flex-direction: row !important;
justify-content: flex-start !important;
gap: 16px !important;
}
::ng-deep .labels-left-field > :first-child {
text-align: start !important;
min-width: 25% !important;
margin-top: 0px !important;
}
::ng-deep .labels-left-field:not(.absolute-positioned) > :last-child {
flex: 1 !important;
}
::ng-deep .labels-left-field .k-form-field.form-field-label .form-field-div,
::ng-deep .labels-left-field .k-form-field.form-field-label .form-field-input,
::ng-deep .labels-left-field .k-form-field.form-field-label kendo-numerictextbox,
::ng-deep .labels-left-field .k-form-field.form-field-label kendo-textarea,
::ng-deep .labels-left-field .k-form-field.form-field-label smart-lookup,
::ng-deep .labels-left-field .k-form-field.form-field-label smart-combo-editor,
::ng-deep .labels-left-field .k-form-field.form-field-label smart-radio-set,
::ng-deep .labels-left-field .k-form-field.form-field-label smart-logical-combo,
::ng-deep .labels-left-field .k-form-field.form-field-label smart-radio-set {
flex: 1 !important;
}
::ng-deep .labels-left-field:not(.absolute-positioned) .k-form-field.form-field-label span {
left: 0 !important;
}
@media screen and (max-width: 2600px) {
::ng-deep .labels-left-field > :first-child {
min-width: 15% !important;
}
}
@media screen and (max-width: 2000px) {
::ng-deep .labels-left-field > :first-child {
min-width: 20% !important;
}
}
::ng-deep
.labels-left-field > :first-child[type="checkbox"],
.labels-left-field > :first-child[type="button"] {
min-width: unset !important;
}
::ng-deep .labels-left-field:not(.absolute-positioned) .k-form-field.form-field-label.vertical-stretch {
flex-direction: row !important;
}
::ng-deep .tooltip.fade {
z-index: 10000;
}
::ng-deep :not(.labels-left-field) smart-combo-editor {
display: block !important;
}
::ng-deep .k-form-field.smart-checkbox:not(.inline-label) {
flex-direction: column;
margin-top: 0px !important;
}