@abgov/web-components 1.15.0 → 1.16.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.
@@ -343,14 +343,6 @@ function get_current_component() {
343
343
  function onMount(fn) {
344
344
  get_current_component().$$.on_mount.push(fn);
345
345
  }
346
- /**
347
- * Schedules a callback to run immediately after the component has been updated.
348
- *
349
- * The first time the callback runs will be after the initial `onMount`
350
- */
351
- function afterUpdate(fn) {
352
- get_current_component().$$.after_update.push(fn);
353
- }
354
346
  /**
355
347
  * Schedules a callback to run immediately before the component is unmounted.
356
348
  *
@@ -1657,7 +1649,7 @@ function create_if_block_6$1(ctx) {
1657
1649
  }
1658
1650
 
1659
1651
  // (109:4) {#if _showToggleMenu && _mobile}
1660
- function create_if_block_4$5(ctx) {
1652
+ function create_if_block_4$4(ctx) {
1661
1653
  let button;
1662
1654
  let t;
1663
1655
  let goa_icon;
@@ -1709,7 +1701,7 @@ function create_if_block_2$e(ctx) {
1709
1701
  let t1;
1710
1702
  let mounted;
1711
1703
  let dispose;
1712
- let if_block = /*_showMenu*/ ctx[8] && create_if_block_3$c(ctx);
1704
+ let if_block = /*_showMenu*/ ctx[8] && create_if_block_3$b(ctx);
1713
1705
 
1714
1706
  return {
1715
1707
  c() {
@@ -1762,7 +1754,7 @@ function create_if_block_2$e(ctx) {
1762
1754
  if (if_block) {
1763
1755
  if_block.p(ctx, dirty);
1764
1756
  } else {
1765
- if_block = create_if_block_3$c(ctx);
1757
+ if_block = create_if_block_3$b(ctx);
1766
1758
  if_block.c();
1767
1759
  if_block.m(goa_popover, null);
1768
1760
  }
@@ -1785,7 +1777,7 @@ function create_if_block_2$e(ctx) {
1785
1777
  }
1786
1778
 
1787
1779
  // (135:8) {#if _showMenu}
1788
- function create_if_block_3$c(ctx) {
1780
+ function create_if_block_3$b(ctx) {
1789
1781
  let div;
1790
1782
 
1791
1783
  return {
@@ -1870,7 +1862,7 @@ function create_fragment$_(ctx) {
1870
1862
 
1871
1863
  let current_block_type = select_block_type(ctx);
1872
1864
  let if_block0 = current_block_type(ctx);
1873
- let if_block1 = /*_showToggleMenu*/ ctx[7] && /*_mobile*/ ctx[10] && create_if_block_4$5(ctx);
1865
+ let if_block1 = /*_showToggleMenu*/ ctx[7] && /*_mobile*/ ctx[10] && create_if_block_4$4(ctx);
1874
1866
  let if_block2 = /*_showToggleMenu*/ ctx[7] && /*_tablet*/ ctx[9] && create_if_block_2$e(ctx);
1875
1867
  let if_block3 = !/*_showMenu*/ ctx[8] && (/*_mobile*/ ctx[10] || /*_tablet*/ ctx[9]) && create_if_block_1$i(ctx);
1876
1868
  let if_block4 = (/*_showMenu*/ ctx[8] && /*_mobile*/ ctx[10] || /*_desktop*/ ctx[5]) && create_if_block$v(ctx);
@@ -1930,7 +1922,7 @@ function create_fragment$_(ctx) {
1930
1922
  if (if_block1) {
1931
1923
  if_block1.p(ctx, dirty);
1932
1924
  } else {
1933
- if_block1 = create_if_block_4$5(ctx);
1925
+ if_block1 = create_if_block_4$4(ctx);
1934
1926
  if_block1.c();
1935
1927
  if_block1.m(div0, t1);
1936
1928
  }
@@ -5355,7 +5347,7 @@ function create_if_block$p(ctx) {
5355
5347
  let if_block;
5356
5348
  let if_block_anchor;
5357
5349
  let current;
5358
- const if_block_creators = [create_if_block_1$d, create_if_block_3$b];
5350
+ const if_block_creators = [create_if_block_1$d, create_if_block_3$a];
5359
5351
  const if_blocks = [];
5360
5352
 
5361
5353
  function select_block_type(ctx, dirty) {
@@ -5437,12 +5429,12 @@ function create_if_block$p(ctx) {
5437
5429
  }
5438
5430
 
5439
5431
  // (43:19)
5440
- function create_if_block_3$b(ctx) {
5432
+ function create_if_block_3$a(ctx) {
5441
5433
  let div;
5442
5434
  let goa_spinner;
5443
5435
  let t;
5444
5436
  let div_class_value;
5445
- let if_block = /*message*/ ctx[0] && create_if_block_4$4(ctx);
5437
+ let if_block = /*message*/ ctx[0] && create_if_block_4$3(ctx);
5446
5438
 
5447
5439
  return {
5448
5440
  c() {
@@ -5474,7 +5466,7 @@ function create_if_block_3$b(ctx) {
5474
5466
  if (if_block) {
5475
5467
  if_block.p(ctx, dirty);
5476
5468
  } else {
5477
- if_block = create_if_block_4$4(ctx);
5469
+ if_block = create_if_block_4$3(ctx);
5478
5470
  if_block.c();
5479
5471
  if_block.m(div, null);
5480
5472
  }
@@ -5586,7 +5578,7 @@ function create_if_block_1$d(ctx) {
5586
5578
  }
5587
5579
 
5588
5580
  // (46:6) {#if message}
5589
- function create_if_block_4$4(ctx) {
5581
+ function create_if_block_4$3(ctx) {
5590
5582
  let div;
5591
5583
  let t;
5592
5584
 
@@ -6461,18 +6453,18 @@ customElements.define("goa-divider", Divider);
6461
6453
 
6462
6454
  function get_each_context_1$1(ctx, list, i) {
6463
6455
  const child_ctx = ctx.slice();
6464
- child_ctx[69] = list[i];
6465
- child_ctx[73] = i;
6456
+ child_ctx[61] = list[i];
6457
+ child_ctx[65] = i;
6466
6458
  return child_ctx;
6467
6459
  }
6468
6460
 
6469
6461
  function get_each_context$8(ctx, list, i) {
6470
6462
  const child_ctx = ctx.slice();
6471
- child_ctx[69] = list[i];
6463
+ child_ctx[61] = list[i];
6472
6464
  return child_ctx;
6473
6465
  }
6474
6466
 
6475
- // (509:2) {:else}
6467
+ // (444:2) {:else}
6476
6468
  function create_else_block$a(ctx) {
6477
6469
  let slot;
6478
6470
  let t0;
@@ -6483,30 +6475,42 @@ function create_else_block$a(ctx) {
6483
6475
  let input_style_value;
6484
6476
  let input_aria_controls_value;
6485
6477
  let input_aria_label_value;
6486
- let input_id_value;
6487
6478
  let input_aria_owns_value;
6488
6479
  let input_readonly_value;
6489
6480
  let t2;
6490
- let t3;
6491
6481
  let div_style_value;
6492
- let t4;
6482
+ let t3;
6493
6483
  let ul;
6484
+ let each_blocks = [];
6485
+ let each_1_lookup = new Map();
6494
6486
  let ul_id_value;
6495
6487
  let ul_aria_label_value;
6496
6488
  let ul_style_value;
6497
6489
  let mounted;
6498
6490
  let dispose;
6499
- let if_block0 = /*leadingicon*/ ctx[4] && create_if_block_4$3(ctx);
6500
- let if_block1 = /*_inputValue*/ ctx[16] && /*_filterable*/ ctx[20] && create_if_block_3$a(ctx);
6501
- let if_block2 = (/*_filterable*/ ctx[20] && /*_inputValue*/ ctx[16].length === 0 || !/*_filterable*/ ctx[20]) && create_if_block_2$a(ctx);
6491
+ let if_block0 = /*leadingicon*/ ctx[4] && create_if_block_2$a(ctx);
6502
6492
 
6503
6493
  function select_block_type_1(ctx, dirty) {
6504
- if (/*_filteredOptions*/ ctx[21].length > 0) return create_if_block_1$c;
6505
- return create_else_block_1;
6494
+ if (/*_inputEl*/ ctx[23]?.value && /*_filterable*/ ctx[24]) return create_if_block_1$c;
6495
+ return create_else_block_2;
6506
6496
  }
6507
6497
 
6508
6498
  let current_block_type = select_block_type_1(ctx);
6509
- let if_block3 = current_block_type(ctx);
6499
+ let if_block1 = current_block_type(ctx);
6500
+ let each_value_1 = /*_filteredOptions*/ ctx[15];
6501
+ const get_key = ctx => /*index*/ ctx[65];
6502
+
6503
+ for (let i = 0; i < each_value_1.length; i += 1) {
6504
+ let child_ctx = get_each_context_1$1(ctx, each_value_1, i);
6505
+ let key = get_key(child_ctx);
6506
+ each_1_lookup.set(key, each_blocks[i] = create_each_block_1$1(key, child_ctx));
6507
+ }
6508
+
6509
+ let each_1_else = null;
6510
+
6511
+ if (!each_value_1.length) {
6512
+ each_1_else = create_else_block_1();
6513
+ }
6510
6514
 
6511
6515
  return {
6512
6516
  c() {
@@ -6518,56 +6522,60 @@ function create_else_block$a(ctx) {
6518
6522
  t1 = space();
6519
6523
  input = element("input");
6520
6524
  t2 = space();
6521
- if (if_block1) if_block1.c();
6525
+ if_block1.c();
6522
6526
  t3 = space();
6523
- if (if_block2) if_block2.c();
6524
- t4 = space();
6525
6527
  ul = element("ul");
6526
- if_block3.c();
6527
6528
 
6528
- attr(input, "style", input_style_value = `cursor: ${!/*_disabled*/ ctx[28]
6529
- ? /*_filterable*/ ctx[20] ? "auto" : "pointer"
6530
- : 'default'}`);
6529
+ for (let i = 0; i < each_blocks.length; i += 1) {
6530
+ each_blocks[i].c();
6531
+ }
6532
+
6533
+ if (each_1_else) {
6534
+ each_1_else.c();
6535
+ }
6531
6536
 
6532
- attr(input, "tabindex", "1");
6537
+ attr(input, "style", input_style_value = `
6538
+ cursor: ${!/*_disabled*/ ctx[26]
6539
+ ? /*_filterable*/ ctx[24] ? "auto" : "pointer"
6540
+ : "default"};
6541
+ `);
6542
+
6543
+ attr(input, "data-testid", "input");
6533
6544
  attr(input, "type", "text");
6534
6545
  attr(input, "role", "combobox");
6535
6546
  attr(input, "autocomplete", "off");
6536
6547
  attr(input, "aria-autocomplete", "list");
6537
- attr(input, "aria-controls", input_aria_controls_value = `menu-${/*id*/ ctx[14] || /*name*/ ctx[1]}`);
6538
- attr(input, "aria-expanded", /*_isMenuVisible*/ ctx[23]);
6539
- attr(input, "aria-label", input_aria_label_value = /*arialabel*/ ctx[2] || /*name*/ ctx[1]);
6540
- attr(input, "aria-labelledby", /*arialabelledby*/ ctx[3]);
6541
- attr(input, "id", input_id_value = `${/*id*/ ctx[14] || /*name*/ ctx[1]}`);
6542
- attr(input, "aria-activedescendant", /*_activeDescendantId*/ ctx[29]);
6543
- attr(input, "aria-disabled", /*_disabled*/ ctx[28]);
6544
-
6545
- attr(input, "aria-owns", input_aria_owns_value = /*_isMenuVisible*/ ctx[23]
6546
- ? `menu-${/*id*/ ctx[14] || /*name*/ ctx[1]}`
6548
+ attr(input, "aria-controls", input_aria_controls_value = `menu-${/*name*/ ctx[0]}`);
6549
+ attr(input, "aria-expanded", /*_isMenuVisible*/ ctx[18]);
6550
+ attr(input, "aria-label", input_aria_label_value = /*arialabel*/ ctx[1] || /*name*/ ctx[0]);
6551
+ attr(input, "aria-labelledby", /*arialabelledby*/ ctx[2]);
6552
+ attr(input, "id", /*name*/ ctx[0]);
6553
+ attr(input, "aria-activedescendant", /*_activeDescendantId*/ ctx[25]);
6554
+ attr(input, "aria-disabled", /*_disabled*/ ctx[26]);
6555
+
6556
+ attr(input, "aria-owns", input_aria_owns_value = /*_isMenuVisible*/ ctx[18]
6557
+ ? `menu-${/*name*/ ctx[0]}`
6547
6558
  : undefined);
6548
6559
 
6549
6560
  attr(input, "aria-haspopup", "listbox");
6550
- input.disabled = /*_disabled*/ ctx[28];
6551
- input.readOnly = input_readonly_value = !/*_filterable*/ ctx[20];
6561
+ input.disabled = /*_disabled*/ ctx[26];
6562
+ input.readOnly = input_readonly_value = !/*_filterable*/ ctx[24];
6552
6563
  attr(input, "placeholder", /*placeholder*/ ctx[6]);
6553
- attr(input, "name", /*name*/ ctx[1]);
6564
+ attr(input, "name", /*name*/ ctx[0]);
6554
6565
  attr(div, "slot", "target");
6555
-
6556
- attr(div, "style", div_style_value = `
6557
- ${cssVar("width", /*width*/ ctx[7])}
6558
- `);
6559
-
6566
+ attr(div, "style", div_style_value = cssVar("width", /*width*/ ctx[7]));
6560
6567
  attr(div, "class", "dropdown-input-group");
6561
- toggle_class(div, "dropdown-input-group--disabled", /*_disabled*/ ctx[28]);
6562
- toggle_class(div, "error", /*_error*/ ctx[30]);
6563
- attr(ul, "id", ul_id_value = `menu-${/*id*/ ctx[14] || /*name*/ ctx[1]}`);
6568
+ toggle_class(div, "dropdown-input-group--disabled", /*_disabled*/ ctx[26]);
6569
+ toggle_class(div, "error", /*_error*/ ctx[27]);
6570
+ attr(ul, "id", ul_id_value = `menu-${/*name*/ ctx[0]}`);
6564
6571
  attr(ul, "role", "listbox");
6565
6572
  attr(ul, "tabindex", "-1");
6566
6573
  attr(ul, "data-testid", "dropdown-menu");
6567
- attr(ul, "aria-label", ul_aria_label_value = /*arialabel*/ ctx[2] || /*name*/ ctx[1]);
6568
- attr(ul, "aria-labelledby", /*arialabelledby*/ ctx[3]);
6574
+ attr(ul, "aria-label", ul_aria_label_value = /*arialabel*/ ctx[1] || /*name*/ ctx[0]);
6575
+ attr(ul, "aria-labelledby", /*arialabelledby*/ ctx[2]);
6569
6576
 
6570
6577
  attr(ul, "style", ul_style_value = `
6578
+ width: ${/*_width*/ ctx[19]};
6571
6579
  outline: none;
6572
6580
  overflow-y: auto;
6573
6581
  max-height: ${/*maxheight*/ ctx[5]};
@@ -6575,11 +6583,12 @@ function create_else_block$a(ctx) {
6575
6583
 
6576
6584
  set_custom_element_data(goa_popover, "disabled", /*disabled*/ ctx[8]);
6577
6585
  set_custom_element_data(goa_popover, "relative", /*relative*/ ctx[9]);
6578
- set_custom_element_data(goa_popover, "open", /*_isMenuVisible*/ ctx[23]);
6586
+ set_custom_element_data(goa_popover, "data-testid", "option-list");
6587
+ set_custom_element_data(goa_popover, "maxwidth", "1000px");
6588
+ set_custom_element_data(goa_popover, "open", /*_isMenuVisible*/ ctx[18]);
6579
6589
  set_custom_element_data(goa_popover, "padded", "false");
6580
- set_custom_element_data(goa_popover, "width", /*_width*/ ctx[24]);
6581
6590
  set_custom_element_data(goa_popover, "tabindex", "-1");
6582
- set_custom_element_data(goa_popover, "maxwidth", /*_inputWidth*/ ctx[25]);
6591
+ set_custom_element_data(goa_popover, "width", /*_width*/ ctx[19]);
6583
6592
  },
6584
6593
  m(target, anchor) {
6585
6594
  insert(target, slot, anchor);
@@ -6589,23 +6598,30 @@ function create_else_block$a(ctx) {
6589
6598
  if (if_block0) if_block0.m(div, null);
6590
6599
  append(div, t1);
6591
6600
  append(div, input);
6592
- /*input_binding*/ ctx[43](input);
6593
- set_input_value(input, /*_inputValue*/ ctx[16]);
6601
+ /*input_binding*/ ctx[42](input);
6594
6602
  append(div, t2);
6595
- if (if_block1) if_block1.m(div, null);
6596
- append(div, t3);
6597
- if (if_block2) if_block2.m(div, null);
6598
- append(goa_popover, t4);
6603
+ if_block1.m(div, null);
6604
+ append(goa_popover, t3);
6599
6605
  append(goa_popover, ul);
6600
- if_block3.m(ul, null);
6601
- /*ul_binding*/ ctx[47](ul);
6606
+
6607
+ for (let i = 0; i < each_blocks.length; i += 1) {
6608
+ if (each_blocks[i]) {
6609
+ each_blocks[i].m(ul, null);
6610
+ }
6611
+ }
6612
+
6613
+ if (each_1_else) {
6614
+ each_1_else.m(ul, null);
6615
+ }
6616
+
6617
+ /*ul_binding*/ ctx[44](ul);
6602
6618
 
6603
6619
  if (!mounted) {
6604
6620
  dispose = [
6605
- listen(input, "input", /*input_input_handler*/ ctx[44]),
6606
- listen(input, "keydown", /*onInputKeyDown*/ ctx[34]),
6607
- listen(goa_popover, "_open", /*showMenu*/ ctx[31]),
6608
- listen(goa_popover, "_close", /*closeMenu*/ ctx[32])
6621
+ listen(input, "keydown", /*onInputKeyDown*/ ctx[32]),
6622
+ listen(input, "keyup", /*onInputKeyUp*/ ctx[31]),
6623
+ listen(goa_popover, "_open", /*showMenu*/ ctx[28]),
6624
+ listen(goa_popover, "_close", /*hideMenu*/ ctx[29])
6609
6625
  ];
6610
6626
 
6611
6627
  mounted = true;
@@ -6616,7 +6632,7 @@ function create_else_block$a(ctx) {
6616
6632
  if (if_block0) {
6617
6633
  if_block0.p(ctx, dirty);
6618
6634
  } else {
6619
- if_block0 = create_if_block_4$3(ctx);
6635
+ if_block0 = create_if_block_2$a(ctx);
6620
6636
  if_block0.c();
6621
6637
  if_block0.m(div, t1);
6622
6638
  }
@@ -6625,51 +6641,53 @@ function create_else_block$a(ctx) {
6625
6641
  if_block0 = null;
6626
6642
  }
6627
6643
 
6628
- if (dirty[0] & /*_disabled, _filterable*/ 269484032 && input_style_value !== (input_style_value = `cursor: ${!/*_disabled*/ ctx[28]
6629
- ? /*_filterable*/ ctx[20] ? "auto" : "pointer"
6630
- : 'default'}`)) {
6644
+ if (dirty[0] & /*_disabled, _filterable*/ 83886080 && input_style_value !== (input_style_value = `
6645
+ cursor: ${!/*_disabled*/ ctx[26]
6646
+ ? /*_filterable*/ ctx[24] ? "auto" : "pointer"
6647
+ : "default"};
6648
+ `)) {
6631
6649
  attr(input, "style", input_style_value);
6632
6650
  }
6633
6651
 
6634
- if (dirty[0] & /*id, name*/ 16386 && input_aria_controls_value !== (input_aria_controls_value = `menu-${/*id*/ ctx[14] || /*name*/ ctx[1]}`)) {
6652
+ if (dirty[0] & /*name*/ 1 && input_aria_controls_value !== (input_aria_controls_value = `menu-${/*name*/ ctx[0]}`)) {
6635
6653
  attr(input, "aria-controls", input_aria_controls_value);
6636
6654
  }
6637
6655
 
6638
- if (dirty[0] & /*_isMenuVisible*/ 8388608) {
6639
- attr(input, "aria-expanded", /*_isMenuVisible*/ ctx[23]);
6656
+ if (dirty[0] & /*_isMenuVisible*/ 262144) {
6657
+ attr(input, "aria-expanded", /*_isMenuVisible*/ ctx[18]);
6640
6658
  }
6641
6659
 
6642
- if (dirty[0] & /*arialabel, name*/ 6 && input_aria_label_value !== (input_aria_label_value = /*arialabel*/ ctx[2] || /*name*/ ctx[1])) {
6660
+ if (dirty[0] & /*arialabel, name*/ 3 && input_aria_label_value !== (input_aria_label_value = /*arialabel*/ ctx[1] || /*name*/ ctx[0])) {
6643
6661
  attr(input, "aria-label", input_aria_label_value);
6644
6662
  }
6645
6663
 
6646
- if (dirty[0] & /*arialabelledby*/ 8) {
6647
- attr(input, "aria-labelledby", /*arialabelledby*/ ctx[3]);
6664
+ if (dirty[0] & /*arialabelledby*/ 4) {
6665
+ attr(input, "aria-labelledby", /*arialabelledby*/ ctx[2]);
6648
6666
  }
6649
6667
 
6650
- if (dirty[0] & /*id, name*/ 16386 && input_id_value !== (input_id_value = `${/*id*/ ctx[14] || /*name*/ ctx[1]}`)) {
6651
- attr(input, "id", input_id_value);
6668
+ if (dirty[0] & /*name*/ 1) {
6669
+ attr(input, "id", /*name*/ ctx[0]);
6652
6670
  }
6653
6671
 
6654
- if (dirty[0] & /*_activeDescendantId*/ 536870912) {
6655
- attr(input, "aria-activedescendant", /*_activeDescendantId*/ ctx[29]);
6672
+ if (dirty[0] & /*_activeDescendantId*/ 33554432) {
6673
+ attr(input, "aria-activedescendant", /*_activeDescendantId*/ ctx[25]);
6656
6674
  }
6657
6675
 
6658
- if (dirty[0] & /*_disabled*/ 268435456) {
6659
- attr(input, "aria-disabled", /*_disabled*/ ctx[28]);
6676
+ if (dirty[0] & /*_disabled*/ 67108864) {
6677
+ attr(input, "aria-disabled", /*_disabled*/ ctx[26]);
6660
6678
  }
6661
6679
 
6662
- if (dirty[0] & /*_isMenuVisible, id, name*/ 8404994 && input_aria_owns_value !== (input_aria_owns_value = /*_isMenuVisible*/ ctx[23]
6663
- ? `menu-${/*id*/ ctx[14] || /*name*/ ctx[1]}`
6680
+ if (dirty[0] & /*_isMenuVisible, name*/ 262145 && input_aria_owns_value !== (input_aria_owns_value = /*_isMenuVisible*/ ctx[18]
6681
+ ? `menu-${/*name*/ ctx[0]}`
6664
6682
  : undefined)) {
6665
6683
  attr(input, "aria-owns", input_aria_owns_value);
6666
6684
  }
6667
6685
 
6668
- if (dirty[0] & /*_disabled*/ 268435456) {
6669
- input.disabled = /*_disabled*/ ctx[28];
6686
+ if (dirty[0] & /*_disabled*/ 67108864) {
6687
+ input.disabled = /*_disabled*/ ctx[26];
6670
6688
  }
6671
6689
 
6672
- if (dirty[0] & /*_filterable*/ 1048576 && input_readonly_value !== (input_readonly_value = !/*_filterable*/ ctx[20])) {
6690
+ if (dirty[0] & /*_filterable*/ 16777216 && input_readonly_value !== (input_readonly_value = !/*_filterable*/ ctx[24])) {
6673
6691
  input.readOnly = input_readonly_value;
6674
6692
  }
6675
6693
 
@@ -6677,79 +6695,64 @@ function create_else_block$a(ctx) {
6677
6695
  attr(input, "placeholder", /*placeholder*/ ctx[6]);
6678
6696
  }
6679
6697
 
6680
- if (dirty[0] & /*name*/ 2) {
6681
- attr(input, "name", /*name*/ ctx[1]);
6698
+ if (dirty[0] & /*name*/ 1) {
6699
+ attr(input, "name", /*name*/ ctx[0]);
6682
6700
  }
6683
6701
 
6684
- if (dirty[0] & /*_inputValue*/ 65536 && input.value !== /*_inputValue*/ ctx[16]) {
6685
- set_input_value(input, /*_inputValue*/ ctx[16]);
6686
- }
6702
+ if (current_block_type === (current_block_type = select_block_type_1(ctx)) && if_block1) {
6703
+ if_block1.p(ctx, dirty);
6704
+ } else {
6705
+ if_block1.d(1);
6706
+ if_block1 = current_block_type(ctx);
6687
6707
 
6688
- if (/*_inputValue*/ ctx[16] && /*_filterable*/ ctx[20]) {
6689
6708
  if (if_block1) {
6690
- if_block1.p(ctx, dirty);
6691
- } else {
6692
- if_block1 = create_if_block_3$a(ctx);
6693
6709
  if_block1.c();
6694
- if_block1.m(div, t3);
6710
+ if_block1.m(div, null);
6695
6711
  }
6696
- } else if (if_block1) {
6697
- if_block1.d(1);
6698
- if_block1 = null;
6699
6712
  }
6700
6713
 
6701
- if (/*_filterable*/ ctx[20] && /*_inputValue*/ ctx[16].length === 0 || !/*_filterable*/ ctx[20]) {
6702
- if (if_block2) {
6703
- if_block2.p(ctx, dirty);
6704
- } else {
6705
- if_block2 = create_if_block_2$a(ctx);
6706
- if_block2.c();
6707
- if_block2.m(div, null);
6708
- }
6709
- } else if (if_block2) {
6710
- if_block2.d(1);
6711
- if_block2 = null;
6712
- }
6713
-
6714
- if (dirty[0] & /*width*/ 128 && div_style_value !== (div_style_value = `
6715
- ${cssVar("width", /*width*/ ctx[7])}
6716
- `)) {
6714
+ if (dirty[0] & /*width*/ 128 && div_style_value !== (div_style_value = cssVar("width", /*width*/ ctx[7]))) {
6717
6715
  attr(div, "style", div_style_value);
6718
6716
  }
6719
6717
 
6720
- if (dirty[0] & /*_disabled*/ 268435456) {
6721
- toggle_class(div, "dropdown-input-group--disabled", /*_disabled*/ ctx[28]);
6718
+ if (dirty[0] & /*_disabled*/ 67108864) {
6719
+ toggle_class(div, "dropdown-input-group--disabled", /*_disabled*/ ctx[26]);
6722
6720
  }
6723
6721
 
6724
- if (dirty[0] & /*_error*/ 1073741824) {
6725
- toggle_class(div, "error", /*_error*/ ctx[30]);
6722
+ if (dirty[0] & /*_error*/ 134217728) {
6723
+ toggle_class(div, "error", /*_error*/ ctx[27]);
6726
6724
  }
6727
6725
 
6728
- if (current_block_type === (current_block_type = select_block_type_1(ctx)) && if_block3) {
6729
- if_block3.p(ctx, dirty);
6730
- } else {
6731
- if_block3.d(1);
6732
- if_block3 = current_block_type(ctx);
6726
+ if (dirty[0] & /*_filteredOptions, _inputEl, _highlightedIndex, onSelect*/ 1082179584) {
6727
+ each_value_1 = /*_filteredOptions*/ ctx[15];
6728
+ each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value_1, each_1_lookup, ul, destroy_block, create_each_block_1$1, null, get_each_context_1$1);
6733
6729
 
6734
- if (if_block3) {
6735
- if_block3.c();
6736
- if_block3.m(ul, null);
6730
+ if (!each_value_1.length && each_1_else) {
6731
+ each_1_else.p(ctx, dirty);
6732
+ } else if (!each_value_1.length) {
6733
+ each_1_else = create_else_block_1();
6734
+ each_1_else.c();
6735
+ each_1_else.m(ul, null);
6736
+ } else if (each_1_else) {
6737
+ each_1_else.d(1);
6738
+ each_1_else = null;
6737
6739
  }
6738
6740
  }
6739
6741
 
6740
- if (dirty[0] & /*id, name*/ 16386 && ul_id_value !== (ul_id_value = `menu-${/*id*/ ctx[14] || /*name*/ ctx[1]}`)) {
6742
+ if (dirty[0] & /*name*/ 1 && ul_id_value !== (ul_id_value = `menu-${/*name*/ ctx[0]}`)) {
6741
6743
  attr(ul, "id", ul_id_value);
6742
6744
  }
6743
6745
 
6744
- if (dirty[0] & /*arialabel, name*/ 6 && ul_aria_label_value !== (ul_aria_label_value = /*arialabel*/ ctx[2] || /*name*/ ctx[1])) {
6746
+ if (dirty[0] & /*arialabel, name*/ 3 && ul_aria_label_value !== (ul_aria_label_value = /*arialabel*/ ctx[1] || /*name*/ ctx[0])) {
6745
6747
  attr(ul, "aria-label", ul_aria_label_value);
6746
6748
  }
6747
6749
 
6748
- if (dirty[0] & /*arialabelledby*/ 8) {
6749
- attr(ul, "aria-labelledby", /*arialabelledby*/ ctx[3]);
6750
+ if (dirty[0] & /*arialabelledby*/ 4) {
6751
+ attr(ul, "aria-labelledby", /*arialabelledby*/ ctx[2]);
6750
6752
  }
6751
6753
 
6752
- if (dirty[0] & /*maxheight*/ 32 && ul_style_value !== (ul_style_value = `
6754
+ if (dirty[0] & /*_width, maxheight*/ 524320 && ul_style_value !== (ul_style_value = `
6755
+ width: ${/*_width*/ ctx[19]};
6753
6756
  outline: none;
6754
6757
  overflow-y: auto;
6755
6758
  max-height: ${/*maxheight*/ ctx[5]};
@@ -6765,16 +6768,12 @@ function create_else_block$a(ctx) {
6765
6768
  set_custom_element_data(goa_popover, "relative", /*relative*/ ctx[9]);
6766
6769
  }
6767
6770
 
6768
- if (dirty[0] & /*_isMenuVisible*/ 8388608) {
6769
- set_custom_element_data(goa_popover, "open", /*_isMenuVisible*/ ctx[23]);
6770
- }
6771
-
6772
- if (dirty[0] & /*_width*/ 16777216) {
6773
- set_custom_element_data(goa_popover, "width", /*_width*/ ctx[24]);
6771
+ if (dirty[0] & /*_isMenuVisible*/ 262144) {
6772
+ set_custom_element_data(goa_popover, "open", /*_isMenuVisible*/ ctx[18]);
6774
6773
  }
6775
6774
 
6776
- if (dirty[0] & /*_inputWidth*/ 33554432) {
6777
- set_custom_element_data(goa_popover, "maxwidth", /*_inputWidth*/ ctx[25]);
6775
+ if (dirty[0] & /*_width*/ 524288) {
6776
+ set_custom_element_data(goa_popover, "width", /*_width*/ ctx[19]);
6778
6777
  }
6779
6778
  },
6780
6779
  d(detaching) {
@@ -6782,26 +6781,29 @@ function create_else_block$a(ctx) {
6782
6781
  if (detaching) detach(t0);
6783
6782
  if (detaching) detach(goa_popover);
6784
6783
  if (if_block0) if_block0.d();
6785
- /*input_binding*/ ctx[43](null);
6786
- if (if_block1) if_block1.d();
6787
- if (if_block2) if_block2.d();
6788
- if_block3.d();
6789
- /*ul_binding*/ ctx[47](null);
6784
+ /*input_binding*/ ctx[42](null);
6785
+ if_block1.d();
6786
+
6787
+ for (let i = 0; i < each_blocks.length; i += 1) {
6788
+ each_blocks[i].d();
6789
+ }
6790
+
6791
+ if (each_1_else) each_1_else.d();
6792
+ /*ul_binding*/ ctx[44](null);
6790
6793
  mounted = false;
6791
6794
  run_all(dispose);
6792
6795
  }
6793
6796
  };
6794
6797
  }
6795
6798
 
6796
- // (489:2) {#if _native}
6799
+ // (424:2) {#if _native}
6797
6800
  function create_if_block$o(ctx) {
6798
6801
  let select;
6799
6802
  let slot;
6800
6803
  let select_aria_label_value;
6801
- let select_id_value;
6802
6804
  let mounted;
6803
6805
  let dispose;
6804
- let each_value = /*_options*/ ctx[15];
6806
+ let each_value = /*_options*/ ctx[17];
6805
6807
  let each_blocks = [];
6806
6808
 
6807
6809
  for (let i = 0; i < each_value.length; i += 1) {
@@ -6817,12 +6819,12 @@ function create_if_block$o(ctx) {
6817
6819
  each_blocks[i].c();
6818
6820
  }
6819
6821
 
6820
- select.disabled = /*_disabled*/ ctx[28];
6821
- attr(select, "aria-labelledby", /*arialabelledby*/ ctx[3]);
6822
- attr(select, "aria-label", select_aria_label_value = /*arialabel*/ ctx[2] || /*name*/ ctx[1]);
6823
- attr(select, "id", select_id_value = /*id*/ ctx[14] || /*name*/ ctx[1]);
6824
- attr(select, "name", /*name*/ ctx[1]);
6825
- toggle_class(select, "error", /*_error*/ ctx[30]);
6822
+ attr(select, "name", /*name*/ ctx[0]);
6823
+ attr(select, "aria-label", select_aria_label_value = /*arialabel*/ ctx[1] || /*name*/ ctx[0]);
6824
+ attr(select, "aria-labelledby", /*arialabelledby*/ ctx[2]);
6825
+ select.disabled = /*_disabled*/ ctx[26];
6826
+ attr(select, "id", /*name*/ ctx[0]);
6827
+ toggle_class(select, "error", /*_error*/ ctx[27]);
6826
6828
  },
6827
6829
  m(target, anchor) {
6828
6830
  insert(target, select, anchor);
@@ -6834,7 +6836,7 @@ function create_if_block$o(ctx) {
6834
6836
  }
6835
6837
  }
6836
6838
 
6837
- /*select_binding*/ ctx[42](select);
6839
+ /*select_binding*/ ctx[41](select);
6838
6840
 
6839
6841
  if (!mounted) {
6840
6842
  dispose = listen(select, "change", /*onNativeSelect*/ ctx[35]);
@@ -6842,8 +6844,8 @@ function create_if_block$o(ctx) {
6842
6844
  }
6843
6845
  },
6844
6846
  p(ctx, dirty) {
6845
- if (dirty[0] & /*value, _options*/ 32769) {
6846
- each_value = /*_options*/ ctx[15];
6847
+ if (dirty[0] & /*value, _options*/ 131080) {
6848
+ each_value = /*_options*/ ctx[17];
6847
6849
  let i;
6848
6850
 
6849
6851
  for (i = 0; i < each_value.length; i += 1) {
@@ -6865,42 +6867,42 @@ function create_if_block$o(ctx) {
6865
6867
  each_blocks.length = each_value.length;
6866
6868
  }
6867
6869
 
6868
- if (dirty[0] & /*_disabled*/ 268435456) {
6869
- select.disabled = /*_disabled*/ ctx[28];
6870
+ if (dirty[0] & /*name*/ 1) {
6871
+ attr(select, "name", /*name*/ ctx[0]);
6870
6872
  }
6871
6873
 
6872
- if (dirty[0] & /*arialabelledby*/ 8) {
6873
- attr(select, "aria-labelledby", /*arialabelledby*/ ctx[3]);
6874
+ if (dirty[0] & /*arialabel, name*/ 3 && select_aria_label_value !== (select_aria_label_value = /*arialabel*/ ctx[1] || /*name*/ ctx[0])) {
6875
+ attr(select, "aria-label", select_aria_label_value);
6874
6876
  }
6875
6877
 
6876
- if (dirty[0] & /*arialabel, name*/ 6 && select_aria_label_value !== (select_aria_label_value = /*arialabel*/ ctx[2] || /*name*/ ctx[1])) {
6877
- attr(select, "aria-label", select_aria_label_value);
6878
+ if (dirty[0] & /*arialabelledby*/ 4) {
6879
+ attr(select, "aria-labelledby", /*arialabelledby*/ ctx[2]);
6878
6880
  }
6879
6881
 
6880
- if (dirty[0] & /*id, name*/ 16386 && select_id_value !== (select_id_value = /*id*/ ctx[14] || /*name*/ ctx[1])) {
6881
- attr(select, "id", select_id_value);
6882
+ if (dirty[0] & /*_disabled*/ 67108864) {
6883
+ select.disabled = /*_disabled*/ ctx[26];
6882
6884
  }
6883
6885
 
6884
- if (dirty[0] & /*name*/ 2) {
6885
- attr(select, "name", /*name*/ ctx[1]);
6886
+ if (dirty[0] & /*name*/ 1) {
6887
+ attr(select, "id", /*name*/ ctx[0]);
6886
6888
  }
6887
6889
 
6888
- if (dirty[0] & /*_error*/ 1073741824) {
6889
- toggle_class(select, "error", /*_error*/ ctx[30]);
6890
+ if (dirty[0] & /*_error*/ 134217728) {
6891
+ toggle_class(select, "error", /*_error*/ ctx[27]);
6890
6892
  }
6891
6893
  },
6892
6894
  d(detaching) {
6893
6895
  if (detaching) detach(select);
6894
6896
  destroy_each(each_blocks, detaching);
6895
- /*select_binding*/ ctx[42](null);
6897
+ /*select_binding*/ ctx[41](null);
6896
6898
  mounted = false;
6897
6899
  dispose();
6898
6900
  }
6899
6901
  };
6900
6902
  }
6901
6903
 
6902
- // (531:8) {#if leadingicon}
6903
- function create_if_block_4$3(ctx) {
6904
+ // (467:8) {#if leadingicon}
6905
+ function create_if_block_2$a(ctx) {
6904
6906
  let goa_icon;
6905
6907
 
6906
6908
  return {
@@ -6924,131 +6926,148 @@ function create_if_block_4$3(ctx) {
6924
6926
  };
6925
6927
  }
6926
6928
 
6927
- // (562:8) {#if _inputValue && _filterable}
6928
- function create_if_block_3$a(ctx) {
6929
+ // (517:8) {:else}
6930
+ function create_else_block_2(ctx) {
6929
6931
  let goa_icon;
6930
- let goa_icon_tabindex_value;
6931
6932
  let goa_icon_arialabel_value;
6933
+ let goa_icon_ariacontrols_value;
6934
+ let goa_icon_ariaexpanded_value;
6935
+ let goa_icon_type_value;
6932
6936
  let mounted;
6933
6937
  let dispose;
6934
6938
 
6935
6939
  return {
6936
6940
  c() {
6937
6941
  goa_icon = element("goa-icon");
6938
- set_custom_element_data(goa_icon, "tabindex", goa_icon_tabindex_value = /*_disabled*/ ctx[28] ? -1 : 0);
6939
6942
  set_custom_element_data(goa_icon, "role", "button");
6940
- set_custom_element_data(goa_icon, "arialabel", goa_icon_arialabel_value = "clear " + (/*arialabel*/ ctx[2] || /*name*/ ctx[1]));
6941
- set_custom_element_data(goa_icon, "class", "dropdown-icon--clear");
6943
+ set_custom_element_data(goa_icon, "tabindex", "-1");
6944
+ set_custom_element_data(goa_icon, "id", /*name*/ ctx[0]);
6945
+ set_custom_element_data(goa_icon, "arialabel", goa_icon_arialabel_value = /*arialabel*/ ctx[1] || /*name*/ ctx[0]);
6946
+ set_custom_element_data(goa_icon, "ariacontrols", goa_icon_ariacontrols_value = `menu-${/*name*/ ctx[0]}`);
6947
+ set_custom_element_data(goa_icon, "ariaexpanded", goa_icon_ariaexpanded_value = fromBoolean(/*_isMenuVisible*/ ctx[18]));
6948
+ set_custom_element_data(goa_icon, "class", "dropdown-icon--arrow");
6942
6949
  set_custom_element_data(goa_icon, "size", "medium");
6943
- set_custom_element_data(goa_icon, "type", "close");
6944
- toggle_class(goa_icon, "disabled", /*_disabled*/ ctx[28]);
6950
+
6951
+ set_custom_element_data(goa_icon, "type", goa_icon_type_value = /*_isMenuVisible*/ ctx[18]
6952
+ ? "chevron-up"
6953
+ : "chevron-down");
6945
6954
  },
6946
6955
  m(target, anchor) {
6947
6956
  insert(target, goa_icon, anchor);
6948
6957
 
6949
6958
  if (!mounted) {
6950
- dispose = [
6951
- listen(goa_icon, "click", stop_propagation(/*onClear*/ ctx[37])),
6952
- listen(goa_icon, "keydown", /*keydown_handler*/ ctx[45])
6953
- ];
6954
-
6959
+ dispose = listen(goa_icon, "click", /*onChevronClick*/ ctx[36]);
6955
6960
  mounted = true;
6956
6961
  }
6957
6962
  },
6958
6963
  p(ctx, dirty) {
6959
- if (dirty[0] & /*_disabled*/ 268435456 && goa_icon_tabindex_value !== (goa_icon_tabindex_value = /*_disabled*/ ctx[28] ? -1 : 0)) {
6960
- set_custom_element_data(goa_icon, "tabindex", goa_icon_tabindex_value);
6964
+ if (dirty[0] & /*name*/ 1) {
6965
+ set_custom_element_data(goa_icon, "id", /*name*/ ctx[0]);
6961
6966
  }
6962
6967
 
6963
- if (dirty[0] & /*arialabel, name*/ 6 && goa_icon_arialabel_value !== (goa_icon_arialabel_value = "clear " + (/*arialabel*/ ctx[2] || /*name*/ ctx[1]))) {
6968
+ if (dirty[0] & /*arialabel, name*/ 3 && goa_icon_arialabel_value !== (goa_icon_arialabel_value = /*arialabel*/ ctx[1] || /*name*/ ctx[0])) {
6964
6969
  set_custom_element_data(goa_icon, "arialabel", goa_icon_arialabel_value);
6965
6970
  }
6966
6971
 
6967
- if (dirty[0] & /*_disabled*/ 268435456) {
6968
- toggle_class(goa_icon, "disabled", /*_disabled*/ ctx[28]);
6972
+ if (dirty[0] & /*name*/ 1 && goa_icon_ariacontrols_value !== (goa_icon_ariacontrols_value = `menu-${/*name*/ ctx[0]}`)) {
6973
+ set_custom_element_data(goa_icon, "ariacontrols", goa_icon_ariacontrols_value);
6974
+ }
6975
+
6976
+ if (dirty[0] & /*_isMenuVisible*/ 262144 && goa_icon_ariaexpanded_value !== (goa_icon_ariaexpanded_value = fromBoolean(/*_isMenuVisible*/ ctx[18]))) {
6977
+ set_custom_element_data(goa_icon, "ariaexpanded", goa_icon_ariaexpanded_value);
6978
+ }
6979
+
6980
+ if (dirty[0] & /*_isMenuVisible*/ 262144 && goa_icon_type_value !== (goa_icon_type_value = /*_isMenuVisible*/ ctx[18]
6981
+ ? "chevron-up"
6982
+ : "chevron-down")) {
6983
+ set_custom_element_data(goa_icon, "type", goa_icon_type_value);
6969
6984
  }
6970
6985
  },
6971
6986
  d(detaching) {
6972
6987
  if (detaching) detach(goa_icon);
6973
6988
  mounted = false;
6974
- run_all(dispose);
6989
+ dispose();
6975
6990
  }
6976
6991
  };
6977
6992
  }
6978
6993
 
6979
- // (580:8) {#if (_filterable && _inputValue.length === 0) || !_filterable}
6980
- function create_if_block_2$a(ctx) {
6994
+ // (502:8) {#if _inputEl?.value && _filterable}
6995
+ function create_if_block_1$c(ctx) {
6981
6996
  let goa_icon;
6982
- let goa_icon_id_value;
6997
+ let goa_icon_tabindex_value;
6983
6998
  let goa_icon_arialabel_value;
6984
6999
  let goa_icon_ariacontrols_value;
6985
7000
  let goa_icon_ariaexpanded_value;
6986
- let goa_icon_type_value;
6987
7001
  let mounted;
6988
7002
  let dispose;
6989
7003
 
6990
7004
  return {
6991
7005
  c() {
6992
7006
  goa_icon = element("goa-icon");
7007
+ set_custom_element_data(goa_icon, "id", /*name*/ ctx[0]);
7008
+ set_custom_element_data(goa_icon, "tabindex", goa_icon_tabindex_value = /*_disabled*/ ctx[26] ? -1 : 0);
6993
7009
  set_custom_element_data(goa_icon, "role", "button");
6994
- set_custom_element_data(goa_icon, "id", goa_icon_id_value = `${/*id*/ ctx[14] || /*name*/ ctx[1]}`);
6995
- set_custom_element_data(goa_icon, "arialabel", goa_icon_arialabel_value = /*arialabel*/ ctx[2] || /*name*/ ctx[1]);
6996
- set_custom_element_data(goa_icon, "ariacontrols", goa_icon_ariacontrols_value = `menu-${/*id*/ ctx[14] || /*name*/ ctx[1]}`);
6997
- set_custom_element_data(goa_icon, "ariaexpanded", goa_icon_ariaexpanded_value = /*_isMenuVisible*/ ctx[23] ? "true" : "false");
6998
- set_custom_element_data(goa_icon, "class", "dropdown-icon--arrow");
7010
+ set_custom_element_data(goa_icon, "arialabel", goa_icon_arialabel_value = `clear ${/*arialabel*/ ctx[1] || /*name*/ ctx[0]}`);
7011
+ set_custom_element_data(goa_icon, "ariacontrols", goa_icon_ariacontrols_value = `menu-${/*name*/ ctx[0]}`);
7012
+ set_custom_element_data(goa_icon, "ariaexpanded", goa_icon_ariaexpanded_value = fromBoolean(/*_isMenuVisible*/ ctx[18]));
7013
+ set_custom_element_data(goa_icon, "class", "dropdown-icon--clear");
6999
7014
  set_custom_element_data(goa_icon, "size", "medium");
7000
-
7001
- set_custom_element_data(goa_icon, "type", goa_icon_type_value = /*_isMenuVisible*/ ctx[23]
7002
- ? 'chevron-up'
7003
- : 'chevron-down');
7015
+ set_custom_element_data(goa_icon, "type", "close");
7016
+ toggle_class(goa_icon, "disabled", /*_disabled*/ ctx[26]);
7004
7017
  },
7005
7018
  m(target, anchor) {
7006
7019
  insert(target, goa_icon, anchor);
7007
7020
 
7008
7021
  if (!mounted) {
7009
- dispose = listen(goa_icon, "click", /*onClick*/ ctx[36]);
7022
+ dispose = [
7023
+ listen(goa_icon, "click", stop_propagation(/*onClearIconClick*/ ctx[34])),
7024
+ listen(goa_icon, "keydown", /*onClearIconKeyDown*/ ctx[33])
7025
+ ];
7026
+
7010
7027
  mounted = true;
7011
7028
  }
7012
7029
  },
7013
7030
  p(ctx, dirty) {
7014
- if (dirty[0] & /*id, name*/ 16386 && goa_icon_id_value !== (goa_icon_id_value = `${/*id*/ ctx[14] || /*name*/ ctx[1]}`)) {
7015
- set_custom_element_data(goa_icon, "id", goa_icon_id_value);
7031
+ if (dirty[0] & /*name*/ 1) {
7032
+ set_custom_element_data(goa_icon, "id", /*name*/ ctx[0]);
7033
+ }
7034
+
7035
+ if (dirty[0] & /*_disabled*/ 67108864 && goa_icon_tabindex_value !== (goa_icon_tabindex_value = /*_disabled*/ ctx[26] ? -1 : 0)) {
7036
+ set_custom_element_data(goa_icon, "tabindex", goa_icon_tabindex_value);
7016
7037
  }
7017
7038
 
7018
- if (dirty[0] & /*arialabel, name*/ 6 && goa_icon_arialabel_value !== (goa_icon_arialabel_value = /*arialabel*/ ctx[2] || /*name*/ ctx[1])) {
7039
+ if (dirty[0] & /*arialabel, name*/ 3 && goa_icon_arialabel_value !== (goa_icon_arialabel_value = `clear ${/*arialabel*/ ctx[1] || /*name*/ ctx[0]}`)) {
7019
7040
  set_custom_element_data(goa_icon, "arialabel", goa_icon_arialabel_value);
7020
7041
  }
7021
7042
 
7022
- if (dirty[0] & /*id, name*/ 16386 && goa_icon_ariacontrols_value !== (goa_icon_ariacontrols_value = `menu-${/*id*/ ctx[14] || /*name*/ ctx[1]}`)) {
7043
+ if (dirty[0] & /*name*/ 1 && goa_icon_ariacontrols_value !== (goa_icon_ariacontrols_value = `menu-${/*name*/ ctx[0]}`)) {
7023
7044
  set_custom_element_data(goa_icon, "ariacontrols", goa_icon_ariacontrols_value);
7024
7045
  }
7025
7046
 
7026
- if (dirty[0] & /*_isMenuVisible*/ 8388608 && goa_icon_ariaexpanded_value !== (goa_icon_ariaexpanded_value = /*_isMenuVisible*/ ctx[23] ? "true" : "false")) {
7047
+ if (dirty[0] & /*_isMenuVisible*/ 262144 && goa_icon_ariaexpanded_value !== (goa_icon_ariaexpanded_value = fromBoolean(/*_isMenuVisible*/ ctx[18]))) {
7027
7048
  set_custom_element_data(goa_icon, "ariaexpanded", goa_icon_ariaexpanded_value);
7028
7049
  }
7029
7050
 
7030
- if (dirty[0] & /*_isMenuVisible*/ 8388608 && goa_icon_type_value !== (goa_icon_type_value = /*_isMenuVisible*/ ctx[23]
7031
- ? 'chevron-up'
7032
- : 'chevron-down')) {
7033
- set_custom_element_data(goa_icon, "type", goa_icon_type_value);
7051
+ if (dirty[0] & /*_disabled*/ 67108864) {
7052
+ toggle_class(goa_icon, "disabled", /*_disabled*/ ctx[26]);
7034
7053
  }
7035
7054
  },
7036
7055
  d(detaching) {
7037
7056
  if (detaching) detach(goa_icon);
7038
7057
  mounted = false;
7039
- dispose();
7058
+ run_all(dispose);
7040
7059
  }
7041
7060
  };
7042
7061
  }
7043
7062
 
7044
- // (626:8) {:else}
7063
+ // (565:8) {:else}
7045
7064
  function create_else_block_1(ctx) {
7046
7065
  let li;
7047
7066
 
7048
7067
  return {
7049
7068
  c() {
7050
7069
  li = element("li");
7051
- li.textContent = "No matches found";
7070
+ li.textContent = "No matches found\n ";
7052
7071
  attr(li, "class", "dropdown-item");
7053
7072
  attr(li, "data-testid", "dropdown-item-not-found");
7054
7073
  },
@@ -7062,69 +7081,22 @@ function create_else_block_1(ctx) {
7062
7081
  };
7063
7082
  }
7064
7083
 
7065
- // (609:8) {#if _filteredOptions.length > 0}
7066
- function create_if_block_1$c(ctx) {
7067
- let each_blocks = [];
7068
- let each_1_lookup = new Map();
7069
- let each_1_anchor;
7070
- let each_value_1 = /*_filteredOptions*/ ctx[21];
7071
- const get_key = ctx => /*index*/ ctx[73];
7072
-
7073
- for (let i = 0; i < each_value_1.length; i += 1) {
7074
- let child_ctx = get_each_context_1$1(ctx, each_value_1, i);
7075
- let key = get_key(child_ctx);
7076
- each_1_lookup.set(key, each_blocks[i] = create_each_block_1$1(key, child_ctx));
7077
- }
7078
-
7079
- return {
7080
- c() {
7081
- for (let i = 0; i < each_blocks.length; i += 1) {
7082
- each_blocks[i].c();
7083
- }
7084
-
7085
- each_1_anchor = empty();
7086
- },
7087
- m(target, anchor) {
7088
- for (let i = 0; i < each_blocks.length; i += 1) {
7089
- if (each_blocks[i]) {
7090
- each_blocks[i].m(target, anchor);
7091
- }
7092
- }
7093
-
7094
- insert(target, each_1_anchor, anchor);
7095
- },
7096
- p(ctx, dirty) {
7097
- if (dirty[0] & /*_filteredOptions, value, _highlightedIndex*/ 2228225 | dirty[1] & /*onSelect*/ 4) {
7098
- each_value_1 = /*_filteredOptions*/ ctx[21];
7099
- each_blocks = update_keyed_each(each_blocks, dirty, get_key, 1, ctx, each_value_1, each_1_lookup, each_1_anchor.parentNode, destroy_block, create_each_block_1$1, each_1_anchor, get_each_context_1$1);
7100
- }
7101
- },
7102
- d(detaching) {
7103
- for (let i = 0; i < each_blocks.length; i += 1) {
7104
- each_blocks[i].d(detaching);
7105
- }
7106
-
7107
- if (detaching) detach(each_1_anchor);
7108
- }
7109
- };
7110
- }
7111
-
7112
- // (610:10) {#each _filteredOptions as option, index (index)}
7084
+ // (549:8) {#each _filteredOptions as option, index (index)}
7113
7085
  function create_each_block_1$1(key_1, ctx) {
7114
7086
  let li;
7115
- let t0_value = (/*option*/ ctx[69].label || /*option*/ ctx[69].value) + "";
7087
+ let t0_value = (/*option*/ ctx[61].label || /*option*/ ctx[61].value) + "";
7116
7088
  let t0;
7117
7089
  let t1;
7118
7090
  let li_id_value;
7119
7091
  let li_aria_selected_value;
7120
- let li_data_testid_value;
7121
7092
  let li_data_index_value;
7093
+ let li_data_testid_value;
7122
7094
  let li_data_value_value;
7123
7095
  let mounted;
7124
7096
  let dispose;
7125
7097
 
7126
7098
  function click_handler() {
7127
- return /*click_handler*/ ctx[46](/*option*/ ctx[69]);
7099
+ return /*click_handler*/ ctx[43](/*option*/ ctx[61]);
7128
7100
  }
7129
7101
 
7130
7102
  return {
@@ -7134,15 +7106,16 @@ function create_each_block_1$1(key_1, ctx) {
7134
7106
  li = element("li");
7135
7107
  t0 = text(t0_value);
7136
7108
  t1 = space();
7137
- attr(li, "id", li_id_value = /*option*/ ctx[69].value);
7109
+ attr(li, "id", li_id_value = /*option*/ ctx[61].value);
7110
+ attr(li, "aria-selected", li_aria_selected_value = /*_inputEl*/ ctx[23].value === (/*option*/ ctx[61].label || /*option*/ ctx[61].value));
7111
+ attr(li, "class", "dropdown-item");
7112
+ attr(li, "data-index", li_data_index_value = /*index*/ ctx[65]);
7113
+ attr(li, "data-testid", li_data_testid_value = `dropdown-item-${/*option*/ ctx[61].value}`);
7114
+ attr(li, "data-value", li_data_value_value = /*option*/ ctx[61].value);
7138
7115
  attr(li, "role", "option");
7139
7116
  set_style(li, "display", "block");
7140
- attr(li, "aria-selected", li_aria_selected_value = /*value*/ ctx[0] === /*option*/ ctx[69].value);
7141
- attr(li, "class", "dropdown-item");
7142
- attr(li, "data-testid", li_data_testid_value = `dropdown-item-${/*option*/ ctx[69].value}`);
7143
- attr(li, "data-index", li_data_index_value = /*index*/ ctx[73]);
7144
- attr(li, "data-value", li_data_value_value = /*option*/ ctx[69].value);
7145
- toggle_class(li, "dropdown-item--highlighted", /*index*/ ctx[73] === /*_highlightedIndex*/ ctx[17]);
7117
+ toggle_class(li, "dropdown-item--highlighted", /*index*/ ctx[65] === /*_highlightedIndex*/ ctx[14]);
7118
+ toggle_class(li, "selected", /*_inputEl*/ ctx[23].value === (/*option*/ ctx[61].label || /*option*/ ctx[61].value));
7146
7119
  this.first = li;
7147
7120
  },
7148
7121
  m(target, anchor) {
@@ -7157,30 +7130,34 @@ function create_each_block_1$1(key_1, ctx) {
7157
7130
  },
7158
7131
  p(new_ctx, dirty) {
7159
7132
  ctx = new_ctx;
7160
- if (dirty[0] & /*_filteredOptions*/ 2097152 && t0_value !== (t0_value = (/*option*/ ctx[69].label || /*option*/ ctx[69].value) + "")) set_data(t0, t0_value);
7133
+ if (dirty[0] & /*_filteredOptions*/ 32768 && t0_value !== (t0_value = (/*option*/ ctx[61].label || /*option*/ ctx[61].value) + "")) set_data(t0, t0_value);
7161
7134
 
7162
- if (dirty[0] & /*_filteredOptions*/ 2097152 && li_id_value !== (li_id_value = /*option*/ ctx[69].value)) {
7135
+ if (dirty[0] & /*_filteredOptions*/ 32768 && li_id_value !== (li_id_value = /*option*/ ctx[61].value)) {
7163
7136
  attr(li, "id", li_id_value);
7164
7137
  }
7165
7138
 
7166
- if (dirty[0] & /*value, _filteredOptions*/ 2097153 && li_aria_selected_value !== (li_aria_selected_value = /*value*/ ctx[0] === /*option*/ ctx[69].value)) {
7139
+ if (dirty[0] & /*_inputEl, _filteredOptions*/ 8421376 && li_aria_selected_value !== (li_aria_selected_value = /*_inputEl*/ ctx[23].value === (/*option*/ ctx[61].label || /*option*/ ctx[61].value))) {
7167
7140
  attr(li, "aria-selected", li_aria_selected_value);
7168
7141
  }
7169
7142
 
7170
- if (dirty[0] & /*_filteredOptions*/ 2097152 && li_data_testid_value !== (li_data_testid_value = `dropdown-item-${/*option*/ ctx[69].value}`)) {
7171
- attr(li, "data-testid", li_data_testid_value);
7143
+ if (dirty[0] & /*_filteredOptions*/ 32768 && li_data_index_value !== (li_data_index_value = /*index*/ ctx[65])) {
7144
+ attr(li, "data-index", li_data_index_value);
7172
7145
  }
7173
7146
 
7174
- if (dirty[0] & /*_filteredOptions*/ 2097152 && li_data_index_value !== (li_data_index_value = /*index*/ ctx[73])) {
7175
- attr(li, "data-index", li_data_index_value);
7147
+ if (dirty[0] & /*_filteredOptions*/ 32768 && li_data_testid_value !== (li_data_testid_value = `dropdown-item-${/*option*/ ctx[61].value}`)) {
7148
+ attr(li, "data-testid", li_data_testid_value);
7176
7149
  }
7177
7150
 
7178
- if (dirty[0] & /*_filteredOptions*/ 2097152 && li_data_value_value !== (li_data_value_value = /*option*/ ctx[69].value)) {
7151
+ if (dirty[0] & /*_filteredOptions*/ 32768 && li_data_value_value !== (li_data_value_value = /*option*/ ctx[61].value)) {
7179
7152
  attr(li, "data-value", li_data_value_value);
7180
7153
  }
7181
7154
 
7182
- if (dirty[0] & /*_filteredOptions, _highlightedIndex*/ 2228224) {
7183
- toggle_class(li, "dropdown-item--highlighted", /*index*/ ctx[73] === /*_highlightedIndex*/ ctx[17]);
7155
+ if (dirty[0] & /*_filteredOptions, _highlightedIndex*/ 49152) {
7156
+ toggle_class(li, "dropdown-item--highlighted", /*index*/ ctx[65] === /*_highlightedIndex*/ ctx[14]);
7157
+ }
7158
+
7159
+ if (dirty[0] & /*_inputEl, _filteredOptions*/ 8421376) {
7160
+ toggle_class(li, "selected", /*_inputEl*/ ctx[23].value === (/*option*/ ctx[61].label || /*option*/ ctx[61].value));
7184
7161
  }
7185
7162
  },
7186
7163
  d(detaching) {
@@ -7191,10 +7168,10 @@ function create_each_block_1$1(key_1, ctx) {
7191
7168
  };
7192
7169
  }
7193
7170
 
7194
- // (501:6) {#each _options as option}
7171
+ // (436:6) {#each _options as option}
7195
7172
  function create_each_block$8(ctx) {
7196
7173
  let option;
7197
- let t0_value = /*option*/ ctx[69].label + "";
7174
+ let t0_value = /*option*/ ctx[61].label + "";
7198
7175
  let t0;
7199
7176
  let t1;
7200
7177
  let option_selected_value;
@@ -7205,8 +7182,8 @@ function create_each_block$8(ctx) {
7205
7182
  option = element("option");
7206
7183
  t0 = text(t0_value);
7207
7184
  t1 = space();
7208
- option.selected = option_selected_value = /*value*/ ctx[0] === /*option*/ ctx[69].value;
7209
- option.__value = option_value_value = /*option*/ ctx[69].value;
7185
+ option.selected = option_selected_value = /*value*/ ctx[3] === /*option*/ ctx[61].value;
7186
+ option.__value = option_value_value = /*option*/ ctx[61].value;
7210
7187
  option.value = option.__value;
7211
7188
  },
7212
7189
  m(target, anchor) {
@@ -7215,13 +7192,13 @@ function create_each_block$8(ctx) {
7215
7192
  append(option, t1);
7216
7193
  },
7217
7194
  p(ctx, dirty) {
7218
- if (dirty[0] & /*_options*/ 32768 && t0_value !== (t0_value = /*option*/ ctx[69].label + "")) set_data(t0, t0_value);
7195
+ if (dirty[0] & /*_options*/ 131072 && t0_value !== (t0_value = /*option*/ ctx[61].label + "")) set_data(t0, t0_value);
7219
7196
 
7220
- if (dirty[0] & /*value, _options*/ 32769 && option_selected_value !== (option_selected_value = /*value*/ ctx[0] === /*option*/ ctx[69].value)) {
7197
+ if (dirty[0] & /*value, _options*/ 131080 && option_selected_value !== (option_selected_value = /*value*/ ctx[3] === /*option*/ ctx[61].value)) {
7221
7198
  option.selected = option_selected_value;
7222
7199
  }
7223
7200
 
7224
- if (dirty[0] & /*_options*/ 32768 && option_value_value !== (option_value_value = /*option*/ ctx[69].value)) {
7201
+ if (dirty[0] & /*_options*/ 131072 && option_value_value !== (option_value_value = /*option*/ ctx[61].value)) {
7225
7202
  option.__value = option_value_value;
7226
7203
  option.value = option.__value;
7227
7204
  }
@@ -7238,7 +7215,7 @@ function create_fragment$J(ctx) {
7238
7215
  let div_style_value;
7239
7216
 
7240
7217
  function select_block_type(ctx, dirty) {
7241
- if (/*_native*/ ctx[22]) return create_if_block$o;
7218
+ if (/*_native*/ ctx[16]) return create_if_block$o;
7242
7219
  return create_else_block$a;
7243
7220
  }
7244
7221
 
@@ -7250,20 +7227,20 @@ function create_fragment$J(ctx) {
7250
7227
  div = element("div");
7251
7228
  if_block.c();
7252
7229
  this.c = noop;
7253
- attr(div, "data-testid", div_data_testid_value = `${/*name*/ ctx[1]}-dropdown`);
7230
+ attr(div, "data-testid", div_data_testid_value = `${/*name*/ ctx[0]}-dropdown`);
7254
7231
  attr(div, "class", "dropdown");
7255
7232
 
7256
7233
  attr(div, "style", div_style_value = `
7234
+ --width: ${/*_width*/ ctx[19]};
7257
7235
  ${calculateMargin(/*mt*/ ctx[10], /*mr*/ ctx[11], /*mb*/ ctx[12], /*ml*/ ctx[13])}
7258
- --width: ${/*_width*/ ctx[24]}
7259
7236
  `);
7260
7237
 
7261
- toggle_class(div, "dropdown-native", /*_native*/ ctx[22]);
7238
+ toggle_class(div, "dropdown-native", /*_native*/ ctx[16]);
7262
7239
  },
7263
7240
  m(target, anchor) {
7264
7241
  insert(target, div, anchor);
7265
7242
  if_block.m(div, null);
7266
- /*div_binding*/ ctx[48](div);
7243
+ /*div_binding*/ ctx[45](div);
7267
7244
  },
7268
7245
  p(ctx, dirty) {
7269
7246
  if (current_block_type === (current_block_type = select_block_type(ctx)) && if_block) {
@@ -7278,19 +7255,19 @@ function create_fragment$J(ctx) {
7278
7255
  }
7279
7256
  }
7280
7257
 
7281
- if (dirty[0] & /*name*/ 2 && div_data_testid_value !== (div_data_testid_value = `${/*name*/ ctx[1]}-dropdown`)) {
7258
+ if (dirty[0] & /*name*/ 1 && div_data_testid_value !== (div_data_testid_value = `${/*name*/ ctx[0]}-dropdown`)) {
7282
7259
  attr(div, "data-testid", div_data_testid_value);
7283
7260
  }
7284
7261
 
7285
- if (dirty[0] & /*mt, mr, mb, ml, _width*/ 16792576 && div_style_value !== (div_style_value = `
7262
+ if (dirty[0] & /*_width, mt, mr, mb, ml*/ 539648 && div_style_value !== (div_style_value = `
7263
+ --width: ${/*_width*/ ctx[19]};
7286
7264
  ${calculateMargin(/*mt*/ ctx[10], /*mr*/ ctx[11], /*mb*/ ctx[12], /*ml*/ ctx[13])}
7287
- --width: ${/*_width*/ ctx[24]}
7288
7265
  `)) {
7289
7266
  attr(div, "style", div_style_value);
7290
7267
  }
7291
7268
 
7292
- if (dirty[0] & /*_native*/ 4194304) {
7293
- toggle_class(div, "dropdown-native", /*_native*/ ctx[22]);
7269
+ if (dirty[0] & /*_native*/ 65536) {
7270
+ toggle_class(div, "dropdown-native", /*_native*/ ctx[16]);
7294
7271
  }
7295
7272
  },
7296
7273
  i: noop,
@@ -7298,16 +7275,11 @@ function create_fragment$J(ctx) {
7298
7275
  d(detaching) {
7299
7276
  if (detaching) detach(div);
7300
7277
  if_block.d();
7301
- /*div_binding*/ ctx[48](null);
7278
+ /*div_binding*/ ctx[45](null);
7302
7279
  }
7303
7280
  };
7304
7281
  }
7305
7282
 
7306
- function isPrintableCharacter(inputChar) {
7307
- return inputChar.length === 1 && inputChar.match(/\S| /) != null;
7308
- }
7309
-
7310
- // parse and convert values to strings to avoid later type comparison issues
7311
7283
  function parseValues(selectedValue) {
7312
7284
  let rawValue;
7313
7285
 
@@ -7323,30 +7295,12 @@ function parseValues(selectedValue) {
7323
7295
  return rawValues.map(val => `${val}`);
7324
7296
  }
7325
7297
 
7326
- function isMatched(option, query) {
7327
- if (query.length === 0) return true;
7328
-
7329
- // in case query is "white whale", "b c"
7330
- const queryWords = query.toLowerCase().split(/\s+/);
7331
-
7332
- //In case option is "white whale", "american samoa"
7333
- const filterWords = option.filter.toLowerCase().split(/\s+/);
7334
-
7335
- /**
7336
- * "b c" should not match "bc", "red " should not match "red"
7337
- * but "american sa" should match "american samoa"
7338
- */
7339
- if (query.endsWith(" ") || queryWords.length > 1) {
7340
- if (queryWords.length !== filterWords.length) return false;
7341
-
7342
- return queryWords.every((word, index) => index === queryWords.length - 1
7343
- ? filterWords[index].startsWith(word)
7344
- : filterWords[index] === word); // last word should be prefix match: american sa ==> american samoa
7345
- // other words should be exact match: b c should not match bc
7346
- }
7347
-
7348
- // Single-word query "al" for "Alabama"
7349
- return filterWords.some(word => word.startsWith(queryWords[0]));
7298
+ function isFilterMatch(option, filter) {
7299
+ if (filter.length === 0) return true;
7300
+ let value = option.filter || option.label || option.value;
7301
+ value = value.toLowerCase();
7302
+ filter = filter.toLowerCase();
7303
+ return value.startsWith(filter) || value.includes(" " + filter);
7350
7304
  }
7351
7305
 
7352
7306
  function instance$G($$self, $$props, $$invalidate) {
@@ -7355,7 +7309,6 @@ function instance$G($$self, $$props, $$invalidate) {
7355
7309
  let _multiselect;
7356
7310
  let _native;
7357
7311
  let _filterable;
7358
- let _filteredOptions;
7359
7312
  let _activeDescendantId;
7360
7313
  let { name } = $$props;
7361
7314
  let { arialabel = "" } = $$props;
@@ -7375,47 +7328,107 @@ function instance$G($$self, $$props, $$invalidate) {
7375
7328
  let { mr = null } = $$props;
7376
7329
  let { mb = null } = $$props;
7377
7330
  let { ml = null } = $$props;
7378
- let { id = "" } = $$props;
7379
7331
 
7332
+ //
7380
7333
  // Private
7381
- let _values = [];
7382
-
7334
+ //
7383
7335
  let _options = [];
7384
- let _inputValue = "";
7336
+
7385
7337
  let _isMenuVisible = false;
7386
- let _highlightedIndex = -1; // keep track highlighted option, for arrow up/down
7338
+ let _highlightedIndex = -1;
7387
7339
  let _width;
7388
- let _selectedOption = undefined; // to keep track if value is matched to combobox option
7389
- let _previousSelectedValue = ""; // to keep track if value is changed from previously selected value - for clear button
7390
- let _inputWidth;
7391
- let _el;
7340
+ let _rootEl;
7392
7341
  let _menuEl;
7393
7342
  let _selectEl;
7394
7343
  let _inputEl;
7344
+ let _eventHandler;
7345
+ let _isDirty = false;
7346
+ let _filteredOptions = [];
7347
+ let _values = [];
7395
7348
 
7396
- afterUpdate(() => {
7397
- if (_options.length === 0) return;
7349
+ //
7350
+ // Hooks
7351
+ //
7352
+ onMount(async () => {
7353
+ var _a, _b;
7398
7354
 
7399
- _isMenuVisible
7400
- ? _inputEl.focus()
7401
- : updateInputValue(_selectedOption);
7402
- });
7355
+ _eventHandler = _filterable
7356
+ ? new ComboboxKeyUpHandler(_inputEl)
7357
+ : new DropdownKeyUpHandler(_inputEl);
7358
+
7359
+ // the following is required to appease the jest testing gods in that they don't respond
7360
+ // to the slotchange event
7361
+ $$invalidate(17, _options = getOptions());
7362
+
7363
+ if (!_native) {
7364
+ $$invalidate(
7365
+ 23,
7366
+ _inputEl.value = (_b = (_a = _options.find(o => o.value === value)) === null || _a === void 0
7367
+ ? void 0
7368
+ : _a.label) !== null && _b !== void 0
7369
+ ? _b
7370
+ : "",
7371
+ _inputEl
7372
+ );
7373
+
7374
+ $$invalidate(19, _width = width || calculateWidth(_options));
7375
+ }
7376
+
7377
+ syncFilteredOptions();
7403
7378
 
7404
- onMount(async () => {
7405
7379
  // watch for DOM changes within the slot => dynamic binding
7406
- const slot = _el.querySelector("slot");
7380
+ const slot = _rootEl.querySelector("slot");
7407
7381
 
7408
7382
  slot === null || slot === void 0
7409
7383
  ? void 0
7410
- : slot.addEventListener("slotchange", _e => {
7411
- _values = parseValues(value);
7412
- $$invalidate(15, _options = getOptions());
7384
+ : slot.addEventListener("slotchange", _ => {
7385
+ var _a, _b;
7386
+ $$invalidate(17, _options = getOptions());
7387
+ syncFilteredOptions();
7388
+ $$invalidate(19, _width = width || calculateWidth(_options));
7389
+
7390
+ if (!_native) {
7391
+ $$invalidate(
7392
+ 23,
7393
+ _inputEl.value = (_b = (_a = _options.find(o => o.value === value)) === null || _a === void 0
7394
+ ? void 0
7395
+ : _a.label) !== null && _b !== void 0
7396
+ ? _b
7397
+ : "",
7398
+ _inputEl
7399
+ );
7400
+ }
7413
7401
  });
7414
7402
  });
7415
7403
 
7404
+ //
7416
7405
  // Functions
7406
+ //
7407
+ // prevents unwanted reactive updates.
7408
+ function setDisplayedValue() {
7409
+ var _a, _b;
7410
+
7411
+ if (_inputEl) {
7412
+ const option = _options.find(o => o.value == _values[0]); // possible string number comparison
7413
+
7414
+ $$invalidate(
7415
+ 23,
7416
+ _inputEl.value = (_b = (_a = option === null || option === void 0
7417
+ ? void 0
7418
+ : option.label) !== null && _a !== void 0
7419
+ ? _a
7420
+ : option === null || option === void 0
7421
+ ? void 0
7422
+ : option.value) !== null && _b !== void 0
7423
+ ? _b
7424
+ : "",
7425
+ _inputEl
7426
+ );
7427
+ }
7428
+ }
7429
+
7417
7430
  function getChildren() {
7418
- const slot = _el.querySelector("slot");
7431
+ const slot = _rootEl.querySelector("slot");
7419
7432
 
7420
7433
  if (slot) {
7421
7434
  // default
@@ -7423,7 +7436,7 @@ function instance$G($$self, $$props, $$invalidate) {
7423
7436
  }
7424
7437
 
7425
7438
  // unit tests
7426
- const el = _native ? _selectEl : _el;
7439
+ const el = _native ? _selectEl : _rootEl;
7427
7440
 
7428
7441
  return [...el.children];
7429
7442
  }
@@ -7432,9 +7445,7 @@ function instance$G($$self, $$props, $$invalidate) {
7432
7445
  // The children don't have to be goa-dropdown-item elements. Any child element
7433
7446
  // work as long as it has a value and label content
7434
7447
  function getOptions() {
7435
- const children = getChildren();
7436
-
7437
- return children.filter(child => child.tagName === "GOA-DROPDOWN-ITEM").map(el => {
7448
+ return getChildren().filter(child => child.tagName === "GOA-DROPDOWN-ITEM").map(el => {
7438
7449
  const option = el;
7439
7450
  const value = el.getAttribute("value") || option.value || "";
7440
7451
  const label = el.getAttribute("label") || option.label || el.innerHTML || value;
@@ -7443,8 +7454,8 @@ function instance$G($$self, $$props, $$invalidate) {
7443
7454
  });
7444
7455
  }
7445
7456
 
7446
- // compute the required width to enure all children fit
7447
- function getCustomDropdownWidth(options) {
7457
+ // compute the required width to ensure all children fit
7458
+ function calculateWidth(options) {
7448
7459
  // set width to longest item
7449
7460
  const optionsWidth = options.map(option => {
7450
7461
  const label = `${option.label}` || `${option.value}` || "";
@@ -7462,18 +7473,9 @@ function instance$G($$self, $$props, $$invalidate) {
7462
7473
  return `${maxWidth}ch`;
7463
7474
  }
7464
7475
 
7465
- function isOptionInView(node) {
7466
- const liOptionRect = node.getBoundingClientRect();
7467
- const ulRect = _menuEl.getBoundingClientRect();
7468
- return liOptionRect.top >= 0 && liOptionRect.left >= 0 && liOptionRect.bottom <= ulRect.height && liOptionRect.right <= ulRect.width;
7469
- }
7470
-
7471
- /**
7472
- * Change the direction of highlighted options for Arrow up and down
7473
- * @param position: -1 for previous option, +1 for next option
7474
- */
7475
- function changeHighlightedOption(position) {
7476
- let index = _highlightedIndex + position;
7476
+ // Change the direction of highlighted options for Arrow up and down
7477
+ function changeHighlightedOption(offset) {
7478
+ let index = _highlightedIndex + offset;
7477
7479
 
7478
7480
  let items = !(_filteredOptions === null || _filteredOptions === void 0
7479
7481
  ? void 0
@@ -7490,465 +7492,375 @@ function instance$G($$self, $$props, $$invalidate) {
7490
7492
  index = _filterable ? 0 : items.length - 1;
7491
7493
  }
7492
7494
 
7493
- $$invalidate(17, _highlightedIndex = index);
7495
+ $$invalidate(14, _highlightedIndex = index);
7494
7496
  scrollToOption(index);
7495
7497
  }
7496
7498
 
7497
7499
  function scrollToOption(index) {
7498
- const liNode = _menuEl.querySelector(`li[data-index='${index}']`);
7500
+ const liNode = _menuEl.querySelector(`li[data-index="${index}"]`);
7499
7501
  if (!liNode) return;
7500
- if (isOptionInView(liNode)) return;
7502
+ const liOptionRect = liNode.getBoundingClientRect();
7503
+ const ulRect = _menuEl.getBoundingClientRect();
7504
+ const isInView = liOptionRect.top >= 0 && liOptionRect.left >= 0 && liOptionRect.bottom <= ulRect.height && liOptionRect.right <= ulRect.width;
7505
+ if (isInView) return;
7501
7506
  liNode.scrollIntoView({ behavior: "smooth", block: "nearest" });
7502
7507
  }
7503
7508
 
7504
- /**
7505
- * Update the dropdown selected style/attribute based on new value
7506
- * @param selectedValue
7507
- */
7508
- function setSelectedOption(selectedValue) {
7509
- return _filterable
7510
- ? setSelectedOptionByInputValue()
7511
- : _selectedOption = _options.find(item => item.value === selectedValue);
7509
+ function syncFilteredOptions() {
7510
+ $$invalidate(15, _filteredOptions = _filterable
7511
+ ? _options.filter(option => isFilterMatch(option, _inputEl.value))
7512
+ : _options);
7512
7513
  }
7513
7514
 
7514
- /**
7515
- * Update according to input's value (for filterable dropdown)
7516
- */
7517
- function setSelectedOptionByInputValue() {
7518
- const filteredItems = _options.filter(item => isMatched(item, _inputValue));
7519
- const isTypingInputMatchedOption = filteredItems.length === 1 && _isMenuVisible;
7520
-
7521
- if (!isTypingInputMatchedOption) {
7522
- // follow local value
7523
- _selectedOption = _options.find(item => item.value === value);
7524
-
7515
+ function showMenu() {
7516
+ if (_disabled) {
7525
7517
  return;
7526
7518
  }
7527
7519
 
7528
- _selectedOption = filteredItems[0];
7529
- updateInputValue(_selectedOption);
7530
- $$invalidate(29, _activeDescendantId = undefined);
7520
+ setTimeout(
7521
+ () => {
7522
+ syncFilteredOptions();
7523
+ $$invalidate(18, _isMenuVisible = true);
7524
+ _inputEl.focus();
7525
+ },
7526
+ 0
7527
+ );
7531
7528
  }
7532
7529
 
7533
- /**
7534
- * Update input's value according to selected dropdown option
7535
- * @param option
7536
- */
7537
- function updateInputValue(option) {
7538
- $$invalidate(17, _highlightedIndex = -1);
7539
- $$invalidate(16, _inputValue = option ? option.label : "");
7540
- $$invalidate(0, value = option ? option.value : "");
7530
+ function hideMenu() {
7531
+ $$invalidate(18, _isMenuVisible = false);
7532
+ }
7533
+
7534
+ function dispatchValue(value) {
7535
+ const detail = _multiselect
7536
+ ? { name, values: [value, ..._values] }
7537
+ : { name, value };
7538
+
7539
+ setTimeout(
7540
+ () => {
7541
+ _rootEl.dispatchEvent(new CustomEvent("_change", { composed: true, detail }));
7542
+ _isDirty = false;
7543
+ },
7544
+ 1
7545
+ );
7546
+ }
7547
+
7548
+ //
7549
+ // Event handlers
7550
+ //
7551
+ function onSelect(option) {
7552
+ if (_disabled) return;
7541
7553
 
7542
- if (!option) {
7543
- $$invalidate(29, _activeDescendantId = undefined);
7554
+ if (!_native) {
7555
+ _isDirty = true;
7556
+ hideMenu();
7557
+ $$invalidate(23, _inputEl.value = option.label, _inputEl);
7544
7558
  }
7559
+
7560
+ dispatchValue(option.value);
7545
7561
  }
7546
7562
 
7547
- /**
7548
- * Keep track the component's local value based on new selected value
7549
- * @param newSelectedValue
7550
- */
7551
- function updateSelectedValue(newSelectedValue) {
7552
- if (_previousSelectedValue !== newSelectedValue) {
7553
- _previousSelectedValue = newSelectedValue;
7554
- setSelectedOption(newSelectedValue);
7555
- _values = [value]; // Keep track _values, for multiSelect later
7556
- dispatchValue(value);
7563
+ function onInputKeyUp(e) {
7564
+ if (_disabled) return;
7565
+ _eventHandler.handleKeyUp(e);
7566
+ }
7567
+
7568
+ function onInputKeyDown(e) {
7569
+ if (_disabled) return;
7570
+ _eventHandler.handleKeyDown(e);
7571
+ }
7572
+
7573
+ function onClearIconKeyDown(e) {
7574
+ if (e.key === "Enter" || e.key === " ") {
7575
+ e.stopPropagation();
7576
+ reset();
7577
+ showMenu();
7557
7578
  }
7558
7579
  }
7559
7580
 
7560
- function showMenu() {
7561
- if (_disabled) {
7562
- return;
7581
+ function onClearIconClick(e) {
7582
+ reset();
7583
+ showMenu();
7584
+ e.stopPropagation();
7585
+ }
7586
+
7587
+ function onNativeSelect(e) {
7588
+ const target = e.currentTarget;
7589
+ const option = _options[target.selectedIndex];
7590
+ onSelect(option);
7591
+ }
7592
+
7593
+ function reset() {
7594
+ if (_disabled) return;
7595
+ $$invalidate(25, _activeDescendantId = undefined);
7596
+ $$invalidate(14, _highlightedIndex = -1);
7597
+ $$invalidate(23, _inputEl.value = "", _inputEl);
7598
+ _isDirty = false;
7599
+ syncFilteredOptions();
7600
+ dispatchValue("");
7601
+ }
7602
+
7603
+ function onChevronClick(e) {
7604
+ showMenu();
7605
+ e.stopPropagation();
7606
+ }
7607
+
7608
+ class ComboboxKeyUpHandler {
7609
+ constructor(input) {
7610
+ this.input = input;
7611
+
7612
+ input.addEventListener("blur", async e => {
7613
+ if (!_isDirty) return;
7614
+ if (!_filterable) return;
7615
+ const input = e.target;
7616
+ const selectedOption = _filteredOptions.find(o => o.label === input.value);
7617
+
7618
+ if (!selectedOption) {
7619
+ dispatchValue("");
7620
+ input.value = "";
7621
+ }
7622
+ });
7623
+ }
7624
+
7625
+ onEscape(e) {
7626
+ reset();
7627
+ _inputEl.focus();
7628
+ e.preventDefault();
7629
+ e.stopPropagation();
7563
7630
  }
7564
7631
 
7565
- $$invalidate(23, _isMenuVisible = true);
7566
- }
7632
+ onEnter(e) {
7633
+ const option = _filteredOptions[_highlightedIndex];
7567
7634
 
7568
- function closeMenu() {
7569
- $$invalidate(23, _isMenuVisible = false);
7570
- }
7635
+ if (option) {
7636
+ onSelect(option);
7637
+ }
7571
7638
 
7572
- function dispatchValue(optionValue) {
7573
- const option = _options.find(item => item.value === optionValue);
7574
- const newValue = option ? option.value : "";
7575
- let detail;
7639
+ if (_inputEl.value) {
7640
+ hideMenu();
7641
+ } else {
7642
+ showMenu();
7643
+ }
7576
7644
 
7577
- if (_multiselect) {
7578
- _values.push(newValue);
7579
- detail = { name, values: _values };
7580
- } else {
7581
- _values = [newValue];
7582
- detail = { name, value: newValue };
7645
+ e.stopPropagation();
7583
7646
  }
7584
7647
 
7585
- _el.dispatchEvent(new CustomEvent("_change", { composed: true, detail }));
7586
- }
7648
+ onArrow(e, direction) {
7649
+ if (!_isMenuVisible) showMenu();
7650
+ changeHighlightedOption(direction === "up" ? -1 : 1);
7651
+ e.stopPropagation();
7652
+ }
7587
7653
 
7588
- // Event handlers
7589
- function onSelect(option) {
7590
- if (_disabled) return;
7591
- $$invalidate(0, value = option.value);
7592
- _selectedOption = option;
7654
+ onTab(_) {
7655
+ const matchedOption = _filteredOptions.find(option => option.label.toLowerCase() === this.input.value.toLowerCase());
7593
7656
 
7594
- if (!_native) {
7595
- closeMenu();
7596
- $$invalidate(16, _inputValue = option.label);
7597
- _inputEl.focus();
7657
+ if (matchedOption) {
7658
+ onSelect(matchedOption);
7659
+ }
7660
+
7661
+ hideMenu();
7598
7662
  }
7599
- }
7600
7663
 
7601
- function ComboboxKeyDownHandler() {
7602
- const handle = e => {
7603
- let stopPropagation = false;
7664
+ onKeyUp(_) {
7665
+ showMenu();
7666
+ _isDirty = true;
7667
+ }
7604
7668
 
7669
+ handleKeyUp(e) {
7605
7670
  switch (e.key) {
7606
7671
  case "Enter":
7607
- onEnter();
7608
- stopPropagation = true;
7609
- break;
7610
- case "Escape":
7611
- case 'Esc':
7612
- closeMenu();
7613
- removeSelectedValue();
7614
- stopPropagation = true;
7672
+ this.onEnter(e);
7615
7673
  break;
7616
- case 'Up':
7617
7674
  case "ArrowUp":
7618
- onArrowUp();
7619
- stopPropagation = true;
7675
+ this.onArrow(e, "up");
7620
7676
  break;
7621
- case "Down":
7622
7677
  case "ArrowDown":
7623
- onArrowDown();
7624
- stopPropagation = true;
7625
- break;
7626
- case "Tab":
7627
- closeMenu();
7628
- break;
7629
- case 'Home':
7630
- _inputEl.setSelectionRange(0, 0);
7631
- stopPropagation = true;
7632
- break;
7633
- case 'End':
7634
- _inputEl.setSelectionRange(_inputValue.length, _inputValue.length);
7635
- stopPropagation = true;
7678
+ this.onArrow(e, "down");
7636
7679
  break;
7637
- case 'Backspace':
7638
- if (_inputValue.length === 0) {
7639
- // backspace should not open the filterable dropdown if input has no words
7640
- stopPropagation = true;
7641
-
7642
- return;
7643
- }
7644
- onBackspace();
7680
+ case "Home":
7681
+ this.input.setSelectionRange(0, 0);
7645
7682
  break;
7646
- case ' ':
7647
- if (_inputValue.length === 0) {
7648
- // space should not open the filterable dropdown if input has no words
7649
- stopPropagation = true;
7650
- }
7683
+ case "End":
7684
+ this.input.setSelectionRange(this.input.value.length, this.input.value.length);
7651
7685
  break;
7652
7686
  default:
7653
- if (isPrintableCharacter(e.key)) {
7654
- if (!_isMenuVisible) {
7655
- showMenu();
7656
- }
7657
-
7658
- if (!_inputValue.length) {
7659
- removeSelectedValue();
7660
- }
7661
- }
7687
+ this.onKeyUp(e);
7662
7688
  break;
7663
7689
  }
7690
+ }
7664
7691
 
7665
- if (stopPropagation) {
7666
- e.preventDefault();
7667
- e.stopPropagation();
7668
- }
7669
- };
7670
-
7671
- const onEnter = () => {
7672
- $$invalidate(23, _isMenuVisible = !_isMenuVisible);
7673
-
7674
- if (_highlightedIndex < 0) {
7675
- const matchedOption = _filteredOptions.find(option => option.label.toLowerCase() === (_inputValue === null || _inputValue === void 0
7676
- ? void 0
7677
- : _inputValue.toLowerCase()));
7678
-
7679
- selectOption(matchedOption);
7680
- return;
7692
+ handleKeyDown(e) {
7693
+ switch (e.key) {
7694
+ case "Escape":
7695
+ this.onEscape(e);
7696
+ break;
7697
+ case "Tab":
7698
+ this.onTab(e);
7699
+ break;
7681
7700
  }
7701
+ }
7702
+ }
7682
7703
 
7683
- const highlightedOption = _filteredOptions[_highlightedIndex];
7684
- selectOption(highlightedOption);
7685
- $$invalidate(17, _highlightedIndex = -1); // reset highlighted option
7686
- };
7687
-
7688
- const onArrowUp = () => {
7689
- showMenu();
7690
- changeHighlightedOption(-1);
7691
- };
7692
-
7693
- const onArrowDown = () => {
7694
- showMenu();
7695
- changeHighlightedOption(1);
7696
- };
7697
-
7698
- const onBackspace = () => {
7699
- showMenu();
7704
+ class DropdownKeyUpHandler {
7705
+ constructor(_input) {
7706
+
7707
+ }
7700
7708
 
7701
- if (_inputValue.length === 1) {
7702
- removeSelectedValue();
7703
- }
7704
- };
7709
+ onEnter(e) {
7710
+ if (_isMenuVisible) {
7711
+ const option = _filteredOptions[_highlightedIndex];
7705
7712
 
7706
- const selectOption = option => {
7707
- closeMenu();
7713
+ if (option) {
7714
+ onSelect(option);
7715
+ }
7708
7716
 
7709
- if (option) {
7710
- $$invalidate(16, _inputValue = option.label);
7711
- _selectedOption = option;
7712
- $$invalidate(0, value = option.value);
7717
+ hideMenu();
7718
+ } else {
7719
+ showMenu();
7713
7720
  }
7714
- };
7715
7721
 
7716
- return { handle };
7717
- }
7722
+ e.preventDefault();
7723
+ e.stopPropagation();
7724
+ }
7718
7725
 
7719
- function DropdownKeyDownHandler() {
7720
- const handle = e => {
7721
- let stopPropagation = false;
7726
+ onArrow(e, direction) {
7727
+ if (!_isMenuVisible) showMenu();
7728
+ changeHighlightedOption(direction === "up" ? -1 : 1);
7729
+ e.preventDefault();
7730
+ e.stopPropagation();
7731
+ }
7722
7732
 
7733
+ handleKeyDown(e) {
7723
7734
  switch (e.key) {
7724
7735
  case " ":
7725
- onSpace();
7726
- stopPropagation = true;
7727
- break;
7728
7736
  case "Enter":
7729
- onEnter();
7730
- stopPropagation = true;
7731
- break;
7732
- case "Escape":
7733
- closeMenu();
7737
+ this.onEnter(e);
7734
7738
  break;
7735
- case "Up":
7736
7739
  case "ArrowUp":
7737
- onArrowUp();
7738
- stopPropagation = true;
7740
+ this.onArrow(e, "up");
7739
7741
  break;
7740
- case "Down":
7741
7742
  case "ArrowDown":
7742
- onArrowDown();
7743
- stopPropagation = true;
7743
+ this.onArrow(e, "down");
7744
7744
  break;
7745
7745
  case "Tab":
7746
- closeMenu();
7746
+ hideMenu();
7747
7747
  break;
7748
7748
  }
7749
7749
 
7750
- if (stopPropagation) {
7751
- e.preventDefault();
7752
- e.stopPropagation();
7753
- }
7754
- };
7755
-
7756
- const onSpace = () => {
7757
- $$invalidate(23, _isMenuVisible = !_isMenuVisible); // toggle menu
7758
- if (_highlightedIndex > -1 && _filteredOptions[_highlightedIndex].value !== value) $$invalidate(0, value = _filteredOptions[_highlightedIndex].value);
7759
- };
7760
-
7761
- const onEnter = () => {
7762
- $$invalidate(23, _isMenuVisible = !_isMenuVisible);
7763
-
7764
- if (_highlightedIndex > -1 && _filteredOptions[_highlightedIndex].value !== value) {
7765
- $$invalidate(0, value = _filteredOptions[_highlightedIndex].value);
7766
- closeMenu();
7767
- }
7768
- };
7769
-
7770
- const onArrowUp = () => {
7771
- if (!_isMenuVisible) showMenu();
7772
- changeHighlightedOption(-1);
7773
- };
7774
-
7775
- const onArrowDown = () => {
7776
- if (!_isMenuVisible) showMenu();
7777
- changeHighlightedOption(1);
7778
- };
7779
-
7780
- return { handle };
7781
- }
7782
-
7783
- const comboboxHandler = ComboboxKeyDownHandler();
7784
- const dropdownHandler = DropdownKeyDownHandler();
7785
-
7786
- const onInputKeyDown = e => {
7787
- if (_disabled) return;
7788
-
7789
- if (_filterable) {
7790
- comboboxHandler.handle(e);
7791
- } else {
7792
- dropdownHandler.handle(e);
7750
+ return false;
7793
7751
  }
7794
- };
7795
-
7796
- function onNativeSelect(e) {
7797
- const target = e.currentTarget;
7798
- const option = _options[target.selectedIndex];
7799
- onSelect(option);
7800
- }
7801
-
7802
- function removeSelectedValue() {
7803
- if (_disabled) return;
7804
- _previousSelectedValue = null;
7805
- _selectedOption = undefined;
7806
- updateInputValue(_selectedOption);
7807
- }
7808
7752
 
7809
- async function onClick() {
7810
- if (_disabled) return;
7811
- showMenu();
7812
-
7813
- if (_filterable) {
7814
- await tick();
7815
- _inputEl.focus();
7753
+ handleKeyUp(e) {
7754
+ switch (e.key) {
7755
+ case "ArrowUp":
7756
+ case "ArrowDown":
7757
+ case " ":
7758
+ case "Enter":
7759
+ e.preventDefault();
7760
+ e.stopPropagation();
7761
+ }
7816
7762
  }
7817
7763
  }
7818
7764
 
7819
- function onClear() {
7820
- removeSelectedValue();
7821
- _inputEl.focus();
7822
- onClick();
7823
- }
7824
-
7825
7765
  function select_binding($$value) {
7826
7766
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
7827
7767
  _selectEl = $$value;
7828
- $$invalidate(27, _selectEl);
7829
- ((((($$invalidate(15, _options), $$invalidate(18, _el)), $$invalidate(0, value)), $$invalidate(22, _native)), $$invalidate(7, width)), $$invalidate(41, native));
7768
+ $$invalidate(22, _selectEl);
7769
+ $$invalidate(17, _options);
7830
7770
  });
7831
7771
  }
7832
7772
 
7833
7773
  function input_binding($$value) {
7834
7774
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
7835
7775
  _inputEl = $$value;
7836
- $$invalidate(19, _inputEl);
7776
+ $$invalidate(23, _inputEl);
7837
7777
  });
7838
7778
  }
7839
7779
 
7840
- function input_input_handler() {
7841
- _inputValue = this.value;
7842
- $$invalidate(16, _inputValue);
7843
- }
7844
-
7845
- const keydown_handler = e => {
7846
- if (e.key === 'Enter') {
7847
- // for keyboard accessibility to press the clear icon
7848
- onClear();
7849
- }
7850
- };
7851
-
7852
7780
  const click_handler = option => onSelect(option);
7853
7781
 
7854
7782
  function ul_binding($$value) {
7855
7783
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
7856
7784
  _menuEl = $$value;
7857
- $$invalidate(26, _menuEl);
7785
+ $$invalidate(21, _menuEl);
7858
7786
  });
7859
7787
  }
7860
7788
 
7861
7789
  function div_binding($$value) {
7862
7790
  binding_callbacks[$$value ? 'unshift' : 'push'](() => {
7863
- _el = $$value;
7864
- $$invalidate(18, _el);
7791
+ _rootEl = $$value;
7792
+ $$invalidate(20, _rootEl);
7865
7793
  });
7866
7794
  }
7867
7795
 
7868
7796
  $$self.$$set = $$props => {
7869
- if ('name' in $$props) $$invalidate(1, name = $$props.name);
7870
- if ('arialabel' in $$props) $$invalidate(2, arialabel = $$props.arialabel);
7871
- if ('arialabelledby' in $$props) $$invalidate(3, arialabelledby = $$props.arialabelledby);
7872
- if ('value' in $$props) $$invalidate(0, value = $$props.value);
7873
- if ('filterable' in $$props) $$invalidate(38, filterable = $$props.filterable);
7797
+ if ('name' in $$props) $$invalidate(0, name = $$props.name);
7798
+ if ('arialabel' in $$props) $$invalidate(1, arialabel = $$props.arialabel);
7799
+ if ('arialabelledby' in $$props) $$invalidate(2, arialabelledby = $$props.arialabelledby);
7800
+ if ('value' in $$props) $$invalidate(3, value = $$props.value);
7801
+ if ('filterable' in $$props) $$invalidate(37, filterable = $$props.filterable);
7874
7802
  if ('leadingicon' in $$props) $$invalidate(4, leadingicon = $$props.leadingicon);
7875
7803
  if ('maxheight' in $$props) $$invalidate(5, maxheight = $$props.maxheight);
7876
7804
  if ('placeholder' in $$props) $$invalidate(6, placeholder = $$props.placeholder);
7877
7805
  if ('width' in $$props) $$invalidate(7, width = $$props.width);
7878
7806
  if ('disabled' in $$props) $$invalidate(8, disabled = $$props.disabled);
7879
- if ('error' in $$props) $$invalidate(39, error = $$props.error);
7880
- if ('multiselect' in $$props) $$invalidate(40, multiselect = $$props.multiselect);
7881
- if ('native' in $$props) $$invalidate(41, native = $$props.native);
7807
+ if ('error' in $$props) $$invalidate(38, error = $$props.error);
7808
+ if ('multiselect' in $$props) $$invalidate(39, multiselect = $$props.multiselect);
7809
+ if ('native' in $$props) $$invalidate(40, native = $$props.native);
7882
7810
  if ('relative' in $$props) $$invalidate(9, relative = $$props.relative);
7883
7811
  if ('mt' in $$props) $$invalidate(10, mt = $$props.mt);
7884
7812
  if ('mr' in $$props) $$invalidate(11, mr = $$props.mr);
7885
7813
  if ('mb' in $$props) $$invalidate(12, mb = $$props.mb);
7886
7814
  if ('ml' in $$props) $$invalidate(13, ml = $$props.ml);
7887
- if ('id' in $$props) $$invalidate(14, id = $$props.id);
7888
7815
  };
7889
7816
 
7890
7817
  $$self.$$.update = () => {
7891
7818
  if ($$self.$$.dirty[0] & /*disabled*/ 256) {
7892
- $$invalidate(28, _disabled = toBoolean(disabled));
7819
+ //
7820
+ // Reactive
7821
+ //
7822
+ $$invalidate(26, _disabled = toBoolean(disabled));
7893
7823
  }
7894
7824
 
7895
- if ($$self.$$.dirty[1] & /*error*/ 256) {
7896
- $$invalidate(30, _error = toBoolean(error));
7825
+ if ($$self.$$.dirty[1] & /*error*/ 128) {
7826
+ $$invalidate(27, _error = toBoolean(error));
7897
7827
  }
7898
7828
 
7899
- if ($$self.$$.dirty[1] & /*multiselect*/ 512) {
7829
+ if ($$self.$$.dirty[1] & /*multiselect*/ 256) {
7900
7830
  _multiselect = toBoolean(multiselect);
7901
7831
  }
7902
7832
 
7903
- if ($$self.$$.dirty[1] & /*native*/ 1024) {
7904
- $$invalidate(22, _native = toBoolean(native));
7905
- }
7906
-
7907
- if ($$self.$$.dirty[0] & /*_native*/ 4194304 | $$self.$$.dirty[1] & /*filterable*/ 128) {
7908
- $$invalidate(20, _filterable = toBoolean(filterable) && !_native); // Will replace datalist for filterable true
7909
- }
7910
-
7911
- if ($$self.$$.dirty[0] & /*_el, value, _native, width, _options*/ 4489345) {
7912
- // Reactive statement
7913
- if (_el) {
7914
- _values = parseValues(value);
7915
- $$invalidate(15, _options = getOptions());
7916
-
7917
- if (!_native) {
7918
- $$invalidate(24, _width = width || getCustomDropdownWidth(_options));
7919
- }
7920
-
7921
- if (_options.length) {
7922
- updateSelectedValue(value);
7923
- }
7924
- }
7833
+ if ($$self.$$.dirty[1] & /*native*/ 512) {
7834
+ $$invalidate(16, _native = toBoolean(native));
7925
7835
  }
7926
7836
 
7927
- if ($$self.$$.dirty[0] & /*_filterable, _options, _inputValue*/ 1146880) {
7928
- $$invalidate(21, _filteredOptions = _filterable
7929
- ? _options.filter(option => isMatched(option, _inputValue))
7930
- : _options);
7837
+ if ($$self.$$.dirty[0] & /*_native*/ 65536 | $$self.$$.dirty[1] & /*filterable*/ 64) {
7838
+ $$invalidate(24, _filterable = toBoolean(filterable) && !_native);
7931
7839
  }
7932
7840
 
7933
- if ($$self.$$.dirty[0] & /*_filteredOptions, _highlightedIndex*/ 2228224) {
7934
- // Accessibility
7935
- $$invalidate(29, _activeDescendantId = _filteredOptions[_highlightedIndex]
7841
+ if ($$self.$$.dirty[0] & /*_filteredOptions, _highlightedIndex*/ 49152) {
7842
+ // To keep track of active descendant for the accessibility
7843
+ $$invalidate(25, _activeDescendantId = _filteredOptions[_highlightedIndex]
7936
7844
  ? _filteredOptions[_highlightedIndex].value
7937
- : undefined); //To keep track of active descendant for the accessibility
7845
+ : undefined);
7938
7846
  }
7939
7847
 
7940
- if ($$self.$$.dirty[0] & /*_inputEl, _options*/ 557056) {
7941
- if (_inputEl && _options.length) {
7942
- $$invalidate(25, _inputWidth = `${_inputEl.getBoundingClientRect().width}px`);
7848
+ if ($$self.$$.dirty[0] & /*value*/ 8) {
7849
+ {
7850
+ _values = parseValues(value);
7851
+
7852
+ // updating _inputEl.value is done within seperate function
7853
+ // to prevent unwanted reactive updates.
7854
+ setDisplayedValue();
7943
7855
  }
7944
7856
  }
7945
7857
  };
7946
7858
 
7947
7859
  return [
7948
- value,
7949
7860
  name,
7950
7861
  arialabel,
7951
7862
  arialabelledby,
7863
+ value,
7952
7864
  leadingicon,
7953
7865
  maxheight,
7954
7866
  placeholder,
@@ -7959,38 +7871,35 @@ function instance$G($$self, $$props, $$invalidate) {
7959
7871
  mr,
7960
7872
  mb,
7961
7873
  ml,
7962
- id,
7963
- _options,
7964
- _inputValue,
7965
7874
  _highlightedIndex,
7966
- _el,
7967
- _inputEl,
7968
- _filterable,
7969
7875
  _filteredOptions,
7970
7876
  _native,
7877
+ _options,
7971
7878
  _isMenuVisible,
7972
7879
  _width,
7973
- _inputWidth,
7880
+ _rootEl,
7974
7881
  _menuEl,
7975
7882
  _selectEl,
7976
- _disabled,
7883
+ _inputEl,
7884
+ _filterable,
7977
7885
  _activeDescendantId,
7886
+ _disabled,
7978
7887
  _error,
7979
7888
  showMenu,
7980
- closeMenu,
7889
+ hideMenu,
7981
7890
  onSelect,
7891
+ onInputKeyUp,
7982
7892
  onInputKeyDown,
7893
+ onClearIconKeyDown,
7894
+ onClearIconClick,
7983
7895
  onNativeSelect,
7984
- onClick,
7985
- onClear,
7896
+ onChevronClick,
7986
7897
  filterable,
7987
7898
  error,
7988
7899
  multiselect,
7989
7900
  native,
7990
7901
  select_binding,
7991
7902
  input_binding,
7992
- input_input_handler,
7993
- keydown_handler,
7994
7903
  click_handler,
7995
7904
  ul_binding,
7996
7905
  div_binding
@@ -8015,25 +7924,24 @@ class Dropdown extends SvelteElement {
8015
7924
  create_fragment$J,
8016
7925
  safe_not_equal,
8017
7926
  {
8018
- name: 1,
8019
- arialabel: 2,
8020
- arialabelledby: 3,
8021
- value: 0,
8022
- filterable: 38,
7927
+ name: 0,
7928
+ arialabel: 1,
7929
+ arialabelledby: 2,
7930
+ value: 3,
7931
+ filterable: 37,
8023
7932
  leadingicon: 4,
8024
7933
  maxheight: 5,
8025
7934
  placeholder: 6,
8026
7935
  width: 7,
8027
7936
  disabled: 8,
8028
- error: 39,
8029
- multiselect: 40,
8030
- native: 41,
7937
+ error: 38,
7938
+ multiselect: 39,
7939
+ native: 40,
8031
7940
  relative: 9,
8032
7941
  mt: 10,
8033
7942
  mr: 11,
8034
7943
  mb: 12,
8035
- ml: 13,
8036
- id: 14
7944
+ ml: 13
8037
7945
  },
8038
7946
  null,
8039
7947
  [-1, -1, -1]
@@ -8070,13 +7978,12 @@ class Dropdown extends SvelteElement {
8070
7978
  "mt",
8071
7979
  "mr",
8072
7980
  "mb",
8073
- "ml",
8074
- "id"
7981
+ "ml"
8075
7982
  ];
8076
7983
  }
8077
7984
 
8078
7985
  get name() {
8079
- return this.$$.ctx[1];
7986
+ return this.$$.ctx[0];
8080
7987
  }
8081
7988
 
8082
7989
  set name(name) {
@@ -8085,7 +7992,7 @@ class Dropdown extends SvelteElement {
8085
7992
  }
8086
7993
 
8087
7994
  get arialabel() {
8088
- return this.$$.ctx[2];
7995
+ return this.$$.ctx[1];
8089
7996
  }
8090
7997
 
8091
7998
  set arialabel(arialabel) {
@@ -8094,7 +8001,7 @@ class Dropdown extends SvelteElement {
8094
8001
  }
8095
8002
 
8096
8003
  get arialabelledby() {
8097
- return this.$$.ctx[3];
8004
+ return this.$$.ctx[2];
8098
8005
  }
8099
8006
 
8100
8007
  set arialabelledby(arialabelledby) {
@@ -8103,7 +8010,7 @@ class Dropdown extends SvelteElement {
8103
8010
  }
8104
8011
 
8105
8012
  get value() {
8106
- return this.$$.ctx[0];
8013
+ return this.$$.ctx[3];
8107
8014
  }
8108
8015
 
8109
8016
  set value(value) {
@@ -8112,7 +8019,7 @@ class Dropdown extends SvelteElement {
8112
8019
  }
8113
8020
 
8114
8021
  get filterable() {
8115
- return this.$$.ctx[38];
8022
+ return this.$$.ctx[37];
8116
8023
  }
8117
8024
 
8118
8025
  set filterable(filterable) {
@@ -8166,7 +8073,7 @@ class Dropdown extends SvelteElement {
8166
8073
  }
8167
8074
 
8168
8075
  get error() {
8169
- return this.$$.ctx[39];
8076
+ return this.$$.ctx[38];
8170
8077
  }
8171
8078
 
8172
8079
  set error(error) {
@@ -8175,7 +8082,7 @@ class Dropdown extends SvelteElement {
8175
8082
  }
8176
8083
 
8177
8084
  get multiselect() {
8178
- return this.$$.ctx[40];
8085
+ return this.$$.ctx[39];
8179
8086
  }
8180
8087
 
8181
8088
  set multiselect(multiselect) {
@@ -8184,7 +8091,7 @@ class Dropdown extends SvelteElement {
8184
8091
  }
8185
8092
 
8186
8093
  get native() {
8187
- return this.$$.ctx[41];
8094
+ return this.$$.ctx[40];
8188
8095
  }
8189
8096
 
8190
8097
  set native(native) {
@@ -8236,15 +8143,6 @@ class Dropdown extends SvelteElement {
8236
8143
  this.$$set({ ml });
8237
8144
  flush();
8238
8145
  }
8239
-
8240
- get id() {
8241
- return this.$$.ctx[14];
8242
- }
8243
-
8244
- set id(id) {
8245
- this.$$set({ id });
8246
- flush();
8247
- }
8248
8146
  }
8249
8147
 
8250
8148
  customElements.define("goa-dropdown", Dropdown);
@@ -13949,13 +13847,11 @@ function create_if_block$e(ctx) {
13949
13847
 
13950
13848
  attr(section, "style", section_style_value = `
13951
13849
  ${cssVar("width", /*width*/ ctx[2])}
13952
- max-width: ${/*maxwidth*/ ctx[1] < /*width*/ ctx[2]
13953
- ? /*width*/ ctx[2]
13954
- : /*maxwidth*/ ctx[1]};
13850
+ max-width: ${/*maxwidth*/ ctx[1]};
13955
13851
  padding: ${/*_padded*/ ctx[19] ? "var(--goa-space-m)" : "0"};
13956
13852
  `);
13957
13853
 
13958
- add_render_callback(() => /*section_elementresize_handler*/ ctx[30].call(section));
13854
+ add_render_callback(() => /*section_elementresize_handler*/ ctx[29].call(section));
13959
13855
  attr(div2, "class", "popover-container");
13960
13856
  },
13961
13857
  m(target, anchor) {
@@ -13965,9 +13861,9 @@ function create_if_block$e(ctx) {
13965
13861
  append(div2, section);
13966
13862
  append(section, goa_focus_trap);
13967
13863
  append(goa_focus_trap, div1);
13968
- /*div1_binding*/ ctx[29](div1);
13969
- section_resize_listener = add_iframe_resize_listener(section, /*section_elementresize_handler*/ ctx[30].bind(section));
13970
- /*section_binding*/ ctx[31](section);
13864
+ /*div1_binding*/ ctx[28](div1);
13865
+ section_resize_listener = add_iframe_resize_listener(section, /*section_elementresize_handler*/ ctx[29].bind(section));
13866
+ /*section_binding*/ ctx[30](section);
13971
13867
 
13972
13868
  if (!mounted) {
13973
13869
  dispose = listen(div0, "click", /*closePopover*/ ctx[21]);
@@ -13977,9 +13873,7 @@ function create_if_block$e(ctx) {
13977
13873
  p(ctx, dirty) {
13978
13874
  if (dirty[0] & /*width, maxwidth, _padded*/ 524294 && section_style_value !== (section_style_value = `
13979
13875
  ${cssVar("width", /*width*/ ctx[2])}
13980
- max-width: ${/*maxwidth*/ ctx[1] < /*width*/ ctx[2]
13981
- ? /*width*/ ctx[2]
13982
- : /*maxwidth*/ ctx[1]};
13876
+ max-width: ${/*maxwidth*/ ctx[1]};
13983
13877
  padding: ${/*_padded*/ ctx[19] ? "var(--goa-space-m)" : "0"};
13984
13878
  `)) {
13985
13879
  attr(section, "style", section_style_value);
@@ -13989,9 +13883,9 @@ function create_if_block$e(ctx) {
13989
13883
  if (detaching) detach(div0);
13990
13884
  if (detaching) detach(t);
13991
13885
  if (detaching) detach(div2);
13992
- /*div1_binding*/ ctx[29](null);
13886
+ /*div1_binding*/ ctx[28](null);
13993
13887
  section_resize_listener();
13994
- /*section_binding*/ ctx[31](null);
13888
+ /*section_binding*/ ctx[30](null);
13995
13889
  mounted = false;
13996
13890
  dispose();
13997
13891
  }
@@ -14039,10 +13933,10 @@ function create_fragment$s(ctx) {
14039
13933
  insert(target, div1, anchor);
14040
13934
  append(div1, div0);
14041
13935
  append(div0, slot);
14042
- /*div0_binding*/ ctx[28](div0);
13936
+ /*div0_binding*/ ctx[27](div0);
14043
13937
  append(div1, t);
14044
13938
  if (if_block) if_block.m(div1, null);
14045
- /*div1_binding_1*/ ctx[32](div1);
13939
+ /*div1_binding_1*/ ctx[31](div1);
14046
13940
 
14047
13941
  if (!mounted) {
14048
13942
  dispose = listen(div0, "click", /*openPopover*/ ctx[20]);
@@ -14089,9 +13983,9 @@ function create_fragment$s(ctx) {
14089
13983
  o: noop,
14090
13984
  d(detaching) {
14091
13985
  if (detaching) detach(div1);
14092
- /*div0_binding*/ ctx[28](null);
13986
+ /*div0_binding*/ ctx[27](null);
14093
13987
  if (if_block) if_block.d();
14094
- /*div1_binding_1*/ ctx[32](null);
13988
+ /*div1_binding_1*/ ctx[31](null);
14095
13989
  mounted = false;
14096
13990
  dispose();
14097
13991
  }
@@ -14129,7 +14023,6 @@ function instance$p($$self, $$props, $$invalidate) {
14129
14023
  let { padded = "true" } = $$props;
14130
14024
  let { position = "auto" } = $$props;
14131
14025
  let { relative = "false" } = $$props;
14132
- let { autoclose = "false" } = $$props;
14133
14026
  let { mt = null } = $$props;
14134
14027
  let { mr = null } = $$props;
14135
14028
  let { mb = null } = $$props;
@@ -14325,13 +14218,12 @@ function instance$p($$self, $$props, $$invalidate) {
14325
14218
  if ('padded' in $$props) $$invalidate(22, padded = $$props.padded);
14326
14219
  if ('position' in $$props) $$invalidate(23, position = $$props.position);
14327
14220
  if ('relative' in $$props) $$invalidate(24, relative = $$props.relative);
14328
- if ('autoclose' in $$props) $$invalidate(25, autoclose = $$props.autoclose);
14329
14221
  if ('mt' in $$props) $$invalidate(3, mt = $$props.mt);
14330
14222
  if ('mr' in $$props) $$invalidate(4, mr = $$props.mr);
14331
14223
  if ('mb' in $$props) $$invalidate(5, mb = $$props.mb);
14332
14224
  if ('ml' in $$props) $$invalidate(6, ml = $$props.ml);
14333
- if ('open' in $$props) $$invalidate(26, open = $$props.open);
14334
- if ('disabled' in $$props) $$invalidate(27, disabled = $$props.disabled);
14225
+ if ('open' in $$props) $$invalidate(25, open = $$props.open);
14226
+ if ('disabled' in $$props) $$invalidate(26, disabled = $$props.disabled);
14335
14227
  if ('tabindex' in $$props) $$invalidate(7, tabindex = $$props.tabindex);
14336
14228
  if ('voffset' in $$props) $$invalidate(8, voffset = $$props.voffset);
14337
14229
  if ('hoffset' in $$props) $$invalidate(9, hoffset = $$props.hoffset);
@@ -14345,11 +14237,11 @@ function instance$p($$self, $$props, $$invalidate) {
14345
14237
  $$invalidate(19, _padded = toBoolean(padded));
14346
14238
  }
14347
14239
 
14348
- if ($$self.$$.dirty[0] & /*open*/ 67108864) {
14240
+ if ($$self.$$.dirty[0] & /*open*/ 33554432) {
14349
14241
  $$invalidate(13, _open = toBoolean(open));
14350
14242
  }
14351
14243
 
14352
- if ($$self.$$.dirty[0] & /*disabled*/ 134217728) {
14244
+ if ($$self.$$.dirty[0] & /*disabled*/ 67108864) {
14353
14245
  _disabled = toBoolean(disabled);
14354
14246
  }
14355
14247
 
@@ -14357,8 +14249,6 @@ function instance$p($$self, $$props, $$invalidate) {
14357
14249
  $$invalidate(18, _relative = toBoolean(relative));
14358
14250
  }
14359
14251
 
14360
- if ($$self.$$.dirty[0] & /*autoclose*/ 33554432) ;
14361
-
14362
14252
  if ($$self.$$.dirty[0] & /*_open*/ 8192) {
14363
14253
  (async () => _open && await setPopoverPosition())();
14364
14254
  }
@@ -14404,7 +14294,6 @@ function instance$p($$self, $$props, $$invalidate) {
14404
14294
  padded,
14405
14295
  position,
14406
14296
  relative,
14407
- autoclose,
14408
14297
  open,
14409
14298
  disabled,
14410
14299
  div0_binding,
@@ -14419,7 +14308,7 @@ class Popover extends SvelteElement {
14419
14308
  constructor(options) {
14420
14309
  super();
14421
14310
  const style = document.createElement('style');
14422
- style.textContent = `:host{box-sizing:border-box;font-family:var(--goa-font-family-sans);font-size:var(--goa-font-size-4);display:flex;align-items:center}.popover-target{cursor:pointer}.popover-target:focus{outline:var(--focus-border-width) solid var(--goa-color-interactive-focus)}.popover-content{color:var(--goa-color-text-default);position:absolute;width:-moz-fit-content;width:fit-content;max-width:260px;list-style-type:none;background:var(--goa-color-greyscale-white);border-radius:var(--border-radius);outline:none;filter:drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.2));z-index:99;width:-moz-max-content;width:max-content;margin-top:var(--offset-top, 3px);margin-bottom:var(--offset-bottom, 3px);margin-left:var(--offset-left, 0);margin-right:var(--offset-right, 0)}::slotted(ul){display:block;padding:0;margin:0;list-style-type:none;line-height:2rem}.popover-background{cursor:default;position:fixed;z-index:98;inset:0}`;
14311
+ style.textContent = `:host{box-sizing:border-box;font-family:var(--goa-font-family-sans);font-size:var(--goa-font-size-4);display:flex;align-items:center}.popover-target{cursor:pointer}.popover-target:focus{outline:var(--focus-border-width) solid var(--goa-color-interactive-focus)}.popover-content{color:var(--goa-color-text-default);position:absolute;width:-moz-fit-content;width:fit-content;list-style-type:none;background:var(--goa-color-greyscale-white);border-radius:var(--border-radius);outline:none;filter:drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.2));z-index:99;width:-moz-max-content;width:max-content;margin-top:var(--offset-top, 3px);margin-bottom:var(--offset-bottom, 3px);margin-left:var(--offset-left, 0);margin-right:var(--offset-right, 0)}::slotted(ul){display:block;padding:0;margin:0;list-style-type:none;line-height:2rem}.popover-background{cursor:default;position:fixed;z-index:98;inset:0}`;
14423
14312
  this.shadowRoot.appendChild(style);
14424
14313
 
14425
14314
  init(
@@ -14439,13 +14328,12 @@ class Popover extends SvelteElement {
14439
14328
  padded: 22,
14440
14329
  position: 23,
14441
14330
  relative: 24,
14442
- autoclose: 25,
14443
14331
  mt: 3,
14444
14332
  mr: 4,
14445
14333
  mb: 5,
14446
14334
  ml: 6,
14447
- open: 26,
14448
- disabled: 27,
14335
+ open: 25,
14336
+ disabled: 26,
14449
14337
  tabindex: 7,
14450
14338
  voffset: 8,
14451
14339
  hoffset: 9,
@@ -14476,7 +14364,6 @@ class Popover extends SvelteElement {
14476
14364
  "padded",
14477
14365
  "position",
14478
14366
  "relative",
14479
- "autoclose",
14480
14367
  "mt",
14481
14368
  "mr",
14482
14369
  "mb",
@@ -14545,15 +14432,6 @@ class Popover extends SvelteElement {
14545
14432
  flush();
14546
14433
  }
14547
14434
 
14548
- get autoclose() {
14549
- return this.$$.ctx[25];
14550
- }
14551
-
14552
- set autoclose(autoclose) {
14553
- this.$$set({ autoclose });
14554
- flush();
14555
- }
14556
-
14557
14435
  get mt() {
14558
14436
  return this.$$.ctx[3];
14559
14437
  }
@@ -14591,7 +14469,7 @@ class Popover extends SvelteElement {
14591
14469
  }
14592
14470
 
14593
14471
  get open() {
14594
- return this.$$.ctx[26];
14472
+ return this.$$.ctx[25];
14595
14473
  }
14596
14474
 
14597
14475
  set open(open) {
@@ -14600,7 +14478,7 @@ class Popover extends SvelteElement {
14600
14478
  }
14601
14479
 
14602
14480
  get disabled() {
14603
- return this.$$.ctx[27];
14481
+ return this.$$.ctx[26];
14604
14482
  }
14605
14483
 
14606
14484
  set disabled(disabled) {
@@ -23666,35 +23544,52 @@ function instance$a($$self, $$props, $$invalidate) {
23666
23544
  }
23667
23545
 
23668
23546
  function handleKeyDown(e) {
23669
- if (!_date) return;
23670
-
23671
23547
  if (["Space", "Enter"].includes(e.key)) {
23672
23548
  showCalendar();
23673
23549
  return;
23674
23550
  }
23675
23551
 
23552
+ // in the key event handling below the first line `_date ||= ...` is to initialize the date, if
23553
+ // it hasn't yet been set to 1 unit opposite of what the keybinding does ex. if ArrowDown is
23554
+ // clicked, which moves the datepicker one week ahead, the date is initialize one week before.
23555
+ // This is to allow the starting date displayed to be that of today no matter what key is
23556
+ // pressed.
23676
23557
  switch (e.key) {
23677
23558
  case "ArrowLeft":
23559
+ _date || $$invalidate(9, _date = addDays(new Date(), 1));
23678
23560
  $$invalidate(9, _date = addDays(_date, -1));
23679
23561
  break;
23680
23562
  case "ArrowRight":
23563
+ _date || $$invalidate(9, _date = addDays(new Date(), -1));
23681
23564
  $$invalidate(9, _date = addDays(_date, 1));
23682
23565
  break;
23683
23566
  case "ArrowDown":
23567
+ _date || $$invalidate(9, _date = addDays(new Date(), -7));
23684
23568
  $$invalidate(9, _date = addDays(_date, 7));
23685
23569
  break;
23686
23570
  case "ArrowUp":
23571
+ _date || $$invalidate(9, _date = addDays(new Date(), 7));
23687
23572
  $$invalidate(9, _date = addDays(_date, -7));
23688
23573
  break;
23689
23574
  case "PageUp":
23575
+ _date || $$invalidate(9, _date = e.shiftKey
23576
+ ? addYears(new Date(), 1)
23577
+ : addMonths(new Date(), 1));
23690
23578
  $$invalidate(9, _date = e.shiftKey ? addYears(_date, -1) : addMonths(_date, -1));
23691
23579
  break;
23692
23580
  case "PageDown":
23581
+ _date || $$invalidate(9, _date = e.shiftKey
23582
+ ? addYears(new Date(), -1)
23583
+ : addMonths(new Date(), -1));
23693
23584
  $$invalidate(9, _date = e.shiftKey ? addYears(_date, 1) : addMonths(_date, 1));
23694
23585
  break;
23586
+ default:
23587
+ return;
23695
23588
  }
23696
23589
 
23697
23590
  dispatchValue(_date);
23591
+ e.preventDefault();
23592
+ e.stopPropagation();
23698
23593
  }
23699
23594
 
23700
23595
  function goa_popover_binding($$value) {
@@ -26176,6 +26071,21 @@ class Pages extends SvelteElement {
26176
26071
 
26177
26072
  customElements.define("goa-pages", Pages);
26178
26073
 
26074
+ function isUrlMatch(windowUrl, testUrl) {
26075
+ if (!testUrl)
26076
+ return false;
26077
+ const pathParts = windowUrl.pathname.split("/");
26078
+ testUrl = testUrl.replace(/^\//, "");
26079
+ for (const part of pathParts) {
26080
+ if (part === testUrl)
26081
+ return true;
26082
+ }
26083
+ if (windowUrl.hash === testUrl) {
26084
+ return true;
26085
+ }
26086
+ return false;
26087
+ }
26088
+
26179
26089
  /* src/components/side-menu/SideMenu.svelte generated by Svelte v3.59.2 */
26180
26090
 
26181
26091
  function create_fragment$4(ctx) {
@@ -26207,11 +26117,11 @@ function instance$4($$self, $$props, $$invalidate) {
26207
26117
 
26208
26118
  onMount(async () => {
26209
26119
  await tick();
26210
- setCurrent(window.location.toString());
26120
+ setCurrentUrl();
26211
26121
  addEventListeners();
26212
26122
  });
26213
26123
 
26214
- function setCurrent(url) {
26124
+ function setCurrentUrl() {
26215
26125
  const slot = _rootEl.querySelector("slot");
26216
26126
 
26217
26127
  if (!slot) {
@@ -26221,7 +26131,7 @@ function instance$4($$self, $$props, $$invalidate) {
26221
26131
  const links = slot.assignedElements().filter(el => el.tagName === "A");
26222
26132
 
26223
26133
  links.forEach(child => {
26224
- const current = url.endsWith(child.getAttribute("href"));
26134
+ const current = isUrlMatch(document.location, child.getAttribute("href"));
26225
26135
 
26226
26136
  if (current) {
26227
26137
  child.classList.add("current");
@@ -26236,9 +26146,9 @@ function instance$4($$self, $$props, $$invalidate) {
26236
26146
  let currentLocation = document.location.href;
26237
26147
 
26238
26148
  const observer = new MutationObserver(_mutationList => {
26239
- if (currentLocation !== document.location.href) {
26149
+ if (isUrlMatch(document.location, currentLocation)) {
26240
26150
  currentLocation = document.location.href;
26241
- setCurrent(currentLocation);
26151
+ setCurrentUrl();
26242
26152
  }
26243
26153
  });
26244
26154
 
@@ -26246,7 +26156,7 @@ function instance$4($$self, $$props, $$invalidate) {
26246
26156
 
26247
26157
  // watch hash / browser history changes
26248
26158
  window.addEventListener("popstate", () => {
26249
- setCurrent(document.location.href);
26159
+ setCurrentUrl();
26250
26160
  });
26251
26161
  }
26252
26162
 
@@ -26310,7 +26220,7 @@ function create_else_block(ctx) {
26310
26220
  };
26311
26221
  }
26312
26222
 
26313
- // (189:4) {#if _open}
26223
+ // (190:4) {#if _open}
26314
26224
  function create_if_block$2(ctx) {
26315
26225
  let goa_icon;
26316
26226
 
@@ -26424,24 +26334,6 @@ function toSlug(path) {
26424
26334
  : path.toLowerCase().replace(/ /g, "-");
26425
26335
  }
26426
26336
 
26427
- function matchesChild(el, url) {
26428
- if (url.endsWith(toSlug(el.heading))) {
26429
- return true;
26430
- }
26431
-
26432
- const slot = el.querySelector("slot");
26433
-
26434
- if (!slot) {
26435
- return false;
26436
- }
26437
-
26438
- const children = slot.assignedElements();
26439
-
26440
- return !!children.find(child => {
26441
- return url.endsWith(child.getAttribute("href"));
26442
- });
26443
- }
26444
-
26445
26337
  function instance$3($$self, $$props, $$invalidate) {
26446
26338
  let _slug;
26447
26339
  let { heading } = $$props;
@@ -26457,8 +26349,7 @@ function instance$3($$self, $$props, $$invalidate) {
26457
26349
  });
26458
26350
 
26459
26351
  function checkUrlMatches() {
26460
- const url = window.location.href;
26461
- $$invalidate(1, _open = matchesMenu(url) || matchesChild(_rootEl, url));
26352
+ $$invalidate(1, _open = matchesMenu() || matchesChild(_rootEl));
26462
26353
 
26463
26354
  if (_open) {
26464
26355
  notifyParent(true);
@@ -26491,12 +26382,30 @@ function instance$3($$self, $$props, $$invalidate) {
26491
26382
  });
26492
26383
  }
26493
26384
 
26494
- function matchesMenu(url) {
26495
- return url.endsWith(_slug);
26385
+ function matchesMenu() {
26386
+ return isUrlMatch(document.location, _slug);
26387
+ }
26388
+
26389
+ function matchesChild(el) {
26390
+ if (isUrlMatch(document.location, toSlug(el.heading))) {
26391
+ return true;
26392
+ }
26393
+
26394
+ const slot = el.querySelector("slot");
26395
+
26396
+ if (!slot) {
26397
+ return false;
26398
+ }
26399
+
26400
+ const children = slot.assignedElements();
26401
+
26402
+ return !!children.find(child => {
26403
+ return isUrlMatch(document.location, child.getAttribute("href"));
26404
+ });
26496
26405
  }
26497
26406
 
26498
26407
  function setCurrent() {
26499
- const url = document.location.href;
26408
+ document.location.href;
26500
26409
  const slot = _rootEl.querySelector("slot");
26501
26410
 
26502
26411
  if (!slot) {
@@ -26507,7 +26416,8 @@ function instance$3($$self, $$props, $$invalidate) {
26507
26416
  $$invalidate(2, _current = false);
26508
26417
 
26509
26418
  children.forEach(child => {
26510
- const current = url.endsWith(child.getAttribute("href"));
26419
+ const url = child.getAttribute("href");
26420
+ const current = isUrlMatch(document.location, url);
26511
26421
 
26512
26422
  if (current) {
26513
26423
  $$invalidate(2, _current = true);