@genesislcap/foundation-ui 14.273.0 → 14.274.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.
@@ -896,6 +896,188 @@
896
896
  }
897
897
  ]
898
898
  },
899
+ {
900
+ "kind": "javascript-module",
901
+ "path": "src/accordion/accordion.styles.ts",
902
+ "declarations": [
903
+ {
904
+ "kind": "function",
905
+ "name": "foundationAccordionStyles",
906
+ "return": {
907
+ "type": {
908
+ "text": "ElementStyles"
909
+ }
910
+ },
911
+ "parameters": [
912
+ {
913
+ "name": "context",
914
+ "type": {
915
+ "text": "ElementDefinitionContext"
916
+ }
917
+ },
918
+ {
919
+ "name": "definition",
920
+ "type": {
921
+ "text": "FoundationElementDefinition"
922
+ }
923
+ }
924
+ ]
925
+ }
926
+ ],
927
+ "exports": [
928
+ {
929
+ "kind": "js",
930
+ "name": "foundationAccordionStyles",
931
+ "declaration": {
932
+ "name": "foundationAccordionStyles",
933
+ "module": "src/accordion/accordion.styles.ts"
934
+ }
935
+ }
936
+ ]
937
+ },
938
+ {
939
+ "kind": "javascript-module",
940
+ "path": "src/accordion/accordion.template.ts",
941
+ "declarations": [
942
+ {
943
+ "kind": "function",
944
+ "name": "foundationAccordionTemplate",
945
+ "return": {
946
+ "type": {
947
+ "text": "ViewTemplate<Accordion>"
948
+ }
949
+ },
950
+ "parameters": [
951
+ {
952
+ "name": "context",
953
+ "type": {
954
+ "text": "ElementDefinitionContext"
955
+ }
956
+ },
957
+ {
958
+ "name": "definition",
959
+ "type": {
960
+ "text": "FoundationElementDefinition"
961
+ }
962
+ }
963
+ ]
964
+ }
965
+ ],
966
+ "exports": [
967
+ {
968
+ "kind": "js",
969
+ "name": "foundationAccordionTemplate",
970
+ "declaration": {
971
+ "name": "foundationAccordionTemplate",
972
+ "module": "src/accordion/accordion.template.ts"
973
+ }
974
+ }
975
+ ]
976
+ },
977
+ {
978
+ "kind": "javascript-module",
979
+ "path": "src/accordion/accordion.ts",
980
+ "declarations": [
981
+ {
982
+ "kind": "class",
983
+ "description": "",
984
+ "name": "Accordion",
985
+ "superclass": {
986
+ "name": "FASTAccordion",
987
+ "package": "@microsoft/fast-foundation"
988
+ },
989
+ "tagName": "%%prefix%%-accordion",
990
+ "customElement": true
991
+ },
992
+ {
993
+ "kind": "variable",
994
+ "name": "foundationAccordionShadowOptions",
995
+ "type": {
996
+ "text": "ShadowRootInit"
997
+ },
998
+ "default": "{\n delegatesFocus: true,\n mode: 'open',\n}"
999
+ },
1000
+ {
1001
+ "kind": "variable",
1002
+ "name": "defaultAccordionConfig",
1003
+ "type": {
1004
+ "text": "object"
1005
+ },
1006
+ "default": "{}"
1007
+ },
1008
+ {
1009
+ "kind": "variable",
1010
+ "name": "foundationAccordion",
1011
+ "description": "The Foundation Accordion",
1012
+ "privacy": "public"
1013
+ }
1014
+ ],
1015
+ "exports": [
1016
+ {
1017
+ "kind": "js",
1018
+ "name": "Accordion",
1019
+ "declaration": {
1020
+ "name": "Accordion",
1021
+ "module": "src/accordion/accordion.ts"
1022
+ }
1023
+ },
1024
+ {
1025
+ "kind": "js",
1026
+ "name": "foundationAccordionShadowOptions",
1027
+ "declaration": {
1028
+ "name": "foundationAccordionShadowOptions",
1029
+ "module": "src/accordion/accordion.ts"
1030
+ }
1031
+ },
1032
+ {
1033
+ "kind": "js",
1034
+ "name": "defaultAccordionConfig",
1035
+ "declaration": {
1036
+ "name": "defaultAccordionConfig",
1037
+ "module": "src/accordion/accordion.ts"
1038
+ }
1039
+ },
1040
+ {
1041
+ "kind": "js",
1042
+ "name": "foundationAccordion",
1043
+ "declaration": {
1044
+ "name": "foundationAccordion",
1045
+ "module": "src/accordion/accordion.ts"
1046
+ }
1047
+ }
1048
+ ]
1049
+ },
1050
+ {
1051
+ "kind": "javascript-module",
1052
+ "path": "src/accordion/index.ts",
1053
+ "declarations": [],
1054
+ "exports": [
1055
+ {
1056
+ "kind": "js",
1057
+ "name": "*",
1058
+ "declaration": {
1059
+ "name": "*",
1060
+ "package": "./accordion.template"
1061
+ }
1062
+ },
1063
+ {
1064
+ "kind": "js",
1065
+ "name": "*",
1066
+ "declaration": {
1067
+ "name": "*",
1068
+ "package": "./accordion.styles"
1069
+ }
1070
+ },
1071
+ {
1072
+ "kind": "js",
1073
+ "name": "*",
1074
+ "declaration": {
1075
+ "name": "*",
1076
+ "package": "./accordion"
1077
+ }
1078
+ }
1079
+ ]
1080
+ },
899
1081
  {
900
1082
  "kind": "javascript-module",
901
1083
  "path": "src/_config/index.ts",
@@ -1321,188 +1503,6 @@
1321
1503
  }
1322
1504
  ]
1323
1505
  },
