myrta-ui 1.1.89 → 1.1.90

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 (25) hide show
  1. package/esm2020/lib/components/form/input-date/components/date-calendar/date-calendar.component.mjs +222 -0
  2. package/esm2020/lib/components/form/input-date/helpers/date-helpers.mjs +70 -0
  3. package/esm2020/lib/components/form/input-date/input-date.component.mjs +313 -0
  4. package/esm2020/lib/components/form/input-date/input-date.enum.mjs +7 -0
  5. package/esm2020/lib/components/form/input-date/input-date.module.mjs +54 -0
  6. package/esm2020/lib/components/form/input-date-time/helpers/formatting-moscow-timezone.mjs +15 -3
  7. package/esm2020/lib/components/form/input-date-time/input-date-time.component.mjs +67 -23
  8. package/esm2020/lib/components/form/input-date-time/input-date-time.enum.mjs +7 -7
  9. package/esm2020/lib/enums/overlay/index.mjs +78 -0
  10. package/esm2020/public-api.mjs +3 -1
  11. package/fesm2015/myrta-ui.mjs +834 -61
  12. package/fesm2015/myrta-ui.mjs.map +1 -1
  13. package/fesm2020/myrta-ui.mjs +827 -61
  14. package/fesm2020/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/helpers/formatting-moscow-timezone.d.ts +1 -0
  21. package/lib/components/form/input-date-time/input-date-time.component.d.ts +8 -7
  22. package/lib/components/form/input-date-time/input-date-time.enum.d.ts +2 -2
  23. package/lib/enums/overlay/index.d.ts +13 -0
  24. package/package.json +1 -1
  25. 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": "selectedDate"; "minDate": "minDate"; "maxDate": "maxDate"; }, { "dateSelected": "dateSelected"; "close": "close"; }, never, 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": "fields"; "format": "format"; "minDate": "minDate"; "maxDate": "maxDate"; "isSilentValidation": "isSilentValidation"; "isManualInput": "isManualInput"; "closeAfterSelect": "closeAfterSelect"; "required": "required"; "size": "size"; "customClasses": "customClasses"; "disabled": "disabled"; "readonly": "readonly"; "placeholder": "placeholder"; "popupPosition": "popupPosition"; "invalid": "invalid"; "invalidMessage": "invalidMessage"; "checkInvalid": "checkInvalid"; }, { "changed": "changed"; "modelChange": "modelChange"; "blurred": "blurred"; }, never, 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 declare type InputDateSizesTypes = 'small' | 'medium' | 'large';
7
+ export declare 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 "@angular/forms";
6
+ import * as i5 from "../../error-message/error-message.module";
7
+ import * as i6 from "../../label/label.module";
8
+ import * as i7 from "../../save-state/save-state.module";
9
+ import * as i8 from "ngx-mask";
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.FormsModule, typeof i5.ErrorMessageModule, typeof i6.LabelModule, typeof i7.SaveStateModule, typeof i8.NgxMaskModule], [typeof i1.InputDateComponent]>;
13
+ static ɵinj: i0.ɵɵInjectorDeclaration<InputDateModule>;
14
+ }
@@ -1,2 +1,3 @@
1
1
  import { TimezoneType } from '../enum/timezone';
2
2
  export declare const formattingToMoscowTimezone: (date: any, tz: TimezoneType) => string;
3
+ export declare const formattingFromMoscowTimezone: (date: any, tz: TimezoneType) => string;
@@ -1,9 +1,9 @@
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
- import { Field } from "../../../services";
6
+ import { Field } from '../../../services';
7
7
  import { InputDateTimeValueTypes, InputDateTimeValueWithId } from './models/input-date-time.model';
8
8
  import * as i0 from "@angular/core";
