Skip to content

Commit

Permalink
Merge pull request #277 from thekhegay/feat-select
Browse files Browse the repository at this point in the history
feat: wr-select component
  • Loading branch information
thekhegay authored Jan 28, 2025
2 parents 2544420 + 8f9eefd commit f59a4ca
Show file tree
Hide file tree
Showing 95 changed files with 1,555 additions and 359 deletions.
5 changes: 3 additions & 2 deletions projects/lib/alert/alert.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from '@angular/core';

import { SafeAny } from 'ngwr/cdk/types';
import { provideWrIcons, close, WrIconModule } from 'ngwr/icon';
import { provideWrIcons, close, WrIconComponent } from 'ngwr/icon';

import { WrAlertType } from './alert-type';

Expand All @@ -31,8 +31,9 @@ import { WrAlertType } from './alert-type';
templateUrl: './alert.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
imports: [WrIconModule],
imports: [WrIconComponent],
providers: [provideWrIcons([close])],
standalone: true,
})
export class WrAlertComponent {
@Input({ required: true }) title!: string;
Expand Down
16 changes: 0 additions & 16 deletions projects/lib/alert/alert.module.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/lib/alert/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@

export * from './alert-type';
export * from './alert.component';
export * from './alert.module';
6 changes: 4 additions & 2 deletions projects/lib/avatar/avatar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ import {
} from '@angular/core';

import { SafeAny } from 'ngwr/cdk/types';
import { WrSpinnerModule } from 'ngwr/spinner';

import { WrSpinnerComponent } from '../spinner';

@Component({
selector: 'wr-avatar',
templateUrl: './avatar.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
imports: [NgOptimizedImage, WrSpinnerModule],
imports: [NgOptimizedImage, WrSpinnerComponent],
standalone: true,
})
export class WrAvatarComponent {
readonly cdr = inject(ChangeDetectorRef);
Expand Down
16 changes: 0 additions & 16 deletions projects/lib/avatar/avatar.module.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/lib/avatar/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
*/

export * from './avatar.component';
export * from './avatar.module';
6 changes: 4 additions & 2 deletions projects/lib/button/button.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {

import { SafeAny, WrThemeColor } from 'ngwr/cdk/types';
import { WrIconComponent, wrIconName } from 'ngwr/icon';
import { WrSpinnerModule } from 'ngwr/spinner';

import { WrSpinnerComponent } from '../spinner';

/**
* NGWR button component.
Expand All @@ -29,7 +30,8 @@ import { WrSpinnerModule } from 'ngwr/spinner';
templateUrl: './button.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
imports: [WrIconComponent, WrSpinnerModule],
imports: [WrIconComponent, WrSpinnerComponent],
standalone: true,
})
export class WrButtonComponent {
@Input() color?: WrThemeColor | null;
Expand Down
17 changes: 0 additions & 17 deletions projects/lib/button/button.module.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/lib/button/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@

export * from './button.component';
export * from './button-group.component';
export * from './button.module';
5 changes: 3 additions & 2 deletions projects/lib/cdk/base.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
*/

import { Directive, OnDestroy } from '@angular/core';
import { DestroyRef, Directive, inject, OnDestroy } from '@angular/core';

import { Subject } from 'rxjs';

@Directive({
standalone: true,
})
export abstract class WrAbstractBase implements OnDestroy {
protected readonly destroyed$: Subject<void> = new Subject<void>();
protected readonly destroyed$: Subject<void> = new Subject<void>(); // TODO Перейти на destroyRef$
protected readonly destroyRef$ = inject(DestroyRef);

ngOnDestroy(): void {
this.destroyed$.next();
Expand Down
1 change: 1 addition & 0 deletions projects/lib/checkbox/checkbox.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { WrIconComponent, wrIconName } from 'ngwr/icon';
multi: true,
},
],
standalone: true,
})
export class WrCheckboxComponent extends WrAbstractBase implements ControlValueAccessor {
@Input() id: string = generateRandomId();
Expand Down
16 changes: 0 additions & 16 deletions projects/lib/checkbox/checkbox.module.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/lib/checkbox/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
*/

export * from './checkbox.component';
export * from './checkbox.module';
1 change: 1 addition & 0 deletions projects/lib/dialog/dialog.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import { WrDialogOptions } from './dialog-options';
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
imports: [CdkPortalOutlet],
standalone: true,
})
export class WrDialogComponent extends WrDialogBaseDirective {
@ViewChild(CdkPortalOutlet, { static: true }) override portalOutlet!: CdkPortalOutlet;
Expand Down
14 changes: 1 addition & 13 deletions projects/lib/dialog/dialog.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,10 @@

import { NgModule } from '@angular/core';

import { WrDialogCloseDirective } from './dialog-close.directive';
import { WrDialogContentDirective } from './dialog-content.directive';
import { WrDialogFooterDirective } from './dialog-footer.directive';
import { WrDialogTitleDirective } from './dialog-title.directive';
import { WrDialogComponent } from './dialog.component';
import { WrDialogService } from './dialog.service';

@NgModule({
imports: [
WrDialogComponent,
WrDialogFooterDirective,
WrDialogContentDirective,
WrDialogCloseDirective,
WrDialogTitleDirective,
],
exports: [WrDialogCloseDirective, WrDialogFooterDirective, WrDialogContentDirective, WrDialogTitleDirective],
imports: [],
providers: [WrDialogService],
})
export class WrDialogModule {}
9 changes: 0 additions & 9 deletions projects/lib/divider/divider.module.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/lib/divider/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
*/

export * from './divider.component';
export * from './divider.module';
17 changes: 0 additions & 17 deletions projects/lib/form/form.module.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/lib/form/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@

export * from './form-error.component';
export * from './form-item.component';
export * from './form.module';
16 changes: 0 additions & 16 deletions projects/lib/icon/icon.module.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/lib/icon/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

export * from './icon.component';
export * from './icon.module';
export * from './icon.service';
export * from './icons';
export * from './provide-wr-icons';
5 changes: 3 additions & 2 deletions projects/lib/input/input.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { noop } from 'rxjs';

import { WrAbstractBase } from 'ngwr/cdk';
import { SafeAny } from 'ngwr/cdk/types';
import { provideWrIcons, eye, eyeOff, WrIconModule } from 'ngwr/icon';
import { provideWrIcons, eye, eyeOff, WrIconComponent } from 'ngwr/icon';

import { WrInputType } from './input-types';

Expand All @@ -34,11 +34,12 @@ import { WrInputType } from './input-types';
* {@tutorial} [How to use wr-alert]{@link http://ngwr.dev/docs/components/input}
*/
@Component({
standalone: true,
selector: 'wr-input',
templateUrl: './input.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None,
imports: [FormsModule, WrIconModule],
imports: [FormsModule, WrIconComponent],
providers: [
provideWrIcons([eye, eyeOff]),
{
Expand Down
15 changes: 0 additions & 15 deletions projects/lib/input/input.module.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/lib/input/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@

export * from './input-types';
export * from './input.component';
export * from './input.module';
3 changes: 3 additions & 0 deletions projects/lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
},
"./textarea/styles": {
"sass": "./textarea/styles/_index.scss"
},
"./select/styles": {
"sass": "./select/styles/_index.scss"
}
}
}
16 changes: 0 additions & 16 deletions projects/lib/pipes/pipes.module.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/lib/pipes/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
*/

export * from './new-array.pipe';
export * from './pipes.module';
16 changes: 0 additions & 16 deletions projects/lib/progress/progress.module.ts

This file was deleted.

1 change: 0 additions & 1 deletion projects/lib/progress/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
*/

export * from './progress.component';
export * from './progress.module';
1 change: 0 additions & 1 deletion projects/lib/qr/public-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
*/

export * from './qr.component';
export * from './qr.module';
16 changes: 0 additions & 16 deletions projects/lib/qr/qr.module.ts

This file was deleted.

8 changes: 8 additions & 0 deletions projects/lib/select/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/**
* @license
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE
*/

export * from './public-api';
Loading

0 comments on commit f59a4ca

Please sign in to comment.