1324
- {
1325
- "kind": "javascript-module",
1326
- "path": "src/accordion/accordion.styles.ts",
1327
- "declarations": [
1328
- {
1329
- "kind": "function",
1330
- "name": "foundationAccordionStyles",
1331
- "return": {
1332
- "type": {
1333
- "text": "ElementStyles"
1334
- }
1335
- },
1336
- "parameters": [
1337
- {
1338
- "name": "context",
1339
- "type": {
1340
- "text": "ElementDefinitionContext"
1341
- }
1342
- },
1343
- {
1344
- "name": "definition",
1345
- "type": {
1346
- "text": "FoundationElementDefinition"
1347
- }
1348
- }
1349
- ]
1350
- }
1351
- ],
1352
- "exports": [
1353
- {
1354
- "kind": "js",
1355
- "name": "foundationAccordionStyles",
1356
- "declaration": {
1357
- "name": "foundationAccordionStyles",
1358
- "module": "src/accordion/accordion.styles.ts"
1359
- }
1360
- }
1361
- ]
1362
- },
1363
- {
1364
- "kind": "javascript-module",
1365
- "path": "src/accordion/accordion.template.ts",
1366
- "declarations": [
1367
- {
1368
- "kind": "function",
1369
- "name": "foundationAccordionTemplate",
1370
- "return": {
1371
- "type": {
1372
- "text": "ViewTemplate<Accordion>"
1373
- }
1374
- },
1375
- "parameters": [
1376
- {
1377
- "name": "context",
1378
- "type": {
1379
- "text": "ElementDefinitionContext"
1380
- }
1381
- },
1382
- {
1383
- "name": "definition",
1384
- "type": {
1385
- "text": "FoundationElementDefinition"
1386
- }
1387
- }
1388
- ]
1389
- }
1390
- ],
1391
- "exports": [
1392
- {
1393
- "kind": "js",
1394
- "name": "foundationAccordionTemplate",
1395
- "declaration": {
1396
- "name": "foundationAccordionTemplate",
1397
- "module": "src/accordion/accordion.template.ts"
1398
- }
1399
- }
1400
- ]
1401
- },
1402
- {
1403
- "kind": "javascript-module",
1404
- "path": "src/accordion/accordion.ts",
1405
- "declarations": [
1406
- {
1407
- "kind": "class",
1408
- "description": "",
1409
- "name": "Accordion",
1410
- "superclass": {
1411
- "name": "FASTAccordion",
1412
- "package": "@microsoft/fast-foundation"
1413
- },
1414
- "tagName": "%%prefix%%-accordion",
1415
- "customElement": true
1416
- },
1417
- {
1418
- "kind": "variable",
1419
- "name": "foundationAccordionShadowOptions",
1420
- "type": {
1421
- "text": "ShadowRootInit"
1422
- },
1423
- "default": "{\n delegatesFocus: true,\n mode: 'open',\n}"
1424
- },
1425
- {
1426
- "kind": "variable",
1427
- "name": "defaultAccordionConfig",
1428
- "type": {
1429
- "text": "object"
1430
- },
1431
- "default": "{}"
1432
- },
1433
- {
1434
- "kind": "variable",
1435
- "name": "foundationAccordion",
1436
- "description": "The Foundation Accordion",
1437
- "privacy": "public"
1438
- }
1439
- ],
1440
- "exports": [
1441
- {
1442
- "kind": "js",
1443
- "name": "Accordion",
1444
- "declaration": {
1445
- "name": "Accordion",
1446
- "module": "src/accordion/accordion.ts"
1447
- }
1448
- },
1449
- {
1450
- "kind": "js",
1451
- "name": "foundationAccordionShadowOptions",
1452
- "declaration": {
1453
- "name": "foundationAccordionShadowOptions",
1454
- "module": "src/accordion/accordion.ts"
1455
- }
1456
- },
1457
- {
1458
- "kind": "js",
1459
- "name": "defaultAccordionConfig",
1460
- "declaration": {
1461
- "name": "defaultAccordionConfig",
1462
- "module": "src/accordion/accordion.ts"
1463
- }
1464
- },
1465
- {
1466
- "kind": "js",
1467
- "name": "foundationAccordion",
1468
- "declaration": {
1469
- "name": "foundationAccordion",
1470
- "module": "src/accordion/accordion.ts"
1471
- }
1472
- }
1473
- ]
1474
- },
1475
- {
1476
- "kind": "javascript-module",
1477
- "path": "src/accordion/index.ts",
1478
- "declarations": [],
1479
- "exports": [
1480
- {
1481
- "kind": "js",
1482
- "name": "*",
1483
- "declaration": {
1484
- "name": "*",
1485
- "package": "./accordion.template"
1486
- }
1487
- },
1488
- {
1489
- "kind": "js",
1490
- "name": "*",
1491
- "declaration": {
1492
- "name": "*",
1493
- "package": "./accordion.styles"
1494
- }
1495
- },
1496
- {
1497
- "kind": "js",
1498
- "name": "*",
1499
- "declaration": {
1500
- "name": "*",
1501
- "package": "./accordion"
1502
- }
1503
- }
1504
- ]
1505
- },
1506
1506
  {
1507
1507
  "kind": "javascript-module",
1508
1508
  "path": "src/actions-menu/actions-menu.styles.ts",
@@ -25795,7 +25795,7 @@
25795
25795
  {
25796
25796
  "kind": "variable",
25797
25797
  "name": "multiselectStyles",
25798
- "default": "css`\n :host {\n --scrollbar-width: 12px;\n --scrollbar-thumb-width: 8px;\n }\n\n .root {\n position: relative;\n width: inherit;\n min-width: 250px;\n }\n\n .control {\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n border-radius: calc(var(--control-corner-radius) * 1px);\n }\n\n #display-field {\n width: 100%;\n cursor: pointer;\n color: rgb(241 241 241);\n min-height: 40px;\n padding: 0 calc(var(--design-unit) * 2.25px);\n border-width: 0;\n background-color: var(--neutral-fill-input-rest);\n border-radius: calc(var(--control-corner-radius) * 1px);\n }\n\n #display-field[disabled] {\n cursor: not-allowed;\n opacity: 30%;\n }\n\n #display-field:focus {\n outline: 1px solid var(--accent-fill-rest);\n background: var(--neutral-fill-input-rest);\n border-style: none;\n box-shadow: none;\n }\n\n #display-field:hover:not(:focus):not([disabled]) {\n outline: 1px solid rgb(231 232 232);\n }\n\n button {\n pointer-events: none;\n }\n\n .indicator {\n position: absolute;\n left: calc(100% - 26px);\n padding: 0;\n cursor: pointer;\n }\n\n #arrow-icon {\n width: 16px;\n fill: white;\n transform: rotate(0deg);\n transition: transform 0.2s linear 0s;\n }\n\n #arrow-icon.flipped {\n transform: rotate(180deg);\n }\n\n .disabled-svg {\n pointer-events: none;\n opacity: 30%;\n }\n\n .options {\n display: flex;\n flex-direction: column;\n position: absolute;\n height: max-content;\n overflow-y: hidden;\n margin-top: calc(var(--design-unit) * 1px);\n border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-2);\n border-radius: 4px;\n background: var(--neutral-fill-input-rest);\n width: 100%;\n max-height: 0;\n visibility: hidden;\n transition:\n max-height 0.4s ease 0s,\n visibility 0.4s ease 0s;\n z-index: 999;\n }\n\n .position-above {\n bottom: 100%;\n }\n\n ::-webkit-scrollbar {\n width: var(--scrollbar-width);\n }\n\n ::-webkit-scrollbar-track {\n background: var(--neutral-layer-4);\n }\n\n ::-webkit-scrollbar-thumb {\n width: var(--scrollbar-thumb-width);\n border-radius: 10px;\n box-shadow: inset 0 0 6px rgba(0 0 0 / 30%);\n background-color: var(--neutral-layer-2);\n border: 3px solid var(--neutral-layer-4);\n }\n\n ::-webkit-scrollbar-corner {\n background: var(--neutral-layer-4);\n }\n\n .checkbox-container {\n display: flex;\n flex-direction: column;\n overflow-y: scroll;\n list-style: none;\n }\n\n .checkbox-container zero-checkbox {\n min-width: fit-content;\n }\n\n .checkbox-container zero-checkbox[disabled],\n .checkbox-container foundation-checkbox[disabled] {\n cursor: not-allowed;\n }\n\n .visible {\n visibility: visible;\n max-height: ${maxheight.toString()}px;\n }\n\n ::slotted(foundation-checkbox),\n foundation-checkbox {\n border-bottom: 1px solid var(--neutral-layer-4);\n padding: 5px 0 5px 5px;\n margin: 0;\n }\n\n ::slotted(foundation-checkbox:hover),\n foundation-checkbox:hover {\n background-color: var(--neutral-layer-3);\n cursor: pointer;\n }\n\n ::slotted(foundation-checkbox)::part(label),\n foundation-checkbox::part(label) {\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .label {\n display: block;\n cursor: pointer;\n font-size: var(--type-ramp-base-font-size);\n line-height: var(--type-ramp-base-line-height);\n font-style: normal;\n margin: calc(var(--design-unit) * 2px) 0;\n }\n\n .label-hidden {\n display: none;\n }\n\n ol,\n li {\n margin: 0;\n padding: 0;\n }\n\n .checkbox {\n width: 100%;\n }\n\n .select-all {\n width: 100%;\n }\n\n .display-value {\n position: absolute;\n right: 40px;\n color: var(--neutral-foreground-rest);\n font-size: var(--type-ramp-base-font-size);\n line-height: var(--type-ramp-base-line-height);\n font-family: var(--body-font);\n }\n`"
25798
+ "default": "css`\n :host {\n --scrollbar-width: 12px;\n --scrollbar-thumb-width: 8px;\n }\n\n .root {\n position: relative;\n width: inherit;\n min-width: 250px;\n }\n\n .control {\n cursor: pointer;\n position: relative;\n display: flex;\n align-items: center;\n width: 100%;\n border-radius: calc(var(--control-corner-radius) * 1px);\n }\n\n #display-field {\n width: 100%;\n cursor: pointer;\n color: rgb(241 241 241);\n min-height: 40px;\n padding: 0 calc(var(--design-unit) * 2.25px);\n border-width: 0;\n background-color: var(--neutral-fill-input-rest);\n border-radius: calc(var(--control-corner-radius) * 1px);\n }\n\n #display-field[disabled] {\n cursor: not-allowed;\n opacity: 30%;\n }\n\n #display-field:focus {\n outline: 1px solid var(--accent-fill-rest);\n background: var(--neutral-fill-input-rest);\n border-style: none;\n box-shadow: none;\n }\n\n #display-field:hover:not(:focus):not([disabled]) {\n outline: 1px solid rgb(231 232 232);\n }\n\n button {\n pointer-events: none;\n }\n\n .indicator {\n position: absolute;\n left: calc(100% - 26px);\n padding: 0;\n cursor: pointer;\n }\n\n #arrow-icon {\n width: 16px;\n fill: white;\n transform: rotate(0deg);\n transition: transform 0.2s linear 0s;\n }\n\n #arrow-icon.flipped {\n transform: rotate(180deg);\n }\n\n .disabled-svg {\n pointer-events: none;\n opacity: 30%;\n }\n\n .position-above {\n bottom: 100%;\n }\n\n ::-webkit-scrollbar {\n width: var(--scrollbar-width);\n }\n\n ::-webkit-scrollbar-track {\n background: var(--neutral-layer-4);\n }\n\n ::-webkit-scrollbar-thumb {\n width: var(--scrollbar-thumb-width);\n border-radius: 10px;\n box-shadow: inset 0 0 6px rgba(0 0 0 / 30%);\n background-color: var(--neutral-layer-2);\n border: 3px solid var(--neutral-layer-4);\n }\n\n ::-webkit-scrollbar-corner {\n background: var(--neutral-layer-4);\n }\n\n .multiselect-dropdown {\n display: flex;\n flex-direction: column;\n position: absolute;\n height: max-content;\n overflow-y: scroll;\n margin-top: calc(var(--design-unit) * 1px);\n border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-2);\n border-radius: 4px;\n background: var(--neutral-fill-input-rest);\n width: 100%;\n max-height: 0;\n visibility: hidden;\n transition:\n max-height 0.4s ease 0s,\n visibility 0.4s ease 0s;\n z-index: 999;\n }\n\n .checkbox-container {\n display: flex;\n flex-direction: column;\n list-style: none;\n }\n\n .checkbox-container zero-checkbox {\n min-width: fit-content;\n }\n\n .checkbox-container zero-checkbox[disabled],\n .checkbox-container foundation-checkbox[disabled] {\n cursor: not-allowed;\n }\n\n .visible {\n visibility: visible;\n max-height: ${maxheight.toString()}px;\n }\n\n ::slotted(foundation-checkbox),\n foundation-checkbox {\n border-bottom: 1px solid var(--neutral-layer-4);\n padding: 5px 0 5px 5px;\n margin: 0;\n }\n\n ::slotted(foundation-checkbox:hover),\n foundation-checkbox:hover {\n background-color: var(--neutral-layer-3);\n cursor: pointer;\n }\n\n ::slotted(foundation-checkbox)::part(label),\n foundation-checkbox::part(label) {\n overflow-x: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .label {\n display: block;\n cursor: pointer;\n font-size: var(--type-ramp-base-font-size);\n line-height: var(--type-ramp-base-line-height);\n font-style: normal;\n margin: calc(var(--design-unit) * 2px) 0;\n }\n\n .label-hidden {\n display: none;\n }\n\n ol,\n li {\n margin: 0;\n padding: 0;\n }\n\n .checkbox {\n width: 100%;\n }\n\n .select-all {\n width: 100%;\n margin-left: 0;\n margin-right: 0;\n }\n\n .display-value {\n position: absolute;\n right: 40px;\n color: var(--neutral-foreground-rest);\n font-size: var(--type-ramp-base-font-size);\n line-height: var(--type-ramp-base-line-height);\n font-family: var(--body-font);\n }\n\n .options-header-item-hidden {\n display: none;\n }\n`"
25799
25799
  }
25800
25800
  ],
