@dealpos-npm/ng-dealpos-library 1.0.3 → 2.0.0

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.
Files changed (58) hide show
  1. package/components/datepicker/index.d.ts +5 -0
  2. package/components/datepicker/public-api.d.ts +1 -0
  3. package/components/datepicker/src/DatepickerHeader.component.d.ts +27 -0
  4. package/components/datepicker/src/datepicker.component.d.ts +49 -0
  5. package/components/datepicker/src/services/calendar.service.d.ts +14 -0
  6. package/components/datepicker-range/index.d.ts +5 -0
  7. package/components/datepicker-range/public-api.d.ts +1 -0
  8. package/components/datepicker-range/src/datepicker-range.component.d.ts +35 -0
  9. package/components/dialog/index.d.ts +5 -0
  10. package/components/dialog/public-api.d.ts +2 -0
  11. package/components/dialog/src/custom-dialog/modal-material.component.d.ts +17 -0
  12. package/components/dialog/src/custom-dialog-config/modal-material-config.d.ts +63 -0
  13. package/components/ng-select-infinite/index.d.ts +5 -0
  14. package/components/ng-select-infinite/public-api.d.ts +1 -0
  15. package/components/ng-select-infinite/src/ng-select-infinite.component.d.ts +110 -0
  16. package/components/toastr/index.d.ts +5 -0
  17. package/components/toastr/public-api.d.ts +1 -0
  18. package/components/toastr/src/custom-toast.component.d.ts +12 -0
  19. package/enum/header-type/index.d.ts +5 -0
  20. package/enum/header-type/public-api.d.ts +1 -0
  21. package/enum/header-type/src/HeaderType.d.ts +6 -0
  22. package/esm2022/components/datepicker/dealpos-npm-ng-dealpos-library-components-datepicker.mjs +5 -0
  23. package/esm2022/components/datepicker/public-api.mjs +2 -0
  24. package/esm2022/components/datepicker/src/DatepickerHeader.component.mjs +89 -0
  25. package/esm2022/components/datepicker/src/datepicker.component.mjs +135 -0
  26. package/esm2022/components/datepicker/src/services/calendar.service.mjs +24 -0
  27. package/esm2022/components/datepicker-range/dealpos-npm-ng-dealpos-library-components-datepicker-range.mjs +5 -0
  28. package/esm2022/components/datepicker-range/public-api.mjs +2 -0
  29. package/esm2022/components/datepicker-range/src/datepicker-range.component.mjs +121 -0
  30. package/esm2022/components/dialog/dealpos-npm-ng-dealpos-library-components-dialog.mjs +5 -0
  31. package/esm2022/components/dialog/public-api.mjs +3 -0
  32. package/esm2022/components/dialog/src/custom-dialog/modal-material.component.mjs +52 -0
  33. package/esm2022/components/dialog/src/custom-dialog-config/modal-material-config.mjs +66 -0
  34. package/esm2022/components/ng-select-infinite/dealpos-npm-ng-dealpos-library-components-ng-select-infinite.mjs +5 -0
  35. package/esm2022/components/ng-select-infinite/public-api.mjs +2 -0
  36. package/esm2022/components/ng-select-infinite/src/ng-select-infinite.component.mjs +209 -0
  37. package/esm2022/components/toastr/dealpos-npm-ng-dealpos-library-components-toastr.mjs +5 -0
  38. package/esm2022/components/toastr/public-api.mjs +2 -0
  39. package/esm2022/components/toastr/src/custom-toast.component.mjs +95 -0
  40. package/esm2022/enum/header-type/dealpos-npm-ng-dealpos-library-enum-header-type.mjs +5 -0
  41. package/esm2022/enum/header-type/public-api.mjs +2 -0
  42. package/esm2022/enum/header-type/src/HeaderType.mjs +8 -0
  43. package/esm2022/services/http/src/http.service.mjs +2 -2
  44. package/fesm2022/dealpos-npm-ng-dealpos-library-components-datepicker-range.mjs +128 -0
  45. package/fesm2022/dealpos-npm-ng-dealpos-library-components-datepicker-range.mjs.map +1 -0
  46. package/fesm2022/dealpos-npm-ng-dealpos-library-components-datepicker.mjs +238 -0
  47. package/fesm2022/dealpos-npm-ng-dealpos-library-components-datepicker.mjs.map +1 -0
  48. package/fesm2022/dealpos-npm-ng-dealpos-library-components-dialog.mjs +123 -0
  49. package/fesm2022/dealpos-npm-ng-dealpos-library-components-dialog.mjs.map +1 -0
  50. package/fesm2022/dealpos-npm-ng-dealpos-library-components-ng-select-infinite.mjs +216 -0
  51. package/fesm2022/dealpos-npm-ng-dealpos-library-components-ng-select-infinite.mjs.map +1 -0
  52. package/fesm2022/dealpos-npm-ng-dealpos-library-components-toastr.mjs +102 -0
  53. package/fesm2022/dealpos-npm-ng-dealpos-library-components-toastr.mjs.map +1 -0
  54. package/fesm2022/dealpos-npm-ng-dealpos-library-enum-header-type.mjs +14 -0
  55. package/fesm2022/dealpos-npm-ng-dealpos-library-enum-header-type.mjs.map +1 -0
  56. package/fesm2022/dealpos-npm-ng-dealpos-library-services-http.mjs +1 -1
  57. package/fesm2022/dealpos-npm-ng-dealpos-library-services-http.mjs.map +1 -1
  58. package/package.json +48 -12
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@dealpos-npm/ng-dealpos-library/components/datepicker" />
5
+ export * from './public-api';
@@ -0,0 +1 @@
1
+ export * from "./src/datepicker.component";
@@ -0,0 +1,27 @@
1
+ import { ChangeDetectorRef, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import { DateAdapter } from '@angular/material/core';
3
+ import { MatCalendar, MatDatepicker } from '@angular/material/datepicker';
4
+ import { Observable } from 'rxjs';
5
+ import { CalendarHeaderConfig, CalendarService } from './services/calendar.service';
6
+ import * as i0 from "@angular/core";
7
+ export declare class DatepickerHeaderComponent<D> implements OnDestroy, OnChanges {
8
+ private _datePicker;
9
+ private _calendar;
10
+ private _dateAdapter;
11
+ private calendarService;
12
+ private _destroyed;
13
+ calendarConfig$: Observable<CalendarHeaderConfig>;
14
+ constructor(_datePicker: MatDatepicker<D | null>, _calendar: MatCalendar<D>, _dateAdapter: DateAdapter<D>, calendarService: CalendarService, cdr: ChangeDetectorRef);
15
+ /**
16
+ * set to today date
17
+ */
18
+ todayClicked(): void;
19
+ /**
20
+ * clear selected date from mat datepicker
21
+ */
22
+ clearClicked(): void;
23
+ ngOnChanges(changes: SimpleChanges): void;
24
+ ngOnDestroy(): void;
25
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatepickerHeaderComponent<any>, never>;
26
+ static ɵcmp: i0.ɵɵComponentDeclaration<DatepickerHeaderComponent<any>, "POS-DatepickerHeader.component.ts", never, {}, {}, never, never, true, never>;
27
+ }
@@ -0,0 +1,49 @@
1
+ import { EventEmitter, OnDestroy } from '@angular/core';
2
+ import { MatFormFieldAppearance } from '@angular/material/form-field';
3
+ import moment from 'moment/moment';
4
+ import { DatepickerHeaderComponent } from './DatepickerHeader.component';
5
+ import { CalendarService } from './services/calendar.service';
6
+ import * as i0 from "@angular/core";
7
+ export declare const MY_FORMATS: {
8
+ parse: {
9
+ dateInput: string;
10
+ };
11
+ display: {
12
+ dateInput: string;
13
+ monthYearLabel: string;
14
+ dateA11yLabel: string;
15
+ monthYearA11yLabel: string;
16
+ };
17
+ };
18
+ export declare class DatepickerComponent implements OnDestroy {
19
+ private calendarService;
20
+ /**
21
+ * custom ui for header to adding new functionality ex: today, Clear
22
+ */
23
+ headerComponent: typeof DatepickerHeaderComponent;
24
+ data_cy: string;
25
+ placeholder: string;
26
+ displayToggle: boolean;
27
+ appearance: MatFormFieldAppearance;
28
+ width: string;
29
+ isFloatingLabel: boolean;
30
+ date: string;
31
+ disabled: boolean;
32
+ readOnly: boolean;
33
+ minDateValidation: any;
34
+ maxDateValidation: any;
35
+ set hidelClearBtn(val: boolean);
36
+ dateChange: EventEmitter<Date>;
37
+ minDate: string;
38
+ /**
39
+ * We lie to the compiler, the correct parameter value is moment.Moment
40
+ * @param newDate
41
+ */
42
+ change(momentValue: moment.Moment): void;
43
+ constructor(calendarService: CalendarService);
44
+ onOpenDatepicker(): void;
45
+ onCloseDatepicker(): void;
46
+ ngOnDestroy(): void;
47
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatepickerComponent, never>;
48
+ static ɵcmp: i0.ɵɵComponentDeclaration<DatepickerComponent, "datepicker", never, { "data_cy": { "alias": "data_cy"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "displayToggle": { "alias": "displayToggle"; "required": false; }; "appearance": { "alias": "appearance"; "required": false; }; "width": { "alias": "width"; "required": false; }; "isFloatingLabel": { "alias": "isFloatingLabel"; "required": false; }; "date": { "alias": "date"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readOnly": { "alias": "readOnly"; "required": false; }; "minDateValidation": { "alias": "minDateValidation"; "required": false; }; "maxDateValidation": { "alias": "maxDateValidation"; "required": false; }; "hidelClearBtn": { "alias": "hidelClearBtn"; "required": false; }; }, { "dateChange": "dateChange"; }, never, never, true, never>;
49
+ }
@@ -0,0 +1,14 @@
1
+ import * as i0 from "@angular/core";
2
+ export interface CalendarHeaderConfig {
3
+ hideBtnClear: boolean;
4
+ hideBtnToday: boolean;
5
+ }
6
+ export declare class CalendarService {
7
+ private _calendarHeaderConfig;
8
+ calendarConfig: CalendarHeaderConfig;
9
+ constructor();
10
+ setHeaderConfig(config: CalendarHeaderConfig): void;
11
+ getHeaderConfig$(): import("rxjs").Observable<CalendarHeaderConfig>;
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<CalendarService, never>;
13
+ static ɵprov: i0.ɵɵInjectableDeclaration<CalendarService>;
14
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@dealpos-npm/ng-dealpos-library/components/datepicker-range" />
5
+ export * from './public-api';
@@ -0,0 +1 @@
1
+ export * from "./src/datepicker-range.component";
@@ -0,0 +1,35 @@
1
+ import { EventEmitter } from "@angular/core";
2
+ import * as i0 from "@angular/core";
3
+ export declare const MY_FORMATS: {
4
+ parse: {
5
+ dateInput: string;
6
+ };
7
+ display: {
8
+ dateInput: string;
9
+ monthYearLabel: string;
10
+ dateA11yLabel: string;
11
+ monthYearA11yLabel: string;
12
+ };
13
+ };
14
+ export declare class DatepickerRangeComponent {
15
+ placeholder: string;
16
+ displayToggle: boolean;
17
+ minDate: Date;
18
+ maxDate: Date;
19
+ showButtonConfirm: boolean;
20
+ width: string;
21
+ dateChange: EventEmitter<{
22
+ from: Date;
23
+ to: Date;
24
+ }>;
25
+ from: Date;
26
+ to: Date;
27
+ fromDateChange(momentValue: any): void;
28
+ toDateChange(momentValue: any): void;
29
+ private emitDateChange;
30
+ onSelectDate(): void;
31
+ onOpenDatepicker(): void;
32
+ onCloseDatepicker(): void;
33
+ static ɵfac: i0.ɵɵFactoryDeclaration<DatepickerRangeComponent, never>;
34
+ static ɵcmp: i0.ɵɵComponentDeclaration<DatepickerRangeComponent, "app-datepicker-range", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "displayToggle": { "alias": "displayToggle"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "showButtonConfirm": { "alias": "showButtonConfirm"; "required": false; }; "width": { "alias": "width"; "required": false; }; "from": { "alias": "from"; "required": false; }; "to": { "alias": "to"; "required": false; }; }, { "dateChange": "dateChange"; }, never, never, true, never>;
35
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@dealpos-npm/ng-dealpos-library/components/dialog" />
5
+ export * from './public-api';
@@ -0,0 +1,2 @@
1
+ export * from "./src/custom-dialog-config/modal-material-config";
2
+ export * from "./src/custom-dialog/modal-material.component";
@@ -0,0 +1,17 @@
1
+ import { OnInit, EventEmitter } from "@angular/core";
2
+ import { ModalMaterialConfig } from "../custom-dialog-config/modal-material-config";
3
+ import { HeaderType } from "@dealpos-npm/ng-dealpos-library/enum/header-type";
4
+ import * as i0 from "@angular/core";
5
+ export declare class ModalMaterialComponent implements OnInit {
6
+ config?: ModalMaterialConfig;
7
+ dynamicValidated: boolean;
8
+ onOk: EventEmitter<any>;
9
+ onCancel: EventEmitter<any>;
10
+ onClose: EventEmitter<any>;
11
+ onBack: EventEmitter<any>;
12
+ headerType: typeof HeaderType;
13
+ ngOnInit(): void;
14
+ onKeyup(event: KeyboardEvent): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<ModalMaterialComponent, never>;
16
+ static ɵcmp: i0.ɵɵComponentDeclaration<ModalMaterialComponent, "modal-material", never, { "config": { "alias": "config"; "required": false; }; "dynamicValidated": { "alias": "dynamicValidated"; "required": false; }; }, { "onOk": "onOk"; "onCancel": "onCancel"; "onClose": "onClose"; "onBack": "onBack"; }, never, ["header", "content", "footer"], true, never>;
17
+ }
@@ -0,0 +1,63 @@
1
+ import { HeaderType } from "@dealpos-npm/ng-dealpos-library/enum/header-type";
2
+ /**../../../../enum/header-type/HeaderType
3
+ * Control the modal UI and UX
4
+ */
5
+ export declare class ModalMaterialConfig {
6
+ /**
7
+ * Text inside of mat-dialog-title in h4 tag
8
+ */
9
+ title: string;
10
+ /**
11
+ * the name of the OK button to be displayed
12
+ */
13
+ okText: string;
14
+ /**
15
+ * the name of the CANCEL button to be displayed
16
+ */
17
+ cancelText: string;
18
+ /**
19
+ * the condition of whether the footer is displayed
20
+ */
21
+ hideFooter: boolean;
22
+ /**
23
+ * the condition of whether the CANCEL Button is displayed
24
+ */
25
+ hideCancel: boolean;
26
+ /**
27
+ * the condition of whether the OK Button is displayed
28
+ */
29
+ hideOk: boolean;
30
+ /**
31
+ * the condition of whether the CLOSE Button is displayed
32
+ */
33
+ hideClose: boolean;
34
+ eMoney: boolean;
35
+ /**
36
+ * header type to change the color of the dialog. ex: Success for Green color, Danger for Red color
37
+ */
38
+ headerType: HeaderType;
39
+ /**
40
+ * conditions for disable OK button
41
+ */
42
+ validated: boolean;
43
+ /**
44
+ * Customization width for the dialog
45
+ */
46
+ customWidth: string;
47
+ /**
48
+ * condition whether the dialog body can be scrolled
49
+ */
50
+ bodyScrollable: boolean;
51
+ /**
52
+ * condition whether the scrollbar body is hide
53
+ */
54
+ hideScrollbar: boolean;
55
+ /**
56
+ *
57
+ */
58
+ disableKeyup?: boolean | undefined;
59
+ /**
60
+ * condition to remove the padding in the body of the dialog
61
+ */
62
+ noPadding: boolean;
63
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@dealpos-npm/ng-dealpos-library/components/ng-select-infinite" />
5
+ export * from './public-api';
@@ -0,0 +1 @@
1
+ export * from "./src/ng-select-infinite.component";
@@ -0,0 +1,110 @@
1
+ import { EventEmitter } from "@angular/core";
2
+ import { NgSelectComponent } from "@ng-select/ng-select";
3
+ import { Subject } from "rxjs";
4
+ import * as i0 from "@angular/core";
5
+ export declare class NgSelectInfiniteComponent {
6
+ placeholder: string;
7
+ bindValue: string;
8
+ bindLabel: string;
9
+ width: string;
10
+ clearable: boolean;
11
+ parent: string;
12
+ disabled: boolean;
13
+ /**
14
+ * show option value as title
15
+ */
16
+ optionTitle: boolean;
17
+ /**
18
+ * element for ng-select
19
+ */
20
+ ngSelectElement: NgSelectComponent;
21
+ set items(value: any[]);
22
+ private _selected;
23
+ get selected(): string;
24
+ set selected(value: string);
25
+ /**
26
+ * for emit selected value in options
27
+ */
28
+ selectedChange: EventEmitter<string | null>;
29
+ /**
30
+ * emit selected label
31
+ */
32
+ selectedLabel: EventEmitter<string | null>;
33
+ /**
34
+ * Event emitter that is triggered when the ng-select-infinite component is opened.
35
+ */
36
+ onOpen: EventEmitter<void>;
37
+ /**
38
+ * class implementation for infinite scroll ng-select
39
+ */
40
+ ngSelectInfiniteScroll: NgSelectInfiniteScroll;
41
+ constructor();
42
+ /**
43
+ * Handles the event when the select dropdown is opened.
44
+ * Emits the `onOpen` event.
45
+ */
46
+ onOpenSelect(): void;
47
+ /**
48
+ * Handles the change event when a value is selected.
49
+ * Emits the selected value and label using the `selectedChange` and `selectedLabel` events.
50
+ * @param value - The selected value.
51
+ */
52
+ onSelectChange(value: any): void;
53
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgSelectInfiniteComponent, never>;
54
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgSelectInfiniteComponent, "ng-select-infinite", never, { "placeholder": { "alias": "placeholder"; "required": false; }; "bindValue": { "alias": "bindValue"; "required": false; }; "bindLabel": { "alias": "bindLabel"; "required": false; }; "width": { "alias": "width"; "required": false; }; "clearable": { "alias": "clearable"; "required": false; }; "parent": { "alias": "parent"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "optionTitle": { "alias": "optionTitle"; "required": false; }; "items": { "alias": "items"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; }, { "selectedChange": "selectedChange"; "selectedLabel": "selectedLabel"; "onOpen": "onOpen"; }, never, never, true, never>;
55
+ }
56
+ declare class NgSelectInfiniteScroll {
57
+ private _dataBuffer;
58
+ private _bufferSize;
59
+ private _data;
60
+ private _loading;
61
+ private _input$;
62
+ private _destroy$;
63
+ /**
64
+ *
65
+ * @param propFilter property object for filtering data
66
+ */
67
+ constructor();
68
+ /**
69
+ * used to listen search typing user
70
+ */
71
+ private onSearch;
72
+ onClear(): void;
73
+ /**
74
+ * used for filtered source data with value typing user
75
+ * @param term value from typing user
76
+ * @returns
77
+ */
78
+ private filterData;
79
+ /**
80
+ * observable input to use in [typehead] ng select
81
+ */
82
+ get input$(): Subject<string>;
83
+ /**
84
+ * used for input [items] ng-select
85
+ */
86
+ get bufferData(): any[];
87
+ /**
88
+ * use for input [loading] in ng-select
89
+ */
90
+ get loading(): boolean;
91
+ /**
92
+ * init data for ng-select
93
+ */
94
+ set data(data: any[]);
95
+ initSelectedValue(value: string, prop: string): void;
96
+ /**
97
+ * set data buffer to showing in option ng-select
98
+ */
99
+ set bufferSize(size: number);
100
+ /**
101
+ * for Output (ScrollToEnd) ng-select
102
+ */
103
+ onScrollToEnd(): void;
104
+ /**
105
+ * get data to push in Buffer data base on bufferSize
106
+ */
107
+ private fetchMore;
108
+ destroy(): void;
109
+ }
110
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@dealpos-npm/ng-dealpos-library/components/toastr" />
5
+ export * from './public-api';
@@ -0,0 +1 @@
1
+ export * from "./src/custom-toast.component";
@@ -0,0 +1,12 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { Toast, ToastrService, ToastPackage } from 'ngx-toastr';
3
+ import * as i0 from "@angular/core";
4
+ export declare class CustomToastComponent extends Toast implements OnInit {
5
+ protected toastrService: ToastrService;
6
+ toastPackage: ToastPackage;
7
+ constructor(toastrService: ToastrService, toastPackage: ToastPackage);
8
+ ngOnInit(): void;
9
+ action(event: Event): boolean;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<CustomToastComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<CustomToastComponent, "[custom-toast-component]", never, {}, {}, never, never, false, never>;
12
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@dealpos-npm/ng-dealpos-library/enum/header-type" />
5
+ export * from './public-api';
@@ -0,0 +1 @@
1
+ export * from "./src/HeaderType";
@@ -0,0 +1,6 @@
1
+ export declare enum HeaderType {
2
+ Success = "Success",
3
+ Info = "Info",
4
+ Warning = "Warning",
5
+ Error = "Error"
6
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './public-api';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVhbHBvcy1ucG0tbmctZGVhbHBvcy1saWJyYXJ5LWNvbXBvbmVudHMtZGF0ZXBpY2tlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2RlYWxwb3MtbnBtL25nLWRlYWxwb3MtbGlicmFyeS9jb21wb25lbnRzL2RhdGVwaWNrZXIvZGVhbHBvcy1ucG0tbmctZGVhbHBvcy1saWJyYXJ5LWNvbXBvbmVudHMtZGF0ZXBpY2tlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpYy1hcGknO1xuIl19
@@ -0,0 +1,2 @@
1
+ export * from "./src/datepicker.component";
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2RlYWxwb3MtbnBtL25nLWRlYWxwb3MtbGlicmFyeS9jb21wb25lbnRzL2RhdGVwaWNrZXIvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDRCQUE0QixDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSBcIi4vc3JjL2RhdGVwaWNrZXIuY29tcG9uZW50XCI7Il19
@@ -0,0 +1,89 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import { Component } from '@angular/core';
3
+ import { MatButtonModule } from '@angular/material/button';
4
+ import { MatNativeDateModule } from '@angular/material/core';
5
+ import { MatDatepickerModule } from '@angular/material/datepicker';
6
+ import { MatFormFieldModule } from '@angular/material/form-field';
7
+ import { MatInputModule } from '@angular/material/input';
8
+ import { Subject, takeUntil } from 'rxjs';
9
+ import * as i0 from "@angular/core";
10
+ import * as i1 from "@angular/material/datepicker";
11
+ import * as i2 from "@angular/material/core";
12
+ import * as i3 from "./services/calendar.service";
13
+ import * as i4 from "@angular/common";
14
+ import * as i5 from "@angular/material/button";
15
+ export class DatepickerHeaderComponent {
16
+ constructor(_datePicker, _calendar, _dateAdapter, calendarService, cdr) {
17
+ this._datePicker = _datePicker;
18
+ this._calendar = _calendar;
19
+ this._dateAdapter = _dateAdapter;
20
+ this.calendarService = calendarService;
21
+ this._destroyed = new Subject();
22
+ _calendar.stateChanges
23
+ .pipe(takeUntil(this._destroyed))
24
+ .subscribe((val) => cdr.markForCheck());
25
+ this.calendarConfig$ = this.calendarService.getHeaderConfig$();
26
+ }
27
+ /**
28
+ * set to today date
29
+ */
30
+ todayClicked() {
31
+ this._calendar.activeDate = this._dateAdapter.today();
32
+ this._datePicker.select(this._dateAdapter.today());
33
+ this._datePicker.close();
34
+ }
35
+ /**
36
+ * clear selected date from mat datepicker
37
+ */
38
+ clearClicked() {
39
+ this._datePicker.select(null);
40
+ this._datePicker.close();
41
+ }
42
+ ngOnChanges(changes) {
43
+ this._calendar.ngOnChanges(changes);
44
+ }
45
+ ngOnDestroy() {
46
+ this._destroyed.next();
47
+ this._destroyed.complete();
48
+ }
49
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: DatepickerHeaderComponent, deps: [{ token: i1.MatDatepicker }, { token: i1.MatCalendar }, { token: i2.DateAdapter }, { token: i3.CalendarService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
50
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: DatepickerHeaderComponent, isStandalone: true, selector: "POS-DatepickerHeader.component.ts", providers: [MatDatepickerModule], usesOnChanges: true, ngImport: i0, template: `
51
+ <mat-calendar-header>
52
+ <ng-container *ngIf="(calendarConfig$ | async) as config">
53
+ <button *ngIf="!config.hideBtnToday" mat-icon-button (click)="todayClicked()" title="Today">
54
+ <i class="far fa-clock" style="font-size: 18px;"></i>
55
+ </button>
56
+ <button *ngIf="!config.hideBtnClear" mat-icon-button (click)="clearClicked()" title="Clear">
57
+ <i class="far fa-xmark-circle" style="font-size: 18px;"></i>
58
+ </button>
59
+ </ng-container>
60
+ </mat-calendar-header>
61
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i4.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i4.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatNativeDateModule }, { kind: "ngmodule", type: MatDatepickerModule }, { kind: "component", type: i1.MatCalendarHeader, selector: "mat-calendar-header", exportAs: ["matCalendarHeader"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: MatInputModule }] }); }
62
+ }
63
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: DatepickerHeaderComponent, decorators: [{
64
+ type: Component,
65
+ args: [{
66
+ selector: 'POS-DatepickerHeader.component.ts',
67
+ template: `
68
+ <mat-calendar-header>
69
+ <ng-container *ngIf="(calendarConfig$ | async) as config">
70
+ <button *ngIf="!config.hideBtnToday" mat-icon-button (click)="todayClicked()" title="Today">
71
+ <i class="far fa-clock" style="font-size: 18px;"></i>
72
+ </button>
73
+ <button *ngIf="!config.hideBtnClear" mat-icon-button (click)="clearClicked()" title="Clear">
74
+ <i class="far fa-xmark-circle" style="font-size: 18px;"></i>
75
+ </button>
76
+ </ng-container>
77
+ </mat-calendar-header>
78
+ `,
79
+ standalone: true,
80
+ imports: [CommonModule,
81
+ MatButtonModule,
82
+ MatNativeDateModule,
83
+ MatDatepickerModule,
84
+ MatFormFieldModule,
85
+ MatInputModule],
86
+ providers: [MatDatepickerModule]
87
+ }]
88
+ }], ctorParameters: () => [{ type: i1.MatDatepicker }, { type: i1.MatCalendar }, { type: i2.DateAdapter }, { type: i3.CalendarService }, { type: i0.ChangeDetectorRef }] });
89
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGF0ZXBpY2tlckhlYWRlci5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9kZWFscG9zLW5wbS9uZy1kZWFscG9zLWxpYnJhcnkvY29tcG9uZW50cy9kYXRlcGlja2VyL3NyYy9EYXRlcGlja2VySGVhZGVyLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hc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