Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@
padding: 0 8px;
cursor: pointer;
height: 34px;
border-radius: 6px;

&.extra-small {
height: 30px;
}

&.small {
height: 32px;
}

&.large {
height: 44px;
}

&.open {
background-color: $gray-2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import { MultiSelectJustify } from './multi-select-justify';
<div
class="trigger-content"
[style.justify-content]="this.justify"
[ngClass]="[this.triggerLabelDisplayMode, this.popoverOpen ? 'open' : '']"
[ngClass]="[this.triggerLabelDisplayMode, this.popoverOpen ? 'open' : '', this.size]"
#triggerContainer
>
<ht-icon *ngIf="this.icon" [icon]="this.icon" [size]="this.iconSize"></ht-icon>
Expand All @@ -63,7 +63,7 @@ import { MultiSelectJustify } from './multi-select-justify';
<span *ngIf="triggerValues.selectedItemsCount > 1" class="trigger-more-items"
>+{{ triggerValues.selectedItemsCount - 1 }}</span
>
<ht-icon class="trigger-icon" icon="${IconType.ChevronDown}" size="${IconSize.Small}"></ht-icon>
<ht-icon class="trigger-icon" icon="${IconType.ChevronDown}" [size]="this.iconSize"></ht-icon>
</div>
</ng-container>
</div>
Expand Down
1 change: 1 addition & 0 deletions projects/components/src/select/select-size.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export const enum SelectSize {
ExtraSmall = 'extra-small',
Small = 'small',
Medium = 'medium',
Large = 'large'
Expand Down
13 changes: 11 additions & 2 deletions projects/components/src/time-picker/time-picker.component.scss
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
@import 'mixins';

.time-picker {
@include disableable;
display: flex;

.time-selector {
@include body-1-medium($gray-7);
height: 32px;
border: 1px solid $gray-1;
background: $gray-1;
border-radius: 4px;

&.with-background {
border: 1px solid $gray-1;
background: $gray-1;
}

&.with-border {
border: 1px solid $color-border;
border-radius: 6px;
}
}
}

Expand Down
31 changes: 28 additions & 3 deletions projects/components/src/time-picker/time-picker.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { PredefinedTimeService } from '../time-range/predefined-time.service';
styleUrls: ['./time-picker.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
template: `
<div class="time-picker">
<ht-popover class="time-selector" [closeOnClick]="true">
<div class="time-picker" [ngClass]="{ disabled: this.disabled }">
<ht-popover class="time-selector" [disabled]="this.disabled" [ngClass]="this.displayMode" [closeOnClick]="true">
<ht-popover-trigger>
<div class="popover-trigger" #popoverTrigger>
<ht-icon
Expand All @@ -20,7 +20,13 @@ import { PredefinedTimeService } from '../time-range/predefined-time.service';
*ngIf="this.showTimeTriggerIcon"
></ht-icon>
<ht-label class="trigger-label" *ngIf="this.time" [label]="this.time!.label"></ht-label>
<ht-icon class="trigger-caret" icon="${IconType.ChevronDown}" size="${IconSize.Small}"></ht-icon>
<ht-icon
class="trigger-caret"
icon="${IconType.ChevronDown}"
[size]="
this.iconSize === '${TimePickerIconSize.Regular}' ? '${IconSize.Small}' : '${IconSize.ExtraSmall}'
"
></ht-icon>
</div>
</ht-popover-trigger>
<ht-popover-content>
Expand All @@ -45,9 +51,18 @@ export class TimePickerComponent {
@Input()
public time?: Time;

@Input()
public iconSize?: TimePickerIconSize = TimePickerIconSize.Regular;

@Input()
public showTimeTriggerIcon?: boolean = false;

@Input()
public displayMode?: TimePickerDisplayMode = TimePickerDisplayMode.MenuWithBackground;

@Input()
public disabled: boolean = false;

@Output()
public readonly timeChange: EventEmitter<Time> = new EventEmitter();

Expand All @@ -67,3 +82,13 @@ export class TimePickerComponent {
this.timeChange.emit(time);
}
}

export const enum TimePickerDisplayMode {
MenuWithBorder = 'with-border',
MenuWithBackground = 'with-background'
}

export const enum TimePickerIconSize {
Small = 'small',
Regular = 'regular'
}