@abgov/web-components 1.0.0-alpha.208 → 1.0.0-alpha.209

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.0.0-alpha.208",
3
+ "version": "1.0.0-alpha.209",
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[50] = list[i];
6232
- child_ctx[54] = i;
6231
+ child_ctx[48] = list[i];
6232
+ child_ctx[52] = 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[50] = list[i];
6238
+ child_ctx[48] = list[i];
6239
6239
  return child_ctx;
6240
6240
  }
6241
6241
 
6242
- // (271:2) {:else}
6242
+ // (259:2) {:else}
6243
6243
  function create_else_block$9(ctx) {
6244
6244
  let slot;
6245
6245
  let t0;
@@ -6256,7 +6256,7 @@ function create_else_block$9(ctx) {
6256
6256
  let mounted;
6257
6257
  let dispose;
6258
6258
  let each_value_1 = /*_options*/ ctx[12];
6259
- const get_key = ctx => /*index*/ ctx[54];
6259
+ const get_key = ctx => /*index*/ ctx[52];
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);
@@ -6411,7 +6411,7 @@ function create_else_block$9(ctx) {
6411
6411
  };
6412
6412
  }
6413
6413
 
6414
- // (252:2) {#if _native}
6414
+ // (240:2) {#if _native}
6415
6415
  function create_if_block$l(ctx) {
6416
6416
  let select;
6417
6417
  let slot;
@@ -6501,10 +6501,10 @@ function create_if_block$l(ctx) {
6501
6501
  };
6502
6502
  }
6503
6503
 
