@genesislcap/foundation-ui 14.284.3 → 14.284.4
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/dist/custom-elements.json +220 -184
- package/dist/dts/select/select.d.ts +9 -2
- package/dist/dts/select/select.d.ts.map +1 -1
- package/dist/dts/utils/dom.d.ts +1 -0
- package/dist/dts/utils/dom.d.ts.map +1 -1
- package/dist/esm/select/select.js +35 -4
- package/dist/esm/utils/dom.js +7 -0
- package/package.json +18 -18
|
@@ -921,6 +921,188 @@
|
|
|
921
921
|
}
|
|
922
922
|
]
|
|
923
923
|
},
|
|
924
|
+
{
|
|
925
|
+
"kind": "javascript-module",
|
|
926
|
+
"path": "src/accordion/accordion.styles.ts",
|
|
927
|
+
"declarations": [
|
|
928
|
+
{
|
|
929
|
+
"kind": "function",
|
|
930
|
+
"name": "foundationAccordionStyles",
|
|
931
|
+
"return": {
|
|
932
|
+
"type": {
|
|
933
|
+
"text": "ElementStyles"
|
|
934
|
+
}
|
|
935
|
+
},
|
|
936
|
+
"parameters": [
|
|
937
|
+
{
|
|
938
|
+
"name": "context",
|
|
939
|
+
"type": {
|
|
940
|
+
"text": "ElementDefinitionContext"
|
|
941
|
+
}
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
"name": "definition",
|
|
945
|
+
"type": {
|
|
946
|
+
"text": "FoundationElementDefinition"
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
]
|
|
950
|
+
}
|
|
951
|
+
],
|
|
952
|
+
"exports": [
|
|
953
|
+
{
|
|
954
|
+
"kind": "js",
|
|
955
|
+
"name": "foundationAccordionStyles",
|
|
956
|
+
"declaration": {
|
|
957
|
+
"name": "foundationAccordionStyles",
|
|
958
|
+
"module": "src/accordion/accordion.styles.ts"
|
|
959
|
+
}
|
|
960
|
+
}
|
|
961
|
+
]
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
"kind": "javascript-module",
|
|
965
|
+
"path": "src/accordion/accordion.template.ts",
|
|
966
|
+
"declarations": [
|
|
967
|
+
{
|
|
968
|
+
"kind": "function",
|
|
969
|
+
"name": "foundationAccordionTemplate",
|
|
970
|
+
"return": {
|
|
971
|
+
"type": {
|
|
972
|
+
"text": "ViewTemplate<Accordion>"
|
|
973
|
+
}
|
|
974
|
+
},
|
|
975
|
+
"parameters": [
|
|
976
|
+
{
|
|
977
|
+
"name": "context",
|
|
978
|
+
"type": {
|
|
979
|
+
"text": "ElementDefinitionContext"
|
|
980
|
+
}
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
"name": "definition",
|
|
984
|
+
"type": {
|
|
985
|
+
"text": "FoundationElementDefinition"
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
]
|
|
989
|
+
}
|
|
990
|
+
],
|
|
991
|
+
"exports": [
|
|
992
|
+
{
|
|
993
|
+
"kind": "js",
|
|
994
|
+
"name": "foundationAccordionTemplate",
|
|
995
|
+
"declaration": {
|
|
996
|
+
"name": "foundationAccordionTemplate",
|
|
997
|
+
"module": "src/accordion/accordion.template.ts"
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
]
|
|
1001
|
+
},
|
|
1002
|
+
{
|
|
1003
|
+
"kind": "javascript-module",
|
|
1004
|
+
"path": "src/accordion/accordion.ts",
|
|
1005
|
+
"declarations": [
|
|
1006
|
+
{
|
|
1007
|
+
"kind": "class",
|
|
1008
|
+
"description": "",
|
|
1009
|
+
"name": "Accordion",
|
|
1010
|
+
"superclass": {
|
|
1011
|
+
"name": "FASTAccordion",
|
|
1012
|
+
"package": "@microsoft/fast-foundation"
|
|
1013
|
+
},
|
|
1014
|
+
"tagName": "%%prefix%%-accordion",
|
|
1015
|
+
"customElement": true
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
"kind": "variable",
|
|
1019
|
+
"name": "foundationAccordionShadowOptions",
|
|
1020
|
+
"type": {
|
|
1021
|
+
"text": "ShadowRootInit"
|
|
1022
|
+
},
|
|
1023
|
+
"default": "{\n delegatesFocus: true,\n mode: 'open',\n}"
|
|
1024
|
+
},
|
|
1025
|
+
{
|
|
1026
|
+
"kind": "variable",
|
|
1027
|
+
"name": "defaultAccordionConfig",
|
|
1028
|
+
"type": {
|
|
1029
|
+
"text": "object"
|
|
1030
|
+
},
|
|
1031
|
+
"default": "{}"
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
"kind": "variable",
|
|
1035
|
+
"name": "foundationAccordion",
|
|
1036
|
+
"description": "The Foundation Accordion",
|
|
1037
|
+
"privacy": "public"
|
|
1038
|
+
}
|
|
1039
|
+
],
|
|
1040
|
+
"exports": [
|
|
1041
|
+
{
|
|
1042
|
+
"kind": "js",
|
|
1043
|
+
"name": "Accordion",
|
|
1044
|
+
"declaration": {
|
|
1045
|
+
"name": "Accordion",
|
|
1046
|
+
"module": "src/accordion/accordion.ts"
|
|
1047
|
+
}
|
|
1048
|
+
},
|
|
1049
|
+
{
|
|
1050
|
+
"kind": "js",
|
|
1051
|
+
"name": "foundationAccordionShadowOptions",
|
|
1052
|
+
"declaration": {
|
|
1053
|
+
"name": "foundationAccordionShadowOptions",
|
|
1054
|
+
"module": "src/accordion/accordion.ts"
|
|
1055
|
+
}
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
"kind": "js",
|
|
1059
|
+
"name": "defaultAccordionConfig",
|
|
1060
|
+
"declaration": {
|
|
1061
|
+
"name": "defaultAccordionConfig",
|
|
1062
|
+
"module": "src/accordion/accordion.ts"
|
|
1063
|
+
}
|
|
1064
|
+
},
|
|
1065
|
+
{
|
|
1066
|
+
"kind": "js",
|
|
1067
|
+
"name": "foundationAccordion",
|
|
1068
|
+
"declaration": {
|
|
1069
|
+
"name": "foundationAccordion",
|
|
1070
|
+
"module": "src/accordion/accordion.ts"
|
|
1071
|
+
}
|
|
1072
|
+
}
|
|
1073
|
+
]
|
|
1074
|
+
},
|
|
1075
|
+
{
|
|
1076
|
+
"kind": "javascript-module",
|
|
1077
|
+
"path": "src/accordion/index.ts",
|
|
1078
|
+
"declarations": [],
|
|
1079
|
+
"exports": [
|
|
1080
|
+
{
|
|
1081
|
+
"kind": "js",
|
|
1082
|
+
"name": "*",
|
|
1083
|
+
"declaration": {
|
|
1084
|
+
"name": "*",
|
|
1085
|
+
"package": "./accordion.template"
|
|
1086
|
+
}
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
"kind": "js",
|
|
1090
|
+
"name": "*",
|
|
1091
|
+
"declaration": {
|
|
1092
|
+
"name": "*",
|
|
1093
|
+
"package": "./accordion.styles"
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
"kind": "js",
|
|
1098
|
+
"name": "*",
|
|
1099
|
+
"declaration": {
|
|
1100
|
+
"name": "*",
|
|
1101
|
+
"package": "./accordion"
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
]
|
|
1105
|
+
},
|
|
924
1106
|
{
|
|
925
1107
|
"kind": "javascript-module",
|
|
926
1108
|
"path": "src/_config/index.ts",
|
|
@@ -1346,188 +1528,6 @@
|
|
|
1346
1528
|
}
|
|
1347
1529
|
]
|
|
1348
1530
|
},
|
|
1349
|
-
{
|
|
1350
|
-
"kind": "javascript-module",
|
|
1351
|
-
"path": "src/accordion/accordion.styles.ts",
|
|
1352
|
-
"declarations": [
|
|
1353
|
-
{
|
|
1354
|
-
"kind": "function",
|
|
1355
|
-
"name": "foundationAccordionStyles",
|
|
1356
|
-
"return": {
|
|
1357
|
-
"type": {
|
|
1358
|
-
"text": "ElementStyles"
|
|
1359
|
-
}
|
|
1360
|
-
},
|
|
1361
|
-
"parameters": [
|
|
1362
|
-
{
|
|
1363
|
-
"name": "context",
|
|
1364
|
-
"type": {
|
|
1365
|
-
"text": "ElementDefinitionContext"
|
|
1366
|
-
}
|
|
1367
|
-
},
|
|
1368
|
-
{
|
|
1369
|
-
"name": "definition",
|
|
1370
|
-
"type": {
|
|
1371
|
-
"text": "FoundationElementDefinition"
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
]
|
|
1375
|
-
}
|
|
1376
|
-
],
|
|
1377
|
-
"exports": [
|
|
1378
|
-
{
|
|
1379
|
-
"kind": "js",
|
|
1380
|
-
"name": "foundationAccordionStyles",
|
|
1381
|
-
"declaration": {
|
|
1382
|
-
"name": "foundationAccordionStyles",
|
|
1383
|
-
"module": "src/accordion/accordion.styles.ts"
|
|
1384
|
-
}
|
|
1385
|
-
}
|
|
1386
|
-
]
|
|
1387
|
-
},
|
|
1388
|
-
{
|
|
1389
|
-
"kind": "javascript-module",
|
|
1390
|
-
"path": "src/accordion/accordion.template.ts",
|
|
1391
|
-
"declarations": [
|
|
1392
|
-
{
|
|
1393
|
-
"kind": "function",
|
|
1394
|
-
"name": "foundationAccordionTemplate",
|
|
1395
|
-
"return": {
|
|
1396
|
-
"type": {
|
|
1397
|
-
"text": "ViewTemplate<Accordion>"
|
|
1398
|
-
}
|
|
1399
|
-
},
|
|
1400
|
-
"parameters": [
|
|
1401
|
-
{
|
|
1402
|
-
"name": "context",
|
|
1403
|
-
"type": {
|
|
1404
|
-
"text": "ElementDefinitionContext"
|
|
1405
|
-
}
|
|
1406
|
-
},
|
|
1407
|
-
{
|
|
1408
|
-
"name": "definition",
|
|
1409
|
-
"type": {
|
|
1410
|
-
"text": "FoundationElementDefinition"
|
|
1411
|
-
}
|
|
1412
|
-
}
|
|
1413
|
-
]
|
|
1414
|
-
}
|
|
1415
|
-
],
|
|
1416
|
-
"exports": [
|
|
1417
|
-
{
|
|
1418
|
-
"kind": "js",
|
|
1419
|
-
"name": "foundationAccordionTemplate",
|
|
1420
|
-
"declaration": {
|
|
1421
|
-
"name": "foundationAccordionTemplate",
|
|
1422
|
-
"module": "src/accordion/accordion.template.ts"
|
|
1423
|
-
}
|
|
1424
|
-
}
|
|
1425
|
-
]
|
|
1426
|
-
},
|
|
1427
|
-
{
|
|
1428
|
-
"kind": "javascript-module",
|
|
1429
|
-
"path": "src/accordion/accordion.ts",
|
|
1430
|
-
"declarations": [
|
|
1431
|
-
{
|
|
1432
|
-
"kind": "class",
|
|
1433
|
-
"description": "",
|
|
1434
|
-
"name": "Accordion",
|
|
1435
|
-
"superclass": {
|
|
1436
|
-
"name": "FASTAccordion",
|
|
1437
|
-
"package": "@microsoft/fast-foundation"
|
|
1438
|
-
},
|
|
1439
|
-
"tagName": "%%prefix%%-accordion",
|
|
1440
|
-
"customElement": true
|
|
1441
|
-
},
|
|
1442
|
-
{
|
|
1443
|
-
"kind": "variable",
|
|
1444
|
-
"name": "foundationAccordionShadowOptions",
|
|
1445
|
-
"type": {
|
|
1446
|
-
"text": "ShadowRootInit"
|
|
1447
|
-
},
|
|
1448
|
-
"default": "{\n delegatesFocus: true,\n mode: 'open',\n}"
|
|
1449
|
-
},
|
|
1450
|
-
{
|
|
1451
|
-
"kind": "variable",
|
|
1452
|
-
"name": "defaultAccordionConfig",
|
|
1453
|
-
"type": {
|
|
1454
|
-
"text": "object"
|
|
1455
|
-
},
|
|
1456
|
-
"default": "{}"
|
|
1457
|
-
},
|
|
1458
|
-
{
|
|
1459
|
-
"kind": "variable",
|
|
1460
|
-
"name": "foundationAccordion",
|
|
1461
|
-
"description": "The Foundation Accordion",
|
|
1462
|
-
"privacy": "public"
|
|
1463
|
-
}
|
|
1464
|
-
],
|
|
1465
|
-
"exports": [
|
|
1466
|
-
{
|
|
1467
|
-
"kind": "js",
|
|
1468
|
-
"name": "Accordion",
|
|
1469
|
-
"declaration": {
|
|
1470
|
-
"name": "Accordion",
|
|
1471
|
-
"module": "src/accordion/accordion.ts"
|
|
1472
|
-
}
|
|
1473
|
-
},
|
|
1474
|
-
{
|
|
1475
|
-
"kind": "js",
|
|
1476
|
-
"name": "foundationAccordionShadowOptions",
|
|
1477
|
-
"declaration": {
|
|
1478
|
-
"name": "foundationAccordionShadowOptions",
|
|
1479
|
-
"module": "src/accordion/accordion.ts"
|
|
1480
|
-
}
|
|
1481
|
-
},
|
|
1482
|
-
{
|
|
1483
|
-
"kind": "js",
|
|
1484
|
-
"name": "defaultAccordionConfig",
|
|
1485
|
-
"declaration": {
|
|
1486
|
-
"name": "defaultAccordionConfig",
|
|
1487
|
-
"module": "src/accordion/accordion.ts"
|
|
1488
|
-
}
|
|
1489
|
-
},
|
|
1490
|
-
{
|
|
1491
|
-
"kind": "js",
|
|
1492
|
-
"name": "foundationAccordion",
|
|
1493
|
-
"declaration": {
|
|
1494
|
-
"name": "foundationAccordion",
|
|
1495
|
-
"module": "src/accordion/accordion.ts"
|
|
1496
|
-
}
|
|
1497
|
-
}
|
|
1498
|
-
]
|
|
1499
|
-
},
|
|
1500
|
-
{
|
|
1501
|
-
"kind": "javascript-module",
|
|
1502
|
-
"path": "src/accordion/index.ts",
|
|
1503
|
-
"declarations": [],
|
|
1504
|
-
"exports": [
|
|
1505
|
-
{
|
|
1506
|
-
"kind": "js",
|
|
1507
|
-
"name": "*",
|
|
1508
|
-
"declaration": {
|
|
1509
|
-
"name": "*",
|
|
1510
|
-
"package": "./accordion.template"
|
|
1511
|
-
}
|
|
1512
|
-
},
|
|
1513
|
-
{
|
|
1514
|
-
"kind": "js",
|
|
1515
|
-
"name": "*",
|
|
1516
|
-
"declaration": {
|
|
1517
|
-
"name": "*",
|
|
1518
|
-
"package": "./accordion.styles"
|
|
1519
|
-
}
|
|
1520
|
-
},
|
|
1521
|
-
{
|
|
1522
|
-
"kind": "js",
|
|
1523
|
-
"name": "*",
|
|
1524
|
-
"declaration": {
|
|
1525
|
-
"name": "*",
|
|
1526
|
-
"package": "./accordion"
|
|
1527
|
-
}
|
|
1528
|
-
}
|
|
1529
|
-
]
|
|
1530
|
-
},
|
|
1531
1531
|
{
|
|
1532
1532
|
"kind": "javascript-module",
|
|
1533
1533
|
"path": "src/actions-menu/actions-menu.styles.ts",
|
|
@@ -35937,12 +35937,23 @@
|
|
|
35937
35937
|
{
|
|
35938
35938
|
"kind": "method",
|
|
35939
35939
|
"name": "openChanged",
|
|
35940
|
+
"return": {
|
|
35941
|
+
"type": {
|
|
35942
|
+
"text": "void"
|
|
35943
|
+
}
|
|
35944
|
+
},
|
|
35940
35945
|
"parameters": [
|
|
35941
35946
|
{
|
|
35942
|
-
"name": "prev"
|
|
35947
|
+
"name": "prev",
|
|
35948
|
+
"type": {
|
|
35949
|
+
"text": "boolean | undefined"
|
|
35950
|
+
}
|
|
35943
35951
|
},
|
|
35944
35952
|
{
|
|
35945
|
-
"name": "next"
|
|
35953
|
+
"name": "next",
|
|
35954
|
+
"type": {
|
|
35955
|
+
"text": "boolean"
|
|
35956
|
+
}
|
|
35946
35957
|
}
|
|
35947
35958
|
]
|
|
35948
35959
|
},
|
|
@@ -47193,6 +47204,23 @@
|
|
|
47193
47204
|
}
|
|
47194
47205
|
}
|
|
47195
47206
|
]
|
|
47207
|
+
},
|
|
47208
|
+
{
|
|
47209
|
+
"kind": "function",
|
|
47210
|
+
"name": "getRootActiveElement",
|
|
47211
|
+
"return": {
|
|
47212
|
+
"type": {
|
|
47213
|
+
"text": "Element | null"
|
|
47214
|
+
}
|
|
47215
|
+
},
|
|
47216
|
+
"parameters": [
|
|
47217
|
+
{
|
|
47218
|
+
"name": "element",
|
|
47219
|
+
"type": {
|
|
47220
|
+
"text": "Element"
|
|
47221
|
+
}
|
|
47222
|
+
}
|
|
47223
|
+
]
|
|
47196
47224
|
}
|
|
47197
47225
|
],
|
|
47198
47226
|
"exports": [
|
|
@@ -47219,6 +47247,14 @@
|
|
|
47219
47247
|
"name": "getPrefix",
|
|
47220
47248
|
"module": "src/utils/dom.ts"
|
|
47221
47249
|
}
|
|
47250
|
+
},
|
|
47251
|
+
{
|
|
47252
|
+
"kind": "js",
|
|
47253
|
+
"name": "getRootActiveElement",
|
|
47254
|
+
"declaration": {
|
|
47255
|
+
"name": "getRootActiveElement",
|
|
47256
|
+
"module": "src/utils/dom.ts"
|
|
47257
|
+
}
|
|
47222
47258
|
}
|
|
47223
47259
|
]
|
|
47224
47260
|
},
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { Select as FASTSelect } from '@microsoft/fast-components';
|
|
2
|
-
import type { SelectOptions } from '@microsoft/fast-foundation';
|
|
2
|
+
import type { ListboxOption, SelectOptions } from '@microsoft/fast-foundation';
|
|
3
3
|
/**
|
|
4
4
|
* @tagname %%prefix%%-select
|
|
5
5
|
*/
|
|
6
6
|
export declare class Select extends FASTSelect {
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Ensures that the provided option is focused and scrolled into view.
|
|
9
|
+
*
|
|
10
|
+
* @param optionToFocus - The option to focus
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
|
+
protected focusAndScrollOptionIntoView(optionToFocus?: ListboxOption | null): void;
|
|
14
|
+
openChanged(prev: boolean | undefined, next: boolean): void;
|
|
8
15
|
keydownHandler(e: KeyboardEvent): boolean | void;
|
|
9
16
|
}
|
|
10
17
|
export declare const foundationSelectShadowOptions: ShadowRootInit;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/select/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../src/select/select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAK/E;;GAEG;AACH,qBAAa,MAAO,SAAQ,UAAU;IACpC;;;;;OAKG;IACH,SAAS,CAAC,4BAA4B,CACpC,aAAa,GAAE,aAAa,GAAG,IAA+B,GAC7D,IAAI;IAcE,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI;IAuB3D,cAAc,CAAC,CAAC,EAAE,aAAa,GAAG,OAAO,GAAG,IAAI;CAoB1D;AAGD,eAAO,MAAM,6BAA6B,EAAE,cAA0B,CAAC;AAEvE,eAAO,MAAM,mBAAmB;;CAa/B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,0SAM3B,CAAC"}
|
package/dist/dts/utils/dom.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const wasClickOutsideElement: (event: MouseEvent, target: EventTarget) => boolean;
|
|
2
2
|
export declare const wasClickInsideElement: (event: MouseEvent, target: EventTarget) => boolean;
|
|
3
3
|
export declare const getPrefix: (element: any) => any;
|
|
4
|
+
export declare function getRootActiveElement(element: Element): Element | null;
|
|
4
5
|
//# sourceMappingURL=dom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/utils/dom.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,UAAW,UAAU,UAAU,WAAW,YACrC,CAAC;AAEzC,eAAO,MAAM,qBAAqB,UAAW,UAAU,UAAU,WAAW,YACrC,CAAC;AAExC,eAAO,MAAM,SAAS,YAAa,GAAG,QAAgD,CAAC"}
|
|
1
|
+
{"version":3,"file":"dom.d.ts","sourceRoot":"","sources":["../../../src/utils/dom.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,UAAW,UAAU,UAAU,WAAW,YACrC,CAAC;AAEzC,eAAO,MAAM,qBAAqB,UAAW,UAAU,UAAU,WAAW,YACrC,CAAC;AAExC,eAAO,MAAM,SAAS,YAAa,GAAG,QAAgD,CAAC;AAEvF,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAQrE"}
|
|
@@ -1,16 +1,47 @@
|
|
|
1
1
|
import { Select as FASTSelect } from '@microsoft/fast-components';
|
|
2
|
+
import { DOM } from '@microsoft/fast-element';
|
|
3
|
+
import { getRootActiveElement } from '../utils';
|
|
2
4
|
import { foundationSelectStyles as styles } from './select.styles';
|
|
3
5
|
import { foundationSelectTemplate as template } from './select.template';
|
|
4
6
|
/**
|
|
5
7
|
* @tagname %%prefix%%-select
|
|
6
8
|
*/
|
|
7
9
|
export class Select extends FASTSelect {
|
|
10
|
+
/**
|
|
11
|
+
* Ensures that the provided option is focused and scrolled into view.
|
|
12
|
+
*
|
|
13
|
+
* @param optionToFocus - The option to focus
|
|
14
|
+
* @internal
|
|
15
|
+
*/
|
|
16
|
+
focusAndScrollOptionIntoView(optionToFocus = this.firstSelectedOption) {
|
|
17
|
+
// To ensure that the browser handles both `focus()` and `scrollIntoView()`, the
|
|
18
|
+
// timing here needs to guarantee that they happen on different frames. Since this
|
|
19
|
+
// function is typically called from the `openChanged` observer, `DOM.queueUpdate`
|
|
20
|
+
// causes the calls to be grouped into the same frame. To prevent this,
|
|
21
|
+
// `requestAnimationFrame` is used instead of `DOM.queueUpdate`.
|
|
22
|
+
if (this.contains(getRootActiveElement(this)) && optionToFocus !== null) {
|
|
23
|
+
optionToFocus.focus();
|
|
24
|
+
requestAnimationFrame(() => {
|
|
25
|
+
optionToFocus.scrollIntoView({ block: 'nearest' });
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}
|
|
8
29
|
openChanged(prev, next) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
30
|
+
if (!this.collapsible) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (this.open) {
|
|
34
|
+
this.ariaControls = this.listboxId;
|
|
35
|
+
this.ariaExpanded = 'true';
|
|
36
|
+
this.setPositioning();
|
|
37
|
+
this.focusAndScrollOptionIntoView();
|
|
38
|
+
this['indexWhenOpened'] = this.selectedIndex;
|
|
39
|
+
// focus is directed to the element when `open` is changed programmatically
|
|
40
|
+
DOM.queueUpdate(() => this.focus());
|
|
41
|
+
return;
|
|
13
42
|
}
|
|
43
|
+
this.ariaControls = '';
|
|
44
|
+
this.ariaExpanded = 'false';
|
|
14
45
|
}
|
|
15
46
|
keydownHandler(e) {
|
|
16
47
|
const key = e.key;
|
package/dist/esm/utils/dom.js
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
export const wasClickOutsideElement = (event, target) => !event.composedPath().includes(target);
|
|
2
2
|
export const wasClickInsideElement = (event, target) => event.composedPath().includes(target);
|
|
3
3
|
export const getPrefix = (element) => element.tagName.toLowerCase().split('-')[0];
|
|
4
|
+
export function getRootActiveElement(element) {
|
|
5
|
+
const rootNode = element.getRootNode();
|
|
6
|
+
if (rootNode instanceof ShadowRoot) {
|
|
7
|
+
return rootNode.activeElement;
|
|
8
|
+
}
|
|
9
|
+
return document.activeElement;
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-ui",
|
|
3
3
|
"description": "Genesis Foundation UI",
|
|
4
|
-
"version": "14.284.
|
|
4
|
+
"version": "14.284.4",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -83,13 +83,13 @@
|
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@genesislcap/foundation-testing": "14.284.
|
|
87
|
-
"@genesislcap/genx": "14.284.
|
|
88
|
-
"@genesislcap/rollup-builder": "14.284.
|
|
89
|
-
"@genesislcap/ts-builder": "14.284.
|
|
90
|
-
"@genesislcap/uvu-playwright-builder": "14.284.
|
|
91
|
-
"@genesislcap/vite-builder": "14.284.
|
|
92
|
-
"@genesislcap/webpack-builder": "14.284.
|
|
86
|
+
"@genesislcap/foundation-testing": "14.284.4",
|
|
87
|
+
"@genesislcap/genx": "14.284.4",
|
|
88
|
+
"@genesislcap/rollup-builder": "14.284.4",
|
|
89
|
+
"@genesislcap/ts-builder": "14.284.4",
|
|
90
|
+
"@genesislcap/uvu-playwright-builder": "14.284.4",
|
|
91
|
+
"@genesislcap/vite-builder": "14.284.4",
|
|
92
|
+
"@genesislcap/webpack-builder": "14.284.4",
|
|
93
93
|
"copyfiles": "^2.4.1",
|
|
94
94
|
"rimraf": "^5.0.0",
|
|
95
95
|
"rxjs": "^7.5.4"
|
|
@@ -100,15 +100,15 @@
|
|
|
100
100
|
"@fortawesome/free-regular-svg-icons": "^6.2.1",
|
|
101
101
|
"@fortawesome/free-solid-svg-icons": "^6.2.1",
|
|
102
102
|
"@genesiscommunitysuccess/analyzer-import-alias-plugin": "^5.0.3",
|
|
103
|
-
"@genesislcap/expression-builder": "14.284.
|
|
104
|
-
"@genesislcap/foundation-comms": "14.284.
|
|
105
|
-
"@genesislcap/foundation-criteria": "14.284.
|
|
106
|
-
"@genesislcap/foundation-errors": "14.284.
|
|
107
|
-
"@genesislcap/foundation-events": "14.284.
|
|
108
|
-
"@genesislcap/foundation-logger": "14.284.
|
|
109
|
-
"@genesislcap/foundation-notifications": "14.284.
|
|
110
|
-
"@genesislcap/foundation-user": "14.284.
|
|
111
|
-
"@genesislcap/foundation-utils": "14.284.
|
|
103
|
+
"@genesislcap/expression-builder": "14.284.4",
|
|
104
|
+
"@genesislcap/foundation-comms": "14.284.4",
|
|
105
|
+
"@genesislcap/foundation-criteria": "14.284.4",
|
|
106
|
+
"@genesislcap/foundation-errors": "14.284.4",
|
|
107
|
+
"@genesislcap/foundation-events": "14.284.4",
|
|
108
|
+
"@genesislcap/foundation-logger": "14.284.4",
|
|
109
|
+
"@genesislcap/foundation-notifications": "14.284.4",
|
|
110
|
+
"@genesislcap/foundation-user": "14.284.4",
|
|
111
|
+
"@genesislcap/foundation-utils": "14.284.4",
|
|
112
112
|
"@microsoft/fast-colors": "5.3.1",
|
|
113
113
|
"@microsoft/fast-components": "2.30.6",
|
|
114
114
|
"@microsoft/fast-element": "1.14.0",
|
|
@@ -130,5 +130,5 @@
|
|
|
130
130
|
"access": "public"
|
|
131
131
|
},
|
|
132
132
|
"customElements": "dist/custom-elements.json",
|
|
133
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "2d0cf06b2b00f5e0e5fd096552cef9d324e832f5"
|
|
134
134
|
}
|