25801
25801
  "exports": [
@@ -25953,6 +25953,22 @@
25953
25953
  },
25954
25954
  "default": "500"
25955
25955
  },
25956
+ {
25957
+ "kind": "field",
25958
+ "name": "delimiterValues",
25959
+ "type": {
25960
+ "text": "string"
25961
+ },
25962
+ "default": "';'"
25963
+ },
25964
+ {
25965
+ "kind": "field",
25966
+ "name": "delimiterLabels",
25967
+ "type": {
25968
+ "text": "string"
25969
+ },
25970
+ "default": "','"
25971
+ },
25956
25972
  {
25957
25973
  "kind": "field",
25958
25974
  "name": "filterByContains",
@@ -26091,6 +26107,13 @@
26091
26107
  "text": "(allSelected: boolean) => void"
26092
26108
  }
26093
26109
  },
26110
+ {
26111
+ "kind": "field",
26112
+ "name": "itemRenderer",
26113
+ "type": {
26114
+ "text": "(\n option: MultiselectOption,\n parent: Multiselect,\n prefix: string,\n ) => ViewTemplate"
26115
+ }
26116
+ },
26094
26117
  {
26095
26118
  "kind": "field",
26096
26119
  "name": "initialisedOptions",
@@ -26109,11 +26132,34 @@
26109
26132
  },