6504
- // (310:8) {#each _options as option, index (index)}
6504
+ // (298:8) {#each _options as option, index (index)}
6505
6505
  function create_each_block_1(key_1, ctx) {
6506
6506
  let li;
6507
- let t0_value = (/*option*/ ctx[50].label || /*option*/ ctx[50].value) + "";
6507
+ let t0_value = (/*option*/ ctx[48].label || /*option*/ ctx[48].value) + "";
6508
6508
  let t0;
6509
6509
  let t1;
6510
6510
  let li_id_value;
@@ -6513,12 +6513,11 @@ function create_each_block_1(key_1, ctx) {
6513
6513
  let li_data_testid_value;
6514
6514
  let li_data_index_value;
6515
6515
  let li_data_value_value;
6516
- let li_style_value;
6517
6516
  let mounted;
6518
6517
  let dispose;
6519
6518
 
6520
6519
  function click_handler() {
6521
- return /*click_handler*/ ctx[31](/*option*/ ctx[50]);
6520
+ return /*click_handler*/ ctx[31](/*option*/ ctx[48]);
6522
6521
  }
6523
6522
 
6524
6523
  return {
@@ -6528,22 +6527,22 @@ function create_each_block_1(key_1, ctx) {
6528
6527
  li = element("li");
6529
6528
  t0 = text(t0_value);
6530
6529
  t1 = space();
6531
- attr(li, "id", li_id_value = /*option*/ ctx[50].label);
6530
+ attr(li, "id", li_id_value = /*option*/ ctx[48].label);
6532
6531
  attr(li, "role", "option");
6533
- attr(li, "aria-label", li_aria_label_value = /*option*/ ctx[50].label || /*option*/ ctx[50].value);
6532
+ attr(li, "aria-label", li_aria_label_value = /*option*/ ctx[48].label || /*option*/ ctx[48].value);
6534
6533
 
6535
- attr(li, "aria-selected", li_aria_selected_value = /*_values*/ ctx[15].includes(/*option*/ ctx[50].value)
6534
+ attr(li, "aria-selected", li_aria_selected_value = /*_values*/ ctx[15].includes(/*option*/ ctx[48].value)
6536
6535
  ? "true"
6537
6536
  : "false");
6538
6537
 
6539
6538
  attr(li, "class", "dropdown-item");
6540
- attr(li, "data-testid", li_data_testid_value = `dropdown-item-${/*option*/ ctx[50].value}`);
6541
- attr(li, "data-index", li_data_index_value = /*index*/ ctx[54]);
6542
- attr(li, "data-value", li_data_value_value = /*option*/ ctx[50].value);
6543
- attr(li, "style", li_style_value = `display: ${"block"}`);
6539
+ attr(li, "data-testid", li_data_testid_value = `dropdown-item-${/*option*/ ctx[48].value}`);
6540
+ attr(li, "data-index", li_data_index_value = /*index*/ ctx[52]);
6541
+ attr(li, "data-value", li_data_value_value = /*option*/ ctx[48].value);
6542
+ set_style(li, "display", "block");
6544
6543
  toggle_class(li, "dropdown-item--disabled", false);
6545
- toggle_class(li, "dropdown-item--tabbed", /*index*/ ctx[54] === /*_highlightedIndex*/ ctx[18]);
6546
- toggle_class(li, "dropdown-item--selected", /*_values*/ ctx[15].includes(/*option*/ ctx[50].value));
6544
+ toggle_class(li, "dropdown-item--tabbed", /*index*/ ctx[52] === /*_highlightedIndex*/ ctx[18]);
6545
+ toggle_class(li, "dropdown-item--selected", /*_values*/ ctx[15].includes(/*option*/ ctx[48].value));
6547
6546
  this.first = li;
6548
6547
  },
6549
6548
  m(target, anchor) {
@@ -6558,40 +6557,40 @@ function create_each_block_1(key_1, ctx) {
6558
6557
  },
6559
6558
  p(new_ctx, dirty) {
6560
6559
  ctx = new_ctx;
6561
- if (dirty[0] & /*_options*/ 4096 && t0_value !== (t0_value = (/*option*/ ctx[50].label || /*option*/ ctx[50].value) + "")) set_data(t0, t0_value);
6560
+ if (dirty[0] & /*_options*/ 4096 && t0_value !== (t0_value = (/*option*/ ctx[48].label || /*option*/ ctx[48].value) + "")) set_data(t0, t0_value);
6562
6561
 
6563
- if (dirty[0] & /*_options*/ 4096 && li_id_value !== (li_id_value = /*option*/ ctx[50].label)) {
6562
+ if (dirty[0] & /*_options*/ 4096 && li_id_value !== (li_id_value = /*option*/ ctx[48].label)) {
6564
6563
  attr(li, "id", li_id_value);
6565
6564
  }
6566
6565
 
6567
- if (dirty[0] & /*_options*/ 4096 && li_aria_label_value !== (li_aria_label_value = /*option*/ ctx[50].label || /*option*/ ctx[50].value)) {
6566
+ if (dirty[0] & /*_options*/ 4096 && li_aria_label_value !== (li_aria_label_value = /*option*/ ctx[48].label || /*option*/ ctx[48].value)) {
6568
6567
  attr(li, "aria-label", li_aria_label_value);
6569
6568
  }
6570
6569
 
6571
- if (dirty[0] & /*_values, _options*/ 36864 && li_aria_selected_value !== (li_aria_selected_value = /*_values*/ ctx[15].includes(/*option*/ ctx[50].value)
6570
+ if (dirty[0] & /*_values, _options*/ 36864 && li_aria_selected_value !== (li_aria_selected_value = /*_values*/ ctx[15].includes(/*option*/ ctx[48].value)
6572
6571
  ? "true"
6573
6572
  : "false")) {
6574
6573
  attr(li, "aria-selected", li_aria_selected_value);
6575
6574
  }
6576
6575
 
6577
- if (dirty[0] & /*_options*/ 4096 && li_data_testid_value !== (li_data_testid_value = `dropdown-item-${/*option*/ ctx[50].value}`)) {
6576
+ if (dirty[0] & /*_options*/ 4096 && li_data_testid_value !== (li_data_testid_value = `dropdown-item-${/*option*/ ctx[48].value}`)) {
6578
6577
  attr(li, "data-testid", li_data_testid_value);
6579
6578
  }
6580
6579
 
6581
- if (dirty[0] & /*_options*/ 4096 && li_data_index_value !== (li_data_index_value = /*index*/ ctx[54])) {
6580
+ if (dirty[0] & /*_options*/ 4096 && li_data_index_value !== (li_data_index_value = /*index*/ ctx[52])) {
6582
6581
  attr(li, "data-index", li_data_index_value);
6583
6582
  }
6584
6583
 
6585
- if (dirty[0] & /*_options*/ 4096 && li_data_value_value !== (li_data_value_value = /*option*/ ctx[50].value)) {
6584
+ if (dirty[0] & /*_options*/ 4096 && li_data_value_value !== (li_data_value_value = /*option*/ ctx[48].value)) {
6586
6585
  attr(li, "data-value", li_data_value_value);
6587
6586
  }
6588
6587
 
6589
6588
  if (dirty[0] & /*_options, _highlightedIndex*/ 266240) {
6590
- toggle_class(li, "dropdown-item--tabbed", /*index*/ ctx[54] === /*_highlightedIndex*/ ctx[18]);
6589
+ toggle_class(li, "dropdown-item--tabbed", /*index*/ ctx[52] === /*_highlightedIndex*/ ctx[18]);
6591
6590
  }
6592
6591
 
6593
6592
  if (dirty[0] & /*_values, _options*/ 36864) {
6594
- toggle_class(li, "dropdown-item--selected", /*_values*/ ctx[15].includes(/*option*/ ctx[50].value));
6593
+ toggle_class(li, "dropdown-item--selected", /*_values*/ ctx[15].includes(/*option*/ ctx[48].value));
6595
6594
  }
6596
6595
  },
6597
6596
  d(detaching) {
@@ -6602,10 +6601,10 @@ function create_each_block_1(key_1, ctx) {
6602
6601
  };
6603
6602
  }
6604
6603
 
6605
- // (261:6) {#each _options as option}
6604
+ // (249:6) {#each _options as option}
6606
6605
  function create_each_block$7(ctx) {
6607
6606
  let option;
6608
- let t0_value = /*option*/ ctx[50].label + "";
6607
+ let t0_value = /*option*/ ctx[48].label + "";
6609
6608
  let t0;
6610
6609
  let t1;
6611
6610
  let option_selected_value;
@@ -6617,10 +6616,10 @@ function create_each_block$7(ctx) {
6617
6616
  option = element("option");
6618
6617
  t0 = text(t0_value);
6619
6618
  t1 = space();
6620
- option.selected = option_selected_value = /*option*/ ctx[50].selected;
6621
- option.__value = option_value_value = /*option*/ ctx[50].value;
6619
+ option.selected = option_selected_value = /*option*/ ctx[48].selected;
6620
+ option.__value = option_value_value = /*option*/ ctx[48].value;
6622
6621
  option.value = option.__value;
6623
- attr(option, "aria-label", option_aria_label_value = /*option*/ ctx[50].label);
6622
+ attr(option, "aria-label", option_aria_label_value = /*option*/ ctx[48].label);
6624
6623
  },
6625
6624
  m(target, anchor) {
6626
6625
  insert(target, option, anchor);
@@ -6628,18 +6627,18 @@ function create_each_block$7(ctx) {
6628
6627
  append(option, t1);
6629
6628
  },
6630
6629
  p(ctx, dirty) {
6631
- if (dirty[0] & /*_options*/ 4096 && t0_value !== (t0_value = /*option*/ ctx[50].label + "")) set_data(t0, t0_value);
6630
+ if (dirty[0] & /*_options*/ 4096 && t0_value !== (t0_value = /*option*/ ctx[48].label + "")) set_data(t0, t0_value);
6632
6631
 
6633
- if (dirty[0] & /*_options*/ 4096 && option_selected_value !== (option_selected_value = /*option*/ ctx[50].selected)) {
6632
+ if (dirty[0] & /*_options*/ 4096 && option_selected_value !== (option_selected_value = /*option*/ ctx[48].selected)) {
6634
6633
  option.selected = option_selected_value;
6635
6634
  }
6636
6635
 
6637
- if (dirty[0] & /*_options*/ 4096 && option_value_value !== (option_value_value = /*option*/ ctx[50].value)) {
6636
+ if (dirty[0] & /*_options*/ 4096 && option_value_value !== (option_value_value = /*option*/ ctx[48].value)) {
6638
6637
  option.__value = option_value_value;
6639
6638
  option.value = option.__value;
6640
6639
  }
6641
6640
 
6642
- if (dirty[0] & /*_options*/ 4096 && option_aria_label_value !== (option_aria_label_value = /*option*/ ctx[50].label)) {
6641
+ if (dirty[0] & /*_options*/ 4096 && option_aria_label_value !== (option_aria_label_value = /*option*/ ctx[48].label)) {
6643
6642
  attr(option, "aria-label", option_aria_label_value);
6644
6643
  }
6645
6644
  },
@@ -6865,8 +6864,6 @@ function instance$C($$self, $$props, $$invalidate) {
6865
6864
 
6866
6865
  // bind up/down arrows to navigate options
6867
6866
  _menuEl.addEventListener("mouseover", onHighlight);
6868
-
6869
- setDropdownMenuPosition();
6870
6867
  }
6871
6868
 
6872
6869
  function closeMenu() {
@@ -6876,15 +6873,6 @@ function instance$C($$self, $$props, $$invalidate) {
6876
6873
  $$invalidate(17, _isMenuVisible = false);
6877
6874
  }
6878
6875
 
6879
- function setDropdownMenuPosition() {
6880
- const dropdownRect = _el.getBoundingClientRect();
6881
- const menuRect = _menuEl.getBoundingClientRect();
6882
-
6883
- if (window.innerHeight - dropdownRect.top < dropdownRect.height + menuRect.height) {
6884
- menuRect.top - dropdownRect.top + 'px';
6885
- }
6886
- }
6887
-
6888
6876
  function setHighlightedIndexToSelected() {
6889
6877
  $$invalidate(18, _highlightedIndex = _options.findIndex(option => _values.includes(option.value)));
6890
6878
  }
@@ -6918,6 +6906,7 @@ function instance$C($$self, $$props, $$invalidate) {
6918
6906
  case " ":
6919
6907
  case "Enter":
6920
6908
  _isMenuVisible ? closeMenu() : showMenu();
6909
+ _menuEl.focus();
6921
6910
  e.preventDefault();
6922
6911
  break;
6923
6912
  case "Escape":
@@ -6927,11 +6916,10 @@ function instance$C($$self, $$props, $$invalidate) {
6927
6916
  break;
6928
6917
  case "ArrowDown":
6929
6918
  if (e.altKey) {
6930
- _isMenuVisible ? closeMenu() : showMenu();
6919
+ _isMenuVisible ? closeMenu() : showMenu(); // set menu focus to allow arrow keys to trigger scrolling within option list
6931
6920
  break;
6932
6921
  }
6933
6922
  _handleArrowDown();
6934
- e.preventDefault();
6935
6923
  break;
6936
6924
  case "ArrowUp":
6937
6925
  if (e.altKey) {
@@ -6939,7 +6927,6 @@ function instance$C($$self, $$props, $$invalidate) {
6939
6927
  break;
6940
6928
  }
6941
6929
  _handleArrowUp();
6942
- e.preventDefault();
6943
6930
  break;
6944
6931
  }
6945
6932
  };