@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.50 → 0.0.0-pr624.52

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.
Files changed (52) hide show
  1. package/components/bibtemplate/dist/index.js +1 -1
  2. package/components/bibtemplate/dist/registered.js +1 -1
  3. package/components/checkbox/demo/api.min.js +5 -5
  4. package/components/checkbox/demo/index.min.js +5 -5
  5. package/components/checkbox/dist/index.js +5 -5
  6. package/components/checkbox/dist/registered.js +5 -5
  7. package/components/combobox/demo/api.min.js +69 -86
  8. package/components/combobox/demo/index.min.js +69 -86
  9. package/components/combobox/dist/index.js +33 -75
  10. package/components/combobox/dist/registered.js +33 -75
  11. package/components/counter/demo/api.md +127 -0
  12. package/components/counter/demo/api.min.js +548 -385
  13. package/components/counter/demo/index.md +82 -0
  14. package/components/counter/demo/index.min.js +548 -385
  15. package/components/counter/dist/auro-counter-group.d.ts +70 -13
  16. package/components/counter/dist/auro-counter.d.ts +10 -0
  17. package/components/counter/dist/index.js +548 -385
  18. package/components/counter/dist/registered.js +548 -385
  19. package/components/datepicker/demo/api.min.js +54 -81
  20. package/components/datepicker/demo/index.min.js +54 -81
  21. package/components/datepicker/dist/auro-datepicker.d.ts +6 -0
  22. package/components/datepicker/dist/index.js +54 -81
  23. package/components/datepicker/dist/registered.js +54 -81
  24. package/components/dropdown/demo/api.md +59 -265
  25. package/components/dropdown/demo/api.min.js +22 -64
  26. package/components/dropdown/demo/index.md +45 -363
  27. package/components/dropdown/demo/index.min.js +22 -64
  28. package/components/dropdown/dist/auro-dropdown.d.ts +21 -71
  29. package/components/dropdown/dist/index.js +22 -64
  30. package/components/dropdown/dist/registered.js +22 -64
  31. package/components/input/demo/api.min.js +5 -5
  32. package/components/input/demo/index.min.js +5 -5
  33. package/components/input/dist/index.js +5 -5
  34. package/components/input/dist/registered.js +5 -5
  35. package/components/menu/demo/api.md +1 -1
  36. package/components/menu/demo/api.min.js +36 -11
  37. package/components/menu/demo/index.min.js +36 -11
  38. package/components/menu/dist/auro-menu.d.ts +13 -2
  39. package/components/menu/dist/index.js +36 -11
  40. package/components/menu/dist/registered.js +36 -11
  41. package/components/radio/demo/api.min.js +6 -6
  42. package/components/radio/demo/index.min.js +6 -6
  43. package/components/radio/dist/auro-radio.d.ts +1 -1
  44. package/components/radio/dist/index.js +6 -6
  45. package/components/radio/dist/registered.js +6 -6
  46. package/components/select/demo/api.md +2 -2
  47. package/components/select/demo/api.min.js +94 -164
  48. package/components/select/demo/index.min.js +94 -164
  49. package/components/select/dist/auro-select.d.ts +13 -3
  50. package/components/select/dist/index.js +58 -153
  51. package/components/select/dist/registered.js +58 -153
  52. package/package.json +1 -1
