@abgov/web-components 1.13.1-alpha.1 → 1.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abgov/web-components",
3
- "version": "1.13.1-alpha.1",
3
+ "version": "1.13.1",
4
4
  "description": "Government of Alberta - UI Web components",
5
5
  "bugs": {
6
6
  "url": "https://github.com/GovAlta/ui-components/issues"
@@ -6228,18 +6228,18 @@ customElements.define("goa-divider", Divider);
6228
6228
 
6229
6229
  function get_each_context_1(ctx, list, i) {
6230
6230
  const child_ctx = ctx.slice();
6231
- child_ctx[51] = list[i];
6232
- child_ctx[55] = i;
6231
+ child_ctx[49] = list[i];
6232
+ child_ctx[53] = i;
6233
6233
  return child_ctx;
6234
6234
  }
6235
6235
 
6236
6236
  function get_each_context$7(ctx, list, i) {
6237
6237
  const child_ctx = ctx.slice();
6238
- child_ctx[51] = list[i];
6238
+ child_ctx[49] = list[i];
6239
6239
  return child_ctx;
6240
6240
  }
6241
6241
 
6242
- // (343:2) {:else}
6242
+ // (257:2) {:else}
6243
6243
  function create_else_block$a(ctx) {
6244
6244
  let slot;
6245
6245
  let t0;
@@ -6256,7 +6256,7 @@ function create_else_block$a(ctx) {
6256
6256
  let mounted;
6257
6257
  let dispose;
6258
6258
  let each_value_1 = /*_options*/ ctx[13];
6259
- const get_key = ctx => /*index*/ ctx[55];
6259
+ const get_key = ctx => /*index*/ ctx[53];
6260
6260
 
6261
6261
  for (let i = 0; i < each_value_1.length; i += 1) {
6262
6262
  let child_ctx = get_each_context_1(ctx, each_value_1, i);
@@ -6278,35 +6278,34 @@ function create_else_block$a(ctx) {
6278
6278
  }
6279
6279
 
6280
6280
  set_custom_element_data(goa_input, "slot", "target");
6281
- set_custom_element_data(goa_input, "disabled", /*disabled*/ ctx[6]);
6282
6281
  set_custom_element_data(goa_input, "error", /*error*/ ctx[7]);
6282
+ set_custom_element_data(goa_input, "disabled", /*disabled*/ ctx[6]);
6283
6283
  set_custom_element_data(goa_input, "leadingicon", /*leadingicon*/ ctx[2]);
6284
- set_custom_element_data(goa_input, "name", /*name*/ ctx[0]);
6285
6284
  set_custom_element_data(goa_input, "placeholder", /*placeholder*/ ctx[4]);
6286
6285
  set_custom_element_data(goa_input, "aria-controls", "menu");
6287
6286
  set_custom_element_data(goa_input, "aria-expanded", /*_isMenuVisible*/ ctx[18]);
6288
6287
  set_custom_element_data(goa_input, "arialabel", goa_input_arialabel_value = /*arialabel*/ ctx[1] || /*name*/ ctx[0]);
6289
6288
  set_custom_element_data(goa_input, "data-testid", goa_input_data_testid_value = `${/*name*/ ctx[0]}-dropdown-input`);
6289
+ set_custom_element_data(goa_input, "readonly", "");
6290
6290
  set_custom_element_data(goa_input, "role", "combobox");
6291
6291
  set_custom_element_data(goa_input, "trailingicon", "chevron-down");
6292
6292
  set_custom_element_data(goa_input, "type", "text");
6293
6293
  set_custom_element_data(goa_input, "value", /*_selectedLabel*/ ctx[17]);
6294
6294
  set_custom_element_data(goa_input, "width", "100%");
6295
- set_custom_element_data(goa_input, "readonly", "");
6295
+ set_custom_element_data(goa_input, "name", /*name*/ ctx[0]);
6296
6296
  attr(ul, "id", "menu");
6297
6297
  attr(ul, "role", "listbox");
6298
6298
  attr(ul, "aria-activedescendant", /*_selectedLabel*/ ctx[17]);
6299
6299
  attr(ul, "data-testid", "dropdown-menu");
6300
+ attr(ul, "tabindex", "0");
6300
6301
 
6301
6302
  attr(ul, "style", ul_style_value = `
6302
- outline: none;
6303
6303
  overflow-y: auto;
6304
6304
  max-height: ${/*maxheight*/ ctx[3]};
6305
6305
  `);
6306
6306
 
6307
6307
  set_custom_element_data(goa_popover, "disabled", /*disabled*/ ctx[6]);
6308
6308
  set_custom_element_data(goa_popover, "relative", /*relative*/ ctx[8]);
6309
- set_custom_element_data(goa_popover, "tabindex", "-1");
6310
6309
  set_custom_element_data(goa_popover, "open", /*_isMenuVisible*/ ctx[18]);
6311
6310
  set_custom_element_data(goa_popover, "padded", "false");
6312
6311
  set_custom_element_data(goa_popover, "width", goa_popover_width_value = /*width*/ ctx[5] || /*_computedWidth*/ ctx[20]);
@@ -6333,20 +6332,16 @@ function create_else_block$a(ctx) {
6333
6332
  }
6334
6333
  },
6335
6334
  p(ctx, dirty) {
6336
- if (dirty[0] & /*disabled*/ 64) {
6337
- set_custom_element_data(goa_input, "disabled", /*disabled*/ ctx[6]);
6338
- }
6339
-
6340
6335
  if (dirty[0] & /*error*/ 128) {
6341
6336
  set_custom_element_data(goa_input, "error", /*error*/ ctx[7]);
6342
6337
  }
6343
6338
 
6344
- if (dirty[0] & /*leadingicon*/ 4) {
6345
- set_custom_element_data(goa_input, "leadingicon", /*leadingicon*/ ctx[2]);
6339
+ if (dirty[0] & /*disabled*/ 64) {
6340
+ set_custom_element_data(goa_input, "disabled", /*disabled*/ ctx[6]);
6346
6341
  }
6347
6342
 
6348
- if (dirty[0] & /*name*/ 1) {
6349
- set_custom_element_data(goa_input, "name", /*name*/ ctx[0]);
6343
+ if (dirty[0] & /*leadingicon*/ 4) {
6344
+ set_custom_element_data(goa_input, "leadingicon", /*leadingicon*/ ctx[2]);
6350
6345
  }
6351
6346
 
6352
6347
  if (dirty[0] & /*placeholder*/ 16) {
@@ -6369,6 +6364,10 @@ function create_else_block$a(ctx) {
6369
6364
  set_custom_element_data(goa_input, "value", /*_selectedLabel*/ ctx[17]);
6370
6365
  }
6371
6366
 
6367
+ if (dirty[0] & /*name*/ 1) {
6368
+ set_custom_element_data(goa_input, "name", /*name*/ ctx[0]);
6369
+ }
6370
+
6372
6371
  if (dirty[0] & /*_options, _values, _highlightedIndex, onSelect*/ 67706880) {
6373
6372
  each_value_1 = /*_options*/ ctx[13];
6374
6373
  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, null, get_each_context_1);
@@ -6379,7 +6378,6 @@ function create_else_block$a(ctx) {
6379
6378
  }
6380
6379
 
6381
6380
  if (dirty[0] & /*maxheight*/ 8 && ul_style_value !== (ul_style_value = `
6382
- outline: none;
6383
6381
  overflow-y: auto;
6384
6382
  max-height: ${/*maxheight*/ ctx[3]};
6385
6383
  `)) {
@@ -6418,7 +6416,7 @@ function create_else_block$a(ctx) {
6418
6416
  };
6419
6417
  }
6420
6418
 
6421
- // (328:2) {#if _native}
6419
+ // (238:2) {#if _native}
6422
6420
  function create_if_block$m(ctx) {
6423
6421
  let select;
6424
6422
  let slot;
@@ -6508,10 +6506,10 @@ function create_if_block$m(ctx) {
6508
6506
  };
6509
6507
  }
6510
6508
 
6511
- // (389:8) {#each _options as option, index (index)}
6509
+ // (296:8) {#each _options as option, index (index)}
6512
6510
  function create_each_block_1(key_1, ctx) {
6513
6511
  let li;
6514
- let t0_value = (/*option*/ ctx[51].label || /*option*/ ctx[51].value) + "";
6512
+ let t0_value = (/*option*/ ctx[49].label || /*option*/ ctx[49].value) + "";
6515
6513
  let t0;
6516
6514
  let t1;
6517
6515
  let li_id_value;
@@ -6524,7 +6522,7 @@ function create_each_block_1(key_1, ctx) {
6524
6522
  let dispose;
6525
6523
 
6526
6524
  function click_handler() {
6527
- return /*click_handler*/ ctx[32](/*option*/ ctx[51]);
6525
+ return /*click_handler*/ ctx[32](/*option*/ ctx[49]);
6528
6526
  }
6529
6527
 
6530
6528
  return {
@@ -6534,23 +6532,22 @@ function create_each_block_1(key_1, ctx) {
6534
6532
  li = element("li");
6535
6533
  t0 = text(t0_value);
6536
6534
  t1 = space();
6537
- attr(li, "id", li_id_value = /*option*/ ctx[51].label);
6535
+ attr(li, "id", li_id_value = /*option*/ ctx[49].label);
6538
6536
  attr(li, "role", "option");
6539
- attr(li, "tabindex", "0");
6540
- set_style(li, "display", "block");
6541
- attr(li, "aria-label", li_aria_label_value = /*option*/ ctx[51].label || /*option*/ ctx[51].value);
6537
+ attr(li, "aria-label", li_aria_label_value = /*option*/ ctx[49].label || /*option*/ ctx[49].value);
6542
6538
 
6543
- attr(li, "aria-selected", li_aria_selected_value = /*_values*/ ctx[16].includes(/*option*/ ctx[51].value)
6539
+ attr(li, "aria-selected", li_aria_selected_value = /*_values*/ ctx[16].includes(/*option*/ ctx[49].value)
6544
6540
  ? "true"
6545
6541
  : "false");
6546
6542
 
6547
6543
  attr(li, "class", "dropdown-item");
6548
- attr(li, "data-testid", li_data_testid_value = `dropdown-item-${/*option*/ ctx[51].value}`);
6549
- attr(li, "data-index", li_data_index_value = /*index*/ ctx[55]);
6550
- attr(li, "data-value", li_data_value_value = /*option*/ ctx[51].value);
6544
+ attr(li, "data-testid", li_data_testid_value = `dropdown-item-${/*option*/ ctx[49].value}`);
6545
+ attr(li, "data-index", li_data_index_value = /*index*/ ctx[53]);
6546
+ attr(li, "data-value", li_data_value_value = /*option*/ ctx[49].value);
6547
+ set_style(li, "display", "block");
6551
6548
  toggle_class(li, "dropdown-item--disabled", false);
6552
- toggle_class(li, "dropdown-item--tabbed", /*index*/ ctx[55] === /*_highlightedIndex*/ ctx[19]);
6553
- toggle_class(li, "dropdown-item--selected", /*_values*/ ctx[16].includes(/*option*/ ctx[51].value));
6549
+ toggle_class(li, "dropdown-item--tabbed", /*index*/ ctx[53] === /*_highlightedIndex*/ ctx[19]);
6550
+ toggle_class(li, "dropdown-item--selected", /*_values*/ ctx[16].includes(/*option*/ ctx[49].value));
6554
6551
  this.first = li;
6555
6552
  },
6556
6553
  m(target, anchor) {
@@ -6565,40 +6562,40 @@ function create_each_block_1(key_1, ctx) {
6565
6562
  },
6566
6563
  p(new_ctx, dirty) {
6567
6564
  ctx = new_ctx;
6568
- if (dirty[0] & /*_options*/ 8192 && t0_value !== (t0_value = (/*option*/ ctx[51].label || /*option*/ ctx[51].value) + "")) set_data(t0, t0_value);
6565
+ if (dirty[0] & /*_options*/ 8192 && t0_value !== (t0_value = (/*option*/ ctx[49].label || /*option*/ ctx[49].value) + "")) set_data(t0, t0_value);
6569
6566
 
6570
- if (dirty[0] & /*_options*/ 8192 && li_id_value !== (li_id_value = /*option*/ ctx[51].label)) {
6567
+ if (dirty[0] & /*_options*/ 8192 && li_id_value !== (li_id_value = /*option*/ ctx[49].label)) {
6571
6568
  attr(li, "id", li_id_value);
6572
6569
  }
6573
6570
 
6574
- if (dirty[0] & /*_options*/ 8192 && li_aria_label_value !== (li_aria_label_value = /*option*/ ctx[51].label || /*option*/ ctx[51].value)) {
6571
+ if (dirty[0] & /*_options*/ 8192 && li_aria_label_value !== (li_aria_label_value = /*option*/ ctx[49].label || /*option*/ ctx[49].value)) {
6575
6572
  attr(li, "aria-label", li_aria_label_value);
6576
6573
  }
6577
6574
 
6578
- if (dirty[0] & /*_values, _options*/ 73728 && li_aria_selected_value !== (li_aria_selected_value = /*_values*/ ctx[16].includes(/*option*/ ctx[51].value)
6575
+ if (dirty[0] & /*_values, _options*/ 73728 && li_aria_selected_value !== (li_aria_selected_value = /*_values*/ ctx[16].includes(/*option*/ ctx[49].value)
6579
6576
  ? "true"
6580
6577
  : "false")) {
6581
6578
  attr(li, "aria-selected", li_aria_selected_value);
6582
6579
  }
6583
6580
 
6584
- if (dirty[0] & /*_options*/ 8192 && li_data_testid_value !== (li_data_testid_value = `dropdown-item-${/*option*/ ctx[51].value}`)) {
6581
+ if (dirty[0] & /*_options*/ 8192 && li_data_testid_value !== (li_data_testid_value = `dropdown-item-${/*option*/ ctx[49].value}`)) {
6585
6582
  attr(li, "data-testid", li_data_testid_value);
6586
6583
  }
6587
6584
 
6588
- if (dirty[0] & /*_options*/ 8192 && li_data_index_value !== (li_data_index_value = /*index*/ ctx[55])) {
6585
+ if (dirty[0] & /*_options*/ 8192 && li_data_index_value !== (li_data_index_value = /*index*/ ctx[53])) {
6589
6586
  attr(li, "data-index", li_data_index_value);
6590
6587
  }
6591
6588
 
6592
- if (dirty[0] & /*_options*/ 8192 && li_data_value_value !== (li_data_value_value = /*option*/ ctx[51].value)) {
6589
+ if (dirty[0] & /*_options*/ 8192 && li_data_value_value !== (li_data_value_value = /*option*/ ctx[49].value)) {
6593
6590
  attr(li, "data-value", li_data_value_value);
6594
6591
  }
6595
6592
 
6596
6593
  if (dirty[0] & /*_options, _highlightedIndex*/ 532480) {
6597
- toggle_class(li, "dropdown-item--tabbed", /*index*/ ctx[55] === /*_highlightedIndex*/ ctx[19]);
6594
+ toggle_class(li, "dropdown-item--tabbed", /*index*/ ctx[53] === /*_highlightedIndex*/ ctx[19]);
6598
6595
  }
6599
6596
 
6600
6597
  if (dirty[0] & /*_values, _options*/ 73728) {
6601
- toggle_class(li, "dropdown-item--selected", /*_values*/ ctx[16].includes(/*option*/ ctx[51].value));
6598
+ toggle_class(li, "dropdown-item--selected", /*_values*/ ctx[16].includes(/*option*/ ctx[49].value));
6602
6599
  }
6603
6600
  },
6604
6601
  d(detaching) {
@@ -6609,10 +6606,10 @@ function create_each_block_1(key_1, ctx) {
6609
6606
  };
6610
6607
  }
6611
6608
 
6612
- // (337:6) {#each _options as option}
6609
+ // (247:6) {#each _options as option}
6613
6610
  function create_each_block$7(ctx) {
6614
6611
  let option;
6615
- let t0_value = /*option*/ ctx[51].label + "";
6612
+ let t0_value = /*option*/ ctx[49].label + "";
6616
6613
  let t0;
6617
6614
  let t1;
6618
6615
  let option_selected_value;
@@ -6624,10 +6621,10 @@ function create_each_block$7(ctx) {
6624
6621
  option = element("option");
6625
6622
  t0 = text(t0_value);
6626
6623
  t1 = space();
6627
- option.selected = option_selected_value = /*option*/ ctx[51].selected;
6628
- option.__value = option_value_value = /*option*/ ctx[51].value;
6624
+ option.selected = option_selected_value = /*option*/ ctx[49].selected;
6625
+ option.__value = option_value_value = /*option*/ ctx[49].value;
6629
6626
  option.value = option.__value;
6630
- attr(option, "aria-label", option_aria_label_value = /*option*/ ctx[51].label);
6627
+ attr(option, "aria-label", option_aria_label_value = /*option*/ ctx[49].label);
6631
6628
  },
6632
6629
  m(target, anchor) {
6633
6630
  insert(target, option, anchor);
@@ -6635,18 +6632,18 @@ function create_each_block$7(ctx) {
6635
6632
  append(option, t1);
6636
6633
  },
6637
6634
  p(ctx, dirty) {
6638
- if (dirty[0] & /*_options*/ 8192 && t0_value !== (t0_value = /*option*/ ctx[51].label + "")) set_data(t0, t0_value);
6635
+ if (dirty[0] & /*_options*/ 8192 && t0_value !== (t0_value = /*option*/ ctx[49].label + "")) set_data(t0, t0_value);
6639
6636
 
6640
- if (dirty[0] & /*_options*/ 8192 && option_selected_value !== (option_selected_value = /*option*/ ctx[51].selected)) {
6637
+ if (dirty[0] & /*_options*/ 8192 && option_selected_value !== (option_selected_value = /*option*/ ctx[49].selected)) {
6641
6638
  option.selected = option_selected_value;
6642
6639
  }
6643
6640
 
6644
- if (dirty[0] & /*_options*/ 8192 && option_value_value !== (option_value_value = /*option*/ ctx[51].value)) {
6641
+ if (dirty[0] & /*_options*/ 8192 && option_value_value !== (option_value_value = /*option*/ ctx[49].value)) {
6645
6642
  option.__value = option_value_value;
6646
6643
  option.value = option.__value;
6647
6644
  }
6648
6645
 
6649
- if (dirty[0] & /*_options*/ 8192 && option_aria_label_value !== (option_aria_label_value = /*option*/ ctx[51].label)) {
6646
+ if (dirty[0] & /*_options*/ 8192 && option_aria_label_value !== (option_aria_label_value = /*option*/ ctx[49].label)) {
6650
6647
  attr(option, "aria-label", option_aria_label_value);
6651
6648
  }
6652
6649
  },
@@ -6907,161 +6904,58 @@ function instance$C($$self, $$props, $$invalidate) {
6907
6904
  }
6908
6905
  }
6909
6906
 
6910
- function MenuVisibleKeyDownHandler() {
6911
- const handle = e => {
6912
- switch (e.key) {
6913
- case " ":
6914
- onSpace(e);
6915
- break;
6916
- case "Enter":
6917
- onEnter(e);
6918
- break;
6919
- case "Escape":
6920
- onEscape(e);
6921
- break;
6922
- case "ArrowUp":
6923
- onArrowUp(e);
6907
+ const onInputKeyDown = e => {
6908
+ switch (e.key) {
6909
+ case " ":
6910
+ case "Enter":
6911
+ _isMenuVisible ? closeMenu() : showMenu();
6912
+ _menuEl.focus();
6913
+ e.preventDefault();
6914
+ break;
6915
+ case "Escape":
6916
+ _isMenuVisible && closeMenu();
6917
+ e.preventDefault();
6918
+ e.stopPropagation();
6919
+ break;
6920
+ case "ArrowDown":
6921
+ if (e.altKey) {
6922
+ _isMenuVisible ? closeMenu() : showMenu(); // set menu focus to allow arrow keys to trigger scrolling within option list
6924
6923
  break;
6925
- case "ArrowDown":
6926
- onArrowDown(e);
6924
+ }
6925
+ _handleArrowDown();
6926
+ break;
6927
+ case "ArrowUp":
6928
+ if (e.altKey) {
6929
+ _isMenuVisible ? closeMenu() : showMenu();
6927
6930
  break;
6928
- }
6929
- };
6930
-
6931
- const onSpace = e => {
6932
- e.preventDefault();
6933
- };
6934
-
6935
- const onEnter = e => {
6936
- onSelect(_options[_highlightedIndex].value, _options[_highlightedIndex].label, false);
6937
- closeMenu();
6938
- e.preventDefault();
6939
- e.stopPropagation();
6940
- };
6941
-
6942
- const onEscape = e => {
6943
- closeMenu();
6944
- e.preventDefault();
6945
- e.stopPropagation();
6946
- };
6947
-
6948
- const onArrowUp = e => {
6949
- if (e.altKey) {
6950
- closeMenu();
6951
- }
6952
-
6953
- if (_highlightedIndex > 0) {
6954
- $$invalidate(19, _highlightedIndex--, _highlightedIndex);
6955
- }
6956
-
6957
- onSelect(_options[_highlightedIndex].value, _options[_highlightedIndex].label, false);
6958
- }; // e.stopPropagation();
6959
- // e.preventDefault();
6960
-
6961
- const onArrowDown = e => {
6962
- if (e.altKey) {
6963
- closeMenu();
6964
- }
6965
-
6966
- if (_highlightedIndex < _options.length - 1) {
6967
- $$invalidate(19, _highlightedIndex++, _highlightedIndex);
6968
- }
6931
+ }
6932
+ _handleArrowUp();
6933
+ break;
6934
+ }
6935
+ };
6969
6936
 
6937
+ function _handleArrowDown() {
6938
+ if (_highlightedIndex < _options.length - 1) {
6939
+ $$invalidate(19, _highlightedIndex++, _highlightedIndex);
6970
6940
  onSelect(_options[_highlightedIndex].value, _options[_highlightedIndex].label, false);
6971
- console.log("on arrow down");
6972
- }; // e.stopPropagation();
6973
- // e.preventDefault();
6974
-
6975
- return { handle };
6976
- }
6977
-
6978
- function MenuHiddenKeyDownHandler() {
6979
- const handle = e => {
6980
- switch (e.key) {
6981
- case " ":
6982
- onSpace(e);
6983
- break;
6984
- case "Enter":
6985
- onEnter(e);
6986
- break;
6987
- case "Escape":
6988
- break;
6989
- case "ArrowUp":
6990
- onArrowUp(e);
6991
- break;
6992
- case "ArrowDown":
6993
- onArrowDown(e);
6994
- break;
6995
- }
6996
- };
6997
-
6998
- const onSpace = e => {
6999
- showMenu();
7000
- _menuEl.focus(); // set menu focus to allow arrow keys to trigger scrolling within option list
7001
- e.preventDefault();
7002
- };
7003
-
7004
- const onEnter = e => {
7005
- showMenu();
7006
- _menuEl.focus(); // set menu focus to allow arrow keys to trigger scrolling within option list
7007
- e.preventDefault();
7008
- };
7009
-
7010
- const onArrowUp = e => {
7011
- if (e.altKey) {
7012
- showMenu();
7013
- }
7014
-
7015
- if (_highlightedIndex > 0) {
7016
- $$invalidate(19, _highlightedIndex--, _highlightedIndex);
7017
- }
7018
-
7019
- onSelect(_options[_highlightedIndex].value, _options[_highlightedIndex].label);
7020
- e.stopPropagation();
7021
- e.preventDefault();
7022
- };
7023
-
7024
- // FIXME: here
7025
- const onArrowDown = e => {
7026
- if (e.altKey) {
7027
- showMenu();
7028
- }
7029
-
7030
- if (_highlightedIndex < _options.length - 1) {
7031
- $$invalidate(19, _highlightedIndex++, _highlightedIndex);
7032
- }
7033
-
7034
- onSelect(_options[_highlightedIndex].value, _options[_highlightedIndex].label);
7035
- e.stopPropagation();
7036
- e.preventDefault();
7037
- };
7038
-
7039
- return { handle };
6941
+ }
7040
6942
  }
7041
6943
 
7042
- const menuVisibleHandler = MenuVisibleKeyDownHandler();
7043
- const menuHiddenHandler = MenuHiddenKeyDownHandler();
7044
-
7045
- const onInputKeyDown = e => {
7046
- if (_isMenuVisible) {
7047
- menuVisibleHandler.handle(e);
7048
- } else {
7049
- menuHiddenHandler.handle(e);
6944
+ function _handleArrowUp() {
6945
+ if (_highlightedIndex > 0) {
6946
+ $$invalidate(19, _highlightedIndex--, _highlightedIndex);
6947
+ onSelect(_options[_highlightedIndex].value, _options[_highlightedIndex].label, false);
7050
6948
  }
7051
- };
6949
+ }
7052
6950
 
7053
6951
  // add required bindings to component
7054
6952
  function onFocus() {
7055
- if (!_native) {
7056
- _el.addEventListener("keydown", onInputKeyDown);
7057
- }
6953
+ _el.addEventListener("keydown", onInputKeyDown);
7058
6954
  }
7059
6955
 
7060
6956
  // remove all bindings from component
7061
6957
  function onBlur() {
7062
- if (!_native) {
7063
- _el.removeEventListener("keydown", onInputKeyDown);
7064
- }
6958
+ _el.removeEventListener("keydown", onInputKeyDown);
7065
6959
  }
7066
6960
 
7067
6961
  function onHighlight(e) {
@@ -7193,7 +7087,7 @@ class Dropdown extends SvelteElement {
7193
7087
  constructor(options) {
7194
7088
  super();
7195
7089
  const style = document.createElement('style');
7196
- style.textContent = `:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.dropdown{cursor:pointer;display:inline-block;width:var(--width, 100%)}.dropdown-item{margin:0;padding:0.5rem;cursor:pointer;color:var(--goa-color-greyscale-black);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-item--tabbed{background:var(--goa-color-greyscale-100);color:var(--goa-color-interactive-hover)}.dropdown-item--disabled{opacity:0.5;cursor:default}.dropdown-item--disabled:hover{cursor:default;color:var(--goa-color-greyscale-700)}.dropdown-item--selected{background:var(--goa-color-interactive-default);color:var(--goa-color-greyscale-white)}.dropdown-item--tabbed.dropdown-item--selected,.dropdown-item--selected:hover{background:var(--goa-color-interactive-hover);color:var(--goa-color-greyscale-white)}.dropdown-native{position:relative;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);background-color:var(--goa-color-greyscale-white);transition:box-shadow 0.1s ease-in}.dropdown-native:has(select:disabled){background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);box-shadow:none;color:var(--goa-color-text-secondary);cursor:default}.dropdown-native:has(select.error){border:2px solid var(--goa-color-interactive-error)}.dropdown-native:hover{border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}select{border:none;font:var(--goa-font-family-sans);background-color:transparent;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);appearance:none;padding:calc(var(--goa-space-xs) + 1px);padding-left:var(--goa-space-s);padding-right:3rem;outline:none;width:100%}.dropdown-native::after{content:"";position:absolute;right:0.6rem;top:0.6rem;pointer-events:none;width:1.5rem;height:1.5rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144' /%3E%3C/svg%3E");background-repeat:none}.dropdown-native:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}`;
7090
+ style.textContent = `:host{box-sizing:border-box;font-family:var(--goa-font-family-sans)}.dropdown{cursor:pointer;display:inline-block;width:var(--width, 100%)}.dropdown-item{margin:0;padding:0.5rem;cursor:pointer;color:var(--goa-color-greyscale-black);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dropdown-item--tabbed{background:var(--goa-color-greyscale-100);color:var(--goa-color-interactive-hover)}.dropdown-item--disabled{opacity:0.5;cursor:default}.dropdown-item--disabled:hover{cursor:default;color:var(--goa-color-greyscale-700)}.dropdown-item--selected{background:var(--goa-color-interactive-default);color:var(--goa-color-greyscale-white)}.dropdown-item--tabbed.dropdown-item--selected,.dropdown-item--selected:hover{background:var(--goa-color-interactive-hover);color:var(--goa-color-greyscale-white)}.dropdown-native{border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);background-color:var(--goa-color-greyscale-white);transition:box-shadow 0.1s ease-in}.dropdown-native:has(select:disabled){background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200);box-shadow:none;color:var(--goa-color-text-secondary);cursor:default}.dropdown-native:has(select.error){border:2px solid var(--goa-color-interactive-error)}.dropdown-native:hover{border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}select{border:none;background-color:transparent;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);appearance:none;padding:calc(var(--goa-space-xs) + 2px);padding-left:0.5rem;padding-right:3rem;outline:none;width:100%}.dropdown-native::after{content:"";position:absolute;right:0.6rem;top:0.6rem;pointer-events:none;width:1.5rem;height:1.5rem;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'><path fill='none' stroke='%23333333' stroke-linecap='round' stroke-linejoin='round' stroke-width='48' d='M112 184l144 144 144-144' /%3E%3C/svg%3E");background-repeat:none}.dropdown-native:focus-within{box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}`;
7197
7091
  this.shadowRoot.appendChild(style);
7198
7092
 
7199
7093
  init(