Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
/// @param {Map} $theme - The theme used to style the component.
@mixin date-range-picker($theme) {
@include css-vars($theme);
$variant: map.get($theme, '_meta', 'theme');

%igx-date-range-picker {
@include sizable();
--input-group-size: #{map.get($theme, 'size')};
--component-size: var(--ig-size, #{var-get($theme, 'default-size')});
display: flex;

> igx-icon {
Expand All @@ -32,6 +36,8 @@
igx-date-range-end,
%igx-date-range-picker__start,
%igx-date-range-picker__end {
--size: var(--input-group-size) !important;

flex: 1 0 0%;
}

Expand All @@ -40,6 +46,21 @@
align-items: center;
color: var-get($theme, 'label-color');
margin: 0 rem(8px);
height: var(--input-group-size);

@if $variant != 'material' {
align-self: flex-end;

&.input-has-hint {
align-self: center;

&:not(.input-has-label) {
align-self: flex-start;
}
}
} @else {
align-self: flex-start;
}
}

%igx-date-range-picker-buttons {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { DateTimeUtil } from '../date-common/util/date-time.util';
import { IgxOverlayOutletDirective } from '../directives/toggle/toggle.directive';
import {
IgxInputDirective, IgxInputGroupComponent, IgxInputGroupType, IgxInputState,
IgxLabelDirective, IGX_INPUT_GROUP_TYPE, IgxSuffixDirective
IgxLabelDirective, IgxHintDirective, IGX_INPUT_GROUP_TYPE, IgxSuffixDirective
} from '../input-group/public_api';
import {
AutoPositionStrategy, IgxOverlayService, OverlayCancelableEventArgs, OverlayEventArgs,
Expand Down Expand Up @@ -407,6 +407,9 @@ export class IgxDateRangePickerComponent extends PickerBaseDirective
@ContentChild(IgxLabelDirective)
public label: IgxLabelDirective;

@ContentChild(IgxHintDirective)
public hint: IgxHintDirective;

@ContentChild(IgxPickerActionsDirective)
public pickerActions: IgxPickerActionsDirective;

Expand Down Expand Up @@ -537,7 +540,10 @@ export class IgxDateRangePickerComponent extends PickerBaseDirective

/** @hidden @internal */
public get separatorClass(): string {
return 'igx-date-range-picker__label';
const classes = ['igx-date-range-picker__label'];
if (this.label) classes.push('input-has-label');
if (this.hint) classes.push('input-has-hint');
return classes.join(' ');
}

protected override get toggleContainer(): HTMLElement | undefined {
Expand Down
4 changes: 3 additions & 1 deletion src/app/date-range/date-range.sample.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ <h6>Angular Date Range Picker, two inputs, template-driven form</h6>
type="text"
[placeholder]="properties.placeholder"
/>
<igx-hint>Helper text</igx-hint>
@if (properties.hint) {
<span igxHint>{{ properties.hint }}</span>
}
</igx-date-range-start>
<igx-date-range-end>
<igx-picker-toggle igxPrefix>
Expand Down
6 changes: 6 additions & 0 deletions src/app/date-range/date-range.sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ export class DateRangeSampleComponent {
defaultValue: 'MM/dd/yyyy'
}
},
hint: {
label: 'Hint Text',
control: {
type: 'text'
}
},
displayFormat: {
label: 'Display Format',
control: {
Expand Down
Loading