@@ -3457,10 +3457,8 @@ class AuroElement extends LitElement {
3457
3457
  // See LICENSE in the project root for license information.
3458
3458
 
3459
3459
 
3460
- /**
3461
- * @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
3460
+ /*
3462
3461
  * @slot - Default slot for the popover content.
3463
- * @slot label - Defines the content of the label.
3464
3462
  * @slot helpText - Defines the content of the helpText.
3465
3463
  * @slot trigger - Defines the content of the trigger.
3466
3464
  * @csspart trigger - The trigger content container.
@@ -3479,18 +3477,22 @@ class AuroDropdown extends AuroElement {
3479
3477
  this.matchWidth = false;
3480
3478
  this.noHideOnThisFocusLoss = false;
3481
3479
 
3482
- this.errorMessage = ''; // TODO - check with Doug if there is still more to do here
3480
+ this.errorMessage = undefined; // TODO - check with Doug if there is still more to do here
3483
3481
 
3484
3482
  // Layout Config
3485
- this.layout = 'classic';
3486
- this.shape = 'classic';
3487
- this.size = 'xl';
3483
+ this.layout = undefined;
3484
+ this.shape = undefined;
3485
+ this.size = undefined;
3488
3486
 
3489
3487
  this.parentBorder = false;
3490
3488
 
3491
3489
  this.privateDefaults();
3492
3490
  }
3493
3491
 
3492
+ /**
3493
+ * @private
3494
+ * @returns {object} Class definition for the wrapper element.
3495
+ */
3494
3496
  get commonWrapperClasses() {
3495
3497
  return {
3496
3498
  'trigger': true,
@@ -3510,12 +3512,8 @@ class AuroDropdown extends AuroElement {
3510
3512
  this.disabled = false;
3511
3513
  this.disableFocusTrap = false;
3512
3514
  this.error = false;
3513
- this.inset = false;
3514
- this.rounded = false;
3515
3515
  this.tabIndex = 0;
3516
3516
  this.noToggle = false;
3517
- this.a11yAutocomplete = 'none';
3518
- this.labeled = true;
3519
3517
  this.a11yRole = 'button';
3520
3518
  this.onDark = false;
3521
3519
  this.showTriggerBorders = true;
@@ -3637,26 +3635,27 @@ class AuroDropdown extends AuroElement {
3637
3635
  },
3638
3636
 
3639
3637
  /**
3640
- * If declared, applies a border around the trigger slot.
3638
+ * If declared, the dropdown will only show by calling the API .show() public method.
3639
+ * @default false
3641
3640
  */
3642
- simple: {
3641
+ disableEventShow: {
3643
3642
  type: Boolean,
3644
3643
  reflect: true
3645
3644
  },
3646
3645
 
3647
3646
  /**
3648
- * If declared, the dropdown displays a chevron on the right.
3649
- * @attr {Boolean} chevron
3647
+ * If declared, applies a border around the trigger slot.
3650
3648
  */
3651
- chevron: {
3649
+ simple: {
3652
3650
  type: Boolean,
3653
3651
  reflect: true
3654
3652
  },
3655
3653
 
3656
3654
  /**
3657
- * If declared, the dropdown will be styled with the common theme.
3655
+ * If declared, the dropdown displays a chevron on the right.
3656
+ * @attr {Boolean} chevron
3658
3657
  */
3659
- common: {
3658
+ chevron: {
3660
3659
  type: Boolean,
3661
3660
  reflect: true
3662
3661
  },
@@ -3670,7 +3669,7 @@ class AuroDropdown extends AuroElement {
3670
3669
  },
3671
3670
 
3672
3671
  /**
3673
- * If declare, the focus trap inside of bib will be turned off.
3672
+ * If declared, the focus trap inside of bib will be turned off.
3674
3673
  */
3675
3674
  disableFocusTrap: {
3676
3675
  type: Boolean,
@@ -3717,22 +3716,6 @@ class AuroDropdown extends AuroElement {
3717
3716
  reflect: true
3718
3717
  },
3719
3718
 
3720
- /**
3721
- * Makes the trigger to be full width of its parent container.
3722
- */
3723
- fluid: {
3724
- type: Boolean,
3725
- reflect: true
3726
- },
3727
-
3728
- /**
3729
- * If declared, will apply padding around trigger slot content.
3730
- */
3731
- inset: {
3732
- type: Boolean,
3733
- reflect: true
3734
- },
3735
-
3736
3719
  /**
3737
3720
  * If true, the dropdown bib is displayed.
3738
3721
  */
@@ -3776,15 +3759,6 @@ class AuroDropdown extends AuroElement {
3776
3759
  reflect: true
3777
3760
  },
3778
3761
 
3779
- /**
3780
- * Defines if there is a label preset.
3781
- * @private
3782
- */
3783
- labeled: {
3784
- type: Boolean,
3785
- reflect: true
3786
- },
3787
-
3788
3762
  /**
3789
3763
  * Defines if the trigger should size based on the parent element providing the border UI.
3790
3764
  * @private
@@ -3845,6 +3819,9 @@ class AuroDropdown extends AuroElement {
3845
3819
  reflect: true
3846
3820
  },
3847
3821
 
3822
+ /**
3823
+ * If declared, and a function is set, that function will execute when the slot content is updated.
3824
+ */
3848
3825
  onSlotChange: {
3849
3826
  type: Function,
3850
3827
  reflect: false
@@ -3859,14 +3836,6 @@ class AuroDropdown extends AuroElement {
3859
3836
  reflect: true
3860
3837
  },
3861
3838
 
3862
- /**
3863
- * If declared, will apply border-radius to trigger and default slots.
3864
- */
3865
- rounded: {
3866
- type: Boolean,
3867
- reflect: true
3868
- },
3869
-
3870
3839
  /**
3871
3840
  * @private
3872
3841
  */
@@ -3881,14 +3850,6 @@ class AuroDropdown extends AuroElement {
3881
3850
  type: String || undefined,
3882
3851
  attribute: false,
3883
3852
  reflect: false
3884
- },
3885
-
3886
- /**
3887
- * The value for the aria-autocomplete attribute of the trigger element.
3888
- */
3889
- a11yAutocomplete: {
3890
- type: String,
3891
- attribute: false,
3892
3853
  }
3893
3854
  };
3894
3855
  }
@@ -4336,10 +4297,7 @@ class AuroDropdown extends AuroElement {
4336
4297
  id="bib"
4337
4298
  shape="${this.shape}"
4338
4299
  ?data-show="${this.isPopoverVisible}"
4339
- ?isfullscreen="${this.isBibFullscreen}"
4340
- ?common="${this.common}"
4341
- ?rounded="${this.common || this.rounded}"
4342
- ?inset="${this.common || this.inset}">
4300
+ ?isfullscreen="${this.isBibFullscreen}">
4343
4301
  <div class="slotContent">
4344
4302
  <slot @slotchange="${this.handleDefaultSlot}"></slot>
4345
4303
  </div>
@@ -4688,19 +4688,19 @@ class AuroFormValidation {
4688
4688
  {
4689
4689
  check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
4690
4690
  validity: 'tooShort',
4691
- message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
4691
+ message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
4692
4692
  },
4693
4693
  {
4694
4694
  check: (e) => e.value?.length > e.maxLength,
4695
4695
  validity: 'tooLong',
4696
- message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
4696
+ message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
4697
4697
  }
4698
4698
  ],
4699
4699
  pattern: [
4700
4700
  {
4701
4701
  check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
4702
4702
  validity: 'patternMismatch',
4703
- message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
4703
+ message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
4704
4704
  }
4705
4705
  ]
4706
4706
  },
@@ -4895,10 +4895,10 @@ class AuroFormValidation {
4895
4895
  if (!hasValue && elem.required && elem.touched) {
4896
4896
  elem.validity = 'valueMissing';
4897
4897
  elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
4898
- } else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
4898
+ } else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
4899
4899
  this.validateType(elem);
4900
4900
  this.validateElementAttributes(elem);
4901
- } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
4901
+ } else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
4902
4902
  this.validateElementAttributes(elem);
4903
4903
  }
4904
4904
  }
@@ -4613,19 +4613,19 @@ class AuroFormValidation {
4613
4613
  {
4614
4614
  check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
4615
4615
  validity: 'tooShort',
4616
- message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
4616
+ message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
4617
4617
  },
4618
4618
  {
4619
4619
  check: (e) => e.value?.length > e.maxLength,
4620
4620
  validity: 'tooLong',
4621
- message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
4621
+ message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
4622
4622
  }
4623
4623
  ],
4624
4624
  pattern: [
4625
4625
  {
4626
4626
  check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
4627
4627
  validity: 'patternMismatch',
4628
- message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
4628
+ message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
4629
4629
  }
4630
4630
  ]
4631
4631
  },
@@ -4820,10 +4820,10 @@ class AuroFormValidation {
4820
4820
  if (!hasValue && elem.required && elem.touched) {
4821
4821
  elem.validity = 'valueMissing';
4822
4822
  elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
4823
- } else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
4823
+ } else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
4824
4824
  this.validateType(elem);
4825
4825
  this.validateElementAttributes(elem);
4826
- } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
4826
+ } else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
4827
4827
  this.validateElementAttributes(elem);
