@aurodesignsystem-dev/auro-formkit 0.0.0-pr1506.0 → 0.0.0-pr1506.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.html +1 -2
- package/components/checkbox/demo/customize.min.js +1 -1
- package/components/checkbox/demo/getting-started.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/customize.html +1 -2
- package/components/combobox/demo/customize.md +108 -132
- package/components/combobox/demo/customize.min.js +26 -130
- package/components/combobox/demo/getting-started.min.js +26 -130
- package/components/combobox/demo/index.min.js +26 -130
- package/components/combobox/dist/index.js +26 -130
- package/components/combobox/dist/registered.js +26 -130
- package/components/counter/demo/customize.min.js +2 -2
- package/components/counter/demo/index.min.js +2 -2
- package/components/counter/dist/index.js +2 -2
- package/components/counter/dist/registered.js +2 -2
- package/components/datepicker/demo/customize.min.js +12 -124
- package/components/datepicker/demo/index.min.js +12 -124
- package/components/datepicker/dist/index.js +12 -124
- package/components/datepicker/dist/registered.js +12 -124
- 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.html +6 -6
- package/components/form/demo/customize.js +19 -0
- package/components/form/demo/customize.md +203 -51
- package/components/form/demo/customize.min.js +489 -419
- package/components/form/demo/getting-started.min.js +417 -419
- package/components/form/demo/index.min.js +417 -419
- package/components/form/demo/registerDemoDeps.min.js +54 -382
- package/components/form/dist/auro-form.d.ts +122 -4
- package/components/form/dist/index.js +363 -37
- package/components/form/dist/registered.js +363 -37
- package/components/input/demo/customize.html +1 -2
- package/components/input/demo/customize.min.js +10 -122
- package/components/input/demo/getting-started.min.js +10 -122
- package/components/input/demo/index.min.js +10 -122
- package/components/input/dist/base-input.d.ts +1 -49
- package/components/input/dist/index.js +10 -122
- package/components/input/dist/registered.js +10 -122
- package/components/radio/demo/customize.min.js +1 -1
- package/components/radio/demo/getting-started.min.js +1 -1
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/customize.html +1 -2
- package/components/select/demo/customize.min.js +2 -2
- package/components/select/demo/getting-started.min.js +2 -2
- package/components/select/demo/index.min.js +2 -2
- package/components/select/dist/index.js +2 -2
- package/components/select/dist/registered.js +2 -2
- package/custom-elements.json +123 -266
- package/package.json +1 -1
|
@@ -10541,10 +10541,8 @@ class BaseInput extends AuroElement {
|
|
|
10541
10541
|
this.layout = 'classic';
|
|
10542
10542
|
this.locale = 'en-US';
|
|
10543
10543
|
this.max = undefined;
|
|
10544
|
-
this._maxObject = undefined;
|
|
10545
10544
|
this.maxLength = undefined;
|
|
10546
10545
|
this.min = undefined;
|
|
10547
|
-
this._minObject = undefined;
|
|
10548
10546
|
this.minLength = undefined;
|
|
10549
10547
|
this.required = false;
|
|
10550
10548
|
this.onDark = false;
|
|
@@ -10552,7 +10550,6 @@ class BaseInput extends AuroElement {
|
|
|
10552
10550
|
this.size = 'lg';
|
|
10553
10551
|
this.shape = 'classic';
|
|
10554
10552
|
this.value = undefined;
|
|
10555
|
-
this._valueObject = undefined;
|
|
10556
10553
|
|
|
10557
10554
|
this._initializePrivateDefaults();
|
|
10558
10555
|
}
|
|
@@ -11092,7 +11089,7 @@ class BaseInput extends AuroElement {
|
|
|
11092
11089
|
* @returns {Date|undefined}
|
|
11093
11090
|
*/
|
|
11094
11091
|
get valueObject() {
|
|
11095
|
-
return this.
|
|
11092
|
+
return this.value && dateFormatter.isValidDate(this.value) ? dateFormatter.stringToDateInstance(this.value) : undefined;
|
|
11096
11093
|
}
|
|
11097
11094
|
|
|
11098
11095
|
/**
|
|
@@ -11100,7 +11097,7 @@ class BaseInput extends AuroElement {
|
|
|
11100
11097
|
* @returns {Date|undefined}
|
|
11101
11098
|
*/
|
|
11102
11099
|
get minObject() {
|
|
11103
|
-
return this.
|
|
11100
|
+
return this.min && dateFormatter.isValidDate(this.min) ? dateFormatter.stringToDateInstance(this.min) : undefined;
|
|
11104
11101
|
}
|
|
11105
11102
|
|
|
11106
11103
|
/**
|
|
@@ -11108,50 +11105,7 @@ class BaseInput extends AuroElement {
|
|
|
11108
11105
|
* @returns {Date|undefined}
|
|
11109
11106
|
*/
|
|
11110
11107
|
get maxObject() {
|
|
11111
|
-
return this.
|
|
11112
|
-
}
|
|
11113
|
-
|
|
11114
|
-
/**
|
|
11115
|
-
* Parses a date string into a Date object when the corresponding `_*Object`
|
|
11116
|
-
* field hasn't been synced yet by `updated()`. Returns undefined when the
|
|
11117
|
-
* input type/format isn't a full date or the string is not a valid date.
|
|
11118
|
-
*
|
|
11119
|
-
* Why this exists: a parent (datepicker) can call `inputN.validate()` from
|
|
11120
|
-
* inside its own `updated()` before this input's `updated()` has run
|
|
11121
|
-
* `syncDateValues()` — so `_valueObject`/`_maxObject` are still `undefined`
|
|
11122
|
-
* and range checks would otherwise silently no-op (flipping the result to
|
|
11123
|
-
* `valid` or `patternMismatch`).
|
|
11124
|
-
* @private
|
|
11125
|
-
* @param {string|undefined} dateStr - ISO date string from `value`/`min`/`max`.
|
|
11126
|
-
* @returns {Date|undefined}
|
|
11127
|
-
*/
|
|
11128
|
-
_computeDateObjectFallback(dateStr) {
|
|
11129
|
-
if (!dateStr || !this.util || !this.util.isFullDateFormat(this.type, this.format)) {
|
|
11130
|
-
return undefined;
|
|
11131
|
-
}
|
|
11132
|
-
if (!dateFormatter.isValidDate(dateStr)) {
|
|
11133
|
-
return undefined;
|
|
11134
|
-
}
|
|
11135
|
-
return dateFormatter.stringToDateInstance(dateStr);
|
|
11136
|
-
}
|
|
11137
|
-
|
|
11138
|
-
/**
|
|
11139
|
-
* Internal setter for readonly date object properties.
|
|
11140
|
-
* @private
|
|
11141
|
-
* @param {'valueObject'|'minObject'|'maxObject'} propertyName - Public object property name.
|
|
11142
|
-
* @param {Date|undefined} propertyValue - Value to assign.
|
|
11143
|
-
* @returns {void}
|
|
11144
|
-
*/
|
|
11145
|
-
setDateObjectProperty(propertyName, propertyValue) {
|
|
11146
|
-
const internalPropertyName = `_${propertyName}`;
|
|
11147
|
-
const previousValue = this[internalPropertyName];
|
|
11148
|
-
|
|
11149
|
-
if (previousValue === propertyValue) {
|
|
11150
|
-
return;
|
|
11151
|
-
}
|
|
11152
|
-
|
|
11153
|
-
this[internalPropertyName] = propertyValue;
|
|
11154
|
-
this.requestUpdate(propertyName, previousValue);
|
|
11108
|
+
return this.max && dateFormatter.isValidDate(this.max) ? dateFormatter.stringToDateInstance(this.max) : undefined;
|
|
11155
11109
|
}
|
|
11156
11110
|
|
|
11157
11111
|
connectedCallback() {
|
|
@@ -11180,7 +11134,6 @@ class BaseInput extends AuroElement {
|
|
|
11180
11134
|
format: this.format
|
|
11181
11135
|
});
|
|
11182
11136
|
this.configureDataForType();
|
|
11183
|
-
this.syncDateValues();
|
|
11184
11137
|
}
|
|
11185
11138
|
|
|
11186
11139
|
disconnectedCallback() {
|
|
@@ -11210,7 +11163,6 @@ class BaseInput extends AuroElement {
|
|
|
11210
11163
|
this.setCustomHelpTextMessage();
|
|
11211
11164
|
this.configureAutoFormatting();
|
|
11212
11165
|
this.configureDataForType();
|
|
11213
|
-
this.syncDateValues();
|
|
11214
11166
|
}
|
|
11215
11167
|
|
|
11216
11168
|
/**
|
|
@@ -11347,8 +11299,6 @@ class BaseInput extends AuroElement {
|
|
|
11347
11299
|
this.configureDataForType();
|
|
11348
11300
|
}
|
|
11349
11301
|
|
|
11350
|
-
this.syncDateValues(changedProperties);
|
|
11351
|
-
|
|
11352
11302
|
if (changedProperties.has('value')) {
|
|
11353
11303
|
if (this.value && this.value.length > 0) {
|
|
11354
11304
|
this.hasValue = true;
|
|
@@ -11419,69 +11369,6 @@ class BaseInput extends AuroElement {
|
|
|
11419
11369
|
}));
|
|
11420
11370
|
}
|
|
11421
11371
|
|
|
11422
|
-
|
|
11423
|
-
/**
|
|
11424
|
-
* Synchronizes the ISO string values and Date object representations for date-related properties.
|
|
11425
|
-
* This keeps the model and display values aligned when either side changes.
|
|
11426
|
-
*
|
|
11427
|
-
* When a full date format is in use, this method updates `value`, `min`, and `max` from their corresponding
|
|
11428
|
-
* Date objects or vice versa, based on which properties have changed. It only runs when the current configuration
|
|
11429
|
-
* represents a full year/month/day date format.
|
|
11430
|
-
*
|
|
11431
|
-
* @param {Map<string, unknown>|undefined} [changedProperties=undefined] - Optional map of changed properties used to limit which values are synchronized.
|
|
11432
|
-
* @returns {void}
|
|
11433
|
-
* @private
|
|
11434
|
-
*/
|
|
11435
|
-
syncDateValues(changedProperties = undefined) {
|
|
11436
|
-
if (!this.util.isFullDateFormat(this.type, this.format)) {
|
|
11437
|
-
return;
|
|
11438
|
-
}
|
|
11439
|
-
|
|
11440
|
-
this.syncSingleDateValue(changedProperties, 'valueObject', 'value');
|
|
11441
|
-
this.syncSingleDateValue(changedProperties, 'minObject', 'min');
|
|
11442
|
-
this.syncSingleDateValue(changedProperties, 'maxObject', 'max');
|
|
11443
|
-
}
|
|
11444
|
-
|
|
11445
|
-
/**
|
|
11446
|
-
* Synchronizes one date object/string property pair.
|
|
11447
|
-
* @private
|
|
11448
|
-
* @param {Map<string, unknown>|undefined} changedProperties - Map of changed properties from Lit.
|
|
11449
|
-
* @param {string} objectProperty - Date object property name.
|
|
11450
|
-
* @param {string} valueProperty - ISO string property name.
|
|
11451
|
-
* @returns {void}
|
|
11452
|
-
*/
|
|
11453
|
-
syncSingleDateValue(changedProperties, objectProperty, valueProperty) {
|
|
11454
|
-
const objectPropertyChanged = !changedProperties || changedProperties.has(objectProperty);
|
|
11455
|
-
|
|
11456
|
-
// objectProperty wins over valueProperty when both changed
|
|
11457
|
-
if (objectPropertyChanged && this[objectProperty]) {
|
|
11458
|
-
this[valueProperty] = dateFormatter.toISOFormatString(this[objectProperty]);
|
|
11459
|
-
return;
|
|
11460
|
-
}
|
|
11461
|
-
|
|
11462
|
-
const valuePropertyChanged = !changedProperties || changedProperties.has(valueProperty);
|
|
11463
|
-
if (!valuePropertyChanged) {
|
|
11464
|
-
return;
|
|
11465
|
-
}
|
|
11466
|
-
|
|
11467
|
-
// when value is newly set to the same ISO string that corresponds to the existing Date object, do not clear the Date object (avoid unnecessary updates)
|
|
11468
|
-
if (
|
|
11469
|
-
changedProperties &&
|
|
11470
|
-
valueProperty === 'value' &&
|
|
11471
|
-
changedProperties.get('value') === undefined &&
|
|
11472
|
-
this[objectProperty] instanceof Date &&
|
|
11473
|
-
this[valueProperty] === dateFormatter.toISOFormatString(this[objectProperty])
|
|
11474
|
-
) {
|
|
11475
|
-
return;
|
|
11476
|
-
}
|
|
11477
|
-
|
|
11478
|
-
if (dateFormatter.isValidDate(this[valueProperty])) {
|
|
11479
|
-
this.setDateObjectProperty(objectProperty, dateFormatter.stringToDateInstance(this[valueProperty]));
|
|
11480
|
-
} else {
|
|
11481
|
-
this.setDateObjectProperty(objectProperty, undefined);
|
|
11482
|
-
}
|
|
11483
|
-
}
|
|
11484
|
-
|
|
11485
11372
|
/**
|
|
11486
11373
|
* Sets up IMasks and logic based on auto-formatting requirements.
|
|
11487
11374
|
* @private
|
|
@@ -11496,8 +11383,13 @@ class BaseInput extends AuroElement {
|
|
|
11496
11383
|
this._configuringMask = true;
|
|
11497
11384
|
try {
|
|
11498
11385
|
// Destroy any prior mask so IMask can attach fresh under the new format.
|
|
11386
|
+
// Null the reference too — if the new maskOptions.mask is falsy (e.g.
|
|
11387
|
+
// type switched from credit-card to text) the IMask() reassignment
|
|
11388
|
+
// below is skipped, and downstream writes at line ~823 would otherwise
|
|
11389
|
+
// route through the destroyed instance.
|
|
11499
11390
|
if (this.maskInstance) {
|
|
11500
11391
|
this.maskInstance.destroy();
|
|
11392
|
+
this.maskInstance = null;
|
|
11501
11393
|
}
|
|
11502
11394
|
|
|
11503
11395
|
this.util.updateFormat(this.format);
|
|
@@ -11518,9 +11410,7 @@ class BaseInput extends AuroElement {
|
|
|
11518
11410
|
if (
|
|
11519
11411
|
this.util.isFullDateFormat(this.type, this.format) &&
|
|
11520
11412
|
this.value &&
|
|
11521
|
-
|
|
11522
|
-
this.valueObject instanceof Date &&
|
|
11523
|
-
!Number.isNaN(this.valueObject.getTime()) &&
|
|
11413
|
+
this.valueObject &&
|
|
11524
11414
|
typeof maskOptions.format === 'function'
|
|
11525
11415
|
) {
|
|
11526
11416
|
existingValue = maskOptions.format(this.valueObject);
|
|
@@ -11725,7 +11615,6 @@ class BaseInput extends AuroElement {
|
|
|
11725
11615
|
*/
|
|
11726
11616
|
reset() {
|
|
11727
11617
|
this.value = undefined;
|
|
11728
|
-
this.setDateObjectProperty('valueObject', undefined);
|
|
11729
11618
|
this.validation.reset(this);
|
|
11730
11619
|
}
|
|
11731
11620
|
|
|
@@ -11734,7 +11623,6 @@ class BaseInput extends AuroElement {
|
|
|
11734
11623
|
*/
|
|
11735
11624
|
clear() {
|
|
11736
11625
|
this.value = undefined;
|
|
11737
|
-
this.setDateObjectProperty('valueObject', undefined);
|
|
11738
11626
|
}
|
|
11739
11627
|
|
|
11740
11628
|
/**
|
|
@@ -12263,7 +12151,7 @@ class AuroHelpText extends i$3 {
|
|
|
12263
12151
|
}
|
|
12264
12152
|
}
|
|
12265
12153
|
|
|
12266
|
-
var formkitVersion = '
|
|
12154
|
+
var formkitVersion = '202606221656';
|
|
12267
12155
|
|
|
12268
12156
|
/**
|
|
12269
12157
|
* @license
|
|
@@ -10541,10 +10541,8 @@ class BaseInput extends AuroElement {
|
|
|
10541
10541
|
this.layout = 'classic';
|
|
10542
10542
|
this.locale = 'en-US';
|
|
10543
10543
|
this.max = undefined;
|
|
10544
|
-
this._maxObject = undefined;
|
|
10545
10544
|
this.maxLength = undefined;
|
|
10546
10545
|
this.min = undefined;
|
|
10547
|
-
this._minObject = undefined;
|
|
10548
10546
|
this.minLength = undefined;
|
|
10549
10547
|
this.required = false;
|
|
10550
10548
|
this.onDark = false;
|
|
@@ -10552,7 +10550,6 @@ class BaseInput extends AuroElement {
|
|
|
10552
10550
|
this.size = 'lg';
|
|
10553
10551
|
this.shape = 'classic';
|
|
10554
10552
|
this.value = undefined;
|
|
10555
|
-
this._valueObject = undefined;
|
|
10556
10553
|
|
|
10557
10554
|
this._initializePrivateDefaults();
|
|
10558
10555
|
}
|
|
@@ -11092,7 +11089,7 @@ class BaseInput extends AuroElement {
|
|
|
11092
11089
|
* @returns {Date|undefined}
|
|
11093
11090
|
*/
|
|
11094
11091
|
get valueObject() {
|
|
11095
|
-
return this.
|
|
11092
|
+
return this.value && dateFormatter.isValidDate(this.value) ? dateFormatter.stringToDateInstance(this.value) : undefined;
|
|
11096
11093
|
}
|
|
11097
11094
|
|
|
11098
11095
|
/**
|
|
@@ -11100,7 +11097,7 @@ class BaseInput extends AuroElement {
|
|
|
11100
11097
|
* @returns {Date|undefined}
|
|
11101
11098
|
*/
|
|
11102
11099
|
get minObject() {
|
|
11103
|
-
return this.
|
|
11100
|
+
return this.min && dateFormatter.isValidDate(this.min) ? dateFormatter.stringToDateInstance(this.min) : undefined;
|
|
11104
11101
|
}
|
|
11105
11102
|
|
|
11106
11103
|
/**
|
|
@@ -11108,50 +11105,7 @@ class BaseInput extends AuroElement {
|
|
|
11108
11105
|
* @returns {Date|undefined}
|
|
11109
11106
|
*/
|
|
11110
11107
|
get maxObject() {
|
|
11111
|
-
return this.
|
|
11112
|
-
}
|
|
11113
|
-
|
|
11114
|
-
/**
|
|
11115
|
-
* Parses a date string into a Date object when the corresponding `_*Object`
|
|
11116
|
-
* field hasn't been synced yet by `updated()`. Returns undefined when the
|
|
11117
|
-
* input type/format isn't a full date or the string is not a valid date.
|
|
11118
|
-
*
|
|
11119
|
-
* Why this exists: a parent (datepicker) can call `inputN.validate()` from
|
|
11120
|
-
* inside its own `updated()` before this input's `updated()` has run
|
|
11121
|
-
* `syncDateValues()` — so `_valueObject`/`_maxObject` are still `undefined`
|
|
11122
|
-
* and range checks would otherwise silently no-op (flipping the result to
|
|
11123
|
-
* `valid` or `patternMismatch`).
|
|
11124
|
-
* @private
|
|
11125
|
-
* @param {string|undefined} dateStr - ISO date string from `value`/`min`/`max`.
|
|
11126
|
-
* @returns {Date|undefined}
|
|
11127
|
-
*/
|
|
11128
|
-
_computeDateObjectFallback(dateStr) {
|
|
11129
|
-
if (!dateStr || !this.util || !this.util.isFullDateFormat(this.type, this.format)) {
|
|
11130
|
-
return undefined;
|
|
11131
|
-
}
|
|
11132
|
-
if (!dateFormatter.isValidDate(dateStr)) {
|
|
11133
|
-
return undefined;
|
|
11134
|
-
}
|
|
11135
|
-
return dateFormatter.stringToDateInstance(dateStr);
|
|
11136
|
-
}
|
|
11137
|
-
|
|
11138
|
-
/**
|
|
11139
|
-
* Internal setter for readonly date object properties.
|
|
11140
|
-
* @private
|
|
11141
|
-
* @param {'valueObject'|'minObject'|'maxObject'} propertyName - Public object property name.
|
|
11142
|
-
* @param {Date|undefined} propertyValue - Value to assign.
|
|
11143
|
-
* @returns {void}
|
|
11144
|
-
*/
|
|
11145
|
-
setDateObjectProperty(propertyName, propertyValue) {
|
|
11146
|
-
const internalPropertyName = `_${propertyName}`;
|
|
11147
|
-
const previousValue = this[internalPropertyName];
|
|
11148
|
-
|
|
11149
|
-
if (previousValue === propertyValue) {
|
|
11150
|
-
return;
|
|
11151
|
-
}
|
|
11152
|
-
|
|
11153
|
-
this[internalPropertyName] = propertyValue;
|
|
11154
|
-
this.requestUpdate(propertyName, previousValue);
|
|
11108
|
+
return this.max && dateFormatter.isValidDate(this.max) ? dateFormatter.stringToDateInstance(this.max) : undefined;
|
|
11155
11109
|
}
|
|
11156
11110
|
|
|
11157
11111
|
connectedCallback() {
|
|
@@ -11180,7 +11134,6 @@ class BaseInput extends AuroElement {
|
|
|
11180
11134
|
format: this.format
|
|
11181
11135
|
});
|
|
11182
11136
|
this.configureDataForType();
|
|
11183
|
-
this.syncDateValues();
|
|
11184
11137
|
}
|
|
11185
11138
|
|
|
11186
11139
|
disconnectedCallback() {
|
|
@@ -11210,7 +11163,6 @@ class BaseInput extends AuroElement {
|
|
|
11210
11163
|
this.setCustomHelpTextMessage();
|
|
11211
11164
|
this.configureAutoFormatting();
|
|
11212
11165
|
this.configureDataForType();
|
|
11213
|
-
this.syncDateValues();
|
|
11214
11166
|
}
|
|
11215
11167
|
|
|
11216
11168
|
/**
|
|
@@ -11347,8 +11299,6 @@ class BaseInput extends AuroElement {
|
|
|
11347
11299
|
this.configureDataForType();
|
|
11348
11300
|
}
|
|
11349
11301
|
|
|
11350
|
-
this.syncDateValues(changedProperties);
|
|
11351
|
-
|
|
11352
11302
|
if (changedProperties.has('value')) {
|
|
11353
11303
|
if (this.value && this.value.length > 0) {
|
|
11354
11304
|
this.hasValue = true;
|
|
@@ -11419,69 +11369,6 @@ class BaseInput extends AuroElement {
|
|
|
11419
11369
|
}));
|
|
11420
11370
|
}
|
|
11421
11371
|
|
|
11422
|
-
|
|
11423
|
-
/**
|
|
11424
|
-
* Synchronizes the ISO string values and Date object representations for date-related properties.
|
|
11425
|
-
* This keeps the model and display values aligned when either side changes.
|
|
11426
|
-
*
|
|
11427
|
-
* When a full date format is in use, this method updates `value`, `min`, and `max` from their corresponding
|
|
11428
|
-
* Date objects or vice versa, based on which properties have changed. It only runs when the current configuration
|
|
11429
|
-
* represents a full year/month/day date format.
|
|
11430
|
-
*
|
|
11431
|
-
* @param {Map<string, unknown>|undefined} [changedProperties=undefined] - Optional map of changed properties used to limit which values are synchronized.
|
|
11432
|
-
* @returns {void}
|
|
11433
|
-
* @private
|
|
11434
|
-
*/
|
|
11435
|
-
syncDateValues(changedProperties = undefined) {
|
|
11436
|
-
if (!this.util.isFullDateFormat(this.type, this.format)) {
|
|
11437
|
-
return;
|
|
11438
|
-
}
|
|
11439
|
-
|
|
11440
|
-
this.syncSingleDateValue(changedProperties, 'valueObject', 'value');
|
|
11441
|
-
this.syncSingleDateValue(changedProperties, 'minObject', 'min');
|
|
11442
|
-
this.syncSingleDateValue(changedProperties, 'maxObject', 'max');
|
|
11443
|
-
}
|
|
11444
|
-
|
|
11445
|
-
/**
|
|
11446
|
-
* Synchronizes one date object/string property pair.
|
|
11447
|
-
* @private
|
|
11448
|
-
* @param {Map<string, unknown>|undefined} changedProperties - Map of changed properties from Lit.
|
|
11449
|
-
* @param {string} objectProperty - Date object property name.
|
|
11450
|
-
* @param {string} valueProperty - ISO string property name.
|
|
11451
|
-
* @returns {void}
|
|
11452
|
-
*/
|
|
11453
|
-
syncSingleDateValue(changedProperties, objectProperty, valueProperty) {
|
|
11454
|
-
const objectPropertyChanged = !changedProperties || changedProperties.has(objectProperty);
|
|
11455
|
-
|
|
11456
|
-
// objectProperty wins over valueProperty when both changed
|
|
11457
|
-
if (objectPropertyChanged && this[objectProperty]) {
|
|
11458
|
-
this[valueProperty] = dateFormatter.toISOFormatString(this[objectProperty]);
|
|
11459
|
-
return;
|
|
11460
|
-
}
|
|
11461
|
-
|
|
11462
|
-
const valuePropertyChanged = !changedProperties || changedProperties.has(valueProperty);
|
|
11463
|
-
if (!valuePropertyChanged) {
|
|
11464
|
-
return;
|
|
11465
|
-
}
|
|
11466
|
-
|
|
11467
|
-
// when value is newly set to the same ISO string that corresponds to the existing Date object, do not clear the Date object (avoid unnecessary updates)
|
|
11468
|
-
if (
|
|
11469
|
-
changedProperties &&
|
|
11470
|
-
valueProperty === 'value' &&
|
|
11471
|
-
changedProperties.get('value') === undefined &&
|
|
11472
|
-
this[objectProperty] instanceof Date &&
|
|
11473
|
-
this[valueProperty] === dateFormatter.toISOFormatString(this[objectProperty])
|
|
11474
|
-
) {
|
|
11475
|
-
return;
|
|
11476
|
-
}
|
|
11477
|
-
|
|
11478
|
-
if (dateFormatter.isValidDate(this[valueProperty])) {
|
|
11479
|
-
this.setDateObjectProperty(objectProperty, dateFormatter.stringToDateInstance(this[valueProperty]));
|
|
11480
|
-
} else {
|
|
11481
|
-
this.setDateObjectProperty(objectProperty, undefined);
|
|
11482
|
-
}
|
|
11483
|
-
}
|
|
11484
|
-
|
|
11485
11372
|
/**
|
|
11486
11373
|
* Sets up IMasks and logic based on auto-formatting requirements.
|
|
11487
11374
|
* @private
|
|
@@ -11496,8 +11383,13 @@ class BaseInput extends AuroElement {
|
|
|
11496
11383
|
this._configuringMask = true;
|
|
11497
11384
|
try {
|
|
11498
11385
|
// Destroy any prior mask so IMask can attach fresh under the new format.
|
|
11386
|
+
// Null the reference too — if the new maskOptions.mask is falsy (e.g.
|
|
11387
|
+
// type switched from credit-card to text) the IMask() reassignment
|
|
11388
|
+
// below is skipped, and downstream writes at line ~823 would otherwise
|
|
11389
|
+
// route through the destroyed instance.
|
|
11499
11390
|
if (this.maskInstance) {
|
|
11500
11391
|
this.maskInstance.destroy();
|
|
11392
|
+
this.maskInstance = null;
|
|
11501
11393
|
}
|
|
11502
11394
|
|
|
11503
11395
|
this.util.updateFormat(this.format);
|
|
@@ -11518,9 +11410,7 @@ class BaseInput extends AuroElement {
|
|
|
11518
11410
|
if (
|
|
11519
11411
|
this.util.isFullDateFormat(this.type, this.format) &&
|
|
11520
11412
|
this.value &&
|
|
11521
|
-
|
|
11522
|
-
this.valueObject instanceof Date &&
|
|
11523
|
-
!Number.isNaN(this.valueObject.getTime()) &&
|
|
11413
|
+
this.valueObject &&
|
|
11524
11414
|
typeof maskOptions.format === 'function'
|
|
11525
11415
|
) {
|
|
11526
11416
|
existingValue = maskOptions.format(this.valueObject);
|
|
@@ -11725,7 +11615,6 @@ class BaseInput extends AuroElement {
|
|
|
11725
11615
|
*/
|
|
11726
11616
|
reset() {
|
|
11727
11617
|
this.value = undefined;
|
|
11728
|
-
this.setDateObjectProperty('valueObject', undefined);
|
|
11729
11618
|
this.validation.reset(this);
|
|
11730
11619
|
}
|
|
11731
11620
|
|
|
@@ -11734,7 +11623,6 @@ class BaseInput extends AuroElement {
|
|
|
11734
11623
|
*/
|
|
11735
11624
|
clear() {
|
|
11736
11625
|
this.value = undefined;
|
|
11737
|
-
this.setDateObjectProperty('valueObject', undefined);
|
|
11738
11626
|
}
|
|
11739
11627
|
|
|
11740
11628
|
/**
|
|
@@ -12263,7 +12151,7 @@ class AuroHelpText extends i$3 {
|
|
|
12263
12151
|
}
|
|
12264
12152
|
}
|
|
12265
12153
|
|
|
12266
|
-
var formkitVersion = '
|
|
12154
|
+
var formkitVersion = '202606221656';
|
|
12267
12155
|
|
|
12268
12156
|
/**
|
|
12269
12157
|
* @license
|
|
@@ -10541,10 +10541,8 @@ class BaseInput extends AuroElement {
|
|
|
10541
10541
|
this.layout = 'classic';
|
|
10542
10542
|
this.locale = 'en-US';
|
|
10543
10543
|
this.max = undefined;
|
|
10544
|
-
this._maxObject = undefined;
|
|
10545
10544
|
this.maxLength = undefined;
|
|
10546
10545
|
this.min = undefined;
|
|
10547
|
-
this._minObject = undefined;
|
|
10548
10546
|
this.minLength = undefined;
|
|
10549
10547
|
this.required = false;
|
|
10550
10548
|
this.onDark = false;
|
|
@@ -10552,7 +10550,6 @@ class BaseInput extends AuroElement {
|
|
|
10552
10550
|
this.size = 'lg';
|
|
10553
10551
|
this.shape = 'classic';
|
|
10554
10552
|
this.value = undefined;
|
|
10555
|
-
this._valueObject = undefined;
|
|
10556
10553
|
|
|
10557
10554
|
this._initializePrivateDefaults();
|
|
10558
10555
|
}
|
|
@@ -11092,7 +11089,7 @@ class BaseInput extends AuroElement {
|
|
|
11092
11089
|
* @returns {Date|undefined}
|
|
11093
11090
|
*/
|
|
11094
11091
|
get valueObject() {
|
|
11095
|
-
return this.
|
|
11092
|
+
return this.value && dateFormatter.isValidDate(this.value) ? dateFormatter.stringToDateInstance(this.value) : undefined;
|
|
11096
11093
|
}
|
|
11097
11094
|
|
|
11098
11095
|
/**
|
|
@@ -11100,7 +11097,7 @@ class BaseInput extends AuroElement {
|
|
|
11100
11097
|
* @returns {Date|undefined}
|
|
11101
11098
|
*/
|
|
11102
11099
|
get minObject() {
|
|
11103
|
-
return this.
|
|
11100
|
+
return this.min && dateFormatter.isValidDate(this.min) ? dateFormatter.stringToDateInstance(this.min) : undefined;
|
|
11104
11101
|
}
|
|
11105
11102
|
|
|
11106
11103
|
/**
|
|
@@ -11108,50 +11105,7 @@ class BaseInput extends AuroElement {
|
|
|
11108
11105
|
* @returns {Date|undefined}
|
|
11109
11106
|
*/
|
|
11110
11107
|
get maxObject() {
|
|
11111
|
-
return this.
|
|
11112
|
-
}
|
|
11113
|
-
|
|
11114
|
-
/**
|
|
11115
|
-
* Parses a date string into a Date object when the corresponding `_*Object`
|
|
11116
|
-
* field hasn't been synced yet by `updated()`. Returns undefined when the
|
|
11117
|
-
* input type/format isn't a full date or the string is not a valid date.
|
|
11118
|
-
*
|
|
11119
|
-
* Why this exists: a parent (datepicker) can call `inputN.validate()` from
|
|
11120
|
-
* inside its own `updated()` before this input's `updated()` has run
|
|
11121
|
-
* `syncDateValues()` — so `_valueObject`/`_maxObject` are still `undefined`
|
|
11122
|
-
* and range checks would otherwise silently no-op (flipping the result to
|
|
11123
|
-
* `valid` or `patternMismatch`).
|
|
11124
|
-
* @private
|
|
11125
|
-
* @param {string|undefined} dateStr - ISO date string from `value`/`min`/`max`.
|
|
11126
|
-
* @returns {Date|undefined}
|
|
11127
|
-
*/
|
|
11128
|
-
_computeDateObjectFallback(dateStr) {
|
|
11129
|
-
if (!dateStr || !this.util || !this.util.isFullDateFormat(this.type, this.format)) {
|
|
11130
|
-
return undefined;
|
|
11131
|
-
}
|
|
11132
|
-
if (!dateFormatter.isValidDate(dateStr)) {
|
|
11133
|
-
return undefined;
|
|
11134
|
-
}
|
|
11135
|
-
return dateFormatter.stringToDateInstance(dateStr);
|
|
11136
|
-
}
|
|
11137
|
-
|
|
11138
|
-
/**
|
|
11139
|
-
* Internal setter for readonly date object properties.
|
|
11140
|
-
* @private
|
|
11141
|
-
* @param {'valueObject'|'minObject'|'maxObject'} propertyName - Public object property name.
|
|
11142
|
-
* @param {Date|undefined} propertyValue - Value to assign.
|
|
11143
|
-
* @returns {void}
|
|
11144
|
-
*/
|
|
11145
|
-
setDateObjectProperty(propertyName, propertyValue) {
|
|
11146
|
-
const internalPropertyName = `_${propertyName}`;
|
|
11147
|
-
const previousValue = this[internalPropertyName];
|
|
11148
|
-
|
|
11149
|
-
if (previousValue === propertyValue) {
|
|
11150
|
-
return;
|
|
11151
|
-
}
|
|
11152
|
-
|
|
11153
|
-
this[internalPropertyName] = propertyValue;
|
|
11154
|
-
this.requestUpdate(propertyName, previousValue);
|
|
11108
|
+
return this.max && dateFormatter.isValidDate(this.max) ? dateFormatter.stringToDateInstance(this.max) : undefined;
|
|
11155
11109
|
}
|
|
11156
11110
|
|
|
11157
11111
|
connectedCallback() {
|
|
@@ -11180,7 +11134,6 @@ class BaseInput extends AuroElement {
|
|
|
11180
11134
|
format: this.format
|
|
11181
11135
|
});
|
|
11182
11136
|
this.configureDataForType();
|
|
11183
|
-
this.syncDateValues();
|
|
11184
11137
|
}
|
|
11185
11138
|
|
|
11186
11139
|
disconnectedCallback() {
|
|
@@ -11210,7 +11163,6 @@ class BaseInput extends AuroElement {
|
|
|
11210
11163
|
this.setCustomHelpTextMessage();
|
|
11211
11164
|
this.configureAutoFormatting();
|
|
11212
11165
|
this.configureDataForType();
|
|
11213
|
-
this.syncDateValues();
|
|
11214
11166
|
}
|
|
11215
11167
|
|
|
11216
11168
|
/**
|
|
@@ -11347,8 +11299,6 @@ class BaseInput extends AuroElement {
|
|
|
11347
11299
|
this.configureDataForType();
|
|
11348
11300
|
}
|
|
11349
11301
|
|
|
11350
|
-
this.syncDateValues(changedProperties);
|
|
11351
|
-
|
|
11352
11302
|
if (changedProperties.has('value')) {
|
|
11353
11303
|
if (this.value && this.value.length > 0) {
|
|
11354
11304
|
this.hasValue = true;
|
|
@@ -11419,69 +11369,6 @@ class BaseInput extends AuroElement {
|
|
|
11419
11369
|
}));
|
|
11420
11370
|
}
|
|
11421
11371
|
|
|
11422
|
-
|
|
11423
|
-
/**
|
|
11424
|
-
* Synchronizes the ISO string values and Date object representations for date-related properties.
|
|
11425
|
-
* This keeps the model and display values aligned when either side changes.
|
|
11426
|
-
*
|
|
11427
|
-
* When a full date format is in use, this method updates `value`, `min`, and `max` from their corresponding
|
|
11428
|
-
* Date objects or vice versa, based on which properties have changed. It only runs when the current configuration
|
|
11429
|
-
* represents a full year/month/day date format.
|
|
11430
|
-
*
|
|
11431
|
-
* @param {Map<string, unknown>|undefined} [changedProperties=undefined] - Optional map of changed properties used to limit which values are synchronized.
|
|
11432
|
-
* @returns {void}
|
|
11433
|
-
* @private
|
|
11434
|
-
*/
|
|
11435
|
-
syncDateValues(changedProperties = undefined) {
|
|
11436
|
-
if (!this.util.isFullDateFormat(this.type, this.format)) {
|
|
11437
|
-
return;
|
|
11438
|
-
}
|
|
11439
|
-
|
|
11440
|
-
this.syncSingleDateValue(changedProperties, 'valueObject', 'value');
|
|
11441
|
-
this.syncSingleDateValue(changedProperties, 'minObject', 'min');
|
|
11442
|
-
this.syncSingleDateValue(changedProperties, 'maxObject', 'max');
|
|
11443
|
-
}
|
|
11444
|
-
|
|
11445
|
-
/**
|
|
11446
|
-
* Synchronizes one date object/string property pair.
|
|
11447
|
-
* @private
|
|
11448
|
-
* @param {Map<string, unknown>|undefined} changedProperties - Map of changed properties from Lit.
|
|
11449
|
-
* @param {string} objectProperty - Date object property name.
|
|
11450
|
-
* @param {string} valueProperty - ISO string property name.
|
|
11451
|
-
* @returns {void}
|
|
11452
|
-
*/
|
|
11453
|
-
syncSingleDateValue(changedProperties, objectProperty, valueProperty) {
|
|
11454
|
-
const objectPropertyChanged = !changedProperties || changedProperties.has(objectProperty);
|
|
11455
|
-
|
|
11456
|
-
// objectProperty wins over valueProperty when both changed
|
|
11457
|
-
if (objectPropertyChanged && this[objectProperty]) {
|
|
11458
|
-
this[valueProperty] = dateFormatter.toISOFormatString(this[objectProperty]);
|
|
11459
|
-
return;
|
|
11460
|
-
}
|
|
11461
|
-
|
|
11462
|
-
const valuePropertyChanged = !changedProperties || changedProperties.has(valueProperty);
|
|
11463
|
-
if (!valuePropertyChanged) {
|
|
11464
|
-
return;
|
|
11465
|
-
}
|
|
11466
|
-
|
|
11467
|
-
// when value is newly set to the same ISO string that corresponds to the existing Date object, do not clear the Date object (avoid unnecessary updates)
|
|
11468
|
-
if (
|
|
11469
|
-
changedProperties &&
|
|
11470
|
-
valueProperty === 'value' &&
|
|
11471
|
-
changedProperties.get('value') === undefined &&
|
|
11472
|
-
this[objectProperty] instanceof Date &&
|
|
11473
|
-
this[valueProperty] === dateFormatter.toISOFormatString(this[objectProperty])
|
|
11474
|
-
) {
|
|
11475
|
-
return;
|
|
11476
|
-
}
|
|
11477
|
-
|
|
11478
|
-
if (dateFormatter.isValidDate(this[valueProperty])) {
|
|
11479
|
-
this.setDateObjectProperty(objectProperty, dateFormatter.stringToDateInstance(this[valueProperty]));
|
|
11480
|
-
} else {
|
|
11481
|
-
this.setDateObjectProperty(objectProperty, undefined);
|
|
11482
|
-
}
|
|
11483
|
-
}
|
|
11484
|
-
|
|
11485
11372
|
/**
|
|
11486
11373
|
* Sets up IMasks and logic based on auto-formatting requirements.
|
|
11487
11374
|
* @private
|
|
@@ -11496,8 +11383,13 @@ class BaseInput extends AuroElement {
|
|
|
11496
11383
|
this._configuringMask = true;
|
|
11497
11384
|
try {
|
|
11498
11385
|
// Destroy any prior mask so IMask can attach fresh under the new format.
|
|
11386
|
+
// Null the reference too — if the new maskOptions.mask is falsy (e.g.
|
|
11387
|
+
// type switched from credit-card to text) the IMask() reassignment
|
|
11388
|
+
// below is skipped, and downstream writes at line ~823 would otherwise
|
|
11389
|
+
// route through the destroyed instance.
|
|
11499
11390
|
if (this.maskInstance) {
|
|
11500
11391
|
this.maskInstance.destroy();
|
|
11392
|
+
this.maskInstance = null;
|
|
11501
11393
|
}
|
|
11502
11394
|
|
|
11503
11395
|
this.util.updateFormat(this.format);
|
|
@@ -11518,9 +11410,7 @@ class BaseInput extends AuroElement {
|
|
|
11518
11410
|
if (
|
|
11519
11411
|
this.util.isFullDateFormat(this.type, this.format) &&
|
|
11520
11412
|
this.value &&
|
|
11521
|
-
|
|
11522
|
-
this.valueObject instanceof Date &&
|
|
11523
|
-
!Number.isNaN(this.valueObject.getTime()) &&
|
|
11413
|
+
this.valueObject &&
|
|
11524
11414
|
typeof maskOptions.format === 'function'
|
|
11525
11415
|
) {
|
|
11526
11416
|
existingValue = maskOptions.format(this.valueObject);
|
|
@@ -11725,7 +11615,6 @@ class BaseInput extends AuroElement {
|
|
|
11725
11615
|
*/
|
|
11726
11616
|
reset() {
|
|
11727
11617
|
this.value = undefined;
|
|
11728
|
-
this.setDateObjectProperty('valueObject', undefined);
|
|
11729
11618
|
this.validation.reset(this);
|
|
11730
11619
|
}
|
|
11731
11620
|
|
|
@@ -11734,7 +11623,6 @@ class BaseInput extends AuroElement {
|
|
|
11734
11623
|
*/
|
|
11735
11624
|
clear() {
|
|
11736
11625
|
this.value = undefined;
|
|
11737
|
-
this.setDateObjectProperty('valueObject', undefined);
|
|
11738
11626
|
}
|
|
11739
11627
|
|
|
11740
11628
|
/**
|
|
@@ -12263,7 +12151,7 @@ class AuroHelpText extends i$3 {
|
|
|
12263
12151
|
}
|
|
12264
12152
|
}
|
|
12265
12153
|
|
|
12266
|
-
var formkitVersion = '
|
|
12154
|
+
var formkitVersion = '202606221656';
|
|
12267
12155
|
|
|
12268
12156
|
/**
|
|
12269
12157
|
* @license
|