Skip to content

Commit 197402e

Browse files
committed
feat: m-overflow added
1 parent b239953 commit 197402e

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { computed, Directive, input } from '@angular/core';
2+
import { OverflowValue } from './overflow.types';
3+
4+
@Directive({
5+
selector: '[m-overflow]',
6+
host: {
7+
'[style.overflow]': 'overflow()',
8+
'[style.overflow-x]': 'overflowX()',
9+
'[style.overflow-y]': 'overflowY()',
10+
}
11+
})
12+
export class OverflowDirective {
13+
public static readonly default = {
14+
directive: OverflowDirective,
15+
inputs: ['m-overflow', 'm-overflow-x', 'm-overflow-y']
16+
};
17+
18+
public readonly mOverflow = input<OverflowValue | '' | undefined>(undefined, { alias: 'm-overflow' });
19+
public readonly overflowX = input<OverflowValue | undefined>(undefined, { alias: 'm-overflow-x' });
20+
public readonly overflowY = input<OverflowValue | undefined>(undefined, { alias: 'm-overflow-y' });
21+
public readonly overflow = computed(() => this.mOverflow() || undefined);
22+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export type OverflowValue = 'visible' | 'hidden' | 'clip' | 'scroll' | 'auto';

projects/mantic-ui/src/public-api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ export * from './lib/components/flex/shrink/shrink.directive';
5757
export * from './lib/components/flex/grow/grow.component';
5858
export * from './lib/components/flex/grow/grow.directive';
5959
export * from './lib/components/flex/flex.types';
60+
export * from './lib/components/overflow/overflow.directive';
61+
export * from './lib/components/overflow/overflow.types';
6062
export * from './lib/components/footer/footer.component';
6163
export * from './lib/components/footer-link/footer-link.component';
6264
export * from './lib/components/form/form.component';

0 commit comments

Comments
 (0)