4828
4828
  }
4829
4829
  }
@@ -4537,19 +4537,19 @@ class AuroFormValidation {
4537
4537
  {
4538
4538
  check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
4539
4539
  validity: 'tooShort',
4540
- message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
4540
+ message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
4541
4541
  },
4542
4542
  {
4543
4543
  check: (e) => e.value?.length > e.maxLength,
4544
4544
  validity: 'tooLong',
4545
- message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
4545
+ message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
4546
4546
  }
4547
4547
  ],
4548
4548
  pattern: [
4549
4549
  {
4550
4550
  check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
4551
4551
  validity: 'patternMismatch',
4552
- message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
4552
+ message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
4553
4553
  }
4554
4554
  ]
4555
4555
  },
@@ -4744,10 +4744,10 @@ class AuroFormValidation {
4744
4744
  if (!hasValue && elem.required && elem.touched) {
4745
4745
  elem.validity = 'valueMissing';
4746
4746
  elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
4747
- } else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
4747
+ } else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
4748
4748
  this.validateType(elem);
4749
4749
  this.validateElementAttributes(elem);
4750
- } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
4750
+ } else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
4751
4751
  this.validateElementAttributes(elem);
4752
4752
  }
4753
4753
  }
@@ -4537,19 +4537,19 @@ class AuroFormValidation {
4537
4537
  {
4538
4538
  check: (e) => e.value?.length > 0 && e.value?.length < e.minLength,
4539
4539
  validity: 'tooShort',
4540
- message: e => e.setCustomValidityTooShort || e.setCustomValidity || ''
4540
+ message: e => e.getAttribute('setCustomValidityTooShort') || e.setCustomValidity || ''
4541
4541
  },
4542
4542
  {
4543
4543
  check: (e) => e.value?.length > e.maxLength,
4544
4544
  validity: 'tooLong',
4545
- message: e => e.setCustomValidityTooLong || e.setCustomValidity || ''
4545
+ message: e => e.getAttribute('setCustomValidityTooLong') || e.setCustomValidity || ''
4546
4546
  }
4547
4547
  ],