26110
26133
  {
26111
26134
  "kind": "field",
26112
- "name": "optionsElement",
26135
+ "name": "multiselectDropdown",
26113
26136
  "type": {
26114
26137
  "text": "HTMLElement"
26115
26138
  }
26116
26139
  },
26140
+ {
26141
+ "kind": "method",
26142
+ "name": "defaultItemRenderer",
26143
+ "return": {
26144
+ "type": {
26145
+ "text": "ViewTemplate"
26146
+ }
26147
+ },
26148
+ "parameters": [
26149
+ {
26150
+ "name": "option",
26151
+ "type": {
26152
+ "text": "MultiselectOption"
26153
+ }
26154
+ },
26155
+ {
26156
+ "name": "parent",
26157
+ "type": {
26158
+ "text": "Multiselect"
26159
+ }
26160
+ }
26161
+ ]
26162
+ },
26117
26163
  {
26118
26164
  "kind": "method",
26119
26165
  "name": "toggle"
@@ -26134,7 +26180,19 @@
26134
26180
  },
26135
26181
  {
26136
26182
  "kind": "method",
26137
- "name": "optionGetter",
26183
+ "name": "optionValueGetter",
26184
+ "parameters": [
26185
+ {
26186
+ "name": "option",
26187
+ "type": {
26188
+ "text": "MultiselectOption"
26189
+ }
26190
+ }
26191
+ ]
26192
+ },
26193
+ {
26194
+ "kind": "method",
26195
+ "name": "optionLabelGetter",
26138
26196
  "parameters": [
26139
26197
  {
26140
26198
  "name": "option",
@@ -26305,6 +26363,13 @@
26305
26363
  }
26306
26364
  ]
26307
26365
  },
26366
+ {
26367
+ "kind": "field",
26368
+ "name": "optionsHeaderSlottedNodes",
26369
+ "type": {
26370
+ "text": "Node[]"
26371
+ }
26372
+ },
26308
26373
  {
26309
26374
  "kind": "field",
26310
26375
  "name": "_presentation",
@@ -26487,6 +26552,22 @@
26487
26552
  },
26488
26553
  "fieldName": "debounce"
26489
26554
  },
