@aurodesignsystem-dev/auro-formkit 0.0.0-pr1130.0 → 0.0.0-pr1137.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -11093,6 +11093,8 @@ class BaseInput extends AuroElement$2$1 {
11093
11093
  this.inputElement = this.renderRoot.querySelector('input');
11094
11094
  this.labelElement = this.shadowRoot.querySelector('label');
11095
11095
 
11096
+ this.patchInputEvent(this.inputElement);
11097
+
11096
11098
  if (this.wrapperElement) {
11097
11099
  this.wrapperElement.addEventListener('click', this.handleClick);
11098
11100
  }
@@ -11117,6 +11119,52 @@ class BaseInput extends AuroElement$2$1 {
11117
11119
  this.configureAutoFormatting();
11118
11120
  }
11119
11121
 
11122
+ /**
11123
+ * Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
11124
+ * This ensures that changes to the input's value are consistently communicated, even if not triggered by user input.
11125
+ *
11126
+ * @param {HTMLInputElement} input - The input element to patch.
11127
+ * @returns {void}
11128
+ * @private
11129
+ */
11130
+ patchInputEvent(input) {
11131
+ if (!input) return;
11132
+ if (input && !input.valuePatched) {
11133
+ const component = this; // eslint-disable-line
11134
+ const nativeDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
11135
+ Object.defineProperty(input, 'value', {
11136
+ get() {
11137
+ return nativeDescriptor.get.call(this);
11138
+ },
11139
+ set(val) {
11140
+ // Call the native setter
11141
+ nativeDescriptor.set.call(this, val);
11142
+
11143
+ // If the input is not connected to the DOM do not dispatch the event
11144
+ if (!this.isConnected) return;
11145
+
11146
+ // If the input has focus, do not dispatch the event because it was not programmatic
11147
+ if (this.matches(":focus")) return;
11148
+
11149
+ // If the component has flagged to skip the next programmatic input event, do not dispatch the event
11150
+ if (component.skipNextProgrammaticInputEvent) {
11151
+ component.skipNextProgrammaticInputEvent = false;
11152
+ return;
11153
+ }
11154
+
11155
+ // If all guard clauses are passed, dispatch the event
11156
+ const inputEvent = new InputEvent('input', {
11157
+ bubbles: true,
11158
+ composed: true,
11159
+ });
11160
+ inputEvent.isProgrammatic = true;
11161
+ this.dispatchEvent(inputEvent);
11162
+ }
11163
+ });
11164
+ input.valuePatched = true;
11165
+ }
11166
+ }
11167
+
11120
11168
  /**
11121
11169
  * @private
11122
11170
  * @returns {void} Sets the default help text for the input.
@@ -11191,6 +11239,7 @@ class BaseInput extends AuroElement$2$1 {
11191
11239
  }
11192
11240
 
11193
11241
  if (this.value !== this.inputElement.value) {
11242
+ this.skipNextProgrammaticInputEvent = true;
11194
11243
  if (this.value) {
11195
11244
  this.inputElement.value = this.value;
11196
11245
  } else {
@@ -11333,15 +11382,20 @@ class BaseInput extends AuroElement$2$1 {
11333
11382
  }
11334
11383
 
11335
11384
  /**
11385
+ * @param {Event} event - The input event
11336
11386
  * @private
11337
- * @return {void}
11387
+ * @returns {void}
11338
11388
  */
11339
- handleInput() {
11389
+ handleInput(event) {
11340
11390
  // Sets value property to value of element value (el.value).
11341
11391
  this.value = this.inputElement.value;
11342
11392
 
11343
- // Validation on blur or input.
11344
- if (this.validateOnInput) {
11393
+ // Determine if the value change was programmatic, including autofill.
11394
+ const inputWasProgrammatic = !this.matches(":focus") || event.isProgrammatic;
11395
+
11396
+ // Validation on input or programmatic value change (including autofill).
11397
+ if (this.validateOnInput || inputWasProgrammatic) {
11398
+ this.touched = true;
11345
11399
  this.validation.validate(this);
11346
11400
  }
11347
11401
 
@@ -15927,7 +15981,7 @@ class AuroBibtemplate extends i$2 {
15927
15981
 
15928
15982
  var bibTemplateVersion = '1.0.0';
15929
15983
 
15930
- var styleCss$4 = i$5`.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 #inputInBib::part(accent-right){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
15984
+ var styleCss$4 = i$5`.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}`;
15931
15985
 
15932
15986
  var styleEmphasizedCss = i$5`:host([layout*=emphasized][shape*=pill]) [auro-input]{--ds-auro-input-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));--ds-auro-input-container-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));width:100%}:host([layout*=emphasized][shape*=pill]) [auro-input]:hover{--ds-auro-input-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));--ds-auro-input-container-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843))}:host([layout*=emphasized][shape*=pill]) [auro-input]::part(inputHelpText){display:none}:host([layout=emphasized]) [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843))}:host([layout=emphasized]) [auro-dropdown]:hover{--ds-auro-dropdown-trigger-hover-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843))}:host([layout=emphasized]) [auro-dropdown][layout*=emphasized]::part(wrapper){--ds-auro-dropdown-trigger-background-color: transparent}`;
15933
15987
 
@@ -10965,6 +10965,8 @@ class BaseInput extends AuroElement$2$1 {
10965
10965
  this.inputElement = this.renderRoot.querySelector('input');
10966
10966
  this.labelElement = this.shadowRoot.querySelector('label');
10967
10967
 
10968
+ this.patchInputEvent(this.inputElement);
10969
+
10968
10970
  if (this.wrapperElement) {
10969
10971
  this.wrapperElement.addEventListener('click', this.handleClick);
10970
10972
  }
@@ -10989,6 +10991,52 @@ class BaseInput extends AuroElement$2$1 {
10989
10991
  this.configureAutoFormatting();
10990
10992
  }
10991
10993
 
10994
+ /**
10995
+ * Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
10996
+ * This ensures that changes to the input's value are consistently communicated, even if not triggered by user input.
10997
+ *
10998
+ * @param {HTMLInputElement} input - The input element to patch.
10999
+ * @returns {void}
11000
+ * @private
11001
+ */
11002
+ patchInputEvent(input) {
11003
+ if (!input) return;
11004
+ if (input && !input.valuePatched) {
11005
+ const component = this; // eslint-disable-line
11006
+ const nativeDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
11007
+ Object.defineProperty(input, 'value', {
11008
+ get() {
11009
+ return nativeDescriptor.get.call(this);
11010
+ },
11011
+ set(val) {
11012
+ // Call the native setter
11013
+ nativeDescriptor.set.call(this, val);
11014
+
11015
+ // If the input is not connected to the DOM do not dispatch the event
11016
+ if (!this.isConnected) return;
11017
+
11018
+ // If the input has focus, do not dispatch the event because it was not programmatic
11019
+ if (this.matches(":focus")) return;
11020
+
11021
+ // If the component has flagged to skip the next programmatic input event, do not dispatch the event
11022
+ if (component.skipNextProgrammaticInputEvent) {
11023
+ component.skipNextProgrammaticInputEvent = false;
11024
+ return;
11025
+ }
11026
+
11027
+ // If all guard clauses are passed, dispatch the event
11028
+ const inputEvent = new InputEvent('input', {
11029
+ bubbles: true,
11030
+ composed: true,
11031
+ });
11032
+ inputEvent.isProgrammatic = true;
11033
+ this.dispatchEvent(inputEvent);
11034
+ }
11035
+ });
11036
+ input.valuePatched = true;
11037
+ }
11038
+ }
11039
+
10992
11040
  /**
10993
11041
  * @private
10994
11042
  * @returns {void} Sets the default help text for the input.
@@ -11063,6 +11111,7 @@ class BaseInput extends AuroElement$2$1 {
11063
11111
  }
11064
11112
 
11065
11113
  if (this.value !== this.inputElement.value) {
11114
+ this.skipNextProgrammaticInputEvent = true;
11066
11115
  if (this.value) {
11067
11116
  this.inputElement.value = this.value;
11068
11117
  } else {
@@ -11205,15 +11254,20 @@ class BaseInput extends AuroElement$2$1 {
11205
11254
  }
11206
11255
 
11207
11256
  /**
11257
+ * @param {Event} event - The input event
11208
11258
  * @private
11209
- * @return {void}
11259
+ * @returns {void}
11210
11260
  */
11211
- handleInput() {
11261
+ handleInput(event) {
11212
11262
  // Sets value property to value of element value (el.value).
11213
11263
  this.value = this.inputElement.value;
11214
11264
 
11215
- // Validation on blur or input.
11216
- if (this.validateOnInput) {
11265
+ // Determine if the value change was programmatic, including autofill.
11266
+ const inputWasProgrammatic = !this.matches(":focus") || event.isProgrammatic;
11267
+
11268
+ // Validation on input or programmatic value change (including autofill).
11269
+ if (this.validateOnInput || inputWasProgrammatic) {
11270
+ this.touched = true;
11217
11271
  this.validation.validate(this);
11218
11272
  }
11219
11273
 
@@ -15799,7 +15853,7 @@ class AuroBibtemplate extends i$2 {
15799
15853
 
15800
15854
  var bibTemplateVersion = '1.0.0';
15801
15855
 
15802
- var styleCss$4 = i$5`.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 #inputInBib::part(accent-right){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
15856
+ var styleCss$4 = i$5`.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}`;
15803
15857
 
