File

src/ui/viewer/components/group/field-group.component.ts

Implements

OnInit AfterViewInit

Metadata

Index

Properties
Methods
Inputs
Accessors

Constructor

constructor(screen: SmartScreenService, changeDetector: ChangeDetectorRef, renderer: Renderer2, elementRef: ElementRef, viewerHelperService: SmartViewerHelperService<AbstractFrameComponent>, injector: Injector)
Parameters :
Name Type Optional
screen SmartScreenService No
changeDetector ChangeDetectorRef No
renderer Renderer2 No
elementRef ElementRef No
viewerHelperService SmartViewerHelperService<AbstractFrameComponent> No
injector Injector No

Inputs

definition
Type : any

Sets the definition for the group.

hasAbsolutePosition
Type : boolean

Sets whether the group uses absolute positioning.

inline-labels
Type : boolean

Sets the inline labels flag.

smart-help-url
Type : string

Methods

computeNoLabelFields
computeNoLabelFields()
Returns : void

Properties

classList
Type : any
Default value : {}
fieldComponents
Type : QueryList<SmartViewerFieldComponent>
Decorators :
@ViewChildren(SmartViewerFieldComponent)
fieldGroup
Type : ElementRef
Decorators :
@ViewChild('fieldGroup', {read: ElementRef})
groupFields
Type : QueryList<ElementRef>
Decorators :
@ViewChildren(SmartViewerFieldComponent, {read: ElementRef})
isField
Type : boolean
itemWidthClass
Type : string

Accessors

definition
getdefinition()

Returns the group definition.

Returns : any
setdefinition(value: any)

Sets the definition for the group.

Parameters :
Name Type Optional Description
value any No
  • The group definition.
Returns : void
hasAbsolutePosition
gethasAbsolutePosition()

Returns whether the group uses absolute positioning.

Returns : boolean
sethasAbsolutePosition(value: boolean)

Sets whether the group uses absolute positioning.

Parameters :
Name Type Optional Description
value boolean No
  • The absolute position flag.
Returns : void
inlineLabels
getinlineLabels()

Returns whether labels are inline.

Returns : boolean
setinlineLabels(value: boolean)

Sets the inline labels flag.

Parameters :
Name Type Optional Description
value boolean No
  • Whether labels are inline.
Returns : void
items
getitems()

Returns the items for the group.

setitems(value: SmartViewerFormItem[])

Sets the items for the group.

Parameters :
Name Type Optional Description
value SmartViewerFormItem[] No
  • The items array.
Returns : void
fieldContainerClassList
getfieldContainerClassList()

Returns the field container class list array.

Returns : any[]
setfieldContainerClassList(value: any[])

Sets the field container class list array.

Parameters :
Name Type Optional Description
value any[] No
  • The class list array.
Returns : void
type
gettype()

Returns the group type.

Returns : string
settype(value: string)

Sets the group type.

Parameters :
Name Type Optional Description
value string No
  • The type.
Returns : void
helpUrl
gethelpUrl()
Returns : string
sethelpUrl(value: string)
Parameters :
Name Type Optional
value string No
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-group.component.html
    Purpose     : Template for field group.
    Author(s)   : Radu Nicoara
    Created     : Dec 21, 2017
--------------------------------------------------------------------------
-->
<div #fieldGroup class="row gx-2 gy-0">
	@for (item of _itemsSignal(); track item.fieldName; let i = $index) {
	<div [ngClass]="_fieldContainerClassListSignal()[i]">
		@if (item.type === 'fieldset') {
		<smart-viewer-fieldset
			[style.flex]="1"
			[style.width]="'100%'"
			[definition]="item"
			[hasAbsolutePosition]="_hasAbsolutePositionSignal()"
			[inline-labels]="_inlineLabelsSignal()"
			[itemIndex]="i"
			[partOfGroup]="true"
			[smart-help-url]="helpUrl"
		>
		</smart-viewer-fieldset>
		} @if (item.type !== 'fieldset' && item.type !== 'group' &&
		_typeSignal() !== 'custom') {
		<smart-viewer-field
			[style.flex]="1"
			[style.width]="'100%'"
			[field]="item"
			[ngClass]="{
				'labels-left-field': _inlineLabelsSignal(),
				'vertical-stretch': item.inputSettings?.editorOptions
					?.verticalStretch
					? true
					: false,
				'absolute-positioned': _hasAbsolutePositionSignal()
			}"
			[smart-help-url]="
				$safeNavigationMigration(item.inputSettings?.helpUrl)
			"
		>
		</smart-viewer-field>
		}
	</div>
	}
</div>

./field-group.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-group.component.css
    Purpose     : Styles for field group.
    Author(s)   : Radu Nicoara
    Created     : Dec 21, 2017
  ----------------------------------------------------------------------*/

.row {
    padding-inline-start: 0px !important;
    padding-inline-end: 0px !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.row > div {
    /* allow flex items to shrink below min-content to equalize widths */
    min-width: 0;
}

/*.row div {
    padding-left: 0px !important;
    padding-right: 0px !important;
}*/
.group-separator {
    width: 15px;
}

.row div.first {
    padding-inline-start: 0px !important;
}

.row div.last {
    padding-inline-end: 0px !important;
}

.row smart-viewer-field {
    width: 100% !important;
}

::ng-deep .labels-left-group .k-form-field.form-field-label {
    display: flex !important;
    gap: 6px;
}

::ng-deep .labels-left-group .k-form-field.form-field-label span {
    flex-basis: 50% !important;
    padding-top: 2px !important;
}

::ng-deep .labels-left-group .smart-checkbox {
    width: max-content !important;
    margin-top: -20px !important;
    margin-bottom: 20px !important;
    padding-top: 0 !important;
}

::ng-deep .labels-left-group-left .smart-checkbox input {
    flex: initial !important;
    margin-left: 5px !important;
}

@media (max-width: 991px) {
    .row div, .row div.first, .row div.last {
        padding-inline-start: 0px !important;
        padding-inline-end: 0px !important;
    }
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""