9
9
  export declare class InputDateTimeComponent implements ControlValueAccessor, OnChanges, AfterViewInit {
@@ -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;
@@ -26,8 +26,6 @@ export declare class InputDateTimeComponent implements ControlValueAccessor, OnC
26
26
  required: boolean;
27
27
  timepicker: boolean;
28
28
  range: boolean;
29
- minDate: string;
30
- maxDate: string;
31
29
  timezone: TimezoneType;
32
30
  inline: boolean;
33
31
  isManualInput: boolean;
@@ -36,16 +34,18 @@ export declare class InputDateTimeComponent implements ControlValueAccessor, OnC
36
34
  addMinTimeObj: ExtraTime;
37
35
  addMaxTimeObj: ExtraTime;
38
36
  disableValidate: boolean;
37
+ disableIncludes: boolean;
39
38
  container: string;
40
39
  invalid: boolean;
41
40
  invalidMessage: string | string[];
42
41
  checkInvalid: true | false | null;
42
+ minDate: string;
43
+ maxDate: string;
43
44
  dateInput: ElementRef;
44
45
  timeInput: ElementRef;
45
46
  changed: EventEmitter<InputDateTimeValueTypes>;
46
47
  modelChange: EventEmitter<InputDateTimeValueWithId>;
47
48
  blurred: EventEmitter<InputDateTimeValueWithId>;
48
- constructor();
49
49
  ngAfterViewInit(): void;
50
50
  ngOnChanges(changes: SimpleChanges): void;
51
51
  get getDateValue(): string;
@@ -53,6 +53,7 @@ export declare class InputDateTimeComponent implements ControlValueAccessor, OnC
53
53
  private get isValidModels();
54
54
  get isViewCleanIcon(): boolean;
55
55
  get checkValidClasses(): string;
56
+ private _getDateFromTimezone;
56
57
  private _checkExtraTime;
57
58
  clickToIconCalendar(): void;
58
59
  clickToIconClear(): void;
@@ -73,5 +74,5 @@ export declare class InputDateTimeComponent implements ControlValueAccessor, OnC
73
74
  updateValue(insideValue: InputDateTimeValueTypes): void;
74
75
  onBlur(event: Event): void;
75
76
  static ɵfac: i0.ɵɵFactoryDeclaration<InputDateTimeComponent, never>;
76
- static ɵcmp: i0.ɵɵComponentDeclaration<InputDateTimeComponent, "mrx-input-date-time", never, { "fields": "fields"; "size": "size"; "customClasses": "customClasses"; "dateLabel": "dateLabel"; "timeLabel": "timeLabel"; "datePlaceholder": "datePlaceholder"; "timePlaceholder": "timePlaceholder"; "disabled": "disabled"; "readonly": "readonly"; "required": "required"; "timepicker": "timepicker"; "range": "range"; "minDate": "minDate"; "maxDate": "maxDate"; "timezone": "timezone"; "inline": "inline"; "isManualInput": "isManualInput"; "addMinTime": "addMinTime"; "addMaxTime": "addMaxTime"; "addMinTimeObj": "addMinTimeObj"; "addMaxTimeObj": "addMaxTimeObj"; "disableValidate": "disableValidate"; "container": "container"; "invalid": "invalid"; "invalidMessage": "invalidMessage"; "checkInvalid": "checkInvalid"; }, { "changed": "changed"; "modelChange": "modelChange"; "blurred": "blurred"; }, never, never>;
77
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputDateTimeComponent, "mrx-input-date-time", never, { "fields": "fields"; "size": "size"; "customClasses": "customClasses"; "dateLabel": "dateLabel"; "timeLabel": "timeLabel"; "datePlaceholder": "datePlaceholder"; "timePlaceholder": "timePlaceholder"; "disabled": "disabled"; "readonly": "readonly"; "required": "required"; "timepicker": "timepicker"; "range": "range"; "timezone": "timezone"; "inline": "inline"; "isManualInput": "isManualInput"; "addMinTime": "addMinTime"; "addMaxTime": "addMaxTime"; "addMinTimeObj": "addMinTimeObj"; "addMaxTimeObj": "addMaxTimeObj"; "disableValidate": "disableValidate"; "disableIncludes": "disableIncludes"; "container": "container"; "invalid": "invalid"; "invalidMessage": "invalidMessage"; "checkInvalid": "checkInvalid"; "minDate": "minDate"; "maxDate": "maxDate"; }, { "changed": "changed"; "modelChange": "modelChange"; "blurred": "blurred"; }, never, never>;
77
78
  }
@@ -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 declare type InputDateSizesTypes = 'small' | 'medium' | 'large';
6
+ export declare type InputDateTimeSizesTypes = 'small' | 'medium' | 'large';
7
7
  /**
8
8
  * Пример использования <br/>
9
9
  * message="Не более {diff} дней" <br/>
@@ -0,0 +1,13 @@
1
+ import { ConnectedPosition } from '@angular/cdk/overlay';
2
+ export declare type PositionType = 'top' | 'bottom' | 'left' | 'right' | 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end';
3
+ export declare enum PositionEnum {
4
+ Top = "top",
5
+ Bottom = "bottom",
6
+ Left = "left",
7
+ Right = "right",
8
+ TopStart = "top-start",
9
+ TopEnd = "top-end",
10
+ BottomStart = "bottom-start",
11
+ BottomEnd = "bottom-end"
12
+ }
13
+ export declare const PositionStrategyEnum: Record<PositionType, ConnectedPosition[]>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myrta-ui",
3
- "version": "1.1.89",
3
+ "version": "1.1.90",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^13.3.0",
6
6
  "@angular/core": "^13.3.0",
package/public-api.d.ts CHANGED
@@ -103,6 +103,8 @@ export * from './lib/components/form/input-datepicker/input-datepicker.module';
103
103
  export * from './lib/components/form/input-datepicker/input-datepicker.component';
104
104
  export * from './lib/components/form/input-datepicker/models/input-datepicker.model';
105
105
  export * from './lib/components/form/input-datepicker/input-datepicker.enum';
106
+ export * from './lib/components/form/input-date/input-date.module';
107
+ export * from './lib/components/form/input-date/input-date.component';
106
108
  export * from './lib/components/form/input-date-time/input-date-time.module';
107
109
  export * from './lib/components/form/input-date-time/input-date-time.component';
108
110
  export * from './lib/components/form/input-date-time/models/input-date-time.model';