@tabworthy/components 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +69 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/index-C15oswCE.js +2148 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/moment-CdViwxPQ.js +5681 -0
- package/dist/cjs/tabworthy-components.cjs.js +25 -0
- package/dist/cjs/tabworthy-dates-calendar_2.cjs.entry.js +884 -0
- package/dist/cjs/tabworthy-dates.cjs.entry.js +10906 -0
- package/dist/cjs/tabworthy-times-picker.cjs.entry.js +181 -0
- package/dist/cjs/tabworthy-times.cjs.entry.js +242 -0
- package/dist/cjs/utils-y5Vtky2t.js +214 -0
- package/dist/collection/collection-manifest.json +16 -0
- package/dist/collection/components/tabworthy-dates/tabworthy-dates.css +10 -0
- package/dist/collection/components/tabworthy-dates/tabworthy-dates.js +1197 -0
- package/dist/collection/components/tabworthy-dates-calendar/tabworthy-dates-calendar.css +10 -0
- package/dist/collection/components/tabworthy-dates-calendar/tabworthy-dates-calendar.js +986 -0
- package/dist/collection/components/tabworthy-modal/tabworthy-dates-modal.css +14 -0
- package/dist/collection/components/tabworthy-modal/tabworthy-dates-modal.js +237 -0
- package/dist/collection/components/tabworthy-times/tabworthy-times.js +832 -0
- package/dist/collection/components/tabworthy-times-picker/tabworthy-times-picker.js +356 -0
- package/dist/collection/index.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/moment.js +8 -0
- package/dist/components/tabworthy-dates-calendar.d.ts +11 -0
- package/dist/components/tabworthy-dates-calendar.js +1 -0
- package/dist/components/tabworthy-dates-calendar2.js +1 -0
- package/dist/components/tabworthy-dates-modal.d.ts +11 -0
- package/dist/components/tabworthy-dates-modal.js +1 -0
- package/dist/components/tabworthy-dates-modal2.js +1 -0
- package/dist/components/tabworthy-dates.d.ts +11 -0
- package/dist/components/tabworthy-dates.js +1 -0
- package/dist/components/tabworthy-times-picker.d.ts +11 -0
- package/dist/components/tabworthy-times-picker.js +1 -0
- package/dist/components/tabworthy-times-picker2.js +1 -0
- package/dist/components/tabworthy-times.d.ts +11 -0
- package/dist/components/tabworthy-times.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/index-BusoZVTR.js +2139 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/moment-Mki5YqAR.js +5679 -0
- package/dist/esm/tabworthy-components.js +21 -0
- package/dist/esm/tabworthy-dates-calendar_2.entry.js +881 -0
- package/dist/esm/tabworthy-dates.entry.js +10904 -0
- package/dist/esm/tabworthy-times-picker.entry.js +179 -0
- package/dist/esm/tabworthy-times.entry.js +240 -0
- package/dist/esm/utils-BVHu5CWV.js +188 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/loader/cdn.js +1 -0
- package/dist/loader/index.cjs.js +1 -0
- package/dist/loader/index.d.ts +24 -0
- package/dist/loader/index.es2017.js +1 -0
- package/dist/loader/index.js +2 -0
- package/dist/shared/utils/chrono-parser/chrono-parser.js +146 -0
- package/dist/shared/utils/chrono-parser/chrono-parser.type.js +1 -0
- package/dist/shared/utils/utils.js +186 -0
- package/dist/tabworthy-components/index.esm.js +0 -0
- package/dist/tabworthy-components/p-170bc6ca.entry.js +1 -0
- package/dist/tabworthy-components/p-3ce9a767.entry.js +1 -0
- package/dist/tabworthy-components/p-77bd1bd4.entry.js +1 -0
- package/dist/tabworthy-components/p-BVHu5CWV.js +1 -0
- package/dist/tabworthy-components/p-BusoZVTR.js +2 -0
- package/dist/tabworthy-components/p-DQuL1Twl.js +1 -0
- package/dist/tabworthy-components/p-Mki5YqAR.js +8 -0
- package/dist/tabworthy-components/p-ebbb4c46.entry.js +1 -0
- package/dist/tabworthy-components/tabworthy-components.esm.js +1 -0
- package/dist/themes/dark.css +1 -0
- package/dist/themes/light.css +1 -0
- package/dist/types/Users/damirbogdanov_1/work/tabworthy-components/.stencil/shared/utils/chrono-parser/chrono-parser.d.ts +3 -0
- package/dist/types/Users/damirbogdanov_1/work/tabworthy-components/.stencil/shared/utils/chrono-parser/chrono-parser.type.d.ts +40 -0
- package/dist/types/Users/damirbogdanov_1/work/tabworthy-components/.stencil/shared/utils/utils.d.ts +28 -0
- package/dist/types/components/tabworthy-dates/tabworthy-dates.d.ts +80 -0
- package/dist/types/components/tabworthy-dates-calendar/tabworthy-dates-calendar.d.ts +89 -0
- package/dist/types/components/tabworthy-modal/tabworthy-dates-modal.d.ts +29 -0
- package/dist/types/components/tabworthy-times/tabworthy-times.d.ts +65 -0
- package/dist/types/components/tabworthy-times-picker/tabworthy-times-picker.d.ts +46 -0
- package/dist/types/components.d.ts +879 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1858 -0
- package/package.json +132 -0
|
@@ -0,0 +1,832 @@
|
|
|
1
|
+
import { h, Host } from "@stencil/core";
|
|
2
|
+
import moment from "moment";
|
|
3
|
+
import { getISODateString, removeTimezoneOffset } from "../../../../shared/utils/utils";
|
|
4
|
+
const defaultLabels = {
|
|
5
|
+
selected: "selected",
|
|
6
|
+
openCalendar: "Open date and time picker",
|
|
7
|
+
calendar: "date and time picker",
|
|
8
|
+
invalidDateError: "We could not find a matching date",
|
|
9
|
+
minDateError: `Please fill in a date after `,
|
|
10
|
+
maxDateError: `Please fill in a date before `,
|
|
11
|
+
rangeOutOfBoundsError: `Please enter a valid range of dates`,
|
|
12
|
+
disabledDateError: `Please choose an available date`,
|
|
13
|
+
to: "to",
|
|
14
|
+
startDate: "Start date",
|
|
15
|
+
timeLabel: "Time"
|
|
16
|
+
};
|
|
17
|
+
export class InclusiveTimes {
|
|
18
|
+
constructor() {
|
|
19
|
+
// Enable or disable range mode
|
|
20
|
+
this.range = false;
|
|
21
|
+
// A label for the text field
|
|
22
|
+
this.label = "Choose a date and time";
|
|
23
|
+
// A placeholder for the text field
|
|
24
|
+
this.placeholder = "";
|
|
25
|
+
// Locale used for internal translations and date parsing
|
|
26
|
+
this.locale = (navigator === null || navigator === void 0 ? void 0 : navigator.language) || "en-US";
|
|
27
|
+
// If the datetime picker is disabled
|
|
28
|
+
this.disabled = false;
|
|
29
|
+
// Which date to be displayed when calendar is first opened
|
|
30
|
+
this.startDate = getISODateString(new Date());
|
|
31
|
+
// Reference date used for Chrono date parsing. Equals "today"
|
|
32
|
+
this.referenceDate = getISODateString(new Date());
|
|
33
|
+
// Use 12-hour format with AM/PM
|
|
34
|
+
this.use12HourFormat = true;
|
|
35
|
+
// Labels used for internal translations
|
|
36
|
+
this.timesLabels = defaultLabels;
|
|
37
|
+
// Prevent hiding the calendar
|
|
38
|
+
this.inline = false;
|
|
39
|
+
// Current error state of the input field
|
|
40
|
+
this.hasError = false;
|
|
41
|
+
// Show or hide the next/previous year buttons
|
|
42
|
+
this.showYearStepper = false;
|
|
43
|
+
// Show or hide the next/previous month buttons
|
|
44
|
+
this.showMonthStepper = true;
|
|
45
|
+
// Show or hide the clear button
|
|
46
|
+
this.showClearButton = true;
|
|
47
|
+
// Show or hide the today button
|
|
48
|
+
this.showTodayButton = true;
|
|
49
|
+
// Function to disable individual dates
|
|
50
|
+
this.disableDate = () => false;
|
|
51
|
+
// Component name used to generate CSS classes
|
|
52
|
+
this.elementClassName = "tabworthy-times";
|
|
53
|
+
// Which day that should start the week (0 is sunday, 1 is monday)
|
|
54
|
+
this.firstDayOfWeek = 1;
|
|
55
|
+
// Format for the value prop (input/output format). Defaults to ISO 8601 format.
|
|
56
|
+
this.format = "YYYY-MM-DDTHH:mm:ss";
|
|
57
|
+
this.selectedHours = 12;
|
|
58
|
+
this.selectedMinutes = 0;
|
|
59
|
+
this.errorState = this.hasError;
|
|
60
|
+
this.disabledState = this.disabled;
|
|
61
|
+
this.errorMessage = "";
|
|
62
|
+
this.handlePickerSelection = async (dateString) => {
|
|
63
|
+
const dates = dateString.split(",");
|
|
64
|
+
if (this.range && dates.length === 2) {
|
|
65
|
+
const startDate = removeTimezoneOffset(new Date(dates[0]));
|
|
66
|
+
const endDate = removeTimezoneOffset(new Date(dates[1]));
|
|
67
|
+
this.updateValue([startDate, endDate]);
|
|
68
|
+
// Update calendar with selected dates
|
|
69
|
+
if (this.pickerRef) {
|
|
70
|
+
this.pickerRef.value = [startDate, endDate];
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
const date = removeTimezoneOffset(new Date(dates[0]));
|
|
75
|
+
this.updateValue(date);
|
|
76
|
+
// Update calendar with selected date
|
|
77
|
+
if (this.pickerRef) {
|
|
78
|
+
this.pickerRef.value = date;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
this.handleTimeChange = (event) => {
|
|
83
|
+
this.selectedHours = event.detail.hours;
|
|
84
|
+
this.selectedMinutes = event.detail.minutes;
|
|
85
|
+
// Update the value if we have a selected date
|
|
86
|
+
if (this.selectedDate) {
|
|
87
|
+
this.updateValue(this.selectedDate);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
this.handleCalendarButtonClick = async () => {
|
|
91
|
+
if (this.modalRef) {
|
|
92
|
+
await this.modalRef.setTriggerElement(this.calendarButtonRef);
|
|
93
|
+
await this.modalRef.open();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
this.handleYearChange = (eventDetail) => {
|
|
97
|
+
if (this.changeYear) {
|
|
98
|
+
this.changeYear.emit(eventDetail);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
this.handleChangedMonths = (_eventDetail) => {
|
|
102
|
+
// Can be used for month change tracking
|
|
103
|
+
};
|
|
104
|
+
this.handleInputBlur = () => {
|
|
105
|
+
this.formatInput();
|
|
106
|
+
};
|
|
107
|
+
this.handleInputChange = (event) => {
|
|
108
|
+
const value = event.target.value;
|
|
109
|
+
// Try to parse the input value as a datetime
|
|
110
|
+
const parsed = moment(value);
|
|
111
|
+
if (parsed.isValid()) {
|
|
112
|
+
this.selectedHours = parsed.hours();
|
|
113
|
+
this.selectedMinutes = parsed.minutes();
|
|
114
|
+
this.updateValue(parsed.toDate());
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
watchValue(_newValue) {
|
|
119
|
+
this.syncFromValueProp();
|
|
120
|
+
}
|
|
121
|
+
watchDisabled(newValue) {
|
|
122
|
+
this.disabledState = newValue;
|
|
123
|
+
}
|
|
124
|
+
watchHasError(newValue) {
|
|
125
|
+
this.errorState = newValue;
|
|
126
|
+
}
|
|
127
|
+
componentDidLoad() {
|
|
128
|
+
this.syncFromValueProp();
|
|
129
|
+
this.componentReady.emit();
|
|
130
|
+
if (!this.id) {
|
|
131
|
+
console.error('tabworthy-times: The "id" prop is required for accessibility');
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
syncFromValueProp() {
|
|
135
|
+
if (this.value) {
|
|
136
|
+
this.internalValue = this.value;
|
|
137
|
+
// Parse the first datetime value to set time picker
|
|
138
|
+
const firstValue = Array.isArray(this.value) ? this.value[0] : this.value;
|
|
139
|
+
if (firstValue) {
|
|
140
|
+
const parsed = moment(firstValue, this.format);
|
|
141
|
+
if (parsed.isValid()) {
|
|
142
|
+
this.selectedDate = parsed.toDate();
|
|
143
|
+
this.selectedHours = parsed.hours();
|
|
144
|
+
this.selectedMinutes = parsed.minutes();
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
this.internalValue = null;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
updateValue(date) {
|
|
153
|
+
if (Array.isArray(date)) {
|
|
154
|
+
// Range mode
|
|
155
|
+
const formattedDates = date.map((d) => {
|
|
156
|
+
const m = moment(d);
|
|
157
|
+
m.hours(this.selectedHours);
|
|
158
|
+
m.minutes(this.selectedMinutes);
|
|
159
|
+
m.seconds(0);
|
|
160
|
+
return m.format(this.format);
|
|
161
|
+
});
|
|
162
|
+
this.internalValue = formattedDates;
|
|
163
|
+
this.value = formattedDates;
|
|
164
|
+
this.selectDateTime.emit(formattedDates);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
// Single date mode
|
|
168
|
+
const m = moment(date);
|
|
169
|
+
m.hours(this.selectedHours);
|
|
170
|
+
m.minutes(this.selectedMinutes);
|
|
171
|
+
m.seconds(0);
|
|
172
|
+
const formatted = m.format(this.format);
|
|
173
|
+
this.internalValue = formatted;
|
|
174
|
+
this.value = formatted;
|
|
175
|
+
this.selectedDate = date;
|
|
176
|
+
this.selectDateTime.emit(formatted);
|
|
177
|
+
}
|
|
178
|
+
this.errorState = false;
|
|
179
|
+
this.formatInput();
|
|
180
|
+
}
|
|
181
|
+
formatInput() {
|
|
182
|
+
if (!this.internalValue)
|
|
183
|
+
return;
|
|
184
|
+
if (Array.isArray(this.internalValue)) {
|
|
185
|
+
// Format range
|
|
186
|
+
const formatted = this.internalValue
|
|
187
|
+
.map((v) => moment(v, this.format).format("lll"))
|
|
188
|
+
.join(` ${this.timesLabels.to} `);
|
|
189
|
+
this.inputRef.value = formatted;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
// Format single datetime
|
|
193
|
+
this.inputRef.value = moment(this.internalValue, this.format).format("lll");
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
getClassName(suffix) {
|
|
197
|
+
return `${this.elementClassName}__${suffix}`;
|
|
198
|
+
}
|
|
199
|
+
async clearValue() {
|
|
200
|
+
this.internalValue = null;
|
|
201
|
+
this.value = undefined;
|
|
202
|
+
this.selectedDate = undefined;
|
|
203
|
+
this.inputRef.value = "";
|
|
204
|
+
if (this.pickerRef) {
|
|
205
|
+
this.pickerRef.value = null;
|
|
206
|
+
}
|
|
207
|
+
this.selectDateTime.emit(undefined);
|
|
208
|
+
}
|
|
209
|
+
render() {
|
|
210
|
+
var _a;
|
|
211
|
+
return (h(Host, { key: 'e922c649f8ed2bf03711fe99ae73bca550c9d8ef', class: this.elementClassName, "has-error": this.errorState, disabled: this.disabledState }, h("label", { key: '6b8c053bcb4d232c52e0b95da141e4a433f2bc16', htmlFor: `${this.id}-input`, class: this.getClassName("label") }, this.label), h("div", { key: '1950259cf662cedae9b8f0fed6a61f095d3a4424', class: this.getClassName("input-container") }, h("input", { key: '1c6bfced55bd60706eadf6304eb7204c89bda8d6', id: `${this.id}-input`, ref: (r) => (this.inputRef = r), type: "text", class: this.getClassName("input"), placeholder: this.placeholder, disabled: this.disabledState, value: (_a = this.internalValue) === null || _a === void 0 ? void 0 : _a.toString(), onBlur: this.handleInputBlur, onChange: this.handleInputChange, "aria-describedby": this.errorState ? `${this.id}-error` : undefined, "aria-invalid": this.errorState }), !this.inline && (h("button", { key: '60b202b017d7ffe5de182908c809a24eba4f8e56', type: "button", ref: (r) => (this.calendarButtonRef = r), onClick: this.handleCalendarButtonClick, class: this.getClassName("calendar-button"), disabled: this.disabledState }, this.calendarButtonContent ? (h("span", { innerHTML: this.calendarButtonContent })) : (this.timesLabels.openCalendar)))), h("tabworthy-dates-modal", { key: '83716e92fd3711c65b23f007bba209bcc60a4d7d', label: this.timesLabels.calendar, ref: (el) => (this.modalRef = el), onOpened: () => {
|
|
212
|
+
if (this.pickerRef) {
|
|
213
|
+
this.pickerRef.modalIsOpen = true;
|
|
214
|
+
}
|
|
215
|
+
}, onClosed: () => {
|
|
216
|
+
if (this.pickerRef) {
|
|
217
|
+
this.pickerRef.modalIsOpen = false;
|
|
218
|
+
}
|
|
219
|
+
}, inline: this.inline }, h("div", { key: '3972712165cdc3069498d5683ca7b8b25041e44d', class: this.getClassName("picker-container") }, h("tabworthy-dates-calendar", { key: 'e6472861402e4926227657fb68f57d8671452260', range: this.range, locale: this.locale, onSelectDate: (event) => this.handlePickerSelection(event.detail), onChangeMonth: (event) => this.handleChangedMonths(event.detail), onChangeYear: (event) => this.handleYearChange(event.detail), labels: this.datesCalendarLabels, ref: (el) => (this.pickerRef = el), startDate: this.startDate, firstDayOfWeek: this.firstDayOfWeek, showHiddenTitle: true, disabled: this.disabledState, showMonthStepper: this.showMonthStepper, showYearStepper: this.showYearStepper, showClearButton: this.showClearButton, showTodayButton: this.showTodayButton, disableDate: this.disableDate, minDate: this.minDate, maxDate: this.maxDate, inline: this.inline }, h("div", { key: 'e9f7b9baa9544ae651b4b6b73094a215cabcc796', slot: "after-calendar", class: this.getClassName("time-section") }, h("tabworthy-times-picker", { key: 'b4c2f14b9311d1e3c186825785d6f64580f2896c', hours: this.selectedHours, minutes: this.selectedMinutes, use12HourFormat: this.use12HourFormat, disabled: this.disabledState, onTimeChanged: this.handleTimeChange }))))), this.errorState && (h("div", { key: '684dce5fc46c53feea28b19eca46746d7538aa3f', class: this.getClassName("input-error"), id: this.id ? `${this.id}-error` : undefined, role: "status" }, this.errorMessage))));
|
|
220
|
+
}
|
|
221
|
+
static get is() { return "tabworthy-times"; }
|
|
222
|
+
static get encapsulation() { return "scoped"; }
|
|
223
|
+
static get properties() {
|
|
224
|
+
return {
|
|
225
|
+
"id": {
|
|
226
|
+
"type": "string",
|
|
227
|
+
"mutable": false,
|
|
228
|
+
"complexType": {
|
|
229
|
+
"original": "string",
|
|
230
|
+
"resolved": "string",
|
|
231
|
+
"references": {}
|
|
232
|
+
},
|
|
233
|
+
"required": true,
|
|
234
|
+
"optional": false,
|
|
235
|
+
"docs": {
|
|
236
|
+
"tags": [],
|
|
237
|
+
"text": ""
|
|
238
|
+
},
|
|
239
|
+
"getter": false,
|
|
240
|
+
"setter": false,
|
|
241
|
+
"reflect": true,
|
|
242
|
+
"attribute": "id"
|
|
243
|
+
},
|
|
244
|
+
"value": {
|
|
245
|
+
"type": "string",
|
|
246
|
+
"mutable": true,
|
|
247
|
+
"complexType": {
|
|
248
|
+
"original": "string | string[]",
|
|
249
|
+
"resolved": "string | string[]",
|
|
250
|
+
"references": {}
|
|
251
|
+
},
|
|
252
|
+
"required": false,
|
|
253
|
+
"optional": true,
|
|
254
|
+
"docs": {
|
|
255
|
+
"tags": [],
|
|
256
|
+
"text": ""
|
|
257
|
+
},
|
|
258
|
+
"getter": false,
|
|
259
|
+
"setter": false,
|
|
260
|
+
"reflect": false,
|
|
261
|
+
"attribute": "value"
|
|
262
|
+
},
|
|
263
|
+
"range": {
|
|
264
|
+
"type": "boolean",
|
|
265
|
+
"mutable": false,
|
|
266
|
+
"complexType": {
|
|
267
|
+
"original": "boolean",
|
|
268
|
+
"resolved": "boolean",
|
|
269
|
+
"references": {}
|
|
270
|
+
},
|
|
271
|
+
"required": false,
|
|
272
|
+
"optional": true,
|
|
273
|
+
"docs": {
|
|
274
|
+
"tags": [],
|
|
275
|
+
"text": ""
|
|
276
|
+
},
|
|
277
|
+
"getter": false,
|
|
278
|
+
"setter": false,
|
|
279
|
+
"reflect": false,
|
|
280
|
+
"attribute": "range",
|
|
281
|
+
"defaultValue": "false"
|
|
282
|
+
},
|
|
283
|
+
"label": {
|
|
284
|
+
"type": "string",
|
|
285
|
+
"mutable": false,
|
|
286
|
+
"complexType": {
|
|
287
|
+
"original": "string",
|
|
288
|
+
"resolved": "string",
|
|
289
|
+
"references": {}
|
|
290
|
+
},
|
|
291
|
+
"required": false,
|
|
292
|
+
"optional": false,
|
|
293
|
+
"docs": {
|
|
294
|
+
"tags": [],
|
|
295
|
+
"text": ""
|
|
296
|
+
},
|
|
297
|
+
"getter": false,
|
|
298
|
+
"setter": false,
|
|
299
|
+
"reflect": false,
|
|
300
|
+
"attribute": "label",
|
|
301
|
+
"defaultValue": "\"Choose a date and time\""
|
|
302
|
+
},
|
|
303
|
+
"placeholder": {
|
|
304
|
+
"type": "string",
|
|
305
|
+
"mutable": false,
|
|
306
|
+
"complexType": {
|
|
307
|
+
"original": "string",
|
|
308
|
+
"resolved": "string",
|
|
309
|
+
"references": {}
|
|
310
|
+
},
|
|
311
|
+
"required": false,
|
|
312
|
+
"optional": false,
|
|
313
|
+
"docs": {
|
|
314
|
+
"tags": [],
|
|
315
|
+
"text": ""
|
|
316
|
+
},
|
|
317
|
+
"getter": false,
|
|
318
|
+
"setter": false,
|
|
319
|
+
"reflect": false,
|
|
320
|
+
"attribute": "placeholder",
|
|
321
|
+
"defaultValue": "\"\""
|
|
322
|
+
},
|
|
323
|
+
"locale": {
|
|
324
|
+
"type": "string",
|
|
325
|
+
"mutable": false,
|
|
326
|
+
"complexType": {
|
|
327
|
+
"original": "string",
|
|
328
|
+
"resolved": "string",
|
|
329
|
+
"references": {}
|
|
330
|
+
},
|
|
331
|
+
"required": false,
|
|
332
|
+
"optional": false,
|
|
333
|
+
"docs": {
|
|
334
|
+
"tags": [],
|
|
335
|
+
"text": ""
|
|
336
|
+
},
|
|
337
|
+
"getter": false,
|
|
338
|
+
"setter": false,
|
|
339
|
+
"reflect": false,
|
|
340
|
+
"attribute": "locale",
|
|
341
|
+
"defaultValue": "navigator?.language || \"en-US\""
|
|
342
|
+
},
|
|
343
|
+
"disabled": {
|
|
344
|
+
"type": "boolean",
|
|
345
|
+
"mutable": false,
|
|
346
|
+
"complexType": {
|
|
347
|
+
"original": "boolean",
|
|
348
|
+
"resolved": "boolean",
|
|
349
|
+
"references": {}
|
|
350
|
+
},
|
|
351
|
+
"required": false,
|
|
352
|
+
"optional": false,
|
|
353
|
+
"docs": {
|
|
354
|
+
"tags": [],
|
|
355
|
+
"text": ""
|
|
356
|
+
},
|
|
357
|
+
"getter": false,
|
|
358
|
+
"setter": false,
|
|
359
|
+
"reflect": false,
|
|
360
|
+
"attribute": "disabled",
|
|
361
|
+
"defaultValue": "false"
|
|
362
|
+
},
|
|
363
|
+
"minDate": {
|
|
364
|
+
"type": "string",
|
|
365
|
+
"mutable": false,
|
|
366
|
+
"complexType": {
|
|
367
|
+
"original": "string",
|
|
368
|
+
"resolved": "string",
|
|
369
|
+
"references": {}
|
|
370
|
+
},
|
|
371
|
+
"required": false,
|
|
372
|
+
"optional": true,
|
|
373
|
+
"docs": {
|
|
374
|
+
"tags": [],
|
|
375
|
+
"text": ""
|
|
376
|
+
},
|
|
377
|
+
"getter": false,
|
|
378
|
+
"setter": false,
|
|
379
|
+
"reflect": false,
|
|
380
|
+
"attribute": "min-date"
|
|
381
|
+
},
|
|
382
|
+
"maxDate": {
|
|
383
|
+
"type": "string",
|
|
384
|
+
"mutable": false,
|
|
385
|
+
"complexType": {
|
|
386
|
+
"original": "string",
|
|
387
|
+
"resolved": "string",
|
|
388
|
+
"references": {}
|
|
389
|
+
},
|
|
390
|
+
"required": false,
|
|
391
|
+
"optional": true,
|
|
392
|
+
"docs": {
|
|
393
|
+
"tags": [],
|
|
394
|
+
"text": ""
|
|
395
|
+
},
|
|
396
|
+
"getter": false,
|
|
397
|
+
"setter": false,
|
|
398
|
+
"reflect": false,
|
|
399
|
+
"attribute": "max-date"
|
|
400
|
+
},
|
|
401
|
+
"startDate": {
|
|
402
|
+
"type": "string",
|
|
403
|
+
"mutable": false,
|
|
404
|
+
"complexType": {
|
|
405
|
+
"original": "string",
|
|
406
|
+
"resolved": "string",
|
|
407
|
+
"references": {}
|
|
408
|
+
},
|
|
409
|
+
"required": false,
|
|
410
|
+
"optional": false,
|
|
411
|
+
"docs": {
|
|
412
|
+
"tags": [],
|
|
413
|
+
"text": ""
|
|
414
|
+
},
|
|
415
|
+
"getter": false,
|
|
416
|
+
"setter": false,
|
|
417
|
+
"reflect": false,
|
|
418
|
+
"attribute": "start-date",
|
|
419
|
+
"defaultValue": "getISODateString(new Date())"
|
|
420
|
+
},
|
|
421
|
+
"referenceDate": {
|
|
422
|
+
"type": "string",
|
|
423
|
+
"mutable": false,
|
|
424
|
+
"complexType": {
|
|
425
|
+
"original": "string",
|
|
426
|
+
"resolved": "string",
|
|
427
|
+
"references": {}
|
|
428
|
+
},
|
|
429
|
+
"required": false,
|
|
430
|
+
"optional": false,
|
|
431
|
+
"docs": {
|
|
432
|
+
"tags": [],
|
|
433
|
+
"text": ""
|
|
434
|
+
},
|
|
435
|
+
"getter": false,
|
|
436
|
+
"setter": false,
|
|
437
|
+
"reflect": false,
|
|
438
|
+
"attribute": "reference-date",
|
|
439
|
+
"defaultValue": "getISODateString(new Date())"
|
|
440
|
+
},
|
|
441
|
+
"use12HourFormat": {
|
|
442
|
+
"type": "boolean",
|
|
443
|
+
"mutable": false,
|
|
444
|
+
"complexType": {
|
|
445
|
+
"original": "boolean",
|
|
446
|
+
"resolved": "boolean",
|
|
447
|
+
"references": {}
|
|
448
|
+
},
|
|
449
|
+
"required": false,
|
|
450
|
+
"optional": false,
|
|
451
|
+
"docs": {
|
|
452
|
+
"tags": [],
|
|
453
|
+
"text": ""
|
|
454
|
+
},
|
|
455
|
+
"getter": false,
|
|
456
|
+
"setter": false,
|
|
457
|
+
"reflect": false,
|
|
458
|
+
"attribute": "use-1-2-hour-format",
|
|
459
|
+
"defaultValue": "true"
|
|
460
|
+
},
|
|
461
|
+
"timesLabels": {
|
|
462
|
+
"type": "unknown",
|
|
463
|
+
"mutable": false,
|
|
464
|
+
"complexType": {
|
|
465
|
+
"original": "TimesLabels",
|
|
466
|
+
"resolved": "TimesLabels",
|
|
467
|
+
"references": {
|
|
468
|
+
"TimesLabels": {
|
|
469
|
+
"location": "local",
|
|
470
|
+
"path": "/Users/damirbogdanov_1/work/tabworthy-components/src/components/tabworthy-times/tabworthy-times.tsx",
|
|
471
|
+
"id": "src/components/tabworthy-times/tabworthy-times.tsx::TimesLabels"
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
"required": false,
|
|
476
|
+
"optional": false,
|
|
477
|
+
"docs": {
|
|
478
|
+
"tags": [],
|
|
479
|
+
"text": ""
|
|
480
|
+
},
|
|
481
|
+
"getter": false,
|
|
482
|
+
"setter": false,
|
|
483
|
+
"defaultValue": "defaultLabels"
|
|
484
|
+
},
|
|
485
|
+
"datesCalendarLabels": {
|
|
486
|
+
"type": "unknown",
|
|
487
|
+
"mutable": false,
|
|
488
|
+
"complexType": {
|
|
489
|
+
"original": "DatesCalendarLabels",
|
|
490
|
+
"resolved": "{ clearButton: string; monthSelect: string; nextMonthButton: string; nextYearButton: string; picker: string; previousMonthButton: string; previousYearButton: string; todayButton: string; yearSelect: string; keyboardHint: string; selected: string; chooseAsStartDate: string; chooseAsEndDate: string; }",
|
|
491
|
+
"references": {
|
|
492
|
+
"DatesCalendarLabels": {
|
|
493
|
+
"location": "import",
|
|
494
|
+
"path": "../tabworthy-dates-calendar/tabworthy-dates-calendar",
|
|
495
|
+
"id": "src/components/tabworthy-dates-calendar/tabworthy-dates-calendar.tsx::DatesCalendarLabels",
|
|
496
|
+
"referenceLocation": "DatesCalendarLabels"
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
"required": false,
|
|
501
|
+
"optional": true,
|
|
502
|
+
"docs": {
|
|
503
|
+
"tags": [],
|
|
504
|
+
"text": ""
|
|
505
|
+
},
|
|
506
|
+
"getter": false,
|
|
507
|
+
"setter": false
|
|
508
|
+
},
|
|
509
|
+
"inline": {
|
|
510
|
+
"type": "boolean",
|
|
511
|
+
"mutable": false,
|
|
512
|
+
"complexType": {
|
|
513
|
+
"original": "boolean",
|
|
514
|
+
"resolved": "boolean",
|
|
515
|
+
"references": {}
|
|
516
|
+
},
|
|
517
|
+
"required": false,
|
|
518
|
+
"optional": false,
|
|
519
|
+
"docs": {
|
|
520
|
+
"tags": [],
|
|
521
|
+
"text": ""
|
|
522
|
+
},
|
|
523
|
+
"getter": false,
|
|
524
|
+
"setter": false,
|
|
525
|
+
"reflect": false,
|
|
526
|
+
"attribute": "inline",
|
|
527
|
+
"defaultValue": "false"
|
|
528
|
+
},
|
|
529
|
+
"hasError": {
|
|
530
|
+
"type": "boolean",
|
|
531
|
+
"mutable": true,
|
|
532
|
+
"complexType": {
|
|
533
|
+
"original": "boolean",
|
|
534
|
+
"resolved": "boolean",
|
|
535
|
+
"references": {}
|
|
536
|
+
},
|
|
537
|
+
"required": false,
|
|
538
|
+
"optional": false,
|
|
539
|
+
"docs": {
|
|
540
|
+
"tags": [],
|
|
541
|
+
"text": ""
|
|
542
|
+
},
|
|
543
|
+
"getter": false,
|
|
544
|
+
"setter": false,
|
|
545
|
+
"reflect": false,
|
|
546
|
+
"attribute": "has-error",
|
|
547
|
+
"defaultValue": "false"
|
|
548
|
+
},
|
|
549
|
+
"showYearStepper": {
|
|
550
|
+
"type": "boolean",
|
|
551
|
+
"mutable": false,
|
|
552
|
+
"complexType": {
|
|
553
|
+
"original": "boolean",
|
|
554
|
+
"resolved": "boolean",
|
|
555
|
+
"references": {}
|
|
556
|
+
},
|
|
557
|
+
"required": false,
|
|
558
|
+
"optional": false,
|
|
559
|
+
"docs": {
|
|
560
|
+
"tags": [],
|
|
561
|
+
"text": ""
|
|
562
|
+
},
|
|
563
|
+
"getter": false,
|
|
564
|
+
"setter": false,
|
|
565
|
+
"reflect": false,
|
|
566
|
+
"attribute": "show-year-stepper",
|
|
567
|
+
"defaultValue": "false"
|
|
568
|
+
},
|
|
569
|
+
"showMonthStepper": {
|
|
570
|
+
"type": "boolean",
|
|
571
|
+
"mutable": false,
|
|
572
|
+
"complexType": {
|
|
573
|
+
"original": "boolean",
|
|
574
|
+
"resolved": "boolean",
|
|
575
|
+
"references": {}
|
|
576
|
+
},
|
|
577
|
+
"required": false,
|
|
578
|
+
"optional": false,
|
|
579
|
+
"docs": {
|
|
580
|
+
"tags": [],
|
|
581
|
+
"text": ""
|
|
582
|
+
},
|
|
583
|
+
"getter": false,
|
|
584
|
+
"setter": false,
|
|
585
|
+
"reflect": false,
|
|
586
|
+
"attribute": "show-month-stepper",
|
|
587
|
+
"defaultValue": "true"
|
|
588
|
+
},
|
|
589
|
+
"showClearButton": {
|
|
590
|
+
"type": "boolean",
|
|
591
|
+
"mutable": false,
|
|
592
|
+
"complexType": {
|
|
593
|
+
"original": "boolean",
|
|
594
|
+
"resolved": "boolean",
|
|
595
|
+
"references": {}
|
|
596
|
+
},
|
|
597
|
+
"required": false,
|
|
598
|
+
"optional": false,
|
|
599
|
+
"docs": {
|
|
600
|
+
"tags": [],
|
|
601
|
+
"text": ""
|
|
602
|
+
},
|
|
603
|
+
"getter": false,
|
|
604
|
+
"setter": false,
|
|
605
|
+
"reflect": false,
|
|
606
|
+
"attribute": "show-clear-button",
|
|
607
|
+
"defaultValue": "true"
|
|
608
|
+
},
|
|
609
|
+
"showTodayButton": {
|
|
610
|
+
"type": "boolean",
|
|
611
|
+
"mutable": false,
|
|
612
|
+
"complexType": {
|
|
613
|
+
"original": "boolean",
|
|
614
|
+
"resolved": "boolean",
|
|
615
|
+
"references": {}
|
|
616
|
+
},
|
|
617
|
+
"required": false,
|
|
618
|
+
"optional": false,
|
|
619
|
+
"docs": {
|
|
620
|
+
"tags": [],
|
|
621
|
+
"text": ""
|
|
622
|
+
},
|
|
623
|
+
"getter": false,
|
|
624
|
+
"setter": false,
|
|
625
|
+
"reflect": false,
|
|
626
|
+
"attribute": "show-today-button",
|
|
627
|
+
"defaultValue": "true"
|
|
628
|
+
},
|
|
629
|
+
"calendarButtonContent": {
|
|
630
|
+
"type": "string",
|
|
631
|
+
"mutable": false,
|
|
632
|
+
"complexType": {
|
|
633
|
+
"original": "string",
|
|
634
|
+
"resolved": "string",
|
|
635
|
+
"references": {}
|
|
636
|
+
},
|
|
637
|
+
"required": false,
|
|
638
|
+
"optional": true,
|
|
639
|
+
"docs": {
|
|
640
|
+
"tags": [],
|
|
641
|
+
"text": ""
|
|
642
|
+
},
|
|
643
|
+
"getter": false,
|
|
644
|
+
"setter": false,
|
|
645
|
+
"reflect": false,
|
|
646
|
+
"attribute": "calendar-button-content"
|
|
647
|
+
},
|
|
648
|
+
"disableDate": {
|
|
649
|
+
"type": "unknown",
|
|
650
|
+
"mutable": false,
|
|
651
|
+
"complexType": {
|
|
652
|
+
"original": "(date: Date) => boolean",
|
|
653
|
+
"resolved": "(date: Date) => boolean",
|
|
654
|
+
"references": {
|
|
655
|
+
"Date": {
|
|
656
|
+
"location": "global",
|
|
657
|
+
"id": "global::Date"
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
},
|
|
661
|
+
"required": false,
|
|
662
|
+
"optional": false,
|
|
663
|
+
"docs": {
|
|
664
|
+
"tags": [],
|
|
665
|
+
"text": ""
|
|
666
|
+
},
|
|
667
|
+
"getter": false,
|
|
668
|
+
"setter": false,
|
|
669
|
+
"defaultValue": "() => false"
|
|
670
|
+
},
|
|
671
|
+
"elementClassName": {
|
|
672
|
+
"type": "string",
|
|
673
|
+
"mutable": false,
|
|
674
|
+
"complexType": {
|
|
675
|
+
"original": "string",
|
|
676
|
+
"resolved": "string",
|
|
677
|
+
"references": {}
|
|
678
|
+
},
|
|
679
|
+
"required": false,
|
|
680
|
+
"optional": true,
|
|
681
|
+
"docs": {
|
|
682
|
+
"tags": [],
|
|
683
|
+
"text": ""
|
|
684
|
+
},
|
|
685
|
+
"getter": false,
|
|
686
|
+
"setter": false,
|
|
687
|
+
"reflect": false,
|
|
688
|
+
"attribute": "element-class-name",
|
|
689
|
+
"defaultValue": "\"tabworthy-times\""
|
|
690
|
+
},
|
|
691
|
+
"firstDayOfWeek": {
|
|
692
|
+
"type": "number",
|
|
693
|
+
"mutable": false,
|
|
694
|
+
"complexType": {
|
|
695
|
+
"original": "number",
|
|
696
|
+
"resolved": "number",
|
|
697
|
+
"references": {}
|
|
698
|
+
},
|
|
699
|
+
"required": false,
|
|
700
|
+
"optional": true,
|
|
701
|
+
"docs": {
|
|
702
|
+
"tags": [],
|
|
703
|
+
"text": ""
|
|
704
|
+
},
|
|
705
|
+
"getter": false,
|
|
706
|
+
"setter": false,
|
|
707
|
+
"reflect": false,
|
|
708
|
+
"attribute": "first-day-of-week",
|
|
709
|
+
"defaultValue": "1"
|
|
710
|
+
},
|
|
711
|
+
"format": {
|
|
712
|
+
"type": "string",
|
|
713
|
+
"mutable": false,
|
|
714
|
+
"complexType": {
|
|
715
|
+
"original": "string",
|
|
716
|
+
"resolved": "string",
|
|
717
|
+
"references": {}
|
|
718
|
+
},
|
|
719
|
+
"required": false,
|
|
720
|
+
"optional": false,
|
|
721
|
+
"docs": {
|
|
722
|
+
"tags": [],
|
|
723
|
+
"text": ""
|
|
724
|
+
},
|
|
725
|
+
"getter": false,
|
|
726
|
+
"setter": false,
|
|
727
|
+
"reflect": false,
|
|
728
|
+
"attribute": "format",
|
|
729
|
+
"defaultValue": "\"YYYY-MM-DDTHH:mm:ss\""
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
static get states() {
|
|
734
|
+
return {
|
|
735
|
+
"internalValue": {},
|
|
736
|
+
"selectedDate": {},
|
|
737
|
+
"selectedHours": {},
|
|
738
|
+
"selectedMinutes": {},
|
|
739
|
+
"errorState": {},
|
|
740
|
+
"disabledState": {}
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
static get events() {
|
|
744
|
+
return [{
|
|
745
|
+
"method": "selectDateTime",
|
|
746
|
+
"name": "selectDateTime",
|
|
747
|
+
"bubbles": true,
|
|
748
|
+
"cancelable": true,
|
|
749
|
+
"composed": true,
|
|
750
|
+
"docs": {
|
|
751
|
+
"tags": [],
|
|
752
|
+
"text": ""
|
|
753
|
+
},
|
|
754
|
+
"complexType": {
|
|
755
|
+
"original": "string | string[] | undefined",
|
|
756
|
+
"resolved": "string | string[]",
|
|
757
|
+
"references": {}
|
|
758
|
+
}
|
|
759
|
+
}, {
|
|
760
|
+
"method": "changeYear",
|
|
761
|
+
"name": "changeYear",
|
|
762
|
+
"bubbles": true,
|
|
763
|
+
"cancelable": true,
|
|
764
|
+
"composed": true,
|
|
765
|
+
"docs": {
|
|
766
|
+
"tags": [],
|
|
767
|
+
"text": ""
|
|
768
|
+
},
|
|
769
|
+
"complexType": {
|
|
770
|
+
"original": "YearChangedEventDetails",
|
|
771
|
+
"resolved": "YearChangedEventDetails",
|
|
772
|
+
"references": {
|
|
773
|
+
"YearChangedEventDetails": {
|
|
774
|
+
"location": "import",
|
|
775
|
+
"path": "../tabworthy-dates-calendar/tabworthy-dates-calendar",
|
|
776
|
+
"id": "src/components/tabworthy-dates-calendar/tabworthy-dates-calendar.tsx::YearChangedEventDetails",
|
|
777
|
+
"referenceLocation": "YearChangedEventDetails"
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
}, {
|
|
782
|
+
"method": "componentReady",
|
|
783
|
+
"name": "componentReady",
|
|
784
|
+
"bubbles": true,
|
|
785
|
+
"cancelable": true,
|
|
786
|
+
"composed": true,
|
|
787
|
+
"docs": {
|
|
788
|
+
"tags": [],
|
|
789
|
+
"text": ""
|
|
790
|
+
},
|
|
791
|
+
"complexType": {
|
|
792
|
+
"original": "void",
|
|
793
|
+
"resolved": "void",
|
|
794
|
+
"references": {}
|
|
795
|
+
}
|
|
796
|
+
}];
|
|
797
|
+
}
|
|
798
|
+
static get methods() {
|
|
799
|
+
return {
|
|
800
|
+
"clearValue": {
|
|
801
|
+
"complexType": {
|
|
802
|
+
"signature": "() => Promise<void>",
|
|
803
|
+
"parameters": [],
|
|
804
|
+
"references": {
|
|
805
|
+
"Promise": {
|
|
806
|
+
"location": "global",
|
|
807
|
+
"id": "global::Promise"
|
|
808
|
+
}
|
|
809
|
+
},
|
|
810
|
+
"return": "Promise<void>"
|
|
811
|
+
},
|
|
812
|
+
"docs": {
|
|
813
|
+
"text": "",
|
|
814
|
+
"tags": []
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
};
|
|
818
|
+
}
|
|
819
|
+
static get elementRef() { return "el"; }
|
|
820
|
+
static get watchers() {
|
|
821
|
+
return [{
|
|
822
|
+
"propName": "value",
|
|
823
|
+
"methodName": "watchValue"
|
|
824
|
+
}, {
|
|
825
|
+
"propName": "disabled",
|
|
826
|
+
"methodName": "watchDisabled"
|
|
827
|
+
}, {
|
|
828
|
+
"propName": "hasError",
|
|
829
|
+
"methodName": "watchHasError"
|
|
830
|
+
}];
|
|
831
|
+
}
|
|
832
|
+
}
|