@aurodesignsystem-dev/auro-formkit 0.0.0-pr1052.1 → 0.0.0-pr1052.3

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.
@@ -40,15 +40,16 @@
40
40
 
41
41
  ## Methods
42
42
 
43
- | Method | Type | Description |
44
- |------------|----------------------------------------|--------------------------------------------------|
45
- | [clear](#clear) | `(): void` | Clears the current value of the combobox. |
46
- | [focus](#focus) | `(): void` | Focuses the combobox trigger input. |
47
- | [hideBib](#hideBib) | `(): void` | Hides the dropdown bib if its open. |
48
- | [isValid](#isValid) | `(): boolean` | Checks if the element is valid. |
49
- | [reset](#reset) | `(): void` | Resets component to initial state. |
50
- | [showBib](#showBib) | `(): void` | Shows the dropdown bib if there are options to show. |
51
- | [validate](#validate) | `(force?: boolean \| undefined): void` | Validates value.<br /><br />**force**: Whether to force validation. |
43
+ | Method | Type | Description |
44
+ |----------------------|----------------------------------------|--------------------------------------------------|
45
+ | [clear](#clear) | `(): void` | Clears the current value of the combobox. |
46
+ | [focus](#focus) | `(): void` | Focuses the combobox trigger input. |
47
+ | [hideBib](#hideBib) | `(): void` | Hides the dropdown bib if its open. |
48
+ | [isValid](#isValid) | `(): boolean` | Checks if the element is valid. |
49
+ | [reset](#reset) | `(): void` | Resets component to initial state. |
50
+ | [showBib](#showBib) | `(): void` | Shows the dropdown bib if there are options to show. |
51
+ | [updateActiveOption](#updateActiveOption) | `(index: number): void` | Updates the active option in the menu.<br /><br />**index**: Index of the option to make active. |
52
+ | [validate](#validate) | `(force?: boolean \| undefined): void` | Validates value.<br /><br />**force**: Whether to force validation. |
52
53
 
53
54
  ## Events
54
55
 
@@ -171,7 +172,9 @@ The menu in this example was populated from data from a country/city API. To kee
171
172
  size="lg"
172
173
  ondark
173
174
  noFilter
174
- persistInput>
175
+ persistInput
176
+ dvInputOnly
177
+ required>
175
178
  <span slot="bib.fullscreen.headline">Dynamic Combobox Header</span>
176
179
  <span slot="label">Name</span>
177
180
  <!--
@@ -198,7 +201,9 @@ The menu in this example was populated from data from a country/city API. To kee
198
201
  size="lg"
199
202
  ondark
200
203
  noFilter
201
- persistInput>
204
+ persistInput
205
+ dvInputOnly
206
+ required>
202
207
  <span slot="bib.fullscreen.headline">Dynamic Combobox Header</span>
203
208
  <span slot="label">Name</span>
204
209
  <!--
@@ -217,7 +222,7 @@ The menu in this example was populated from data from a country/city API. To kee
217
222
  // -----------------------
218
223
  import { DynamicData } from './dynamicMenuDataApi';
219
224
 
220
- export function dynamicMenuExample() {
225
+ export async function dynamicMenuExample() {
221
226
  // Resets the root menu
222
227
  function resetMenu(root) {
223
228
  while (root.firstChild) {
@@ -262,16 +267,22 @@ export function dynamicMenuExample() {
262
267
 
263
268
  // Main javascript that runs all JS to create example
264
269
  const dynamicData = new DynamicData();
265
- const dynamicMenuExample = document.querySelector('#dynamicMenuExample');
266
- const dropdownEl = dynamicMenuExample.shadowRoot.querySelector(dynamicMenuExample.dropdownTag._$litStatic$);
267
- const inputEl = dropdownEl.querySelector(dynamicMenuExample.inputTag._$litStatic$);
270
+ const dynamicMenuExampleEl = document.querySelector('#dynamicMenuExample');
271
+ const dropdownEl = dynamicMenuExampleEl.shadowRoot.querySelector(dynamicMenuExampleEl.dropdownTag._$litStatic$);
272
+ const inputEl = dropdownEl.querySelector(dynamicMenuExampleEl.inputTag._$litStatic$);
268
273
 
269
274
  inputEl.addEventListener('input', () => {
270
275
  let data = dynamicData.getData();
271
276
  data = dynamicData.filterData(data, inputEl.value);
272
277
 
273
278
  generateHtml(data);
274
- });
279
+ });
280
+
281
+ if (dynamicMenuExampleEl.value && dynamicMenuExampleEl.value.length > 0 && dynamicMenuExampleEl.input.value && (!dynamicMenuExampleEl.menu.availableOptions || dynamicMenuExampleEl.menu.availableOptions.length === 0)) {
282
+ let data = dynamicData.getData();
283
+ data = dynamicData.filterData(data, inputEl.value);
284
+ generateHtml(data);
285
+ }
275
286
  }
276
287
  ```
277
288
  <!-- AURO-GENERATED-CONTENT:END -->
@@ -32,7 +32,7 @@ class DynamicData {
32
32
  // Javascript example file
33
33
  // -----------------------
34
34
 
35
- function dynamicMenuExample() {
35
+ async function dynamicMenuExample() {
36
36
  // Resets the root menu
37
37
  function resetMenu(root) {
38
38
  while (root.firstChild) {
@@ -76,9 +76,9 @@ function dynamicMenuExample() {
76
76
 
77
77
  // Main javascript that runs all JS to create example
78
78
  const dynamicData = new DynamicData();
79
- const dynamicMenuExample = document.querySelector('#dynamicMenuExample');
80
- const dropdownEl = dynamicMenuExample.shadowRoot.querySelector(dynamicMenuExample.dropdownTag._$litStatic$);
81
- const inputEl = dropdownEl.querySelector(dynamicMenuExample.inputTag._$litStatic$);
79
+ const dynamicMenuExampleEl = document.querySelector('#dynamicMenuExample');
80
+ const dropdownEl = dynamicMenuExampleEl.shadowRoot.querySelector(dynamicMenuExampleEl.dropdownTag._$litStatic$);
81
+ const inputEl = dropdownEl.querySelector(dynamicMenuExampleEl.inputTag._$litStatic$);
82
82
 
83
83
  inputEl.addEventListener('input', () => {
84
84
  let data = dynamicData.getData();
@@ -86,6 +86,13 @@ function dynamicMenuExample() {
86
86
 
87
87
  generateHtml(data);
88
88
  });
89
+
90
+
91
+ if (dynamicMenuExampleEl.value && dynamicMenuExampleEl.value.length > 0 && dynamicMenuExampleEl.input.value && (!dynamicMenuExampleEl.menu.availableOptions || dynamicMenuExampleEl.menu.availableOptions.length === 0)) {
92
+ let data = dynamicData.getData();
93
+ data = dynamicData.filterData(data, inputEl.value);
94
+ generateHtml(data);
95
+ }
89
96
  }
90
97
 
91
98
  function valueExample() {
@@ -16728,6 +16735,10 @@ class AuroCombobox extends AuroElement$1 {
16728
16735
  this.generateOptionsArray();
16729
16736
  this.availableOptions = [];
16730
16737
  this.updateFilter();
16738
+
16739
+ if (this.value && this.input.value && !this.menu.value) {
16740
+ this.menu.value = this.value;
16741
+ }
16731
16742
  }
16732
16743
 
16733
16744
  /**
@@ -17199,6 +17210,15 @@ class AuroCombobox extends AuroElement$1 {
17199
17210
  async updated(changedProperties) {
17200
17211
  // After the component is ready, send direct value changes to auro-menu.
17201
17212
  if (changedProperties.has('value')) {
17213
+ if (this.value && this.value.length > 0) {
17214
+ this.hasValue = true;
17215
+ } else {
17216
+ this.hasValue = false;
17217
+ }
17218
+
17219
+ if (this.hasValue && !this.input.value && (!this.menu.availableOptions || this.menu.availableOptions.length === 0)) {
17220
+ this.input.value = this.value;
17221
+ }
17202
17222
 
17203
17223
  if (this.value) {
17204
17224
  // If the value got set programmatically make sure we hide the bib
@@ -17267,6 +17287,16 @@ class AuroCombobox extends AuroElement$1 {
17267
17287
  });
17268
17288
  }
17269
17289
 
17290
+ /**
17291
+ * Updates the active option in the menu.
17292
+ * @param {number} index - Index of the option to make active.
17293
+ */
17294
+ updateActiveOption(index) {
17295
+ if (this.menu) {
17296
+ this.menu.updateActiveOption(index);
17297
+ }
17298
+ }
17299
+
17270
17300
  /**
17271
17301
  * Watch for slot changes and recalculate the menuoptions.
17272
17302
  * @private
@@ -17292,12 +17322,6 @@ class AuroCombobox extends AuroElement$1 {
17292
17322
 
17293
17323
  this.handleMenuOptions();
17294
17324
 
17295
-
17296
- console.warn('make a selection?');
17297
- console.info('this.hasFocus', this.componentHasFocus);
17298
- console.info('this.inputValue', this.inputValue);
17299
- console.info('this.value', this.value);
17300
-
17301
17325
  break;
17302
17326
 
17303
17327
  // Programmatically inject as the slot cannot be carried over to bibtemplate.
@@ -18209,7 +18233,6 @@ class AuroMenu extends AuroElement$1 {
18209
18233
 
18210
18234
  /**
18211
18235
  * Updates the active option state and dispatches events.
18212
- * @private
18213
18236
  * @param {number} index - Index of the option to make active.
18214
18237
  */
18215
18238
  updateActiveOption(index) {
@@ -16583,6 +16583,10 @@ class AuroCombobox extends AuroElement$1 {
16583
16583
  this.generateOptionsArray();
16584
16584
  this.availableOptions = [];
16585
16585
  this.updateFilter();
16586
+
16587
+ if (this.value && this.input.value && !this.menu.value) {
16588
+ this.menu.value = this.value;
16589
+ }
16586
16590
  }
16587
16591
 
16588
16592
  /**
@@ -17054,6 +17058,15 @@ class AuroCombobox extends AuroElement$1 {
17054
17058
  async updated(changedProperties) {
17055
17059
  // After the component is ready, send direct value changes to auro-menu.
17056
17060
  if (changedProperties.has('value')) {
17061
+ if (this.value && this.value.length > 0) {
17062
+ this.hasValue = true;
17063
+ } else {
17064
+ this.hasValue = false;
17065
+ }
17066
+
17067
+ if (this.hasValue && !this.input.value && (!this.menu.availableOptions || this.menu.availableOptions.length === 0)) {
17068
+ this.input.value = this.value;
17069
+ }
17057
17070
 
17058
17071
  if (this.value) {
17059
17072
  // If the value got set programmatically make sure we hide the bib
@@ -17122,6 +17135,16 @@ class AuroCombobox extends AuroElement$1 {
17122
17135
  });
17123
17136
  }
17124
17137
 
17138
+ /**
17139
+ * Updates the active option in the menu.
17140
+ * @param {number} index - Index of the option to make active.
17141
+ */
17142
+ updateActiveOption(index) {
17143
+ if (this.menu) {
17144
+ this.menu.updateActiveOption(index);
17145
+ }
17146
+ }
17147
+
17125
17148
  /**
17126
17149
  * Watch for slot changes and recalculate the menuoptions.
17127
17150
  * @private
@@ -17147,12 +17170,6 @@ class AuroCombobox extends AuroElement$1 {
17147
17170
 
17148
17171
  this.handleMenuOptions();
17149
17172
 
17150
-
17151
- console.warn('make a selection?');
17152
- console.info('this.hasFocus', this.componentHasFocus);
17153
- console.info('this.inputValue', this.inputValue);
17154
- console.info('this.value', this.value);
17155
-
17156
17173
  break;
17157
17174
 
17158
17175
  // Programmatically inject as the slot cannot be carried over to bibtemplate.
@@ -18064,7 +18081,6 @@ class AuroMenu extends AuroElement$1 {
18064
18081
 
18065
18082
  /**
18066
18083
  * Updates the active option state and dispatches events.
18067
- * @private
18068
18084
  * @param {number} index - Index of the option to make active.
18069
18085
  */
18070
18086
  updateActiveOption(index) {
@@ -461,6 +461,7 @@ export class AuroCombobox extends AuroElement {
461
461
  */
462
462
  validate(force?: boolean): void;
463
463
  updated(changedProperties: any): Promise<void>;
464
+ hasValue: boolean;
464
465
  /**
465
466
  * Applies slotted nodes to a target element with a new slot name.
466
467
  * @private
@@ -470,6 +471,11 @@ export class AuroCombobox extends AuroElement {
470
471
  * @returns {void}
471
472
  */
472
473
  private transportAssignedNodes;
474
+ /**
475
+ * Updates the active option in the menu.
476
+ * @param {number} index - Index of the option to make active.
477
+ */
478
+ updateActiveOption(index: number): void;
473
479
  /**
474
480
  * Watch for slot changes and recalculate the menuoptions.
475
481
  * @private
@@ -16501,6 +16501,10 @@ class AuroCombobox extends AuroElement {
16501
16501
  this.generateOptionsArray();
16502
16502
  this.availableOptions = [];
16503
16503
  this.updateFilter();
16504
+
16505
+ if (this.value && this.input.value && !this.menu.value) {
16506
+ this.menu.value = this.value;
16507
+ }
16504
16508
  }
16505
16509
 
16506
16510
  /**
@@ -16972,6 +16976,15 @@ class AuroCombobox extends AuroElement {
16972
16976
  async updated(changedProperties) {
16973
16977
  // After the component is ready, send direct value changes to auro-menu.
16974
16978
  if (changedProperties.has('value')) {
16979
+ if (this.value && this.value.length > 0) {
16980
+ this.hasValue = true;
16981
+ } else {
16982
+ this.hasValue = false;
16983
+ }
16984
+
16985
+ if (this.hasValue && !this.input.value && (!this.menu.availableOptions || this.menu.availableOptions.length === 0)) {
16986
+ this.input.value = this.value;
16987
+ }
16975
16988
 
16976
16989
  if (this.value) {
16977
16990
  // If the value got set programmatically make sure we hide the bib
@@ -17040,6 +17053,16 @@ class AuroCombobox extends AuroElement {
17040
17053
  });
17041
17054
  }
17042
17055
 
17056
+ /**
17057
+ * Updates the active option in the menu.
17058
+ * @param {number} index - Index of the option to make active.
17059
+ */
17060
+ updateActiveOption(index) {
17061
+ if (this.menu) {
17062
+ this.menu.updateActiveOption(index);
17063
+ }
17064
+ }
17065
+
17043
17066
  /**
17044
17067
  * Watch for slot changes and recalculate the menuoptions.
17045
17068
  * @private
@@ -17065,12 +17088,6 @@ class AuroCombobox extends AuroElement {
17065
17088
 
17066
17089
  this.handleMenuOptions();
17067
17090
 
17068
-
17069
- console.warn('make a selection?');
17070
- console.info('this.hasFocus', this.componentHasFocus);
17071
- console.info('this.inputValue', this.inputValue);
17072
- console.info('this.value', this.value);
17073
-
17074
17091
  break;
17075
17092
 
17076
17093
  // Programmatically inject as the slot cannot be carried over to bibtemplate.
@@ -16501,6 +16501,10 @@ class AuroCombobox extends AuroElement {
16501
16501
  this.generateOptionsArray();
16502
16502
  this.availableOptions = [];
16503
16503
  this.updateFilter();
16504
+
16505
+ if (this.value && this.input.value && !this.menu.value) {
16506
+ this.menu.value = this.value;
16507
+ }
16504
16508
  }
16505
16509
 
16506
16510
  /**
@@ -16972,6 +16976,15 @@ class AuroCombobox extends AuroElement {
16972
16976
  async updated(changedProperties) {
16973
16977
  // After the component is ready, send direct value changes to auro-menu.
16974
16978
  if (changedProperties.has('value')) {
16979
+ if (this.value && this.value.length > 0) {
16980
+ this.hasValue = true;
16981
+ } else {
16982
+ this.hasValue = false;
16983
+ }
16984
+
16985
+ if (this.hasValue && !this.input.value && (!this.menu.availableOptions || this.menu.availableOptions.length === 0)) {
16986
+ this.input.value = this.value;
16987
+ }
16975
16988
 
16976
16989
  if (this.value) {
16977
16990
  // If the value got set programmatically make sure we hide the bib
@@ -17040,6 +17053,16 @@ class AuroCombobox extends AuroElement {
17040
17053
  });
17041
17054
  }
17042
17055
 
17056
+ /**
17057
+ * Updates the active option in the menu.
17058
+ * @param {number} index - Index of the option to make active.
17059
+ */
17060
+ updateActiveOption(index) {
17061
+ if (this.menu) {
17062
+ this.menu.updateActiveOption(index);
17063
+ }
17064
+ }
17065
+
17043
17066
  /**
17044
17067
  * Watch for slot changes and recalculate the menuoptions.
17045
17068
  * @private
@@ -17065,12 +17088,6 @@ class AuroCombobox extends AuroElement {
17065
17088
 
17066
17089
  this.handleMenuOptions();
17067
17090
 
17068
-
17069
- console.warn('make a selection?');
17070
- console.info('this.hasFocus', this.componentHasFocus);
17071
- console.info('this.inputValue', this.inputValue);
17072
- console.info('this.value', this.value);
17073
-
17074
17091
  break;
17075
17092
 
17076
17093
  // Programmatically inject as the slot cannot be carried over to bibtemplate.
@@ -57,10 +57,15 @@ The `<auro-input>` element should be used in situations where users may:
57
57
  <div class="exampleWrapper--ondark">
58
58
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/snowflake/basic.html) -->
59
59
  <!-- The below content is automatically added from ./../apiExamples/snowflake/basic.html -->
60
- <auro-input id="snowflakePill" layout="snowflake" shape="snowflake" size="lg" placeholder="Departure" style="width: 249px;" ondark required>
60
+ <auro-input dvInputOnly value="lax" id="snowflakePill" layout="snowflake" shape="snowflake" size="lg" placeholder="Departure" style="width: 249px;" ondark required>
61
61
  <span slot="ariaLabel.clear">Clear All</span>
62
62
  <label slot="label">From</label>
63
63
  <span slot="helpText">Example help text</span>
64
+ <span slot="displayValue">
65
+ <div>
66
+ <div class="subText">Los Angeles</div>
67
+ </div>
68
+ </span>
64
69
  </auro-input>
65
70
  <!-- AURO-GENERATED-CONTENT:END -->
66
71
  </div>
@@ -22,9 +22,10 @@ The auro-menu element provides users a way to select from a list of options.
22
22
 
23
23
  ## Methods
24
24
 
25
- | Method | Type | Description |
26
- |---------|------------|--------------------------------------------------|
27
- | [reset](#reset) | `(): void` | Resets the menu to its initial state.<br />This is the only way to return value to undefined. |
25
+ | Method | Type | Description |
26
+ |----------------------|-------------------------|--------------------------------------------------|
27
+ | [reset](#reset) | `(): void` | Resets the menu to its initial state.<br />This is the only way to return value to undefined. |
28
+ | [updateActiveOption](#updateActiveOption) | `(index: number): void` | Updates the active option state and dispatches events.<br /><br />**index**: Index of the option to make active. |
28
29
 
29
30
  ## Events
30
31
 
@@ -1026,7 +1026,6 @@ class AuroMenu extends AuroElement$1 {
1026
1026
 
1027
1027
  /**
1028
1028
  * Updates the active option state and dispatches events.
1029
- * @private
1030
1029
  * @param {number} index - Index of the option to make active.
1031
1030
  */
1032
1031
  updateActiveOption(index) {
@@ -986,7 +986,6 @@ class AuroMenu extends AuroElement$1 {
986
986
 
987
987
  /**
988
988
  * Updates the active option state and dispatches events.
989
- * @private
990
989
  * @param {number} index - Index of the option to make active.
991
990
  */
992
991
  updateActiveOption(index) {
@@ -204,10 +204,9 @@ export class AuroMenu extends AuroElement {
204
204
  private navigateOptions;
205
205
  /**
206
206
  * Updates the active option state and dispatches events.
207
- * @private
208
207
  * @param {number} index - Index of the option to make active.
209
208
  */
210
- private updateActiveOption;
209
+ updateActiveOption(index: number): void;
211
210
  /**
212
211
  * Handles custom events defined on options.
213
212
  * @private
@@ -993,7 +993,6 @@ class AuroMenu extends AuroElement$1 {
993
993
 
994
994
  /**
995
995
  * Updates the active option state and dispatches events.
996
- * @private
997
996
  * @param {number} index - Index of the option to make active.
998
997
  */
999
998
  updateActiveOption(index) {
@@ -952,7 +952,6 @@ class AuroMenu extends AuroElement$1 {
952
952
 
953
953
  /**
954
954
  * Updates the active option state and dispatches events.
955
- * @private
956
955
  * @param {number} index - Index of the option to make active.
957
956
  */
958
957
  updateActiveOption(index) {
@@ -9840,7 +9840,6 @@ class AuroMenu extends AuroElement$4 {
9840
9840
 
9841
9841
  /**
9842
9842
  * Updates the active option state and dispatches events.
9843
- * @private
9844
9843
  * @param {number} index - Index of the option to make active.
9845
9844
  */
9846
9845
  updateActiveOption(index) {
@@ -9748,7 +9748,6 @@ class AuroMenu extends AuroElement$4 {
9748
9748
 
9749
9749
  /**
9750
9750
  * Updates the active option state and dispatches events.
9751
- * @private
9752
9751
  * @param {number} index - Index of the option to make active.
9753
9752
  */
9754
9753
  updateActiveOption(index) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem-dev/auro-formkit",
3
- "version": "0.0.0-pr1052.1",
3
+ "version": "0.0.0-pr1052.3",
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": {