File

src/ui/filter/horizontal-field/horizontal-field.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs
Accessors

Inputs

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

Methods

handleLookupKeyValueModelChange
handleLookupKeyValueModelChange(value: any)

Updates the filter from the lookup's key-value model when applicable.

Parameters :
Name Type Optional Description
value any No

the lookup key value model

Returns : void
handleLookupSmartModelChange
handleLookupSmartModelChange(value: any)

Updates the filter from the lookup's visible model when applicable.

Parameters :
Name Type Optional Description
value any No

the lookup smart model

Returns : void
setFilterValue
setFilterValue(value: any)

Set the filter value

Parameters :
Name Type Optional
value any No
Returns : void

Properties

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')
lookupSmartModel
Type : unknown
Default value : computed(() => { const value = this.filterSignal()?.value; if (!this.lookupUsesKeyValueModel() || this.isEmptyModelValue(value)) { return value; } return null; })
lookupUsesKeyValueModel
Type : unknown
Default value : computed(() => { return this.alternativeControlSignal()?.bindAsKeyValue === true; })

Accessors

filter
getfilter()

The filter configuration.

Returns : any
setfilter(value: any)

The filter configuration.

Parameters :
Name Type Optional
value any No
Returns : void
alternativeControl
getalternativeControl()

The alternative control configuration.

Returns : any
setalternativeControl(value: any)

The alternative control configuration.

Parameters :
Name Type Optional
value any 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        : horizontal-field.component.html
    Purpose     : Template for horizontal field.
    Author(s)   : Radu Nicoara
    Created     : Feb 22, 2018
--------------------------------------------------------------------------
-->
@switch (inputType) { @case ('checkbox') {
<div
	class="smart-filter-label horizontal k-form-field d-flex align-items-center"
>
	<input
		kendoCheckBox
		type="checkbox"
		class="smart-filter-field horizontal filter-checkbox"
		[ngModel]="filter.value === true"
		[ngModelOptions]="{ standalone: true }"
		(ngModelChange)="setFilterValue($event)"
	/>
	<label
		class="k-checkbox-label"
		style="margin: 0 0 0 var(--kendo-spacing-1, 0.25rem)"
		>{{ title }}</label
	>
</div>
} @default {
<div class="k-form-field mb-0">
	<label class="k-form-label">{{ title }}</label>
	<div class="k-input-group d-flex align-items-stretch" style="gap: 0">
		@if (!alternativeControl) { @if (inputType === 'date') {
		<kendo-datepicker
			class="smart-filter-field horizontal fill"
			[(ngModel)]="filter.value"
			(ngModelChange)="setFilterValue($event)"
		></kendo-datepicker>
		} @else {
		<input
			kendoTextBox
			class="smart-filter-field horizontal fill"
			[type]="inputType"
			[(ngModel)]="filter.value"
		/>
		} } @if (alternativeControl?.kind === 'combo') {
		<smart-combo-editor
			#comboRef
			class="smart-filter-field horizontal 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 horizontal 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 d-flex align-items-center"
			style="margin-left: 0"
		>
			<kendo-dropdownbutton
				[data]="operators"
				(itemClick)="filter.operator = $event.value"
				[popupSettings]="{
					appendTo: containerRef,
					popupClass: 'horizontal-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>
} }

./horizontal-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        : horizontal-field.component.css
    Purpose     : Styles for horizontal 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;
}

@media only screen and (max-width: 992px) {
    .k-form-field {
        padding-inline-end: var(--kendo-spacing-3.5, 0.875rem);
    }
}

@media only screen and (min-width: 993px) {
    .k-form-field {
        padding-inline-end: 0px;
    }
}

::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-inline-end: var(--kendo-spacing-1, 0.25rem);
    margin-inline-start: 0px;
}

::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);
}

/* Add spacing for checkbox fields */
.smart-filter-label.horizontal.k-form-field {
    margin-bottom: 0;
}

/* Prevent label wrap to keep fields aligned; truncate with ellipsis */
.k-form-field .k-form-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""