@aurodesignsystem-dev/auro-formkit 0.0.0-pr1483.0 → 0.0.0-pr1483.1
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/components/checkbox/demo/customize.min.js +2 -233
- package/components/checkbox/demo/getting-started.min.js +2 -233
- package/components/checkbox/demo/index.min.js +2 -233
- package/components/checkbox/dist/index.js +2 -233
- package/components/checkbox/dist/registered.js +2 -233
- package/components/combobox/demo/customize.min.js +5 -236
- package/components/combobox/demo/getting-started.min.js +5 -236
- package/components/combobox/demo/index.min.js +5 -236
- package/components/combobox/dist/index.js +5 -236
- package/components/combobox/dist/registered.js +5 -236
- package/components/counter/demo/customize.min.js +3 -234
- package/components/counter/demo/index.min.js +3 -234
- package/components/counter/dist/index.js +2 -233
- package/components/counter/dist/registered.js +2 -233
- package/components/datepicker/demo/index.min.js +6 -5
- package/components/datepicker/dist/index.js +6 -5
- package/components/datepicker/dist/registered.js +6 -5
- package/components/dropdown/demo/customize.min.js +1 -1
- package/components/dropdown/demo/getting-started.min.js +1 -1
- package/components/dropdown/demo/index.min.js +1 -1
- package/components/dropdown/dist/index.js +1 -1
- package/components/dropdown/dist/registered.js +1 -1
- package/components/form/demo/customize.min.js +168 -1322
- package/components/form/demo/getting-started.min.js +168 -1322
- package/components/form/demo/index.min.js +168 -1322
- package/components/form/demo/registerDemoDeps.min.js +168 -1322
- package/components/input/demo/customize.min.js +2 -2
- package/components/input/demo/getting-started.min.js +2 -2
- package/components/input/demo/index.min.js +2 -2
- package/components/input/dist/index.js +2 -2
- package/components/input/dist/registered.js +2 -2
- package/components/radio/demo/index.min.js +2 -233
- package/components/radio/dist/index.js +2 -233
- package/components/radio/dist/registered.js +2 -233
- package/components/select/demo/customize.min.js +3 -234
- package/components/select/demo/getting-started.min.js +3 -234
- package/components/select/demo/index.min.js +3 -234
- package/components/select/dist/index.js +3 -234
- package/components/select/dist/registered.js +3 -234
- package/custom-elements.json +1444 -1444
- package/package.json +1 -1
|
@@ -130,237 +130,6 @@ let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
-
/**
|
|
134
|
-
* @description Splits a date string into its parts according to the provided format. Does NOT validate that the result is a real calendar date — use `parseDate` when validation is required.
|
|
135
|
-
* @param {string} dateStr - Date string to parse.
|
|
136
|
-
* @param {string} format - Date format to parse.
|
|
137
|
-
* @returns {{ month?: string, day?: string, year?: string }|undefined}
|
|
138
|
-
*/
|
|
139
|
-
function getDateParts$1(dateStr, format) {
|
|
140
|
-
if (!dateStr) {
|
|
141
|
-
return undefined;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const formatSeparatorMatch = format.match(/[/.-]/);
|
|
145
|
-
let valueParts;
|
|
146
|
-
let formatParts;
|
|
147
|
-
|
|
148
|
-
if (formatSeparatorMatch) {
|
|
149
|
-
const separator = formatSeparatorMatch[0];
|
|
150
|
-
valueParts = dateStr.split(separator);
|
|
151
|
-
formatParts = format.split(separator);
|
|
152
|
-
} else {
|
|
153
|
-
if (dateStr.match(/[/.-]/)) {
|
|
154
|
-
throw new Error(
|
|
155
|
-
"AuroDatepickerUtilities | parseDate: Date string has no separators",
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
if (dateStr.length !== format.length) {
|
|
160
|
-
throw new Error(
|
|
161
|
-
"AuroDatepickerUtilities | parseDate: Date string and format length do not match",
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
valueParts = [dateStr];
|
|
166
|
-
formatParts = [format];
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
if (valueParts.length !== formatParts.length) {
|
|
170
|
-
throw new Error(
|
|
171
|
-
`AuroDatepickerUtilities | parseDate: Date string and format do not match : ${dateStr} vs ${format}`,
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
const result = formatParts.reduce((acc, part, index) => {
|
|
176
|
-
const value = valueParts[index];
|
|
177
|
-
|
|
178
|
-
if (/m/iu.test(part) && part.length === value.length) {
|
|
179
|
-
acc.month = value;
|
|
180
|
-
} else if (/d/iu.test(part) && part.length === value.length) {
|
|
181
|
-
acc.day = value;
|
|
182
|
-
} else if (/y/iu.test(part) && part.length === value.length) {
|
|
183
|
-
acc.year = value;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return acc;
|
|
187
|
-
}, {});
|
|
188
|
-
|
|
189
|
-
if (!result.month && !result.day && !result.year) {
|
|
190
|
-
throw new Error(
|
|
191
|
-
"AuroDatepickerUtilities | parseDate: Unable to parse date string",
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return result;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function isCalendarDate$1(year, month, day) {
|
|
199
|
-
let yearNumber = Number(year);
|
|
200
|
-
const monthNumber = Number(month);
|
|
201
|
-
const dayNumber = Number(day);
|
|
202
|
-
|
|
203
|
-
if (
|
|
204
|
-
!Number.isInteger(yearNumber) ||
|
|
205
|
-
!Number.isInteger(monthNumber) ||
|
|
206
|
-
!Number.isInteger(dayNumber)
|
|
207
|
-
) {
|
|
208
|
-
return false;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// Handle 2-digit years by converting them to 4-digit years based on a cutoff. This allows for parsing of 2-digit year formats while still validating the resulting date.
|
|
212
|
-
if (yearNumber < 100 && yearNumber >= 50) {
|
|
213
|
-
yearNumber += 1900;
|
|
214
|
-
} else if (yearNumber < 50) {
|
|
215
|
-
yearNumber += 2000;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
const stringified = `${String(yearNumber).padStart(4, "0")}-${String(monthNumber).padStart(2, "0")}-${String(dayNumber).padStart(2, "0")}`;
|
|
219
|
-
const date = new Date(stringified.replace(/[.-]/g, "/"));
|
|
220
|
-
|
|
221
|
-
return (
|
|
222
|
-
!Number.isNaN(date.getTime()) && toISOFormatString$1(date) === stringified
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* @description Parses a date string into its components and validates that the result is a real calendar date. Use `getDateParts` instead when raw splitting without validation is needed (e.g. for in-progress input).
|
|
228
|
-
*
|
|
229
|
-
* Partial formats are supported: components absent from `format` default to `year → "0"`,
|
|
230
|
-
* `month → "01"`, `day → "01"` for calendar validation only. The returned object contains
|
|
231
|
-
* only the fields actually present in the format string — missing fields are never injected.
|
|
232
|
-
* @param {string} dateStr - Date string to parse.
|
|
233
|
-
* @param {string} format - Date format to parse.
|
|
234
|
-
* @returns {{ month?: string, day?: string, year?: string }|undefined}
|
|
235
|
-
* @throws {Error} Throws when the parsed result does not represent a valid calendar date.
|
|
236
|
-
*/
|
|
237
|
-
function parseDate$1(dateStr, format = "mm/dd/yyyy") {
|
|
238
|
-
if (!dateStr || !format) {
|
|
239
|
-
return undefined;
|
|
240
|
-
}
|
|
241
|
-
const result = getDateParts$1(dateStr.trim(), format);
|
|
242
|
-
|
|
243
|
-
if (!result) {
|
|
244
|
-
return undefined;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
const lowerFormat = format.toLowerCase();
|
|
248
|
-
const year = lowerFormat.includes("yy") ? result.year : "0";
|
|
249
|
-
const month = lowerFormat.includes("mm") ? result.month : "01";
|
|
250
|
-
const day = lowerFormat.includes("dd") ? result.day : "01";
|
|
251
|
-
|
|
252
|
-
if (isCalendarDate$1(year, month, day)) {
|
|
253
|
-
return result;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
throw new Error(
|
|
257
|
-
`AuroDatepickerUtilities | parseDate: Date string is not a valid date ${JSON.stringify(result)} with format ${format}`,
|
|
258
|
-
);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Convert a date object to string format.
|
|
263
|
-
* @param {Object} date - Date to convert to string.
|
|
264
|
-
* @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
|
|
265
|
-
* @returns {String} Returns the date as a string.
|
|
266
|
-
*/
|
|
267
|
-
function getDateAsString$1(date, locale = undefined) {
|
|
268
|
-
return date.toLocaleDateString(locale, {
|
|
269
|
-
year: "numeric",
|
|
270
|
-
month: "2-digit",
|
|
271
|
-
day: "2-digit",
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Converts a date string to a North American date format.
|
|
277
|
-
* @param {String} dateStr - Date to validate.
|
|
278
|
-
* @param {String} format - Date format to validate against.
|
|
279
|
-
* @returns {String}
|
|
280
|
-
*/
|
|
281
|
-
function toNorthAmericanFormat$1(dateStr, format) {
|
|
282
|
-
if (format === "mm/dd/yyyy") {
|
|
283
|
-
return dateStr;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
const parsedDate = parseDate$1(dateStr, format);
|
|
287
|
-
|
|
288
|
-
if (!parsedDate) {
|
|
289
|
-
throw new Error(
|
|
290
|
-
"AuroDatepickerUtilities | toNorthAmericanFormat: Unable to parse date string",
|
|
291
|
-
);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
const { month, day, year } = parsedDate;
|
|
295
|
-
|
|
296
|
-
return [month, day, year].filter(Boolean).join("/");
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Validates that a date string matches the provided format and represents a real calendar date.
|
|
301
|
-
*
|
|
302
|
-
* @param {string} dateStr - Date string to validate.
|
|
303
|
-
* @param {string} [format="yyyy-mm-dd"] - Format of the date string.
|
|
304
|
-
* @returns {boolean} True when the date string is valid for the provided format, otherwise false.
|
|
305
|
-
*/
|
|
306
|
-
function isValidDate$1(dateStr, format = "yyyy-mm-dd") {
|
|
307
|
-
try {
|
|
308
|
-
if (typeof dateStr !== "string" || !dateStr || format?.length < 8) {
|
|
309
|
-
return false;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
if (parseDate$1(dateStr, format)) {
|
|
313
|
-
return true;
|
|
314
|
-
}
|
|
315
|
-
} catch (error) {
|
|
316
|
-
return false;
|
|
317
|
-
}
|
|
318
|
-
return false;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Converts a JavaScript Date instance to a simple ISO-like date string. This returns only the calendar date portion without any time or timezone information.
|
|
323
|
-
*
|
|
324
|
-
* @param {Date} date - Date instance to convert to an ISO-like string.
|
|
325
|
-
* @returns {string} A string in the format "yyyy-mm-dd" representing the provided date.
|
|
326
|
-
* @throws {Error} Throws an error when the input is not a valid Date instance.
|
|
327
|
-
*/
|
|
328
|
-
function toISOFormatString$1(date) {
|
|
329
|
-
if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
|
|
330
|
-
throw new Error(
|
|
331
|
-
"AuroDatepickerUtilities | toISOFormatString: Input must be a valid Date instance",
|
|
332
|
-
);
|
|
333
|
-
}
|
|
334
|
-
return `${String(date.getFullYear()).padStart(4, "0")}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Converts a date string into a JavaScript Date instance. This method supports ISO formatted strings and other formats that can be parsed by the formatter.
|
|
339
|
-
*
|
|
340
|
-
* @param {String} dateStr - Date string to convert into a Date object.
|
|
341
|
-
* @param {String} format - Date format used to parse the string when it is not in ISO format.
|
|
342
|
-
* @returns {Date|null} Returns a Date instance for valid input or null for non-string input.
|
|
343
|
-
* @throws {Error} Throws when parsing fails for non-ISO string input.
|
|
344
|
-
*/
|
|
345
|
-
function stringToDateInstance$1(dateStr, format = "yyyy-mm-dd") {
|
|
346
|
-
if (typeof dateStr !== "string") {
|
|
347
|
-
return null;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
const { month, day, year } = parseDate$1(dateStr, format);
|
|
351
|
-
return new Date(`${year}/${month}/${day}`);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
const dateFormatter$1 = {
|
|
355
|
-
parseDate: parseDate$1,
|
|
356
|
-
getDateParts: getDateParts$1,
|
|
357
|
-
getDateAsString: getDateAsString$1,
|
|
358
|
-
toNorthAmericanFormat: toNorthAmericanFormat$1,
|
|
359
|
-
isValidDate: isValidDate$1,
|
|
360
|
-
toISOFormatString: toISOFormatString$1,
|
|
361
|
-
stringToDateInstance: stringToDateInstance$1,
|
|
362
|
-
};
|
|
363
|
-
|
|
364
133
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
365
134
|
// See LICENSE in the project root for license information.
|
|
366
135
|
|
|
@@ -582,7 +351,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
582
351
|
}
|
|
583
352
|
|
|
584
353
|
// Validate that the date passed was the correct format and is a valid date
|
|
585
|
-
if (elem.value && !
|
|
354
|
+
if (elem.value && !elem.valueObject) {
|
|
586
355
|
elem.validity = 'patternMismatch';
|
|
587
356
|
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || 'Invalid Date Format Entered';
|
|
588
357
|
return;
|
|
@@ -5020,7 +4789,7 @@ let AuroHelpText$2 = class AuroHelpText extends LitElement {
|
|
|
5020
4789
|
}
|
|
5021
4790
|
};
|
|
5022
4791
|
|
|
5023
|
-
var formkitVersion$2 = '
|
|
4792
|
+
var formkitVersion$2 = '202605271820';
|
|
5024
4793
|
|
|
5025
4794
|
let AuroElement$2 = class AuroElement extends LitElement {
|
|
5026
4795
|
static get properties() {
|
|
@@ -10437,7 +10206,7 @@ class AuroFormValidation {
|
|
|
10437
10206
|
}
|
|
10438
10207
|
|
|
10439
10208
|
// Validate that the date passed was the correct format and is a valid date
|
|
10440
|
-
if (elem.value && !
|
|
10209
|
+
if (elem.value && !elem.valueObject) {
|
|
10441
10210
|
elem.validity = 'patternMismatch';
|
|
10442
10211
|
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || 'Invalid Date Format Entered';
|
|
10443
10212
|
return;
|
|
@@ -18271,7 +18040,7 @@ let AuroHelpText$1 = class AuroHelpText extends LitElement {
|
|
|
18271
18040
|
}
|
|
18272
18041
|
};
|
|
18273
18042
|
|
|
18274
|
-
var formkitVersion$1 = '
|
|
18043
|
+
var formkitVersion$1 = '202605271820';
|
|
18275
18044
|
|
|
18276
18045
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
18277
18046
|
// See LICENSE in the project root for license information.
|
|
@@ -19388,7 +19157,7 @@ class AuroBibtemplate extends LitElement {
|
|
|
19388
19157
|
}
|
|
19389
19158
|
}
|
|
19390
19159
|
|
|
19391
|
-
var formkitVersion = '
|
|
19160
|
+
var formkitVersion = '202605271820';
|
|
19392
19161
|
|
|
19393
19162
|
var styleCss$1 = css`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;text-align:left}:host [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: transparent}:host #inputInBib::part(wrapper){box-shadow:none}:host #inputInBib::part(accent-left){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
|
|
19394
19163
|
|
|
@@ -130,237 +130,6 @@ let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
132
|
|
|
133
|
-
/**
|
|
134
|
-
* @description Splits a date string into its parts according to the provided format. Does NOT validate that the result is a real calendar date — use `parseDate` when validation is required.
|
|
135
|
-
* @param {string} dateStr - Date string to parse.
|
|
136
|
-
* @param {string} format - Date format to parse.
|
|
137
|
-
* @returns {{ month?: string, day?: string, year?: string }|undefined}
|
|
138
|
-
*/
|
|
139
|
-
function getDateParts$1(dateStr, format) {
|
|
140
|
-
if (!dateStr) {
|
|
141
|
-
return undefined;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
const formatSeparatorMatch = format.match(/[/.-]/);
|
|
145
|
-
let valueParts;
|
|
146
|
-
let formatParts;
|
|
147
|
-
|
|
148
|
-
if (formatSeparatorMatch) {
|
|
149
|
-
const separator = formatSeparatorMatch[0];
|
|
150
|
-
valueParts = dateStr.split(separator);
|
|
151
|
-
formatParts = format.split(separator);
|
|
152
|
-
} else {
|
|
153
|
-
if (dateStr.match(/[/.-]/)) {
|
|
154
|
-
throw new Error(
|
|
155
|
-
"AuroDatepickerUtilities | parseDate: Date string has no separators",
|
|
156
|
-
);
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
if (dateStr.length !== format.length) {
|
|
160
|
-
throw new Error(
|
|
161
|
-
"AuroDatepickerUtilities | parseDate: Date string and format length do not match",
|
|
162
|
-
);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
valueParts = [dateStr];
|
|
166
|
-
formatParts = [format];
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
if (valueParts.length !== formatParts.length) {
|
|
170
|
-
throw new Error(
|
|
171
|
-
`AuroDatepickerUtilities | parseDate: Date string and format do not match : ${dateStr} vs ${format}`,
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
const result = formatParts.reduce((acc, part, index) => {
|
|
176
|
-
const value = valueParts[index];
|
|
177
|
-
|
|
178
|
-
if (/m/iu.test(part) && part.length === value.length) {
|
|
179
|
-
acc.month = value;
|
|
180
|
-
} else if (/d/iu.test(part) && part.length === value.length) {
|
|
181
|
-
acc.day = value;
|
|
182
|
-
} else if (/y/iu.test(part) && part.length === value.length) {
|
|
183
|
-
acc.year = value;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
return acc;
|
|
187
|
-
}, {});
|
|
188
|
-
|
|
189
|
-
if (!result.month && !result.day && !result.year) {
|
|
190
|
-
throw new Error(
|
|
191
|
-
"AuroDatepickerUtilities | parseDate: Unable to parse date string",
|
|
192
|
-
);
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
return result;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function isCalendarDate$1(year, month, day) {
|
|
199
|
-
let yearNumber = Number(year);
|
|
200
|
-
const monthNumber = Number(month);
|
|
201
|
-
const dayNumber = Number(day);
|
|
202
|
-
|
|
203
|
-
if (
|
|
204
|
-
!Number.isInteger(yearNumber) ||
|
|
205
|
-
!Number.isInteger(monthNumber) ||
|
|
206
|
-
!Number.isInteger(dayNumber)
|
|
207
|
-
) {
|
|
208
|
-
return false;
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
// Handle 2-digit years by converting them to 4-digit years based on a cutoff. This allows for parsing of 2-digit year formats while still validating the resulting date.
|
|
212
|
-
if (yearNumber < 100 && yearNumber >= 50) {
|
|
213
|
-
yearNumber += 1900;
|
|
214
|
-
} else if (yearNumber < 50) {
|
|
215
|
-
yearNumber += 2000;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
const stringified = `${String(yearNumber).padStart(4, "0")}-${String(monthNumber).padStart(2, "0")}-${String(dayNumber).padStart(2, "0")}`;
|
|
219
|
-
const date = new Date(stringified.replace(/[.-]/g, "/"));
|
|
220
|
-
|
|
221
|
-
return (
|
|
222
|
-
!Number.isNaN(date.getTime()) && toISOFormatString$1(date) === stringified
|
|
223
|
-
);
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* @description Parses a date string into its components and validates that the result is a real calendar date. Use `getDateParts` instead when raw splitting without validation is needed (e.g. for in-progress input).
|
|
228
|
-
*
|
|
229
|
-
* Partial formats are supported: components absent from `format` default to `year → "0"`,
|
|
230
|
-
* `month → "01"`, `day → "01"` for calendar validation only. The returned object contains
|
|
231
|
-
* only the fields actually present in the format string — missing fields are never injected.
|
|
232
|
-
* @param {string} dateStr - Date string to parse.
|
|
233
|
-
* @param {string} format - Date format to parse.
|
|
234
|
-
* @returns {{ month?: string, day?: string, year?: string }|undefined}
|
|
235
|
-
* @throws {Error} Throws when the parsed result does not represent a valid calendar date.
|
|
236
|
-
*/
|
|
237
|
-
function parseDate$1(dateStr, format = "mm/dd/yyyy") {
|
|
238
|
-
if (!dateStr || !format) {
|
|
239
|
-
return undefined;
|
|
240
|
-
}
|
|
241
|
-
const result = getDateParts$1(dateStr.trim(), format);
|
|
242
|
-
|
|
243
|
-
if (!result) {
|
|
244
|
-
return undefined;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
const lowerFormat = format.toLowerCase();
|
|
248
|
-
const year = lowerFormat.includes("yy") ? result.year : "0";
|
|
249
|
-
const month = lowerFormat.includes("mm") ? result.month : "01";
|
|
250
|
-
const day = lowerFormat.includes("dd") ? result.day : "01";
|
|
251
|
-
|
|
252
|
-
if (isCalendarDate$1(year, month, day)) {
|
|
253
|
-
return result;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
throw new Error(
|
|
257
|
-
`AuroDatepickerUtilities | parseDate: Date string is not a valid date ${JSON.stringify(result)} with format ${format}`,
|
|
258
|
-
);
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Convert a date object to string format.
|
|
263
|
-
* @param {Object} date - Date to convert to string.
|
|
264
|
-
* @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
|
|
265
|
-
* @returns {String} Returns the date as a string.
|
|
266
|
-
*/
|
|
267
|
-
function getDateAsString$1(date, locale = undefined) {
|
|
268
|
-
return date.toLocaleDateString(locale, {
|
|
269
|
-
year: "numeric",
|
|
270
|
-
month: "2-digit",
|
|
271
|
-
day: "2-digit",
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Converts a date string to a North American date format.
|
|
277
|
-
* @param {String} dateStr - Date to validate.
|
|
278
|
-
* @param {String} format - Date format to validate against.
|
|
279
|
-
* @returns {String}
|
|
280
|
-
*/
|
|
281
|
-
function toNorthAmericanFormat$1(dateStr, format) {
|
|
282
|
-
if (format === "mm/dd/yyyy") {
|
|
283
|
-
return dateStr;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
const parsedDate = parseDate$1(dateStr, format);
|
|
287
|
-
|
|
288
|
-
if (!parsedDate) {
|
|
289
|
-
throw new Error(
|
|
290
|
-
"AuroDatepickerUtilities | toNorthAmericanFormat: Unable to parse date string",
|
|
291
|
-
);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
const { month, day, year } = parsedDate;
|
|
295
|
-
|
|
296
|
-
return [month, day, year].filter(Boolean).join("/");
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Validates that a date string matches the provided format and represents a real calendar date.
|
|
301
|
-
*
|
|
302
|
-
* @param {string} dateStr - Date string to validate.
|
|
303
|
-
* @param {string} [format="yyyy-mm-dd"] - Format of the date string.
|
|
304
|
-
* @returns {boolean} True when the date string is valid for the provided format, otherwise false.
|
|
305
|
-
*/
|
|
306
|
-
function isValidDate$1(dateStr, format = "yyyy-mm-dd") {
|
|
307
|
-
try {
|
|
308
|
-
if (typeof dateStr !== "string" || !dateStr || format?.length < 8) {
|
|
309
|
-
return false;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
if (parseDate$1(dateStr, format)) {
|
|
313
|
-
return true;
|
|
314
|
-
}
|
|
315
|
-
} catch (error) {
|
|
316
|
-
return false;
|
|
317
|
-
}
|
|
318
|
-
return false;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Converts a JavaScript Date instance to a simple ISO-like date string. This returns only the calendar date portion without any time or timezone information.
|
|
323
|
-
*
|
|
324
|
-
* @param {Date} date - Date instance to convert to an ISO-like string.
|
|
325
|
-
* @returns {string} A string in the format "yyyy-mm-dd" representing the provided date.
|
|
326
|
-
* @throws {Error} Throws an error when the input is not a valid Date instance.
|
|
327
|
-
*/
|
|
328
|
-
function toISOFormatString$1(date) {
|
|
329
|
-
if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
|
|
330
|
-
throw new Error(
|
|
331
|
-
"AuroDatepickerUtilities | toISOFormatString: Input must be a valid Date instance",
|
|
332
|
-
);
|
|
333
|
-
}
|
|
334
|
-
return `${String(date.getFullYear()).padStart(4, "0")}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Converts a date string into a JavaScript Date instance. This method supports ISO formatted strings and other formats that can be parsed by the formatter.
|
|
339
|
-
*
|
|
340
|
-
* @param {String} dateStr - Date string to convert into a Date object.
|
|
341
|
-
* @param {String} format - Date format used to parse the string when it is not in ISO format.
|
|
342
|
-
* @returns {Date|null} Returns a Date instance for valid input or null for non-string input.
|
|
343
|
-
* @throws {Error} Throws when parsing fails for non-ISO string input.
|
|
344
|
-
*/
|
|
345
|
-
function stringToDateInstance$1(dateStr, format = "yyyy-mm-dd") {
|
|
346
|
-
if (typeof dateStr !== "string") {
|
|
347
|
-
return null;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
const { month, day, year } = parseDate$1(dateStr, format);
|
|
351
|
-
return new Date(`${year}/${month}/${day}`);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
const dateFormatter$1 = {
|
|
355
|
-
parseDate: parseDate$1,
|
|
356
|
-
getDateParts: getDateParts$1,
|
|
357
|
-
getDateAsString: getDateAsString$1,
|
|
358
|
-
toNorthAmericanFormat: toNorthAmericanFormat$1,
|
|
359
|
-
isValidDate: isValidDate$1,
|
|
360
|
-
toISOFormatString: toISOFormatString$1,
|
|
361
|
-
stringToDateInstance: stringToDateInstance$1,
|
|
362
|
-
};
|
|
363
|
-
|
|
364
133
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
365
134
|
// See LICENSE in the project root for license information.
|
|
366
135
|
|
|
@@ -582,7 +351,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
582
351
|
}
|
|
583
352
|
|
|
584
353
|
// Validate that the date passed was the correct format and is a valid date
|
|
585
|
-
if (elem.value && !
|
|
354
|
+
if (elem.value && !elem.valueObject) {
|
|
586
355
|
elem.validity = 'patternMismatch';
|
|
587
356
|
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || 'Invalid Date Format Entered';
|
|
588
357
|
return;
|
|
@@ -5020,7 +4789,7 @@ let AuroHelpText$2 = class AuroHelpText extends LitElement {
|
|
|
5020
4789
|
}
|
|
5021
4790
|
};
|
|
5022
4791
|
|
|
5023
|
-
var formkitVersion$2 = '
|
|
4792
|
+
var formkitVersion$2 = '202605271820';
|
|
5024
4793
|
|
|
5025
4794
|
let AuroElement$2 = class AuroElement extends LitElement {
|
|
5026
4795
|
static get properties() {
|
|
@@ -10437,7 +10206,7 @@ class AuroFormValidation {
|
|
|
10437
10206
|
}
|
|
10438
10207
|
|
|
10439
10208
|
// Validate that the date passed was the correct format and is a valid date
|
|
10440
|
-
if (elem.value && !
|
|
10209
|
+
if (elem.value && !elem.valueObject) {
|
|
10441
10210
|
elem.validity = 'patternMismatch';
|
|
10442
10211
|
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || 'Invalid Date Format Entered';
|
|
10443
10212
|
return;
|
|
@@ -18271,7 +18040,7 @@ let AuroHelpText$1 = class AuroHelpText extends LitElement {
|
|
|
18271
18040
|
}
|
|
18272
18041
|
};
|
|
18273
18042
|
|
|
18274
|
-
var formkitVersion$1 = '
|
|
18043
|
+
var formkitVersion$1 = '202605271820';
|
|
18275
18044
|
|
|
18276
18045
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
18277
18046
|
// See LICENSE in the project root for license information.
|
|
@@ -19388,7 +19157,7 @@ class AuroBibtemplate extends LitElement {
|
|
|
19388
19157
|
}
|
|
19389
19158
|
}
|
|
19390
19159
|
|
|
19391
|
-
var formkitVersion = '
|
|
19160
|
+
var formkitVersion = '202605271820';
|
|
19392
19161
|
|
|
19393
19162
|
var styleCss$1 = css`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host{display:block;text-align:left}:host [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: transparent}:host #inputInBib::part(wrapper){box-shadow:none}:host #inputInBib::part(accent-left){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
|
|
19394
19163
|
|