@abgov/web-components 1.13.0 → 1.13.1-alpha.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 +1 -1
- package/web-components.es.js +194 -88
- package/web-components.umd.js +83 -81
package/package.json
CHANGED
package/web-components.es.js
CHANGED
|
@@ -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[
|
|
6232
|
-
child_ctx[
|
|
6231
|
+
child_ctx[51] = list[i];
|
|
6232
|
+
child_ctx[55] = 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[
|
|
6238
|
+
child_ctx[51] = list[i];
|
|
6239
6239
|
return child_ctx;
|
|
6240
6240
|
}
|
|
6241
6241
|
|
|
6242
|
-
// (
|
|
6242
|
+
// (343: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[
|
|
6259
|
+
const get_key = ctx => /*index*/ ctx[55];
|
|
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,34 +6278,35 @@ 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, "error", /*error*/ ctx[7]);
|
|
6282
6281
|
set_custom_element_data(goa_input, "disabled", /*disabled*/ ctx[6]);
|
|
6282
|
+
set_custom_element_data(goa_input, "error", /*error*/ ctx[7]);
|
|
6283
6283
|
set_custom_element_data(goa_input, "leadingicon", /*leadingicon*/ ctx[2]);
|
|
6284
|
+
set_custom_element_data(goa_input, "name", /*name*/ ctx[0]);
|
|
6284
6285
|
set_custom_element_data(goa_input, "placeholder", /*placeholder*/ ctx[4]);
|
|
6285
6286
|
set_custom_element_data(goa_input, "aria-controls", "menu");
|
|
6286
6287
|
set_custom_element_data(goa_input, "aria-expanded", /*_isMenuVisible*/ ctx[18]);
|
|
6287
6288
|
set_custom_element_data(goa_input, "arialabel", goa_input_arialabel_value = /*arialabel*/ ctx[1] || /*name*/ ctx[0]);
|
|
6288
6289
|
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, "
|
|
6295
|
+
set_custom_element_data(goa_input, "readonly", "");
|
|
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");
|
|
6301
6300
|
|
|
6302
6301
|
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");
|
|
6309
6310
|
set_custom_element_data(goa_popover, "open", /*_isMenuVisible*/ ctx[18]);
|
|
6310
6311
|
set_custom_element_data(goa_popover, "padded", "false");
|
|
6311
6312
|
set_custom_element_data(goa_popover, "width", goa_popover_width_value = /*width*/ ctx[5] || /*_computedWidth*/ ctx[20]);
|
|
@@ -6332,18 +6333,22 @@ function create_else_block$a(ctx) {
|
|
|
6332
6333
|
}
|
|
6333
6334
|
},
|
|
6334
6335
|
p(ctx, dirty) {
|
|
6335
|
-
if (dirty[0] & /*error*/ 128) {
|
|
6336
|
-
set_custom_element_data(goa_input, "error", /*error*/ ctx[7]);
|
|
6337
|
-
}
|
|
6338
|
-
|
|
6339
6336
|
if (dirty[0] & /*disabled*/ 64) {
|
|
6340
6337
|
set_custom_element_data(goa_input, "disabled", /*disabled*/ ctx[6]);
|
|
6341
6338
|
}
|
|
6342
6339
|
|
|
6340
|
+
if (dirty[0] & /*error*/ 128) {
|
|
6341
|
+
set_custom_element_data(goa_input, "error", /*error*/ ctx[7]);
|
|
6342
|
+
}
|
|
6343
|
+
|
|
6343
6344
|
if (dirty[0] & /*leadingicon*/ 4) {
|
|
6344
6345
|
set_custom_element_data(goa_input, "leadingicon", /*leadingicon*/ ctx[2]);
|
|
6345
6346
|
}
|
|
6346
6347
|
|
|
6348
|
+
if (dirty[0] & /*name*/ 1) {
|
|
6349
|
+
set_custom_element_data(goa_input, "name", /*name*/ ctx[0]);
|
|
6350
|
+
}
|
|
6351
|
+
|
|
6347
6352
|
if (dirty[0] & /*placeholder*/ 16) {
|
|
6348
6353
|
set_custom_element_data(goa_input, "placeholder", /*placeholder*/ ctx[4]);
|
|
6349
6354
|
}
|
|
@@ -6364,10 +6369,6 @@ function create_else_block$a(ctx) {
|
|
|
6364
6369
|
set_custom_element_data(goa_input, "value", /*_selectedLabel*/ ctx[17]);
|
|
6365
6370
|
}
|
|
6366
6371
|
|
|
6367
|
-
if (dirty[0] & /*name*/ 1) {
|
|
6368
|
-
set_custom_element_data(goa_input, "name", /*name*/ ctx[0]);
|
|
6369
|
-
}
|
|
6370
|
-
|
|
6371
6372
|
if (dirty[0] & /*_options, _values, _highlightedIndex, onSelect*/ 67706880) {
|
|
6372
6373
|
each_value_1 = /*_options*/ ctx[13];
|
|
6373
6374
|
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);
|
|
@@ -6378,6 +6379,7 @@ function create_else_block$a(ctx) {
|
|
|
6378
6379
|
}
|
|
6379
6380
|
|
|
6380
6381
|
if (dirty[0] & /*maxheight*/ 8 && ul_style_value !== (ul_style_value = `
|
|
6382
|
+
outline: none;
|
|
6381
6383
|
overflow-y: auto;
|
|
6382
6384
|
max-height: ${/*maxheight*/ ctx[3]};
|
|
6383
6385
|
`)) {
|
|
@@ -6416,7 +6418,7 @@ function create_else_block$a(ctx) {
|
|
|
6416
6418
|
};
|
|
6417
6419
|
}
|
|
6418
6420
|
|
|
6419
|
-
// (
|
|
6421
|
+
// (328:2) {#if _native}
|
|
6420
6422
|
function create_if_block$m(ctx) {
|
|
6421
6423
|
let select;
|
|
6422
6424
|
let slot;
|
|
@@ -6506,10 +6508,10 @@ function create_if_block$m(ctx) {
|
|
|
6506
6508
|
};
|
|
6507
6509
|
}
|
|
6508
6510
|
|
|
6509
|
-
// (
|
|
6511
|
+
// (389:8) {#each _options as option, index (index)}
|
|
6510
6512
|
function create_each_block_1(key_1, ctx) {
|
|
6511
6513
|
let li;
|
|
6512
|
-
let t0_value = (/*option*/ ctx[
|
|
6514
|
+
let t0_value = (/*option*/ ctx[51].label || /*option*/ ctx[51].value) + "";
|
|
6513
6515
|
let t0;
|
|
6514
6516
|
let t1;
|
|
6515
6517
|
let li_id_value;
|
|
@@ -6522,7 +6524,7 @@ function create_each_block_1(key_1, ctx) {
|
|
|
6522
6524
|
let dispose;
|
|
6523
6525
|
|
|
6524
6526
|
function click_handler() {
|
|
6525
|
-
return /*click_handler*/ ctx[32](/*option*/ ctx[
|
|
6527
|
+
return /*click_handler*/ ctx[32](/*option*/ ctx[51]);
|
|
6526
6528
|
}
|
|
6527
6529
|
|
|
6528
6530
|
return {
|
|
@@ -6532,22 +6534,23 @@ function create_each_block_1(key_1, ctx) {
|
|
|
6532
6534
|
li = element("li");
|
|
6533
6535
|
t0 = text(t0_value);
|
|
6534
6536
|
t1 = space();
|
|
6535
|
-
attr(li, "id", li_id_value = /*option*/ ctx[
|
|
6537
|
+
attr(li, "id", li_id_value = /*option*/ ctx[51].label);
|
|
6536
6538
|
attr(li, "role", "option");
|
|
6537
|
-
attr(li, "
|
|
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);
|
|
6538
6542
|
|
|
6539
|
-
attr(li, "aria-selected", li_aria_selected_value = /*_values*/ ctx[16].includes(/*option*/ ctx[
|
|
6543
|
+
attr(li, "aria-selected", li_aria_selected_value = /*_values*/ ctx[16].includes(/*option*/ ctx[51].value)
|
|
6540
6544
|
? "true"
|
|
6541
6545
|
: "false");
|
|
6542
6546
|
|
|
6543
6547
|
attr(li, "class", "dropdown-item");
|
|
6544
|
-
attr(li, "data-testid", li_data_testid_value = `dropdown-item-${/*option*/ ctx[
|
|
6545
|
-
attr(li, "data-index", li_data_index_value = /*index*/ ctx[
|
|
6546
|
-
attr(li, "data-value", li_data_value_value = /*option*/ ctx[
|
|
6547
|
-
set_style(li, "display", "block");
|
|
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);
|
|
6548
6551
|
toggle_class(li, "dropdown-item--disabled", false);
|
|
6549
|
-
toggle_class(li, "dropdown-item--tabbed", /*index*/ ctx[
|
|
6550
|
-
toggle_class(li, "dropdown-item--selected", /*_values*/ ctx[16].includes(/*option*/ ctx[
|
|
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));
|
|
6551
6554
|
this.first = li;
|
|
6552
6555
|
},
|
|
6553
6556
|
m(target, anchor) {
|
|
@@ -6562,40 +6565,40 @@ function create_each_block_1(key_1, ctx) {
|
|
|
6562
6565
|
},
|
|
6563
6566
|
p(new_ctx, dirty) {
|
|
6564
6567
|
ctx = new_ctx;
|
|
6565
|
-
if (dirty[0] & /*_options*/ 8192 && t0_value !== (t0_value = (/*option*/ ctx[
|
|
6568
|
+
if (dirty[0] & /*_options*/ 8192 && t0_value !== (t0_value = (/*option*/ ctx[51].label || /*option*/ ctx[51].value) + "")) set_data(t0, t0_value);
|
|
6566
6569
|
|
|
6567
|
-
if (dirty[0] & /*_options*/ 8192 && li_id_value !== (li_id_value = /*option*/ ctx[
|
|
6570
|
+
if (dirty[0] & /*_options*/ 8192 && li_id_value !== (li_id_value = /*option*/ ctx[51].label)) {
|
|
6568
6571
|
attr(li, "id", li_id_value);
|
|
6569
6572
|
}
|
|
6570
6573
|
|
|
6571
|
-
if (dirty[0] & /*_options*/ 8192 && li_aria_label_value !== (li_aria_label_value = /*option*/ ctx[
|
|
6574
|
+
if (dirty[0] & /*_options*/ 8192 && li_aria_label_value !== (li_aria_label_value = /*option*/ ctx[51].label || /*option*/ ctx[51].value)) {
|
|
6572
6575
|
attr(li, "aria-label", li_aria_label_value);
|
|
6573
6576
|
}
|
|
6574
6577
|
|
|
6575
|
-
if (dirty[0] & /*_values, _options*/ 73728 && li_aria_selected_value !== (li_aria_selected_value = /*_values*/ ctx[16].includes(/*option*/ ctx[
|
|
6578
|
+
if (dirty[0] & /*_values, _options*/ 73728 && li_aria_selected_value !== (li_aria_selected_value = /*_values*/ ctx[16].includes(/*option*/ ctx[51].value)
|
|
6576
6579
|
? "true"
|
|
6577
6580
|
: "false")) {
|
|
6578
6581
|
attr(li, "aria-selected", li_aria_selected_value);
|
|
6579
6582
|
}
|
|
6580
6583
|
|
|
6581
|
-
if (dirty[0] & /*_options*/ 8192 && li_data_testid_value !== (li_data_testid_value = `dropdown-item-${/*option*/ ctx[
|
|
6584
|
+
if (dirty[0] & /*_options*/ 8192 && li_data_testid_value !== (li_data_testid_value = `dropdown-item-${/*option*/ ctx[51].value}`)) {
|
|
6582
6585
|
attr(li, "data-testid", li_data_testid_value);
|
|
6583
6586
|
}
|
|
6584
6587
|
|
|
6585
|
-
if (dirty[0] & /*_options*/ 8192 && li_data_index_value !== (li_data_index_value = /*index*/ ctx[
|
|
6588
|
+
if (dirty[0] & /*_options*/ 8192 && li_data_index_value !== (li_data_index_value = /*index*/ ctx[55])) {
|
|
6586
6589
|
attr(li, "data-index", li_data_index_value);
|
|
6587
6590
|
}
|
|
6588
6591
|
|
|
6589
|
-
if (dirty[0] & /*_options*/ 8192 && li_data_value_value !== (li_data_value_value = /*option*/ ctx[
|
|
6592
|
+
if (dirty[0] & /*_options*/ 8192 && li_data_value_value !== (li_data_value_value = /*option*/ ctx[51].value)) {
|
|
6590
6593
|
attr(li, "data-value", li_data_value_value);
|
|
6591
6594
|
}
|
|
6592
6595
|
|
|
6593
6596
|
if (dirty[0] & /*_options, _highlightedIndex*/ 532480) {
|
|
6594
|
-
toggle_class(li, "dropdown-item--tabbed", /*index*/ ctx[
|
|
6597
|
+
toggle_class(li, "dropdown-item--tabbed", /*index*/ ctx[55] === /*_highlightedIndex*/ ctx[19]);
|
|
6595
6598
|
}
|
|
6596
6599
|
|
|
6597
6600
|
if (dirty[0] & /*_values, _options*/ 73728) {
|
|
6598
|
-
toggle_class(li, "dropdown-item--selected", /*_values*/ ctx[16].includes(/*option*/ ctx[
|
|
6601
|
+
toggle_class(li, "dropdown-item--selected", /*_values*/ ctx[16].includes(/*option*/ ctx[51].value));
|
|
6599
6602
|
}
|
|
6600
6603
|
},
|
|
6601
6604
|
d(detaching) {
|
|
@@ -6606,10 +6609,10 @@ function create_each_block_1(key_1, ctx) {
|
|
|
6606
6609
|
};
|
|
6607
6610
|
}
|
|
6608
6611
|
|
|
6609
|
-
// (
|
|
6612
|
+
// (337:6) {#each _options as option}
|
|
6610
6613
|
function create_each_block$7(ctx) {
|
|
6611
6614
|
let option;
|
|
6612
|
-
let t0_value = /*option*/ ctx[
|
|
6615
|
+
let t0_value = /*option*/ ctx[51].label + "";
|
|
6613
6616
|
let t0;
|
|
6614
6617
|
let t1;
|
|
6615
6618
|
let option_selected_value;
|
|
@@ -6621,10 +6624,10 @@ function create_each_block$7(ctx) {
|
|
|
6621
6624
|
option = element("option");
|
|
6622
6625
|
t0 = text(t0_value);
|
|
6623
6626
|
t1 = space();
|
|
6624
|
-
option.selected = option_selected_value = /*option*/ ctx[
|
|
6625
|
-
option.__value = option_value_value = /*option*/ ctx[
|
|
6627
|
+
option.selected = option_selected_value = /*option*/ ctx[51].selected;
|
|
6628
|
+
option.__value = option_value_value = /*option*/ ctx[51].value;
|
|
6626
6629
|
option.value = option.__value;
|
|
6627
|
-
attr(option, "aria-label", option_aria_label_value = /*option*/ ctx[
|
|
6630
|
+
attr(option, "aria-label", option_aria_label_value = /*option*/ ctx[51].label);
|
|
6628
6631
|
},
|
|
6629
6632
|
m(target, anchor) {
|
|
6630
6633
|
insert(target, option, anchor);
|
|
@@ -6632,18 +6635,18 @@ function create_each_block$7(ctx) {
|
|
|
6632
6635
|
append(option, t1);
|
|
6633
6636
|
},
|
|
6634
6637
|
p(ctx, dirty) {
|
|
6635
|
-
if (dirty[0] & /*_options*/ 8192 && t0_value !== (t0_value = /*option*/ ctx[
|
|
6638
|
+
if (dirty[0] & /*_options*/ 8192 && t0_value !== (t0_value = /*option*/ ctx[51].label + "")) set_data(t0, t0_value);
|
|
6636
6639
|
|
|
6637
|
-
if (dirty[0] & /*_options*/ 8192 && option_selected_value !== (option_selected_value = /*option*/ ctx[
|
|
6640
|
+
if (dirty[0] & /*_options*/ 8192 && option_selected_value !== (option_selected_value = /*option*/ ctx[51].selected)) {
|
|
6638
6641
|
option.selected = option_selected_value;
|
|
6639
6642
|
}
|
|
6640
6643
|
|
|
6641
|
-
if (dirty[0] & /*_options*/ 8192 && option_value_value !== (option_value_value = /*option*/ ctx[
|
|
6644
|
+
if (dirty[0] & /*_options*/ 8192 && option_value_value !== (option_value_value = /*option*/ ctx[51].value)) {
|
|
6642
6645
|
option.__value = option_value_value;
|
|
6643
6646
|
option.value = option.__value;
|
|
6644
6647
|
}
|
|
6645
6648
|
|
|
6646
|
-
if (dirty[0] & /*_options*/ 8192 && option_aria_label_value !== (option_aria_label_value = /*option*/ ctx[
|
|
6649
|
+
if (dirty[0] & /*_options*/ 8192 && option_aria_label_value !== (option_aria_label_value = /*option*/ ctx[51].label)) {
|
|
6647
6650
|
attr(option, "aria-label", option_aria_label_value);
|
|
6648
6651
|
}
|
|
6649
6652
|
},
|
|
@@ -6904,58 +6907,161 @@ function instance$C($$self, $$props, $$invalidate) {
|
|
|
6904
6907
|
}
|
|
6905
6908
|
}
|
|
6906
6909
|
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
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
|
|
6910
|
+
function MenuVisibleKeyDownHandler() {
|
|
6911
|
+
const handle = e => {
|
|
6912
|
+
switch (e.key) {
|
|
6913
|
+
case " ":
|
|
6914
|
+
onSpace(e);
|
|
6923
6915
|
break;
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
break;
|
|
6927
|
-
case "ArrowUp":
|
|
6928
|
-
if (e.altKey) {
|
|
6929
|
-
_isMenuVisible ? closeMenu() : showMenu();
|
|
6916
|
+
case "Enter":
|
|
6917
|
+
onEnter(e);
|
|
6930
6918
|
break;
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6919
|
+
case "Escape":
|
|
6920
|
+
onEscape(e);
|
|
6921
|
+
break;
|
|
6922
|
+
case "ArrowUp":
|
|
6923
|
+
onArrowUp(e);
|
|
6924
|
+
break;
|
|
6925
|
+
case "ArrowDown":
|
|
6926
|
+
onArrowDown(e);
|
|
6927
|
+
break;
|
|
6928
|
+
}
|
|
6929
|
+
};
|
|
6930
|
+
|
|
6931
|
+
const onSpace = e => {
|
|
6932
|
+
e.preventDefault();
|
|
6933
|
+
};
|
|
6936
6934
|
|
|
6937
|
-
|
|
6938
|
-
if (_highlightedIndex < _options.length - 1) {
|
|
6939
|
-
$$invalidate(19, _highlightedIndex++, _highlightedIndex);
|
|
6935
|
+
const onEnter = e => {
|
|
6940
6936
|
onSelect(_options[_highlightedIndex].value, _options[_highlightedIndex].label, false);
|
|
6941
|
-
|
|
6942
|
-
|
|
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
|
+
}
|
|
6943
6956
|
|
|
6944
|
-
function _handleArrowUp() {
|
|
6945
|
-
if (_highlightedIndex > 0) {
|
|
6946
|
-
$$invalidate(19, _highlightedIndex--, _highlightedIndex);
|
|
6947
6957
|
onSelect(_options[_highlightedIndex].value, _options[_highlightedIndex].label, false);
|
|
6948
|
-
}
|
|
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
|
+
}
|
|
6969
|
+
|
|
6970
|
+
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 };
|
|
6949
7040
|
}
|
|
6950
7041
|
|
|
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);
|
|
7050
|
+
}
|
|
7051
|
+
};
|
|
7052
|
+
|
|
6951
7053
|
// add required bindings to component
|
|
6952
7054
|
function onFocus() {
|
|
6953
|
-
|
|
7055
|
+
if (!_native) {
|
|
7056
|
+
_el.addEventListener("keydown", onInputKeyDown);
|
|
7057
|
+
}
|
|
6954
7058
|
}
|
|
6955
7059
|
|
|
6956
7060
|
// remove all bindings from component
|
|
6957
7061
|
function onBlur() {
|
|
6958
|
-
|
|
7062
|
+
if (!_native) {
|
|
7063
|
+
_el.removeEventListener("keydown", onInputKeyDown);
|
|
7064
|
+
}
|
|
6959
7065
|
}
|
|
6960
7066
|
|
|
6961
7067
|
function onHighlight(e) {
|
|
@@ -7087,7 +7193,7 @@ class Dropdown extends SvelteElement {
|
|
|
7087
7193
|
constructor(options) {
|
|
7088
7194
|
super();
|
|
7089
7195
|
const style = document.createElement('style');
|
|
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) +
|
|
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)}`;
|
|
7091
7197
|
this.shadowRoot.appendChild(style);
|
|
7092
7198
|
|
|
7093
7199
|
init(
|
|
@@ -10423,7 +10529,7 @@ class Input extends SvelteElement {
|
|
|
10423
10529
|
super();
|
|
10424
10530
|
const style = document.createElement('style');
|
|
10425
10531
|
|
|
10426
|
-
style.textContent = `:host{box-sizing:border-box}.container{position:relative;width:100%;display:inline-block}@media(min-width: 640px){.container{width:var(--width)}}.goa-input,.goa-input *{box-sizing:border-box;line-height:normal}.goa-input{box-sizing:border-box;outline:none;transition:box-shadow 0.1s ease-in;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);display:inline-flex;align-items:stretch;vertical-align:middle;min-width:100%;background-color:var(--goa-color-greyscale-white)}.goa-input:hover:not(.goa-input-leading-content):not(.goa-input-trailing-content){border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}.goa-input:active:not(.goa-input-leading-content):not(.goa-input-trailing-content),.goa-input:focus:not(.goa-input-leading-content):not(.goa-input-trailing-content),.goa-input:focus-within:not(.goa-input-leading-content):not(.goa-input-trailing-content){box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}.goa-input.type--range{border:none}.goa-input.type--range:active,.goa-input.type--range:focus,.goa-input.type--range:focus-within{box-shadow:none}.goa-input-leading-icon{margin-left:0.75rem}.goa-input-trailing-icon{margin-right:var(--goa-space-s)}.goa-input-trailing-icon-button{margin-right:var(--goa-space-xs)}input{display:inline-block;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);padding:var(--goa-space-s);line-height:calc(40px - calc(var(--goa-space-xs) * 2));background-color:transparent;width:100%;flex:1 1 auto;font-family:var(--goa-font-family-sans);z-index:1}input[readonly]{cursor:pointer}.goa-input-leading-icon+input{padding-left:0.5rem}input,input:focus,input:hover,input:active{outline:none;border:none}.goa-input--disabled,.goa-input--disabled:hover,.goa-input--disabled:active,.goa-input--disabled:focus{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200) !important;cursor:default;box-shadow:none !important}.goa-input--disabled input,.goa-input--disabled input:hover,.goa-input--disabled input:active,.goa-input--disabled input:focus{color:var(--goa-color-text-secondary)}.goa-input--disabled input:hover{cursor:default !important}.prefix,.suffix,.leading-content ::slotted(div),.trailing-content ::slotted(div){background-color:var(--goa-color-greyscale-100);padding:0 0.75rem;display:flex;align-items:center}.leading-content ::slotted(div),.trailing-content ::slotted(div){padding:0.5rem 0.75rem}.prefix,.leading-content ::slotted(div){border-top-left-radius:var(--goa-border-radius-m);border-bottom-left-radius:var(--goa-border-radius-m);border-right:1px solid var(--goa-color-greyscale-700)}.suffix,.trailing-content ::slotted(div){border-top-right-radius:var(--goa-border-radius-m);border-bottom-right-radius:var(--goa-border-radius-m);border-left:1px solid var(--goa-color-greyscale-700)}.goa-input--disabled .prefix,.goa-input--disabled .leading-content ::slotted(div){border-right:1px solid var(--goa-color-greyscale-200)}.goa-input--disabled .suffix,.goa-input--disabled .trailing-content ::slotted(div){border-left:1px solid var(--goa-color-greyscale-200)}input.input--goa{display:block;border:none;flex:1 1 auto}.variant--bare{border:none}.variant--bare:focus,.variant--bare:active,.variant--bare:focus-within{box-shadow:none}.error:not(.goa-input-leading-content):not(.goa-input-trailing-content),.error:hover:not(.goa-input-leading-content):not(.goa-input-trailing-content){border:2px solid var(--goa-color-interactive-error);box-shadow:0 0 0 1px var(--goa-color-interactive-error)}.error:focus-within:hover:not(.goa-input-leading-content):not(.goa-input-trailing-content){border:2px solid var(--goa-color-interactive-error);box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}.error .input-leading-content,.error .input-leading-content:hover,.error .input-trailing-content,.error .input-trailing-content:hover{outline:var(--goa-border-width-s) solid var(--goa-color-interactive-error);box-shadow:inset 0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-error)}.error .input-leading-content:focus,.error .input-trailing-content:focus,.error .input-leading-content:active,.error .input-trailing-content:active{outline:var(--goa-border-width-s) solid var(--goa-color-interactive-error);box-shadow:0 0 0 var(--goa-border-width-l) var(--goa-color-interactive-focus)}.input-leading-content:hover,.input-trailing-content:hover{box-shadow:inset 0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover);outline:var(--goa-border-width-s) solid var(--goa-color-interactive-hover)}.input-leading-content:active,.input-leading-content:focus,.input-leading-content:focus-within,.input-trailing-content:active,.input-trailing-content:focus,.input-trailing-content:focus-within{box-shadow:0 0 0 var(--goa-border-width-l) var(--goa-color-interactive-focus);outline:var(--goa-border-width-s) solid var(--goa-color-greyscale-700)}.error .input-trailing-content,.input-trailing-content:hover,.input-trailing-content:active,.input-trailing-content:focus,.input-trailing-content:focus-within{border-top-left-radius:var(--goa-border-radius-m);border-bottom-left-radius:var(--goa-border-radius-m)}.error .input-leading-content,.input-leading-content:hover,.input-leading-content:active,.input-leading-content:focus,.input-leading-content:focus-within{border-top-right-radius:var(--goa-border-radius-m);border-bottom-right-radius:var(--goa-border-radius-m)}.input-leading-content.input-trailing-content,.input-leading-content.input-trailing-content:hover,.input-leading-content.input-trailing-content:active,.input-leading-content.input-trailing-content:focus,.input-leading-content.input-trailing-content:focus-within{border-radius:0}input[type="search"]:enabled:read-write:-webkit-any(:focus, :hover)::-webkit-search-cancel-button{position:relative;right:var(--search-icon-offset);cursor:pointer;-webkit-appearance:none;height:1.2rem;width:1.2rem;background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23333" d="M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z"/></svg>')
|
|
10532
|
+
style.textContent = `:host{box-sizing:border-box}.container{position:relative;width:100%;display:inline-block}@media(min-width: 640px){.container{width:var(--width)}}.goa-input,.goa-input *{box-sizing:border-box;line-height:normal}.goa-input{box-sizing:border-box;outline:none;transition:box-shadow 0.1s ease-in;border:1px solid var(--goa-color-greyscale-700);border-radius:var(--goa-border-radius-m);display:inline-flex;align-items:stretch;vertical-align:middle;min-width:100%;background-color:var(--goa-color-greyscale-white)}.goa-input:hover:not(.goa-input-leading-content):not(.goa-input-trailing-content){border-color:var(--goa-color-interactive-hover);box-shadow:0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover)}.goa-input:active:not(.goa-input-leading-content):not(.goa-input-trailing-content),.goa-input:focus:not(.goa-input-leading-content):not(.goa-input-trailing-content),.goa-input:focus-within:not(.goa-input-leading-content):not(.goa-input-trailing-content){box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}.goa-input.type--range{border:none}.goa-input.type--range:active,.goa-input.type--range:focus,.goa-input.type--range:focus-within{box-shadow:none}.goa-input-leading-icon{margin-left:0.75rem}.goa-input-trailing-icon{margin-right:var(--goa-space-s)}.goa-input-trailing-icon-button{margin-right:var(--goa-space-xs)}input{display:inline-block;color:var(--goa-color-text-default);font-size:var(--goa-font-size-4);padding:var(--goa-space-xs) var(--goa-space-s);line-height:calc(40px - calc(var(--goa-space-xs) * 2));background-color:transparent;width:100%;flex:1 1 auto;font-family:var(--goa-font-family-sans);z-index:1}input[readonly]{cursor:pointer}.goa-input-leading-icon+input{padding-left:0.5rem}input,input:focus,input:hover,input:active{outline:none;border:none}.goa-input--disabled,.goa-input--disabled:hover,.goa-input--disabled:active,.goa-input--disabled:focus{background-color:var(--goa-color-greyscale-100);border-color:var(--goa-color-greyscale-200) !important;cursor:default;box-shadow:none !important}.goa-input--disabled input,.goa-input--disabled input:hover,.goa-input--disabled input:active,.goa-input--disabled input:focus{color:var(--goa-color-text-secondary)}.goa-input--disabled input:hover{cursor:default !important}.prefix,.suffix,.leading-content ::slotted(div),.trailing-content ::slotted(div){background-color:var(--goa-color-greyscale-100);padding:0 0.75rem;display:flex;align-items:center}.leading-content ::slotted(div),.trailing-content ::slotted(div){padding:0.5rem 0.75rem}.prefix,.leading-content ::slotted(div){border-top-left-radius:var(--goa-border-radius-m);border-bottom-left-radius:var(--goa-border-radius-m);border-right:1px solid var(--goa-color-greyscale-700)}.suffix,.trailing-content ::slotted(div){border-top-right-radius:var(--goa-border-radius-m);border-bottom-right-radius:var(--goa-border-radius-m);border-left:1px solid var(--goa-color-greyscale-700)}.goa-input--disabled .prefix,.goa-input--disabled .leading-content ::slotted(div){border-right:1px solid var(--goa-color-greyscale-200)}.goa-input--disabled .suffix,.goa-input--disabled .trailing-content ::slotted(div){border-left:1px solid var(--goa-color-greyscale-200)}input.input--goa{display:block;border:none;flex:1 1 auto}.variant--bare{border:none}.variant--bare:focus,.variant--bare:active,.variant--bare:focus-within{box-shadow:none}.error:not(.goa-input-leading-content):not(.goa-input-trailing-content),.error:hover:not(.goa-input-leading-content):not(.goa-input-trailing-content){border:2px solid var(--goa-color-interactive-error);box-shadow:0 0 0 1px var(--goa-color-interactive-error)}.error:focus-within:hover:not(.goa-input-leading-content):not(.goa-input-trailing-content){border:2px solid var(--goa-color-interactive-error);box-shadow:0 0 0 3px var(--goa-color-interactive-focus)}.error .input-leading-content,.error .input-leading-content:hover,.error .input-trailing-content,.error .input-trailing-content:hover{outline:var(--goa-border-width-s) solid var(--goa-color-interactive-error);box-shadow:inset 0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-error)}.error .input-leading-content:focus,.error .input-trailing-content:focus,.error .input-leading-content:active,.error .input-trailing-content:active{outline:var(--goa-border-width-s) solid var(--goa-color-interactive-error);box-shadow:0 0 0 var(--goa-border-width-l) var(--goa-color-interactive-focus)}.input-leading-content:hover,.input-trailing-content:hover{box-shadow:inset 0 0 0 var(--goa-border-width-m) var(--goa-color-interactive-hover);outline:var(--goa-border-width-s) solid var(--goa-color-interactive-hover)}.input-leading-content:active,.input-leading-content:focus,.input-leading-content:focus-within,.input-trailing-content:active,.input-trailing-content:focus,.input-trailing-content:focus-within{box-shadow:0 0 0 var(--goa-border-width-l) var(--goa-color-interactive-focus);outline:var(--goa-border-width-s) solid var(--goa-color-greyscale-700)}.error .input-trailing-content,.input-trailing-content:hover,.input-trailing-content:active,.input-trailing-content:focus,.input-trailing-content:focus-within{border-top-left-radius:var(--goa-border-radius-m);border-bottom-left-radius:var(--goa-border-radius-m)}.error .input-leading-content,.input-leading-content:hover,.input-leading-content:active,.input-leading-content:focus,.input-leading-content:focus-within{border-top-right-radius:var(--goa-border-radius-m);border-bottom-right-radius:var(--goa-border-radius-m)}.input-leading-content.input-trailing-content,.input-leading-content.input-trailing-content:hover,.input-leading-content.input-trailing-content:active,.input-leading-content.input-trailing-content:focus,.input-leading-content.input-trailing-content:focus-within{border-radius:0}input[type="search"]:enabled:read-write:-webkit-any(:focus, :hover)::-webkit-search-cancel-button{position:relative;right:var(--search-icon-offset);cursor:pointer;-webkit-appearance:none;height:1.2rem;width:1.2rem;background:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="%23333" d="M405 136.798L375.202 107 256 226.202 136.798 107 107 136.798 226.202 256 107 375.202 136.798 405 256 285.798 375.202 405 405 375.202 285.798 256z"/></svg>')
|
|
10427
10533
|
center center no-repeat}`;
|
|
10428
10534
|
|
|
10429
10535
|
this.shadowRoot.appendChild(style);
|