@telcomdev/ui 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -0
- package/fesm2022/telcomdev-ui.mjs +917 -141
- package/fesm2022/telcomdev-ui.mjs.map +1 -1
- package/package.json +4 -1
- package/types/telcomdev-ui.d.ts +189 -56
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Component, Injectable, inject, HostBinding, Input, ChangeDetectionStrategy, EventEmitter, Output, ViewChild,
|
|
2
|
+
import { Component, Injectable, inject, HostBinding, Input, ChangeDetectionStrategy, EventEmitter, Output, ViewChild, ChangeDetectorRef, input, output, model, signal, computed, forwardRef, InjectionToken, HostListener, Directive, DestroyRef, TemplateRef, ViewChildren, ContentChildren } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/cdk/scrolling';
|
|
4
4
|
import { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
5
5
|
import * as i1 from '@angular/forms';
|
|
6
6
|
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
7
|
+
import { ScrollStrategyOptions, CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
|
|
7
8
|
import { DIALOG_DATA, Dialog } from '@angular/cdk/dialog';
|
|
8
9
|
import { NgComponentOutlet, DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
9
|
-
import { ScrollStrategyOptions, CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
|
|
10
10
|
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
11
11
|
|
|
12
12
|
class TelcomdevUi {
|
|
@@ -863,6 +863,742 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
863
863
|
type: Output
|
|
864
864
|
}] } });
|
|
865
865
|
|
|
866
|
+
let datePickerSequence = 0;
|
|
867
|
+
class TdDatePicker {
|
|
868
|
+
cdr = inject(ChangeDetectorRef);
|
|
869
|
+
scrollStrategies = inject(ScrollStrategyOptions);
|
|
870
|
+
generatedId = `td-date-picker-${++datePickerSequence}`;
|
|
871
|
+
formatter = new Intl.DateTimeFormat('es-PE', {
|
|
872
|
+
day: '2-digit',
|
|
873
|
+
month: 'short',
|
|
874
|
+
year: 'numeric',
|
|
875
|
+
});
|
|
876
|
+
monthFormatter = new Intl.DateTimeFormat('es-PE', {
|
|
877
|
+
month: 'long',
|
|
878
|
+
year: 'numeric',
|
|
879
|
+
});
|
|
880
|
+
longFormatter = new Intl.DateTimeFormat('es-PE', {
|
|
881
|
+
weekday: 'long',
|
|
882
|
+
day: 'numeric',
|
|
883
|
+
month: 'long',
|
|
884
|
+
year: 'numeric',
|
|
885
|
+
});
|
|
886
|
+
label = 'Fecha';
|
|
887
|
+
placeholder = 'Selecciona una fecha';
|
|
888
|
+
mode = 'fecha';
|
|
889
|
+
hint = '';
|
|
890
|
+
error = '';
|
|
891
|
+
minDate = null;
|
|
892
|
+
maxDate = null;
|
|
893
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
894
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
895
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
896
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
897
|
+
touch = output();
|
|
898
|
+
clearable = true;
|
|
899
|
+
dark = false;
|
|
900
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
901
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
902
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
903
|
+
displayError = computed(() => this.error || this.errors()[0]?.message || '', ...(ngDevMode ? [{ debugName: "displayError" }] : /* istanbul ignore next */ []));
|
|
904
|
+
hasError = computed(() => this.invalid() || !!this.displayError(), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
905
|
+
selectionChange = new EventEmitter();
|
|
906
|
+
openedChange = new EventEmitter();
|
|
907
|
+
open = false;
|
|
908
|
+
hoveredDate = null;
|
|
909
|
+
viewDate = this.startOfMonth(new Date());
|
|
910
|
+
calendarView = 'dias';
|
|
911
|
+
currentYear = new Date().getFullYear();
|
|
912
|
+
scrollStrategy = this.scrollStrategies.reposition();
|
|
913
|
+
get labelId() {
|
|
914
|
+
return `${this.generatedId}-label`;
|
|
915
|
+
}
|
|
916
|
+
get calendarId() {
|
|
917
|
+
return `${this.generatedId}-calendar`;
|
|
918
|
+
}
|
|
919
|
+
get weekdays() {
|
|
920
|
+
return ['L', 'M', 'X', 'J', 'V', 'S', 'D'];
|
|
921
|
+
}
|
|
922
|
+
get monthLabel() {
|
|
923
|
+
const label = this.monthFormatter.format(this.viewDate);
|
|
924
|
+
return label.charAt(0).toUpperCase() + label.slice(1);
|
|
925
|
+
}
|
|
926
|
+
get periodLabel() {
|
|
927
|
+
if (this.calendarView === 'dias')
|
|
928
|
+
return this.monthLabel;
|
|
929
|
+
if (this.calendarView === 'meses')
|
|
930
|
+
return String(this.viewDate.getFullYear());
|
|
931
|
+
return `${this.yearPageStart} – ${this.yearPageStart + 11}`;
|
|
932
|
+
}
|
|
933
|
+
get periodButtonLabel() {
|
|
934
|
+
if (this.calendarView === 'dias')
|
|
935
|
+
return 'Elegir mes y año';
|
|
936
|
+
if (this.calendarView === 'meses')
|
|
937
|
+
return 'Elegir año';
|
|
938
|
+
return 'Periodo de años';
|
|
939
|
+
}
|
|
940
|
+
get previousLabel() {
|
|
941
|
+
return this.calendarView === 'dias'
|
|
942
|
+
? 'Mes anterior'
|
|
943
|
+
: this.calendarView === 'meses'
|
|
944
|
+
? 'Año anterior'
|
|
945
|
+
: 'Años anteriores';
|
|
946
|
+
}
|
|
947
|
+
get nextLabel() {
|
|
948
|
+
return this.calendarView === 'dias'
|
|
949
|
+
? 'Mes siguiente'
|
|
950
|
+
: this.calendarView === 'meses'
|
|
951
|
+
? 'Año siguiente'
|
|
952
|
+
: 'Años siguientes';
|
|
953
|
+
}
|
|
954
|
+
get months() {
|
|
955
|
+
const formatter = new Intl.DateTimeFormat('es-PE', { month: 'short' });
|
|
956
|
+
const year = this.viewDate.getFullYear();
|
|
957
|
+
return Array.from({ length: 12 }, (_, index) => {
|
|
958
|
+
const label = formatter.format(new Date(year, index, 1)).replace('.', '');
|
|
959
|
+
return {
|
|
960
|
+
index,
|
|
961
|
+
label: label.charAt(0).toUpperCase() + label.slice(1),
|
|
962
|
+
disabled: !this.monthIntersectsLimits(year, index),
|
|
963
|
+
};
|
|
964
|
+
});
|
|
965
|
+
}
|
|
966
|
+
get years() {
|
|
967
|
+
return Array.from({ length: 12 }, (_, index) => {
|
|
968
|
+
const value = this.yearPageStart + index;
|
|
969
|
+
return { value, disabled: !this.yearIntersectsLimits(value) };
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
get yearPageStart() {
|
|
973
|
+
return Math.floor(this.viewDate.getFullYear() / 12) * 12;
|
|
974
|
+
}
|
|
975
|
+
get days() {
|
|
976
|
+
const first = this.startOfMonth(this.viewDate);
|
|
977
|
+
const mondayOffset = (first.getDay() + 6) % 7;
|
|
978
|
+
const start = new Date(first.getFullYear(), first.getMonth(), 1 - mondayOffset);
|
|
979
|
+
return Array.from({ length: 42 }, (_, index) => {
|
|
980
|
+
const date = new Date(start.getFullYear(), start.getMonth(), start.getDate() + index);
|
|
981
|
+
const iso = this.toIso(date);
|
|
982
|
+
return {
|
|
983
|
+
iso,
|
|
984
|
+
day: date.getDate(),
|
|
985
|
+
currentMonth: date.getMonth() === this.viewDate.getMonth(),
|
|
986
|
+
today: iso === this.toIso(new Date()),
|
|
987
|
+
disabled: (typeof this.minDate === 'string' && iso < this.minDate) ||
|
|
988
|
+
(typeof this.maxDate === 'string' && iso > this.maxDate),
|
|
989
|
+
};
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
get displayValue() {
|
|
993
|
+
const current = this.value();
|
|
994
|
+
if (typeof current === 'string')
|
|
995
|
+
return this.format(current);
|
|
996
|
+
if (current && typeof current === 'object') {
|
|
997
|
+
return current.fin
|
|
998
|
+
? `${this.format(current.inicio)} — ${this.format(current.fin)}`
|
|
999
|
+
: this.format(current.inicio);
|
|
1000
|
+
}
|
|
1001
|
+
return '';
|
|
1002
|
+
}
|
|
1003
|
+
get rangeStartLabel() {
|
|
1004
|
+
return this.currentRange()?.inicio ? this.format(this.currentRange().inicio) : 'Sin elegir';
|
|
1005
|
+
}
|
|
1006
|
+
get rangeEndLabel() {
|
|
1007
|
+
return this.currentRange()?.fin ? this.format(this.currentRange().fin) : 'Sin elegir';
|
|
1008
|
+
}
|
|
1009
|
+
changed = () => undefined;
|
|
1010
|
+
onCvaTouched = () => undefined;
|
|
1011
|
+
writeValue(value) {
|
|
1012
|
+
this.value.set(this.normalizeValue(value));
|
|
1013
|
+
this.syncViewToValue();
|
|
1014
|
+
this.cdr.markForCheck();
|
|
1015
|
+
}
|
|
1016
|
+
registerOnChange(fn) {
|
|
1017
|
+
this.changed = fn;
|
|
1018
|
+
}
|
|
1019
|
+
registerOnTouched(fn) {
|
|
1020
|
+
this.onCvaTouched = fn;
|
|
1021
|
+
}
|
|
1022
|
+
setDisabledState(disabled) {
|
|
1023
|
+
this.cvaDisabled.set(disabled);
|
|
1024
|
+
this.cdr.markForCheck();
|
|
1025
|
+
}
|
|
1026
|
+
focus() {
|
|
1027
|
+
document.getElementById(this.labelId)?.parentElement?.querySelector('button')?.focus();
|
|
1028
|
+
}
|
|
1029
|
+
toggle() {
|
|
1030
|
+
if (this.isDisabled() || this.readonly())
|
|
1031
|
+
return;
|
|
1032
|
+
this.open ? this.close() : this.openPanel();
|
|
1033
|
+
}
|
|
1034
|
+
openPanel() {
|
|
1035
|
+
if (this.isDisabled() || this.readonly())
|
|
1036
|
+
return;
|
|
1037
|
+
this.syncViewToValue();
|
|
1038
|
+
this.calendarView = 'dias';
|
|
1039
|
+
this.open = true;
|
|
1040
|
+
this.openedChange.emit(true);
|
|
1041
|
+
}
|
|
1042
|
+
close() {
|
|
1043
|
+
if (!this.open)
|
|
1044
|
+
return;
|
|
1045
|
+
this.open = false;
|
|
1046
|
+
this.hoveredDate = null;
|
|
1047
|
+
this.onCvaTouched();
|
|
1048
|
+
this.touch.emit();
|
|
1049
|
+
this.openedChange.emit(false);
|
|
1050
|
+
}
|
|
1051
|
+
previousPage() {
|
|
1052
|
+
if (this.calendarView === 'dias') {
|
|
1053
|
+
this.viewDate = new Date(this.viewDate.getFullYear(), this.viewDate.getMonth() - 1, 1);
|
|
1054
|
+
}
|
|
1055
|
+
else if (this.calendarView === 'meses') {
|
|
1056
|
+
this.viewDate = new Date(this.viewDate.getFullYear() - 1, this.viewDate.getMonth(), 1);
|
|
1057
|
+
}
|
|
1058
|
+
else {
|
|
1059
|
+
this.viewDate = new Date(this.viewDate.getFullYear() - 12, this.viewDate.getMonth(), 1);
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
nextPage() {
|
|
1063
|
+
if (this.calendarView === 'dias') {
|
|
1064
|
+
this.viewDate = new Date(this.viewDate.getFullYear(), this.viewDate.getMonth() + 1, 1);
|
|
1065
|
+
}
|
|
1066
|
+
else if (this.calendarView === 'meses') {
|
|
1067
|
+
this.viewDate = new Date(this.viewDate.getFullYear() + 1, this.viewDate.getMonth(), 1);
|
|
1068
|
+
}
|
|
1069
|
+
else {
|
|
1070
|
+
this.viewDate = new Date(this.viewDate.getFullYear() + 12, this.viewDate.getMonth(), 1);
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
changeCalendarView() {
|
|
1074
|
+
if (this.calendarView === 'dias') {
|
|
1075
|
+
this.calendarView = 'meses';
|
|
1076
|
+
}
|
|
1077
|
+
else if (this.calendarView === 'meses') {
|
|
1078
|
+
this.calendarView = 'anios';
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
selectMonth(month) {
|
|
1082
|
+
this.viewDate = new Date(this.viewDate.getFullYear(), month, 1);
|
|
1083
|
+
this.calendarView = 'dias';
|
|
1084
|
+
}
|
|
1085
|
+
selectYear(year) {
|
|
1086
|
+
this.viewDate = new Date(year, this.viewDate.getMonth(), 1);
|
|
1087
|
+
this.calendarView = 'meses';
|
|
1088
|
+
}
|
|
1089
|
+
goToday() {
|
|
1090
|
+
const today = this.toIso(new Date());
|
|
1091
|
+
if ((typeof this.minDate === 'string' && today < this.minDate) ||
|
|
1092
|
+
(typeof this.maxDate === 'string' && today > this.maxDate))
|
|
1093
|
+
return;
|
|
1094
|
+
this.viewDate = this.startOfMonth(new Date());
|
|
1095
|
+
this.calendarView = 'dias';
|
|
1096
|
+
this.selectDate(this.days.find((day) => day.iso === today) ?? {
|
|
1097
|
+
iso: today,
|
|
1098
|
+
day: new Date().getDate(),
|
|
1099
|
+
currentMonth: true,
|
|
1100
|
+
today: true,
|
|
1101
|
+
disabled: false,
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
selectDate(date) {
|
|
1105
|
+
if (date.disabled)
|
|
1106
|
+
return;
|
|
1107
|
+
if (!date.currentMonth) {
|
|
1108
|
+
const parsed = this.fromIso(date.iso);
|
|
1109
|
+
this.viewDate = this.startOfMonth(parsed);
|
|
1110
|
+
}
|
|
1111
|
+
if (this.mode === 'fecha') {
|
|
1112
|
+
this.setValue(date.iso);
|
|
1113
|
+
this.close();
|
|
1114
|
+
return;
|
|
1115
|
+
}
|
|
1116
|
+
const range = this.currentRange();
|
|
1117
|
+
if (!range || range.fin) {
|
|
1118
|
+
this.setValue({ inicio: date.iso, fin: null });
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
this.setValue(date.iso < range.inicio
|
|
1122
|
+
? { inicio: date.iso, fin: range.inicio }
|
|
1123
|
+
: { inicio: range.inicio, fin: date.iso });
|
|
1124
|
+
this.close();
|
|
1125
|
+
}
|
|
1126
|
+
clear(event) {
|
|
1127
|
+
event.stopPropagation();
|
|
1128
|
+
this.setValue(null);
|
|
1129
|
+
}
|
|
1130
|
+
isSelected(iso) {
|
|
1131
|
+
const current = this.value();
|
|
1132
|
+
if (typeof current === 'string')
|
|
1133
|
+
return current === iso;
|
|
1134
|
+
return !!current && (current.inicio === iso || current.fin === iso);
|
|
1135
|
+
}
|
|
1136
|
+
isRangeStart(iso) {
|
|
1137
|
+
return this.currentRange()?.inicio === iso;
|
|
1138
|
+
}
|
|
1139
|
+
isRangeEnd(iso) {
|
|
1140
|
+
return this.currentRange()?.fin === iso;
|
|
1141
|
+
}
|
|
1142
|
+
isInRange(iso) {
|
|
1143
|
+
const range = this.currentRange();
|
|
1144
|
+
if (!range)
|
|
1145
|
+
return false;
|
|
1146
|
+
const end = range.fin ?? this.hoveredDate;
|
|
1147
|
+
if (!end)
|
|
1148
|
+
return false;
|
|
1149
|
+
const start = end < range.inicio ? end : range.inicio;
|
|
1150
|
+
const finish = end < range.inicio ? range.inicio : end;
|
|
1151
|
+
return iso > start && iso < finish;
|
|
1152
|
+
}
|
|
1153
|
+
formatLong(iso) {
|
|
1154
|
+
return this.longFormatter.format(this.fromIso(iso));
|
|
1155
|
+
}
|
|
1156
|
+
handleTriggerKeydown(event) {
|
|
1157
|
+
if (event.key === 'ArrowDown' || event.key === 'Enter' || event.key === ' ') {
|
|
1158
|
+
event.preventDefault();
|
|
1159
|
+
this.openPanel();
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
handleOverlayKeydown(event) {
|
|
1163
|
+
if (event.key === 'Escape') {
|
|
1164
|
+
event.preventDefault();
|
|
1165
|
+
this.close();
|
|
1166
|
+
}
|
|
1167
|
+
else if (event.key === 'PageUp') {
|
|
1168
|
+
event.preventDefault();
|
|
1169
|
+
this.previousPage();
|
|
1170
|
+
}
|
|
1171
|
+
else if (event.key === 'PageDown') {
|
|
1172
|
+
event.preventDefault();
|
|
1173
|
+
this.nextPage();
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
currentRange() {
|
|
1177
|
+
const current = this.value();
|
|
1178
|
+
return current && typeof current === 'object' ? current : null;
|
|
1179
|
+
}
|
|
1180
|
+
setValue(value) {
|
|
1181
|
+
this.value.set(value);
|
|
1182
|
+
this.changed(value);
|
|
1183
|
+
this.selectionChange.emit(value);
|
|
1184
|
+
}
|
|
1185
|
+
syncViewToValue() {
|
|
1186
|
+
const current = this.value();
|
|
1187
|
+
const iso = typeof current === 'string' ? current : current?.inicio;
|
|
1188
|
+
if (iso)
|
|
1189
|
+
this.viewDate = this.startOfMonth(this.fromIso(iso));
|
|
1190
|
+
}
|
|
1191
|
+
normalizeValue(value) {
|
|
1192
|
+
if (!value)
|
|
1193
|
+
return null;
|
|
1194
|
+
if (typeof value === 'string')
|
|
1195
|
+
return value;
|
|
1196
|
+
return { inicio: value.inicio, fin: value.fin ?? null };
|
|
1197
|
+
}
|
|
1198
|
+
format(iso) {
|
|
1199
|
+
return this.formatter.format(this.fromIso(iso)).replace('.', '');
|
|
1200
|
+
}
|
|
1201
|
+
fromIso(iso) {
|
|
1202
|
+
const [year, month, day] = iso.split('-').map(Number);
|
|
1203
|
+
return new Date(year, month - 1, day);
|
|
1204
|
+
}
|
|
1205
|
+
toIso(date) {
|
|
1206
|
+
const year = date.getFullYear();
|
|
1207
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
1208
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
1209
|
+
return `${year}-${month}-${day}`;
|
|
1210
|
+
}
|
|
1211
|
+
startOfMonth(date) {
|
|
1212
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
1213
|
+
}
|
|
1214
|
+
monthIntersectsLimits(year, month) {
|
|
1215
|
+
const first = this.toIso(new Date(year, month, 1));
|
|
1216
|
+
const last = this.toIso(new Date(year, month + 1, 0));
|
|
1217
|
+
return !((typeof this.minDate === 'string' && last < this.minDate) ||
|
|
1218
|
+
(typeof this.maxDate === 'string' && first > this.maxDate));
|
|
1219
|
+
}
|
|
1220
|
+
yearIntersectsLimits(year) {
|
|
1221
|
+
const first = `${year}-01-01`;
|
|
1222
|
+
const last = `${year}-12-31`;
|
|
1223
|
+
return !((typeof this.minDate === 'string' && last < this.minDate) ||
|
|
1224
|
+
(typeof this.maxDate === 'string' && first > this.maxDate));
|
|
1225
|
+
}
|
|
1226
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdDatePicker, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1227
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdDatePicker, isStandalone: true, selector: "td-date-picker", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, mode: { classPropertyName: "mode", publicName: "mode", isSignal: false, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: false, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: false, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "min", isSignal: false, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "max", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, dark: { classPropertyName: "dark", publicName: "dark", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", value: "valueChange", selectionChange: "selectionChange", openedChange: "openedChange" }, providers: [
|
|
1228
|
+
{
|
|
1229
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1230
|
+
useExisting: forwardRef(() => TdDatePicker),
|
|
1231
|
+
multi: true,
|
|
1232
|
+
},
|
|
1233
|
+
], ngImport: i0, template: `
|
|
1234
|
+
<div
|
|
1235
|
+
cdkOverlayOrigin
|
|
1236
|
+
#origin="cdkOverlayOrigin"
|
|
1237
|
+
class="td-date-picker"
|
|
1238
|
+
[class.td-date-picker--open]="open"
|
|
1239
|
+
[class.td-date-picker--error]="hasError()"
|
|
1240
|
+
[class.td-date-picker--disabled]="isDisabled()"
|
|
1241
|
+
[class.td-date-picker--dark]="dark"
|
|
1242
|
+
>
|
|
1243
|
+
<label [id]="labelId">{{ label }}</label>
|
|
1244
|
+
<button
|
|
1245
|
+
type="button"
|
|
1246
|
+
class="td-date-picker__trigger"
|
|
1247
|
+
[disabled]="isDisabled()"
|
|
1248
|
+
[attr.aria-labelledby]="labelId"
|
|
1249
|
+
[attr.aria-expanded]="open"
|
|
1250
|
+
[attr.aria-controls]="calendarId"
|
|
1251
|
+
(click)="toggle()"
|
|
1252
|
+
(keydown)="handleTriggerKeydown($event)"
|
|
1253
|
+
>
|
|
1254
|
+
<td-icon nombre="calendar" />
|
|
1255
|
+
<span [class.td-date-picker__placeholder]="!displayValue">
|
|
1256
|
+
{{ displayValue || placeholder }}
|
|
1257
|
+
</span>
|
|
1258
|
+
@if (clearable && value() && !isDisabled() && !readonly()) {
|
|
1259
|
+
<span
|
|
1260
|
+
class="td-date-picker__clear"
|
|
1261
|
+
role="button"
|
|
1262
|
+
tabindex="-1"
|
|
1263
|
+
aria-label="Limpiar fecha"
|
|
1264
|
+
(click)="clear($event)"
|
|
1265
|
+
>
|
|
1266
|
+
<td-icon nombre="close" tamano=".92rem" />
|
|
1267
|
+
</span>
|
|
1268
|
+
}
|
|
1269
|
+
<td-icon
|
|
1270
|
+
class="td-date-picker__chevron"
|
|
1271
|
+
[class.td-date-picker__chevron--open]="open"
|
|
1272
|
+
nombre="chevron_down"
|
|
1273
|
+
/>
|
|
1274
|
+
</button>
|
|
1275
|
+
</div>
|
|
1276
|
+
|
|
1277
|
+
@if (displayError() || hint) {
|
|
1278
|
+
<p class="td-date-picker__message" [class.td-date-picker__message--error]="hasError()">
|
|
1279
|
+
{{ displayError() || hint }}
|
|
1280
|
+
</p>
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
<ng-template
|
|
1284
|
+
cdkConnectedOverlay
|
|
1285
|
+
[cdkConnectedOverlayOrigin]="origin"
|
|
1286
|
+
[cdkConnectedOverlayOpen]="open"
|
|
1287
|
+
[cdkConnectedOverlayScrollStrategy]="scrollStrategy"
|
|
1288
|
+
[cdkConnectedOverlayMatchWidth]="false"
|
|
1289
|
+
[cdkConnectedOverlayViewportMargin]="8"
|
|
1290
|
+
[cdkConnectedOverlayPush]="true"
|
|
1291
|
+
(overlayOutsideClick)="close()"
|
|
1292
|
+
(overlayKeydown)="handleOverlayKeydown($event)"
|
|
1293
|
+
(detach)="close()"
|
|
1294
|
+
>
|
|
1295
|
+
<section
|
|
1296
|
+
class="td-calendar"
|
|
1297
|
+
[class.td-calendar--dark]="dark"
|
|
1298
|
+
[id]="calendarId"
|
|
1299
|
+
role="dialog"
|
|
1300
|
+
aria-modal="true"
|
|
1301
|
+
[attr.aria-label]="mode === 'rango' ? 'Seleccionar rango de fechas' : 'Seleccionar fecha'"
|
|
1302
|
+
>
|
|
1303
|
+
<header class="td-calendar__header">
|
|
1304
|
+
<button type="button" [attr.aria-label]="previousLabel" (click)="previousPage()">
|
|
1305
|
+
<td-icon nombre="chevron_left" />
|
|
1306
|
+
</button>
|
|
1307
|
+
<button
|
|
1308
|
+
type="button"
|
|
1309
|
+
class="td-calendar__period"
|
|
1310
|
+
[attr.aria-label]="periodButtonLabel"
|
|
1311
|
+
(click)="changeCalendarView()"
|
|
1312
|
+
>
|
|
1313
|
+
{{ periodLabel }}
|
|
1314
|
+
@if (calendarView !== 'anios') {
|
|
1315
|
+
<td-icon nombre="chevron_down" tamano=".85rem" />
|
|
1316
|
+
}
|
|
1317
|
+
</button>
|
|
1318
|
+
<button type="button" [attr.aria-label]="nextLabel" (click)="nextPage()">
|
|
1319
|
+
<td-icon nombre="chevron_right" />
|
|
1320
|
+
</button>
|
|
1321
|
+
</header>
|
|
1322
|
+
|
|
1323
|
+
@if (mode === 'rango') {
|
|
1324
|
+
<div class="td-calendar__range-summary">
|
|
1325
|
+
<span><small>Desde</small><strong>{{ rangeStartLabel }}</strong></span>
|
|
1326
|
+
<td-icon nombre="arrow_forward" />
|
|
1327
|
+
<span><small>Hasta</small><strong>{{ rangeEndLabel }}</strong></span>
|
|
1328
|
+
</div>
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
@if (calendarView === 'dias') {
|
|
1332
|
+
<div class="td-calendar__weekdays" aria-hidden="true">
|
|
1333
|
+
@for (weekday of weekdays; track weekday) {
|
|
1334
|
+
<span>{{ weekday }}</span>
|
|
1335
|
+
}
|
|
1336
|
+
</div>
|
|
1337
|
+
|
|
1338
|
+
<div class="td-calendar__grid">
|
|
1339
|
+
@for (date of days; track date.iso) {
|
|
1340
|
+
<button
|
|
1341
|
+
type="button"
|
|
1342
|
+
class="td-calendar__day"
|
|
1343
|
+
[class.td-calendar__day--outside]="!date.currentMonth"
|
|
1344
|
+
[class.td-calendar__day--today]="date.today"
|
|
1345
|
+
[class.td-calendar__day--selected]="isSelected(date.iso)"
|
|
1346
|
+
[class.td-calendar__day--range]="isInRange(date.iso)"
|
|
1347
|
+
[class.td-calendar__day--range-start]="isRangeStart(date.iso)"
|
|
1348
|
+
[class.td-calendar__day--range-end]="isRangeEnd(date.iso)"
|
|
1349
|
+
[disabled]="date.disabled"
|
|
1350
|
+
[attr.aria-label]="formatLong(date.iso)"
|
|
1351
|
+
[attr.aria-pressed]="isSelected(date.iso)"
|
|
1352
|
+
(mouseenter)="hoveredDate = date.iso"
|
|
1353
|
+
(mouseleave)="hoveredDate = null"
|
|
1354
|
+
(click)="selectDate(date)"
|
|
1355
|
+
>
|
|
1356
|
+
{{ date.day }}
|
|
1357
|
+
</button>
|
|
1358
|
+
}
|
|
1359
|
+
</div>
|
|
1360
|
+
} @else if (calendarView === 'meses') {
|
|
1361
|
+
<div class="td-calendar__selector-grid td-calendar__selector-grid--months">
|
|
1362
|
+
@for (month of months; track month.index) {
|
|
1363
|
+
<button
|
|
1364
|
+
type="button"
|
|
1365
|
+
[class.td-calendar__selector--active]="month.index === viewDate.getMonth()"
|
|
1366
|
+
[disabled]="month.disabled"
|
|
1367
|
+
(click)="selectMonth(month.index)"
|
|
1368
|
+
>
|
|
1369
|
+
{{ month.label }}
|
|
1370
|
+
</button>
|
|
1371
|
+
}
|
|
1372
|
+
</div>
|
|
1373
|
+
} @else {
|
|
1374
|
+
<div class="td-calendar__selector-grid td-calendar__selector-grid--years">
|
|
1375
|
+
@for (year of years; track year.value) {
|
|
1376
|
+
<button
|
|
1377
|
+
type="button"
|
|
1378
|
+
[class.td-calendar__selector--active]="year.value === viewDate.getFullYear()"
|
|
1379
|
+
[class.td-calendar__selector--today]="year.value === currentYear"
|
|
1380
|
+
[disabled]="year.disabled"
|
|
1381
|
+
(click)="selectYear(year.value)"
|
|
1382
|
+
>
|
|
1383
|
+
{{ year.value }}
|
|
1384
|
+
</button>
|
|
1385
|
+
}
|
|
1386
|
+
</div>
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
<footer class="td-calendar__footer">
|
|
1390
|
+
<button type="button" class="td-calendar__text-action" (click)="goToday()">
|
|
1391
|
+
Hoy
|
|
1392
|
+
</button>
|
|
1393
|
+
<button type="button" class="td-calendar__text-action" (click)="close()">
|
|
1394
|
+
Cerrar
|
|
1395
|
+
</button>
|
|
1396
|
+
</footer>
|
|
1397
|
+
</section>
|
|
1398
|
+
</ng-template>
|
|
1399
|
+
`, isInline: true, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-date-picker{--td-date-bg: #fff;--td-date-border: #dfe3eb;--td-date-text: #263147;--td-date-muted: #748096;position:relative;min-height:3.15rem;border:1px solid var(--td-date-border);border-radius:.78rem;background:var(--td-date-bg);transition:border-color .14s ease,box-shadow .14s ease}.td-date-picker--dark{--td-date-bg: #19191f;--td-date-border: #34343e;--td-date-text: #ededf0;--td-date-muted: #a1a1aa}.td-date-picker:hover:not(.td-date-picker--disabled){border-color:#8d80e8}.td-date-picker--open{border-color:#5746d8;box-shadow:0 0 0 3px #5746d821}.td-date-picker--error{border-color:#d33f3f;box-shadow:0 0 0 3px #d33f3f1a}.td-date-picker--disabled{opacity:.58;background:#f5f6f8}.td-date-picker>label{position:absolute;z-index:1;top:-.48rem;left:.72rem;padding:0 .35rem;color:var(--td-date-muted);background:var(--td-date-bg);font-size:.65rem;font-weight:750;line-height:1}.td-date-picker--open>label{color:#5746d8}.td-date-picker--error>label{color:#d33f3f}.td-date-picker__trigger{display:flex;width:100%;min-height:3.05rem;align-items:center;gap:.55rem;border:0;border-radius:inherit;padding:.3rem .7rem;color:var(--td-date-text);background:transparent;font:550 .78rem/1.25 system-ui,sans-serif;text-align:left;cursor:pointer}.td-date-picker__trigger>span:not(.td-date-picker__clear){min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.td-date-picker__placeholder{color:color-mix(in srgb,var(--td-date-muted) 72%,transparent)}.td-date-picker__trigger>td-icon{color:var(--td-date-muted)}.td-date-picker__chevron{transition:transform .14s ease}.td-date-picker__chevron--open{transform:rotate(180deg)}.td-date-picker__clear{display:grid;width:1.8rem;height:1.8rem;flex:0 0 auto;place-items:center;border-radius:.45rem;color:var(--td-date-muted)}.td-date-picker__clear:hover{color:#5746d8;background:#f2f0ff}.td-date-picker__message{margin:.38rem .75rem 0;color:#748096;font-size:.66rem}.td-date-picker__message--error{color:#c43636}.td-calendar{width:min(21rem,100vw - 1rem);overflow:hidden;border:1px solid #e1e5ee;border-radius:1rem;padding:.8rem;color:#263147;background:#fff;box-shadow:0 22px 55px #0f172a33;font-family:Inter,ui-sans-serif,system-ui,sans-serif;animation:td-calendar-in .14s ease-out}.td-calendar--dark{border-color:#34343e;color:#ededf0;background:#202028}.td-calendar__header{display:grid;grid-template-columns:2.35rem 1fr 2.35rem;align-items:center;gap:.35rem}.td-calendar__header button,.td-calendar__footer button{border:0;color:inherit;background:transparent;cursor:pointer}.td-calendar__header button{display:grid;width:2.35rem;height:2.35rem;place-items:center;border-radius:.65rem}.td-calendar__header .td-calendar__period{display:inline-flex;width:auto;min-width:0;height:2.35rem;align-items:center;justify-content:center;gap:.35rem;padding:0 .65rem;font-size:.82rem;font-weight:800}.td-calendar__header button:hover{color:#5746d8;background:#f2f0ff}.td-calendar--dark .td-calendar__header button:hover{background:#2b293d}.td-calendar__range-summary{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:.55rem;margin:.65rem 0 .35rem;border-radius:.72rem;padding:.55rem .65rem;background:#f7f7fb}.td-calendar--dark .td-calendar__range-summary{background:#292931}.td-calendar__range-summary span{min-width:0}.td-calendar__range-summary span:last-child{text-align:right}.td-calendar__range-summary small,.td-calendar__range-summary strong{display:block}.td-calendar__range-summary small{color:#748096;font-size:.58rem}.td-calendar__range-summary strong{overflow:hidden;margin-top:.12rem;font-size:.67rem;text-overflow:ellipsis;white-space:nowrap}.td-calendar__weekdays,.td-calendar__grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.td-calendar__weekdays{margin-top:.55rem}.td-calendar__weekdays span{padding:.35rem 0;color:#8791a4;font-size:.59rem;font-weight:800;text-align:center}.td-calendar__day{position:relative;display:grid;min-width:0;aspect-ratio:1;place-items:center;border:0;border-radius:.6rem;color:inherit;background:transparent;font:650 .7rem/1 system-ui,sans-serif;cursor:pointer}.td-calendar__day:hover:not(:disabled){color:#5746d8;background:#f0eeff}.td-calendar__day--outside{color:#b4bac6}.td-calendar__day--today{box-shadow:inset 0 0 0 1px #8d80e8}.td-calendar__day--range{border-radius:0;color:#5746d8;background:#efedff}.td-calendar__day--selected,.td-calendar__day--range-start,.td-calendar__day--range-end{border-radius:.6rem;color:#fff;background:#5746d8;box-shadow:0 5px 12px #5746d83d}.td-calendar__day:disabled{opacity:.3;cursor:not-allowed}.td-calendar__selector-grid{display:grid;min-height:15.75rem;align-content:center;gap:.45rem;padding:.75rem .15rem}.td-calendar__selector-grid--months,.td-calendar__selector-grid--years{grid-template-columns:repeat(3,minmax(0,1fr))}.td-calendar__selector-grid button{min-height:3.15rem;border:0;border-radius:.7rem;color:inherit;background:transparent;font:700 .72rem/1 system-ui,sans-serif;cursor:pointer}.td-calendar__selector-grid button:hover:not(:disabled){color:#5746d8;background:#f0eeff}.td-calendar--dark .td-calendar__selector-grid button:hover:not(:disabled){color:#b9b0fa;background:#2b293d}.td-calendar__selector-grid button:disabled{opacity:.28;cursor:not-allowed}.td-calendar__selector--active{color:#fff!important;background:#5746d8!important;box-shadow:0 5px 12px #5746d838}.td-calendar__selector--today:not(.td-calendar__selector--active){box-shadow:inset 0 0 0 1px #8d80e8}.td-calendar__footer{display:flex;justify-content:space-between;margin-top:.55rem;border-top:1px solid #e6e9f0;padding-top:.55rem}.td-calendar--dark .td-calendar__footer{border-color:#34343e}.td-calendar__text-action{border-radius:.5rem!important;padding:.45rem .6rem;color:#5746d8!important;font-size:.68rem;font-weight:750}.td-calendar__text-action:hover{background:#f2f0ff!important}@keyframes td-calendar-in{0%{opacity:0;transform:translateY(-.25rem) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@media(max-width:600px){.td-calendar{width:calc(100vw - 1rem);border-radius:.9rem}}@media(prefers-reduced-motion:reduce){.td-calendar{animation:none}}\n"], dependencies: [{ kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation", "cdkConnectedOverlayUsePopover", "cdkConnectedOverlayMatchWidth", "cdkConnectedOverlay"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }, { kind: "component", type: TdIcon, selector: "td-icon", inputs: ["nombre", "titulo", "tamano"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1400
|
+
}
|
|
1401
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdDatePicker, decorators: [{
|
|
1402
|
+
type: Component,
|
|
1403
|
+
args: [{ selector: 'td-date-picker', imports: [CdkConnectedOverlay, CdkOverlayOrigin, TdIcon], template: `
|
|
1404
|
+
<div
|
|
1405
|
+
cdkOverlayOrigin
|
|
1406
|
+
#origin="cdkOverlayOrigin"
|
|
1407
|
+
class="td-date-picker"
|
|
1408
|
+
[class.td-date-picker--open]="open"
|
|
1409
|
+
[class.td-date-picker--error]="hasError()"
|
|
1410
|
+
[class.td-date-picker--disabled]="isDisabled()"
|
|
1411
|
+
[class.td-date-picker--dark]="dark"
|
|
1412
|
+
>
|
|
1413
|
+
<label [id]="labelId">{{ label }}</label>
|
|
1414
|
+
<button
|
|
1415
|
+
type="button"
|
|
1416
|
+
class="td-date-picker__trigger"
|
|
1417
|
+
[disabled]="isDisabled()"
|
|
1418
|
+
[attr.aria-labelledby]="labelId"
|
|
1419
|
+
[attr.aria-expanded]="open"
|
|
1420
|
+
[attr.aria-controls]="calendarId"
|
|
1421
|
+
(click)="toggle()"
|
|
1422
|
+
(keydown)="handleTriggerKeydown($event)"
|
|
1423
|
+
>
|
|
1424
|
+
<td-icon nombre="calendar" />
|
|
1425
|
+
<span [class.td-date-picker__placeholder]="!displayValue">
|
|
1426
|
+
{{ displayValue || placeholder }}
|
|
1427
|
+
</span>
|
|
1428
|
+
@if (clearable && value() && !isDisabled() && !readonly()) {
|
|
1429
|
+
<span
|
|
1430
|
+
class="td-date-picker__clear"
|
|
1431
|
+
role="button"
|
|
1432
|
+
tabindex="-1"
|
|
1433
|
+
aria-label="Limpiar fecha"
|
|
1434
|
+
(click)="clear($event)"
|
|
1435
|
+
>
|
|
1436
|
+
<td-icon nombre="close" tamano=".92rem" />
|
|
1437
|
+
</span>
|
|
1438
|
+
}
|
|
1439
|
+
<td-icon
|
|
1440
|
+
class="td-date-picker__chevron"
|
|
1441
|
+
[class.td-date-picker__chevron--open]="open"
|
|
1442
|
+
nombre="chevron_down"
|
|
1443
|
+
/>
|
|
1444
|
+
</button>
|
|
1445
|
+
</div>
|
|
1446
|
+
|
|
1447
|
+
@if (displayError() || hint) {
|
|
1448
|
+
<p class="td-date-picker__message" [class.td-date-picker__message--error]="hasError()">
|
|
1449
|
+
{{ displayError() || hint }}
|
|
1450
|
+
</p>
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
<ng-template
|
|
1454
|
+
cdkConnectedOverlay
|
|
1455
|
+
[cdkConnectedOverlayOrigin]="origin"
|
|
1456
|
+
[cdkConnectedOverlayOpen]="open"
|
|
1457
|
+
[cdkConnectedOverlayScrollStrategy]="scrollStrategy"
|
|
1458
|
+
[cdkConnectedOverlayMatchWidth]="false"
|
|
1459
|
+
[cdkConnectedOverlayViewportMargin]="8"
|
|
1460
|
+
[cdkConnectedOverlayPush]="true"
|
|
1461
|
+
(overlayOutsideClick)="close()"
|
|
1462
|
+
(overlayKeydown)="handleOverlayKeydown($event)"
|
|
1463
|
+
(detach)="close()"
|
|
1464
|
+
>
|
|
1465
|
+
<section
|
|
1466
|
+
class="td-calendar"
|
|
1467
|
+
[class.td-calendar--dark]="dark"
|
|
1468
|
+
[id]="calendarId"
|
|
1469
|
+
role="dialog"
|
|
1470
|
+
aria-modal="true"
|
|
1471
|
+
[attr.aria-label]="mode === 'rango' ? 'Seleccionar rango de fechas' : 'Seleccionar fecha'"
|
|
1472
|
+
>
|
|
1473
|
+
<header class="td-calendar__header">
|
|
1474
|
+
<button type="button" [attr.aria-label]="previousLabel" (click)="previousPage()">
|
|
1475
|
+
<td-icon nombre="chevron_left" />
|
|
1476
|
+
</button>
|
|
1477
|
+
<button
|
|
1478
|
+
type="button"
|
|
1479
|
+
class="td-calendar__period"
|
|
1480
|
+
[attr.aria-label]="periodButtonLabel"
|
|
1481
|
+
(click)="changeCalendarView()"
|
|
1482
|
+
>
|
|
1483
|
+
{{ periodLabel }}
|
|
1484
|
+
@if (calendarView !== 'anios') {
|
|
1485
|
+
<td-icon nombre="chevron_down" tamano=".85rem" />
|
|
1486
|
+
}
|
|
1487
|
+
</button>
|
|
1488
|
+
<button type="button" [attr.aria-label]="nextLabel" (click)="nextPage()">
|
|
1489
|
+
<td-icon nombre="chevron_right" />
|
|
1490
|
+
</button>
|
|
1491
|
+
</header>
|
|
1492
|
+
|
|
1493
|
+
@if (mode === 'rango') {
|
|
1494
|
+
<div class="td-calendar__range-summary">
|
|
1495
|
+
<span><small>Desde</small><strong>{{ rangeStartLabel }}</strong></span>
|
|
1496
|
+
<td-icon nombre="arrow_forward" />
|
|
1497
|
+
<span><small>Hasta</small><strong>{{ rangeEndLabel }}</strong></span>
|
|
1498
|
+
</div>
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
@if (calendarView === 'dias') {
|
|
1502
|
+
<div class="td-calendar__weekdays" aria-hidden="true">
|
|
1503
|
+
@for (weekday of weekdays; track weekday) {
|
|
1504
|
+
<span>{{ weekday }}</span>
|
|
1505
|
+
}
|
|
1506
|
+
</div>
|
|
1507
|
+
|
|
1508
|
+
<div class="td-calendar__grid">
|
|
1509
|
+
@for (date of days; track date.iso) {
|
|
1510
|
+
<button
|
|
1511
|
+
type="button"
|
|
1512
|
+
class="td-calendar__day"
|
|
1513
|
+
[class.td-calendar__day--outside]="!date.currentMonth"
|
|
1514
|
+
[class.td-calendar__day--today]="date.today"
|
|
1515
|
+
[class.td-calendar__day--selected]="isSelected(date.iso)"
|
|
1516
|
+
[class.td-calendar__day--range]="isInRange(date.iso)"
|
|
1517
|
+
[class.td-calendar__day--range-start]="isRangeStart(date.iso)"
|
|
1518
|
+
[class.td-calendar__day--range-end]="isRangeEnd(date.iso)"
|
|
1519
|
+
[disabled]="date.disabled"
|
|
1520
|
+
[attr.aria-label]="formatLong(date.iso)"
|
|
1521
|
+
[attr.aria-pressed]="isSelected(date.iso)"
|
|
1522
|
+
(mouseenter)="hoveredDate = date.iso"
|
|
1523
|
+
(mouseleave)="hoveredDate = null"
|
|
1524
|
+
(click)="selectDate(date)"
|
|
1525
|
+
>
|
|
1526
|
+
{{ date.day }}
|
|
1527
|
+
</button>
|
|
1528
|
+
}
|
|
1529
|
+
</div>
|
|
1530
|
+
} @else if (calendarView === 'meses') {
|
|
1531
|
+
<div class="td-calendar__selector-grid td-calendar__selector-grid--months">
|
|
1532
|
+
@for (month of months; track month.index) {
|
|
1533
|
+
<button
|
|
1534
|
+
type="button"
|
|
1535
|
+
[class.td-calendar__selector--active]="month.index === viewDate.getMonth()"
|
|
1536
|
+
[disabled]="month.disabled"
|
|
1537
|
+
(click)="selectMonth(month.index)"
|
|
1538
|
+
>
|
|
1539
|
+
{{ month.label }}
|
|
1540
|
+
</button>
|
|
1541
|
+
}
|
|
1542
|
+
</div>
|
|
1543
|
+
} @else {
|
|
1544
|
+
<div class="td-calendar__selector-grid td-calendar__selector-grid--years">
|
|
1545
|
+
@for (year of years; track year.value) {
|
|
1546
|
+
<button
|
|
1547
|
+
type="button"
|
|
1548
|
+
[class.td-calendar__selector--active]="year.value === viewDate.getFullYear()"
|
|
1549
|
+
[class.td-calendar__selector--today]="year.value === currentYear"
|
|
1550
|
+
[disabled]="year.disabled"
|
|
1551
|
+
(click)="selectYear(year.value)"
|
|
1552
|
+
>
|
|
1553
|
+
{{ year.value }}
|
|
1554
|
+
</button>
|
|
1555
|
+
}
|
|
1556
|
+
</div>
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
<footer class="td-calendar__footer">
|
|
1560
|
+
<button type="button" class="td-calendar__text-action" (click)="goToday()">
|
|
1561
|
+
Hoy
|
|
1562
|
+
</button>
|
|
1563
|
+
<button type="button" class="td-calendar__text-action" (click)="close()">
|
|
1564
|
+
Cerrar
|
|
1565
|
+
</button>
|
|
1566
|
+
</footer>
|
|
1567
|
+
</section>
|
|
1568
|
+
</ng-template>
|
|
1569
|
+
`, providers: [
|
|
1570
|
+
{
|
|
1571
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1572
|
+
useExisting: forwardRef(() => TdDatePicker),
|
|
1573
|
+
multi: true,
|
|
1574
|
+
},
|
|
1575
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-date-picker{--td-date-bg: #fff;--td-date-border: #dfe3eb;--td-date-text: #263147;--td-date-muted: #748096;position:relative;min-height:3.15rem;border:1px solid var(--td-date-border);border-radius:.78rem;background:var(--td-date-bg);transition:border-color .14s ease,box-shadow .14s ease}.td-date-picker--dark{--td-date-bg: #19191f;--td-date-border: #34343e;--td-date-text: #ededf0;--td-date-muted: #a1a1aa}.td-date-picker:hover:not(.td-date-picker--disabled){border-color:#8d80e8}.td-date-picker--open{border-color:#5746d8;box-shadow:0 0 0 3px #5746d821}.td-date-picker--error{border-color:#d33f3f;box-shadow:0 0 0 3px #d33f3f1a}.td-date-picker--disabled{opacity:.58;background:#f5f6f8}.td-date-picker>label{position:absolute;z-index:1;top:-.48rem;left:.72rem;padding:0 .35rem;color:var(--td-date-muted);background:var(--td-date-bg);font-size:.65rem;font-weight:750;line-height:1}.td-date-picker--open>label{color:#5746d8}.td-date-picker--error>label{color:#d33f3f}.td-date-picker__trigger{display:flex;width:100%;min-height:3.05rem;align-items:center;gap:.55rem;border:0;border-radius:inherit;padding:.3rem .7rem;color:var(--td-date-text);background:transparent;font:550 .78rem/1.25 system-ui,sans-serif;text-align:left;cursor:pointer}.td-date-picker__trigger>span:not(.td-date-picker__clear){min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.td-date-picker__placeholder{color:color-mix(in srgb,var(--td-date-muted) 72%,transparent)}.td-date-picker__trigger>td-icon{color:var(--td-date-muted)}.td-date-picker__chevron{transition:transform .14s ease}.td-date-picker__chevron--open{transform:rotate(180deg)}.td-date-picker__clear{display:grid;width:1.8rem;height:1.8rem;flex:0 0 auto;place-items:center;border-radius:.45rem;color:var(--td-date-muted)}.td-date-picker__clear:hover{color:#5746d8;background:#f2f0ff}.td-date-picker__message{margin:.38rem .75rem 0;color:#748096;font-size:.66rem}.td-date-picker__message--error{color:#c43636}.td-calendar{width:min(21rem,100vw - 1rem);overflow:hidden;border:1px solid #e1e5ee;border-radius:1rem;padding:.8rem;color:#263147;background:#fff;box-shadow:0 22px 55px #0f172a33;font-family:Inter,ui-sans-serif,system-ui,sans-serif;animation:td-calendar-in .14s ease-out}.td-calendar--dark{border-color:#34343e;color:#ededf0;background:#202028}.td-calendar__header{display:grid;grid-template-columns:2.35rem 1fr 2.35rem;align-items:center;gap:.35rem}.td-calendar__header button,.td-calendar__footer button{border:0;color:inherit;background:transparent;cursor:pointer}.td-calendar__header button{display:grid;width:2.35rem;height:2.35rem;place-items:center;border-radius:.65rem}.td-calendar__header .td-calendar__period{display:inline-flex;width:auto;min-width:0;height:2.35rem;align-items:center;justify-content:center;gap:.35rem;padding:0 .65rem;font-size:.82rem;font-weight:800}.td-calendar__header button:hover{color:#5746d8;background:#f2f0ff}.td-calendar--dark .td-calendar__header button:hover{background:#2b293d}.td-calendar__range-summary{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:.55rem;margin:.65rem 0 .35rem;border-radius:.72rem;padding:.55rem .65rem;background:#f7f7fb}.td-calendar--dark .td-calendar__range-summary{background:#292931}.td-calendar__range-summary span{min-width:0}.td-calendar__range-summary span:last-child{text-align:right}.td-calendar__range-summary small,.td-calendar__range-summary strong{display:block}.td-calendar__range-summary small{color:#748096;font-size:.58rem}.td-calendar__range-summary strong{overflow:hidden;margin-top:.12rem;font-size:.67rem;text-overflow:ellipsis;white-space:nowrap}.td-calendar__weekdays,.td-calendar__grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.td-calendar__weekdays{margin-top:.55rem}.td-calendar__weekdays span{padding:.35rem 0;color:#8791a4;font-size:.59rem;font-weight:800;text-align:center}.td-calendar__day{position:relative;display:grid;min-width:0;aspect-ratio:1;place-items:center;border:0;border-radius:.6rem;color:inherit;background:transparent;font:650 .7rem/1 system-ui,sans-serif;cursor:pointer}.td-calendar__day:hover:not(:disabled){color:#5746d8;background:#f0eeff}.td-calendar__day--outside{color:#b4bac6}.td-calendar__day--today{box-shadow:inset 0 0 0 1px #8d80e8}.td-calendar__day--range{border-radius:0;color:#5746d8;background:#efedff}.td-calendar__day--selected,.td-calendar__day--range-start,.td-calendar__day--range-end{border-radius:.6rem;color:#fff;background:#5746d8;box-shadow:0 5px 12px #5746d83d}.td-calendar__day:disabled{opacity:.3;cursor:not-allowed}.td-calendar__selector-grid{display:grid;min-height:15.75rem;align-content:center;gap:.45rem;padding:.75rem .15rem}.td-calendar__selector-grid--months,.td-calendar__selector-grid--years{grid-template-columns:repeat(3,minmax(0,1fr))}.td-calendar__selector-grid button{min-height:3.15rem;border:0;border-radius:.7rem;color:inherit;background:transparent;font:700 .72rem/1 system-ui,sans-serif;cursor:pointer}.td-calendar__selector-grid button:hover:not(:disabled){color:#5746d8;background:#f0eeff}.td-calendar--dark .td-calendar__selector-grid button:hover:not(:disabled){color:#b9b0fa;background:#2b293d}.td-calendar__selector-grid button:disabled{opacity:.28;cursor:not-allowed}.td-calendar__selector--active{color:#fff!important;background:#5746d8!important;box-shadow:0 5px 12px #5746d838}.td-calendar__selector--today:not(.td-calendar__selector--active){box-shadow:inset 0 0 0 1px #8d80e8}.td-calendar__footer{display:flex;justify-content:space-between;margin-top:.55rem;border-top:1px solid #e6e9f0;padding-top:.55rem}.td-calendar--dark .td-calendar__footer{border-color:#34343e}.td-calendar__text-action{border-radius:.5rem!important;padding:.45rem .6rem;color:#5746d8!important;font-size:.68rem;font-weight:750}.td-calendar__text-action:hover{background:#f2f0ff!important}@keyframes td-calendar-in{0%{opacity:0;transform:translateY(-.25rem) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}@media(max-width:600px){.td-calendar{width:calc(100vw - 1rem);border-radius:.9rem}}@media(prefers-reduced-motion:reduce){.td-calendar{animation:none}}\n"] }]
|
|
1576
|
+
}], propDecorators: { label: [{
|
|
1577
|
+
type: Input
|
|
1578
|
+
}], placeholder: [{
|
|
1579
|
+
type: Input
|
|
1580
|
+
}], mode: [{
|
|
1581
|
+
type: Input
|
|
1582
|
+
}], hint: [{
|
|
1583
|
+
type: Input
|
|
1584
|
+
}], error: [{
|
|
1585
|
+
type: Input
|
|
1586
|
+
}], minDate: [{
|
|
1587
|
+
type: Input,
|
|
1588
|
+
args: [{ alias: 'min' }]
|
|
1589
|
+
}], maxDate: [{
|
|
1590
|
+
type: Input,
|
|
1591
|
+
args: [{ alias: 'max' }]
|
|
1592
|
+
}], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], clearable: [{
|
|
1593
|
+
type: Input
|
|
1594
|
+
}], dark: [{
|
|
1595
|
+
type: Input
|
|
1596
|
+
}], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], selectionChange: [{
|
|
1597
|
+
type: Output
|
|
1598
|
+
}], openedChange: [{
|
|
1599
|
+
type: Output
|
|
1600
|
+
}] } });
|
|
1601
|
+
|
|
866
1602
|
const TD_DIALOG_DATA = new InjectionToken('TD_DIALOG_DATA');
|
|
867
1603
|
const TD_DIALOG_CONFIG = new InjectionToken('TD_DIALOG_CONFIG');
|
|
868
1604
|
|
|
@@ -1212,7 +1948,7 @@ class TdInput {
|
|
|
1212
1948
|
cdr = inject(ChangeDetectorRef);
|
|
1213
1949
|
generatedId = `td-input-${++inputSequence}`;
|
|
1214
1950
|
id = '';
|
|
1215
|
-
name = '';
|
|
1951
|
+
name = input('', ...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
1216
1952
|
label = 'Campo';
|
|
1217
1953
|
type = 'text';
|
|
1218
1954
|
placeholder = '';
|
|
@@ -1220,25 +1956,31 @@ class TdInput {
|
|
|
1220
1956
|
icon = '';
|
|
1221
1957
|
hint = '';
|
|
1222
1958
|
error = '';
|
|
1223
|
-
readonly = false;
|
|
1224
|
-
disabled = false;
|
|
1225
|
-
required = false;
|
|
1959
|
+
readonly = input(false, ...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
1960
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
1961
|
+
required = input(false, ...(ngDevMode ? [{ debugName: "required" }] : /* istanbul ignore next */ []));
|
|
1962
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
1963
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
1964
|
+
touch = output();
|
|
1226
1965
|
clearable = false;
|
|
1227
1966
|
dark = false;
|
|
1228
|
-
|
|
1229
|
-
|
|
1967
|
+
minValue = null;
|
|
1968
|
+
maxValue = null;
|
|
1230
1969
|
step = null;
|
|
1231
1970
|
minlength = null;
|
|
1232
1971
|
maxlength = null;
|
|
1233
|
-
|
|
1234
|
-
|
|
1972
|
+
value = model('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
1973
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
1974
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
1975
|
+
displayError = computed(() => this.error || this.errors()[0]?.message || '', ...(ngDevMode ? [{ debugName: "displayError" }] : /* istanbul ignore next */ []));
|
|
1976
|
+
hasError = computed(() => this.invalid() || !!this.displayError(), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
1235
1977
|
focused = false;
|
|
1236
1978
|
passwordVisible = false;
|
|
1237
1979
|
get inputId() {
|
|
1238
1980
|
return this.id || this.generatedId;
|
|
1239
1981
|
}
|
|
1240
1982
|
get descriptionId() {
|
|
1241
|
-
return this.
|
|
1983
|
+
return this.displayError() || this.hint ? `${this.inputId}-description` : null;
|
|
1242
1984
|
}
|
|
1243
1985
|
get resolvedType() {
|
|
1244
1986
|
return this.type === 'password' && this.passwordVisible ? 'text' : this.type;
|
|
@@ -1246,7 +1988,7 @@ class TdInput {
|
|
|
1246
1988
|
onChange = () => undefined;
|
|
1247
1989
|
onTouched = () => undefined;
|
|
1248
1990
|
writeValue(value) {
|
|
1249
|
-
this.value
|
|
1991
|
+
this.value.set(value === null || value === undefined ? '' : String(value));
|
|
1250
1992
|
this.cdr.markForCheck();
|
|
1251
1993
|
}
|
|
1252
1994
|
registerOnChange(fn) {
|
|
@@ -1256,7 +1998,7 @@ class TdInput {
|
|
|
1256
1998
|
this.onTouched = fn;
|
|
1257
1999
|
}
|
|
1258
2000
|
setDisabledState(disabled) {
|
|
1259
|
-
this.disabled
|
|
2001
|
+
this.cvaDisabled.set(disabled);
|
|
1260
2002
|
this.cdr.markForCheck();
|
|
1261
2003
|
}
|
|
1262
2004
|
handleInput(event) {
|
|
@@ -1265,17 +2007,17 @@ class TdInput {
|
|
|
1265
2007
|
handleBlur() {
|
|
1266
2008
|
this.focused = false;
|
|
1267
2009
|
this.onTouched();
|
|
2010
|
+
this.touch.emit();
|
|
1268
2011
|
}
|
|
1269
2012
|
clear() {
|
|
1270
2013
|
this.setValue('');
|
|
1271
2014
|
}
|
|
1272
2015
|
setValue(value) {
|
|
1273
|
-
this.value
|
|
2016
|
+
this.value.set(value);
|
|
1274
2017
|
this.onChange(value);
|
|
1275
|
-
this.valueChange.emit(value);
|
|
1276
2018
|
}
|
|
1277
2019
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdInput, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1278
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdInput, isStandalone: true, selector: "td-input", inputs: { id: "id", name: "name", label: "label", type: "type", placeholder: "placeholder", autocomplete: "autocomplete", icon: "icon", hint: "hint", error: "error", readonly: "readonly", disabled: "disabled", required: "required", clearable: "clearable", dark: "dark",
|
|
2020
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdInput, isStandalone: true, selector: "td-input", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: false, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: false, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: false, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, dark: { classPropertyName: "dark", publicName: "dark", isSignal: false, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "min", isSignal: false, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "max", isSignal: false, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: false, isRequired: false, transformFunction: null }, minlength: { classPropertyName: "minlength", publicName: "minlength", isSignal: false, isRequired: false, transformFunction: null }, maxlength: { classPropertyName: "maxlength", publicName: "maxlength", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", value: "valueChange" }, providers: [
|
|
1279
2021
|
{
|
|
1280
2022
|
provide: NG_VALUE_ACCESSOR,
|
|
1281
2023
|
useExisting: forwardRef(() => TdInput),
|
|
@@ -1285,8 +2027,8 @@ class TdInput {
|
|
|
1285
2027
|
<div
|
|
1286
2028
|
class="td-input"
|
|
1287
2029
|
[class.td-input--focused]="focused"
|
|
1288
|
-
[class.td-input--error]="
|
|
1289
|
-
[class.td-input--disabled]="
|
|
2030
|
+
[class.td-input--error]="hasError()"
|
|
2031
|
+
[class.td-input--disabled]="isDisabled()"
|
|
1290
2032
|
[class.td-input--dark]="dark"
|
|
1291
2033
|
>
|
|
1292
2034
|
<label [for]="inputId">{{ label }}</label>
|
|
@@ -1298,27 +2040,27 @@ class TdInput {
|
|
|
1298
2040
|
|
|
1299
2041
|
<input
|
|
1300
2042
|
[id]="inputId"
|
|
1301
|
-
[name]="name"
|
|
2043
|
+
[name]="name()"
|
|
1302
2044
|
[type]="resolvedType"
|
|
1303
|
-
[value]="value"
|
|
2045
|
+
[value]="value()"
|
|
1304
2046
|
[placeholder]="placeholder"
|
|
1305
2047
|
[autocomplete]="autocomplete"
|
|
1306
|
-
[disabled]="
|
|
1307
|
-
[readonly]="readonly"
|
|
1308
|
-
[required]="required"
|
|
1309
|
-
[min]="
|
|
1310
|
-
[max]="
|
|
2048
|
+
[disabled]="isDisabled()"
|
|
2049
|
+
[readonly]="readonly()"
|
|
2050
|
+
[required]="required()"
|
|
2051
|
+
[min]="minValue"
|
|
2052
|
+
[max]="maxValue"
|
|
1311
2053
|
[step]="step"
|
|
1312
2054
|
[attr.minlength]="minlength"
|
|
1313
2055
|
[attr.maxlength]="maxlength"
|
|
1314
2056
|
[attr.aria-describedby]="descriptionId"
|
|
1315
|
-
[attr.aria-invalid]="
|
|
2057
|
+
[attr.aria-invalid]="hasError()"
|
|
1316
2058
|
(input)="handleInput($event)"
|
|
1317
2059
|
(focus)="focused = true"
|
|
1318
2060
|
(blur)="handleBlur()"
|
|
1319
2061
|
/>
|
|
1320
2062
|
|
|
1321
|
-
@if (clearable && value && !
|
|
2063
|
+
@if (clearable && value() && !isDisabled() && !readonly()) {
|
|
1322
2064
|
<button type="button" class="td-input__action" title="Limpiar" (click)="clear()">
|
|
1323
2065
|
<td-icon nombre="close" tamano=".95rem" />
|
|
1324
2066
|
</button>
|
|
@@ -1337,13 +2079,13 @@ class TdInput {
|
|
|
1337
2079
|
</div>
|
|
1338
2080
|
</div>
|
|
1339
2081
|
|
|
1340
|
-
@if (
|
|
2082
|
+
@if (displayError() || hint) {
|
|
1341
2083
|
<p
|
|
1342
2084
|
class="td-input__message"
|
|
1343
|
-
[class.td-input__message--error]="
|
|
2085
|
+
[class.td-input__message--error]="hasError()"
|
|
1344
2086
|
[id]="descriptionId"
|
|
1345
2087
|
>
|
|
1346
|
-
{{
|
|
2088
|
+
{{ displayError() || hint }}
|
|
1347
2089
|
</p>
|
|
1348
2090
|
}
|
|
1349
2091
|
`, isInline: true, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-input{--td-input-bg: #fff;--td-input-border: #dfe3eb;--td-input-text: #263147;--td-input-muted: #748096;position:relative;display:flex;min-height:3.15rem;align-items:center;border:1px solid var(--td-input-border);border-radius:.78rem;background:var(--td-input-bg);transition:border-color .14s ease,box-shadow .14s ease,background .14s ease}.td-input--dark{--td-input-bg: #19191f;--td-input-border: #34343e;--td-input-text: #ededf0;--td-input-muted: #a1a1aa;color-scheme:dark}.td-input:hover:not(.td-input--disabled){border-color:color-mix(in srgb,#5746d8 42%,var(--td-input-border))}.td-input--focused{border-color:#5746d8;box-shadow:0 0 0 3px #5746d821}.td-input--error{border-color:#d33f3f;box-shadow:0 0 0 3px #d33f3f1a}.td-input--disabled{opacity:.58;background:#f5f6f8;cursor:not-allowed}.td-input label{position:absolute;z-index:1;top:-.48rem;left:.72rem;max-width:calc(100% - 1.4rem);overflow:hidden;padding:0 .35rem;color:var(--td-input-muted);background:var(--td-input-bg);font-size:.65rem;font-weight:750;line-height:1;text-overflow:ellipsis;white-space:nowrap}.td-input--focused label{color:#5746d8}.td-input--error label{color:#d33f3f}.td-input__control{display:flex;width:100%;min-width:0;align-items:center;gap:.55rem;padding:.25rem .7rem}.td-input__icon{flex:0 0 auto;color:var(--td-input-muted)}input{width:100%;min-width:0;height:2.55rem;border:0;outline:0;color:var(--td-input-text);background:transparent;font:550 .78rem/1 system-ui,sans-serif}input::placeholder{color:color-mix(in srgb,var(--td-input-muted) 72%,transparent)}input:disabled{cursor:not-allowed}input[type=search]::-webkit-search-cancel-button{display:none}.td-input__action{display:grid;width:2rem;height:2rem;flex:0 0 auto;place-items:center;border:0;border-radius:.5rem;color:var(--td-input-muted);background:transparent;cursor:pointer}.td-input__action:hover{color:#5746d8;background:#f2f0ff}.td-input--dark .td-input__action:hover{color:#b9b0fa;background:#292931}.td-input__message{margin:.38rem .75rem 0;color:#748096;font-size:.66rem;line-height:1.4}.td-input__message--error{color:#c43636}\n"], dependencies: [{ kind: "component", type: TdIcon, selector: "td-icon", inputs: ["nombre", "titulo", "tamano"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -1354,8 +2096,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1354
2096
|
<div
|
|
1355
2097
|
class="td-input"
|
|
1356
2098
|
[class.td-input--focused]="focused"
|
|
1357
|
-
[class.td-input--error]="
|
|
1358
|
-
[class.td-input--disabled]="
|
|
2099
|
+
[class.td-input--error]="hasError()"
|
|
2100
|
+
[class.td-input--disabled]="isDisabled()"
|
|
1359
2101
|
[class.td-input--dark]="dark"
|
|
1360
2102
|
>
|
|
1361
2103
|
<label [for]="inputId">{{ label }}</label>
|
|
@@ -1367,27 +2109,27 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1367
2109
|
|
|
1368
2110
|
<input
|
|
1369
2111
|
[id]="inputId"
|
|
1370
|
-
[name]="name"
|
|
2112
|
+
[name]="name()"
|
|
1371
2113
|
[type]="resolvedType"
|
|
1372
|
-
[value]="value"
|
|
2114
|
+
[value]="value()"
|
|
1373
2115
|
[placeholder]="placeholder"
|
|
1374
2116
|
[autocomplete]="autocomplete"
|
|
1375
|
-
[disabled]="
|
|
1376
|
-
[readonly]="readonly"
|
|
1377
|
-
[required]="required"
|
|
1378
|
-
[min]="
|
|
1379
|
-
[max]="
|
|
2117
|
+
[disabled]="isDisabled()"
|
|
2118
|
+
[readonly]="readonly()"
|
|
2119
|
+
[required]="required()"
|
|
2120
|
+
[min]="minValue"
|
|
2121
|
+
[max]="maxValue"
|
|
1380
2122
|
[step]="step"
|
|
1381
2123
|
[attr.minlength]="minlength"
|
|
1382
2124
|
[attr.maxlength]="maxlength"
|
|
1383
2125
|
[attr.aria-describedby]="descriptionId"
|
|
1384
|
-
[attr.aria-invalid]="
|
|
2126
|
+
[attr.aria-invalid]="hasError()"
|
|
1385
2127
|
(input)="handleInput($event)"
|
|
1386
2128
|
(focus)="focused = true"
|
|
1387
2129
|
(blur)="handleBlur()"
|
|
1388
2130
|
/>
|
|
1389
2131
|
|
|
1390
|
-
@if (clearable && value && !
|
|
2132
|
+
@if (clearable && value() && !isDisabled() && !readonly()) {
|
|
1391
2133
|
<button type="button" class="td-input__action" title="Limpiar" (click)="clear()">
|
|
1392
2134
|
<td-icon nombre="close" tamano=".95rem" />
|
|
1393
2135
|
</button>
|
|
@@ -1406,13 +2148,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1406
2148
|
</div>
|
|
1407
2149
|
</div>
|
|
1408
2150
|
|
|
1409
|
-
@if (
|
|
2151
|
+
@if (displayError() || hint) {
|
|
1410
2152
|
<p
|
|
1411
2153
|
class="td-input__message"
|
|
1412
|
-
[class.td-input__message--error]="
|
|
2154
|
+
[class.td-input__message--error]="hasError()"
|
|
1413
2155
|
[id]="descriptionId"
|
|
1414
2156
|
>
|
|
1415
|
-
{{
|
|
2157
|
+
{{ displayError() || hint }}
|
|
1416
2158
|
</p>
|
|
1417
2159
|
}
|
|
1418
2160
|
`, providers: [
|
|
@@ -1424,9 +2166,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1424
2166
|
], changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-input{--td-input-bg: #fff;--td-input-border: #dfe3eb;--td-input-text: #263147;--td-input-muted: #748096;position:relative;display:flex;min-height:3.15rem;align-items:center;border:1px solid var(--td-input-border);border-radius:.78rem;background:var(--td-input-bg);transition:border-color .14s ease,box-shadow .14s ease,background .14s ease}.td-input--dark{--td-input-bg: #19191f;--td-input-border: #34343e;--td-input-text: #ededf0;--td-input-muted: #a1a1aa;color-scheme:dark}.td-input:hover:not(.td-input--disabled){border-color:color-mix(in srgb,#5746d8 42%,var(--td-input-border))}.td-input--focused{border-color:#5746d8;box-shadow:0 0 0 3px #5746d821}.td-input--error{border-color:#d33f3f;box-shadow:0 0 0 3px #d33f3f1a}.td-input--disabled{opacity:.58;background:#f5f6f8;cursor:not-allowed}.td-input label{position:absolute;z-index:1;top:-.48rem;left:.72rem;max-width:calc(100% - 1.4rem);overflow:hidden;padding:0 .35rem;color:var(--td-input-muted);background:var(--td-input-bg);font-size:.65rem;font-weight:750;line-height:1;text-overflow:ellipsis;white-space:nowrap}.td-input--focused label{color:#5746d8}.td-input--error label{color:#d33f3f}.td-input__control{display:flex;width:100%;min-width:0;align-items:center;gap:.55rem;padding:.25rem .7rem}.td-input__icon{flex:0 0 auto;color:var(--td-input-muted)}input{width:100%;min-width:0;height:2.55rem;border:0;outline:0;color:var(--td-input-text);background:transparent;font:550 .78rem/1 system-ui,sans-serif}input::placeholder{color:color-mix(in srgb,var(--td-input-muted) 72%,transparent)}input:disabled{cursor:not-allowed}input[type=search]::-webkit-search-cancel-button{display:none}.td-input__action{display:grid;width:2rem;height:2rem;flex:0 0 auto;place-items:center;border:0;border-radius:.5rem;color:var(--td-input-muted);background:transparent;cursor:pointer}.td-input__action:hover{color:#5746d8;background:#f2f0ff}.td-input--dark .td-input__action:hover{color:#b9b0fa;background:#292931}.td-input__message{margin:.38rem .75rem 0;color:#748096;font-size:.66rem;line-height:1.4}.td-input__message--error{color:#c43636}\n"] }]
|
|
1425
2167
|
}], propDecorators: { id: [{
|
|
1426
2168
|
type: Input
|
|
1427
|
-
}], name: [{
|
|
1428
|
-
type: Input
|
|
1429
|
-
}], label: [{
|
|
2169
|
+
}], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], label: [{
|
|
1430
2170
|
type: Input
|
|
1431
2171
|
}], type: [{
|
|
1432
2172
|
type: Input
|
|
@@ -1440,31 +2180,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1440
2180
|
type: Input
|
|
1441
2181
|
}], error: [{
|
|
1442
2182
|
type: Input
|
|
1443
|
-
}], readonly: [{
|
|
1444
|
-
type: Input
|
|
1445
|
-
}], disabled: [{
|
|
1446
|
-
type: Input
|
|
1447
|
-
}], required: [{
|
|
1448
|
-
type: Input
|
|
1449
|
-
}], clearable: [{
|
|
2183
|
+
}], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], clearable: [{
|
|
1450
2184
|
type: Input
|
|
1451
2185
|
}], dark: [{
|
|
1452
2186
|
type: Input
|
|
1453
|
-
}],
|
|
1454
|
-
type: Input
|
|
1455
|
-
|
|
1456
|
-
|
|
2187
|
+
}], minValue: [{
|
|
2188
|
+
type: Input,
|
|
2189
|
+
args: [{ alias: 'min' }]
|
|
2190
|
+
}], maxValue: [{
|
|
2191
|
+
type: Input,
|
|
2192
|
+
args: [{ alias: 'max' }]
|
|
1457
2193
|
}], step: [{
|
|
1458
2194
|
type: Input
|
|
1459
2195
|
}], minlength: [{
|
|
1460
2196
|
type: Input
|
|
1461
2197
|
}], maxlength: [{
|
|
1462
2198
|
type: Input
|
|
1463
|
-
}],
|
|
1464
|
-
type: Output
|
|
1465
|
-
}], value: [{
|
|
1466
|
-
type: Input
|
|
1467
|
-
}] } });
|
|
2199
|
+
}], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
1468
2200
|
|
|
1469
2201
|
let autocompleteSequence = 0;
|
|
1470
2202
|
class TdAutocompleteSelect {
|
|
@@ -1483,14 +2215,21 @@ class TdAutocompleteSelect {
|
|
|
1483
2215
|
emptyText = 'No se encontraron resultados';
|
|
1484
2216
|
clearable = true;
|
|
1485
2217
|
dark = false;
|
|
1486
|
-
disabled = false;
|
|
2218
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2219
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
2220
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
2221
|
+
touch = output();
|
|
1487
2222
|
scrollBehavior = 'reposition';
|
|
1488
2223
|
minimumCharacters = 0;
|
|
1489
2224
|
filterWith = (option, search) => `${option.label} ${option.description ?? ''}`.toLocaleLowerCase().includes(search);
|
|
1490
2225
|
compareWith = (first, second) => Object.is(first, second);
|
|
1491
2226
|
selectionChange = new EventEmitter();
|
|
1492
2227
|
searchChange = new EventEmitter();
|
|
1493
|
-
value = null;
|
|
2228
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2229
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
2230
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
2231
|
+
displayError = computed(() => this.error || this.errors()[0]?.message || '', ...(ngDevMode ? [{ debugName: "displayError" }] : /* istanbul ignore next */ []));
|
|
2232
|
+
hasError = computed(() => this.invalid() || !!this.displayError(), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
1494
2233
|
search = '';
|
|
1495
2234
|
open = false;
|
|
1496
2235
|
activeIndex = -1;
|
|
@@ -1508,10 +2247,11 @@ class TdAutocompleteSelect {
|
|
|
1508
2247
|
return this.options.filter((option) => this.filterWith(option, normalized));
|
|
1509
2248
|
}
|
|
1510
2249
|
onTouched = () => {
|
|
1511
|
-
this.
|
|
2250
|
+
this.onCvaTouched();
|
|
2251
|
+
this.touch.emit();
|
|
1512
2252
|
};
|
|
1513
2253
|
changed = () => undefined;
|
|
1514
|
-
|
|
2254
|
+
onCvaTouched = () => undefined;
|
|
1515
2255
|
constructor() {
|
|
1516
2256
|
const scrollListener = (event) => {
|
|
1517
2257
|
const target = event.target;
|
|
@@ -1531,39 +2271,41 @@ class TdAutocompleteSelect {
|
|
|
1531
2271
|
this.destroyRef.onDestroy(() => this.document.removeEventListener('scroll', scrollListener, true));
|
|
1532
2272
|
}
|
|
1533
2273
|
writeValue(value) {
|
|
1534
|
-
this.value
|
|
1535
|
-
this.search =
|
|
2274
|
+
this.value.set(value ?? null);
|
|
2275
|
+
this.search =
|
|
2276
|
+
this.options.find((option) => this.compare(option.value, this.value()))?.label ?? '';
|
|
1536
2277
|
this.cdr.markForCheck();
|
|
1537
2278
|
}
|
|
1538
2279
|
registerOnChange(fn) {
|
|
1539
2280
|
this.changed = fn;
|
|
1540
2281
|
}
|
|
1541
2282
|
registerOnTouched(fn) {
|
|
1542
|
-
this.
|
|
2283
|
+
this.onCvaTouched = fn;
|
|
1543
2284
|
}
|
|
1544
2285
|
setDisabledState(disabled) {
|
|
1545
|
-
this.disabled
|
|
2286
|
+
this.cvaDisabled.set(disabled);
|
|
1546
2287
|
this.cdr.markForCheck();
|
|
1547
2288
|
}
|
|
1548
2289
|
compare(first, second) {
|
|
1549
2290
|
return this.compareWith(first, second);
|
|
1550
2291
|
}
|
|
1551
2292
|
openPanel() {
|
|
1552
|
-
if (this.
|
|
2293
|
+
if (this.isDisabled())
|
|
1553
2294
|
return;
|
|
1554
2295
|
this.open = true;
|
|
1555
2296
|
this.activeIndex = this.firstEnabledIndex();
|
|
1556
2297
|
}
|
|
1557
2298
|
close() {
|
|
1558
2299
|
this.open = false;
|
|
1559
|
-
const selected = this.options.find((option) => this.compare(option.value, this.value));
|
|
2300
|
+
const selected = this.options.find((option) => this.compare(option.value, this.value()));
|
|
1560
2301
|
if (selected)
|
|
1561
2302
|
this.search = selected.label;
|
|
1562
|
-
this.
|
|
2303
|
+
this.onCvaTouched();
|
|
2304
|
+
this.touch.emit();
|
|
1563
2305
|
}
|
|
1564
2306
|
handleInput(event) {
|
|
1565
2307
|
this.search = event.target.value;
|
|
1566
|
-
this.value
|
|
2308
|
+
this.value.set(null);
|
|
1567
2309
|
this.changed(null);
|
|
1568
2310
|
this.searchChange.emit(this.search);
|
|
1569
2311
|
this.openPanel();
|
|
@@ -1572,7 +2314,7 @@ class TdAutocompleteSelect {
|
|
|
1572
2314
|
select(option) {
|
|
1573
2315
|
if (option.disabled)
|
|
1574
2316
|
return;
|
|
1575
|
-
this.value
|
|
2317
|
+
this.value.set(option.value);
|
|
1576
2318
|
this.search = option.label;
|
|
1577
2319
|
this.changed(option.value);
|
|
1578
2320
|
this.selectionChange.emit(option.value);
|
|
@@ -1580,7 +2322,7 @@ class TdAutocompleteSelect {
|
|
|
1580
2322
|
}
|
|
1581
2323
|
clear(event) {
|
|
1582
2324
|
event.stopPropagation();
|
|
1583
|
-
this.value
|
|
2325
|
+
this.value.set(null);
|
|
1584
2326
|
this.search = '';
|
|
1585
2327
|
this.changed(null);
|
|
1586
2328
|
this.selectionChange.emit(null);
|
|
@@ -1627,7 +2369,7 @@ class TdAutocompleteSelect {
|
|
|
1627
2369
|
return this.filteredOptions.findIndex((option) => !option.disabled);
|
|
1628
2370
|
}
|
|
1629
2371
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdAutocompleteSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1630
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdAutocompleteSelect, isStandalone: true, selector: "td-autocomplete-select", inputs: { label: "label", placeholder: "placeholder", options: "options", hint: "hint", error: "error", emptyText: "emptyText", clearable: "clearable", dark: "dark", disabled: "disabled", scrollBehavior: "scrollBehavior", minimumCharacters: "minimumCharacters", filterWith: "filterWith", compareWith: "compareWith" }, outputs: { selectionChange: "selectionChange", searchChange: "searchChange" }, providers: [
|
|
2372
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdAutocompleteSelect, isStandalone: true, selector: "td-autocomplete-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: false, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: false, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, dark: { classPropertyName: "dark", publicName: "dark", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "scrollBehavior", isSignal: false, isRequired: false, transformFunction: null }, minimumCharacters: { classPropertyName: "minimumCharacters", publicName: "minimumCharacters", isSignal: false, isRequired: false, transformFunction: null }, filterWith: { classPropertyName: "filterWith", publicName: "filterWith", isSignal: false, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", selectionChange: "selectionChange", searchChange: "searchChange", value: "valueChange" }, providers: [
|
|
1631
2373
|
{
|
|
1632
2374
|
provide: NG_VALUE_ACCESSOR,
|
|
1633
2375
|
useExisting: forwardRef(() => TdAutocompleteSelect),
|
|
@@ -1639,8 +2381,8 @@ class TdAutocompleteSelect {
|
|
|
1639
2381
|
#origin="cdkOverlayOrigin"
|
|
1640
2382
|
class="td-select td-select--autocomplete"
|
|
1641
2383
|
[class.td-select--open]="open"
|
|
1642
|
-
[class.td-select--error]="
|
|
1643
|
-
[class.td-select--disabled]="
|
|
2384
|
+
[class.td-select--error]="hasError()"
|
|
2385
|
+
[class.td-select--disabled]="isDisabled()"
|
|
1644
2386
|
[class.td-select--dark]="dark"
|
|
1645
2387
|
>
|
|
1646
2388
|
<label [for]="inputId">{{ label }}</label>
|
|
@@ -1654,7 +2396,7 @@ class TdAutocompleteSelect {
|
|
|
1654
2396
|
role="combobox"
|
|
1655
2397
|
[value]="search"
|
|
1656
2398
|
[placeholder]="placeholder"
|
|
1657
|
-
[disabled]="
|
|
2399
|
+
[disabled]="isDisabled()"
|
|
1658
2400
|
[attr.aria-expanded]="open"
|
|
1659
2401
|
[attr.aria-controls]="listId"
|
|
1660
2402
|
(focus)="openPanel()"
|
|
@@ -1662,7 +2404,7 @@ class TdAutocompleteSelect {
|
|
|
1662
2404
|
(keydown)="handleKeydown($event)"
|
|
1663
2405
|
(blur)="onTouched()"
|
|
1664
2406
|
/>
|
|
1665
|
-
@if (clearable && (value !== null || search) && !
|
|
2407
|
+
@if (clearable && (value() !== null || search) && !isDisabled()) {
|
|
1666
2408
|
<button type="button" class="td-select__clear" title="Limpiar" (click)="clear($event)">
|
|
1667
2409
|
<td-icon nombre="close" tamano=".95rem" />
|
|
1668
2410
|
</button>
|
|
@@ -1675,9 +2417,9 @@ class TdAutocompleteSelect {
|
|
|
1675
2417
|
</div>
|
|
1676
2418
|
</div>
|
|
1677
2419
|
|
|
1678
|
-
@if (
|
|
1679
|
-
<p class="td-select__message" [class.td-select__message--error]="
|
|
1680
|
-
{{
|
|
2420
|
+
@if (displayError() || hint) {
|
|
2421
|
+
<p class="td-select__message" [class.td-select__message--error]="hasError()">
|
|
2422
|
+
{{ displayError() || hint }}
|
|
1681
2423
|
</p>
|
|
1682
2424
|
}
|
|
1683
2425
|
|
|
@@ -1708,7 +2450,7 @@ class TdAutocompleteSelect {
|
|
|
1708
2450
|
type="button"
|
|
1709
2451
|
role="option"
|
|
1710
2452
|
[class.td-select-panel__option--active]="index === activeIndex"
|
|
1711
|
-
[class.td-select-panel__option--selected]="compare(option.value, value)"
|
|
2453
|
+
[class.td-select-panel__option--selected]="compare(option.value, value())"
|
|
1712
2454
|
[disabled]="option.disabled"
|
|
1713
2455
|
(mousedown)="$event.preventDefault()"
|
|
1714
2456
|
(mouseenter)="activeIndex = index"
|
|
@@ -1723,7 +2465,7 @@ class TdAutocompleteSelect {
|
|
|
1723
2465
|
<small>{{ option.description }}</small>
|
|
1724
2466
|
}
|
|
1725
2467
|
</span>
|
|
1726
|
-
@if (compare(option.value, value)) {
|
|
2468
|
+
@if (compare(option.value, value())) {
|
|
1727
2469
|
<td-icon class="td-select-panel__check" nombre="check" />
|
|
1728
2470
|
}
|
|
1729
2471
|
</button>
|
|
@@ -1740,8 +2482,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1740
2482
|
#origin="cdkOverlayOrigin"
|
|
1741
2483
|
class="td-select td-select--autocomplete"
|
|
1742
2484
|
[class.td-select--open]="open"
|
|
1743
|
-
[class.td-select--error]="
|
|
1744
|
-
[class.td-select--disabled]="
|
|
2485
|
+
[class.td-select--error]="hasError()"
|
|
2486
|
+
[class.td-select--disabled]="isDisabled()"
|
|
1745
2487
|
[class.td-select--dark]="dark"
|
|
1746
2488
|
>
|
|
1747
2489
|
<label [for]="inputId">{{ label }}</label>
|
|
@@ -1755,7 +2497,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1755
2497
|
role="combobox"
|
|
1756
2498
|
[value]="search"
|
|
1757
2499
|
[placeholder]="placeholder"
|
|
1758
|
-
[disabled]="
|
|
2500
|
+
[disabled]="isDisabled()"
|
|
1759
2501
|
[attr.aria-expanded]="open"
|
|
1760
2502
|
[attr.aria-controls]="listId"
|
|
1761
2503
|
(focus)="openPanel()"
|
|
@@ -1763,7 +2505,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1763
2505
|
(keydown)="handleKeydown($event)"
|
|
1764
2506
|
(blur)="onTouched()"
|
|
1765
2507
|
/>
|
|
1766
|
-
@if (clearable && (value !== null || search) && !
|
|
2508
|
+
@if (clearable && (value() !== null || search) && !isDisabled()) {
|
|
1767
2509
|
<button type="button" class="td-select__clear" title="Limpiar" (click)="clear($event)">
|
|
1768
2510
|
<td-icon nombre="close" tamano=".95rem" />
|
|
1769
2511
|
</button>
|
|
@@ -1776,9 +2518,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1776
2518
|
</div>
|
|
1777
2519
|
</div>
|
|
1778
2520
|
|
|
1779
|
-
@if (
|
|
1780
|
-
<p class="td-select__message" [class.td-select__message--error]="
|
|
1781
|
-
{{
|
|
2521
|
+
@if (displayError() || hint) {
|
|
2522
|
+
<p class="td-select__message" [class.td-select__message--error]="hasError()">
|
|
2523
|
+
{{ displayError() || hint }}
|
|
1782
2524
|
</p>
|
|
1783
2525
|
}
|
|
1784
2526
|
|
|
@@ -1809,7 +2551,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1809
2551
|
type="button"
|
|
1810
2552
|
role="option"
|
|
1811
2553
|
[class.td-select-panel__option--active]="index === activeIndex"
|
|
1812
|
-
[class.td-select-panel__option--selected]="compare(option.value, value)"
|
|
2554
|
+
[class.td-select-panel__option--selected]="compare(option.value, value())"
|
|
1813
2555
|
[disabled]="option.disabled"
|
|
1814
2556
|
(mousedown)="$event.preventDefault()"
|
|
1815
2557
|
(mouseenter)="activeIndex = index"
|
|
@@ -1824,7 +2566,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1824
2566
|
<small>{{ option.description }}</small>
|
|
1825
2567
|
}
|
|
1826
2568
|
</span>
|
|
1827
|
-
@if (compare(option.value, value)) {
|
|
2569
|
+
@if (compare(option.value, value())) {
|
|
1828
2570
|
<td-icon class="td-select-panel__check" nombre="check" />
|
|
1829
2571
|
}
|
|
1830
2572
|
</button>
|
|
@@ -1860,9 +2602,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1860
2602
|
type: Input
|
|
1861
2603
|
}], dark: [{
|
|
1862
2604
|
type: Input
|
|
1863
|
-
}], disabled: [{
|
|
1864
|
-
type: Input
|
|
1865
|
-
}], scrollBehavior: [{
|
|
2605
|
+
}], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], scrollBehavior: [{
|
|
1866
2606
|
type: Input
|
|
1867
2607
|
}], minimumCharacters: [{
|
|
1868
2608
|
type: Input
|
|
@@ -1874,7 +2614,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
1874
2614
|
type: Output
|
|
1875
2615
|
}], searchChange: [{
|
|
1876
2616
|
type: Output
|
|
1877
|
-
}] } });
|
|
2617
|
+
}], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
1878
2618
|
|
|
1879
2619
|
let selectSequence = 0;
|
|
1880
2620
|
class TdSelect {
|
|
@@ -1892,11 +2632,18 @@ class TdSelect {
|
|
|
1892
2632
|
emptyText = 'No hay opciones disponibles';
|
|
1893
2633
|
clearable = false;
|
|
1894
2634
|
dark = false;
|
|
1895
|
-
disabled = false;
|
|
2635
|
+
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
2636
|
+
invalid = input(false, ...(ngDevMode ? [{ debugName: "invalid" }] : /* istanbul ignore next */ []));
|
|
2637
|
+
errors = input([], ...(ngDevMode ? [{ debugName: "errors" }] : /* istanbul ignore next */ []));
|
|
2638
|
+
touch = output();
|
|
1896
2639
|
scrollBehavior = 'reposition';
|
|
1897
2640
|
compareWith = (first, second) => Object.is(first, second);
|
|
1898
2641
|
selectionChange = new EventEmitter();
|
|
1899
|
-
value = null;
|
|
2642
|
+
value = model(null, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
2643
|
+
cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
|
|
2644
|
+
isDisabled = computed(() => this.disabled() || this.cvaDisabled(), ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
|
|
2645
|
+
displayError = computed(() => this.error || this.errors()[0]?.message || '', ...(ngDevMode ? [{ debugName: "displayError" }] : /* istanbul ignore next */ []));
|
|
2646
|
+
hasError = computed(() => this.invalid() || !!this.displayError(), ...(ngDevMode ? [{ debugName: "hasError" }] : /* istanbul ignore next */ []));
|
|
1900
2647
|
open = false;
|
|
1901
2648
|
activeIndex = -1;
|
|
1902
2649
|
scrollStrategy = this.scrollStrategies.reposition();
|
|
@@ -1907,7 +2654,7 @@ class TdSelect {
|
|
|
1907
2654
|
return `${this.generatedId}-list`;
|
|
1908
2655
|
}
|
|
1909
2656
|
get selectedOption() {
|
|
1910
|
-
return this.options.find((option) => this.compare(option.value, this.value));
|
|
2657
|
+
return this.options.find((option) => this.compare(option.value, this.value()));
|
|
1911
2658
|
}
|
|
1912
2659
|
onChange = () => undefined;
|
|
1913
2660
|
onTouched = () => undefined;
|
|
@@ -1930,7 +2677,7 @@ class TdSelect {
|
|
|
1930
2677
|
this.destroyRef.onDestroy(() => this.document.removeEventListener('scroll', scrollListener, true));
|
|
1931
2678
|
}
|
|
1932
2679
|
writeValue(value) {
|
|
1933
|
-
this.value
|
|
2680
|
+
this.value.set(value ?? null);
|
|
1934
2681
|
this.cdr.markForCheck();
|
|
1935
2682
|
}
|
|
1936
2683
|
registerOnChange(fn) {
|
|
@@ -1940,14 +2687,14 @@ class TdSelect {
|
|
|
1940
2687
|
this.onTouched = fn;
|
|
1941
2688
|
}
|
|
1942
2689
|
setDisabledState(disabled) {
|
|
1943
|
-
this.disabled
|
|
2690
|
+
this.cvaDisabled.set(disabled);
|
|
1944
2691
|
this.cdr.markForCheck();
|
|
1945
2692
|
}
|
|
1946
2693
|
compare(first, second) {
|
|
1947
2694
|
return this.compareWith(first, second);
|
|
1948
2695
|
}
|
|
1949
2696
|
toggle() {
|
|
1950
|
-
if (this.
|
|
2697
|
+
if (this.isDisabled())
|
|
1951
2698
|
return;
|
|
1952
2699
|
this.open ? this.close() : this.openPanel();
|
|
1953
2700
|
}
|
|
@@ -1956,6 +2703,7 @@ class TdSelect {
|
|
|
1956
2703
|
return;
|
|
1957
2704
|
this.open = false;
|
|
1958
2705
|
this.onTouched();
|
|
2706
|
+
this.touch.emit();
|
|
1959
2707
|
}
|
|
1960
2708
|
select(option) {
|
|
1961
2709
|
if (option.disabled)
|
|
@@ -1996,7 +2744,7 @@ class TdSelect {
|
|
|
1996
2744
|
}
|
|
1997
2745
|
openPanel() {
|
|
1998
2746
|
this.open = true;
|
|
1999
|
-
const selectedIndex = this.options.findIndex((option) => this.compare(option.value, this.value));
|
|
2747
|
+
const selectedIndex = this.options.findIndex((option) => this.compare(option.value, this.value()));
|
|
2000
2748
|
this.activeIndex = selectedIndex >= 0 ? selectedIndex : this.firstEnabledIndex();
|
|
2001
2749
|
}
|
|
2002
2750
|
moveActive(direction) {
|
|
@@ -2015,12 +2763,12 @@ class TdSelect {
|
|
|
2015
2763
|
return this.options.findIndex((option) => !option.disabled);
|
|
2016
2764
|
}
|
|
2017
2765
|
setValue(value) {
|
|
2018
|
-
this.value
|
|
2766
|
+
this.value.set(value);
|
|
2019
2767
|
this.onChange(value);
|
|
2020
2768
|
this.selectionChange.emit(value);
|
|
2021
2769
|
}
|
|
2022
2770
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2023
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdSelect, isStandalone: true, selector: "td-select", inputs: { label: "label", placeholder: "placeholder", options: "options", hint: "hint", error: "error", emptyText: "emptyText", clearable: "clearable", dark: "dark", disabled: "disabled", scrollBehavior: "scrollBehavior", compareWith: "compareWith" }, outputs: { selectionChange: "selectionChange" }, providers: [
|
|
2771
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdSelect, isStandalone: true, selector: "td-select", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: false, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: false, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: false, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: false, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: false, isRequired: false, transformFunction: null }, dark: { classPropertyName: "dark", publicName: "dark", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, errors: { classPropertyName: "errors", publicName: "errors", isSignal: true, isRequired: false, transformFunction: null }, scrollBehavior: { classPropertyName: "scrollBehavior", publicName: "scrollBehavior", isSignal: false, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { touch: "touch", selectionChange: "selectionChange", value: "valueChange" }, providers: [
|
|
2024
2772
|
{
|
|
2025
2773
|
provide: NG_VALUE_ACCESSOR,
|
|
2026
2774
|
useExisting: forwardRef(() => TdSelect),
|
|
@@ -2032,16 +2780,16 @@ class TdSelect {
|
|
|
2032
2780
|
#origin="cdkOverlayOrigin"
|
|
2033
2781
|
class="td-select"
|
|
2034
2782
|
[class.td-select--open]="open"
|
|
2035
|
-
[class.td-select--error]="
|
|
2036
|
-
[class.td-select--disabled]="
|
|
2783
|
+
[class.td-select--error]="hasError()"
|
|
2784
|
+
[class.td-select--disabled]="isDisabled()"
|
|
2037
2785
|
[class.td-select--dark]="dark"
|
|
2038
2786
|
>
|
|
2039
2787
|
<label [id]="labelId">{{ label }}</label>
|
|
2040
2788
|
<div
|
|
2041
2789
|
class="td-select__trigger"
|
|
2042
2790
|
role="combobox"
|
|
2043
|
-
[attr.tabindex]="
|
|
2044
|
-
[attr.aria-disabled]="
|
|
2791
|
+
[attr.tabindex]="isDisabled() ? -1 : 0"
|
|
2792
|
+
[attr.aria-disabled]="isDisabled()"
|
|
2045
2793
|
[attr.aria-labelledby]="labelId"
|
|
2046
2794
|
[attr.aria-expanded]="open"
|
|
2047
2795
|
[attr.aria-controls]="listId"
|
|
@@ -2054,7 +2802,7 @@ class TdSelect {
|
|
|
2054
2802
|
<span [class.td-select__placeholder]="!selectedOption">
|
|
2055
2803
|
{{ selectedOption?.label || placeholder }}
|
|
2056
2804
|
</span>
|
|
2057
|
-
@if (clearable && selectedOption && !
|
|
2805
|
+
@if (clearable && selectedOption && !isDisabled()) {
|
|
2058
2806
|
<button
|
|
2059
2807
|
type="button"
|
|
2060
2808
|
class="td-select__clear"
|
|
@@ -2072,9 +2820,9 @@ class TdSelect {
|
|
|
2072
2820
|
</div>
|
|
2073
2821
|
</div>
|
|
2074
2822
|
|
|
2075
|
-
@if (
|
|
2076
|
-
<p class="td-select__message" [class.td-select__message--error]="
|
|
2077
|
-
{{
|
|
2823
|
+
@if (displayError() || hint) {
|
|
2824
|
+
<p class="td-select__message" [class.td-select__message--error]="hasError()">
|
|
2825
|
+
{{ displayError() || hint }}
|
|
2078
2826
|
</p>
|
|
2079
2827
|
}
|
|
2080
2828
|
|
|
@@ -2105,8 +2853,8 @@ class TdSelect {
|
|
|
2105
2853
|
type="button"
|
|
2106
2854
|
role="option"
|
|
2107
2855
|
[class.td-select-panel__option--active]="index === activeIndex"
|
|
2108
|
-
[class.td-select-panel__option--selected]="compare(option.value, value)"
|
|
2109
|
-
[attr.aria-selected]="compare(option.value, value)"
|
|
2856
|
+
[class.td-select-panel__option--selected]="compare(option.value, value())"
|
|
2857
|
+
[attr.aria-selected]="compare(option.value, value())"
|
|
2110
2858
|
[disabled]="option.disabled"
|
|
2111
2859
|
(mouseenter)="activeIndex = index"
|
|
2112
2860
|
(click)="select(option)"
|
|
@@ -2120,7 +2868,7 @@ class TdSelect {
|
|
|
2120
2868
|
<small>{{ option.description }}</small>
|
|
2121
2869
|
}
|
|
2122
2870
|
</span>
|
|
2123
|
-
@if (compare(option.value, value)) {
|
|
2871
|
+
@if (compare(option.value, value())) {
|
|
2124
2872
|
<td-icon class="td-select-panel__check" nombre="check" />
|
|
2125
2873
|
}
|
|
2126
2874
|
</button>
|
|
@@ -2137,16 +2885,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2137
2885
|
#origin="cdkOverlayOrigin"
|
|
2138
2886
|
class="td-select"
|
|
2139
2887
|
[class.td-select--open]="open"
|
|
2140
|
-
[class.td-select--error]="
|
|
2141
|
-
[class.td-select--disabled]="
|
|
2888
|
+
[class.td-select--error]="hasError()"
|
|
2889
|
+
[class.td-select--disabled]="isDisabled()"
|
|
2142
2890
|
[class.td-select--dark]="dark"
|
|
2143
2891
|
>
|
|
2144
2892
|
<label [id]="labelId">{{ label }}</label>
|
|
2145
2893
|
<div
|
|
2146
2894
|
class="td-select__trigger"
|
|
2147
2895
|
role="combobox"
|
|
2148
|
-
[attr.tabindex]="
|
|
2149
|
-
[attr.aria-disabled]="
|
|
2896
|
+
[attr.tabindex]="isDisabled() ? -1 : 0"
|
|
2897
|
+
[attr.aria-disabled]="isDisabled()"
|
|
2150
2898
|
[attr.aria-labelledby]="labelId"
|
|
2151
2899
|
[attr.aria-expanded]="open"
|
|
2152
2900
|
[attr.aria-controls]="listId"
|
|
@@ -2159,7 +2907,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2159
2907
|
<span [class.td-select__placeholder]="!selectedOption">
|
|
2160
2908
|
{{ selectedOption?.label || placeholder }}
|
|
2161
2909
|
</span>
|
|
2162
|
-
@if (clearable && selectedOption && !
|
|
2910
|
+
@if (clearable && selectedOption && !isDisabled()) {
|
|
2163
2911
|
<button
|
|
2164
2912
|
type="button"
|
|
2165
2913
|
class="td-select__clear"
|
|
@@ -2177,9 +2925,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2177
2925
|
</div>
|
|
2178
2926
|
</div>
|
|
2179
2927
|
|
|
2180
|
-
@if (
|
|
2181
|
-
<p class="td-select__message" [class.td-select__message--error]="
|
|
2182
|
-
{{
|
|
2928
|
+
@if (displayError() || hint) {
|
|
2929
|
+
<p class="td-select__message" [class.td-select__message--error]="hasError()">
|
|
2930
|
+
{{ displayError() || hint }}
|
|
2183
2931
|
</p>
|
|
2184
2932
|
}
|
|
2185
2933
|
|
|
@@ -2210,8 +2958,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2210
2958
|
type="button"
|
|
2211
2959
|
role="option"
|
|
2212
2960
|
[class.td-select-panel__option--active]="index === activeIndex"
|
|
2213
|
-
[class.td-select-panel__option--selected]="compare(option.value, value)"
|
|
2214
|
-
[attr.aria-selected]="compare(option.value, value)"
|
|
2961
|
+
[class.td-select-panel__option--selected]="compare(option.value, value())"
|
|
2962
|
+
[attr.aria-selected]="compare(option.value, value())"
|
|
2215
2963
|
[disabled]="option.disabled"
|
|
2216
2964
|
(mouseenter)="activeIndex = index"
|
|
2217
2965
|
(click)="select(option)"
|
|
@@ -2225,7 +2973,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2225
2973
|
<small>{{ option.description }}</small>
|
|
2226
2974
|
}
|
|
2227
2975
|
</span>
|
|
2228
|
-
@if (compare(option.value, value)) {
|
|
2976
|
+
@if (compare(option.value, value())) {
|
|
2229
2977
|
<td-icon class="td-select-panel__check" nombre="check" />
|
|
2230
2978
|
}
|
|
2231
2979
|
</button>
|
|
@@ -2258,15 +3006,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2258
3006
|
type: Input
|
|
2259
3007
|
}], dark: [{
|
|
2260
3008
|
type: Input
|
|
2261
|
-
}], disabled: [{
|
|
2262
|
-
type: Input
|
|
2263
|
-
}], scrollBehavior: [{
|
|
3009
|
+
}], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], errors: [{ type: i0.Input, args: [{ isSignal: true, alias: "errors", required: false }] }], touch: [{ type: i0.Output, args: ["touch"] }], scrollBehavior: [{
|
|
2264
3010
|
type: Input
|
|
2265
3011
|
}], compareWith: [{
|
|
2266
3012
|
type: Input
|
|
2267
3013
|
}], selectionChange: [{
|
|
2268
3014
|
type: Output
|
|
2269
|
-
}] } });
|
|
3015
|
+
}], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }] } });
|
|
2270
3016
|
|
|
2271
3017
|
class TdSidebar {
|
|
2272
3018
|
titulo = 'Gestión Corporativa';
|
|
@@ -2417,6 +3163,7 @@ class TdTabs {
|
|
|
2417
3163
|
tabsChange;
|
|
2418
3164
|
requestedIndex = 0;
|
|
2419
3165
|
tabQuery;
|
|
3166
|
+
tabList;
|
|
2420
3167
|
tabButtons;
|
|
2421
3168
|
set selectedIndex(value) {
|
|
2422
3169
|
this.requestedIndex = Number.isFinite(value) ? Math.max(0, Math.trunc(value)) : 0;
|
|
@@ -2458,8 +3205,11 @@ class TdTabs {
|
|
|
2458
3205
|
this.selectedIndexChange.emit(index);
|
|
2459
3206
|
this.tabChange.emit(tab);
|
|
2460
3207
|
this.cdr.markForCheck();
|
|
2461
|
-
|
|
2462
|
-
|
|
3208
|
+
queueMicrotask(() => {
|
|
3209
|
+
this.ensureTabVisible(index, focus ? 'auto' : 'smooth');
|
|
3210
|
+
if (focus)
|
|
3211
|
+
this.focusButton(index);
|
|
3212
|
+
});
|
|
2463
3213
|
}
|
|
2464
3214
|
handleKeydown(event) {
|
|
2465
3215
|
const horizontalKeys = ['ArrowLeft', 'ArrowRight'];
|
|
@@ -2486,6 +3236,7 @@ class TdTabs {
|
|
|
2486
3236
|
this.tabs = this.tabQuery.toArray();
|
|
2487
3237
|
this.applyRequestedIndex();
|
|
2488
3238
|
this.cdr.markForCheck();
|
|
3239
|
+
queueMicrotask(() => this.ensureTabVisible(this.activeIndex, 'auto'));
|
|
2489
3240
|
}
|
|
2490
3241
|
applyRequestedIndex() {
|
|
2491
3242
|
if (!this.tabs.length) {
|
|
@@ -2524,8 +3275,28 @@ class TdTabs {
|
|
|
2524
3275
|
focusButton(index) {
|
|
2525
3276
|
this.tabButtons.get(index)?.nativeElement.focus();
|
|
2526
3277
|
}
|
|
3278
|
+
ensureTabVisible(index, behavior) {
|
|
3279
|
+
const list = this.tabList?.nativeElement;
|
|
3280
|
+
const button = this.tabButtons?.get(index)?.nativeElement;
|
|
3281
|
+
if (!list || !button || list.scrollWidth <= list.clientWidth)
|
|
3282
|
+
return;
|
|
3283
|
+
const padding = 8;
|
|
3284
|
+
const visibleStart = list.scrollLeft + padding;
|
|
3285
|
+
const visibleEnd = list.scrollLeft + list.clientWidth - padding;
|
|
3286
|
+
const tabStart = button.offsetLeft;
|
|
3287
|
+
const tabEnd = tabStart + button.offsetWidth;
|
|
3288
|
+
if (tabStart < visibleStart) {
|
|
3289
|
+
list.scrollTo({ left: Math.max(0, tabStart - padding), behavior });
|
|
3290
|
+
}
|
|
3291
|
+
else if (tabEnd > visibleEnd) {
|
|
3292
|
+
list.scrollTo({
|
|
3293
|
+
left: tabEnd - list.clientWidth + padding,
|
|
3294
|
+
behavior,
|
|
3295
|
+
});
|
|
3296
|
+
}
|
|
3297
|
+
}
|
|
2527
3298
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdTabs, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2528
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdTabs, isStandalone: true, selector: "td-tabs", inputs: { selectedIndex: "selectedIndex", variant: "variant", alignment: "alignment", stretch: "stretch", dark: "dark", ariaLabel: "ariaLabel", panelFocusable: "panelFocusable" }, outputs: { selectedIndexChange: "selectedIndexChange", tabChange: "tabChange" }, queries: [{ propertyName: "tabQuery", predicate: TdTab }], viewQueries: [{ propertyName: "tabButtons", predicate: ["tabButton"], descendants: true }], ngImport: i0, template: `
|
|
3299
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.17", type: TdTabs, isStandalone: true, selector: "td-tabs", inputs: { selectedIndex: "selectedIndex", variant: "variant", alignment: "alignment", stretch: "stretch", dark: "dark", ariaLabel: "ariaLabel", panelFocusable: "panelFocusable" }, outputs: { selectedIndexChange: "selectedIndexChange", tabChange: "tabChange" }, queries: [{ propertyName: "tabQuery", predicate: TdTab }], viewQueries: [{ propertyName: "tabList", first: true, predicate: ["tabList"], descendants: true }, { propertyName: "tabButtons", predicate: ["tabButton"], descendants: true }], ngImport: i0, template: `
|
|
2529
3300
|
<section
|
|
2530
3301
|
class="td-tabs"
|
|
2531
3302
|
[class.td-tabs--dark]="dark"
|
|
@@ -2534,6 +3305,7 @@ class TdTabs {
|
|
|
2534
3305
|
(dark ? ' td-tabs--dark' : '') + (stretch ? ' td-tabs--stretch' : '')"
|
|
2535
3306
|
>
|
|
2536
3307
|
<div
|
|
3308
|
+
#tabList
|
|
2537
3309
|
class="td-tabs__list"
|
|
2538
3310
|
role="tablist"
|
|
2539
3311
|
[attr.aria-label]="ariaLabel"
|
|
@@ -2576,7 +3348,7 @@ class TdTabs {
|
|
|
2576
3348
|
</div>
|
|
2577
3349
|
}
|
|
2578
3350
|
</section>
|
|
2579
|
-
`, isInline: true, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-tabs{--td-tabs-bg: #fff;--td-tabs-soft: #f7f8fb;--td-tabs-border: #e3e7ef;--td-tabs-text: #263147;--td-tabs-muted: #748096;--td-tabs-accent: #5746d8;min-width:0;color:var(--td-tabs-text)}.td-tabs--dark{--td-tabs-bg: #19191f;--td-tabs-soft: #202028;--td-tabs-border: #303039;--td-tabs-text: #ededf0;--td-tabs-muted: #a1a1aa;--td-tabs-accent: #b9b0fa}.td-tabs__list{display:flex;min-width:0;overflow-x:auto;scrollbar-width:none}.td-tabs__list::-webkit-scrollbar{display:none}.td-tabs--align-centro .td-tabs__list{justify-content:center}.td-tabs--align-fin .td-tabs__list{justify-content:flex-end}.td-tabs__tab{position:relative;display:inline-flex;min-height:2.85rem;flex:0 0 auto;align-items:center;justify-content:center;gap:.45rem;border:0;padding:.7rem .95rem;color:var(--td-tabs-muted);background:transparent;font:750 .72rem/1 system-ui,sans-serif;white-space:nowrap;cursor:pointer;transition:color .13s ease,background .13s ease}.td-tabs--stretch .td-tabs__tab{min-width:0;flex:1 1 0}.td-tabs__tab:hover:not(:disabled){color:var(--td-tabs-accent)}.td-tabs__tab:focus-visible{outline:2px solid var(--td-tabs-accent);outline-offset:-2px}.td-tabs__tab:disabled{opacity:.42;cursor:not-allowed}.td-tabs__tab small{min-width:1.25rem;border-radius:999px;padding:.22rem .38rem;color:var(--td-tabs-muted);background:var(--td-tabs-soft);font-size:.58rem}.td-tabs--linea .td-tabs__list{border-bottom:1px solid var(--td-tabs-border)}.td-tabs--linea .td-tabs__tab:after{position:absolute;right:.65rem;bottom:-1px;left:.65rem;height:2px;border-radius:999px 999px 0 0;background:transparent;content:\"\"}.td-tabs--linea .td-tabs__tab--active{color:var(--td-tabs-accent)}.td-tabs--linea .td-tabs__tab--active:after{background:var(--td-tabs-accent)}.td-tabs--pastilla .td-tabs__list{gap:.3rem;border:1px solid var(--td-tabs-border);border-radius:.8rem;padding:.28rem;background:var(--td-tabs-soft)}.td-tabs--pastilla .td-tabs__tab{min-height:2.35rem;border-radius:.58rem}.td-tabs--pastilla .td-tabs__tab--active{color:var(--td-tabs-accent);background:var(--td-tabs-bg);box-shadow:0 3px 10px #0f172a14}.td-tabs--contenida{overflow:hidden;border:1px solid var(--td-tabs-border);border-radius:.9rem;background:var(--td-tabs-bg)}.td-tabs--contenida .td-tabs__list{border-bottom:1px solid var(--td-tabs-border);padding:0 .45rem;background:var(--td-tabs-soft)}.td-tabs--contenida .td-tabs__tab--active{color:var(--td-tabs-accent);background:var(--td-tabs-bg)}.td-tabs--contenida .td-tabs__panel{padding:1.25rem}.td-tabs__panel{min-width:0;padding-top:1.15rem;animation:td-tabs-panel-in .14s ease-out}@keyframes td-tabs-panel-in{0%{opacity:0;transform:translateY(.18rem)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.td-tabs__panel{animation:none}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TdIcon, selector: "td-icon", inputs: ["nombre", "titulo", "tamano"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
3351
|
+
`, isInline: true, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-tabs{--td-tabs-bg: #fff;--td-tabs-soft: #f7f8fb;--td-tabs-border: #e3e7ef;--td-tabs-text: #263147;--td-tabs-muted: #748096;--td-tabs-accent: #5746d8;min-width:0;color:var(--td-tabs-text)}.td-tabs--dark{--td-tabs-bg: #19191f;--td-tabs-soft: #202028;--td-tabs-border: #303039;--td-tabs-text: #ededf0;--td-tabs-muted: #a1a1aa;--td-tabs-accent: #b9b0fa}.td-tabs__list{display:flex;width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;scroll-padding-inline:.5rem;scroll-snap-type:inline proximity;touch-action:pan-x;-webkit-overflow-scrolling:touch;scrollbar-width:none}.td-tabs__list::-webkit-scrollbar{display:none}.td-tabs--align-centro .td-tabs__list{justify-content:safe center}.td-tabs--align-fin .td-tabs__list{justify-content:safe flex-end}.td-tabs__tab{position:relative;display:inline-flex;min-height:2.85rem;flex:0 0 auto;align-items:center;justify-content:center;gap:.45rem;border:0;padding:.7rem .95rem;color:var(--td-tabs-muted);background:transparent;font:750 .72rem/1 system-ui,sans-serif;white-space:nowrap;scroll-snap-align:start;cursor:pointer;transition:color .13s ease,background .13s ease}.td-tabs--stretch .td-tabs__tab{min-width:0;flex:1 1 0}.td-tabs__tab:hover:not(:disabled){color:var(--td-tabs-accent)}.td-tabs__tab:focus-visible{outline:2px solid var(--td-tabs-accent);outline-offset:-2px}.td-tabs__tab:disabled{opacity:.42;cursor:not-allowed}.td-tabs__tab small{min-width:1.25rem;border-radius:999px;padding:.22rem .38rem;color:var(--td-tabs-muted);background:var(--td-tabs-soft);font-size:.58rem}.td-tabs--linea .td-tabs__list{border-bottom:1px solid var(--td-tabs-border)}.td-tabs--linea .td-tabs__tab:after{position:absolute;right:.65rem;bottom:-1px;left:.65rem;height:2px;border-radius:999px 999px 0 0;background:transparent;content:\"\"}.td-tabs--linea .td-tabs__tab--active{color:var(--td-tabs-accent)}.td-tabs--linea .td-tabs__tab--active:after{background:var(--td-tabs-accent)}.td-tabs--pastilla .td-tabs__list{gap:.3rem;border:1px solid var(--td-tabs-border);border-radius:.8rem;padding:.28rem;background:var(--td-tabs-soft)}.td-tabs--pastilla .td-tabs__tab{min-height:2.35rem;border-radius:.58rem}.td-tabs--pastilla .td-tabs__tab--active{color:var(--td-tabs-accent);background:var(--td-tabs-bg);box-shadow:0 3px 10px #0f172a14}.td-tabs--contenida{overflow:hidden;border:1px solid var(--td-tabs-border);border-radius:.9rem;background:var(--td-tabs-bg)}.td-tabs--contenida .td-tabs__list{border-bottom:1px solid var(--td-tabs-border);padding:0 .45rem;background:var(--td-tabs-soft)}.td-tabs--contenida .td-tabs__tab--active{color:var(--td-tabs-accent);background:var(--td-tabs-bg)}.td-tabs--contenida .td-tabs__panel{padding:1.25rem}.td-tabs__panel{min-width:0;padding-top:1.15rem;animation:td-tabs-panel-in .14s ease-out}@keyframes td-tabs-panel-in{0%{opacity:0;transform:translateY(.18rem)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.td-tabs__panel{animation:none}}@media(max-width:600px){.td-tabs__list{justify-content:flex-start!important}.td-tabs--stretch .td-tabs__tab{min-width:max-content;flex:0 0 auto}.td-tabs--contenida .td-tabs__list{padding-inline:.25rem}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: TdIcon, selector: "td-icon", inputs: ["nombre", "titulo", "tamano"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2580
3352
|
}
|
|
2581
3353
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: TdTabs, decorators: [{
|
|
2582
3354
|
type: Component,
|
|
@@ -2589,6 +3361,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2589
3361
|
(dark ? ' td-tabs--dark' : '') + (stretch ? ' td-tabs--stretch' : '')"
|
|
2590
3362
|
>
|
|
2591
3363
|
<div
|
|
3364
|
+
#tabList
|
|
2592
3365
|
class="td-tabs__list"
|
|
2593
3366
|
role="tablist"
|
|
2594
3367
|
[attr.aria-label]="ariaLabel"
|
|
@@ -2631,10 +3404,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2631
3404
|
</div>
|
|
2632
3405
|
}
|
|
2633
3406
|
</section>
|
|
2634
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-tabs{--td-tabs-bg: #fff;--td-tabs-soft: #f7f8fb;--td-tabs-border: #e3e7ef;--td-tabs-text: #263147;--td-tabs-muted: #748096;--td-tabs-accent: #5746d8;min-width:0;color:var(--td-tabs-text)}.td-tabs--dark{--td-tabs-bg: #19191f;--td-tabs-soft: #202028;--td-tabs-border: #303039;--td-tabs-text: #ededf0;--td-tabs-muted: #a1a1aa;--td-tabs-accent: #b9b0fa}.td-tabs__list{display:flex;min-width:0;overflow-x:auto;scrollbar-width:none}.td-tabs__list::-webkit-scrollbar{display:none}.td-tabs--align-centro .td-tabs__list{justify-content:center}.td-tabs--align-fin .td-tabs__list{justify-content:flex-end}.td-tabs__tab{position:relative;display:inline-flex;min-height:2.85rem;flex:0 0 auto;align-items:center;justify-content:center;gap:.45rem;border:0;padding:.7rem .95rem;color:var(--td-tabs-muted);background:transparent;font:750 .72rem/1 system-ui,sans-serif;white-space:nowrap;cursor:pointer;transition:color .13s ease,background .13s ease}.td-tabs--stretch .td-tabs__tab{min-width:0;flex:1 1 0}.td-tabs__tab:hover:not(:disabled){color:var(--td-tabs-accent)}.td-tabs__tab:focus-visible{outline:2px solid var(--td-tabs-accent);outline-offset:-2px}.td-tabs__tab:disabled{opacity:.42;cursor:not-allowed}.td-tabs__tab small{min-width:1.25rem;border-radius:999px;padding:.22rem .38rem;color:var(--td-tabs-muted);background:var(--td-tabs-soft);font-size:.58rem}.td-tabs--linea .td-tabs__list{border-bottom:1px solid var(--td-tabs-border)}.td-tabs--linea .td-tabs__tab:after{position:absolute;right:.65rem;bottom:-1px;left:.65rem;height:2px;border-radius:999px 999px 0 0;background:transparent;content:\"\"}.td-tabs--linea .td-tabs__tab--active{color:var(--td-tabs-accent)}.td-tabs--linea .td-tabs__tab--active:after{background:var(--td-tabs-accent)}.td-tabs--pastilla .td-tabs__list{gap:.3rem;border:1px solid var(--td-tabs-border);border-radius:.8rem;padding:.28rem;background:var(--td-tabs-soft)}.td-tabs--pastilla .td-tabs__tab{min-height:2.35rem;border-radius:.58rem}.td-tabs--pastilla .td-tabs__tab--active{color:var(--td-tabs-accent);background:var(--td-tabs-bg);box-shadow:0 3px 10px #0f172a14}.td-tabs--contenida{overflow:hidden;border:1px solid var(--td-tabs-border);border-radius:.9rem;background:var(--td-tabs-bg)}.td-tabs--contenida .td-tabs__list{border-bottom:1px solid var(--td-tabs-border);padding:0 .45rem;background:var(--td-tabs-soft)}.td-tabs--contenida .td-tabs__tab--active{color:var(--td-tabs-accent);background:var(--td-tabs-bg)}.td-tabs--contenida .td-tabs__panel{padding:1.25rem}.td-tabs__panel{min-width:0;padding-top:1.15rem;animation:td-tabs-panel-in .14s ease-out}@keyframes td-tabs-panel-in{0%{opacity:0;transform:translateY(.18rem)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.td-tabs__panel{animation:none}}\n"] }]
|
|
3407
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block;min-width:0;font-family:Inter,ui-sans-serif,system-ui,sans-serif}*{box-sizing:border-box}.td-tabs{--td-tabs-bg: #fff;--td-tabs-soft: #f7f8fb;--td-tabs-border: #e3e7ef;--td-tabs-text: #263147;--td-tabs-muted: #748096;--td-tabs-accent: #5746d8;min-width:0;color:var(--td-tabs-text)}.td-tabs--dark{--td-tabs-bg: #19191f;--td-tabs-soft: #202028;--td-tabs-border: #303039;--td-tabs-text: #ededf0;--td-tabs-muted: #a1a1aa;--td-tabs-accent: #b9b0fa}.td-tabs__list{display:flex;width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-inline:contain;scroll-padding-inline:.5rem;scroll-snap-type:inline proximity;touch-action:pan-x;-webkit-overflow-scrolling:touch;scrollbar-width:none}.td-tabs__list::-webkit-scrollbar{display:none}.td-tabs--align-centro .td-tabs__list{justify-content:safe center}.td-tabs--align-fin .td-tabs__list{justify-content:safe flex-end}.td-tabs__tab{position:relative;display:inline-flex;min-height:2.85rem;flex:0 0 auto;align-items:center;justify-content:center;gap:.45rem;border:0;padding:.7rem .95rem;color:var(--td-tabs-muted);background:transparent;font:750 .72rem/1 system-ui,sans-serif;white-space:nowrap;scroll-snap-align:start;cursor:pointer;transition:color .13s ease,background .13s ease}.td-tabs--stretch .td-tabs__tab{min-width:0;flex:1 1 0}.td-tabs__tab:hover:not(:disabled){color:var(--td-tabs-accent)}.td-tabs__tab:focus-visible{outline:2px solid var(--td-tabs-accent);outline-offset:-2px}.td-tabs__tab:disabled{opacity:.42;cursor:not-allowed}.td-tabs__tab small{min-width:1.25rem;border-radius:999px;padding:.22rem .38rem;color:var(--td-tabs-muted);background:var(--td-tabs-soft);font-size:.58rem}.td-tabs--linea .td-tabs__list{border-bottom:1px solid var(--td-tabs-border)}.td-tabs--linea .td-tabs__tab:after{position:absolute;right:.65rem;bottom:-1px;left:.65rem;height:2px;border-radius:999px 999px 0 0;background:transparent;content:\"\"}.td-tabs--linea .td-tabs__tab--active{color:var(--td-tabs-accent)}.td-tabs--linea .td-tabs__tab--active:after{background:var(--td-tabs-accent)}.td-tabs--pastilla .td-tabs__list{gap:.3rem;border:1px solid var(--td-tabs-border);border-radius:.8rem;padding:.28rem;background:var(--td-tabs-soft)}.td-tabs--pastilla .td-tabs__tab{min-height:2.35rem;border-radius:.58rem}.td-tabs--pastilla .td-tabs__tab--active{color:var(--td-tabs-accent);background:var(--td-tabs-bg);box-shadow:0 3px 10px #0f172a14}.td-tabs--contenida{overflow:hidden;border:1px solid var(--td-tabs-border);border-radius:.9rem;background:var(--td-tabs-bg)}.td-tabs--contenida .td-tabs__list{border-bottom:1px solid var(--td-tabs-border);padding:0 .45rem;background:var(--td-tabs-soft)}.td-tabs--contenida .td-tabs__tab--active{color:var(--td-tabs-accent);background:var(--td-tabs-bg)}.td-tabs--contenida .td-tabs__panel{padding:1.25rem}.td-tabs__panel{min-width:0;padding-top:1.15rem;animation:td-tabs-panel-in .14s ease-out}@keyframes td-tabs-panel-in{0%{opacity:0;transform:translateY(.18rem)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.td-tabs__panel{animation:none}}@media(max-width:600px){.td-tabs__list{justify-content:flex-start!important}.td-tabs--stretch .td-tabs__tab{min-width:max-content;flex:0 0 auto}.td-tabs--contenida .td-tabs__list{padding-inline:.25rem}}\n"] }]
|
|
2635
3408
|
}], propDecorators: { tabQuery: [{
|
|
2636
3409
|
type: ContentChildren,
|
|
2637
3410
|
args: [TdTab]
|
|
3411
|
+
}], tabList: [{
|
|
3412
|
+
type: ViewChild,
|
|
3413
|
+
args: ['tabList']
|
|
2638
3414
|
}], tabButtons: [{
|
|
2639
3415
|
type: ViewChildren,
|
|
2640
3416
|
args: ['tabButton']
|
|
@@ -2666,5 +3442,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
2666
3442
|
* Generated bundle index. Do not edit.
|
|
2667
3443
|
*/
|
|
2668
3444
|
|
|
2669
|
-
export { TD_DIALOG_CONFIG, TD_DIALOG_DATA, TD_ICONOS, TD_ICONOS_NOMBRES, TdAlerta, TdAutocompleteSelect, TdDataTable, TdDialog, TdDialogActions, TdDialogClose, TdDialogPrimary, TdDialogRef, TdFooter, TdHeader, TdIcon, TdIconoRegistry, TdInput, TdSelect, TdSidebar, TdTab, TdTabs, TelcomdevUi };
|
|
3445
|
+
export { TD_DIALOG_CONFIG, TD_DIALOG_DATA, TD_ICONOS, TD_ICONOS_NOMBRES, TdAlerta, TdAutocompleteSelect, TdDataTable, TdDatePicker, TdDialog, TdDialogActions, TdDialogClose, TdDialogPrimary, TdDialogRef, TdFooter, TdHeader, TdIcon, TdIconoRegistry, TdInput, TdSelect, TdSidebar, TdTab, TdTabs, TelcomdevUi };
|
|
2670
3446
|
//# sourceMappingURL=telcomdev-ui.mjs.map
|