myrta-ui 17.1.47 → 17.1.49

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 (24) hide show
  1. package/esm2022/lib/components/form/input-date/components/date-calendar/date-calendar.component.mjs +222 -0
  2. package/esm2022/lib/components/form/input-date/helpers/date-helpers.mjs +70 -0
  3. package/esm2022/lib/components/form/input-date/input-date.component.mjs +316 -0
  4. package/esm2022/lib/components/form/input-date/input-date.enum.mjs +7 -0
  5. package/esm2022/lib/components/form/input-date/input-date.module.mjs +51 -0
  6. package/esm2022/lib/components/form/input-date-time/input-date-time.component.mjs +3 -3
  7. package/esm2022/lib/components/form/input-date-time/input-date-time.enum.mjs +7 -7
  8. package/esm2022/lib/components/form/input-tel/data/all-countries.mjs +2 -2
  9. package/esm2022/lib/components/form/input-timepicker/input-timepicker.component.mjs +3 -3
  10. package/esm2022/lib/services/toaster-service/config/index.mjs +3 -2
  11. package/esm2022/lib/services/toaster-service/toaster-service.service.mjs +1 -1
  12. package/esm2022/public-api.mjs +3 -1
  13. package/fesm2022/myrta-ui.mjs +648 -9
  14. package/fesm2022/myrta-ui.mjs.map +1 -1
  15. package/lib/components/form/input-date/components/date-calendar/date-calendar.component.d.ts +63 -0
  16. package/lib/components/form/input-date/helpers/date-helpers.d.ts +14 -0
  17. package/lib/components/form/input-date/input-date.component.d.ts +65 -0
  18. package/lib/components/form/input-date/input-date.enum.d.ts +11 -0
  19. package/lib/components/form/input-date/input-date.module.d.ts +14 -0
  20. package/lib/components/form/input-date-time/input-date-time.component.d.ts +2 -2
  21. package/lib/components/form/input-date-time/input-date-time.enum.d.ts +2 -2
  22. package/lib/services/toaster-service/config/index.d.ts +1 -1
  23. package/package.json +1 -1
  24. package/public-api.d.ts +2 -0
