@cityway/bo-ui 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +37 -0
- package/ng-package.json +21 -0
- package/package.json +21 -32
- package/src/lib/bo-ui.config.ts +8 -0
- package/src/lib/components/accordions/accordions.component.html +16 -0
- package/src/lib/components/accordions/accordions.component.spec.ts +24 -0
- package/src/lib/components/accordions/accordions.component.ts +27 -0
- package/src/lib/components/accordions/components/accordions-content.component.spec.ts +24 -0
- package/src/lib/components/accordions/components/accordions-content.component.ts +28 -0
- package/src/lib/components/alert/alert.component.html +15 -0
- package/src/lib/components/alert/alert.component.spec.ts +24 -0
- package/src/lib/components/alert/alert.component.ts +36 -0
- package/src/lib/components/badge/badge.component.html +7 -0
- package/src/lib/components/badge/badge.component.spec.ts +24 -0
- package/src/lib/components/badge/badge.component.ts +24 -0
- package/src/lib/components/button/button.component.html +43 -0
- package/src/lib/components/button/button.component.spec.ts +25 -0
- package/src/lib/components/button/button.component.ts +47 -0
- package/src/lib/components/card/card.component.html +15 -0
- package/src/lib/components/card/card.component.spec.ts +25 -0
- package/src/lib/components/card/card.component.ts +30 -0
- package/src/lib/components/custom-list/custom-list.component.html +31 -0
- package/src/lib/components/custom-list/custom-list.component.spec.ts +24 -0
- package/src/lib/components/custom-list/custom-list.component.ts +42 -0
- package/src/lib/components/drag-n-drop-list/drag-n-drop-list.component.html +27 -0
- package/src/lib/components/drag-n-drop-list/drag-n-drop-list.component.spec.ts +24 -0
- package/src/lib/components/drag-n-drop-list/drag-n-drop-list.component.ts +40 -0
- package/src/lib/components/form-field/form-field.component.html +333 -0
- package/src/lib/components/form-field/form-field.component.spec.ts +24 -0
- package/src/lib/components/form-field/form-field.component.ts +256 -0
- package/src/lib/components/icon/icon.component.html +9 -0
- package/src/lib/components/icon/icon.component.spec.ts +25 -0
- package/src/lib/components/icon/icon.component.ts +31 -0
- package/src/lib/components/layout/admin-layout/admin-layout.component.html +17 -0
- package/src/lib/components/layout/admin-layout/admin-layout.component.ts +181 -0
- package/src/lib/components/layout/footer/footer.component.html +51 -0
- package/src/lib/components/layout/footer/footer.component.ts +65 -0
- package/src/lib/components/layout/header/header.component.html +71 -0
- package/src/lib/components/layout/header/header.component.ts +95 -0
- package/src/lib/components/layout/menu/menu.component.html +115 -0
- package/src/lib/components/layout/menu/menu.component.ts +75 -0
- package/src/lib/components/layout/menu-accordion/accordion.directive.ts +57 -0
- package/src/lib/components/layout/menu-accordion/accordionanchor.directive.ts +21 -0
- package/src/lib/components/layout/menu-accordion/accordionlink.directive.ts +45 -0
- package/src/lib/components/layout/menu-accordion/index.ts +3 -0
- package/src/lib/components/layout/sidebar/sidebar.component.html +62 -0
- package/src/lib/components/layout/sidebar/sidebar.component.ts +28 -0
- package/src/lib/components/layout/skip-links/skip-links.component.html +3 -0
- package/src/lib/components/layout/skip-links/skip-links.component.spec.ts +25 -0
- package/src/lib/components/layout/skip-links/skip-links.component.ts +19 -0
- package/src/lib/components/layout/title-breadcrumb/title-breadcrumb.component.html +10 -0
- package/src/lib/components/layout/title-breadcrumb/title-breadcrumb.component.spec.ts +25 -0
- package/src/lib/components/layout/title-breadcrumb/title-breadcrumb.component.ts +16 -0
- package/src/lib/components/legend/legend.component.html +23 -0
- package/src/lib/components/legend/legend.component.spec.ts +24 -0
- package/src/lib/components/legend/legend.component.ts +28 -0
- package/src/lib/components/loader/loader.component.html +4 -0
- package/src/lib/components/loader/loader.component.ts +16 -0
- package/src/lib/components/modals/modals.component.html +71 -0
- package/src/lib/components/modals/modals.component.spec.ts +25 -0
- package/src/lib/components/modals/modals.component.ts +49 -0
- package/src/lib/components/tab/components/tab-content.component.spec.ts +24 -0
- package/src/lib/components/tab/components/tab-content.component.ts +27 -0
- package/src/lib/components/tab/tab.component.html +59 -0
- package/src/lib/components/tab/tab.component.spec.ts +24 -0
- package/src/lib/components/tab/tab.component.ts +79 -0
- package/src/lib/components/table/components/actions-on-table/actions-on-table.component.html +50 -0
- package/src/lib/components/table/components/actions-on-table/actions-on-table.component.spec.ts +24 -0
- package/src/lib/components/table/components/actions-on-table/actions-on-table.component.ts +33 -0
- package/src/lib/components/table/components/filter/filter.component.html +21 -0
- package/src/lib/components/table/components/filter/filter.component.spec.ts +24 -0
- package/src/lib/components/table/components/filter/filter.component.ts +38 -0
- package/src/lib/components/table/table.component.html +104 -0
- package/src/lib/components/table/table.component.spec.ts +24 -0
- package/src/lib/components/table/table.component.ts +85 -0
- package/src/lib/components/wizard-stepper/components/wizard-step.component.spec.ts +25 -0
- package/src/lib/components/wizard-stepper/components/wizard-step.component.ts +16 -0
- package/src/lib/components/wizard-stepper/wizard-stepper.component.html +45 -0
- package/src/lib/components/wizard-stepper/wizard-stepper.component.spec.ts +25 -0
- package/src/lib/components/wizard-stepper/wizard-stepper.component.ts +70 -0
- package/src/lib/directives/double-scroll.ts +64 -0
- package/src/lib/directives/rwd-tabs.ts +99 -0
- package/src/lib/directives/show-hide-password.ts +61 -0
- package/src/lib/enum/drag-item.enum.ts +5 -0
- package/src/lib/enum/field-type.enum.ts +36 -0
- package/src/lib/enum/legend-type.enum.ts +5 -0
- package/src/lib/enum/modals.enum.ts +6 -0
- package/src/lib/enum/ui-type.enum.ts +11 -0
- package/src/lib/models/ui/custom-list.model.ts +14 -0
- package/src/lib/models/ui/legend.model.ts +17 -0
- package/src/lib/models/ui/table.model.ts +33 -0
- package/src/lib/services/ui/modals.service.ts +47 -0
- package/src/lib/services/version.service.ts +22 -0
- package/src/public-api.ts +49 -0
- package/tsconfig.lib.json +18 -0
- package/tsconfig.lib.prod.json +11 -0
- package/tsconfig.spec.json +14 -0
- package/tslint.json +17 -0
- package/cityway-bo-ui-1.0.0.tgz +0 -0
- package/fesm2022/cityway-bo-ui.mjs +0 -1598
- package/fesm2022/cityway-bo-ui.mjs.map +0 -1
- package/index.d.ts +0 -509
- package/styles.min.css +0 -5
- package/styles.min.css.map +0 -1
- /package/{lib → src/lib}/assets/fonts/bo/_variables.scss +0 -0
- /package/{lib → src/lib}/assets/fonts/bo/bo.scss +0 -0
- /package/{lib → src/lib}/assets/fonts/bo/bo.woff +0 -0
- /package/{lib → src/lib}/assets/fonts/bo/bo.woff2 +0 -0
- /package/{lib → src/lib}/assets/fonts/nunito/_nunito.scss +0 -0
- /package/{lib → src/lib}/assets/fonts/nunito/nunito-bold.woff +0 -0
- /package/{lib → src/lib}/assets/fonts/nunito/nunito-bold.woff2 +0 -0
- /package/{lib → src/lib}/assets/fonts/nunito/nunito-extrabold.woff +0 -0
- /package/{lib → src/lib}/assets/fonts/nunito/nunito-extrabold.woff2 +0 -0
- /package/{lib → src/lib}/assets/fonts/nunito/nunito-regular.woff +0 -0
- /package/{lib → src/lib}/assets/fonts/nunito/nunito-regular.woff2 +0 -0
- /package/{lib → src/lib}/assets/fonts/nunito/nunito-semi-bold.woff +0 -0
- /package/{lib → src/lib}/assets/fonts/nunito/nunito-semi-bold.woff2 +0 -0
- /package/{lib → src/lib}/assets/fonts/optyweb/_variables.scss +0 -0
- /package/{lib → src/lib}/assets/fonts/optyweb/optyweb.scss +0 -0
- /package/{lib → src/lib}/assets/fonts/optyweb/optyweb.woff +0 -0
- /package/{lib → src/lib}/assets/fonts/optyweb/optyweb.woff2 +0 -0
- /package/{lib → src/lib}/assets/i18n/common.en.json +0 -0
- /package/{lib → src/lib}/assets/i18n/common.fr.json +0 -0
- /package/{lib → src/lib}/assets/i18n/label.en.json +0 -0
- /package/{lib → src/lib}/assets/i18n/label.fr.json +0 -0
- /package/{lib → src/lib}/assets/images/common/bg-loader.svg +0 -0
- /package/{lib → src/lib}/assets/images/common/bg-menu.svg +0 -0
- /package/{lib → src/lib}/assets/images/common/bg-round.svg +0 -0
- /package/{lib → src/lib}/assets/images/common/check-mark.svg +0 -0
- /package/{lib → src/lib}/assets/images/common/loader.svg +0 -0
- /package/{lib → src/lib}/assets/images/common/logo-en-bw.svg +0 -0
- /package/{lib → src/lib}/assets/images/common/logo-en.svg +0 -0
- /package/{lib → src/lib}/assets/images/common/logo-fr-bw.svg +0 -0
- /package/{lib → src/lib}/assets/images/common/logo-fr.svg +0 -0
- /package/{lib → src/lib}/assets/images/favicon/android-chrome-192x192.png +0 -0
- /package/{lib → src/lib}/assets/images/favicon/android-chrome-512x512.png +0 -0
- /package/{lib → src/lib}/assets/images/favicon/apple-touch-icon.png +0 -0
- /package/{lib → src/lib}/assets/images/favicon/favicon-16x16.png +0 -0
- /package/{lib → src/lib}/assets/images/favicon/favicon-32x32.png +0 -0
- /package/{lib → src/lib}/assets/images/favicon/favicon-96x96.png +0 -0
- /package/{lib → src/lib}/assets/images/favicon/favicon.ico +0 -0
- /package/{lib → src/lib}/assets/images/favicon/site.webmanifest +0 -0
- /package/{lib → src/lib}/assets/images/icon/referential-icon.svg +0 -0
- /package/{lib → src/lib}/assets/images/login/login-bg.jpg +0 -0
- /package/{lib → src/lib}/assets/images/login/logo-cityway-baseline.svg +0 -0
- /package/{lib → src/lib}/assets/images/toast/warning.svg +0 -0
- /package/{lib → src/lib}/assets/styles/scss/_components.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/_core.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/_custom-bootstrap.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_accordion.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_alert.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_badge.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_breadcrumb.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_button-group.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_buttons.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_card.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_close.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_dropdown.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_forms.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_input-group.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_lists.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_modal.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_pagination.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_popover.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_progress.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_reboot.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_tables.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_tabs.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_tooltip.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/bootstrap/_type.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_forms-firefox.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_leaflet.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_legend.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_ng-select.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_ng2-dragula.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_ng2-validation.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_ng5-slider.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_ngb-datepicker.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_ngb-timepicker.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_ngx-chips.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_ngx-editor.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_ngx-file-drop.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_ngx-intl-tel-input.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_ngx-slider.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_ngx-toast.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_pwd-policy.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_table.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_vis.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/_wizard-stepper.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/table/_table-action.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/table/_table-bg-cell.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/table/_table-double-scroll.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/table/_table-filter.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/table/_table-pagination.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/table/_table-popover.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/components/table/_table-sorting.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/core/_footer.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/core/_header.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/core/_layout.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/core/_menu.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/core/_sidebar.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/mixins/_utilities.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/styles.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/tools/_focus.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/tools/_loader.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/variables/_colors.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/variables/_custom.scss +0 -0
- /package/{lib → src/lib}/assets/styles/scss/variables/_site.scss +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { TitleBreadcrumbComponent } from './title-breadcrumb.component';
|
|
4
|
+
|
|
5
|
+
describe('TitleBreadcrumbComponent', () => {
|
|
6
|
+
let component: TitleBreadcrumbComponent;
|
|
7
|
+
let fixture: ComponentFixture<TitleBreadcrumbComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(waitForAsync(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ TitleBreadcrumbComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(TitleBreadcrumbComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Component, Input } from '@angular/core';
|
|
3
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
4
|
+
|
|
5
|
+
@Component({
|
|
6
|
+
selector: 'app-title-breadcrumb',
|
|
7
|
+
templateUrl: './title-breadcrumb.component.html',
|
|
8
|
+
standalone: true,
|
|
9
|
+
imports: [
|
|
10
|
+
TranslateModule,
|
|
11
|
+
CommonModule
|
|
12
|
+
]
|
|
13
|
+
})
|
|
14
|
+
export class TitleBreadcrumbComponent {
|
|
15
|
+
@Input() heading: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<div *ngIf="legend.title" class="legend-title">
|
|
2
|
+
{{ '_COMMON._TABLE.LEGEND' | translate }}
|
|
3
|
+
</div>
|
|
4
|
+
<ul class="list-inline legend-items">
|
|
5
|
+
@for (item of legend.data; track $index) {
|
|
6
|
+
<li class="list-inline-item legend-item">
|
|
7
|
+
@switch (item.type) {
|
|
8
|
+
@case (legendTypeEnum.icon) {
|
|
9
|
+
<app-icon [icon]="item.icon" [label]="item.label" [iconCssClass]="'text-' + item.colorUi" [iconColorCustom]="item.colorCustom">
|
|
10
|
+
</app-icon>
|
|
11
|
+
}
|
|
12
|
+
@case (legendTypeEnum.badge) {
|
|
13
|
+
<app-badge [type]="item.colorUi" [label]="item.labelBadge"></app-badge>
|
|
14
|
+
{{item.label}}
|
|
15
|
+
}
|
|
16
|
+
@case (legendTypeEnum.color) {
|
|
17
|
+
<span class="legend-item-color" [ngClass]="item.colorUi ?'legend-' + item.colorUi : ''" [style.background-color]="item.colorCustom"></span>
|
|
18
|
+
{{item.label}}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
</li>
|
|
22
|
+
}
|
|
23
|
+
</ul>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { LegendComponent } from './legend.component';
|
|
3
|
+
|
|
4
|
+
describe('LegendComponen', () => {
|
|
5
|
+
let component: LegendComponent;
|
|
6
|
+
let fixture: ComponentFixture<LegendComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [ LegendComponent ]
|
|
11
|
+
})
|
|
12
|
+
.compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(LegendComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Component, Input } from '@angular/core';
|
|
3
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
4
|
+
import { LegendTypeEnum } from '../../enum/legend-type.enum';
|
|
5
|
+
import { Legend } from '../../models/ui/legend.model';
|
|
6
|
+
import { BadgeComponent } from '../badge/badge.component';
|
|
7
|
+
import { IconComponent } from '../icon/icon.component';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'app-legend',
|
|
11
|
+
templateUrl: './legend.component.html',
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [
|
|
14
|
+
CommonModule,
|
|
15
|
+
IconComponent,
|
|
16
|
+
BadgeComponent,
|
|
17
|
+
TranslateModule
|
|
18
|
+
]
|
|
19
|
+
})
|
|
20
|
+
export class LegendComponent {
|
|
21
|
+
|
|
22
|
+
@Input() legend: Legend;
|
|
23
|
+
|
|
24
|
+
public legendTypeEnum = LegendTypeEnum;
|
|
25
|
+
|
|
26
|
+
constructor() { }
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
3
|
+
|
|
4
|
+
@Component({
|
|
5
|
+
selector: 'app-loader',
|
|
6
|
+
templateUrl: './loader.component.html',
|
|
7
|
+
standalone: true,
|
|
8
|
+
imports: [
|
|
9
|
+
TranslateModule
|
|
10
|
+
]
|
|
11
|
+
})
|
|
12
|
+
export class LoaderComponent {
|
|
13
|
+
|
|
14
|
+
constructor() { }
|
|
15
|
+
|
|
16
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
@if (type !== modalsType.loader) {
|
|
2
|
+
<div class="modal-header">
|
|
3
|
+
@if (type === modalsType.delete) {
|
|
4
|
+
<h1 class="modal-title" id="modal-basic-title">
|
|
5
|
+
{{ '_COMMON._MODAL_DELETE.TITLE' | translate: { number: itemsToDelete.length, name: itemsToDeleteTitle } }}
|
|
6
|
+
</h1>
|
|
7
|
+
}
|
|
8
|
+
@else {
|
|
9
|
+
<h1 class="modal-title" id="modal-basic-title">
|
|
10
|
+
{{ modalTitle | translate }}
|
|
11
|
+
</h1>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
<button type="button" class="btn-close" [attr.aria-label]="'_COMMON._ACTION.CLOSE' | translate"
|
|
15
|
+
(click)="activeModal.dismiss()" data-test-ctw="btn-close-modal">
|
|
16
|
+
</button>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="modal-body">
|
|
20
|
+
@if (type === modalsType.delete) {
|
|
21
|
+
@if (itemsToDelete.length === 1) {
|
|
22
|
+
<div [innerHTML]="'_COMMON._MODAL_DELETE.SIMPLE_TEXT' | translate"></div>
|
|
23
|
+
}
|
|
24
|
+
@if (itemsToDelete.length > 1) {
|
|
25
|
+
<div [innerHTML]="'_COMMON._MODAL_DELETE.MULTIPLE_TEXT' | translate"></div>
|
|
26
|
+
}
|
|
27
|
+
@if (itemsToDelete.length > 0) {
|
|
28
|
+
<ul class="mb-0">
|
|
29
|
+
@for (item of itemsToDelete; track item) {
|
|
30
|
+
<li>{{ item }}</li>
|
|
31
|
+
}
|
|
32
|
+
</ul>
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
@else if (type === modalsType.custom || type === modalsType.quickSideView) {
|
|
36
|
+
@if (customBodyTemplate) {
|
|
37
|
+
<ng-container [ngTemplateOutlet]="customBodyTemplate" [ngTemplateOutletContext]="customBodyContext">
|
|
38
|
+
</ng-container>
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<div class="modal-footer">
|
|
44
|
+
@if (type === modalsType.delete) {
|
|
45
|
+
<app-button label="_COMMON._ACTION.DELETE" [type]="buttonTypeEnum.danger" [isMinWidth]="true"
|
|
46
|
+
(btnAction)="actionClick()" dataTest="btn-action-modal">
|
|
47
|
+
</app-button>
|
|
48
|
+
|
|
49
|
+
<app-button label="_COMMON._ACTION.CANCEL" [type]="buttonTypeEnum.secondary" [isMinWidth]="true"
|
|
50
|
+
(btnAction)="activeModal.dismiss()" dataTest="btn-close-modal">
|
|
51
|
+
</app-button>
|
|
52
|
+
}
|
|
53
|
+
@else {
|
|
54
|
+
@if(labelBtnAction) {
|
|
55
|
+
<app-button [label]="labelBtnAction | translate" [type]="buttonTypeEnum.primary" [isMinWidth]="true"
|
|
56
|
+
(btnAction)="actionClick()" dataTest="btn-close-modal">
|
|
57
|
+
</app-button>
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
<app-button label="_COMMON._ACTION.CLOSE" [type]="buttonTypeEnum.secondary" [isMinWidth]="true"
|
|
61
|
+
(btnAction)="activeModal.dismiss()" dataTest="btn-close-modal">
|
|
62
|
+
</app-button>
|
|
63
|
+
}
|
|
64
|
+
</div>
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@if (type === modalsType.loader) {
|
|
68
|
+
<div class="modal-body">
|
|
69
|
+
<app-loader></app-loader>
|
|
70
|
+
</div>
|
|
71
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { ModalsComponent } from './modals.component';
|
|
4
|
+
|
|
5
|
+
describe('ModalsComponent', () => {
|
|
6
|
+
let component: ModalsComponent;
|
|
7
|
+
let fixture: ComponentFixture<ModalsComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
declarations: [ ModalsComponent ]
|
|
12
|
+
})
|
|
13
|
+
.compileComponents();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
beforeEach(() => {
|
|
17
|
+
fixture = TestBed.createComponent(ModalsComponent);
|
|
18
|
+
component = fixture.componentInstance;
|
|
19
|
+
fixture.detectChanges();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it('should create', () => {
|
|
23
|
+
expect(component).toBeTruthy();
|
|
24
|
+
});
|
|
25
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, OnInit, Output, TemplateRef } from '@angular/core';
|
|
2
|
+
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap';
|
|
3
|
+
import { ModalsType } from '../../enum/modals.enum';
|
|
4
|
+
import { UiTypeEnum } from '../../enum/ui-type.enum';
|
|
5
|
+
import { TranslateService } from '@ngx-translate/core';
|
|
6
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
7
|
+
import { CommonModule } from '@angular/common';
|
|
8
|
+
import { ButtonComponent } from '../button/button.component';
|
|
9
|
+
import { LoaderComponent } from '../loader/loader.component';
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'app-modals',
|
|
13
|
+
templateUrl: './modals.component.html',
|
|
14
|
+
standalone: true,
|
|
15
|
+
imports: [
|
|
16
|
+
CommonModule,
|
|
17
|
+
TranslateModule,
|
|
18
|
+
ButtonComponent,
|
|
19
|
+
LoaderComponent
|
|
20
|
+
]
|
|
21
|
+
})
|
|
22
|
+
export class ModalsComponent implements OnInit {
|
|
23
|
+
@Input() type: ModalsType;
|
|
24
|
+
@Input() modalTitle: string;
|
|
25
|
+
@Input() itemsToDelete: any[] = [];
|
|
26
|
+
@Input() itemsToDeleteTitle = this.translateService.instant('_COMMON._MODAL_DELETE.DEFAULT_TYPE');
|
|
27
|
+
@Input() labelBtnAction: string;
|
|
28
|
+
@Input() customBodyTemplate?: TemplateRef<any>;
|
|
29
|
+
@Input() customBodyContext?: any;
|
|
30
|
+
|
|
31
|
+
@Output() btnAction = new EventEmitter<string>();
|
|
32
|
+
|
|
33
|
+
public modalsType = ModalsType;
|
|
34
|
+
public buttonTypeEnum = UiTypeEnum;
|
|
35
|
+
|
|
36
|
+
constructor(
|
|
37
|
+
public activeModal: NgbActiveModal,
|
|
38
|
+
private translateService: TranslateService
|
|
39
|
+
) { }
|
|
40
|
+
|
|
41
|
+
ngOnInit(): void {
|
|
42
|
+
this.labelBtnAction = this.type === this.modalsType.quickSideView
|
|
43
|
+
? this.translateService.instant('_COMMON._ACTION.EDIT') : this.labelBtnAction;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public actionClick() {
|
|
47
|
+
this.activeModal.close();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { TabContentComponent } from './tab-content.component';
|
|
3
|
+
|
|
4
|
+
describe('TabContentComponent', () => {
|
|
5
|
+
let component: TabContentComponent;
|
|
6
|
+
let fixture: ComponentFixture<TabContentComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [ TabContentComponent ]
|
|
11
|
+
})
|
|
12
|
+
.compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(TabContentComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Component, Input, TemplateRef, ViewChild } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
@Component({
|
|
4
|
+
selector: 'app-tab-content',
|
|
5
|
+
template: '<ng-template #content><ng-content></ng-content></ng-template>',
|
|
6
|
+
standalone: true
|
|
7
|
+
})
|
|
8
|
+
export class TabContentComponent {
|
|
9
|
+
@Input() title!: string;
|
|
10
|
+
@Input() disabled = false;
|
|
11
|
+
|
|
12
|
+
@ViewChild('content', { static: true }) templateRef!: TemplateRef<any>;
|
|
13
|
+
|
|
14
|
+
get fragment(): string {
|
|
15
|
+
return this.slugify(this.title);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
private slugify(text: string): string {
|
|
19
|
+
return text
|
|
20
|
+
.toLowerCase()
|
|
21
|
+
.trim()
|
|
22
|
+
.normalize('NFD')
|
|
23
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
24
|
+
.replace(/[^a-z0-9]+/g, '-')
|
|
25
|
+
.replace(/^-+|-+$/g, '');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
@if (!basicDisplay) {
|
|
2
|
+
<div class="card">
|
|
3
|
+
@if (title) {
|
|
4
|
+
<h2 class="card-header">{{ title | translate }}</h2>
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
<div class="card-body p-0">
|
|
8
|
+
<ul ngbNav #nav="ngbNav" [(activeId)]="activeId" class="nav-tabs nav-tabs-card"
|
|
9
|
+
(activeIdChange)="onTabChange($event)" appRwdTabs>
|
|
10
|
+
@for (tab of tabs.toArray(); track tab; let i = $index) {
|
|
11
|
+
<li [ngbNavItem]="i" [disabled]="tab.disabled">
|
|
12
|
+
<a ngbNavLink [attr.data-test-ctw]="'link-tab-' + id + '-' + i">
|
|
13
|
+
{{ tab.title | translate }}
|
|
14
|
+
</a>
|
|
15
|
+
<ng-template ngbNavContent>
|
|
16
|
+
<ng-container *ngTemplateOutlet="tab.templateRef"></ng-container>
|
|
17
|
+
</ng-template>
|
|
18
|
+
</li>
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
<li ngbDropdown class="nav-item d-none" placement="bottom-right">
|
|
22
|
+
<button (click)="false" class="nav-link" ngbDropdownToggle>
|
|
23
|
+
{{ '_COMMON._ACTION.MORE' | translate }}
|
|
24
|
+
</button>
|
|
25
|
+
<ul ngbDropdownMenu placement="bottom right"></ul>
|
|
26
|
+
</li>
|
|
27
|
+
</ul>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div [ngbNavOutlet]="nav" class="tab-content-card"></div>
|
|
32
|
+
}
|
|
33
|
+
@else {
|
|
34
|
+
@if (title) {
|
|
35
|
+
<h2>{{ title | translate }}</h2>
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
<ul ngbNav #nav="ngbNav" [(activeId)]="activeId" class="nav-tabs" (activeIdChange)="onTabChange($event)" appRwdTabs>
|
|
39
|
+
@for (tab of tabs.toArray(); track tab; let i = $index) {
|
|
40
|
+
<li [ngbNavItem]="i" [disabled]="tab.disabled">
|
|
41
|
+
<a ngbNavLink [attr.data-test-ctw]="'link-tab-' + i">
|
|
42
|
+
{{ tab.title | translate }}
|
|
43
|
+
</a>
|
|
44
|
+
<ng-template ngbNavContent>
|
|
45
|
+
<ng-container *ngTemplateOutlet="tab.templateRef"></ng-container>
|
|
46
|
+
</ng-template>
|
|
47
|
+
</li>
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
<li ngbDropdown class="nav-item d-none" placement="bottom-right">
|
|
51
|
+
<button (click)="false" class="nav-link" ngbDropdownToggle>
|
|
52
|
+
{{ '_COMMON._ACTION.MORE' | translate }}
|
|
53
|
+
</button>
|
|
54
|
+
<ul ngbDropdownMenu placement="bottom right"></ul>
|
|
55
|
+
</li>
|
|
56
|
+
</ul>
|
|
57
|
+
|
|
58
|
+
<div [ngbNavOutlet]="nav" class="tab-content"></div>
|
|
59
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { TabComponent } from './tab.component';
|
|
3
|
+
|
|
4
|
+
describe('TabComponent', () => {
|
|
5
|
+
let component: TabComponent;
|
|
6
|
+
let fixture: ComponentFixture<TabComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [ TabComponent ]
|
|
11
|
+
})
|
|
12
|
+
.compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(TabComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { AfterContentInit, Component, ContentChildren, Input, QueryList } from '@angular/core';
|
|
2
|
+
import { TabContentComponent } from './components/tab-content.component';
|
|
3
|
+
import { ActivatedRoute, Router } from '@angular/router';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
6
|
+
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'app-tab',
|
|
10
|
+
templateUrl: './tab.component.html',
|
|
11
|
+
standalone: true,
|
|
12
|
+
imports: [
|
|
13
|
+
CommonModule,
|
|
14
|
+
TranslateModule,
|
|
15
|
+
NgbNavModule
|
|
16
|
+
]
|
|
17
|
+
})
|
|
18
|
+
export class TabComponent implements AfterContentInit {
|
|
19
|
+
|
|
20
|
+
@Input() useFragment = true;
|
|
21
|
+
@Input() title?: string;
|
|
22
|
+
@Input() id: string;
|
|
23
|
+
@Input() basicDisplay? = false;
|
|
24
|
+
@ContentChildren(TabContentComponent) tabs!: QueryList<TabContentComponent>;
|
|
25
|
+
|
|
26
|
+
public activeId = 0;
|
|
27
|
+
|
|
28
|
+
constructor(
|
|
29
|
+
private router: Router,
|
|
30
|
+
private route: ActivatedRoute
|
|
31
|
+
) { }
|
|
32
|
+
|
|
33
|
+
ngAfterContentInit(): void {
|
|
34
|
+
const tabsArray = this.tabs.toArray();
|
|
35
|
+
const firstEnabledIndex = tabsArray.findIndex(tab => !tab.disabled);
|
|
36
|
+
this.activeId = firstEnabledIndex !== -1 ? firstEnabledIndex : 0;
|
|
37
|
+
|
|
38
|
+
this.route.fragment.subscribe(fragment => {
|
|
39
|
+
if (this.useFragment) {
|
|
40
|
+
if (fragment) {
|
|
41
|
+
const foundIndex = tabsArray.findIndex(
|
|
42
|
+
tab => tab.fragment === fragment && !tab.disabled
|
|
43
|
+
);
|
|
44
|
+
if (foundIndex !== -1) {
|
|
45
|
+
this.activeId = foundIndex;
|
|
46
|
+
}
|
|
47
|
+
} else {
|
|
48
|
+
const currentTab = tabsArray[this.activeId];
|
|
49
|
+
this.router.navigate([], {
|
|
50
|
+
relativeTo: this.route,
|
|
51
|
+
fragment: currentTab.fragment,
|
|
52
|
+
queryParamsHandling: 'preserve',
|
|
53
|
+
replaceUrl: true
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
public onTabChange(newIndex: number) {
|
|
61
|
+
this.activeId = newIndex;
|
|
62
|
+
|
|
63
|
+
if (!this.useFragment) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const tabsArray = this.tabs.toArray();
|
|
68
|
+
const selectedTab = tabsArray[newIndex];
|
|
69
|
+
|
|
70
|
+
if (selectedTab && !selectedTab.disabled) {
|
|
71
|
+
this.router.navigate([], {
|
|
72
|
+
relativeTo: this.route,
|
|
73
|
+
fragment: selectedTab.fragment,
|
|
74
|
+
queryParamsHandling: 'preserve',
|
|
75
|
+
replaceUrl: true
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<div class="actions-on-table" *ngIf="actionOnTable?.length || customContent">
|
|
2
|
+
<div class="me-auto">
|
|
3
|
+
@if (customContent) {
|
|
4
|
+
<ng-container [ngTemplateOutlet]="customContent"></ng-container>
|
|
5
|
+
}
|
|
6
|
+
</div>
|
|
7
|
+
<div class="btn-group">
|
|
8
|
+
@for (action of actionOnTable; track action) {
|
|
9
|
+
@if (action.action === actionOnTableAction.add) {
|
|
10
|
+
<a (click)="onActionClick(actionOnTableAction.add)" href="javascript:void(0)" class="btn btn-primary btn-min-width">
|
|
11
|
+
{{ '_COMMON._ACTION.ADD' | translate }}
|
|
12
|
+
</a>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@if (action.action === actionOnTableAction.exportAll) {
|
|
16
|
+
<div class="btn-group" ngbDropdown placement="bottom-right">
|
|
17
|
+
<button class="btn btn-secondary btn-min-width" id="dd-export" ngbDropdownToggle>
|
|
18
|
+
{{ '_COMMON._ACTION.EXPORT' | translate }}
|
|
19
|
+
</button>
|
|
20
|
+
<ul ngbDropdownMenu aria-labelledby="dd-export">
|
|
21
|
+
<li>
|
|
22
|
+
<button class="dropdown-item" (click)="onActionClick(actionOnTableAction.exportPage)">
|
|
23
|
+
{{ '_COMMON._TABLE.EXPORT_CURRENT' | translate }}
|
|
24
|
+
</button>
|
|
25
|
+
</li>
|
|
26
|
+
<li>
|
|
27
|
+
<button class="dropdown-item" (click)="onActionClick(actionOnTableAction.exportAll)">
|
|
28
|
+
{{ '_COMMON._TABLE.EXPORT_ALL' | translate }}
|
|
29
|
+
</button>
|
|
30
|
+
</li>
|
|
31
|
+
</ul>
|
|
32
|
+
</div>
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@if (action.action === actionOnTableAction.custom1) {
|
|
36
|
+
<a (click)="onActionClick(actionOnTableAction.custom1)" href="javascript:void(0)" class="btn btn-min-width"
|
|
37
|
+
[ngClass]="'btn-' + action.type">
|
|
38
|
+
{{ action.label }}
|
|
39
|
+
</a>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@if (action.action === actionOnTableAction.custom2) {
|
|
43
|
+
<a (click)="onActionClick(actionOnTableAction.custom2)" href="javascript:void(0)" class="btn btn-min-width"
|
|
44
|
+
[ngClass]="'btn-' + action.type">
|
|
45
|
+
{{ action.label }}
|
|
46
|
+
</a>
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
package/src/lib/components/table/components/actions-on-table/actions-on-table.component.spec.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { ActionsOnTableComponent } from './actions-on-table.component';
|
|
3
|
+
|
|
4
|
+
describe('ActionsOnTableComponent', () => {
|
|
5
|
+
let component: ActionsOnTableComponent;
|
|
6
|
+
let fixture: ComponentFixture<ActionsOnTableComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [ ActionsOnTableComponent ]
|
|
11
|
+
})
|
|
12
|
+
.compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(ActionsOnTableComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { CommonModule } from '@angular/common';
|
|
2
|
+
import { Component, EventEmitter, Input, Output, TemplateRef } from '@angular/core';
|
|
3
|
+
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
4
|
+
import { TranslateModule } from '@ngx-translate/core';
|
|
5
|
+
import { ActionOnTable, ActionOnTableType } from '../../../../models/ui/table.model';
|
|
6
|
+
|
|
7
|
+
@Component({
|
|
8
|
+
selector: 'app-actions-on-table',
|
|
9
|
+
templateUrl: './actions-on-table.component.html',
|
|
10
|
+
standalone: true,
|
|
11
|
+
imports: [
|
|
12
|
+
TranslateModule,
|
|
13
|
+
CommonModule,
|
|
14
|
+
NgbDropdownModule
|
|
15
|
+
]
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
export class ActionsOnTableComponent {
|
|
19
|
+
|
|
20
|
+
@Input() actionOnTable: ActionOnTable[] = [];
|
|
21
|
+
@Input() customContent?: TemplateRef<any>;
|
|
22
|
+
|
|
23
|
+
@Output() actionClick = new EventEmitter<ActionOnTableType>();
|
|
24
|
+
|
|
25
|
+
public actionOnTableAction = ActionOnTableType;
|
|
26
|
+
|
|
27
|
+
constructor() { }
|
|
28
|
+
|
|
29
|
+
public onActionClick(action: ActionOnTableType): void {
|
|
30
|
+
this.actionClick.emit(action);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@if (
|
|
2
|
+
[typeField.select, typeField.ngSelect, typeField.ngSelectMultiple, typeField.dateToDate,typeField.timeToTime,
|
|
3
|
+
typeField.dateTimeToDateTime].includes(column.filter?.type)
|
|
4
|
+
) {
|
|
5
|
+
<ng-container [ngTemplateOutlet]="field"></ng-container>
|
|
6
|
+
}
|
|
7
|
+
@else {
|
|
8
|
+
<div class="input-group">
|
|
9
|
+
<ng-container [ngTemplateOutlet]="field"></ng-container>
|
|
10
|
+
<button *ngIf="cssClass" class="btn btn-secondary" type="button" (click)="onClearFilter()">×</button>
|
|
11
|
+
</div>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
<ng-template #field>
|
|
15
|
+
<label class="form-label" [for]="column.key" class="visually-hidden">
|
|
16
|
+
{{'_COMMON._FORM.FILTER_LABEL' | translate: { col: column.label } }}
|
|
17
|
+
</label>
|
|
18
|
+
<app-form-field [type]="column.filter?.type" [name]="column.key" [control]="control"
|
|
19
|
+
[options]="column.filter?.options" [inTableFilter]="true" [cssClass]="cssClass"
|
|
20
|
+
[placeholder]="'_COMMON._ACTION.FILTER_BY' | translate"></app-form-field>
|
|
21
|
+
</ng-template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
import { FilterComponent } from './filter.component';
|
|
3
|
+
|
|
4
|
+
describe('FilterComponent', () => {
|
|
5
|
+
let component: FilterComponent;
|
|
6
|
+
let fixture: ComponentFixture<FilterComponent>;
|
|
7
|
+
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
await TestBed.configureTestingModule({
|
|
10
|
+
declarations: [ FilterComponent ]
|
|
11
|
+
})
|
|
12
|
+
.compileComponents();
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(FilterComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('should create', () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|