@mk-kit/ui 0.41.0 → 0.43.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.
- package/README.md +4 -4
- package/THIRD_PARTY_NOTICES.md +4 -2
- package/fesm2022/mk-kit-ui-block-editor.mjs +4 -2
- package/fesm2022/mk-kit-ui-block-editor.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-checkbox.mjs +4 -2
- package/fesm2022/mk-kit-ui-checkbox.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-core.mjs +218 -1
- package/fesm2022/mk-kit-ui-core.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-data.mjs +801 -16
- package/fesm2022/mk-kit-ui-data.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-datetime.mjs +90 -52
- package/fesm2022/mk-kit-ui-datetime.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-directives.mjs +395 -2
- package/fesm2022/mk-kit-ui-directives.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-dnd.mjs +183 -29
- package/fesm2022/mk-kit-ui-dnd.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-dynamic-form.mjs +149 -2
- package/fesm2022/mk-kit-ui-dynamic-form.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-feedback.mjs +1 -1
- package/fesm2022/mk-kit-ui-feedback.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-forms.mjs +331 -81
- package/fesm2022/mk-kit-ui-forms.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-icon-extended.mjs +425 -0
- package/fesm2022/mk-kit-ui-icon-extended.mjs.map +1 -0
- package/fesm2022/mk-kit-ui-icon.mjs +296 -459
- package/fesm2022/mk-kit-ui-icon.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-query-builder.mjs +1 -1
- package/fesm2022/mk-kit-ui-query-builder.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-rich-text.mjs +4 -2
- package/fesm2022/mk-kit-ui-rich-text.mjs.map +1 -1
- package/fesm2022/mk-kit-ui-table.mjs +36 -8
- package/fesm2022/mk-kit-ui-table.mjs.map +1 -1
- package/fesm2022/mk-kit-ui.mjs +1 -0
- package/fesm2022/mk-kit-ui.mjs.map +1 -1
- package/package.json +5 -1
- package/schematics/migrate-primeng/transform.js +4 -1
- package/schematics/ng-add/index.js +30 -2
- package/schematics/ng-add/schema.json +6 -0
- package/styles/mk-kit.css +604 -0
- package/types/mk-kit-ui-block-editor.d.ts +2 -0
- package/types/mk-kit-ui-checkbox.d.ts +2 -0
- package/types/mk-kit-ui-core.d.ts +119 -2
- package/types/mk-kit-ui-data.d.ts +359 -3
- package/types/mk-kit-ui-datetime.d.ts +41 -19
- package/types/mk-kit-ui-directives.d.ts +234 -3
- package/types/mk-kit-ui-dnd.d.ts +96 -14
- package/types/mk-kit-ui-dynamic-form.d.ts +44 -1
- package/types/mk-kit-ui-forms.d.ts +160 -20
- package/types/mk-kit-ui-icon-extended.d.ts +83 -0
- package/types/mk-kit-ui-icon.d.ts +100 -17
- package/types/mk-kit-ui-rich-text.d.ts +2 -0
- package/types/mk-kit-ui-table.d.ts +38 -21
- package/types/mk-kit-ui.d.ts +1 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, ElementRef, Injector, model, input, numberAttribute, booleanAttribute, output, signal, computed, effect, untracked, afterNextRender, forwardRef, ChangeDetectionStrategy, Component, viewChild, viewChildren } from '@angular/core';
|
|
3
3
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
4
|
-
import { MK_I18N, MkLiveAnnouncer, mkUniqueId, mkValidatorChange, MkAnchoredPanel } from '@mk-kit/ui/core';
|
|
4
|
+
import { MK_I18N, MkLiveAnnouncer, mkUniqueId, mkInjectFieldTouched, mkValidatorChange, MkAnchoredPanel } from '@mk-kit/ui/core';
|
|
5
5
|
import { MkFormField } from '@mk-kit/ui/forms';
|
|
6
6
|
import { DOCUMENT } from '@angular/common';
|
|
7
7
|
|
|
@@ -282,11 +282,13 @@ class MkCalendar {
|
|
|
282
282
|
value = model(null, /* @ts-ignore */
|
|
283
283
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
284
284
|
/** Earliest selectable date (inclusive, day granularity). */
|
|
285
|
-
min = input(null, /*
|
|
286
|
-
|
|
285
|
+
min = input(null, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}),
|
|
286
|
+
// Signal Forms binds the schema's `min()` limit here, `undefined` when unset.
|
|
287
|
+
transform: (v) => v ?? null });
|
|
287
288
|
/** Latest selectable date (inclusive, day granularity). */
|
|
288
|
-
max = input(null, /*
|
|
289
|
-
|
|
289
|
+
max = input(null, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}),
|
|
290
|
+
// Signal Forms binds the schema's `max()` limit here, `undefined` when unset.
|
|
291
|
+
transform: (v) => v ?? null });
|
|
290
292
|
/** First column of the week: 0 = Sunday … 6 = Saturday. */
|
|
291
293
|
firstDayOfWeek = input(0, { ...(ngDevMode ? { debugName: "firstDayOfWeek" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
292
294
|
/** Disable the whole calendar. */
|
|
@@ -340,7 +342,9 @@ class MkCalendar {
|
|
|
340
342
|
/** Disabled by the `disabled` input or by the bound form control. */
|
|
341
343
|
isControlDisabled = computed(() => this.disabled() || this.cvaDisabled(), /* @ts-ignore */
|
|
342
344
|
...(ngDevMode ? [{ debugName: "isControlDisabled" }] : /* istanbul ignore next */ []));
|
|
343
|
-
|
|
345
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
346
|
+
fieldTouched = mkInjectFieldTouched();
|
|
347
|
+
isInvalid = computed(() => this.invalid() && this.fieldTouched(), /* @ts-ignore */
|
|
344
348
|
...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
|
|
345
349
|
/** First day of the visible month. */
|
|
346
350
|
viewMonth = computed(() => startOfMonth(this.focusedDate()), /* @ts-ignore */
|
|
@@ -609,7 +613,7 @@ class MkCalendar {
|
|
|
609
613
|
useExisting: forwardRef(() => MkCalendar),
|
|
610
614
|
multi: true,
|
|
611
615
|
},
|
|
612
|
-
], ngImport: i0, template: "<div class=\"mk-calendar__header\">\n <button\n type=\"button\"\n class=\"mk-calendar__nav\"\n [attr.aria-label]=\"i18n.previousMonth\"\n (click)=\"prevMonth()\"\n >\n <svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" aria-hidden=\"true\">\n <path\n d=\"M15 5l-7 7 7 7\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n <span class=\"mk-calendar__label\" [id]=\"labelId\" aria-live=\"polite\">{{\n monthLabel()\n }}</span>\n\n <button\n type=\"button\"\n class=\"mk-calendar__nav\"\n [attr.aria-label]=\"i18n.nextMonth\"\n (click)=\"nextMonth()\"\n >\n <svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" aria-hidden=\"true\">\n <path\n d=\"M9 5l7 7-7 7\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n</div>\n\n<table\n class=\"mk-calendar__grid\"\n role=\"grid\"\n [attr.aria-labelledby]=\"labelId\"\n (keydown)=\"onGridKeydown($event)\"\n>\n <thead>\n <tr>\n @for (wd of weekdays(); track $index) {\n <th class=\"mk-calendar__weekday\" scope=\"col\">\n <abbr [title]=\"wd.full\">{{ wd.short }}</abbr>\n </th>\n }\n </tr>\n </thead>\n <tbody (mouseleave)=\"clearHover()\">\n @for (week of weeks(); track $index) {\n <tr>\n @for (day of week; track day.getTime()) {\n <td\n class=\"mk-calendar__cell\"\n role=\"gridcell\"\n [attr.aria-selected]=\"isAriaSelected(day) || null\"\n >\n <button\n type=\"button\"\n class=\"mk-calendar__day\"\n [class.mk-calendar__day--outside]=\"isOutside(day)\"\n [class.mk-calendar__day--today]=\"isToday(day)\"\n [class.mk-calendar__day--selected]=\"isSelected(day)\"\n [class.mk-calendar__day--range-start]=\"isRangeStart(day)\"\n [class.mk-calendar__day--range-end]=\"isRangeEnd(day)\"\n [class.mk-calendar__day--in-range]=\"isInRange(day)\"\n [class.mk-calendar__day--disabled]=\"isDisabled(day)\"\n [attr.tabindex]=\"isFocused(day) ? 0 : -1\"\n [attr.aria-label]=\"dayLabel(day)\"\n [attr.aria-current]=\"isToday(day) ? 'date' : null\"\n [attr.aria-disabled]=\"isDisabled(day) || null\"\n (click)=\"select(day)\"\n (mouseenter)=\"onHover(day)\"\n >\n <span class=\"mk-calendar__day-num\">{{ day.getDate() }}</span>\n </button>\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n", styles: ["@charset \"UTF-8\";:host{--_cell-size: 2.5rem;display:inline-block;width:fit-content;max-width:100%;padding:var(--mk-space-4);font-family:var(--mk-font-sans);color:var(--mk-text);background-color:var(--mk-surface);border:var(--mk-border-width) solid var(--mk-border);border-radius:var(--mk-radius-lg);box-shadow:var(--mk-shadow-xs)}:host(.mk-calendar--full){display:block;width:100%;min-width:min-content}:host(.mk-calendar--full) .mk-calendar__grid{width:100%}:host(.mk-calendar--full) .mk-calendar__weekday{width:auto;min-width:var(--_cell-size)}:host(.mk-calendar--full) .mk-calendar__day{width:100%;min-width:var(--_cell-size)}:host(.mk-calendar--sm){--_cell-size: 2.1rem;padding:var(--mk-space-3);font-size:var(--mk-font-size-sm)}:host(.mk-calendar--lg){--_cell-size: 2.9rem;font-size:var(--mk-font-size-lg)}.mk-calendar__header{display:flex;align-items:center;gap:var(--mk-space-1);margin-bottom:var(--mk-space-2)}.mk-calendar__label{flex:1 1 auto;text-align:center;font-weight:var(--mk-font-weight-semibold);font-size:var(--mk-font-size-md);white-space:nowrap}.mk-calendar__nav{display:inline-flex;align-items:center;justify-content:center;width:var(--mk-control-height-sm);height:var(--mk-control-height-sm);flex:none;color:var(--mk-text-muted);background:transparent;border:var(--mk-border-width) solid transparent;border-radius:var(--mk-radius-md);cursor:pointer;transition:background-color var(--mk-duration-fast) var(--mk-ease-standard),color var(--mk-duration-fast) var(--mk-ease-standard)}.mk-calendar__nav:hover{background-color:var(--mk-hover-overlay);color:var(--mk-text)}.mk-calendar__nav:active{background-color:var(--mk-active-overlay)}.mk-calendar__nav:focus-visible{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:var(--mk-focus-ring-offset)}.mk-calendar__nav svg{display:block}.mk-calendar__grid{border-collapse:separate;border-spacing:0;table-layout:fixed}.mk-calendar__weekday{width:var(--_cell-size);padding:0 0 var(--mk-space-2);font-size:var(--mk-font-size-xs);font-weight:var(--mk-font-weight-semibold);letter-spacing:var(--mk-letter-spacing-wide);text-transform:uppercase;color:var(--mk-text-subtle)}.mk-calendar__weekday abbr{text-decoration:none;cursor:default}.mk-calendar__cell{padding:1px;text-align:center}.mk-calendar__day{display:inline-flex;align-items:center;justify-content:center;position:relative;width:var(--_cell-size);height:var(--_cell-size);font-family:inherit;font-size:var(--mk-font-size-sm);color:var(--mk-text);background:transparent;border:var(--mk-border-width) solid transparent;border-radius:var(--mk-radius-md);cursor:pointer;transition:background-color var(--mk-duration-fast) var(--mk-ease-standard),color var(--mk-duration-fast) var(--mk-ease-standard)}.mk-calendar__day:hover:not(.mk-calendar__day--disabled){background-color:var(--mk-hover-overlay)}.mk-calendar__day:focus-visible{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:calc(var(--mk-focus-ring-offset) * -1)}.mk-calendar__day--outside{color:var(--mk-text-
|
|
616
|
+
], ngImport: i0, template: "<div class=\"mk-calendar__header\">\n <button\n type=\"button\"\n class=\"mk-calendar__nav\"\n [attr.aria-label]=\"i18n.previousMonth\"\n (click)=\"prevMonth()\"\n >\n <svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" aria-hidden=\"true\">\n <path\n d=\"M15 5l-7 7 7 7\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n <span class=\"mk-calendar__label\" [id]=\"labelId\" aria-live=\"polite\">{{\n monthLabel()\n }}</span>\n\n <button\n type=\"button\"\n class=\"mk-calendar__nav\"\n [attr.aria-label]=\"i18n.nextMonth\"\n (click)=\"nextMonth()\"\n >\n <svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" aria-hidden=\"true\">\n <path\n d=\"M9 5l7 7-7 7\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n</div>\n\n<table\n class=\"mk-calendar__grid\"\n role=\"grid\"\n [attr.aria-labelledby]=\"labelId\"\n (keydown)=\"onGridKeydown($event)\"\n>\n <thead>\n <tr>\n @for (wd of weekdays(); track $index) {\n <th class=\"mk-calendar__weekday\" scope=\"col\">\n <abbr [title]=\"wd.full\">{{ wd.short }}</abbr>\n </th>\n }\n </tr>\n </thead>\n <tbody (mouseleave)=\"clearHover()\">\n @for (week of weeks(); track $index) {\n <tr>\n @for (day of week; track day.getTime()) {\n <td\n class=\"mk-calendar__cell\"\n role=\"gridcell\"\n [attr.aria-selected]=\"isAriaSelected(day) || null\"\n >\n <button\n type=\"button\"\n class=\"mk-calendar__day\"\n [class.mk-calendar__day--outside]=\"isOutside(day)\"\n [class.mk-calendar__day--today]=\"isToday(day)\"\n [class.mk-calendar__day--selected]=\"isSelected(day)\"\n [class.mk-calendar__day--range-start]=\"isRangeStart(day)\"\n [class.mk-calendar__day--range-end]=\"isRangeEnd(day)\"\n [class.mk-calendar__day--in-range]=\"isInRange(day)\"\n [class.mk-calendar__day--disabled]=\"isDisabled(day)\"\n [attr.tabindex]=\"isFocused(day) ? 0 : -1\"\n [attr.aria-label]=\"dayLabel(day)\"\n [attr.aria-current]=\"isToday(day) ? 'date' : null\"\n [attr.aria-disabled]=\"isDisabled(day) || null\"\n (click)=\"select(day)\"\n (mouseenter)=\"onHover(day)\"\n >\n <span class=\"mk-calendar__day-num\">{{ day.getDate() }}</span>\n </button>\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n", styles: ["@charset \"UTF-8\";:host{--_cell-size: 2.5rem;display:inline-block;width:fit-content;max-width:100%;padding:var(--mk-space-4);font-family:var(--mk-font-sans);color:var(--mk-text);background-color:var(--mk-surface);border:var(--mk-border-width) solid var(--mk-border);border-radius:var(--mk-radius-lg);box-shadow:var(--mk-shadow-xs)}:host(.mk-calendar--full){display:block;width:100%;min-width:min-content}:host(.mk-calendar--full) .mk-calendar__grid{width:100%}:host(.mk-calendar--full) .mk-calendar__weekday{width:auto;min-width:var(--_cell-size)}:host(.mk-calendar--full) .mk-calendar__day{width:100%;min-width:var(--_cell-size)}:host(.mk-calendar--sm){--_cell-size: 2.1rem;padding:var(--mk-space-3);font-size:var(--mk-font-size-sm)}:host(.mk-calendar--lg){--_cell-size: 2.9rem;font-size:var(--mk-font-size-lg)}.mk-calendar__header{display:flex;align-items:center;gap:var(--mk-space-1);margin-bottom:var(--mk-space-2)}.mk-calendar__label{flex:1 1 auto;text-align:center;font-weight:var(--mk-font-weight-semibold);font-size:var(--mk-font-size-md);white-space:nowrap}.mk-calendar__nav{display:inline-flex;align-items:center;justify-content:center;width:var(--mk-control-height-sm);height:var(--mk-control-height-sm);flex:none;color:var(--mk-text-muted);background:transparent;border:var(--mk-border-width) solid transparent;border-radius:var(--mk-radius-md);cursor:pointer;transition:background-color var(--mk-duration-fast) var(--mk-ease-standard),color var(--mk-duration-fast) var(--mk-ease-standard)}.mk-calendar__nav:hover{background-color:var(--mk-hover-overlay);color:var(--mk-text)}.mk-calendar__nav:active{background-color:var(--mk-active-overlay)}.mk-calendar__nav:focus-visible{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:var(--mk-focus-ring-offset)}.mk-calendar__nav svg{display:block}.mk-calendar__grid{border-collapse:separate;border-spacing:0;table-layout:fixed}.mk-calendar__weekday{width:var(--_cell-size);padding:0 0 var(--mk-space-2);font-size:var(--mk-font-size-xs);font-weight:var(--mk-font-weight-semibold);letter-spacing:var(--mk-letter-spacing-wide);text-transform:uppercase;color:var(--mk-text-subtle)}.mk-calendar__weekday abbr{text-decoration:none;cursor:default}.mk-calendar__cell{padding:1px;text-align:center}.mk-calendar__day{display:inline-flex;align-items:center;justify-content:center;position:relative;width:var(--_cell-size);height:var(--_cell-size);font-family:inherit;font-size:var(--mk-font-size-sm);color:var(--mk-text);background:transparent;border:var(--mk-border-width) solid transparent;border-radius:var(--mk-radius-md);cursor:pointer;transition:background-color var(--mk-duration-fast) var(--mk-ease-standard),color var(--mk-duration-fast) var(--mk-ease-standard)}.mk-calendar__day:hover:not(.mk-calendar__day--disabled){background-color:var(--mk-hover-overlay)}.mk-calendar__day:focus-visible{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:calc(var(--mk-focus-ring-offset) * -1)}.mk-calendar__day--outside{color:var(--mk-text-subtle)}.mk-calendar__day--today:after{content:\"\";position:absolute;left:50%;bottom:4px;width:4px;height:4px;border-radius:var(--mk-radius-circle);background-color:var(--mk-primary);transform:translate(-50%)}.mk-calendar__day--in-range{background-color:var(--mk-primary-subtle);border-radius:0}.mk-calendar__day--selected,.mk-calendar__day--range-start,.mk-calendar__day--range-end{background-color:var(--mk-primary);color:var(--mk-primary-contrast);font-weight:var(--mk-font-weight-semibold)}.mk-calendar__day--selected:hover,.mk-calendar__day--range-start:hover,.mk-calendar__day--range-end:hover{background-color:var(--mk-primary-hover)}.mk-calendar__day--range-start{border-start-end-radius:0;border-end-end-radius:0}.mk-calendar__day--range-end{border-start-start-radius:0;border-end-start-radius:0}.mk-calendar__day--today.mk-calendar__day--selected:after,.mk-calendar__day--today.mk-calendar__day--range-start:after,.mk-calendar__day--today.mk-calendar__day--range-end:after{background-color:var(--mk-primary-contrast)}.mk-calendar__day--disabled{color:var(--mk-text-disabled);cursor:not-allowed;opacity:.6}.mk-calendar__day-num{line-height:1}@media(prefers-reduced-motion:reduce){.mk-calendar__nav,.mk-calendar__day{transition:none}}.mk-calendar--disabled{opacity:.55;pointer-events:none}:host(.mk-calendar--invalid){border-color:var(--mk-danger)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
613
617
|
}
|
|
614
618
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: MkCalendar, decorators: [{
|
|
615
619
|
type: Component,
|
|
@@ -635,7 +639,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
635
639
|
'[class.mk-calendar--range]': 'rangeMode()',
|
|
636
640
|
'[class.mk-calendar--invalid]': 'isInvalid()',
|
|
637
641
|
'[attr.aria-invalid]': 'isInvalid() || null',
|
|
638
|
-
}, template: "<div class=\"mk-calendar__header\">\n <button\n type=\"button\"\n class=\"mk-calendar__nav\"\n [attr.aria-label]=\"i18n.previousMonth\"\n (click)=\"prevMonth()\"\n >\n <svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" aria-hidden=\"true\">\n <path\n d=\"M15 5l-7 7 7 7\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n <span class=\"mk-calendar__label\" [id]=\"labelId\" aria-live=\"polite\">{{\n monthLabel()\n }}</span>\n\n <button\n type=\"button\"\n class=\"mk-calendar__nav\"\n [attr.aria-label]=\"i18n.nextMonth\"\n (click)=\"nextMonth()\"\n >\n <svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" aria-hidden=\"true\">\n <path\n d=\"M9 5l7 7-7 7\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n</div>\n\n<table\n class=\"mk-calendar__grid\"\n role=\"grid\"\n [attr.aria-labelledby]=\"labelId\"\n (keydown)=\"onGridKeydown($event)\"\n>\n <thead>\n <tr>\n @for (wd of weekdays(); track $index) {\n <th class=\"mk-calendar__weekday\" scope=\"col\">\n <abbr [title]=\"wd.full\">{{ wd.short }}</abbr>\n </th>\n }\n </tr>\n </thead>\n <tbody (mouseleave)=\"clearHover()\">\n @for (week of weeks(); track $index) {\n <tr>\n @for (day of week; track day.getTime()) {\n <td\n class=\"mk-calendar__cell\"\n role=\"gridcell\"\n [attr.aria-selected]=\"isAriaSelected(day) || null\"\n >\n <button\n type=\"button\"\n class=\"mk-calendar__day\"\n [class.mk-calendar__day--outside]=\"isOutside(day)\"\n [class.mk-calendar__day--today]=\"isToday(day)\"\n [class.mk-calendar__day--selected]=\"isSelected(day)\"\n [class.mk-calendar__day--range-start]=\"isRangeStart(day)\"\n [class.mk-calendar__day--range-end]=\"isRangeEnd(day)\"\n [class.mk-calendar__day--in-range]=\"isInRange(day)\"\n [class.mk-calendar__day--disabled]=\"isDisabled(day)\"\n [attr.tabindex]=\"isFocused(day) ? 0 : -1\"\n [attr.aria-label]=\"dayLabel(day)\"\n [attr.aria-current]=\"isToday(day) ? 'date' : null\"\n [attr.aria-disabled]=\"isDisabled(day) || null\"\n (click)=\"select(day)\"\n (mouseenter)=\"onHover(day)\"\n >\n <span class=\"mk-calendar__day-num\">{{ day.getDate() }}</span>\n </button>\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n", styles: ["@charset \"UTF-8\";:host{--_cell-size: 2.5rem;display:inline-block;width:fit-content;max-width:100%;padding:var(--mk-space-4);font-family:var(--mk-font-sans);color:var(--mk-text);background-color:var(--mk-surface);border:var(--mk-border-width) solid var(--mk-border);border-radius:var(--mk-radius-lg);box-shadow:var(--mk-shadow-xs)}:host(.mk-calendar--full){display:block;width:100%;min-width:min-content}:host(.mk-calendar--full) .mk-calendar__grid{width:100%}:host(.mk-calendar--full) .mk-calendar__weekday{width:auto;min-width:var(--_cell-size)}:host(.mk-calendar--full) .mk-calendar__day{width:100%;min-width:var(--_cell-size)}:host(.mk-calendar--sm){--_cell-size: 2.1rem;padding:var(--mk-space-3);font-size:var(--mk-font-size-sm)}:host(.mk-calendar--lg){--_cell-size: 2.9rem;font-size:var(--mk-font-size-lg)}.mk-calendar__header{display:flex;align-items:center;gap:var(--mk-space-1);margin-bottom:var(--mk-space-2)}.mk-calendar__label{flex:1 1 auto;text-align:center;font-weight:var(--mk-font-weight-semibold);font-size:var(--mk-font-size-md);white-space:nowrap}.mk-calendar__nav{display:inline-flex;align-items:center;justify-content:center;width:var(--mk-control-height-sm);height:var(--mk-control-height-sm);flex:none;color:var(--mk-text-muted);background:transparent;border:var(--mk-border-width) solid transparent;border-radius:var(--mk-radius-md);cursor:pointer;transition:background-color var(--mk-duration-fast) var(--mk-ease-standard),color var(--mk-duration-fast) var(--mk-ease-standard)}.mk-calendar__nav:hover{background-color:var(--mk-hover-overlay);color:var(--mk-text)}.mk-calendar__nav:active{background-color:var(--mk-active-overlay)}.mk-calendar__nav:focus-visible{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:var(--mk-focus-ring-offset)}.mk-calendar__nav svg{display:block}.mk-calendar__grid{border-collapse:separate;border-spacing:0;table-layout:fixed}.mk-calendar__weekday{width:var(--_cell-size);padding:0 0 var(--mk-space-2);font-size:var(--mk-font-size-xs);font-weight:var(--mk-font-weight-semibold);letter-spacing:var(--mk-letter-spacing-wide);text-transform:uppercase;color:var(--mk-text-subtle)}.mk-calendar__weekday abbr{text-decoration:none;cursor:default}.mk-calendar__cell{padding:1px;text-align:center}.mk-calendar__day{display:inline-flex;align-items:center;justify-content:center;position:relative;width:var(--_cell-size);height:var(--_cell-size);font-family:inherit;font-size:var(--mk-font-size-sm);color:var(--mk-text);background:transparent;border:var(--mk-border-width) solid transparent;border-radius:var(--mk-radius-md);cursor:pointer;transition:background-color var(--mk-duration-fast) var(--mk-ease-standard),color var(--mk-duration-fast) var(--mk-ease-standard)}.mk-calendar__day:hover:not(.mk-calendar__day--disabled){background-color:var(--mk-hover-overlay)}.mk-calendar__day:focus-visible{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:calc(var(--mk-focus-ring-offset) * -1)}.mk-calendar__day--outside{color:var(--mk-text-
|
|
642
|
+
}, template: "<div class=\"mk-calendar__header\">\n <button\n type=\"button\"\n class=\"mk-calendar__nav\"\n [attr.aria-label]=\"i18n.previousMonth\"\n (click)=\"prevMonth()\"\n >\n <svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" aria-hidden=\"true\">\n <path\n d=\"M15 5l-7 7 7 7\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n\n <span class=\"mk-calendar__label\" [id]=\"labelId\" aria-live=\"polite\">{{\n monthLabel()\n }}</span>\n\n <button\n type=\"button\"\n class=\"mk-calendar__nav\"\n [attr.aria-label]=\"i18n.nextMonth\"\n (click)=\"nextMonth()\"\n >\n <svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" aria-hidden=\"true\">\n <path\n d=\"M9 5l7 7-7 7\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </button>\n</div>\n\n<table\n class=\"mk-calendar__grid\"\n role=\"grid\"\n [attr.aria-labelledby]=\"labelId\"\n (keydown)=\"onGridKeydown($event)\"\n>\n <thead>\n <tr>\n @for (wd of weekdays(); track $index) {\n <th class=\"mk-calendar__weekday\" scope=\"col\">\n <abbr [title]=\"wd.full\">{{ wd.short }}</abbr>\n </th>\n }\n </tr>\n </thead>\n <tbody (mouseleave)=\"clearHover()\">\n @for (week of weeks(); track $index) {\n <tr>\n @for (day of week; track day.getTime()) {\n <td\n class=\"mk-calendar__cell\"\n role=\"gridcell\"\n [attr.aria-selected]=\"isAriaSelected(day) || null\"\n >\n <button\n type=\"button\"\n class=\"mk-calendar__day\"\n [class.mk-calendar__day--outside]=\"isOutside(day)\"\n [class.mk-calendar__day--today]=\"isToday(day)\"\n [class.mk-calendar__day--selected]=\"isSelected(day)\"\n [class.mk-calendar__day--range-start]=\"isRangeStart(day)\"\n [class.mk-calendar__day--range-end]=\"isRangeEnd(day)\"\n [class.mk-calendar__day--in-range]=\"isInRange(day)\"\n [class.mk-calendar__day--disabled]=\"isDisabled(day)\"\n [attr.tabindex]=\"isFocused(day) ? 0 : -1\"\n [attr.aria-label]=\"dayLabel(day)\"\n [attr.aria-current]=\"isToday(day) ? 'date' : null\"\n [attr.aria-disabled]=\"isDisabled(day) || null\"\n (click)=\"select(day)\"\n (mouseenter)=\"onHover(day)\"\n >\n <span class=\"mk-calendar__day-num\">{{ day.getDate() }}</span>\n </button>\n </td>\n }\n </tr>\n }\n </tbody>\n</table>\n", styles: ["@charset \"UTF-8\";:host{--_cell-size: 2.5rem;display:inline-block;width:fit-content;max-width:100%;padding:var(--mk-space-4);font-family:var(--mk-font-sans);color:var(--mk-text);background-color:var(--mk-surface);border:var(--mk-border-width) solid var(--mk-border);border-radius:var(--mk-radius-lg);box-shadow:var(--mk-shadow-xs)}:host(.mk-calendar--full){display:block;width:100%;min-width:min-content}:host(.mk-calendar--full) .mk-calendar__grid{width:100%}:host(.mk-calendar--full) .mk-calendar__weekday{width:auto;min-width:var(--_cell-size)}:host(.mk-calendar--full) .mk-calendar__day{width:100%;min-width:var(--_cell-size)}:host(.mk-calendar--sm){--_cell-size: 2.1rem;padding:var(--mk-space-3);font-size:var(--mk-font-size-sm)}:host(.mk-calendar--lg){--_cell-size: 2.9rem;font-size:var(--mk-font-size-lg)}.mk-calendar__header{display:flex;align-items:center;gap:var(--mk-space-1);margin-bottom:var(--mk-space-2)}.mk-calendar__label{flex:1 1 auto;text-align:center;font-weight:var(--mk-font-weight-semibold);font-size:var(--mk-font-size-md);white-space:nowrap}.mk-calendar__nav{display:inline-flex;align-items:center;justify-content:center;width:var(--mk-control-height-sm);height:var(--mk-control-height-sm);flex:none;color:var(--mk-text-muted);background:transparent;border:var(--mk-border-width) solid transparent;border-radius:var(--mk-radius-md);cursor:pointer;transition:background-color var(--mk-duration-fast) var(--mk-ease-standard),color var(--mk-duration-fast) var(--mk-ease-standard)}.mk-calendar__nav:hover{background-color:var(--mk-hover-overlay);color:var(--mk-text)}.mk-calendar__nav:active{background-color:var(--mk-active-overlay)}.mk-calendar__nav:focus-visible{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:var(--mk-focus-ring-offset)}.mk-calendar__nav svg{display:block}.mk-calendar__grid{border-collapse:separate;border-spacing:0;table-layout:fixed}.mk-calendar__weekday{width:var(--_cell-size);padding:0 0 var(--mk-space-2);font-size:var(--mk-font-size-xs);font-weight:var(--mk-font-weight-semibold);letter-spacing:var(--mk-letter-spacing-wide);text-transform:uppercase;color:var(--mk-text-subtle)}.mk-calendar__weekday abbr{text-decoration:none;cursor:default}.mk-calendar__cell{padding:1px;text-align:center}.mk-calendar__day{display:inline-flex;align-items:center;justify-content:center;position:relative;width:var(--_cell-size);height:var(--_cell-size);font-family:inherit;font-size:var(--mk-font-size-sm);color:var(--mk-text);background:transparent;border:var(--mk-border-width) solid transparent;border-radius:var(--mk-radius-md);cursor:pointer;transition:background-color var(--mk-duration-fast) var(--mk-ease-standard),color var(--mk-duration-fast) var(--mk-ease-standard)}.mk-calendar__day:hover:not(.mk-calendar__day--disabled){background-color:var(--mk-hover-overlay)}.mk-calendar__day:focus-visible{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:calc(var(--mk-focus-ring-offset) * -1)}.mk-calendar__day--outside{color:var(--mk-text-subtle)}.mk-calendar__day--today:after{content:\"\";position:absolute;left:50%;bottom:4px;width:4px;height:4px;border-radius:var(--mk-radius-circle);background-color:var(--mk-primary);transform:translate(-50%)}.mk-calendar__day--in-range{background-color:var(--mk-primary-subtle);border-radius:0}.mk-calendar__day--selected,.mk-calendar__day--range-start,.mk-calendar__day--range-end{background-color:var(--mk-primary);color:var(--mk-primary-contrast);font-weight:var(--mk-font-weight-semibold)}.mk-calendar__day--selected:hover,.mk-calendar__day--range-start:hover,.mk-calendar__day--range-end:hover{background-color:var(--mk-primary-hover)}.mk-calendar__day--range-start{border-start-end-radius:0;border-end-end-radius:0}.mk-calendar__day--range-end{border-start-start-radius:0;border-end-start-radius:0}.mk-calendar__day--today.mk-calendar__day--selected:after,.mk-calendar__day--today.mk-calendar__day--range-start:after,.mk-calendar__day--today.mk-calendar__day--range-end:after{background-color:var(--mk-primary-contrast)}.mk-calendar__day--disabled{color:var(--mk-text-disabled);cursor:not-allowed;opacity:.6}.mk-calendar__day-num{line-height:1}@media(prefers-reduced-motion:reduce){.mk-calendar__nav,.mk-calendar__day{transition:none}}.mk-calendar--disabled{opacity:.55;pointer-events:none}:host(.mk-calendar--invalid){border-color:var(--mk-danger)}\n"] }]
|
|
639
643
|
}], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], disabledDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDate", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], fullWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullWidth", required: false }] }], rangeMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangeMode", required: false }] }], rangeStart: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangeStart", required: false }] }], rangeEnd: [{ type: i0.Input, args: [{ isSignal: true, alias: "rangeEnd", required: false }] }], dateSelected: [{ type: i0.Output, args: ["dateSelected"] }], dateHovered: [{ type: i0.Output, args: ["dateHovered"] }] } });
|
|
640
644
|
|
|
641
645
|
/**
|
|
@@ -655,6 +659,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
655
659
|
class MkDatePicker {
|
|
656
660
|
i18n = inject(MK_I18N);
|
|
657
661
|
field = inject(MkFormField, { optional: true });
|
|
662
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
663
|
+
fieldTouched = mkInjectFieldTouched();
|
|
658
664
|
host = inject(ElementRef);
|
|
659
665
|
injector = inject(Injector);
|
|
660
666
|
inputRef = viewChild('textInput', /* @ts-ignore */
|
|
@@ -670,11 +676,13 @@ class MkDatePicker {
|
|
|
670
676
|
ariaLabel = input('', { ...(ngDevMode ? { debugName: "ariaLabel" } : /* istanbul ignore next */ {}), alias: 'aria-label' });
|
|
671
677
|
ariaLabelAttr = computed(() => (this.field ? null : this.ariaLabel() || null), /* @ts-ignore */
|
|
672
678
|
...(ngDevMode ? [{ debugName: "ariaLabelAttr" }] : /* istanbul ignore next */ []));
|
|
673
|
-
min = input(null, /*
|
|
674
|
-
|
|
679
|
+
min = input(null, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}),
|
|
680
|
+
// Signal Forms binds the schema's `min()` limit here, `undefined` when unset.
|
|
681
|
+
transform: (v) => v ?? null });
|
|
675
682
|
/** Latest selectable date (inclusive). */
|
|
676
|
-
max = input(null, /*
|
|
677
|
-
|
|
683
|
+
max = input(null, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}),
|
|
684
|
+
// Signal Forms binds the schema's `max()` limit here, `undefined` when unset.
|
|
685
|
+
transform: (v) => v ?? null });
|
|
678
686
|
/** Predicate marking individual days as disabled (threaded to the calendar). */
|
|
679
687
|
disabledDate = input(null, /* @ts-ignore */
|
|
680
688
|
...(ngDevMode ? [{ debugName: "disabledDate" }] : /* istanbul ignore next */ []));
|
|
@@ -690,6 +698,8 @@ class MkDatePicker {
|
|
|
690
698
|
clearable = input(false, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
691
699
|
/** Force invalid styling + `aria-invalid`. */
|
|
692
700
|
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
701
|
+
/** Mark required (adds `aria-required`). Set by Signal Forms' `[formField]` from the schema. */
|
|
702
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
693
703
|
/** First column of the calendar week (0 = Sunday). */
|
|
694
704
|
firstDayOfWeek = input(0, { ...(ngDevMode ? { debugName: "firstDayOfWeek" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
695
705
|
/** Control size. Ignored when nested in an `mk-form-field`. */
|
|
@@ -710,9 +720,9 @@ class MkDatePicker {
|
|
|
710
720
|
...(ngDevMode ? [{ debugName: "effectiveSize" }] : /* istanbul ignore next */ []));
|
|
711
721
|
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), /* @ts-ignore */
|
|
712
722
|
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
713
|
-
isInvalid = computed(() => this.invalid() || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
723
|
+
isInvalid = computed(() => (this.invalid() && this.fieldTouched()) || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
714
724
|
...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
|
|
715
|
-
isRequired = computed(() => this.field?.isRequired() ?? false, /* @ts-ignore */
|
|
725
|
+
isRequired = computed(() => this.required() || (this.field?.isRequired() ?? false), /* @ts-ignore */
|
|
716
726
|
...(ngDevMode ? [{ debugName: "isRequired" }] : /* istanbul ignore next */ []));
|
|
717
727
|
describedBy = computed(() => this.field?.describedBy() ?? null, /* @ts-ignore */
|
|
718
728
|
...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
@@ -890,7 +900,7 @@ class MkDatePicker {
|
|
|
890
900
|
this.validatorChange.register(fn);
|
|
891
901
|
}
|
|
892
902
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: MkDatePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
893
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: MkDatePicker, isStandalone: true, selector: "mk-date-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabledDate: { classPropertyName: "disabledDate", publicName: "disabledDate", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, displayFormat: { classPropertyName: "displayFormat", publicName: "displayFormat", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "class.mk-date-picker--sm": "effectiveSize() === 'sm'", "class.mk-date-picker--md": "effectiveSize() === 'md'", "class.mk-date-picker--lg": "effectiveSize() === 'lg'", "class.mk-date-picker--open": "open()", "class.mk-date-picker--invalid": "isInvalid()", "class.mk-date-picker--disabled": "isDisabled()" }, classAttribute: "mk-date-picker" }, providers: [
|
|
903
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: MkDatePicker, isStandalone: true, selector: "mk-date-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabledDate: { classPropertyName: "disabledDate", publicName: "disabledDate", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, displayFormat: { classPropertyName: "displayFormat", publicName: "displayFormat", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "class.mk-date-picker--sm": "effectiveSize() === 'sm'", "class.mk-date-picker--md": "effectiveSize() === 'md'", "class.mk-date-picker--lg": "effectiveSize() === 'lg'", "class.mk-date-picker--open": "open()", "class.mk-date-picker--invalid": "isInvalid()", "class.mk-date-picker--disabled": "isDisabled()" }, classAttribute: "mk-date-picker" }, providers: [
|
|
894
904
|
{
|
|
895
905
|
provide: NG_VALUE_ACCESSOR,
|
|
896
906
|
useExisting: forwardRef(() => MkDatePicker),
|
|
@@ -926,7 +936,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
926
936
|
multi: true,
|
|
927
937
|
},
|
|
928
938
|
], template: "<div #field class=\"mk-date-picker__field\">\n <input\n #textInput\n type=\"text\"\n class=\"mk-date-picker__input\"\n [id]=\"inputId\"\n [value]=\"inputText()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"isDisabled()\"\n autocomplete=\"off\"\n role=\"combobox\"\n [attr.aria-label]=\"ariaLabelAttr()\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-required]=\"isRequired() || null\"\n [attr.aria-describedby]=\"describedBy()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n />\n\n @if (showClear()) {\n <button\n type=\"button\"\n class=\"mk-date-picker__clear\"\n [attr.aria-label]=\"i18n.clear\"\n (click)=\"clear()\"\n >\n <span class=\"mk-date-picker__clear-icon\" aria-hidden=\"true\"></span>\n </button>\n }\n\n <button\n type=\"button\"\n class=\"mk-date-picker__toggle\"\n [attr.aria-label]=\"i18n.openCalendar\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"panelId\"\n [disabled]=\"isDisabled()\"\n (click)=\"toggle()\"\n >\n <svg\n class=\"mk-date-picker__icon\"\n viewBox=\"0 0 24 24\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n aria-hidden=\"true\"\n >\n <rect x=\"3\" y=\"4\" width=\"18\" height=\"17\" rx=\"2\" />\n <path d=\"M3 9h18M8 2v4M16 2v4\" />\n </svg>\n </button>\n</div>\n\n@if (open()) {\n <div\n #panel\n class=\"mk-date-picker__panel\"\n mkAnchoredPanel\n [mkAnchoredPanelFor]=\"field\"\n (dismiss)=\"close()\"\n [id]=\"panelId\"\n role=\"dialog\"\n [attr.aria-label]=\"i18n.chooseDate\"\n (keydown.escape)=\"onPanelEscape($event)\"\n (focusout)=\"onPanelFocusout($event)\"\n >\n <mk-calendar\n [value]=\"value()\"\n (valueChange)=\"onCalendarPick($event)\"\n [min]=\"min()\"\n [max]=\"max()\"\n [firstDayOfWeek]=\"firstDayOfWeek()\"\n [size]=\"effectiveSize()\"\n [disabledDate]=\"disabledDate()\"\n />\n </div>\n}\n", styles: ["@charset \"UTF-8\";:host{display:block;position:relative;width:100%;font-family:var(--mk-font-sans)}.mk-date-picker__field{display:flex;align-items:center;width:100%;height:var(--mk-control-height-md);background-color:var(--mk-surface);border:var(--mk-border-width) solid var(--mk-border);border-radius:var(--mk-radius-md);transition:border-color var(--mk-duration-fast) var(--mk-ease-standard),box-shadow var(--mk-duration-fast) var(--mk-ease-standard)}:host(.mk-date-picker--sm) .mk-date-picker__field{height:var(--mk-control-height-sm);border-radius:var(--mk-radius-sm)}:host(.mk-date-picker--lg) .mk-date-picker__field{height:var(--mk-control-height-lg)}.mk-date-picker__field:hover{border-color:var(--mk-border-strong)}.mk-date-picker__field:focus-within{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:var(--mk-focus-ring-offset);border-color:var(--mk-primary)}:host(.mk-date-picker--invalid) .mk-date-picker__field{border-color:var(--mk-danger)}:host(.mk-date-picker--invalid) .mk-date-picker__field:focus-within{outline-color:var(--mk-danger)}:host(.mk-date-picker--disabled) .mk-date-picker__field{background-color:var(--mk-surface-2);border-color:var(--mk-border-subtle);cursor:not-allowed;opacity:.7}.mk-date-picker__input{flex:1 1 auto;min-width:0;height:100%;padding:0 var(--mk-space-3);font-family:inherit;font-size:var(--mk-font-size-md);color:var(--mk-text);background:transparent;border:0;outline:none}:host(.mk-date-picker--sm) .mk-date-picker__input{padding:0 var(--mk-space-2);font-size:var(--mk-font-size-sm)}:host(.mk-date-picker--lg) .mk-date-picker__input{padding:0 var(--mk-space-4);font-size:var(--mk-font-size-lg)}.mk-date-picker__input::placeholder{color:var(--mk-text-subtle);opacity:1}.mk-date-picker__input:disabled{color:var(--mk-text-disabled);cursor:not-allowed}.mk-date-picker__toggle,.mk-date-picker__clear{display:inline-flex;align-items:center;justify-content:center;flex:none;height:100%;padding:0 var(--mk-space-2);color:var(--mk-text-muted);background:transparent;border:0;cursor:pointer;transition:color var(--mk-duration-fast) var(--mk-ease-standard)}.mk-date-picker__toggle:hover:not(:disabled),.mk-date-picker__clear:hover{color:var(--mk-text)}.mk-date-picker__toggle:focus-visible,.mk-date-picker__clear:focus-visible{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:calc(var(--mk-focus-ring-offset) * -1);border-radius:var(--mk-radius-sm)}.mk-date-picker__toggle:disabled{cursor:not-allowed}.mk-date-picker__clear-icon{position:relative;width:.85rem;height:.85rem}.mk-date-picker__clear-icon:before,.mk-date-picker__clear-icon:after{content:\"\";position:absolute;top:50%;left:0;width:100%;height:2px;background-color:currentColor}.mk-date-picker__clear-icon:before{transform:rotate(45deg)}.mk-date-picker__clear-icon:after{transform:rotate(-45deg)}.mk-date-picker__panel{box-shadow:var(--mk-shadow-lg);border-radius:var(--mk-radius-lg)}@media(prefers-reduced-motion:reduce){.mk-date-picker__field,.mk-date-picker__toggle,.mk-date-picker__clear{transition:none}}@media(pointer:coarse){.mk-date-picker__input{font-size:max(var(--mk-font-size-md),16px)}:host(.mk-date-picker--sm) .mk-date-picker__input{font-size:max(var(--mk-font-size-sm),16px)}}\n"] }]
|
|
929
|
-
}], ctorParameters: () => [], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ['textInput', { isSignal: true }] }], panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabledDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDate", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], displayFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayFormat", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
939
|
+
}], ctorParameters: () => [], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ['textInput', { isSignal: true }] }], panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabledDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDate", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], displayFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayFormat", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
930
940
|
|
|
931
941
|
function pad2$1(n) {
|
|
932
942
|
return n < 10 ? `0${n}` : `${n}`;
|
|
@@ -961,6 +971,8 @@ function pad2$1(n) {
|
|
|
961
971
|
class MkTimePicker {
|
|
962
972
|
i18n = inject(MK_I18N);
|
|
963
973
|
field = inject(MkFormField, { optional: true });
|
|
974
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
975
|
+
fieldTouched = mkInjectFieldTouched();
|
|
964
976
|
host = inject(ElementRef);
|
|
965
977
|
injector = inject(Injector);
|
|
966
978
|
inputRef = viewChild('textInput', /* @ts-ignore */
|
|
@@ -983,11 +995,13 @@ class MkTimePicker {
|
|
|
983
995
|
valueFormat = input('string', /* @ts-ignore */
|
|
984
996
|
...(ngDevMode ? [{ debugName: "valueFormat" }] : /* istanbul ignore next */ []));
|
|
985
997
|
/** Earliest selectable time `HH:mm` (inclusive). */
|
|
986
|
-
min = input(null, /*
|
|
987
|
-
|
|
998
|
+
min = input(null, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}),
|
|
999
|
+
// Signal Forms binds the schema's `min()` limit here, `undefined` when unset.
|
|
1000
|
+
transform: (v) => v ?? null });
|
|
988
1001
|
/** Latest selectable time `HH:mm` (inclusive). */
|
|
989
|
-
max = input(null, /*
|
|
990
|
-
|
|
1002
|
+
max = input(null, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}),
|
|
1003
|
+
// Signal Forms binds the schema's `max()` limit here, `undefined` when unset.
|
|
1004
|
+
transform: (v) => v ?? null });
|
|
991
1005
|
/** Interval between generated options, in minutes. */
|
|
992
1006
|
step = input(30, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
993
1007
|
/** Display 12-hour time with AM/PM (the model stays 24h). */
|
|
@@ -1001,6 +1015,8 @@ class MkTimePicker {
|
|
|
1001
1015
|
clearable = input(false, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1002
1016
|
/** Force invalid styling + `aria-invalid`. */
|
|
1003
1017
|
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1018
|
+
/** Mark required (adds `aria-required`). Set by Signal Forms' `[formField]` from the schema. */
|
|
1019
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1004
1020
|
/** Control size. Ignored when nested in an `mk-form-field`. */
|
|
1005
1021
|
size = input('md', /* @ts-ignore */
|
|
1006
1022
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
@@ -1027,9 +1043,9 @@ class MkTimePicker {
|
|
|
1027
1043
|
...(ngDevMode ? [{ debugName: "effectiveSize" }] : /* istanbul ignore next */ []));
|
|
1028
1044
|
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), /* @ts-ignore */
|
|
1029
1045
|
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
1030
|
-
isInvalid = computed(() => this.invalid() || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
1046
|
+
isInvalid = computed(() => (this.invalid() && this.fieldTouched()) || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
1031
1047
|
...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
|
|
1032
|
-
isRequired = computed(() => this.field?.isRequired() ?? false, /* @ts-ignore */
|
|
1048
|
+
isRequired = computed(() => this.required() || (this.field?.isRequired() ?? false), /* @ts-ignore */
|
|
1033
1049
|
...(ngDevMode ? [{ debugName: "isRequired" }] : /* istanbul ignore next */ []));
|
|
1034
1050
|
describedBy = computed(() => this.field?.describedBy() ?? null, /* @ts-ignore */
|
|
1035
1051
|
...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
@@ -1332,7 +1348,7 @@ class MkTimePicker {
|
|
|
1332
1348
|
this.validatorChange.register(fn);
|
|
1333
1349
|
}
|
|
1334
1350
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: MkTimePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1335
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: MkTimePicker, isStandalone: true, selector: "mk-time-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, hour12: { classPropertyName: "hour12", publicName: "hour12", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "class.mk-time-picker--sm": "effectiveSize() === 'sm'", "class.mk-time-picker--md": "effectiveSize() === 'md'", "class.mk-time-picker--lg": "effectiveSize() === 'lg'", "class.mk-time-picker--open": "open()", "class.mk-time-picker--invalid": "isInvalid()", "class.mk-time-picker--disabled": "isDisabled()" }, classAttribute: "mk-time-picker" }, providers: [
|
|
1351
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: MkTimePicker, isStandalone: true, selector: "mk-time-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, hour12: { classPropertyName: "hour12", publicName: "hour12", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "class.mk-time-picker--sm": "effectiveSize() === 'sm'", "class.mk-time-picker--md": "effectiveSize() === 'md'", "class.mk-time-picker--lg": "effectiveSize() === 'lg'", "class.mk-time-picker--open": "open()", "class.mk-time-picker--invalid": "isInvalid()", "class.mk-time-picker--disabled": "isDisabled()" }, classAttribute: "mk-time-picker" }, providers: [
|
|
1336
1352
|
{
|
|
1337
1353
|
provide: NG_VALUE_ACCESSOR,
|
|
1338
1354
|
useExisting: forwardRef(() => MkTimePicker),
|
|
@@ -1368,7 +1384,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
1368
1384
|
multi: true,
|
|
1369
1385
|
},
|
|
1370
1386
|
], template: "<div #field class=\"mk-time-picker__field\">\n <input\n #textInput\n type=\"text\"\n class=\"mk-time-picker__input\"\n [id]=\"inputId\"\n [value]=\"inputText()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"isDisabled()\"\n autocomplete=\"off\"\n role=\"combobox\"\n [attr.aria-label]=\"ariaLabelAttr()\"\n aria-haspopup=\"listbox\"\n aria-autocomplete=\"none\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listId\"\n [attr.aria-activedescendant]=\"\n open() && activeIndex() >= 0 ? optionId(activeIndex()) : null\n \"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-required]=\"isRequired() || null\"\n [attr.aria-describedby]=\"describedBy()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n />\n\n @if (showClear()) {\n <button\n type=\"button\"\n class=\"mk-time-picker__clear\"\n [attr.aria-label]=\"i18n.clear\"\n (click)=\"clear()\"\n >\n <span class=\"mk-time-picker__clear-icon\" aria-hidden=\"true\"></span>\n </button>\n }\n\n <button\n type=\"button\"\n class=\"mk-time-picker__toggle\"\n [attr.aria-label]=\"i18n.openTimeList\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"listId\"\n [disabled]=\"isDisabled()\"\n (click)=\"toggle()\"\n >\n <svg\n class=\"mk-time-picker__icon\"\n viewBox=\"0 0 24 24\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n aria-hidden=\"true\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"9\" />\n <path d=\"M12 7v5l3 2\" />\n </svg>\n </button>\n</div>\n\n@if (open()) {\n <ul\n #list\n class=\"mk-time-picker__list\"\n mkAnchoredPanel\n [mkAnchoredPanelFor]=\"field\"\n [matchWidth]=\"true\"\n (dismiss)=\"close()\"\n [id]=\"listId\"\n role=\"listbox\"\n >\n @for (opt of options(); track opt.value; let i = $index) {\n <li\n class=\"mk-time-picker__option\"\n [id]=\"optionId(i)\"\n role=\"option\"\n [attr.aria-selected]=\"i === selectedIndex()\"\n [class.mk-time-picker__option--active]=\"i === activeIndex()\"\n [class.mk-time-picker__option--selected]=\"i === selectedIndex()\"\n (mousedown)=\"$event.preventDefault()\"\n (mousemove)=\"activeIndex.set(i)\"\n (click)=\"selectOption(i)\"\n >\n {{ opt.label }}\n </li>\n } @empty {\n <li class=\"mk-time-picker__empty\" role=\"presentation\">\n {{ i18n.noOptions }}\n </li>\n }\n </ul>\n}\n", styles: ["@charset \"UTF-8\";:host{display:block;position:relative;width:100%;font-family:var(--mk-font-sans)}.mk-time-picker__field{display:flex;align-items:center;width:100%;height:var(--mk-control-height-md);background-color:var(--mk-surface);border:var(--mk-border-width) solid var(--mk-border);border-radius:var(--mk-radius-md);transition:border-color var(--mk-duration-fast) var(--mk-ease-standard),box-shadow var(--mk-duration-fast) var(--mk-ease-standard)}:host(.mk-time-picker--sm) .mk-time-picker__field{height:var(--mk-control-height-sm);border-radius:var(--mk-radius-sm)}:host(.mk-time-picker--lg) .mk-time-picker__field{height:var(--mk-control-height-lg)}.mk-time-picker__field:hover{border-color:var(--mk-border-strong)}.mk-time-picker__field:focus-within{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:var(--mk-focus-ring-offset);border-color:var(--mk-primary)}:host(.mk-time-picker--invalid) .mk-time-picker__field{border-color:var(--mk-danger)}:host(.mk-time-picker--invalid) .mk-time-picker__field:focus-within{outline-color:var(--mk-danger)}:host(.mk-time-picker--disabled) .mk-time-picker__field{background-color:var(--mk-surface-2);border-color:var(--mk-border-subtle);cursor:not-allowed;opacity:.7}.mk-time-picker__input{flex:1 1 auto;min-width:0;height:100%;padding:0 var(--mk-space-3);font-family:inherit;font-size:var(--mk-font-size-md);color:var(--mk-text);background:transparent;border:0;outline:none}:host(.mk-time-picker--sm) .mk-time-picker__input{padding:0 var(--mk-space-2);font-size:var(--mk-font-size-sm)}:host(.mk-time-picker--lg) .mk-time-picker__input{padding:0 var(--mk-space-4);font-size:var(--mk-font-size-lg)}.mk-time-picker__input::placeholder{color:var(--mk-text-subtle);opacity:1}.mk-time-picker__input:disabled{color:var(--mk-text-disabled);cursor:not-allowed}.mk-time-picker__toggle,.mk-time-picker__clear{display:inline-flex;align-items:center;justify-content:center;flex:none;height:100%;padding:0 var(--mk-space-2);color:var(--mk-text-muted);background:transparent;border:0;cursor:pointer;transition:color var(--mk-duration-fast) var(--mk-ease-standard)}.mk-time-picker__toggle:hover:not(:disabled),.mk-time-picker__clear:hover{color:var(--mk-text)}.mk-time-picker__toggle:focus-visible,.mk-time-picker__clear:focus-visible{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:calc(var(--mk-focus-ring-offset) * -1);border-radius:var(--mk-radius-sm)}.mk-time-picker__toggle:disabled{cursor:not-allowed}.mk-time-picker__clear-icon{position:relative;width:.85rem;height:.85rem}.mk-time-picker__clear-icon:before,.mk-time-picker__clear-icon:after{content:\"\";position:absolute;top:50%;left:0;width:100%;height:2px;background-color:currentColor}.mk-time-picker__clear-icon:before{transform:rotate(45deg)}.mk-time-picker__clear-icon:after{transform:rotate(-45deg)}.mk-time-picker__list{padding:var(--mk-space-1);list-style:none;max-height:15rem;overflow-y:auto;background-color:var(--mk-surface);border:var(--mk-border-width) solid var(--mk-border);border-radius:var(--mk-radius-md);box-shadow:var(--mk-shadow-lg)}.mk-time-picker__option{padding:var(--mk-space-2) var(--mk-space-3);font-size:var(--mk-font-size-md);color:var(--mk-text);border-radius:var(--mk-radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none}.mk-time-picker__option--active{background-color:var(--mk-selected-bg)}.mk-time-picker__option--selected{color:var(--mk-selected-text);font-weight:var(--mk-font-weight-medium)}.mk-time-picker__empty{padding:var(--mk-space-2) var(--mk-space-3);color:var(--mk-text-subtle);font-size:var(--mk-font-size-sm)}@media(prefers-reduced-motion:reduce){.mk-time-picker__field,.mk-time-picker__toggle,.mk-time-picker__clear{transition:none}}@media(pointer:coarse){.mk-time-picker__input{font-size:max(var(--mk-font-size-md),16px)}:host(.mk-time-picker--sm) .mk-time-picker__input{font-size:max(var(--mk-font-size-sm),16px)}}\n"] }]
|
|
1371
|
-
}], ctorParameters: () => [], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ['textInput', { isSignal: true }] }], listRef: [{ type: i0.ViewChild, args: ['list', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], hour12: [{ type: i0.Input, args: [{ isSignal: true, alias: "hour12", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
1387
|
+
}], ctorParameters: () => [], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ['textInput', { isSignal: true }] }], listRef: [{ type: i0.ViewChild, args: ['list', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], valueFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormat", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], hour12: [{ type: i0.Input, args: [{ isSignal: true, alias: "hour12", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
1372
1388
|
|
|
1373
1389
|
function pad2(n) {
|
|
1374
1390
|
return n < 10 ? `0${n}` : `${n}`;
|
|
@@ -1435,6 +1451,8 @@ function parseTime(text) {
|
|
|
1435
1451
|
class MkDateTimePicker {
|
|
1436
1452
|
i18n = inject(MK_I18N);
|
|
1437
1453
|
field = inject(MkFormField, { optional: true });
|
|
1454
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
1455
|
+
fieldTouched = mkInjectFieldTouched();
|
|
1438
1456
|
host = inject(ElementRef);
|
|
1439
1457
|
injector = inject(Injector);
|
|
1440
1458
|
inputRef = viewChild('textInput', /* @ts-ignore */
|
|
@@ -1448,11 +1466,13 @@ class MkDateTimePicker {
|
|
|
1448
1466
|
value = model(null, /* @ts-ignore */
|
|
1449
1467
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1450
1468
|
/** Earliest selectable instant (inclusive, minute precision). */
|
|
1451
|
-
min = input(null, /*
|
|
1452
|
-
|
|
1469
|
+
min = input(null, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}),
|
|
1470
|
+
// Signal Forms binds the schema's `min()` limit here, `undefined` when unset.
|
|
1471
|
+
transform: (v) => v ?? null });
|
|
1453
1472
|
/** Latest selectable instant (inclusive, minute precision). */
|
|
1454
|
-
max = input(null, /*
|
|
1455
|
-
|
|
1473
|
+
max = input(null, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}),
|
|
1474
|
+
// Signal Forms binds the schema's `max()` limit here, `undefined` when unset.
|
|
1475
|
+
transform: (v) => v ?? null });
|
|
1456
1476
|
/** Predicate marking individual days as disabled (threaded to the calendar). */
|
|
1457
1477
|
disabledDate = input(null, /* @ts-ignore */
|
|
1458
1478
|
...(ngDevMode ? [{ debugName: "disabledDate" }] : /* istanbul ignore next */ []));
|
|
@@ -1475,6 +1495,8 @@ class MkDateTimePicker {
|
|
|
1475
1495
|
clearable = input(false, { ...(ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1476
1496
|
/** Force invalid styling + `aria-invalid`. */
|
|
1477
1497
|
invalid = input(false, { ...(ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1498
|
+
/** Mark required (adds `aria-required`). Set by Signal Forms' `[formField]` from the schema. */
|
|
1499
|
+
required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
1478
1500
|
/** First column of the calendar week (0 = Sunday). */
|
|
1479
1501
|
firstDayOfWeek = input(0, { ...(ngDevMode ? { debugName: "firstDayOfWeek" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
1480
1502
|
/** Control size. Ignored when nested in an `mk-form-field`. */
|
|
@@ -1502,9 +1524,9 @@ class MkDateTimePicker {
|
|
|
1502
1524
|
...(ngDevMode ? [{ debugName: "effectiveSize" }] : /* istanbul ignore next */ []));
|
|
1503
1525
|
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), /* @ts-ignore */
|
|
1504
1526
|
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
1505
|
-
isInvalid = computed(() => this.invalid() || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
1527
|
+
isInvalid = computed(() => (this.invalid() && this.fieldTouched()) || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
1506
1528
|
...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
|
|
1507
|
-
isRequired = computed(() => this.field?.isRequired() ?? false, /* @ts-ignore */
|
|
1529
|
+
isRequired = computed(() => this.required() || (this.field?.isRequired() ?? false), /* @ts-ignore */
|
|
1508
1530
|
...(ngDevMode ? [{ debugName: "isRequired" }] : /* istanbul ignore next */ []));
|
|
1509
1531
|
describedBy = computed(() => this.field?.describedBy() ?? null, /* @ts-ignore */
|
|
1510
1532
|
...(ngDevMode ? [{ debugName: "describedBy" }] : /* istanbul ignore next */ []));
|
|
@@ -1863,7 +1885,7 @@ class MkDateTimePicker {
|
|
|
1863
1885
|
this.validatorChange.register(fn);
|
|
1864
1886
|
}
|
|
1865
1887
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.7", ngImport: i0, type: MkDateTimePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1866
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: MkDateTimePicker, isStandalone: true, selector: "mk-datetime-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabledDate: { classPropertyName: "disabledDate", publicName: "disabledDate", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, displayFormat: { classPropertyName: "displayFormat", publicName: "displayFormat", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, hour12: { classPropertyName: "hour12", publicName: "hour12", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "class.mk-datetime-picker--sm": "effectiveSize() === 'sm'", "class.mk-datetime-picker--md": "effectiveSize() === 'md'", "class.mk-datetime-picker--lg": "effectiveSize() === 'lg'", "class.mk-datetime-picker--open": "open()", "class.mk-datetime-picker--invalid": "isInvalid()", "class.mk-datetime-picker--disabled": "isDisabled()" }, classAttribute: "mk-datetime-picker" }, providers: [
|
|
1888
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.7", type: MkDateTimePicker, isStandalone: true, selector: "mk-datetime-picker", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, disabledDate: { classPropertyName: "disabledDate", publicName: "disabledDate", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, displayFormat: { classPropertyName: "displayFormat", publicName: "displayFormat", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, hour12: { classPropertyName: "hour12", publicName: "hour12", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, firstDayOfWeek: { classPropertyName: "firstDayOfWeek", publicName: "firstDayOfWeek", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { listeners: { "focusout": "onFocusOut($event)" }, properties: { "class.mk-datetime-picker--sm": "effectiveSize() === 'sm'", "class.mk-datetime-picker--md": "effectiveSize() === 'md'", "class.mk-datetime-picker--lg": "effectiveSize() === 'lg'", "class.mk-datetime-picker--open": "open()", "class.mk-datetime-picker--invalid": "isInvalid()", "class.mk-datetime-picker--disabled": "isDisabled()" }, classAttribute: "mk-datetime-picker" }, providers: [
|
|
1867
1889
|
{
|
|
1868
1890
|
provide: NG_VALUE_ACCESSOR,
|
|
1869
1891
|
useExisting: forwardRef(() => MkDateTimePicker),
|
|
@@ -1899,7 +1921,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
1899
1921
|
multi: true,
|
|
1900
1922
|
},
|
|
1901
1923
|
], template: "<div #field class=\"mk-datetime-picker__field\">\n <input\n #textInput\n type=\"text\"\n class=\"mk-datetime-picker__input\"\n [id]=\"inputId\"\n [value]=\"inputText()\"\n [placeholder]=\"placeholder()\"\n [disabled]=\"isDisabled()\"\n autocomplete=\"off\"\n role=\"combobox\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"panelId\"\n [attr.aria-invalid]=\"isInvalid() || null\"\n [attr.aria-required]=\"isRequired() || null\"\n [attr.aria-describedby]=\"describedBy()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n />\n\n @if (showClear()) {\n <button\n type=\"button\"\n class=\"mk-datetime-picker__clear\"\n [attr.aria-label]=\"i18n.clear\"\n (click)=\"clear()\"\n >\n <span class=\"mk-datetime-picker__clear-icon\" aria-hidden=\"true\"></span>\n </button>\n }\n\n <button\n type=\"button\"\n class=\"mk-datetime-picker__toggle\"\n [attr.aria-label]=\"i18n.openDateTimePicker\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"open()\"\n [attr.aria-controls]=\"panelId\"\n [disabled]=\"isDisabled()\"\n (click)=\"toggle()\"\n >\n <svg\n class=\"mk-datetime-picker__icon\"\n viewBox=\"0 0 24 24\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n aria-hidden=\"true\"\n >\n <path d=\"M3 9h18M8 2v4M16 2v4\" />\n <path d=\"M21 12V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h6\" />\n <circle cx=\"17.5\" cy=\"17.5\" r=\"4.5\" />\n <path d=\"M17.5 15.5v2l1.5 1\" />\n </svg>\n </button>\n</div>\n\n@if (open()) {\n <div\n #panel\n class=\"mk-datetime-picker__panel\"\n mkAnchoredPanel\n [mkAnchoredPanelFor]=\"field\"\n (dismiss)=\"close()\"\n [id]=\"panelId\"\n role=\"dialog\"\n [attr.aria-label]=\"i18n.chooseDateTime\"\n (keydown.escape)=\"onPanelEscape($event)\"\n (focusout)=\"onPanelFocusout($event)\"\n >\n <mk-calendar\n [value]=\"calendarValue()\"\n (valueChange)=\"onCalendarPick($event)\"\n [min]=\"calendarMin()\"\n [max]=\"calendarMax()\"\n [firstDayOfWeek]=\"firstDayOfWeek()\"\n [size]=\"effectiveSize()\"\n [disabledDate]=\"disabledDate()\"\n />\n\n <ul\n #times\n class=\"mk-datetime-picker__times\"\n [id]=\"listId\"\n role=\"listbox\"\n tabindex=\"0\"\n [attr.aria-label]=\"i18n.chooseTime\"\n [attr.aria-activedescendant]=\"\n activeIndex() >= 0 && options()[activeIndex()] ? options()[activeIndex()].id : null\n \"\n (keydown)=\"onListKeydown($event)\"\n >\n @for (opt of options(); track opt.minutes; let i = $index) {\n <li\n class=\"mk-datetime-picker__option\"\n [id]=\"opt.id\"\n role=\"option\"\n [attr.aria-selected]=\"i === selectedIndex()\"\n [class.mk-datetime-picker__option--active]=\"i === activeIndex()\"\n [class.mk-datetime-picker__option--selected]=\"i === selectedIndex()\"\n (mousedown)=\"$event.preventDefault()\"\n (mousemove)=\"activeIndex.set(i)\"\n (click)=\"selectTime(i)\"\n >\n {{ opt.label }}\n </li>\n } @empty {\n <li class=\"mk-datetime-picker__empty\" role=\"presentation\">\n {{ i18n.noOptions }}\n </li>\n }\n </ul>\n </div>\n}\n", styles: ["@charset \"UTF-8\";:host{display:block;position:relative;width:100%;font-family:var(--mk-font-sans)}.mk-datetime-picker__field{display:flex;align-items:center;width:100%;height:var(--mk-control-height-md);background-color:var(--mk-surface);border:var(--mk-border-width) solid var(--mk-border);border-radius:var(--mk-radius-md);transition:border-color var(--mk-duration-fast) var(--mk-ease-standard),box-shadow var(--mk-duration-fast) var(--mk-ease-standard)}:host(.mk-datetime-picker--sm) .mk-datetime-picker__field{height:var(--mk-control-height-sm);border-radius:var(--mk-radius-sm)}:host(.mk-datetime-picker--lg) .mk-datetime-picker__field{height:var(--mk-control-height-lg)}.mk-datetime-picker__field:hover{border-color:var(--mk-border-strong)}.mk-datetime-picker__field:focus-within{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:var(--mk-focus-ring-offset);border-color:var(--mk-primary)}:host(.mk-datetime-picker--invalid) .mk-datetime-picker__field{border-color:var(--mk-danger)}:host(.mk-datetime-picker--invalid) .mk-datetime-picker__field:focus-within{outline-color:var(--mk-danger)}:host(.mk-datetime-picker--disabled) .mk-datetime-picker__field{background-color:var(--mk-surface-2);border-color:var(--mk-border-subtle);cursor:not-allowed;opacity:.7}.mk-datetime-picker__input{flex:1 1 auto;min-width:0;height:100%;padding:0 var(--mk-space-3);font-family:inherit;font-size:var(--mk-font-size-md);color:var(--mk-text);background:transparent;border:0;outline:none}:host(.mk-datetime-picker--sm) .mk-datetime-picker__input{padding:0 var(--mk-space-2);font-size:var(--mk-font-size-sm)}:host(.mk-datetime-picker--lg) .mk-datetime-picker__input{padding:0 var(--mk-space-4);font-size:var(--mk-font-size-lg)}.mk-datetime-picker__input::placeholder{color:var(--mk-text-subtle);opacity:1}.mk-datetime-picker__input:disabled{color:var(--mk-text-disabled);cursor:not-allowed}.mk-datetime-picker__toggle,.mk-datetime-picker__clear{display:inline-flex;align-items:center;justify-content:center;flex:none;height:100%;padding:0 var(--mk-space-2);color:var(--mk-text-muted);background:transparent;border:0;cursor:pointer;transition:color var(--mk-duration-fast) var(--mk-ease-standard)}.mk-datetime-picker__toggle:hover:not(:disabled),.mk-datetime-picker__clear:hover{color:var(--mk-text)}.mk-datetime-picker__toggle:focus-visible,.mk-datetime-picker__clear:focus-visible{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:calc(var(--mk-focus-ring-offset) * -1);border-radius:var(--mk-radius-sm)}.mk-datetime-picker__toggle:disabled{cursor:not-allowed}.mk-datetime-picker__clear-icon{position:relative;width:.85rem;height:.85rem}.mk-datetime-picker__clear-icon:before,.mk-datetime-picker__clear-icon:after{content:\"\";position:absolute;top:50%;left:0;width:100%;height:2px;background-color:currentColor}.mk-datetime-picker__clear-icon:before{transform:rotate(45deg)}.mk-datetime-picker__clear-icon:after{transform:rotate(-45deg)}.mk-datetime-picker__panel{display:flex;align-items:stretch;background-color:var(--mk-surface);border:var(--mk-border-width) solid var(--mk-border);border-radius:var(--mk-radius-lg);box-shadow:var(--mk-shadow-lg);overflow:hidden}.mk-datetime-picker__times{flex:none;width:8rem;max-height:21rem;margin:0;padding:var(--mk-space-1);overflow-y:auto;list-style:none;border-inline-start:var(--mk-border-width) solid var(--mk-border-subtle);outline:none}.mk-datetime-picker__times:focus-visible{outline:var(--mk-focus-ring-width) solid var(--mk-focus-ring);outline-offset:calc(var(--mk-focus-ring-offset) * -1)}.mk-datetime-picker__option{padding:var(--mk-space-2) var(--mk-space-3);font-size:var(--mk-font-size-md);color:var(--mk-text);border-radius:var(--mk-radius-sm);cursor:pointer;-webkit-user-select:none;user-select:none;font-variant-numeric:tabular-nums}.mk-datetime-picker__option--active{background-color:var(--mk-selected-bg)}.mk-datetime-picker__option--selected{color:var(--mk-selected-text);font-weight:var(--mk-font-weight-medium)}.mk-datetime-picker__empty{padding:var(--mk-space-2) var(--mk-space-3);color:var(--mk-text-subtle);font-size:var(--mk-font-size-sm)}@media(max-width:480px){.mk-datetime-picker__panel{flex-direction:column}.mk-datetime-picker__times{width:auto;max-height:10rem;border-inline-start:0;border-top:var(--mk-border-width) solid var(--mk-border-subtle)}}@media(prefers-reduced-motion:reduce){.mk-datetime-picker__field,.mk-datetime-picker__toggle,.mk-datetime-picker__clear{transition:none}}@media(pointer:coarse){.mk-datetime-picker__input{font-size:max(var(--mk-font-size-md),16px)}:host(.mk-datetime-picker--sm) .mk-datetime-picker__input{font-size:max(var(--mk-font-size-sm),16px)}}@media(pointer:coarse){.mk-datetime-picker__option{position:relative}.mk-datetime-picker__option:before{content:\"\";position:absolute;inset:min(0px,(100% - 44px) / 2)}}\n"] }]
|
|
1902
|
-
}], ctorParameters: () => [], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ['textInput', { isSignal: true }] }], panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], timesRef: [{ type: i0.ViewChild, args: ['times', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabledDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDate", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], displayFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayFormat", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], hour12: [{ type: i0.Input, args: [{ isSignal: true, alias: "hour12", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
1924
|
+
}], ctorParameters: () => [], propDecorators: { inputRef: [{ type: i0.ViewChild, args: ['textInput', { isSignal: true }] }], panelRef: [{ type: i0.ViewChild, args: ['panel', { isSignal: true }] }], timesRef: [{ type: i0.ViewChild, args: ['times', { isSignal: true }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], disabledDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabledDate", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], displayFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "displayFormat", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], hour12: [{ type: i0.Input, args: [{ isSignal: true, alias: "hour12", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], clearable: [{ type: i0.Input, args: [{ isSignal: true, alias: "clearable", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], firstDayOfWeek: [{ type: i0.Input, args: [{ isSignal: true, alias: "firstDayOfWeek", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
1903
1925
|
|
|
1904
1926
|
/**
|
|
1905
1927
|
* DateRangePicker — select a start + end date from a single calendar popover.
|
|
@@ -1915,6 +1937,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
1915
1937
|
class MkDateRangePicker {
|
|
1916
1938
|
i18n = inject(MK_I18N);
|
|
1917
1939
|
field = inject(MkFormField, { optional: true });
|
|
1940
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
1941
|
+
fieldTouched = mkInjectFieldTouched();
|
|
1918
1942
|
host = inject(ElementRef);
|
|
1919
1943
|
injector = inject(Injector);
|
|
1920
1944
|
triggerRef = viewChild('trigger', /* @ts-ignore */
|
|
@@ -1926,11 +1950,13 @@ class MkDateRangePicker {
|
|
|
1926
1950
|
value = model({ start: null, end: null }, /* @ts-ignore */
|
|
1927
1951
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1928
1952
|
/** Earliest selectable date (inclusive). */
|
|
1929
|
-
min = input(null, /*
|
|
1930
|
-
|
|
1953
|
+
min = input(null, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}),
|
|
1954
|
+
// Signal Forms binds the schema's `min()` limit here, `undefined` when unset.
|
|
1955
|
+
transform: (v) => v ?? null });
|
|
1931
1956
|
/** Latest selectable date (inclusive). */
|
|
1932
|
-
max = input(null, /*
|
|
1933
|
-
|
|
1957
|
+
max = input(null, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}),
|
|
1958
|
+
// Signal Forms binds the schema's `max()` limit here, `undefined` when unset.
|
|
1959
|
+
transform: (v) => v ?? null });
|
|
1934
1960
|
/** Predicate marking individual days as disabled. */
|
|
1935
1961
|
disabledDate = input(null, /* @ts-ignore */
|
|
1936
1962
|
...(ngDevMode ? [{ debugName: "disabledDate" }] : /* istanbul ignore next */ []));
|
|
@@ -1969,7 +1995,7 @@ class MkDateRangePicker {
|
|
|
1969
1995
|
...(ngDevMode ? [{ debugName: "effectiveSize" }] : /* istanbul ignore next */ []));
|
|
1970
1996
|
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), /* @ts-ignore */
|
|
1971
1997
|
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
1972
|
-
isInvalid = computed(() => this.invalid() || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
1998
|
+
isInvalid = computed(() => (this.invalid() && this.fieldTouched()) || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
1973
1999
|
...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
|
|
1974
2000
|
isRequired = computed(() => this.field?.isRequired() ?? false, /* @ts-ignore */
|
|
1975
2001
|
...(ngDevMode ? [{ debugName: "isRequired" }] : /* istanbul ignore next */ []));
|
|
@@ -2193,6 +2219,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
2193
2219
|
class MkMonthPicker {
|
|
2194
2220
|
i18n = inject(MK_I18N);
|
|
2195
2221
|
field = inject(MkFormField, { optional: true });
|
|
2222
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
2223
|
+
fieldTouched = mkInjectFieldTouched();
|
|
2196
2224
|
host = inject(ElementRef);
|
|
2197
2225
|
injector = inject(Injector);
|
|
2198
2226
|
triggerRef = viewChild('trigger', /* @ts-ignore */
|
|
@@ -2208,11 +2236,13 @@ class MkMonthPicker {
|
|
|
2208
2236
|
mode = input('month', /* @ts-ignore */
|
|
2209
2237
|
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
2210
2238
|
/** Earliest selectable date. */
|
|
2211
|
-
min = input(null, /*
|
|
2212
|
-
|
|
2239
|
+
min = input(null, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}),
|
|
2240
|
+
// Signal Forms binds the schema's `min()` limit here, `undefined` when unset.
|
|
2241
|
+
transform: (v) => v ?? null });
|
|
2213
2242
|
/** Latest selectable date. */
|
|
2214
|
-
max = input(null, /*
|
|
2215
|
-
|
|
2243
|
+
max = input(null, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}),
|
|
2244
|
+
// Signal Forms binds the schema's `max()` limit here, `undefined` when unset.
|
|
2245
|
+
transform: (v) => v ?? null });
|
|
2216
2246
|
/** Placeholder shown when empty. */
|
|
2217
2247
|
placeholder = input('', /* @ts-ignore */
|
|
2218
2248
|
...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
@@ -2245,7 +2275,7 @@ class MkMonthPicker {
|
|
|
2245
2275
|
...(ngDevMode ? [{ debugName: "effectiveSize" }] : /* istanbul ignore next */ []));
|
|
2246
2276
|
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), /* @ts-ignore */
|
|
2247
2277
|
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
2248
|
-
isInvalid = computed(() => this.invalid() || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
2278
|
+
isInvalid = computed(() => (this.invalid() && this.fieldTouched()) || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
2249
2279
|
...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
|
|
2250
2280
|
isRequired = computed(() => this.field?.isRequired() ?? false, /* @ts-ignore */
|
|
2251
2281
|
...(ngDevMode ? [{ debugName: "isRequired" }] : /* istanbul ignore next */ []));
|
|
@@ -2503,6 +2533,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.7", ngImpor
|
|
|
2503
2533
|
class MkWeekPicker {
|
|
2504
2534
|
i18n = inject(MK_I18N);
|
|
2505
2535
|
field = inject(MkFormField, { optional: true });
|
|
2536
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
2537
|
+
fieldTouched = mkInjectFieldTouched();
|
|
2506
2538
|
host = inject(ElementRef);
|
|
2507
2539
|
injector = inject(Injector);
|
|
2508
2540
|
triggerRef = viewChild('trigger', /* @ts-ignore */
|
|
@@ -2513,11 +2545,13 @@ class MkWeekPicker {
|
|
|
2513
2545
|
value = model(null, /* @ts-ignore */
|
|
2514
2546
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2515
2547
|
/** Earliest selectable date (inclusive). */
|
|
2516
|
-
min = input(null, /*
|
|
2517
|
-
|
|
2548
|
+
min = input(null, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}),
|
|
2549
|
+
// Signal Forms binds the schema's `min()` limit here, `undefined` when unset.
|
|
2550
|
+
transform: (v) => v ?? null });
|
|
2518
2551
|
/** Latest selectable date (inclusive). */
|
|
2519
|
-
max = input(null, /*
|
|
2520
|
-
|
|
2552
|
+
max = input(null, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}),
|
|
2553
|
+
// Signal Forms binds the schema's `max()` limit here, `undefined` when unset.
|
|
2554
|
+
transform: (v) => v ?? null });
|
|
2521
2555
|
/** First column of the calendar week (0 = Sunday). Also anchors the week. */
|
|
2522
2556
|
firstDayOfWeek = input(0, { ...(ngDevMode ? { debugName: "firstDayOfWeek" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
2523
2557
|
/** Placeholder shown when empty. */
|
|
@@ -2552,7 +2586,7 @@ class MkWeekPicker {
|
|
|
2552
2586
|
...(ngDevMode ? [{ debugName: "effectiveSize" }] : /* istanbul ignore next */ []));
|
|
2553
2587
|
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), /* @ts-ignore */
|
|
2554
2588
|
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
2555
|
-
isInvalid = computed(() => this.invalid() || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
2589
|
+
isInvalid = computed(() => (this.invalid() && this.fieldTouched()) || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
2556
2590
|
...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
|
|
2557
2591
|
isRequired = computed(() => this.field?.isRequired() ?? false, /* @ts-ignore */
|
|
2558
2592
|
...(ngDevMode ? [{ debugName: "isRequired" }] : /* istanbul ignore next */ []));
|
|
@@ -3591,15 +3625,19 @@ function daysInMonth(m, year) {
|
|
|
3591
3625
|
*/
|
|
3592
3626
|
class MkMiniDate {
|
|
3593
3627
|
field = inject(MkFormField, { optional: true });
|
|
3628
|
+
/** Signal Forms: gates `invalid` until the bound field is touched or dirty. */
|
|
3629
|
+
fieldTouched = mkInjectFieldTouched();
|
|
3594
3630
|
i18n = inject(MK_I18N);
|
|
3595
3631
|
segEls = viewChildren('seg', /* @ts-ignore */
|
|
3596
3632
|
...(ngDevMode ? [{ debugName: "segEls" }] : /* istanbul ignore next */ []));
|
|
3597
3633
|
/** Minimum selectable date (inclusive). */
|
|
3598
|
-
min = input(null, /*
|
|
3599
|
-
|
|
3634
|
+
min = input(null, { ...(ngDevMode ? { debugName: "min" } : /* istanbul ignore next */ {}),
|
|
3635
|
+
// Signal Forms binds the schema's `min()` limit here, `undefined` when unset.
|
|
3636
|
+
transform: (v) => v ?? null });
|
|
3600
3637
|
/** Maximum selectable date (inclusive). */
|
|
3601
|
-
max = input(null, /*
|
|
3602
|
-
|
|
3638
|
+
max = input(null, { ...(ngDevMode ? { debugName: "max" } : /* istanbul ignore next */ {}),
|
|
3639
|
+
// Signal Forms binds the schema's `max()` limit here, `undefined` when unset.
|
|
3640
|
+
transform: (v) => v ?? null });
|
|
3603
3641
|
/** Two-way value — a real `Date`, or `null` while incomplete. */
|
|
3604
3642
|
value = model(null, /* @ts-ignore */
|
|
3605
3643
|
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
@@ -3636,7 +3674,7 @@ class MkMiniDate {
|
|
|
3636
3674
|
...(ngDevMode ? [{ debugName: "effectiveSize" }] : /* istanbul ignore next */ []));
|
|
3637
3675
|
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), /* @ts-ignore */
|
|
3638
3676
|
...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
3639
|
-
isInvalid = computed(() => this.invalid() || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
3677
|
+
isInvalid = computed(() => (this.invalid() && this.fieldTouched()) || (this.field?.hasError() ?? false), /* @ts-ignore */
|
|
3640
3678
|
...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
|
|
3641
3679
|
isRequired = computed(() => this.field?.isRequired() ?? false, /* @ts-ignore */
|
|
3642
3680
|
...(ngDevMode ? [{ debugName: "isRequired" }] : /* istanbul ignore next */ []));
|