@@ -0,0 +1,63 @@
1
+ import { ChangeDetectorRef, EventEmitter, OnInit } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class DateCalendarComponent implements OnInit {
4
+ private _detector;
5
+ selectedDate: Date | null;
6
+ dateSelected: EventEmitter<Date>;
7
+ close: EventEmitter<void>;
8
+ currentMonth: number;
9
+ currentYear: number;
10
+ view: 'days' | 'months' | 'years';
11
+ readonly monthNames: string[];
12
+ readonly daysOfWeek: string[];
13
+ readonly months: number[];
14
+ private _minDate;
15
+ private _maxDate;
16
+ private _minDateStr;
17
+ private _maxDateStr;
18
+ private calendarDaysCache;
19
+ constructor(_detector: ChangeDetectorRef);
20
+ ngOnInit(): void;
21
+ set minDate(value: string | null);
22
+ get minDate(): string | null;
23
+ set maxDate(value: string | null);
24
+ get maxDate(): string | null;
25
+ private updateDateBounds;
26
+ get headerText(): string;
27
+ switchView(): void;
28
+ getCalendarDays(): {
29
+ day: number;
30
+ month: number;
31
+ year: number;
32
+ }[];
33
+ getYears(): number[];
34
+ isSelected(day: {
35
+ day: number;
36
+ month: number;
37
+ year: number;
38
+ }): boolean;
39
+ isMonthSelected(month: number): boolean;
40
+ isYearSelected(year: number): boolean;
41
+ isDateEnabled(day: {
42
+ day: number;
43
+ month: number;
44
+ year: number;
45
+ }): boolean;
46
+ isMonthDisabled(month: number): boolean;
47
+ isYearDisabled(year: number): boolean;
48
+ selectDate(day: {
49
+ day: number;
50
+ month: number;
51
+ year: number;
52
+ }): void;
53
+ selectMonth(month: number): void;
54
+ selectYear(year: number): void;
55
+ changeMonth(offset: number): void;
56
+ changeYearRange(offset: number): void;
57
+ isPreviousMonthDisabled(): boolean;
58
+ isNextMonthDisabled(): boolean;
59
+ isPreviousYearRangeDisabled(): boolean;
60
+ isNextYearRangeDisabled(): boolean;
61
+ static ɵfac: i0.ɵɵFactoryDeclaration<DateCalendarComponent, never>;
62
+ static ɵcmp: i0.ɵɵComponentDeclaration<DateCalendarComponent, "mrx-date-calendar", never, { "selectedDate": { "alias": "selectedDate"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; }, { "dateSelected": "dateSelected"; "close": "close"; }, never, never, false, never>;
63
+ }
@@ -0,0 +1,14 @@
1
+ export declare function formatDate(date: Date, format: string): string;
2
+ export declare function toOutputFormat(date: Date): string;
3
+ export declare function isValidDate(date: Date): boolean;
4
+ export declare function getDaysInMonth(year: number, month: number): number;
5
+ export declare function isDateInRange(date: Date, minDate: string | null, maxDate: string | null): boolean;
6
+ export declare function clampDate(date: Date, minDate: string | null, maxDate: string | null): Date;
7
+ export declare function getRangeErrorMessage(date: Date, minDate: string | null, maxDate: string | null): string;
8
+ export declare function parseInputDate(dateStr: string): Date | null;
9
+ export declare function adjustInvalidDate(year: number, month: number, day: number): {
10
+ year: number;
11
+ month: number;
12
+ day: number;
13
+ };
14
+ export declare const cleanDate: (date: string) => Date;
@@ -0,0 +1,65 @@
1
+ import { ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { ControlValueAccessor } from '@angular/forms';
3
+ import { Overlay } from '@angular/cdk/overlay';
4
+ import { Field } from '../../../services';
5
+ import { InputDateSizesTypes, InputDateValueTypes } from './input-date.enum';
6
+ import { InputDateTimeValueTypes, InputDateTimeValueWithId } from '../input-date-time/models/input-date-time.model';
7
+ import { PositionType } from '../../../enums/overlay';
8
+ import * as i0 from "@angular/core";
9
+ export declare class InputDateComponent implements OnInit, OnDestroy, ControlValueAccessor {
10
+ private _overlay;
11
+ private _detector;
12
+ private _elementRef;
13
+ private _clickSubscription;
14
+ private _overlayRef;
15
+ displayValue: string;
16
+ selectedDate: Date | null;
17
+ mask: string;
18
+ errorMessage: string | null;
19
+ uuid: string;
20
+ fields: Field[];
21
+ format: string;
22
+ minDate: string | null;
23
+ maxDate: string | null;
24
+ isSilentValidation: boolean;
25
+ isManualInput: boolean;
26
+ closeAfterSelect: boolean;
27
+ required: boolean;
28
+ size: InputDateSizesTypes;
29
+ customClasses: string;
30
+ disabled: boolean;
31
+ readonly: boolean;
32
+ placeholder: string;
33
+ popupPosition: PositionType;
34
+ invalid: boolean;
35
+ invalidMessage: string | string[];
36
+ checkInvalid: true | false | null;
37
+ changed: EventEmitter<InputDateTimeValueTypes>;
38
+ modelChange: EventEmitter<InputDateTimeValueWithId>;
39
+ blurred: EventEmitter<InputDateTimeValueWithId>;
40
+ dateInput: ElementRef;
41
+ private onChange;
42
+ private onTouched;
43
+ constructor(_overlay: Overlay, _detector: ChangeDetectorRef, _elementRef: ElementRef);
44
+ ngOnInit(): void;
45
+ ngOnDestroy(): void;
46
+ get checkValidClasses(): string;
47
+ get getClasses(): string;
48
+ get isViewCleanIcon(): boolean;
49
+ writeValue(value: string): void;
50
+ registerOnChange(fn: (value: string) => void): void;
51
+ registerOnTouched(fn: () => void): void;
52
+ setDisabledState(isDisabled: boolean): void;
53
+ set value(value: string);
54
+ onInput(event: Event): void;
55
+ private processInput;
56
+ onBlur(): void;
57
+ openCalendar(): void;
58
+ onDateSelected(date: Date): void;
59
+ closeCalendar(): void;
60
+ clickToIconCalendar(): void;
61
+ clickToIconClear(): void;
62
+ updateValue(insideValue: InputDateValueTypes): void;
63
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputDateComponent, never>;
64
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputDateComponent, "mrx-input-date", never, { "fields": { "alias": "fields"; "required": false; }; "format": { "alias": "format"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "isSilentValidation": { "alias": "isSilentValidation"; "required": false; }; "isManualInput": { "alias": "isManualInput"; "required": false; }; "closeAfterSelect": { "alias": "closeAfterSelect"; "required": false; }; "required": { "alias": "required"; "required": false; }; "size": { "alias": "size"; "required": false; }; "customClasses": { "alias": "customClasses"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "popupPosition": { "alias": "popupPosition"; "required": false; }; "invalid": { "alias": "invalid"; "required": false; }; "invalidMessage": { "alias": "invalidMessage"; "required": false; }; "checkInvalid": { "alias": "checkInvalid"; "required": false; }; }, { "changed": "changed"; "modelChange": "modelChange"; "blurred": "blurred"; }, never, never, false, never>;
65
+ }
@@ -0,0 +1,11 @@
1
+ export declare enum InputDateSizesEnum {
2
+ 'small' = "mrx-input-date-sm",
3
+ 'medium' = "mrx-input-date-md",
4
+ 'large' = "mrx-input-date-lg"
5
+ }
6
+ export type InputDateSizesTypes = 'small' | 'medium' | 'large';
7
+ export type InputDateValueTypes = string;
8
+ export interface InputDateValueWithId {
9
+ value: InputDateValueTypes;
10
+ id: string;
11
+ }
@@ -0,0 +1,14 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./input-date.component";
3
+ import * as i2 from "./components/date-calendar/date-calendar.component";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "ngx-mask";
6
+ import * as i5 from "@angular/forms";
7
+ import * as i6 from "../../error-message/error-message.module";
8
+ import * as i7 from "../../label/label.module";
9
+ import * as i8 from "../../save-state/save-state.module";
10
+ export declare class InputDateModule {
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputDateModule, never>;
12
+ static ɵmod: i0.ɵɵNgModuleDeclaration<InputDateModule, [typeof i1.InputDateComponent, typeof i2.DateCalendarComponent], [typeof i3.CommonModule, typeof i4.NgxMaskDirective, typeof i5.FormsModule, typeof i6.ErrorMessageModule, typeof i7.LabelModule, typeof i8.SaveStateModule], [typeof i1.InputDateComponent]>;
13
+ static ɵinj: i0.ɵɵInjectorDeclaration<InputDateModule>;
14
+ }
@@ -1,6 +1,6 @@
1
1
  import { AfterViewInit, ElementRef, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
2
2
  import { ControlValueAccessor } from '@angular/forms';
3
- import { ExtraTime, InputDateSizesTypes } from './input-date-time.enum';
3
+ import { ExtraTime, InputDateTimeSizesTypes } from './input-date-time.enum';
4
4
  import { DateModel, TimeModel } from './helpers/validate-value-models';
5
5
  import { TimezoneType } from './enum/timezone';
6
6
  import { Field } from '../../../services';
@@ -15,7 +15,7 @@ export declare class InputDateTimeComponent implements ControlValueAccessor, OnC
15
15
  innerInvalidMessage: string;
16
16
  uuid: string;
17
17
  fields: Field[];
18
- size: InputDateSizesTypes;
18
+ size: InputDateTimeSizesTypes;
19
19
  customClasses: string;
20
20
  dateLabel: string;
21
21
  timeLabel: string;
@@ -1,9 +1,9 @@
1
- export declare enum InputDateSizesEnum {
1
+ export declare enum InputDateTimeSizesEnum {
2
2
  'small' = "mrx-input-date-sm",
3
3
  'medium' = "mrx-input-date-md",
4
4
  'large' = "mrx-input-date-lg"
5
5
  }
6
- export type InputDateSizesTypes = 'small' | 'medium' | 'large';
6
+ export type InputDateTimeSizesTypes = 'small' | 'medium' | 'large';
7
7
  /**
8
8
  * Пример использования <br/>
9
9
  * message="Не более {diff} дней" <br/>
@@ -1,2 +1,2 @@
1
- import { GlobalConfig } from "ngx-toastr";
1
+ import { GlobalConfig } from 'ngx-toastr';
2
2
  export declare const toastrDefaultConfig: Partial<GlobalConfig>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myrta-ui",
3
- "version": "17.1.47",
3
+ "version": "17.1.49",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^17.3.0",
6
6
  "@angular/core": "^17.3.0",
package/public-api.d.ts CHANGED
@@ -95,6 +95,8 @@ export * from './lib/components/form/input-phone/models/country.model';
95
95
  export * from './lib/components/form/input-datepicker/input-datepicker.module';
96
96
  export * from './lib/components/form/input-datepicker/input-datepicker.component';
97
97
  export * from './lib/components/form/input-datepicker/input-datepicker.enum';
98
+ export * from './lib/components/form/input-date/input-date.module';
99
+ export * from './lib/components/form/input-date/input-date.component';
98
100
  export * from './lib/components/form/input-date-time/input-date-time.module';
99
101
  export * from './lib/components/form/input-date-time/input-date-time.component';
100
102
  export * from './lib/components/form/input-date-time/input-date-time.enum';