26555
+ {
26556
+ "name": "delimiterValues",
26557
+ "type": {
26558
+ "text": "string"
26559
+ },
26560
+ "default": "';'",
26561
+ "fieldName": "delimiterValues"
26562
+ },
26563
+ {
26564
+ "name": "delimiterLabels",
26565
+ "type": {
26566
+ "text": "string"
26567
+ },
26568
+ "default": "','",
26569
+ "fieldName": "delimiterLabels"
26570
+ },
26490
26571
  {
26491
26572
  "name": "filter-by-contains",
26492
26573
  "type": {
@@ -3,8 +3,8 @@ export declare enum Position {
3
3
  ABOVE = "above"
4
4
  }
5
5
  export type MultiselectOption = {
6
- value: string;
7
- label: string;
6
+ value: string | string[];
7
+ label: string | string[];
8
8
  disabled?: boolean;
9
9
  labelStyle?: string;
10
10
  optionLabelText?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"multiselect-consts.d.ts","sourceRoot":"","sources":["../../../src/multiselect/multiselect-consts.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,iBAAiB,GACzB;IACE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GACD,MAAM,CAAC"}
1
+ {"version":3,"file":"multiselect-consts.d.ts","sourceRoot":"","sources":["../../../src/multiselect/multiselect-consts.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,iBAAiB,GACzB;IACE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GACD,MAAM,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { ViewTemplate } from '@microsoft/fast-element';
1
2
  import { FoundationElement } from '@microsoft/fast-foundation';
2
3
  import { MultiselectDatasource } from '../options-datasource';
3
4
  import { MultiselectOption, Position } from './multiselect-consts';
@@ -16,6 +17,8 @@ export declare class Multiselect extends FoundationElement {
16
17
  creatable: boolean;
17
18
  async: boolean;
18
19
  debounce: number;
20
+ delimiterValues: string;
21
+ delimiterLabels: string;
19
22
  /** Tells if the filter uses a contains; if FALSE, will filter using a starts-with check */
20
23
  filterByContains: boolean;
21
24
  debounceChanged(oldValue: any, newValue: number): void;
@@ -39,11 +42,13 @@ export declare class Multiselect extends FoundationElement {
39
42
  */
40
43
  position: Position;
41
44
  onAllSelectedCallback: (allSelected: boolean) => void;
45
+ itemRenderer: (option: MultiselectOption, parent: Multiselect, prefix: string) => ViewTemplate;
42
46
  private initialisedOptions;
43
47
  arrowIcon: SVGElement;
44
- optionsElement: HTMLElement;
48
+ multiselectDropdown: HTMLElement;
45
49
  connectedCallback(): void;
46
50
  disconnectedCallback(): void;
51
+ defaultItemRenderer(option: MultiselectOption, parent: Multiselect): ViewTemplate;
47
52
  toggle(): void;
48
53
  optionsChanged(): void;
49
54
  selectedOptionsChanged(): void;
@@ -56,7 +61,8 @@ export declare class Multiselect extends FoundationElement {
56
61
  * @private
57
62
  */
58
63
  private setDropdownPosition;
59
- optionGetter(option: MultiselectOption): string;
64
+ optionValueGetter(option: MultiselectOption): string;
65
+ optionLabelGetter(option: MultiselectOption): string;
60
66
  getItemLabel(option: MultiselectOption): any;
61
67
  isOptionDisabled(option: MultiselectOption): boolean;
62
68
  get getDisplayValue(): string;
@@ -76,15 +82,16 @@ export declare class Multiselect extends FoundationElement {
76
82
  changeHandler(event: Event): void;
77
83
  private handleClickOutside;
78
84
  keydownHandler(e: Event & KeyboardEvent): boolean | void;
85
+ optionsHeaderSlottedNodes: Node[];
79
86
  }
80
87
  export declare const foundationMultiselect: (overrideDefinition?: import("@microsoft/fast-foundation").OverrideFoundationElementDefinition<{
81
88
  baseName: string;
82
- template: import("@microsoft/fast-element").ViewTemplate<Multiselect, any>;
89
+ template: ViewTemplate<Multiselect, any>;
83
90
  styles: import("@microsoft/fast-element").ElementStyles;
84
91
  shadowOptions: ShadowRootInit;
85
92
  }>) => import("@microsoft/fast-foundation").FoundationElementRegistry<{
86
93
  baseName: string;
87
- template: import("@microsoft/fast-element").ViewTemplate<Multiselect, any>;
94
+ template: ViewTemplate<Multiselect, any>;
88
95
  styles: import("@microsoft/fast-element").ElementStyles;
89
96
  shadowOptions: ShadowRootInit;
90
97
  }, typeof Multiselect>;
@@ -1 +1 @@
1
- {"version":3,"file":"multiselect.d.ts","sourceRoot":"","sources":["../../../src/multiselect/multiselect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAO9D,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,sBAAs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AE,iBAAiB;IAY3C,YAAY,CAAC,MAAM,EAAE,iBAAiB;IAetC,gBAAgB,CAAC,MAAM,EAAE,iBAAiB;IAQ1C,IACI,eAAe,WAyBlB;IAED,IACI,cAAc,WAEjB;IAED,IACI,oBAAoB,YAEvB;IAED,IACI,aAAa,YAMhB;IAED,gBAAgB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,OAAO;IAK9D,iBAAiB,CAAC,gBAAgB,EAAE,iBAAiB;IAYrD,eAAe,CAAC,gBAAgB,EAAE,iBAAiB,EAAE,KAAK,EAAE,aAAa;IAQzE,sBAAsB;IAItB,iBAAiB;IAajB,YAAY;IAcZ,qBAAqB;IAWrB,SAAS;IAwBT,SAAS;IAST,cAAc;IAkBd,aAAa,CAAC,KAAK,EAAE,KAAK;IAK1B,OAAO,CAAC,kBAAkB;IAM1B,cAAc,CAAC,CAAC,EAAE,KAAK,GAAG,aAAa,GAAG,OAAO,GAAG,IAAI;IAiC5C,yBAAyB,EAAE,IAAI,EAAE,CAAC;CAC/C;AAED,eAAO,MAAM,qBAAqB;;;;;;;;;;sBAMhC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"multiselect.styles.d.ts","sourceRoot":"","sources":["../../../src/multiselect/multiselect.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,MAAM,CAAC;AAE7B,eAAO,MAAM,iBAAiB,iDAkM7B,CAAC"}
1
+ {"version":3,"file":"multiselect.styles.d.ts","sourceRoot":"","sources":["../../../src/multiselect/multiselect.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,MAAM,CAAC;AAE7B,eAAO,MAAM,iBAAiB,iDAuM7B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"multiselect.template.d.ts","sourceRoot":"","sources":["../../../src/multiselect/multiselect.template.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAMjD,eAAO,MAAM,sBAAsB,uFAwHlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,kEAE/B,CAAC"}
1
+ {"version":3,"file":"multiselect.template.d.ts","sourceRoot":"","sources":["../../../src/multiselect/multiselect.template.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAMjD,eAAO,MAAM,sBAAsB,uFA4HlC,CAAC;AAEF,eAAO,MAAM,mBAAmB,kEAE/B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { __decorate } from "tslib";
2
2
  import { ResourceType } from '@genesislcap/foundation-comms';
3
- import { attr, observable, volatile } from '@microsoft/fast-element';
3
+ import { attr, html, observable, volatile } from '@microsoft/fast-element';
4
4
  import { FoundationElement } from '@microsoft/fast-foundation';
5
5
  import debounce from 'lodash.debounce';
6
6
  import { dataserverCriteriaBuilder, logger, requestServerCriteriaBuilder, wasClickOutsideElement, } from '../utils';
@@ -25,6 +25,8 @@ export class Multiselect extends FoundationElement {
25
25
  this.creatable = false;
26
26
  this.async = false;
27
27
  this.debounce = DEBOUNCE_TIME;
28
+ this.delimiterValues = ';';
29
+ this.delimiterLabels = ',';
28
30
  /** Tells if the filter uses a contains; if FALSE, will filter using a starts-with check */
29
31
  this.filterByContains = false;
30
32
  this.filterSearchValue = '';
@@ -39,6 +41,7 @@ export class Multiselect extends FoundationElement {
39
41
  * - Position.BELOW: Forces the dropdown to always open below the input field.
40
42
  */
41
43
  this.position = Position.BELOW;
44
+ this.itemRenderer = this.defaultItemRenderer;
42
45
  this.initialisedOptions = false;
43
46
  }
44
47
  debounceChanged(oldValue, newValue) {
@@ -49,25 +52,42 @@ export class Multiselect extends FoundationElement {
49
52
  if (open) {
50
53
  document.addEventListener('mousedown', this.clickOutside);
51
54
  (_a = this.arrowIcon) === null || _a === void 0 ? void 0 : _a.classList.add('flipped');
52
- (_b = this.optionsElement) === null || _b === void 0 ? void 0 : _b.classList.add('visible');
55
+ (_b = this.multiselectDropdown) === null || _b === void 0 ? void 0 : _b.classList.add('visible');
53
56
  }
54
57
  else {
55
58
  document.removeEventListener('mousedown', this.clickOutside);
56
59
  (_c = this.arrowIcon) === null || _c === void 0 ? void 0 : _c.classList.remove('flipped');
57
- (_d = this.optionsElement) === null || _d === void 0 ? void 0 : _d.classList.remove('visible');
60
+ (_d = this.multiselectDropdown) === null || _d === void 0 ? void 0 : _d.classList.remove('visible');
58
61
  }
59
62
  }
60
63
  connectedCallback() {
61
64
  var _a;
62
65
  super.connectedCallback();
63
66
  if (this.position === Position.ABOVE) {
64
- (_a = this.optionsElement) === null || _a === void 0 ? void 0 : _a.classList.add('position-above');
67
+ (_a = this.multiselectDropdown) === null || _a === void 0 ? void 0 : _a.classList.add('position-above');
65
68
  }
66
69
  }
67
70
  disconnectedCallback() {
68
71
  super.disconnectedCallback();
69
72
  document.removeEventListener('mousedown', this.clickOutside);
70
73
  }
74
+ defaultItemRenderer(option, parent) {
75
+ return html `
76
+ ${typeof option === 'string'
77
+ ? html `
78
+ <span part="option-label">${() => parent.getItemLabel(option)}</span>
79
+ `
80
+ : html `
81
+ <span
82
+ data-option-label-text=${() => option.optionLabelText}
83
+ style=${() => option.labelStyle}
84
+ part="option-label"
85
+ >
86
+ ${() => parent.getItemLabel(option)}
87
+ </span>
88
+ `}
89
+ `;
90
+ }
71
91
  toggle() {
72
92
  if (!this.open) {
73
93
  this.setDropdownPosition();
@@ -76,7 +96,7 @@ export class Multiselect extends FoundationElement {
76
96
  }
77
97
  optionsChanged() {
78
98
  if (this.allSelected && !this.initialisedOptions) {
79
- this.selectedOptions = this.options.map((option) => this.optionGetter(option));
99
+ this.selectedOptions = this.options.map((option) => this.optionValueGetter(option));
80
100
  }
81
101
  this.filteredAvailableOptions = [...this.options];
82
102
  }
@@ -108,14 +128,26 @@ export class Multiselect extends FoundationElement {
108
128
  calculatedPosition = Position.BELOW;
109
129
  }
110
130
  }
111
- this.optionsElement.classList.toggle('position-above', calculatedPosition === Position.ABOVE);
112
- this.optionsElement.classList.toggle('position-below', calculatedPosition === Position.BELOW);
131
+ this.multiselectDropdown.classList.toggle('position-above', calculatedPosition === Position.ABOVE);
132
+ this.multiselectDropdown.classList.toggle('position-below', calculatedPosition === Position.BELOW);
113
133
  }
114
- optionGetter(option) {
115
- if (typeof option != 'string') {
116
- return option.value;
134
+ optionValueGetter(option) {
135
+ if (typeof option === 'string') {
136
+ return option;
137
+ }
138
+ if (Array.isArray(option.value)) {
139
+ return option.value.join(this.delimiterValues);
117
140
  }
118
- return option;
141
+ return option.value;
142
+ }
143
+ optionLabelGetter(option) {
144
+ if (typeof option === 'string') {
145
+ return option;
146
+ }
147
+ if (Array.isArray(option.label)) {
148
+ return option.label.join(this.delimiterLabels);
149
+ }
150
+ return option.label;
119
151
  }
120
152
  getItemLabel(option) {
121
153
  let value;
@@ -126,7 +158,7 @@ export class Multiselect extends FoundationElement {
126
158
  value = option;
127
159
  }
128
160
  else {
129
- value = option.label || option.value || '';
161
+ value = this.optionLabelGetter(option) || this.optionValueGetter(option) || '';
130
162
  }
131
163
  return this.valueFormatter ? this.valueFormatter(value) : value;
132
164
  }
@@ -144,7 +176,7 @@ export class Multiselect extends FoundationElement {
144
176
  break;
145
177
  }
146
178
  case 1: {
147
- const selectedOption = this.options.find((option) => this.optionGetter(option) === this.selectedOptions[0]);
179
+ const selectedOption = this.options.find((option) => this.optionValueGetter(option) === this.selectedOptions[0]);
148
180
  displayText = this.getItemLabel(selectedOption);
149
181
  break;
150
182
  }
@@ -170,17 +202,17 @@ export class Multiselect extends FoundationElement {
170
202
  this.findExactMatchOptions().length === 0);
171
203
  }
172
204
  isOptionSelected(normalizedOption) {
173
- return this.selectedOptions.includes(this.optionGetter(normalizedOption));
205
+ const value = this.optionValueGetter(normalizedOption);
206
+ return this.selectedOptions.includes(value);
174
207
  }
175
208
  selectCheckboxOne(normalizedOption) {
176
- const option = this.optionGetter(normalizedOption);
209
+ const option = this.optionValueGetter(normalizedOption);
177
210
  const isIncluded = this.selectedOptions.includes(option);
178
211
  if (!isIncluded) {
179
212
  this.selectedOptions = [...this.selectedOptions, option];
180
213
  }
181
214
  else {
182
- this.selectedOptions = [...this.selectedOptions];
183
- this.selectedOptions.splice(this.selectedOptions.indexOf(option), 1);
215
+ this.selectedOptions = this.selectedOptions.filter((x) => x !== option);
184
216
  }
185
217
  this.$emit('selectionChange', this.selectedOptions);
186
218
  }
@@ -200,7 +232,7 @@ export class Multiselect extends FoundationElement {
200
232
  ? []
201
233
  : this.options
202
234
  .filter((opt) => !this.isOptionDisabled(opt))
203
- .map((option) => this.optionGetter(option));
235
+ .map((option) => this.optionValueGetter(option));
204
236
  if (this.onAllSelectedCallback) {
205
237
  this.onAllSelectedCallback(!prevAllChecked);
206
238
  }
@@ -223,21 +255,28 @@ export class Multiselect extends FoundationElement {
223
255
  const filterSearchValueLower = this.filterSearchValue.toLowerCase();
224
256
  return this.filteredAvailableOptions.filter((option) => {
225
257
  var _a, _b;
226
- const optionValue = typeof option === 'string' ? option : (_a = option.label) !== null && _a !== void 0 ? _a : option.value;
258
+ const optionValue = typeof option === 'string'
259
+ ? option
260
+ : (_a = this.optionLabelGetter(option)) !== null && _a !== void 0 ? _a : this.optionValueGetter(option);
227
261
  return ((_b = optionValue === null || optionValue === void 0 ? void 0 : optionValue.toLowerCase()) !== null && _b !== void 0 ? _b : '') === filterSearchValueLower;
228
262
  });
229
263
  }
230
264
  setFilter() {
231
- this.filteredAvailableOptions = [
232
- ...this.options.filter((option) => {
233
- var _a;
234
- const optionValue = (typeof option == 'string' ? option : (_a = option.label) !== null && _a !== void 0 ? _a : option.value).toLowerCase();
235
- const searchValue = this.filterSearchValue.toLowerCase();
236
- return this.filterByContains
237
- ? optionValue.indexOf(searchValue) >= 0
238
- : optionValue.startsWith(searchValue);
239
- }),
240
- ];
265
+ const searchValue = this.filterSearchValue.toLowerCase();
266
+ this.filteredAvailableOptions = this.options.filter((option) => {
267
+ const rawLabel = typeof option === 'string' ? option : option.label;
268
+ const rawValue = typeof option === 'string' ? option : option.value;
269
+ const checkMatch = (val) => this.filterByContains
270
+ ? val === null || val === void 0 ? void 0 : val.toLowerCase().includes(searchValue)
271
+ : val === null || val === void 0 ? void 0 : val.toLowerCase().startsWith(searchValue);
272
+ const matchLabel = Array.isArray(rawLabel)
273
+ ? rawLabel.some(checkMatch)
274
+ : rawLabel && checkMatch(rawLabel);
275
+ const matchValue = Array.isArray(rawValue)
276
+ ? rawValue.some((val) => checkMatch(val))
277
+ : rawValue && checkMatch(rawValue);
278
+ return matchLabel || matchValue;
279
+ });
241
280
  }
242
281
  addOption() {
243
282
  this.options = [
@@ -325,6 +364,12 @@ __decorate([
325
364
  __decorate([
326
365
  attr
327
366
  ], Multiselect.prototype, "debounce", void 0);
367
+ __decorate([
368
+ attr
369
+ ], Multiselect.prototype, "delimiterValues", void 0);
370
+ __decorate([
371
+ attr
372
+ ], Multiselect.prototype, "delimiterLabels", void 0);
328
373
  __decorate([
329
374
  attr({ mode: 'boolean', attribute: 'filter-by-contains' })
330
375
  ], Multiselect.prototype, "filterByContains", void 0);
@@ -364,6 +409,9 @@ __decorate([
364
409
  __decorate([
365
410
  observable
366
411
  ], Multiselect.prototype, "onAllSelectedCallback", void 0);
412
+ __decorate([
413
+ observable
414
+ ], Multiselect.prototype, "itemRenderer", void 0);
367
415
  __decorate([
368
416
  volatile
369
417
  ], Multiselect.prototype, "getDisplayValue", null);
@@ -376,5 +424,8 @@ __decorate([
376
424
  __decorate([
377
425
  volatile
378
426
  ], Multiselect.prototype, "showCreatable", null);
427
+ __decorate([
428
+ observable
429
+ ], Multiselect.prototype, "optionsHeaderSlottedNodes", void 0);
379
430
  export const foundationMultiselect = Multiselect.compose(Object.assign({ baseName: 'multiselect', template,
380
431
  styles, shadowOptions: foundationMultiselectShadowOptions }, defaultMultiselectConfig));
@@ -75,25 +75,6 @@ export const multiselectStyles = css `
75
75
  opacity: 30%;
76
76
  }
77
77
 
78
- .options {
79
- display: flex;
80
- flex-direction: column;
81
- position: absolute;
82
- height: max-content;
83
- overflow-y: hidden;
84
- margin-top: calc(var(--design-unit) * 1px);
85
- border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-2);
86
- border-radius: 4px;
87
- background: var(--neutral-fill-input-rest);
88
- width: 100%;
89
- max-height: 0;
90
- visibility: hidden;
91
- transition:
92
- max-height 0.4s ease 0s,
93
- visibility 0.4s ease 0s;
94
- z-index: 999;
95
- }
96
-
97
78
  .position-above {
98
79
  bottom: 100%;
99
80
  }
@@ -118,10 +99,28 @@ export const multiselectStyles = css `
118
99
  background: var(--neutral-layer-4);
119
100
  }
120
101
 
121
- .checkbox-container {
102
+ .multiselect-dropdown {
122
103
  display: flex;
123
104
  flex-direction: column;
105
+ position: absolute;
106
+ height: max-content;
124
107
  overflow-y: scroll;
108
+ margin-top: calc(var(--design-unit) * 1px);
109
+ border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-2);
110
+ border-radius: 4px;
111
+ background: var(--neutral-fill-input-rest);
112
+ width: 100%;
113
+ max-height: 0;
114
+ visibility: hidden;
115
+ transition:
116
+ max-height 0.4s ease 0s,
117
+ visibility 0.4s ease 0s;
118
+ z-index: 999;
119
+ }
120
+
121
+ .checkbox-container {
122
+ display: flex;
123
+ flex-direction: column;
125
124
  list-style: none;
126
125
  }
127
126
 
@@ -184,6 +183,8 @@ export const multiselectStyles = css `
184
183
 
185
184
  .select-all {
186
185
  width: 100%;
186
+ margin-left: 0;
187
+ margin-right: 0;
187
188
  }
188
189
 
189
190
  .display-value {
@@ -194,4 +195,8 @@ export const multiselectStyles = css `
194
195
  line-height: var(--type-ramp-base-line-height);
195
196
  font-family: var(--body-font);
196
197
  }
198
+
199
+ .options-header-item-hidden {
200
+ display: none;
201
+ }
197
202
  `;
@@ -1,5 +1,5 @@
1
- import { sync, whenElse } from '@genesislcap/foundation-utils';
2
- import { html, repeat, ref, when, slotted } from '@microsoft/fast-element';
1
+ import { sync } from '@genesislcap/foundation-utils';
2
+ import { html, ref, repeat, slotted, when } from '@microsoft/fast-element';
3
3
  import { whitespaceFilter } from '@microsoft/fast-foundation';
4
4
  import { classNames } from '@microsoft/fast-web-utilities';
5
5
  import { MultiselectDatasource } from '../options-datasource';
@@ -53,13 +53,7 @@ export const getPrefixedMultiselect = (prefix = 'foundation') => html `
53
53
  ${when((x) => x.loading, html `
54
54
  <${prefix}-progress slot="indicator"></${prefix}-progress>
55
55
  `)}
56
- <ol
57
- ${ref('optionsElement')}
58
- id="checkbox-container"
59
- class="checkbox-container options"
60
- aria-multiselectable="true"
61
- part="options-ol"
62
- >
56
+ <section class="multiselect-dropdown" ${ref('multiselectDropdown')} part="multiselect-dropdown">
63
57
  ${when((x) => x.all, html `
64
58
  <${prefix}-button
65
59
  class="select-all"
@@ -69,35 +63,51 @@ export const getPrefixedMultiselect = (prefix = 'foundation') => html `
69
63
  Select All ${(x) => x.name}
70
64
  </${prefix}-button>
71
65
  `)}
72
- ${repeat((x) => x.filteredAvailableOptions, html `
73
- <li role="option" value=${(x, ctx) => ctx.parent.getItemLabel(x)}>
74
- <${prefix}-checkbox
75
- part="checkbox"
76
- class="checkbox"
77
- @keydown=${(x, c) => c.parent.checkboxKeyDown(x, c.event)}
78
- @click=${(x, c) => c.parent.selectCheckboxOne(x)}
79
- @change=${(x, c) => c.parent.changeHandler(c.event)}
80
- ?current-checked="${(x, c) => c.parent.isOptionSelected(x)}"
81
- ?disabled="${(x, c) => c.parent.isOptionDisabled(x)}"
82
- >
83
- ${whenElse((x) => typeof x === 'string', html `
84
- <span part="option-label">${(x, ctx) => ctx.parent.getItemLabel(x)}</span>
85
- `, html `
86
- <span
87
- data-option-label-text=${(x) => x.optionLabelText}
88
- style=${(x) => x.labelStyle}
89
- part="option-label"
90
- >
91
- ${(x, ctx) => ctx.parent.getItemLabel(x)}
92
- </span>
93
- `)}
94
- </${prefix}-checkbox>
95
- </li>
96
- `)}
66
+ <ol
67
+ id="checkbox-container"
68
+ class="checkbox-container options"
69
+ aria-multiselectable="true"
70
+ part="options-ol"
71
+ >
72
+ <li
73
+ part="options-header-item"
74
+ class=${(x) => {
75
+ var _a;
76
+ return classNames('options-header-item', [
77
+ 'options-header-item-hidden',
78
+ !((_a = x.optionsHeaderSlottedNodes) === null || _a === void 0 ? void 0 : _a.length),
79
+ ]);
80
+ }}
81
+ >
82
+ <slot
83
+ name="options-header"
84
+ ${slotted({
85
+ property: 'optionsHeaderSlottedNodes',
86
+ filter: whitespaceFilter,
87
+ })}
88
+ ></slot>
89
+ </li>
90
+ ${repeat((x) => x.filteredAvailableOptions, html `
91
+ <li role="option" value=${(x, ctx) => ctx.parent.getItemLabel(x)} part="option">
92
+ <${prefix}-checkbox
93
+ part="checkbox"
94
+ class="checkbox"
95
+ exportparts="label:checkbox-label"
96
+ @keydown=${(x, c) => c.parent.checkboxKeyDown(x, c.event)}
97
+ @click=${(x, c) => c.parent.selectCheckboxOne(x)}
98
+ @change=${(x, c) => c.parent.changeHandler(c.event)}
99
+ ?current-checked="${(x, c) => c.parent.isOptionSelected(x)}"
100
+ ?disabled="${(x, c) => c.parent.isOptionDisabled(x)}"
101
+ >
102
+ ${(x, ctx) => { var _a, _b; return (_b = (_a = ctx.parent) === null || _a === void 0 ? void 0 : _a.itemRenderer) === null || _b === void 0 ? void 0 : _b.call(_a, x, ctx.parent); }}
103
+ </${prefix}-checkbox>
104
+ </li>
105
+ `)}
106
+ </ol>
97
107
  ${when((x) => x.showCreatable, html `
98
108
  <${prefix}-button @click=${(x) => x.addOption()}>Create&nbsp;"${(x) => x.filterSearchValue}"</${prefix}-button>
99
109
  `)}
100
- </ol>
110
+ </section>
101
111
  </div>
102
112
  <slot
103
113
  ${slotted({
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.273.0",
4
+ "version": "14.274.1",
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.273.0",
87
- "@genesislcap/genx": "14.273.0",
88
- "@genesislcap/rollup-builder": "14.273.0",
89
- "@genesislcap/ts-builder": "14.273.0",
90
- "@genesislcap/uvu-playwright-builder": "14.273.0",
91
- "@genesislcap/vite-builder": "14.273.0",
92
- "@genesislcap/webpack-builder": "14.273.0",
86
+ "@genesislcap/foundation-testing": "14.274.1",
87
+ "@genesislcap/genx": "14.274.1",
88
+ "@genesislcap/rollup-builder": "14.274.1",
89
+ "@genesislcap/ts-builder": "14.274.1",
90
+ "@genesislcap/uvu-playwright-builder": "14.274.1",
91
+ "@genesislcap/vite-builder": "14.274.1",
92
+ "@genesislcap/webpack-builder": "14.274.1",
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.273.0",
104
- "@genesislcap/foundation-comms": "14.273.0",
105
- "@genesislcap/foundation-criteria": "14.273.0",
106
- "@genesislcap/foundation-errors": "14.273.0",
107
- "@genesislcap/foundation-events": "14.273.0",
108
- "@genesislcap/foundation-logger": "14.273.0",
109
- "@genesislcap/foundation-notifications": "14.273.0",
110
- "@genesislcap/foundation-user": "14.273.0",
111
- "@genesislcap/foundation-utils": "14.273.0",
103
+ "@genesislcap/expression-builder": "14.274.1",
104
+ "@genesislcap/foundation-comms": "14.274.1",
105
+ "@genesislcap/foundation-criteria": "14.274.1",
106
+ "@genesislcap/foundation-errors": "14.274.1",
107
+ "@genesislcap/foundation-events": "14.274.1",
108
+ "@genesislcap/foundation-logger": "14.274.1",
109
+ "@genesislcap/foundation-notifications": "14.274.1",
110
+ "@genesislcap/foundation-user": "14.274.1",
111
+ "@genesislcap/foundation-utils": "14.274.1",
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": "06838df20d39cb79d0f9ab27c3ca2a9654441a66"
133
+ "gitHead": "a4925dc9d6c9da09f282cc5255ade13937cba2cd"
134
134
  }