4548
4548
  pattern: [
4549
4549
  {
4550
4550
  check: (e) => e.pattern && !new RegExp(`^${e.pattern}$`, 'u').test(e.value),
4551
4551
  validity: 'patternMismatch',
4552
- message: e => e.setCustomValidityPatternMismatch || e.setCustomValidity || ''
4552
+ message: e => e.getAttribute('setCustomValidityPatternMismatch') || e.setCustomValidity || ''
4553
4553
  }
4554
4554
  ]
4555
4555
  },
@@ -4744,10 +4744,10 @@ class AuroFormValidation {
4744
4744
  if (!hasValue && elem.required && elem.touched) {
4745
4745
  elem.validity = 'valueMissing';
4746
4746
  elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
4747
- } else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
4747
+ } else if (hasValue && this.runtimeUtils.elementMatch(elem, 'auro-input')) {
4748
4748
  this.validateType(elem);
4749
4749
  this.validateElementAttributes(elem);
4750
- } else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
4750
+ } else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
4751
4751
  this.validateElementAttributes(elem);
4752
4752
  }
4753
4753
  }
@@ -20,7 +20,7 @@ The auro-menu element provides users a way to select from a list of options.
20
20
  | [optionSelected](#optionSelected) | `optionSelected` | `HTMLElement\|Array<HTMLElement>` | "undefined" | An array of currently selected menu options, type `HTMLElement` by default. In multi-select mode, `optionSelected` is an array of HTML elements. |
21
21
  | [shape](#shape) | | `string` | "" | |
22
22
  | [size](#size) | | `string` | "" | |
23
- | [value](#value) | `value` | `String\|Array<string>` | "undefined" | Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings. |
23
+ | [value](#value) | `value` | `string` | "undefined" | Value selected for the component. |
24
24
 
25
25
  ## Methods
26
26
 
@@ -286,7 +286,6 @@ function dispatchMenuEvent(element, eventName, detail = null) {
286
286
  * @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
287
287
  * @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
288
288
  * @attr {boolean} multiselect - When true, the selected option can be multiple options.
289
- * @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
290
289
  * @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
291
290
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
292
291
  * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
@@ -399,9 +398,14 @@ class AuroMenu extends AuroElement$1 {
399
398
  reflect: true,
400
399
  attribute: 'multiselect'
401
400
  },
401
+
402
+ /**
403
+ * Value selected for the component.
404
+ */
402
405
  value: {
403
- // Allow string, string[] arrays and undefined
404
- type: Object
406
+ type: String,
407
+ reflect: true,
408
+ attribute: 'value'
405
409
  },
406
410
 
407
411
  /**
@@ -436,6 +440,25 @@ class AuroMenu extends AuroElement$1 {
436
440
  AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroMenu);
437
441
  }
438
442
 
443
+ /**
444
+ * Formatted value based on `multiSelect` state.
445
+ * Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
446
+ * @private
447
+ * @returns {String|Array<String>}
448
+ */
449
+ get formattedValue() {
450
+ if (this.multiSelect) {
451
+ if (!this.value) {
452
+ return undefined;
453
+ }
454
+ if (this.value.startsWith("[")) {
455
+ return JSON.parse(this.value);
456
+ }
457
+ return [this.value];
458
+ }
459
+ return this.value;
460
+ }
461
+
439
462
  // Lifecycle Methods
440
463
 
441
464
  connectedCallback() {
@@ -478,7 +501,7 @@ class AuroMenu extends AuroElement$1 {
478
501
  updated(changedProperties) {
479
502
  super.updated(changedProperties);
480
503
 
481
- if (changedProperties.has('multiSelect')) {
504
+ if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
482
505
  // Reset selection if multiSelect mode changes
483
506
  this.clearSelection();
484
507
  }
@@ -492,7 +515,7 @@ class AuroMenu extends AuroElement$1 {
492
515
  } else {
493
516
  if (this.multiSelect) {
494
517
  // In multiselect mode, this.value should be an array of strings
495
- const valueArray = Array.isArray(this.value) ? this.value : [this.value];
518
+ const valueArray = this.formattedValue;
496
519
  const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
497
520
 
498
521
  this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
@@ -659,14 +682,14 @@ class AuroMenu extends AuroElement$1 {
659
682
  */
660
683
  handleSelectState(option) {
661
684
  if (this.multiSelect) {
662
- const currentValue = this.value || [];
685
+ const currentValue = this.formattedValue || [];
663
686
  const currentSelected = this.optionSelected || [];
664
687
 
665
688
  if (!currentValue.includes(option.value)) {
666
- this.value = [
689
+ this.value = JSON.stringify([
667
690
  ...currentValue,
668
691
  option.value
669
- ];
692
+ ]);
670
693
  }
671
694
  if (!currentSelected.includes(option)) {
672
695
  this.optionSelected = [
@@ -689,13 +712,15 @@ class AuroMenu extends AuroElement$1 {
689
712
  * @param {HTMLElement} option - The menuoption to be deselected.
690
713
  */
691
714
  handleDeselectState(option) {
692
- if (this.multiSelect && Array.isArray(this.value)) {
715
+ if (this.multiSelect) {
693
716
  // Remove this option from array
694
- this.value = this.value.filter((val) => val !== option.value);
717
+ const newFormattedValue = (this.formattedValue || []).filter((val) => val !== option.value);
695
718
 
696
719
  // If array is empty after removal, set back to undefined
697
- if (this.value.length === 0) {
720
+ if (newFormattedValue && newFormattedValue.length === 0) {
698
721
  this.value = undefined;
722
+ } else {
723
+ this.value = JSON.stringify(newFormattedValue);
699
724
  }
700
725
 
701
726
  this.optionSelected = this.optionSelected.filter((val) => val !== option);
@@ -246,7 +246,6 @@ function dispatchMenuEvent(element, eventName, detail = null) {
246
246
  * @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
247
247
  * @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
248
248
  * @attr {boolean} multiselect - When true, the selected option can be multiple options.
249
- * @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
250
249
  * @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
251
250
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
252
251
  * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
@@ -359,9 +358,14 @@ class AuroMenu extends AuroElement$1 {
359
358
  reflect: true,
360
359
  attribute: 'multiselect'
361
360
  },
361
+
362
+ /**
363
+ * Value selected for the component.
364
+ */
362
365
  value: {
363
- // Allow string, string[] arrays and undefined
364
- type: Object
366
+ type: String,
367
+ reflect: true,
368
+ attribute: 'value'
365
369
  },
366
370
 
367
371
  /**
@@ -396,6 +400,25 @@ class AuroMenu extends AuroElement$1 {
396
400
  AuroLibraryRuntimeUtils$1.prototype.registerComponent(name, AuroMenu);
397
401
  }
398
402
 
403
+ /**
404
+ * Formatted value based on `multiSelect` state.
405
+ * Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
406
+ * @private
407
+ * @returns {String|Array<String>}
408
+ */
409
+ get formattedValue() {
410
+ if (this.multiSelect) {
411
+ if (!this.value) {
412
+ return undefined;
413
+ }
414
+ if (this.value.startsWith("[")) {
415
+ return JSON.parse(this.value);
416
+ }
417
+ return [this.value];
418
+ }
419
+ return this.value;
420
+ }
421
+
399
422
  // Lifecycle Methods
400
423
 
401
424
  connectedCallback() {
@@ -438,7 +461,7 @@ class AuroMenu extends AuroElement$1 {
438
461
  updated(changedProperties) {
439
462
  super.updated(changedProperties);
440
463
 
441
- if (changedProperties.has('multiSelect')) {
464
+ if (changedProperties.has('multiSelect') && !changedProperties.has("value")) {
442
465
  // Reset selection if multiSelect mode changes
443
466
  this.clearSelection();
444
467
  }
@@ -452,7 +475,7 @@ class AuroMenu extends AuroElement$1 {
452
475
  } else {
453
476
  if (this.multiSelect) {
454
477
  // In multiselect mode, this.value should be an array of strings
455
- const valueArray = Array.isArray(this.value) ? this.value : [this.value];
478
+ const valueArray = this.formattedValue;
456
479
  const matchingOptions = this.items.filter((item) => valueArray.includes(item.value));
457
480
 
458
481
  this.optionSelected = matchingOptions.length > 0 ? matchingOptions : undefined;
@@ -619,14 +642,14 @@ class AuroMenu extends AuroElement$1 {
619
642
  */
620
643
  handleSelectState(option) {
621
644
  if (this.multiSelect) {
622
- const currentValue = this.value || [];
645
+ const currentValue = this.formattedValue || [];
623
646
  const currentSelected = this.optionSelected || [];
624
647
 
625
648
  if (!currentValue.includes(option.value)) {
626
- this.value = [
649
+ this.value = JSON.stringify([
627
650
  ...currentValue,
628
651
  option.value
629
- ];
652
+ ]);
630
653
  }
631
654
  if (!currentSelected.includes(option)) {
632
655
  this.optionSelected = [
@@ -649,13 +672,15 @@ class AuroMenu extends AuroElement$1 {
649
672
  * @param {HTMLElement} option - The menuoption to be deselected.
650
673
  */
651
674
  handleDeselectState(option) {
652
- if (this.multiSelect && Array.isArray(this.value)) {
675
+ if (this.multiSelect) {
653
676
  // Remove this option from array
654
- this.value = this.value.filter((val) => val !== option.value);
677
+ const newFormattedValue = (this.formattedValue || []).filter((val) => val !== option.value);
655
678
 
656
679
  // If array is empty after removal, set back to undefined
657
- if (this.value.length === 0) {
680
+ if (newFormattedValue && newFormattedValue.length === 0) {
658
681
  this.value = undefined;
682
+ } else {
683
+ this.value = JSON.stringify(newFormattedValue);
659
684
  }
660
685
 
661
686
  this.optionSelected = this.optionSelected.filter((val) => val !== option);
@@ -7,7 +7,6 @@
7
7
  * @attr {boolean} nocheckmark - When true, selected option will not show the checkmark.
8
8
  * @attr {boolean} loading - When true, displays a loading state using the loadingIcon and loadingText slots if provided.
9
9
  * @attr {boolean} multiselect - When true, the selected option can be multiple options.
10
- * @attr {String|Array<string>} value - Value selected for the menu, type `string` by default. In multi-select mode, `value` is an array of strings.
11
10
  * @prop {boolean} hasLoadingPlaceholder - Indicates whether the menu has a loadingIcon or loadingText to render when in a loading state.
12
11
  * @event {CustomEvent<Element>} auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
13
12
  * @event {CustomEvent<any>} auroMenu-customEventFired - Notifies that a custom event has been fired.
@@ -50,8 +49,13 @@ export class AuroMenu extends AuroElement {
50
49
  reflect: boolean;
51
50
  attribute: string;
52
51
  };
52
+ /**
53
+ * Value selected for the component.
54
+ */
53
55
  value: {
54
- type: ObjectConstructor;
56
+ type: StringConstructor;
57
+ reflect: boolean;
58
+ attribute: string;
55
59
  };
56
60
  /**
57
61
  * Indent level for submenus.
@@ -110,6 +114,13 @@ export class AuroMenu extends AuroElement {
110
114
  * @private
111
115
  */
112
116
  private handleSlotChange;
117
+ /**
118
+ * Formatted value based on `multiSelect` state.
119
+ * Default type is `String`, changing to `Array<String>` when `multiSelect` is true.
120
+ * @private
121
+ * @returns {String|Array<String>}
122
+ */
123
+ private get formattedValue();
113
124
  firstUpdated(): void;
114
125
  loadingSlots: NodeListOf<Element>;
115
126
  /**