@aurodesignsystem-dev/auro-formkit 0.0.0-pr1483.0 → 0.0.0-pr1483.2
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 +8 -7
- package/components/datepicker/dist/index.js +8 -7
- package/components/datepicker/dist/registered.js +8 -7
- 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 +170 -1324
- package/components/form/demo/getting-started.min.js +170 -1324
- package/components/form/demo/index.min.js +170 -1324
- package/components/form/demo/registerDemoDeps.min.js +170 -1324
- 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
|
@@ -167,237 +167,6 @@ let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
|
167
167
|
}
|
|
168
168
|
};
|
|
169
169
|
|
|
170
|
-
/**
|
|
171
|
-
* @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.
|
|
172
|
-
* @param {string} dateStr - Date string to parse.
|
|
173
|
-
* @param {string} format - Date format to parse.
|
|
174
|
-
* @returns {{ month?: string, day?: string, year?: string }|undefined}
|
|
175
|
-
*/
|
|
176
|
-
function getDateParts$1(dateStr, format) {
|
|
177
|
-
if (!dateStr) {
|
|
178
|
-
return undefined;
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
const formatSeparatorMatch = format.match(/[/.-]/);
|
|
182
|
-
let valueParts;
|
|
183
|
-
let formatParts;
|
|
184
|
-
|
|
185
|
-
if (formatSeparatorMatch) {
|
|
186
|
-
const separator = formatSeparatorMatch[0];
|
|
187
|
-
valueParts = dateStr.split(separator);
|
|
188
|
-
formatParts = format.split(separator);
|
|
189
|
-
} else {
|
|
190
|
-
if (dateStr.match(/[/.-]/)) {
|
|
191
|
-
throw new Error(
|
|
192
|
-
"AuroDatepickerUtilities | parseDate: Date string has no separators",
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
if (dateStr.length !== format.length) {
|
|
197
|
-
throw new Error(
|
|
198
|
-
"AuroDatepickerUtilities | parseDate: Date string and format length do not match",
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
valueParts = [dateStr];
|
|
203
|
-
formatParts = [format];
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
if (valueParts.length !== formatParts.length) {
|
|
207
|
-
throw new Error(
|
|
208
|
-
`AuroDatepickerUtilities | parseDate: Date string and format do not match : ${dateStr} vs ${format}`,
|
|
209
|
-
);
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
const result = formatParts.reduce((acc, part, index) => {
|
|
213
|
-
const value = valueParts[index];
|
|
214
|
-
|
|
215
|
-
if (/m/iu.test(part) && part.length === value.length) {
|
|
216
|
-
acc.month = value;
|
|
217
|
-
} else if (/d/iu.test(part) && part.length === value.length) {
|
|
218
|
-
acc.day = value;
|
|
219
|
-
} else if (/y/iu.test(part) && part.length === value.length) {
|
|
220
|
-
acc.year = value;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
return acc;
|
|
224
|
-
}, {});
|
|
225
|
-
|
|
226
|
-
if (!result.month && !result.day && !result.year) {
|
|
227
|
-
throw new Error(
|
|
228
|
-
"AuroDatepickerUtilities | parseDate: Unable to parse date string",
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
return result;
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
function isCalendarDate$1(year, month, day) {
|
|
236
|
-
let yearNumber = Number(year);
|
|
237
|
-
const monthNumber = Number(month);
|
|
238
|
-
const dayNumber = Number(day);
|
|
239
|
-
|
|
240
|
-
if (
|
|
241
|
-
!Number.isInteger(yearNumber) ||
|
|
242
|
-
!Number.isInteger(monthNumber) ||
|
|
243
|
-
!Number.isInteger(dayNumber)
|
|
244
|
-
) {
|
|
245
|
-
return false;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
// 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.
|
|
249
|
-
if (yearNumber < 100 && yearNumber >= 50) {
|
|
250
|
-
yearNumber += 1900;
|
|
251
|
-
} else if (yearNumber < 50) {
|
|
252
|
-
yearNumber += 2000;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
const stringified = `${String(yearNumber).padStart(4, "0")}-${String(monthNumber).padStart(2, "0")}-${String(dayNumber).padStart(2, "0")}`;
|
|
256
|
-
const date = new Date(stringified.replace(/[.-]/g, "/"));
|
|
257
|
-
|
|
258
|
-
return (
|
|
259
|
-
!Number.isNaN(date.getTime()) && toISOFormatString$1(date) === stringified
|
|
260
|
-
);
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* @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).
|
|
265
|
-
*
|
|
266
|
-
* Partial formats are supported: components absent from `format` default to `year → "0"`,
|
|
267
|
-
* `month → "01"`, `day → "01"` for calendar validation only. The returned object contains
|
|
268
|
-
* only the fields actually present in the format string — missing fields are never injected.
|
|
269
|
-
* @param {string} dateStr - Date string to parse.
|
|
270
|
-
* @param {string} format - Date format to parse.
|
|
271
|
-
* @returns {{ month?: string, day?: string, year?: string }|undefined}
|
|
272
|
-
* @throws {Error} Throws when the parsed result does not represent a valid calendar date.
|
|
273
|
-
*/
|
|
274
|
-
function parseDate$1(dateStr, format = "mm/dd/yyyy") {
|
|
275
|
-
if (!dateStr || !format) {
|
|
276
|
-
return undefined;
|
|
277
|
-
}
|
|
278
|
-
const result = getDateParts$1(dateStr.trim(), format);
|
|
279
|
-
|
|
280
|
-
if (!result) {
|
|
281
|
-
return undefined;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
const lowerFormat = format.toLowerCase();
|
|
285
|
-
const year = lowerFormat.includes("yy") ? result.year : "0";
|
|
286
|
-
const month = lowerFormat.includes("mm") ? result.month : "01";
|
|
287
|
-
const day = lowerFormat.includes("dd") ? result.day : "01";
|
|
288
|
-
|
|
289
|
-
if (isCalendarDate$1(year, month, day)) {
|
|
290
|
-
return result;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
throw new Error(
|
|
294
|
-
`AuroDatepickerUtilities | parseDate: Date string is not a valid date ${JSON.stringify(result)} with format ${format}`,
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
/**
|
|
299
|
-
* Convert a date object to string format.
|
|
300
|
-
* @param {Object} date - Date to convert to string.
|
|
301
|
-
* @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
|
|
302
|
-
* @returns {String} Returns the date as a string.
|
|
303
|
-
*/
|
|
304
|
-
function getDateAsString$1(date, locale = undefined) {
|
|
305
|
-
return date.toLocaleDateString(locale, {
|
|
306
|
-
year: "numeric",
|
|
307
|
-
month: "2-digit",
|
|
308
|
-
day: "2-digit",
|
|
309
|
-
});
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Converts a date string to a North American date format.
|
|
314
|
-
* @param {String} dateStr - Date to validate.
|
|
315
|
-
* @param {String} format - Date format to validate against.
|
|
316
|
-
* @returns {String}
|
|
317
|
-
*/
|
|
318
|
-
function toNorthAmericanFormat$1(dateStr, format) {
|
|
319
|
-
if (format === "mm/dd/yyyy") {
|
|
320
|
-
return dateStr;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
const parsedDate = parseDate$1(dateStr, format);
|
|
324
|
-
|
|
325
|
-
if (!parsedDate) {
|
|
326
|
-
throw new Error(
|
|
327
|
-
"AuroDatepickerUtilities | toNorthAmericanFormat: Unable to parse date string",
|
|
328
|
-
);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
const { month, day, year } = parsedDate;
|
|
332
|
-
|
|
333
|
-
return [month, day, year].filter(Boolean).join("/");
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
/**
|
|
337
|
-
* Validates that a date string matches the provided format and represents a real calendar date.
|
|
338
|
-
*
|
|
339
|
-
* @param {string} dateStr - Date string to validate.
|
|
340
|
-
* @param {string} [format="yyyy-mm-dd"] - Format of the date string.
|
|
341
|
-
* @returns {boolean} True when the date string is valid for the provided format, otherwise false.
|
|
342
|
-
*/
|
|
343
|
-
function isValidDate$1(dateStr, format = "yyyy-mm-dd") {
|
|
344
|
-
try {
|
|
345
|
-
if (typeof dateStr !== "string" || !dateStr || format?.length < 8) {
|
|
346
|
-
return false;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
if (parseDate$1(dateStr, format)) {
|
|
350
|
-
return true;
|
|
351
|
-
}
|
|
352
|
-
} catch (error) {
|
|
353
|
-
return false;
|
|
354
|
-
}
|
|
355
|
-
return false;
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
/**
|
|
359
|
-
* 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.
|
|
360
|
-
*
|
|
361
|
-
* @param {Date} date - Date instance to convert to an ISO-like string.
|
|
362
|
-
* @returns {string} A string in the format "yyyy-mm-dd" representing the provided date.
|
|
363
|
-
* @throws {Error} Throws an error when the input is not a valid Date instance.
|
|
364
|
-
*/
|
|
365
|
-
function toISOFormatString$1(date) {
|
|
366
|
-
if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
|
|
367
|
-
throw new Error(
|
|
368
|
-
"AuroDatepickerUtilities | toISOFormatString: Input must be a valid Date instance",
|
|
369
|
-
);
|
|
370
|
-
}
|
|
371
|
-
return `${String(date.getFullYear()).padStart(4, "0")}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
/**
|
|
375
|
-
* 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.
|
|
376
|
-
*
|
|
377
|
-
* @param {String} dateStr - Date string to convert into a Date object.
|
|
378
|
-
* @param {String} format - Date format used to parse the string when it is not in ISO format.
|
|
379
|
-
* @returns {Date|null} Returns a Date instance for valid input or null for non-string input.
|
|
380
|
-
* @throws {Error} Throws when parsing fails for non-ISO string input.
|
|
381
|
-
*/
|
|
382
|
-
function stringToDateInstance$1(dateStr, format = "yyyy-mm-dd") {
|
|
383
|
-
if (typeof dateStr !== "string") {
|
|
384
|
-
return null;
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
const { month, day, year } = parseDate$1(dateStr, format);
|
|
388
|
-
return new Date(`${year}/${month}/${day}`);
|
|
389
|
-
}
|
|
390
|
-
|
|
391
|
-
const dateFormatter$1 = {
|
|
392
|
-
parseDate: parseDate$1,
|
|
393
|
-
getDateParts: getDateParts$1,
|
|
394
|
-
getDateAsString: getDateAsString$1,
|
|
395
|
-
toNorthAmericanFormat: toNorthAmericanFormat$1,
|
|
396
|
-
isValidDate: isValidDate$1,
|
|
397
|
-
toISOFormatString: toISOFormatString$1,
|
|
398
|
-
stringToDateInstance: stringToDateInstance$1,
|
|
399
|
-
};
|
|
400
|
-
|
|
401
170
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
402
171
|
// See LICENSE in the project root for license information.
|
|
403
172
|
|
|
@@ -619,7 +388,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
619
388
|
}
|
|
620
389
|
|
|
621
390
|
// Validate that the date passed was the correct format and is a valid date
|
|
622
|
-
if (elem.value && !
|
|
391
|
+
if (elem.value && !elem.valueObject) {
|
|
623
392
|
elem.validity = 'patternMismatch';
|
|
624
393
|
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || 'Invalid Date Format Entered';
|
|
625
394
|
return;
|
|
@@ -5087,7 +4856,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$4 {
|
|
|
5087
4856
|
}
|
|
5088
4857
|
};
|
|
5089
4858
|
|
|
5090
|
-
var formkitVersion$2 = '
|
|
4859
|
+
var formkitVersion$2 = '202605271836';
|
|
5091
4860
|
|
|
5092
4861
|
let AuroElement$2 = class AuroElement extends i$4 {
|
|
5093
4862
|
static get properties() {
|
|
@@ -10511,7 +10280,7 @@ class AuroFormValidation {
|
|
|
10511
10280
|
}
|
|
10512
10281
|
|
|
10513
10282
|
// Validate that the date passed was the correct format and is a valid date
|
|
10514
|
-
if (elem.value && !
|
|
10283
|
+
if (elem.value && !elem.valueObject) {
|
|
10515
10284
|
elem.validity = 'patternMismatch';
|
|
10516
10285
|
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || 'Invalid Date Format Entered';
|
|
10517
10286
|
return;
|
|
@@ -18345,7 +18114,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$4 {
|
|
|
18345
18114
|
}
|
|
18346
18115
|
};
|
|
18347
18116
|
|
|
18348
|
-
var formkitVersion$1 = '
|
|
18117
|
+
var formkitVersion$1 = '202605271836';
|
|
18349
18118
|
|
|
18350
18119
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
18351
18120
|
// See LICENSE in the project root for license information.
|
|
@@ -19462,7 +19231,7 @@ class AuroBibtemplate extends i$4 {
|
|
|
19462
19231
|
}
|
|
19463
19232
|
}
|
|
19464
19233
|
|
|
19465
|
-
var formkitVersion = '
|
|
19234
|
+
var formkitVersion = '202605271836';
|
|
19466
19235
|
|
|
19467
19236
|
var styleCss$3 = i$7`.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}`;
|
|
19468
19237
|
|
|
@@ -182,237 +182,6 @@ let AuroLibraryRuntimeUtils$4 = class AuroLibraryRuntimeUtils {
|
|
|
182
182
|
}
|
|
183
183
|
};
|
|
184
184
|
|
|
185
|
-
/**
|
|
186
|
-
* @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.
|
|
187
|
-
* @param {string} dateStr - Date string to parse.
|
|
188
|
-
* @param {string} format - Date format to parse.
|
|
189
|
-
* @returns {{ month?: string, day?: string, year?: string }|undefined}
|
|
190
|
-
*/
|
|
191
|
-
function getDateParts$1(dateStr, format) {
|
|
192
|
-
if (!dateStr) {
|
|
193
|
-
return undefined;
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const formatSeparatorMatch = format.match(/[/.-]/);
|
|
197
|
-
let valueParts;
|
|
198
|
-
let formatParts;
|
|
199
|
-
|
|
200
|
-
if (formatSeparatorMatch) {
|
|
201
|
-
const separator = formatSeparatorMatch[0];
|
|
202
|
-
valueParts = dateStr.split(separator);
|
|
203
|
-
formatParts = format.split(separator);
|
|
204
|
-
} else {
|
|
205
|
-
if (dateStr.match(/[/.-]/)) {
|
|
206
|
-
throw new Error(
|
|
207
|
-
"AuroDatepickerUtilities | parseDate: Date string has no separators",
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
if (dateStr.length !== format.length) {
|
|
212
|
-
throw new Error(
|
|
213
|
-
"AuroDatepickerUtilities | parseDate: Date string and format length do not match",
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
valueParts = [dateStr];
|
|
218
|
-
formatParts = [format];
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
if (valueParts.length !== formatParts.length) {
|
|
222
|
-
throw new Error(
|
|
223
|
-
`AuroDatepickerUtilities | parseDate: Date string and format do not match : ${dateStr} vs ${format}`,
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
const result = formatParts.reduce((acc, part, index) => {
|
|
228
|
-
const value = valueParts[index];
|
|
229
|
-
|
|
230
|
-
if (/m/iu.test(part) && part.length === value.length) {
|
|
231
|
-
acc.month = value;
|
|
232
|
-
} else if (/d/iu.test(part) && part.length === value.length) {
|
|
233
|
-
acc.day = value;
|
|
234
|
-
} else if (/y/iu.test(part) && part.length === value.length) {
|
|
235
|
-
acc.year = value;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
return acc;
|
|
239
|
-
}, {});
|
|
240
|
-
|
|
241
|
-
if (!result.month && !result.day && !result.year) {
|
|
242
|
-
throw new Error(
|
|
243
|
-
"AuroDatepickerUtilities | parseDate: Unable to parse date string",
|
|
244
|
-
);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
return result;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
function isCalendarDate$1(year, month, day) {
|
|
251
|
-
let yearNumber = Number(year);
|
|
252
|
-
const monthNumber = Number(month);
|
|
253
|
-
const dayNumber = Number(day);
|
|
254
|
-
|
|
255
|
-
if (
|
|
256
|
-
!Number.isInteger(yearNumber) ||
|
|
257
|
-
!Number.isInteger(monthNumber) ||
|
|
258
|
-
!Number.isInteger(dayNumber)
|
|
259
|
-
) {
|
|
260
|
-
return false;
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
// 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.
|
|
264
|
-
if (yearNumber < 100 && yearNumber >= 50) {
|
|
265
|
-
yearNumber += 1900;
|
|
266
|
-
} else if (yearNumber < 50) {
|
|
267
|
-
yearNumber += 2000;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
const stringified = `${String(yearNumber).padStart(4, "0")}-${String(monthNumber).padStart(2, "0")}-${String(dayNumber).padStart(2, "0")}`;
|
|
271
|
-
const date = new Date(stringified.replace(/[.-]/g, "/"));
|
|
272
|
-
|
|
273
|
-
return (
|
|
274
|
-
!Number.isNaN(date.getTime()) && toISOFormatString$1(date) === stringified
|
|
275
|
-
);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* @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).
|
|
280
|
-
*
|
|
281
|
-
* Partial formats are supported: components absent from `format` default to `year → "0"`,
|
|
282
|
-
* `month → "01"`, `day → "01"` for calendar validation only. The returned object contains
|
|
283
|
-
* only the fields actually present in the format string — missing fields are never injected.
|
|
284
|
-
* @param {string} dateStr - Date string to parse.
|
|
285
|
-
* @param {string} format - Date format to parse.
|
|
286
|
-
* @returns {{ month?: string, day?: string, year?: string }|undefined}
|
|
287
|
-
* @throws {Error} Throws when the parsed result does not represent a valid calendar date.
|
|
288
|
-
*/
|
|
289
|
-
function parseDate$1(dateStr, format = "mm/dd/yyyy") {
|
|
290
|
-
if (!dateStr || !format) {
|
|
291
|
-
return undefined;
|
|
292
|
-
}
|
|
293
|
-
const result = getDateParts$1(dateStr.trim(), format);
|
|
294
|
-
|
|
295
|
-
if (!result) {
|
|
296
|
-
return undefined;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
const lowerFormat = format.toLowerCase();
|
|
300
|
-
const year = lowerFormat.includes("yy") ? result.year : "0";
|
|
301
|
-
const month = lowerFormat.includes("mm") ? result.month : "01";
|
|
302
|
-
const day = lowerFormat.includes("dd") ? result.day : "01";
|
|
303
|
-
|
|
304
|
-
if (isCalendarDate$1(year, month, day)) {
|
|
305
|
-
return result;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
throw new Error(
|
|
309
|
-
`AuroDatepickerUtilities | parseDate: Date string is not a valid date ${JSON.stringify(result)} with format ${format}`,
|
|
310
|
-
);
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
/**
|
|
314
|
-
* Convert a date object to string format.
|
|
315
|
-
* @param {Object} date - Date to convert to string.
|
|
316
|
-
* @param {String} locale - Optional locale to use for the date string. Defaults to user's locale.
|
|
317
|
-
* @returns {String} Returns the date as a string.
|
|
318
|
-
*/
|
|
319
|
-
function getDateAsString$1(date, locale = undefined) {
|
|
320
|
-
return date.toLocaleDateString(locale, {
|
|
321
|
-
year: "numeric",
|
|
322
|
-
month: "2-digit",
|
|
323
|
-
day: "2-digit",
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* Converts a date string to a North American date format.
|
|
329
|
-
* @param {String} dateStr - Date to validate.
|
|
330
|
-
* @param {String} format - Date format to validate against.
|
|
331
|
-
* @returns {String}
|
|
332
|
-
*/
|
|
333
|
-
function toNorthAmericanFormat$1(dateStr, format) {
|
|
334
|
-
if (format === "mm/dd/yyyy") {
|
|
335
|
-
return dateStr;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
const parsedDate = parseDate$1(dateStr, format);
|
|
339
|
-
|
|
340
|
-
if (!parsedDate) {
|
|
341
|
-
throw new Error(
|
|
342
|
-
"AuroDatepickerUtilities | toNorthAmericanFormat: Unable to parse date string",
|
|
343
|
-
);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
const { month, day, year } = parsedDate;
|
|
347
|
-
|
|
348
|
-
return [month, day, year].filter(Boolean).join("/");
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* Validates that a date string matches the provided format and represents a real calendar date.
|
|
353
|
-
*
|
|
354
|
-
* @param {string} dateStr - Date string to validate.
|
|
355
|
-
* @param {string} [format="yyyy-mm-dd"] - Format of the date string.
|
|
356
|
-
* @returns {boolean} True when the date string is valid for the provided format, otherwise false.
|
|
357
|
-
*/
|
|
358
|
-
function isValidDate$1(dateStr, format = "yyyy-mm-dd") {
|
|
359
|
-
try {
|
|
360
|
-
if (typeof dateStr !== "string" || !dateStr || format?.length < 8) {
|
|
361
|
-
return false;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
if (parseDate$1(dateStr, format)) {
|
|
365
|
-
return true;
|
|
366
|
-
}
|
|
367
|
-
} catch (error) {
|
|
368
|
-
return false;
|
|
369
|
-
}
|
|
370
|
-
return false;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* 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.
|
|
375
|
-
*
|
|
376
|
-
* @param {Date} date - Date instance to convert to an ISO-like string.
|
|
377
|
-
* @returns {string} A string in the format "yyyy-mm-dd" representing the provided date.
|
|
378
|
-
* @throws {Error} Throws an error when the input is not a valid Date instance.
|
|
379
|
-
*/
|
|
380
|
-
function toISOFormatString$1(date) {
|
|
381
|
-
if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
|
|
382
|
-
throw new Error(
|
|
383
|
-
"AuroDatepickerUtilities | toISOFormatString: Input must be a valid Date instance",
|
|
384
|
-
);
|
|
385
|
-
}
|
|
386
|
-
return `${String(date.getFullYear()).padStart(4, "0")}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* 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.
|
|
391
|
-
*
|
|
392
|
-
* @param {String} dateStr - Date string to convert into a Date object.
|
|
393
|
-
* @param {String} format - Date format used to parse the string when it is not in ISO format.
|
|
394
|
-
* @returns {Date|null} Returns a Date instance for valid input or null for non-string input.
|
|
395
|
-
* @throws {Error} Throws when parsing fails for non-ISO string input.
|
|
396
|
-
*/
|
|
397
|
-
function stringToDateInstance$1(dateStr, format = "yyyy-mm-dd") {
|
|
398
|
-
if (typeof dateStr !== "string") {
|
|
399
|
-
return null;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
const { month, day, year } = parseDate$1(dateStr, format);
|
|
403
|
-
return new Date(`${year}/${month}/${day}`);
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
const dateFormatter$1 = {
|
|
407
|
-
parseDate: parseDate$1,
|
|
408
|
-
getDateParts: getDateParts$1,
|
|
409
|
-
getDateAsString: getDateAsString$1,
|
|
410
|
-
toNorthAmericanFormat: toNorthAmericanFormat$1,
|
|
411
|
-
isValidDate: isValidDate$1,
|
|
412
|
-
toISOFormatString: toISOFormatString$1,
|
|
413
|
-
stringToDateInstance: stringToDateInstance$1,
|
|
414
|
-
};
|
|
415
|
-
|
|
416
185
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
417
186
|
// See LICENSE in the project root for license information.
|
|
418
187
|
|
|
@@ -634,7 +403,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
634
403
|
}
|
|
635
404
|
|
|
636
405
|
// Validate that the date passed was the correct format and is a valid date
|
|
637
|
-
if (elem.value && !
|
|
406
|
+
if (elem.value && !elem.valueObject) {
|
|
638
407
|
elem.validity = 'patternMismatch';
|
|
639
408
|
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || 'Invalid Date Format Entered';
|
|
640
409
|
return;
|
|
@@ -5102,7 +4871,7 @@ let AuroHelpText$2 = class AuroHelpText extends i$4 {
|
|
|
5102
4871
|
}
|
|
5103
4872
|
};
|
|
5104
4873
|
|
|
5105
|
-
var formkitVersion$2 = '
|
|
4874
|
+
var formkitVersion$2 = '202605271836';
|
|
5106
4875
|
|
|
5107
4876
|
let AuroElement$2 = class AuroElement extends i$4 {
|
|
5108
4877
|
static get properties() {
|
|
@@ -10526,7 +10295,7 @@ class AuroFormValidation {
|
|
|
10526
10295
|
}
|
|
10527
10296
|
|
|
10528
10297
|
// Validate that the date passed was the correct format and is a valid date
|
|
10529
|
-
if (elem.value && !
|
|
10298
|
+
if (elem.value && !elem.valueObject) {
|
|
10530
10299
|
elem.validity = 'patternMismatch';
|
|
10531
10300
|
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || 'Invalid Date Format Entered';
|
|
10532
10301
|
return;
|
|
@@ -18360,7 +18129,7 @@ let AuroHelpText$1 = class AuroHelpText extends i$4 {
|
|
|
18360
18129
|
}
|
|
18361
18130
|
};
|
|
18362
18131
|
|
|
18363
|
-
var formkitVersion$1 = '
|
|
18132
|
+
var formkitVersion$1 = '202605271836';
|
|
18364
18133
|
|
|
18365
18134
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
18366
18135
|
// See LICENSE in the project root for license information.
|
|
@@ -19477,7 +19246,7 @@ class AuroBibtemplate extends i$4 {
|
|
|
19477
19246
|
}
|
|
19478
19247
|
}
|
|
19479
19248
|
|
|
19480
|
-
var formkitVersion = '
|
|
19249
|
+
var formkitVersion = '202605271836';
|
|
19481
19250
|
|
|
19482
19251
|
var styleCss$3 = i$7`.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}`;
|
|
19483
19252
|
|