src/ui/filter/vertical-field/vertical-field.component.ts
| changeDetection | ChangeDetectionStrategy.OnPush |
| selector | VerticalField |
| styleUrls | ./vertical-field.component.css |
| templateUrl | ./vertical-field.component.html |
Properties |
Methods |
Inputs |
Accessors |
| alternativeControl |
Type : any
|
|
The alternative control configuration. |
| filter |
Type : any
|
|
The filter configuration. |
| filterInstanceName |
Type : string
|
| inputType |
Type : string
|
| onFilterValueChange |
Type : function
|
| operators |
Type : any[]
|
| title |
Type : string
|
| handleLookupKeyValueModelChange | ||||||||
handleLookupKeyValueModelChange(value: any)
|
||||||||
|
Updates the filter from the lookup's key-value model when applicable.
Parameters :
Returns :
void
|
| handleLookupSmartModelChange | ||||||||
handleLookupSmartModelChange(value: any)
|
||||||||
|
Updates the filter from the lookup's visible model when applicable.
Parameters :
Returns :
void
|
| setFilterValue | ||||||
setFilterValue(value: any)
|
||||||
|
Set the filter value
Parameters :
Returns :
void
|
| comboRef |
Type : SmartComboEditorComponent
|
Decorators :
@ViewChild('comboRef')
|
| containerRef |
Type : "root" | ViewContainerRef
|
| lookupKeyValueModel |
Type : unknown
|
Default value : computed(() => {
return this.lookupUsesKeyValueModel()
? this.filterSignal()?.value
: null;
})
|
| lookupRef |
Type : SmartLookupComponent
|
Decorators :
@ViewChild('lookupRef')
|
| lookupUsesKeyValueModel |
Type : unknown
|
Default value : computed(() => {
return this.alternativeControlSignal()?.bindAsKeyValue === true;
})
|
| filter | ||||||
getfilter()
|
||||||
|
The filter configuration.
Returns :
any
|
||||||
setfilter(value: any)
|
||||||
|
The filter configuration.
Parameters :
Returns :
void
|
| alternativeControl | ||||||
getalternativeControl()
|
||||||
|
The alternative control configuration.
Returns :
any
|
||||||
setalternativeControl(value: any)
|
||||||
|
The alternative control configuration.
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 : vertical-field.component.html
Purpose : Template for vertical field.
Author(s) : Radu Nicoara
Created : Feb 22, 2018
--------------------------------------------------------------------------
-->
<div class="smart-filter-label vertical k-form-field">
@if (inputType !== 'checkbox') {
<label class="k-form-label">{{ title }}</label>
}
<div class="k-input-group">
@switch (inputType) { @case ('checkbox') {
<kendo-checkbox
#checkbox
[checkedState]="filter.value === true"
[ngModel]="filter.value === true"
[ngModelOptions]="{ standalone: true }"
(ngModelChange)="setFilterValue($event)"
>
</kendo-checkbox>
<label class="k-checkbox-label">{{ title }}</label>
} @case ('date') {
<kendo-datepicker
class="smart-filter-field vertical fill"
[(ngModel)]="filter.value"
(ngModelChange)="setFilterValue($event)"
>
</kendo-datepicker>
@if (!alternativeControl) {
<span class="k-input-group-suffix">
<kendo-dropdownbutton
[data]="operators"
(itemClick)="filter.operator = $event.value"
[popupSettings]="{
appendTo: containerRef,
popupClass: 'vertical-filter-popup'
}"
>
<span class="fa-solid fa-filter"></span>
<ng-template kendoDropDownButtonItemTemplate let-dataItem>
<span
[ngClass]="{
bolded: dataItem.value === filter.operator
}"
>{{ dataItem.display }}</span
>
@if (dataItem.value === filter.operator) {
<span class="fa-solid fa-check"></span>
}
</ng-template>
</kendo-dropdownbutton>
</span>
} } @default { @if (!alternativeControl) {
<input
kendoTextBox
class="smart-filter-field vertical fill"
[type]="inputType || 'text'"
[(ngModel)]="filter.value"
/>
} @if (alternativeControl?.kind === 'combo') {
<smart-combo-editor
#comboRef
class="smart-filter-field vertical fill"
[smart-value-list]="alternativeControl.smartValueList"
[value-list-pair]="alternativeControl.valueListPair"
[value-list-entries]="alternativeControl.valueListEntries"
[value-list]="alternativeControl.valueList"
[smart-value-list-display-text]="
alternativeControl.valueListDisplayText
"
[smart-business-entity-name]="alternativeControl.entityName"
[smart-entity-table]="alternativeControl.tableRef"
[smart-partial-dataset]="alternativeControl.partialDataset"
[image-field-name]="alternativeControl.imageField"
[image-substitute]="alternativeControl.imageSubstitute"
[display-column-name]="alternativeControl.displayColumn"
[display-fields]="alternativeControl.displayFields"
[display-substitute]="alternativeControl.displaySubstitute"
[key-column-name]="alternativeControl.keyColumn"
[smart-field-binding]="alternativeControl.fieldBinding"
[smart-flag-value]="
alternativeControl.flagValue === ''
? ''
: alternativeControl.flagValue || null
"
[smart-flag-label]="alternativeControl.flagLabel || null"
[smart-flag-image]="alternativeControl.flagImage || null"
[smart-foreign-fields]="alternativeControl.foreignFields"
[smart-query-string]="alternativeControl.queryString"
[smart-sort]="alternativeControl.querySort"
[provide-foreign-field-value]="
alternativeControl.provideForeignFieldValue
"
[smart-combo-allow-filter]="alternativeControl.allowFiltering"
[smart-limit-to-list]="alternativeControl.limitToList"
[autoCompleteMode]="alternativeControl.autoCompleteMode"
[autoSuggestFilterMode]="alternativeControl.autoSuggestFilterMode"
[smartModel]="filter.value"
(smartModelChange)="setFilterValue($event)"
>
</smart-combo-editor>
} @if (alternativeControl?.kind === 'lookup') {
<smart-lookup
#lookupRef
class="smart-filter-field vertical fill"
[name]="filterInstanceName + '.' + filter.field"
[smart-business-entity-name]="
alternativeControl.lookup.businessEntity
"
[smart-entity-table]="alternativeControl.lookup.table"
[smart-grid-layout]="alternativeControl.lookup.gridLayout"
[smart-lookup-fields]="alternativeControl.lookup.fields"
[smart-lookup-fields-binding]="
alternativeControl.lookup.fieldBinding
"
[smart-lookup-dialog-options]="
alternativeControl.lookup.dialogOptions
"
[smart-server-side-filtering]="
alternativeControl.lookup.serverSideFiltering
"
[smart-lookup-disable-autocomplete]="
alternativeControl.lookup.disableAutocomplete
"
[smart-lookup-query-string]="
alternativeControl.lookup.lookupQueryString
"
[smart-lookup-dialog-query-string]="
alternativeControl.lookup.lookupDialogQueryString
"
[smart-lookup-key-field]="alternativeControl.lookup.keyField"
[smart-lookup-key-value-field]="
alternativeControl.lookup.keyValueField
"
[smart-fetch-data-on-navigate]="
alternativeControl.lookup.fetchDataOnNavigate
"
[smart-fetch-data-from-key-value-on-navigate]="
alternativeControl.lookup.fetchDataFromKeyValueOnNavigate
"
[smartModel]="lookupSmartModel()"
(smartModelChange)="handleLookupSmartModelChange($event)"
[keyValueModel]="lookupKeyValueModel()"
(keyValueModelChange)="handleLookupKeyValueModelChange($event)"
>
</smart-lookup>
} @if (!alternativeControl) {
<span class="k-input-group-suffix">
<kendo-dropdownbutton
[data]="operators"
(itemClick)="filter.operator = $event.value"
[popupSettings]="{
appendTo: containerRef,
popupClass: 'vertical-filter-popup'
}"
>
<span class="fa-solid fa-filter"></span>
<ng-template kendoDropDownButtonItemTemplate let-dataItem>
<span
[ngClass]="{
bolded: dataItem.value === filter.operator
}"
>{{ dataItem.display }}</span
>
@if (dataItem.value === filter.operator) {
<span class="fa-solid fa-check"></span>
}
</ng-template>
</kendo-dropdownbutton>
</span>
} } }
</div>
</div>
./vertical-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 : vertical-field.component.css
Purpose : Styles for vertical field.
Author(s) : Radu Nicoara
Created : Feb 22, 2018
----------------------------------------------------------------------*/
::ng-deep .bolded {
font-weight: var(--kendo-font-weight-semibold, 600) !important;
}
::ng-deep .op-dropdown, ::ng-deep .op-dropdown * {
height: 100% !important;
vertical-align: middle;
text-align: center;
}
::ng-deep .smart-filter-field.fill {
width: auto;
flex-grow: 1;
}
::ng-deep .k-textbox-container:not(.k-state-focused) label {
color: var(--kendo-color-subtle, #49454F);
}
.filter-checkbox {
margin-right: var(--kendo-spacing-1, 0.25rem);
}
::ng-deep .k-input-group-suffix .k-button {
border-radius: 0 var(--kendo-border-radius-md, 0.25rem) var(--kendo-border-radius-md, 0.25rem) 0;
}
::ng-deep .k-input-group .k-textbox {
border-right: none;
border-radius: var(--kendo-border-radius-md, 0.25rem) 0 0 var(--kendo-border-radius-md, 0.25rem);
}
.smart-filter-label.vertical {
display: flex;
flex-direction: column;
padding-left: 0;
padding-right: 0;
}
.smart-filter-label.vertical .k-input-group {
display: flex;
}
.smart-filter-label.vertical:has(.k-checkbox) {
flex-direction: row;
}
.smart-filter-label.vertical {
width: 100%;
}
::ng-deep .smart-filter-label.vertical .k-input-group {
width: 100%;
padding-left: 0;
padding-right: 0;
}
/* Add spacing for checkbox fields */
.smart-filter-label.vertical.k-form-field {
margin-top: var(--kendo-spacing-2, 0.5rem);
margin-bottom: var(--kendo-spacing-1, 0.25rem);
}