@annalib/anna-core 7.2.3 → 7.2.4
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/.browserslistrc +16 -0
- package/karma.conf.js +44 -0
- package/ng-package.json +14 -0
- package/package.json +19 -39
- package/src/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.html +22 -0
- package/src/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.scss +0 -0
- package/src/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.spec.ts +25 -0
- package/src/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.ts +16 -0
- package/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.html +33 -0
- package/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.scss +0 -0
- package/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.spec.ts +25 -0
- package/src/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.ts +28 -0
- package/src/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.html +20 -0
- package/src/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.scss +0 -0
- package/src/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.spec.ts +25 -0
- package/src/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.ts +16 -0
- package/src/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.html +3 -0
- package/src/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.scss +17 -0
- package/src/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.spec.ts +24 -0
- package/src/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.ts +20 -0
- package/src/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.html +23 -0
- package/src/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.scss +0 -0
- package/src/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.spec.ts +25 -0
- package/src/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.ts +16 -0
- package/src/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.html +15 -0
- package/src/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.scss +0 -0
- package/src/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.spec.ts +25 -0
- package/src/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.ts +19 -0
- package/src/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.html +14 -0
- package/src/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.scss +0 -0
- package/src/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.spec.ts +25 -0
- package/src/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.ts +16 -0
- package/src/lib/anna-core-shared-lib/constants/shared.constant.ts +35 -0
- package/src/lib/anna-core-shared-lib/directives/digits-only/digits-only.directive.ts +307 -0
- package/src/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.ts +19 -0
- package/src/lib/anna-core-shared-lib/models/anna-generic-data-type.model.ts +19 -0
- package/{lib/anna-core-shared-lib/models/anna-global-dropdown-config.model.d.ts → src/lib/anna-core-shared-lib/models/anna-global-dropdown-config.model.ts} +21 -9
- package/src/lib/anna-core-shared-lib/models/anna-manage-users.model.ts +6 -0
- package/{lib/anna-core-shared-lib/models/anna-non-editable-gt-models.d.ts → src/lib/anna-core-shared-lib/models/anna-non-editable-gt-models.ts} +28 -17
- package/src/lib/anna-core-shared-lib/models/anna-sort.model.ts +13 -0
- package/src/lib/anna-core-shared-lib/models/anna-tooltip.model.ts +44 -0
- package/src/lib/anna-core-shared-lib/pipes/annaConvertZeroOrNullOrUndefined.pipe.ts +20 -0
- package/src/lib/anna-core-shared-lib/pipes/annaFilterSearchedText.pipe.ts +43 -0
- package/src/lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe.ts +19 -0
- package/src/lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe.ts +12 -0
- package/src/lib/anna-core-shared-lib/services/anna-date-time-format.service.ts +219 -0
- package/src/lib/anna-core-shared-lib/services/anna-filter.service.ts +563 -0
- package/src/lib/anna-core-shared-lib/services/anna-generic-table.service.ts +136 -0
- package/src/lib/anna-core-shared-lib/services/anna-global-config.service.ts +170 -0
- package/src/lib/anna-core-shared-lib/services/anna-number-format.service.ts +43 -0
- package/src/lib/anna-core-shared-lib/services/anna-sort.service.ts +179 -0
- package/src/lib/anna-core.module.ts +112 -0
- package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.html +46 -0
- package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.scss +153 -0
- package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.spec.ts +24 -0
- package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.ts +106 -0
- package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.html +129 -0
- package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.scss +275 -0
- package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.spec.ts +24 -0
- package/src/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.ts +414 -0
- package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.html +1080 -0
- package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.scss +668 -0
- package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.spec.ts +25 -0
- package/src/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.ts +2186 -0
- package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.html +10 -0
- package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.scss +1 -0
- package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.spec.ts +24 -0
- package/src/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.ts +69 -0
- package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.html +13 -0
- package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.scss +88 -0
- package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.spec.ts +25 -0
- package/src/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.ts +460 -0
- package/src/lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/anna-fixed-row-size-table-virtual-scroll-strategy.directive.ts +237 -0
- package/{lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/index.d.ts → src/lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/index.ts} +0 -0
- package/src/lib/anna-generic-table-lib/directives/anna-virtual-table/anna-virtual-table.directive.ts +204 -0
- package/{lib/anna-generic-table-lib/directives/anna-virtual-table/index.d.ts → src/lib/anna-generic-table-lib/directives/anna-virtual-table/index.ts} +0 -0
- package/{public-api.d.ts → src/public-api.ts} +28 -0
- package/src/test.ts +27 -0
- package/tsconfig.lib.json +19 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +17 -0
- package/annalib-anna-core.d.ts +0 -5
- package/esm2020/annalib-anna-core.mjs +0 -5
- package/esm2020/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.mjs +0 -15
- package/esm2020/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.mjs +0 -35
- package/esm2020/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.mjs +0 -15
- package/esm2020/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.mjs +0 -22
- package/esm2020/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.mjs +0 -15
- package/esm2020/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.mjs +0 -21
- package/esm2020/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.mjs +0 -15
- package/esm2020/lib/anna-core-shared-lib/constants/shared.constant.mjs +0 -35
- package/esm2020/lib/anna-core-shared-lib/directives/digits-only/digits-only.directive.mjs +0 -282
- package/esm2020/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.mjs +0 -27
- package/esm2020/lib/anna-core-shared-lib/models/anna-generic-data-type.model.mjs +0 -2
- package/esm2020/lib/anna-core-shared-lib/models/anna-global-dropdown-config.model.mjs +0 -2
- package/esm2020/lib/anna-core-shared-lib/models/anna-manage-users.model.mjs +0 -8
- package/esm2020/lib/anna-core-shared-lib/models/anna-non-editable-gt-models.mjs +0 -2
- package/esm2020/lib/anna-core-shared-lib/models/anna-sort.model.mjs +0 -7
- package/esm2020/lib/anna-core-shared-lib/models/anna-tooltip.model.mjs +0 -30
- package/esm2020/lib/anna-core-shared-lib/pipes/annaConvertZeroOrNullOrUndefined.pipe.mjs +0 -26
- package/esm2020/lib/anna-core-shared-lib/pipes/annaFilterSearchedText.pipe.mjs +0 -46
- package/esm2020/lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe.mjs +0 -25
- package/esm2020/lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe.mjs +0 -16
- package/esm2020/lib/anna-core-shared-lib/services/anna-date-time-format.service.mjs +0 -199
- package/esm2020/lib/anna-core-shared-lib/services/anna-filter.service.mjs +0 -469
- package/esm2020/lib/anna-core-shared-lib/services/anna-generic-table.service.mjs +0 -124
- package/esm2020/lib/anna-core-shared-lib/services/anna-global-config.service.mjs +0 -133
- package/esm2020/lib/anna-core-shared-lib/services/anna-number-format.service.mjs +0 -41
- package/esm2020/lib/anna-core-shared-lib/services/anna-sort.service.mjs +0 -147
- package/esm2020/lib/anna-core.module.mjs +0 -180
- package/esm2020/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.mjs +0 -101
- package/esm2020/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.mjs +0 -364
- package/esm2020/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.mjs +0 -1834
- package/esm2020/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.mjs +0 -69
- package/esm2020/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.mjs +0 -357
- package/esm2020/lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/anna-fixed-row-size-table-virtual-scroll-strategy.directive.mjs +0 -189
- package/esm2020/lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/index.mjs +0 -2
- package/esm2020/lib/anna-generic-table-lib/directives/anna-virtual-table/anna-virtual-table.directive.mjs +0 -178
- package/esm2020/lib/anna-generic-table-lib/directives/anna-virtual-table/index.mjs +0 -2
- package/esm2020/public-api.mjs +0 -50
- package/fesm2015/annalib-anna-core.mjs +0 -4875
- package/fesm2015/annalib-anna-core.mjs.map +0 -1
- package/fesm2020/annalib-anna-core.mjs +0 -4868
- package/fesm2020/annalib-anna-core.mjs.map +0 -1
- package/lib/anna-core-shared-lib/components/anna-buyer-approval-icon-template/anna-buyer-approval-icon-template.component.d.ts +0 -8
- package/lib/anna-core-shared-lib/components/anna-icon-column/anna-icon-column.component.d.ts +0 -16
- package/lib/anna-core-shared-lib/components/anna-live-icon-template/anna-live-icon-template.component.d.ts +0 -8
- package/lib/anna-core-shared-lib/components/anna-no-data/anna-no-data.component.d.ts +0 -11
- package/lib/anna-core-shared-lib/components/anna-notify-icon-template/anna-notify-icon-template.component.d.ts +0 -8
- package/lib/anna-core-shared-lib/components/anna-pay-for-performance-icon-template/anna-pay-for-performance-icon-template.component.d.ts +0 -11
- package/lib/anna-core-shared-lib/components/anna-rejected-icon-template/anna-rejected-icon-template.component.d.ts +0 -8
- package/lib/anna-core-shared-lib/constants/shared.constant.d.ts +0 -33
- package/lib/anna-core-shared-lib/directives/digits-only/digits-only.directive.d.ts +0 -34
- package/lib/anna-core-shared-lib/directives/show-ellipsis-text/show-ellipsis-text.directive.d.ts +0 -9
- package/lib/anna-core-shared-lib/models/anna-generic-data-type.model.d.ts +0 -16
- package/lib/anna-core-shared-lib/models/anna-manage-users.model.d.ts +0 -6
- package/lib/anna-core-shared-lib/models/anna-sort.model.d.ts +0 -11
- package/lib/anna-core-shared-lib/models/anna-tooltip.model.d.ts +0 -25
- package/lib/anna-core-shared-lib/pipes/annaConvertZeroOrNullOrUndefined.pipe.d.ts +0 -9
- package/lib/anna-core-shared-lib/pipes/annaFilterSearchedText.pipe.d.ts +0 -9
- package/lib/anna-core-shared-lib/pipes/annaReplaceChar.pipe.d.ts +0 -9
- package/lib/anna-core-shared-lib/pipes/annaTypeOfData.pipe.d.ts +0 -7
- package/lib/anna-core-shared-lib/services/anna-date-time-format.service.d.ts +0 -27
- package/lib/anna-core-shared-lib/services/anna-filter.service.d.ts +0 -74
- package/lib/anna-core-shared-lib/services/anna-generic-table.service.d.ts +0 -28
- package/lib/anna-core-shared-lib/services/anna-global-config.service.d.ts +0 -21
- package/lib/anna-core-shared-lib/services/anna-number-format.service.d.ts +0 -7
- package/lib/anna-core-shared-lib/services/anna-sort.service.d.ts +0 -16
- package/lib/anna-core.module.d.ts +0 -36
- package/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.d.ts +0 -34
- package/lib/anna-dropdown-lib/components/anna-week-calendar-filter/anna-week-calendar-filter.component.d.ts +0 -70
- package/lib/anna-generic-table-lib/components/anna-non-editable-generic-table/anna-non-editable-generic-table.component.d.ts +0 -283
- package/lib/anna-generic-table-lib/components/anna-sort/anna-sort.component.d.ts +0 -17
- package/lib/anna-generic-table-lib/components/anna-table-virtual-scroll-viewport/anna-table-virtual-scroll-viewport.component.d.ts +0 -141
- package/lib/anna-generic-table-lib/directives/anna-fixed-row-size-table-virtual-scroll-strategy/anna-fixed-row-size-table-virtual-scroll-strategy.directive.d.ts +0 -89
- package/lib/anna-generic-table-lib/directives/anna-virtual-table/anna-virtual-table.directive.d.ts +0 -45
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
|
|
2
|
+
|
|
3
|
+
import { AnnaCalendarFilterComponent } from "./anna-calendar-filter.component";
|
|
4
|
+
|
|
5
|
+
describe("OrderListingCalendarFilterComponent", () => {
|
|
6
|
+
let component: AnnaCalendarFilterComponent;
|
|
7
|
+
let fixture: ComponentFixture<AnnaCalendarFilterComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(waitForAsync(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [AnnaCalendarFilterComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(AnnaCalendarFilterComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should create", () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|
package/src/lib/anna-dropdown-lib/components/anna-calendar-filter/anna-calendar-filter.component.ts
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
// Angular import statements
|
|
2
|
+
import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from "@angular/core";
|
|
3
|
+
|
|
4
|
+
//Third party import statements
|
|
5
|
+
import { NgbDate, NgbDatepickerConfig, NgbDateStruct } from "@ng-bootstrap/ng-bootstrap";
|
|
6
|
+
import { AnnaDateTimeFormatService } from '../../../anna-core-shared-lib/services/anna-date-time-format.service';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: "anna-core-calendar-filter-lib",
|
|
10
|
+
templateUrl: "./anna-calendar-filter.component.html",
|
|
11
|
+
styleUrls: ["./anna-calendar-filter.component.scss"],
|
|
12
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
13
|
+
})
|
|
14
|
+
export class AnnaCalendarFilterComponent implements OnInit,OnChanges {
|
|
15
|
+
|
|
16
|
+
@Input() maxDate: any;
|
|
17
|
+
@Input() label: string;
|
|
18
|
+
@Input() minDate: any;
|
|
19
|
+
@Output() selectedDate = new EventEmitter();
|
|
20
|
+
@Input() selectedFromDate: any;
|
|
21
|
+
@Input() selectedToDate: any;
|
|
22
|
+
@Output() apply = new EventEmitter();
|
|
23
|
+
@Output() cancel = new EventEmitter();
|
|
24
|
+
fromDate: any;
|
|
25
|
+
toDate: any;
|
|
26
|
+
hoveredDate: any;
|
|
27
|
+
disableApplyBtn: boolean = false;
|
|
28
|
+
dateToBeShownInInput: string = "";
|
|
29
|
+
|
|
30
|
+
constructor(private annaTimeService: AnnaDateTimeFormatService,
|
|
31
|
+
private datePickerConfig: NgbDatepickerConfig) {}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
ngOnChanges(changes: SimpleChanges): void {
|
|
35
|
+
this.fromDate = this.selectedFromDate;
|
|
36
|
+
this.toDate = this.selectedToDate;
|
|
37
|
+
this.setInputText();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
ngOnInit() {
|
|
41
|
+
// this.fromDate = this.selectedFromDate;
|
|
42
|
+
// this.toDate = this.selectedToDate;
|
|
43
|
+
|
|
44
|
+
this.datePickerConfig.markDisabled = (date: NgbDateStruct) => {
|
|
45
|
+
return false;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
// this.setInputText();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
onDateSelection(date: NgbDate) {
|
|
52
|
+
if (!this.fromDate && !this.toDate) {
|
|
53
|
+
this.fromDate = date;
|
|
54
|
+
} else if (this.fromDate && !this.toDate && (date.after(this.fromDate) || date.equals(this.fromDate))) {
|
|
55
|
+
this.toDate = date;
|
|
56
|
+
} else {
|
|
57
|
+
this.toDate = null;
|
|
58
|
+
this.fromDate = date;
|
|
59
|
+
}
|
|
60
|
+
this.selectedDate.emit({ fromDate: this.fromDate, toDate: this.toDate });
|
|
61
|
+
this.disableCalendarApplyBtn();
|
|
62
|
+
this.setInputText();
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
isHovered(date: NgbDate) {
|
|
66
|
+
return this.fromDate && !this.toDate && this.hoveredDate && date.after(this.fromDate) && date.before(this.hoveredDate);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
isInside(date: NgbDate) {
|
|
70
|
+
return this.toDate && date.after(this.fromDate) && date.before(this.toDate);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
isRange(date: NgbDate) {
|
|
74
|
+
return (
|
|
75
|
+
date.equals(this.fromDate) || (this.toDate && date.equals(this.toDate)) || this.isInside(date) || this.isHovered(date)
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
cancelSelection() {
|
|
80
|
+
this.cancel.emit();
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
applySelection() {
|
|
84
|
+
if (this.fromDate && this.toDate) {
|
|
85
|
+
let dateObj = { fromDate: this.fromDate, toDate: this.toDate };
|
|
86
|
+
this.apply.emit(dateObj);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
disableCalendarApplyBtn() {
|
|
91
|
+
this.disableApplyBtn = !(this.fromDate && this.toDate);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
setInputText(){
|
|
95
|
+
|
|
96
|
+
if(this.fromDate && this.toDate){
|
|
97
|
+
this.dateToBeShownInInput = `${this.annaTimeService.convertNgbDateToMoment(this.fromDate)} - ${this.annaTimeService.convertNgbDateToMoment(this.toDate)}`;
|
|
98
|
+
}
|
|
99
|
+
else if(this.fromDate){
|
|
100
|
+
this.dateToBeShownInInput = `${this.annaTimeService.convertNgbDateToMoment(this.fromDate)}`;
|
|
101
|
+
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<form class="form-inline" *ngIf="config.showAsDropdown">
|
|
2
|
+
<div class="form-group hidden">
|
|
3
|
+
<div class="input-group">
|
|
4
|
+
<input
|
|
5
|
+
name="datepicker"
|
|
6
|
+
class="form-control"
|
|
7
|
+
ngbDatepicker
|
|
8
|
+
#datepicker="ngbDatepicker"
|
|
9
|
+
[autoClose]="false"
|
|
10
|
+
(dateSelect)="selectWeek($event)"
|
|
11
|
+
(closed)="isFocused(false)"
|
|
12
|
+
[displayMonths]="1"
|
|
13
|
+
[dayTemplate]="t"
|
|
14
|
+
[startDate]="fromDate!"
|
|
15
|
+
[firstDayOfWeek]="config.firstDayOfWeek"
|
|
16
|
+
[showWeekNumbers]="config.showWeekNumbers"
|
|
17
|
+
tabindex="-1"
|
|
18
|
+
style="display: none"
|
|
19
|
+
[footerTemplate]="footerTemplate"
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
|
|
24
|
+
<!--Single week select-->
|
|
25
|
+
<div *ngIf="!config.selectMultipleWeeks">
|
|
26
|
+
<span style="position: relative; left: 30px; font-size: 12px"> {{ weekNumbers }} </span>
|
|
27
|
+
<div class="form-group">
|
|
28
|
+
<div class="input-group">
|
|
29
|
+
<div class="single-week">
|
|
30
|
+
<div class="left">
|
|
31
|
+
<span class="material-icons next-round-btn" (click)="previousWeek()"> navigate_next </span>
|
|
32
|
+
</div>
|
|
33
|
+
<input
|
|
34
|
+
#dpFromDate
|
|
35
|
+
class="form-control"
|
|
36
|
+
placeholder="Select Weeks"
|
|
37
|
+
[ngClass]="[config.customClass == '' ? '' : config.customClass]"
|
|
38
|
+
name="dpFromDate"
|
|
39
|
+
[value]="dateToDisplay"
|
|
40
|
+
[readonly]="true"
|
|
41
|
+
(click)="isFocused(true); isDropdownOpenedForCalendar(datepicker)"
|
|
42
|
+
/>
|
|
43
|
+
<i class="mdi mdi-menu-down" *ngIf='!datepicker.isOpen()' (click)="datepicker.open()"></i>
|
|
44
|
+
<i class='mdi mdi-menu-up' *ngIf="datepicker.isOpen()" (click)="isDropdownOpenedForCalendar(datepicker)"></i>
|
|
45
|
+
<div class="right">
|
|
46
|
+
<span class="material-icons round-btn" (click)="nextWeek()"> navigate_next </span>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<!--Multiple week select-->
|
|
54
|
+
<div class="form-group" *ngIf="config.selectMultipleWeeks">
|
|
55
|
+
<div class="input-group">
|
|
56
|
+
<div class="multiple-weeks">
|
|
57
|
+
<input
|
|
58
|
+
#dpFromDate
|
|
59
|
+
class="form-control"
|
|
60
|
+
placeholder="Select Weeks"
|
|
61
|
+
[ngClass]="[config.customClass == '' ? '' : config.customClass]"
|
|
62
|
+
name="dpFromDate"
|
|
63
|
+
[readonly]="true"
|
|
64
|
+
[value]="weekNumbers"
|
|
65
|
+
(click)="isFocused(true); isDropdownOpenedForCalendar(datepicker)"
|
|
66
|
+
/>
|
|
67
|
+
<i *ngIf="!multiSelectDropdownOpen" class="mdi mdi-menu-down multiselect-input-arrow"></i>
|
|
68
|
+
<i *ngIf="multiSelectDropdownOpen" class="mdi mdi-menu-up multiselect-input-arrow"></i>
|
|
69
|
+
</div>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
</form>
|
|
73
|
+
|
|
74
|
+
<ngb-datepicker
|
|
75
|
+
#weekPicker
|
|
76
|
+
*ngIf="!config.showAsDropdown"
|
|
77
|
+
[displayMonths]="1"
|
|
78
|
+
[startDate]="fromDate!"
|
|
79
|
+
[firstDayOfWeek]="config.firstDayOfWeek"
|
|
80
|
+
[showWeekNumbers]="config.showWeekNumbers"
|
|
81
|
+
[dayTemplate]="t"
|
|
82
|
+
[maxDate]="maxDate"
|
|
83
|
+
[minDate]="minDate"
|
|
84
|
+
(dateSelect)="selectWeek($event)"
|
|
85
|
+
[markDisabled]="disabledFunc"
|
|
86
|
+
>
|
|
87
|
+
</ngb-datepicker>
|
|
88
|
+
|
|
89
|
+
<ng-template #footerTemplate>
|
|
90
|
+
<hr class="my-0" />
|
|
91
|
+
<button
|
|
92
|
+
class="btn btn-primary btn-sm m-2 float-right"
|
|
93
|
+
(click)="applyChanges(); closeDatepicker(datepicker)"
|
|
94
|
+
style="background-color: #268bff; color: #ffffff"
|
|
95
|
+
>
|
|
96
|
+
Apply
|
|
97
|
+
</button>
|
|
98
|
+
<button
|
|
99
|
+
class="btn btn-primary btn-sm m-2 float-right"
|
|
100
|
+
(click)="revertDates(); closeDatepicker(datepicker)"
|
|
101
|
+
style="background-color: rgba(38, 139, 255, 0.12); color: #268bff"
|
|
102
|
+
>
|
|
103
|
+
Cancel
|
|
104
|
+
</button>
|
|
105
|
+
</ng-template>
|
|
106
|
+
|
|
107
|
+
<ng-template #t let-date let-focused="focused" let-disabled="disabled">
|
|
108
|
+
<span
|
|
109
|
+
class="custom-day"
|
|
110
|
+
[class.focused]="focused"
|
|
111
|
+
[class.range]="isRange(date)"
|
|
112
|
+
[class.faded]="isHovered(date) || isInside(date)"
|
|
113
|
+
[class.disabled]="disabled"
|
|
114
|
+
(mouseenter)="hoveredDate = date"
|
|
115
|
+
(mouseleave)="hoveredDate = null"
|
|
116
|
+
>
|
|
117
|
+
{{ date.day }}
|
|
118
|
+
</span>
|
|
119
|
+
</ng-template>
|
|
120
|
+
|
|
121
|
+
<!--
|
|
122
|
+
|
|
123
|
+
<hr>
|
|
124
|
+
|
|
125
|
+
<pre>From: {{ fromDate | json }} </pre>
|
|
126
|
+
<pre>To: {{ toDate | json }} </pre>
|
|
127
|
+
<pre>weekNumbers: {{ weekNumbers | json }} </pre>
|
|
128
|
+
|
|
129
|
+
-->
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
/*Setting the properties of week-picker calendar*/
|
|
2
|
+
@import "colors", "fonts";
|
|
3
|
+
|
|
4
|
+
@mixin font-style {
|
|
5
|
+
font-style: unset !important;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@mixin week-width {
|
|
9
|
+
width: 3rem !important;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@mixin material-icon {
|
|
13
|
+
// height: 1.8rem;
|
|
14
|
+
line-height: 1.3;
|
|
15
|
+
// background-color: #d8d8d8;
|
|
16
|
+
border-radius: 50%;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@mixin input-group {
|
|
21
|
+
width: 212px;
|
|
22
|
+
border-radius: 2px;
|
|
23
|
+
border: solid 1px #b3b3b3;
|
|
24
|
+
height: 1.875rem;
|
|
25
|
+
cursor: pointer; //Lur setting issue no 36
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@mixin outline {
|
|
29
|
+
outline: none !important;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@mixin common-css {
|
|
33
|
+
background-color: rgba(38, 139, 255, 0.12) !important;
|
|
34
|
+
color: $charcoal !important;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
:host::ng-deep {
|
|
38
|
+
&.right {
|
|
39
|
+
width: unset !important;
|
|
40
|
+
background-color: white !important;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.ngb-dp-day,
|
|
44
|
+
&.ngb-dp-weekday {
|
|
45
|
+
@include week-width;
|
|
46
|
+
@include font-style;
|
|
47
|
+
color: $green;
|
|
48
|
+
outline: none;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&.ngb-dp-day {
|
|
52
|
+
&:first-child {
|
|
53
|
+
border: 1px solid black;
|
|
54
|
+
}
|
|
55
|
+
&.disabled {
|
|
56
|
+
color: $lightGrey;
|
|
57
|
+
cursor: not-allowed;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&.ngb-dp-showweek:before {
|
|
62
|
+
content: "Weeks";
|
|
63
|
+
margin-right: 5px;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
&.ngb-dp-week-number {
|
|
67
|
+
@include font-style;
|
|
68
|
+
width: 4rem !important;
|
|
69
|
+
margin-right: 5px;
|
|
70
|
+
font-weight: bold;
|
|
71
|
+
color: black !important;
|
|
72
|
+
border-right: 1px solid rgba(0, 0, 0, 0.125);
|
|
73
|
+
&::before {
|
|
74
|
+
@include font-style;
|
|
75
|
+
content: "Week ";
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&.ngb-dp-weekday.ngb-dp-showweek {
|
|
80
|
+
margin-right: 5px;
|
|
81
|
+
width: 4rem !important;
|
|
82
|
+
border-right: 1px solid rgba(0, 0, 0, 0.125);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.dropdown-menu {
|
|
86
|
+
box-shadow: none;
|
|
87
|
+
&.show {
|
|
88
|
+
top: 15px !important;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
&.bg-light {
|
|
93
|
+
background-color: white !important;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&.ngb-dp-weekdays {
|
|
97
|
+
border-top: 1px solid rgba(0, 0, 0, 0.125);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&.ngb-dp-arrow-btn:focus {
|
|
101
|
+
box-shadow: none;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.custom-day {
|
|
106
|
+
text-align: center;
|
|
107
|
+
padding: 0.185rem 0.25rem;
|
|
108
|
+
display: inline-block;
|
|
109
|
+
height: 1.75rem;
|
|
110
|
+
font-weight: bold;
|
|
111
|
+
color: $darkBlueShade;
|
|
112
|
+
@include week-width;
|
|
113
|
+
&.focused {
|
|
114
|
+
background-color: white; //$lightGray-5;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&.faded {
|
|
118
|
+
background-color: rgba(2, 117, 216, 0.5) !important; //#0275d880
|
|
119
|
+
&:focus {
|
|
120
|
+
@include outline;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&:hover {
|
|
125
|
+
@include common-css;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
&:focus {
|
|
129
|
+
@include outline;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&.range {
|
|
133
|
+
@include common-css;
|
|
134
|
+
&:focus {
|
|
135
|
+
@include outline;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&.disabled {
|
|
140
|
+
color: $lightGray;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.input-group {
|
|
145
|
+
& > .single-week,
|
|
146
|
+
.multiple-weeks {
|
|
147
|
+
display: inline-flex !important;
|
|
148
|
+
& > .form-control {
|
|
149
|
+
@include input-group;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
& > .form-control {
|
|
154
|
+
@include input-group;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.form-control[readonly] {
|
|
159
|
+
background-color: white !important;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@mixin round-button($name, $direction, $boolean) {
|
|
163
|
+
@if $boolean {
|
|
164
|
+
.next-#{"" + $name} {
|
|
165
|
+
transform: rotate(180deg);
|
|
166
|
+
// margin-#{"" + $direction}: 5px;
|
|
167
|
+
margin-#{"" + $direction}: $fs-2;
|
|
168
|
+
@include material-icon;
|
|
169
|
+
}
|
|
170
|
+
} @else {
|
|
171
|
+
.#{"" + $name} {
|
|
172
|
+
@include material-icon;
|
|
173
|
+
// margin-#{"" + $direction}: 5px;
|
|
174
|
+
margin-#{"" + $direction}: $fs-4;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
$roundBtn: "round-btn";
|
|
180
|
+
@include round-button($roundBtn, "left", true);
|
|
181
|
+
@include round-button($roundBtn, "left", false);
|
|
182
|
+
|
|
183
|
+
:host::ng-deep select.custom-select {
|
|
184
|
+
background: none;
|
|
185
|
+
appearance: auto;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
//Lur Setting issue no 11
|
|
189
|
+
.left,
|
|
190
|
+
.right {
|
|
191
|
+
width: $fs-30 !important;
|
|
192
|
+
height: $fs-30;
|
|
193
|
+
background: $lightSilver !important;
|
|
194
|
+
border-radius: 50%;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.left {
|
|
198
|
+
margin-right: $fs-5;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.right {
|
|
202
|
+
margin-left: $fs-5;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
// lur-setting issue no 20 till line number 267
|
|
206
|
+
:host::ng-deep .right .ngb-dp-navigation-chevron,
|
|
207
|
+
:host::ng-deep .ngb-dp-navigation-chevron {
|
|
208
|
+
color: $primary-color;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
:host::ng-deep .ngb-dp-arrow-btn:focus {
|
|
212
|
+
outline-width: 0px;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.custom-day.faded {
|
|
216
|
+
background-color: rgba(38, 139, 255, 0.2);
|
|
217
|
+
color: black;
|
|
218
|
+
font-weight: 600;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.custom-day {
|
|
222
|
+
text-align: center;
|
|
223
|
+
padding: 0.185rem 0.25rem;
|
|
224
|
+
color: black;
|
|
225
|
+
display: inline-block;
|
|
226
|
+
line-height: 1.9;
|
|
227
|
+
height: 2rem;
|
|
228
|
+
width: 2rem;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.custom-day.focused {
|
|
232
|
+
background-color: $lightGray-5;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.custom-day.range,
|
|
236
|
+
.custom-day:hover {
|
|
237
|
+
background-color: $primary-color;
|
|
238
|
+
color: white;
|
|
239
|
+
font-weight: 600;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
//Lur setting issue no 38
|
|
243
|
+
:host::ng-deep div.ngb-dp-weekday {
|
|
244
|
+
color: $oliveGreen;
|
|
245
|
+
@include fonts(Roboto, $fs-13, normal, bold, normal, 2.6, normal);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.mdi-menu-up,
|
|
249
|
+
.mdi-menu-down {
|
|
250
|
+
position: absolute;
|
|
251
|
+
right: $fs-39;
|
|
252
|
+
top: 1px;
|
|
253
|
+
font-size: $fs-22;
|
|
254
|
+
cursor: pointer;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.multiselect-input-arrow {
|
|
258
|
+
position: absolute;
|
|
259
|
+
right: $fs-12;
|
|
260
|
+
top: 3px;
|
|
261
|
+
font-size: $fs-20;
|
|
262
|
+
cursor: pointer;
|
|
263
|
+
pointer-events: none;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
button:focus {
|
|
267
|
+
outline: none;
|
|
268
|
+
box-shadow: none;
|
|
269
|
+
border-color: transparent;
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
::ng-deep .ngb-dp-header, ::ng-deep .ngb-dp-week{
|
|
274
|
+
background: white !important;
|
|
275
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed, waitForAsync } from "@angular/core/testing";
|
|
2
|
+
|
|
3
|
+
import { AnnaWeekCalendarComponent } from "./anna-week-calendar-filter.component";
|
|
4
|
+
|
|
5
|
+
describe("AnnaWeekCalendarComponent", () => {
|
|
6
|
+
let component: AnnaWeekCalendarComponent;
|
|
7
|
+
let fixture: ComponentFixture<AnnaWeekCalendarComponent>;
|
|
8
|
+
|
|
9
|
+
beforeEach(waitForAsync(() => {
|
|
10
|
+
TestBed.configureTestingModule({
|
|
11
|
+
declarations: [AnnaWeekCalendarComponent],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
fixture = TestBed.createComponent(AnnaWeekCalendarComponent);
|
|
17
|
+
component = fixture.componentInstance;
|
|
18
|
+
fixture.detectChanges();
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it("should create", () => {
|
|
22
|
+
expect(component).toBeTruthy();
|
|
23
|
+
});
|
|
24
|
+
});
|