@tectra-ng/ui 0.4.4 → 0.4.5
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/amount/README.md +19 -1
- package/analog-clock/README.md +1 -1
- package/autocomplete/README.md +1 -1
- package/avatar/README.md +24 -4
- package/cascade-select/README.md +1 -1
- package/chips-input/README.md +10 -5
- package/color-picker/README.md +5 -0
- package/countdown/README.md +7 -1
- package/country/README.md +14 -1
- package/country-select/README.md +2 -1
- package/export/README.md +27 -2
- package/export-font/README.md +1 -1
- package/fesm2022/tectra-ng-ui-amount.mjs +96 -14
- package/fesm2022/tectra-ng-ui-amount.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-analog-clock.mjs +6 -19
- package/fesm2022/tectra-ng-ui-analog-clock.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-autocomplete.mjs +5 -4
- package/fesm2022/tectra-ng-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-avatar.mjs +59 -17
- package/fesm2022/tectra-ng-ui-avatar.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-button.mjs +2 -2
- package/fesm2022/tectra-ng-ui-button.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-card.mjs +2 -2
- package/fesm2022/tectra-ng-ui-card.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-cascade-select.mjs +7 -4
- package/fesm2022/tectra-ng-ui-cascade-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-chips-input.mjs +114 -15
- package/fesm2022/tectra-ng-ui-chips-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-color-picker.mjs +93 -6
- package/fesm2022/tectra-ng-ui-color-picker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-countdown.mjs +39 -10
- package/fesm2022/tectra-ng-ui-countdown.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-country-select.mjs +28 -5
- package/fesm2022/tectra-ng-ui-country-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-country.mjs +15 -6
- package/fesm2022/tectra-ng-ui-country.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-datepicker.mjs +10 -8
- package/fesm2022/tectra-ng-ui-datepicker.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-dialog.mjs +6 -6
- package/fesm2022/tectra-ng-ui-dialog.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-export.mjs +1237 -84
- package/fesm2022/tectra-ng-ui-export.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-field.mjs +1 -0
- package/fesm2022/tectra-ng-ui-field.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-fieldset.mjs +2 -2
- package/fesm2022/tectra-ng-ui-fieldset.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-icon-field.mjs +51 -23
- package/fesm2022/tectra-ng-ui-icon-field.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-input-number.mjs +2 -2
- package/fesm2022/tectra-ng-ui-input-number.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-input.mjs +5 -4
- package/fesm2022/tectra-ng-ui-input.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-key-filter.mjs +84 -19
- package/fesm2022/tectra-ng-ui-key-filter.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-knob.mjs +24 -2
- package/fesm2022/tectra-ng-ui-knob.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-label.mjs +68 -9
- package/fesm2022/tectra-ng-ui-label.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-link.mjs +38 -14
- package/fesm2022/tectra-ng-ui-link.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs +16 -5
- package/fesm2022/tectra-ng-ui-mention-textarea.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-message.mjs +5 -1
- package/fesm2022/tectra-ng-ui-message.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-month-calendar.mjs +26 -9
- package/fesm2022/tectra-ng-ui-month-calendar.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-multiselect.mjs +3 -2
- package/fesm2022/tectra-ng-ui-multiselect.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-panel-menu.mjs +45 -14
- package/fesm2022/tectra-ng-ui-panel-menu.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-panel.mjs +4 -2
- package/fesm2022/tectra-ng-ui-panel.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-password-generator.mjs +18 -1
- package/fesm2022/tectra-ng-ui-password-generator.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-password.mjs +2 -2
- package/fesm2022/tectra-ng-ui-password.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-pill.mjs +36 -16
- package/fesm2022/tectra-ng-ui-pill.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-rating.mjs +2 -2
- package/fesm2022/tectra-ng-ui-rating.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-select.mjs +30 -7
- package/fesm2022/tectra-ng-ui-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs +93 -8
- package/fesm2022/tectra-ng-ui-stat-tiles.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-status-icon.mjs +40 -3
- package/fesm2022/tectra-ng-ui-status-icon.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-table.mjs +20 -6
- package/fesm2022/tectra-ng-ui-table.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tag.mjs +2 -2
- package/fesm2022/tectra-ng-ui-tag.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-toast.mjs +2 -2
- package/fesm2022/tectra-ng-ui-toast.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree-select.mjs +10 -8
- package/fesm2022/tectra-ng-ui-tree-select.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-tree-table.mjs +4 -4
- package/fesm2022/tectra-ng-ui-tree-table.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui-truncate-text.mjs +33 -9
- package/fesm2022/tectra-ng-ui-truncate-text.mjs.map +1 -1
- package/fesm2022/tectra-ng-ui.mjs +1 -1
- package/icon-field/README.md +2 -1
- package/key-filter/README.md +3 -2
- package/knob/README.md +3 -1
- package/label/README.md +4 -1
- package/link/README.md +4 -1
- package/message/README.md +2 -2
- package/month-calendar/README.md +2 -1
- package/multiselect/README.md +1 -1
- package/package.json +4 -4
- package/panel/README.md +3 -1
- package/panel-menu/README.md +3 -2
- package/password-generator/README.md +2 -0
- package/pill/README.md +4 -4
- package/select/README.md +1 -1
- package/stat-tiles/README.md +17 -1
- package/status-icon/README.md +3 -1
- package/table/README.md +1 -1
- package/tag/README.md +2 -0
- package/tree-select/README.md +1 -1
- package/truncate-text/README.md +2 -1
- package/types/tectra-ng-ui-amount.d.ts +41 -1
- package/types/tectra-ng-ui-amount.d.ts.map +1 -1
- package/types/tectra-ng-ui-analog-clock.d.ts +1 -4
- package/types/tectra-ng-ui-analog-clock.d.ts.map +1 -1
- package/types/tectra-ng-ui-autocomplete.d.ts +1 -1
- package/types/tectra-ng-ui-avatar.d.ts +45 -12
- package/types/tectra-ng-ui-avatar.d.ts.map +1 -1
- package/types/tectra-ng-ui-cascade-select.d.ts +3 -2
- package/types/tectra-ng-ui-cascade-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-chips-input.d.ts +54 -6
- package/types/tectra-ng-ui-chips-input.d.ts.map +1 -1
- package/types/tectra-ng-ui-color-picker.d.ts +38 -1
- package/types/tectra-ng-ui-color-picker.d.ts.map +1 -1
- package/types/tectra-ng-ui-countdown.d.ts +12 -1
- package/types/tectra-ng-ui-countdown.d.ts.map +1 -1
- package/types/tectra-ng-ui-country-select.d.ts +17 -4
- package/types/tectra-ng-ui-country-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-country.d.ts +7 -1
- package/types/tectra-ng-ui-country.d.ts.map +1 -1
- package/types/tectra-ng-ui-datepicker.d.ts +2 -2
- package/types/tectra-ng-ui-datepicker.d.ts.map +1 -1
- package/types/tectra-ng-ui-export.d.ts +68 -8
- package/types/tectra-ng-ui-export.d.ts.map +1 -1
- package/types/tectra-ng-ui-icon-field.d.ts +9 -2
- package/types/tectra-ng-ui-icon-field.d.ts.map +1 -1
- package/types/tectra-ng-ui-key-filter.d.ts +19 -4
- package/types/tectra-ng-ui-key-filter.d.ts.map +1 -1
- package/types/tectra-ng-ui-knob.d.ts +10 -2
- package/types/tectra-ng-ui-knob.d.ts.map +1 -1
- package/types/tectra-ng-ui-label.d.ts +8 -1
- package/types/tectra-ng-ui-label.d.ts.map +1 -1
- package/types/tectra-ng-ui-link.d.ts +8 -2
- package/types/tectra-ng-ui-link.d.ts.map +1 -1
- package/types/tectra-ng-ui-mention-textarea.d.ts +5 -0
- package/types/tectra-ng-ui-mention-textarea.d.ts.map +1 -1
- package/types/tectra-ng-ui-message.d.ts +1 -1
- package/types/tectra-ng-ui-message.d.ts.map +1 -1
- package/types/tectra-ng-ui-month-calendar.d.ts +14 -4
- package/types/tectra-ng-ui-month-calendar.d.ts.map +1 -1
- package/types/tectra-ng-ui-multiselect.d.ts +1 -1
- package/types/tectra-ng-ui-panel-menu.d.ts +34 -6
- package/types/tectra-ng-ui-panel-menu.d.ts.map +1 -1
- package/types/tectra-ng-ui-panel.d.ts +1 -1
- package/types/tectra-ng-ui-panel.d.ts.map +1 -1
- package/types/tectra-ng-ui-password-generator.d.ts +10 -3
- package/types/tectra-ng-ui-password-generator.d.ts.map +1 -1
- package/types/tectra-ng-ui-pill.d.ts +9 -5
- package/types/tectra-ng-ui-pill.d.ts.map +1 -1
- package/types/tectra-ng-ui-select.d.ts +5 -2
- package/types/tectra-ng-ui-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-stat-tiles.d.ts +49 -5
- package/types/tectra-ng-ui-stat-tiles.d.ts.map +1 -1
- package/types/tectra-ng-ui-status-icon.d.ts +20 -2
- package/types/tectra-ng-ui-status-icon.d.ts.map +1 -1
- package/types/tectra-ng-ui-table.d.ts +2 -1
- package/types/tectra-ng-ui-table.d.ts.map +1 -1
- package/types/tectra-ng-ui-tree-select.d.ts +3 -3
- package/types/tectra-ng-ui-tree-select.d.ts.map +1 -1
- package/types/tectra-ng-ui-truncate-text.d.ts +7 -2
- package/types/tectra-ng-ui-truncate-text.d.ts.map +1 -1
- package/types/tectra-ng-ui.d.ts +1 -1
|
@@ -10,7 +10,7 @@ import { injectPassThrough, injectTokens, injectUnstyled } from "@tectra-ng/core
|
|
|
10
10
|
import { injectFluid } from "@tectra-ng/core/fluid";
|
|
11
11
|
import { TxFormControlBase, injectFieldInvalid } from "@tectra-ng/core/forms";
|
|
12
12
|
import { TxLocaleService, injectTranslations } from "@tectra-ng/core/i18n";
|
|
13
|
-
import { TxOverlayAnchor, TxOverlayInsets, placementFromPosition, txAnimateEnter, txAnimateLeave,
|
|
13
|
+
import { TxOverlayAnchor, TxOverlayInsets, TxPanelWidth, placementFromPosition, txAnimateEnter, txAnimateLeave, txFieldPositions, txScrollStrategy, watchOrigin } from "@tectra-ng/core/overlay";
|
|
14
14
|
import { optionalBoolean } from "@tectra-ng/core/utils";
|
|
15
15
|
import { TxIcon, provideTxIconDefaults, txIconCalendar, txIconChevronDown, txIconChevronLeft, txIconChevronRight, txIconChevronUp, txIconSpinner, txIconTable, txIconText, txIconTimes } from "@tectra-ng/icons";
|
|
16
16
|
import { datePickerTokens, fieldTokens, formFieldTokens, toStyleObject } from "@tectra-ng/themes";
|
|
@@ -719,7 +719,7 @@ var TxDatePicker = class TxDatePicker extends TxFormControlBase {
|
|
|
719
719
|
isFluid = injectFluid(this.fluid);
|
|
720
720
|
isInvalid = injectFieldInvalid(this.invalid);
|
|
721
721
|
passThrough = injectPassThrough("datePicker", this, this.pt, this.ptOptions);
|
|
722
|
-
positions =
|
|
722
|
+
positions = txFieldPositions(4);
|
|
723
723
|
scrollStrategy = txScrollStrategy(this.injector);
|
|
724
724
|
panelId = uniqueId("tx-datepicker");
|
|
725
725
|
generatedInputId = `${this.panelId}-input`;
|
|
@@ -735,7 +735,7 @@ var TxDatePicker = class TxDatePicker extends TxFormControlBase {
|
|
|
735
735
|
focusedYear = signal((/* @__PURE__ */ new Date()).getFullYear(), ...ngDevMode ? [{ debugName: "focusedYear" }] : /* istanbul ignore next */ []);
|
|
736
736
|
pendingTime = signal(null, ...ngDevMode ? [{ debugName: "pendingTime" }] : /* istanbul ignore next */ []);
|
|
737
737
|
previewDate = signal(null, ...ngDevMode ? [{ debugName: "previewDate" }] : /* istanbul ignore next */ []);
|
|
738
|
-
|
|
738
|
+
panelWidth = new TxPanelWidth({ fitContent: false });
|
|
739
739
|
matchedMonths = signal(null, ...ngDevMode ? [{ debugName: "matchedMonths" }] : /* istanbul ignore next */ []);
|
|
740
740
|
isDisabled = computed(() => this.disabled() || this.disabledInput(), ...ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []);
|
|
741
741
|
isEditable = computed(() => !this.isDisabled() && !this.readonly(), ...ngDevMode ? [{ debugName: "isEditable" }] : /* istanbul ignore next */ []);
|
|
@@ -793,6 +793,7 @@ var TxDatePicker = class TxDatePicker extends TxFormControlBase {
|
|
|
793
793
|
}), ...ngDevMode ? [{ debugName: "hostStyle" }] : /* istanbul ignore next */ []);
|
|
794
794
|
panelStyle = computed(() => ({
|
|
795
795
|
...toStyleObject(this.dt(), "--tx-date-picker"),
|
|
796
|
+
...this.panelWidth.style(),
|
|
796
797
|
...this.passThrough().panel?.style
|
|
797
798
|
}), ...ngDevMode ? [{ debugName: "panelStyle" }] : /* istanbul ignore next */ []);
|
|
798
799
|
showPanel = computed(() => this.inline() || this.isPanelMounted(), ...ngDevMode ? [{ debugName: "showPanel" }] : /* istanbul ignore next */ []);
|
|
@@ -860,7 +861,8 @@ var TxDatePicker = class TxDatePicker extends TxFormControlBase {
|
|
|
860
861
|
this.resetFocus();
|
|
861
862
|
this.isOpen.set(true);
|
|
862
863
|
this.hasEntered = false;
|
|
863
|
-
this.
|
|
864
|
+
const field = this.fieldRef()?.nativeElement;
|
|
865
|
+
if (field && !this.touchUI()) this.panelWidth.open(field);
|
|
864
866
|
if (this.touchUI()) this.openTouch();
|
|
865
867
|
else this.isPanelMounted.set(true);
|
|
866
868
|
this.opened.emit();
|
|
@@ -1960,8 +1962,8 @@ var TxDatePicker = class TxDatePicker extends TxFormControlBase {
|
|
|
1960
1962
|
],
|
|
1961
1963
|
usesInheritance: true,
|
|
1962
1964
|
ngImport: i0,
|
|
1963
|
-
template: "@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n} @else {\n <div #field #origin=\"cdkOverlayOrigin\" cdkOverlayOrigin class=\"tx-datepicker__field\">\n <input\n #input\n txInput\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"dialog\"\n class=\"tx-datepicker__input\"\n [class]=\"passThrough().input?.class\"\n [style]=\"passThrough().input?.style\"\n [id]=\"resolvedInputId()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [fluid]=\"true\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly() || readonlyInput()\"\n [attr.data-picker]=\"readonlyInput() && !readonly() ? '' : null\"\n [required]=\"required()\"\n [value]=\"inputText()\"\n [attr.inputmode]=\"readonlyInput() || touchUI() ? 'none' : null\"\n [attr.placeholder]=\"placeholder() ?? null\"\n [attr.name]=\"name() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n (click)=\"onInputClick()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n />\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-datepicker__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"onClearIcon()\"\n >\n <tx-icon name=\"times\" />\n </button>\n }\n @if (showIcon() && iconDisplay() === 'input') {\n <span\n class=\"tx-datepicker__input-icon\"\n aria-hidden=\"true\"\n [class]=\"passThrough().inputIcon?.class\"\n [style]=\"passThrough().inputIcon?.style\"\n (click)=\"toggle(false)\"\n >\n @if (inputIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: toggle.bind(this, false) }\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </span>\n }\n @if (showIcon() && iconDisplay() === 'button') {\n <button\n type=\"button\"\n class=\"tx-datepicker__dropdown\"\n aria-haspopup=\"dialog\"\n tabindex=\"-1\"\n [class]=\"passThrough().dropdown?.class\"\n [style]=\"passThrough().dropdown?.style\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"iconAriaLabel() ?? translations().chooseDate\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (click)=\"toggle(true)\"\n >\n @if (triggerIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </button>\n }\n </div>\n\n <ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted() && !touchUI()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayMinWidth]=\"panelMinWidth()\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (attach)=\"onAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (detach)=\"close(false)\"\n >\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n </ng-template>\n}\n\n<ng-template #panelTemplate>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its controls -->\n <div\n #panel\n class=\"tx-datepicker__panel\"\n [cdkTrapFocus]=\"!inline()\"\n [attr.id]=\"panelId\"\n [attr.role]=\"inline() ? 'group' : 'dialog'\"\n [attr.aria-modal]=\"inline() ? null : 'true'\"\n [attr.aria-label]=\"ariaLabel() ?? translations().chooseDate\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-view]=\"currentView()\"\n [class.tx-datepicker__panel--inline]=\"inline()\"\n [class.tx-datepicker__panel--touch]=\"touchUI() && !inline()\"\n [class.tx-datepicker__panel--time-only]=\"timeOnly()\"\n [class.tx-datepicker__panel--disabled]=\"isDisabled()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n [style.min-width.px]=\"inline() ? null : panelMinWidth()\"\n (keydown)=\"onPanelKeydown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n @if (!timeOnly()) {\n <div class=\"tx-datepicker__calendars\">\n @for (month of currentView() === 'date' ? months() : [months()[0]]; track month.year * 12 + month.month; let first = $first; let last = $last) {\n <div class=\"tx-datepicker__calendar\" [class]=\"passThrough().calendar?.class\" [style]=\"passThrough().calendar?.style\">\n <div class=\"tx-datepicker__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-left\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__previous\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!first\"\n [class]=\"passThrough().previous?.class\"\n [style]=\"passThrough().previous?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"first ? null : 'true'\"\n [attr.tabindex]=\"first ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().previousDecade : currentView() === 'month' ? translations().previousYear : translations().previousMonth\"\n (click)=\"previous()\"\n ></button>\n <div class=\"tx-datepicker__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">\n @switch (currentView()) {\n @case ('date') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-month\"\n [class]=\"passThrough().selectMonth?.class\"\n [style]=\"passThrough().selectMonth?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseMonth + ', ' + names().monthNames[month.month]\"\n (click)=\"showMonthView()\"\n >\n {{ names().monthNames[month.month] }}\n </button>\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + month.year\"\n (click)=\"showYearView()\"\n >\n {{ month.year }}\n </button>\n }\n @case ('month') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled() || view() === 'year'\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + viewYear()\"\n (click)=\"showYearView()\"\n >\n {{ viewYear() }}\n </button>\n }\n @case ('year') {\n <span class=\"tx-datepicker__decade\">\n @if (decadeTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: decade() }\" />\n } @else {\n {{ decade()[0] }} – {{ decade()[9] }}\n }\n </span>\n }\n }\n </div>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-right\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__next\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!last\"\n [class]=\"passThrough().next?.class\"\n [style]=\"passThrough().next?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"last ? null : 'true'\"\n [attr.tabindex]=\"last ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().nextDecade : currentView() === 'month' ? translations().nextYear : translations().nextMonth\"\n (click)=\"next()\"\n ></button>\n </div>\n\n @switch (currentView()) {\n @case ('date') {\n <table\n role=\"grid\"\n class=\"tx-datepicker__day-view\"\n (mouseleave)=\"onGridLeave()\"\n [attr.aria-label]=\"names().monthNames[month.month] + ' ' + month.year\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n >\n <thead>\n <tr>\n @if (showWeek()) {\n <th scope=\"col\" class=\"tx-datepicker__weekday tx-datepicker__weekheader\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ translations().weekHeader }}\n </th>\n }\n @for (weekday of weekdays(); track weekday.long) {\n <th scope=\"col\" class=\"tx-datepicker__weekday\" [attr.abbr]=\"weekday.long\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ weekday.short }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (week of month.weeks; track week.number + '-' + $index) {\n <tr>\n @if (showWeek()) {\n <th scope=\"row\" class=\"tx-datepicker__week-number\" [class]=\"passThrough().weekNumber?.class\" [style]=\"passThrough().weekNumber?.style\">\n {{ week.number }}\n </th>\n }\n @for (day of week.days; track dayKey(day.date)) {\n @if (day.otherMonth && !showOtherMonths()) {\n <td role=\"gridcell\" class=\"tx-datepicker__day-cell tx-datepicker__day-cell--empty\"></td>\n } @else {\n <td\n role=\"gridcell\"\n class=\"tx-datepicker__day-cell\"\n [class.tx-datepicker__day-cell--today]=\"day.today\"\n [class.tx-datepicker__day-cell--other]=\"day.otherMonth\"\n [attr.data-date]=\"dayKey(day.date)\"\n [attr.data-active]=\"isFocusedDay(day) || null\"\n [attr.tabindex]=\"isFocusedDay(day) ? 0 : -1\"\n [attr.aria-label]=\"dayLabel(day.date)\"\n [attr.aria-selected]=\"isSelected(day.date) || isInRange(day.date)\"\n [attr.aria-disabled]=\"!day.selectable || (day.otherMonth && !selectOtherMonths()) || null\"\n [attr.aria-current]=\"day.today ? 'date' : null\"\n (click)=\"onDayClick(day)\"\n (mouseenter)=\"onDayEnter(day)\"\n (keydown)=\"onDayKeydown($event, day)\"\n >\n <span\n class=\"tx-datepicker__day\"\n [class.tx-datepicker__day--selected]=\"isSelected(day.date)\"\n [class.tx-datepicker__day--range]=\"isInRange(day.date)\"\n [class.tx-datepicker__day--preview]=\"isPreview(day.date)\"\n [class.tx-datepicker__day--disabled]=\"!day.selectable\"\n [class]=\"passThrough().day?.class\"\n [style]=\"passThrough().day?.style\"\n >\n @if (dateTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: day, selected: isSelected(day.date), inRange: isInRange(day.date) }\"\n />\n } @else {\n {{ day.day }}\n }\n </span>\n </td>\n }\n }\n </tr>\n }\n </tbody>\n </table>\n }\n @case ('month') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__month-view\"\n [attr.aria-label]=\"translations().chooseMonth\"\n [class]=\"passThrough().monthView?.class\"\n [style]=\"passThrough().monthView?.style\"\n >\n @for (row of [0, 1, 2, 3]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1, 2]; track column) {\n @let monthIndex = row * 3 + column;\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__month\"\n [class.tx-datepicker__month--selected]=\"isMonthSelected(monthIndex)\"\n [class.tx-datepicker__month--disabled]=\"!monthSelectable(monthIndex)\"\n [class]=\"passThrough().month?.class\"\n [style]=\"passThrough().month?.style\"\n [attr.data-active]=\"focusedMonth() === monthIndex || null\"\n [attr.tabindex]=\"focusedMonth() === monthIndex ? 0 : -1\"\n [attr.aria-label]=\"names().monthNames[monthIndex] + ' ' + viewYear()\"\n [attr.aria-selected]=\"isMonthSelected(monthIndex)\"\n [attr.aria-disabled]=\"!monthSelectable(monthIndex) || null\"\n (click)=\"pickMonth(monthIndex)\"\n (keydown)=\"onMonthKeydown($event, monthIndex)\"\n >{{ names().monthNamesShort[monthIndex] }}</span\n >\n }\n </div>\n }\n </div>\n }\n @case ('year') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__year-view\"\n [attr.aria-label]=\"translations().chooseYear\"\n [class]=\"passThrough().yearView?.class\"\n [style]=\"passThrough().yearView?.style\"\n >\n @for (row of [0, 1, 2, 3, 4]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1]; track column) {\n @let year = decade()[row * 2 + column];\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__year\"\n [class.tx-datepicker__year--selected]=\"isYearSelected(year)\"\n [class.tx-datepicker__year--disabled]=\"!yearSelectable(year)\"\n [class]=\"passThrough().year?.class\"\n [style]=\"passThrough().year?.style\"\n [attr.data-active]=\"focusedYear() === year || null\"\n [attr.tabindex]=\"focusedYear() === year ? 0 : -1\"\n [attr.aria-selected]=\"isYearSelected(year)\"\n [attr.aria-disabled]=\"!yearSelectable(year) || null\"\n (click)=\"pickYear(year)\"\n (keydown)=\"onYearKeydown($event, year)\"\n >{{ year }}</span\n >\n }\n </div>\n }\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (hasTime() && currentView() === 'date') {\n <div class=\"tx-datepicker__time\" [class]=\"passThrough().timePicker?.class\" [style]=\"passThrough().timePicker?.style\">\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'hour', value: hours() }\" />\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'minute', value: minutes() }\" />\n @if (showSeconds()) {\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'second', value: seconds() }\" />\n }\n @if (hourFormat() === '12') {\n <div class=\"tx-datepicker__time-unit\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n <span class=\"tx-datepicker__time-value\">{{ isPm() ? translations().pm : translations().am }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n </div>\n }\n </div>\n }\n\n @if (showButtonBar()) {\n <div class=\"tx-datepicker__buttonbar\" [class]=\"passThrough().buttonbar?.class\" [style]=\"passThrough().buttonbar?.style\">\n @if (buttonBarTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ today: selectToday.bind(this), clear: onClearButton.bind(this) }\" />\n } @else {\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().today\"\n [disabled]=\"!isEditable()\"\n (click)=\"selectToday()\"\n ></button>\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().clear\"\n [disabled]=\"!isEditable()\"\n (click)=\"onClearButton()\"\n ></button>\n }\n </div>\n }\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n </div>\n</ng-template>\n\n<ng-template #spinner let-unit=\"unit\" let-value=\"value\">\n <div class=\"tx-datepicker__time-unit\" role=\"group\" [attr.aria-label]=\"unit === 'hour' ? translations().hour : unit === 'minute' ? translations().minute : translations().second\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().nextHour : unit === 'minute' ? translations().nextMinute : translations().nextSecond\"\n (pointerdown)=\"startRepeat($event, unit, 1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, 1)\"\n ></button>\n <span class=\"tx-datepicker__time-value\" aria-live=\"polite\">{{ formatPart(value) }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().previousHour : unit === 'minute' ? translations().previousMinute : translations().previousSecond\"\n (pointerdown)=\"startRepeat($event, unit, -1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, -1)\"\n ></button>\n </div>\n</ng-template>\n",
|
|
1964
|
-
styles: [":host{display:inline-flex;max-width:100%;vertical-align:top}:host(.tx-datepicker--fluid){display:flex;width:100%}:host(.tx-datepicker--inline){display:inline-block}.tx-datepicker__field{position:relative;display:flex;flex:1 1 auto;align-items:stretch;min-width:0}.tx-datepicker__input{flex:1 1 auto;width:1%;min-width:0}.tx-datepicker__clear,.tx-datepicker__input-icon{position:absolute;top:50%;transform:translateY(-50%)}.tx-datepicker__dropdown{display:inline-flex;flex:none;align-items:center;justify-content:center;cursor:pointer}.tx-datepicker__nav--hidden{visibility:hidden}:host([data-styled]){--_icon-room: 0px;--_clear-room: 0px}:host([data-styled]) .tx-datepicker__input{--tx-field-inset-end: calc(var(--_icon-room) + var(--_clear-room))}:host([data-styled]) .tx-datepicker__clear{display:grid;place-items:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-form-field-icon-color);font-size:var(--tx-form-field-font-size);cursor:pointer;pointer-events:auto;transition:background-color var(--tx-form-field-transition-duration),color var(--tx-form-field-transition-duration)}:host([data-styled]) .tx-datepicker__clear:hover{background:var(--tx-surface-hover);color:var(--tx-form-field-color)}:host([data-styled]) .tx-datepicker__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}:host([data-styled]) .tx-datepicker__clear{right:calc(var(--_icon-room) + var(--_button-room, 0px) + 8px)}:host([data-styled]) .tx-datepicker__input-icon{right:var(--tx-form-field-padding-x);display:inline-flex;color:var(--tx-date-picker-input-icon-color);font-size:var(--tx-form-field-font-size);line-height:1;cursor:pointer}:host([data-styled]) .tx-datepicker__dropdown{box-sizing:border-box;width:var(--tx-date-picker-dropdown-width);padding:0;border:1px solid var(--tx-date-picker-dropdown-border-color);border-inline-start:0 none;border-start-end-radius:var(--tx-date-picker-dropdown-border-radius);border-end-end-radius:var(--tx-date-picker-dropdown-border-radius);outline-color:transparent;background:var(--tx-date-picker-dropdown-background);color:var(--tx-date-picker-dropdown-color);font-size:var(--tx-form-field-font-size);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),border-color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}:host([data-styled]) .tx-datepicker__dropdown:not(:disabled):hover{border-color:var(--tx-date-picker-dropdown-hover-border-color);background:var(--tx-date-picker-dropdown-hover-background);color:var(--tx-date-picker-dropdown-hover-color)}:host([data-styled]) .tx-datepicker__dropdown:not(:disabled):active{border-color:var(--tx-date-picker-dropdown-active-border-color);background:var(--tx-date-picker-dropdown-active-background);color:var(--tx-date-picker-dropdown-active-color)}:host([data-styled]) .tx-datepicker__dropdown:focus-visible{outline:var(--tx-date-picker-dropdown-focus-ring-width) var(--tx-date-picker-dropdown-focus-ring-style) var(--tx-date-picker-dropdown-focus-ring-color);outline-offset:var(--tx-date-picker-dropdown-focus-ring-offset);box-shadow:var(--tx-date-picker-dropdown-focus-ring-shadow)}:host([data-styled]) .tx-datepicker__dropdown:disabled{cursor:not-allowed;opacity:.6}:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown,:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown:not(:disabled):hover,:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown:not(:disabled):active{border-color:var(--tx-date-picker-dropdown-invalid-border-color)}:host([data-styled]:has(.tx-datepicker__input-icon)){--_icon-room: calc(var(--tx-form-field-padding-x) + 1em)}:host([data-styled]:has(.tx-datepicker__clear)){--_clear-room: 28px}:host([data-styled].tx-datepicker--button){--_button-room: var(--tx-date-picker-dropdown-width)}:host([data-styled].tx-datepicker--button[data-size=small]){--_button-room: var(--tx-date-picker-dropdown-sm-width)}:host([data-styled].tx-datepicker--button[data-size=large]){--_button-room: var(--tx-date-picker-dropdown-lg-width)}:host([data-styled].tx-datepicker--button) .tx-datepicker__input{border-start-end-radius:0;border-end-end-radius:0}:host([data-styled][data-size=small]) .tx-datepicker__dropdown{width:var(--tx-date-picker-dropdown-sm-width);font-size:var(--tx-form-field-sm-font-size)}:host([data-styled][data-size=large]) .tx-datepicker__dropdown{width:var(--tx-date-picker-dropdown-lg-width);font-size:var(--tx-form-field-lg-font-size)}.tx-datepicker__panel{box-sizing:border-box}.tx-datepicker__calendars{display:flex}.tx-datepicker__header,.tx-datepicker__title,.tx-datepicker__time,.tx-datepicker__buttonbar{display:flex;align-items:center}.tx-datepicker__header,.tx-datepicker__buttonbar{justify-content:space-between}.tx-datepicker__time{justify-content:center}.tx-datepicker__time-unit{display:flex;flex-direction:column;align-items:center}.tx-datepicker__day-view{width:100%;border-collapse:collapse}.tx-datepicker__day-cell{cursor:pointer}.tx-datepicker__day-cell[aria-disabled=true]{cursor:default}.tx-datepicker__day{display:flex;align-items:center;justify-content:center;margin:0 auto}.tx-datepicker__row{display:flex}.tx-datepicker__month,.tx-datepicker__year{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.tx-datepicker__month{width:33.3%}.tx-datepicker__year{width:50%}.tx-datepicker__month--disabled,.tx-datepicker__year--disabled{cursor:default}.tx-datepicker__panel[data-styled]{padding:var(--tx-date-picker-panel-padding);border:1px solid var(--tx-date-picker-panel-border-color);border-radius:var(--tx-date-picker-panel-border-radius);background:var(--tx-date-picker-panel-background);box-shadow:var(--tx-date-picker-panel-shadow);color:var(--tx-date-picker-panel-color);font-family:var(--tx-font-family)}.tx-datepicker__panel[data-styled].tx-datepicker__panel--inline{display:inline-block;overflow-x:auto;box-shadow:none}.tx-datepicker__panel[data-styled].tx-datepicker__panel--touch{width:var(--tx-date-picker-touch-width);max-height:92vh;overflow:auto}.tx-datepicker__panel[data-styled].tx-datepicker__panel--disabled{opacity:.6}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar{flex:1 1 auto;padding-inline:var(--tx-date-picker-group-gap);border-inline-start:1px solid var(--tx-date-picker-group-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar:first-child{padding-inline-start:0;border-inline-start:0 none}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar:last-child{padding-inline-end:0}.tx-datepicker__panel[data-styled] .tx-datepicker__header{padding:var(--tx-date-picker-header-padding);border-bottom:1px solid var(--tx-date-picker-header-border-color);background:var(--tx-date-picker-header-background);color:var(--tx-date-picker-header-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__title{gap:var(--tx-date-picker-title-gap);font-size:var(--tx-date-picker-title-font-size);font-weight:var(--tx-date-picker-title-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year{margin:0;border:none;outline-color:transparent;background:transparent;font-family:inherit;cursor:pointer;transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:focus-visible,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:focus-visible{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:disabled,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:disabled{cursor:default}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month{padding:var(--tx-date-picker-select-month-padding);border-radius:var(--tx-date-picker-select-month-border-radius);color:var(--tx-date-picker-select-month-color);font-size:var(--tx-date-picker-select-month-font-size);font-weight:var(--tx-date-picker-select-month-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:enabled:hover{background:var(--tx-date-picker-select-month-hover-background);color:var(--tx-date-picker-select-month-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-year{padding:var(--tx-date-picker-select-year-padding);border-radius:var(--tx-date-picker-select-year-border-radius);color:var(--tx-date-picker-select-year-color);font-size:var(--tx-date-picker-select-year-font-size);font-weight:var(--tx-date-picker-select-year-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:enabled:hover{background:var(--tx-date-picker-select-year-hover-background);color:var(--tx-date-picker-select-year-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__decade{padding:var(--tx-date-picker-select-year-padding)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{margin:var(--tx-date-picker-day-view-margin);font-size:var(--tx-date-picker-date-font-size)}.tx-datepicker__panel[data-styled] .tx-datepicker__weekday{padding:var(--tx-date-picker-week-day-padding);color:var(--tx-date-picker-week-day-color);font-size:var(--tx-date-picker-week-day-font-size);font-weight:var(--tx-date-picker-week-day-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__week-number{padding:var(--tx-date-picker-date-padding);color:var(--tx-date-picker-week-number-color);font-size:var(--tx-date-picker-week-number-font-size);font-weight:var(--tx-date-picker-date-font-weight);text-align:center}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell{padding:var(--tx-date-picker-date-padding);outline:none}.tx-datepicker__panel[data-styled] .tx-datepicker__day{box-sizing:border-box;width:var(--tx-date-picker-date-width);height:var(--tx-date-picker-date-height);border:1px solid transparent;border-radius:var(--tx-date-picker-date-border-radius);color:var(--tx-date-picker-date-color);font-size:var(--tx-date-picker-date-font-size);font-weight:var(--tx-date-picker-date-font-weight);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),box-shadow var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day{background:var(--tx-date-picker-today-background);color:var(--tx-date-picker-today-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell:not([aria-disabled=true]):hover .tx-datepicker__day:not(.tx-datepicker__day--selected,.tx-datepicker__day--preview){background:var(--tx-date-picker-date-hover-background);color:var(--tx-date-picker-date-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell:focus-visible .tx-datepicker__day{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset);box-shadow:var(--tx-date-picker-date-focus-ring-shadow)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--range,.tx-datepicker__panel[data-styled] .tx-datepicker__day--preview,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--range,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--preview{background:var(--tx-date-picker-date-range-selected-background);color:var(--tx-date-picker-date-range-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--selected,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--selected{background:var(--tx-date-picker-date-selected-background);color:var(--tx-date-picker-date-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--disabled{opacity:var(--tx-date-picker-date-disabled-opacity)}.tx-datepicker__panel[data-styled] .tx-datepicker__month-view{margin:var(--tx-date-picker-month-view-margin)}.tx-datepicker__panel[data-styled] .tx-datepicker__year-view{margin:var(--tx-date-picker-year-view-margin)}.tx-datepicker__panel[data-styled] .tx-datepicker__month,.tx-datepicker__panel[data-styled] .tx-datepicker__year{box-sizing:border-box;outline-color:transparent;color:var(--tx-date-picker-date-color);font-size:var(--tx-date-picker-date-font-size);font-weight:var(--tx-date-picker-date-font-weight);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__month:not(.tx-datepicker__month--disabled,.tx-datepicker__year--disabled,.tx-datepicker__month--selected,.tx-datepicker__year--selected):hover,.tx-datepicker__panel[data-styled] .tx-datepicker__year:not(.tx-datepicker__month--disabled,.tx-datepicker__year--disabled,.tx-datepicker__month--selected,.tx-datepicker__year--selected):hover{background:var(--tx-date-picker-date-hover-background);color:var(--tx-date-picker-date-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__month:focus-visible,.tx-datepicker__panel[data-styled] .tx-datepicker__year:focus-visible{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset)}.tx-datepicker__panel[data-styled] .tx-datepicker__month{padding:var(--tx-date-picker-month-padding);border-radius:var(--tx-date-picker-month-border-radius)}.tx-datepicker__panel[data-styled] .tx-datepicker__year{padding:var(--tx-date-picker-year-padding);border-radius:var(--tx-date-picker-year-border-radius)}.tx-datepicker__panel[data-styled] .tx-datepicker__month--selected,.tx-datepicker__panel[data-styled] .tx-datepicker__year--selected{background:var(--tx-date-picker-date-selected-background);color:var(--tx-date-picker-date-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__month--disabled,.tx-datepicker__panel[data-styled] .tx-datepicker__year--disabled{opacity:var(--tx-date-picker-date-disabled-opacity)}.tx-datepicker__panel[data-styled] .tx-datepicker__time{gap:var(--tx-date-picker-time-picker-gap);padding:0;color:var(--tx-date-picker-time-picker-color);font-size:var(--tx-date-picker-time-picker-font-size);font-weight:var(--tx-date-picker-time-picker-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendars+.tx-datepicker__time{margin-top:var(--tx-date-picker-time-picker-gap);padding:var(--tx-date-picker-time-picker-padding);border-top:1px solid var(--tx-date-picker-time-picker-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__time-unit{gap:var(--tx-date-picker-time-picker-button-gap)}.tx-datepicker__panel[data-styled] .tx-datepicker__time-value{font-variant-numeric:tabular-nums}.tx-datepicker__panel[data-styled] .tx-datepicker__buttonbar{padding:var(--tx-date-picker-buttonbar-padding);border-top:1px solid var(--tx-date-picker-buttonbar-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendars+.tx-datepicker__buttonbar,.tx-datepicker__panel[data-styled] .tx-datepicker__time+.tx-datepicker__buttonbar{margin-top:var(--tx-date-picker-time-picker-gap)}.tx-datepicker__panel[data-styled] .tx-datepicker__month-view,.tx-datepicker__panel[data-styled] .tx-datepicker__year-view,.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{animation:tx-datepicker-view var(--tx-date-picker-transition-duration) ease-out}@keyframes tx-datepicker-view{0%{opacity:0}}@media(prefers-reduced-motion:reduce){.tx-datepicker__panel[data-styled] .tx-datepicker__month-view,.tx-datepicker__panel[data-styled] .tx-datepicker__year-view,.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{animation:none}}\n"],
|
|
1965
|
+
template: "@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n} @else {\n <div #field #origin=\"cdkOverlayOrigin\" cdkOverlayOrigin class=\"tx-datepicker__field\">\n <input\n #input\n txInput\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"dialog\"\n class=\"tx-datepicker__input\"\n [class]=\"passThrough().input?.class\"\n [style]=\"passThrough().input?.style\"\n [id]=\"resolvedInputId()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [fluid]=\"true\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly() || readonlyInput()\"\n [attr.data-picker]=\"readonlyInput() && !readonly() ? '' : null\"\n [required]=\"required()\"\n [value]=\"inputText()\"\n [attr.inputmode]=\"readonlyInput() || touchUI() ? 'none' : null\"\n [attr.placeholder]=\"placeholder() ?? null\"\n [attr.name]=\"name() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n (click)=\"onInputClick()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n />\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-datepicker__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"onClearIcon()\"\n >\n <tx-icon name=\"times\" />\n </button>\n }\n @if (showIcon() && iconDisplay() === 'input') {\n <span\n class=\"tx-datepicker__input-icon\"\n aria-hidden=\"true\"\n [class]=\"passThrough().inputIcon?.class\"\n [style]=\"passThrough().inputIcon?.style\"\n (click)=\"toggle(false)\"\n >\n @if (inputIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: toggle.bind(this, false) }\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </span>\n }\n @if (showIcon() && iconDisplay() === 'button') {\n <button\n type=\"button\"\n class=\"tx-datepicker__dropdown\"\n aria-haspopup=\"dialog\"\n tabindex=\"-1\"\n [class]=\"passThrough().dropdown?.class\"\n [style]=\"passThrough().dropdown?.style\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"iconAriaLabel() ?? translations().chooseDate\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (click)=\"toggle(true)\"\n >\n @if (triggerIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </button>\n }\n </div>\n\n <ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted() && !touchUI()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (attach)=\"onAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (detach)=\"close(false)\"\n >\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n </ng-template>\n}\n\n<ng-template #panelTemplate>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its controls -->\n <div\n #panel\n class=\"tx-datepicker__panel\"\n [cdkTrapFocus]=\"!inline()\"\n [attr.id]=\"panelId\"\n [attr.role]=\"inline() ? 'group' : 'dialog'\"\n [attr.aria-modal]=\"inline() ? null : 'true'\"\n [attr.aria-label]=\"ariaLabel() ?? translations().chooseDate\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-view]=\"currentView()\"\n [class.tx-datepicker__panel--inline]=\"inline()\"\n [class.tx-datepicker__panel--touch]=\"touchUI() && !inline()\"\n [class.tx-datepicker__panel--time-only]=\"timeOnly()\"\n [class.tx-datepicker__panel--disabled]=\"isDisabled()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n (keydown)=\"onPanelKeydown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n @if (!timeOnly()) {\n <div class=\"tx-datepicker__calendars\">\n @for (month of currentView() === 'date' ? months() : [months()[0]]; track $index; let first = $first; let last = $last) {\n <div class=\"tx-datepicker__calendar\" [class]=\"passThrough().calendar?.class\" [style]=\"passThrough().calendar?.style\">\n <div class=\"tx-datepicker__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-left\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__previous\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!first\"\n [class]=\"passThrough().previous?.class\"\n [style]=\"passThrough().previous?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"first ? null : 'true'\"\n [attr.tabindex]=\"first ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().previousDecade : currentView() === 'month' ? translations().previousYear : translations().previousMonth\"\n (click)=\"previous()\"\n ></button>\n <div class=\"tx-datepicker__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">\n @switch (currentView()) {\n @case ('date') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-month\"\n [class]=\"passThrough().selectMonth?.class\"\n [style]=\"passThrough().selectMonth?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseMonth + ', ' + names().monthNames[month.month]\"\n (click)=\"showMonthView()\"\n >\n {{ names().monthNames[month.month] }}\n </button>\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + month.year\"\n (click)=\"showYearView()\"\n >\n {{ month.year }}\n </button>\n }\n @case ('month') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled() || view() === 'year'\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + viewYear()\"\n (click)=\"showYearView()\"\n >\n {{ viewYear() }}\n </button>\n }\n @case ('year') {\n <span class=\"tx-datepicker__decade\">\n @if (decadeTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: decade() }\" />\n } @else {\n {{ decade()[0] }} – {{ decade()[9] }}\n }\n </span>\n }\n }\n </div>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-right\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__next\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!last\"\n [class]=\"passThrough().next?.class\"\n [style]=\"passThrough().next?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"last ? null : 'true'\"\n [attr.tabindex]=\"last ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().nextDecade : currentView() === 'month' ? translations().nextYear : translations().nextMonth\"\n (click)=\"next()\"\n ></button>\n </div>\n\n @switch (currentView()) {\n @case ('date') {\n <table\n role=\"grid\"\n class=\"tx-datepicker__day-view\"\n (mouseleave)=\"onGridLeave()\"\n [attr.aria-label]=\"names().monthNames[month.month] + ' ' + month.year\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n >\n <thead>\n <tr>\n @if (showWeek()) {\n <th scope=\"col\" class=\"tx-datepicker__weekday tx-datepicker__weekheader\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ translations().weekHeader }}\n </th>\n }\n @for (weekday of weekdays(); track weekday.long) {\n <th scope=\"col\" class=\"tx-datepicker__weekday\" [attr.abbr]=\"weekday.long\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ weekday.short }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (week of month.weeks; track week.number + '-' + $index) {\n <tr>\n @if (showWeek()) {\n <th scope=\"row\" class=\"tx-datepicker__week-number\" [class]=\"passThrough().weekNumber?.class\" [style]=\"passThrough().weekNumber?.style\">\n {{ week.number }}\n </th>\n }\n @for (day of week.days; track dayKey(day.date)) {\n @if (day.otherMonth && !showOtherMonths()) {\n <td role=\"gridcell\" class=\"tx-datepicker__day-cell tx-datepicker__day-cell--empty\"></td>\n } @else {\n <td\n role=\"gridcell\"\n class=\"tx-datepicker__day-cell\"\n [class.tx-datepicker__day-cell--today]=\"day.today\"\n [class.tx-datepicker__day-cell--other]=\"day.otherMonth\"\n [attr.data-date]=\"dayKey(day.date)\"\n [attr.data-active]=\"isFocusedDay(day) || null\"\n [attr.tabindex]=\"isFocusedDay(day) ? 0 : -1\"\n [attr.aria-label]=\"dayLabel(day.date)\"\n [attr.aria-selected]=\"isSelected(day.date) || isInRange(day.date)\"\n [attr.aria-disabled]=\"!day.selectable || (day.otherMonth && !selectOtherMonths()) || null\"\n [attr.aria-current]=\"day.today ? 'date' : null\"\n (click)=\"onDayClick(day)\"\n (mouseenter)=\"onDayEnter(day)\"\n (keydown)=\"onDayKeydown($event, day)\"\n >\n <span\n class=\"tx-datepicker__day\"\n [class.tx-datepicker__day--selected]=\"isSelected(day.date)\"\n [class.tx-datepicker__day--range]=\"isInRange(day.date)\"\n [class.tx-datepicker__day--preview]=\"isPreview(day.date)\"\n [class.tx-datepicker__day--disabled]=\"!day.selectable\"\n [class]=\"passThrough().day?.class\"\n [style]=\"passThrough().day?.style\"\n >\n @if (dateTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: day, selected: isSelected(day.date), inRange: isInRange(day.date) }\"\n />\n } @else {\n {{ day.day }}\n }\n </span>\n </td>\n }\n }\n </tr>\n }\n </tbody>\n </table>\n }\n @case ('month') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__month-view\"\n [attr.aria-label]=\"translations().chooseMonth\"\n [class]=\"passThrough().monthView?.class\"\n [style]=\"passThrough().monthView?.style\"\n >\n @for (row of [0, 1, 2, 3]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1, 2]; track column) {\n @let monthIndex = row * 3 + column;\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__month\"\n [class.tx-datepicker__month--selected]=\"isMonthSelected(monthIndex)\"\n [class.tx-datepicker__month--disabled]=\"!monthSelectable(monthIndex)\"\n [class]=\"passThrough().month?.class\"\n [style]=\"passThrough().month?.style\"\n [attr.data-active]=\"focusedMonth() === monthIndex || null\"\n [attr.tabindex]=\"focusedMonth() === monthIndex ? 0 : -1\"\n [attr.aria-label]=\"names().monthNames[monthIndex] + ' ' + viewYear()\"\n [attr.aria-selected]=\"isMonthSelected(monthIndex)\"\n [attr.aria-disabled]=\"!monthSelectable(monthIndex) || null\"\n (click)=\"pickMonth(monthIndex)\"\n (keydown)=\"onMonthKeydown($event, monthIndex)\"\n >{{ names().monthNamesShort[monthIndex] }}</span\n >\n }\n </div>\n }\n </div>\n }\n @case ('year') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__year-view\"\n [attr.aria-label]=\"translations().chooseYear\"\n [class]=\"passThrough().yearView?.class\"\n [style]=\"passThrough().yearView?.style\"\n >\n @for (row of [0, 1, 2, 3, 4]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1]; track column) {\n @let year = decade()[row * 2 + column];\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__year\"\n [class.tx-datepicker__year--selected]=\"isYearSelected(year)\"\n [class.tx-datepicker__year--disabled]=\"!yearSelectable(year)\"\n [class]=\"passThrough().year?.class\"\n [style]=\"passThrough().year?.style\"\n [attr.data-active]=\"focusedYear() === year || null\"\n [attr.tabindex]=\"focusedYear() === year ? 0 : -1\"\n [attr.aria-selected]=\"isYearSelected(year)\"\n [attr.aria-disabled]=\"!yearSelectable(year) || null\"\n (click)=\"pickYear(year)\"\n (keydown)=\"onYearKeydown($event, year)\"\n >{{ year }}</span\n >\n }\n </div>\n }\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (hasTime() && currentView() === 'date') {\n <div class=\"tx-datepicker__time\" [class]=\"passThrough().timePicker?.class\" [style]=\"passThrough().timePicker?.style\">\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'hour', value: hours() }\" />\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'minute', value: minutes() }\" />\n @if (showSeconds()) {\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'second', value: seconds() }\" />\n }\n @if (hourFormat() === '12') {\n <div class=\"tx-datepicker__time-unit\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n <span class=\"tx-datepicker__time-value\">{{ isPm() ? translations().pm : translations().am }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n </div>\n }\n </div>\n }\n\n @if (showButtonBar()) {\n <div class=\"tx-datepicker__buttonbar\" [class]=\"passThrough().buttonbar?.class\" [style]=\"passThrough().buttonbar?.style\">\n @if (buttonBarTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ today: selectToday.bind(this), clear: onClearButton.bind(this) }\" />\n } @else {\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().today\"\n [disabled]=\"!isEditable()\"\n (click)=\"selectToday()\"\n ></button>\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().clear\"\n [disabled]=\"!isEditable()\"\n (click)=\"onClearButton()\"\n ></button>\n }\n </div>\n }\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n </div>\n</ng-template>\n\n<ng-template #spinner let-unit=\"unit\" let-value=\"value\">\n <div class=\"tx-datepicker__time-unit\" role=\"group\" [attr.aria-label]=\"unit === 'hour' ? translations().hour : unit === 'minute' ? translations().minute : translations().second\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().nextHour : unit === 'minute' ? translations().nextMinute : translations().nextSecond\"\n (pointerdown)=\"startRepeat($event, unit, 1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, 1)\"\n ></button>\n <span class=\"tx-datepicker__time-value\" aria-live=\"polite\">{{ formatPart(value) }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().previousHour : unit === 'minute' ? translations().previousMinute : translations().previousSecond\"\n (pointerdown)=\"startRepeat($event, unit, -1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, -1)\"\n ></button>\n </div>\n</ng-template>\n",
|
|
1966
|
+
styles: [":host{display:inline-flex;max-width:100%;vertical-align:top}:host(.tx-datepicker--fluid){display:flex;width:100%}:host(.tx-datepicker--inline){display:inline-block}.tx-datepicker__field{position:relative;display:flex;flex:1 1 auto;align-items:stretch;min-width:0}.tx-datepicker__input{flex:1 1 auto;width:1%;min-width:0}.tx-datepicker__clear,.tx-datepicker__input-icon{position:absolute;top:50%;transform:translateY(-50%)}.tx-datepicker__dropdown{display:inline-flex;flex:none;align-items:center;justify-content:center;cursor:pointer}.tx-datepicker__nav--hidden{visibility:hidden}:host([data-styled]){--_icon-room: 0px;--_clear-room: 0px}:host([data-styled]) .tx-datepicker__input{--tx-field-inset-end: calc(var(--_icon-room) + var(--_clear-room))}:host([data-styled]) .tx-datepicker__clear{display:grid;place-items:center;width:var(--tx-form-field-action-size);height:var(--tx-form-field-action-size);padding:0;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-form-field-icon-color);font-size:var(--tx-form-field-font-size);cursor:pointer;pointer-events:auto;transition:background-color var(--tx-form-field-transition-duration),color var(--tx-form-field-transition-duration)}:host([data-styled]) .tx-datepicker__clear:hover{background:var(--tx-surface-hover);color:var(--tx-form-field-color)}:host([data-styled]) .tx-datepicker__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}:host([data-styled]) .tx-datepicker__clear{right:calc(var(--_icon-room) + var(--_button-room, 0px) + var(--tx-space-2))}:host([data-styled]) .tx-datepicker__input-icon{right:var(--tx-form-field-padding-x);display:inline-flex;color:var(--tx-date-picker-input-icon-color);font-size:var(--tx-form-field-font-size);line-height:1;cursor:pointer}:host([data-styled]) .tx-datepicker__dropdown{box-sizing:border-box;width:var(--tx-date-picker-dropdown-width);padding:0;border:1px solid var(--tx-date-picker-dropdown-border-color);border-inline-start:0 none;border-start-end-radius:var(--tx-date-picker-dropdown-border-radius);border-end-end-radius:var(--tx-date-picker-dropdown-border-radius);outline-color:transparent;background:var(--tx-date-picker-dropdown-background);color:var(--tx-date-picker-dropdown-color);font-size:var(--tx-form-field-font-size);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),border-color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}:host([data-styled]) .tx-datepicker__dropdown:not(:disabled):hover{border-color:var(--tx-date-picker-dropdown-hover-border-color);background:var(--tx-date-picker-dropdown-hover-background);color:var(--tx-date-picker-dropdown-hover-color)}:host([data-styled]) .tx-datepicker__dropdown:not(:disabled):active{border-color:var(--tx-date-picker-dropdown-active-border-color);background:var(--tx-date-picker-dropdown-active-background);color:var(--tx-date-picker-dropdown-active-color)}:host([data-styled]) .tx-datepicker__dropdown:focus-visible{outline:var(--tx-date-picker-dropdown-focus-ring-width) var(--tx-date-picker-dropdown-focus-ring-style) var(--tx-date-picker-dropdown-focus-ring-color);outline-offset:var(--tx-date-picker-dropdown-focus-ring-offset);box-shadow:var(--tx-date-picker-dropdown-focus-ring-shadow)}:host([data-styled]) .tx-datepicker__dropdown:disabled{cursor:not-allowed;opacity:.6}:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown,:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown:not(:disabled):hover,:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown:not(:disabled):active{border-color:var(--tx-date-picker-dropdown-invalid-border-color)}:host([data-styled]:has(.tx-datepicker__input-icon)){--_icon-room: calc(var(--tx-form-field-padding-x) + 1em)}:host([data-styled]:has(.tx-datepicker__clear)){--_clear-room: var(--tx-form-field-action-room)}:host([data-styled].tx-datepicker--button){--_button-room: var(--tx-date-picker-dropdown-width)}:host([data-styled].tx-datepicker--button[data-size=small]){--_button-room: var(--tx-date-picker-dropdown-sm-width)}:host([data-styled].tx-datepicker--button[data-size=large]){--_button-room: var(--tx-date-picker-dropdown-lg-width)}:host([data-styled].tx-datepicker--button) .tx-datepicker__input{border-start-end-radius:0;border-end-end-radius:0}:host([data-styled][data-size=small]) .tx-datepicker__dropdown{width:var(--tx-date-picker-dropdown-sm-width);font-size:var(--tx-form-field-sm-font-size)}:host([data-styled][data-size=large]) .tx-datepicker__dropdown{width:var(--tx-date-picker-dropdown-lg-width);font-size:var(--tx-form-field-lg-font-size)}.tx-datepicker__panel{box-sizing:border-box}.tx-datepicker__calendars{display:flex}.tx-datepicker__header,.tx-datepicker__title,.tx-datepicker__time,.tx-datepicker__buttonbar{display:flex;align-items:center}.tx-datepicker__header,.tx-datepicker__buttonbar{justify-content:space-between}.tx-datepicker__time{justify-content:center}.tx-datepicker__time-unit{display:flex;flex-direction:column;align-items:center}.tx-datepicker__day-view{width:100%;border-collapse:collapse}.tx-datepicker__day-cell{cursor:pointer}.tx-datepicker__day-cell[aria-disabled=true]{cursor:default}.tx-datepicker__day{display:flex;align-items:center;justify-content:center;margin:0 auto}.tx-datepicker__row{display:flex}.tx-datepicker__month,.tx-datepicker__year{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.tx-datepicker__month{width:33.3%}.tx-datepicker__year{width:50%}.tx-datepicker__month--disabled,.tx-datepicker__year--disabled{cursor:default}.tx-datepicker__panel[data-styled]{padding:var(--tx-date-picker-panel-padding);border:1px solid var(--tx-date-picker-panel-border-color);border-radius:var(--tx-date-picker-panel-border-radius);background:var(--tx-date-picker-panel-background);box-shadow:var(--tx-date-picker-panel-shadow);color:var(--tx-date-picker-panel-color);font-family:var(--tx-font-family)}.tx-datepicker__panel[data-styled].tx-datepicker__panel--inline{display:inline-block;overflow-x:auto;box-shadow:none}.tx-datepicker__panel[data-styled].tx-datepicker__panel--touch{width:var(--tx-date-picker-touch-width);max-height:92vh;overflow:auto}.tx-datepicker__panel[data-styled].tx-datepicker__panel--disabled{opacity:.6}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar{flex:1 1 auto;padding-inline:var(--tx-date-picker-group-gap);border-inline-start:1px solid var(--tx-date-picker-group-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar:first-child{padding-inline-start:0;border-inline-start:0 none}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar:last-child{padding-inline-end:0}.tx-datepicker__panel[data-styled] .tx-datepicker__header{padding:var(--tx-date-picker-header-padding);border-bottom:1px solid var(--tx-date-picker-header-border-color);background:var(--tx-date-picker-header-background);color:var(--tx-date-picker-header-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__title{gap:var(--tx-date-picker-title-gap);font-size:var(--tx-date-picker-title-font-size);font-weight:var(--tx-date-picker-title-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year{margin:0;border:none;outline-color:transparent;background:transparent;font-family:inherit;cursor:pointer;transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:focus-visible,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:focus-visible{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:disabled,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:disabled{cursor:default}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month{padding:var(--tx-date-picker-select-month-padding);border-radius:var(--tx-date-picker-select-month-border-radius);color:var(--tx-date-picker-select-month-color);font-size:var(--tx-date-picker-select-month-font-size);font-weight:var(--tx-date-picker-select-month-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:enabled:hover{background:var(--tx-date-picker-select-month-hover-background);color:var(--tx-date-picker-select-month-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-year{padding:var(--tx-date-picker-select-year-padding);border-radius:var(--tx-date-picker-select-year-border-radius);color:var(--tx-date-picker-select-year-color);font-size:var(--tx-date-picker-select-year-font-size);font-weight:var(--tx-date-picker-select-year-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:enabled:hover{background:var(--tx-date-picker-select-year-hover-background);color:var(--tx-date-picker-select-year-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__decade{padding:var(--tx-date-picker-select-year-padding)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{margin:var(--tx-date-picker-day-view-margin);font-size:var(--tx-date-picker-date-font-size)}.tx-datepicker__panel[data-styled] .tx-datepicker__weekday{padding:var(--tx-date-picker-week-day-padding);color:var(--tx-date-picker-week-day-color);font-size:var(--tx-date-picker-week-day-font-size);font-weight:var(--tx-date-picker-week-day-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__week-number{padding:var(--tx-date-picker-date-padding);color:var(--tx-date-picker-week-number-color);font-size:var(--tx-date-picker-week-number-font-size);font-weight:var(--tx-date-picker-date-font-weight);text-align:center}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell{padding:var(--tx-date-picker-date-padding);outline:none}.tx-datepicker__panel[data-styled] .tx-datepicker__day{box-sizing:border-box;width:var(--tx-date-picker-date-width);height:var(--tx-date-picker-date-height);border:1px solid transparent;border-radius:var(--tx-date-picker-date-border-radius);color:var(--tx-date-picker-date-color);font-size:var(--tx-date-picker-date-font-size);font-weight:var(--tx-date-picker-date-font-weight);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),box-shadow var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day{background:var(--tx-date-picker-today-background);color:var(--tx-date-picker-today-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell:not([aria-disabled=true]):hover .tx-datepicker__day:not(.tx-datepicker__day--selected,.tx-datepicker__day--preview){background:var(--tx-date-picker-date-hover-background);color:var(--tx-date-picker-date-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell:focus-visible .tx-datepicker__day{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset);box-shadow:var(--tx-date-picker-date-focus-ring-shadow)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--range,.tx-datepicker__panel[data-styled] .tx-datepicker__day--preview,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--range,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--preview{background:var(--tx-date-picker-date-range-selected-background);color:var(--tx-date-picker-date-range-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--selected,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--selected{background:var(--tx-date-picker-date-selected-background);color:var(--tx-date-picker-date-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--disabled{opacity:var(--tx-date-picker-date-disabled-opacity)}.tx-datepicker__panel[data-styled] .tx-datepicker__month-view{margin:var(--tx-date-picker-month-view-margin)}.tx-datepicker__panel[data-styled] .tx-datepicker__year-view{margin:var(--tx-date-picker-year-view-margin)}.tx-datepicker__panel[data-styled] .tx-datepicker__month,.tx-datepicker__panel[data-styled] .tx-datepicker__year{box-sizing:border-box;outline-color:transparent;color:var(--tx-date-picker-date-color);font-size:var(--tx-date-picker-date-font-size);font-weight:var(--tx-date-picker-date-font-weight);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__month:not(.tx-datepicker__month--disabled,.tx-datepicker__year--disabled,.tx-datepicker__month--selected,.tx-datepicker__year--selected):hover,.tx-datepicker__panel[data-styled] .tx-datepicker__year:not(.tx-datepicker__month--disabled,.tx-datepicker__year--disabled,.tx-datepicker__month--selected,.tx-datepicker__year--selected):hover{background:var(--tx-date-picker-date-hover-background);color:var(--tx-date-picker-date-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__month:focus-visible,.tx-datepicker__panel[data-styled] .tx-datepicker__year:focus-visible{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset)}.tx-datepicker__panel[data-styled] .tx-datepicker__month{padding:var(--tx-date-picker-month-padding);border-radius:var(--tx-date-picker-month-border-radius)}.tx-datepicker__panel[data-styled] .tx-datepicker__year{padding:var(--tx-date-picker-year-padding);border-radius:var(--tx-date-picker-year-border-radius)}.tx-datepicker__panel[data-styled] .tx-datepicker__month--selected,.tx-datepicker__panel[data-styled] .tx-datepicker__year--selected{background:var(--tx-date-picker-date-selected-background);color:var(--tx-date-picker-date-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__month--disabled,.tx-datepicker__panel[data-styled] .tx-datepicker__year--disabled{opacity:var(--tx-date-picker-date-disabled-opacity)}.tx-datepicker__panel[data-styled] .tx-datepicker__time{gap:var(--tx-date-picker-time-picker-gap);padding:0;color:var(--tx-date-picker-time-picker-color);font-size:var(--tx-date-picker-time-picker-font-size);font-weight:var(--tx-date-picker-time-picker-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendars+.tx-datepicker__time{margin-top:var(--tx-date-picker-time-picker-gap);padding:var(--tx-date-picker-time-picker-padding);border-top:1px solid var(--tx-date-picker-time-picker-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__time-unit{gap:var(--tx-date-picker-time-picker-button-gap)}.tx-datepicker__panel[data-styled] .tx-datepicker__time-value{font-variant-numeric:tabular-nums}.tx-datepicker__panel[data-styled] .tx-datepicker__buttonbar{padding:var(--tx-date-picker-buttonbar-padding);border-top:1px solid var(--tx-date-picker-buttonbar-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendars+.tx-datepicker__buttonbar,.tx-datepicker__panel[data-styled] .tx-datepicker__time+.tx-datepicker__buttonbar{margin-top:var(--tx-date-picker-time-picker-gap)}.tx-datepicker__panel[data-styled] .tx-datepicker__month-view,.tx-datepicker__panel[data-styled] .tx-datepicker__year-view,.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{animation:tx-datepicker-view var(--tx-date-picker-transition-duration) ease-out}@keyframes tx-datepicker-view{0%{opacity:0}}@media(prefers-reduced-motion:reduce){.tx-datepicker__panel[data-styled] .tx-datepicker__month-view,.tx-datepicker__panel[data-styled] .tx-datepicker__year-view,.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{animation:none}}\n"],
|
|
1965
1967
|
dependencies: [
|
|
1966
1968
|
{
|
|
1967
1969
|
kind: "directive",
|
|
@@ -2130,8 +2132,8 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
2130
2132
|
"[class.tx-datepicker--button]": "showIcon() && iconDisplay() === \"button\" && !inline()"
|
|
2131
2133
|
},
|
|
2132
2134
|
viewProviders: [provideTxIconDefaults(DATEPICKER_ICON_DEFAULTS)],
|
|
2133
|
-
template: "@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n} @else {\n <div #field #origin=\"cdkOverlayOrigin\" cdkOverlayOrigin class=\"tx-datepicker__field\">\n <input\n #input\n txInput\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"dialog\"\n class=\"tx-datepicker__input\"\n [class]=\"passThrough().input?.class\"\n [style]=\"passThrough().input?.style\"\n [id]=\"resolvedInputId()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [fluid]=\"true\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly() || readonlyInput()\"\n [attr.data-picker]=\"readonlyInput() && !readonly() ? '' : null\"\n [required]=\"required()\"\n [value]=\"inputText()\"\n [attr.inputmode]=\"readonlyInput() || touchUI() ? 'none' : null\"\n [attr.placeholder]=\"placeholder() ?? null\"\n [attr.name]=\"name() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n (click)=\"onInputClick()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n />\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-datepicker__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"onClearIcon()\"\n >\n <tx-icon name=\"times\" />\n </button>\n }\n @if (showIcon() && iconDisplay() === 'input') {\n <span\n class=\"tx-datepicker__input-icon\"\n aria-hidden=\"true\"\n [class]=\"passThrough().inputIcon?.class\"\n [style]=\"passThrough().inputIcon?.style\"\n (click)=\"toggle(false)\"\n >\n @if (inputIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: toggle.bind(this, false) }\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </span>\n }\n @if (showIcon() && iconDisplay() === 'button') {\n <button\n type=\"button\"\n class=\"tx-datepicker__dropdown\"\n aria-haspopup=\"dialog\"\n tabindex=\"-1\"\n [class]=\"passThrough().dropdown?.class\"\n [style]=\"passThrough().dropdown?.style\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"iconAriaLabel() ?? translations().chooseDate\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (click)=\"toggle(true)\"\n >\n @if (triggerIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </button>\n }\n </div>\n\n <ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted() && !touchUI()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayMinWidth]=\"panelMinWidth()\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (attach)=\"onAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (detach)=\"close(false)\"\n >\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n </ng-template>\n}\n\n<ng-template #panelTemplate>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its controls -->\n <div\n #panel\n class=\"tx-datepicker__panel\"\n [cdkTrapFocus]=\"!inline()\"\n [attr.id]=\"panelId\"\n [attr.role]=\"inline() ? 'group' : 'dialog'\"\n [attr.aria-modal]=\"inline() ? null : 'true'\"\n [attr.aria-label]=\"ariaLabel() ?? translations().chooseDate\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-view]=\"currentView()\"\n [class.tx-datepicker__panel--inline]=\"inline()\"\n [class.tx-datepicker__panel--touch]=\"touchUI() && !inline()\"\n [class.tx-datepicker__panel--time-only]=\"timeOnly()\"\n [class.tx-datepicker__panel--disabled]=\"isDisabled()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n [style.min-width.px]=\"inline() ? null : panelMinWidth()\"\n (keydown)=\"onPanelKeydown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n @if (!timeOnly()) {\n <div class=\"tx-datepicker__calendars\">\n @for (month of currentView() === 'date' ? months() : [months()[0]]; track month.year * 12 + month.month; let first = $first; let last = $last) {\n <div class=\"tx-datepicker__calendar\" [class]=\"passThrough().calendar?.class\" [style]=\"passThrough().calendar?.style\">\n <div class=\"tx-datepicker__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-left\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__previous\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!first\"\n [class]=\"passThrough().previous?.class\"\n [style]=\"passThrough().previous?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"first ? null : 'true'\"\n [attr.tabindex]=\"first ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().previousDecade : currentView() === 'month' ? translations().previousYear : translations().previousMonth\"\n (click)=\"previous()\"\n ></button>\n <div class=\"tx-datepicker__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">\n @switch (currentView()) {\n @case ('date') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-month\"\n [class]=\"passThrough().selectMonth?.class\"\n [style]=\"passThrough().selectMonth?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseMonth + ', ' + names().monthNames[month.month]\"\n (click)=\"showMonthView()\"\n >\n {{ names().monthNames[month.month] }}\n </button>\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + month.year\"\n (click)=\"showYearView()\"\n >\n {{ month.year }}\n </button>\n }\n @case ('month') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled() || view() === 'year'\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + viewYear()\"\n (click)=\"showYearView()\"\n >\n {{ viewYear() }}\n </button>\n }\n @case ('year') {\n <span class=\"tx-datepicker__decade\">\n @if (decadeTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: decade() }\" />\n } @else {\n {{ decade()[0] }} – {{ decade()[9] }}\n }\n </span>\n }\n }\n </div>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-right\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__next\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!last\"\n [class]=\"passThrough().next?.class\"\n [style]=\"passThrough().next?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"last ? null : 'true'\"\n [attr.tabindex]=\"last ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().nextDecade : currentView() === 'month' ? translations().nextYear : translations().nextMonth\"\n (click)=\"next()\"\n ></button>\n </div>\n\n @switch (currentView()) {\n @case ('date') {\n <table\n role=\"grid\"\n class=\"tx-datepicker__day-view\"\n (mouseleave)=\"onGridLeave()\"\n [attr.aria-label]=\"names().monthNames[month.month] + ' ' + month.year\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n >\n <thead>\n <tr>\n @if (showWeek()) {\n <th scope=\"col\" class=\"tx-datepicker__weekday tx-datepicker__weekheader\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ translations().weekHeader }}\n </th>\n }\n @for (weekday of weekdays(); track weekday.long) {\n <th scope=\"col\" class=\"tx-datepicker__weekday\" [attr.abbr]=\"weekday.long\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ weekday.short }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (week of month.weeks; track week.number + '-' + $index) {\n <tr>\n @if (showWeek()) {\n <th scope=\"row\" class=\"tx-datepicker__week-number\" [class]=\"passThrough().weekNumber?.class\" [style]=\"passThrough().weekNumber?.style\">\n {{ week.number }}\n </th>\n }\n @for (day of week.days; track dayKey(day.date)) {\n @if (day.otherMonth && !showOtherMonths()) {\n <td role=\"gridcell\" class=\"tx-datepicker__day-cell tx-datepicker__day-cell--empty\"></td>\n } @else {\n <td\n role=\"gridcell\"\n class=\"tx-datepicker__day-cell\"\n [class.tx-datepicker__day-cell--today]=\"day.today\"\n [class.tx-datepicker__day-cell--other]=\"day.otherMonth\"\n [attr.data-date]=\"dayKey(day.date)\"\n [attr.data-active]=\"isFocusedDay(day) || null\"\n [attr.tabindex]=\"isFocusedDay(day) ? 0 : -1\"\n [attr.aria-label]=\"dayLabel(day.date)\"\n [attr.aria-selected]=\"isSelected(day.date) || isInRange(day.date)\"\n [attr.aria-disabled]=\"!day.selectable || (day.otherMonth && !selectOtherMonths()) || null\"\n [attr.aria-current]=\"day.today ? 'date' : null\"\n (click)=\"onDayClick(day)\"\n (mouseenter)=\"onDayEnter(day)\"\n (keydown)=\"onDayKeydown($event, day)\"\n >\n <span\n class=\"tx-datepicker__day\"\n [class.tx-datepicker__day--selected]=\"isSelected(day.date)\"\n [class.tx-datepicker__day--range]=\"isInRange(day.date)\"\n [class.tx-datepicker__day--preview]=\"isPreview(day.date)\"\n [class.tx-datepicker__day--disabled]=\"!day.selectable\"\n [class]=\"passThrough().day?.class\"\n [style]=\"passThrough().day?.style\"\n >\n @if (dateTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: day, selected: isSelected(day.date), inRange: isInRange(day.date) }\"\n />\n } @else {\n {{ day.day }}\n }\n </span>\n </td>\n }\n }\n </tr>\n }\n </tbody>\n </table>\n }\n @case ('month') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__month-view\"\n [attr.aria-label]=\"translations().chooseMonth\"\n [class]=\"passThrough().monthView?.class\"\n [style]=\"passThrough().monthView?.style\"\n >\n @for (row of [0, 1, 2, 3]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1, 2]; track column) {\n @let monthIndex = row * 3 + column;\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__month\"\n [class.tx-datepicker__month--selected]=\"isMonthSelected(monthIndex)\"\n [class.tx-datepicker__month--disabled]=\"!monthSelectable(monthIndex)\"\n [class]=\"passThrough().month?.class\"\n [style]=\"passThrough().month?.style\"\n [attr.data-active]=\"focusedMonth() === monthIndex || null\"\n [attr.tabindex]=\"focusedMonth() === monthIndex ? 0 : -1\"\n [attr.aria-label]=\"names().monthNames[monthIndex] + ' ' + viewYear()\"\n [attr.aria-selected]=\"isMonthSelected(monthIndex)\"\n [attr.aria-disabled]=\"!monthSelectable(monthIndex) || null\"\n (click)=\"pickMonth(monthIndex)\"\n (keydown)=\"onMonthKeydown($event, monthIndex)\"\n >{{ names().monthNamesShort[monthIndex] }}</span\n >\n }\n </div>\n }\n </div>\n }\n @case ('year') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__year-view\"\n [attr.aria-label]=\"translations().chooseYear\"\n [class]=\"passThrough().yearView?.class\"\n [style]=\"passThrough().yearView?.style\"\n >\n @for (row of [0, 1, 2, 3, 4]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1]; track column) {\n @let year = decade()[row * 2 + column];\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__year\"\n [class.tx-datepicker__year--selected]=\"isYearSelected(year)\"\n [class.tx-datepicker__year--disabled]=\"!yearSelectable(year)\"\n [class]=\"passThrough().year?.class\"\n [style]=\"passThrough().year?.style\"\n [attr.data-active]=\"focusedYear() === year || null\"\n [attr.tabindex]=\"focusedYear() === year ? 0 : -1\"\n [attr.aria-selected]=\"isYearSelected(year)\"\n [attr.aria-disabled]=\"!yearSelectable(year) || null\"\n (click)=\"pickYear(year)\"\n (keydown)=\"onYearKeydown($event, year)\"\n >{{ year }}</span\n >\n }\n </div>\n }\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (hasTime() && currentView() === 'date') {\n <div class=\"tx-datepicker__time\" [class]=\"passThrough().timePicker?.class\" [style]=\"passThrough().timePicker?.style\">\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'hour', value: hours() }\" />\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'minute', value: minutes() }\" />\n @if (showSeconds()) {\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'second', value: seconds() }\" />\n }\n @if (hourFormat() === '12') {\n <div class=\"tx-datepicker__time-unit\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n <span class=\"tx-datepicker__time-value\">{{ isPm() ? translations().pm : translations().am }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n </div>\n }\n </div>\n }\n\n @if (showButtonBar()) {\n <div class=\"tx-datepicker__buttonbar\" [class]=\"passThrough().buttonbar?.class\" [style]=\"passThrough().buttonbar?.style\">\n @if (buttonBarTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ today: selectToday.bind(this), clear: onClearButton.bind(this) }\" />\n } @else {\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().today\"\n [disabled]=\"!isEditable()\"\n (click)=\"selectToday()\"\n ></button>\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().clear\"\n [disabled]=\"!isEditable()\"\n (click)=\"onClearButton()\"\n ></button>\n }\n </div>\n }\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n </div>\n</ng-template>\n\n<ng-template #spinner let-unit=\"unit\" let-value=\"value\">\n <div class=\"tx-datepicker__time-unit\" role=\"group\" [attr.aria-label]=\"unit === 'hour' ? translations().hour : unit === 'minute' ? translations().minute : translations().second\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().nextHour : unit === 'minute' ? translations().nextMinute : translations().nextSecond\"\n (pointerdown)=\"startRepeat($event, unit, 1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, 1)\"\n ></button>\n <span class=\"tx-datepicker__time-value\" aria-live=\"polite\">{{ formatPart(value) }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().previousHour : unit === 'minute' ? translations().previousMinute : translations().previousSecond\"\n (pointerdown)=\"startRepeat($event, unit, -1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, -1)\"\n ></button>\n </div>\n</ng-template>\n",
|
|
2134
|
-
styles: [":host{display:inline-flex;max-width:100%;vertical-align:top}:host(.tx-datepicker--fluid){display:flex;width:100%}:host(.tx-datepicker--inline){display:inline-block}.tx-datepicker__field{position:relative;display:flex;flex:1 1 auto;align-items:stretch;min-width:0}.tx-datepicker__input{flex:1 1 auto;width:1%;min-width:0}.tx-datepicker__clear,.tx-datepicker__input-icon{position:absolute;top:50%;transform:translateY(-50%)}.tx-datepicker__dropdown{display:inline-flex;flex:none;align-items:center;justify-content:center;cursor:pointer}.tx-datepicker__nav--hidden{visibility:hidden}:host([data-styled]){--_icon-room: 0px;--_clear-room: 0px}:host([data-styled]) .tx-datepicker__input{--tx-field-inset-end: calc(var(--_icon-room) + var(--_clear-room))}:host([data-styled]) .tx-datepicker__clear{display:grid;place-items:center;width:24px;height:24px;padding:0;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-form-field-icon-color);font-size:var(--tx-form-field-font-size);cursor:pointer;pointer-events:auto;transition:background-color var(--tx-form-field-transition-duration),color var(--tx-form-field-transition-duration)}:host([data-styled]) .tx-datepicker__clear:hover{background:var(--tx-surface-hover);color:var(--tx-form-field-color)}:host([data-styled]) .tx-datepicker__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}:host([data-styled]) .tx-datepicker__clear{right:calc(var(--_icon-room) + var(--_button-room, 0px) + 8px)}:host([data-styled]) .tx-datepicker__input-icon{right:var(--tx-form-field-padding-x);display:inline-flex;color:var(--tx-date-picker-input-icon-color);font-size:var(--tx-form-field-font-size);line-height:1;cursor:pointer}:host([data-styled]) .tx-datepicker__dropdown{box-sizing:border-box;width:var(--tx-date-picker-dropdown-width);padding:0;border:1px solid var(--tx-date-picker-dropdown-border-color);border-inline-start:0 none;border-start-end-radius:var(--tx-date-picker-dropdown-border-radius);border-end-end-radius:var(--tx-date-picker-dropdown-border-radius);outline-color:transparent;background:var(--tx-date-picker-dropdown-background);color:var(--tx-date-picker-dropdown-color);font-size:var(--tx-form-field-font-size);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),border-color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}:host([data-styled]) .tx-datepicker__dropdown:not(:disabled):hover{border-color:var(--tx-date-picker-dropdown-hover-border-color);background:var(--tx-date-picker-dropdown-hover-background);color:var(--tx-date-picker-dropdown-hover-color)}:host([data-styled]) .tx-datepicker__dropdown:not(:disabled):active{border-color:var(--tx-date-picker-dropdown-active-border-color);background:var(--tx-date-picker-dropdown-active-background);color:var(--tx-date-picker-dropdown-active-color)}:host([data-styled]) .tx-datepicker__dropdown:focus-visible{outline:var(--tx-date-picker-dropdown-focus-ring-width) var(--tx-date-picker-dropdown-focus-ring-style) var(--tx-date-picker-dropdown-focus-ring-color);outline-offset:var(--tx-date-picker-dropdown-focus-ring-offset);box-shadow:var(--tx-date-picker-dropdown-focus-ring-shadow)}:host([data-styled]) .tx-datepicker__dropdown:disabled{cursor:not-allowed;opacity:.6}:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown,:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown:not(:disabled):hover,:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown:not(:disabled):active{border-color:var(--tx-date-picker-dropdown-invalid-border-color)}:host([data-styled]:has(.tx-datepicker__input-icon)){--_icon-room: calc(var(--tx-form-field-padding-x) + 1em)}:host([data-styled]:has(.tx-datepicker__clear)){--_clear-room: 28px}:host([data-styled].tx-datepicker--button){--_button-room: var(--tx-date-picker-dropdown-width)}:host([data-styled].tx-datepicker--button[data-size=small]){--_button-room: var(--tx-date-picker-dropdown-sm-width)}:host([data-styled].tx-datepicker--button[data-size=large]){--_button-room: var(--tx-date-picker-dropdown-lg-width)}:host([data-styled].tx-datepicker--button) .tx-datepicker__input{border-start-end-radius:0;border-end-end-radius:0}:host([data-styled][data-size=small]) .tx-datepicker__dropdown{width:var(--tx-date-picker-dropdown-sm-width);font-size:var(--tx-form-field-sm-font-size)}:host([data-styled][data-size=large]) .tx-datepicker__dropdown{width:var(--tx-date-picker-dropdown-lg-width);font-size:var(--tx-form-field-lg-font-size)}.tx-datepicker__panel{box-sizing:border-box}.tx-datepicker__calendars{display:flex}.tx-datepicker__header,.tx-datepicker__title,.tx-datepicker__time,.tx-datepicker__buttonbar{display:flex;align-items:center}.tx-datepicker__header,.tx-datepicker__buttonbar{justify-content:space-between}.tx-datepicker__time{justify-content:center}.tx-datepicker__time-unit{display:flex;flex-direction:column;align-items:center}.tx-datepicker__day-view{width:100%;border-collapse:collapse}.tx-datepicker__day-cell{cursor:pointer}.tx-datepicker__day-cell[aria-disabled=true]{cursor:default}.tx-datepicker__day{display:flex;align-items:center;justify-content:center;margin:0 auto}.tx-datepicker__row{display:flex}.tx-datepicker__month,.tx-datepicker__year{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.tx-datepicker__month{width:33.3%}.tx-datepicker__year{width:50%}.tx-datepicker__month--disabled,.tx-datepicker__year--disabled{cursor:default}.tx-datepicker__panel[data-styled]{padding:var(--tx-date-picker-panel-padding);border:1px solid var(--tx-date-picker-panel-border-color);border-radius:var(--tx-date-picker-panel-border-radius);background:var(--tx-date-picker-panel-background);box-shadow:var(--tx-date-picker-panel-shadow);color:var(--tx-date-picker-panel-color);font-family:var(--tx-font-family)}.tx-datepicker__panel[data-styled].tx-datepicker__panel--inline{display:inline-block;overflow-x:auto;box-shadow:none}.tx-datepicker__panel[data-styled].tx-datepicker__panel--touch{width:var(--tx-date-picker-touch-width);max-height:92vh;overflow:auto}.tx-datepicker__panel[data-styled].tx-datepicker__panel--disabled{opacity:.6}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar{flex:1 1 auto;padding-inline:var(--tx-date-picker-group-gap);border-inline-start:1px solid var(--tx-date-picker-group-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar:first-child{padding-inline-start:0;border-inline-start:0 none}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar:last-child{padding-inline-end:0}.tx-datepicker__panel[data-styled] .tx-datepicker__header{padding:var(--tx-date-picker-header-padding);border-bottom:1px solid var(--tx-date-picker-header-border-color);background:var(--tx-date-picker-header-background);color:var(--tx-date-picker-header-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__title{gap:var(--tx-date-picker-title-gap);font-size:var(--tx-date-picker-title-font-size);font-weight:var(--tx-date-picker-title-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year{margin:0;border:none;outline-color:transparent;background:transparent;font-family:inherit;cursor:pointer;transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:focus-visible,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:focus-visible{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:disabled,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:disabled{cursor:default}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month{padding:var(--tx-date-picker-select-month-padding);border-radius:var(--tx-date-picker-select-month-border-radius);color:var(--tx-date-picker-select-month-color);font-size:var(--tx-date-picker-select-month-font-size);font-weight:var(--tx-date-picker-select-month-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:enabled:hover{background:var(--tx-date-picker-select-month-hover-background);color:var(--tx-date-picker-select-month-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-year{padding:var(--tx-date-picker-select-year-padding);border-radius:var(--tx-date-picker-select-year-border-radius);color:var(--tx-date-picker-select-year-color);font-size:var(--tx-date-picker-select-year-font-size);font-weight:var(--tx-date-picker-select-year-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:enabled:hover{background:var(--tx-date-picker-select-year-hover-background);color:var(--tx-date-picker-select-year-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__decade{padding:var(--tx-date-picker-select-year-padding)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{margin:var(--tx-date-picker-day-view-margin);font-size:var(--tx-date-picker-date-font-size)}.tx-datepicker__panel[data-styled] .tx-datepicker__weekday{padding:var(--tx-date-picker-week-day-padding);color:var(--tx-date-picker-week-day-color);font-size:var(--tx-date-picker-week-day-font-size);font-weight:var(--tx-date-picker-week-day-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__week-number{padding:var(--tx-date-picker-date-padding);color:var(--tx-date-picker-week-number-color);font-size:var(--tx-date-picker-week-number-font-size);font-weight:var(--tx-date-picker-date-font-weight);text-align:center}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell{padding:var(--tx-date-picker-date-padding);outline:none}.tx-datepicker__panel[data-styled] .tx-datepicker__day{box-sizing:border-box;width:var(--tx-date-picker-date-width);height:var(--tx-date-picker-date-height);border:1px solid transparent;border-radius:var(--tx-date-picker-date-border-radius);color:var(--tx-date-picker-date-color);font-size:var(--tx-date-picker-date-font-size);font-weight:var(--tx-date-picker-date-font-weight);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),box-shadow var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day{background:var(--tx-date-picker-today-background);color:var(--tx-date-picker-today-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell:not([aria-disabled=true]):hover .tx-datepicker__day:not(.tx-datepicker__day--selected,.tx-datepicker__day--preview){background:var(--tx-date-picker-date-hover-background);color:var(--tx-date-picker-date-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell:focus-visible .tx-datepicker__day{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset);box-shadow:var(--tx-date-picker-date-focus-ring-shadow)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--range,.tx-datepicker__panel[data-styled] .tx-datepicker__day--preview,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--range,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--preview{background:var(--tx-date-picker-date-range-selected-background);color:var(--tx-date-picker-date-range-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--selected,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--selected{background:var(--tx-date-picker-date-selected-background);color:var(--tx-date-picker-date-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--disabled{opacity:var(--tx-date-picker-date-disabled-opacity)}.tx-datepicker__panel[data-styled] .tx-datepicker__month-view{margin:var(--tx-date-picker-month-view-margin)}.tx-datepicker__panel[data-styled] .tx-datepicker__year-view{margin:var(--tx-date-picker-year-view-margin)}.tx-datepicker__panel[data-styled] .tx-datepicker__month,.tx-datepicker__panel[data-styled] .tx-datepicker__year{box-sizing:border-box;outline-color:transparent;color:var(--tx-date-picker-date-color);font-size:var(--tx-date-picker-date-font-size);font-weight:var(--tx-date-picker-date-font-weight);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__month:not(.tx-datepicker__month--disabled,.tx-datepicker__year--disabled,.tx-datepicker__month--selected,.tx-datepicker__year--selected):hover,.tx-datepicker__panel[data-styled] .tx-datepicker__year:not(.tx-datepicker__month--disabled,.tx-datepicker__year--disabled,.tx-datepicker__month--selected,.tx-datepicker__year--selected):hover{background:var(--tx-date-picker-date-hover-background);color:var(--tx-date-picker-date-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__month:focus-visible,.tx-datepicker__panel[data-styled] .tx-datepicker__year:focus-visible{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset)}.tx-datepicker__panel[data-styled] .tx-datepicker__month{padding:var(--tx-date-picker-month-padding);border-radius:var(--tx-date-picker-month-border-radius)}.tx-datepicker__panel[data-styled] .tx-datepicker__year{padding:var(--tx-date-picker-year-padding);border-radius:var(--tx-date-picker-year-border-radius)}.tx-datepicker__panel[data-styled] .tx-datepicker__month--selected,.tx-datepicker__panel[data-styled] .tx-datepicker__year--selected{background:var(--tx-date-picker-date-selected-background);color:var(--tx-date-picker-date-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__month--disabled,.tx-datepicker__panel[data-styled] .tx-datepicker__year--disabled{opacity:var(--tx-date-picker-date-disabled-opacity)}.tx-datepicker__panel[data-styled] .tx-datepicker__time{gap:var(--tx-date-picker-time-picker-gap);padding:0;color:var(--tx-date-picker-time-picker-color);font-size:var(--tx-date-picker-time-picker-font-size);font-weight:var(--tx-date-picker-time-picker-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendars+.tx-datepicker__time{margin-top:var(--tx-date-picker-time-picker-gap);padding:var(--tx-date-picker-time-picker-padding);border-top:1px solid var(--tx-date-picker-time-picker-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__time-unit{gap:var(--tx-date-picker-time-picker-button-gap)}.tx-datepicker__panel[data-styled] .tx-datepicker__time-value{font-variant-numeric:tabular-nums}.tx-datepicker__panel[data-styled] .tx-datepicker__buttonbar{padding:var(--tx-date-picker-buttonbar-padding);border-top:1px solid var(--tx-date-picker-buttonbar-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendars+.tx-datepicker__buttonbar,.tx-datepicker__panel[data-styled] .tx-datepicker__time+.tx-datepicker__buttonbar{margin-top:var(--tx-date-picker-time-picker-gap)}.tx-datepicker__panel[data-styled] .tx-datepicker__month-view,.tx-datepicker__panel[data-styled] .tx-datepicker__year-view,.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{animation:tx-datepicker-view var(--tx-date-picker-transition-duration) ease-out}@keyframes tx-datepicker-view{0%{opacity:0}}@media(prefers-reduced-motion:reduce){.tx-datepicker__panel[data-styled] .tx-datepicker__month-view,.tx-datepicker__panel[data-styled] .tx-datepicker__year-view,.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{animation:none}}\n"]
|
|
2135
|
+
template: "@if (inline()) {\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n} @else {\n <div #field #origin=\"cdkOverlayOrigin\" cdkOverlayOrigin class=\"tx-datepicker__field\">\n <input\n #input\n txInput\n type=\"text\"\n role=\"combobox\"\n autocomplete=\"off\"\n aria-autocomplete=\"none\"\n aria-haspopup=\"dialog\"\n class=\"tx-datepicker__input\"\n [class]=\"passThrough().input?.class\"\n [style]=\"passThrough().input?.style\"\n [id]=\"resolvedInputId()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [fluid]=\"true\"\n [invalid]=\"isInvalid()\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly() || readonlyInput()\"\n [attr.data-picker]=\"readonlyInput() && !readonly() ? '' : null\"\n [required]=\"required()\"\n [value]=\"inputText()\"\n [attr.inputmode]=\"readonlyInput() || touchUI() ? 'none' : null\"\n [attr.placeholder]=\"placeholder() ?? null\"\n [attr.name]=\"name() ?? null\"\n [attr.aria-label]=\"ariaLabel() ?? null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() ?? null\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (focus)=\"onInputFocus($event)\"\n (blur)=\"onInputBlur($event)\"\n (click)=\"onInputClick()\"\n (input)=\"onInput($event)\"\n (keydown)=\"onInputKeydown($event)\"\n />\n @if (canClear()) {\n <button\n type=\"button\"\n class=\"tx-datepicker__clear\"\n [class]=\"passThrough().clear?.class\"\n [style]=\"passThrough().clear?.style\"\n [attr.aria-label]=\"translations().clear\"\n (click)=\"onClearIcon()\"\n >\n <tx-icon name=\"times\" />\n </button>\n }\n @if (showIcon() && iconDisplay() === 'input') {\n <span\n class=\"tx-datepicker__input-icon\"\n aria-hidden=\"true\"\n [class]=\"passThrough().inputIcon?.class\"\n [style]=\"passThrough().inputIcon?.style\"\n (click)=\"toggle(false)\"\n >\n @if (inputIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: toggle.bind(this, false) }\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </span>\n }\n @if (showIcon() && iconDisplay() === 'button') {\n <button\n type=\"button\"\n class=\"tx-datepicker__dropdown\"\n aria-haspopup=\"dialog\"\n tabindex=\"-1\"\n [class]=\"passThrough().dropdown?.class\"\n [style]=\"passThrough().dropdown?.style\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"iconAriaLabel() ?? translations().chooseDate\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"isOpen() ? panelId : null\"\n (click)=\"toggle(true)\"\n >\n @if (triggerIconTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n } @else {\n <tx-icon [name]=\"icon()\" />\n }\n </button>\n }\n </div>\n\n <ng-template\n cdkConnectedOverlay\n txOverlayAnchor\n [cdkConnectedOverlayOrigin]=\"origin\"\n [cdkConnectedOverlayOpen]=\"isPanelMounted() && !touchUI()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n [cdkConnectedOverlayScrollStrategy]=\"scrollStrategy\"\n [cdkConnectedOverlayDisableClose]=\"true\"\n (attach)=\"onAttach()\"\n (positionChange)=\"onPositionChange($event)\"\n (overlayOutsideClick)=\"onOutsideClick($event)\"\n (detach)=\"close(false)\"\n >\n <ng-container [ngTemplateOutlet]=\"panelTemplate\" />\n </ng-template>\n}\n\n<ng-template #panelTemplate>\n <!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -- the panel only listens to keys and focus that bubble from its controls -->\n <div\n #panel\n class=\"tx-datepicker__panel\"\n [cdkTrapFocus]=\"!inline()\"\n [attr.id]=\"panelId\"\n [attr.role]=\"inline() ? 'group' : 'dialog'\"\n [attr.aria-modal]=\"inline() ? null : 'true'\"\n [attr.aria-label]=\"ariaLabel() ?? translations().chooseDate\"\n [attr.data-styled]=\"!isUnstyled() || null\"\n [attr.data-view]=\"currentView()\"\n [class.tx-datepicker__panel--inline]=\"inline()\"\n [class.tx-datepicker__panel--touch]=\"touchUI() && !inline()\"\n [class.tx-datepicker__panel--time-only]=\"timeOnly()\"\n [class.tx-datepicker__panel--disabled]=\"isDisabled()\"\n [class]=\"passThrough().panel?.class\"\n [style]=\"panelStyle()\"\n (keydown)=\"onPanelKeydown($event)\"\n (focusout)=\"onPanelFocusOut($event)\"\n >\n @if (headerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n @if (!timeOnly()) {\n <div class=\"tx-datepicker__calendars\">\n @for (month of currentView() === 'date' ? months() : [months()[0]]; track $index; let first = $first; let last = $last) {\n <div class=\"tx-datepicker__calendar\" [class]=\"passThrough().calendar?.class\" [style]=\"passThrough().calendar?.style\">\n <div class=\"tx-datepicker__header\" [class]=\"passThrough().header?.class\" [style]=\"passThrough().header?.style\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-left\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__previous\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!first\"\n [class]=\"passThrough().previous?.class\"\n [style]=\"passThrough().previous?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"first ? null : 'true'\"\n [attr.tabindex]=\"first ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().previousDecade : currentView() === 'month' ? translations().previousYear : translations().previousMonth\"\n (click)=\"previous()\"\n ></button>\n <div class=\"tx-datepicker__title\" [class]=\"passThrough().title?.class\" [style]=\"passThrough().title?.style\">\n @switch (currentView()) {\n @case ('date') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-month\"\n [class]=\"passThrough().selectMonth?.class\"\n [style]=\"passThrough().selectMonth?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseMonth + ', ' + names().monthNames[month.month]\"\n (click)=\"showMonthView()\"\n >\n {{ names().monthNames[month.month] }}\n </button>\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + month.year\"\n (click)=\"showYearView()\"\n >\n {{ month.year }}\n </button>\n }\n @case ('month') {\n <button\n type=\"button\"\n class=\"tx-datepicker__select-year\"\n [class]=\"passThrough().selectYear?.class\"\n [style]=\"passThrough().selectYear?.style\"\n [disabled]=\"isDisabled() || view() === 'year'\"\n [attr.aria-label]=\"translations().chooseYear + ', ' + viewYear()\"\n (click)=\"showYearView()\"\n >\n {{ viewYear() }}\n </button>\n }\n @case ('year') {\n <span class=\"tx-datepicker__decade\">\n @if (decadeTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ $implicit: decade() }\" />\n } @else {\n {{ decade()[0] }} – {{ decade()[9] }}\n }\n </span>\n }\n }\n </div>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-right\"\n severity=\"secondary\"\n variant=\"text\"\n class=\"tx-datepicker__next\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [class.tx-datepicker__nav--hidden]=\"!last\"\n [class]=\"passThrough().next?.class\"\n [style]=\"passThrough().next?.style\"\n [disabled]=\"isDisabled()\"\n [attr.aria-hidden]=\"last ? null : 'true'\"\n [attr.tabindex]=\"last ? null : -1\"\n [attr.aria-label]=\"currentView() === 'year' ? translations().nextDecade : currentView() === 'month' ? translations().nextYear : translations().nextMonth\"\n (click)=\"next()\"\n ></button>\n </div>\n\n @switch (currentView()) {\n @case ('date') {\n <table\n role=\"grid\"\n class=\"tx-datepicker__day-view\"\n (mouseleave)=\"onGridLeave()\"\n [attr.aria-label]=\"names().monthNames[month.month] + ' ' + month.year\"\n [class]=\"passThrough().table?.class\"\n [style]=\"passThrough().table?.style\"\n >\n <thead>\n <tr>\n @if (showWeek()) {\n <th scope=\"col\" class=\"tx-datepicker__weekday tx-datepicker__weekheader\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ translations().weekHeader }}\n </th>\n }\n @for (weekday of weekdays(); track weekday.long) {\n <th scope=\"col\" class=\"tx-datepicker__weekday\" [attr.abbr]=\"weekday.long\" [class]=\"passThrough().weekday?.class\" [style]=\"passThrough().weekday?.style\">\n {{ weekday.short }}\n </th>\n }\n </tr>\n </thead>\n <tbody>\n @for (week of month.weeks; track week.number + '-' + $index) {\n <tr>\n @if (showWeek()) {\n <th scope=\"row\" class=\"tx-datepicker__week-number\" [class]=\"passThrough().weekNumber?.class\" [style]=\"passThrough().weekNumber?.style\">\n {{ week.number }}\n </th>\n }\n @for (day of week.days; track dayKey(day.date)) {\n @if (day.otherMonth && !showOtherMonths()) {\n <td role=\"gridcell\" class=\"tx-datepicker__day-cell tx-datepicker__day-cell--empty\"></td>\n } @else {\n <td\n role=\"gridcell\"\n class=\"tx-datepicker__day-cell\"\n [class.tx-datepicker__day-cell--today]=\"day.today\"\n [class.tx-datepicker__day-cell--other]=\"day.otherMonth\"\n [attr.data-date]=\"dayKey(day.date)\"\n [attr.data-active]=\"isFocusedDay(day) || null\"\n [attr.tabindex]=\"isFocusedDay(day) ? 0 : -1\"\n [attr.aria-label]=\"dayLabel(day.date)\"\n [attr.aria-selected]=\"isSelected(day.date) || isInRange(day.date)\"\n [attr.aria-disabled]=\"!day.selectable || (day.otherMonth && !selectOtherMonths()) || null\"\n [attr.aria-current]=\"day.today ? 'date' : null\"\n (click)=\"onDayClick(day)\"\n (mouseenter)=\"onDayEnter(day)\"\n (keydown)=\"onDayKeydown($event, day)\"\n >\n <span\n class=\"tx-datepicker__day\"\n [class.tx-datepicker__day--selected]=\"isSelected(day.date)\"\n [class.tx-datepicker__day--range]=\"isInRange(day.date)\"\n [class.tx-datepicker__day--preview]=\"isPreview(day.date)\"\n [class.tx-datepicker__day--disabled]=\"!day.selectable\"\n [class]=\"passThrough().day?.class\"\n [style]=\"passThrough().day?.style\"\n >\n @if (dateTemplate(); as template) {\n <ng-container\n [ngTemplateOutlet]=\"template.templateRef\"\n [ngTemplateOutletContext]=\"{ $implicit: day, selected: isSelected(day.date), inRange: isInRange(day.date) }\"\n />\n } @else {\n {{ day.day }}\n }\n </span>\n </td>\n }\n }\n </tr>\n }\n </tbody>\n </table>\n }\n @case ('month') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__month-view\"\n [attr.aria-label]=\"translations().chooseMonth\"\n [class]=\"passThrough().monthView?.class\"\n [style]=\"passThrough().monthView?.style\"\n >\n @for (row of [0, 1, 2, 3]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1, 2]; track column) {\n @let monthIndex = row * 3 + column;\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__month\"\n [class.tx-datepicker__month--selected]=\"isMonthSelected(monthIndex)\"\n [class.tx-datepicker__month--disabled]=\"!monthSelectable(monthIndex)\"\n [class]=\"passThrough().month?.class\"\n [style]=\"passThrough().month?.style\"\n [attr.data-active]=\"focusedMonth() === monthIndex || null\"\n [attr.tabindex]=\"focusedMonth() === monthIndex ? 0 : -1\"\n [attr.aria-label]=\"names().monthNames[monthIndex] + ' ' + viewYear()\"\n [attr.aria-selected]=\"isMonthSelected(monthIndex)\"\n [attr.aria-disabled]=\"!monthSelectable(monthIndex) || null\"\n (click)=\"pickMonth(monthIndex)\"\n (keydown)=\"onMonthKeydown($event, monthIndex)\"\n >{{ names().monthNamesShort[monthIndex] }}</span\n >\n }\n </div>\n }\n </div>\n }\n @case ('year') {\n <div\n role=\"grid\"\n class=\"tx-datepicker__year-view\"\n [attr.aria-label]=\"translations().chooseYear\"\n [class]=\"passThrough().yearView?.class\"\n [style]=\"passThrough().yearView?.style\"\n >\n @for (row of [0, 1, 2, 3, 4]; track row) {\n <div role=\"row\" class=\"tx-datepicker__row\">\n @for (column of [0, 1]; track column) {\n @let year = decade()[row * 2 + column];\n <span\n role=\"gridcell\"\n class=\"tx-datepicker__year\"\n [class.tx-datepicker__year--selected]=\"isYearSelected(year)\"\n [class.tx-datepicker__year--disabled]=\"!yearSelectable(year)\"\n [class]=\"passThrough().year?.class\"\n [style]=\"passThrough().year?.style\"\n [attr.data-active]=\"focusedYear() === year || null\"\n [attr.tabindex]=\"focusedYear() === year ? 0 : -1\"\n [attr.aria-selected]=\"isYearSelected(year)\"\n [attr.aria-disabled]=\"!yearSelectable(year) || null\"\n (click)=\"pickYear(year)\"\n (keydown)=\"onYearKeydown($event, year)\"\n >{{ year }}</span\n >\n }\n </div>\n }\n </div>\n }\n }\n </div>\n }\n </div>\n }\n\n @if (hasTime() && currentView() === 'date') {\n <div class=\"tx-datepicker__time\" [class]=\"passThrough().timePicker?.class\" [style]=\"passThrough().timePicker?.style\">\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'hour', value: hours() }\" />\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'minute', value: minutes() }\" />\n @if (showSeconds()) {\n <span class=\"tx-datepicker__time-separator\" aria-hidden=\"true\">{{ timeSeparator() }}</span>\n <ng-container [ngTemplateOutlet]=\"spinner\" [ngTemplateOutletContext]=\"{ unit: 'second', value: seconds() }\" />\n }\n @if (hourFormat() === '12') {\n <div class=\"tx-datepicker__time-unit\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n <span class=\"tx-datepicker__time-value\">{{ isPm() ? translations().pm : translations().am }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"translations().toggleAmPm\"\n (click)=\"toggleMeridiem()\"\n ></button>\n </div>\n }\n </div>\n }\n\n @if (showButtonBar()) {\n <div class=\"tx-datepicker__buttonbar\" [class]=\"passThrough().buttonbar?.class\" [style]=\"passThrough().buttonbar?.style\">\n @if (buttonBarTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" [ngTemplateOutletContext]=\"{ today: selectToday.bind(this), clear: onClearButton.bind(this) }\" />\n } @else {\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().today\"\n [disabled]=\"!isEditable()\"\n (click)=\"selectToday()\"\n ></button>\n <button\n txButton\n type=\"button\"\n size=\"small\"\n severity=\"secondary\"\n variant=\"text\"\n [unstyled]=\"isUnstyled()\"\n [label]=\"translations().clear\"\n [disabled]=\"!isEditable()\"\n (click)=\"onClearButton()\"\n ></button>\n }\n </div>\n }\n @if (footerTemplate(); as template) {\n <ng-container [ngTemplateOutlet]=\"template.templateRef\" />\n }\n </div>\n</ng-template>\n\n<ng-template #spinner let-unit=\"unit\" let-value=\"value\">\n <div class=\"tx-datepicker__time-unit\" role=\"group\" [attr.aria-label]=\"unit === 'hour' ? translations().hour : unit === 'minute' ? translations().minute : translations().second\">\n <button\n txButton\n type=\"button\"\n icon=\"chevron-up\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().nextHour : unit === 'minute' ? translations().nextMinute : translations().nextSecond\"\n (pointerdown)=\"startRepeat($event, unit, 1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, 1)\"\n ></button>\n <span class=\"tx-datepicker__time-value\" aria-live=\"polite\">{{ formatPart(value) }}</span>\n <button\n txButton\n type=\"button\"\n icon=\"chevron-down\"\n severity=\"secondary\"\n variant=\"text\"\n [rounded]=\"true\"\n [unstyled]=\"isUnstyled()\"\n [disabled]=\"!isEditable()\"\n [attr.aria-label]=\"unit === 'hour' ? translations().previousHour : unit === 'minute' ? translations().previousMinute : translations().previousSecond\"\n (pointerdown)=\"startRepeat($event, unit, -1)\"\n (pointerup)=\"stopRepeat()\"\n (pointerleave)=\"stopRepeat()\"\n (pointercancel)=\"stopRepeat()\"\n (keydown)=\"onTimeKeydown($event, unit, -1)\"\n ></button>\n </div>\n</ng-template>\n",
|
|
2136
|
+
styles: [":host{display:inline-flex;max-width:100%;vertical-align:top}:host(.tx-datepicker--fluid){display:flex;width:100%}:host(.tx-datepicker--inline){display:inline-block}.tx-datepicker__field{position:relative;display:flex;flex:1 1 auto;align-items:stretch;min-width:0}.tx-datepicker__input{flex:1 1 auto;width:1%;min-width:0}.tx-datepicker__clear,.tx-datepicker__input-icon{position:absolute;top:50%;transform:translateY(-50%)}.tx-datepicker__dropdown{display:inline-flex;flex:none;align-items:center;justify-content:center;cursor:pointer}.tx-datepicker__nav--hidden{visibility:hidden}:host([data-styled]){--_icon-room: 0px;--_clear-room: 0px}:host([data-styled]) .tx-datepicker__input{--tx-field-inset-end: calc(var(--_icon-room) + var(--_clear-room))}:host([data-styled]) .tx-datepicker__clear{display:grid;place-items:center;width:var(--tx-form-field-action-size);height:var(--tx-form-field-action-size);padding:0;border:none;border-radius:var(--tx-radius-sm);background:transparent;color:var(--tx-form-field-icon-color);font-size:var(--tx-form-field-font-size);cursor:pointer;pointer-events:auto;transition:background-color var(--tx-form-field-transition-duration),color var(--tx-form-field-transition-duration)}:host([data-styled]) .tx-datepicker__clear:hover{background:var(--tx-surface-hover);color:var(--tx-form-field-color)}:host([data-styled]) .tx-datepicker__clear:focus-visible{outline:2px solid var(--tx-focus-ring-color);outline-offset:1px}:host([data-styled]) .tx-datepicker__clear{right:calc(var(--_icon-room) + var(--_button-room, 0px) + var(--tx-space-2))}:host([data-styled]) .tx-datepicker__input-icon{right:var(--tx-form-field-padding-x);display:inline-flex;color:var(--tx-date-picker-input-icon-color);font-size:var(--tx-form-field-font-size);line-height:1;cursor:pointer}:host([data-styled]) .tx-datepicker__dropdown{box-sizing:border-box;width:var(--tx-date-picker-dropdown-width);padding:0;border:1px solid var(--tx-date-picker-dropdown-border-color);border-inline-start:0 none;border-start-end-radius:var(--tx-date-picker-dropdown-border-radius);border-end-end-radius:var(--tx-date-picker-dropdown-border-radius);outline-color:transparent;background:var(--tx-date-picker-dropdown-background);color:var(--tx-date-picker-dropdown-color);font-size:var(--tx-form-field-font-size);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),border-color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}:host([data-styled]) .tx-datepicker__dropdown:not(:disabled):hover{border-color:var(--tx-date-picker-dropdown-hover-border-color);background:var(--tx-date-picker-dropdown-hover-background);color:var(--tx-date-picker-dropdown-hover-color)}:host([data-styled]) .tx-datepicker__dropdown:not(:disabled):active{border-color:var(--tx-date-picker-dropdown-active-border-color);background:var(--tx-date-picker-dropdown-active-background);color:var(--tx-date-picker-dropdown-active-color)}:host([data-styled]) .tx-datepicker__dropdown:focus-visible{outline:var(--tx-date-picker-dropdown-focus-ring-width) var(--tx-date-picker-dropdown-focus-ring-style) var(--tx-date-picker-dropdown-focus-ring-color);outline-offset:var(--tx-date-picker-dropdown-focus-ring-offset);box-shadow:var(--tx-date-picker-dropdown-focus-ring-shadow)}:host([data-styled]) .tx-datepicker__dropdown:disabled{cursor:not-allowed;opacity:.6}:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown,:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown:not(:disabled):hover,:host([data-styled].tx-datepicker--invalid) .tx-datepicker__dropdown:not(:disabled):active{border-color:var(--tx-date-picker-dropdown-invalid-border-color)}:host([data-styled]:has(.tx-datepicker__input-icon)){--_icon-room: calc(var(--tx-form-field-padding-x) + 1em)}:host([data-styled]:has(.tx-datepicker__clear)){--_clear-room: var(--tx-form-field-action-room)}:host([data-styled].tx-datepicker--button){--_button-room: var(--tx-date-picker-dropdown-width)}:host([data-styled].tx-datepicker--button[data-size=small]){--_button-room: var(--tx-date-picker-dropdown-sm-width)}:host([data-styled].tx-datepicker--button[data-size=large]){--_button-room: var(--tx-date-picker-dropdown-lg-width)}:host([data-styled].tx-datepicker--button) .tx-datepicker__input{border-start-end-radius:0;border-end-end-radius:0}:host([data-styled][data-size=small]) .tx-datepicker__dropdown{width:var(--tx-date-picker-dropdown-sm-width);font-size:var(--tx-form-field-sm-font-size)}:host([data-styled][data-size=large]) .tx-datepicker__dropdown{width:var(--tx-date-picker-dropdown-lg-width);font-size:var(--tx-form-field-lg-font-size)}.tx-datepicker__panel{box-sizing:border-box}.tx-datepicker__calendars{display:flex}.tx-datepicker__header,.tx-datepicker__title,.tx-datepicker__time,.tx-datepicker__buttonbar{display:flex;align-items:center}.tx-datepicker__header,.tx-datepicker__buttonbar{justify-content:space-between}.tx-datepicker__time{justify-content:center}.tx-datepicker__time-unit{display:flex;flex-direction:column;align-items:center}.tx-datepicker__day-view{width:100%;border-collapse:collapse}.tx-datepicker__day-cell{cursor:pointer}.tx-datepicker__day-cell[aria-disabled=true]{cursor:default}.tx-datepicker__day{display:flex;align-items:center;justify-content:center;margin:0 auto}.tx-datepicker__row{display:flex}.tx-datepicker__month,.tx-datepicker__year{display:inline-flex;align-items:center;justify-content:center;cursor:pointer}.tx-datepicker__month{width:33.3%}.tx-datepicker__year{width:50%}.tx-datepicker__month--disabled,.tx-datepicker__year--disabled{cursor:default}.tx-datepicker__panel[data-styled]{padding:var(--tx-date-picker-panel-padding);border:1px solid var(--tx-date-picker-panel-border-color);border-radius:var(--tx-date-picker-panel-border-radius);background:var(--tx-date-picker-panel-background);box-shadow:var(--tx-date-picker-panel-shadow);color:var(--tx-date-picker-panel-color);font-family:var(--tx-font-family)}.tx-datepicker__panel[data-styled].tx-datepicker__panel--inline{display:inline-block;overflow-x:auto;box-shadow:none}.tx-datepicker__panel[data-styled].tx-datepicker__panel--touch{width:var(--tx-date-picker-touch-width);max-height:92vh;overflow:auto}.tx-datepicker__panel[data-styled].tx-datepicker__panel--disabled{opacity:.6}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar{flex:1 1 auto;padding-inline:var(--tx-date-picker-group-gap);border-inline-start:1px solid var(--tx-date-picker-group-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar:first-child{padding-inline-start:0;border-inline-start:0 none}.tx-datepicker__panel[data-styled] .tx-datepicker__calendar:last-child{padding-inline-end:0}.tx-datepicker__panel[data-styled] .tx-datepicker__header{padding:var(--tx-date-picker-header-padding);border-bottom:1px solid var(--tx-date-picker-header-border-color);background:var(--tx-date-picker-header-background);color:var(--tx-date-picker-header-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__title{gap:var(--tx-date-picker-title-gap);font-size:var(--tx-date-picker-title-font-size);font-weight:var(--tx-date-picker-title-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year{margin:0;border:none;outline-color:transparent;background:transparent;font-family:inherit;cursor:pointer;transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:focus-visible,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:focus-visible{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:disabled,.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:disabled{cursor:default}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month{padding:var(--tx-date-picker-select-month-padding);border-radius:var(--tx-date-picker-select-month-border-radius);color:var(--tx-date-picker-select-month-color);font-size:var(--tx-date-picker-select-month-font-size);font-weight:var(--tx-date-picker-select-month-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-month:enabled:hover{background:var(--tx-date-picker-select-month-hover-background);color:var(--tx-date-picker-select-month-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-year{padding:var(--tx-date-picker-select-year-padding);border-radius:var(--tx-date-picker-select-year-border-radius);color:var(--tx-date-picker-select-year-color);font-size:var(--tx-date-picker-select-year-font-size);font-weight:var(--tx-date-picker-select-year-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__select-year:enabled:hover{background:var(--tx-date-picker-select-year-hover-background);color:var(--tx-date-picker-select-year-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__decade{padding:var(--tx-date-picker-select-year-padding)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{margin:var(--tx-date-picker-day-view-margin);font-size:var(--tx-date-picker-date-font-size)}.tx-datepicker__panel[data-styled] .tx-datepicker__weekday{padding:var(--tx-date-picker-week-day-padding);color:var(--tx-date-picker-week-day-color);font-size:var(--tx-date-picker-week-day-font-size);font-weight:var(--tx-date-picker-week-day-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__week-number{padding:var(--tx-date-picker-date-padding);color:var(--tx-date-picker-week-number-color);font-size:var(--tx-date-picker-week-number-font-size);font-weight:var(--tx-date-picker-date-font-weight);text-align:center}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell{padding:var(--tx-date-picker-date-padding);outline:none}.tx-datepicker__panel[data-styled] .tx-datepicker__day{box-sizing:border-box;width:var(--tx-date-picker-date-width);height:var(--tx-date-picker-date-height);border:1px solid transparent;border-radius:var(--tx-date-picker-date-border-radius);color:var(--tx-date-picker-date-color);font-size:var(--tx-date-picker-date-font-size);font-weight:var(--tx-date-picker-date-font-weight);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),box-shadow var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day{background:var(--tx-date-picker-today-background);color:var(--tx-date-picker-today-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell:not([aria-disabled=true]):hover .tx-datepicker__day:not(.tx-datepicker__day--selected,.tx-datepicker__day--preview){background:var(--tx-date-picker-date-hover-background);color:var(--tx-date-picker-date-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell:focus-visible .tx-datepicker__day{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset);box-shadow:var(--tx-date-picker-date-focus-ring-shadow)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--range,.tx-datepicker__panel[data-styled] .tx-datepicker__day--preview,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--range,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--preview{background:var(--tx-date-picker-date-range-selected-background);color:var(--tx-date-picker-date-range-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--selected,.tx-datepicker__panel[data-styled] .tx-datepicker__day-cell--today .tx-datepicker__day--selected{background:var(--tx-date-picker-date-selected-background);color:var(--tx-date-picker-date-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__day--disabled{opacity:var(--tx-date-picker-date-disabled-opacity)}.tx-datepicker__panel[data-styled] .tx-datepicker__month-view{margin:var(--tx-date-picker-month-view-margin)}.tx-datepicker__panel[data-styled] .tx-datepicker__year-view{margin:var(--tx-date-picker-year-view-margin)}.tx-datepicker__panel[data-styled] .tx-datepicker__month,.tx-datepicker__panel[data-styled] .tx-datepicker__year{box-sizing:border-box;outline-color:transparent;color:var(--tx-date-picker-date-color);font-size:var(--tx-date-picker-date-font-size);font-weight:var(--tx-date-picker-date-font-weight);transition:background-color var(--tx-date-picker-transition-duration),color var(--tx-date-picker-transition-duration),outline-color var(--tx-date-picker-transition-duration)}.tx-datepicker__panel[data-styled] .tx-datepicker__month:not(.tx-datepicker__month--disabled,.tx-datepicker__year--disabled,.tx-datepicker__month--selected,.tx-datepicker__year--selected):hover,.tx-datepicker__panel[data-styled] .tx-datepicker__year:not(.tx-datepicker__month--disabled,.tx-datepicker__year--disabled,.tx-datepicker__month--selected,.tx-datepicker__year--selected):hover{background:var(--tx-date-picker-date-hover-background);color:var(--tx-date-picker-date-hover-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__month:focus-visible,.tx-datepicker__panel[data-styled] .tx-datepicker__year:focus-visible{outline:var(--tx-date-picker-date-focus-ring-width) var(--tx-date-picker-date-focus-ring-style) var(--tx-date-picker-date-focus-ring-color);outline-offset:var(--tx-date-picker-date-focus-ring-offset)}.tx-datepicker__panel[data-styled] .tx-datepicker__month{padding:var(--tx-date-picker-month-padding);border-radius:var(--tx-date-picker-month-border-radius)}.tx-datepicker__panel[data-styled] .tx-datepicker__year{padding:var(--tx-date-picker-year-padding);border-radius:var(--tx-date-picker-year-border-radius)}.tx-datepicker__panel[data-styled] .tx-datepicker__month--selected,.tx-datepicker__panel[data-styled] .tx-datepicker__year--selected{background:var(--tx-date-picker-date-selected-background);color:var(--tx-date-picker-date-selected-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__month--disabled,.tx-datepicker__panel[data-styled] .tx-datepicker__year--disabled{opacity:var(--tx-date-picker-date-disabled-opacity)}.tx-datepicker__panel[data-styled] .tx-datepicker__time{gap:var(--tx-date-picker-time-picker-gap);padding:0;color:var(--tx-date-picker-time-picker-color);font-size:var(--tx-date-picker-time-picker-font-size);font-weight:var(--tx-date-picker-time-picker-font-weight)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendars+.tx-datepicker__time{margin-top:var(--tx-date-picker-time-picker-gap);padding:var(--tx-date-picker-time-picker-padding);border-top:1px solid var(--tx-date-picker-time-picker-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__time-unit{gap:var(--tx-date-picker-time-picker-button-gap)}.tx-datepicker__panel[data-styled] .tx-datepicker__time-value{font-variant-numeric:tabular-nums}.tx-datepicker__panel[data-styled] .tx-datepicker__buttonbar{padding:var(--tx-date-picker-buttonbar-padding);border-top:1px solid var(--tx-date-picker-buttonbar-border-color)}.tx-datepicker__panel[data-styled] .tx-datepicker__calendars+.tx-datepicker__buttonbar,.tx-datepicker__panel[data-styled] .tx-datepicker__time+.tx-datepicker__buttonbar{margin-top:var(--tx-date-picker-time-picker-gap)}.tx-datepicker__panel[data-styled] .tx-datepicker__month-view,.tx-datepicker__panel[data-styled] .tx-datepicker__year-view,.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{animation:tx-datepicker-view var(--tx-date-picker-transition-duration) ease-out}@keyframes tx-datepicker-view{0%{opacity:0}}@media(prefers-reduced-motion:reduce){.tx-datepicker__panel[data-styled] .tx-datepicker__month-view,.tx-datepicker__panel[data-styled] .tx-datepicker__year-view,.tx-datepicker__panel[data-styled] .tx-datepicker__day-view{animation:none}}\n"]
|
|
2135
2137
|
}]
|
|
2136
2138
|
}],
|
|
2137
2139
|
propDecorators: {
|