mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
ACS-7390: Core and Content Services as Standalone components (#10001)
This commit is contained in:
@@ -18,7 +18,8 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-blank-page',
|
||||
template: ``
|
||||
selector: 'adf-blank-page',
|
||||
standalone: true,
|
||||
template: ``
|
||||
})
|
||||
export class BlankPageComponent {}
|
||||
|
@@ -19,13 +19,9 @@ import { NgModule } from '@angular/core';
|
||||
|
||||
import { BlankPageComponent } from './blank-page.component';
|
||||
|
||||
/** @deprecated import standalone `BlankPageComponent` instead */
|
||||
@NgModule({
|
||||
declarations: [
|
||||
BlankPageComponent
|
||||
],
|
||||
exports: [
|
||||
BlankPageComponent
|
||||
]
|
||||
imports: [BlankPageComponent],
|
||||
exports: [BlankPageComponent]
|
||||
})
|
||||
export class BlankPageModule {
|
||||
}
|
||||
export class BlankPageModule {}
|
||||
|
@@ -15,24 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { MatChipsModule } from '@angular/material/chips';
|
||||
import { MatNativeDateModule } from '@angular/material/core';
|
||||
import { MatDatepickerModule } from '@angular/material/datepicker';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { MatDatetimepickerModule, MatNativeDatetimeModule } from '@mat-datetimepicker/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { CardViewComponent } from './components/card-view/card-view.component';
|
||||
import { CardViewBoolItemComponent } from './components/card-view-boolitem/card-view-boolitem.component';
|
||||
import { CardViewDateItemComponent } from './components/card-view-dateitem/card-view-dateitem.component';
|
||||
@@ -44,49 +27,22 @@ import { CardViewSelectItemComponent } from './components/card-view-selectitem/c
|
||||
import { CardViewArrayItemComponent } from './components/card-view-arrayitem/card-view-arrayitem.component';
|
||||
import { SelectFilterInputComponent } from './components/card-view-selectitem/select-filter-input/select-filter-input.component';
|
||||
|
||||
export const CARD_VIEW_DIRECTIVES = [
|
||||
CardViewComponent,
|
||||
CardViewBoolItemComponent,
|
||||
CardViewDateItemComponent,
|
||||
CardViewMapItemComponent,
|
||||
CardViewTextItemComponent,
|
||||
CardViewKeyValuePairsItemComponent,
|
||||
CardViewSelectItemComponent,
|
||||
CardViewItemDispatcherComponent,
|
||||
CardViewArrayItemComponent,
|
||||
SelectFilterInputComponent
|
||||
] as const;
|
||||
|
||||
/** @deprecated use `...CARD_VIEW_DIRECTIVES` or import standalone components directly */
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
TranslateModule,
|
||||
MatDatepickerModule,
|
||||
MatNativeDateModule,
|
||||
MatCheckboxModule,
|
||||
MatInputModule,
|
||||
MatTableModule,
|
||||
MatIconModule,
|
||||
MatSelectModule,
|
||||
MatButtonModule,
|
||||
MatChipsModule,
|
||||
MatMenuModule,
|
||||
MatCardModule,
|
||||
MatDatetimepickerModule,
|
||||
MatNativeDatetimeModule,
|
||||
MatSlideToggleModule
|
||||
],
|
||||
declarations: [
|
||||
CardViewComponent,
|
||||
CardViewBoolItemComponent,
|
||||
CardViewDateItemComponent,
|
||||
CardViewMapItemComponent,
|
||||
CardViewTextItemComponent,
|
||||
CardViewKeyValuePairsItemComponent,
|
||||
CardViewSelectItemComponent,
|
||||
CardViewItemDispatcherComponent,
|
||||
CardViewArrayItemComponent,
|
||||
SelectFilterInputComponent
|
||||
],
|
||||
exports: [
|
||||
CardViewComponent,
|
||||
CardViewBoolItemComponent,
|
||||
CardViewDateItemComponent,
|
||||
CardViewMapItemComponent,
|
||||
CardViewTextItemComponent,
|
||||
CardViewSelectItemComponent,
|
||||
CardViewKeyValuePairsItemComponent,
|
||||
CardViewArrayItemComponent,
|
||||
SelectFilterInputComponent
|
||||
]
|
||||
imports: [...CARD_VIEW_DIRECTIVES],
|
||||
exports: [...CARD_VIEW_DIRECTIVES]
|
||||
})
|
||||
export class CardViewModule {}
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CardViewArrayItemComponent } from './card-view-arrayitem.component';
|
||||
import { CoreStoryModule } from './../../../testing/core.story.module';
|
||||
import { CardViewArrayItemModel, CardViewModule } from '../../public-api';
|
||||
import { CardViewArrayItemModel, CARD_VIEW_DIRECTIVES } from '../../public-api';
|
||||
import { of } from 'rxjs';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
title: 'Core/Card View/Card View Array Item',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CardViewModule]
|
||||
imports: [...CARD_VIEW_DIRECTIVES]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
|
@@ -18,12 +18,21 @@
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { CardViewArrayItemModel } from '../../models/card-view-arrayitem.model';
|
||||
import { BaseCardView } from '../base-card-view';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatChipsModule } from '@angular/material/chips';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-card-view-arrayitem',
|
||||
templateUrl: './card-view-arrayitem.component.html',
|
||||
styleUrls: ['./card-view-arrayitem.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
selector: 'adf-card-view-arrayitem',
|
||||
standalone: true,
|
||||
imports: [CommonModule, MatChipsModule, TranslateModule, MatIconModule, MatMenuModule, MatCardModule, MatButtonModule],
|
||||
templateUrl: './card-view-arrayitem.component.html',
|
||||
styleUrls: ['./card-view-arrayitem.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class CardViewArrayItemComponent extends BaseCardView<CardViewArrayItemModel> {
|
||||
clicked(): void {
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CardViewBoolItemComponent } from './card-view-boolitem.component';
|
||||
import { CoreStoryModule } from './../../../testing/core.story.module';
|
||||
import { CardViewBoolItemModel, CardViewModule } from '../../public-api';
|
||||
import { CardViewBoolItemModel, CARD_VIEW_DIRECTIVES } from '../../public-api';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
export default {
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
title: 'Core/Card View/Card View Bool Item',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CardViewModule]
|
||||
imports: [...CARD_VIEW_DIRECTIVES]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
|
@@ -16,28 +16,31 @@
|
||||
*/
|
||||
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { MatCheckboxChange } from '@angular/material/checkbox';
|
||||
import { MatCheckboxChange, MatCheckboxModule } from '@angular/material/checkbox';
|
||||
import { CardViewBoolItemModel } from '../../models/card-view-boolitem.model';
|
||||
import { BaseCardView } from '../base-card-view';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-card-view-boolitem',
|
||||
standalone: true,
|
||||
imports: [CommonModule, MatCheckboxModule, TranslateModule],
|
||||
templateUrl: './card-view-boolitem.component.html',
|
||||
styles: [
|
||||
`
|
||||
.adf-property-value {
|
||||
padding: 15px 0;
|
||||
}
|
||||
`
|
||||
.adf-property-value {
|
||||
padding: 15px 0;
|
||||
}
|
||||
`
|
||||
]
|
||||
})
|
||||
|
||||
export class CardViewBoolItemComponent extends BaseCardView<CardViewBoolItemModel> {
|
||||
@Input()
|
||||
editable: boolean;
|
||||
|
||||
changed(change: MatCheckboxChange) {
|
||||
this.cardViewUpdateService.update({ ...this.property } as CardViewBoolItemModel, change.checked );
|
||||
this.cardViewUpdateService.update({ ...this.property } as CardViewBoolItemModel, change.checked);
|
||||
this.property.value = change.checked;
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,6 @@
|
||||
*ngIf="showProperty"
|
||||
[attr.data-automation-id]="'card-dateitem-' + property.key"
|
||||
(dblclick)="copyToClipboard(property.displayValue)"
|
||||
matTooltipShowDelay="1000"
|
||||
[title]="'CORE.METADATA.ACTIONS.COPY_TO_CLIPBOARD' | translate"
|
||||
>{{ property.displayValue }}</span
|
||||
>
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CardViewDateItemComponent } from './card-view-dateitem.component';
|
||||
import { CoreStoryModule } from './../../../testing/core.story.module';
|
||||
import { CardViewDateItemModel, CardViewDatetimeItemModel, CardViewModule } from '../../public-api';
|
||||
import { CardViewDateItemModel, CardViewDatetimeItemModel, CARD_VIEW_DIRECTIVES } from '../../public-api';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
export default {
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
title: 'Core/Card View/Card View Date Item',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CardViewModule]
|
||||
imports: [...CARD_VIEW_DIRECTIVES]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
|
@@ -17,7 +17,13 @@
|
||||
|
||||
import { Component, Input, OnDestroy, OnInit, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core';
|
||||
import { DatetimeAdapter, MAT_DATETIME_FORMATS, MatDatetimepickerComponent, MatDatetimepickerInputEvent } from '@mat-datetimepicker/core';
|
||||
import {
|
||||
DatetimeAdapter,
|
||||
MAT_DATETIME_FORMATS,
|
||||
MatDatetimepickerComponent,
|
||||
MatDatetimepickerInputEvent,
|
||||
MatDatetimepickerModule
|
||||
} from '@mat-datetimepicker/core';
|
||||
import { CardViewDateItemModel } from '../../models/card-view-dateitem.model';
|
||||
import { UserPreferencesService, UserPreferenceValues } from '../../../common/services/user-preferences.service';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
@@ -28,6 +34,11 @@ import { ADF_DATE_FORMATS, AdfDateFnsAdapter } from '../../../common/utils/date-
|
||||
import { ADF_DATETIME_FORMATS, AdfDateTimeFnsAdapter } from '../../../common/utils/datetime-fns-adapter';
|
||||
import { isValid } from 'date-fns';
|
||||
import { DateFnsUtils } from '../../../common/utils/date-fns-utils';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatChipsModule } from '@angular/material/chips';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
|
||||
@Component({
|
||||
providers: [
|
||||
@@ -37,6 +48,8 @@ import { DateFnsUtils } from '../../../common/utils/date-fns-utils';
|
||||
{ provide: DatetimeAdapter, useClass: AdfDateTimeFnsAdapter }
|
||||
],
|
||||
selector: 'adf-card-view-dateitem',
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslateModule, MatIconModule, MatDatetimepickerModule, MatChipsModule, MatFormFieldModule],
|
||||
templateUrl: './card-view-dateitem.component.html',
|
||||
styleUrls: ['./card-view-dateitem.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
@@ -102,7 +115,7 @@ export class CardViewDateItemComponent extends BaseCardView<CardViewDateItemMode
|
||||
this.property.value = new Date(event.value);
|
||||
this.valueDate = new Date(event.value);
|
||||
if (this.property.type === 'date') {
|
||||
this.property.value = DateFnsUtils.forceUtc(event.value);
|
||||
this.property.value = DateFnsUtils.forceUtc(event.value);
|
||||
this.valueDate = DateFnsUtils.forceLocal(event.value);
|
||||
}
|
||||
this.update();
|
||||
@@ -162,9 +175,7 @@ export class CardViewDateItemComponent extends BaseCardView<CardViewDateItemMode
|
||||
}
|
||||
if (Array.isArray(this.property.value) && this.property.value.length > 0) {
|
||||
this.property.value = this.property.value.map((date: Date | string) => new Date(date));
|
||||
this.valueDate = this.property.type === 'date'
|
||||
? DateFnsUtils.forceLocal(this.property.value[0])
|
||||
: this.property.value[0];
|
||||
this.valueDate = this.property.type === 'date' ? DateFnsUtils.forceLocal(this.property.value[0]) : this.property.value[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -26,6 +26,7 @@ import { CardViewItemDispatcherComponent } from './card-view-item-dispatcher.com
|
||||
|
||||
@Component({
|
||||
selector: 'whatever-you-want-to-have',
|
||||
standalone: true,
|
||||
template: '<div data-automation-id="found-me">Hey I am shiny!</div>'
|
||||
})
|
||||
export class CardViewShinyCustomElementItemComponent {
|
||||
@@ -43,7 +44,7 @@ describe('CardViewItemDispatcherComponent', () => {
|
||||
cardItemTypeService.setComponentTypeResolver('shiny-custom-element', () => CardViewShinyCustomElementItemComponent);
|
||||
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [CardViewItemDispatcherComponent, CardViewShinyCustomElementItemComponent],
|
||||
imports: [CardViewItemDispatcherComponent, CardViewShinyCustomElementItemComponent],
|
||||
providers: [{ provide: CardItemTypeService, useValue: cardItemTypeService }]
|
||||
});
|
||||
|
||||
|
@@ -22,6 +22,7 @@ import { DEFAULT_SEPARATOR } from '../card-view-textitem/card-view-textitem.comp
|
||||
|
||||
@Component({
|
||||
selector: 'adf-card-view-item-dispatcher',
|
||||
standalone: true,
|
||||
template: '<ng-template #content></ng-template>'
|
||||
})
|
||||
export class CardViewItemDispatcherComponent implements OnChanges {
|
||||
|
@@ -21,10 +21,7 @@ import { CardViewKeyValuePairsItemModel } from '../../models/card-view-keyvaluep
|
||||
import { CardViewKeyValuePairsItemComponent } from './card-view-keyvaluepairsitem.component';
|
||||
import { CardViewUpdateService } from '../../services/card-view-update.service';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatTableModule } from '@angular/material/table';
|
||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
describe('CardViewKeyValuePairsItemComponent', () => {
|
||||
let fixture: ComponentFixture<CardViewKeyValuePairsItemComponent>;
|
||||
@@ -35,9 +32,8 @@ describe('CardViewKeyValuePairsItemComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule, TranslateModule.forRoot(), MatIconModule, MatTableModule, FormsModule],
|
||||
providers: [CardViewUpdateService],
|
||||
declarations: [CardViewKeyValuePairsItemComponent]
|
||||
imports: [NoopAnimationsModule, TranslateModule.forRoot(), CardViewKeyValuePairsItemComponent],
|
||||
providers: [CardViewUpdateService]
|
||||
});
|
||||
fixture = TestBed.createComponent(CardViewKeyValuePairsItemComponent);
|
||||
cardViewUpdateService = TestBed.inject(CardViewUpdateService);
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CardViewKeyValuePairsItemComponent } from './card-view-keyvaluepairsitem.component';
|
||||
import { CoreStoryModule } from './../../../testing/core.story.module';
|
||||
import { CardViewModule, CardViewKeyValuePairsItemModel } from '../../public-api';
|
||||
import { CARD_VIEW_DIRECTIVES, CardViewKeyValuePairsItemModel } from '../../public-api';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
export default {
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
title: 'Core/Card View/Card View Key Value Pairs Item',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CoreStoryModule, CardViewModule]
|
||||
imports: [CoreStoryModule, ...CARD_VIEW_DIRECTIVES]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
|
@@ -18,17 +18,24 @@
|
||||
import { Component, OnChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { CardViewKeyValuePairsItemModel } from '../../models/card-view.models';
|
||||
import { CardViewKeyValuePairsItemType } from '../../interfaces/card-view.interfaces';
|
||||
import { MatTableDataSource } from '@angular/material/table';
|
||||
import { MatTableDataSource, MatTableModule } from '@angular/material/table';
|
||||
import { BaseCardView } from '../base-card-view';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-card-view-key-value-pairs-item',
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslateModule, MatTableModule, MatInputModule, FormsModule, MatButtonModule, MatIconModule],
|
||||
templateUrl: './card-view-keyvaluepairsitem.component.html',
|
||||
styleUrls: ['./card-view-keyvaluepairsitem.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
host: { class: 'adf-card-view-key-value-pairs-item' }
|
||||
})
|
||||
|
||||
export class CardViewKeyValuePairsItemComponent extends BaseCardView<CardViewKeyValuePairsItemModel> implements OnChanges {
|
||||
values: CardViewKeyValuePairsItemType[];
|
||||
matTableValues: MatTableDataSource<CardViewKeyValuePairsItemType>;
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CardViewMapItemComponent } from './card-view-mapitem.component';
|
||||
import { CoreStoryModule } from './../../../testing/core.story.module';
|
||||
import { CardViewMapItemModel, CardViewModule } from '../../public-api';
|
||||
import { CardViewMapItemModel, CARD_VIEW_DIRECTIVES } from '../../public-api';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
export default {
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
title: 'Core/Card View/Card View Map Item',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CardViewModule]
|
||||
imports: [...CARD_VIEW_DIRECTIVES]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
|
@@ -18,13 +18,16 @@
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { CardViewMapItemModel } from '../../models/card-view-mapitem.model';
|
||||
import { BaseCardView } from '../base-card-view';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-card-view-mapitem',
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslateModule],
|
||||
templateUrl: './card-view-mapitem.component.html',
|
||||
styleUrls: ['./card-view-mapitem.component.scss']
|
||||
})
|
||||
|
||||
export class CardViewMapItemComponent extends BaseCardView<CardViewMapItemModel> {
|
||||
@Input()
|
||||
displayEmpty: boolean = true;
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CardViewSelectItemComponent } from './card-view-selectitem.component';
|
||||
import { CoreStoryModule } from './../../../testing/core.story.module';
|
||||
import { CardViewSelectItemModel, CardViewModule } from '../../public-api';
|
||||
import { CardViewSelectItemModel, CARD_VIEW_DIRECTIVES } from '../../public-api';
|
||||
import { of } from 'rxjs';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
title: 'Core/Card View/Card View Select Item',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CardViewModule]
|
||||
imports: [...CARD_VIEW_DIRECTIVES]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
@@ -52,8 +52,7 @@ export default {
|
||||
},
|
||||
displayEmpty: {
|
||||
control: 'boolean',
|
||||
description:
|
||||
'Defines if it should display CardView item when data is empty',
|
||||
description: 'Defines if it should display CardView item when data is empty',
|
||||
table: {
|
||||
type: { summary: 'boolean' },
|
||||
defaultValue: { summary: 'true' }
|
||||
|
@@ -19,13 +19,19 @@ import { Component, Input, OnChanges, OnDestroy, OnInit, inject, ViewEncapsulati
|
||||
import { CardViewSelectItemModel } from '../../models/card-view-selectitem.model';
|
||||
import { BehaviorSubject, combineLatest, Observable } from 'rxjs';
|
||||
import { CardViewSelectItemOption } from '../../interfaces/card-view.interfaces';
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
import { MatSelectChange, MatSelectModule } from '@angular/material/select';
|
||||
import { BaseCardView } from '../base-card-view';
|
||||
import { AppConfigService } from '../../../app-config/app-config.service';
|
||||
import { takeUntil, map } from 'rxjs/operators';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { SelectFilterInputComponent } from './select-filter-input/select-filter-input.component';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-card-view-selectitem',
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslateModule, MatFormFieldModule, MatSelectModule, SelectFilterInputComponent],
|
||||
templateUrl: './card-view-selectitem.component.html',
|
||||
styleUrls: ['./card-view-selectitem.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
@@ -71,13 +77,10 @@ export class CardViewSelectItemComponent extends BaseCardView<CardViewSelectItem
|
||||
}
|
||||
|
||||
getList(): Observable<CardViewSelectItemOption<string | number>[]> {
|
||||
return combineLatest([this.getOptions(), this.filter$])
|
||||
.pipe(
|
||||
map(([items, filter]) => items.filter((item) =>
|
||||
filter ? item.label.toLowerCase().includes(filter.toLowerCase())
|
||||
: true)),
|
||||
takeUntil(this.destroy$)
|
||||
);
|
||||
return combineLatest([this.getOptions(), this.filter$]).pipe(
|
||||
map(([items, filter]) => items.filter((item) => (filter ? item.label.toLowerCase().includes(filter.toLowerCase()) : true))),
|
||||
takeUntil(this.destroy$)
|
||||
);
|
||||
}
|
||||
|
||||
onChange(event: MatSelectChange): void {
|
||||
|
@@ -19,9 +19,18 @@ import { Component, ViewEncapsulation, ViewChild, ElementRef, OnDestroy, Inject,
|
||||
import { MatSelect } from '@angular/material/select';
|
||||
import { Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-select-filter-input',
|
||||
standalone: true,
|
||||
imports: [CommonModule, MatFormFieldModule, MatInputModule, FormsModule, MatButtonModule, MatIconModule, TranslateModule],
|
||||
templateUrl: './select-filter-input.component.html',
|
||||
styleUrls: ['./select-filter-input.component.scss'],
|
||||
host: { class: 'adf-select-filter-input' },
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CardViewTextItemComponent } from './card-view-textitem.component';
|
||||
import { CoreStoryModule } from './../../../testing/core.story.module';
|
||||
import { CardViewModule, CardViewTextItemModel } from '../../public-api';
|
||||
import { CARD_VIEW_DIRECTIVES, CardViewTextItemModel } from '../../public-api';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
export default {
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
title: 'Core/Card View/Card View Text Item',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CardViewModule]
|
||||
imports: [...CARD_VIEW_DIRECTIVES]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
@@ -43,8 +43,7 @@ export default {
|
||||
},
|
||||
displayEmpty: {
|
||||
control: 'boolean',
|
||||
description:
|
||||
'Defines if it should display CardView item when data is empty',
|
||||
description: 'Defines if it should display CardView item when data is empty',
|
||||
table: {
|
||||
type: { summary: 'boolean' },
|
||||
defaultValue: { summary: 'true' }
|
||||
@@ -90,7 +89,6 @@ export default {
|
||||
useChipsForMultiValueProperty: true,
|
||||
multiValueSeparator: ', ',
|
||||
displayLabelForChips: false
|
||||
|
||||
}
|
||||
} as Meta<CardViewTextItemComponent>;
|
||||
|
||||
|
@@ -18,12 +18,18 @@
|
||||
import { ChangeDetectorRef, Component, Input, OnChanges, OnDestroy, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { CardViewTextItemModel } from '../../models/card-view-textitem.model';
|
||||
import { BaseCardView } from '../base-card-view';
|
||||
import { MatChipInputEvent } from '@angular/material/chips';
|
||||
import { MatChipInputEvent, MatChipsModule } from '@angular/material/chips';
|
||||
import { ClipboardService } from '../../../clipboard/clipboard.service';
|
||||
import { TranslationService } from '../../../translation/translation.service';
|
||||
import { CardViewItemValidator } from '../../interfaces/card-view-item-validator.interface';
|
||||
import { UntypedFormControl } from '@angular/forms';
|
||||
import { FormsModule, ReactiveFormsModule, UntypedFormControl } from '@angular/forms';
|
||||
import { debounceTime, takeUntil, filter } from 'rxjs/operators';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
|
||||
export const DEFAULT_SEPARATOR = ', ';
|
||||
const templateTypes = {
|
||||
@@ -36,6 +42,18 @@ const templateTypes = {
|
||||
|
||||
@Component({
|
||||
selector: 'adf-card-view-textitem',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule,
|
||||
MatFormFieldModule,
|
||||
TranslateModule,
|
||||
MatInputModule,
|
||||
ReactiveFormsModule,
|
||||
MatChipsModule,
|
||||
MatIconModule,
|
||||
FormsModule,
|
||||
MatButtonModule
|
||||
],
|
||||
templateUrl: './card-view-textitem.component.html',
|
||||
styleUrls: ['./card-view-textitem.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
|
@@ -54,7 +54,8 @@ describe('CardViewComponent', () => {
|
||||
MatDialogModule,
|
||||
MatDatepickerModule,
|
||||
MatSelectModule,
|
||||
HttpClientTestingModule
|
||||
HttpClientTestingModule,
|
||||
CardViewComponent
|
||||
],
|
||||
providers: [{ provide: TranslationService, useClass: TranslationMock }]
|
||||
}).compileComponents();
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CardViewComponent } from './card-view.component';
|
||||
import { CoreStoryModule } from './../../../testing/core.story.module';
|
||||
import { CardViewModule } from '../../public-api';
|
||||
import { CARD_VIEW_DIRECTIVES } from '../../public-api';
|
||||
import { cardViewDataSource, cardViewUndefinedValues } from '../../mock/card-view-content.mock';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
title: 'Core/Card View/Card View',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CoreStoryModule, CardViewModule]
|
||||
imports: [CoreStoryModule, ...CARD_VIEW_DIRECTIVES]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
|
@@ -18,9 +18,13 @@
|
||||
import { Component, Input, ViewEncapsulation } from '@angular/core';
|
||||
import { CardViewItem } from '../../interfaces/card-view-item.interface';
|
||||
import { DEFAULT_SEPARATOR } from '../card-view-textitem/card-view-textitem.component';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { CardViewItemDispatcherComponent } from '../card-view-item-dispatcher/card-view-item-dispatcher.component';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-card-view',
|
||||
standalone: true,
|
||||
imports: [CommonModule, CardViewItemDispatcherComponent],
|
||||
templateUrl: './card-view.component.html',
|
||||
styleUrls: ['./card-view.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
@@ -28,7 +32,7 @@ import { DEFAULT_SEPARATOR } from '../card-view-textitem/card-view-textitem.comp
|
||||
export class CardViewComponent {
|
||||
/** (**required**) Items to show in the card view. */
|
||||
@Input()
|
||||
properties: CardViewItem [];
|
||||
properties: CardViewItem[];
|
||||
|
||||
/** Toggles whether or not the items can be edited. */
|
||||
@Input()
|
||||
|
@@ -33,3 +33,4 @@ export * from './validators/card-view.validators';
|
||||
export * from './models/card-view.models';
|
||||
export * from './services/card-view.services';
|
||||
export * from './card-view.module';
|
||||
export * from './components/card-view-item-dispatcher/card-view-item-dispatcher.component';
|
||||
|
@@ -42,9 +42,9 @@ describe('ClipboardDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule, MatSnackBarModule, MatButtonModule],
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule, MatSnackBarModule, MatButtonModule, ClipboardDirective],
|
||||
providers: [ClipboardService, { provide: TranslationService, useClass: TranslationMock }],
|
||||
declarations: [TestTargetClipboardComponent, ClipboardDirective]
|
||||
declarations: [TestTargetClipboardComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestTargetClipboardComponent);
|
||||
clipboardService = TestBed.inject(ClipboardService);
|
||||
@@ -86,9 +86,9 @@ describe('CopyClipboardDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule, MatSnackBarModule],
|
||||
imports: [TranslateModule.forRoot(), HttpClientTestingModule, MatSnackBarModule, ClipboardDirective],
|
||||
providers: [ClipboardService, { provide: TranslationService, useClass: TranslationMock }],
|
||||
declarations: [TestCopyClipboardComponent, ClipboardDirective]
|
||||
declarations: [TestCopyClipboardComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestCopyClipboardComponent);
|
||||
element = fixture.debugElement.nativeElement;
|
||||
|
@@ -17,9 +17,11 @@
|
||||
|
||||
import { Directive, Input, HostListener, Component, ViewContainerRef, ViewEncapsulation, OnInit } from '@angular/core';
|
||||
import { ClipboardService } from './clipboard.service';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@Directive({
|
||||
selector: '[adf-clipboard]',
|
||||
standalone: true,
|
||||
exportAs: 'adfClipboard'
|
||||
})
|
||||
export class ClipboardDirective {
|
||||
@@ -73,6 +75,8 @@ export class ClipboardDirective {
|
||||
|
||||
@Component({
|
||||
selector: 'adf-copy-content-tooltip',
|
||||
standalone: true,
|
||||
imports: [TranslateModule],
|
||||
template: `<span class="adf-copy-tooltip">{{ placeholder | translate }} </span>`,
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
|
@@ -15,23 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { ClipboardDirective, ClipboardComponent } from './clipboard.directive';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
export const CLIPBOARD_DIRECTIVES = [ClipboardDirective, ClipboardComponent] as const;
|
||||
|
||||
/** @deprecated use `...CLIPBOARD_DIRECTIVES` or import standalone directives */
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
TranslateModule
|
||||
],
|
||||
declarations: [
|
||||
ClipboardDirective,
|
||||
ClipboardComponent
|
||||
],
|
||||
exports: [
|
||||
ClipboardDirective
|
||||
]
|
||||
imports: [...CLIPBOARD_DIRECTIVES],
|
||||
exports: [...CLIPBOARD_DIRECTIVES]
|
||||
})
|
||||
|
||||
export class ClipboardModule {}
|
||||
|
@@ -21,7 +21,6 @@ import { CommentListComponent } from './comment-list.component';
|
||||
import { commentsTaskData, commentsNodeData } from '../mocks/comments.stories.mock';
|
||||
import { CommentListServiceMock } from './mocks/comment-list.service.mock';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
import { CommentListModule } from './comment-list.module';
|
||||
import { CommentsServiceStoriesMock } from '../mocks/comments.service.stories.mock';
|
||||
import { ADF_COMMENTS_SERVICE } from '../interfaces/comments.token';
|
||||
|
||||
@@ -30,7 +29,7 @@ export default {
|
||||
title: 'Core/Comments/Comment List',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CommentListModule],
|
||||
imports: [CommentListComponent],
|
||||
providers: [
|
||||
{ provide: CommentListServiceMock, useValue: { getUserProfileImage: () => '../assets/images/logo.png' } },
|
||||
{ provide: ADF_COMMENTS_SERVICE, useClass: CommentsServiceStoriesMock }
|
||||
|
@@ -19,9 +19,16 @@ import { Component, EventEmitter, Input, Output, ViewEncapsulation, inject } fro
|
||||
import { CommentModel } from '../../models/comment.model';
|
||||
import { CommentsService } from '../interfaces/comments-service.interface';
|
||||
import { ADF_COMMENTS_SERVICE } from '../interfaces/comments.token';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatListModule } from '@angular/material/list';
|
||||
import { MatLineModule } from '@angular/material/core';
|
||||
import { TimeAgoPipe } from '../../pipes';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-comment-list',
|
||||
standalone: true,
|
||||
imports: [CommonModule, MatListModule, MatLineModule, TimeAgoPipe, TranslateModule],
|
||||
templateUrl: './comment-list.component.html',
|
||||
styleUrls: ['./comment-list.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
|
@@ -15,34 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatListModule } from '@angular/material/list';
|
||||
import { MatLineModule } from '@angular/material/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { PipeModule } from '../../pipes/pipe.module';
|
||||
|
||||
import { CommentListComponent } from './comment-list.component';
|
||||
import { TimeAgoPipe } from '../../pipes';
|
||||
|
||||
/** @deprecated import `CommentListComponent` standalone component directly */
|
||||
@NgModule({
|
||||
imports: [
|
||||
PipeModule,
|
||||
FormsModule,
|
||||
CommonModule,
|
||||
TranslateModule,
|
||||
MatButtonModule,
|
||||
MatFormFieldModule,
|
||||
MatInputModule,
|
||||
MatListModule,
|
||||
MatLineModule,
|
||||
TimeAgoPipe
|
||||
],
|
||||
declarations: [CommentListComponent],
|
||||
imports: [CommentListComponent],
|
||||
exports: [CommentListComponent]
|
||||
})
|
||||
export class CommentListModule {}
|
||||
|
@@ -35,7 +35,7 @@ describe('CommentsComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [NoopAnimationsModule, HttpClientTestingModule, TranslateModule.forRoot()],
|
||||
imports: [NoopAnimationsModule, HttpClientTestingModule, TranslateModule.forRoot(), CommentsComponent],
|
||||
providers: [
|
||||
{
|
||||
provide: ADF_COMMENTS_SERVICE,
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CoreStoryModule } from '../testing/core.story.module';
|
||||
import { CommentsComponent } from './comments.component';
|
||||
import { CommentsModule } from './comments.module';
|
||||
import { ADF_COMMENTS_SERVICE } from './interfaces/comments.token';
|
||||
import { commentsStoriesData } from './mocks/comments.stories.mock';
|
||||
import { CommentsServiceStoriesMock } from './mocks/comments.service.stories.mock';
|
||||
@@ -29,7 +28,7 @@ export default {
|
||||
title: 'Core/Comments/Comment',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CommentsModule],
|
||||
imports: [CommentsComponent],
|
||||
providers: [
|
||||
{ provide: CommentsServiceStoriesMock, useValue: { getUserProfileImage: () => '../assets/images/logo.png' } },
|
||||
{ provide: ADF_COMMENTS_SERVICE, useClass: CommentsServiceStoriesMock }
|
||||
|
@@ -16,27 +16,26 @@
|
||||
*/
|
||||
|
||||
import { CommentModel } from '../models/comment.model';
|
||||
import {
|
||||
Component,
|
||||
EventEmitter,
|
||||
inject,
|
||||
Input,
|
||||
OnChanges,
|
||||
Output,
|
||||
SimpleChanges,
|
||||
ViewEncapsulation
|
||||
} from '@angular/core';
|
||||
import { Component, EventEmitter, inject, Input, OnChanges, Output, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { ADF_COMMENTS_SERVICE } from './interfaces/comments.token';
|
||||
import { CommentsService } from './interfaces/comments-service.interface';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { CommentListComponent } from './comment-list';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-comments',
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslateModule, MatFormFieldModule, MatInputModule, FormsModule, MatButtonModule, CommentListComponent],
|
||||
templateUrl: './comments.component.html',
|
||||
styleUrls: ['./comments.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class CommentsComponent implements OnChanges {
|
||||
|
||||
/** The numeric ID of the task. */
|
||||
@Input()
|
||||
id: string;
|
||||
@@ -96,19 +95,18 @@ export class CommentsComponent implements OnChanges {
|
||||
|
||||
this.beingAdded = true;
|
||||
|
||||
this.commentsService.add(this.id, this.message)
|
||||
.subscribe(
|
||||
(res: CommentModel) => {
|
||||
this.addToComments(res);
|
||||
this.resetMessage();
|
||||
},
|
||||
(err) => {
|
||||
this.error.emit(err);
|
||||
},
|
||||
() => {
|
||||
this.beingAdded = false;
|
||||
}
|
||||
);
|
||||
this.commentsService.add(this.id, this.message).subscribe(
|
||||
(res: CommentModel) => {
|
||||
this.addToComments(res);
|
||||
this.resetMessage();
|
||||
},
|
||||
(err) => {
|
||||
this.error.emit(err);
|
||||
},
|
||||
() => {
|
||||
this.beingAdded = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
clearMessage(event: Event): void {
|
||||
|
@@ -15,39 +15,12 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatListModule } from '@angular/material/list';
|
||||
import { MatLineModule } from '@angular/material/core';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { PipeModule } from '../pipes/pipe.module';
|
||||
import { CommentListModule } from './comment-list/comment-list.module';
|
||||
|
||||
import { CommentsComponent } from './comments.component';
|
||||
|
||||
/** @deprecated import standalone `CommentsComponent` directly */
|
||||
@NgModule({
|
||||
imports: [
|
||||
PipeModule,
|
||||
FormsModule,
|
||||
CommonModule,
|
||||
TranslateModule,
|
||||
MatButtonModule,
|
||||
MatFormFieldModule,
|
||||
MatInputModule,
|
||||
MatListModule,
|
||||
MatLineModule,
|
||||
CommentListModule
|
||||
],
|
||||
declarations: [
|
||||
CommentsComponent
|
||||
],
|
||||
exports: [
|
||||
CommentsComponent
|
||||
]
|
||||
imports: [CommentsComponent],
|
||||
exports: [CommentsComponent]
|
||||
})
|
||||
export class CommentsModule {
|
||||
}
|
||||
export class CommentsModule {}
|
||||
|
@@ -19,8 +19,11 @@ import { NgModule } from '@angular/core';
|
||||
import { ContextMenuDirective } from './context-menu.directive';
|
||||
import { ContextMenuListComponent } from './context-menu-list.component';
|
||||
|
||||
export const CONTEXT_MENU_DIRECTIVES = [ContextMenuListComponent, ContextMenuDirective] as const;
|
||||
|
||||
/** @deprecated use `...CONTEXT_MENU_DIRECTIVES` or import standalone directives */
|
||||
@NgModule({
|
||||
imports: [ContextMenuListComponent, ContextMenuDirective],
|
||||
exports: [ContextMenuListComponent, ContextMenuDirective]
|
||||
imports: [...CONTEXT_MENU_DIRECTIVES],
|
||||
exports: [...CONTEXT_MENU_DIRECTIVES]
|
||||
})
|
||||
export class ContextMenuModule {}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { Component } from '@angular/core';
|
||||
import { TestBed, ComponentFixture } from '@angular/core/testing';
|
||||
import { ContextMenuModule } from './context-menu.module';
|
||||
import { CONTEXT_MENU_DIRECTIVES } from './context-menu.module';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { HarnessLoader } from '@angular/cdk/testing';
|
||||
import { MatIconHarness } from '@angular/material/icon/testing';
|
||||
@@ -103,7 +103,7 @@ describe('ContextMenuDirective', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, ContextMenuModule],
|
||||
imports: [CoreTestingModule, CONTEXT_MENU_DIRECTIVES],
|
||||
declarations: [TestComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(TestComponent);
|
||||
|
@@ -15,46 +15,38 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { APP_INITIALIZER, NgModule, ModuleWithProviders } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { TranslateModule, TranslateLoader, TranslateStore, TranslateService } from '@ngx-translate/core';
|
||||
import { MaterialModule } from './material.module';
|
||||
import { ABOUT_DIRECTIVES } from './about/about.module';
|
||||
import { CardViewModule } from './card-view/card-view.module';
|
||||
import { ContextMenuModule } from './context-menu/context-menu.module';
|
||||
import { CARD_VIEW_DIRECTIVES } from './card-view/card-view.module';
|
||||
import { CONTEXT_MENU_DIRECTIVES } from './context-menu/context-menu.module';
|
||||
import { DATATABLE_DIRECTIVES } from './datatable/datatable.module';
|
||||
import { InfoDrawerModule } from './info-drawer/info-drawer.module';
|
||||
import { LanguageMenuModule } from './language-menu/language-menu.module';
|
||||
import { LoginModule } from './login/login.module';
|
||||
import { PaginationModule } from './pagination/pagination.module';
|
||||
import { ToolbarModule } from './toolbar/toolbar.module';
|
||||
import { ViewerModule } from './viewer/viewer.module';
|
||||
import { INFO_DRAWER_DIRECTIVES } from './info-drawer/info-drawer.module';
|
||||
import { LANGUAGE_MENU_DIRECTIVES } from './language-menu/language-menu.module';
|
||||
import { LOGIN_DIRECTIVES } from './login/login.module';
|
||||
import { PAGINATION_DIRECTIVES } from './pagination/pagination.module';
|
||||
import { TOOLBAR_DIRECTIVES } from './toolbar/toolbar.module';
|
||||
import { VIEWER_DIRECTIVES } from './viewer/viewer.module';
|
||||
import { FormBaseModule } from './form/form-base.module';
|
||||
import { LAYOUT_DIRECTIVES } from './layout/layout.module';
|
||||
import { CommentsModule } from './comments/comments.module';
|
||||
import { CommentListModule } from './comments/comment-list/comment-list.module';
|
||||
import { TemplateModule } from './templates/template.module';
|
||||
import { ClipboardModule } from './clipboard/clipboard.module';
|
||||
import { NotificationHistoryModule } from './notifications/notification-history.module';
|
||||
import { BlankPageModule } from './blank-page/blank-page.module';
|
||||
|
||||
import { DirectiveModule } from './directives/directive.module';
|
||||
import { PipeModule } from './pipes/pipe.module';
|
||||
|
||||
import { CommentsComponent } from './comments/comments.component';
|
||||
import { CommentListComponent } from './comments/comment-list/comment-list.component';
|
||||
import { TEMPLATE_DIRECTIVES } from './templates/template.module';
|
||||
import { CLIPBOARD_DIRECTIVES } from './clipboard/clipboard.module';
|
||||
import { NOTIFICATION_HISTORY_DIRECTIVES } from './notifications/notification-history.module';
|
||||
import { BlankPageComponent } from './blank-page/blank-page.component';
|
||||
import { CORE_DIRECTIVES } from './directives/directive.module';
|
||||
import { CORE_PIPES } from './pipes/pipe.module';
|
||||
import { TranslationService } from './translation/translation.service';
|
||||
import { SortingPickerModule } from './sorting-picker/sorting-picker.module';
|
||||
import { TranslateLoaderService } from './translation/translate-loader.service';
|
||||
import { ExtensionsModule } from '@alfresco/adf-extensions';
|
||||
import { directionalityConfigFactory } from './common/services/directionality-config-factory';
|
||||
import { DirectionalityConfigService } from './common/services/directionality-config.service';
|
||||
import { SearchTextModule } from './search-text/search-text-input.module';
|
||||
import { SEARCH_TEXT_INPUT_DIRECTIVES } from './search-text/search-text-input.module';
|
||||
import { AdfHttpClient } from '@alfresco/adf-core/api';
|
||||
import { AuthenticationInterceptor, Authentication } from '@alfresco/adf-core/auth';
|
||||
import { HttpClientModule, HttpClientXsrfModule, HTTP_INTERCEPTORS } from '@angular/common/http';
|
||||
import { AuthenticationService } from './auth/services/authentication.service';
|
||||
import { MAT_SNACK_BAR_DEFAULT_OPTIONS } from '@angular/material/snack-bar';
|
||||
import { IdentityUserInfoModule } from './identity-user-info/identity-user-info.module';
|
||||
import { loadAppConfig } from './app-config/app-config.loader';
|
||||
import { AppConfigService } from './app-config/app-config.service';
|
||||
import { StorageService } from './common/services/storage.service';
|
||||
@@ -63,83 +55,81 @@ import { AdfDateFnsAdapter } from './common/utils/date-fns-adapter';
|
||||
import { MomentDateAdapter } from './common/utils/moment-date-adapter';
|
||||
import { AdfDateTimeFnsAdapter } from './common/utils/datetime-fns-adapter';
|
||||
import { AppConfigPipe, StoragePrefixFactory } from './app-config';
|
||||
import { UnsavedChangesDialogModule } from './dialogs';
|
||||
import { DynamicChipListModule } from './dynamic-chip-list';
|
||||
import { IconComponent } from './icon';
|
||||
import { SortingPickerComponent } from './sorting-picker';
|
||||
import { DynamicChipListComponent } from './dynamic-chip-list';
|
||||
import { IdentityUserInfoComponent } from './identity-user-info';
|
||||
import { UnsavedChangesDialogComponent } from './dialogs';
|
||||
import { MaterialModule } from './material.module';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
TranslateModule,
|
||||
ExtensionsModule,
|
||||
...ABOUT_DIRECTIVES,
|
||||
ViewerModule,
|
||||
...VIEWER_DIRECTIVES,
|
||||
...LAYOUT_DIRECTIVES,
|
||||
PipeModule,
|
||||
CommonModule,
|
||||
IdentityUserInfoModule,
|
||||
DirectiveModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
MaterialModule,
|
||||
...CORE_PIPES,
|
||||
IdentityUserInfoComponent,
|
||||
...CORE_DIRECTIVES,
|
||||
AppConfigPipe,
|
||||
PaginationModule,
|
||||
ToolbarModule,
|
||||
ContextMenuModule,
|
||||
CardViewModule,
|
||||
...PAGINATION_DIRECTIVES,
|
||||
...TOOLBAR_DIRECTIVES,
|
||||
...CONTEXT_MENU_DIRECTIVES,
|
||||
...CARD_VIEW_DIRECTIVES,
|
||||
FormBaseModule,
|
||||
CommentsModule,
|
||||
CommentListModule,
|
||||
LoginModule,
|
||||
LanguageMenuModule,
|
||||
InfoDrawerModule,
|
||||
CommentsComponent,
|
||||
CommentListComponent,
|
||||
...CLIPBOARD_DIRECTIVES,
|
||||
...LOGIN_DIRECTIVES,
|
||||
...LANGUAGE_MENU_DIRECTIVES,
|
||||
...INFO_DRAWER_DIRECTIVES,
|
||||
...DATATABLE_DIRECTIVES,
|
||||
TemplateModule,
|
||||
...TEMPLATE_DIRECTIVES,
|
||||
IconComponent,
|
||||
SortingPickerModule,
|
||||
NotificationHistoryModule,
|
||||
SearchTextModule,
|
||||
BlankPageModule,
|
||||
UnsavedChangesDialogModule,
|
||||
DynamicChipListModule,
|
||||
SortingPickerComponent,
|
||||
...NOTIFICATION_HISTORY_DIRECTIVES,
|
||||
...SEARCH_TEXT_INPUT_DIRECTIVES,
|
||||
BlankPageComponent,
|
||||
UnsavedChangesDialogComponent,
|
||||
DynamicChipListComponent,
|
||||
HttpClientModule,
|
||||
HttpClientXsrfModule.withOptions({
|
||||
cookieName: 'CSRF-TOKEN',
|
||||
headerName: 'X-CSRF-TOKEN'
|
||||
})
|
||||
}),
|
||||
MaterialModule
|
||||
],
|
||||
providers: [...CORE_PIPES],
|
||||
exports: [
|
||||
...ABOUT_DIRECTIVES,
|
||||
ViewerModule,
|
||||
...VIEWER_DIRECTIVES,
|
||||
...LAYOUT_DIRECTIVES,
|
||||
PipeModule,
|
||||
CommonModule,
|
||||
DirectiveModule,
|
||||
ClipboardModule,
|
||||
FormsModule,
|
||||
IdentityUserInfoModule,
|
||||
ReactiveFormsModule,
|
||||
MaterialModule,
|
||||
...CORE_PIPES,
|
||||
...CORE_DIRECTIVES,
|
||||
...CLIPBOARD_DIRECTIVES,
|
||||
IdentityUserInfoComponent,
|
||||
AppConfigPipe,
|
||||
PaginationModule,
|
||||
ToolbarModule,
|
||||
ContextMenuModule,
|
||||
CardViewModule,
|
||||
...PAGINATION_DIRECTIVES,
|
||||
...TOOLBAR_DIRECTIVES,
|
||||
...CONTEXT_MENU_DIRECTIVES,
|
||||
...CARD_VIEW_DIRECTIVES,
|
||||
FormBaseModule,
|
||||
CommentsModule,
|
||||
CommentListModule,
|
||||
LoginModule,
|
||||
LanguageMenuModule,
|
||||
InfoDrawerModule,
|
||||
CommentsComponent,
|
||||
CommentListComponent,
|
||||
...LOGIN_DIRECTIVES,
|
||||
...LANGUAGE_MENU_DIRECTIVES,
|
||||
...INFO_DRAWER_DIRECTIVES,
|
||||
...DATATABLE_DIRECTIVES,
|
||||
TranslateModule,
|
||||
TemplateModule,
|
||||
SortingPickerModule,
|
||||
...TEMPLATE_DIRECTIVES,
|
||||
SortingPickerComponent,
|
||||
IconComponent,
|
||||
NotificationHistoryModule,
|
||||
SearchTextModule,
|
||||
BlankPageModule,
|
||||
UnsavedChangesDialogModule,
|
||||
DynamicChipListModule
|
||||
...NOTIFICATION_HISTORY_DIRECTIVES,
|
||||
...SEARCH_TEXT_INPUT_DIRECTIVES,
|
||||
BlankPageComponent,
|
||||
UnsavedChangesDialogComponent,
|
||||
DynamicChipListComponent,
|
||||
MaterialModule
|
||||
]
|
||||
})
|
||||
export class CoreModule {
|
||||
@@ -184,6 +174,10 @@ export class CoreModule {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated this api is deprecated, import `CoreModule` instead
|
||||
* @returns ModuleWithProviders<CoreModule>
|
||||
*/
|
||||
static forChild(): ModuleWithProviders<CoreModule> {
|
||||
return {
|
||||
ngModule: CoreModule
|
||||
|
@@ -23,12 +23,12 @@ import { BehaviorSubject, Subject } from 'rxjs';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
import { DataTableService } from '../../services/datatable.service';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ClipboardModule } from '../../../clipboard';
|
||||
import { ClipboardDirective } from '../../../clipboard/clipboard.directive';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-datatable-cell',
|
||||
standalone: true,
|
||||
imports: [CommonModule, ClipboardModule],
|
||||
imports: [CommonModule, ClipboardDirective],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
template: `
|
||||
<ng-container>
|
||||
|
@@ -16,12 +16,19 @@
|
||||
*/
|
||||
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
|
||||
/**
|
||||
* Dialog which informs about unsaved changes. Allows discard them and proceed or close dialog and stop proceeding.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'adf-unsaved-changes-dialog',
|
||||
standalone: true,
|
||||
imports: [CommonModule, MatDialogModule, TranslateModule, MatButtonModule, MatIconModule],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
templateUrl: './unsaved-changes-dialog.component.html',
|
||||
styleUrls: ['./unsaved-changes-dialog.component.scss']
|
||||
|
@@ -17,21 +17,10 @@
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { UnsavedChangesDialogComponent } from './unsaved-changes-dialog.component';
|
||||
import { MatDialogModule } from '@angular/material/dialog';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
/** @deprecated import `UnsavedChangesDialogComponent` instead */
|
||||
@NgModule({
|
||||
declarations: [UnsavedChangesDialogComponent],
|
||||
imports: [
|
||||
MatDialogModule,
|
||||
TranslateModule,
|
||||
MatButtonModule,
|
||||
MatIconModule,
|
||||
CommonModule
|
||||
],
|
||||
imports: [UnsavedChangesDialogComponent],
|
||||
exports: [UnsavedChangesDialogComponent]
|
||||
})
|
||||
export class UnsavedChangesDialogModule {}
|
||||
|
@@ -23,9 +23,18 @@ import { TooltipCardComponent } from './tooltip-card/tooltip-card.component';
|
||||
import { TooltipCardDirective } from './tooltip-card/tooltip-card.directive';
|
||||
import { UploadDirective } from './upload.directive';
|
||||
|
||||
export const CORE_DIRECTIVES = [
|
||||
HighlightDirective,
|
||||
LogoutDirective,
|
||||
UploadDirective,
|
||||
TooltipCardDirective,
|
||||
TooltipCardComponent,
|
||||
InfiniteSelectScrollDirective
|
||||
];
|
||||
|
||||
/** @deprecated use `...CORE_DIRECTIVES` or import standalone directives directly */
|
||||
@NgModule({
|
||||
imports: [HighlightDirective, LogoutDirective, UploadDirective, TooltipCardDirective, TooltipCardComponent, InfiniteSelectScrollDirective],
|
||||
exports: [HighlightDirective, LogoutDirective, UploadDirective, TooltipCardDirective, TooltipCardComponent, InfiniteSelectScrollDirective]
|
||||
imports: [...CORE_DIRECTIVES],
|
||||
exports: [...CORE_DIRECTIVES]
|
||||
})
|
||||
/** @deprecated This module is deprecated and will be removed in a future release. Please consider importing standalone components and directives directly. */
|
||||
export class DirectiveModule {}
|
||||
|
@@ -18,6 +18,7 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { DynamicChipListComponent } from './dynamic-chip-list.component';
|
||||
|
||||
/** @deprecated use `DynamicChipListComponent` or import standalone components directly */
|
||||
@NgModule({
|
||||
imports: [DynamicChipListComponent],
|
||||
exports: [DynamicChipListComponent]
|
||||
|
@@ -45,6 +45,7 @@ import { WidgetComponent } from '../widget.component';
|
||||
'(select)': 'event($event)'
|
||||
},
|
||||
imports: [NgIf, TranslateModule, MatFormFieldModule, MatInputModule, FormsModule, ErrorWidgetComponent],
|
||||
providers: [DecimalNumberPipe],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class NumberWidgetComponent extends WidgetComponent implements OnInit {
|
||||
|
@@ -21,6 +21,8 @@ export * from './components/inplace-form-input/inplace-form-input.component';
|
||||
export * from './components/form-custom-button.directive';
|
||||
export * from './components/form-renderer.component';
|
||||
export * from './components/widgets';
|
||||
export * from './components/middlewares/middleware';
|
||||
export * from './components/middlewares/decimal-middleware.service';
|
||||
|
||||
export * from './services/form-rendering.service';
|
||||
export * from './services/form.service';
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { Component, HostBinding, Input, ViewEncapsulation } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { ThemePalette } from '@angular/material/core';
|
||||
import { ToolbarModule } from '../toolbar';
|
||||
import { TOOLBAR_DIRECTIVES } from '../toolbar';
|
||||
import { NavbarItem } from './navbar/navbar-item.component';
|
||||
import { NavbarComponent } from './navbar/navbar.component';
|
||||
|
||||
@@ -27,7 +27,7 @@ export type HeaderVariant = 'minimal' | 'extended';
|
||||
@Component({
|
||||
selector: 'adf-header',
|
||||
standalone: true,
|
||||
imports: [CommonModule, ToolbarModule, NavbarComponent],
|
||||
imports: [CommonModule, ...TOOLBAR_DIRECTIVES, NavbarComponent],
|
||||
templateUrl: './header.component.html',
|
||||
styleUrls: ['./header.component.scss'],
|
||||
host: { class: 'adf-header' },
|
||||
|
@@ -51,7 +51,7 @@ describe('IdentityUserInfoComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, MatMenuModule]
|
||||
imports: [CoreTestingModule, MatMenuModule, IdentityUserInfoComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(IdentityUserInfoComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -18,7 +18,6 @@
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CoreStoryModule } from '../testing/core.story.module';
|
||||
import { IdentityUserInfoComponent } from './identity-user-info.component';
|
||||
import { IdentityUserInfoModule } from './identity-user-info.module';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
const fakeIdentityUser = {
|
||||
@@ -33,7 +32,7 @@ export default {
|
||||
title: 'Core/Identity User Info/Identity User Info',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [IdentityUserInfoModule]
|
||||
imports: [IdentityUserInfoComponent]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
|
@@ -16,18 +16,24 @@
|
||||
*/
|
||||
|
||||
import { Component, Input, OnDestroy, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { MatMenuTrigger, MenuPositionX, MenuPositionY } from '@angular/material/menu';
|
||||
import { MatMenuModule, MatMenuTrigger, MenuPositionX, MenuPositionY } from '@angular/material/menu';
|
||||
import { IdentityUserModel } from '../auth/models/identity-user.model';
|
||||
import { Subject } from 'rxjs';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FullNamePipe, InitialUsernamePipe } from '../pipes';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-identity-user-info',
|
||||
standalone: true,
|
||||
imports: [CommonModule, FullNamePipe, MatMenuModule, InitialUsernamePipe, MatButtonModule, MatCardModule, TranslateModule],
|
||||
templateUrl: './identity-user-info.component.html',
|
||||
styleUrls: ['./identity-user-info.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class IdentityUserInfoComponent implements OnDestroy {
|
||||
|
||||
@ViewChild(MatMenuTrigger) trigger: MatMenuTrigger;
|
||||
|
||||
/** Is the user logged in */
|
||||
|
@@ -16,29 +16,11 @@
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { IdentityUserInfoComponent } from './identity-user-info.component';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { PipeModule } from '../pipes/pipe.module';
|
||||
import { FullNamePipe, InitialUsernamePipe } from '../pipes';
|
||||
|
||||
/** @deprecated import `IdentityUserInfoComponent` directly */
|
||||
@NgModule({
|
||||
declarations: [IdentityUserInfoComponent],
|
||||
imports: [
|
||||
CommonModule,
|
||||
MatButtonModule,
|
||||
MatMenuModule,
|
||||
MatTabsModule,
|
||||
MatCardModule,
|
||||
TranslateModule,
|
||||
PipeModule,
|
||||
InitialUsernamePipe,
|
||||
FullNamePipe
|
||||
],
|
||||
imports: [IdentityUserInfoComponent],
|
||||
exports: [IdentityUserInfoComponent]
|
||||
})
|
||||
export class IdentityUserInfoModule {}
|
||||
|
@@ -16,9 +16,12 @@
|
||||
*/
|
||||
|
||||
import { Component, Directive, Input, ViewEncapsulation } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-info-drawer-layout',
|
||||
standalone: true,
|
||||
imports: [CommonModule],
|
||||
templateUrl: './info-drawer-layout.component.html',
|
||||
styleUrls: ['./info-drawer-layout.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
@@ -33,6 +36,20 @@ export class InfoDrawerLayoutComponent {
|
||||
/**
|
||||
* Directive selectors without adf- prefix will be deprecated on 3.0.0
|
||||
*/
|
||||
@Directive({ selector: '[adf-info-drawer-title], [info-drawer-title]' }) export class InfoDrawerTitleDirective {}
|
||||
@Directive({ selector: '[adf-info-drawer-buttons], [info-drawer-buttons]' }) export class InfoDrawerButtonsDirective {}
|
||||
@Directive({ selector: '[adf-info-drawer-content], [info-drawer-content]' }) export class InfoDrawerContentDirective {}
|
||||
@Directive({
|
||||
selector: '[adf-info-drawer-title], [info-drawer-title]',
|
||||
standalone: true
|
||||
})
|
||||
export class InfoDrawerTitleDirective {}
|
||||
|
||||
@Directive({
|
||||
selector: '[adf-info-drawer-buttons], [info-drawer-buttons]',
|
||||
standalone: true
|
||||
})
|
||||
export class InfoDrawerButtonsDirective {}
|
||||
|
||||
@Directive({
|
||||
selector: '[adf-info-drawer-content], [info-drawer-content]',
|
||||
standalone: true
|
||||
})
|
||||
export class InfoDrawerContentDirective {}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { InfoDrawerComponent } from './info-drawer.component';
|
||||
import { InfoDrawerModule } from './info-drawer.module';
|
||||
import { INFO_DRAWER_DIRECTIVES } from './info-drawer.module';
|
||||
import { mockTabText, mockCardText } from './mock/info-drawer.mock';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
import { CoreStoryModule } from '../../..';
|
||||
@@ -27,7 +27,7 @@ export default {
|
||||
title: 'Core/Info Drawer/Info Drawer',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [InfoDrawerModule]
|
||||
imports: [...INFO_DRAWER_DIRECTIVES]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
@@ -212,8 +212,7 @@ export default {
|
||||
|
||||
const tabLayoutTemplate: StoryFn<InfoDrawerComponent> = (args) => ({
|
||||
props: args,
|
||||
template:
|
||||
`<adf-info-drawer title="{{ title }}" [showHeader]="showHeader" (currentTab)="currentTab($event)" selectedIndex="{{ selectedIndex }}">
|
||||
template: `<adf-info-drawer title="{{ title }}" [showHeader]="showHeader" (currentTab)="currentTab($event)" selectedIndex="{{ selectedIndex }}">
|
||||
<div info-drawer-buttons>
|
||||
<mat-icon>clear</mat-icon>
|
||||
</div>
|
||||
@@ -235,8 +234,7 @@ const tabLayoutTemplate: StoryFn<InfoDrawerComponent> = (args) => ({
|
||||
|
||||
const singleLayoutTemplate: StoryFn<InfoDrawerComponent> = (args) => ({
|
||||
props: args,
|
||||
template:
|
||||
`<adf-info-drawer title="{{ title }}" [showHeader]="showHeader">
|
||||
template: `<adf-info-drawer title="{{ title }}" [showHeader]="showHeader">
|
||||
<div info-drawer-title>File info</div>
|
||||
|
||||
<div info-drawer-buttons>
|
||||
|
@@ -15,10 +15,31 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ContentChildren, EventEmitter, HostListener, Input, Output, QueryList, TemplateRef, ViewChild, ViewEncapsulation } from '@angular/core';
|
||||
import { MatTabChangeEvent } from '@angular/material/tabs';
|
||||
import {
|
||||
Component,
|
||||
ContentChildren,
|
||||
EventEmitter,
|
||||
HostListener,
|
||||
Input,
|
||||
Output,
|
||||
QueryList,
|
||||
TemplateRef,
|
||||
ViewChild,
|
||||
ViewEncapsulation
|
||||
} from '@angular/core';
|
||||
import { MatTabChangeEvent, MatTabsModule } from '@angular/material/tabs';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import {
|
||||
InfoDrawerButtonsDirective,
|
||||
InfoDrawerContentDirective,
|
||||
InfoDrawerLayoutComponent,
|
||||
InfoDrawerTitleDirective
|
||||
} from './info-drawer-layout.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
@Component({
|
||||
selector: 'adf-info-drawer-tab',
|
||||
standalone: true,
|
||||
template: '<ng-template><ng-content></ng-content></ng-template>',
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
@@ -37,6 +58,18 @@ export class InfoDrawerTabComponent {
|
||||
|
||||
@Component({
|
||||
selector: 'adf-info-drawer',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CommonModule,
|
||||
InfoDrawerLayoutComponent,
|
||||
TranslateModule,
|
||||
MatTabsModule,
|
||||
MatIconModule,
|
||||
InfoDrawerButtonsDirective,
|
||||
InfoDrawerTitleDirective,
|
||||
InfoDrawerContentDirective,
|
||||
InfoDrawerTabComponent
|
||||
],
|
||||
templateUrl: './info-drawer.component.html',
|
||||
styleUrls: ['./info-drawer.component.scss'],
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
@@ -45,7 +78,7 @@ export class InfoDrawerTabComponent {
|
||||
export class InfoDrawerComponent {
|
||||
/** The title of the info drawer (string or translation key). */
|
||||
@Input()
|
||||
title: string|null = null;
|
||||
title: string | null = null;
|
||||
|
||||
@Input()
|
||||
icon: string | null = null;
|
||||
|
@@ -15,41 +15,27 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { InfoDrawerLayoutComponent, InfoDrawerTitleDirective, InfoDrawerButtonsDirective, InfoDrawerContentDirective } from './info-drawer-layout.component';
|
||||
import {
|
||||
InfoDrawerLayoutComponent,
|
||||
InfoDrawerTitleDirective,
|
||||
InfoDrawerButtonsDirective,
|
||||
InfoDrawerContentDirective
|
||||
} from './info-drawer-layout.component';
|
||||
import { InfoDrawerComponent, InfoDrawerTabComponent } from './info-drawer.component';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
|
||||
export const INFO_DRAWER_DIRECTIVES = [
|
||||
InfoDrawerLayoutComponent,
|
||||
InfoDrawerTabComponent,
|
||||
InfoDrawerComponent,
|
||||
InfoDrawerTitleDirective,
|
||||
InfoDrawerButtonsDirective,
|
||||
InfoDrawerContentDirective
|
||||
] as const;
|
||||
|
||||
/** @deprecated use `...INFO_DRAWER_DIRECTIVES` or import standalone directives directly */
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
MatTabsModule,
|
||||
MatIconModule,
|
||||
MatCardModule,
|
||||
TranslateModule
|
||||
],
|
||||
declarations: [
|
||||
InfoDrawerLayoutComponent,
|
||||
InfoDrawerTabComponent,
|
||||
InfoDrawerComponent,
|
||||
InfoDrawerTitleDirective,
|
||||
InfoDrawerButtonsDirective,
|
||||
InfoDrawerContentDirective
|
||||
],
|
||||
exports: [
|
||||
InfoDrawerLayoutComponent,
|
||||
InfoDrawerTabComponent,
|
||||
InfoDrawerComponent,
|
||||
InfoDrawerTitleDirective,
|
||||
InfoDrawerButtonsDirective,
|
||||
InfoDrawerContentDirective,
|
||||
MatTabsModule,
|
||||
MatCardModule,
|
||||
MatIconModule
|
||||
]
|
||||
imports: [...INFO_DRAWER_DIRECTIVES],
|
||||
exports: [...INFO_DRAWER_DIRECTIVES]
|
||||
})
|
||||
export class InfoDrawerModule {}
|
||||
|
@@ -47,7 +47,7 @@ describe('LanguageMenuComponent', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [CoreTestingModule, LanguageMenuComponent]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(LanguageMenuComponent);
|
||||
|
@@ -17,10 +17,8 @@
|
||||
|
||||
import { applicationConfig, componentWrapperDecorator, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CoreStoryModule } from '../testing/core.story.module';
|
||||
|
||||
import { LanguageMenuModule } from './language-menu.module';
|
||||
import { LANGUAGE_MENU_DIRECTIVES } from './language-menu.module';
|
||||
import { LanguageMenuComponent } from './language-menu.component';
|
||||
|
||||
import { LanguageService } from './service/language.service';
|
||||
import { LanguageServiceMock } from '../mock/language.service.mock';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
@@ -30,7 +28,7 @@ export default {
|
||||
title: 'Core/Language Menu/Language Menu',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [LanguageMenuModule],
|
||||
imports: [...LANGUAGE_MENU_DIRECTIVES],
|
||||
providers: [{ provide: LanguageService, useClass: LanguageServiceMock }]
|
||||
}),
|
||||
applicationConfig({
|
||||
|
@@ -19,19 +19,20 @@ import { Component, EventEmitter, Output } from '@angular/core';
|
||||
import { LanguageService } from './service/language.service';
|
||||
import { Observable } from 'rxjs';
|
||||
import { LanguageItem } from '../common/services/language-item.interface';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-language-menu',
|
||||
standalone: true,
|
||||
imports: [CommonModule, MatMenuModule],
|
||||
template: `
|
||||
<button
|
||||
mat-menu-item
|
||||
*ngFor="let language of languages$ | async"
|
||||
[attr.lang]="language.key"
|
||||
(click)="changeLanguage(language)">{{language.label}}</button>
|
||||
<button mat-menu-item *ngFor="let language of languages$ | async" [attr.lang]="language.key" (click)="changeLanguage(language)">
|
||||
{{ language.label }}
|
||||
</button>
|
||||
`
|
||||
})
|
||||
export class LanguageMenuComponent {
|
||||
|
||||
/** Emitted when the language change */
|
||||
@Output()
|
||||
changedLanguage: EventEmitter<LanguageItem> = new EventEmitter<LanguageItem>();
|
||||
|
@@ -15,35 +15,15 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
|
||||
import { LanguageMenuComponent } from './language-menu.component';
|
||||
import { LanguagePickerComponent } from './language-picker.component';
|
||||
|
||||
export const LANGUAGE_MENU_DIRECTIVES = [LanguageMenuComponent, LanguagePickerComponent] as const;
|
||||
|
||||
/** @deprecated use `...LANGUAGE_MENU_DIRECTIVES` or import components directly instead. */
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
MatMenuModule,
|
||||
MatIconModule,
|
||||
MatButtonModule,
|
||||
TranslateModule
|
||||
],
|
||||
declarations: [
|
||||
LanguageMenuComponent,
|
||||
LanguagePickerComponent
|
||||
],
|
||||
exports: [
|
||||
LanguageMenuComponent,
|
||||
LanguagePickerComponent,
|
||||
MatMenuModule,
|
||||
MatIconModule,
|
||||
MatButtonModule
|
||||
]
|
||||
imports: [...LANGUAGE_MENU_DIRECTIVES],
|
||||
exports: [...LANGUAGE_MENU_DIRECTIVES]
|
||||
})
|
||||
export class LanguageMenuModule {}
|
||||
|
@@ -17,10 +17,8 @@
|
||||
|
||||
import { applicationConfig, componentWrapperDecorator, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CoreStoryModule } from '../testing/core.story.module';
|
||||
|
||||
import { LanguageMenuModule } from './language-menu.module';
|
||||
import { LANGUAGE_MENU_DIRECTIVES } from './language-menu.module';
|
||||
import { LanguagePickerComponent } from './language-picker.component';
|
||||
|
||||
import { LanguageService } from './service/language.service';
|
||||
import { LanguageServiceMock } from '../mock/language.service.mock';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
@@ -30,7 +28,7 @@ export default {
|
||||
title: 'Core/Language Menu/Language Picker',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [LanguageMenuModule],
|
||||
imports: [...LANGUAGE_MENU_DIRECTIVES],
|
||||
providers: [{ provide: LanguageService, useClass: LanguageServiceMock }]
|
||||
}),
|
||||
applicationConfig({
|
||||
|
@@ -17,9 +17,16 @@
|
||||
|
||||
import { Component, EventEmitter, Output } from '@angular/core';
|
||||
import { LanguageItem } from '../common/services/language-item.interface';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { LanguageMenuComponent } from './language-menu.component';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-picker-button',
|
||||
standalone: true,
|
||||
imports: [CommonModule, MatMenuModule, TranslateModule, LanguageMenuComponent, MatIconModule],
|
||||
template: `
|
||||
<button mat-menu-item [matMenuTriggerFor]="langMenu">
|
||||
<mat-icon>language</mat-icon>
|
||||
@@ -33,5 +40,4 @@ import { LanguageItem } from '../common/services/language-item.interface';
|
||||
export class LanguagePickerComponent {
|
||||
@Output()
|
||||
public changedLanguage = new EventEmitter<LanguageItem>();
|
||||
|
||||
}
|
||||
|
@@ -158,37 +158,37 @@ const template: StoryFn<SidenavLayoutComponent> = (args) => ({
|
||||
<ng-template>
|
||||
<mat-nav-list class="app-sidenav-linklist">
|
||||
<mat-list-item class="app-sidenav-link">
|
||||
<mat-icon matListIcon>home</mat-icon>
|
||||
<mat-icon matListItemIcon>home</mat-icon>
|
||||
<span matLine>Home</span>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item class="app-sidenav-link">
|
||||
<mat-icon matListIcon>device_hub</mat-icon>
|
||||
<mat-icon matListItemIcon>device_hub</mat-icon>
|
||||
<span matLine>Content Processes</span>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item class="app-sidenav-link">
|
||||
<mat-icon matListIcon>folder_open</mat-icon>
|
||||
<mat-icon matListItemIcon>folder_open</mat-icon>
|
||||
<span matLine>Files</span>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item class="app-sidenav-link">
|
||||
<mat-icon matListIcon>rowing</mat-icon>
|
||||
<mat-icon matListItemIcon>rowing</mat-icon>
|
||||
<span matLine>Quick Search</span>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item class="app-sidenav-link">
|
||||
<mat-icon matListIcon>cloud</mat-icon>
|
||||
<mat-icon matListItemIcon>cloud</mat-icon>
|
||||
<span matLine>Cloud</span>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item class="app-sidenav-link">
|
||||
<mat-icon matListIcon>settings</mat-icon>
|
||||
<mat-icon matListItemIcon>settings</mat-icon>
|
||||
<span matLine>Settings</span>
|
||||
</mat-list-item>
|
||||
|
||||
<mat-list-item adf-logout class="app-sidenav-link" data-automation-id="Logout">
|
||||
<mat-icon matListIcon>exit_to_app</mat-icon>
|
||||
<mat-icon matListItemIcon>exit_to_app</mat-icon>
|
||||
<span matLine>Logout</span>
|
||||
</mat-list-item>
|
||||
</mat-nav-list>
|
||||
|
@@ -23,21 +23,17 @@ import { LoginComponent } from './components/login/login.component';
|
||||
import { LoginFooterDirective } from './directives/login-footer.directive';
|
||||
import { LoginHeaderDirective } from './directives/login-header.directive';
|
||||
|
||||
export const LOGIN_DIRECTIVES = [
|
||||
LoginComponent,
|
||||
LoginFooterDirective,
|
||||
LoginHeaderDirective,
|
||||
LoginDialogComponent,
|
||||
LoginDialogPanelComponent
|
||||
] as const;
|
||||
|
||||
/** @deprecated use `...LOGIN_DIRECTIVES` or import the standalone directives directly */
|
||||
@NgModule({
|
||||
imports: [
|
||||
LoginComponent,
|
||||
LoginFooterDirective,
|
||||
LoginHeaderDirective,
|
||||
LoginDialogComponent,
|
||||
LoginDialogPanelComponent
|
||||
],
|
||||
exports: [
|
||||
LoginComponent,
|
||||
LoginFooterDirective,
|
||||
LoginHeaderDirective,
|
||||
LoginDialogComponent,
|
||||
LoginDialogPanelComponent
|
||||
]
|
||||
imports: [...LOGIN_DIRECTIVES],
|
||||
exports: [...LOGIN_DIRECTIVES]
|
||||
})
|
||||
export class LoginModule {
|
||||
}
|
||||
export class LoginModule {}
|
||||
|
@@ -16,8 +16,9 @@
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||
import { MatDatetimepickerModule, MatNativeDatetimeModule } from '@mat-datetimepicker/core';
|
||||
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatAutocompleteModule } from '@angular/material/autocomplete';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatCardModule } from '@angular/material/card';
|
||||
@@ -43,10 +44,14 @@ import { MatTableModule } from '@angular/material/table';
|
||||
import { MatTabsModule } from '@angular/material/tabs';
|
||||
import { MatToolbarModule } from '@angular/material/toolbar';
|
||||
import { MatBadgeModule } from '@angular/material/badge';
|
||||
import { CommonModule } from '@angular/common';
|
||||
|
||||
/** @deprecated This module is deprecated and will be removed in a future release. */
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
MatAutocompleteModule,
|
||||
MatButtonModule,
|
||||
MatCardModule,
|
||||
@@ -75,9 +80,13 @@ import { MatBadgeModule } from '@angular/material/badge';
|
||||
MatDatetimepickerModule,
|
||||
MatNativeDatetimeModule,
|
||||
MatExpansionModule,
|
||||
MatBadgeModule
|
||||
MatBadgeModule,
|
||||
MatFormFieldModule
|
||||
],
|
||||
exports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
ReactiveFormsModule,
|
||||
MatAutocompleteModule,
|
||||
MatButtonModule,
|
||||
MatCardModule,
|
||||
|
@@ -43,7 +43,7 @@
|
||||
class="adf-notification-history-menu-item"
|
||||
(click)="onNotificationClick(notification)">
|
||||
<div *ngIf="notification.initiator; else no_avatar"
|
||||
matListAvatar
|
||||
matListItemAvatar
|
||||
[outerHTML]="notification.initiator | usernameInitials : 'adf-notification-initiator-pic'"></div>
|
||||
<ng-template #no_avatar>
|
||||
<mat-icon matListItemLine
|
||||
|
@@ -40,7 +40,7 @@ describe('Notification History Component', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule]
|
||||
imports: [CoreTestingModule, NotificationHistoryComponent]
|
||||
});
|
||||
fixture = TestBed.createComponent(NotificationHistoryComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CoreStoryModule } from '../../testing/core.story.module';
|
||||
import { NotificationHistoryComponent } from './notification-history.component';
|
||||
import { NotificationHistoryModule } from '../notification-history.module';
|
||||
import { NOTIFICATION_HISTORY_DIRECTIVES } from '../notification-history.module';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
export default {
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
title: 'Core/Notification History/Notification History',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CoreStoryModule, NotificationHistoryModule]
|
||||
imports: [CoreStoryModule, ...NOTIFICATION_HISTORY_DIRECTIVES]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
|
@@ -30,6 +30,7 @@ import { MatBadgeModule } from '@angular/material/badge';
|
||||
import { MatListModule } from '@angular/material/list';
|
||||
import { NgForOf, NgIf } from '@angular/common';
|
||||
import { InitialUsernamePipe, TimeAgoPipe } from '../../pipes';
|
||||
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-notification-history',
|
||||
@@ -46,7 +47,8 @@ import { InitialUsernamePipe, TimeAgoPipe } from '../../pipes';
|
||||
NgIf,
|
||||
NgForOf,
|
||||
TimeAgoPipe,
|
||||
InitialUsernamePipe
|
||||
InitialUsernamePipe,
|
||||
MatSnackBarModule
|
||||
],
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
|
@@ -19,8 +19,11 @@ import { NgModule } from '@angular/core';
|
||||
import { NotificationHistoryComponent } from './components/notification-history.component';
|
||||
import { AddNotificationStorybookComponent } from './components/add-notification.stories.component';
|
||||
|
||||
export const NOTIFICATION_HISTORY_DIRECTIVES = [NotificationHistoryComponent, AddNotificationStorybookComponent] as const;
|
||||
|
||||
/** @deprecated use `...NOTIFICATION_HISTORY_DIRECTIVES` or import the individual directives */
|
||||
@NgModule({
|
||||
imports: [NotificationHistoryComponent, AddNotificationStorybookComponent],
|
||||
exports: [NotificationHistoryComponent, AddNotificationStorybookComponent]
|
||||
imports: [...NOTIFICATION_HISTORY_DIRECTIVES],
|
||||
exports: [...NOTIFICATION_HISTORY_DIRECTIVES]
|
||||
})
|
||||
export class NotificationHistoryModule {}
|
||||
|
@@ -17,7 +17,7 @@
|
||||
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CoreStoryModule } from '../testing/core.story.module';
|
||||
import { PaginationModule } from './pagination.module';
|
||||
import { PAGINATION_DIRECTIVES } from './pagination.module';
|
||||
import { PaginationComponent } from './pagination.component';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
title: 'Core/Pagination/Pagination',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [PaginationModule]
|
||||
imports: [...PAGINATION_DIRECTIVES]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
|
@@ -19,8 +19,11 @@ import { NgModule } from '@angular/core';
|
||||
import { InfinitePaginationComponent } from './infinite-pagination.component';
|
||||
import { PaginationComponent } from './pagination.component';
|
||||
|
||||
export const PAGINATION_DIRECTIVES = [InfinitePaginationComponent, PaginationComponent];
|
||||
|
||||
/** @deprecated use `...PAGINATION_DIRECTIVES` or import standalone components */
|
||||
@NgModule({
|
||||
imports: [InfinitePaginationComponent, PaginationComponent],
|
||||
exports: [InfinitePaginationComponent, PaginationComponent]
|
||||
imports: [...PAGINATION_DIRECTIVES],
|
||||
exports: [...PAGINATION_DIRECTIVES]
|
||||
})
|
||||
export class PaginationModule {}
|
||||
|
@@ -24,7 +24,8 @@ describe('MultiValuePipe', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, MultiValuePipe]
|
||||
imports: [CoreTestingModule, MultiValuePipe],
|
||||
providers: [MultiValuePipe]
|
||||
});
|
||||
pipe = TestBed.inject(MultiValuePipe);
|
||||
});
|
||||
|
@@ -19,8 +19,11 @@ import { NgModule } from '@angular/core';
|
||||
import { SearchTextInputComponent } from './search-text-input.component';
|
||||
import { SearchTriggerDirective } from './search-trigger.directive';
|
||||
|
||||
export const SEARCH_TEXT_INPUT_DIRECTIVES = [SearchTextInputComponent, SearchTriggerDirective] as const;
|
||||
|
||||
/** @deprecated use `...SEARCH_TEXT_INPUT_DIRECTIVES` or import the individual directives */
|
||||
@NgModule({
|
||||
imports: [SearchTextInputComponent, SearchTriggerDirective],
|
||||
exports: [SearchTextInputComponent, SearchTriggerDirective]
|
||||
imports: [...SEARCH_TEXT_INPUT_DIRECTIVES],
|
||||
exports: [...SEARCH_TEXT_INPUT_DIRECTIVES]
|
||||
})
|
||||
export class SearchTextModule {}
|
||||
|
@@ -1,24 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
export const initialSortingTypes: Array<{key: string; label: string}> = [
|
||||
{ key: 'sortByFirstName', label: 'First Name' },
|
||||
{ key: 'sortByLastName', label: 'Last Name' },
|
||||
{ key: 'sortByBirthDate', label: 'Birth Date' }
|
||||
];
|
||||
|
||||
export const initialOptionKeys = [...initialSortingTypes.map((type) => type.key.toString())];
|
@@ -16,4 +16,3 @@
|
||||
*/
|
||||
|
||||
export * from './sorting-picker.component';
|
||||
export * from './sorting-picker.module';
|
||||
|
@@ -17,17 +17,23 @@
|
||||
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CoreStoryModule } from '../testing/core.story.module';
|
||||
import { SortingPickerModule } from './sorting-picker.module';
|
||||
import { SortingPickerComponent } from './sorting-picker.component';
|
||||
import { initialOptionKeys, initialSortingTypes } from './mock/sorting-picker.mock';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
const initialSortingTypes: Array<{ key: string; label: string }> = [
|
||||
{ key: 'sortByFirstName', label: 'First Name' },
|
||||
{ key: 'sortByLastName', label: 'Last Name' },
|
||||
{ key: 'sortByBirthDate', label: 'Birth Date' }
|
||||
];
|
||||
|
||||
const initialOptionKeys = [...initialSortingTypes.map((type) => type.key.toString())];
|
||||
|
||||
export default {
|
||||
component: SortingPickerComponent,
|
||||
title: 'Core/Sorting Picker/Sorting Picker',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [SortingPickerModule]
|
||||
imports: [SortingPickerComponent]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
@@ -90,7 +96,7 @@ export default {
|
||||
}
|
||||
} as Meta<SortingPickerComponent>;
|
||||
|
||||
const template: StoryFn<SortingPickerModule> = (args) => ({
|
||||
const template: StoryFn<SortingPickerComponent> = (args) => ({
|
||||
props: args
|
||||
});
|
||||
|
||||
|
@@ -16,19 +16,25 @@
|
||||
*/
|
||||
|
||||
import { Component, ViewEncapsulation, Input, EventEmitter, Output } from '@angular/core';
|
||||
import { MatSelectChange } from '@angular/material/select';
|
||||
import { MatSelectChange, MatSelectModule } from '@angular/material/select';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-sorting-picker',
|
||||
standalone: true,
|
||||
imports: [CommonModule, TranslateModule, MatFormFieldModule, MatSelectModule, MatButtonModule, MatIconModule],
|
||||
templateUrl: './sorting-picker.component.html',
|
||||
encapsulation: ViewEncapsulation.None,
|
||||
host: { class: 'adf-sorting-picker' }
|
||||
})
|
||||
export class SortingPickerComponent {
|
||||
|
||||
/** Available sorting options */
|
||||
@Input()
|
||||
options: Array<{key: string; label: string}> = [];
|
||||
options: Array<{ key: string; label: string }> = [];
|
||||
|
||||
/** Currently selected option key */
|
||||
@Input()
|
||||
|
@@ -1,41 +0,0 @@
|
||||
/*!
|
||||
* @license
|
||||
* Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
import { TranslateModule } from '@ngx-translate/core';
|
||||
import { SortingPickerComponent } from './sorting-picker.component';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
MatButtonModule,
|
||||
MatIconModule,
|
||||
MatSelectModule,
|
||||
TranslateModule
|
||||
],
|
||||
declarations: [
|
||||
SortingPickerComponent
|
||||
],
|
||||
exports: [
|
||||
SortingPickerComponent
|
||||
]
|
||||
})
|
||||
export class SortingPickerModule {}
|
@@ -16,8 +16,6 @@ $mat-tab-body: '.mat-mdc-tab-body';
|
||||
$mat-tab-body-wrapper: '.mat-mdc-tab-body-wrapper';
|
||||
$mat-tab-body-content: '.mat-mdc-tab-body-content';
|
||||
$mat-tab-header: '.mat-mdc-tab-header';
|
||||
$mat-tab-header-pagination: '.mat-mdc-tab-header-pagination';
|
||||
$mat-tab-header-pagination-controls-enabled: '.mat-mdc-tab-header-pagination-controls-enabled';
|
||||
$mat-tab-labels: '.mat-mdc-tab-labels';
|
||||
$mat-tab-ink-bar: '.mdc-tab-indicator';
|
||||
$mat-chip: '.mat-mdc-chip';
|
||||
@@ -31,15 +29,9 @@ $mat-checkbox-checked: '.mat-mdc-checkbox-checked';
|
||||
$mat-button: '.mat-mdc-button';
|
||||
$mat-button-label: '.mdc-button__label';
|
||||
$mat-button-label-text: '.mdc-button__label';
|
||||
$mat-button-focus-overlay: '.mat-button-focus-overlay';
|
||||
$mat-raised-button: '.mat-mdc-raised-button';
|
||||
$mat-radio-outer-circle: '.mdc-radio__outer-circle';
|
||||
$mat-radio-inner-circle: '.mdc-radio__inner-circle';
|
||||
$mat-radio-checked: '.mat-mdc-radio-checked';
|
||||
$mat-radio-label-content: '.mdc-label';
|
||||
$mat-radio-label: '.mdc-label';
|
||||
$mat-progress-bar: '.mat-mdc-progress-bar';
|
||||
$mat-progress-bar-buffer: '.mdc-linear-progress__buffer';
|
||||
$mat-progress-spinner: '.mat-mdc-progress-spinner';
|
||||
$mat-form-field: '.mat-mdc-form-field';
|
||||
$mat-form-field-flex: '.mat-mdc-form-field-flex';
|
||||
@@ -60,8 +52,6 @@ $mat-dialog-container: '.mdc-dialog__container';
|
||||
$mat-dialog-content: '.mat-mdc-dialog-content';
|
||||
$mat-button-toggle: '.mat-button-toggle';
|
||||
$mat-button-toggle-checked: '.mat-button-toggle-checked';
|
||||
$mat-button-toggle-disabled: '.mat-button-toggle-disabled';
|
||||
$mat-button-toggle-focus-overlay: '.mat-button-toggle-focus-overlay';
|
||||
$mat-button-touch-target: '.mat-mdc-button-touch-target';
|
||||
$mat-input-element: '.mat-mdc-input-element';
|
||||
$mat-card: '.mat-mdc-card';
|
||||
@@ -188,23 +178,8 @@ $mat-text-field: '.mdc-text-field';
|
||||
$mat-form-field-disabled: '.mat-form-field-disabled';
|
||||
$mat-select-disabled: '.mat-mdc-select-disabled';
|
||||
$mat-select-value: '.mat-mdc-select-value';
|
||||
$mat-ripple: '.mat-ripple';
|
||||
$mat-checkbox-native-control: '.mdc-checkbox__native-control';
|
||||
$mat-checkbox-selected: '.mdc-checkbox--selected';
|
||||
$mat-checkbox-ripple: '.mat-mdc-checkbox-ripple';
|
||||
$mdc-checkbox-ripple: '.mdc-checkbox__ripple';
|
||||
$mat-list-base: '.mat-mdc-list-base';
|
||||
$mat-list-option: '.mat-mdc-list-option';
|
||||
$mat-option: '.mat-mdc-option';
|
||||
$mat-option-ripple: '.mat-mdc-option-ripple';
|
||||
$mat-snackbar-simple: '.mat-mdc-simple-snack-bar';
|
||||
$mat-snackbar-action: '.mat-mdc-snack-bar-action';
|
||||
$mat-slide-toggle-checked: '.mat-mdc-slide-toggle-checked';
|
||||
$mat-button-outlined: '.mat-mdc-outlined-button';
|
||||
$mat-button-unelevated: '.mat-mdc-unelevated-button';
|
||||
$mat-button-ripple: '.mat-mdc-button-ripple';
|
||||
$mat-datetimepicker-calendar-body-active: '.mat-datetimepicker-calendar-body-active';
|
||||
$mat-datetimepicker-calendar-body-cell-content: '.mat-datetimepicker-calendar-body-cell-content';
|
||||
$mat-datetimepicker-calendar-body-selected: '.mat-datetimepicker-calendar-body-selected';
|
||||
$mat-disabled: '.mat-disabled';
|
||||
$mat-card-header: '.mat-mdc-card-header';
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { EmptyContentComponent } from './empty-content.component';
|
||||
import { CoreStoryModule } from '../../testing/core.story.module';
|
||||
import { TemplateModule } from '../template.module';
|
||||
import { TEMPLATE_DIRECTIVES } from '../template.module';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
export default {
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
title: 'Core/Template/Empty Content',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CoreStoryModule, TemplateModule]
|
||||
imports: [CoreStoryModule, ...TEMPLATE_DIRECTIVES]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
|
@@ -19,12 +19,14 @@ import { NgModule } from '@angular/core';
|
||||
import { ErrorContentComponent } from './error-content/error-content.component';
|
||||
import { EmptyContentComponent } from './empty-content/empty-content.component';
|
||||
|
||||
export const TEMPLATE_DIRECTIVES = [ErrorContentComponent, EmptyContentComponent] as const;
|
||||
|
||||
/**
|
||||
* @deprecated this Module is deprecated and should no longer be used.
|
||||
* Consider importing components directly instead.
|
||||
* Consider using `...TEMPLATE_DIRECTIVES` or importing components directly instead.
|
||||
*/
|
||||
@NgModule({
|
||||
imports: [ErrorContentComponent, EmptyContentComponent],
|
||||
exports: [ErrorContentComponent, EmptyContentComponent]
|
||||
imports: [...TEMPLATE_DIRECTIVES],
|
||||
exports: [...TEMPLATE_DIRECTIVES]
|
||||
})
|
||||
export class TemplateModule {}
|
||||
|
@@ -18,14 +18,14 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { CoreTestingModule } from '../testing/core.testing.module';
|
||||
import { ToolbarComponent } from './toolbar.component';
|
||||
import { ToolbarModule } from './toolbar.module';
|
||||
import { TOOLBAR_DIRECTIVES } from './toolbar.module';
|
||||
|
||||
describe('ToolbarComponent', () => {
|
||||
let fixture: ComponentFixture<ToolbarComponent>;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [CoreTestingModule, ToolbarModule]
|
||||
imports: [CoreTestingModule, ...TOOLBAR_DIRECTIVES]
|
||||
});
|
||||
|
||||
fixture = TestBed.createComponent(ToolbarComponent);
|
||||
|
@@ -18,7 +18,7 @@
|
||||
import { applicationConfig, Meta, moduleMetadata, StoryFn } from '@storybook/angular';
|
||||
import { CoreStoryModule } from '../testing/core.story.module';
|
||||
import { ToolbarComponent } from './toolbar.component';
|
||||
import { ToolbarModule } from './toolbar.module';
|
||||
import { TOOLBAR_DIRECTIVES } from './toolbar.module';
|
||||
import { importProvidersFrom } from '@angular/core';
|
||||
|
||||
export default {
|
||||
@@ -26,7 +26,7 @@ export default {
|
||||
title: 'Core/Toolbar/Toolbar',
|
||||
decorators: [
|
||||
moduleMetadata({
|
||||
imports: [CoreStoryModule, ToolbarModule]
|
||||
imports: [CoreStoryModule, ...TOOLBAR_DIRECTIVES]
|
||||
}),
|
||||
applicationConfig({
|
||||
providers: [importProvidersFrom(CoreStoryModule)]
|
||||
|
@@ -20,8 +20,11 @@ import { ToolbarDividerComponent } from './toolbar-divider.component';
|
||||
import { ToolbarTitleComponent } from './toolbar-title.component';
|
||||
import { ToolbarComponent } from './toolbar.component';
|
||||
|
||||
export const TOOLBAR_DIRECTIVES = [ToolbarComponent, ToolbarTitleComponent, ToolbarDividerComponent] as const;
|
||||
|
||||
/** @deprecated use `...TOOLBAR_DIRECTIVES` or import standalone components */
|
||||
@NgModule({
|
||||
imports: [ToolbarComponent, ToolbarTitleComponent, ToolbarDividerComponent],
|
||||
exports: [ToolbarComponent, ToolbarTitleComponent, ToolbarDividerComponent]
|
||||
imports: [...TOOLBAR_DIRECTIVES],
|
||||
exports: [...TOOLBAR_DIRECTIVES]
|
||||
})
|
||||
export class ToolbarModule {}
|
||||
|
@@ -56,6 +56,7 @@ export const VIEWER_DIRECTIVES = [
|
||||
DownloadPromptDialogComponent
|
||||
] as const;
|
||||
|
||||
/** @deprecated use `...VIEWER_DIRECTIVES` or import standalone directives */
|
||||
@NgModule({
|
||||
imports: [...VIEWER_DIRECTIVES],
|
||||
exports: [...VIEWER_DIRECTIVES]
|
||||
|
@@ -60,5 +60,5 @@ export * from './lib/testing';
|
||||
export * from './lib/auth';
|
||||
export * from './lib/common';
|
||||
|
||||
export * from './lib/material.module';
|
||||
export * from './lib/core.module';
|
||||
export * from './lib/material.module';
|
||||
|
Reference in New Issue
Block a user