@cityway/bo-ui 1.0.1 → 1.0.2
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/cityway-bo-ui-1.0.1.tgz +0 -0
- package/cityway-bo-ui-1.0.2.tgz +0 -0
- package/fesm2022/cityway-bo-ui.mjs +1598 -0
- package/fesm2022/cityway-bo-ui.mjs.map +1 -0
- package/index.d.ts +509 -0
- package/package.json +32 -21
- package/styles.min.css +5 -0
- package/styles.min.css.map +1 -0
- package/.eslintrc.json +0 -37
- package/ng-package.json +0 -21
- package/src/lib/bo-ui.config.ts +0 -8
- package/src/lib/components/accordions/accordions.component.html +0 -16
- package/src/lib/components/accordions/accordions.component.spec.ts +0 -24
- package/src/lib/components/accordions/accordions.component.ts +0 -27
- package/src/lib/components/accordions/components/accordions-content.component.spec.ts +0 -24
- package/src/lib/components/accordions/components/accordions-content.component.ts +0 -28
- package/src/lib/components/alert/alert.component.html +0 -15
- package/src/lib/components/alert/alert.component.spec.ts +0 -24
- package/src/lib/components/alert/alert.component.ts +0 -36
- package/src/lib/components/badge/badge.component.html +0 -7
- package/src/lib/components/badge/badge.component.spec.ts +0 -24
- package/src/lib/components/badge/badge.component.ts +0 -24
- package/src/lib/components/button/button.component.html +0 -43
- package/src/lib/components/button/button.component.spec.ts +0 -25
- package/src/lib/components/button/button.component.ts +0 -47
- package/src/lib/components/card/card.component.html +0 -15
- package/src/lib/components/card/card.component.spec.ts +0 -25
- package/src/lib/components/card/card.component.ts +0 -30
- package/src/lib/components/custom-list/custom-list.component.html +0 -31
- package/src/lib/components/custom-list/custom-list.component.spec.ts +0 -24
- package/src/lib/components/custom-list/custom-list.component.ts +0 -42
- package/src/lib/components/drag-n-drop-list/drag-n-drop-list.component.html +0 -27
- package/src/lib/components/drag-n-drop-list/drag-n-drop-list.component.spec.ts +0 -24
- package/src/lib/components/drag-n-drop-list/drag-n-drop-list.component.ts +0 -40
- package/src/lib/components/form-field/form-field.component.html +0 -333
- package/src/lib/components/form-field/form-field.component.spec.ts +0 -24
- package/src/lib/components/form-field/form-field.component.ts +0 -256
- package/src/lib/components/icon/icon.component.html +0 -9
- package/src/lib/components/icon/icon.component.spec.ts +0 -25
- package/src/lib/components/icon/icon.component.ts +0 -31
- package/src/lib/components/layout/admin-layout/admin-layout.component.html +0 -17
- package/src/lib/components/layout/admin-layout/admin-layout.component.ts +0 -181
- package/src/lib/components/layout/footer/footer.component.html +0 -51
- package/src/lib/components/layout/footer/footer.component.ts +0 -65
- package/src/lib/components/layout/header/header.component.html +0 -71
- package/src/lib/components/layout/header/header.component.ts +0 -95
- package/src/lib/components/layout/menu/menu.component.html +0 -115
- package/src/lib/components/layout/menu/menu.component.ts +0 -75
- package/src/lib/components/layout/menu-accordion/accordion.directive.ts +0 -57
- package/src/lib/components/layout/menu-accordion/accordionanchor.directive.ts +0 -21
- package/src/lib/components/layout/menu-accordion/accordionlink.directive.ts +0 -45
- package/src/lib/components/layout/menu-accordion/index.ts +0 -3
- package/src/lib/components/layout/sidebar/sidebar.component.html +0 -62
- package/src/lib/components/layout/sidebar/sidebar.component.ts +0 -28
- package/src/lib/components/layout/skip-links/skip-links.component.html +0 -3
- package/src/lib/components/layout/skip-links/skip-links.component.spec.ts +0 -25
- package/src/lib/components/layout/skip-links/skip-links.component.ts +0 -19
- package/src/lib/components/layout/title-breadcrumb/title-breadcrumb.component.html +0 -10
- package/src/lib/components/layout/title-breadcrumb/title-breadcrumb.component.spec.ts +0 -25
- package/src/lib/components/layout/title-breadcrumb/title-breadcrumb.component.ts +0 -16
- package/src/lib/components/legend/legend.component.html +0 -23
- package/src/lib/components/legend/legend.component.spec.ts +0 -24
- package/src/lib/components/legend/legend.component.ts +0 -28
- package/src/lib/components/loader/loader.component.html +0 -4
- package/src/lib/components/loader/loader.component.ts +0 -16
- package/src/lib/components/modals/modals.component.html +0 -71
- package/src/lib/components/modals/modals.component.spec.ts +0 -25
- package/src/lib/components/modals/modals.component.ts +0 -49
- package/src/lib/components/tab/components/tab-content.component.spec.ts +0 -24
- package/src/lib/components/tab/components/tab-content.component.ts +0 -27
- package/src/lib/components/tab/tab.component.html +0 -59
- package/src/lib/components/tab/tab.component.spec.ts +0 -24
- package/src/lib/components/tab/tab.component.ts +0 -79
- package/src/lib/components/table/components/actions-on-table/actions-on-table.component.html +0 -50
- package/src/lib/components/table/components/actions-on-table/actions-on-table.component.spec.ts +0 -24
- package/src/lib/components/table/components/actions-on-table/actions-on-table.component.ts +0 -33
- package/src/lib/components/table/components/filter/filter.component.html +0 -21
- package/src/lib/components/table/components/filter/filter.component.spec.ts +0 -24
- package/src/lib/components/table/components/filter/filter.component.ts +0 -38
- package/src/lib/components/table/table.component.html +0 -104
- package/src/lib/components/table/table.component.spec.ts +0 -24
- package/src/lib/components/table/table.component.ts +0 -85
- package/src/lib/components/wizard-stepper/components/wizard-step.component.spec.ts +0 -25
- package/src/lib/components/wizard-stepper/components/wizard-step.component.ts +0 -16
- package/src/lib/components/wizard-stepper/wizard-stepper.component.html +0 -45
- package/src/lib/components/wizard-stepper/wizard-stepper.component.spec.ts +0 -25
- package/src/lib/components/wizard-stepper/wizard-stepper.component.ts +0 -70
- package/src/lib/directives/double-scroll.ts +0 -64
- package/src/lib/directives/rwd-tabs.ts +0 -99
- package/src/lib/directives/show-hide-password.ts +0 -61
- package/src/lib/enum/drag-item.enum.ts +0 -5
- package/src/lib/enum/field-type.enum.ts +0 -36
- package/src/lib/enum/legend-type.enum.ts +0 -5
- package/src/lib/enum/modals.enum.ts +0 -6
- package/src/lib/enum/ui-type.enum.ts +0 -11
- package/src/lib/models/ui/custom-list.model.ts +0 -14
- package/src/lib/models/ui/legend.model.ts +0 -17
- package/src/lib/models/ui/table.model.ts +0 -33
- package/src/lib/services/ui/modals.service.ts +0 -47
- package/src/lib/services/version.service.ts +0 -22
- package/src/public-api.ts +0 -49
- package/tsconfig.lib.json +0 -18
- package/tsconfig.lib.prod.json +0 -11
- package/tsconfig.spec.json +0 -14
- package/tslint.json +0 -17
- /package/{src/lib → lib}/assets/fonts/bo/_variables.scss +0 -0
- /package/{src/lib → lib}/assets/fonts/bo/bo.scss +0 -0
- /package/{src/lib → lib}/assets/fonts/bo/bo.woff +0 -0
- /package/{src/lib → lib}/assets/fonts/bo/bo.woff2 +0 -0
- /package/{src/lib → lib}/assets/fonts/nunito/_nunito.scss +0 -0
- /package/{src/lib → lib}/assets/fonts/nunito/nunito-bold.woff +0 -0
- /package/{src/lib → lib}/assets/fonts/nunito/nunito-bold.woff2 +0 -0
- /package/{src/lib → lib}/assets/fonts/nunito/nunito-extrabold.woff +0 -0
- /package/{src/lib → lib}/assets/fonts/nunito/nunito-extrabold.woff2 +0 -0
- /package/{src/lib → lib}/assets/fonts/nunito/nunito-regular.woff +0 -0
- /package/{src/lib → lib}/assets/fonts/nunito/nunito-regular.woff2 +0 -0
- /package/{src/lib → lib}/assets/fonts/nunito/nunito-semi-bold.woff +0 -0
- /package/{src/lib → lib}/assets/fonts/nunito/nunito-semi-bold.woff2 +0 -0
- /package/{src/lib → lib}/assets/fonts/optyweb/_variables.scss +0 -0
- /package/{src/lib → lib}/assets/fonts/optyweb/optyweb.scss +0 -0
- /package/{src/lib → lib}/assets/fonts/optyweb/optyweb.woff +0 -0
- /package/{src/lib → lib}/assets/fonts/optyweb/optyweb.woff2 +0 -0
- /package/{src/lib → lib}/assets/i18n/common.en.json +0 -0
- /package/{src/lib → lib}/assets/i18n/common.fr.json +0 -0
- /package/{src/lib → lib}/assets/i18n/label.en.json +0 -0
- /package/{src/lib → lib}/assets/i18n/label.fr.json +0 -0
- /package/{src/lib → lib}/assets/images/common/bg-loader.svg +0 -0
- /package/{src/lib → lib}/assets/images/common/bg-menu.svg +0 -0
- /package/{src/lib → lib}/assets/images/common/bg-round.svg +0 -0
- /package/{src/lib → lib}/assets/images/common/check-mark.svg +0 -0
- /package/{src/lib → lib}/assets/images/common/loader.svg +0 -0
- /package/{src/lib → lib}/assets/images/common/logo-en-bw.svg +0 -0
- /package/{src/lib → lib}/assets/images/common/logo-en.svg +0 -0
- /package/{src/lib → lib}/assets/images/common/logo-fr-bw.svg +0 -0
- /package/{src/lib → lib}/assets/images/common/logo-fr.svg +0 -0
- /package/{src/lib → lib}/assets/images/favicon/android-chrome-192x192.png +0 -0
- /package/{src/lib → lib}/assets/images/favicon/android-chrome-512x512.png +0 -0
- /package/{src/lib → lib}/assets/images/favicon/apple-touch-icon.png +0 -0
- /package/{src/lib → lib}/assets/images/favicon/favicon-16x16.png +0 -0
- /package/{src/lib → lib}/assets/images/favicon/favicon-32x32.png +0 -0
- /package/{src/lib → lib}/assets/images/favicon/favicon-96x96.png +0 -0
- /package/{src/lib → lib}/assets/images/favicon/favicon.ico +0 -0
- /package/{src/lib → lib}/assets/images/favicon/site.webmanifest +0 -0
- /package/{src/lib → lib}/assets/images/icon/referential-icon.svg +0 -0
- /package/{src/lib → lib}/assets/images/login/login-bg.jpg +0 -0
- /package/{src/lib → lib}/assets/images/login/logo-cityway-baseline.svg +0 -0
- /package/{src/lib → lib}/assets/images/toast/warning.svg +0 -0
- /package/{src/lib → lib}/assets/styles/scss/_components.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/_core.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/_custom-bootstrap.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_accordion.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_alert.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_badge.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_breadcrumb.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_button-group.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_buttons.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_card.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_close.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_dropdown.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_forms.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_input-group.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_lists.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_modal.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_pagination.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_popover.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_progress.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_reboot.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_tables.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_tabs.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_tooltip.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/bootstrap/_type.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_forms-firefox.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_leaflet.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_legend.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_ng-select.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_ng2-dragula.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_ng2-validation.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_ng5-slider.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_ngb-datepicker.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_ngb-timepicker.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_ngx-chips.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_ngx-editor.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_ngx-file-drop.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_ngx-intl-tel-input.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_ngx-slider.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_ngx-toast.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_pwd-policy.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_table.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_vis.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/_wizard-stepper.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/table/_table-action.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/table/_table-bg-cell.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/table/_table-double-scroll.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/table/_table-filter.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/table/_table-pagination.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/table/_table-popover.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/components/table/_table-sorting.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/core/_footer.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/core/_header.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/core/_layout.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/core/_menu.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/core/_sidebar.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/mixins/_utilities.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/styles.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/tools/_focus.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/tools/_loader.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/variables/_colors.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/variables/_custom.scss +0 -0
- /package/{src/lib → lib}/assets/styles/scss/variables/_site.scss +0 -0
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
|
|
2
|
-
import { UiTypeEnum } from '../../enum/ui-type.enum';
|
|
3
|
-
import { IconComponent } from '../icon/icon.component';
|
|
4
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
5
|
-
import { CommonModule } from '@angular/common';
|
|
6
|
-
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
|
|
7
|
-
|
|
8
|
-
@Component({
|
|
9
|
-
selector: 'app-button',
|
|
10
|
-
templateUrl: './button.component.html',
|
|
11
|
-
standalone: true,
|
|
12
|
-
imports: [
|
|
13
|
-
CommonModule,
|
|
14
|
-
TranslateModule,
|
|
15
|
-
NgbDropdownModule,
|
|
16
|
-
IconComponent
|
|
17
|
-
]
|
|
18
|
-
})
|
|
19
|
-
export class ButtonComponent implements OnInit {
|
|
20
|
-
|
|
21
|
-
@Input() type: UiTypeEnum;
|
|
22
|
-
@Input() isDropdown = false;
|
|
23
|
-
@Input() withIcon: string;
|
|
24
|
-
@Input() withOnlyIcon = false;
|
|
25
|
-
@Input() isMinWidth = false;
|
|
26
|
-
@Input() isDisabled = false;
|
|
27
|
-
@Input() withSpinner = false;
|
|
28
|
-
@Input() label: string;
|
|
29
|
-
@Input() small = false;
|
|
30
|
-
@Input() dataTest: string;
|
|
31
|
-
|
|
32
|
-
@Output() btnAction = new EventEmitter<string>();
|
|
33
|
-
public isLoading = false;
|
|
34
|
-
|
|
35
|
-
constructor() { }
|
|
36
|
-
|
|
37
|
-
ngOnInit(): void {
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
public onBtnAction() {
|
|
41
|
-
this.btnAction.emit();
|
|
42
|
-
if (this.withSpinner) {
|
|
43
|
-
this.isLoading = !this.isLoading;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<div class="card">
|
|
2
|
-
@if (title) {
|
|
3
|
-
<h2 class="card-header">{{ title }}</h2>
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
<div class="card-body">
|
|
7
|
-
<ng-content></ng-content>
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
@if (showFooter) {
|
|
11
|
-
<div class="card-footer" #cardFooter>
|
|
12
|
-
<ng-content select="[card-footer]"></ng-content>
|
|
13
|
-
</div>
|
|
14
|
-
}
|
|
15
|
-
</div>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
|
|
3
|
-
import { CardComponent } from './card.component';
|
|
4
|
-
|
|
5
|
-
describe('CardComponent', () => {
|
|
6
|
-
let component: CardComponent;
|
|
7
|
-
let fixture: ComponentFixture<CardComponent>;
|
|
8
|
-
|
|
9
|
-
beforeEach(async () => {
|
|
10
|
-
await TestBed.configureTestingModule({
|
|
11
|
-
declarations: [ CardComponent ]
|
|
12
|
-
})
|
|
13
|
-
.compileComponents();
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
fixture = TestBed.createComponent(CardComponent);
|
|
18
|
-
component = fixture.componentInstance;
|
|
19
|
-
fixture.detectChanges();
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('should create', () => {
|
|
23
|
-
expect(component).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { CommonModule } from '@angular/common';
|
|
2
|
-
import { ChangeDetectorRef, Component, Input, OnInit, AfterViewInit, ViewChild, ElementRef } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
@Component({
|
|
5
|
-
selector: 'app-card',
|
|
6
|
-
templateUrl: './card.component.html',
|
|
7
|
-
standalone: true,
|
|
8
|
-
imports: [
|
|
9
|
-
CommonModule
|
|
10
|
-
]
|
|
11
|
-
})
|
|
12
|
-
|
|
13
|
-
export class CardComponent implements OnInit, AfterViewInit {
|
|
14
|
-
|
|
15
|
-
@Input() title: string;
|
|
16
|
-
@ViewChild('cardFooter') cardFooter: ElementRef<any>;
|
|
17
|
-
|
|
18
|
-
public showFooter = true;
|
|
19
|
-
|
|
20
|
-
constructor(private cdRef: ChangeDetectorRef) { }
|
|
21
|
-
|
|
22
|
-
ngOnInit(): void {
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
ngAfterViewInit(): void {
|
|
26
|
-
this.showFooter = this.cardFooter.nativeElement && this.cardFooter.nativeElement.children.length > 0;
|
|
27
|
-
this.cdRef.detectChanges();
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<div class="custom-card-light">
|
|
2
|
-
@for (group of customListData; track group.title) {
|
|
3
|
-
@if (group.title) {
|
|
4
|
-
<h3>{{ group.title | translate }}</h3>
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
<dl class="custom-description-list">
|
|
8
|
-
@for (field of group.fields; track field.label) {
|
|
9
|
-
@if (!field.hideIfEmpty || hasValue(field.value)) {
|
|
10
|
-
<dt [innerHTML]="'_LABEL.COLON' | translate: { label: (field.label | translate) }"></dt>
|
|
11
|
-
<dd>
|
|
12
|
-
@switch (field.type) {
|
|
13
|
-
@case ('date') {
|
|
14
|
-
{{ field.value | date: 'short' }}
|
|
15
|
-
}
|
|
16
|
-
@case ('boolean') {
|
|
17
|
-
{{ (field.value ? '_COMMON._PRO_SENTENCE.YES' : '_COMMON._PRO_SENTENCE.NO') | translate }}
|
|
18
|
-
}
|
|
19
|
-
@case ('html') {
|
|
20
|
-
<span [innerHTML]="field.value"></span>
|
|
21
|
-
}
|
|
22
|
-
@default {
|
|
23
|
-
{{ field.translateValue ? (field.value | translate) : field.value }}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
</dd>
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
</dl>
|
|
30
|
-
}
|
|
31
|
-
</div>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import { CustomListComponent } from './custom-list.component';
|
|
3
|
-
|
|
4
|
-
describe('CustomListComponent', () => {
|
|
5
|
-
let component: CustomListComponent;
|
|
6
|
-
let fixture: ComponentFixture<CustomListComponent>;
|
|
7
|
-
|
|
8
|
-
beforeEach(async () => {
|
|
9
|
-
await TestBed.configureTestingModule({
|
|
10
|
-
declarations: [ CustomListComponent ]
|
|
11
|
-
})
|
|
12
|
-
.compileComponents();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
beforeEach(() => {
|
|
16
|
-
fixture = TestBed.createComponent(CustomListComponent);
|
|
17
|
-
component = fixture.componentInstance;
|
|
18
|
-
fixture.detectChanges();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('should create', () => {
|
|
22
|
-
expect(component).toBeTruthy();
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Component, Input, OnInit } from '@angular/core';
|
|
2
|
-
import { DataCustomListGroup } from '../../models/ui/custom-list.model';
|
|
3
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
|
|
6
|
-
@Component({
|
|
7
|
-
selector: 'app-custom-list',
|
|
8
|
-
templateUrl: './custom-list.component.html',
|
|
9
|
-
standalone: true,
|
|
10
|
-
imports: [
|
|
11
|
-
CommonModule,
|
|
12
|
-
TranslateModule
|
|
13
|
-
]
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
export class CustomListComponent implements OnInit {
|
|
17
|
-
|
|
18
|
-
@Input() customListData: DataCustomListGroup[] = [];
|
|
19
|
-
|
|
20
|
-
constructor() { }
|
|
21
|
-
|
|
22
|
-
ngOnInit(): void {
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
hasValue(value: any): boolean {
|
|
26
|
-
if (value === null || value === undefined) {
|
|
27
|
-
return false;
|
|
28
|
-
};
|
|
29
|
-
if (typeof value === 'string' && value.trim() === '') {
|
|
30
|
-
return false;
|
|
31
|
-
};
|
|
32
|
-
if (Array.isArray(value) && value.length === 0) {
|
|
33
|
-
return false;
|
|
34
|
-
};
|
|
35
|
-
if (typeof value === 'object' && Object.keys(value).length === 0) {
|
|
36
|
-
return false;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return true;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<div class="drag-drop-list">
|
|
2
|
-
<div class="list-column" cdkDropList #availableList="cdkDropList" [cdkDropListData]="availableItems"
|
|
3
|
-
[cdkDropListConnectedTo]="[activeList]" (cdkDropListDropped)="drop($event)">
|
|
4
|
-
<h3>Modes disponibles</h3>
|
|
5
|
-
@for (item of availableItems; track item) {
|
|
6
|
-
<div cdkDrag>
|
|
7
|
-
<ng-container *ngTemplateOutlet="itemTemplate || defaultTemplate; context: { $implicit: item }"></ng-container>
|
|
8
|
-
</div>
|
|
9
|
-
}
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<div class="list-column" cdkDropList #activeList="cdkDropList" [cdkDropListData]="activeItems"
|
|
13
|
-
[cdkDropListConnectedTo]="[availableList]" (cdkDropListDropped)="drop($event)">
|
|
14
|
-
<h3>Modes activés</h3>
|
|
15
|
-
@for (item of activeItems; track item) {
|
|
16
|
-
<div cdkDrag>
|
|
17
|
-
<ng-container *ngTemplateOutlet="itemTemplate || defaultTemplate; context: { $implicit: item }"></ng-container>
|
|
18
|
-
</div>
|
|
19
|
-
}
|
|
20
|
-
</div>
|
|
21
|
-
|
|
22
|
-
<ng-template #defaultTemplate let-item>
|
|
23
|
-
<div class="default-item">
|
|
24
|
-
Mode : {{ item.label }} ({{ item.code }} )
|
|
25
|
-
</div>
|
|
26
|
-
</ng-template>
|
|
27
|
-
</div>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import { DragNDropListComponent } from './drag-n-drop-list.component';
|
|
3
|
-
|
|
4
|
-
describe('DragNDropListComponent', () => {
|
|
5
|
-
let component: DragNDropListComponent;
|
|
6
|
-
let fixture: ComponentFixture<DragNDropListComponent>;
|
|
7
|
-
|
|
8
|
-
beforeEach(async () => {
|
|
9
|
-
await TestBed.configureTestingModule({
|
|
10
|
-
declarations: [ DragNDropListComponent ]
|
|
11
|
-
})
|
|
12
|
-
.compileComponents();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
beforeEach(() => {
|
|
16
|
-
fixture = TestBed.createComponent(DragNDropListComponent);
|
|
17
|
-
component = fixture.componentInstance;
|
|
18
|
-
fixture.detectChanges();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('should create', () => {
|
|
22
|
-
expect(component).toBeTruthy();
|
|
23
|
-
});
|
|
24
|
-
});
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { CdkDragDrop, DragDropModule, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';
|
|
2
|
-
import { CommonModule } from '@angular/common';
|
|
3
|
-
import { Component, EventEmitter, Input, Output, TemplateRef } from '@angular/core';
|
|
4
|
-
import { TranslateModule } from '@ngx-translate/core';
|
|
5
|
-
import { DragItem } from '../../enum/drag-item.enum';
|
|
6
|
-
|
|
7
|
-
@Component({
|
|
8
|
-
selector: 'app-drag-n-drop-list',
|
|
9
|
-
templateUrl: './drag-n-drop-list.component.html',
|
|
10
|
-
standalone: true,
|
|
11
|
-
imports: [
|
|
12
|
-
CommonModule,
|
|
13
|
-
TranslateModule,
|
|
14
|
-
DragDropModule
|
|
15
|
-
]
|
|
16
|
-
})
|
|
17
|
-
export class DragNDropListComponent {
|
|
18
|
-
|
|
19
|
-
@Input() availableItems: DragItem[] = [];
|
|
20
|
-
@Input() activeItems: DragItem[] = [];
|
|
21
|
-
@Input() itemTemplate?: TemplateRef<any>;
|
|
22
|
-
|
|
23
|
-
@Output() availableItemsChange = new EventEmitter<DragItem[]>();
|
|
24
|
-
@Output() activeItemsChange = new EventEmitter<DragItem[]>();
|
|
25
|
-
|
|
26
|
-
drop(event: CdkDragDrop<any[]>) {
|
|
27
|
-
if (event.previousContainer === event.container) {
|
|
28
|
-
moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
|
|
29
|
-
} else {
|
|
30
|
-
transferArrayItem(
|
|
31
|
-
event.previousContainer.data,
|
|
32
|
-
event.container.data,
|
|
33
|
-
event.previousIndex,
|
|
34
|
-
event.currentIndex
|
|
35
|
-
);
|
|
36
|
-
}
|
|
37
|
-
this.availableItemsChange.emit(this.availableItems);
|
|
38
|
-
this.activeItemsChange.emit(this.activeItems);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,333 +0,0 @@
|
|
|
1
|
-
@if (!isInAddon && !inTableFilter) {
|
|
2
|
-
<div class="form-group">
|
|
3
|
-
@if (
|
|
4
|
-
type !== typeField.checkbox &&
|
|
5
|
-
type !== typeField.radio &&
|
|
6
|
-
type !== typeField.checkboxButton &&
|
|
7
|
-
type !== typeField.radioButton &&
|
|
8
|
-
type !== typeField.checkboxInline &&
|
|
9
|
-
type !== typeField.radioInline &&
|
|
10
|
-
type !== typeField.switch &&
|
|
11
|
-
type !== typeField.switchSmall
|
|
12
|
-
|
|
13
|
-
) {
|
|
14
|
-
<label [for]="name" class="form-label">
|
|
15
|
-
{{ label }}
|
|
16
|
-
|
|
17
|
-
@if (isRequired) {
|
|
18
|
-
<span class="text-danger">*</span>
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
@if (tooltip) {
|
|
22
|
-
<button type="button" class="btn btn-link btn-popover" placement="bottom" [ngbPopover]="popContent" container="body"
|
|
23
|
-
triggers="mouseenter:mouseleave">
|
|
24
|
-
<span class="btn-popover-icon bo-icons bo-help"></span>
|
|
25
|
-
</button>
|
|
26
|
-
<ng-template #popContent>
|
|
27
|
-
<div [innerHTML]="tooltip"></div>
|
|
28
|
-
</ng-template>
|
|
29
|
-
}
|
|
30
|
-
</label>
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@if (addonLeft || addonRight) {
|
|
34
|
-
<div class="input-group">
|
|
35
|
-
<ng-container *ngIf="addonLeft" [ngTemplateOutlet]="addonLeft"></ng-container>
|
|
36
|
-
<ng-container [ngTemplateOutlet]="field"></ng-container>
|
|
37
|
-
<ng-container *ngIf="addonRight" [ngTemplateOutlet]="addonRight"></ng-container>
|
|
38
|
-
</div>
|
|
39
|
-
}
|
|
40
|
-
@else {
|
|
41
|
-
@if ( isInInputGroup() ) {
|
|
42
|
-
<div class="input-group">
|
|
43
|
-
<ng-container [ngTemplateOutlet]="field"></ng-container>
|
|
44
|
-
</div>
|
|
45
|
-
}
|
|
46
|
-
@else {
|
|
47
|
-
<ng-container [ngTemplateOutlet]="field"></ng-container>
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
<!-- Error message -->
|
|
52
|
-
@if (controlOrGroup?.invalid && controlOrGroup?.touched) {
|
|
53
|
-
<div class="invalid-feedback d-block" [id]="'error-' + name">
|
|
54
|
-
<span
|
|
55
|
-
*ngIf="(controlOrGroup?.errors?.['required']) || (getControl('start')?.errors?.['required'] || getControl('end')?.errors?.['required'])"
|
|
56
|
-
[innerHtml]="'_COMMON._FORM.ERROR_IS_MANDATORY' | translate: {label: label}">
|
|
57
|
-
</span>
|
|
58
|
-
<span *ngIf="controlOrGroup?.errors?.['rangeInvalid']">
|
|
59
|
-
{{'_COMMON._DATES.ERROR_START_END_PERIOD' | translate}}
|
|
60
|
-
</span>
|
|
61
|
-
</div>
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@if (help) {
|
|
65
|
-
<small [id]="name + '-help'" class="form-text text-muted">{{help}}</small>
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
</div>
|
|
69
|
-
}
|
|
70
|
-
@else if ( inTableFilter ) {
|
|
71
|
-
<label class="form-label" [for]="name" class="visually-hidden">
|
|
72
|
-
{{'_COMMON._FORM.FILTER_LABEL' | translate: { col: name } }}
|
|
73
|
-
</label>
|
|
74
|
-
|
|
75
|
-
@if ( isInInputGroup() ) {
|
|
76
|
-
<div class="input-group">
|
|
77
|
-
<ng-container [ngTemplateOutlet]="field"></ng-container>
|
|
78
|
-
</div>
|
|
79
|
-
}
|
|
80
|
-
@else {
|
|
81
|
-
<ng-container [ngTemplateOutlet]="field"></ng-container>
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
@else {
|
|
85
|
-
<ng-container [ngTemplateOutlet]="field"></ng-container>
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
<ng-template #field>
|
|
89
|
-
<!-- Text -->
|
|
90
|
-
@if ([typeField.text, typeField.date, typeField.time, typeField.dateTime, typeField.number, typeField.file,
|
|
91
|
-
typeField.email,
|
|
92
|
-
typeField.color].includes(type)) {
|
|
93
|
-
<input [type]="type" class="form-control" [id]="name" [formControl]="formControl"
|
|
94
|
-
[ngClass]="[(cssClass || ''), formControl?.value ? 'has-value' : '']"
|
|
95
|
-
[attr.placeholder]="placeholder ? placeholder : null" [attr.required]="isRequired ? 'required' : null"
|
|
96
|
-
[attr.readonly]="isReadonly ? 'readonly' : null" [disabled]="isDisabled"
|
|
97
|
-
[attr.aria-required]="isRequired" [attr.aria-invalid]="control.invalid && control.touched"
|
|
98
|
-
[attr.aria-describedby]="control.invalid && control.touched ? 'error-' + name : null" />
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@if (type === typeField.password) {
|
|
102
|
-
<input showHidePassword [type]="type" class="form-control" [id]="name" [formControl]="formControl"
|
|
103
|
-
[ngClass]="[(cssClass || ''), formControl?.value ? 'has-value' : '']"
|
|
104
|
-
[attr.required]="isRequired ? 'required' : null" [attr.readonly]="isReadonly ? 'readonly' : null"
|
|
105
|
-
[attr.disabled]="isDisabled ? 'disabled' : null" [attr.aria-required]="isRequired"
|
|
106
|
-
[attr.aria-invalid]="control.invalid && control.touched"
|
|
107
|
-
[attr.aria-describedby]="control.invalid && control.touched ? 'error-' + name : null" />
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
<!-- Textarea -->
|
|
111
|
-
@if (type === typeField.textarea) {
|
|
112
|
-
<textarea class="form-control" [id]="name" [formControl]="formControl"
|
|
113
|
-
[ngClass]="[(cssClass || ''), formControl?.value ? 'has-value' : '']"
|
|
114
|
-
[attr.placeholder]="placeholder ? placeholder : null" [attr.required]="isRequired ? 'required' : null"
|
|
115
|
-
[attr.readonly]="isReadonly ? 'readonly' : null" [attr.disabled]="isDisabled ? 'disabled' : null"
|
|
116
|
-
[attr.aria-required]="isRequired" [attr.aria-invalid]="control.invalid && control.touched"
|
|
117
|
-
[attr.aria-describedby]="control.invalid && control.touched ? 'error-' + name : null"></textarea>
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
<!-- Select -->
|
|
121
|
-
@if (type === typeField.select) {
|
|
122
|
-
<ng-select [formControl]="formControl" [items]="options" bindLabel="label" [labelForId]="name" bindValue="value"
|
|
123
|
-
[ngClass]="cssClass" [searchable]="false" [placeholder]="placeholder ? placeholder : null" [readonly]="isReadonly"
|
|
124
|
-
[attr.disabled]="isDisabled ? 'disabled' : null" [attr.required]="isRequired ? 'required' : null"
|
|
125
|
-
[attr.aria-required]="isRequired" [attr.aria-invalid]="control.invalid && control.touched"
|
|
126
|
-
[attr.aria-describedby]="control.invalid && control.touched ? 'error-' + name : null" [attr.id]="name"
|
|
127
|
-
(blur)="onBlur()">
|
|
128
|
-
<ng-content></ng-content>
|
|
129
|
-
</ng-select>
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
<!-- NgSelect -->
|
|
133
|
-
@if (type === typeField.ngSelect || type === typeField.ngSelectMultiple) {
|
|
134
|
-
<ng-select [formControl]="formControl" [items]="options" bindLabel="label" [labelForId]="name" bindValue="value"
|
|
135
|
-
[multiple]="type === typeField.ngSelectMultiple" [ngClass]="cssClass"
|
|
136
|
-
[placeholder]="placeholder ? placeholder : null" [readonly]="isReadonly"
|
|
137
|
-
[notFoundText]="'_COMMON.NO_RESULT' | translate" [attr.disabled]="isDisabled ? 'disabled' : null"
|
|
138
|
-
[attr.required]="isRequired ? 'required' : null" [attr.aria-required]="isRequired"
|
|
139
|
-
[attr.aria-invalid]="control.invalid && control.touched"
|
|
140
|
-
[attr.aria-describedby]="control.invalid && control.touched ? 'error-' + name : null" [attr.id]="name"
|
|
141
|
-
(blur)="onBlur()">
|
|
142
|
-
<ng-content></ng-content>
|
|
143
|
-
</ng-select>
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
<!-- Radio -->
|
|
147
|
-
@if (type === typeField.radioInline || type === typeField.radio) {
|
|
148
|
-
<fieldset [ngClass]="{ 'flex-column': type === typeField.radio }">
|
|
149
|
-
<legend>{{label}}</legend>
|
|
150
|
-
<ul class=" mb-0" [ngClass]="type === typeField.radioInline ? 'list-inline' : 'list-unstyled'">
|
|
151
|
-
<li *ngFor="let opt of options" class="form-check"
|
|
152
|
-
[ngClass]="{ 'form-check-inline': type === typeField.radioInline }">
|
|
153
|
-
<input type="radio" [id]="name + '_' + opt.value" [value]="opt.value" [formControl]="formControl"
|
|
154
|
-
class="form-check-input" />
|
|
155
|
-
<label [for]="name + '_' + opt.value" class="form-check-label">{{ opt.label }}</label>
|
|
156
|
-
</li>
|
|
157
|
-
</ul>
|
|
158
|
-
</fieldset>
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
<!-- Radio button -->
|
|
162
|
-
@if (type === typeField.radioButton) {
|
|
163
|
-
<fieldset>
|
|
164
|
-
<legend>{{label}}</legend>
|
|
165
|
-
<div class="btn-group btn-group-secondary">
|
|
166
|
-
<ng-container *ngFor="let opt of options">
|
|
167
|
-
<input type="radio" [id]="name + '_' + opt.value" [value]="opt.value" [formControl]="formControl"
|
|
168
|
-
class="visually-hidden" />
|
|
169
|
-
<label [for]="name + '_' + opt.value" class="btn btn-form">{{ opt.label }}</label>
|
|
170
|
-
</ng-container>
|
|
171
|
-
</div>
|
|
172
|
-
</fieldset>
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
<!-- Checkbox Switch -->
|
|
176
|
-
@if (
|
|
177
|
-
(type === typeField.checkbox ||
|
|
178
|
-
type === typeField.switch ||
|
|
179
|
-
type === typeField.switchSmall)
|
|
180
|
-
&& options.length === 0
|
|
181
|
-
) {
|
|
182
|
-
<div class="form-check form-switch" [ngClass]="{'form-switch-small': type === typeField.switchSmall}">
|
|
183
|
-
<input type="checkbox" [id]="name" [formControl]="formControl" class="form-check-input" />
|
|
184
|
-
<label [for]="name" class="form-check-label">{{ label }}</label>
|
|
185
|
-
</div>
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
<!-- Checkbox -->
|
|
189
|
-
@if ((type === typeField.checkboxInline || type === typeField.checkbox) && options.length > 0) {
|
|
190
|
-
<fieldset *ngIf="" [ngClass]="{ 'flex-column': type === typeField.checkbox }">
|
|
191
|
-
<legend>{{label}}</legend>
|
|
192
|
-
<ul class="mb-0" [ngClass]="type === typeField.checkboxInline ? 'list-inline' : 'list-unstyled'">
|
|
193
|
-
<li *ngFor="let opt of options" class="form-check"
|
|
194
|
-
[ngClass]="{ 'form-check-inline': type === typeField.checkboxInline }">
|
|
195
|
-
<input type="checkbox" [id]="name + '_' + opt.value" [value]="opt.value" (change)="onCheckboxChange($event)"
|
|
196
|
-
[checked]="control.value?.includes(opt.value)" class="form-check-input" />
|
|
197
|
-
<label [for]="name + '_' + opt.value" class="form-check-label">{{ opt.label }}</label>
|
|
198
|
-
</li>
|
|
199
|
-
</ul>
|
|
200
|
-
</fieldset>
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
<!-- Checkbox button -->
|
|
204
|
-
@if (type === typeField.checkboxButton) {
|
|
205
|
-
<fieldset>
|
|
206
|
-
<legend>{{label}}</legend>
|
|
207
|
-
<div class="btn-group btn-group-secondary">
|
|
208
|
-
<ng-container *ngFor="let opt of options">
|
|
209
|
-
<input type="checkbox" [id]="name + '_' + opt.value" [value]="opt.value" (change)="onCheckboxChange($event)"
|
|
210
|
-
[checked]="control.value?.includes(opt.value)" class="visually-hidden" />
|
|
211
|
-
<label [for]="name + '_' + opt.value" class="btn btn-form">{{ opt.label }}</label>
|
|
212
|
-
</ng-container>
|
|
213
|
-
</div>
|
|
214
|
-
</fieldset>
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
<!-- Period - DateToDate / TimeToTime / DateTimeToDateTime -->
|
|
218
|
-
@if ([typeField.dateToDate, typeField.timeToTime, typeField.dateTimeToDateTime].includes(type) && isRange) {
|
|
219
|
-
|
|
220
|
-
<div class="input-group">
|
|
221
|
-
@if (!inTableFilter) {
|
|
222
|
-
<span class="input-group-text text-lowercase" [class.disabled]="isDisabled ? 'disabled' : null">
|
|
223
|
-
{{ type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)
|
|
224
|
-
}}
|
|
225
|
-
</span>
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
<input [type]="getInputType()" class="form-control" [id]="name + '_start'" [formControl]="getControl('start')"
|
|
229
|
-
[attr.placeholder]="inTableFilter ? (type === typeField.timeToTime ? ('_COMMON._DATES.FROM' | translate) : ('_COMMON._DATES.FROM_TO_1' | translate)) : null"
|
|
230
|
-
[ngClass]="[(cssClass || ''), getControl('start')?.value ? 'has-value' : '']"
|
|
231
|
-
[attr.required]="isRequired ? 'required' : null" [attr.readonly]="isReadonly ? 'readonly' : null"
|
|
232
|
-
[attr.disabled]="isDisabled ? 'disabled' : null" [attr.aria-required]="isRequired"
|
|
233
|
-
[attr.aria-invalid]="getControl('start')?.invalid && getControl('start')?.touched"
|
|
234
|
-
[attr.aria-describedby]="getControl('start')?.invalid && getControl('start')?.touched ? 'error-' + name : null" />
|
|
235
|
-
|
|
236
|
-
<button *ngIf="getControl('start')?.value" type="button" class="btn btn-secondary btn-clear-field"
|
|
237
|
-
(click)="onClearFieldPeriod('start')">
|
|
238
|
-
×
|
|
239
|
-
</button>
|
|
240
|
-
|
|
241
|
-
@if (!inTableFilter) {
|
|
242
|
-
<span class="input-group-text text-lowercase" [class.disabled]="isDisabled ? 'disabled' : null">
|
|
243
|
-
{{ type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate) }}
|
|
244
|
-
</span>
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
<input [type]="getInputType()" class="form-control" [id]="name + '_end'" [formControl]="getControl('end')"
|
|
248
|
-
[attr.placeholder]="inTableFilter ? (type === typeField.timeToTime ? ('_COMMON._DATES.TO' | translate) : ('_COMMON._DATES.FROM_TO_2' | translate)) : null"
|
|
249
|
-
[ngClass]="[(cssClass || ''), getControl('end')?.value ? 'has-value' : '']"
|
|
250
|
-
[attr.required]="isRequired ? 'required' : null" [attr.readonly]="isReadonly ? 'readonly' : null"
|
|
251
|
-
[attr.disabled]="isDisabled ? 'disabled' : null"
|
|
252
|
-
[attr.aria-invalid]="getControl('end')?.invalid && getControl('end')?.touched"
|
|
253
|
-
[attr.aria-describedby]="getControl('end')?.invalid && getControl('end')?.touched ? 'error-' + name : null" />
|
|
254
|
-
|
|
255
|
-
<button *ngIf="getControl('end')?.value" type="button" class="btn btn-secondary btn-clear-field"
|
|
256
|
-
(click)="onClearFieldPeriod('end')">
|
|
257
|
-
×
|
|
258
|
-
</button>
|
|
259
|
-
</div>
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
@if ([typeField.datePlusOne, typeField.datePlusTwo, typeField.datePlusSeven, typeField.dateComplexe].includes(type)) {
|
|
263
|
-
<div class="input-group">
|
|
264
|
-
|
|
265
|
-
@if (type === typeField.dateComplexe) {
|
|
266
|
-
<button class="btn btn-secondary btn-clear-field" type="button" (click)="onDateAddDay('prev')"
|
|
267
|
-
[attr.disabled]="isDisabled ? 'disabled' : null">
|
|
268
|
-
<app-icon font="optyweb" icon="cw-nav-next-left" [withOnlyIcon]="true" [label]="'Jour précédent'"></app-icon>
|
|
269
|
-
</button>
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
<input type="date" class="form-control" [id]="name" [formControl]="formControl"
|
|
273
|
-
[ngClass]="[(cssClass || ''), formControl?.value ? 'has-value' : '']"
|
|
274
|
-
[attr.placeholder]="placeholder ? placeholder : null" [attr.required]="isRequired ? 'required' : null"
|
|
275
|
-
[attr.readonly]="isReadonly ? 'readonly' : null" [disabled]="isDisabled"
|
|
276
|
-
[attr.aria-required]="isRequired" [attr.aria-invalid]="control.invalid && control.touched"
|
|
277
|
-
[attr.aria-describedby]="control.invalid && control.touched ? 'error-' + name : null" />
|
|
278
|
-
<button *ngIf="formControl?.value" class="btn btn-secondary btn-clear-field" type="button"
|
|
279
|
-
(click)="onClearField(formControl)">×</button>
|
|
280
|
-
|
|
281
|
-
@if (type === typeField.dateComplexe) {
|
|
282
|
-
<button class="btn btn-secondary btn-clear-field" type="button" (click)="onDateAddDay('next')"
|
|
283
|
-
[attr.disabled]="isDisabled ? 'disabled' : null">
|
|
284
|
-
<app-icon font="optyweb" icon="cw-nav-next-right" [withOnlyIcon]="true" [label]="'Jour suivant'"></app-icon>
|
|
285
|
-
</button>
|
|
286
|
-
<button class="btn btn-secondary btn-clear-field" type="button" (click)="onRefresh()"
|
|
287
|
-
[attr.disabled]="isDisabled ? 'disabled' : null">
|
|
288
|
-
<app-icon font="optyweb" icon="cw-toolbar-reload" [withOnlyIcon]="true" [label]="'Rafraîchir'"></app-icon>
|
|
289
|
-
</button>
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
<button class="btn btn-secondary btn-clear-field" type="button" (click)="onTodayAddDay(0)"
|
|
293
|
-
[attr.disabled]="isDisabled ? 'disabled' : null">
|
|
294
|
-
J
|
|
295
|
-
<span class="visually-hidden">Aujourd'hui</span>
|
|
296
|
-
</button>
|
|
297
|
-
<button class="btn btn-secondary btn-clear-field" type="button" (click)="onTodayAddDay(1)"
|
|
298
|
-
[attr.disabled]="isDisabled ? 'disabled' : null">
|
|
299
|
-
J+1
|
|
300
|
-
<span class="visually-hidden">Demain</span>
|
|
301
|
-
</button>
|
|
302
|
-
|
|
303
|
-
@if (type !== typeField.datePlusOne && type !== typeField.dateComplexe) {
|
|
304
|
-
<button class="btn btn-secondary btn-clear-field" type="button" (click)="onTodayAddDay(2)"
|
|
305
|
-
[attr.disabled]="isDisabled ? 'disabled' : null">
|
|
306
|
-
J+2
|
|
307
|
-
<span class="visually-hidden">Dans 2 jours</span>
|
|
308
|
-
</button>
|
|
309
|
-
|
|
310
|
-
@if (type !== typeField.datePlusTwo) {
|
|
311
|
-
<button class="btn btn-secondary btn-clear-field" type="button" (click)="onTodayAddDay(7)"
|
|
312
|
-
[attr.disabled]="isDisabled ? 'disabled' : null">
|
|
313
|
-
J+7
|
|
314
|
-
<span class="visually-hidden">Dans 7 jours</span>
|
|
315
|
-
</button>
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
</div>
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
@if (type === typeField.slider) {
|
|
322
|
-
<ngx-slider [(value)]="sliderValue" [options]="sliderOptions" [formControl]="formControl"></ngx-slider>
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
@if (inTableFilter && isInInputGroup()) {
|
|
326
|
-
<button class="btn btn-secondary btn-clear-field" type="button" (click)="onClearFieldFilter()">×</button>
|
|
327
|
-
}
|
|
328
|
-
@else if (isInInputGroup()) {
|
|
329
|
-
<button *ngIf="formControl?.value" class="btn btn-secondary btn-clear-field" type="button"
|
|
330
|
-
(click)="onClearField(formControl)">×</button>
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
</ng-template>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
-
import { FormFieldComponent } from './form-field.component';
|
|
3
|
-
|
|
4
|
-
describe('FormFieldComponent', () => {
|
|
5
|
-
let component: FormFieldComponent;
|
|
6
|
-
let fixture: ComponentFixture<FormFieldComponent>;
|
|
7
|
-
|
|
8
|
-
beforeEach(async () => {
|
|
9
|
-
await TestBed.configureTestingModule({
|
|
10
|
-
declarations: [ FormFieldComponent ]
|
|
11
|
-
})
|
|
12
|
-
.compileComponents();
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
beforeEach(() => {
|
|
16
|
-
fixture = TestBed.createComponent(FormFieldComponent);
|
|
17
|
-
component = fixture.componentInstance;
|
|
18
|
-
fixture.detectChanges();
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
it('should create', () => {
|
|
22
|
-
expect(component).toBeTruthy();
|
|
23
|
-
});
|
|
24
|
-
});
|