myrta-ui 1.1.96 → 1.1.98
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/esm2020/lib/components/form/input-date/components/date-calendar/date-calendar.component.mjs +10 -3
- package/esm2020/lib/components/form/input-date-time/input-date-time.component.mjs +8 -8
- package/fesm2015/myrta-ui.mjs +16 -9
- package/fesm2015/myrta-ui.mjs.map +1 -1
- package/fesm2020/myrta-ui.mjs +16 -9
- package/fesm2020/myrta-ui.mjs.map +1 -1
- package/lib/components/form/input-date-time/input-date-time.component.d.ts +3 -2
- package/package.json +1 -1
package/fesm2020/myrta-ui.mjs
CHANGED
|
@@ -9477,21 +9477,28 @@ class DateCalendarComponent {
|
|
|
9477
9477
|
if (this.calendarDaysCache?.month === this.currentMonth && this.calendarDaysCache?.year === this.currentYear) {
|
|
9478
9478
|
return this.calendarDaysCache.days;
|
|
9479
9479
|
}
|
|
9480
|
+
// Определяем количество дней в текущем, предыдущем и следующем месяцах
|
|
9480
9481
|
const daysInMonth = new Date(this.currentYear, this.currentMonth + 1, 0).getDate();
|
|
9481
9482
|
const prevMonthDays = new Date(this.currentYear, this.currentMonth, 0).getDate();
|
|
9482
9483
|
const days = [];
|
|
9483
|
-
|
|
9484
|
+
// Вычисляем, сколько дней взять из предыдущего месяца, чтобы неделя начиналась с понедельника
|
|
9485
|
+
const firstDayJS = new Date(this.currentYear, this.currentMonth, 1).getDay(); // 0 = воскресенье, 1 = понедельник, ...
|
|
9486
|
+
const prevDaysCount = (firstDayJS + 6) % 7; // 0..6, где 0 означает, что 1-е число уже понедельник
|
|
9484
9487
|
const prevMonth = this.currentMonth === 0 ? 11 : this.currentMonth - 1;
|
|
9485
9488
|
const prevYear = this.currentMonth === 0 ? this.currentYear - 1 : this.currentYear;
|
|
9486
9489
|
const nextMonth = this.currentMonth === 11 ? 0 : this.currentMonth + 1;
|
|
9487
9490
|
const nextYear = this.currentMonth === 11 ? this.currentYear + 1 : this.currentYear;
|
|
9491
|
+
// Предыдущие дни (если нужны)
|
|
9488
9492
|
for (let i = 0; i < prevDaysCount; i++) {
|
|
9489
9493
|
days.push({ day: prevMonthDays - prevDaysCount + 1 + i, month: prevMonth, year: prevYear });
|
|
9490
9494
|
}
|
|
9495
|
+
// Дни текущего месяца
|
|
9491
9496
|
for (let i = 1; i <= daysInMonth; i++) {
|
|
9492
9497
|
days.push({ day: i, month: this.currentMonth, year: this.currentYear });
|
|
9493
9498
|
}
|
|
9494
|
-
|
|
9499
|
+
// Дозаполняем до полного количества ячеек (6 недель по 7 дней = 42)
|
|
9500
|
+
const totalCells = 42;
|
|
9501
|
+
const remainingDays = totalCells - days.length;
|
|
9495
9502
|
for (let i = 1; i <= remainingDays; i++) {
|
|
9496
9503
|
days.push({ day: i, month: nextMonth, year: nextYear });
|
|
9497
9504
|
}
|
|
@@ -10260,6 +10267,7 @@ class InputDateTimeComponent {
|
|
|
10260
10267
|
this.checkInvalid = null;
|
|
10261
10268
|
this.minDate = '';
|
|
10262
10269
|
this.maxDate = '';
|
|
10270
|
+
this.calendarPosition = 'bottom-start';
|
|
10263
10271
|
this.changed = new EventEmitter();
|
|
10264
10272
|
this.modelChange = new EventEmitter();
|
|
10265
10273
|
this.blurred = new EventEmitter();
|
|
@@ -10288,9 +10296,9 @@ class InputDateTimeComponent {
|
|
|
10288
10296
|
minDate: this.minDate ? formattingFromMoscowTimezone(this.minDate, this.timezone) : '',
|
|
10289
10297
|
maxDate: this.maxDate ? formattingFromMoscowTimezone(this.maxDate, this.timezone) : '',
|
|
10290
10298
|
inline: this.inline,
|
|
10291
|
-
position({ $datepicker, $target, $pointer, done }) {
|
|
10299
|
+
position: ({ $datepicker, $target, $pointer, done }) => {
|
|
10292
10300
|
let popper = createPopper($target, $datepicker, {
|
|
10293
|
-
placement:
|
|
10301
|
+
placement: this.calendarPosition,
|
|
10294
10302
|
modifiers: [
|
|
10295
10303
|
{
|
|
10296
10304
|
name: 'flip',
|
|
@@ -10559,9 +10567,9 @@ class InputDateTimeComponent {
|
|
|
10559
10567
|
}
|
|
10560
10568
|
}
|
|
10561
10569
|
InputDateTimeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InputDateTimeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
10562
|
-
InputDateTimeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: InputDateTimeComponent, selector: "mrx-input-date-time", inputs: { 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" }, outputs: { changed: "changed", modelChange: "modelChange", blurred: "blurred" }, providers: [
|
|
10570
|
+
InputDateTimeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: InputDateTimeComponent, selector: "mrx-input-date-time", inputs: { 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", calendarPosition: "calendarPosition" }, outputs: { changed: "changed", modelChange: "modelChange", blurred: "blurred" }, providers: [
|
|
10563
10571
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => InputDateTimeComponent), multi: true }
|
|
10564
|
-
], viewQueries: [{ propertyName: "dateInput", first: true, predicate: ["dateInput"], descendants: true }
|
|
10572
|
+
], viewQueries: [{ propertyName: "dateInput", first: true, predicate: ["dateInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\r\n class=\"mrx-input-date\"\r\n [class.mrx-input-error]=\"invalid || innerInvalid\"\r\n [class.mrx-input-readonly]=\"readonly\"\r\n [class]=\"getClasses\"\r\n>\r\n <div class=\"\">\r\n <mrx-label *ngIf=\"timeLabel || dateLabel\">{{ dateLabel }}</mrx-label>\r\n <div class=\"mrx-input-date__wrapper\">\r\n <input\r\n #dateInput\r\n type=\"text\"\r\n autocomplete=\"nope\"\r\n class=\"mrx-input-date__input mrx-input-date__date\"\r\n [placeholder]=\"datePlaceholder\"\r\n [ngModel]=\"getDateValue\"\r\n [mask]=\"'00.00.0000 00:m0'\"\r\n [leadZeroDateTime]=\"true\"\r\n [validation]=\"false\"\r\n [disabled]=\"disabled\"\r\n [readOnly]=\"!isManualInput\"\r\n (input)=\"updateDateValue(dateInput)\"\r\n (click)=\"clickToInput(dateInput)\"\r\n (blur)=\"onBlur($event)\"\r\n />\r\n\r\n <div *ngIf=\"!disabled\" class=\"mrx-input-date__icons\">\r\n <span\r\n class=\"mrx-icon icon-close\"\r\n *ngIf=\"isViewCleanIcon\"\r\n (click)=\"clickToIconClear()\"\r\n [class.icon-font-16]=\"size === 'small'\"\r\n [class.icon-font-24]=\"size === 'medium' || size === 'large'\"\r\n ></span>\r\n <span\r\n class=\"mrx-icon icon-calendar\"\r\n (click)=\"clickToIconCalendar()\"\r\n [class.icon-font-16]=\"size === 'small'\"\r\n [class.icon-font-24]=\"size === 'medium' || size === 'large'\"\r\n ></span>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <mrx-error-message\r\n *ngIf=\"invalid; else innerInvalidTemplate\"\r\n [invalidMessage]=\"invalidMessage\"\r\n ></mrx-error-message>\r\n\r\n <ng-template #innerInvalidTemplate>\r\n <mrx-error-message\r\n *ngIf=\"innerInvalid\"\r\n [invalidMessage]=\"innerInvalidMessage\"\r\n ></mrx-error-message>\r\n </ng-template>\r\n\r\n <mrx-save-state [id]=\"uuid\" [fields]=\"fields\"></mrx-save-state>\r\n</div>\r\n", styles: [".mrx-input-date{width:100%;position:relative}.mrx-input-date .mrx-input-date__wrapper{position:relative}.mrx-input-date .mrx-input-date__input{border:var(--border-width-default) solid var(--neutral-bg-stroke-default);border-radius:var(--border-radius-1);color:var(--neutral-text-primary);width:100%;transition:outline-width .2s,border .2s}.mrx-input-date .mrx-input-date__input:focus,.mrx-input-date .mrx-input-date__input:active{outline:var(--neutral-bg-island-default) solid var(--border-width-focused)}.mrx-input-date .mrx-input-date__input:hover{border:var(--border-width-default) solid var(--neutral-bg-stroke-hover)}.mrx-input-date .mrx-input-date__input:disabled{background-color:var(--neutral-bg-disabled);color:var(--neutral-text-tertiary)}.mrx-input-date.mrx-input-date-lg .mrx-input-date__input{padding:calc(var(--spacing-3) + var(--spacing-half) - var(--border-width-default)) calc(var(--spacing-4) - var(--border-width-default));font-family:var(--body-md-font-family);font-size:var(--body-md-font-size);font-weight:var(--body-md-font-weight);line-height:var(--body-md-line-height)}.mrx-input-date.mrx-input-date-md .mrx-input-date__input{padding:calc(var(--spacing-2) + var(--spacing-half) - var(--border-width-default)) calc(var(--spacing-3) - var(--border-width-default));font-family:var(--body-md-font-family);font-size:var(--body-md-font-size);font-weight:var(--body-md-font-weight);line-height:var(--body-md-line-height)}.mrx-input-date.mrx-input-date-sm .mrx-input-date__input{padding:calc(var(--spacing-2) - var(--border-width-default)) calc(var(--spacing-2) - var(--border-width-default));font-family:var(--body-sm-font-family);font-size:var(--body-sm-font-size);font-weight:var(--body-sm-font-weight);line-height:var(--body-sm-line-height)}.mrx-input-date.mrx-input-date.mrx-input-error .mrx-input-date__input{border-color:var(--system-bg-controls-negative-default)}.mrx-input-date.mrx-input-date.mrx-input-checked-error .mrx-input-date__input{border-color:var(--system-bg-controls-negative-default);background-color:var(--system-bg-negative-secondary)}.mrx-input-date.mrx-input-date.mrx-input-checked-error .mrx-input-date__input:disabled{background-color:var(--neutral-bg-disabled, #EEF0F4);border-color:var(--neutral-bg-stroke-default)}.mrx-input-date.mrx-input-date.mrx-input-checked-success .mrx-input-date__input{background-color:var(--system-bg-positive-secondary);border-color:var(--system-bg-controls-positive-default)}.mrx-input-date.mrx-input-date.mrx-input-checked-success .mrx-input-date__input:disabled{background-color:var(--neutral-bg-disabled, #EEF0F4);border-color:var(--neutral-bg-stroke-default)}.mrx-input-date.mrx-input-date .mrx-input-date__icons{position:absolute;top:0;right:0;display:flex;align-items:center}.mrx-input-date.mrx-input-date .mrx-input-date__icons-item,.mrx-input-date.mrx-input-date .mrx-input-date__icons .mrx-icon{cursor:pointer}.mrx-input-date.mrx-input-date.mrx-input-date-lg .mrx-icon{margin-top:calc(var(--spacing-3) - var(--border-width-default));margin-right:var(--spacing-3)}.mrx-input-date.mrx-input-date.mrx-input-date-md .mrx-icon{margin-top:calc(var(--spacing-2) - var(--border-width-default));margin-right:var(--spacing-3)}.mrx-input-date.mrx-input-date.mrx-input-date-sm .mrx-icon{margin-top:calc(var(--spacing-2) - var(--border-width-default));margin-right:var(--spacing-2)}\n"], components: [{ type: LabelComponent, selector: "mrx-label", inputs: ["requiredHidden", "required", "boldLabel", "placeholder", "label", "customClasses", "triggerTextPosition", "isPublicInfo", "publicInfoTooltip", "disabled", "isSwitch", "switchLabel", "switchValue", "isCheckbox", "checkboxLabel", "checkboxValue", "counter", "linkText", "linkPrevent", "linkType", "linkMonochrome", "href", "triggerType", "tooltip", "tooltipInitialVisible", "isSaveToStorage"], outputs: ["changeCheckboxValue", "clickedLink"] }, { type: ErrorMessageComponent, selector: "mrx-error-message", inputs: ["invalid", "invalidMessage", "customClasses"] }, { type: SaveStateComponent, selector: "mrx-save-state", inputs: ["type", "fields", "id"] }], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$7.MaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "showTemplate", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "triggerOnMaskChange"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
10565
10573
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InputDateTimeComponent, decorators: [{
|
|
10566
10574
|
type: Component,
|
|
10567
10575
|
args: [{ selector: 'mrx-input-date-time', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
@@ -10621,12 +10629,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
|
|
|
10621
10629
|
type: Input
|
|
10622
10630
|
}], maxDate: [{
|
|
10623
10631
|
type: Input
|
|
10632
|
+
}], calendarPosition: [{
|
|
10633
|
+
type: Input
|
|
10624
10634
|
}], dateInput: [{
|
|
10625
10635
|
type: ViewChild,
|
|
10626
10636
|
args: ['dateInput']
|
|
10627
|
-
}], timeInput: [{
|
|
10628
|
-
type: ViewChild,
|
|
10629
|
-
args: ['timeInput']
|
|
10630
10637
|
}], changed: [{
|
|
10631
10638
|
type: Output
|
|
10632
10639
|
}], modelChange: [{
|