15804
15858
  var styleEmphasizedCss = i$5`:host([layout*=emphasized][shape*=pill]) [auro-input]{--ds-auro-input-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));--ds-auro-input-container-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));width:100%}:host([layout*=emphasized][shape*=pill]) [auro-input]:hover{--ds-auro-input-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));--ds-auro-input-container-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843))}:host([layout*=emphasized][shape*=pill]) [auro-input]::part(inputHelpText){display:none}:host([layout=emphasized]) [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843))}:host([layout=emphasized]) [auro-dropdown]:hover{--ds-auro-dropdown-trigger-hover-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843))}:host([layout=emphasized]) [auro-dropdown][layout*=emphasized]::part(wrapper){--ds-auro-dropdown-trigger-background-color: transparent}`;
15805
15859
 
@@ -10872,6 +10872,8 @@ class BaseInput extends AuroElement$2$1 {
10872
10872
  this.inputElement = this.renderRoot.querySelector('input');
10873
10873
  this.labelElement = this.shadowRoot.querySelector('label');
10874
10874
 
10875
+ this.patchInputEvent(this.inputElement);
10876
+
10875
10877
  if (this.wrapperElement) {
10876
10878
  this.wrapperElement.addEventListener('click', this.handleClick);
10877
10879
  }
@@ -10896,6 +10898,52 @@ class BaseInput extends AuroElement$2$1 {
10896
10898
  this.configureAutoFormatting();
10897
10899
  }
10898
10900
 
10901
+ /**
10902
+ * Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
10903
+ * This ensures that changes to the input's value are consistently communicated, even if not triggered by user input.
10904
+ *
10905
+ * @param {HTMLInputElement} input - The input element to patch.
10906
+ * @returns {void}
10907
+ * @private
10908
+ */
10909
+ patchInputEvent(input) {
10910
+ if (!input) return;
10911
+ if (input && !input.valuePatched) {
10912
+ const component = this; // eslint-disable-line
10913
+ const nativeDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
10914
+ Object.defineProperty(input, 'value', {
10915
+ get() {
10916
+ return nativeDescriptor.get.call(this);
10917
+ },
10918
+ set(val) {
10919
+ // Call the native setter
10920
+ nativeDescriptor.set.call(this, val);
10921
+
10922
+ // If the input is not connected to the DOM do not dispatch the event
10923
+ if (!this.isConnected) return;
10924
+
10925
+ // If the input has focus, do not dispatch the event because it was not programmatic
10926
+ if (this.matches(":focus")) return;
10927
+
10928
+ // If the component has flagged to skip the next programmatic input event, do not dispatch the event
10929
+ if (component.skipNextProgrammaticInputEvent) {
10930
+ component.skipNextProgrammaticInputEvent = false;
10931
+ return;
10932
+ }
10933
+
10934
+ // If all guard clauses are passed, dispatch the event
10935
+ const inputEvent = new InputEvent('input', {
10936
+ bubbles: true,
10937
+ composed: true,
10938
+ });
10939
+ inputEvent.isProgrammatic = true;
10940
+ this.dispatchEvent(inputEvent);
10941
+ }
10942
+ });
10943
+ input.valuePatched = true;
10944
+ }
10945
+ }
10946
+
10899
10947
  /**
10900
10948
  * @private
10901
10949
  * @returns {void} Sets the default help text for the input.
@@ -10970,6 +11018,7 @@ class BaseInput extends AuroElement$2$1 {
10970
11018
  }
10971
11019
 
10972
11020
  if (this.value !== this.inputElement.value) {
11021
+ this.skipNextProgrammaticInputEvent = true;
10973
11022
  if (this.value) {
10974
11023
  this.inputElement.value = this.value;
10975
11024
  } else {
@@ -11112,15 +11161,20 @@ class BaseInput extends AuroElement$2$1 {
11112
11161
  }
11113
11162
 
11114
11163
  /**
11164
+ * @param {Event} event - The input event
11115
11165
  * @private
11116
- * @return {void}
11166
+ * @returns {void}
11117
11167
  */
11118
- handleInput() {
11168
+ handleInput(event) {
11119
11169
  // Sets value property to value of element value (el.value).
11120
11170
  this.value = this.inputElement.value;
11121
11171
 
11122
- // Validation on blur or input.
11123
- if (this.validateOnInput) {
11172
+ // Determine if the value change was programmatic, including autofill.
11173
+ const inputWasProgrammatic = !this.matches(":focus") || event.isProgrammatic;
11174
+
11175
+ // Validation on input or programmatic value change (including autofill).
11176
+ if (this.validateOnInput || inputWasProgrammatic) {
11177
+ this.touched = true;
11124
11178
  this.validation.validate(this);
11125
11179
  }
11126
11180
 
@@ -15706,7 +15760,7 @@ class AuroBibtemplate extends LitElement {
15706
15760
 
15707
15761
  var bibTemplateVersion = '1.0.0';
15708
15762
 
15709
- 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 #inputInBib::part(accent-right){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
15763
+ 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}`;
15710
15764
 
15711
15765
  var styleEmphasizedCss = css`:host([layout*=emphasized][shape*=pill]) [auro-input]{--ds-auro-input-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));--ds-auro-input-container-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));width:100%}:host([layout*=emphasized][shape*=pill]) [auro-input]:hover{--ds-auro-input-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));--ds-auro-input-container-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843))}:host([layout*=emphasized][shape*=pill]) [auro-input]::part(inputHelpText){display:none}:host([layout=emphasized]) [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843))}:host([layout=emphasized]) [auro-dropdown]:hover{--ds-auro-dropdown-trigger-hover-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843))}:host([layout=emphasized]) [auro-dropdown][layout*=emphasized]::part(wrapper){--ds-auro-dropdown-trigger-background-color: transparent}`;
15712
15766
 
@@ -10872,6 +10872,8 @@ class BaseInput extends AuroElement$2$1 {
10872
10872
  this.inputElement = this.renderRoot.querySelector('input');
10873
10873
  this.labelElement = this.shadowRoot.querySelector('label');
10874
10874
 
10875
+ this.patchInputEvent(this.inputElement);
10876
+
10875
10877
  if (this.wrapperElement) {
10876
10878
  this.wrapperElement.addEventListener('click', this.handleClick);
10877
10879
  }
@@ -10896,6 +10898,52 @@ class BaseInput extends AuroElement$2$1 {
10896
10898
  this.configureAutoFormatting();
10897
10899
  }
10898
10900
 
10901
+ /**
10902
+ * Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
10903
+ * This ensures that changes to the input's value are consistently communicated, even if not triggered by user input.
10904
+ *
10905
+ * @param {HTMLInputElement} input - The input element to patch.
10906
+ * @returns {void}
10907
+ * @private
10908
+ */
10909
+ patchInputEvent(input) {
10910
+ if (!input) return;
10911
+ if (input && !input.valuePatched) {
10912
+ const component = this; // eslint-disable-line
10913
+ const nativeDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
10914
+ Object.defineProperty(input, 'value', {
10915
+ get() {
10916
+ return nativeDescriptor.get.call(this);
10917
+ },
10918
+ set(val) {
10919
+ // Call the native setter
10920
+ nativeDescriptor.set.call(this, val);
10921
+
10922
+ // If the input is not connected to the DOM do not dispatch the event
10923
+ if (!this.isConnected) return;
10924
+
10925
+ // If the input has focus, do not dispatch the event because it was not programmatic
10926
+ if (this.matches(":focus")) return;
10927
+
10928
+ // If the component has flagged to skip the next programmatic input event, do not dispatch the event
10929
+ if (component.skipNextProgrammaticInputEvent) {
10930
+ component.skipNextProgrammaticInputEvent = false;
10931
+ return;
10932
+ }
10933
+
10934
+ // If all guard clauses are passed, dispatch the event
10935
+ const inputEvent = new InputEvent('input', {
10936
+ bubbles: true,
10937
+ composed: true,
10938
+ });
10939
+ inputEvent.isProgrammatic = true;
10940
+ this.dispatchEvent(inputEvent);
10941
+ }
10942
+ });
10943
+ input.valuePatched = true;
10944
+ }
10945
+ }
10946
+
10899
10947
  /**
10900
10948
  * @private
10901
10949
  * @returns {void} Sets the default help text for the input.
@@ -10970,6 +11018,7 @@ class BaseInput extends AuroElement$2$1 {
10970
11018
  }
10971
11019
 
10972
11020
  if (this.value !== this.inputElement.value) {
11021
+ this.skipNextProgrammaticInputEvent = true;
10973
11022
  if (this.value) {
10974
11023
  this.inputElement.value = this.value;
10975
11024
  } else {
@@ -11112,15 +11161,20 @@ class BaseInput extends AuroElement$2$1 {
11112
11161
  }
11113
11162
 
11114
11163
  /**
11164
+ * @param {Event} event - The input event
11115
11165
  * @private
11116
- * @return {void}
11166
+ * @returns {void}
11117
11167
  */
11118
- handleInput() {
11168
+ handleInput(event) {
11119
11169
  // Sets value property to value of element value (el.value).
11120
11170
  this.value = this.inputElement.value;
11121
11171
 
11122
- // Validation on blur or input.
11123
- if (this.validateOnInput) {
11172
+ // Determine if the value change was programmatic, including autofill.
11173
+ const inputWasProgrammatic = !this.matches(":focus") || event.isProgrammatic;
11174
+
11175
+ // Validation on input or programmatic value change (including autofill).
11176
+ if (this.validateOnInput || inputWasProgrammatic) {
11177
+ this.touched = true;
11124
11178
  this.validation.validate(this);
11125
11179
  }
11126
11180
 
@@ -15706,7 +15760,7 @@ class AuroBibtemplate extends LitElement {
15706
15760
 
15707
15761
  var bibTemplateVersion = '1.0.0';
15708
15762
 
15709
- 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 #inputInBib::part(accent-right){display:none}:host([layout*=classic]) [auro-input]{width:100%}:host([layout*=classic]) [auro-input]::part(helpText){display:none}:host([layout*=classic]) #slotHolder{display:none}`;
15763
+ 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}`;
15710
15764
 
15711
15765
  var styleEmphasizedCss = css`:host([layout*=emphasized][shape*=pill]) [auro-input]{--ds-auro-input-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));--ds-auro-input-container-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));width:100%}:host([layout*=emphasized][shape*=pill]) [auro-input]:hover{--ds-auro-input-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843));--ds-auro-input-container-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843))}:host([layout*=emphasized][shape*=pill]) [auro-input]::part(inputHelpText){display:none}:host([layout=emphasized]) [auro-dropdown]{--ds-auro-dropdown-trigger-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843))}:host([layout=emphasized]) [auro-dropdown]:hover{--ds-auro-dropdown-trigger-hover-background-color: var(--ds-advanced-color-dropdown-emphasized-background, rgba(0, 39, 74, 0.1019607843))}:host([layout=emphasized]) [auro-dropdown][layout*=emphasized]::part(wrapper){--ds-auro-dropdown-trigger-background-color: transparent}`;
15712
15766
 
@@ -24483,6 +24483,8 @@ class BaseInput extends AuroElement$2 {
24483
24483
  this.inputElement = this.renderRoot.querySelector('input');
24484
24484
  this.labelElement = this.shadowRoot.querySelector('label');
24485
24485
 
24486
+ this.patchInputEvent(this.inputElement);
24487
+
24486
24488
  if (this.wrapperElement) {
24487
24489
  this.wrapperElement.addEventListener('click', this.handleClick);
24488
24490
  }
@@ -24507,6 +24509,52 @@ class BaseInput extends AuroElement$2 {
24507
24509
  this.configureAutoFormatting();
24508
24510
  }
24509
24511
 
24512
+ /**
24513
+ * Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
24514
+ * This ensures that changes to the input's value are consistently communicated, even if not triggered by user input.
24515
+ *
24516
+ * @param {HTMLInputElement} input - The input element to patch.
24517
+ * @returns {void}
24518
+ * @private
24519
+ */
24520
+ patchInputEvent(input) {
24521
+ if (!input) return;
24522
+ if (input && !input.valuePatched) {
24523
+ const component = this; // eslint-disable-line
24524
+ const nativeDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
24525
+ Object.defineProperty(input, 'value', {
24526
+ get() {
24527
+ return nativeDescriptor.get.call(this);
24528
+ },
24529
+ set(val) {
24530
+ // Call the native setter
24531
+ nativeDescriptor.set.call(this, val);
24532
+
24533
+ // If the input is not connected to the DOM do not dispatch the event
24534
+ if (!this.isConnected) return;
24535
+
24536
+ // If the input has focus, do not dispatch the event because it was not programmatic
24537
+ if (this.matches(":focus")) return;
24538
+
24539
+ // If the component has flagged to skip the next programmatic input event, do not dispatch the event
24540
+ if (component.skipNextProgrammaticInputEvent) {
24541
+ component.skipNextProgrammaticInputEvent = false;
24542
+ return;
24543
+ }
24544
+
24545
+ // If all guard clauses are passed, dispatch the event
24546
+ const inputEvent = new InputEvent('input', {
24547
+ bubbles: true,
24548
+ composed: true,
24549
+ });
24550
+ inputEvent.isProgrammatic = true;
24551
+ this.dispatchEvent(inputEvent);
24552
+ }
24553
+ });
24554
+ input.valuePatched = true;
24555
+ }
24556
+ }
24557
+
24510
24558
  /**
24511
24559
  * @private
24512
24560
  * @returns {void} Sets the default help text for the input.
@@ -24581,6 +24629,7 @@ class BaseInput extends AuroElement$2 {
24581
24629
  }
24582
24630
 
24583
24631
  if (this.value !== this.inputElement.value) {
24632
+ this.skipNextProgrammaticInputEvent = true;
24584
24633
  if (this.value) {
24585
24634
  this.inputElement.value = this.value;
24586
24635
  } else {
@@ -24723,15 +24772,20 @@ class BaseInput extends AuroElement$2 {
24723
24772
  }
24724
24773
 
24725
24774
  /**
24775
+ * @param {Event} event - The input event
24726
24776
  * @private
24727
- * @return {void}
24777
+ * @returns {void}
24728
24778
  */
24729
- handleInput() {
24779
+ handleInput(event) {
24730
24780
  // Sets value property to value of element value (el.value).
24731
24781
  this.value = this.inputElement.value;
24732
24782
 
24733
- // Validation on blur or input.
24734
- if (this.validateOnInput) {
24783
+ // Determine if the value change was programmatic, including autofill.
24784
+ const inputWasProgrammatic = !this.matches(":focus") || event.isProgrammatic;
24785
+
24786
+ // Validation on input or programmatic value change (including autofill).
24787
+ if (this.validateOnInput || inputWasProgrammatic) {
24788
+ this.touched = true;
24735
24789
  this.validation.validate(this);
24736
24790
  }
24737
24791
 
@@ -29349,6 +29403,7 @@ class AuroDatePicker extends AuroElement$1 {
29349
29403
  }
29350
29404
 
29351
29405
  if (changedProperties.has('value')) {
29406
+
29352
29407
  this.formattedValue = this.util.toNorthAmericanFormat(this.value, this.format);
29353
29408
 
29354
29409
  // Change the calendar focus to the first valid date value only the first time the value is set
@@ -29397,6 +29452,7 @@ class AuroDatePicker extends AuroElement$1 {
29397
29452
  }
29398
29453
 
29399
29454
  if (changedProperties.has('valueEnd') && this.inputList[1]) {
29455
+
29400
29456
  this.formattedValueEnd = this.util.toNorthAmericanFormat(this.valueEnd, this.format);
29401
29457
 
29402
29458
  // update the calendar
@@ -24224,6 +24224,8 @@ class BaseInput extends AuroElement$2 {
24224
24224
  this.inputElement = this.renderRoot.querySelector('input');
24225
24225
  this.labelElement = this.shadowRoot.querySelector('label');
24226
24226
 
24227
+ this.patchInputEvent(this.inputElement);
24228
+
24227
24229
  if (this.wrapperElement) {
24228
24230
  this.wrapperElement.addEventListener('click', this.handleClick);
24229
24231
  }
@@ -24248,6 +24250,52 @@ class BaseInput extends AuroElement$2 {
24248
24250
  this.configureAutoFormatting();
24249
24251
  }
24250
24252
 
24253
+ /**
24254
+ * Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
24255
+ * This ensures that changes to the input's value are consistently communicated, even if not triggered by user input.
24256
+ *
24257
+ * @param {HTMLInputElement} input - The input element to patch.
24258
+ * @returns {void}
24259
+ * @private
24260
+ */
24261
+ patchInputEvent(input) {
24262
+ if (!input) return;
24263
+ if (input && !input.valuePatched) {
24264
+ const component = this; // eslint-disable-line
24265
+ const nativeDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
24266
+ Object.defineProperty(input, 'value', {
24267
+ get() {
24268
+ return nativeDescriptor.get.call(this);
24269
+ },
24270
+ set(val) {
24271
+ // Call the native setter
24272
+ nativeDescriptor.set.call(this, val);
24273
+
24274
+ // If the input is not connected to the DOM do not dispatch the event
24275
+ if (!this.isConnected) return;
24276
+
24277
+ // If the input has focus, do not dispatch the event because it was not programmatic
24278
+ if (this.matches(":focus")) return;
24279
+
24280
+ // If the component has flagged to skip the next programmatic input event, do not dispatch the event
24281
+ if (component.skipNextProgrammaticInputEvent) {
24282
+ component.skipNextProgrammaticInputEvent = false;
24283
+ return;
24284
+ }
24285
+
24286
+ // If all guard clauses are passed, dispatch the event
24287
+ const inputEvent = new InputEvent('input', {
24288
+ bubbles: true,
24289
+ composed: true,
24290
+ });
24291
+ inputEvent.isProgrammatic = true;
24292
+ this.dispatchEvent(inputEvent);
24293
+ }
24294
+ });
24295
+ input.valuePatched = true;
24296
+ }
24297
+ }
24298
+
24251
24299
  /**
24252
24300
  * @private
24253
24301
  * @returns {void} Sets the default help text for the input.
@@ -24322,6 +24370,7 @@ class BaseInput extends AuroElement$2 {
24322
24370
  }
24323
24371
 
24324
24372
  if (this.value !== this.inputElement.value) {
24373
+ this.skipNextProgrammaticInputEvent = true;
24325
24374
  if (this.value) {
24326
24375
  this.inputElement.value = this.value;
24327
24376
  } else {
@@ -24464,15 +24513,20 @@ class BaseInput extends AuroElement$2 {
24464
24513
  }
24465
24514
 
24466
24515
  /**
24516
+ * @param {Event} event - The input event
24467
24517
  * @private
24468
- * @return {void}
24518
+ * @returns {void}
24469
24519
  */
24470
- handleInput() {
24520
+ handleInput(event) {
24471
24521
  // Sets value property to value of element value (el.value).
24472
24522
  this.value = this.inputElement.value;
24473
24523
 
24474
- // Validation on blur or input.
24475
- if (this.validateOnInput) {
24524
+ // Determine if the value change was programmatic, including autofill.
24525
+ const inputWasProgrammatic = !this.matches(":focus") || event.isProgrammatic;
24526
+
24527
+ // Validation on input or programmatic value change (including autofill).
24528
+ if (this.validateOnInput || inputWasProgrammatic) {
24529
+ this.touched = true;
24476
24530
  this.validation.validate(this);
24477
24531
  }
24478
24532
 
@@ -29090,6 +29144,7 @@ class AuroDatePicker extends AuroElement$1 {
29090
29144
  }
29091
29145
 
29092
29146
  if (changedProperties.has('value')) {
29147
+
29093
29148
  this.formattedValue = this.util.toNorthAmericanFormat(this.value, this.format);
29094
29149
 
29095
29150
  // Change the calendar focus to the first valid date value only the first time the value is set
@@ -29138,6 +29193,7 @@ class AuroDatePicker extends AuroElement$1 {
29138
29193
  }
29139
29194
 
29140
29195
  if (changedProperties.has('valueEnd') && this.inputList[1]) {
29196
+
29141
29197
  this.formattedValueEnd = this.util.toNorthAmericanFormat(this.valueEnd, this.format);
29142
29198
 
29143
29199
  // update the calendar
@@ -24149,6 +24149,8 @@ class BaseInput extends AuroElement$2 {
24149
24149
  this.inputElement = this.renderRoot.querySelector('input');
24150
24150
  this.labelElement = this.shadowRoot.querySelector('label');
24151
24151
 
24152
+ this.patchInputEvent(this.inputElement);
24153
+
24152
24154
  if (this.wrapperElement) {
24153
24155
  this.wrapperElement.addEventListener('click', this.handleClick);
24154
24156
  }
@@ -24173,6 +24175,52 @@ class BaseInput extends AuroElement$2 {
24173
24175
  this.configureAutoFormatting();
24174
24176
  }
24175
24177
 
24178
+ /**
24179
+ * Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
24180
+ * This ensures that changes to the input's value are consistently communicated, even if not triggered by user input.
24181
+ *
24182
+ * @param {HTMLInputElement} input - The input element to patch.
24183
+ * @returns {void}
24184
+ * @private
24185
+ */
24186
+ patchInputEvent(input) {
24187
+ if (!input) return;
24188
+ if (input && !input.valuePatched) {
24189
+ const component = this; // eslint-disable-line
24190
+ const nativeDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
24191
+ Object.defineProperty(input, 'value', {
24192
+ get() {
24193
+ return nativeDescriptor.get.call(this);
24194
+ },
24195
+ set(val) {
24196
+ // Call the native setter
24197
+ nativeDescriptor.set.call(this, val);
24198
+
24199
+ // If the input is not connected to the DOM do not dispatch the event
24200
+ if (!this.isConnected) return;
24201
+
24202
+ // If the input has focus, do not dispatch the event because it was not programmatic
24203
+ if (this.matches(":focus")) return;
24204
+
24205
+ // If the component has flagged to skip the next programmatic input event, do not dispatch the event
24206
+ if (component.skipNextProgrammaticInputEvent) {
24207
+ component.skipNextProgrammaticInputEvent = false;
24208
+ return;
24209
+ }
24210
+
24211
+ // If all guard clauses are passed, dispatch the event
24212
+ const inputEvent = new InputEvent('input', {
24213
+ bubbles: true,
24214
+ composed: true,
24215
+ });
24216
+ inputEvent.isProgrammatic = true;
24217
+ this.dispatchEvent(inputEvent);
24218
+ }
24219
+ });
24220
+ input.valuePatched = true;
24221
+ }
24222
+ }
24223
+
24176
24224
  /**
24177
24225
  * @private
24178
24226
  * @returns {void} Sets the default help text for the input.
@@ -24247,6 +24295,7 @@ class BaseInput extends AuroElement$2 {
24247
24295
  }
24248
24296
 
24249
24297
  if (this.value !== this.inputElement.value) {
24298
+ this.skipNextProgrammaticInputEvent = true;
24250
24299
  if (this.value) {
24251
24300
  this.inputElement.value = this.value;
24252
24301
  } else {
@@ -24389,15 +24438,20 @@ class BaseInput extends AuroElement$2 {
24389
24438
  }
24390
24439
 
24391
24440
  /**
24441
+ * @param {Event} event - The input event
24392
24442
  * @private
24393
- * @return {void}
24443
+ * @returns {void}
24394
24444
  */
24395
- handleInput() {
24445
+ handleInput(event) {
24396
24446
  // Sets value property to value of element value (el.value).
24397
24447
  this.value = this.inputElement.value;
24398
24448
 
24399
- // Validation on blur or input.
24400
- if (this.validateOnInput) {
24449
+ // Determine if the value change was programmatic, including autofill.
24450
+ const inputWasProgrammatic = !this.matches(":focus") || event.isProgrammatic;
24451
+
24452
+ // Validation on input or programmatic value change (including autofill).
24453
+ if (this.validateOnInput || inputWasProgrammatic) {
24454
+ this.touched = true;
24401
24455
  this.validation.validate(this);
24402
24456
  }
24403
24457
 
@@ -29015,6 +29069,7 @@ class AuroDatePicker extends AuroElement$1 {
29015
29069
  }
29016
29070
 
29017
29071
  if (changedProperties.has('value')) {
29072
+
29018
29073
  this.formattedValue = this.util.toNorthAmericanFormat(this.value, this.format);
29019
29074
 
29020
29075
  // Change the calendar focus to the first valid date value only the first time the value is set
@@ -29063,6 +29118,7 @@ class AuroDatePicker extends AuroElement$1 {
29063
29118
  }
29064
29119
 
29065
29120
  if (changedProperties.has('valueEnd') && this.inputList[1]) {
29121
+
29066
29122
  this.formattedValueEnd = this.util.toNorthAmericanFormat(this.valueEnd, this.format);
29067
29123
 
29068
29124
  // update the calendar
@@ -24149,6 +24149,8 @@ class BaseInput extends AuroElement$2 {
24149
24149
  this.inputElement = this.renderRoot.querySelector('input');
24150
24150
  this.labelElement = this.shadowRoot.querySelector('label');
24151
24151
 
24152
+ this.patchInputEvent(this.inputElement);
24153
+
24152
24154
  if (this.wrapperElement) {
24153
24155
  this.wrapperElement.addEventListener('click', this.handleClick);
24154
24156
  }
@@ -24173,6 +24175,52 @@ class BaseInput extends AuroElement$2 {
24173
24175
  this.configureAutoFormatting();
24174
24176
  }
24175
24177
 
24178
+ /**
24179
+ * Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
24180
+ * This ensures that changes to the input's value are consistently communicated, even if not triggered by user input.
24181
+ *
24182
+ * @param {HTMLInputElement} input - The input element to patch.
24183
+ * @returns {void}
24184
+ * @private
24185
+ */
24186
+ patchInputEvent(input) {
24187
+ if (!input) return;
24188
+ if (input && !input.valuePatched) {
24189
+ const component = this; // eslint-disable-line
24190
+ const nativeDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
24191
+ Object.defineProperty(input, 'value', {
24192
+ get() {
24193
+ return nativeDescriptor.get.call(this);
24194
+ },
24195
+ set(val) {
24196
+ // Call the native setter
24197
+ nativeDescriptor.set.call(this, val);
24198
+
24199
+ // If the input is not connected to the DOM do not dispatch the event
24200
+ if (!this.isConnected) return;
24201
+
24202
+ // If the input has focus, do not dispatch the event because it was not programmatic
24203
+ if (this.matches(":focus")) return;
24204
+
24205
+ // If the component has flagged to skip the next programmatic input event, do not dispatch the event
24206
+ if (component.skipNextProgrammaticInputEvent) {
24207
+ component.skipNextProgrammaticInputEvent = false;
24208
+ return;
24209
+ }
24210
+
24211
+ // If all guard clauses are passed, dispatch the event
24212
+ const inputEvent = new InputEvent('input', {
24213
+ bubbles: true,
24214
+ composed: true,
24215
+ });
24216
+ inputEvent.isProgrammatic = true;
24217
+ this.dispatchEvent(inputEvent);
24218
+ }
24219
+ });
24220
+ input.valuePatched = true;
24221
+ }
24222
+ }
24223
+
24176
24224
  /**
24177
24225
  * @private
24178
24226
  * @returns {void} Sets the default help text for the input.
@@ -24247,6 +24295,7 @@ class BaseInput extends AuroElement$2 {
24247
24295
  }
24248
24296
 
24249
24297
  if (this.value !== this.inputElement.value) {
24298
+ this.skipNextProgrammaticInputEvent = true;
24250
24299
  if (this.value) {
24251
24300
  this.inputElement.value = this.value;
24252
24301
  } else {
@@ -24389,15 +24438,20 @@ class BaseInput extends AuroElement$2 {
24389
24438
  }
24390
24439
 
24391
24440
  /**
24441
+ * @param {Event} event - The input event
24392
24442
  * @private
24393
- * @return {void}
24443
+ * @returns {void}
24394
24444
  */
24395
- handleInput() {
24445
+ handleInput(event) {
24396
24446
  // Sets value property to value of element value (el.value).
24397
24447
  this.value = this.inputElement.value;
24398
24448
 
24399
- // Validation on blur or input.
24400
- if (this.validateOnInput) {
24449
+ // Determine if the value change was programmatic, including autofill.
24450
+ const inputWasProgrammatic = !this.matches(":focus") || event.isProgrammatic;
24451
+
24452
+ // Validation on input or programmatic value change (including autofill).
24453
+ if (this.validateOnInput || inputWasProgrammatic) {
24454
+ this.touched = true;
24401
24455
  this.validation.validate(this);
24402
24456
  }
24403
24457
 
@@ -29015,6 +29069,7 @@ class AuroDatePicker extends AuroElement$1 {
29015
29069
  }
29016
29070
 
29017
29071
  if (changedProperties.has('value')) {
29072
+
29018
29073
  this.formattedValue = this.util.toNorthAmericanFormat(this.value, this.format);
29019
29074
 
29020
29075
  // Change the calendar focus to the first valid date value only the first time the value is set
@@ -29063,6 +29118,7 @@ class AuroDatePicker extends AuroElement$1 {
29063
29118
  }
29064
29119
 
29065
29120
  if (changedProperties.has('valueEnd') && this.inputList[1]) {
29121
+
29066
29122
  this.formattedValueEnd = this.util.toNorthAmericanFormat(this.valueEnd, this.format);
29067
29123
 
29068
29124
  // update the calendar
@@ -70,7 +70,7 @@ Generate unique names for dependency components.
70
70
  |-----------------------------|--------------------|--------------------------------------------------|
71
71
  | `auroFormElement-validated` | | Notifies that the `validity` and `errorMessage` value has changed. |
72
72
  | `auroInput-validityChange` | `CustomEvent<any>` | |
73
- | [input](#input) | | Event fires when the value of an `auro-input` has been changed. |
73
+ | [input](#input) | `InputEvent` | Event fires when the value of an `auro-input` has been changed. |
74
74
 
75
75
  ## Slots
76
76
 
@@ -5623,6 +5623,8 @@ class BaseInput extends AuroElement$2 {
5623
5623
  this.inputElement = this.renderRoot.querySelector('input');
5624
5624
  this.labelElement = this.shadowRoot.querySelector('label');
5625
5625
 
5626
+ this.patchInputEvent(this.inputElement);
5627
+
5626
5628
  if (this.wrapperElement) {
5627
5629
  this.wrapperElement.addEventListener('click', this.handleClick);
5628
5630
  }
@@ -5647,6 +5649,52 @@ class BaseInput extends AuroElement$2 {
5647
5649
  this.configureAutoFormatting();
5648
5650
  }
5649
5651
 
5652
+ /**
5653
+ * Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
5654
+ * This ensures that changes to the input's value are consistently communicated, even if not triggered by user input.
5655
+ *
5656
+ * @param {HTMLInputElement} input - The input element to patch.
5657
+ * @returns {void}
5658
+ * @private
5659
+ */
5660
+ patchInputEvent(input) {
5661
+ if (!input) return;
5662
+ if (input && !input.valuePatched) {
5663
+ const component = this; // eslint-disable-line
5664
+ const nativeDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
5665
+ Object.defineProperty(input, 'value', {
5666
+ get() {
5667
+ return nativeDescriptor.get.call(this);
5668
+ },
5669
+ set(val) {
5670
+ // Call the native setter
5671
+ nativeDescriptor.set.call(this, val);
5672
+
5673
+ // If the input is not connected to the DOM do not dispatch the event
5674
+ if (!this.isConnected) return;
5675
+
5676
+ // If the input has focus, do not dispatch the event because it was not programmatic
5677
+ if (this.matches(":focus")) return;
5678
+
5679
+ // If the component has flagged to skip the next programmatic input event, do not dispatch the event
5680
+ if (component.skipNextProgrammaticInputEvent) {
5681
+ component.skipNextProgrammaticInputEvent = false;
5682
+ return;
5683
+ }
5684
+
5685
+ // If all guard clauses are passed, dispatch the event
5686
+ const inputEvent = new InputEvent('input', {
5687
+ bubbles: true,
5688
+ composed: true,
5689
+ });
5690
+ inputEvent.isProgrammatic = true;
5691
+ this.dispatchEvent(inputEvent);
5692
+ }
5693
+ });
5694
+ input.valuePatched = true;
5695
+ }
5696
+ }
5697
+
5650
5698
  /**
5651
5699
  * @private
5652
5700
  * @returns {void} Sets the default help text for the input.
@@ -5721,6 +5769,7 @@ class BaseInput extends AuroElement$2 {
5721
5769
  }
5722
5770
 
5723
5771
  if (this.value !== this.inputElement.value) {
5772
+ this.skipNextProgrammaticInputEvent = true;
5724
5773
  if (this.value) {
5725
5774
  this.inputElement.value = this.value;
5726
5775
  } else {
@@ -5863,15 +5912,20 @@ class BaseInput extends AuroElement$2 {
5863
5912
  }
5864
5913
 
5865
5914
  /**
5915
+ * @param {Event} event - The input event
5866
5916
  * @private
5867
- * @return {void}
5917
+ * @returns {void}
5868
5918
  */
5869
- handleInput() {
5919
+ handleInput(event) {
5870
5920
  // Sets value property to value of element value (el.value).
5871
5921
  this.value = this.inputElement.value;
5872
5922
 
5873
- // Validation on blur or input.
5874
- if (this.validateOnInput) {
5923
+ // Determine if the value change was programmatic, including autofill.
5924
+ const inputWasProgrammatic = !this.matches(":focus") || event.isProgrammatic;
5925
+
5926
+ // Validation on input or programmatic value change (including autofill).
5927
+ if (this.validateOnInput || inputWasProgrammatic) {
5928
+ this.touched = true;
5875
5929
  this.validation.validate(this);
5876
5930
  }
5877
5931
 
@@ -5548,6 +5548,8 @@ class BaseInput extends AuroElement$2 {
5548
5548
  this.inputElement = this.renderRoot.querySelector('input');
5549
5549
  this.labelElement = this.shadowRoot.querySelector('label');
5550
5550
 
5551
+ this.patchInputEvent(this.inputElement);
5552
+
5551
5553
  if (this.wrapperElement) {
5552
5554
  this.wrapperElement.addEventListener('click', this.handleClick);
5553
5555
  }
@@ -5572,6 +5574,52 @@ class BaseInput extends AuroElement$2 {
5572
5574
  this.configureAutoFormatting();
5573
5575
  }
5574
5576
 
5577
+ /**
5578
+ * Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
5579
+ * This ensures that changes to the input's value are consistently communicated, even if not triggered by user input.
5580
+ *
5581
+ * @param {HTMLInputElement} input - The input element to patch.
5582
+ * @returns {void}
5583
+ * @private
5584
+ */
5585
+ patchInputEvent(input) {
5586
+ if (!input) return;
5587
+ if (input && !input.valuePatched) {
5588
+ const component = this; // eslint-disable-line
5589
+ const nativeDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
5590
+ Object.defineProperty(input, 'value', {
5591
+ get() {
5592
+ return nativeDescriptor.get.call(this);
5593
+ },
5594
+ set(val) {
5595
+ // Call the native setter
5596
+ nativeDescriptor.set.call(this, val);
5597
+
5598
+ // If the input is not connected to the DOM do not dispatch the event
5599
+ if (!this.isConnected) return;
5600
+
5601
+ // If the input has focus, do not dispatch the event because it was not programmatic
5602
+ if (this.matches(":focus")) return;
5603
+
5604
+ // If the component has flagged to skip the next programmatic input event, do not dispatch the event
5605
+ if (component.skipNextProgrammaticInputEvent) {
5606
+ component.skipNextProgrammaticInputEvent = false;
5607
+ return;
5608
+ }
5609
+
5610
+ // If all guard clauses are passed, dispatch the event
5611
+ const inputEvent = new InputEvent('input', {
5612
+ bubbles: true,
5613
+ composed: true,
5614
+ });
5615
+ inputEvent.isProgrammatic = true;
5616
+ this.dispatchEvent(inputEvent);
5617
+ }
5618
+ });
5619
+ input.valuePatched = true;
5620
+ }
5621
+ }
5622
+
5575
5623
  /**
5576
5624
  * @private
5577
5625
  * @returns {void} Sets the default help text for the input.
@@ -5646,6 +5694,7 @@ class BaseInput extends AuroElement$2 {
5646
5694
  }
5647
5695
 
5648
5696
  if (this.value !== this.inputElement.value) {
5697
+ this.skipNextProgrammaticInputEvent = true;
5649
5698
  if (this.value) {
5650
5699
  this.inputElement.value = this.value;
5651
5700
  } else {
@@ -5788,15 +5837,20 @@ class BaseInput extends AuroElement$2 {
5788
5837
  }
5789
5838
 
5790
5839
  /**
5840
+ * @param {Event} event - The input event
5791
5841
  * @private
5792
- * @return {void}
5842
+ * @returns {void}
5793
5843
  */
5794
- handleInput() {
5844
+ handleInput(event) {
5795
5845
  // Sets value property to value of element value (el.value).
5796
5846
  this.value = this.inputElement.value;
5797
5847
 
5798
- // Validation on blur or input.
5799
- if (this.validateOnInput) {
5848
+ // Determine if the value change was programmatic, including autofill.
5849
+ const inputWasProgrammatic = !this.matches(":focus") || event.isProgrammatic;
5850
+
5851
+ // Validation on input or programmatic value change (including autofill).
5852
+ if (this.validateOnInput || inputWasProgrammatic) {
5853
+ this.touched = true;
5800
5854
  this.validation.validate(this);
5801
5855
  }
5802
5856
 
@@ -403,6 +403,15 @@ export default class BaseInput extends AuroElement {
403
403
  inputId: string;
404
404
  format: any;
405
405
  ValidityMessageOverride: any;
406
+ /**
407
+ * Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
408
+ * This ensures that changes to the input's value are consistently communicated, even if not triggered by user input.
409
+ *
410
+ * @param {HTMLInputElement} input - The input element to patch.
411
+ * @returns {void}
412
+ * @private
413
+ */
414
+ private patchInputEvent;
406
415
  /**
407
416
  * @private
408
417
  * @returns {void} Sets the default help text for the input.
@@ -414,6 +423,7 @@ export default class BaseInput extends AuroElement {
414
423
  * @returns {void}
415
424
  */
416
425
  updated(changedProperties: Map<string, any>): void;
426
+ skipNextProgrammaticInputEvent: boolean;
417
427
  /**
418
428
  * @private
419
429
  * @returns {void} Notify validity state changed via event.
@@ -465,8 +475,9 @@ export default class BaseInput extends AuroElement {
465
475
  */
466
476
  private handleClickClear;
467
477
  /**
478
+ * @param {Event} event - The input event
468
479
  * @private
469
- * @return {void}
480
+ * @returns {void}
470
481
  */
471
482
  private handleInput;
472
483
  /**
@@ -5472,6 +5472,8 @@ class BaseInput extends AuroElement$2 {
5472
5472
  this.inputElement = this.renderRoot.querySelector('input');
5473
5473
  this.labelElement = this.shadowRoot.querySelector('label');
5474
5474
 
5475
+ this.patchInputEvent(this.inputElement);
5476
+
5475
5477
  if (this.wrapperElement) {
5476
5478
  this.wrapperElement.addEventListener('click', this.handleClick);
5477
5479
  }
@@ -5496,6 +5498,52 @@ class BaseInput extends AuroElement$2 {
5496
5498
  this.configureAutoFormatting();
5497
5499
  }
5498
5500
 
5501
+ /**
5502
+ * Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
5503
+ * This ensures that changes to the input's value are consistently communicated, even if not triggered by user input.
5504
+ *
5505
+ * @param {HTMLInputElement} input - The input element to patch.
5506
+ * @returns {void}
5507
+ * @private
5508
+ */
5509
+ patchInputEvent(input) {
5510
+ if (!input) return;
5511
+ if (input && !input.valuePatched) {
5512
+ const component = this; // eslint-disable-line
5513
+ const nativeDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
5514
+ Object.defineProperty(input, 'value', {
5515
+ get() {
5516
+ return nativeDescriptor.get.call(this);
5517
+ },
5518
+ set(val) {
5519
+ // Call the native setter
5520
+ nativeDescriptor.set.call(this, val);
5521
+
5522
+ // If the input is not connected to the DOM do not dispatch the event
5523
+ if (!this.isConnected) return;
5524
+
5525
+ // If the input has focus, do not dispatch the event because it was not programmatic
5526
+ if (this.matches(":focus")) return;
5527
+
5528
+ // If the component has flagged to skip the next programmatic input event, do not dispatch the event
5529
+ if (component.skipNextProgrammaticInputEvent) {
5530
+ component.skipNextProgrammaticInputEvent = false;
5531
+ return;
5532
+ }
5533
+
5534
+ // If all guard clauses are passed, dispatch the event
5535
+ const inputEvent = new InputEvent('input', {
5536
+ bubbles: true,
5537
+ composed: true,
5538
+ });
5539
+ inputEvent.isProgrammatic = true;
5540
+ this.dispatchEvent(inputEvent);
5541
+ }
5542
+ });
5543
+ input.valuePatched = true;
5544
+ }
5545
+ }
5546
+
5499
5547
  /**
5500
5548
  * @private
5501
5549
  * @returns {void} Sets the default help text for the input.
@@ -5570,6 +5618,7 @@ class BaseInput extends AuroElement$2 {
5570
5618
  }
5571
5619
 
5572
5620
  if (this.value !== this.inputElement.value) {
5621
+ this.skipNextProgrammaticInputEvent = true;
5573
5622
  if (this.value) {
5574
5623
  this.inputElement.value = this.value;
5575
5624
  } else {
@@ -5712,15 +5761,20 @@ class BaseInput extends AuroElement$2 {
5712
5761
  }
5713
5762
 
5714
5763
  /**
5764
+ * @param {Event} event - The input event
5715
5765
  * @private
5716
- * @return {void}
5766
+ * @returns {void}
5717
5767
  */
5718
- handleInput() {
5768
+ handleInput(event) {
5719
5769
  // Sets value property to value of element value (el.value).
5720
5770
  this.value = this.inputElement.value;
5721
5771
 
5722
- // Validation on blur or input.
5723
- if (this.validateOnInput) {
5772
+ // Determine if the value change was programmatic, including autofill.
5773
+ const inputWasProgrammatic = !this.matches(":focus") || event.isProgrammatic;
5774
+
5775
+ // Validation on input or programmatic value change (including autofill).
5776
+ if (this.validateOnInput || inputWasProgrammatic) {
5777
+ this.touched = true;
5724
5778
  this.validation.validate(this);
5725
5779
  }
5726
5780
 
@@ -5472,6 +5472,8 @@ class BaseInput extends AuroElement$2 {
5472
5472
  this.inputElement = this.renderRoot.querySelector('input');
5473
5473
  this.labelElement = this.shadowRoot.querySelector('label');
5474
5474
 
5475
+ this.patchInputEvent(this.inputElement);
5476
+
5475
5477
  if (this.wrapperElement) {
5476
5478
  this.wrapperElement.addEventListener('click', this.handleClick);
5477
5479
  }
@@ -5496,6 +5498,52 @@ class BaseInput extends AuroElement$2 {
5496
5498
  this.configureAutoFormatting();
5497
5499
  }
5498
5500
 
5501
+ /**
5502
+ * Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
5503
+ * This ensures that changes to the input's value are consistently communicated, even if not triggered by user input.
5504
+ *
5505
+ * @param {HTMLInputElement} input - The input element to patch.
5506
+ * @returns {void}
5507
+ * @private
5508
+ */
5509
+ patchInputEvent(input) {
5510
+ if (!input) return;
5511
+ if (input && !input.valuePatched) {
5512
+ const component = this; // eslint-disable-line
5513
+ const nativeDescriptor = Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, 'value');
5514
+ Object.defineProperty(input, 'value', {
5515
+ get() {
5516
+ return nativeDescriptor.get.call(this);
5517
+ },
5518
+ set(val) {
5519
+ // Call the native setter
5520
+ nativeDescriptor.set.call(this, val);
5521
+
5522
+ // If the input is not connected to the DOM do not dispatch the event
5523
+ if (!this.isConnected) return;
5524
+
5525
+ // If the input has focus, do not dispatch the event because it was not programmatic
5526
+ if (this.matches(":focus")) return;
5527
+
5528
+ // If the component has flagged to skip the next programmatic input event, do not dispatch the event
5529
+ if (component.skipNextProgrammaticInputEvent) {
5530
+ component.skipNextProgrammaticInputEvent = false;
5531
+ return;
5532
+ }
5533
+
5534
+ // If all guard clauses are passed, dispatch the event
5535
+ const inputEvent = new InputEvent('input', {
5536
+ bubbles: true,
5537
+ composed: true,
5538
+ });
5539
+ inputEvent.isProgrammatic = true;
5540
+ this.dispatchEvent(inputEvent);
5541
+ }
5542
+ });
5543
+ input.valuePatched = true;
5544
+ }
5545
+ }
5546
+
5499
5547
  /**
5500
5548
  * @private
5501
5549
  * @returns {void} Sets the default help text for the input.
@@ -5570,6 +5618,7 @@ class BaseInput extends AuroElement$2 {
5570
5618
  }
5571
5619
 
5572
5620
  if (this.value !== this.inputElement.value) {
5621
+ this.skipNextProgrammaticInputEvent = true;
5573
5622
  if (this.value) {
5574
5623
  this.inputElement.value = this.value;
5575
5624
  } else {
@@ -5712,15 +5761,20 @@ class BaseInput extends AuroElement$2 {
5712
5761
  }
5713
5762
 
5714
5763
  /**
5764
+ * @param {Event} event - The input event
5715
5765
  * @private
5716
- * @return {void}
5766
+ * @returns {void}
5717
5767
  */
5718
- handleInput() {
5768
+ handleInput(event) {
5719
5769
  // Sets value property to value of element value (el.value).
5720
5770
  this.value = this.inputElement.value;
5721
5771
 
5722
- // Validation on blur or input.
5723
- if (this.validateOnInput) {
5772
+ // Determine if the value change was programmatic, including autofill.
5773
+ const inputWasProgrammatic = !this.matches(":focus") || event.isProgrammatic;
5774
+
5775
+ // Validation on input or programmatic value change (including autofill).
5776
+ if (this.validateOnInput || inputWasProgrammatic) {
5777
+ this.touched = true;
5724
5778
  this.validation.validate(this);
5725
5779
  }
5726
5780
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem-dev/auro-formkit",
3
- "version": "0.0.0-pr1130.0",
3
+ "version": "0.0.0-pr1137.0",
4
4
  "description": "A collection of web components used to build forms.",
5
5
  "homepage": "https://github.com/AlaskaAirlines/auro-formkit#readme",
6
6
  "bugs": {